-
Notifications
You must be signed in to change notification settings - Fork 0
/
landscape.h
303 lines (282 loc) · 13.4 KB
/
landscape.h
1
/****************************************************************************************//* LANDSCAPE.H *//****************************************************************************************//* (c) 1995 by Magnet Interactive Studios, inc. All rights reserved. *//****************************************************************************************//* Revision History: *//* 7/6/94 File first created. By Andrew Looney. *//* v1.0 8/3/94 First polished version. By Andrew Looney. *//* 8/8/94 Started making changes for next version. *//* v2.0 8/24/94 Seven level version burned onto CD-ROM. By Andrew Looney. *//* v2.1 8/29/94 Comments brought back up to date. By Andrew Looney. *//* v2.2 9/7/94 Sixteen level version. By Andrew Looney. *//* v2.3 9/23/94 Thirty level version burned onto CD-ROM. By Andrew Looney. *//* v2.4 10/19/94 Fifty level version. By Andrew Looney. *//* v2.5 10/31/94 Sixty level version burned onto CD-ROM. By Andrew Looney. *//* v3.0 10/31/94 Began switching over to real artwork. By Andrew Looney. *//* v3.1 11/11/94 COMDEX version. By Andrew Looney. *//* v3.2 12/2/94 Seventy-five level version. By Andrew Looney. *//* v3.3 12/14/94 Ack! Zombies! By Andrew Looney. *//* v3.4 12/23/94 Orange Meanies! By Andrew Looney. *//* v3.5 1/3/95 100 Levels! By Andrew Looney. *//* v3.6 1/5/95 101 Levels. By Andrew Looney. *//* v3.7 1/16/95 New, improved Brainy Seeker logic! By Andrew Looney. *//* v3.8 1/27/95 114 level version burned onto CD-ROM. By Andrew Looney. *//* v3.9 2/3/95 New CD-ROM burned for shipment to 3DO. By Andrew Looney. *//* v4.0 2/9/95 New CD-ROM featuring the big level grid. By Andrew Looney. *//* v4.1 2/22/95 New CD-ROM with rough draft of full interface. By Andrew Looney. *//* v4.2 3/17/95 The St. Patrick's Day Version. By Andrew Looney. *//* v4.3 3/20/95 The last version before the movies get added. By Andrew Looney. *//* v4.4 3/21/95 First version with movies integrated. By Andrew Looney. *//* v4.5 3/22/95 Second version with movies integrated. By Andrew Looney. *//* v4.6 3/27/95 Third version with movies integrated. By Andrew Looney. *//* v5.0 3/28/95 Newest version sent to QA. By Andrew Looney. *//* v5.1 3/28/95 Now, with Easter Eggs! By Andrew Looney. *//* v5.2 3/29/95 Could this be the final version? By Andrew Looney. *//* v5.3 3/30/95 OK, now maybe THIS is the final version! By Andrew Looney. *//* v5.4 4/3/95 Made a couple more minor changes. By Andrew Looney. *//****************************************************************************************/typedef struct anitile{ anim_user tile_anim; bool endless; int32 row; int32 column; anitile *next;};typedef struct hazard{ int32 row; int32 column; hazard *next;};/****************************************************************************************/#define GA_FILE "$boot/IceFiles/TileArt/grass/GA.cel"#define GA2PE_FILE "$boot/IceFiles/TileArt/grass/GAtoPE.anim"#define PE_FILE "$boot/IceFiles/TileArt/grass/PE.cel"#define GB_FILE "$boot/IceFiles/TileArt/grass/GB.cel"#define GB2PA_FILE "$boot/IceFiles/TileArt/grass/GBtoPA.anim"#define PA_FILE "$boot/IceFiles/TileArt/grass/PA.cel"#define GC_FILE "$boot/IceFiles/TileArt/grass/GC.cel"#define GD_FILE "$boot/IceFiles/TileArt/grass/GD.cel"#define GE_FILE "$boot/IceFiles/TileArt/grass/GE.cel"#define GF_FILE "$boot/IceFiles/TileArt/grass/GF.cel"#define GC2PA_FILE "$boot/IceFiles/TileArt/grass/GCtoPA.anim"#define GD2PA_FILE "$boot/IceFiles/TileArt/grass/GDtoPA.anim"#define GE2PA_FILE "$boot/IceFiles/TileArt/grass/GEtoPA.anim"#define GF2PA_FILE "$boot/IceFiles/TileArt/grass/GFtoPA.anim"#define DA_FILE "$boot/IceFiles/TileArt/desert/DA.cel"#define DA2PJ_FILE "$boot/IceFiles/TileArt/desert/DAtoPJ.anim"#define PJ_FILE "$boot/IceFiles/TileArt/desert/PJ.cel"#define DB_FILE "$boot/IceFiles/TileArt/desert/DB.cel"#define DB2PI_FILE "$boot/IceFiles/TileArt/desert/DBtoPI.anim"#define PI_FILE "$boot/IceFiles/TileArt/desert/PI.cel"#define DC_FILE "$boot/IceFiles/TileArt/desert/DC.cel"#define DD_FILE "$boot/IceFiles/TileArt/desert/DD.cel"#define DD2PH_FILE "$boot/IceFiles/TileArt/desert/DDtoPH.anim"#define PH_FILE "$boot/IceFiles/TileArt/desert/PH.cel"#define DC2PJ_FILE "$boot/IceFiles/TileArt/desert/DCtoPJ.anim"#define DE_FILE "$boot/IceFiles/TileArt/desert/DE.cel"#define DE2PJ_FILE "$boot/IceFiles/TileArt/desert/DEtoPJ.anim"#define IA_FILE "$boot/IceFiles/TileArt/ice/IA.cel"#define IA2PB_FILE "$boot/IceFiles/TileArt/ice/IAtoPB.anim"#define PB_FILE "$boot/IceFiles/TileArt/ice/PB.cel"#define IB_FILE "$boot/IceFiles/TileArt/ice/IB.cel"#define IB2PG_FILE "$boot/IceFiles/TileArt/ice/IBtoPG.anim"#define PG_FILE "$boot/IceFiles/TileArt/ice/PG.cel"#define IC_FILE "$boot/IceFiles/TileArt/ice/IC.cel"#define ID_FILE "$boot/IceFiles/TileArt/ice/ID.cel"#define IC2PB_FILE "$boot/IceFiles/TileArt/ice/ICtoPB.anim"#define ID2PB_FILE "$boot/IceFiles/TileArt/ice/IDtoPB.anim"#define L1_FILE "$boot/IceFiles/TileArt/lava/L1.anim"#define LA_FILE "$boot/IceFiles/TileArt/lava/LA.cel"#define LB_FILE "$boot/IceFiles/TileArt/lava/LB.cel"#define HA_FILE "$boot/IceFiles/TileArt/volcanic/HA.cel"#define HA2PF_FILE "$boot/IceFiles/TileArt/volcanic/HAtoPF.anim"#define PF_FILE "$boot/IceFiles/TileArt/volcanic/PF.cel"#define HB_FILE "$boot/IceFiles/TileArt/volcanic/HB.cel"#define HC_FILE "$boot/IceFiles/TileArt/volcanic/HC.cel"#define HD_FILE "$boot/IceFiles/TileArt/volcanic/HD.cel"#define HD2PC_FILE "$boot/IceFiles/TileArt/volcanic/HDtoPC.anim"#define PC_FILE "$boot/IceFiles/TileArt/volcanic/PC.cel"#define HE_FILE "$boot/IceFiles/TileArt/volcanic/HE.cel"#define HC2PL_FILE "$boot/IceFiles/TileArt/volcanic/HCtoPL.anim"#define PL_FILE "$boot/IceFiles/TileArt/volcanic/PL.cel"#define HB2PC_FILE "$boot/IceFiles/TileArt/volcanic/HBtoPC.anim"#define HE2PC_FILE "$boot/IceFiles/TileArt/volcanic/HEtoPC.anim"#define S1_FILE "$boot/IceFiles/TileArt/slime/S1.anim"#define SA_FILE "$boot/IceFiles/TileArt/slime/SA.cel"#define SB_FILE "$boot/IceFiles/TileArt/slime/SB.cel"#define WA_FILE "$boot/IceFiles/TileArt/swamp/WA.cel"#define WA2PD_FILE "$boot/IceFiles/TileArt/swamp/WAtoPD.anim"#define PD_FILE "$boot/IceFiles/TileArt/swamp/PD.cel"#define WB_FILE "$boot/IceFiles/TileArt/swamp/WB.cel"#define WB2PD_FILE "$boot/IceFiles/TileArt/swamp/WBtoPD.anim"#define WC2PD_FILE "$boot/IceFiles/TileArt/swamp/WCtoPD.anim"#define WD2PD_FILE "$boot/IceFiles/TileArt/swamp/WDtoPD.anim"#define WC_FILE "$boot/IceFiles/TileArt/swamp/WC.cel"#define WD_FILE "$boot/IceFiles/TileArt/swamp/WD.cel"#define UA_FILE "$boot/IceFiles/TileArt/underwater/UA.cel"#define UB_FILE "$boot/IceFiles/TileArt/underwater/UB.cel"#define UC_FILE "$boot/IceFiles/TileArt/underwater/UC.cel"#define UD_FILE "$boot/IceFiles/TileArt/underwater/UD.cel"#define UE_FILE "$boot/IceFiles/TileArt/underwater/UE.cel"#define P1_FILE "$boot/IceFiles/TileArt/underwater/P1.anim"#define UD2P1_FILE "$boot/IceFiles/TileArt/underwater/UDtoP1.anim"#define UA2P1_FILE "$boot/IceFiles/TileArt/underwater/UAtoP1.anim"#define UB2P1_FILE "$boot/IceFiles/TileArt/underwater/UBtoP1.anim"#define PM_FILE "$boot/IceFiles/TileArt/underwater/PM.cel"#define UC2PM_FILE "$boot/IceFiles/TileArt/underwater/UCtoPM.anim"#define UE2PM_FILE "$boot/IceFiles/TileArt/underwater/UEtoPM.anim"#define VA_FILE "$boot/IceFiles/TileArt/vortex/VA.cel"#define VA2PK_FILE "$boot/IceFiles/TileArt/vortex/VAtoPK.anim"#define PK_FILE "$boot/IceFiles/TileArt/vortex/PK.cel"#define VB_FILE "$boot/IceFiles/TileArt/vortex/VB.cel"/****************************************************************************************/class landscape { private: /*** variables for storage of master copies of artwork elements ***/ anim_source l1_tile; anim_source s1_tile; anim_source p1_tile; anim_source da2pj_tile; anim_source db2pi_tile; anim_source dd2ph_tile; anim_source ga2pe_tile; anim_source gb2pa_tile; anim_source ha2pf_tile; anim_source hd2pc_tile; anim_source ia2pb_tile; anim_source ib2pg_tile; anim_source va2pk_tile; anim_source wa2pd_tile; anim_source ud2p1_tile; anim_source dc2pj_tile; anim_source ic2pb_tile; anim_source id2pb_tile; anim_source gc2pa_tile; anim_source gd2pa_tile; anim_source ge2pa_tile; anim_source gf2pa_tile; anim_source de2pj_tile; anim_source hb2pc_tile; anim_source hc2pl_tile; anim_source he2pc_tile; anim_source ua2p1_tile; anim_source ub2p1_tile; anim_source ue2pm_tile; anim_source uc2pm_tile; anim_source wb2pd_tile; anim_source wc2pd_tile; anim_source wd2pd_tile; CCB *de_tile; CCB *wc_tile; CCB *wd_tile; CCB *pl_tile; CCB *pm_tile; CCB *id_tile; CCB *da_tile; CCB *db_tile; CCB *dc_tile; CCB *dd_tile; CCB *ga_tile; CCB *gb_tile; CCB *gc_tile; CCB *gd_tile; CCB *ge_tile; CCB *gf_tile; CCB *ha_tile; CCB *hb_tile; CCB *hc_tile; CCB *hd_tile; CCB *he_tile; CCB *ia_tile; CCB *ib_tile; CCB *ic_tile; CCB *la_tile; CCB *lb_tile; CCB *pa_tile; CCB *pb_tile; CCB *pc_tile; CCB *pd_tile; CCB *pe_tile; CCB *pf_tile; CCB *pg_tile; CCB *ph_tile; CCB *pi_tile; CCB *pj_tile; CCB *pk_tile; CCB *sa_tile; CCB *sb_tile; CCB *ua_tile; CCB *ub_tile; CCB *uc_tile; CCB *ud_tile; CCB *ue_tile; CCB *va_tile; CCB *vb_tile; CCB *wa_tile; CCB *wb_tile; /*** variables required for management of normal and animated tiles ***/ CCB *landscape_cels [ROWS_IN_LANDSCAPE] [COLUMNS_IN_LANDSCAPE]; bool rock_lookup_table [ROWS_IN_LANDSCAPE] [COLUMNS_IN_LANDSCAPE]; anitile *anitile_list; hazard *swamp_list; /*** variables required for endless region of wasteland tiles ***/ CCB *wasteland_cels [ROWS_ON_SCREEN] [COLUMNS_ON_SCREEN]; int32 key_row, key_column; int32 left_index, right_index, top_index, bottom_index; void CreateTiles (void); void PlaceTilesInStartingPositions (void); void RepaintAndRegisterTiles(); void RebuildScreenDisplayTable (int32 left, int32 top); void ChangeArt (int32 row, int32 column); bool IsThisDangerous(int32 row, int32 column, bool check_semi_hazards, bool view_rocks_as_hazards); bool TotallyInTheWasteland(int32 center_x, int32 center_y); bool TotallyInThePlayingArea(int32 center_x, int32 center_y, int32 cd_x, int32 cd_y); int32 DetermineWhatTileWeAreOn(int32 center_x, int32 center_y, int32 cd_x, int32 cd_y, int32 &row, int32 &column, CCB* &tile_ccb); public: int32 wasteland_descriptor; CCB *center_tile; void BootLandscape(void); void LoadArtwork (int32 element_to_load); void InitializeLandscape (void); void DisplayLandscape (bool only_maintain_endless_animations); void MoveWorld (int32 x_change, int32 y_change); void MaintainWasteland (int32 x_change, int32 y_change); void RegisterHazard (int32 row, int32 column); void RegisterRockyTile (CCB *rock); void LoadPitFormation (CCB *purple); bool CheckTheWasteland(int32 center_x, int32 center_y, int32 cd_x,int32 cd_y, CCB* &which_tile); CCB* ExamineTile(int32 center_x, int32 center_y, int32 cd_x, int32 cd_y, int32 &tile_type); bool AmIOnThisTile (CCB *tile, int32 center_x, int32 center_y, int32 cd_x, int32 cd_y); bool CheckForSwamp (int32 center_x, int32 center_y, int32 cd_x, int32 cd_y); int32 SelectSwampAtRandom (int32 &row, int32 &column); void CreateAnimatedTile (anim_source *original, int32 frame_rate, int32 row, int32 column, bool endless_value, int32 new_type); void MaintainAnimatedTiles(bool endless_only); CCB* LocateAnimatedTile(int32 row, int32 column); void TransformTile(int32 lookup_row, int32 lookup_column, int32 new_type); void TransformTile(int32 center_x, int32 center_y, int32 cd_x, int32 cd_y, int32 new_type); CCB* FetchTileCCB(int32 lookup_row, int32 lookup_column); void DetermineAdjacentTile (int32 i, int32 j, int32 direction, int32 &adj_i, int32 &adj_j); bool CheckForDanger(int32 center_x, int32 center_y, int32 cd_x, int32 cd_y, int32 &row, int32 &column, int32 &tile_type, CCB* &tile_ccb, bool check_semi_hazards, bool view_rocks_as_hazards); void ShutdownForRestart(void); void ShutdownForExit(void); void ShutdownUnusedArtwork(void);};/*************************************** EOF ********************************************/