00001 00005 /* 00006 All original material Copyright (C) 2002-2010 UFO: Alien Invasion. 00007 00008 Original file from Quake 2 v3.21: quake2-2.31/server/sv_init.c 00009 00010 Copyright (C) 1997-2001 Id Software, Inc. 00011 00012 This program is free software; you can redistribute it and/or 00013 modify it under the terms of the GNU General Public License 00014 as published by the Free Software Foundation; either version 2 00015 of the License, or (at your option) any later version. 00016 00017 This program is distributed in the hope that it will be useful, 00018 but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00020 00021 See the GNU General Public License for more details. 00022 00023 You should have received a copy of the GNU General Public License 00024 along with this program; if not, write to the Free Software 00025 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00026 00027 */ 00028 00029 #ifndef SV_RMA_H_ 00030 #define SV_RMA_H_ 00031 00032 #define MAX_MAPASSEMBLIES 32 00033 #define MAX_TILETYPES 64 00034 #define MAX_TILESETS 16 00035 #define MAX_TILESETTILES 8 00036 #define MAX_TILESIZE 16 00037 #define MAX_FIXEDTILES 64 00038 00039 #define MAX_RANDOM_MAP_WIDTH 32 00040 #define MAX_RANDOM_MAP_HEIGHT 32 00041 00043 typedef struct mTile_s { 00044 char id[MAX_VAR]; 00045 unsigned long spec[MAX_TILESIZE][MAX_TILESIZE]; 00046 int w, h; 00047 int area; 00048 } mTile_t; 00049 00050 typedef struct mTileSet_s { 00051 char id[MAX_VAR]; 00052 char tiles[MAX_TILESETTILES][MAX_VAR]; 00053 int numTiles; 00054 } mTileSet_t; 00055 00060 typedef struct mAssembly_s { 00061 char id[MAX_VAR]; 00062 char title[MAX_VAR]; 00063 byte min[MAX_TILETYPES]; 00064 byte max[MAX_TILETYPES]; 00065 byte fT[MAX_FIXEDTILES]; 00066 byte fX[MAX_FIXEDTILES]; 00067 byte fY[MAX_FIXEDTILES]; 00068 int numFixed; 00069 int width, height; 00073 int size; 00074 int dx, dy; 00078 } mAssembly_t; 00079 00084 typedef struct mToPlace_s { 00085 mTile_t *tile; 00086 int min, max; 00087 int cnt; 00088 } mToPlace_t; 00089 00094 typedef struct mPlaced_s { 00095 const mTile_t *tile; 00096 int x, y; 00097 int idx, pos; 00098 } mPlaced_t; 00099 00100 typedef struct mapInfo_s { 00101 char name[MAX_TOKEN_CHARS * MAX_TILESTRINGS]; 00103 unsigned long curMap[MAX_RANDOM_MAP_HEIGHT][MAX_RANDOM_MAP_WIDTH]; 00104 00106 char curRating[MAX_RANDOM_MAP_HEIGHT][MAX_RANDOM_MAP_WIDTH]; 00107 00109 mToPlace_t mToPlace[MAX_TILETYPES]; 00110 int numToPlace; 00112 mAssembly_t mAssembly[MAX_MAPASSEMBLIES]; 00113 int numAssemblies; 00115 mPlaced_t mPlaced[MAX_MAPTILES]; 00116 int numPlaced; 00118 mTileSet_t mTileSets[MAX_TILESETS]; 00119 int numTileSets; 00121 mTile_t mTile[MAX_TILETYPES]; 00122 int numTiles; 00124 char basePath[MAX_QPATH]; 00125 char inheritBasePath[MAX_QPATH]; 00127 int mAsm; 00128 } mapInfo_t; 00129 00130 mapInfo_t* SV_AssembleMap(const char *name, const char *assembly, char *asmMap, char *asmPos); 00131 00132 #endif /* SV_RMA_H_ */