1 //---------------------------------------------------------------------------- 2 // EDGE Data Definition File Code (Main) 3 //---------------------------------------------------------------------------- 4 // 5 // Copyright (c) 1999-2008 The EDGE Team. 6 // 7 // This program is free software; you can redistribute it and/or 8 // modify it under the terms of the GNU General Public License 9 // as published by the Free Software Foundation; either version 2 10 // of the License, or (at your option) any later version. 11 // 12 // This program is distributed in the hope that it will be useful, 13 // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 // GNU General Public License for more details. 16 // 17 //---------------------------------------------------------------------------- 18 19 #ifndef __DDF_MAIN_H__ 20 #define __DDF_MAIN_H__ 21 22 #include "epi/file.h" 23 #include "epi/utility.h" 24 25 #include "types.h" 26 27 #define DEBUG_DDF 0 28 29 // Forward declarations 30 struct mobj_s; 31 struct sfx_s; 32 33 class atkdef_c; 34 class colourmap_c; 35 class gamedef_c; 36 class mapdef_c; 37 class mobjtype_c; 38 class pl_entry_c; 39 class weapondef_c; 40 41 42 #include "thing.h" 43 #include "attack.h" 44 #include "states.h" 45 #include "weapon.h" 46 47 #include "line.h" 48 #include "level.h" 49 #include "game.h" 50 51 #include "playlist.h" 52 #include "sfx.h" 53 #include "language.h" 54 55 56 // State updates, number of tics / second. 57 #define TICRATE 35 58 59 // Misc playsim constants 60 #define CEILSPEED 1.0f 61 #define FLOORSPEED 1.0f 62 63 #define GRAVITY 8.0f 64 #define FRICTION 0.9063f 65 #define VISCOSITY 0.0f 66 #define DRAG 0.99f 67 #define RIDE_FRICTION 0.7f 68 69 70 // Info for the JUMP action 71 typedef struct act_jump_info_s 72 { 73 // chance value 74 percent_t chance; 75 76 public: 77 act_jump_info_s(); 78 ~act_jump_info_s(); 79 } 80 act_jump_info_t; 81 82 83 // Info for the BECOME action 84 typedef struct act_become_info_s 85 { 86 const mobjtype_c *info; 87 epi::strent_c info_ref; 88 89 label_offset_c start; 90 91 public: 92 act_become_info_s(); 93 ~act_become_info_s(); 94 } 95 act_become_info_t; 96 97 98 // ------------------------------------------------------------------ 99 // -------------------------EXTERNALISATIONS------------------------- 100 // ------------------------------------------------------------------ 101 102 // if true, prefer to crash out on various errors 103 extern bool strict_errors; 104 105 // if true, prefer to ignore or fudge various (serious) errors 106 extern bool lax_errors; 107 108 // if true, disable warning messages 109 extern bool no_warnings; 110 111 void DDF_Init(int _engine_ver); 112 void DDF_CleanUp(void); 113 void DDF_SetWhere(const std::string& dir); 114 115 void DDF_Load(epi::file_c *f); 116 117 bool DDF_MainParseCondition(const char *str, condition_check_t *cond); 118 void DDF_MainGetWhenAppear(const char *info, void *storage); 119 void DDF_MainGetRGB(const char *info, void *storage); 120 bool DDF_MainDecodeBrackets(const char *info, char *outer, char *inner, int buf_len); 121 const char *DDF_MainDecodeList(const char *info, char divider, bool simple); 122 void DDF_GetLumpNameForFile(const char *filename, char *lumpname); 123 124 int DDF_CompareName(const char *A, const char *B); 125 126 bool DDF_WeaponIsUpgrade(weapondef_c *weap, weapondef_c *old); 127 128 bool DDF_IsBoomLineType(int num); 129 bool DDF_IsBoomSectorType(int num); 130 void DDF_BoomClearGenTypes(void); 131 linetype_c *DDF_BoomGetGenLine(int number); 132 sectortype_c *DDF_BoomGetGenSector(int number); 133 134 #endif /* __DDF_MAIN_H__ */ 135 136 //--- editor settings --- 137 // vi:ts=4:sw=4:noexpandtab 138