[Video] change gfxSstWinOpen and gfxSstWinClose

This commit is contained in:
zilmar 2017-07-23 12:53:37 +10:00
parent 87efd0c259
commit f14c857bce
4 changed files with 15 additions and 17 deletions

View File

@ -51,7 +51,6 @@ GFX_INFO gfx;
int to_fullscreen = FALSE;
int GfxInitDone = FALSE;
bool g_romopen = false;
GrContext_t gfx_context = 0;
int exception = FALSE;
int evoodoo = 0;
@ -474,8 +473,7 @@ int InitGfx()
#ifndef ANDROID
SetWindowDisplaySize((HWND)gfx.hWnd);
#endif
gfx_context = gfxSstWinOpen(GR_COLORFORMAT_RGBA, GR_ORIGIN_UPPER_LEFT, 2, 1);
if (!gfx_context)
if (!gfxSstWinOpen(GR_COLORFORMAT_RGBA, GR_ORIGIN_UPPER_LEFT, 2, 1))
{
g_Notify->DisplayError("Error setting display mode");
return FALSE;
@ -639,7 +637,7 @@ void ReleaseGfx()
}
// Release graphics
gfxSstWinClose(gfx_context);
gfxSstWinClose();
GfxInitDone = FALSE;
rdp.window_changed = TRUE;

View File

@ -319,7 +319,7 @@ int isWglExtensionSupported(const char *extension)
# endif
#endif
GrContext_t gfxSstWinOpen(GrColorFormat_t color_format, GrOriginLocation_t origin_location, int nColBuffers, int nAuxBuffers)
bool gfxSstWinOpen(GrColorFormat_t color_format, GrOriginLocation_t origin_location, int nColBuffers, int nAuxBuffers)
{
static int show_warning = 1;
@ -509,10 +509,10 @@ GrContext_t gfxSstWinOpen(GrColorFormat_t color_format, GrOriginLocation_t origi
return 1;
}
bool gfxSstWinClose(GrContext_t context)
bool gfxSstWinClose()
{
WriteTrace(TraceGlitch, TraceDebug, "-");
int i, clear_texbuff = use_fbo;
WriteTrace(TraceGlitch, TraceDebug, "context: %d", context);
for (i = 0; i < 2; i++) {
tmu_usage[i].min = 0xfffffff;

View File

@ -451,7 +451,7 @@ int isWglExtensionSupported(const char *extension)
extern HWND g_hwnd_win;
#endif
GrContext_t gfxSstWinOpen(GrColorFormat_t color_format, GrOriginLocation_t origin_location, int nColBuffers, int nAuxBuffers)
bool gfxSstWinOpen(GrColorFormat_t color_format, GrOriginLocation_t origin_location, int nColBuffers, int nAuxBuffers)
{
static int show_warning = 1;
@ -514,7 +514,7 @@ GrContext_t gfxSstWinOpen(GrColorFormat_t color_format, GrOriginLocation_t origi
if ((hGLRC = wglCreateContext(hDC)) == 0)
{
WriteTrace(TraceGlitch, TraceWarning, "wglCreateContext failed!");
gfxSstWinClose(0);
gfxSstWinClose();
return FXFALSE;
}
@ -525,7 +525,7 @@ GrContext_t gfxSstWinOpen(GrColorFormat_t color_format, GrOriginLocation_t origi
if (!wglMakeCurrent(hDC, hGLRC))
{
WriteTrace(TraceGlitch, TraceWarning, "wglMakeCurrent failed!");
gfxSstWinClose(0);
gfxSstWinClose();
return FXFALSE;
}
}
@ -801,13 +801,13 @@ GrContext_t gfxSstWinOpen(GrColorFormat_t color_format, GrOriginLocation_t origi
return 1;
}
bool gfxSstWinClose(GrContext_t context)
bool gfxSstWinClose()
{
WriteTrace(TraceGlitch, TraceDebug, "-");
int i;
#ifndef WIN32
int clear_texbuff = use_fbo;
#endif
WriteTrace(TraceGlitch, TraceDebug, "context: %d", context);
for (i = 0; i < 2; i++) {
tmu_usage[i].min = 0x0FFFFFFFul;
@ -1194,7 +1194,7 @@ uint32_t gfxGet(uint32_t pname, uint32_t plength, FxI32 *params)
if (!nbTextureUnits)
{
gfxSstWinOpen(GR_COLORFORMAT_ARGB, GR_ORIGIN_UPPER_LEFT, 2, 1);
gfxSstWinClose(0);
gfxSstWinClose();
}
#ifdef VOODOO1
params[0] = 1;
@ -1980,8 +1980,8 @@ void gfxGetGammaTableExt(uint32_t /*nentries*/, uint32_t *red, uint32_t *green,
green[i] = aGammaRamp[1][i] >> 8;
blue[i] = aGammaRamp[2][i] >> 8;
}
}
}
}
void gfxGammaCorrectionRGB(FxFloat gammaR, FxFloat gammaG, FxFloat gammaB)
{
@ -2050,7 +2050,7 @@ int grDisplayGLError(const char* message)
fprintf(stderr, "%s\n%s\n\n", GL_errors[error_index], message);
#endif
return (failure);
}
}
#endif
void CHECK_FRAMEBUFFER_STATUS()

View File

@ -18,7 +18,7 @@
void gfxClipWindow(uint32_t minx, uint32_t miny, uint32_t maxx, uint32_t maxy);
void gfxColorMask(bool rgb, bool a);
uint32_t gfxTexMinAddress(gfxChipID_t tmu);
bool gfxSstWinClose(GrContext_t context);
bool gfxSstWinClose();
void gfxTextureBufferExt(gfxChipID_t tmu, uint32_t startAddress, GrLOD_t lodmin, GrLOD_t lodmax, GrAspectRatio_t aspect, GrTextureFormat_t fmt, uint32_t evenOdd);
uint32_t gfxTexMaxAddress(gfxChipID_t tmu);
uint32_t gfxTexTextureMemRequired(uint32_t evenOdd, GrTexInfo *info);
@ -51,7 +51,7 @@ void gfxDrawLine(const void *a, const void *b);
void gfxDrawVertexArray(uint32_t mode, uint32_t Count, void *pointers2);
void gfxDrawVertexArrayContiguous(uint32_t mode, uint32_t Count, void *pointers, uint32_t stride);
GrContext_t gfxSstWinOpen(GrColorFormat_t color_format, GrOriginLocation_t origin_location, int nColBuffers, int nAuxBuffers);
bool gfxSstWinOpen(GrColorFormat_t color_format, GrOriginLocation_t origin_location, int nColBuffers, int nAuxBuffers);
void gfxAuxBufferExt(GrBuffer_t buffer);
uint32_t gfxGet(uint32_t pname, uint32_t plength, FxI32 *params);
void gfxFramebufferCopyExt(int x, int y, int w, int h, int from, int to, int mode);