Home WinSpy2 & SpyDrive2 ECFTP Eon Clash's Text File Monitor Resume Creation Suite EC LCD Editor XML Browser Lite TXMLParser for Delphi Treemap ECXML Parser for Lazarus pas2lua and lua for Delphi/FPC AVR GCC Deprecated Macros XMethods WSDL Browser Graphics 32 Image Editor Demo Using TPaintBox for annimations Maze Generation and Solving TSimpleMath JD Docking Components JDErrorLog JDImageButton Tile Joiner SDL, LUA, and Freepascal Game Engine Demo Simple Bezier Curve sample in Lazarus Recurisve Shadowmapping in FPC/Lazarus ATerm - ANSI Terminal Demo Simple Side Scroller Demo Source Generic Pascal Lua Library pLua (Lua wrapper for FPC, Lazarus, and Delphi) News Forums Jeremy's Resume Contact Us Bug Tracking JumpStart Game Engine Jeremy's Blog

Recurisve Shadowmapping in FPC/Lazarus

Conversion of FOV.CPP (created by Björn Bergström) to pascal by Jeremy Darling.

This is a pascal implmentation of recursive shadowcasting.

Generic information:
mapData - Pointer to the object or data structure containing the map data
x, y - Current x and y positions or start position
BlocksFOV - Set to true if the FOV should stop at the cell
Set to false if you can see past this cell.

Sample Usage:


    fov := TSimpleFOV.Create;
try
fov.CanSeePast:=@NotWalkable;
fov.LightCell:=@Light;
fov.start(CurrentLevel, Player.X, Player.Y, Player.LightLevel);
finally
fov.Free;
end;
Download includes a sample usage application:

Click here to download
Text Link Ads