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)
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
ESMatrix theMvpMatrix;

View File

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

View File

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

View File

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

View File

@@ -823,7 +823,7 @@ void JRenderer::BeginScene()
esMatrixLoadIdentity(&theMvpMatrix);
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)
#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 scaleW = mActualWidth/SCREEN_WIDTH_F;
if (scaleH != 1.0f || scaleW != 1.0f)

View File

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

View File

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