mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-14 10:05:44 -04:00
Show better error message when not enough memory to load a level
This commit is contained in:
parent
4ee1775ccb
commit
01c872f333
@ -652,8 +652,8 @@ static void OnInit(void) {
|
||||
// Tile the texture to fill the entire screen
|
||||
int tilesX = (320 + ctx.width - 1) / ctx.width;
|
||||
int tilesY = (240 + ctx.height - 1) / ctx.height;
|
||||
touchBgTex.Width *= tilesX; touchBgTex.Height *= tilesY;
|
||||
touchBgTex.uv.U2 *= tilesX; touchBgTex.uv.V2 *= tilesY;
|
||||
touchBgTex.width *= tilesX; touchBgTex.height *= tilesY;
|
||||
touchBgTex.uv.u2 *= tilesX; touchBgTex.uv.v2 *= tilesY;
|
||||
#endif
|
||||
|
||||
Event_Register_(&ChatEvents.FontChanged, NULL, OnFontChanged);
|
||||
@ -691,4 +691,4 @@ struct IGameComponent Gui_Component = {
|
||||
OnReset, /* Reset */
|
||||
NULL, /* OnNewMap */
|
||||
NULL, /* OnNewMapLoaded */
|
||||
};
|
||||
};
|
||||
|
@ -612,11 +612,13 @@ static void Classic_LevelFinalise(cc_uint8* data) {
|
||||
length = Stream_GetU16_BE(data + 4);
|
||||
volume = width * height * length;
|
||||
|
||||
if (!map1.blocks) {
|
||||
if (map1.allocFailed) {
|
||||
Chat_AddRaw("&cFailed to load map, try joining a different map");
|
||||
Chat_AddRaw(" &cNot enough free memory to load the map");
|
||||
} else if (!map1.blocks) {
|
||||
Chat_AddRaw("&cFailed to load map, try joining a different map");
|
||||
Chat_AddRaw(" &cAttempted to load map without a Blocks array");
|
||||
}
|
||||
if (map_volume != volume) {
|
||||
} else if (map_volume != volume) {
|
||||
Chat_AddRaw("&cFailed to load map, try joining a different map");
|
||||
Chat_Add2( " &cBlocks array size (%i) does not match volume of map (%i)", &map_volume, &volume);
|
||||
FreeMapStates();
|
||||
|
Loading…
x
Reference in New Issue
Block a user