diff --git a/Source/Project64-video/Config.cpp b/Source/Project64-video/Config.cpp index 1a0b81b47..8a0e0db64 100644 --- a/Source/Project64-video/Config.cpp +++ b/Source/Project64-video/Config.cpp @@ -19,6 +19,7 @@ #include #include #include "SettingsID.h" +#include "ScreenResolution.h" #ifdef _WIN32 #include @@ -274,7 +275,7 @@ public: m_cmbFSResolution.Attach(GetDlgItem(IDC_CMB_FS_RESOLUTION)); int32_t size = 0; - char ** aRes = grQueryResolutionsExt(&size); + const char ** aRes = getFullScreenResList(&size); if (aRes && size) { for (int r = 0; r < size; r++) diff --git a/Source/Project64-video/Gfx_1.3.h b/Source/Project64-video/Gfx_1.3.h index c18c44cb5..fae49ab37 100644 --- a/Source/Project64-video/Gfx_1.3.h +++ b/Source/Project64-video/Gfx_1.3.h @@ -17,9 +17,7 @@ #include #include #include // offsetof -#include #include -#include "GlideExtensions.h" #include "rdp.h" #include "Config.h" #include "Settings.h" diff --git a/Source/Project64-video/Main.cpp b/Source/Project64-video/Main.cpp index 9fd07662e..269ea1163 100644 --- a/Source/Project64-video/Main.cpp +++ b/Source/Project64-video/Main.cpp @@ -500,7 +500,7 @@ int InitGfx() grGet(GR_MAX_TEXTURE_SIZE, 4, (FxI32*)&voodoo.max_tex_size); voodoo.sup_large_tex = (voodoo.max_tex_size > 256 && !g_settings->hacks(CSettings::hack_PPL)); - voodoo.tex_min_addr[0] = voodoo.tex_min_addr[1] = grTexMinAddress(GR_TMU0); + voodoo.tex_min_addr[0] = voodoo.tex_min_addr[1] = gfxTexMinAddress(GR_TMU0); voodoo.tex_max_addr[0] = voodoo.tex_max_addr[1] = grTexMaxAddress(GR_TMU0); // Is mirroring allowed? diff --git a/Source/Project64-video/Renderer/OGLESglitchmain.cpp b/Source/Project64-video/Renderer/OGLESglitchmain.cpp index 497bf7ad7..52923a208 100644 --- a/Source/Project64-video/Renderer/OGLESglitchmain.cpp +++ b/Source/Project64-video/Renderer/OGLESglitchmain.cpp @@ -708,7 +708,7 @@ FX_ENTRY void FX_CALL grTextureBufferExt(GrChipID_t tmu, curBufferAddr = pBufferAddress = startAddress + 1; pBufferFmt = fmt; - int rtmu = startAddress < grTexMinAddress(GR_TMU1) ? 0 : 1; + int rtmu = startAddress < gfxTexMinAddress(GR_TMU1) ? 0 : 1; int size = pBufferWidth*pBufferHeight * 2; //grTexFormatSize(fmt); if ((unsigned int)tmu_usage[rtmu].min > pBufferAddress) tmu_usage[rtmu].min = pBufferAddress; diff --git a/Source/Project64-video/Renderer/OGLEStextures.cpp b/Source/Project64-video/Renderer/OGLEStextures.cpp index 5ec6c29ae..1ab21eb37 100644 --- a/Source/Project64-video/Renderer/OGLEStextures.cpp +++ b/Source/Project64-video/Renderer/OGLEStextures.cpp @@ -22,7 +22,6 @@ #include #include - int TMU_SIZE = 8 * 2048 * 2048; static unsigned char* texture = NULL; @@ -139,8 +138,7 @@ void free_textures() } } -FX_ENTRY FxU32 FX_CALL -grTexMinAddress(GrChipID_t tmu) +FxU32 gfxTexMinAddress(GrChipID_t tmu) { WriteTrace(TraceGlitch, TraceDebug, "tmu = %d", tmu); if (UMAmode) diff --git a/Source/Project64-video/Renderer/OGLglitchmain.cpp b/Source/Project64-video/Renderer/OGLglitchmain.cpp index 3c8bd6074..7c6f8809c 100644 --- a/Source/Project64-video/Renderer/OGLglitchmain.cpp +++ b/Source/Project64-video/Renderer/OGLglitchmain.cpp @@ -997,7 +997,7 @@ FX_ENTRY void FX_CALL grTextureBufferExt(GrChipID_t tmu, curBufferAddr = pBufferAddress = startAddress + 1; pBufferFmt = fmt; - int rtmu = startAddress < grTexMinAddress(GR_TMU1) ? 0 : 1; + int rtmu = startAddress < gfxTexMinAddress(GR_TMU1) ? 0 : 1; int size = pBufferWidth*pBufferHeight * 2; //grTexFormatSize(fmt); if (tmu_usage[rtmu].min > pBufferAddress + 0) tmu_usage[rtmu].min = pBufferAddress + 0; diff --git a/Source/Project64-video/Renderer/OGLtextures.cpp b/Source/Project64-video/Renderer/OGLtextures.cpp index 5a6d0f610..9502b3e20 100644 --- a/Source/Project64-video/Renderer/OGLtextures.cpp +++ b/Source/Project64-video/Renderer/OGLtextures.cpp @@ -139,8 +139,7 @@ void free_textures() } } -FX_ENTRY FxU32 FX_CALL -grTexMinAddress(GrChipID_t tmu) +FxU32 gfxTexMinAddress(GrChipID_t tmu) { WriteTrace(TraceGlitch, TraceDebug, "tmu = %d", tmu); if (UMAmode) diff --git a/Source/Project64-video/Renderer/Renderer.h b/Source/Project64-video/Renderer/Renderer.h index 91f77346c..106bea9dd 100644 --- a/Source/Project64-video/Renderer/Renderer.h +++ b/Source/Project64-video/Renderer/Renderer.h @@ -13,6 +13,10 @@ ****************************************************************************/ #pragma once #include +#include +#include "../GlideExtensions.h" + +FxU32 gfxTexMinAddress(GrChipID_t tmu); extern uint32_t nbTextureUnits; extern uint32_t g_scr_res_x, g_scr_res_y, g_res_x, g_res_y; diff --git a/Source/Project64-video/ScreenResolution.cpp b/Source/Project64-video/ScreenResolution.cpp index 7e16dfc8c..73f341d5e 100644 --- a/Source/Project64-video/ScreenResolution.cpp +++ b/Source/Project64-video/ScreenResolution.cpp @@ -88,7 +88,7 @@ void UpdateScreenResolution(int ScreenWidth, int ScreenHeight) switch (g_settings->aspectmode()) { case CSettings::Aspect_4x3: - g_resolutions.push_back(ResolutionInfo(stdstr_f("%dx%d", ScreenHeight * 4/3, ScreenHeight).c_str(), ScreenHeight * 4 / 3, ScreenHeight, 0, true)); + g_resolutions.push_back(ResolutionInfo(stdstr_f("%dx%d", ScreenHeight * 4 / 3, ScreenHeight).c_str(), ScreenHeight * 4 / 3, ScreenHeight, 0, true)); g_resolutions.push_back(ResolutionInfo("960x720", 960, 720, 0, false)); g_resolutions.push_back(ResolutionInfo("800x600", 800, 600, 0, false)); g_resolutions.push_back(ResolutionInfo("640x480", 640, 480, 0, false)); @@ -165,9 +165,9 @@ uint32_t GetScreenResHeight(uint32_t index) class FullScreenResolutions { public: - FullScreenResolutions() : + FullScreenResolutions() : m_dwNumResolutions(0), - m_aResolutions(0), + m_aResolutions(0), m_aResolutionsStr(0) { } @@ -202,14 +202,14 @@ public: return m_currentResolutions; } - char ** getResolutionsList(int32_t * Size) + const char ** getResolutionsList(int32_t * Size) { if (m_dwNumResolutions == 0) { init(); } *Size = (int32_t)m_dwNumResolutions; - return m_aResolutionsStr; + return (const char **)m_aResolutionsStr; } bool changeDisplaySettings(uint32_t _resolution); @@ -340,13 +340,13 @@ int GetCurrentResIndex(void) } #ifndef ANDROID -char ** grQueryResolutionsExt(int32_t * Size) +const char ** getFullScreenResList(int32_t * Size) { WriteTrace(TraceGlitch, TraceDebug, "-"); return g_FullScreenResolutions.getResolutionsList(Size); } -uint32_t grWrapperFullScreenResolutionExt(uint32_t * width, uint32_t * height) +uint32_t getFullScreenRes(uint32_t * width, uint32_t * height) { WriteTrace(TraceGlitch, TraceDebug, "-"); g_FullScreenResolutions.getResolution(g_settings->FullScreenRes(), width, height); diff --git a/Source/Project64-video/ScreenResolution.h b/Source/Project64-video/ScreenResolution.h index 96d23382f..4534d0ab0 100644 --- a/Source/Project64-video/ScreenResolution.h +++ b/Source/Project64-video/ScreenResolution.h @@ -13,7 +13,11 @@ #ifdef ANDROID void UpdateScreenResolution(int ScreenWidth, int ScreenHeight); +#else +const char ** getFullScreenResList(int32_t * Size); +uint32_t getFullScreenRes(uint32_t * width, uint32_t * height); #endif + uint32_t GetScreenResolutionCount(); uint32_t GetDefaultScreenRes(); uint32_t GetScreenResWidth(uint32_t index);