Fixed compilation on Windows.

This commit is contained in:
xawotihs
2013-10-31 23:48:19 +01:00
parent ea98b769a7
commit fea5b04a77
7 changed files with 32 additions and 27 deletions

View File

@@ -578,7 +578,7 @@ private:
#if (!defined PSP) #if (!defined PSP)
GLuint mCurrentTex; GLuint mCurrentTex;
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) || (defined WIN32) #if ((defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) || (defined WIN32)) && (!defined CONSOLE_CONFIG)
// MVP matrix // MVP matrix
ESMatrix theMvpMatrix; ESMatrix theMvpMatrix;

View File

@@ -25,8 +25,7 @@
#elif defined USE_PHONON #elif defined USE_PHONON
#include <phonon/AudioOutput> #include <phonon/AudioOutput>
#include <phonon/MediaObject> #include <phonon/MediaObject>
#else #elif defined WIN32
#ifdef WIN32
#include <windows.h> #include <windows.h>
#define WITH_FMOD #define WITH_FMOD
#elif defined (PSP) #elif defined (PSP)
@@ -43,10 +42,10 @@
#include "JAudio.h" #include "JAudio.h"
#include "JMP3.h" #include "JMP3.h"
#endif #endif
#ifdef WITH_FMOD #ifdef WITH_FMOD
#include "../Dependencies/include/fmod.h" #include "../Dependencies/include/fmod.h"
#endif #endif
#endif
//------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------
using namespace std; using namespace std;

View File

@@ -75,16 +75,7 @@ enum {
#define SCREEN_HEIGHT_F 272.0f #define SCREEN_HEIGHT_F 272.0f
#ifdef WIN32 #ifdef CONSOLE_CONFIG
// #define DEFAULT_BLEND BLEND_DEFAULT
// #define BLEND_OPTION_ADD BLEND_COLORADD
// #define BLEND_OPTION_BLEND (BLEND_COLORADD | BLEND_ALPHABLEND | BLEND_NOZWRITE)
#else
#ifndef CONSOLE_CONFIG
#define DEFAULT_BLEND GU_TFX_MODULATE
#define BLEND_OPTION_ADD GU_TFX_ADD
#define BLEND_OPTION_BLEND GU_TFX_BLEND
#else
#define DEFAULT_BLEND 0 #define DEFAULT_BLEND 0
#define BLEND_OPTION_ADD 0 #define BLEND_OPTION_ADD 0
#define BLEND_OPTION_BLEND 0 #define BLEND_OPTION_BLEND 0
@@ -100,9 +91,17 @@ enum {
#define BLEND_ONE_MINUS_DST_COLOR 0 #define BLEND_ONE_MINUS_DST_COLOR 0
#define BLEND_SRC_ALPHA_SATURATE 0 #define BLEND_SRC_ALPHA_SATURATE 0
#define GU_PSM_5551 0 #define GU_PSM_5551 0
#else
#endif // CONSOLE_CONFIG #ifdef WIN32
// #define DEFAULT_BLEND BLEND_DEFAULT
// #define BLEND_OPTION_ADD BLEND_COLORADD
// #define BLEND_OPTION_BLEND (BLEND_COLORADD | BLEND_ALPHABLEND | BLEND_NOZWRITE)
#else
#define DEFAULT_BLEND GU_TFX_MODULATE
#define BLEND_OPTION_ADD GU_TFX_ADD
#define BLEND_OPTION_BLEND GU_TFX_BLEND
#endif #endif
#endif // CONSOLE_CONFIG
#if (defined WIN32) && (!defined LINUX) #if (defined WIN32) && (!defined LINUX)
#include <windows.h> #include <windows.h>
@@ -111,6 +110,10 @@ enum {
typedef uint8_t byte; typedef uint8_t byte;
typedef uint32_t DWORD; typedef uint32_t DWORD;
typedef uint8_t BYTE; typedef uint8_t BYTE;
#ifndef IOS
typedef bool BOOL;
#endif
#endif
typedef int8_t s8; typedef int8_t s8;
typedef int16_t s16; typedef int16_t s16;
@@ -122,10 +125,6 @@ typedef uint32_t u32;
#define ARGB(a, r, g, b) ((PIXEL_TYPE)((a) << 24) | ((r) << 16) | ((g) << 8) | (b)) #define ARGB(a, r, g, b) ((PIXEL_TYPE)((a) << 24) | ((r) << 16) | ((g) << 8) | (b))
#define RGBA(r, g, b, a) ((PIXEL_TYPE)((a) << 24) | ((b) << 16) | ((g) << 8) | (r)) #define RGBA(r, g, b, a) ((PIXEL_TYPE)((a) << 24) | ((b) << 16) | ((g) << 8) | (r))
#define TEXTURE_FORMAT 0 #define TEXTURE_FORMAT 0
#ifndef IOS
typedef bool BOOL;
#endif
#endif
@@ -267,6 +266,7 @@ typedef struct
#endif #endif
#else #else
typedef uint32_t GLuint; typedef uint32_t GLuint;
typedef float GLfloat;
#endif //CONSOLE_CONFIG #endif //CONSOLE_CONFIG
//------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------

View File

@@ -9,9 +9,8 @@
#include "GameOptions.h" #include "GameOptions.h"
#include "MTGDeck.h" #include "MTGDeck.h"
#include "DebugRoutines.h" #include "DebugRoutines.h"
#include <sys/time.h>
#include <QCoreApplication> #include <QCoreApplication>
#include <QElapsedTimer>
class WagicWrapper class WagicWrapper
{ {
@@ -19,17 +18,21 @@ public:
WagicWrapper(); WagicWrapper();
virtual ~WagicWrapper(); virtual ~WagicWrapper();
public:
// used mainly to mesure the delta between 2 updates
static QElapsedTimer g_startTimer;
private: private:
JGE* m_engine; JGE* m_engine;
JApp* m_app; JApp* m_app;
JGameLauncher* m_launcher; JGameLauncher* m_launcher;
}; };
QElapsedTimer WagicWrapper::g_startTimer;
int JGEGetTime() int JGEGetTime()
{ {
struct timeval tv; return (int)WagicWrapper::g_startTimer.elapsed();
gettimeofday(&tv, NULL);
return tv.tv_sec * 1000 + tv.tv_usec / 1000;
} }
bool JGEToggleFullscreen() bool JGEToggleFullscreen()
@@ -57,6 +60,7 @@ WagicWrapper::WagicWrapper()
m_app->Create(); m_app->Create();
m_engine->SetApp(m_app); m_engine->SetApp(m_app);
JRenderer::GetInstance()->Enable2D(); JRenderer::GetInstance()->Enable2D();
g_startTimer.restart();
} }
WagicWrapper::~WagicWrapper() WagicWrapper::~WagicWrapper()

View File

@@ -823,7 +823,7 @@ void JRenderer::BeginScene()
esMatrixLoadIdentity(&theMvpMatrix); esMatrixLoadIdentity(&theMvpMatrix);
esOrtho(&theMvpMatrix, 0.0f, SCREEN_WIDTH_F, 0.0f, SCREEN_HEIGHT_F-1.0f,-1.0f, 1.0f); esOrtho(&theMvpMatrix, 0.0f, SCREEN_WIDTH_F, 0.0f, SCREEN_HEIGHT_F-1.0f,-1.0f, 1.0f);
#endif //(!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0) #endif //(!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0)
#if (defined WIN32) || ((defined GL_VERSION_ES_CM_1_1) && (!defined IOS)) #if (defined WIN32 && !defined GL_ES_VERSION_2_0) || ((defined GL_VERSION_ES_CM_1_1) && (!defined IOS))
float scaleH = mActualHeight/SCREEN_HEIGHT_F; float scaleH = mActualHeight/SCREEN_HEIGHT_F;
float scaleW = mActualWidth/SCREEN_WIDTH_F; float scaleW = mActualWidth/SCREEN_WIDTH_F;
if (scaleH != 1.0f || scaleW != 1.0f) if (scaleH != 1.0f || scaleW != 1.0f)

View File

@@ -1,7 +1,7 @@
#ifndef _DEBUG_H_ #ifndef _DEBUG_H_
#define _DEBUG_H_ #define _DEBUG_H_
#if ((defined WIN32) || (defined WP8)) && (!defined QT_CONFIG) #if ((defined WIN32) || (defined WP8))
#define snprintf sprintf_s #define snprintf sprintf_s
#endif #endif

View File

@@ -68,6 +68,8 @@ INCLUDEPATH += include
#!symbian:DESTDIR = bin #!symbian:DESTDIR = bin
unix:!symbian:LIBS += -lz unix:!symbian:LIBS += -lz
win32:LIBS += ../../JGE/Dependencies/lib/fmodvc.lib
win32:LIBS += ../../JGE/Dependencies/lib/zlibd.lib
PRECOMPILED_HEADER = include/PrecompiledHeader.h PRECOMPILED_HEADER = include/PrecompiledHeader.h
#DEFINES += TRACK_OBJECT_USAGE #DEFINES += TRACK_OBJECT_USAGE