diff --git a/TODO.txt b/TODO.txt index 511d133..bfed44d 100644 --- a/TODO.txt +++ b/TODO.txt @@ -20,7 +20,6 @@ =========== BUGS ================= -- was able to take a CP without it changing color to gray, try to reproduce - drawing dithered transparent objects fills z-buffer in the transparent parts and then the geometry behind it isn't drawn <- PARTIALLY FIXED NOW @@ -45,6 +44,7 @@ AND frontend doesn't have to use RGB565 (it can basically choose any mode). - drifting: passing some upper threshold on steering force should reduce steering friction until reaching some some lower threshold again probably +- was able to take a CP without it changing color to gray, try to reproduce - Environments: just different textures for a cube inside which the tarck is, the cube won't have the top side, texture can have transparency (sky see through) <-- NO diff --git a/game.h b/game.h index 81b37fd..bf98ccc 100644 --- a/game.h +++ b/game.h @@ -847,8 +847,8 @@ uint8_t LCR_gameStep(uint32_t time) { int carBlock[3]; - LCR_racingGetCarBlockCoords(carBlock); LCR_LOG1("CP taken"); + LCR_racingGetCarBlockCoords(carBlock); LCR_rendererMarkTakenCP(carBlock[0],carBlock[1],carBlock[2]); LCR_audioPlaySound(LCR_SOUND_CLICK); } diff --git a/racing.h b/racing.h index 27ca156..afff05b 100644 --- a/racing.h +++ b/racing.h @@ -1043,39 +1043,6 @@ uint32_t LCR_racingStep(unsigned int input) LCR_racing.fanForce = 0; } - int carBlock[3]; - - LCR_racingGetCarBlockCoords(carBlock); - - carBlock[0] = LCR_mapGetBlockAt(carBlock[0],carBlock[1],carBlock[2]); - - if (carBlock[0] >= 0) - { - if (LCR_currentMap.blocks[carBlock[0] * LCR_BLOCK_SIZE] == - LCR_BLOCK_CHECKPOINT_0) - { - LCR_currentMap.blocks[carBlock[0] * LCR_BLOCK_SIZE] = - LCR_BLOCK_CHECKPOINT_1; - - result |= LCR_RACING_EVENT_CP_TAKEN; - } - else if (LCR_currentMap.blocks[carBlock[0] * LCR_BLOCK_SIZE] == - LCR_BLOCK_FINISH) - { - int valid = 1; - - for (int i = 0; i < LCR_currentMap.blockCount; ++i) - if (LCR_currentMap.blocks[i * LCR_BLOCK_SIZE] == LCR_BLOCK_CHECKPOINT_0) - { - valid = 0; - break; - } - - if (valid) - result |= LCR_RACING_EVENT_FINISHED; - } - } - LCR_LOG2("gonna step physics engine"); TPE_worldStep(&(LCR_racing.physicsWorld)); LCR_LOG2("stepping physics engine done"); @@ -1202,6 +1169,39 @@ uint32_t LCR_racingStep(unsigned int input) LCR_racing.carOKPositions[i] = LCR_racing.carBody.joints[i].position; } + int carBlock[3]; + + LCR_racingGetCarBlockCoords(carBlock); + + carBlock[0] = LCR_mapGetBlockAt(carBlock[0],carBlock[1],carBlock[2]); + + if (carBlock[0] >= 0) + { + if (LCR_currentMap.blocks[carBlock[0] * LCR_BLOCK_SIZE] == + LCR_BLOCK_CHECKPOINT_0) + { + LCR_currentMap.blocks[carBlock[0] * LCR_BLOCK_SIZE] = + LCR_BLOCK_CHECKPOINT_1; + + result |= LCR_RACING_EVENT_CP_TAKEN; + } + else if (LCR_currentMap.blocks[carBlock[0] * LCR_BLOCK_SIZE] == + LCR_BLOCK_FINISH) + { + int valid = 1; + + for (int i = 0; i < LCR_currentMap.blockCount; ++i) + if (LCR_currentMap.blocks[i * LCR_BLOCK_SIZE] == LCR_BLOCK_CHECKPOINT_0) + { + valid = 0; + break; + } + + if (valid) + result |= LCR_RACING_EVENT_FINISHED; + } + } + LCR_racing.tick++; LCR_LOG2("racing step end"); diff --git a/settings.h b/settings.h index a60cc3b..0ada35d 100644 --- a/settings.h +++ b/settings.h @@ -184,7 +184,7 @@ #ifndef LCR_SETTING_COUNTDOWN_SECONDS /** Run start countdown length in seconds. */ - #define LCR_SETTING_COUNTDOWN_SECONDS 3 + #define LCR_SETTING_COUNTDOWN_SECONDS 1 // for release make 3 #endif #endif // guard