Fix 'overwrite existing' not working in Save menu

This commit is contained in:
UnknownShadow200 2024-09-01 11:59:42 +10:00
parent f5b7e1b891
commit 0940ea13a1
4 changed files with 5 additions and 7 deletions

View File

@ -68,7 +68,8 @@ void Gfx_OnWindowResize(void) {
}
void Gfx_SetViewport(int x, int y, int w, int h) {
int x2 = x + w - 1, y2 = y + h - 1;
int x2 = x + w - 1;
int y2 = y + h - 1;
GFX_VIEWPORT = x | (y << 8) | (x2 << 16) | (y2 << 24);
}

View File

@ -1454,13 +1454,13 @@ static int SaveLevelScreen_TextChanged(void* screen, const cc_string* str) {
static int SaveLevelScreen_KeyDown(void* screen, int key, struct InputDevice* device) {
struct SaveLevelScreen* s = (struct SaveLevelScreen*)screen;
int handled;
SaveLevelScreen_RemoveOverwrites(s);
handled = Menu_DoInputDown(s, key, device);
/* Pressing Enter triggers save */
if (!handled && InputDevice_IsEnter(key, device))
SaveLevelScreen_Save(s, &s->save);
if (key != CCMOUSE_L) SaveLevelScreen_RemoveOverwrites(s);
return Screen_InputDown(s, key, device);
}

View File

@ -152,7 +152,8 @@ void apply_poly_header(pvr_poly_hdr_t* dst, int list_type) {
dst->mode2 |= (DimensionFlag(tx1->width) << PVR_TA_PM2_USIZE_SHIFT) & PVR_TA_PM2_USIZE_MASK;
dst->mode2 |= (DimensionFlag(tx1->height) << PVR_TA_PM2_VSIZE_SHIFT) & PVR_TA_PM2_VSIZE_MASK;
dst->mode3 = (tx1->color << PVR_TA_PM3_TXRFMT_SHIFT) & PVR_TA_PM3_TXRFMT_MASK;
dst->mode3 = (0 << PVR_TA_PM3_MIPMAP_SHIFT) & PVR_TA_PM3_MIPMAP_MASK;
dst->mode3 |= (tx1->color << PVR_TA_PM3_TXRFMT_SHIFT) & PVR_TA_PM3_TXRFMT_MASK;
dst->mode3 |= ((uint32_t)tx1->data & 0x00fffff8) >> 3;
}

View File

@ -166,7 +166,6 @@ int gldcAllocTexture(int w, int h, int format) {
/* changed - free old texture memory */
yalloc_free(YALLOC_BASE, active->data);
active->data = NULL;
active->mipmap = 0;
}
}
@ -181,9 +180,6 @@ int gldcAllocTexture(int w, int h, int format) {
active->data = yalloc_alloc_and_defrag(bytes);
}
if (!active->data) return GL_OUT_OF_MEMORY;
/* Mark level 0 as set in the mipmap bitmask */
active->mipmap |= (1 << 0);
return 0;
}