00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "obj_column_def.h"
00021
00022 #include "lev_data.h"
00023 #include "globals.h"
00024 #include "obj_cube.h"
00025 #include "obj_slabs.h"
00026
00027 const char *cube_fullnames[]={
00028 "empty cube", "standard earth 1", "standard earth 2", "standard earth 3",
00029 "earth bright top L", "earth bright top C", "earth bright top R", "earth n/water L",
00030 "earth n/water R", "earth n/wtr s.top L", "earth n/wtr s.top C", "earth n/wtr s.top R",
00031 "stone w/earth top 1", "stone w/earth top 2", "white stone", "stone w/earth top 3",
00032 "unknown cube 0x0010", "unknown cube 0x0011", "unknown cube 0x0012", "unknown cube 0x0013",
00033 "unknown cube 0x0014", "unknown cube 0x0015", "unknown cube 0x0016", "unknown cube 0x0017",
00034 "unknown cube 0x0018", "unknown cube 0x0019", "unknown cube 0x001a", "unknown cube 0x001b",
00035 "unknown cube 0x001c", "unknown cube 0x001d", "unknown cube 0x001e", "unknown cube 0x001f",
00036 "unknown cube 0x0020", "unknown cube 0x0021", "unknown cube 0x0022", "unknown cube 0x0023",
00037 "unknown cube 0x0024", "unknown cube 0x0025", "unknown cube 0x0026", "static water",
00038 "static dark lava", "static bright lava", "unknown cube 0x002a", "unknown cube 0x002b",
00039 "unknown cube 0x002c", "unknown cube 0x002d", "unknown cube 0x002e", "unknown cube 0x002f",
00040 "unknown cube 0x0030", "unknown cube 0x0031", "unknown cube 0x0032", "unknown cube 0x0033",
00041 "unknown cube 0x0034", "unknown cube 0x0035", "unknown cube 0x0036", "unknown cube 0x0037",
00042 "unknown cube 0x0038", "unknown cube 0x0039", "unknown cube 0x003a", "unknown cube 0x003b",
00043 "unknown cube 0x003c", "unknown cube 0x003d", "unknown cube 0x003e", "unknown cube 0x003f",
00044 "unknown cube 0x0040", "unknown cube 0x0041", "unknown cube 0x0042", "unknown cube 0x0043",
00045 "unknown cube 0x0044", "unknown cube 0x0045", "unknown cube 0x0046", "unknown cube 0x0047",
00046 "unknown cube 0x0048", "unknown cube 0x0049", "unknown cube 0x004a", "unknown cube 0x004b",
00047 "unknown cube 0x004c", "unknown cube 0x004d", "unknown cube 0x004e", "unknown cube 0x004f",
00048 "unknown cube 0x0050", "unknown cube 0x0051", "unknown cube 0x0052", "unknown cube 0x0053",
00049 "woman wall rlf TL", "woman wall rlf TC", "woman wall rlf TR", "woman wall rlf UL",
00050 "woman wall rlf UC", "woman wall rlf UR", "woman wall rlf ML", "woman wall rlf MC",
00051 "woman wall rlf MR", "woman wall rlf BL", "woman wall rlf BC", "woman wall rlf BR",
00052 "twins wall rlf TL", "twins wall rlf TC", "twins wall rlf TR", "twins wall rlf ML",
00053 "twins wall rlf MC", "twins wall rlf MR", "twins wall rlf BL", "twins wall rlf BC",
00054 "twins wall rlf BR", "pair shagn rlf TL", "pair shagn rlf TC", "pair shagn rlf TR",
00055 "pair shagn rlf UL", "pair shagn rlf UC", "pair shagn rlf UR", "pair shagn rlf ML",
00056 "pair shagn rlf MC", "pair shagn rlf MR", "pair shagn rlf BL", "pair shagn rlf BC",
00057 "pair shagn rlf BR", "unknown cube 0x0075", "unknown cube 0x0076", "unknown cube 0x0077",
00058 "unknown cube 0x0078", "unknown cube 0x0079", "unknown cube 0x007a", "unknown cube 0x007b",
00059 "unknown cube 0x007c", "unknown cube 0x007d", "unknown cube 0x007e", "unknown cube 0x007f",
00060 "unknown cube 0x0080", "unknown cube 0x0081", "unknown cube 0x0082", "unknown cube 0x0083",
00061 "unknown cube 0x0084", "unknown cube 0x0085", "unknown cube 0x0086", "unknown cube 0x0087",
00062 "unknown cube 0x0088", "unknown cube 0x0089", "unknown cube 0x008a", "unknown cube 0x008b",
00063 "unknown cube 0x008c", "unknown cube 0x008d", "unknown cube 0x008e", "unknown cube 0x008f",
00064 "unknown cube 0x0090", "unknown cube 0x0091", "unknown cube 0x0092", "unknown cube 0x0093",
00065 "unknown cube 0x0094", "unknown cube 0x0095", "unknown cube 0x0096", "unknown cube 0x0097",
00066 "unknown cube 0x0098", "unknown cube 0x0099", "unknown cube 0x009a", "unknown cube 0x009b",
00067 "unknown cube 0x009c", "unknown cube 0x009d", "unknown cube 0x009e", "unknown cube 0x009f",
00068 "unknown cube 0x00a0", "unknown cube 0x00a1", "unknown cube 0x00a2", "unknown cube 0x00a3",
00069 "unknown cube 0x00a4", "unknown cube 0x00a5", "unknown cube 0x00a6", "unknown cube 0x00a7",
00070 "unknown cube 0x00a8", "unknown cube 0x00a9", "unknown cube 0x00aa", "unknown cube 0x00ab",
00071 "unknown cube 0x00ac", "unknown cube 0x00ad", "unknown cube 0x00ae", "unknown cube 0x00af",
00072 "unknown cube 0x00b0", "unknown cube 0x00b1", "unknown cube 0x00b2", "unknown cube 0x00b3",
00073 "unknown cube 0x00b4", "unknown cube 0x00b5", "unknown cube 0x00b6", "unknown cube 0x00b7",
00074 "unknown cube 0x00b8", "unknown cube 0x00b9", "unknown cube 0x00ba", "unknown cube 0x00bb",
00075 "unknown cube 0x00bc", "unknown cube 0x00bd", "unknown cube 0x00be", "unknown cube 0x00bf",
00076 "unknown cube 0x00c0", "unknown cube 0x00c1", "unknown cube 0x00c2", "unknown cube 0x00c3",
00077 "unknown cube 0x00c4", "unknown cube 0x00c5", "unknown cube 0x00c6", "unknown cube 0x00c7",
00078 "unknown cube 0x00c8", "unknown cube 0x00c9", "unknown cube 0x00ca", "unknown cube 0x00cb",
00079 "unknown cube 0x00cc", "unknown cube 0x00cd", "unknown cube 0x00ce", "unknown cube 0x00cf",
00080 "unknown cube 0x00d0", "unknown cube 0x00d1", "unknown cube 0x00d2", "unknown cube 0x00d3",
00081 "unknown cube 0x00d4", "unknown cube 0x00d5", "unknown cube 0x00d6", "unknown cube 0x00d7",
00082 "unknown cube 0x00d8", "unknown cube 0x00d9", "unknown cube 0x00da", "unknown cube 0x00db",
00083 "unknown cube 0x00dc", "unknown cube 0x00dd", "unknown cube 0x00de", "unknown cube 0x00df",
00084 "unknown cube 0x00e0", "head shape wall TL", "head shape wall TC", "head shape wall TR",
00085 "head shape wall BL", "head shape wall BC", "head shape wall BR", "tortr floor w/circl",
00086 "skel.splat wall TL", "skel.splat wall TC", "skel.splat wall TR", "skel.splat wall ML",
00087 "skel.splat wall MC", "skel.splat wall MR", "skel.splat wall BL", "skel.splat wall BC",
00088 "skel.splat wall BR", "unknown cube 0x00f1", "unknown cube 0x00f2", "unknown cube 0x00f3",
00089 "unknown cube 0x00f4", "unknown cube 0x00f5", "unknown cube 0x00f6", "unknown cube 0x00f7",
00090 "unknown cube 0x00f8", "unknown cube 0x00f9", "unknown cube 0x00fa", "unknown cube 0x00fb",
00091 "unknown cube 0x00fc", "unknown cube 0x00fd", "unknown cube 0x00fe", "unknown cube 0x00ff",
00092 "unknown cube 0x0100", "unknown cube 0x0101", "unknown cube 0x0102", "unknown cube 0x0103",
00093 "unknown cube 0x0104", "unknown cube 0x0105", "unknown cube 0x0106", "unknown cube 0x0107",
00094 "unknown cube 0x0108", "unknown cube 0x0109", "unknown cube 0x010a", "unknown cube 0x010b",
00095 "unknown cube 0x010c", "unknown cube 0x010d", "unknown cube 0x010e", "unknown cube 0x010f",
00096 "unknown cube 0x0110", "unknown cube 0x0111", "unknown cube 0x0112", "unknown cube 0x0113",
00097 "unknown cube 0x0114", "unknown cube 0x0115", "unknown cube 0x0116", "unknown cube 0x0117",
00098 "unknown cube 0x0118", "unknown cube 0x0119", "unknown cube 0x011a", "unknown cube 0x011b",
00099 "unknown cube 0x011c", "unknown cube 0x011d", "unknown cube 0x011e", "unknown cube 0x011f",
00100 "unknown cube 0x0120", "unknown cube 0x0121", "unknown cube 0x0122", "unknown cube 0x0123",
00101 "unknown cube 0x0124", "unknown cube 0x0125", "unknown cube 0x0126", "unknown cube 0x0127",
00102 "unknown cube 0x0128", "unknown cube 0x0129", "unknown cube 0x012a", "unknown cube 0x012b",
00103 "unknown cube 0x012c", "unknown cube 0x012d", "unknown cube 0x012e", "unknown cube 0x012f",
00104 "unknown cube 0x0130", "unknown cube 0x0131", "unknown cube 0x0132", "unknown cube 0x0133",
00105 "unknown cube 0x0134", "unknown cube 0x0135", "unknown cube 0x0136", "unknown cube 0x0137",
00106 "unknown cube 0x0138", "unknown cube 0x0139", "unknown cube 0x013a", "unknown cube 0x013b",
00107 "unknown cube 0x013c", "unknown cube 0x013d", "unknown cube 0x013e", "unknown cube 0x013f",
00108 "unknown cube 0x0140", "unknown cube 0x0141", "unknown cube 0x0142", "unknown cube 0x0143",
00109 "unknown cube 0x0144", "unknown cube 0x0145", "unknown cube 0x0146", "unknown cube 0x0147",
00110 "unknown cube 0x0148", "unknown cube 0x0149", "unknown cube 0x014a", "unknown cube 0x014b",
00111 "unknown cube 0x014c", "unknown cube 0x014d", "unknown cube 0x014e", "unknown cube 0x014f",
00112 "unknown cube 0x0150", "unknown cube 0x0151", "unknown cube 0x0152", "unknown cube 0x0153",
00113 "unknown cube 0x0154", "unknown cube 0x0155", "unknown cube 0x0156", "unknown cube 0x0157",
00114 "unknown cube 0x0158", "unknown cube 0x0159", "unknown cube 0x015a", "unknown cube 0x015b",
00115 "unknown cube 0x015c", "unknown cube 0x015d", "unknown cube 0x015e", "unknown cube 0x015f",
00116 "unknown cube 0x0160", "unknown cube 0x0161", "unknown cube 0x0162", "wooden door 0x0163",
00117 "wooden door 0x0164", "wooden door 0x0165", "wooden door 0x0166", "wooden door 0x0167",
00118 "wooden door 0x0168", "wooden door 0x0169", "wooden door 0x016a", "wooden door 0x016b",
00119 "braced door 0x016c", "braced door 0x016d", "braced door 0x016e", "braced door 0x016f",
00120 "braced door 0x0170", "braced door 0x0171", "braced door 0x0172", "braced door 0x0173",
00121 "braced door 0x0174", "steel door 0x0175", "steel door 0x0176", "steel door 0x0177",
00122 "steel door 0x0178", "steel door 0x0179", "steel door 0x017a", "steel door 0x017b",
00123 "steel door 0x017c", "steel door 0x017d", "unknown cube 0x017e", "unknown cube 0x017f",
00124 "unknown cube 0x0180", "unknown cube 0x0181", "unknown cube 0x0182", "unknown cube 0x0183",
00125 "unknown cube 0x0184", "unknown cube 0x0185", "unknown cube 0x0186", "unknown cube 0x0187",
00126 "unknown cube 0x0188", "unknown cube 0x0189", "unknown cube 0x018a", "unknown cube 0x018b",
00127 "unknown cube 0x018c", "unknown cube 0x018d", "unknown cube 0x018e", "unknown cube 0x018f",
00128 "unknown cube 0x0190", "unknown cube 0x0191", "unknown cube 0x0192", "unknown cube 0x0193",
00129 "unknown cube 0x0194", "unknown cube 0x0195", "unknown cube 0x0196", "unknown cube 0x0197",
00130 "unknown cube 0x0198", "unknown cube 0x0199", "unknown cube 0x019a", "unknown cube 0x019b",
00131 "unknown cube 0x019c", "unknown cube 0x019d", "unknown cube 0x019e", "unknown cube 0x019f",
00132 "unknown cube 0x01a0", "unknown cube 0x01a1", "unknown cube 0x01a2", "unknown cube 0x01a3",
00133 "unknown cube 0x01a4", "unknown cube 0x01a5", "unknown cube 0x01a6", "unknown cube 0x01a7",
00134 "unknown cube 0x01a8", "unknown cube 0x01a9", "unknown cube 0x01aa", "blue face flag",
00135 "green face flag", "yellow face flag", "unowned flag place", "white face flag",
00136 "red face flag stone", "lair floor Cntr", "fence brick wall T", "fence brick wall B",
00137 "wood floor hole R", "wood floor hole L", "wood floor hole C", "wood floor n/lava",
00138 "wood floor n/water", "valuable gems 1", "valuable gems 2", "valuable gems 3",
00139 "valuable gems 4", "empty cube 0x01bd", "empty cube 0x01be", "empty cube 0x01bf",
00140 "empty cube 0x01c0", "empty cube 0x01c1", "empty cube 0x01c2", "empty cube 0x01c3",
00141 "empty cube 0x01c4", "empty cube 0x01c5", "empty cube 0x01c6", "empty cube 0x01c7",
00142 "empty cube 0x01c8", "empty cube 0x01c9", "empty cube 0x01ca", "empty cube 0x01cb",
00143 "empty cube 0x01cc", "empty cube 0x01cd", "empty cube 0x01ce", "empty cube 0x01cf",
00144 "empty cube 0x01d0", "empty cube 0x01d1", "empty cube 0x01d2", "empty cube 0x01d3",
00145 "empty cube 0x01d4", "empty cube 0x01d5", "empty cube 0x01d6", "empty cube 0x01d7",
00146 "empty cube 0x01d8", "empty cube 0x01d9", "empty cube 0x01da", "empty cube 0x01db",
00147 "empty cube 0x01dc", "empty cube 0x01dd", "empty cube 0x01de", "empty cube 0x01df",
00148 "empty cube 0x01e0", "empty cube 0x01e1", "empty cube 0x01e2", "empty cube 0x01e3",
00149 "empty cube 0x01e4", "empty cube 0x01e5", "empty cube 0x01e6", "empty cube 0x01e7",
00150 "empty cube 0x01e8", "empty cube 0x01e9", "empty cube 0x01ea", "empty cube 0x01eb",
00151 "empty cube 0x01ec", "empty cube 0x01ed", "empty cube 0x01ee", "empty cube 0x01ef",
00152 "empty cube 0x01f0", "empty cube 0x01f1", "empty cube 0x01f2", "empty cube 0x01f3",
00153 "empty cube 0x01f4", "empty cube 0x01f5", "empty cube 0x01f6", "empty cube 0x01f7",
00154 "empty cube 0x01f8", "empty cube 0x01f9", "empty cube 0x01fa", "empty cube 0x01fb",
00155 "empty cube 0x01fc", "empty cube 0x01fd", "empty cube 0x01fe", "empty cube 0x01ff",
00156 };
00157
00158 const unsigned short wib_columns_animate[]={
00159 CUBE_ANI_WATER,
00160 CUBE_ANI_LAVADK, CUBE_ANI_LAVABR,
00161 };
00162
00163 const unsigned short animated_cubes[]={
00164 CUBE_ANI_WATER,
00165 CUBE_ANI_LAVADK, CUBE_ANI_LAVABR,
00166 0x0201, 0x0202, 0x0203,
00167 };
00168
00169
00170
00171
00172 struct COLUMN_REC *create_column_rec(void)
00173 {
00174 struct COLUMN_REC *clm_rec=(struct COLUMN_REC *)malloc(sizeof(struct COLUMN_REC));
00175 if (clm_rec==NULL)
00176 {
00177 message_error("Cannot allocate memory for clm_rec");
00178 return NULL;
00179 }
00180 fill_column_rec(clm_rec, 0, 0, 0, 0, 0, 0, 0,
00181 0, 0, 0, 0, 0, 0, 0, 0);
00182 return clm_rec;
00183 }
00184
00185
00186
00187
00188 struct COLUMN_REC *create_column_recp(void)
00189 {
00190 struct COLUMN_REC *clm_rec=(struct COLUMN_REC *)malloc(sizeof(struct COLUMN_REC));
00191 if (clm_rec==NULL)
00192 {
00193 message_error("create_column_recp: Cannot allocate memory for clm_rec");
00194 return NULL;
00195 }
00196 fill_column_rec(clm_rec, 0, 1, 0, 0, 0, 0, 0,
00197 0, 0, 0, 0, 0, 0, 0, 0);
00198 return clm_rec;
00199 }
00200
00201
00202
00203
00204 void free_column_rec(struct COLUMN_REC *clm_rec)
00205 {
00206 free(clm_rec);
00207 }
00208
00209 void clear_clm_entry(unsigned char *clmentry)
00210 {
00211 if (clmentry==NULL) return;
00212 memset(clmentry,'\0',SIZEOF_DK_CLM_REC);
00213 }
00214
00215
00216
00217
00218
00219 void fill_column_rec_simp(struct COLUMN_REC *clm_rec, unsigned int use, int base,
00220 int c0, int c1, int c2, int c3, int c4, int c5, int c6, int c7)
00221 {
00222 fill_column_rec_autosh(clm_rec, use,1, 0, base,
00223 c0, c1, c2, c3, c4, c5, c6, c7);
00224 }
00225
00226
00227
00228
00229
00230 void fill_column_rec_sim(struct COLUMN_REC *clm_rec, unsigned int use, int base,
00231 int c0, int c1, int c2, int c3, int c4, int c5, int c6, int c7)
00232 {
00233 fill_column_rec_autosh(clm_rec, use, 0, 0, base,
00234 c0, c1, c2, c3, c4, c5, c6, c7);
00235 }
00236
00237
00238
00239
00240
00241 void fill_column_rec_autosh(struct COLUMN_REC *clm_rec, const unsigned int use,
00242 const int permanent, const int lintel, const int base,
00243 const int c0, const int c1, const int c2, const int c3,
00244 const int c4, const int c5, const int c6, const int c7)
00245 {
00246 fill_column_rec(clm_rec, use, permanent, lintel, 0, 0, base, 0,
00247 c0, c1, c2, c3, c4, c5, c6, c7);
00248 clm_rec->solid=compute_clm_rec_solid(clm_rec);
00249 clm_rec->height=compute_clm_rec_height(clm_rec);
00250 }
00251
00252
00253
00254
00255 void fill_column_rec(struct COLUMN_REC *clm_rec, const unsigned int use,
00256 const int permanent, const int lintel, const int height,
00257 const unsigned int solid, const int base, const int orientation,
00258 const int c0, const int c1, const int c2, const int c3,
00259 const int c4, const int c5, const int c6, const int c7)
00260 {
00261 clm_rec->use=use;
00262 clm_rec->permanent=permanent;
00263 clm_rec->lintel=lintel;
00264 clm_rec->height=height;
00265 clm_rec->solid=solid;
00266 clm_rec->base=base;
00267 clm_rec->orientation=orientation;
00268 clm_rec->c[0]=c0;
00269 clm_rec->c[1]=c1;
00270 clm_rec->c[2]=c2;
00271 clm_rec->c[3]=c3;
00272 clm_rec->c[4]=c4;
00273 clm_rec->c[5]=c5;
00274 clm_rec->c[6]=c6;
00275 clm_rec->c[7]=c7;
00276 }
00277
00278
00279
00280
00281 void set_clm_entry(unsigned char *clmentry, struct COLUMN_REC *clm_rec)
00282 {
00283 if ((clmentry==NULL)||(clm_rec==NULL)) return;
00284 unsigned char *x=clmentry;
00285 x[0]=clm_rec->use&255;
00286 x[1]=(clm_rec->use>>8)&255;
00287 x[2]=(clm_rec->permanent&1)+((clm_rec->lintel&7)<<1)+((clm_rec->height&15)<<4);
00288 x[3]=clm_rec->solid&255;
00289 x[4]=(clm_rec->solid>>8)&255;
00290 x[5]=clm_rec->base&255;
00291 x[6]=(clm_rec->base>>8)&255;
00292 x[7]=clm_rec->orientation&255;
00293 x[8]=clm_rec->c[0]&255;
00294 x[9]=(clm_rec->c[0]>>8)&255;
00295 x[10]=clm_rec->c[1]&255;
00296 x[11]=(clm_rec->c[1]>>8)&255;
00297 x[12]=clm_rec->c[2]&255;
00298 x[13]=(clm_rec->c[2]>>8)&255;
00299 x[14]=clm_rec->c[3]&255;
00300 x[15]=(clm_rec->c[3]>>8)&255;
00301 x[16]=clm_rec->c[4]&255;
00302 x[17]=(clm_rec->c[4]>>8)&255;
00303 x[18]=clm_rec->c[5]&255;
00304 x[19]=(clm_rec->c[5]>>8)&255;
00305 x[20]=clm_rec->c[6]&255;
00306 x[21]=(clm_rec->c[6]>>8)&255;
00307 x[22]=clm_rec->c[7]&255;
00308 x[23]=(clm_rec->c[7]>>8)&255;
00309 }
00310
00311 void get_clm_entry(struct COLUMN_REC *clm_rec, const unsigned char *clmentry)
00312 {
00313 if ((clmentry==NULL)||(clm_rec==NULL)) return;
00314 clm_rec->use=clmentry[0]+(clmentry[1]<<8);
00315 clm_rec->permanent=clmentry[2]&1;
00316 clm_rec->lintel=(clmentry[2]>>1)&7;
00317 clm_rec->height=(clmentry[2]>>4)&15;
00318 clm_rec->solid=clmentry[3]+(clmentry[4]<<8);
00319 clm_rec->base=clmentry[5]+(clmentry[6]<<8);
00320 clm_rec->orientation=clmentry[7];
00321 clm_rec->c[0]=clmentry[8]+(clmentry[9]<<8);
00322 clm_rec->c[1]=clmentry[10]+(clmentry[11]<<8);
00323 clm_rec->c[2]=clmentry[12]+(clmentry[13]<<8);
00324 clm_rec->c[3]=clmentry[14]+(clmentry[15]<<8);
00325 clm_rec->c[4]=clmentry[16]+(clmentry[17]<<8);
00326 clm_rec->c[5]=clmentry[18]+(clmentry[19]<<8);
00327 clm_rec->c[6]=clmentry[20]+(clmentry[21]<<8);
00328 clm_rec->c[7]=clmentry[22]+(clmentry[23]<<8);
00329 }
00330
00331
00332
00333
00334 short compare_column_recs(struct COLUMN_REC *clm_rec1, struct COLUMN_REC *clm_rec2)
00335 {
00336 if (clm_rec1->height != clm_rec2->height)
00337 return false;
00338 if (clm_rec1->solid != clm_rec2->solid)
00339 return false;
00340 if (clm_rec1->lintel != clm_rec2->lintel)
00341 return false;
00342 unsigned short height=clm_rec1->height;
00343 unsigned int solid=clm_rec1->solid;
00344 if (clm_rec1->base!=clm_rec2->base)
00345 return false;
00346 if ((solid&1))
00347 if (clm_rec1->c[0]!=clm_rec2->c[0])
00348 return false;
00349 if ((solid&2))
00350 if (clm_rec1->c[1]!=clm_rec2->c[1])
00351 return false;
00352 if ((solid&4))
00353 if (clm_rec1->c[2]!=clm_rec2->c[2])
00354 return false;
00355 if ((solid&8))
00356 if (clm_rec1->c[3]!=clm_rec2->c[3])
00357 return false;
00358 if ((solid&16))
00359 if (clm_rec1->c[4]!=clm_rec2->c[4])
00360 return false;
00361 if ((solid&32))
00362 if (clm_rec1->c[5]!=clm_rec2->c[5])
00363 return false;
00364 if ((solid&64))
00365 if (clm_rec1->c[6]!=clm_rec2->c[6])
00366 return false;
00367 if ((solid&128))
00368 if (clm_rec1->c[7]!=clm_rec2->c[7])
00369 return false;
00370 return true;
00371 }
00372
00373
00374
00375
00376 short compare_column_entries(const unsigned char *clmentry1, const unsigned char *clmentry2)
00377 {
00378
00379 if ((clmentry1[2]&0x0fe)!=(clmentry2[2]&0x0fe))
00380 return false;
00381
00382 if (memcmp(clmentry1+3,clmentry2+3,4)!=0)
00383 return false;
00384
00385 if (memcmp(clmentry1+8,clmentry2+8,15)!=0)
00386 return false;
00387 return true;
00388 }
00389
00390 unsigned short compute_clm_rec_height(const struct COLUMN_REC *clm_rec)
00391 {
00392 if (clm_rec==NULL) return 0;
00393
00394 if ((clm_rec->c[0]==0) && (clm_rec->c[1]==0) && (clm_rec->c[2]==0))
00395 return 0;
00396 if ((clm_rec->c[1]==0) && (clm_rec->c[2]==0) && (clm_rec->c[3]==0))
00397 return 1;
00398 if ((clm_rec->c[2]==0) && (clm_rec->c[3]==0) && (clm_rec->c[4]==0))
00399 return 2;
00400 if ((clm_rec->c[3]==0) && (clm_rec->c[4]==0) && (clm_rec->c[5]==0))
00401 return 3;
00402
00403 if ((clm_rec->c[0]==0x094) && (clm_rec->c[1]==0x0))
00404 return 1;
00405
00406 if ((clm_rec->base==0x0b1) && (clm_rec->c[0]==0x0) && (clm_rec->c[1]==0x17c))
00407 return 0;
00408 if ((clm_rec->c[7]!=0))
00409 return 8;
00410 if ((clm_rec->c[6]!=0))
00411 return 7;
00412 if ((clm_rec->c[5]!=0))
00413 return 6;
00414 if ((clm_rec->c[4]!=0))
00415 return 5;
00416 if ((clm_rec->c[3]!=0))
00417 return 4;
00418 if ((clm_rec->c[2]!=0))
00419 return 3;
00420 if ((clm_rec->c[1]!=0))
00421 return 2;
00422 if ((clm_rec->c[0]!=0))
00423 return 1;
00424 return 0;
00425 }
00426
00427 unsigned short compute_clm_rec_solid(const struct COLUMN_REC *clm_rec)
00428 {
00429 if (clm_rec==NULL) return 0;
00430 unsigned short solid=0;
00431 if ((clm_rec->c[7]!=0))
00432 solid|=128;
00433 if ((clm_rec->c[6]!=0))
00434 solid|=64;
00435 if ((clm_rec->c[5]!=0))
00436 solid|=32;
00437 if ((clm_rec->c[4]!=0))
00438 solid|=16;
00439 if ((clm_rec->c[3]!=0))
00440 solid|=8;
00441 if ((clm_rec->c[2]!=0))
00442 solid|=4;
00443 if ((clm_rec->c[1]!=0))
00444 solid|=2;
00445 if ((clm_rec->c[0]!=0))
00446 solid|=1;
00447 return solid;
00448 }
00449
00450 unsigned int get_clm_entry_use(const unsigned char *clmentry)
00451 {
00452 return (unsigned int)clmentry[0]+(clmentry[1]<<8);
00453 }
00454
00455
00456
00457
00458
00459 unsigned int clm_entry_use_inc(unsigned char *clmentry)
00460 {
00461 unsigned int use=clmentry[0]+(clmentry[1]<<8);
00462 if (use<65535) use++;
00463 clmentry[0]=use&255;
00464 clmentry[1]=(use>>8)&255;
00465 return use;
00466 }
00467
00468
00469
00470
00471
00472 unsigned int clm_entry_use_dec(unsigned char *clmentry)
00473 {
00474 unsigned int use=clmentry[0]+(clmentry[1]<<8);
00475 if (use>0) use--;
00476 clmentry[0]=use&255;
00477 clmentry[1]=(use>>8)&255;
00478 return use;
00479 }
00480
00481
00482
00483
00484 short get_clm_entry_permanent(const unsigned char *clmentry)
00485 {
00486 if (clmentry==NULL) return 0;
00487 short permanent=clmentry[2]&1;
00488 return permanent;
00489 }
00490
00491 void set_clm_entry_permanent(unsigned char *clmentry,short nperm)
00492 {
00493 if (clmentry==NULL) return;
00494 unsigned char val;
00495 val=clmentry[2] & 0xfe;
00496 clmentry[2]=(val)|(nperm!=0);
00497 }
00498
00499 unsigned short get_clm_entry_height(const unsigned char *clmentry)
00500 {
00501 return (unsigned short)(clmentry[2]>>4)&15;
00502 }
00503
00504 unsigned short get_clm_entry_solid(const unsigned char *clmentry)
00505 {
00506 return read_int16_le_buf(clmentry+3);
00507 }
00508
00509 unsigned short get_clm_entry_base(const unsigned char *clmentry)
00510 {
00511 return read_int16_le_buf(clmentry+5);
00512 }
00513
00514
00515
00516
00517
00518 unsigned short get_clm_entry_topcube(const unsigned char *clmentry)
00519 {
00520 unsigned short cube=0;
00521 int i=7;
00522 while ((cube==0)&&(i>=0))
00523 {
00524 cube = read_int16_le_buf(clmentry+(i<<1)+8);
00525 i--;
00526 }
00527 return cube;
00528 }
00529
00530 short clm_rec_copy(struct COLUMN_REC *dest_rec,const struct COLUMN_REC *src_rec)
00531 {
00532 memcpy(dest_rec,src_rec,sizeof(struct COLUMN_REC));
00533 return true;
00534 }
00535
00536
00537
00538
00539 short clm_verify_entry(const unsigned char *clmentry, char *err_msg)
00540 {
00541 struct COLUMN_REC *clm_rec;
00542 clm_rec=create_column_rec();
00543 get_clm_entry(clm_rec, clmentry);
00544 int i;
00545 for (i=0;i<9;i++)
00546 {
00547 unsigned int cube;
00548 if (i==0)
00549 cube=clm_rec->base;
00550 else
00551 cube=clm_rec->c[i-1];
00552 if ((cube>CUBE_MAX_INDEX)&&(!is_animated_cube(cube)))
00553 {
00554 sprintf(err_msg,"Cube entry %d too large (%u>%d)",i,cube,CUBE_MAX_INDEX);
00555 return VERIF_WARN;
00556 }
00557 }
00558 unsigned int prop_solid=compute_clm_rec_solid(clm_rec);
00559 if (clm_rec->solid != prop_solid)
00560 {
00561 sprintf(err_msg,"Solid property should be %u",prop_solid);
00562 return VERIF_WARN;
00563 }
00564 unsigned int prop_height=compute_clm_rec_height(clm_rec);
00565 if (clm_rec->height != prop_height)
00566 {
00567 sprintf(err_msg,"Height property should be %u",prop_height);
00568 return VERIF_WARN;
00569 }
00570 free_column_rec(clm_rec);
00571 return VERIF_OK;
00572 }
00573
00574
00575
00576
00577 short cube_wib_animate(unsigned int cube)
00578 {
00579 int array_count=sizeof(wib_columns_animate)/sizeof(unsigned short);
00580 int idx=arr_ushort_pos(wib_columns_animate,cube,array_count);
00581 if (idx>=0) return true;
00582 return false;
00583 }
00584
00585
00586
00587
00588 short is_animated_cube(unsigned int cube)
00589 {
00590 int array_count=sizeof(animated_cubes)/sizeof(unsigned short);
00591 int idx=arr_ushort_pos(animated_cubes,cube,array_count);
00592 if (idx>=0) return true;
00593 return false;
00594 }
00595
00596
00597
00598
00599
00600 unsigned short column_wib_entry(struct COLUMN_REC *clm_rec,
00601 struct COLUMN_REC *clm_rec_n,struct COLUMN_REC *clm_rec_w,struct COLUMN_REC *clm_rec_nw)
00602 {
00603 int i;
00604
00605 short anim_north=false;
00606 if (cube_wib_animate(clm_rec_n->base))
00607 anim_north=true;
00608 for (i=0;i<8;i++)
00609 {
00610 if ((clm_rec_n->solid&(1<<i))&&(cube_wib_animate(clm_rec_n->c[i])))
00611 anim_north=true;
00612 }
00613 short anim_west=false;
00614 if (cube_wib_animate(clm_rec_w->base))
00615 anim_west=true;
00616 for (i=0;i<8;i++)
00617 {
00618 if ((clm_rec_w->solid&(1<<i))&&(cube_wib_animate(clm_rec_w->c[i])))
00619 anim_west=true;
00620 }
00621 short anim_nw=false;
00622 if (cube_wib_animate(clm_rec_nw->base))
00623 anim_nw=true;
00624 for (i=0;i<8;i++)
00625 {
00626 if ((clm_rec_nw->solid&(1<<i))&&(cube_wib_animate(clm_rec_nw->c[i])))
00627 anim_nw=true;
00628 }
00629
00630 short anim_this=false;
00631 if (cube_wib_animate(clm_rec->base))
00632 anim_this=true;
00633 for (i=0;i<8;i++)
00634 {
00635 if ((clm_rec->solid&(1<<i))&&(cube_wib_animate(clm_rec->c[i])))
00636 anim_this=true;
00637 }
00638
00639 if (anim_this&&anim_west&&anim_north&&anim_nw)
00640 return COLUMN_WIB_ANIMATE;
00641 return COLUMN_WIB_SKEW;
00642 }
00643
00644
00645
00646
00647 char *get_cube_fullname(unsigned short idx)
00648 {
00649 int types_count=sizeof(cube_fullnames)/sizeof(char *);
00650 if (idx<types_count)
00651 return (char *)cube_fullnames[idx];
00652 else
00653 return "unknown(?!)";
00654 }
00655
00656 void place_column_doorwood_a(struct COLUMN_REC *clm_rec, unsigned char owner)
00657 {
00658 int pos=1;
00659 if (pos<0) pos=0;
00660 if (pos>4) pos=4;
00661 clm_rec->c[pos+0]=0x169;
00662 clm_rec->c[pos+1]=0x166;
00663 clm_rec->c[pos+2]=0x163;
00664 switch (owner)
00665 {
00666 case PLAYER0: clm_rec->c[pos+3]=0x0a0; break;
00667 case PLAYER1: clm_rec->c[pos+3]=0x19a; break;
00668 case PLAYER2: clm_rec->c[pos+3]=0x19d; break;
00669 case PLAYER3: clm_rec->c[pos+3]=0x1a0; break;
00670 case PLAYER_GOOD:clm_rec->c[pos+3]=0x1a3; break;
00671 default: clm_rec->c[pos+3]=0x04d; break;
00672 }
00673 clm_rec->solid=compute_clm_rec_solid(clm_rec);
00674 clm_rec->height=compute_clm_rec_height(clm_rec);
00675 }
00676
00677 void place_column_doorwood_b(struct COLUMN_REC *clm_rec, unsigned char owner)
00678 {
00679 int pos=1;
00680 if (pos<0) pos=0;
00681 if (pos>4) pos=4;
00682 clm_rec->c[pos+0]=0x169;
00683 clm_rec->c[pos+1]=0x166;
00684 clm_rec->c[pos+2]=0x163;
00685 switch (owner)
00686 {
00687 case PLAYER0: clm_rec->c[0]=0x0c0; clm_rec->c[pos+3]=0x0a1; break;
00688 case PLAYER1: clm_rec->c[0]=0x0c1; clm_rec->c[pos+3]=0x19b; break;
00689 case PLAYER2: clm_rec->c[0]=0x0c2; clm_rec->c[pos+3]=0x19e; break;
00690 case PLAYER3: clm_rec->c[0]=0x0c3; clm_rec->c[pos+3]=0x1a1; break;
00691 case PLAYER_GOOD:clm_rec->c[0]=0x0c7; clm_rec->c[pos+3]=0x1a4; break;
00692 default: clm_rec->c[0]=0x0c6; clm_rec->c[pos+3]=0x04d; break;
00693 }
00694 clm_rec->solid=compute_clm_rec_solid(clm_rec);
00695 clm_rec->height=compute_clm_rec_height(clm_rec);
00696 }
00697
00698 void place_column_doorwood_c(struct COLUMN_REC *clm_rec, unsigned char owner)
00699 {
00700 int pos=1;
00701 if (pos<0) pos=0;
00702 if (pos>4) pos=4;
00703 clm_rec->c[pos+0]=0x16b;
00704 clm_rec->c[pos+1]=0x168;
00705 clm_rec->c[pos+2]=0x165;
00706 switch (owner)
00707 {
00708 case PLAYER0: clm_rec->c[pos+3]=0x0a2; break;
00709 case PLAYER1: clm_rec->c[pos+3]=0x19c; break;
00710 case PLAYER2: clm_rec->c[pos+3]=0x19f; break;
00711 case PLAYER3: clm_rec->c[pos+3]=0x1a2; break;
00712 case PLAYER_GOOD:clm_rec->c[pos+3]=0x1a5; break;
00713 default: clm_rec->c[pos+3]=0x04d; break;
00714 }
00715 clm_rec->solid=compute_clm_rec_solid(clm_rec);
00716 clm_rec->height=compute_clm_rec_height(clm_rec);
00717 }
00718
00719 void place_column_doorbrace_a(struct COLUMN_REC *clm_rec, unsigned char owner)
00720 {
00721 int pos=1;
00722 if (pos<0) pos=0;
00723 if (pos>4) pos=4;
00724 clm_rec->c[pos+0]=0x172;
00725 clm_rec->c[pos+1]=0x16f;
00726 clm_rec->c[pos+2]=0x16c;
00727 switch (owner)
00728 {
00729 case PLAYER0: clm_rec->c[pos+3]=0x0a0; break;
00730 case PLAYER1: clm_rec->c[pos+3]=0x19a; break;
00731 case PLAYER2: clm_rec->c[pos+3]=0x19d; break;
00732 case PLAYER3: clm_rec->c[pos+3]=0x1a0; break;
00733 case PLAYER_GOOD:clm_rec->c[pos+3]=0x1a3; break;
00734 default: clm_rec->c[pos+3]=0x04d; break;
00735 }
00736 clm_rec->solid=compute_clm_rec_solid(clm_rec);
00737 clm_rec->height=compute_clm_rec_height(clm_rec);
00738 }
00739
00740 void place_column_doorbrace_b(struct COLUMN_REC *clm_rec, unsigned char owner)
00741 {
00742 int pos=1;
00743 if (pos<0) pos=0;
00744 if (pos>4) pos=4;
00745 clm_rec->c[pos+0]=0x173;
00746 clm_rec->c[pos+1]=0x170;
00747 clm_rec->c[pos+2]=0x16d;
00748 switch (owner)
00749 {
00750 case PLAYER0: clm_rec->c[0]=0x0c0; clm_rec->c[pos+3]=0x0a1; break;
00751 case PLAYER1: clm_rec->c[0]=0x0c1; clm_rec->c[pos+3]=0x19b; break;
00752 case PLAYER2: clm_rec->c[0]=0x0c2; clm_rec->c[pos+3]=0x19e; break;
00753 case PLAYER3: clm_rec->c[0]=0x0c3; clm_rec->c[pos+3]=0x1a1; break;
00754 case PLAYER_GOOD:clm_rec->c[0]=0x0c7; clm_rec->c[pos+3]=0x1a4; break;
00755 default: clm_rec->c[0]=0x0c6; clm_rec->c[pos+3]=0x04d; break;
00756 }
00757 clm_rec->solid=compute_clm_rec_solid(clm_rec);
00758 clm_rec->height=compute_clm_rec_height(clm_rec);
00759 }
00760
00761 void place_column_doorbrace_c(struct COLUMN_REC *clm_rec, unsigned char owner)
00762 {
00763 int pos=1;
00764 if (pos<0) pos=0;
00765 if (pos>4) pos=4;
00766 clm_rec->c[pos+0]=0x174;
00767 clm_rec->c[pos+1]=0x171;
00768 clm_rec->c[pos+2]=0x16e;
00769 switch (owner)
00770 {
00771 case PLAYER0: clm_rec->c[pos+3]=0x0a2; break;
00772 case PLAYER1: clm_rec->c[pos+3]=0x19c; break;
00773 case PLAYER2: clm_rec->c[pos+3]=0x19f; break;
00774 case PLAYER3: clm_rec->c[pos+3]=0x1a2; break;
00775 case PLAYER_GOOD:clm_rec->c[pos+3]=0x1a5; break;
00776 default: clm_rec->c[pos+3]=0x04d; break;
00777 }
00778 clm_rec->solid=compute_clm_rec_solid(clm_rec);
00779 clm_rec->height=compute_clm_rec_height(clm_rec);
00780 }
00781
00782 void place_column_dooriron_a(struct COLUMN_REC *clm_rec, unsigned char owner)
00783 {
00784 int pos=1;
00785 if (pos<0) pos=0;
00786 if (pos>4) pos=4;
00787 clm_rec->c[pos+0]=0x17b;
00788 clm_rec->c[pos+1]=0x178;
00789 clm_rec->c[pos+2]=0x175;
00790 switch (owner)
00791 {
00792 case PLAYER0: clm_rec->c[pos+3]=0x0a0; break;
00793 case PLAYER1: clm_rec->c[pos+3]=0x19a; break;
00794 case PLAYER2: clm_rec->c[pos+3]=0x19d; break;
00795 case PLAYER3: clm_rec->c[pos+3]=0x1a0; break;
00796 case PLAYER_GOOD:clm_rec->c[pos+3]=0x1a3; break;
00797 default: clm_rec->c[pos+3]=0x04d; break;
00798 }
00799 clm_rec->solid=compute_clm_rec_solid(clm_rec);
00800 clm_rec->height=compute_clm_rec_height(clm_rec);
00801 }
00802
00803 void place_column_dooriron_b(struct COLUMN_REC *clm_rec, unsigned char owner)
00804 {
00805 int pos=1;
00806 if (pos<0) pos=0;
00807 if (pos>4) pos=4;
00808 clm_rec->c[pos+0]=0x17c;
00809 clm_rec->c[pos+1]=0x179;
00810 clm_rec->c[pos+2]=0x176;
00811 switch (owner)
00812 {
00813 case PLAYER0: clm_rec->c[0]=0x0c0; clm_rec->c[pos+3]=0x0a1; break;
00814 case PLAYER1: clm_rec->c[0]=0x0c1; clm_rec->c[pos+3]=0x19b; break;
00815 case PLAYER2: clm_rec->c[0]=0x0c2; clm_rec->c[pos+3]=0x19e; break;
00816 case PLAYER3: clm_rec->c[0]=0x0c3; clm_rec->c[pos+3]=0x1a1; break;
00817 case PLAYER_GOOD:clm_rec->c[0]=0x0c7; clm_rec->c[pos+3]=0x1a4; break;
00818 default: clm_rec->c[0]=0x0c6; clm_rec->c[pos+3]=0x04d; break;
00819 }
00820 clm_rec->solid=compute_clm_rec_solid(clm_rec);
00821 clm_rec->height=compute_clm_rec_height(clm_rec);
00822 }
00823
00824 void place_column_dooriron_c(struct COLUMN_REC *clm_rec, unsigned char owner)
00825 {
00826 int pos=1;
00827 if (pos<0) pos=0;
00828 if (pos>4) pos=4;
00829 clm_rec->c[pos+0]=0x17d;
00830 clm_rec->c[pos+1]=0x17a;
00831 clm_rec->c[pos+2]=0x177;
00832 switch (owner)
00833 {
00834 case PLAYER0: clm_rec->c[pos+3]=0x0a2; break;
00835 case PLAYER1: clm_rec->c[pos+3]=0x19c; break;
00836 case PLAYER2: clm_rec->c[pos+3]=0x19f; break;
00837 case PLAYER3: clm_rec->c[pos+3]=0x1a2; break;
00838 case PLAYER_GOOD:clm_rec->c[pos+3]=0x1a5; break;
00839 default: clm_rec->c[pos+3]=0x04d; break;
00840 }
00841 clm_rec->solid=compute_clm_rec_solid(clm_rec);
00842 clm_rec->height=compute_clm_rec_height(clm_rec);
00843 }
00844
00845 void place_column_doormagic_a(struct COLUMN_REC *clm_rec, unsigned char owner)
00846 {
00847 int pos=1;
00848 if (pos<0) pos=0;
00849 if (pos>4) pos=4;
00850 clm_rec->c[pos+0]=0x12e;
00851 clm_rec->c[pos+1]=0x12b;
00852 clm_rec->c[pos+2]=0x128;
00853 switch (owner)
00854 {
00855 case PLAYER0: clm_rec->c[pos+3]=0x0a0; break;
00856 case PLAYER1: clm_rec->c[pos+3]=0x19a; break;
00857 case PLAYER2: clm_rec->c[pos+3]=0x19d; break;
00858 case PLAYER3: clm_rec->c[pos+3]=0x1a0; break;
00859 case PLAYER_GOOD:clm_rec->c[pos+3]=0x1a3; break;
00860 default: clm_rec->c[pos+3]=0x04d; break;
00861 }
00862 clm_rec->solid=compute_clm_rec_solid(clm_rec);
00863 clm_rec->height=compute_clm_rec_height(clm_rec);
00864 }
00865
00866 void place_column_doormagic_b(struct COLUMN_REC *clm_rec, unsigned char owner)
00867 {
00868 int pos=1;
00869 if (pos<0) pos=0;
00870 if (pos>4) pos=4;
00871 clm_rec->c[pos+0]=0x12d;
00872 clm_rec->c[pos+1]=0x12a;
00873 clm_rec->c[pos+2]=0x127;
00874 switch (owner)
00875 {
00876 case PLAYER0: clm_rec->c[0]=0x0c0; clm_rec->c[pos+3]=0x0a1; break;
00877 case PLAYER1: clm_rec->c[0]=0x0c1; clm_rec->c[pos+3]=0x19b; break;
00878 case PLAYER2: clm_rec->c[0]=0x0c2; clm_rec->c[pos+3]=0x19e; break;
00879 case PLAYER3: clm_rec->c[0]=0x0c3; clm_rec->c[pos+3]=0x1a1; break;
00880 case PLAYER_GOOD:clm_rec->c[0]=0x0c7; clm_rec->c[pos+3]=0x1a4; break;
00881 default: clm_rec->c[0]=0x0c6; clm_rec->c[pos+3]=0x04d; break;
00882 }
00883 clm_rec->solid=compute_clm_rec_solid(clm_rec);
00884 clm_rec->height=compute_clm_rec_height(clm_rec);
00885 }
00886
00887 void place_column_doormagic_c(struct COLUMN_REC *clm_rec, unsigned char owner)
00888 {
00889 int pos=1;
00890 if (pos<0) pos=0;
00891 if (pos>4) pos=4;
00892 clm_rec->c[pos+0]=0x12c;
00893 clm_rec->c[pos+1]=0x129;
00894 clm_rec->c[pos+2]=0x126;
00895 switch (owner)
00896 {
00897 case PLAYER0: clm_rec->c[pos+3]=0x0a2; break;
00898 case PLAYER1: clm_rec->c[pos+3]=0x19c; break;
00899 case PLAYER2: clm_rec->c[pos+3]=0x19f; break;
00900 case PLAYER3: clm_rec->c[pos+3]=0x1a2; break;
00901 case PLAYER_GOOD:clm_rec->c[pos+3]=0x1a5; break;
00902 default: clm_rec->c[pos+3]=0x04d; break;
00903 }
00904 clm_rec->solid=compute_clm_rec_solid(clm_rec);
00905 clm_rec->height=compute_clm_rec_height(clm_rec);
00906 }
00907
00908 void fill_column_rock_gndlev(struct COLUMN_REC *clm_rec, unsigned char owner)
00909 {
00910 fill_column_rec_simp(clm_rec, 0, CUBE_PATH_SMLSTONES,
00911 CUBE_ROCK_ANY, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0);
00912 }
00913
00914 void fill_column_rockground(struct COLUMN_REC *clm_rec, unsigned char owner)
00915 {
00916 fill_column_rec_simp(clm_rec, 0, CUBE_PATH_SMLSTONES,
00917 CUBE_ROCK3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0);
00918 }
00919
00920 void fill_column_rock(struct COLUMN_REC *clm_rec, unsigned char owner)
00921 {
00922 fill_column_rockground(clm_rec,owner);
00923 place_column_rock(clm_rec,owner);
00924 }
00925
00926
00927
00928
00929 void place_column_rock(struct COLUMN_REC *clm_rec, unsigned char owner)
00930 {
00931 int pos=clm_rec->height-4;
00932 if (pos<0) pos=clm_rec->height;
00933 if (pos>4) pos=4;
00934 clm_rec->c[pos+0]=CUBE_ROCK3;
00935 clm_rec->c[pos+1]=CUBE_ROCK2;
00936 clm_rec->c[pos+2]=CUBE_ROCK2;
00937 clm_rec->c[pos+3]=CUBE_ROCK1;
00938 clm_rec->solid=compute_clm_rec_solid(clm_rec);
00939 clm_rec->height=compute_clm_rec_height(clm_rec);
00940 }
00941
00942
00943
00944
00945 void fill_column_earthground(struct COLUMN_REC *clm_rec, unsigned char owner)
00946 {
00947 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
00948 CUBE_PATH_SMOOTH1 +rnd(5), 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0);
00949 }
00950
00951
00952
00953
00954 void fill_column_wallground_nearwater(struct COLUMN_REC *clm_rec, unsigned char owner)
00955 {
00956 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
00957 0x075, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0);
00958 }
00959
00960
00961
00962
00963 void fill_column_wallground_nearlava(struct COLUMN_REC *clm_rec, unsigned char owner)
00964 {
00965 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
00966 0x076, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0);
00967 }
00968
00969 void fill_column_gold(struct COLUMN_REC *clm_rec, unsigned char owner)
00970 {
00971 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
00972 CUBE_PATH_SMOOTH1 +rnd(5), CUBE_EARTHGRNSDCTR, CUBE_GOLD1 +rnd(3), CUBE_GOLD1 +rnd(3), CUBE_GOLD1 +rnd(3), 0, 0, 0);
00973 }
00974
00975 void fill_column_gold_nearwater(struct COLUMN_REC *clm_rec, unsigned char owner)
00976 {
00977 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
00978 0x026, CUBE_GOLD1 +rnd(3), CUBE_GOLD1 +rnd(3), CUBE_GOLD1 +rnd(3), CUBE_GOLD1 +rnd(3), 0, 0, 0);
00979 }
00980
00981 void fill_column_gold_nearlava(struct COLUMN_REC *clm_rec, unsigned char owner)
00982 {
00983 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
00984 CUBE_EARTHBTMLAVA, 0x034+rnd(3), 0x034+rnd(3), 0x034+rnd(3), 0x034+rnd(3), 0, 0, 0);
00985 }
00986
00987 void fill_column_earth(struct COLUMN_REC *clm_rec, unsigned char owner)
00988 {
00989 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
00990 CUBE_PATH_SMOOTH1 +rnd(5), CUBE_EARTHGRNSDCTR, 0x001+rnd(3), 0x001+rnd(3), 0x005, 0, 0, 0);
00991 }
00992
00993 void fill_column_earth_nearwater(struct COLUMN_REC *clm_rec, unsigned char owner)
00994 {
00995 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
00996 0x026, 0x001+rnd(3), 0x001+rnd(3), 0x001+rnd(3), 0x005, 0, 0, 0);
00997 }
00998
00999 void fill_column_earth_nearlava(struct COLUMN_REC *clm_rec, unsigned char owner)
01000 {
01001 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01002 CUBE_EARTHBTMLAVA, 0x030, 0x030, 0x030, 0x030, 0, 0, 0);
01003 }
01004
01005 void fill_column_wall_centr(struct COLUMN_REC *clm_rec, unsigned char owner)
01006 {
01007
01008
01009
01010 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01011 CUBE_PATH_SMOOTH1, CUBE_EARTHGRNSDCTR, CUBE_EARTHSTD2, CUBE_EARTHSTD2, CUBE_EARTHBRGTOPDKL, 0, 0, 0);
01012
01013 if (owner<PLAYER_UNSET)
01014 clm_rec->c[4]=0x043+owner;
01015 }
01016
01017
01018
01019
01020 void fill_column_wall_cobblestones(struct COLUMN_REC *clm_rec, unsigned char owner)
01021 {
01022 fill_column_earthground(clm_rec,owner);
01023 place_column_wall_cobblestones(clm_rec,owner);
01024 }
01025
01026
01027
01028
01029 void place_column_wall_cobblestones(struct COLUMN_REC *clm_rec, unsigned char owner)
01030 {
01031 int pos=clm_rec->height-4;
01032 if (pos<0) pos=clm_rec->height;
01033 if (pos>4) pos=4;
01034 clm_rec->c[pos+0]=0x098;
01035 clm_rec->c[pos+1]=0x097;
01036 clm_rec->c[pos+2]=0x096;
01037 clm_rec->c[pos+3]=0x095;
01038 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01039 clm_rec->height=compute_clm_rec_height(clm_rec);
01040 }
01041
01042
01043
01044
01045 void place_column_wall_cobblestones_mk(struct COLUMN_REC *clm_rec, unsigned char owner)
01046 {
01047 int pos=clm_rec->height-4;
01048 if (pos<0) pos=clm_rec->height;
01049 if (pos>4) pos=4;
01050 clm_rec->c[pos+0]=0x03e;
01051 clm_rec->c[pos+1]=0x039;
01052 clm_rec->c[pos+2]=0x03a;
01053 clm_rec->c[pos+3]=0x041;
01054 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01055 clm_rec->height=compute_clm_rec_height(clm_rec);
01056 }
01057
01058 void place_column_wall_redsmbrick_b(struct COLUMN_REC *clm_rec, unsigned char owner)
01059 {
01060 int pos=clm_rec->height-4;
01061 if (pos<0) pos=clm_rec->height;
01062 if (pos>4) pos=4;
01063 clm_rec->c[pos+0]=0x053;
01064 clm_rec->c[pos+1]=0x050;
01065 clm_rec->c[pos+2]=0x050;
01066 clm_rec->c[pos+3]=0x04e;
01067 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01068 clm_rec->height=compute_clm_rec_height(clm_rec);
01069 }
01070
01071 void place_column_wall_redsmbrick_dkbtm(struct COLUMN_REC *clm_rec, unsigned char owner)
01072 {
01073 int pos=clm_rec->height-4;
01074 if (pos<0) pos=clm_rec->height;
01075 if (pos>4) pos=4;
01076 clm_rec->c[pos+0]=0x052;
01077 clm_rec->c[pos+1]=0x048+rnd(3);
01078 clm_rec->c[pos+2]=0x048+rnd(3);
01079 clm_rec->c[pos+3]=0x04d;
01080 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01081 clm_rec->height=compute_clm_rec_height(clm_rec);
01082 }
01083
01084 void place_column_wall_redsmbrick_c(struct COLUMN_REC *clm_rec, unsigned char owner)
01085 {
01086 int pos=clm_rec->height-4;
01087 if (pos<0) pos=clm_rec->height;
01088 if (pos>4) pos=4;
01089 clm_rec->c[pos+0]=0x051;
01090 clm_rec->c[pos+1]=0x04f;
01091 clm_rec->c[pos+2]=0x04f;
01092 clm_rec->c[pos+3]=0x04c;
01093 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01094 clm_rec->height=compute_clm_rec_height(clm_rec);
01095 }
01096
01097 void place_column_wall_redsmbrick(struct COLUMN_REC *clm_rec, unsigned char owner)
01098 {
01099 int pos=clm_rec->height-4;
01100 if (pos<0) pos=clm_rec->height;
01101 if (pos>4) pos=4;
01102 clm_rec->c[pos+0]=0x048+rnd(3);
01103 clm_rec->c[pos+1]=0x048+rnd(3);
01104 clm_rec->c[pos+2]=0x048+rnd(3);
01105 clm_rec->c[pos+3]=0x04d;
01106 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01107 clm_rec->height=compute_clm_rec_height(clm_rec);
01108 }
01109
01110 void fill_column_wall_redsmbrick_b(struct COLUMN_REC *clm_rec, unsigned char owner)
01111 {
01112 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01113 CUBE_PATH_SMOOTH1 +rnd(5), 0x053, 0x050, 0x050, 0x04e, 0, 0, 0);
01114 }
01115
01116 void fill_column_wall_redsmbrick_a(struct COLUMN_REC *clm_rec, unsigned char owner)
01117 {
01118 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01119 CUBE_PATH_SMOOTH1 +rnd(5), 0x052, 0x048+rnd(3), 0x048+rnd(3), 0x04d, 0, 0, 0);
01120 }
01121
01122 void fill_column_wall_redsmbrick_c(struct COLUMN_REC *clm_rec, unsigned char owner)
01123 {
01124 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01125 CUBE_PATH_SMOOTH1 +rnd(5), 0x051, 0x04f, 0x04f, 0x04c, 0, 0, 0);
01126 }
01127
01128 void fill_column_wall_redsmbrick_a_nearwater(struct COLUMN_REC *clm_rec, unsigned char owner)
01129 {
01130 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01131 0x075, 0x048+rnd(3), 0x048+rnd(3), 0x048+rnd(3), 0x04d, 0, 0, 0);
01132 }
01133
01134 void fill_column_wall_redsmbrick_a_nearlava(struct COLUMN_REC *clm_rec, unsigned char owner)
01135 {
01136 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01137 0x076, 0x048+rnd(3), 0x048+rnd(3), 0x048+rnd(3), 0x04d, 0, 0, 0);
01138 }
01139
01140 void fill_column_wall_redsmbrick_c_nearwater(struct COLUMN_REC *clm_rec, unsigned char owner)
01141 {
01142 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01143 0x075, 0x04f, 0x04f, 0x04f, 0x04c, 0, 0, 0);
01144 }
01145
01146 void fill_column_wall_redsmbrick_c_nearlava(struct COLUMN_REC *clm_rec, unsigned char owner)
01147 {
01148 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01149 0x076, 0x04f, 0x04f, 0x04f, 0x04c, 0, 0, 0);
01150 }
01151
01152 void fill_column_wall_drapebrick_a(struct COLUMN_REC *clm_rec, unsigned char owner)
01153 {
01154
01155
01156 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01157 CUBE_PATH_SMOOTH1, 0x052, 0x049, 0x049, 0x04d, 0, 0, 0);
01158 switch (owner)
01159 {
01160 case PLAYER0: clm_rec->c[4]=0x0a0; break;
01161 case PLAYER1: clm_rec->c[4]=0x19a; break;
01162 case PLAYER2: clm_rec->c[4]=0x19d; break;
01163 case PLAYER3: clm_rec->c[4]=0x1a0; break;
01164 case PLAYER_GOOD:clm_rec->c[4]=0x1a3; break;
01165 default: clm_rec->c[4]=0x04d; break;
01166 }
01167 }
01168
01169 void fill_column_wall_drapebrick_b(struct COLUMN_REC *clm_rec, unsigned char owner)
01170 {
01171
01172
01173 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01174 CUBE_PATH_SMOOTH1, 0x052, 0x049, 0x049, 0x04d, 0, 0, 0);
01175 switch (owner)
01176 {
01177 case PLAYER0: clm_rec->c[4]=0x0a1; break;
01178 case PLAYER1: clm_rec->c[4]=0x19b; break;
01179 case PLAYER2: clm_rec->c[4]=0x19e; break;
01180 case PLAYER3: clm_rec->c[4]=0x1a1; break;
01181 case PLAYER_GOOD:clm_rec->c[4]=0x1a4; break;
01182 default: clm_rec->c[4]=0x04d; break;
01183 }
01184 }
01185
01186 void fill_column_wall_drapebrick_c(struct COLUMN_REC *clm_rec, unsigned char owner)
01187 {
01188 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01189 CUBE_PATH_SMOOTH1, 0x052, 0x049, 0x049, 0x04d, 0, 0, 0);
01190 switch (owner)
01191 {
01192 case PLAYER0: clm_rec->c[4]=0x0a2; break;
01193 case PLAYER1: clm_rec->c[4]=0x19c; break;
01194 case PLAYER2: clm_rec->c[4]=0x19f; break;
01195 case PLAYER3: clm_rec->c[4]=0x1a2; break;
01196 case PLAYER_GOOD:clm_rec->c[4]=0x1a5; break;
01197 default: clm_rec->c[4]=0x04d; break;
01198 }
01199 }
01200
01201 void fill_column_wall_twinsbrick_a(struct COLUMN_REC *clm_rec, unsigned char owner)
01202 {
01203 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01204 CUBE_PATH_SMOOTH1 +rnd(5), 0x195, CUBE_BRICK_RTWINSBL, CUBE_BRICK_RTWINSML, CUBE_BRICK_RTWINSTL, 0, 0, 0);
01205 }
01206
01207 void fill_column_wall_twinsbrick_b(struct COLUMN_REC *clm_rec, unsigned char owner)
01208 {
01209 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01210 CUBE_PATH_SMOOTH1 +rnd(5), 0x196, CUBE_BRICK_RTWINSBC, CUBE_BRICK_RTWINSMC, CUBE_BRICK_RTWINSTC, 0, 0, 0);
01211 }
01212
01213 void fill_column_wall_twinsbrick_c(struct COLUMN_REC *clm_rec, unsigned char owner)
01214 {
01215 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01216 CUBE_PATH_SMOOTH1 +rnd(5), 0x197, CUBE_BRICK_RTWINSBR, CUBE_BRICK_RTWINSMR, CUBE_BRICK_RTWINSTR, 0, 0, 0);
01217 }
01218
01219 void fill_column_wall_womanbrick_a(struct COLUMN_REC *clm_rec, unsigned char owner)
01220 {
01221 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01222 CUBE_PATH_SMOOTH1 +rnd(5), CUBE_BRICK_RWOMANBL, CUBE_BRICK_RWOMANML,
01223 CUBE_BRICK_RWOMANUL, CUBE_BRICK_RWOMANTL, 0, 0, 0);
01224 }
01225
01226 void fill_column_wall_womanbrick_b(struct COLUMN_REC *clm_rec, unsigned char owner)
01227 {
01228 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01229 CUBE_PATH_SMOOTH1 +rnd(5), CUBE_BRICK_RWOMANBC, CUBE_BRICK_RWOMANMC,
01230 CUBE_BRICK_RWOMANUC, CUBE_BRICK_RWOMANTC, 0, 0, 0);
01231 }
01232
01233 void fill_column_wall_womanbrick_c(struct COLUMN_REC *clm_rec, unsigned char owner)
01234 {
01235 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01236 CUBE_PATH_SMOOTH1 +rnd(5), CUBE_BRICK_RWOMANBR, CUBE_BRICK_RWOMANMR,
01237 CUBE_BRICK_RWOMANUR, CUBE_BRICK_RWOMANTR, 0, 0, 0);
01238 }
01239
01240 void fill_column_wall_pairshrbrick_a(struct COLUMN_REC *clm_rec, unsigned char owner)
01241 {
01242 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01243 CUBE_PATH_SMOOTH1 +rnd(5), CUBE_BRICK_PAIRSHBL, CUBE_BRICK_PAIRSHML,
01244 CUBE_BRICK_PAIRSHUL, CUBE_BRICK_PAIRSHTL, 0, 0, 0);
01245 }
01246
01247 void fill_column_wall_pairshrbrick_b(struct COLUMN_REC *clm_rec, unsigned char owner)
01248 {
01249 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01250 CUBE_PATH_SMOOTH1 +rnd(5), CUBE_BRICK_PAIRSHBC, CUBE_BRICK_PAIRSHMC,
01251 CUBE_BRICK_PAIRSHUC, CUBE_BRICK_PAIRSHTC, 0, 0, 0);
01252 }
01253
01254 void fill_column_wall_pairshrbrick_c(struct COLUMN_REC *clm_rec, unsigned char owner)
01255 {
01256 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01257 CUBE_PATH_SMOOTH1 +rnd(5), CUBE_BRICK_PAIRSHBR, CUBE_BRICK_PAIRSHMR,
01258 CUBE_BRICK_PAIRSHUR, CUBE_BRICK_PAIRSHTR, 0, 0, 0);
01259 }
01260
01261 void fill_column_path(struct COLUMN_REC *clm_rec, unsigned char owner)
01262 {
01263 fill_column_rec_sim(clm_rec, 0, 0x0cf,
01264 CUBE_PATH_SMOOTH1 +rnd(5), 0x0, 0x0, 0x0, 0x0, 0, 0, 0);
01265 }
01266
01267
01268
01269
01270 void fill_column_claimedgnd_centr(struct COLUMN_REC *clm_rec, unsigned char owner)
01271 {
01272 fill_column_rec_sim(clm_rec, 0, 0x0ce,
01273 0x0c6, 0x0, 0x0, 0x0, 0x0, 0, 0, 0);
01274
01275 if (owner==PLAYER_GOOD)
01276 clm_rec->c[0]=0x0c7;
01277 else
01278 if (owner<PLAYER_UNSET)
01279 clm_rec->c[0]=0x0c0+owner;
01280 }
01281
01282 void fill_column_claimedgnd_surr(struct COLUMN_REC *clm_rec, unsigned char owner)
01283 {
01284 fill_column_rec_sim(clm_rec, 0, 0x0ce,
01285 0x07e +rnd(3), 0x0, 0x0, 0x0, 0x0, 0, 0, 0);
01286 }
01287
01288 void fill_column_claimedgnd_nearwater(struct COLUMN_REC *clm_rec, unsigned char owner)
01289 {
01290 fill_column_rec_sim(clm_rec, 0, 0x0ce,
01291 0x094, 0x0, 0x0, 0x0, 0x0, 0, 0, 0);
01292 }
01293
01294 void fill_column_claimedgnd_nearlava(struct COLUMN_REC *clm_rec, unsigned char owner)
01295 {
01296 fill_column_rec_sim(clm_rec, 0, 0x0ce,
01297 0x093, 0x0, 0x0, 0x0, 0x0, 0, 0, 0);
01298 }
01299
01300 void fill_column_lava(struct COLUMN_REC *clm_rec, unsigned char owner)
01301 {
01302 fill_column_rec_sim(clm_rec, 0, CUBE_ANI_LAVA_ANY,
01303 0x0, 0x0, 0x0, 0x0, 0x0, 0, 0, 0);
01304 }
01305
01306 void fill_column_water(struct COLUMN_REC *clm_rec, unsigned char owner)
01307 {
01308 fill_column_rec_sim(clm_rec, 0, CUBE_ANI_WATER,
01309 0x0, 0x0, 0x0, 0x0, 0x0, 0, 0, 0);
01310 }
01311
01312 void fill_column_gem(struct COLUMN_REC *clm_rec, unsigned char owner)
01313 {
01314 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01315 CUBE_PATH_SMOOTH1 +rnd(5), 0x00a, CUBE_GEMS_ANY, CUBE_GEMS_ANY, CUBE_GEMS_ANY, 0, 0, 0);
01316 }
01317
01318 void fill_column_library_pillar(struct COLUMN_REC *clm_rec, unsigned char owner)
01319 {
01320 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01321 CUBE_PATH_SMOOTH1 +rnd(5), 0x0b9, 0x0b8, 0x0b7, 0x0b6, 0, 0, 0);
01322 }
01323
01324 void place_column_library_bookcase_a(struct COLUMN_REC *clm_rec, unsigned char owner)
01325 {
01326 clm_rec->base=CUBE_PATH_SMOOTH3;
01327 clm_rec->c[1]=0x14b;
01328 clm_rec->c[2]=0x14d;
01329 clm_rec->c[3]=0x14b;
01330 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01331 clm_rec->height=compute_clm_rec_height(clm_rec);
01332 }
01333
01334 void place_column_library_bookcase_b(struct COLUMN_REC *clm_rec, unsigned char owner)
01335 {
01336 clm_rec->base=CUBE_PATH_SMOOTH3;
01337 clm_rec->c[1]=0x0b1;
01338 clm_rec->c[2]=0x0b4;
01339 clm_rec->c[3]=0x0b1;
01340 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01341 clm_rec->height=compute_clm_rec_height(clm_rec);
01342 }
01343
01344 void place_column_library_bookcase_c(struct COLUMN_REC *clm_rec, unsigned char owner)
01345 {
01346 clm_rec->base=CUBE_PATH_SMOOTH3;
01347 clm_rec->c[1]=0x14c;
01348 clm_rec->c[2]=0x14e;
01349 clm_rec->c[3]=0x14c;
01350 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01351 clm_rec->height=compute_clm_rec_height(clm_rec);
01352 }
01353
01354 void place_column_temple_pillar(struct COLUMN_REC *clm_rec, unsigned char owner)
01355 {
01356 int pos=clm_rec->height-1;
01357 if (pos<0) pos=0;
01358 if (pos>1) pos=1;
01359 clm_rec->c[pos+0]=0x122;
01360 clm_rec->c[pos+1]=0x122;
01361 clm_rec->c[pos+2]=0x120;
01362 clm_rec->c[pos+3]=0x11d;
01363 clm_rec->c[pos+4]=0x120;
01364 clm_rec->c[pos+5]=0x11e;
01365 clm_rec->c[pos+6]=0x11d;
01366 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01367 clm_rec->height=compute_clm_rec_height(clm_rec);
01368 }
01369
01370 void fill_column_temple_floor(struct COLUMN_REC *clm_rec, unsigned char owner)
01371 {
01372 fill_column_rec_sim(clm_rec, 0, 0x177,
01373 CUBE_PATH_SMOOTH1 +rnd(5), 0x123, 0x0, 0x0, 0x0, 0, 0, 0);
01374 }
01375
01376 void place_column_temple_corner(struct COLUMN_REC *clm_rec, unsigned char owner)
01377 {
01378 int pos=clm_rec->height-1;
01379 if (pos<0) pos=0;
01380 if (pos>7) pos=7;
01381 clm_rec->c[pos]=0x122;
01382 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01383 clm_rec->height=compute_clm_rec_height(clm_rec);
01384 }
01385
01386 void place_column_temple_edge(struct COLUMN_REC *clm_rec, unsigned char owner)
01387 {
01388 int pos=clm_rec->height;
01389 if (pos<0) pos=0;
01390 if (pos>7) pos=7;
01391 clm_rec->c[pos]=0x122;
01392 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01393 clm_rec->height=compute_clm_rec_height(clm_rec);
01394 }
01395
01396 void fill_column_dungheart_floor(struct COLUMN_REC *clm_rec, unsigned char owner)
01397 {
01398 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01399 0x09f , 0x0, 0x0, 0x0, 0x0, 0, 0, 0);
01400 }
01401
01402 void fill_column_dungheart_pillar(struct COLUMN_REC *clm_rec, unsigned char owner)
01403 {
01404 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01405 0x080 , 0x052, 0x048, 0x049, 0x04a, 0x049, 0x17f, 0x1aa);
01406 switch (owner)
01407 {
01408 case PLAYER0: clm_rec->c[7]=CUBE_EYEDROCKRED; break;
01409 case PLAYER1: clm_rec->c[7]=CUBE_EYEDROCKBLUE; break;
01410 case PLAYER2: clm_rec->c[7]=CUBE_EYEDROCKGREEN; break;
01411 case PLAYER3: clm_rec->c[7]=CUBE_EYEDROCKYELLOW; break;
01412 case PLAYER_GOOD:clm_rec->c[7]=CUBE_EYEDROCKWHITE; break;
01413 default: clm_rec->c[7]=CUBE_EYEDROCKBLINK; break;
01414 }
01415 }
01416
01417 void fill_column_dungheart_inside(struct COLUMN_REC *clm_rec, unsigned char owner)
01418 {
01419 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01420 CUBE_PATH_SMOOTH1 +rnd(5), 0x052, 0x09f, 0x0, 0x0, 0, 0, 0);
01421 }
01422
01423
01424 void place_column_univ_stair(struct COLUMN_REC *clm_rec, unsigned char owner)
01425 {
01426 int pos=clm_rec->height-1;
01427 if (pos<0) pos=0;
01428 if (pos>6) pos=6;
01429 clm_rec->c[pos+1]=clm_rec->c[pos+0];
01430 clm_rec->c[pos+0]=CUBE_PATH_SMOOTH1 +rnd(5);
01431 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01432 clm_rec->height=compute_clm_rec_height(clm_rec);
01433 }
01434
01435 void place_column_dungheart_raise(struct COLUMN_REC *clm_rec, unsigned char owner)
01436 {
01437 int pos=clm_rec->height;
01438 if (pos<0) pos=0;
01439 if (pos>6) pos=6;
01440 clm_rec->c[pos+0]=0x052;
01441 clm_rec->c[pos+1]=0x04d;
01442 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01443 clm_rec->height=compute_clm_rec_height(clm_rec);
01444 }
01445
01446 void fill_column_portal_edge(struct COLUMN_REC *clm_rec, unsigned char owner)
01447 {
01448 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01449 0x138, 0x0, 0x0, 0x0, 0x0, 0, 0, 0);
01450 }
01451
01452 void fill_column_portal_floor(struct COLUMN_REC *clm_rec, unsigned char owner)
01453 {
01454 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01455 CUBE_PATH_SMOOTH1 +rnd(5), 0x00a, 0x0, 0x0, 0x0, 0, 0, 0);
01456 }
01457
01458 void fill_column_portal_pillar(struct COLUMN_REC *clm_rec, unsigned char owner)
01459 {
01460 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMLSTONES,
01461 CUBE_PATH_SMOOTH1 +rnd(5), 0x00a, 0x00f, 0x00d, 0x00d, 0x00c, 0x00e, 0x0);
01462 }
01463
01464 void fill_column_portal_step(struct COLUMN_REC *clm_rec, unsigned char owner)
01465 {
01466 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_LRGSTONES +rnd(2),
01467 0x00a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x00e, 0);
01468 }
01469
01470 void fill_column_portal_inside_cntr(struct COLUMN_REC *clm_rec, unsigned char owner)
01471 {
01472 fill_column_rec_sim(clm_rec, 0, 0x0,
01473 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x089+4, 0);
01474 switch (owner)
01475 {
01476 case PLAYER0: clm_rec->c[6]=CUBE_EYEDROCKRED; break;
01477 case PLAYER1: clm_rec->c[6]=CUBE_EYEDROCKBLUE; break;
01478 case PLAYER2: clm_rec->c[6]=CUBE_EYEDROCKGREEN; break;
01479 case PLAYER3: clm_rec->c[6]=CUBE_EYEDROCKYELLOW; break;
01480 case PLAYER_GOOD:clm_rec->c[6]=CUBE_EYEDROCKWHITE; break;
01481 default: clm_rec->c[6]=CUBE_EYEDROCKBLINK; break;
01482 }
01483 }
01484
01485 void fill_column_hatchery_inside(struct COLUMN_REC *clm_rec, unsigned char owner)
01486 {
01487 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3 +rnd(5),
01488 0x0, 0x0, 0x0, 0x0, 0x0, 0, 0, 0);
01489 }
01490
01491 void fill_column_hatchery_edge(struct COLUMN_REC *clm_rec, unsigned char owner)
01492 {
01493 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01494 0x15a, 0x0, 0x0, 0x0, 0x0, 0, 0, 0);
01495 }
01496
01497 void fill_column_hatchery_pillar(struct COLUMN_REC *clm_rec, unsigned char owner)
01498 {
01499 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01500 0x15b, 0x158, 0x158, 0x158, 0x158, 0x159, 0, 0);
01501 }
01502
01503 void fill_column_lair_inside(struct COLUMN_REC *clm_rec, unsigned char owner)
01504 {
01505 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01506 CUBE_LAIR_INSIDE, 0x0, 0x0, 0x0, 0x0, 0, 0, 0);
01507 }
01508
01509 void fill_column_graveyard_inside(struct COLUMN_REC *clm_rec, unsigned char owner)
01510 {
01511 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_LRGSTONES,
01512 0x142, 0x0, 0x0, 0x0, 0x0, 0, 0, 0);
01513 }
01514
01515 void place_column_barracks_raise(struct COLUMN_REC *clm_rec, unsigned char owner)
01516 {
01517 int pos=clm_rec->height;
01518 if (pos>7) pos=7;
01519 if (pos<1) pos=1;
01520 clm_rec->c[pos-1]=0x183;
01521 clm_rec->c[pos+0]=0x194;
01522 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01523 clm_rec->height=compute_clm_rec_height(clm_rec);
01524 }
01525
01526 void fill_column_barracks_floor(struct COLUMN_REC *clm_rec, unsigned char owner)
01527 {
01528 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01529 0x181, 0x0, 0x0, 0x0, 0x0, 0, 0, 0);
01530 }
01531
01532 void fill_column_barracks_pillar(struct COLUMN_REC *clm_rec, unsigned char owner)
01533 {
01534 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01535 CUBE_PATH_SMOOTH2, 0x184, 0x184, 0x18f, 0x18e, 0x184, 0x0, 0x0);
01536 }
01537
01538 void fill_column_training_floor(struct COLUMN_REC *clm_rec, unsigned char owner)
01539 {
01540 fill_column_rec_sim(clm_rec, 0, 0x13e,
01541 0x0fc, 0x0, 0x0, 0x0, 0x0, 0, 0, 0);
01542 }
01543
01544 void fill_column_training_pillar(struct COLUMN_REC *clm_rec, unsigned char owner)
01545 {
01546 fill_column_rec_sim(clm_rec, 0, 0x13e,
01547 0x0fc, 0x0fb, 0x0fa, 0x0f9, 0x0f9, 0x0f1, 0x0, 0x0);
01548 }
01549
01550 void fill_column_treasure_floor(struct COLUMN_REC *clm_rec, unsigned char owner)
01551 {
01552 fill_column_rec_sim(clm_rec, 0, 0x06a,
01553 0x09f, 0x0, 0x0, 0x0, 0x0, 0, 0, 0);
01554 }
01555
01556 void fill_column_treasure_pillar(struct COLUMN_REC *clm_rec, unsigned char owner)
01557 {
01558 fill_column_rec_sim(clm_rec, 0, 0x06a,
01559 0x09f, 0x03e, 0x039, 0x03a, 0x039, 0x041, 0x0, 0x0);
01560 }
01561
01562 void fill_column_workshop_floor(struct COLUMN_REC *clm_rec, unsigned char owner)
01563 {
01564 fill_column_rec_sim(clm_rec, 0, 0x15a,
01565 0x107, 0x0, 0x0, 0x0, 0x0, 0, 0, 0);
01566 }
01567
01568 void fill_column_workshop_pillar(struct COLUMN_REC *clm_rec, unsigned char owner)
01569 {
01570 fill_column_rec_sim(clm_rec, 0, CUBE_PATH_SMOOTH3,
01571 CUBE_PATH_LRGSTONES, 0x10e, 0x10d, 0x10c, 0x10b, 0x0, 0x0, 0x0);
01572 }
01573
01574
01575 void fill_column_scavenger_floor(struct COLUMN_REC *clm_rec, unsigned char owner)
01576 {
01577 fill_column_rec_sim(clm_rec, 0, 0x0f8,
01578 0x119, 0x0, 0x0, 0x0, 0x0, 0, 0, 0);
01579 }
01580
01581 void fill_column_scavenger_pillar(struct COLUMN_REC *clm_rec, unsigned char owner)
01582 {
01583 fill_column_rec_sim(clm_rec, 0, 0x0f8,
01584 CUBE_PATH_SMOOTH1, 0x118, 0x117, 0x116, 0x115, 0x0, 0x0, 0x0);
01585 }
01586
01587 void fill_column_scavenger_inside_cntr(struct COLUMN_REC *clm_rec, unsigned char owner)
01588 {
01589 fill_column_rec_sim(clm_rec, 0, 0x0f8,
01590 0x11c, 0x0, 0x0, 0x0, 0x0, 0, 0, 0);
01591 }
01592
01593 void fill_column_prison_inside(struct COLUMN_REC *clm_rec, unsigned char owner)
01594 {
01595 fill_column_rec_sim(clm_rec, 0, 0x118,
01596 0x0c8, 0x0, 0x0, 0x0, 0x0, 0, 0, 0);
01597 }
01598
01599 void fill_column_guardpost_floor_a(struct COLUMN_REC *clm_rec, unsigned char owner)
01600 {
01601 fill_column_rec_sim(clm_rec, 0, 0x0b0 +rnd(3),
01602 0x07e +rnd(3), CUBE_WOOD_FLOOR1, 0x0, 0x0, 0x0, 0, 0, 0);
01603 }
01604
01605 void fill_column_guardpost_floor_b(struct COLUMN_REC *clm_rec, unsigned char owner)
01606 {
01607 fill_column_rec_sim(clm_rec, 0, 0x0b0 +rnd(3),
01608 0x07e +rnd(3), CUBE_WOOD_FLOOR2, 0x0, 0x0, 0x0, 0, 0, 0);
01609 }
01610
01611 void fill_column_guardpost_floor_c(struct COLUMN_REC *clm_rec, unsigned char owner)
01612 {
01613 fill_column_rec_sim(clm_rec, 0, 0x0b0 +rnd(3),
01614 0x07e +rnd(3), CUBE_WOOD_FLOOR3, 0x0, 0x0, 0x0, 0, 0, 0);
01615 }
01616
01617 void fill_column_bridge_inside(struct COLUMN_REC *clm_rec, unsigned char owner)
01618 {
01619 fill_column_rec_sim(clm_rec, 0, 0x1f3,
01620 0x1b8, 0x0, 0x0, 0x0, 0x0, 0, 0, 0);
01621 }
01622
01623 void place_column_wall_drape_a(struct COLUMN_REC *clm_rec, unsigned char owner)
01624 {
01625 int pos=clm_rec->height-1;
01626 if (pos<0) pos=0;
01627 if (pos>7) pos=7;
01628 switch (owner)
01629 {
01630 case PLAYER0: clm_rec->c[pos+0]=0x0a0; break;
01631 case PLAYER1: clm_rec->c[pos+0]=0x19a; break;
01632 case PLAYER2: clm_rec->c[pos+0]=0x19d; break;
01633 case PLAYER3: clm_rec->c[pos+0]=0x1a0; break;
01634 case PLAYER_GOOD:clm_rec->c[pos+0]=0x1a3; break;
01635 default: clm_rec->c[pos+0]=0x04d; break;
01636 }
01637 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01638 clm_rec->height=compute_clm_rec_height(clm_rec);
01639 }
01640
01641 void place_column_wall_drape_b(struct COLUMN_REC *clm_rec, unsigned char owner)
01642 {
01643 int pos=clm_rec->height-1;
01644 if (pos<0) pos=0;
01645 if (pos>7) pos=7;
01646 switch (owner)
01647 {
01648 case PLAYER0: clm_rec->c[4]=0x0a1; break;
01649 case PLAYER1: clm_rec->c[4]=0x19b; break;
01650 case PLAYER2: clm_rec->c[4]=0x19e; break;
01651 case PLAYER3: clm_rec->c[4]=0x1a1; break;
01652 case PLAYER_GOOD:clm_rec->c[4]=0x1a4; break;
01653 default: clm_rec->c[4]=0x04d; break;
01654 }
01655 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01656 clm_rec->height=compute_clm_rec_height(clm_rec);
01657 }
01658
01659 void place_column_wall_drape_c(struct COLUMN_REC *clm_rec, unsigned char owner)
01660 {
01661 int pos=clm_rec->height-1;
01662 if (pos<0) pos=0;
01663 if (pos>7) pos=7;
01664 switch (owner)
01665 {
01666 case PLAYER0: clm_rec->c[4]=0x0a2; break;
01667 case PLAYER1: clm_rec->c[4]=0x19c; break;
01668 case PLAYER2: clm_rec->c[4]=0x19f; break;
01669 case PLAYER3: clm_rec->c[4]=0x1a2; break;
01670 case PLAYER_GOOD:clm_rec->c[4]=0x1a5; break;
01671 default: clm_rec->c[4]=0x04d; break;
01672 }
01673 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01674 clm_rec->height=compute_clm_rec_height(clm_rec);
01675 }
01676
01677 void place_column_wall_portal_a(struct COLUMN_REC *clm_rec, unsigned char owner)
01678 {
01679 int pos=clm_rec->height-4;
01680 if (pos<0) pos=0;
01681 if (pos>4) pos=4;
01682 clm_rec->c[pos+0]=0x098;
01683 clm_rec->c[pos+1]=0x097;
01684 clm_rec->c[pos+2]=0x096;
01685 clm_rec->c[pos+3]=0x095;
01686 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01687 clm_rec->height=compute_clm_rec_height(clm_rec);
01688 }
01689
01690 void place_column_wall_portal_b(struct COLUMN_REC *clm_rec, unsigned char owner)
01691 {
01692 int pos=clm_rec->height-4;
01693 if (pos<0) pos=0;
01694 if (pos>4) pos=4;
01695 clm_rec->c[pos+0]=0x04b;
01696 clm_rec->c[pos+1]=0x04b;
01697 clm_rec->c[pos+2]=0x04b;
01698 clm_rec->c[pos+3]=0x04b;
01699 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01700 clm_rec->height=compute_clm_rec_height(clm_rec);
01701 }
01702
01703 void place_column_wall_treasure_a(struct COLUMN_REC *clm_rec, unsigned char owner)
01704 {
01705 int pos=clm_rec->height-3;
01706 if (pos<0) pos=0;
01707 if (pos>6) pos=6;
01708 clm_rec->c[pos+0]=0x09c;
01709 clm_rec->c[pos+1]=0x099;
01710 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01711 clm_rec->height=compute_clm_rec_height(clm_rec);
01712 }
01713
01714 void place_column_wall_treasure_b(struct COLUMN_REC *clm_rec, unsigned char owner)
01715 {
01716 int pos=clm_rec->height-3;
01717 if (pos<0) pos=0;
01718 if (pos>6) pos=6;
01719 clm_rec->c[pos+0]=0x09d;
01720 clm_rec->c[pos+1]=0x09a;
01721 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01722 clm_rec->height=compute_clm_rec_height(clm_rec);
01723 }
01724
01725 void place_column_wall_treasure_c(struct COLUMN_REC *clm_rec, unsigned char owner)
01726 {
01727 int pos=clm_rec->height-3;
01728 if (pos<0) pos=0;
01729 if (pos>6) pos=6;
01730 clm_rec->c[pos+0]=0x09e;
01731 clm_rec->c[pos+1]=0x09b;
01732 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01733 clm_rec->height=compute_clm_rec_height(clm_rec);
01734 }
01735
01736 void place_column_wall_training_a(struct COLUMN_REC *clm_rec, unsigned char owner)
01737 {
01738 int pos=clm_rec->height-4;
01739 if (pos<0) pos=0;
01740 if (pos>5) pos=5;
01741 clm_rec->c[pos+0]=0x053;
01742 clm_rec->c[pos+1]=CUBE_BRICK_CRSWRDBL;
01743 clm_rec->c[pos+2]=CUBE_BRICK_CRSWRDTL;
01744 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01745 clm_rec->height=compute_clm_rec_height(clm_rec);
01746 }
01747
01748 void place_column_wall_training_b(struct COLUMN_REC *clm_rec, unsigned char owner)
01749 {
01750 int pos=clm_rec->height-4;
01751 if (pos<0) pos=0;
01752 if (pos>5) pos=5;
01753 clm_rec->c[pos+0]=0x0fb;
01754 clm_rec->c[pos+1]=CUBE_BRICK_CRSWRDBC;
01755 clm_rec->c[pos+2]=CUBE_BRICK_CRSWRDTC;
01756 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01757 clm_rec->height=compute_clm_rec_height(clm_rec);
01758 }
01759
01760 void place_column_wall_training_c(struct COLUMN_REC *clm_rec, unsigned char owner)
01761 {
01762 int pos=clm_rec->height-4;
01763 if (pos<0) pos=0;
01764 if (pos>5) pos=5;
01765 clm_rec->c[pos+0]=0x051;
01766 clm_rec->c[pos+1]=CUBE_BRICK_CRSWRDBR;
01767 clm_rec->c[pos+2]=CUBE_BRICK_CRSWRDTR;
01768 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01769 clm_rec->height=compute_clm_rec_height(clm_rec);
01770 }
01771
01772 void place_column_wall_library_a(struct COLUMN_REC *clm_rec, unsigned char owner)
01773 {
01774 int pos=clm_rec->height-3;
01775 if (pos<0) pos=0;
01776 if (pos>6) pos=6;
01777 clm_rec->c[pos+0]=CUBE_BRICK_MGMIRRBL;
01778 clm_rec->c[pos+1]=CUBE_BRICK_MGMIRRTL;
01779 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01780 clm_rec->height=compute_clm_rec_height(clm_rec);
01781 }
01782
01783 void place_column_wall_library_b(struct COLUMN_REC *clm_rec, unsigned char owner)
01784 {
01785 int pos=clm_rec->height-3;
01786 if (pos<0) pos=0;
01787 if (pos>6) pos=6;
01788 clm_rec->c[pos+0]=CUBE_BRICK_MGMIRRBC;
01789 clm_rec->c[pos+1]=CUBE_BRICK_MGMIRRTC;
01790 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01791 clm_rec->height=compute_clm_rec_height(clm_rec);
01792 }
01793
01794 void place_column_wall_library_c(struct COLUMN_REC *clm_rec, unsigned char owner)
01795 {
01796 int pos=clm_rec->height-3;
01797 if (pos<0) pos=0;
01798 if (pos>6) pos=6;
01799 clm_rec->c[pos+0]=CUBE_BRICK_MGMIRRBR;
01800 clm_rec->c[pos+1]=CUBE_BRICK_MGMIRRTR;
01801 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01802 clm_rec->height=compute_clm_rec_height(clm_rec);
01803 }
01804
01805 void place_column_wall_scavenger_a(struct COLUMN_REC *clm_rec, unsigned char owner)
01806 {
01807 int pos=clm_rec->height-3;
01808 if (pos<0) pos=0;
01809 if (pos>6) pos=6;
01810 clm_rec->c[pos+0]=CUBE_BRICK_GODEYEBL;
01811 clm_rec->c[pos+1]=CUBE_BRICK_GODEYETL;
01812 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01813 clm_rec->height=compute_clm_rec_height(clm_rec);
01814 }
01815
01816 void place_column_wall_scavenger_b(struct COLUMN_REC *clm_rec, unsigned char owner)
01817 {
01818 int pos=clm_rec->height-3;
01819 if (pos<0) pos=0;
01820 if (pos>6) pos=6;
01821 clm_rec->c[pos+0]=CUBE_BRICK_GODEYEBC;
01822 clm_rec->c[pos+1]=CUBE_BRICK_GODEYETC;
01823 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01824 clm_rec->height=compute_clm_rec_height(clm_rec);
01825 }
01826
01827 void place_column_wall_scavenger_c(struct COLUMN_REC *clm_rec, unsigned char owner)
01828 {
01829 int pos=clm_rec->height-3;
01830 if (pos<0) pos=0;
01831 if (pos>6) pos=6;
01832 clm_rec->c[pos+0]=CUBE_BRICK_GODEYEBR;
01833 clm_rec->c[pos+1]=CUBE_BRICK_GODEYETR;
01834 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01835 clm_rec->height=compute_clm_rec_height(clm_rec);
01836 }
01837
01838 void place_column_wall_graveyard_a(struct COLUMN_REC *clm_rec, unsigned char owner)
01839 {
01840 int pos=clm_rec->height-4;
01841 if (pos<0) pos=0;
01842 if (pos>5) pos=5;
01843 clm_rec->c[pos+0]=CUBE_STONEWALL2;
01844 clm_rec->c[pos+1]=CUBE_STONEWALL1;
01845 clm_rec->c[pos+2]=0x050;
01846 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01847 clm_rec->height=compute_clm_rec_height(clm_rec);
01848 }
01849
01850 void place_column_wall_graveyard_b(struct COLUMN_REC *clm_rec, unsigned char owner)
01851 {
01852 int pos=clm_rec->height-4;
01853 if (pos<0) pos=0;
01854 if (pos>5) pos=5;
01855 clm_rec->c[pos+0]=0x098;
01856 clm_rec->c[pos+1]=0x097;
01857 clm_rec->c[pos+2]=0x096;
01858 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01859 clm_rec->height=compute_clm_rec_height(clm_rec);
01860 }
01861
01862 void place_column_wall_graveyard_c(struct COLUMN_REC *clm_rec, unsigned char owner)
01863 {
01864 int pos=clm_rec->height-4;
01865 if (pos<0) pos=0;
01866 if (pos>5) pos=5;
01867 clm_rec->c[pos+0]=CUBE_STONEWALL2;
01868 clm_rec->c[pos+1]=CUBE_STONEWALL1;
01869 clm_rec->c[pos+2]=0x04f;
01870 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01871 clm_rec->height=compute_clm_rec_height(clm_rec);
01872 }
01873
01874 void place_column_wall_lair_a(struct COLUMN_REC *clm_rec, unsigned char owner)
01875 {
01876 int pos=clm_rec->height-4;
01877 if (pos<0) pos=0;
01878 if (pos>4) pos=4;
01879 clm_rec->c[pos+0]=CUBE_BRICK_SKLSTW2L;
01880 clm_rec->c[pos+3]=CUBE_BRICK_SKLSTW1L;
01881 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01882 clm_rec->height=compute_clm_rec_height(clm_rec);
01883 }
01884
01885 void place_column_wall_lair_b(struct COLUMN_REC *clm_rec, unsigned char owner)
01886 {
01887 int pos=clm_rec->height-4;
01888 if (pos<0) pos=0;
01889 if (pos>4) pos=4;
01890 clm_rec->c[pos+0]=CUBE_BRICK_SKLSTW2C;
01891 clm_rec->c[pos+1]=CUBE_BRICK_SKULSTM;
01892 clm_rec->c[pos+2]=CUBE_BRICK_SKULSTT;
01893 clm_rec->c[pos+3]=CUBE_BRICK_SKLSTW1C;
01894 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01895 clm_rec->height=compute_clm_rec_height(clm_rec);
01896 }
01897
01898 void place_column_wall_lair_c(struct COLUMN_REC *clm_rec, unsigned char owner)
01899 {
01900 int pos=clm_rec->height-4;
01901 if (pos<0) pos=0;
01902 if (pos>4) pos=4;
01903 clm_rec->c[pos+0]=CUBE_BRICK_SKLSTW2R;
01904 clm_rec->c[pos+3]=CUBE_BRICK_SKLSTW1R;
01905 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01906 clm_rec->height=compute_clm_rec_height(clm_rec);
01907 }
01908
01909 void place_column_wall_laircrnr_a(struct COLUMN_REC *clm_rec, unsigned char owner)
01910 {
01911 int pos=clm_rec->height-4;
01912 if (pos<0) pos=0;
01913 if (pos>4) pos=4;
01914 clm_rec->c[pos+0]=CUBE_BRICK_SKLSTW2L;
01915 clm_rec->c[pos+3]=0x0a0;
01916 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01917 clm_rec->height=compute_clm_rec_height(clm_rec);
01918 }
01919
01920 void place_column_wall_laircrnr_b(struct COLUMN_REC *clm_rec, unsigned char owner)
01921 {
01922 int pos=clm_rec->height-4;
01923 if (pos<0) pos=0;
01924 if (pos>4) pos=4;
01925 clm_rec->c[pos+0]=CUBE_BRICK_SKLSTW2C;
01926 clm_rec->c[pos+1]=CUBE_BRICK_SKULSTM;
01927 clm_rec->c[pos+2]=CUBE_BRICK_SKULSTT;
01928 clm_rec->c[pos+3]=0x0a1;
01929 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01930 clm_rec->height=compute_clm_rec_height(clm_rec);
01931 }
01932
01933 void place_column_wall_laircrnr_c(struct COLUMN_REC *clm_rec, unsigned char owner)
01934 {
01935 int pos=clm_rec->height-4;
01936 if (pos<0) pos=0;
01937 if (pos>4) pos=4;
01938 clm_rec->c[pos+0]=CUBE_BRICK_SKLSTW2R;
01939 clm_rec->c[pos+3]=0x0a2;
01940 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01941 clm_rec->height=compute_clm_rec_height(clm_rec);
01942 }
01943
01944 void place_column_wall_workshop_a(struct COLUMN_REC *clm_rec, unsigned char owner)
01945 {
01946 int pos=clm_rec->height-3;
01947 if (pos<0) pos=0;
01948 if (pos>6) pos=6;
01949 clm_rec->c[pos+0]=CUBE_BRICK_FURNCEBL;
01950 clm_rec->c[pos+1]=CUBE_BRICK_FURNCETL;
01951 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01952 clm_rec->height=compute_clm_rec_height(clm_rec);
01953 }
01954
01955 void place_column_wall_workshop_b(struct COLUMN_REC *clm_rec, unsigned char owner)
01956 {
01957 int pos=clm_rec->height-3;
01958 if (pos<0) pos=0;
01959 if (pos>6) pos=6;
01960 clm_rec->c[pos+0]=CUBE_BRICK_FURNCEBC;
01961 clm_rec->c[pos+1]=CUBE_BRICK_FURNCETC;
01962 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01963 clm_rec->height=compute_clm_rec_height(clm_rec);
01964 }
01965
01966 void place_column_wall_workshop_c(struct COLUMN_REC *clm_rec, unsigned char owner)
01967 {
01968 int pos=clm_rec->height-3;
01969 if (pos<0) pos=0;
01970 if (pos>6) pos=6;
01971 clm_rec->c[pos+0]=CUBE_BRICK_FURNCEBR;
01972 clm_rec->c[pos+1]=CUBE_BRICK_FURNCETR;
01973 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01974 clm_rec->height=compute_clm_rec_height(clm_rec);
01975 }
01976
01977 void place_column_wall_prison_a(struct COLUMN_REC *clm_rec, unsigned char owner)
01978 {
01979 int pos=clm_rec->height-3;
01980 if (pos<0) pos=0;
01981 if (pos>6) pos=6;
01982 clm_rec->c[pos+0]=CUBE_BRICK_RDHEADBL;
01983 clm_rec->c[pos+1]=CUBE_BRICK_RDHEADTL;
01984 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01985 clm_rec->height=compute_clm_rec_height(clm_rec);
01986 }
01987
01988 void place_column_wall_prison_b(struct COLUMN_REC *clm_rec, unsigned char owner)
01989 {
01990 int pos=clm_rec->height-3;
01991 if (pos<0) pos=0;
01992 if (pos>6) pos=6;
01993 clm_rec->c[pos+0]=CUBE_BRICK_RDHEADBC;
01994 clm_rec->c[pos+1]=CUBE_BRICK_RDHEADTC;
01995 clm_rec->solid=compute_clm_rec_solid(clm_rec);
01996 clm_rec->height=compute_clm_rec_height(clm_rec);
01997 }
01998
01999 void place_column_wall_prison_c(struct COLUMN_REC *clm_rec, unsigned char owner)
02000 {
02001 int pos=clm_rec->height-3;
02002 if (pos<0) pos=0;
02003 if (pos>6) pos=6;
02004 clm_rec->c[pos+0]=CUBE_BRICK_RDHEADBR;
02005 clm_rec->c[pos+1]=CUBE_BRICK_RDHEADTR;
02006 clm_rec->solid=compute_clm_rec_solid(clm_rec);
02007 clm_rec->height=compute_clm_rec_height(clm_rec);
02008 }
02009
02010 void place_column_wall_torture_a(struct COLUMN_REC *clm_rec, unsigned char owner)
02011 {
02012 int pos=clm_rec->height-3;
02013 if (pos<0) pos=0;
02014 if (pos>5) pos=5;
02015 clm_rec->c[pos+0]=CUBE_BRICK_SPSKELBL;
02016 clm_rec->c[pos+1]=CUBE_BRICK_SPSKELML;
02017 clm_rec->c[pos+2]=CUBE_BRICK_SPSKELTL;
02018 clm_rec->solid=compute_clm_rec_solid(clm_rec);
02019 clm_rec->height=compute_clm_rec_height(clm_rec);
02020 }
02021
02022 void place_column_wall_torture_b(struct COLUMN_REC *clm_rec, unsigned char owner)
02023 {
02024 int pos=clm_rec->height-3;
02025 if (pos<0) pos=0;
02026 if (pos>5) pos=5;
02027 clm_rec->c[pos+0]=CUBE_BRICK_SPSKELBC;
02028 clm_rec->c[pos+1]=CUBE_BRICK_SPSKELMC;
02029 clm_rec->c[pos+2]=CUBE_BRICK_SPSKELTC;
02030 clm_rec->solid=compute_clm_rec_solid(clm_rec);
02031 clm_rec->height=compute_clm_rec_height(clm_rec);
02032 }
02033
02034 void place_column_wall_torture_c(struct COLUMN_REC *clm_rec, unsigned char owner)
02035 {
02036 int pos=clm_rec->height-3;
02037 if (pos<0) pos=0;
02038 if (pos>5) pos=5;
02039 clm_rec->c[pos+0]=CUBE_BRICK_SPSKELBR;
02040 clm_rec->c[pos+1]=CUBE_BRICK_SPSKELMR;
02041 clm_rec->c[pos+2]=CUBE_BRICK_SPSKELTR;
02042 clm_rec->solid=compute_clm_rec_solid(clm_rec);
02043 clm_rec->height=compute_clm_rec_height(clm_rec);
02044 }
02045
02046 void place_column_wall_barracks_a(struct COLUMN_REC *clm_rec, unsigned char owner)
02047 {
02048 int pos=clm_rec->height-3;
02049 if (pos<0) pos=0;
02050 if (pos>5) pos=5;
02051 clm_rec->c[pos+0]=CUBE_BRICK_COOPERBL;
02052 clm_rec->c[pos+1]=CUBE_BRICK_COOPERML;
02053 clm_rec->c[pos+2]=CUBE_BRICK_COOPERTL;
02054 clm_rec->solid=compute_clm_rec_solid(clm_rec);
02055 clm_rec->height=compute_clm_rec_height(clm_rec);
02056 }
02057
02058 void place_column_wall_barracks_b(struct COLUMN_REC *clm_rec, unsigned char owner)
02059 {
02060 int pos=clm_rec->height-3;
02061 if (pos<0) pos=0;
02062 if (pos>5) pos=5;
02063 clm_rec->c[pos+0]=CUBE_BRICK_COOPERBC;
02064 switch (owner)
02065 {
02066 case PLAYER0: clm_rec->c[pos+1]=CUBE_BRICK_COOPRMCR; break;
02067 case PLAYER1: clm_rec->c[pos+1]=0x1ab; break;
02068 case PLAYER2: clm_rec->c[pos+1]=0x1ac; break;
02069 case PLAYER3: clm_rec->c[pos+1]=0x1ad; break;
02070 case PLAYER_GOOD:clm_rec->c[pos+1]=0x1af; break;
02071 default: clm_rec->c[pos+1]=0x0ae; break;
02072 }
02073 clm_rec->c[pos+2]=CUBE_BRICK_COOPERTC;
02074 clm_rec->solid=compute_clm_rec_solid(clm_rec);
02075 clm_rec->height=compute_clm_rec_height(clm_rec);
02076 }
02077
02078 void place_column_wall_barracks_c(struct COLUMN_REC *clm_rec, unsigned char owner)
02079 {
02080 int pos=clm_rec->height-3;
02081 if (pos<0) pos=0;
02082 if (pos>5) pos=5;
02083 clm_rec->c[pos+0]=CUBE_BRICK_COOPERBR;
02084 clm_rec->c[pos+1]=CUBE_BRICK_COOPERMR;
02085 clm_rec->c[pos+2]=CUBE_BRICK_COOPERTR;
02086 clm_rec->solid=compute_clm_rec_solid(clm_rec);
02087 clm_rec->height=compute_clm_rec_height(clm_rec);
02088 }
02089
02090 void place_column_wall_temple_a(struct COLUMN_REC *clm_rec, unsigned char owner)
02091 {
02092 int pos=clm_rec->height-4;
02093 if (pos<0) pos=0;
02094 if (pos>4) pos=4;
02095 clm_rec->c[pos+0]=0x122;
02096 clm_rec->c[pos+1]=CUBE_BRICK_HORNRPBL;
02097 clm_rec->c[pos+2]=CUBE_BRICK_HORNRPML;
02098 clm_rec->c[pos+3]=CUBE_BRICK_HORNRPTL;
02099 clm_rec->solid=compute_clm_rec_solid(clm_rec);
02100 clm_rec->height=compute_clm_rec_height(clm_rec);
02101 }
02102
02103 void place_column_wall_temple_b(struct COLUMN_REC *clm_rec, unsigned char owner)
02104 {
02105 int pos=clm_rec->height-4;
02106 if (pos<0) pos=0;
02107 if (pos>4) pos=4;
02108 clm_rec->c[pos+0]=0x122;
02109 clm_rec->c[pos+1]=CUBE_BRICK_HORNRPBC;
02110 clm_rec->c[pos+2]=CUBE_BRICK_HORNRPMC;
02111 clm_rec->c[pos+3]=CUBE_BRICK_HORNRPTC;
02112 clm_rec->solid=compute_clm_rec_solid(clm_rec);
02113 clm_rec->height=compute_clm_rec_height(clm_rec);
02114 }
02115
02116 void place_column_wall_temple_c(struct COLUMN_REC *clm_rec, unsigned char owner)
02117 {
02118 int pos=clm_rec->height-4;
02119 if (pos<0) pos=0;
02120 if (pos>4) pos=4;
02121 clm_rec->c[pos+0]=0x122;
02122 clm_rec->c[pos+1]=CUBE_BRICK_HORNRPBR;
02123 clm_rec->c[pos+2]=CUBE_BRICK_HORNRPMR;
02124 clm_rec->c[pos+3]=CUBE_BRICK_HORNRPTR;
02125 clm_rec->solid=compute_clm_rec_solid(clm_rec);
02126 clm_rec->height=compute_clm_rec_height(clm_rec);
02127 }
02128
02129 void place_column_wall_hatchery_a(struct COLUMN_REC *clm_rec, unsigned char owner)
02130 {
02131 int pos=clm_rec->height-4;
02132 if (pos<0) pos=0;
02133 if (pos>5) pos=5;
02134 clm_rec->c[pos+0]=CUBE_BRICK_CHICKNBL;
02135 clm_rec->c[pos+1]=CUBE_BRICK_CHICKNML;
02136 clm_rec->c[pos+2]=CUBE_BRICK_CHICKNTL;
02137 clm_rec->solid=compute_clm_rec_solid(clm_rec);
02138 clm_rec->height=compute_clm_rec_height(clm_rec);
02139 }
02140
02141 void place_column_wall_hatchery_b(struct COLUMN_REC *clm_rec, unsigned char owner)
02142 {
02143 int pos=clm_rec->height-4;
02144 if (pos<0) pos=0;
02145 if (pos>5) pos=5;
02146 clm_rec->c[pos+0]=CUBE_BRICK_CHICKNBC;
02147 clm_rec->c[pos+1]=CUBE_BRICK_CHICKNMC;
02148 clm_rec->c[pos+2]=CUBE_BRICK_CHICKNTC;
02149 clm_rec->solid=compute_clm_rec_solid(clm_rec);
02150 clm_rec->height=compute_clm_rec_height(clm_rec);
02151 }
02152
02153 void place_column_wall_hatchery_c(struct COLUMN_REC *clm_rec, unsigned char owner)
02154 {
02155 int pos=clm_rec->height-4;
02156 if (pos<0) pos=0;
02157 if (pos>5) pos=5;
02158 clm_rec->c[pos+0]=CUBE_BRICK_CHICKNBR;
02159 clm_rec->c[pos+1]=CUBE_BRICK_CHICKNMR;
02160 clm_rec->c[pos+2]=CUBE_BRICK_CHICKNTR;
02161 clm_rec->solid=compute_clm_rec_solid(clm_rec);
02162 clm_rec->height=compute_clm_rec_height(clm_rec);
02163 }