diff --git a/Source/Glide64/GlideExtensions.h b/Source/Glide64/GlideExtensions.h index 787be1506..86f6f206d 100644 --- a/Source/Glide64/GlideExtensions.h +++ b/Source/Glide64/GlideExtensions.h @@ -44,20 +44,31 @@ typedef FxU32 GrCombineMode_t; #define GR_TEXTURE_UMA_EXT 0x06 //wrapper specific -#ifdef _WIN32 -FX_ENTRY void FX_CALL grConfigWrapperExt(FxI32, FxI32, FxBool, FxBool); -#else -FX_ENTRY void FX_CALL grConfigWrapperExt(FxI32, FxBool, FxBool); +FX_ENTRY void FX_CALL grConfigWrapperExt( +#ifndef ANDROID + FxI32, /* resolution parameter not supported on Android */ #endif + FxI32, + FxBool, + FxBool +); FX_ENTRY GrScreenResolution_t FX_CALL grWrapperFullScreenResolutionExt(FxU32*, FxU32*); FX_ENTRY char ** FX_CALL grQueryResolutionsExt(int32_t*); FX_ENTRY FxBool FX_CALL grKeyPressedExt(FxU32 key); FX_ENTRY void FX_CALL grGetGammaTableExt(FxU32, FxU32*, FxU32*, FxU32*); -#ifdef _WIN32 -FX_ENTRY GrContext_t FX_CALL grSstWinOpenExt(HWND hWnd, GrScreenResolution_t screen_resolution, GrScreenRefresh_t refresh_rate, GrColorFormat_t color_format, GrOriginLocation_t origin_location, GrPixelFormat_t pixelformat, int nColBuffers, int nAuxBuffers); -#else -FX_ENTRY GrContext_t FX_CALL grSstWinOpenExt(GrScreenRefresh_t refresh_rate, GrColorFormat_t color_format, GrOriginLocation_t origin_location, GrPixelFormat_t pixelformat, int nColBuffers, int nAuxBuffers); +FX_ENTRY GrContext_t FX_CALL grSstWinOpenExt( +#ifndef ANDROID + HWND hWnd, + GrScreenResolution_t screen_resolution, +#endif + GrScreenRefresh_t refresh_rate, + GrColorFormat_t color_format, + GrOriginLocation_t origin_location, + GrPixelFormat_t pixelformat, + int nColBuffers, + int nAuxBuffers +); #endif //color combiner diff --git a/Source/Glide64/Main.cpp b/Source/Glide64/Main.cpp index 69d02ef1a..7357ada87 100644 --- a/Source/Glide64/Main.cpp +++ b/Source/Glide64/Main.cpp @@ -281,11 +281,13 @@ void ChangeSize() void ConfigWrapper() { -#ifdef _WIN32 - grConfigWrapperExt(g_settings->wrpResolution, g_settings->wrpVRAM * 1024 * 1024, g_settings->wrpFBO, g_settings->wrpAnisotropic); + grConfigWrapperExt( +#ifdef ANDROID + g_settings->wrpVRAM * 1024 * 1024, g_settings->wrpFBO, g_settings->wrpAnisotropic #else - grConfigWrapperExt(g_settings->wrpVRAM * 1024 * 1024, g_settings->wrpFBO, g_settings->wrpAnisotropic); + g_settings->wrpResolution, g_settings->wrpVRAM * 1024 * 1024, g_settings->wrpFBO, g_settings->wrpAnisotropic #endif + ); } void UseUnregisteredSetting(int /*SettingID*/) @@ -859,6 +861,10 @@ int InitGfx() } //*/ +/* + * 2016.03.27 cxd4 -- to do: #ifdef _WIN32 or #ifndef _ANDROID? + * Can't tell which one is correct here, but I think the latter. + */ #ifdef _WIN32 uint32_t res_data = g_settings->res_data; if (ev_fullscreen) @@ -1401,7 +1407,7 @@ int CALL InitiateGFX(GFX_INFO Gfx_Info) ReadSettings(); char name[21] = "DEFAULT"; ReadSpecialSettings(name); -#ifdef _WIN32 +#ifndef ANDROID g_settings->res_data_org = g_settings->res_data; #endif @@ -1430,11 +1436,13 @@ int CALL InitiateGFX(GFX_INFO Gfx_Info) if (fb_depth_render_enabled) ZLUT_init(); + grConfigWrapperExt( #ifdef _WIN32 - grConfigWrapperExt(g_settings->wrpResolution, g_settings->wrpVRAM * 1024 * 1024, g_settings->wrpFBO, g_settings->wrpAnisotropic); + g_settings->wrpResolution, g_settings->wrpVRAM * 1024 * 1024, g_settings->wrpFBO, g_settings->wrpAnisotropic #else - grConfigWrapperExt(g_settings->wrpVRAM * 1024 * 1024, g_settings->wrpFBO, g_settings->wrpAnisotropic); + g_settings->wrpVRAM * 1024 * 1024, g_settings->wrpFBO, g_settings->wrpAnisotropic #endif + ); grGlideInit(); grSstSelect(0); diff --git a/Source/Glide64/Settings.cpp b/Source/Glide64/Settings.cpp index 6b55a12dc..298fc6430 100644 --- a/Source/Glide64/Settings.cpp +++ b/Source/Glide64/Settings.cpp @@ -6,7 +6,7 @@ res_x(640), scr_res_x(640), res_y(480), scr_res_y(480), -#ifdef _WIN32 +#ifndef ANDROID res_data(GR_RESOLUTION_640x480), res_data_org(GR_RESOLUTION_640x480), #endif @@ -94,7 +94,7 @@ n64_z_scale(0), //scale vertex z value before writing to depth buffer, as N64 do hacks(0), //wrapper settings -#ifdef _WIN32 +#ifndef ANDROID wrpResolution(0), #endif wrpVRAM(0), diff --git a/Source/Glide64/Settings.h b/Source/Glide64/Settings.h index 070a45a7d..d7198524c 100644 --- a/Source/Glide64/Settings.h +++ b/Source/Glide64/Settings.h @@ -9,7 +9,7 @@ public: uint32_t res_x, scr_res_x; uint32_t res_y, scr_res_y; -#ifdef _WIN32 +#ifndef ANDROID uint32_t res_data, res_data_org; #endif @@ -157,7 +157,7 @@ public: uint32_t hacks; //wrapper settings -#ifdef _WIN32 +#ifndef ANDROID int wrpResolution; #endif int wrpVRAM; diff --git a/Source/Glitch64/glitchmain.h b/Source/Glitch64/glitchmain.h index 681e10c59..e5e20c89c 100644 --- a/Source/Glitch64/glitchmain.h +++ b/Source/Glitch64/glitchmain.h @@ -17,7 +17,7 @@ extern int dumping; typedef struct _wrapper_config { -#ifdef _WIN32 +#ifndef ANDROID int res; #endif int fbo; @@ -178,11 +178,14 @@ void disable_textureSizes(); // config functions -#ifdef _WIN32 -FX_ENTRY void FX_CALL grConfigWrapperExt(FxI32, FxI32, FxBool, FxBool); -#else -FX_ENTRY void FX_CALL grConfigWrapperExt(FxI32, FxBool, FxBool); +FX_ENTRY void FX_CALL grConfigWrapperExt( +#ifndef ANDROID + FxI32, /* resolution parameter not supported on Android build */ #endif + FxI32, + FxBool, + FxBool +); FX_ENTRY GrScreenResolution_t FX_CALL grWrapperFullScreenResolutionExt(FxU32*, FxU32*); FX_ENTRY char ** FX_CALL grQueryResolutionsExt(int32_t*); FX_ENTRY FxBool FX_CALL grKeyPressedExt(FxU32 key); diff --git a/Source/Glitch64/inc/glide.h b/Source/Glitch64/inc/glide.h index b232cae0f..138d79e80 100644 --- a/Source/Glitch64/inc/glide.h +++ b/Source/Glitch64/inc/glide.h @@ -623,11 +623,13 @@ grFinish(void); FX_ENTRY void FX_CALL grFlush(void); -#ifdef _WIN32 -FX_ENTRY GrContext_t FX_CALL grSstWinOpen( HWND hWnd, GrScreenResolution_t screen_resolution, GrScreenRefresh_t refresh_rate, GrColorFormat_t color_format, GrOriginLocation_t origin_location, int nColBuffers, int nAuxBuffers); +FX_ENTRY GrContext_t FX_CALL grSstWinOpen( +#ifdef ANDROID + GrScreenRefresh_t refresh_rate, GrColorFormat_t color_format, GrOriginLocation_t origin_location, int nColBuffers, int nAuxBuffers #else -FX_ENTRY GrContext_t FX_CALL grSstWinOpen( GrScreenRefresh_t refresh_rate, GrColorFormat_t color_format, GrOriginLocation_t origin_location, int nColBuffers, int nAuxBuffers); + HWND hWnd, GrScreenResolution_t screen_resolution, GrScreenRefresh_t refresh_rate, GrColorFormat_t color_format, GrOriginLocation_t origin_location, int nColBuffers, int nAuxBuffers #endif +); FX_ENTRY FxBool FX_CALL grSstWinClose( GrContext_t context );