I'm trying to use the above procedure to color my surfaces, but for some reason I'm getting an error with the 'AsciiMap.Format' part, when trying to set the transparency color of my surface:

[pascal]VAR AsciiMap : PSDL_Surface;
TempImage : PSDL_Surface;

{...}

TempImage := SDL_LoadBMP('640x400.bmp');
AsciiMap := SDL_DisplayFormat(TempImage);
SDL_SetColorKey(AsciiMap, SDL_SRCCOLORKEY OR SDL_RLEACCEL, SDL_MapRGB(AsciiMap.Format, 255, 0, 255));
[/pascal]

I can't figure out what I'm doing wrong. I believe I'm declaring the surfaces correctly.


EDIT: The compile error I'm getting is 'Unexpected identifier "Format"', so it seems there's something wrong with my AsciiMap surface - maybe I haven't declared it correctly? Any help would be appreciated!