mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-12 09:06:55 -04:00
Fix 'overwrite existing' not working in Save menu
This commit is contained in:
parent
f5b7e1b891
commit
0940ea13a1
@ -68,7 +68,8 @@ void Gfx_OnWindowResize(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Gfx_SetViewport(int x, int y, int w, int h) {
|
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);
|
GFX_VIEWPORT = x | (y << 8) | (x2 << 16) | (y2 << 24);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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) {
|
static int SaveLevelScreen_KeyDown(void* screen, int key, struct InputDevice* device) {
|
||||||
struct SaveLevelScreen* s = (struct SaveLevelScreen*)screen;
|
struct SaveLevelScreen* s = (struct SaveLevelScreen*)screen;
|
||||||
int handled;
|
int handled;
|
||||||
SaveLevelScreen_RemoveOverwrites(s);
|
|
||||||
|
|
||||||
handled = Menu_DoInputDown(s, key, device);
|
handled = Menu_DoInputDown(s, key, device);
|
||||||
/* Pressing Enter triggers save */
|
/* Pressing Enter triggers save */
|
||||||
if (!handled && InputDevice_IsEnter(key, device))
|
if (!handled && InputDevice_IsEnter(key, device))
|
||||||
SaveLevelScreen_Save(s, &s->save);
|
SaveLevelScreen_Save(s, &s->save);
|
||||||
|
|
||||||
|
if (key != CCMOUSE_L) SaveLevelScreen_RemoveOverwrites(s);
|
||||||
return Screen_InputDown(s, key, device);
|
return Screen_InputDown(s, key, device);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
3
third_party/gldc/src/state.c
vendored
3
third_party/gldc/src/state.c
vendored
@ -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->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->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;
|
dst->mode3 |= ((uint32_t)tx1->data & 0x00fffff8) >> 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
third_party/gldc/src/texture.c
vendored
4
third_party/gldc/src/texture.c
vendored
@ -166,7 +166,6 @@ int gldcAllocTexture(int w, int h, int format) {
|
|||||||
/* changed - free old texture memory */
|
/* changed - free old texture memory */
|
||||||
yalloc_free(YALLOC_BASE, active->data);
|
yalloc_free(YALLOC_BASE, active->data);
|
||||||
active->data = NULL;
|
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);
|
active->data = yalloc_alloc_and_defrag(bytes);
|
||||||
}
|
}
|
||||||
if (!active->data) return GL_OUT_OF_MEMORY;
|
if (!active->data) return GL_OUT_OF_MEMORY;
|
||||||
|
|
||||||
/* Mark level 0 as set in the mipmap bitmask */
|
|
||||||
active->mipmap |= (1 << 0);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user