| 1 | These patches are required to build with a modern GCC; most of them
|
| 2 | are taken from the Debian package. Upstream has disappeared.
|
| 3 |
|
| 4 | diff -r -u einstein-2.0.orig/convert.h einstein-2.0/convert.h
|
| 5 | |
| 6 | |
| 7 | @@ -5,6 +5,7 @@
|
| 8 | #include <iostream>
|
| 9 | #include <sstream>
|
| 10 | #include <string>
|
| 11 | +#include <typeinfo>
|
| 12 |
|
| 13 | #include "exceptions.h"
|
| 14 | #include "unicode.h"
|
| 15 | diff -r -u einstein-2.0.orig/descr.cpp einstein-2.0/descr.cpp
|
| 16 | |
| 17 | |
| 18 | @@ -139,9 +139,9 @@
|
| 19 | {
|
| 20 | currentPage = 0;
|
| 21 | //area.add(parentArea, false);
|
| 22 | - titleFont = new Font(L"nova.ttf", 26);
|
| 23 | - buttonFont = new Font(L"laudcn2.ttf", 14);
|
| 24 | - textFont = new Font(L"laudcn2.ttf", 16);
|
| 25 | + titleFont = new Font(L"DejaVuSans.ttf", 26);
|
| 26 | + buttonFont = new Font(L"DejaVuSans.ttf", 14);
|
| 27 | + textFont = new Font(L"DejaVuSans.ttf", 16);
|
| 28 | textHeight = (int)(textFont->getHeight(L"A") * 1.0);
|
| 29 | text = new TextParser(msg(L"rulesText"), *textFont, START_X, START_Y,
|
| 30 | CLIENT_WIDTH, CLIENT_HEIGHT);
|
| 31 | diff -r -u einstein-2.0.orig/font.h einstein-2.0/font.h
|
| 32 | |
| 33 | |
| 34 | @@ -3,7 +3,7 @@
|
| 35 |
|
| 36 |
|
| 37 | #include <string>
|
| 38 | -#include <SDL_ttf.h>
|
| 39 | +#include <SDL/SDL_ttf.h>
|
| 40 |
|
| 41 |
|
| 42 | class Font
|
| 43 | diff -r -u einstein-2.0.orig/formatter.cpp einstein-2.0/formatter.cpp
|
| 44 | |
| 45 | |
| 46 | @@ -58,7 +58,7 @@
|
| 47 | if ((c.type == INT_ARG) || (c.type == STRING_ARG) ||
|
| 48 | (c.type == FLOAT_ARG) || (c.type == DOUBLE_ARG))
|
| 49 | {
|
| 50 | - int no = (int)c.data;
|
| 51 | + long no = (long)c.data;
|
| 52 | args[no - 1] = c.type;
|
| 53 | }
|
| 54 | }
|
| 55 | @@ -123,7 +123,7 @@
|
| 56 | std::wstring Formatter::format(std::vector<ArgValue*> &argValues) const
|
| 57 | {
|
| 58 | std::wstring s;
|
| 59 | - int no;
|
| 60 | + long no;
|
| 61 |
|
| 62 | for (int i = 0; i < commandsCnt; i++) {
|
| 63 | Command *cmd = &commands[i];
|
| 64 | @@ -135,8 +135,8 @@
|
| 65 |
|
| 66 | case STRING_ARG:
|
| 67 | case INT_ARG:
|
| 68 | - no = (int)cmd->data - 1;
|
| 69 | - if (no < (int)argValues.size())
|
| 70 | + no = (long)cmd->data - 1;
|
| 71 | + if (no < (long)argValues.size())
|
| 72 | s += argValues[no]->format(cmd);
|
| 73 | break;
|
| 74 |
|
| 75 | diff -r -u einstein-2.0.orig/game.cpp einstein-2.0/game.cpp
|
| 76 | |
| 77 | |
| 78 | @@ -33,7 +33,7 @@
|
| 79 | screen.draw(8, 10, tile);
|
| 80 | SDL_FreeSurface(tile);
|
| 81 |
|
| 82 | - Font titleFont(L"nova.ttf", 28);
|
| 83 | + Font titleFont(L"DejaVuSans.ttf", 28);
|
| 84 | titleFont.draw(screen.getSurface(), 20, 20, 255,255,0, true,
|
| 85 | msg(L"einsteinPuzzle"));
|
| 86 |
|
| 87 | @@ -89,7 +89,7 @@
|
| 88 | {
|
| 89 | lastRun = elapsed = lastUpdate = 0;
|
| 90 | stop();
|
| 91 | - font = new Font(L"luximb.ttf", 16);
|
| 92 | + font = new Font(L"DejaVuSans.ttf", 16);
|
| 93 | }
|
| 94 |
|
| 95 | Watch::Watch(std::istream &stream)
|
| 96 | @@ -97,7 +97,7 @@
|
| 97 | elapsed = readInt(stream);
|
| 98 | lastUpdate = 0;
|
| 99 | stop();
|
| 100 | - font = new Font(L"luximb.ttf", 16);
|
| 101 | + font = new Font(L"DejaVuSans.ttf", 16);
|
| 102 | }
|
| 103 |
|
| 104 | Watch::~Watch()
|
| 105 | @@ -178,7 +178,7 @@
|
| 106 | watch->stop();
|
| 107 | Area area;
|
| 108 | area.add(background, false);
|
| 109 | - Font font(L"laudcn2.ttf", 16);
|
| 110 | + Font font(L"DejaVuSans.ttf", 16);
|
| 111 | area.add(new Window(280, 275, 240, 50, L"greenpattern.bmp", 6));
|
| 112 | area.add(new Label(&font, 280, 275, 240, 50, Label::ALIGN_CENTER,
|
| 113 | Label::ALIGN_MIDDLE, 255,255,0, msg(L"paused")));
|
| 114 | @@ -209,7 +209,7 @@
|
| 115 | virtual void doAction() {
|
| 116 | sound->play(L"applause.wav");
|
| 117 | watch->stop();
|
| 118 | - Font font(L"laudcn2.ttf", 20);
|
| 119 | + Font font(L"DejaVuSans.ttf", 20);
|
| 120 | showMessageWindow(gameArea, L"marble1.bmp",
|
| 121 | 500, 70, &font, 255,0,0, msg(L"won"));
|
| 122 | gameArea->draw();
|
| 123 | @@ -257,8 +257,8 @@
|
| 124 | sound->play(L"glasbk2.wav");
|
| 125 | bool restart = false;
|
| 126 | bool newGame = false;
|
| 127 | - Font font(L"laudcn2.ttf", 24);
|
| 128 | - Font btnFont(L"laudcn2.ttf", 14);
|
| 129 | + Font font(L"DejaVuSans.ttf", 24);
|
| 130 | + Font btnFont(L"DejaVuSans.ttf", 14);
|
| 131 | Area area;
|
| 132 | area.add(gameArea);
|
| 133 | area.add(new Window(220, 240, 360, 140, L"redpattern.bmp", 6));
|
| 134 | @@ -329,7 +329,7 @@
|
| 135 | CheatCommand(Area *a) { gameArea = a; };
|
| 136 |
|
| 137 | virtual void doAction() {
|
| 138 | - Font font(L"nova.ttf", 30);
|
| 139 | + Font font(L"DejaVuSans.ttf", 30);
|
| 140 | showMessageWindow(gameArea, L"darkpattern.bmp",
|
| 141 | 500, 100, &font, 255,255,255,
|
| 142 | msg(L"iddqd"));
|
| 143 | @@ -475,7 +475,7 @@
|
| 144 | drawWallpaper(L"rain.bmp");
|
| 145 | Window window(230, 260, 340, 80, L"greenpattern.bmp", 6);
|
| 146 | window.draw();
|
| 147 | - Font font(L"laudcn2.ttf", 16);
|
| 148 | + Font font(L"DejaVuSans.ttf", 16);
|
| 149 | Label label(&font, 280, 275, 240, 50, Label::ALIGN_CENTER,
|
| 150 | Label::ALIGN_MIDDLE, 255,255,0, msg(L"loading"));
|
| 151 | label.draw();
|
| 152 | @@ -533,7 +533,7 @@
|
| 153 | void Game::run()
|
| 154 | {
|
| 155 | Area area;
|
| 156 | - Font btnFont(L"laudcn2.ttf", 14);
|
| 157 | + Font btnFont(L"DejaVuSans.ttf", 14);
|
| 158 |
|
| 159 | area.setTimer(300, watch);
|
| 160 |
|
| 161 | diff -r -u einstein-2.0.orig/main.cpp einstein-2.0/main.cpp
|
| 162 | |
| 163 | |
| 164 | @@ -2,7 +2,7 @@
|
| 165 | #include <iostream>
|
| 166 | #include <SDL.h>
|
| 167 | #include <SDL_main.h>
|
| 168 | -#include <SDL_ttf.h>
|
| 169 | +#include <SDL/SDL_ttf.h>
|
| 170 | #include "main.h"
|
| 171 | #include "utils.h"
|
| 172 | #include "storage.h"
|
| 173 | @@ -78,7 +78,7 @@
|
| 174 | /*static void checkBetaExpire()
|
| 175 | {
|
| 176 | if (1124832535L + 60L*60L*24L*40L < time(NULL)) {
|
| 177 | - Font font(L"laudcn2.ttf", 16);
|
| 178 | + Font font(L"DejaVuSans.ttf", 16);
|
| 179 | Area area;
|
| 180 | showMessageWindow(&area, L"darkpattern.bmp",
|
| 181 | 700, 100, &font, 255,255,255,
|
| 182 | diff -r -u einstein-2.0.orig/Makefile einstein-2.0/Makefile
|
| 183 | |
| 184 | |
| 185 | @@ -49,10 +49,14 @@
|
| 186 |
|
| 187 |
|
| 188 | $(TARGET): $(OBJECTS)
|
| 189 | + cd mkres && make
|
| 190 | + cd res && ../mkres/mkres --source resources.descr --output ../einstein.res
|
| 191 | $(CXX) $(LNFLAGS) $(OBJECTS) -o $(TARGET)
|
| 192 |
|
| 193 | clean:
|
| 194 | rm -f $(OBJECTS) core* *core $(TARGET) *~
|
| 195 | + cd res && rm -f einstein.res
|
| 196 | + cd mkres && make clean
|
| 197 |
|
| 198 | depend:
|
| 199 | @makedepend $(SOURCES) 2> /dev/null
|
| 200 | diff -r -u einstein-2.0.orig/menu.cpp einstein-2.0/menu.cpp
|
| 201 | |
| 202 | |
| 203 | @@ -23,11 +23,11 @@
|
| 204 | SDL_Surface *title = loadImage(L"nova.bmp");
|
| 205 | screen.draw(0, 0, title);
|
| 206 | SDL_FreeSurface(title);
|
| 207 | - Font font(L"nova.ttf", 28);
|
| 208 | + Font font(L"DejaVuSans.ttf", 28);
|
| 209 | std::wstring s(msg(L"einsteinFlowix"));
|
| 210 | int width = font.getWidth(s);
|
| 211 | font.draw((screen.getWidth() - width) / 2, 30, 255,255,255, true, s);
|
| 212 | - Font urlFont(L"luximb.ttf", 16);
|
| 213 | + Font urlFont(L"DejaVuSans.ttf", 16);
|
| 214 | s = L"http://games.flowix.com";
|
| 215 | width = urlFont.getWidth(s);
|
| 216 | urlFont.draw((screen.getWidth() - width) / 2, 60, 255,255,0, true, s);
|
| 217 | @@ -133,9 +133,9 @@
|
| 218 |
|
| 219 | virtual void doAction() {
|
| 220 | Area area;
|
| 221 | - Font titleFont(L"nova.ttf", 26);
|
| 222 | - Font font(L"laudcn2.ttf", 14);
|
| 223 | - Font urlFont(L"luximb.ttf", 16);
|
| 224 | + Font titleFont(L"DejaVuSans.ttf", 26);
|
| 225 | + Font font(L"DejaVuSans.ttf", 14);
|
| 226 | + Font urlFont(L"DejaVuSans.ttf", 16);
|
| 227 |
|
| 228 | #define LABEL(pos, c, f, text) area.add(new Label(&f, 220, pos, 360, 20, \
|
| 229 | Label::ALIGN_CENTER, Label::ALIGN_MIDDLE, 255,255,c, text));
|
| 230 | @@ -171,7 +171,7 @@
|
| 231 | void menu()
|
| 232 | {
|
| 233 | Area area;
|
| 234 | - Font font(L"laudcn2.ttf", 20);
|
| 235 | + Font font(L"DejaVuSans.ttf", 20);
|
| 236 |
|
| 237 | area.add(new MenuBackground());
|
| 238 | area.draw();
|
| 239 | diff -r -u einstein-2.0.orig/mkres/compressor.cpp einstein-2.0/mkres/compressor.cpp
|
| 240 | |
| 241 | |
| 242 | @@ -2,6 +2,7 @@
|
| 243 | #include <zlib.h>
|
| 244 | #include "convert.h"
|
| 245 | #include "exceptions.h"
|
| 246 | +#include "string.h"
|
| 247 |
|
| 248 |
|
| 249 | ResourceCompressor::ResourceCompressor()
|
| 250 | diff -r -u einstein-2.0.orig/mkres/convert.h einstein-2.0/mkres/convert.h
|
| 251 | |
| 252 | |
| 253 | @@ -5,6 +5,7 @@
|
| 254 | #include <iostream>
|
| 255 | #include <sstream>
|
| 256 | #include <string>
|
| 257 | +#include <typeinfo>
|
| 258 |
|
| 259 | #include "exceptions.h"
|
| 260 | #include "unicode.h"
|
| 261 | diff -r -u einstein-2.0.orig/mkres/main.cpp einstein-2.0/mkres/main.cpp
|
| 262 | |
| 263 | |
| 264 | @@ -1,5 +1,6 @@
|
| 265 | #include "compressor.h"
|
| 266 | #include "exceptions.h"
|
| 267 | +#include "string.h"
|
| 268 | #include "unicode.h"
|
| 269 | #include "table.h"
|
| 270 |
|
| 271 | diff -r -u einstein-2.0.orig/mkres/unicode.cpp einstein-2.0/mkres/unicode.cpp
|
| 272 | |
| 273 | |
| 274 | @@ -5,6 +5,7 @@
|
| 275 | #endif
|
| 276 | #include "unicode.h"
|
| 277 | #include "exceptions.h"
|
| 278 | +#include "string.h"
|
| 279 |
|
| 280 |
|
| 281 | /// Returns length of wide character in utf-8
|
| 282 | diff -r -u einstein-2.0.orig/opensave.cpp einstein-2.0/opensave.cpp
|
| 283 | |
| 284 | |
| 285 | @@ -160,7 +160,7 @@
|
| 286 | static void showListWindow(SavesList &list, Command **commands,
|
| 287 | const std::wstring &title, Area &area, Font *font)
|
| 288 | {
|
| 289 | - Font titleFont(L"nova.ttf", 26);
|
| 290 | + Font titleFont(L"DejaVuSans.ttf", 26);
|
| 291 |
|
| 292 | area.add(new Window(250, 90, 300, 420, L"blue.bmp"));
|
| 293 | area.add(new Label(&titleFont, 250, 95, 300, 40, Label::ALIGN_CENTER,
|
| 294 | @@ -189,7 +189,7 @@
|
| 295 |
|
| 296 | Area area;
|
| 297 | area.add(parentArea, false);
|
| 298 | - Font font(L"laudcn2.ttf", 14);
|
| 299 | + Font font(L"DejaVuSans.ttf", 14);
|
| 300 | bool saved = false;
|
| 301 |
|
| 302 | SavesList list;
|
| 303 | @@ -258,7 +258,7 @@
|
| 304 |
|
| 305 | Area area;
|
| 306 | area.add(parentArea, false);
|
| 307 | - Font font(L"laudcn2.ttf", 14);
|
| 308 | + Font font(L"DejaVuSans.ttf", 14);
|
| 309 |
|
| 310 | Game *newGame = NULL;
|
| 311 |
|
| 312 | diff -r -u einstein-2.0.orig/options.cpp einstein-2.0/options.cpp
|
| 313 | |
| 314 | |
| 315 | @@ -53,8 +53,8 @@
|
| 316 |
|
| 317 | void showOptionsWindow(Area *parentArea)
|
| 318 | {
|
| 319 | - Font titleFont(L"nova.ttf", 26);
|
| 320 | - Font font(L"laudcn2.ttf", 14);
|
| 321 | + Font titleFont(L"DejaVuSans.ttf", 26);
|
| 322 | + Font font(L"DejaVuSans.ttf", 14);
|
| 323 |
|
| 324 | bool fullscreen = (getStorage()->get(L"fullscreen", 1) != 0);
|
| 325 | bool niceCursor = (getStorage()->get(L"niceCursor", 1) != 0);
|
| 326 | diff -r -u einstein-2.0.orig/res/resources.descr einstein-2.0/res/resources.descr
|
| 327 | |
| 328 | |
| 329 | @@ -89,13 +89,11 @@
|
| 330 | { name = "title.bmp" }
|
| 331 | { name = "marble1.bmp" }
|
| 332 | { name = "blue.bmp" }
|
| 333 | - { name = "luximb.ttf" }
|
| 334 | { name = "redpattern.bmp" }
|
| 335 | { name = "greenpattern.bmp" }
|
| 336 | { name = "darkpattern.bmp" }
|
| 337 | { name = "nova.bmp" }
|
| 338 | - { name = "nova.ttf" }
|
| 339 | - { name = "laudcn2.ttf" }
|
| 340 | + { name = "DejaVuSans.ttf" }
|
| 341 | { name = "btn.bmp" }
|
| 342 | { name = "rules.txt", format = "messages" group = "messages" }
|
| 343 | { name = "rules_ru.txt", format = "messages" group = "messages" }
|
| 344 | Only in einstein-2.0/res: resources.descr.orig
|
| 345 | diff -r -u einstein-2.0.orig/sound.h einstein-2.0/sound.h
|
| 346 | |
| 347 | |
| 348 | @@ -4,7 +4,7 @@
|
| 349 |
|
| 350 | #include <string>
|
| 351 | #include <map>
|
| 352 | -#include <SDL_mixer.h>
|
| 353 | +#include <SDL/SDL_mixer.h>
|
| 354 |
|
| 355 |
|
| 356 | class Sound
|
| 357 | diff -r -u einstein-2.0.orig/topscores.cpp einstein-2.0/topscores.cpp
|
| 358 | |
| 359 | |
| 360 | @@ -103,9 +103,9 @@
|
| 361 | ScoresWindow::ScoresWindow(int x, int y, TopScores *scores, int highlight):
|
| 362 | Window(x, y, 320, 350, L"blue.bmp")
|
| 363 | {
|
| 364 | - Font titleFont(L"nova.ttf", 26);
|
| 365 | - Font entryFont(L"laudcn2.ttf", 14);
|
| 366 | - Font timeFont(L"luximb.ttf", 14);
|
| 367 | + Font titleFont(L"DejaVuSans.ttf", 26);
|
| 368 | + Font entryFont(L"DejaVuSans.ttf", 14);
|
| 369 | + Font timeFont(L"DejaVuSans.ttf", 14);
|
| 370 |
|
| 371 | std::wstring txt = msg(L"topScores");
|
| 372 | int w = titleFont.getWidth(txt);
|
| 373 | @@ -139,7 +139,7 @@
|
| 374 | {
|
| 375 | Area area;
|
| 376 |
|
| 377 | - Font font(L"laudcn2.ttf", 16);
|
| 378 | + Font font(L"DejaVuSans.ttf", 16);
|
| 379 | area.add(parentArea);
|
| 380 | area.add(new ScoresWindow(240, 125, scores, highlight));
|
| 381 | ExitCommand exitCmd(area);
|
| 382 | @@ -154,7 +154,7 @@
|
| 383 | {
|
| 384 | Area area;
|
| 385 |
|
| 386 | - Font font(L"laudcn2.ttf", 16);
|
| 387 | + Font font(L"DejaVuSans.ttf", 16);
|
| 388 | area.add(parentArea);
|
| 389 | area.add(new Window(170, 280, 460, 100, L"blue.bmp"));
|
| 390 | Storage *storage = getStorage();
|
| 391 | diff -r -u einstein-2.0.orig/unicode.cpp einstein-2.0/unicode.cpp
|
| 392 | |
| 393 | |
| 394 | @@ -5,6 +5,7 @@
|
| 395 | #endif
|
| 396 | #include "unicode.h"
|
| 397 | #include "exceptions.h"
|
| 398 | +#include "string.h"
|
| 399 |
|
| 400 |
|
| 401 | /// Returns length of wide character in utf-8
|