
D3DVERTEX* vbuffer;



var obj_editor = 0;
var window_object_x = 0;

DAT_STRUC_HEADER hData;
DAT_STRUC_HIGHMAP* hmData;
DAT_STRUC_WATERMAP* waData;
DAT_STRUC_MAPOBJECTS objData[1000];
DAT_STRUC_MAPOBJECTS new_obj_list[999];
DAT_STRUC_EFFECT_1 effData_1;

DT_MARKER dt_marker[66049];    

ENTITY* spawn[1000];
ENTITY* newterrain;
ENTITY* map_objects[1000];
ENTITY* water[65536];
ENTITY* ped[65536];
ENTITY* monster[500];
ENTITY* ball1[1000];
ENTITY* ball2[1000];

ENTITY* obj_select;
ENTITY* obj_z_Pfeil;
ENTITY* obj_x_Pfeil;
ENTITY* obj_y_Pfeil;
ENTITY* edit_ball;
ENTITY* temporaere;
ENTITY* rotate_pan;
ENTITY* rotate_tilt;


ENTITY* my_player;

BMAP* Editor_Ground = "Editor_Leiste.tga";

int Edit_Object_count = 0; // Anzahl der neunen bzw bearbeitetn objecte
int Edit_object_Clone = 0;
var Editor_Mode = 0;
var terrain_high = 0;
var range = 300;
int scala_object;
var EditSpeed  = 2;
var ped_edit = 0;

var ent_locked;

var Edit_type = 0; //1 = terrain 2 = Object 3 Ped

var screen_x = 0;
int screen_y = 0;

var move_obj_y;
var move_obj_x;
var move_obj_z;
var mouse_move_object_x = 0;
var mouse_move_object_y = 0;
var mouse_move_object_z = 0;

HWND hwnd1;
HWND hwnd2;
HWND hwnd3;
HWND hwnd4;
HWND hwnd_button1;
HWND hwnd_button2;
HWND hWndListbox;
HWND Label1;
HWND View_OBJ_X;
HWND View_OBJ_Y;
HWND View_OBJ_Z;

HMENU menu;
HMENU hSubMenu;
HMENU hSubMenu1;
HMENU hSubMenu2;
HMENU hSubMenu3;

SMA_STRUC_HEADER hsmadata;

//SMA_UNSIN1 blabla1;
//SMA_UNSIN2 blabla2;
SMA_STRUC_DATEN sma_data2[65536];
SMA_MONSTER_BLOCK_COUNT smamb;
SMA_MONSTER_DATEN monster_data[500];

OBJ_TOTAL_HEADER htobj;

OBJ_DATA_HEADER hdobj_1;
OBJ_DATA_BLOCK blockobj_1[6553699];

MAP_TOTAL_HEADER hMap;
MAP_DATA_HEADER hMapData;
MAP_DATA_BLOCK mDataBlock[96553699];

STRING* maptexturparts[17];
BMAP* bDest;
STRING* Bmap_fileName;


var window_ObjectEdit = 0;
var window_AddItems = 0;
var window_ItemsOnMapList = 0;
var window_TerrainEdit = 0;

STRING* filepfad;
STRING* file_maptextur_pfad = "";
STRING* file_sma;
STRING* file_map;
STRING* file_id;
STRING* temp_map_name;
STRING* filepfad_save_sma;

FILE* datfile;
FILE* objfile;
FILE* tempfile;
FILE* smadata;
FILE* mapdata;
FILE* sma_save;
FILE* dat_save;
FILE* sma_save;
int map_array[257][257];

var sma_ped_create = 0;
var water_map_create = 0;
var objects_create = 0;
var monster_area = 0;

MATERIAL* doublesided =
{
	effect="
	texture entSkin1;

	technique doubleup
	{
		pass p0
		{
			Texture[0]=<entSkin1>;
			ZWriteEnable=True;
			AlphaBlendEnable=False;
			AlphaTestEnable=True;
			CullMode=None; // CCW or None
		}
	}
	technique fallback{pass p0{}}
	";
}

