mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-15 10:35:11 -04:00
PS2: Fix textures appearing slightly offset
This commit is contained in:
parent
662d47505f
commit
f486f74dcf
@ -152,7 +152,7 @@ void Gfx_Free(void) {
|
|||||||
typedef struct CCTexture_ {
|
typedef struct CCTexture_ {
|
||||||
cc_uint32 width, height;
|
cc_uint32 width, height;
|
||||||
cc_uint32 log2_width, log2_height;
|
cc_uint32 log2_width, log2_height;
|
||||||
cc_uint32 pad[(64 - 4)/4];
|
cc_uint32 pad[(64 - 16)/4];
|
||||||
cc_uint32 pixels[]; // aligned to 64 bytes (only need 16?)
|
cc_uint32 pixels[]; // aligned to 64 bytes (only need 16?)
|
||||||
} CCTexture;
|
} CCTexture;
|
||||||
|
|
||||||
@ -165,6 +165,9 @@ static GfxResourceID Gfx_AllocTexture(struct Bitmap* bmp, int rowWidth, cc_uint8
|
|||||||
tex->log2_width = draw_log2(bmp->width);
|
tex->log2_width = draw_log2(bmp->width);
|
||||||
tex->log2_height = draw_log2(bmp->height);
|
tex->log2_height = draw_log2(bmp->height);
|
||||||
|
|
||||||
|
cc_uintptr addr = (cc_uintptr)tex->pixels;
|
||||||
|
Platform_Log1("ADDR: %x", &addr);
|
||||||
|
|
||||||
CopyTextureData(tex->pixels, bmp->width * 4, bmp, rowWidth << 2);
|
CopyTextureData(tex->pixels, bmp->width * 4, bmp, rowWidth << 2);
|
||||||
return tex;
|
return tex;
|
||||||
}
|
}
|
||||||
@ -621,24 +624,23 @@ void Gfx_BeginFrame(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Gfx_EndFrame(void) {
|
void Gfx_EndFrame(void) {
|
||||||
Platform_LogConst("--- EF1 ---");
|
//Platform_LogConst("--- EF1 ---");
|
||||||
q = draw_finish(q);
|
q = draw_finish(q);
|
||||||
Platform_LogConst("--- EF2 ---");
|
|
||||||
|
|
||||||
// Fill out and then send DMA chain
|
// Fill out and then send DMA chain
|
||||||
DMATAG_END(dma_tag, (q - current->data) - 1, 0, 0, 0);
|
DMATAG_END(dma_tag, (q - current->data) - 1, 0, 0, 0);
|
||||||
dma_wait_fast();
|
dma_wait_fast();
|
||||||
dma_channel_send_chain(DMA_CHANNEL_GIF, current->data, q - current->data, 0, 0);
|
dma_channel_send_chain(DMA_CHANNEL_GIF, current->data, q - current->data, 0, 0);
|
||||||
Platform_LogConst("--- EF3 ---");
|
//Platform_LogConst("--- EF2 ---");
|
||||||
|
|
||||||
draw_wait_finish();
|
draw_wait_finish();
|
||||||
Platform_LogConst("--- EF4 ---");
|
//Platform_LogConst("--- EF3 ---");
|
||||||
|
|
||||||
if (gfx_vsync) graph_wait_vsync();
|
if (gfx_vsync) graph_wait_vsync();
|
||||||
if (gfx_minFrameMs) LimitFPS();
|
if (gfx_minFrameMs) LimitFPS();
|
||||||
|
|
||||||
FlipContext();
|
FlipContext();
|
||||||
Platform_LogConst("--- EF5 ---");
|
//Platform_LogConst("--- EF4 ---");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gfx_SetFpsLimit(cc_bool vsync, float minFrameMs) {
|
void Gfx_SetFpsLimit(cc_bool vsync, float minFrameMs) {
|
||||||
|
@ -120,10 +120,10 @@ static void ProcessMouseInput(float delta) {
|
|||||||
mouse_data mData = { 0 };
|
mouse_data mData = { 0 };
|
||||||
if (PS2MouseRead(&mData) < 0) return;
|
if (PS2MouseRead(&mData) < 0) return;
|
||||||
|
|
||||||
//Platform_Log3("MOUSE: %i, %i, %i", &mData.x, &mData.y, &mData.buttons);
|
|
||||||
Input_SetNonRepeatable(CCMOUSE_L, mData.buttons & PS2MOUSE_BTN1);
|
Input_SetNonRepeatable(CCMOUSE_L, mData.buttons & PS2MOUSE_BTN1);
|
||||||
Input_SetNonRepeatable(CCMOUSE_R, mData.buttons & PS2MOUSE_BTN2);
|
Input_SetNonRepeatable(CCMOUSE_R, mData.buttons & PS2MOUSE_BTN2);
|
||||||
Input_SetNonRepeatable(CCMOUSE_M, mData.buttons & PS2MOUSE_BTN3);
|
Input_SetNonRepeatable(CCMOUSE_M, mData.buttons & PS2MOUSE_BTN3);
|
||||||
|
Mouse_ScrollVWheel(mData.wheel);
|
||||||
|
|
||||||
if (!Input.RawMode) return;
|
if (!Input.RawMode) return;
|
||||||
float scale = (delta * 60.0) / 2.0f;
|
float scale = (delta * 60.0) / 2.0f;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user