	long appFlags = 0;

char exeDir[256];

#define AF_FSCREEN   2			// Attila fullscreen  flag
#define AF_RENDERING 4			// Attila rendering   flag
#define AF_DEBUG	 8			// Attila debug mode

#define NPART		40
#define PARTOVER	1500			// particule life time in ms

bool debug()
{
	if ( appFlags & AF_DEBUG) return true;
	else return false;
}


#define AF_TYPE_OBJECT 0
#define AF_TYPE_LIGHT  1
#define AF_TYPE_CAMERA 0
#define AF_TYPE_NULLOBJECT 3	// types of entities
#define AF_MAX_SCENES 512
#define AF_MAX_SURFACES 15000	// allocated during loading only !!!
#define AF_MAX_TEXTURES 5000	// allocated during loading only !!!
#define AF_MAX_CHILDS	200// should be enough I think, its one-level-childs/obj
#define AF_MAX_SPRITES  25

//	flags for surfaces which define render type
#define AF_FLAGS_SCOL	0
#define AF_FLAGS_FLAT	1
#define AF_FLAGS_GOUR	2
#define AF_FLAGS_FMAP	4
#define AF_FLAGS_TMAP	8
#define AF_FLAGS_PHNG	16
#define AF_FLAGS_SPEC	32
#define AF_FLAGS_ADDI	64
#define AF_FLAGS_DSID	128
#define AF_FLAGS_OSRF	256
#define AF_FLAGS_GLOW	512
#define AF_FLAGS_HAIR	1024
#define AF_FLAGS_ALPH	4096
#define AF_FLAGS_LINE	8192
#define AF_FLAGS_ZBUF	16384
#define AF_FLAGS_LIGH	32768


//	---------------------- SOFTWARE DEFS --------------------------

USHORT	**HiPalette = NULL;		//	allocated in software only :)   65536*40 short integers
float Zcut = 0.1f; // fix 4 the moment
float	ftri,Iftri = 0xffffffff * Zcut;	// value to multiply to fill the 32 bits value
//	zbuff precision: 24bits, fill 32 bits anyway and cut 8 bits for integer precision :)

	struct daPoint
	{
	public:;
		float x,y,z;
		float It;	// Gouraud value
		float xm1,ym1,xm2,ym2,fill;	// coord mappings
	}typedef daPoint;
long sizePoint = sizeof(daPoint)>>2;	// daPoint must have 32bits members only!

	struct daFace
	{
		USHORT ngone;
		daPoint *dataPoints;
		USHORT nsurf;
		float nx,ny,nz;	// normal of the face
		float	itf;		// lightning of the face
		float	diss;	// alpha face value
	};

	struct lightMat
	{
		float diffuse;
		float specular;
		float ambient;
	};

	void *VirtualScreen;
	long pitch;
	ULONG *zScreen=NULL;

#ifndef PLATFORM_LINUX
	#include "bass.h"
	HMUSIC mod;
	HSTREAM	strm;
#endif
	char musicname[256];
//	----------------------------------------------------------------

	long res_x = 640, res_y = 480;	// default resolution

	char OutputBuffer[1024];		// temp buffer used in various cases

#define		pi				3.1415926535897932384626433832795F
#define		PI				pi
	struct vertex
	{
		float x,y,z;
	};

//	opengl video image
	void *videoGL = NULL;
	long videoGLnum = 0;

	bool demoMode = false;