Skip to content

Commit

Permalink
[Video] Rename GrOriginLocation_t to gfxOriginLocation_t
Browse files Browse the repository at this point in the history
  • Loading branch information
project64 committed Aug 8, 2017
1 parent 96306c0 commit 955546d
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Source/Project64-video/Main.cpp
Expand Up @@ -473,7 +473,7 @@ int InitGfx()
#ifndef ANDROID
SetWindowDisplaySize((HWND)gfx.hWnd);
#endif
if (!gfxSstWinOpen(GFX_COLORFORMAT_RGBA, GR_ORIGIN_UPPER_LEFT, 2, 1))
if (!gfxSstWinOpen(GFX_COLORFORMAT_RGBA, GFX_ORIGIN_UPPER_LEFT, 2, 1))
{
g_Notify->DisplayError("Error setting display mode");
return FALSE;
Expand Down Expand Up @@ -1273,7 +1273,7 @@ void newSwapBuffers()

GrLfbInfo_t info;
info.size = sizeof(GrLfbInfo_t);
if (gfxLfbLock(GFX_LFB_READ_ONLY, GFX_BUFFER_BACKBUFFER, GR_LFBWRITEMODE_565, GR_ORIGIN_UPPER_LEFT, FXFALSE, &info))
if (gfxLfbLock(GFX_LFB_READ_ONLY, GFX_BUFFER_BACKBUFFER, GR_LFBWRITEMODE_565, GFX_ORIGIN_UPPER_LEFT, FXFALSE, &info))
{
AUTO_PTR<uint8_t> ssimg_buffer(new uint8_t[image_width * image_height * 3]);
uint8_t * ssimg = ssimg_buffer.get();
Expand Down
6 changes: 3 additions & 3 deletions Source/Project64-video/Renderer/OGLESglitchmain.cpp
Expand Up @@ -319,7 +319,7 @@ int isWglExtensionSupported(const char *extension)
# endif
#endif

bool gfxSstWinOpen(gfxColorFormat_t color_format, GrOriginLocation_t origin_location, int nColBuffers, int nAuxBuffers)
bool gfxSstWinOpen(gfxColorFormat_t color_format, gfxOriginLocation_t origin_location, int nColBuffers, int nAuxBuffers)
{
static int show_warning = 1;

Expand All @@ -344,7 +344,7 @@ bool gfxSstWinOpen(gfxColorFormat_t color_format, GrOriginLocation_t origin_loca

glViewport(0, g_viewport_offset, g_width, g_height);
lfb_color_fmt = color_format;
if (origin_location != GR_ORIGIN_UPPER_LEFT) WriteTrace(TraceGlitch, TraceWarning, "origin must be in upper left corner");
if (origin_location != GFX_ORIGIN_UPPER_LEFT) WriteTrace(TraceGlitch, TraceWarning, "origin must be in upper left corner");
if (nColBuffers != 2) WriteTrace(TraceGlitch, TraceWarning, "number of color buffer is not 2");
if (nAuxBuffers != 1) WriteTrace(TraceGlitch, TraceWarning, "number of auxiliary buffer is not 1");

Expand Down Expand Up @@ -1324,7 +1324,7 @@ void gfxBufferSwap(uint32_t swap_interval)
}

// frame buffer
bool gfxLfbLock(gfxLock_t type, gfxBuffer_t buffer, GrLfbWriteMode_t writeMode, GrOriginLocation_t origin, bool pixelPipeline, GrLfbInfo_t *info)
bool gfxLfbLock(gfxLock_t type, gfxBuffer_t buffer, GrLfbWriteMode_t writeMode, gfxOriginLocation_t origin, bool pixelPipeline, GrLfbInfo_t *info)
{
WriteTrace(TraceGlitch, TraceDebug, "type: %d buffer: %d writeMode: %d origin: %d pixelPipeline: %d", type, buffer, writeMode, origin, pixelPipeline);
if (type == GFX_LFB_WRITE_ONLY)
Expand Down
8 changes: 4 additions & 4 deletions Source/Project64-video/Renderer/OGLglitchmain.cpp
Expand Up @@ -451,7 +451,7 @@ int isWglExtensionSupported(const char *extension)
extern HWND g_hwnd_win;
#endif

bool gfxSstWinOpen(gfxColorFormat_t color_format, GrOriginLocation_t origin_location, int nColBuffers, int nAuxBuffers)
bool gfxSstWinOpen(gfxColorFormat_t color_format, gfxOriginLocation_t origin_location, int nColBuffers, int nAuxBuffers)
{
static int show_warning = 1;

Expand Down Expand Up @@ -531,7 +531,7 @@ bool gfxSstWinOpen(gfxColorFormat_t color_format, GrOriginLocation_t origin_loca
}
#endif // _WIN32
lfb_color_fmt = color_format;
if (origin_location != GR_ORIGIN_UPPER_LEFT) WriteTrace(TraceGlitch, TraceWarning, "origin must be in upper left corner");
if (origin_location != GFX_ORIGIN_UPPER_LEFT) WriteTrace(TraceGlitch, TraceWarning, "origin must be in upper left corner");
if (nColBuffers != 2) WriteTrace(TraceGlitch, TraceWarning, "number of color buffer is not 2");
if (nAuxBuffers != 1) WriteTrace(TraceGlitch, TraceWarning, "number of auxiliary buffer is not 1");

Expand Down Expand Up @@ -1193,7 +1193,7 @@ uint32_t gfxGet(uint32_t pname, uint32_t plength, FxI32 *params)
if (plength < 4 || params == NULL) return 0;
if (!nbTextureUnits)
{
gfxSstWinOpen(GFX_COLORFORMAT_ARGB, GR_ORIGIN_UPPER_LEFT, 2, 1);
gfxSstWinOpen(GFX_COLORFORMAT_ARGB, GFX_ORIGIN_UPPER_LEFT, 2, 1);
gfxSstWinClose();
}
#ifdef VOODOO1
Expand Down Expand Up @@ -1604,7 +1604,7 @@ void gfxBufferSwap(uint32_t swap_interval)
}

// frame buffer
bool gfxLfbLock(gfxLock_t type, gfxBuffer_t buffer, GrLfbWriteMode_t writeMode, GrOriginLocation_t origin, bool pixelPipeline, GrLfbInfo_t *info)
bool gfxLfbLock(gfxLock_t type, gfxBuffer_t buffer, GrLfbWriteMode_t writeMode, gfxOriginLocation_t origin, bool pixelPipeline, GrLfbInfo_t *info)
{
WriteTrace(TraceGlitch, TraceDebug, "type: %d buffer: %d writeMode: %d origin: %d pixelPipeline: %d", type, buffer, writeMode, origin, pixelPipeline);
if (type == GFX_LFB_WRITE_ONLY)
Expand Down
4 changes: 2 additions & 2 deletions Source/Project64-video/Renderer/Renderer.h
Expand Up @@ -51,13 +51,13 @@ 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);

bool gfxSstWinOpen(gfxColorFormat_t color_format, GrOriginLocation_t origin_location, int nColBuffers, int nAuxBuffers);
bool gfxSstWinOpen(gfxColorFormat_t color_format, gfxOriginLocation_t origin_location, int nColBuffers, int nAuxBuffers);
void gfxAuxBufferExt(gfxBuffer_t buffer);
uint32_t gfxGet(uint32_t pname, uint32_t plength, FxI32 *params);
void gfxRenderBuffer(gfxBuffer_t buffer);
void gfxBufferClear(gfxColor_t color, gfxAlpha_t alpha, uint32_t depth);
void gfxBufferSwap(uint32_t swap_interval);
bool gfxLfbLock(gfxLock_t type, gfxBuffer_t buffer, GrLfbWriteMode_t writeMode, GrOriginLocation_t origin, bool pixelPipeline, GrLfbInfo_t *info);
bool gfxLfbLock(gfxLock_t type, gfxBuffer_t buffer, GrLfbWriteMode_t writeMode, gfxOriginLocation_t origin, bool pixelPipeline, GrLfbInfo_t *info);
bool gfxLfbUnlock(gfxLock_t type, gfxBuffer_t buffer);
bool gfxLfbReadRegion(gfxBuffer_t src_buffer, uint32_t src_x, uint32_t src_y, uint32_t src_width, uint32_t src_height, uint32_t dst_stride, void *dst_data);
bool gfxLfbWriteRegion(gfxBuffer_t dst_buffer, uint32_t dst_x, uint32_t dst_y, GrLfbSrcFmt_t src_format, uint32_t src_width, uint32_t src_height, bool pixelPipeline, FxI32 src_stride, void *src_data);
Expand Down
7 changes: 7 additions & 0 deletions Source/Project64-video/Renderer/types.h
Expand Up @@ -271,6 +271,13 @@ enum gfxLock_t
GFX_LFB_NOIDLE = 0x10,
};

enum gfxOriginLocation_t
{
GFX_ORIGIN_UPPER_LEFT = 0x0,
GFX_ORIGIN_LOWER_LEFT = 0x1,
GFX_ORIGIN_ANY = 0xFF,
};

enum gfxLfbSrcFmt_t
{
GFX_LFB_SRC_FMT_565 = 0x00,
Expand Down
2 changes: 1 addition & 1 deletion Source/Project64-video/rdp.cpp
Expand Up @@ -666,7 +666,7 @@ static void CopyFrameBuffer(gfxBuffer_t buffer = GFX_BUFFER_BACKBUFFER)
if (gfxLfbLock(GFX_LFB_READ_ONLY,
buffer,
GR_LFBWRITEMODE_565,
GR_ORIGIN_UPPER_LEFT,
GFX_ORIGIN_UPPER_LEFT,
FXFALSE,
&info))
{
Expand Down

0 comments on commit 955546d

Please sign in to comment.