#ifndef BUILDING_H #define BUILDING_H 1 //#include "c:\fallen\headers\memory.h" //DEFINES //#define TEXTURE_PIECE_TOP_LEFT (0) //#define TEXTURE_PIECE_TOP_MIDDLE (1) //#define TEXTURE_PIECE_TOP_RIGHT (2) #define TEXTURE_PIECE_LEFT (0) #define TEXTURE_PIECE_MIDDLE (1) #define TEXTURE_PIECE_RIGHT (2) #define TEXTURE_PIECE_MIDDLE1 (3) #define TEXTURE_PIECE_MIDDLE2 (4) #define TEXTURE_PIECE_NUMBER (5) #if defined(PSX) || defined(TARGET_DC) #define RMAX_PRIM_POINTS 15000 #define MAX_PRIM_FACES3 10000 #define RMAX_PRIM_FACES4 10000 #define MAX_PRIM_OBJECTS 2000 #define MAX_PRIM_MOBJECTS 100 #else #define RMAX_PRIM_POINTS 65000 #define MAX_PRIM_FACES3 32000 #define RMAX_PRIM_FACES4 32760 #define MAX_PRIM_OBJECTS 2000 #define MAX_PRIM_MOBJECTS 100 #endif #define MAX_PRIM_POINTS (save_table[SAVE_TABLE_POINTS].Maximum) #define MAX_PRIM_FACES4 (save_table[SAVE_TABLE_FACE4].Maximum) #define GRAB_FLOOR (MAX_PRIM_FACES4+1) #define GRAB_SEWERS (MAX_PRIM_FACES4+2) #define MAX_ROOF_BOUND 2000 //(8k) #define BLOCK_SHIFT (6) #define BLOCK_SIZE (1<>2) struct FBuilding { UWORD ThingIndex; UWORD LastDrawn; // The GAME_TURN this building was last drawn at. UBYTE Dummy2; UBYTE Foundation; SWORD OffsetY; UWORD InsideSeed; UBYTE MinFoundation; UBYTE ExtraFoundation; UWORD BuildingFlags; SWORD StoreyHead; SWORD Angle; UWORD StoreyCount; CBYTE str[20]; UBYTE StairSeed; UBYTE BuildingType; UWORD Walkable; UWORD Dummy[4]; }; typedef SVector PrimNormal; //data #ifndef PSX extern struct DXTXTY dx_textures_xy[200][5]; #endif extern UWORD next_roof_bound; extern UWORD next_prim_point; extern UWORD next_prim_face4; extern UWORD next_prim_face3; extern UWORD next_prim_object; extern UWORD next_prim_multi_object; extern UWORD end_prim_point; extern UWORD end_prim_face4; extern UWORD end_prim_face3; extern UWORD end_prim_object; extern UWORD end_prim_multi_object; extern UWORD next_building_object; extern UWORD end_building_object; extern UWORD next_building_facet; extern UWORD end_building_facet; extern struct BuildingObject building_objects[]; extern struct BuildingFacet building_facets[]; extern struct FWindow window_list[MAX_WINDOWS]; extern struct FWall wall_list[MAX_WALLS]; extern struct FStorey storey_list[MAX_STOREYS]; extern struct FBuilding building_list[MAX_BUILDINGS]; extern struct TXTY textures_xy[200][5]; extern UBYTE textures_flags[200][5]; extern struct TextureInfo texture_info[]; extern struct RoomID room_ids[MAX_INSIDE_STOREYS]; extern SLONG next_inside; // functions extern SLONG place_building_at(UWORD prim,SLONG x,SLONG y,SLONG z); extern void offset_buildings(SLONG x,SLONG y,SLONG z); //extern void calc_buildings_world_box(UWORD prim,SLONG x,SLONG y,SLONG z,EdRect *rect); //extern void calc_buildings_screen_box(UWORD prim,SLONG x,SLONG y,SLONG z,EdRect *rect); extern void draw_a_building_at(UWORD building,SLONG x,SLONG y,SLONG z); extern void create_city(UBYTE flag); extern SLONG create_building_prim(UWORD building,SLONG *small_y); extern SLONG next_connected_face(SLONG type,SLONG id,SLONG count); extern SLONG is_storey_circular(SLONG storey); // // Returns the start and end of the given wall. // void get_wall_start_and_end( SLONG wall, // // These are 16-bit map coordinates... // SLONG *x1, SLONG *z1, SLONG *x2, SLONG *z2); // // Returns how far (x,z) is along a cable. Value goes from 0 to // (1 << CABLE_ALONG_SHIFT) // #define CABLE_ALONG_SHIFT 12 #define CABLE_ALONG_MAX (1 << CABLE_ALONG_SHIFT) SLONG get_cable_along( SLONG storey, SLONG x, SLONG z); // // Make a cable taut, as if someone is dangling at some point along it. // It returns the height of the point she is dangling at. // // // If you know how far she is along the cable. This is the percentage // straight-line distance from (x1,y1,z1) of the cable to (x2,y2,z2). // 'along' goes from 0 to 256. // void make_cable_taut_along( SLONG along, // 0 - 256 SLONG building, SLONG *x_hanging_point, SLONG *y_hanging_point, SLONG *z_hanging_point); // // Returns the cable to being flabby. // void make_cable_flabby(SLONG building); #endif