updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / tractionedge / tractionedge0.1_sfmlgit.patch_r2
blobab77ddfa60fd4f0a10ee1b75e19e7a569072da65
1 diff -Naur tractionedge-v0.1/AnimManager.h tractionedge-v0.1_mod/AnimManager.h
2 --- tractionedge-v0.1/AnimManager.h     2010-02-05 10:41:05.000000000 +0000
3 +++ tractionedge-v0.1_mod/AnimManager.h 2011-07-09 19:53:33.000000000 +0100
4 @@ -12,7 +12,7 @@
5  
6  #include "Item.h"
7  #include "Position.h"
8 -#include <vector>
9 +#include <deque>
10  #include "DisplayManager.h"
12  class AnimManager: public Item{
13 diff -Naur tractionedge-v0.1/GfxSFML.cpp tractionedge-v0.1_mod/GfxSFML.cpp
14 --- tractionedge-v0.1/GfxSFML.cpp       2010-08-21 12:16:44.000000000 +0100
15 +++ tractionedge-v0.1_mod/GfxSFML.cpp   2011-07-09 19:53:33.000000000 +0100
16 @@ -13,6 +13,7 @@
17  #include "Terrain.h"
18  #include "DisplayManager.h"
19  #include "GameWorld.h"
20 +#include <SFML/Window.hpp>
22  #include "defines.h"
24 @@ -20,7 +21,7 @@
25  {
26         //create window
27         m_mainWindow.Create(sf::VideoMode(SCREENWIDTH, SCREENHEIGHT, 32), "Traction Edge");
28 -       m_mainWindow.UseVerticalSync(true); 
29 +       m_mainWindow.EnableVerticalSync(true); 
30         m_mainWindow.EnableKeyRepeat(true);
31         
32         //create lookup table for colors
33 @@ -48,11 +49,11 @@
34         sf::Font mediumFont;
35         sf::Font largeFont;
36         
37 -       titleFont.LoadFromFile("fonts/Vtks Revolt.ttf", 60);
38 -       tinyFont.LoadFromFile("fonts/LiberationMono-Regular.ttf",FONTSIZETINY);
39 -       smallFont.LoadFromFile("fonts/LiberationMono-Regular.ttf",FONTSIZESMALL);
40 -       mediumFont.LoadFromFile("fonts/LiberationMono-Regular.ttf",FONTSIZEMEDIUM);
41 -       largeFont.LoadFromFile("fonts/LiberationMono-Regular.ttf",FONTSIZELARGE);
42 +       titleFont.LoadFromFile("fonts/Vtks Revolt.ttf"/*, 60*/);
43 +       tinyFont.LoadFromFile("fonts/LiberationMono-Regular.ttf"/*,FONTSIZETINY*/);
44 +       smallFont.LoadFromFile("fonts/LiberationMono-Regular.ttf"/*,FONTSIZESMALL*/);
45 +       mediumFont.LoadFromFile("fonts/LiberationMono-Regular.ttf"/*,FONTSIZEMEDIUM*/);
46 +       largeFont.LoadFromFile("fonts/LiberationMono-Regular.ttf"/*,FONTSIZELARGE*/);
49         //create lookup table of fonts
50 @@ -63,9 +64,9 @@
51         fontLookupMap[BODYLARGE]=largeFont;
52         
53         //create lookup table of font styles
54 -       styleLookupMap[REGULAR]=sf::String::Regular;
55 -       styleLookupMap[BOLD]=sf::String::Bold;
56 -       styleLookupMap[ITALIC]=sf::String::Italic;
57 +       styleLookupMap[REGULAR]=sf::Text::Regular;
58 +       styleLookupMap[BOLD]=sf::Text::Bold;
59 +       styleLookupMap[ITALIC]=sf::Text::Italic;
60         
61         //create lookup table of color shapes
62         for (int i=0;i < 15;i++){
63 @@ -97,7 +98,8 @@
64         tileImages.resize(0);
65         for (int y=0; y<MASTERTILEIMAGEHEIGHT/TILEHEIGHT;y++){
66                 for (int x=0; x<MASTERTILEIMAGEWIDTH/TILEWIDTH; x++) {
67 -                       sf::Image image(TILEWIDTH,TILEHEIGHT,colorLookup[0]);
68 +                       sf::Image image;
69 +                       image.Create(TILEWIDTH,TILEHEIGHT,colorLookup[0]);
70                         sf::IntRect rect(x*TILEWIDTH,y*TILEHEIGHT,x*TILEWIDTH+TILEWIDTH,y*TILEHEIGHT+TILEHEIGHT);
71                         image.Copy(masterImage,0,0,rect,false);
72                         switch (tileImages.size()) {
73 @@ -214,12 +216,12 @@
74  void GfxEngine::renderStrings(std::vector<std::string>& strings, std::vector<int>& colors, std::vector<font_t>& fonts, std::vector<fontStyle_t>& styles, std::vector<int>& sizes, std::vector<Position>& positions)
75  {
76         for (int i=0;i < strings.size();i++){
77 -               sf::String text;
78 -               text.SetText(strings[i]);
79 +               sf::Text text;
80 +               text.SetString(strings[i]);
81                 text.SetPosition(positions[i].x,positions[i].y);
82                 text.SetColor(colorLookup[colors[i]]);
83                 text.SetFont(fontLookupMap[fonts[i]]);
84 -        text.SetSize(sizes[i]);
85 +        text.SetCharacterSize(sizes[i]);
86             text.SetStyle(styleLookupMap[styles[i]]);
87                 m_mainWindow.Draw(text);
88         }
89 @@ -229,7 +231,7 @@
90  void GfxEngine::renderFrame(int x1, int y1, int x2, int y2)
91  {
92         sf::Shape rect = sf::Shape::Rectangle(x1, y1, x2, y2, colorLookup[COLORBROWN],true,colorLookup[COLORBROWN]);
93 -       rect.SetOutlineWidth(1);
94 +       rect.SetOutlineThickness(1);
95         rect.EnableFill(false);
96         m_mainWindow.Draw(rect);
97  }
98 @@ -253,7 +255,7 @@
99  {
100         //create window
101         m_mainWindow.Create(sf::VideoMode(SCREENWIDTH, SCREENHEIGHT, 32), "Traction Edge");
102 -       m_mainWindow.UseVerticalSync(true); 
103 +       m_mainWindow.EnableVerticalSync(true); 
104         m_mainWindow.EnableKeyRepeat(true);
105  }      
106         
107 @@ -268,7 +270,7 @@
109         //fetch events and send only keypresses back
110         sf::Event Event;
111 -       while (m_mainWindow.GetEvent(Event))
112 +       while (m_mainWindow.PollEvent(Event))
113          {
114                 //close and exit
115                 if (Event.Type == sf::Event::Closed)
116 @@ -277,62 +279,62 @@
117                 if (Event.Type == sf::Event::KeyPressed)
118                  {
119                         //Escape key : exit
120 -                       if (Event.Key.Code == sf::Key::Space)
121 +                       if (Event.Key.Code == sf::Keyboard::Space)
122                                 return (KEY_SPACE);
123 -                       if (Event.Key.Code == sf::Key::Escape)
124 +                       if (Event.Key.Code == sf::Keyboard::Escape)
125                                 return (KEY_ESCAPE);
126 -                       if (Event.Key.Code == sf::Key::Return)
127 +                       if (Event.Key.Code == sf::Keyboard::Return)
128                                 return (KEY_RETURN);
129 -                       if (Event.Key.Code == sf::Key::Right || Event.Key.Code == sf::Key::Numpad6)
130 +                       if (Event.Key.Code == sf::Keyboard::Right || Event.Key.Code == sf::Keyboard::Numpad6)
131                                 return (KEY_RIGHT);
132 -                       if (Event.Key.Code == sf::Key::Left || Event.Key.Code == sf::Key::Numpad4)
133 +                       if (Event.Key.Code == sf::Keyboard::Left || Event.Key.Code == sf::Keyboard::Numpad4)
134                                 return (KEY_LEFT);
135 -                       if (Event.Key.Code == sf::Key::Up || Event.Key.Code == sf::Key::Numpad8)
136 +                       if (Event.Key.Code == sf::Keyboard::Up || Event.Key.Code == sf::Keyboard::Numpad8)
137                                 return (KEY_UP);
138 -                       if (Event.Key.Code == sf::Key::Down || Event.Key.Code == sf::Key::Numpad2)
139 +                       if (Event.Key.Code == sf::Keyboard::Down || Event.Key.Code == sf::Keyboard::Numpad2)
140                                 return (KEY_DOWN);
141 -                       if (Event.Key.Code == sf::Key::Numpad9)
142 +                       if (Event.Key.Code == sf::Keyboard::Numpad9)
143                                 return (KEY_UP_RIGHT);
144 -                       if (Event.Key.Code == sf::Key::Numpad7)
145 +                       if (Event.Key.Code == sf::Keyboard::Numpad7)
146                                 return (KEY_UP_LEFT);
147 -                       if (Event.Key.Code == sf::Key::Numpad3)
148 +                       if (Event.Key.Code == sf::Keyboard::Numpad3)
149                                 return (KEY_DOWN_RIGHT);
150 -                       if (Event.Key.Code == sf::Key::Numpad1)
151 +                       if (Event.Key.Code == sf::Keyboard::Numpad1)
152                                 return (KEY_DOWN_LEFT);
153                         
154 -                       if (Event.Key.Code == sf::Key::Tab)
155 +                       if (Event.Key.Code == sf::Keyboard::Tab)
156                                 return (KEY_TAB);
157 -                       if (Event.Key.Code == sf::Key::T)
158 +                       if (Event.Key.Code == sf::Keyboard::T)
159                                 return (ACTION_TARGET);
160 -                       if (Event.Key.Code == sf::Key::R)
161 +                       if (Event.Key.Code == sf::Keyboard::R)
162                                 return (KEY_R);
163 -                       if (Event.Key.Code == sf::Key::A)
164 +                       if (Event.Key.Code == sf::Keyboard::A)
165                                 return (KEY_A);
166 -                       if (Event.Key.Code == sf::Key::A)
167 +                       if (Event.Key.Code == sf::Keyboard::A)
168                                 return (KEY_A);
169 -                       if (Event.Key.Code == sf::Key::B)
170 +                       if (Event.Key.Code == sf::Keyboard::B)
171                                 return (KEY_B);
172 -                       if (Event.Key.Code == sf::Key::C)
173 +                       if (Event.Key.Code == sf::Keyboard::C)
174                                 return (KEY_C);
175 -                       if (Event.Key.Code == sf::Key::D)
176 +                       if (Event.Key.Code == sf::Keyboard::D)
177                                 return (KEY_D);
178 -                       if (Event.Key.Code == sf::Key::E)
179 +                       if (Event.Key.Code == sf::Keyboard::E)
180                                 return (KEY_E);
181 -                       if (Event.Key.Code == sf::Key::F)
182 +                       if (Event.Key.Code == sf::Keyboard::F)
183                                 return (KEY_F);
184 -                       if (Event.Key.Code == sf::Key::G)
185 +                       if (Event.Key.Code == sf::Keyboard::G)
186                                 return (KEY_G);
187 -                       if (Event.Key.Code == sf::Key::I)
188 +                       if (Event.Key.Code == sf::Keyboard::I)
189                                 return (KEY_I);
190 -                       if (Event.Key.Code == sf::Key::H)
191 +                       if (Event.Key.Code == sf::Keyboard::H)
192                                 return (KEY_H);
193 -                       if (Event.Key.Code == sf::Key::N)
194 +                       if (Event.Key.Code == sf::Keyboard::N)
195                                 return (KEY_N);
196 -                       if (Event.Key.Code == sf::Key::P)
197 +                       if (Event.Key.Code == sf::Keyboard::P)
198                                 return (KEY_P);
199 -                       if (Event.Key.Code == sf::Key::S)
200 +                       if (Event.Key.Code == sf::Keyboard::S)
201                                 return (KEY_S);
202 -                       if (Event.Key.Code == sf::Key::W)
203 +                       if (Event.Key.Code == sf::Keyboard::W)
204                                 return (KEY_W);
205                  }
206          }
207 diff -Naur tractionedge-v0.1/GfxSFML.h tractionedge-v0.1_mod/GfxSFML.h
208 --- tractionedge-v0.1/GfxSFML.h 2010-04-24 13:22:15.000000000 +0100
209 +++ tractionedge-v0.1_mod/GfxSFML.h     2011-07-09 19:53:33.000000000 +0100
210 @@ -29,7 +29,7 @@
211      std::map<char, sf::String> tileLookupMap;
212         std::map<int, sf::Shape> colorShapeMap;
213         std::map<font_t, sf::Font> fontLookupMap;
214 -       std::map<fontStyle_t, sf::String::Style> styleLookupMap;
215 +       std::map<fontStyle_t, sf::Text::Style> styleLookupMap;
216         
217         std::vector<sf::Image> tileImages;
218      std::vector<std::vector<sf::Sprite> > mapSprites;
219 diff -Naur tractionedge-v0.1/Utility.cpp tractionedge-v0.1_mod/Utility.cpp
220 --- tractionedge-v0.1/Utility.cpp       2010-07-01 10:31:35.000000000 +0100
221 +++ tractionedge-v0.1_mod/Utility.cpp   2011-07-09 19:53:33.000000000 +0100
222 @@ -10,6 +10,7 @@
223  #include "GameWorld.h"
224  #include "Position.h"
225  #include "Utility.h"
226 +#include <queue>
228  std::string Utility::wrap(std::string str, int width)