1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-15 22:19:07 +00:00

Revert "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 reverts commit fe16861832.

Conflicts:

	Aquaria/Main.cpp
	CMakeLists.txt
This commit is contained in:
fgenesis 2011-08-08 13:06:34 +02:00
parent f8b0c29ecd
commit 01c3e9c38f
9 changed files with 106 additions and 119 deletions

View file

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

View file

@ -65,7 +65,7 @@ static void CheckConfig(void)
} }
#if defined(BBGE_BUILD_WINDOWS) && defined(AQUARIA_WIN32_NOCONSOLE) #if defined(BBGE_BUILD_WINDOWS) && !defined(BBGE_BUILD_SDL)
int WINAPI WinMain( HINSTANCE hInstance, // Instance int WINAPI WinMain( HINSTANCE hInstance, // Instance
HINSTANCE hPrevInstance, // Previous Instance HINSTANCE hPrevInstance, // Previous Instance
LPSTR lpCmdLine, // Command Line Parameters LPSTR lpCmdLine, // Command Line Parameters
@ -76,32 +76,89 @@ static void CheckConfig(void)
_CrtSetReportMode ( _CRT_ERROR, _CRTDBG_MODE_DEBUG); _CrtSetReportMode ( _CRT_ERROR, _CRTDBG_MODE_DEBUG);
#endif #endif
std::string dsqParam = GetCommandLine(); DSQ core(GetCommandLine());
#elif defined(BBGE_BUILD_SDL) #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[]) extern "C" int main(int argc,char *argv[])
{ {
std::string dsqParam = ""; // fileSystem check_beta();
#ifdef BBGE_BUILD_WINDOWS
#if defined(AQUARIA_DEMO) || defined(AQUARIA_FULL)
if (!exists("ran", false))
{
std::ofstream out("ran");
for (int i = 0; i < 32; i++)
out << rand()%1000;
out.close();
ShellExecute(NULL, "open", "aqconfig.exe", NULL, NULL, SW_SHOWNORMAL);
exit(0);
}
#endif
remove("ran");
#endif
std::string fileSystem = "";
#ifdef BBGE_BUILD_UNIX #ifdef BBGE_BUILD_UNIX
const char *envPath = getenv("AQUARIA_DATA_PATH"); const char *envPath = getenv("AQUARIA_DATA_PATH");
if (envPath != NULL) if (envPath != NULL)
dsqParam = envPath; fileSystem = envPath;
#endif #endif
DSQ core(fileSystem);
#endif #endif
CheckConfig();
{ {
DSQ dsql(dsqParam); core.init();
dsql.init(); //enumerateTest();
dsql.main(); core.main();
dsql.shutdown(); core.shutdown();
} }
MakeRan();
return (0); return (0);
} }

View file

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

View file

@ -1,17 +0,0 @@
#ifndef __BBGE_COMPILE_CONFIG_H__
#define __BBGE_COMPILE_CONFIG_H__
#ifndef BBGE_SKIP_CONFIG_HEADERS
#define BBGE_BUILD_SDL 1
#define BBGE_BUILD_FRAMEBUFFER 1
#define BBGE_BUILD_SHADERS 1
#define BBGE_BUILD_OPENGL 1
#define BBGE_BUILD_OPENGL_DYNAMIC 1
#define BBGE_BUILD_WIDESCREEN 1
#define BBGE_BUILD_FMOD_OPENAL_BRIDGE 1
#define BBGE_BUILD_ACHIEVEMENTS_INTERNAL 1
#endif
#endif

View file

@ -25,16 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#ifdef _MSC_VER
#define strtof (float)strtod
#define snprintf _snprintf
#endif
#endif
#include "BBGECompileConfig.h"
#ifdef BBGE_BUILD_WINDOWS
//#include "iprof/prof.h" //#include "iprof/prof.h"
//#define BBGE_PROF(x) Prof(x) //#define BBGE_PROF(x) Prof(x)
@ -88,7 +78,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifdef BBGE_BUILD_SDL #ifdef BBGE_BUILD_SDL
#include "SDL.h" #include "SDL.h"
#undef main // SDL defines main to SDL_main. This is the only place where SDL.h is included, so this is ok.
#endif #endif

View file

@ -21,7 +21,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#pragma once #pragma once
#include <math.h> #include <math.h>
#include <float.h>
#include <vector> #include <vector>
#include "Event.h" #include "Event.h"

View file

@ -12,15 +12,16 @@ IF(APPLE)
SET(MACOSX TRUE) SET(MACOSX TRUE)
ENDIF(APPLE) ENDIF(APPLE)
# HACK: in case mingw is not correctly detected, fix this. OPTION(AQUARIA_BETAEXPIRE "This build should expire in 30 days." FALSE)
IF(${CMAKE_GENERATOR} MATCHES ".*[mM][iI][nN][gG][wW].*") # really ugly hack to match "mingw" case-insensitive IF(AQUARIA_BETAEXPIRE)
set(MINGW 1) EXECUTE_PROCESS(
message(STATUS "!! Using MinGW hack !!") COMMAND date +%s
ENDIF() OUTPUT_VARIABLE BUILD_TIMESTAMP
ERROR_QUIET
IF(WIN32) OUTPUT_STRIP_TRAILING_WHITESPACE
OPTION(AQUARIA_NO_CONSOLE "No console window?" FALSE) )
ENDIF(WIN32) ADD_DEFINITIONS(-DBETAEXPIRE=${BUILD_TIMESTAMP})
ENDIF(AQUARIA_BETAEXPIRE)
# No Steamworks SDK for Linux at the moment. Roll our own achievements. # No Steamworks SDK for Linux at the moment. Roll our own achievements.
ADD_DEFINITIONS(-DBBGE_BUILD_ACHIEVEMENTS_INTERNAL=1) ADD_DEFINITIONS(-DBBGE_BUILD_ACHIEVEMENTS_INTERNAL=1)
@ -133,15 +134,17 @@ if (NOT SDL_FOUND)
set(SDLDIR "${EXTLIBDIR}/SDL12") set(SDLDIR "${EXTLIBDIR}/SDL12")
set(SDL_INCLUDE_DIR "${SDLDIR}/include") set(SDL_INCLUDE_DIR "${SDLDIR}/include")
message(STATUS "Using internal copy of SDL") message(STATUS "Using internal copy of SDL")
set(SDL_LIBRARY "${SDLDIR}/lib/macosx/libSDL-1.2.0.dylib") set(SDL_LIBRARY "${SDLDIR}/lib/macosx/libSDL-1.2.0.dylib;${SDLDIR}/lib/macosx/libSDLmain.a")
elseif(WIN32) elseif(WIN32)
if(MSVC)
set(SDLDIR "${EXTLIBDIR}/SDL12") set(SDLDIR "${EXTLIBDIR}/SDL12")
set(SDL_INCLUDE_DIR "${SDLDIR}/include" CACHE PATH "SDL include directory" FORCE) set(SDL_INCLUDE_DIR "${SDLDIR}/include" CACHE PATH "SDL include directory" FORCE)
message(STATUS "Using internal copy of SDL") message(STATUS "Using internal copy of SDL")
if(MSVC) set(SDLMAIN_LIBRARY "${SDLDIR}/lib/win32/SDLmain.lib" CACHE INTERNAL "")
set(SDL_LIBRARY "${SDLDIR}/lib/win32/SDL.lib" CACHE PATH "Where the SDL library can be found") set(SDL_LIBRARY_TEMP "${SDLDIR}/lib/win32/SDL.lib" CACHE INTERNAL "")
set(SDL_LIBRARY ${SDLMAIN_LIBRARY} ${SDL_LIBRARY_TEMP} CACHE STRING "Where the SDL library can be found")
else(MSVC) else(MSVC)
set(SDL_LIBRARY "${SDLDIR}/lib/win32/libSDL.dll.a" CACHE PATH "Where the SDL library can be found") message(SEND_ERROR "We don't have a prebuilt SDL for this environment.")
endif(MSVC) endif(MSVC)
else(MACOSX) else(MACOSX)
message(SEND_ERROR "We don't have a prebuilt SDL for this platform.") message(SEND_ERROR "We don't have a prebuilt SDL for this platform.")
@ -156,10 +159,14 @@ if(NOT AQUARIA_INTERNAL_OPENAL)
endif(NOT AQUARIA_INTERNAL_OPENAL) endif(NOT AQUARIA_INTERNAL_OPENAL)
if (NOT OPENAL_FOUND) if (NOT OPENAL_FOUND)
if(WIN32) if(WIN32)
if(MSVC)
set(OPENALDIR "${EXTLIBDIR}/AL") set(OPENALDIR "${EXTLIBDIR}/AL")
set(OPENAL_INCLUDE_DIR "${OPENALDIR}/include" CACHE PATH "OpenAL include directory" FORCE) set(OPENAL_INCLUDE_DIR "${OPENALDIR}/include" CACHE PATH "OpenAL include directory" FORCE)
message(STATUS "Using internal copy of OpenAL") message(STATUS "Using internal copy of OpenAL")
set(OPENAL_LIBRARY "${OPENALDIR}/lib/win32/OpenAL32.lib" CACHE FILEPATH "Where the OpenAL library can be found" FORCE) set(OPENAL_LIBRARY "${OPENALDIR}/lib/win32/OpenAL32.lib" CACHE FILEPATH "Where the OpenAL library can be found" FORCE)
else(MSVC)
message(SEND_ERROR "We don't have a prebuilt OpenAL for this environment.")
endif(MSVC)
else(WIN32) else(WIN32)
message(SEND_ERROR "We don't have a prebuilt OpenAL for this platform.") message(SEND_ERROR "We don't have a prebuilt OpenAL for this platform.")
endif(WIN32) endif(WIN32)
@ -178,6 +185,8 @@ INCLUDE_DIRECTORIES(${OGGVORBIS_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${OPENAL_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${OPENAL_INCLUDE_DIR})
# !!! FIXME: don't use fmod!
#INCLUDE_DIRECTORIES("${BBGEDIR}/fmodapi42604linux64/api/inc")
# Custom build ID: e.g. "-custom", " (my very own build)" # Custom build ID: e.g. "-custom", " (my very own build)"
SET(AQUARIA_CUSTOM_BUILD_ID "" CACHE STRING SET(AQUARIA_CUSTOM_BUILD_ID "" CACHE STRING
@ -187,11 +196,9 @@ if (NOT(AQUARIA_CUSTOM_BUILD_ID STREQUAL ""))
endif (NOT(AQUARIA_CUSTOM_BUILD_ID STREQUAL "")) endif (NOT(AQUARIA_CUSTOM_BUILD_ID STREQUAL ""))
# Aquaria/BBGE specific defines... # Aquaria/BBGE specific defines...
ADD_DEFINITIONS(-DGL_GLEXT_LEGACY=1) ADD_DEFINITIONS(-DGL_GLEXT_LEGACY=1)
ADD_DEFINITIONS(-DHAVE_PUTENV=1) ADD_DEFINITIONS(-DHAVE_PUTENV=1)
ADD_DEFINITIONS(-DTIXML_USE_STL=1) ADD_DEFINITIONS(-DTIXML_USE_STL=1)
ADD_DEFINITIONS(-DBBGE_SKIP_CONFIG_HEADERS=1) # if this is not defined, it will use .h files to set the necessary defines
ADD_DEFINITIONS(-DBBGE_BUILD_SDL=1) ADD_DEFINITIONS(-DBBGE_BUILD_SDL=1)
ADD_DEFINITIONS(-DBBGE_BUILD_FRAMEBUFFER=1) ADD_DEFINITIONS(-DBBGE_BUILD_FRAMEBUFFER=1)
#ADD_DEFINITIONS(-DBBGE_BUILD_SHADERS=1) #ADD_DEFINITIONS(-DBBGE_BUILD_SHADERS=1)
@ -213,10 +220,7 @@ ENDIF(MACOSX)
IF(WIN32) IF(WIN32)
ADD_DEFINITIONS(-DBBGE_BUILD_WINDOWS=1) ADD_DEFINITIONS(-DBBGE_BUILD_WINDOWS=1)
IF(AQUARIA_NO_CONSOLE)
SET(EXETYPE WIN32) SET(EXETYPE WIN32)
ADD_DEFINITIONS(-DAQUARIA_WIN32_NOCONSOLE=1)
ENDIF(AQUARIA_NO_CONSOLE)
ENDIF(WIN32) ENDIF(WIN32)
@ -418,13 +422,6 @@ SET(BBGE_SRCS_UNUSED
${BBGEDIR}/PointSprites.cpp ${BBGEDIR}/PointSprites.cpp
) )
IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR MINGW)
SET_SOURCE_FILES_PROPERTIES(
${BBGEDIR}/FmodOpenALBridge.cpp
PROPERTIES COMPILE_FLAGS "-fpermissive"
)
ENDIF()
SET(FTGL_SRCS SET(FTGL_SRCS
${FTGLSRCDIR}/FTCharmap.cpp ${FTGLSRCDIR}/FTCharmap.cpp
${FTGLSRCDIR}/FTContour.cpp ${FTGLSRCDIR}/FTContour.cpp

View file

@ -63,7 +63,7 @@ typedef size_t uintptr_t;
/* Enable the dummy video driver (src/video/dummy/\*.c) */ /* Enable the dummy video driver (src/video/dummy/\*.c) */
#define SDL_VIDEO_DRIVER_DUMMY 1 #define SDL_VIDEO_DRIVER_DUMMY 1
#if defined(_WINDOWS) || defined(_WIN32) #ifdef _WINDOWS
#define SDL_VIDEO_DRIVER_WINDIB 1 #define SDL_VIDEO_DRIVER_WINDIB 1
#endif #endif