mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-18 12:05:14 -04:00
Fix VSync not applying properly at startup in C client
This commit is contained in:
parent
ec690648f8
commit
e9502882e1
@ -416,6 +416,7 @@ void Game_Load(void) {
|
|||||||
|
|
||||||
IGameComponent comp;
|
IGameComponent comp;
|
||||||
Gfx_Init();
|
Gfx_Init();
|
||||||
|
Gfx_SetVSync(true);
|
||||||
Gfx_MakeApiInfo();
|
Gfx_MakeApiInfo();
|
||||||
Drawer2D_Init();
|
Drawer2D_Init();
|
||||||
|
|
||||||
|
@ -403,7 +403,7 @@ static void Classic_LevelInit(Stream* stream) {
|
|||||||
if (cpe_fastMap) {
|
if (cpe_fastMap) {
|
||||||
mapVolume = Stream_ReadI32_BE(stream);
|
mapVolume = Stream_ReadI32_BE(stream);
|
||||||
gzHeader.Done = true;
|
gzHeader.Done = true;
|
||||||
mapSizeIndex = 4;
|
mapSizeIndex = sizeof(UInt32);
|
||||||
map = Platform_MemAlloc(mapVolume, sizeof(BlockID));
|
map = Platform_MemAlloc(mapVolume, sizeof(BlockID));
|
||||||
if (map == NULL) ErrorHandler_Fail("Failed to allocate memory for map");
|
if (map == NULL) ErrorHandler_Fail("Failed to allocate memory for map");
|
||||||
}
|
}
|
||||||
@ -424,14 +424,14 @@ static void Classic_LevelDataChunk(Stream* stream) {
|
|||||||
|
|
||||||
if (!gzHeader.Done) { GZipHeader_Read(&mapPartStream, &gzHeader); }
|
if (!gzHeader.Done) { GZipHeader_Read(&mapPartStream, &gzHeader); }
|
||||||
if (gzHeader.Done) {
|
if (gzHeader.Done) {
|
||||||
if (mapSizeIndex < 4) {
|
if (mapSizeIndex < sizeof(UInt32)) {
|
||||||
UInt8* src = mapSize + mapSizeIndex;
|
UInt8* src = mapSize + mapSizeIndex;
|
||||||
UInt32 count = 4 - mapSizeIndex, modified = 0;
|
UInt32 count = sizeof(UInt32) - mapSizeIndex, modified = 0;
|
||||||
mapInflateStream.Read(&mapInflateStream, src, count, &modified);
|
mapInflateStream.Read(&mapInflateStream, src, count, &modified);
|
||||||
mapSizeIndex += modified;
|
mapSizeIndex += modified;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mapSizeIndex == 4) {
|
if (mapSizeIndex == sizeof(UInt32)) {
|
||||||
if (map == NULL) {
|
if (map == NULL) {
|
||||||
mapVolume = (mapSize[0] << 24) | (mapSize[1] << 16) | (mapSize[2] << 8) | mapSize[3];
|
mapVolume = (mapSize[0] << 24) | (mapSize[1] << 16) | (mapSize[2] << 8) | mapSize[3];
|
||||||
map = Platform_MemAlloc(mapVolume, sizeof(BlockID));
|
map = Platform_MemAlloc(mapVolume, sizeof(BlockID));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user