diff --git a/Aquaria/AquariaCompileConfig.h b/Aquaria/AquariaCompileConfig.h index a7b9cd6..922d212 100644 --- a/Aquaria/AquariaCompileConfig.h +++ b/Aquaria/AquariaCompileConfig.h @@ -5,7 +5,6 @@ // Define BBGE_SKIP_CONFIG_HEADERS to use CMake-only configuration. #ifndef BBGE_SKIP_CONFIG_HEADERS - #define AQUARIA_FULL 1 //#define AQUARIA_DEMO 1 #define AQUARIA_BUILD_CONSOLE 1 #define AQUARIA_BUILD_SCENEEDITOR 1 diff --git a/Aquaria/AquariaWin32Dev.ico b/Aquaria/AquariaWin32Dev.ico deleted file mode 100644 index 3909c58..0000000 Binary files a/Aquaria/AquariaWin32Dev.ico and /dev/null differ diff --git a/Aquaria/AquariaWin32.ico b/Aquaria/AquariaWin32OSE.ico similarity index 100% rename from Aquaria/AquariaWin32.ico rename to Aquaria/AquariaWin32OSE.ico diff --git a/Aquaria/DSQ.cpp b/Aquaria/DSQ.cpp index 5c3bea5..3bd2696 100644 --- a/Aquaria/DSQ.cpp +++ b/Aquaria/DSQ.cpp @@ -989,7 +989,6 @@ This build is not yet final, and as such there are a couple things lacking. They bool fullscreen = true; int joystickMode = 0; int dsq_filter = 0; - developerKeys = false; voiceOversEnabled = true; @@ -1013,13 +1012,6 @@ This build is not yet final, and as such there are a couple things lacking. They useFrameBuffer = user.video.fbuffer; -#ifdef AQUARIA_DEMO - developerKeys = 0; -#endif - - if (exists("unlockdeveloperkeys")) - developerKeys = 1; - if (isDeveloperKeys()) { maxPages = 600/saveSlotPageSize; @@ -1555,11 +1547,15 @@ This build is not yet final, and as such there are a couple things lacking. They sound->playSfx("defense", 0.5); sound->playSfx("visionwakeup"); */ -#if defined(AQUARIA_FULL) || defined(AQUARIA_DEMO) - float trans = 0.5; - overlay->alpha.interpolateTo(1, trans); - core->main(trans); -#endif + + // Don't do transitions for a faster start up in dev mode + if (!isDeveloperKeys()) + { + float trans = 0.5; + overlay->alpha.interpolateTo(1, trans); + core->main(trans); + } + removeRenderObject(loading); loading = 0; removeRenderObject(sidel); @@ -1581,11 +1577,11 @@ This build is not yet final, and as such there are a couple things lacking. They bindInput(); -#if defined(AQUARIA_FULL) || defined(AQUARIA_DEMO) - enqueueJumpState("BitBlotLogo"); -#else - title(); -#endif + // Go directly to the title in dev mode + if(isDeveloperKeys()) + title(); + else + enqueueJumpState("BitBlotLogo"); } void DSQ::recreateBlackBars() @@ -2006,7 +2002,7 @@ void DSQ::reloadDevice() #ifdef AQUARIA_BUILD_CONSOLE void DSQ::toggleConsole() { - if (console) + if (console && isDeveloperKeys()) { if (console->alpha == 0) { @@ -2793,11 +2789,6 @@ void DSQ::nag(NagType type) void DSQ::doModSelect() { -#ifdef AQUARIA_DEMO - nag(NAG_TOTITLE); - return; -#endif - modIsSelected = false; dsq->loadMods(); @@ -2811,10 +2802,14 @@ void DSQ::doModSelect() main(-1); clearModSelector(); - + if (modIsSelected) { +#ifdef AQUARIA_DEMO + nag(NAG_TOTITLE); +#else dsq->startSelectedMod(); +#endif } inModSelector = false; @@ -4147,21 +4142,11 @@ void DSQ::vision(std::string folder, int num, bool ignoreMusic) bool DSQ::isDeveloperKeys() { - ///HACK TEMPORARY - //return true; - -#if !defined(AQUARIA_FULL) && !defined(AQUARIA_DEMO) - return true; -#endif - #ifdef AQUARIA_DEMO return false; #endif -#ifdef AQUARIA_FULL - return false; -#endif - return developerKeys; + return user.system.devModeOn; } bool DSQ::canOpenEditor() const diff --git a/Aquaria/DSQ.h b/Aquaria/DSQ.h index 6e013ba..523ff86 100644 --- a/Aquaria/DSQ.h +++ b/Aquaria/DSQ.h @@ -1612,7 +1612,6 @@ protected: void updatepecue(float dt); std::vector pecue; - bool developerKeys; void onMouseInput(); std::vector voxQueue; diff --git a/Aquaria/Main.cpp b/Aquaria/Main.cpp index 290e54d..ed237b8 100644 --- a/Aquaria/Main.cpp +++ b/Aquaria/Main.cpp @@ -31,26 +31,27 @@ static void MakeRan(void) { #ifdef BBGE_BUILD_WINDOWS std::ofstream out("ran"); - for (int i = 0; i < 32; i++) - out << rand()%1000; - out.close(); + if(out) + { + for (int i = 0; i < 32; i++) + out << rand()%1000; + out.close(); + } #endif } static void StartAQConfig() { #if defined(BBGE_BUILD_WINDOWS) -#if defined(AQUARIA_DEMO) || defined(AQUARIA_FULL) - if (!exists("ran", false)) + if (!exists("ran", false, true)) { MakeRan(); - if(exists("aqconfig.exe", false)) + if(exists("AQConfig.exe", false, true)) { - ShellExecute(NULL, "open", "aqconfig.exe", NULL, NULL, SW_SHOWNORMAL); + ShellExecute(NULL, "open", "AQConfig.exe", NULL, NULL, SW_SHOWNORMAL); exit(0); } } -#endif remove("ran"); #endif } diff --git a/Aquaria/ModSelector.cpp b/Aquaria/ModSelector.cpp index dd03b87..5150475 100644 --- a/Aquaria/ModSelector.cpp +++ b/Aquaria/ModSelector.cpp @@ -338,14 +338,12 @@ void ModSelectorScreen::initNetPanel() #ifdef BBGE_BUILD_VFS if(!gotServerList) { - // FIXME: demo should be able to see downloadable mods imho -#ifndef AQUARIA_DEMO moddl.init(); std::string serv = dsq->user.network.masterServer; if(serv.empty()) serv = DEFAULT_MASTER_SERVER; moddl.GetModlist(serv, true, true); -#endif + gotServerList = true; // try this only once (is automatically reset on failure) } #endif @@ -502,11 +500,6 @@ void ModIcon::onClick() { dsq->sound->playSfx("click"); -#ifdef AQUARIA_DEMO - dsq->nag(NAG_TOTITLE); - return; -#endif - switch(modType) { case MODTYPE_MOD: @@ -520,18 +513,24 @@ void ModIcon::onClick() case MODTYPE_PATCH: { + #ifdef AQUARIA_DEMO + dsq->sound->playSfx("denied"); + core->quitNestedMain(); + dsq->modIsSelected = true; // HACK: trigger nag screen + dsq->selectedMod = -1; + break; + #endif + std::set::iterator it = dsq->activePatches.find(fname); if(it != dsq->activePatches.end()) { dsq->sound->playSfx("pet-off"); dsq->unapplyPatch(fname); - //dsq->screenMessage(modname + " - deactivated"); // DEBUG } else { dsq->sound->playSfx("pet-on"); dsq->applyPatch(fname); - //dsq->screenMessage(modname + " - activated"); // DEBUG } updateStatus(); break; @@ -711,7 +710,9 @@ void ModIconOnline::onClick() dsq->sound->playSfx("click"); #ifdef AQUARIA_DEMO - dsq->nag(NAG_TOTITLE); + core->quitNestedMain(); + dsq->modIsSelected = true; // HACK: trigger nag screen + dsq->selectedMod = -1; return; #endif diff --git a/Aquaria/ScriptInterface.cpp b/Aquaria/ScriptInterface.cpp index 57ed630..aea95ea 100644 --- a/Aquaria/ScriptInterface.cpp +++ b/Aquaria/ScriptInterface.cpp @@ -39,8 +39,6 @@ extern "C" #include "../BBGE/MathFunctions.h" -#if defined(AQUARIA_FULL) || defined(AQUARIA_DEMO) - // Define this to 1 to check types of pointers passed to functions, // and warn if a type mismatch is detected. In this case, // the pointer is treated as NULL, to avoid crashing or undefined behavior. @@ -51,25 +49,16 @@ extern "C" // If true, send all sort of script errors to errorLog instead of debugLog. // On win32/OSX, this pops up message boxes which help to locate errors easily, // but can be annoying for regular gameplay. -const bool loudScriptErrors = false; +bool loudScriptErrors = false; // Set this to true to complain whenever a script tries to // get or set a global variable. -const bool complainOnGlobalVar = false; +bool complainOnGlobalVar = false; // Set this to true to complain whenever a script tries to get an undefined // thread-local variable. -const bool complainOnUndefLocal = false; +bool complainOnUndefLocal = false; -#else - -// Use maximal safety for developer builds. -#define CHECK_POINTER_TYPES 1 -const bool loudScriptErrors = true; -const bool complainOnGlobalVar = true; -const bool complainOnUndefLocal = true; - -#endif // List of all interface functions called by C++ code, terminated by NULL. static const char * const interfaceFunctions[] = { @@ -9739,6 +9728,13 @@ ScriptInterface::ScriptInterface() void ScriptInterface::init() { + bool devmode = dsq->isDeveloperKeys(); + + // Everything on in dev mode, everything off otherwise. + bool loudScriptErrors = devmode; + bool complainOnGlobalVar = devmode; + bool complainOnUndefLocal = devmode; + if (!baseState) baseState = createLuaVM(); } diff --git a/Aquaria/UserSettings.cpp b/Aquaria/UserSettings.cpp index 32d47e9..e9ab64d 100644 --- a/Aquaria/UserSettings.cpp +++ b/Aquaria/UserSettings.cpp @@ -54,6 +54,12 @@ void UserSettings::save() xml_locale.SetAttribute("name", system.locale); } xml_system.InsertEndChild(xml_locale); + + TiXmlElement xml_devmode("DeveloperMode"); + { + xml_devmode.SetAttribute("on", system.devModeOn); + } + xml_system.InsertEndChild(xml_devmode); } doc.InsertEndChild(xml_system); @@ -370,6 +376,12 @@ void UserSettings::load(bool doApply, const std::string &overrideFile) { system.locale = xml_locale->Attribute("name"); } + + TiXmlElement *xml_devmode = xml_system->FirstChildElement("DeveloperMode"); + if (xml_devmode) + { + xml_devmode->Attribute("on", &system.devModeOn); + } } TiXmlElement *xml_audio = doc.FirstChildElement("Audio"); diff --git a/Aquaria/UserSettings.h b/Aquaria/UserSettings.h index 1c4607e..c6b0c22 100644 --- a/Aquaria/UserSettings.h +++ b/Aquaria/UserSettings.h @@ -78,9 +78,10 @@ class UserSettings public: struct System { - System() { debugLogOn = 0; } + System() { debugLogOn = 0; devModeOn = 0; } int debugLogOn; std::string locale; + int devModeOn; } system; struct Audio diff --git a/Aquaria/WorldMapRender.cpp b/Aquaria/WorldMapRender.cpp index b695cb0..55d9fe0 100644 --- a/Aquaria/WorldMapRender.cpp +++ b/Aquaria/WorldMapRender.cpp @@ -1220,7 +1220,11 @@ void WorldMapRender::onUpdate(float dt) else { #ifdef AQUARIA_BUILD_MAPVIS - if (!dsq->isInCutscene() && dsq->game->avatar && activeTile && !dsq->game->sceneEditor.isOn()) + if (!dsq->isInCutscene() && dsq->game->avatar && activeTile + #ifdef AQUARIA_BUILD_SCENEEDITOR + && !dsq->game->sceneEditor.isOn() + #endif + ) { const float screenWidth = core->getVirtualWidth() * core->invGlobalScale; const float screenHeight = core->getVirtualHeight() * core->invGlobalScale; diff --git a/Aquaria/aquaria.rc b/Aquaria/aquaria.rc index 87d609f..2084b20 100644 --- a/Aquaria/aquaria.rc +++ b/Aquaria/aquaria.rc @@ -63,12 +63,5 @@ END END // Icon -#if defined(AQUARIA_FULL) || defined(AQUARIA_DEMO) -101 ICON "AquariaWin32.ico" -#else -101 ICON "AquariaWin32Dev.ico" -#endif - -//101 ICON "Aquaria.ico" - +101 ICON "AquariaWin32OSE.ico" diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b3823b..f236bd2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,6 @@ IF(NOT CMAKE_BUILD_TYPE) SET(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build (Debug, RelWithDebInfo, Release)" FORCE) ENDIF(NOT CMAKE_BUILD_TYPE) -OPTION(AQUARIA_DEVELOPER_BUILD "Developer Build?" FALSE) OPTION(AQUARIA_DEMO_BUILD "Demo Build?" FALSE) OPTION(AQUARIA_USE_VFS "Use Virtual File System? Required for some additional features." TRUE) @@ -258,12 +257,6 @@ IF(AQUARIA_USE_VFS) ADD_DEFINITIONS(-DBBGE_BUILD_VFS=1) ENDIF(AQUARIA_USE_VFS) -IF(AQUARIA_DEVELOPER_BUILD) - message(STATUS "Developer build.") -ELSE(AQUARIA_DEVELOPER_BUILD) - ADD_DEFINITIONS(-DAQUARIA_FULL=1) -ENDIF(AQUARIA_DEVELOPER_BUILD) - IF(AQUARIA_DEMO_BUILD) message(STATUS "Demo build.") ADD_DEFINITIONS(-DAQUARIA_DEMO=1)