#include "jgame.h" #include "jdraw.h" #include "editor.h" #include "console.h" #include "string.h" #include "m_game.h" #include "m_menu.h" #include "m_logo.h" #define M_LOGO 0 #define M_MENU 1 #define M_GAME 2 int current_module = M_LOGO; void game::init() { if (game::getParams(1) && strcmp(game::getParams(1), "editor")==0) editor::setDevMode(); if (editor::isDevMode()) draw::init("The Pool", 520, 240, 3); else { draw::init("The Pool", 320, 240, 3); console::init(); } draw::loadPalette("test.gif"); if (editor::isDevMode()) { current_module = M_GAME; modules::game::init(); } else modules::logo::init(); } bool game::loop() { int option; switch(current_module) { case M_LOGO: if (!modules::logo::loop()) { modules::menu::init(); current_module = M_MENU; } break; case M_MENU: option = modules::menu::loop(); if (option != OPTION_NONE) { if (option == OPTION_EIXIR) return false; if (option == OPTION_JUGAR) { modules::game::init(); current_module = M_GAME; } } break; case M_GAME: return modules::game::loop(); }; return true; }