Fixed compilation on Windows.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user