diff options
| author | XaviDCR92 <xavi.dcr@gmail.com> | 2017-12-26 22:18:37 +0100 |
|---|---|---|
| committer | XaviDCR92 <xavi.dcr@gmail.com> | 2017-12-26 22:18:37 +0100 |
| commit | 4eaa6c091f97ca3455b2ae48a5f68867c0f7768e (patch) | |
| tree | 79ae89ae5b7399c774ae6fcb792c109a725e1af8 /Source/Camera.c | |
| parent | f06d582d63b1f91e48ecb17a11987217144c5c79 (diff) | |
| download | airport-4eaa6c091f97ca3455b2ae48a5f68867c0f7768e.tar.gz | |
* Slight optimization: all comparations against true are now compared against != false.
+ Added a provisional background during gameplay (still WIP).
* Map editor now allows creating a map.
Diffstat (limited to 'Source/Camera.c')
| -rw-r--r-- | Source/Camera.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Source/Camera.c b/Source/Camera.c index 1323d60..657fcab 100644 --- a/Source/Camera.c +++ b/Source/Camera.c @@ -58,9 +58,9 @@ void CameraApplyCoordinatesToRectangle(TYPE_PLAYER* ptrPlayer, GsRectangle * rec void CameraUpdateSpeed(TYPE_PLAYER* ptrPlayer) { - if (ptrPlayer->PadDirectionKeyPressed_Callback() == true) + if (ptrPlayer->PadDirectionKeyPressed_Callback() != false) { - if (ptrPlayer->PadKeyPressed_Callback(PAD_LEFT) == true) + if (ptrPlayer->PadKeyPressed_Callback(PAD_LEFT) != false) { if (ptrPlayer->Camera.X_Speed < 0) { @@ -72,7 +72,7 @@ void CameraUpdateSpeed(TYPE_PLAYER* ptrPlayer) } } - if (ptrPlayer->PadKeyPressed_Callback(PAD_UP) == true) + if (ptrPlayer->PadKeyPressed_Callback(PAD_UP) != false) { if (ptrPlayer->Camera.Y_Speed < 0) { @@ -84,7 +84,7 @@ void CameraUpdateSpeed(TYPE_PLAYER* ptrPlayer) } } - if (ptrPlayer->PadKeyPressed_Callback(PAD_DOWN) == true) + if (ptrPlayer->PadKeyPressed_Callback(PAD_DOWN) != false) { if (ptrPlayer->Camera.Y_Speed > 0) { @@ -96,7 +96,7 @@ void CameraUpdateSpeed(TYPE_PLAYER* ptrPlayer) } } - if (ptrPlayer->PadKeyPressed_Callback(PAD_RIGHT) == true) + if (ptrPlayer->PadKeyPressed_Callback(PAD_RIGHT) != false) { if (ptrPlayer->Camera.X_Speed > 0) { @@ -140,7 +140,7 @@ void CameraUpdateSpeed(TYPE_PLAYER* ptrPlayer) void CameraHandler(TYPE_PLAYER* ptrPlayer) { - if (CameraSpecialConditions(ptrPlayer) == true) + if (CameraSpecialConditions(ptrPlayer) != false) { ptrPlayer->Camera.X_Speed = 0; ptrPlayer->Camera.Y_Speed = 0; @@ -166,9 +166,9 @@ void CameraHandler(TYPE_PLAYER* ptrPlayer) bool CameraSpecialConditions(TYPE_PLAYER* ptrPlayer) { - if ( (ptrPlayer->ShowAircraftData == true) + if ( (ptrPlayer->ShowAircraftData != false) || - (ptrPlayer->SelectRunway == true) ) + (ptrPlayer->SelectRunway != false) ) { // Camera cannot be handled when these states are activated @@ -183,7 +183,7 @@ TYPE_ISOMETRIC_POS CameraGetIsoPos(TYPE_PLAYER* ptrPlayer) TYPE_ISOMETRIC_POS IsoPos; TYPE_CARTESIAN_POS CartPos; - if (GameTwoPlayersActive() == true) + if (GameTwoPlayersActive() != false) { CartPos.x = CAMERA_INITIAL_X_OFFSET_2PLAYER - ptrPlayer->Camera.X_Offset; CartPos.y = (Y_SCREEN_RESOLUTION >> 1) - ptrPlayer->Camera.Y_Offset; @@ -213,7 +213,7 @@ void CameraMoveToIsoPos(TYPE_PLAYER* ptrPlayer, TYPE_ISOMETRIC_POS IsoPos) CartPos.x, CartPos.y );*/ - if (GameTwoPlayersActive() == true) + if (GameTwoPlayersActive() != false) { ptrPlayer->Camera.X_Offset = CAMERA_INITIAL_X_OFFSET_2PLAYER - CartPos.x; ptrPlayer->Camera.Y_Offset = (Y_SCREEN_RESOLUTION >> 1) - CartPos.y; |
