hunk ./SDL_gfxPrimitivesDirty.cc 1815 - static bool donePrecalc = false; + static double precalcedGamma = -1; hunk ./SDL_gfxPrimitivesDirty.cc 1817 - if (!donePrecalc) + if (precalcedGamma != antialiasGamma) hunk ./SDL_gfxPrimitivesDirty.cc 1826 - donePrecalc = true; + precalcedGamma = antialiasGamma; hunk ./Makefile.am 3 - geom.cc gfx.cc invaders.cc main.cc node.cc player.cc\ + geom.cc gfx.cc invaders.cc main.cc menu.cc node.cc player.cc\ hunk ./Makefile.am 6 - gfx.h invaders.h node.h player.h random.h settings.h shot.h\ + gfx.h invaders.h menu.h node.h player.h random.h settings.h shot.h\ hunk ./main.cc 28 +#include hunk ./main.cc 44 +#include "menu.h" hunk ./main.cc 53 +void checkMusic(); hunk ./main.cc 59 - +std::stack menuStack; hunk ./main.cc 63 + ER_MISC, hunk ./main.cc 65 + ER_SURRENDER, hunk ./main.cc 67 - ER_SCREENSHOT + ER_SCREENSHOT, + ER_MENU hunk ./main.cc 81 - switch (event.key.keysym.sym) hunk ./main.cc 82 - case SDLK_q: - return ER_QUIT; - case SDLK_p: - gameClock.paused = !gameClock.paused; - break; - case SDLK_z: - settings.zoomEnabled = !settings.zoomEnabled; - break; - case SDLK_r: - settings.rotatingView = !settings.rotatingView; - break; - case SDLK_a: - if (!event.key.keysym.mod & KMOD_SHIFT) - // 'a': increase anti-aliasing level - settings.useAA = - (settings.useAA == AA_NO) ? AA_YES : - AA_FORCE; - else - // 'A': decrease anti-aliasing level - settings.useAA = - (settings.useAA == AA_FORCE) ? AA_YES : - AA_NO; - break; - case SDLK_g: - settings.showGrid = !settings.showGrid; - break; - case SDLK_LEFTBRACKET: - settings.fps = std::max(1, settings.fps-1); - break; - case SDLK_RIGHTBRACKET: - settings.fps = std::min(100, settings.fps+1); - break; - case SDLK_MINUS: - case SDLK_KP_MINUS: - gameClock.rate = 4*gameClock.rate/5; - if (950 <= gameClock.rate && gameClock.rate <= 1050) - gameClock.rate = 1000; - break; - case SDLK_EQUALS: - if (!event.key.keysym.mod & KMOD_SHIFT) - { - gameClock.rate = 1000; + SDLKey sym = event.key.keysym.sym; + switch (sym) + { + case SDLK_q: + return ER_QUIT; + case SDLK_p: + gameClock.paused = !gameClock.paused; + break; + case SDLK_z: + settings.zoomEnabled = !settings.zoomEnabled; + break; + case SDLK_r: + settings.rotatingView = !settings.rotatingView; + break; + case SDLK_a: + if (!event.key.keysym.mod & KMOD_SHIFT) + // 'a': increase anti-aliasing level + settings.useAA = + (settings.useAA == AA_NO) ? AA_YES : + AA_FORCE; + else + // 'A': decrease anti-aliasing level + settings.useAA = + (settings.useAA == AA_FORCE) ? AA_YES : + AA_NO; + break; + case SDLK_g: + settings.showGrid = !settings.showGrid; + break; + case SDLK_LEFTBRACKET: + settings.fps = std::max(1, settings.fps-1); + break; + case SDLK_RIGHTBRACKET: + settings.fps = std::min(100, settings.fps+1); + break; + case SDLK_MINUS: + case SDLK_KP_MINUS: + gameClock.rate = 4*gameClock.rate/5; + if (950 <= gameClock.rate && gameClock.rate <= 1050) + gameClock.rate = 1000; + break; + case SDLK_EQUALS: + if (!event.key.keysym.mod & KMOD_SHIFT) + { + gameClock.rate = 1000; + break; + } + // fallthrough + case SDLK_PLUS: + case SDLK_KP_PLUS: + gameClock.rate = std::max(5*gameClock.rate/4, + gameClock.rate+1); + if (950 <= gameClock.rate && gameClock.rate <= 1050) + gameClock.rate = 1000; hunk ./main.cc 137 - } - // fallthrough - case SDLK_PLUS: - case SDLK_KP_PLUS: - gameClock.rate = std::max(5*gameClock.rate/4, - gameClock.rate+1); - if (950 <= gameClock.rate && gameClock.rate <= 1050) - gameClock.rate = 1000; - break; hunk ./main.cc 138 - case SDLK_m: - if (music) - musicStop(); - else - musicStart(); - break; + case SDLK_m: + settings.music = !settings.music; + checkMusic(); + break; hunk ./main.cc 143 - case SDLK_SPACE: - case SDLK_RETURN: - if (gameState->end) - return ER_RESTART; - break; - case SDLK_F12: - return ER_SCREENSHOT; - break; - default: ; + case SDLK_SPACE: + case SDLK_RETURN: + if (gameState->end) + return ER_RESTART; + break; + + case SDLK_F12: + return ER_SCREENSHOT; + break; + + case SDLK_ESCAPE: + if (menuStack.empty()) + menuStack.push(&topMenu); + else + menuStack.pop(); + return ER_MISC; + break; + default: ; + } + + if (!menuStack.empty()) + { + int dir = (sym == SDLK_h || sym == SDLK_h || sym == SDLK_LEFT) ? 0 : + (sym == SDLK_n || sym == SDLK_k || sym == SDLK_UP) ? 1 : + (sym == SDLK_s || sym == SDLK_l || sym == SDLK_RIGHT) ? 2 : + (sym == SDLK_t || sym == SDLK_j || sym == SDLK_DOWN) ? 3 : -1; + + if (dir >= 0) + { + Menu* submenu = menuStack.top()->menus[dir]; + MenuLeaf* leaf = menuStack.top()->leaves[dir]; + + if (submenu) + { + menuStack.push(submenu); + } + else if (leaf) + { + LeafReturn lr = leaf->act(); + switch (lr) + { + case LR_QUIT: + return ER_QUIT; + case LR_SURRENDER: + while (!menuStack.empty()) + menuStack.pop(); + return ER_SURRENDER; + case LR_EXITMENU: + menuStack.pop(); + break; + default: ; + } +#ifdef MUSIC + checkMusic(); +#endif + } + return ER_MISC; + } + } + break; hunk ./main.cc 204 - break; hunk ./main.cc 209 - default: ; + default: + return ER_NONE; hunk ./main.cc 213 - return ER_NONE; + return ER_MISC; hunk ./main.cc 231 - stringColor(surface, screenGeom.info.x, screenGeom.info.y, fpsStr, - 0xffffffff); + + if (settings.showFPS) + stringColor(surface, screenGeom.info.x, screenGeom.info.y, fpsStr, + 0xffffffff); + hunk ./main.cc 238 + hunk ./main.cc 283 +void drawMenu(SDL_Surface* surface, const Menu& menu) +{ + static const Uint32 colour = 0xffffffd0; + + filledCircleColor(surface, screenGeom.centre.x, screenGeom.centre.y+7, 15, + colour); + aacircleColor(surface, screenGeom.centre.x, screenGeom.centre.y+7, 15, + colour); + + gfxPrimitivesSetFont(fontBig, 10, 20); + for (int dir = 0; dir < 4; dir++) + { + Menu* submenu = menu.menus[dir]; + MenuLeaf* leaf = menu.leaves[dir]; + std::string text; + + if (submenu) + text = submenu->title; + else if (leaf) + text = leaf->name(); + + if (!text.empty()) + { + int x=0, y=0; + switch (dir) + { + case 0: + x = screenGeom.centre.x - 50 - text.length()*10; + y = screenGeom.centre.y; + break; + case 1: + x = screenGeom.centre.x - text.length()*10/2; + y = screenGeom.centre.y - 50; + break; + case 2: + x = screenGeom.centre.x + 50; + y = screenGeom.centre.y; + break; + case 3: + x = screenGeom.centre.x - text.length()*10/2; + y = screenGeom.centre.y + 50; + break; + default:; + } + stringColor(surface, x, y, text.c_str(), colour); + } + } +} + hunk ./main.cc 552 + +void checkMusic() +{ + if (settings.music && !music) + musicStart(); + else if (music && !settings.music) + musicStop(); +} + hunk ./main.cc 632 + bool forceFrame = false; hunk ./main.cc 634 + forceFrame = false; hunk ./main.cc 657 + case ER_SURRENDER: + if (!ended) + gameState->end = END_DEAD; hunk ./main.cc 663 + case ER_MISC: + forceFrame = true; + break; hunk ./main.cc 671 - if (!gameClock.paused) + if (!gameClock.paused && (menuStack.empty() || ended)) hunk ./main.cc 679 - if (!gameClock.paused) + if (!gameClock.paused || forceFrame) hunk ./main.cc 684 + if (!menuStack.empty()) + drawMenu(screen, *menuStack.top()); addfile ./menu.cc hunk ./menu.cc 1 +/* + * Kuklomenos + * Copyright (C) 2008 Martin Bays + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ + +#include + +#include "menu.h" +#include "settings.h" +#include "SDL_gfxPrimitivesDirty.h" + +#include + +#ifdef HAVE_LIBSDL_MIXER +#define MUSIC 1 +#endif + +Menu::Menu(std::string title, + Menu* m1, MenuLeaf* ml1, + Menu* m2, MenuLeaf* ml2, + Menu* m3, MenuLeaf* ml3, + Menu* m4, MenuLeaf* ml4) : + title(title) +{ + menus[0] = m1; + menus[1] = m2; + menus[2] = m3; + menus[3] = m4; + + leaves[0] = ml1; + leaves[1] = ml2; + leaves[2] = ml3; + leaves[3] = ml4; +} + +std::string MenuLeafToggleBool::name() +{ + return varName + + ((*var) ? + ": true" : + ": false"); +} + +LeafReturn MenuLeafToggleBool::act() +{ + *var = !*var; + return LR_NONE; +} + +std::string MenuLeafCycleAA::name() +{ + switch (settings.useAA) + { + case AA_NO: return "antialias: none"; + case AA_YES: return "antialias: some"; + case AA_FORCE: default: return "antialias: all"; + } +} + +LeafReturn MenuLeafCycleAA::act() +{ + settings.useAA = + (settings.useAA == AA_NO) ? AA_YES : + (settings.useAA == AA_YES) ? AA_FORCE : + AA_NO; + return LR_NONE; +} + +MenuLeafToggleBool zoomToggle("Zoom", &settings.zoomEnabled); +MenuLeafToggleBool rotToggle("Rotate", &settings.rotatingView); +MenuLeafToggleBool gridToggle("Grid", &settings.showGrid); +Menu viewMenu("View", + NULL, &zoomToggle, + NULL, &rotToggle, + NULL, &gridToggle + ); + +#ifdef MUSIC +MenuLeafToggleBool musicToggle("Music", &settings.music); +#endif + +MenuLeafCycleAA cycleAALeaf; +MenuLeafIncVar decAlphaLeaf(&antialiasGamma, "AA Gamma", -0.1, 0.1); +MenuLeafIncVar incAlphaLeaf(&antialiasGamma, "AA Gamma", 0.1, 0.1); +MenuLeafShowVar showAlphaLeaf(&antialiasGamma, "AA Gamma"); +Menu AAMenu("Anti-Aliasing", + NULL, &decAlphaLeaf, + NULL, &cycleAALeaf, + NULL, &incAlphaLeaf, + NULL, &showAlphaLeaf); + +MenuLeafToggleBool showFPSToggle("Show FPS", &settings.showFPS); +MenuLeafIncVar decFPSLeaf(&settings.fps, "FPS", -5, 3); +MenuLeafIncVar incFPSLeaf(&settings.fps, "FPS", 5, 3); +MenuLeafShowVar showFPSLeaf(&settings.fps, "FPS"); +Menu fpsMenu("Framerate", + NULL, &decFPSLeaf, + NULL, &showFPSToggle, + NULL, &incFPSLeaf, + NULL, &showFPSLeaf + ); + +Menu graphicsMenu("Graphics", + NULL, NULL, + &fpsMenu, NULL, + NULL, NULL, + &AAMenu, NULL + ); + +Menu settingsMenu("Settings", + &graphicsMenu, NULL, + NULL, NULL, + &viewMenu, NULL, +#ifdef MUSIC + NULL, &musicToggle +#else + NULL, NULL +#endif + ); + +MenuLeafReturn quitLeaf("Quit", LR_QUIT); +MenuLeafReturn surrenderLeaf("Surrender", LR_SURRENDER); +Menu quitMenu("Quit", + NULL, &quitLeaf, + NULL, NULL, + NULL, &surrenderLeaf + ); + +MenuLeafReturn resumeLeaf("Resume", LR_EXITMENU); + +Menu topMenu("top", + NULL, &resumeLeaf, + NULL, NULL, + &settingsMenu, NULL, + &quitMenu, NULL + ); addfile ./menu.h hunk ./menu.h 1 +#ifndef INC_MENU_H +#define INC_MENU_H + +#include +#include +#include + +enum MenuNodeType +{ + MNT_NONE, + MNT_MENU, + MNT_LEAF +}; +enum LeafReturn +{ + LR_NONE, + LR_QUIT, + LR_SURRENDER, + LR_EXITMENU +}; + +class Menu; +class MenuLeaf; + +class Menu +{ + public: + std::string title; + + /* menus and leaves give the menu or leaf to be found in each + * direction; 0->west, 1->north, 2->east, 3->south. For each i, at + * most one of menus[i] and leaves[i] should be non-NULL. + */ + Menu* menus[4]; + MenuLeaf* leaves[4]; + + Menu(); + + Menu(std::string title, + Menu* m1=NULL, MenuLeaf* ml1=NULL, + Menu* m2=NULL, MenuLeaf* ml2=NULL, + Menu* m3=NULL, MenuLeaf* ml3=NULL, + Menu* m4=NULL, MenuLeaf* ml4=NULL + ); +}; + +class MenuLeaf +{ + public: + virtual std::string name() =0; + virtual LeafReturn act() =0; + + virtual ~MenuLeaf() {}; +}; + +class MenuLeafToggleBool : public MenuLeaf +{ + private: + std::string varName; + bool* var; + public: + std::string name(); + LeafReturn act(); + + MenuLeafToggleBool(std::string varName, bool* var) : + varName(varName), var(var) {} +}; + +class MenuLeafCycleAA : public MenuLeaf +{ + public: + std::string name(); + LeafReturn act(); + + MenuLeafCycleAA() {} +}; + +template +class MenuLeafIncVar : public MenuLeaf +{ + private: + T* var; + std::string varName; + T amount; + T min; + public: + std::string name() { + return ( (amount >= 0) ? "Inc " : "Dec " ) + varName; + } + LeafReturn act() { + *var += amount; + if (*var < min) + *var = min; + return LR_NONE; + } + + MenuLeafIncVar(T* var, std::string(varName), T amount, T min = 0) : + var(var), varName(varName), amount(amount), min(min) {} +}; + +template +class MenuLeafShowVar : public MenuLeaf +{ + private: + T* var; + std::string varName; + public: + std::string name() { + std::stringstream ss; + ss << varName << ": " << *var; + return ss.str(); + } + LeafReturn act() { return LR_NONE; } + + MenuLeafShowVar(T* var, std::string(varName)) : + var(var), varName(varName) {} +}; + +class MenuLeafReturn : public MenuLeaf +{ + private: + std::string text; + LeafReturn ret; + public: + std::string name() { return text; } + LeafReturn act() { return ret; } + + MenuLeafReturn(std::string text, LeafReturn ret) : + text(text), ret(ret) {} +}; + +extern Menu topMenu; + +#endif /* INC_MENU_H */ hunk ./settings.cc 24 - requestedRating(0), fps(30), width(0), height(0), fullscreen(false), + requestedRating(0), fps(30), showFPS(true), width(0), height(0), fullscreen(false), hunk ./settings.h 23 + bool showFPS; hunk ./main.cc 754 + // deal with float inaccuracy - sometimes, 0.6+0.4 is just + // less that 1.0... + if ((gameState->rating - (int)(gameState->rating)) > 0.95) + gameState->rating = (int)(gameState->rating) + 1; + hunk ./player.cc 72 + + shootHeat = std::max(0, shootHeat - shootCoolrate*time); hunk ./state.cc 436 - you.shootHeat = std::max(0, you.shootHeat - you.shootCoolrate*time); hunk ./main.cc 344 + SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); + hunk ./menu.cc 106 -MenuLeafIncVar decFPSLeaf(&settings.fps, "FPS", -5, 3); -MenuLeafIncVar incFPSLeaf(&settings.fps, "FPS", 5, 3); +MenuLeafIncVar decFPSLeaf(&settings.fps, "FPS", -1, 2); +MenuLeafIncVar incFPSLeaf(&settings.fps, "FPS", 1, 2); hunk ./collision.cc 34 - (y < -rad && vy < 0) || (y > rad && vy > 0)) + (y < -rad && vy < 0) || (y > rad && vy > 0)) hunk ./conffile.cc 33 - + hunk ./conffile.cc 60 - + hunk ./coords.h 21 - operator float() const { return angle; } + operator float() const { return angle; } hunk ./gfx.cc 69 - return (filled ? filledCircleColor : + return (filled ? filledCircleColor : hunk ./invaders.cc 80 - + hunk ./main.cc 784 - + hunk ./menu.cc 96 -MenuLeafIncVar decAlphaLeaf(&antialiasGamma, "AA Gamma", -0.1, 0.1); -MenuLeafIncVar incAlphaLeaf(&antialiasGamma, "AA Gamma", 0.1, 0.1); -MenuLeafShowVar showAlphaLeaf(&antialiasGamma, "AA Gamma"); +MenuLeafIncVar decAlphaLeaf(&antialiasGamma, "AA Gamma", -0.1, 0.1); +MenuLeafIncVar incAlphaLeaf(&antialiasGamma, "AA Gamma", 0.1, 0.1); +MenuLeafShowVar showAlphaLeaf(&antialiasGamma, "AA Gamma"); hunk ./menu.cc 106 -MenuLeafIncVar decFPSLeaf(&settings.fps, "FPS", -1, 2); -MenuLeafIncVar incFPSLeaf(&settings.fps, "FPS", 1, 2); -MenuLeafShowVar showFPSLeaf(&settings.fps, "FPS"); +MenuLeafIncVar decFPSLeaf(&settings.fps, "FPS", -1, 2); +MenuLeafIncVar incFPSLeaf(&settings.fps, "FPS", 1, 2); +MenuLeafShowVar showFPSLeaf(&settings.fps, "FPS"); hunk ./node.cc 104 - Polygon(tpoints, 3, 0x00ffff00 + + Polygon(tpoints, 3, 0x00ffff00 + hunk ./state.cc 490 - if (keyShootPod && + if (keyShootPod && hunk ./state.cc 502 - + hunk ./conffile.cc 23 +#include hunk ./conffile.cc 27 +#include "SDL_gfxPrimitivesDirty.h" + +int powmod(int n, int m, int p) +{ + int out = 1; + while (m > 0) + if (m % 2 == 0) + { + n = (n*n) % p; + m /= 2; + } + else + { + out = (out*n) % p; + m -= 1; + } + return out; + +} + +/* obfuscate the rating string: if you want to cheat, you at least have to + * source-dive... + */ +int obfuscatedRating(double rating) +{ + int pertinentRating = (int)(10*rating); + return powmod(pertinentRating, 5, 45953); +} +double unobfuscatedRating(int obfuscated) +{ + double unobf = powmod(obfuscated, 18381, 45953)/10.0; + if (unobf < 0 || unobf > 20) + return 0.0; + return unobf; +} hunk ./conffile.cc 65 - shouldUpdateRating(false) + useAA(AA_YES), showGrid(true), zoomEnabled(true), + rotatingView(true), fps(30), showFPS(true), music(false), + aaGamma(2.2), + shouldUpdateRating(false) {} + +void Config::read() hunk ./conffile.cc 72 - ifstream* f = new ifstream; + ifstream f; hunk ./conffile.cc 78 - f->open((home + (string)"/.kuklomenosrc").c_str()); + f.open((home + (string)"/.kuklomenosrc").c_str()); hunk ./conffile.cc 80 - if (!f->is_open()) - f->open("./kuklomenosrc.txt"); + if (!f.is_open()) + f.open("./kuklomenosrc.txt"); hunk ./conffile.cc 83 - if (f->is_open()) + if (f.is_open()) hunk ./conffile.cc 85 - int ret; - char line[50]; + string line; + double val; hunk ./conffile.cc 88 - f->getline(line, 50); - ret = sscanf(line, "rating: %lf", &rating); - if (ret != 1) + while (!f.eof()) hunk ./conffile.cc 90 - fprintf(stderr, "Bad config file.\n"); + std::getline(f, line); + const char* cstr = line.c_str(); + if (sscanf(cstr, "data: %lf", &val) == 1) + rating = unobfuscatedRating( (int)(val) ); + else if (sscanf(cstr, "showGrid: %lf", &val) == 1) + showGrid = val; + else if (sscanf(cstr, "zoomEnabled: %lf", &val) == 1) + zoomEnabled = val; + else if (sscanf(cstr, "rotatingView: %lf", &val) == 1) + rotatingView = val; + else if (sscanf(cstr, "showFPS: %lf", &val) == 1) + showFPS = val; + else if (sscanf(cstr, "music: %lf", &val) == 1) + music = val; + else if (sscanf(cstr, "antialiasGamma: %lf", &val) == 1) + aaGamma = val; + else if (sscanf(cstr, "fps: %lf", &val) == 1) + fps = (int) val; + else if (sscanf(cstr, "useAA: %lf", &val) == 1) + useAA = (val == 0 ? AA_NO : + val == 2 ? AA_FORCE : + AA_YES); + else if (*cstr != '\0' && *cstr != '#') + fprintf(stderr, "Unparsable line in config file: %s\n", cstr); hunk ./conffile.cc 118 -void Config::write() +void Config::importSettings(const Settings& settings) +{ + useAA = settings.useAA; + showGrid = settings.showGrid; + zoomEnabled = settings.zoomEnabled; + rotatingView = settings.rotatingView; + fps = settings.fps; + showFPS = settings.showFPS; + music = settings.music; + + aaGamma = antialiasGamma; +} +void Config::exportSettings(Settings& settings) const hunk ./conffile.cc 132 - ofstream* f = new ofstream; + settings.useAA = useAA; + settings.showGrid = showGrid; + settings.zoomEnabled = zoomEnabled; + settings.rotatingView = rotatingView; + settings.fps = fps; + settings.showFPS = showFPS; + settings.music = music; + + antialiasGamma = aaGamma; +} + +void Config::write() const +{ + ofstream f; hunk ./conffile.cc 151 - f->open((home + (string)"/.kuklomenosrc").c_str()); + f.open((home + (string)"/.kuklomenosrc").c_str()); hunk ./conffile.cc 153 - if (!f->is_open()) - f->open("./kuklomenosrc.txt"); + if (!f.is_open()) + f.open("./kuklomenosrc.txt"); hunk ./conffile.cc 156 - if (!f->is_open()) + if (!f.is_open()) hunk ./conffile.cc 160 - int n; - char line[50]; - - n = snprintf(line, 50, "rating: %.2f\n", rating); - f->write(line, n); - f->flush(); + ostringstream s; + int aanum = (useAA == AA_NO ? 0 : + useAA == AA_YES ? 1 : 2); + s << + "useAA: " << aanum << endl << + "showGrid: " << showGrid << endl << + "zoomEnabled: " << zoomEnabled << endl << + "rotatingView: " << rotatingView << endl << + "fps: " << fps << endl << + "showFPS: " << showFPS << endl << + "music: " << music << endl << + "antialiasGamma: " << aaGamma << endl << + endl << "# Warning: Do not edit following line" << endl << + "data: " << obfuscatedRating(rating) << endl; + f << s.str(); hunk ./conffile.h 4 +#include "settings.h" + hunk ./conffile.h 10 + + UseAALevel useAA; + bool showGrid; + bool zoomEnabled; + bool rotatingView; + int fps; + bool showFPS; + bool music; + double aaGamma; + hunk ./conffile.h 22 + void read(); + void write() const; + void importSettings(const Settings& settings); + void exportSettings(Settings& settings) const; + hunk ./conffile.h 28 - void write(); hunk ./main.cc 193 + case LR_SAVESETTINGS: + config.importSettings(settings); + config.write(); + menuStack.pop(); + break; hunk ./main.cc 358 - while (1) { + config.read(); + config.exportSettings(settings); + + while (1) + { hunk ./main.cc 490 - hunk ./menu.cc 123 +MenuLeafReturn saveLeaf("Save settings", LR_SAVESETTINGS); hunk ./menu.cc 126 - NULL, NULL, - &viewMenu, NULL, hunk ./menu.cc 127 - NULL, &musicToggle + NULL, &musicToggle, hunk ./menu.cc 129 - NULL, NULL + NULL, NULL, hunk ./menu.cc 131 + &viewMenu, NULL, + NULL, &saveLeaf hunk ./menu.h 19 - LR_EXITMENU + LR_EXITMENU, + LR_SAVESETTINGS hunk ./data.cc 86 + delete f2; hunk ./NEWS 1 +0.3.1: +Menu system and config saving + hunk ./README 1 -Kuklomenos-0.3 -================== +Kuklomenos-0.3.1 +================ hunk ./README 138 +escape: menu + hunk ./configure.ac 5 -AC_INIT(kuklomenos, 0.3) +AC_INIT(kuklomenos, 0.3.1)