Fog Of War.c 928 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifdef PRECOMPILEDHEADERS
  2. #include "TileEngine All.h"
  3. #else
  4. #include "types.h"
  5. #include "Fog Of War.h"
  6. #include "Isometric Utils.h"
  7. #include "worldman.h"
  8. #include "Simple Render Utils.h"
  9. #include "Renderworld.h"
  10. #include "lighting.h"
  11. #endif
  12. //When line of sight reaches a gridno, and there is a light there, it turns it on.
  13. //This is only done in the cave levels.
  14. void RemoveFogFromGridNo( UINT32 uiGridNo )
  15. {
  16. INT32 i;
  17. INT32 x, y;
  18. UINT32 uiAdjacentGridNo = 0;
  19. x = uiGridNo % WORLD_COLS;
  20. y = uiGridNo / WORLD_COLS;
  21. for( i = 0; i < MAX_LIGHT_SPRITES; i++ )
  22. {
  23. if( LightSprites[ i ].iX == x && LightSprites[ i ].iY == y )
  24. {
  25. if( !(LightSprites[ i ].uiFlags & LIGHT_SPR_ON) )
  26. {
  27. LightSpritePower( i, TRUE );
  28. LightDraw( LightSprites[i].uiLightType, LightSprites[i].iTemplate, LightSprites[i].iX, LightSprites[i].iY, i );
  29. MarkWorldDirty();
  30. return;
  31. }
  32. }
  33. }
  34. }