[Video] Rename grClipWindow to gfxClipWindow
This commit is contained in:
parent
02b46a5f74
commit
dad3ac7c2e
|
@ -580,7 +580,7 @@ int InitGfx()
|
|||
grTexFilterMode(1, GR_TEXTUREFILTER_BILINEAR, GR_TEXTUREFILTER_BILINEAR);
|
||||
grTexClampMode(0, GR_TEXTURECLAMP_CLAMP, GR_TEXTURECLAMP_CLAMP);
|
||||
grTexClampMode(1, GR_TEXTURECLAMP_CLAMP, GR_TEXTURECLAMP_CLAMP);
|
||||
grClipWindow(0, 0, g_scr_res_x, g_scr_res_y);
|
||||
gfxClipWindow(0, 0, g_scr_res_x, g_scr_res_y);
|
||||
rdp.update |= UPDATE_SCISSOR | UPDATE_COMBINE | UPDATE_ZBUF_ENABLED | UPDATE_CULL_MODE;
|
||||
|
||||
if (!g_ghq_use)
|
||||
|
@ -1347,7 +1347,7 @@ void newSwapBuffers()
|
|||
WriteTrace(TraceRDP, TraceDebug, "swapped");
|
||||
|
||||
rdp.update |= UPDATE_SCISSOR | UPDATE_COMBINE | UPDATE_ZBUF_ENABLED | UPDATE_CULL_MODE;
|
||||
grClipWindow(0, 0, g_scr_res_x, g_scr_res_y);
|
||||
gfxClipWindow(0, 0, g_scr_res_x, g_scr_res_y);
|
||||
grDepthBufferFunction(GR_CMP_ALWAYS);
|
||||
grDepthMask(FXFALSE);
|
||||
grCullMode(GR_CULL_DISABLE);
|
||||
|
|
|
@ -206,20 +206,12 @@ void display_warning(const char *text, ...)
|
|||
}
|
||||
}
|
||||
|
||||
FX_ENTRY void FX_CALL
|
||||
grSstOrigin(GrOriginLocation_t origin)
|
||||
{
|
||||
WriteTrace(TraceGlitch, TraceDebug, "origin = %d", origin);
|
||||
if (origin != GR_ORIGIN_UPPER_LEFT)
|
||||
WriteTrace(TraceGlitch, TraceWarning, "grSstOrigin : %x", origin);
|
||||
}
|
||||
|
||||
FX_ENTRY void FX_CALL
|
||||
grClipWindow(FxU32 minx, FxU32 miny, FxU32 maxx, FxU32 maxy)
|
||||
void gfxClipWindow(FxU32 minx, FxU32 miny, FxU32 maxx, FxU32 maxy)
|
||||
{
|
||||
WriteTrace(TraceGlitch, TraceDebug, "minx = %d, miny: %d maxx: %d maxy: %d", minx, miny, maxx, maxy);
|
||||
|
||||
if (use_fbo && render_to_texture) {
|
||||
if (use_fbo && render_to_texture)
|
||||
{
|
||||
if (int(minx) < 0) minx = 0;
|
||||
if (int(miny) < 0) miny = 0;
|
||||
if (maxx < minx) maxx = minx;
|
||||
|
|
|
@ -334,16 +334,7 @@ unsigned short depthBuffer[2048 * 2048];
|
|||
|
||||
//#define VOODOO1
|
||||
|
||||
FX_ENTRY void FX_CALL
|
||||
grSstOrigin(GrOriginLocation_t origin)
|
||||
{
|
||||
WriteTrace(TraceGlitch, TraceDebug, "origin = %d", origin);
|
||||
if (origin != GR_ORIGIN_UPPER_LEFT)
|
||||
WriteTrace(TraceGlitch, TraceWarning, "grSstOrigin : %x", origin);
|
||||
}
|
||||
|
||||
FX_ENTRY void FX_CALL
|
||||
grClipWindow(FxU32 minx, FxU32 miny, FxU32 maxx, FxU32 maxy)
|
||||
void gfxClipWindow(FxU32 minx, FxU32 miny, FxU32 maxx, FxU32 maxy)
|
||||
{
|
||||
WriteTrace(TraceGlitch, TraceDebug, "minx = %d, miny: %d maxy: %d", minx, miny, maxy);
|
||||
|
||||
|
@ -355,7 +346,7 @@ grClipWindow(FxU32 minx, FxU32 miny, FxU32 maxx, FxU32 maxy)
|
|||
if (maxy < miny) maxy = miny;
|
||||
glScissor(minx, miny, maxx - minx, maxy - miny);
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
grDisplayGLError("grClipWindow :: use_fbo");
|
||||
grDisplayGLError("gfxClipWindow :: use_fbo");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -379,7 +370,7 @@ grClipWindow(FxU32 minx, FxU32 miny, FxU32 maxx, FxU32 maxy)
|
|||
glScissor(minx, (g_viewport_offset)+g_height - maxy, maxx - minx, maxy - miny);
|
||||
}
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
grDisplayGLError("grClipWindow");
|
||||
grDisplayGLError("gfxClipWindow");
|
||||
}
|
||||
|
||||
FX_ENTRY void FX_CALL
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include <glide.h>
|
||||
#include "../GlideExtensions.h"
|
||||
|
||||
void gfxClipWindow(FxU32 minx, FxU32 miny, FxU32 maxx, FxU32 maxy);
|
||||
FxU32 gfxTexMinAddress(GrChipID_t tmu);
|
||||
|
||||
extern uint32_t nbTextureUnits;
|
||||
|
|
|
@ -339,7 +339,7 @@ static GrTextureFormat_t TexBufSetupCombiner(int force_rgb = FALSE)
|
|||
GR_BLEND_ZERO,
|
||||
GR_BLEND_ONE,
|
||||
GR_BLEND_ZERO);
|
||||
grClipWindow(0, 0, g_scr_res_x, g_scr_res_y);
|
||||
gfxClipWindow(0, 0, g_scr_res_x, g_scr_res_y);
|
||||
grDepthBufferFunction(GR_CMP_ALWAYS);
|
||||
grDepthMask(FXFALSE);
|
||||
grCullMode(GR_CULL_DISABLE);
|
||||
|
@ -427,7 +427,7 @@ int CloseTextureBuffer(int draw)
|
|||
};
|
||||
|
||||
grTexSource(rdp.tbuff_tex->tmu, rdp.tbuff_tex->tex_addr, GR_MIPMAPLEVELMASK_BOTH, &(rdp.tbuff_tex->info));
|
||||
grClipWindow(0, 0, g_res_x, g_res_y);
|
||||
gfxClipWindow(0, 0, g_res_x, g_res_y);
|
||||
grDrawTriangle(&v[0], &v[2], &v[1]);
|
||||
grDrawTriangle(&v[2], &v[3], &v[1]);
|
||||
rdp.update |= UPDATE_ZBUF_ENABLED | UPDATE_COMBINE | UPDATE_TEXTURE | UPDATE_ALPHA_COMPARE;
|
||||
|
@ -489,7 +489,7 @@ int CopyTextureBuffer(COLOR_IMAGE & fb_from, COLOR_IMAGE & fb_to)
|
|||
rdp.offset_y = rdp.offset_y_bak;
|
||||
rdp.offset_x_bak = rdp.offset_y_bak = 0;
|
||||
AddOffset(v, 4);
|
||||
grClipWindow(0, 0, g_res_x, g_res_y);
|
||||
gfxClipWindow(0, 0, g_res_x, g_res_y);
|
||||
grDrawTriangle(&v[0], &v[2], &v[1]);
|
||||
grDrawTriangle(&v[2], &v[3], &v[1]);
|
||||
rdp.tbuff_tex->info.format = buf_format;
|
||||
|
|
|
@ -1620,10 +1620,10 @@ void update_scissor()
|
|||
rdp.scissor.lr_x = (uint32_t)maxval(minval((rdp.scissor_o.lr_x * rdp.scale_x + rdp.offset_x + 0.01f), g_scr_res_x), 0);
|
||||
rdp.scissor.ul_y = (uint32_t)maxval(minval((rdp.scissor_o.ul_y * rdp.scale_y + rdp.offset_y + 0.01f), g_scr_res_y), 0);
|
||||
rdp.scissor.lr_y = (uint32_t)maxval(minval((rdp.scissor_o.lr_y * rdp.scale_y + rdp.offset_y + 0.01f), g_scr_res_y), 0);
|
||||
//grClipWindow specifies the hardware clipping window. Any pixels outside the clipping window are rejected.
|
||||
//gfxClipWindow specifies the hardware clipping window. Any pixels outside the clipping window are rejected.
|
||||
//Values are inclusive for minimum x and y values and exclusive for maximum x and y values.
|
||||
// grClipWindow (rdp.scissor.ul_x?rdp.scissor.ul_x+1:0, rdp.scissor.ul_y?rdp.scissor.ul_y+1:0, rdp.scissor.lr_x, rdp.scissor.lr_y);
|
||||
grClipWindow(rdp.scissor.ul_x, rdp.scissor.ul_y, rdp.scissor.lr_x, rdp.scissor.lr_y);
|
||||
// gfxClipWindow (rdp.scissor.ul_x?rdp.scissor.ul_x+1:0, rdp.scissor.ul_y?rdp.scissor.ul_y+1:0, rdp.scissor.lr_x, rdp.scissor.lr_y);
|
||||
gfxClipWindow(rdp.scissor.ul_x, rdp.scissor.ul_y, rdp.scissor.lr_x, rdp.scissor.lr_y);
|
||||
WriteTrace(TraceRDP, TraceDebug, " |- scissor - (%d, %d) -> (%d, %d)", rdp.scissor.ul_x, rdp.scissor.ul_y, rdp.scissor.lr_x, rdp.scissor.lr_y);
|
||||
}
|
||||
}
|
||||
|
@ -1938,7 +1938,7 @@ void update()
|
|||
rdp.scissor.lr_x = (uint32_t)rdp.clip_max_x;
|
||||
rdp.scissor.ul_y = (uint32_t)rdp.clip_min_y;
|
||||
rdp.scissor.lr_y = (uint32_t)rdp.clip_max_y;
|
||||
grClipWindow(rdp.scissor.ul_x, rdp.scissor.ul_y, rdp.scissor.lr_x, rdp.scissor.lr_y);
|
||||
gfxClipWindow(rdp.scissor.ul_x, rdp.scissor.ul_y, rdp.scissor.lr_x, rdp.scissor.lr_y);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -412,11 +412,11 @@ void DrawImage(DRAWIMAGE & d)
|
|||
rdp.allow_combine = 0;
|
||||
|
||||
if (rdp.ci_width == 512 && !no_dlist)
|
||||
grClipWindow(0, 0, g_scr_res_x, g_scr_res_y);
|
||||
gfxClipWindow(0, 0, g_scr_res_x, g_scr_res_y);
|
||||
else if (d.scaleX == 1.0f && d.scaleY == 1.0f)
|
||||
grClipWindow(rdp.scissor.ul_x, rdp.scissor.ul_y, rdp.scissor.lr_x, rdp.scissor.lr_y);
|
||||
gfxClipWindow(rdp.scissor.ul_x, rdp.scissor.ul_y, rdp.scissor.lr_x, rdp.scissor.lr_y);
|
||||
else
|
||||
grClipWindow(rdp.scissor.ul_x, rdp.scissor.ul_y, minval(rdp.scissor.lr_x, (uint32_t)((d.frameX + d.imageW / d.scaleX + 0.5f)*rdp.scale_x)), minval(rdp.scissor.lr_y, (uint32_t)((d.frameY + d.imageH / d.scaleY + 0.5f)*rdp.scale_y)));
|
||||
gfxClipWindow(rdp.scissor.ul_x, rdp.scissor.ul_y, minval(rdp.scissor.lr_x, (uint32_t)((d.frameX + d.imageW / d.scaleX + 0.5f)*rdp.scale_x)), minval(rdp.scissor.lr_y, (uint32_t)((d.frameY + d.imageH / d.scaleY + 0.5f)*rdp.scale_y)));
|
||||
rdp.update |= UPDATE_SCISSOR;
|
||||
|
||||
// Texture ()
|
||||
|
@ -564,7 +564,7 @@ void DrawHiresImage(DRAWIMAGE & d, int screensize)
|
|||
setTBufTex(rdp.tbuff_tex->t_mem, rdp.tbuff_tex->width << rdp.tbuff_tex->size >> 1);
|
||||
|
||||
const float Z = set_sprite_combine_mode();
|
||||
grClipWindow(0, 0, g_res_x, g_res_y);
|
||||
gfxClipWindow(0, 0, g_res_x, g_res_y);
|
||||
|
||||
if (d.imageW % 2 == 1) d.imageW -= 1;
|
||||
if (d.imageH % 2 == 1) d.imageH -= 1;
|
||||
|
|
Loading…
Reference in New Issue