1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-10-17 11:59:28 +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 5b511f556a.
This commit is contained in:
fgenesis 2011-08-11 01:34:27 +02:00
commit ab11cdb4e4
10 changed files with 118 additions and 225 deletions

View file

@ -1,41 +0,0 @@
#ifndef __AQUARIA_COMPILE_CONFIG_H__
#define __AQUARIA_COMPILE_CONFIG_H__
// The settings below are also configurable with CMake.
// 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
#define AQUARIA_CUSTOM_BUILD_ID ""
// no console window in release mode (note for MSVC: use together with linker SubSystem setting)
#ifdef NDEBUG
# define AQUARIA_WIN32_NOCONSOLE
#endif
#endif
// Not CMake-configurable defines, change at your own risk
// Should stay always defined; this tracks visited map areas
#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 //__AQUARIA_COMPILE_CONFIG_H__

View file

@ -21,7 +21,6 @@ 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"
@ -363,10 +362,6 @@ enum FormUpgradeType
FORMUPGRADE_MAX
};
// defined by windows includes
#undef INPUT_MOUSE
#undef INPUT_KEYBOARD
enum InputMode
{
INPUT_MOUSE = 0,

View file

@ -7812,7 +7812,7 @@ void Game::setControlHint(const std::string &h, bool left, bool right, bool midd
Vector p = controlHint_mouseLeft->position + Vector(-100,0);
os.seekp(0);
os << "song/songslot-" << dsq->continuity.getSongSlotByType(songType) << '\0';
os << "song/songslot-" << dsq->continuity.getSongSlotByType(songType);
Quad *q = new Quad(os.str(), p);
q->followCamera = 1;
q->scale = Vector(0.7, 0.7);
@ -7827,7 +7827,7 @@ void Game::setControlHint(const std::string &h, bool left, bool right, bool midd
int note = song->notes[i];
os.seekp(0);
os << "song/notebutton-" << note << '\0';
os << "song/notebutton-" << note;
Quad *q = new Quad(os.str(), p);
q->color = dsq->getNoteColor(note)*0.5f + Vector(1, 1, 1)*0.5f;
q->followCamera = 1;

View file

@ -18,119 +18,54 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
//#define SANITY_TEST
#ifdef SANITY_TEST
#include "Core.h"
#include "Quad.h"
class SanityTest : public Core
{
std::string dud;
public:
#include "DSQ.h"
SanityTest() : Core(dud)
{
}
void init()
{
Core::init();
if (!createWindow(800,600,32,0, "Aquaria")) return;
debugLog("Init Input Library...");
initInputLibrary();
debugLog("OK");
debugLog("Init Sound Library...");
initSoundLibrary();
debugLog("OK");
debugLog("Init Graphics Library...");
initGraphicsLibrary(0, 1);
core->enable2D(800);
//core->initFrameBuffer();
debugLog("OK");
renderObjectLayers.resize(2);
Quad *q = new Quad;
q->setTexture("gfx/Logo");
q->position = Vector(400,300);
addRenderObject(q, 1);
}
void onUpdate(float dt)
{
Core::onUpdate(dt);
if (core->getKeyState(KEY_ESCAPE))
quit();
}
};
int WINAPI WinMain( HINSTANCE hInstance, // Instance
HINSTANCE hPrevInstance, // Previous Instance
LPSTR lpCmdLine, // Command Line Parameters
int nCmdShow) // Window Show State
{
#ifdef _DEBUG
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
_CrtSetReportMode ( _CRT_ERROR, _CRTDBG_MODE_DEBUG);
#endif
{
SanityTest core;
core.init();
core.main();
core.shutdown();
}
return (0);
}
#else
#include "DSQ.h"
#ifdef BBGE_BUILD_WINDOWS
#include <shellapi.h>
#endif
void enumerateTest()
{
#ifdef BBGE_BUILD_SDL
SDL_Rect **modes;
/* Get available fullscreen/hardware modes */
modes=SDL_ListModes(NULL, SDL_FULLSCREEN|SDL_HWSURFACE);
static void MakeRan(void)
{
#ifdef BBGE_BUILD_WINDOWS
/* Check is there are any modes available */
if(modes == (SDL_Rect **)0){
MessageBox(0, "No modes available!\n", "", MB_OK);
return;
}
/* Check if or resolution is restricted */
if(modes == (SDL_Rect **)-1){
MessageBox(0, "All resolutions available.\n", "", MB_OK);
}
else{
/* Print valid modes */
printf("Available Modes\n");
for(int i=0;modes[i];++i){
std::ostringstream os;
os << "[" << modes[i]->w << "x" << modes[i]->h << "]";
MessageBox(0, os.str().c_str(), "", MB_OK);
//printf(" %d x %d\n", modes[i]->w, modes[i]->h);
}
}
std::ofstream out("ran");
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))
{
MakeRan();
if(exists("aqconfig.exe", false))
{
ShellExecute(NULL, "open", "aqconfig.exe", NULL, NULL, SW_SHOWNORMAL);
exit(0);
}
}
#endif
}
remove("ran");
#endif
}
static void CheckConfig(void)
{
#ifdef BBGE_BUILD_WINDOWS
bool hasCfg = exists("usersettings.xml", false);
if(!hasCfg)
StartAQConfig();
#endif
}
#if defined(BBGE_BUILD_WINDOWS) && defined(AQUARIA_WIN32_NOCONSOLE)
#if defined(BBGE_BUILD_WINDOWS) && !defined(BBGE_BUILD_SDL)
int WINAPI WinMain( HINSTANCE hInstance, // Instance
HINSTANCE hPrevInstance, // Previous Instance
LPSTR lpCmdLine, // Command Line Parameters
@ -141,12 +76,54 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
_CrtSetReportMode ( _CRT_ERROR, _CRTDBG_MODE_DEBUG);
#endif
std::string dsqParam = GetCommandLine();
DSQ core(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)
@ -166,17 +143,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
remove("ran");
#endif
std::string dsqParam = "";
std::string fileSystem = "";
#ifdef BBGE_BUILD_UNIX
const char *envPath = getenv("AQUARIA_DATA_PATH");
if (envPath != NULL)
dsqParam = envPath;
fileSystem = envPath;
#endif
DSQ core(fileSystem);
#endif
#endif
DSQ core(dsqParam);
{
core.init();
//enumerateTest();
@ -184,14 +159,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
core.shutdown();
}
#ifdef BBGE_BUILD_WINDOWS
std::ofstream out("ran");
for (int i = 0; i < 1; i++)
out << rand()%1000;
out.close();
#endif
return (0);
}
#endif

View file

@ -23,6 +23,10 @@ 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