// BlinkGame - Hunt for the Lost Pixels
// an SDL game in honor of the BlinkenArea crew
//
// (C) 2005-06 Rene Schickbauer
//
// See License.txt for licensing information
//
#ifdef NOP_CODE
/*--------------------------------------------------------------------
					CVS AUTO-GENERATED INFO
$Author: cavac $
$Date: 2006/03/15 22:54:08 $
$Name: rel-0-3-patches $
$Revision: 1.7 $
$State: Exp $

$Log: levelhandler.h,v $
Revision 1.7  2006/03/15 22:54:08  cavac
* Added property/methods for setting FG objects as "ontop" which renders
them on top of everything.
* Changed levelhandler.* so that it uses the newly added "AddPixel" function
instead of doing it internally in the file parser state machine.
* Added functionality for bonus live collectables
* Adapted lua bindings so it can utilize above properties
* Removed l2b prefix from lua bindings and adapted scripts
* Added temporary 32x32 explosion graphics
* Adapted level0.bsl (Testlevel/scripting) so it has a small riddle:
  You have to turn on all switches and press the emergency stop button
  while the neon sign is ON (e.g. it lights up yellow). two small
  explosions leave one pixel and one bonus live collectible behind.
  (You can NOT finish the level without collecting the second pixel!)

Revision 1.6  2006/03/02 13:03:42  cavac
Re-formatted all .cpp and .h files a bit to get rid of the TAB/SPACE mess
that makes troubles with XCode's "re-format" feature

Revision 1.5  2006/02/24 18:48:26  cavac
Finally added real scripting support
Added Testlevel (level0) which can be enabled from globals.h

Revision 1.4  2006/01/19 19:19:15  cavac
Various bugfixes and performance tunings

Revision 1.3  2006/01/18 01:22:39  cavac
Added SDL_Image to load additional graphics formats
Updated osdef* and xcode-project to to add SDL_Image
Updated all image-loader functions to use SDL_Image
Added level6 as temporary testlevel
Added code to display start- and goal-points with an animation (needs some fixing)
Removed temporary "marker"-tiles from level-definitions, as we have now an
animated display for that.

Revision 1.2  2006/01/09 00:50:34  cavac
Bugfixed CVS autogenerated entries in background.cpp
Added CVS autogenerated entries to remaining .cpp and .h files
Updated copyright from "2005 Rene Schickbauer" to "2005-06 Rene Schickbauer"


--------------------------------------------------------------------*/
#endif //NOP_CODE

#ifndef LEVELHANDLER_H
#define LEVELHANDLER_H

// include the monster-handler here because we need the monster structure
#include "monstersprites.h"

struct DISPLAYLIST {
	Uint32 type;
	Uint32 x;
	Uint32 y;
	DISPLAYLIST* next;
};

typedef enum _PIXELSTYPE {
	PIXELTYPE_NONE = 0,
	PIXELTYPE_PIXEL,
	PIXELTYPE_LIVE
} PIXELTYPE;
	

struct LEVELHANDLER {
	Uint32 leveltime;
	char bgfile[MAX_STRING_LENGTH];
	char sndfile[MAX_STRING_LENGTH];
	char tilesfile[MAX_STRING_LENGTH];
	char leveldata[MAX_STRING_LENGTH];
	char scriptfile[MAX_STRING_LENGTH];
	Uint32 height;
	Uint32 width;
	Uint32 numBlocks;
	Uint32 numPixels;
	Uint32 start_x;
	Uint32 start_y;
	Uint32 goal_x;
	Uint32 goal_y;
	DISPLAYLIST* dlist;
	DISPLAYLIST* pixels;
	MONSTERS* monsters;
	bool hasScript;
	Uint32 numMonsters;
};

extern LEVELHANDLER lhandle;

void initLevel(Uint32 level);
void deInitLevel();
void addPixel(Uint32 x, Uint32 y, Uint32 pixeltype);
void incrementMaxPixels(Uint32 count);
void paintLevelPixels(Uint32 xoffs, Uint32 yoffs, Uint32 blinkbright);
bool checkForTile(Uint32 x, Uint32 y);

#endif // LEVELHANDLER_H
