[Video] Rename grDrawTriangle to gfxDrawTriangle
This commit is contained in:
parent
6da2839b61
commit
1af5c577ff
|
@ -56,8 +56,8 @@ void output(float x, float y, int scale, const char *fmt, ...)
|
|||
|
||||
ConvertCoordsKeep(v, 4);
|
||||
|
||||
grDrawTriangle(&v[0], &v[1], &v[2]);
|
||||
grDrawTriangle(&v[1], &v[3], &v[2]);
|
||||
gfxDrawTriangle(&v[0], &v[1], &v[2]);
|
||||
gfxDrawTriangle(&v[1], &v[3], &v[2]);
|
||||
|
||||
x += 8;
|
||||
}
|
||||
|
|
|
@ -113,8 +113,8 @@ static void DrawRE2Video(FB_TO_SCREEN_INFO & fb_info, float scale)
|
|||
{ ul_x, lr_y, 1, 1, 0.5f, lr_v, 0.5f, lr_v, { 0.5f, lr_v, 0.5f, lr_v } },
|
||||
{ lr_x, lr_y, 1, 1, lr_u, lr_v, lr_u, lr_v, { lr_u, lr_v, lr_u, lr_v } }
|
||||
};
|
||||
grDrawTriangle(&v[0], &v[2], &v[1]);
|
||||
grDrawTriangle(&v[2], &v[3], &v[1]);
|
||||
gfxDrawTriangle(&v[0], &v[2], &v[1]);
|
||||
gfxDrawTriangle(&v[2], &v[3], &v[1]);
|
||||
}
|
||||
|
||||
static void DrawRE2Video256(FB_TO_SCREEN_INFO & fb_info)
|
||||
|
@ -266,8 +266,8 @@ static void DrawFrameBufferToScreen256(FB_TO_SCREEN_INFO & fb_info)
|
|||
{ ul_x, lr_y, 1, 1, 0.5f, lr_v, 0.5f, lr_v, { 0.5f, lr_v, 0.5f, lr_v } },
|
||||
{ lr_x, lr_y, 1, 1, lr_u, lr_v, lr_u, lr_v, { lr_u, lr_v, lr_u, lr_v } }
|
||||
};
|
||||
grDrawTriangle(&v[0], &v[2], &v[1]);
|
||||
grDrawTriangle(&v[2], &v[3], &v[1]);
|
||||
gfxDrawTriangle(&v[0], &v[2], &v[1]);
|
||||
gfxDrawTriangle(&v[2], &v[3], &v[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -392,8 +392,8 @@ bool DrawFrameBufferToScreen(FB_TO_SCREEN_INFO & fb_info)
|
|||
{ ul_x, lr_y, 1, 1, 0.5f, lr_v, 0.5f, lr_v, { 0.5f, lr_v, 0.5f, lr_v } },
|
||||
{ lr_x, lr_y, 1, 1, lr_u, lr_v, lr_u, lr_v, { lr_u, lr_v, lr_u, lr_v } }
|
||||
};
|
||||
grDrawTriangle(&v[0], &v[2], &v[1]);
|
||||
grDrawTriangle(&v[2], &v[3], &v[1]);
|
||||
gfxDrawTriangle(&v[0], &v[2], &v[1]);
|
||||
gfxDrawTriangle(&v[2], &v[3], &v[1]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -464,8 +464,8 @@ static void DrawDepthBufferToScreen256(FB_TO_SCREEN_INFO & fb_info)
|
|||
{ ul_x, lr_y, 1, 1, 0.5f, lr_v, 0.5f, lr_v, { 0.5f, lr_v, 0.5f, lr_v } },
|
||||
{ lr_x, lr_y, 1, 1, lr_u, lr_v, lr_u, lr_v, { lr_u, lr_v, lr_u, lr_v } }
|
||||
};
|
||||
grDrawTriangle(&v[0], &v[2], &v[1]);
|
||||
grDrawTriangle(&v[2], &v[3], &v[1]);
|
||||
gfxDrawTriangle(&v[0], &v[2], &v[1]);
|
||||
gfxDrawTriangle(&v[2], &v[3], &v[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -533,8 +533,8 @@ static void DrawHiresDepthBufferToScreen(FB_TO_SCREEN_INFO & fb_info)
|
|||
{ ul_x, lr_y, 1, 1, ul_u, lr_v, ul_u, lr_v, { ul_u, lr_v, ul_u, lr_v } },
|
||||
{ lr_x, lr_y, 1, 1, lr_u, lr_v, lr_u, lr_v, { lr_u, lr_v, lr_u, lr_v } }
|
||||
};
|
||||
grDrawTriangle(&v[0], &v[2], &v[1]);
|
||||
grDrawTriangle(&v[2], &v[3], &v[1]);
|
||||
gfxDrawTriangle(&v[0], &v[2], &v[1]);
|
||||
gfxDrawTriangle(&v[2], &v[3], &v[1]);
|
||||
// grAuxBufferExt( GR_BUFFER_TEXTUREAUXBUFFER_EXT );
|
||||
rdp.update |= UPDATE_COMBINE | UPDATE_ZBUF_ENABLED | UPDATE_CULL_MODE;
|
||||
}
|
||||
|
@ -624,6 +624,6 @@ void DrawDepthBufferToScreen(FB_TO_SCREEN_INFO & fb_info)
|
|||
{ ul_x, lr_y, 1, 1, zero, lr_v, zero, lr_v, { zero, lr_v, zero, lr_v } },
|
||||
{ lr_x, lr_y, 1, 1, lr_u, lr_v, lr_u, lr_v, { lr_u, lr_v, lr_u, lr_v } }
|
||||
};
|
||||
grDrawTriangle(&v[0], &v[2], &v[1]);
|
||||
grDrawTriangle(&v[2], &v[3], &v[1]);
|
||||
gfxDrawTriangle(&v[0], &v[2], &v[1]);
|
||||
gfxDrawTriangle(&v[2], &v[3], &v[1]);
|
||||
}
|
|
@ -318,9 +318,7 @@ grDepthBiasLevel(FxI32 level)
|
|||
}
|
||||
|
||||
// draw
|
||||
|
||||
FX_ENTRY void FX_CALL
|
||||
grDrawTriangle(const void *a, const void *b, const void *c)
|
||||
void gfxDrawTriangle(const void *a, const void *b, const void *c)
|
||||
{
|
||||
WriteTrace(TraceGlitch, TraceDebug, "start");
|
||||
vbo_enable();
|
||||
|
|
|
@ -307,9 +307,7 @@ grDepthBiasLevel(FxI32 level)
|
|||
}
|
||||
|
||||
// draw
|
||||
|
||||
FX_ENTRY void FX_CALL
|
||||
grDrawTriangle(const void *a, const void *b, const void *c)
|
||||
void gfxDrawTriangle(const void *a, const void *b, const void *c)
|
||||
{
|
||||
float *a_x = (float*)a + xy_off / sizeof(float);
|
||||
float *a_y = (float*)a + xy_off / sizeof(float) + 1;
|
||||
|
@ -442,7 +440,7 @@ grDrawTriangle(const void *a, const void *b, const void *c)
|
|||
-(*c_y - (float)heighto) / (float)(g_height / 2) / *c_q, ZCALC(*c_z, *c_q), 1.0f / *c_q);
|
||||
|
||||
glEnd();
|
||||
grDisplayGLError("grDrawTriangle");
|
||||
grDisplayGLError("gfxDrawTriangle");
|
||||
}
|
||||
|
||||
FX_ENTRY void FX_CALL
|
||||
|
|
|
@ -46,6 +46,7 @@ void gfxCullMode(GrCullMode_t mode);
|
|||
void gfxDepthBufferMode(GrDepthBufferMode_t mode);
|
||||
void gfxDepthBufferFunction(GrCmpFnc_t function);
|
||||
void gfxDepthMask(FxBool mask);
|
||||
void gfxDrawTriangle(const void *a, const void *b, const void *c);
|
||||
|
||||
extern uint32_t nbTextureUnits;
|
||||
extern uint32_t g_scr_res_x, g_scr_res_y, g_res_x, g_res_y;
|
||||
|
|
|
@ -428,8 +428,8 @@ int CloseTextureBuffer(int draw)
|
|||
|
||||
grTexSource(rdp.tbuff_tex->tmu, rdp.tbuff_tex->tex_addr, GR_MIPMAPLEVELMASK_BOTH, &(rdp.tbuff_tex->info));
|
||||
gfxClipWindow(0, 0, g_res_x, g_res_y);
|
||||
grDrawTriangle(&v[0], &v[2], &v[1]);
|
||||
grDrawTriangle(&v[2], &v[3], &v[1]);
|
||||
gfxDrawTriangle(&v[0], &v[2], &v[1]);
|
||||
gfxDrawTriangle(&v[2], &v[3], &v[1]);
|
||||
rdp.update |= UPDATE_ZBUF_ENABLED | UPDATE_COMBINE | UPDATE_TEXTURE | UPDATE_ALPHA_COMPARE;
|
||||
if (g_settings->fog() && (rdp.flags & FOG_ENABLED))
|
||||
{
|
||||
|
@ -482,16 +482,16 @@ int CopyTextureBuffer(COLOR_IMAGE & fb_from, COLOR_IMAGE & fb_to)
|
|||
};
|
||||
|
||||
grTexSource(rdp.tbuff_tex->tmu, rdp.tbuff_tex->tex_addr, GR_MIPMAPLEVELMASK_BOTH, &(rdp.tbuff_tex->info));
|
||||
grDrawTriangle(&v[0], &v[2], &v[1]);
|
||||
grDrawTriangle(&v[2], &v[3], &v[1]);
|
||||
gfxDrawTriangle(&v[0], &v[2], &v[1]);
|
||||
gfxDrawTriangle(&v[2], &v[3], &v[1]);
|
||||
grRenderBuffer(GR_BUFFER_BACKBUFFER);
|
||||
rdp.offset_x = rdp.offset_x_bak;
|
||||
rdp.offset_y = rdp.offset_y_bak;
|
||||
rdp.offset_x_bak = rdp.offset_y_bak = 0;
|
||||
AddOffset(v, 4);
|
||||
gfxClipWindow(0, 0, g_res_x, g_res_y);
|
||||
grDrawTriangle(&v[0], &v[2], &v[1]);
|
||||
grDrawTriangle(&v[2], &v[3], &v[1]);
|
||||
gfxDrawTriangle(&v[0], &v[2], &v[1]);
|
||||
gfxDrawTriangle(&v[2], &v[3], &v[1]);
|
||||
rdp.tbuff_tex->info.format = buf_format;
|
||||
|
||||
rdp.update |= UPDATE_ZBUF_ENABLED | UPDATE_COMBINE | UPDATE_TEXTURE | UPDATE_ALPHA_COMPARE;
|
||||
|
@ -542,8 +542,8 @@ int CopyDepthBuffer()
|
|||
grRenderBuffer(GR_BUFFER_TEXTUREBUFFER_EXT);
|
||||
gfxTextureBufferExt(rdp.texbufs[1].tmu, rdp.texbufs[1].begin, LOD, LOD,
|
||||
GR_ASPECT_LOG2_1x1, GFX_TEXFMT_RGB_565, GR_MIPMAPLEVELMASK_BOTH);
|
||||
grDrawTriangle(&v[0], &v[2], &v[1]);
|
||||
grDrawTriangle(&v[2], &v[3], &v[1]);
|
||||
gfxDrawTriangle(&v[0], &v[2], &v[1]);
|
||||
gfxDrawTriangle(&v[2], &v[3], &v[1]);
|
||||
grRenderBuffer(GR_BUFFER_BACKBUFFER);
|
||||
grAuxBufferExt(GR_BUFFER_TEXTUREAUXBUFFER_EXT);
|
||||
|
||||
|
@ -599,8 +599,8 @@ int SwapTextureBuffer()
|
|||
grRenderBuffer(GR_BUFFER_TEXTUREBUFFER_EXT);
|
||||
gfxTextureBufferExt(texbuf->tmu, texbuf->tex_addr, texbuf->info.smallLodLog2, texbuf->info.largeLodLog2,
|
||||
texbuf->info.aspectRatioLog2, texbuf->info.format, GR_MIPMAPLEVELMASK_BOTH);
|
||||
grDrawTriangle(&v[0], &v[2], &v[1]);
|
||||
grDrawTriangle(&v[2], &v[3], &v[1]);
|
||||
gfxDrawTriangle(&v[0], &v[2], &v[1]);
|
||||
gfxDrawTriangle(&v[2], &v[3], &v[1]);
|
||||
rdp.texbufs[rdp.tbuff_tex->tmu].clear_allowed = TRUE;
|
||||
rdp.texbufs[rdp.tbuff_tex->tmu].count = 0;
|
||||
texbuf->tile_uls = rdp.tbuff_tex->tile_uls;
|
||||
|
|
|
@ -1596,8 +1596,8 @@ static void render_tri(uint16_t linew, int old_interpolate)
|
|||
v[3].x = V1->x - wx;
|
||||
v[3].y = V1->y + wy;
|
||||
}
|
||||
grDrawTriangle(&v[0], &v[1], &v[2]);
|
||||
grDrawTriangle(&v[1], &v[2], &v[3]);
|
||||
gfxDrawTriangle(&v[0], &v[1], &v[2]);
|
||||
gfxDrawTriangle(&v[1], &v[2], &v[3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -2562,8 +2562,8 @@ void rdp_fillrect()
|
|||
}
|
||||
else
|
||||
{
|
||||
grDrawTriangle(&v[0], &v[2], &v[1]);
|
||||
grDrawTriangle(&v[2], &v[3], &v[1]);
|
||||
gfxDrawTriangle(&v[0], &v[2], &v[1]);
|
||||
gfxDrawTriangle(&v[2], &v[3], &v[1]);
|
||||
}
|
||||
|
||||
rdp.tri_n += 2;
|
||||
|
|
|
@ -198,8 +198,8 @@ void DrawHiresDepthImage(const DRAWIMAGE & d)
|
|||
grRenderBuffer(GR_BUFFER_TEXTUREBUFFER_EXT);
|
||||
grAuxBufferExt(GR_BUFFER_AUXBUFFER);
|
||||
grBufferClear(0, 0, 0xFFFF);
|
||||
grDrawTriangle(&v[0], &v[2], &v[1]);
|
||||
grDrawTriangle(&v[2], &v[3], &v[1]);
|
||||
gfxDrawTriangle(&v[0], &v[2], &v[1]);
|
||||
gfxDrawTriangle(&v[2], &v[3], &v[1]);
|
||||
grRenderBuffer(GR_BUFFER_BACKBUFFER);
|
||||
grAuxBufferExt(GR_BUFFER_TEXTUREAUXBUFFER_EXT);
|
||||
gfxDepthMask(FXTRUE);
|
||||
|
@ -623,8 +623,8 @@ void DrawHiresImage(DRAWIMAGE & d, int screensize)
|
|||
AddOffset(v, 4);
|
||||
for (int s = 0; s < 4; s++)
|
||||
apply_shade_mods(&(v[s]));
|
||||
grDrawTriangle(&v[0], &v[2], &v[1]);
|
||||
grDrawTriangle(&v[2], &v[3], &v[1]);
|
||||
gfxDrawTriangle(&v[0], &v[2], &v[1]);
|
||||
gfxDrawTriangle(&v[2], &v[3], &v[1]);
|
||||
rdp.update |= UPDATE_ZBUF_ENABLED | UPDATE_COMBINE | UPDATE_TEXTURE | UPDATE_ALPHA_COMPARE | UPDATE_SCISSOR;
|
||||
rdp.tri_n += 2;
|
||||
rdp.tbuff_tex = tbuff_tex;
|
||||
|
|
Loading…
Reference in New Issue