1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-10-17 11:59:28 +00:00

fixes for win32/MSVC build. This removes SDLmain as dependency, and fixes newer gcc versions refusing to compile FmodOpenALBridge.cpp. Allow enabling/disabling console window in win32 build.

This commit is contained in:
fgenesis 2011-08-08 03:54:30 +02:00
commit fe16861832
9 changed files with 110 additions and 82 deletions

View file

@ -0,0 +1,33 @@
#ifndef __AQUARIA_COMPILE_CONFIG_H__
#define __AQUARIA_COMPILE_CONFIG_H__
#ifndef BBGE_SKIP_CONFIG_HEADERS
//#define AQUARIA_FULL 1
//#define AQUARIA_DEMO 1
#define AQUARIA_BUILD_CONSOLE 1
#define AQUARIA_BUILD_SCENEEDITOR 1
#define AQUARIA_CUSTOM_BUILD_ID ""
// no console window in release mode (note: use together with linker SubSystem setting)
#ifdef NDEBUG
# define AQUARIA_WIN32_NOCONSOLE
#endif
#define AQUARIA_BUILD_MAPVIS
// Define this to save map visited data in a base64-encoded raw format.
// This can take much less space than the standard text format (as little
// as 10%), but WILL BE INCOMPATIBLE with previous builds of Aquaria --
// the visited data will be lost if the file is loaded into such a build.
// (Current builds will load either format regardless of whether or not
// this is defined.)
//#define AQUARIA_SAVE_MAPVIS_RAW
// Interesting, old test stuff
//#define AQ_TEST_QUADTRAIL
#endif
#endif

View file

@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef __dsq__
#define __dsq__
#include "AquariaCompileConfig.h"
#include "../BBGE/Core.h"
#include "../BBGE/Quad.h"
#include "Element.h"
@ -364,6 +365,14 @@ enum FormUpgradeType
FORMUPGRADE_MAX
};
// defined on windows
#ifdef INPUT_MOUSE
# undef INPUT_MOUSE
#endif
#ifdef INPUT_KEYBOARD
# undef INPUT_KEYBOARD
#endif
enum InputMode
{
INPUT_MOUSE = 0,

View file

@ -130,7 +130,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
}
#if defined(BBGE_BUILD_WINDOWS) && !defined(BBGE_BUILD_SDL)
#if defined(BBGE_BUILD_WINDOWS) && defined(AQUARIA_WIN32_NOCONSOLE)
int WINAPI WinMain( HINSTANCE hInstance, // Instance
HINSTANCE hPrevInstance, // Previous Instance
LPSTR lpCmdLine, // Command Line Parameters
@ -141,54 +141,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
_CrtSetReportMode ( _CRT_ERROR, _CRTDBG_MODE_DEBUG);
#endif
DSQ core(GetCommandLine());
std::string dsqParam = GetCommandLine();
#elif defined(BBGE_BUILD_SDL)
static inline void check_beta(void)
{
#if defined(BBGE_BUILD_UNIX) && defined(BETAEXPIRE)
bool bail = false;
fprintf(stderr, "\n\n\n");
fprintf(stderr, "*********************************************************\n");
fprintf(stderr, "*********************************************************\n");
fprintf(stderr, "*********************************************************\n");
fprintf(stderr, "*********************************************************\n");
fprintf(stderr, "*********************************************************\n");
if ( time(NULL) > (BETAEXPIRE + 14 * 24 * 60 * 60) ) {
fprintf(stderr,
"Sorry, but this beta of the game has expired, and will no\n"
" longer run. This is to prevent tech support on out-of-date\n"
" and prerelease versions of the game. Please go to\n"
" http://www.bit-blot.com/ for information on getting a release\n"
" version that does not expire.\n");
bail = true;
} else {
fprintf(stderr, " Warning: This is a beta version of AQUARIA.\n");
}
fprintf(stderr, "*********************************************************\n");
fprintf(stderr, "*********************************************************\n");
fprintf(stderr, "*********************************************************\n");
fprintf(stderr, "*********************************************************\n");
fprintf(stderr, "*********************************************************\n");
fprintf(stderr, "\n\n\n");
fflush(stderr);
if (bail) {
while (true) {
_exit(0);
}
}
#endif
}
extern "C" int main(int argc,char *argv[])
{
check_beta();
#ifdef BBGE_BUILD_WINDOWS
#if defined(AQUARIA_DEMO) || defined(AQUARIA_FULL)
@ -208,17 +166,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
remove("ran");
#endif
std::string fileSystem = "";
std::string dsqParam = "";
#ifdef BBGE_BUILD_UNIX
const char *envPath = getenv("AQUARIA_DATA_PATH");
if (envPath != NULL)
fileSystem = envPath;
dsqParam = envPath;
#endif
DSQ core(fileSystem);
#endif
#endif
DSQ core(dsqParam);
{
core.init();
//enumerateTest();

View file

@ -23,10 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "Avatar.h"
#include "StatsAndAchievements.h"
#ifdef _MSC_VER
#define snprintf _snprintf
#endif
#ifndef ARRAYSIZE
#define ARRAYSIZE(x) (sizeof (x) / sizeof ((x)[0]))
#endif