mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-08 14:56:12 -04:00
N64: Still enable Z when depth write is enabled
This commit is contained in:
parent
07026d593c
commit
167f501a1a
@ -95,7 +95,7 @@ static int gpu_stride;
|
|||||||
#define GPU_ATTR_TEX (1 << 9)
|
#define GPU_ATTR_TEX (1 << 9)
|
||||||
#define GPU_ATTR_SHADE (1 << 10)
|
#define GPU_ATTR_SHADE (1 << 10)
|
||||||
#define GPU_ATTR_EDGE (1 << 11)
|
#define GPU_ATTR_EDGE (1 << 11)
|
||||||
static bool gpu_attr_z, gpu_attr_tex;
|
static uint8_t gpu_attr_z, gpu_attr_tex;
|
||||||
|
|
||||||
static void gpuUpdateFormat(void)
|
static void gpuUpdateFormat(void)
|
||||||
{
|
{
|
||||||
|
@ -96,7 +96,7 @@ void Gfx_BeginFrame(void) {
|
|||||||
surface_t* disp = display_get();
|
surface_t* disp = display_get();
|
||||||
rdpq_attach(disp, &zbuffer);
|
rdpq_attach(disp, &zbuffer);
|
||||||
|
|
||||||
Platform_LogConst("== BEGIN frame");
|
//Platform_LogConst("== BEGIN frame");
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void __rdpq_autosync_change(int mode);
|
extern void __rdpq_autosync_change(int mode);
|
||||||
@ -251,14 +251,21 @@ static void SetColorWrite(cc_bool r, cc_bool g, cc_bool b, cc_bool a) {
|
|||||||
//gpuColorMask(r, g, b, a); TODO
|
//gpuColorMask(r, g, b, a); TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define FLAG_Z_WRITE 0x02
|
||||||
void Gfx_SetDepthWrite(cc_bool enabled) {
|
void Gfx_SetDepthWrite(cc_bool enabled) {
|
||||||
__rdpq_mode_change_som(SOM_Z_WRITE, enabled ? SOM_Z_WRITE : 0);
|
__rdpq_mode_change_som(SOM_Z_WRITE, enabled ? SOM_Z_WRITE : 0);
|
||||||
|
|
||||||
|
gpu_attr_z &= ~FLAG_Z_WRITE;
|
||||||
|
gpu_attr_z |= enabled ? FLAG_Z_WRITE : 0;
|
||||||
|
gpuUpdateFormat();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define FLAG_Z_READ 0x01
|
||||||
void Gfx_SetDepthTest(cc_bool enabled) {
|
void Gfx_SetDepthTest(cc_bool enabled) {
|
||||||
__rdpq_mode_change_som(SOM_Z_COMPARE, enabled ? SOM_Z_COMPARE : 0);
|
__rdpq_mode_change_som(SOM_Z_COMPARE, enabled ? SOM_Z_COMPARE : 0);
|
||||||
|
|
||||||
gpu_attr_z = enabled;
|
gpu_attr_z &= ~FLAG_Z_READ;
|
||||||
|
gpu_attr_z |= enabled ? FLAG_Z_READ : 0;
|
||||||
gpuUpdateFormat();
|
gpuUpdateFormat();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ void Gfx_UpdateTexture(GfxResourceID texId, int x, int y, struct Bitmap* part, i
|
|||||||
|
|
||||||
CopyPixels(dst, tex->width * BITMAPCOLOR_SIZE,
|
CopyPixels(dst, tex->width * BITMAPCOLOR_SIZE,
|
||||||
part->scan0, rowWidth * BITMAPCOLOR_SIZE,
|
part->scan0, rowWidth * BITMAPCOLOR_SIZE,
|
||||||
bmp->width, bmp->height);
|
part->width, part->height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gfx_EnableMipmaps(void) { }
|
void Gfx_EnableMipmaps(void) { }
|
||||||
|
@ -332,7 +332,8 @@ static CC_INLINE void CopyPixels(void* dst, int dstStride,
|
|||||||
Mem_Copy(dst_, src_, Bitmap_DataSize(pixelsPerRow, rows));
|
Mem_Copy(dst_, src_, Bitmap_DataSize(pixelsPerRow, rows));
|
||||||
} else {
|
} else {
|
||||||
/* Have to copy scanline by scanline */
|
/* Have to copy scanline by scanline */
|
||||||
for (y = 0; y < rows; y++) {
|
for (y = 0; y < rows; y++)
|
||||||
|
{
|
||||||
Mem_Copy(dst_, src_, pixelsPerRow * BITMAPCOLOR_SIZE);
|
Mem_Copy(dst_, src_, pixelsPerRow * BITMAPCOLOR_SIZE);
|
||||||
src_ += srcStride;
|
src_ += srcStride;
|
||||||
dst_ += dstStride;
|
dst_ += dstStride;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user