diff --git a/JGE/include/JRenderer.h b/JGE/include/JRenderer.h index ebbc66a3a..0a7b264e3 100644 --- a/JGE/include/JRenderer.h +++ b/JGE/include/JRenderer.h @@ -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; diff --git a/JGE/include/JSoundSystem.h b/JGE/include/JSoundSystem.h index a1a88e271..93fe4f1e3 100644 --- a/JGE/include/JSoundSystem.h +++ b/JGE/include/JSoundSystem.h @@ -25,8 +25,7 @@ #elif defined USE_PHONON #include #include -#else -#ifdef WIN32 +#elif defined WIN32 #include #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; diff --git a/JGE/include/JTypes.h b/JGE/include/JTypes.h index 231161c22..9a2c9c594 100644 --- a/JGE/include/JTypes.h +++ b/JGE/include/JTypes.h @@ -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 @@ -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 //------------------------------------------------------------------------------------------------ diff --git a/JGE/src/Qtconsole.cpp b/JGE/src/Qtconsole.cpp index b93af3cf2..96b0c9efb 100644 --- a/JGE/src/Qtconsole.cpp +++ b/JGE/src/Qtconsole.cpp @@ -9,9 +9,8 @@ #include "GameOptions.h" #include "MTGDeck.h" #include "DebugRoutines.h" - -#include #include +#include 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() diff --git a/JGE/src/pc/JGfx.cpp b/JGE/src/pc/JGfx.cpp index 9c8ba2d2b..6050eeeab 100644 --- a/JGE/src/pc/JGfx.cpp +++ b/JGE/src/pc/JGfx.cpp @@ -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) diff --git a/projects/mtg/include/config.h b/projects/mtg/include/config.h index e25b8e557..ada8c7add 100644 --- a/projects/mtg/include/config.h +++ b/projects/mtg/include/config.h @@ -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 diff --git a/projects/mtg/wagic-qt.pro b/projects/mtg/wagic-qt.pro index 5b9f9a3ac..5f9544b9b 100644 --- a/projects/mtg/wagic-qt.pro +++ b/projects/mtg/wagic-qt.pro @@ -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