Flashlight changes (#81)

* Flashlight changes:
- Fixed the lighted area being way too large in the diagonal directions.
- Added a minimum range to simulate a flashlight user not illuminating its feet.
- Added angle based calculations instead of the hardcoded one.

* Flashlight changes, MR feedback.
This commit is contained in:
CptMoore
2023-01-18 20:52:12 +02:00
committed by GitHub
parent d6896c9234
commit 624c0f3bc4
4 changed files with 182 additions and 72 deletions
+3
View File
@@ -30,6 +30,8 @@ extern UINT8 gTwoCDirection[ NUM_WORLD_DIRECTIONS ];
extern UINT8 gOneCDirection[ NUM_WORLD_DIRECTIONS ];
extern UINT8 gOneCCDirection[ NUM_WORLD_DIRECTIONS ];
UINT8 DirectionIfTurnedClockwise(UINT8 facing, UINT8 times);
extern UINT8 gPurpendicularDirection[ NUM_WORLD_DIRECTIONS ][ NUM_WORLD_DIRECTIONS ];
// Macros
@@ -40,6 +42,7 @@ extern UINT8 gPurpendicularDirection[ NUM_WORLD_DIRECTIONS ][ NUM_WORLD_DIRECTIO
#define GETWORLDINDEXFROMWORLDCOORDS( y, x ) ( (INT32) ( x / CELL_X_SIZE ) ) + WORLD_COLS * ( (INT32) ( y / CELL_Y_SIZE ) )
void ConvertDirectionToVectorInXY(UINT8 ubDirection, INT16* sXDir, INT16* sYDir);
void ConvertGridNoToXY( INT32 sGridNo, INT16 *sXPos, INT16 *sYPos );
void ConvertGridNoToCellXY( INT32 sGridNo, INT16 *sXPos, INT16 *sYPos );
void ConvertGridNoToCenterCellXY( INT32 sGridNo, INT16 *sXPos, INT16 *sYPos );