// 3d.h

#ifndef	__3_DIMENSIONAL__
#define __3_DIMENSIONAL__

#include "ioanhead.h"
#include "video.h"

#define SCREEN_WIDTH	320
#define SCREEN_HEIGHT	200
#define MAP_WIDTH	64
#define MAP_HEIGHT	64

// Don't forget to alter BOTH!
// Note to BadSector: 2^lg(x) = x
#define LG_BLOCK_SIZE	7
#define BLOCK_SIZE	128


// "To Jupiter,and beyond the infinite"
// proigoumenos INFINITE = (MAX(MAP_WIDTH,MAP_HEIGHT) * BLOCK_SIZE * 2)
#define	JUPITER
#define INFINITE	(MAX(MAP_WIDTH,MAP_HEIGHT) * 256)

// Moving/turning around/running/positioning attributes
#define	STEP		(BLOCK_SIZE/9)
#define LEFT		1.0
#define RIGHT		-1.0
#define FORWARD		1
#define BACKWARD        -1
#define WALKING_SPEED	2
#define RUNNING_SPEED	4
#define TURNING_SPEED	15.0
#define COLLISION_DIST	3

// remember 2^8 = 256
// the less,the darker the room
#define SHADN_MODIFIER	7

// The greater the scale,the smaller the surroundings look
//#define SCALE		1



// Functions defined in 3D.c
int 	InsideMap(point c);
int 	HitWall(point c);
void	DrawWallSlice(int x,double distance,int TextureName,int offset,boolean shading,boolean candlelight);
void    DrawWalls(vector position,int MiniMapX,boolean shading,boolean candlelight);
void	Turn(float direction,float angle,vector *position);
void	Move(int direction,int step,vector *position);
void	LoadMap(char *mapname,vector *position);



#endif