ODATA.CPP (47891B)
1 // 2 // Copyright 2020 Electronic Arts Inc. 3 // 4 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is free 5 // software: you can redistribute it and/or modify it under the terms of 6 // the GNU General Public License as published by the Free Software Foundation, 7 // either version 3 of the License, or (at your option) any later version. 8 9 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed 10 // in the hope that it will be useful, but with permitted additional restrictions 11 // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT 12 // distributed with this program. You should have received a copy of the 13 // GNU General Public License along with permitted additional restrictions 14 // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection 15 16 /* $Header: F:\projects\c&c\vcs\code\odata.cpv 2.16 16 Oct 1995 16:50:36 JOE_BOSTIC $ */ 17 /*********************************************************************************************** 18 *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S *** 19 *********************************************************************************************** 20 * * 21 * Project Name : Command & Conquer * 22 * * 23 * File Name : ODATA.CPP * 24 * * 25 * Programmer : Joe L. Bostic * 26 * * 27 * Start Date : May 16, 1994 * 28 * * 29 * Last Update : April 19, 1995 [PWG] * 30 * * 31 *---------------------------------------------------------------------------------------------* 32 * Functions: * 33 * OverlayTypeClass::Display -- Displays a generic representation of overlay. * 34 * OverlayTypeClass::From_Name -- Determine overlay from ASCII name. * 35 * OverlayTypeClass::Init -- Loads graphic data for overlays. * 36 * OverlayTypeClass::Occupy_List -- Determines occupation list. * 37 * OverlayTypeClass::Prep_For_Add -- Prepares to add overlay to scenario. * 38 * OverlayTypeClass::Create_And_Place -- Creates and places a overlay object on the map. * 39 * OverlayTypeClass::Create_One_Of -- Creates an object of this overlay type. * 40 * OverlayTypeClass::OverlayTypeClass -- Constructor for overlay type objects. * 41 * OverlayTypeClass::Draw_It -- Draws the overlay image at location specified. * 42 * OverlayTypeClass::One_Time -- Loads all the necessary general overlay shape data. * 43 * OverlayTypeClass::Init -- Initialize the overlay graphic data per theater. * 44 * OverlayTypeClass::Radar_Icon -- Gets a pointer to the radar icons * 45 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ 46 47 #include "function.h" 48 #include "type.h" 49 50 51 static OverlayTypeClass const Road( 52 OVERLAY_ROAD, // Overlay type number. 53 "ROAD", // INI name of overlay. 54 TXT_CONCRETE, // Full name of overlay. 55 LAND_ROAD, // What kind of ground is it? 56 0, // If this is a wall, how many damage levels? 57 0, // If this is a wall, how many damage points can it take per level? 58 true, // Visible on the radar map? 59 false, // Is it a wooden overlay (affected by fire)? 60 false, // Targetable as a destroyable overlay? 61 false, // Crushable by tracked vehicle? 62 false, // Is this harvestable Tiberium? 63 false, // Stops low level bullets in flight? 64 false, // Theater specific art? 65 false, // Is this a wall type? 66 false // Is this a crate? 67 ); 68 static OverlayTypeClass const Concrete( 69 OVERLAY_CONCRETE, // Overlay type number. 70 "CONC", // INI name of overlay. 71 TXT_CONCRETE, // Full name of overlay. 72 LAND_ROAD, // What kind of ground is it? 73 0, // If this is a wall, how many damage levels? 74 0, // If this is a wall, how many damage points can it take per level? 75 true, // Visible on the radar map? 76 false, // Is it a wooden overlay (affected by fire)? 77 false, // Targetable as a destroyable overlay? 78 false, // Crushable by tracked vehicle? 79 false, // Is this harvestable Tiberium? 80 false, // Stops low level bullets in flight? 81 false, // Theater specific art? 82 false, // Is this a wall type? 83 false // Is this a crate? 84 ); 85 static OverlayTypeClass const Sandbag( 86 OVERLAY_SANDBAG_WALL, // Overlay type number. 87 "SBAG", // INI name of overlay. 88 TXT_SANDBAG_WALL, // Full name of overlay. 89 LAND_WALL, // What kind of ground is it? 90 1, // If this is a wall, how many damage levels? 91 20, // If this is a wall, how many damage points can it take per level? 92 true, // Visible on the radar map? 93 false, // Is it a wooden overlay (affected by fire)? 94 true, // Targetable as a destroyable overlay? 95 false, // Crushable by tracked vehicle? 96 false, // Is this harvestable Tiberium? 97 false, // Stops low level bullets in flight? 98 false, // Theater specific art? 99 true, // Is this a wall type? 100 false // Is this a crate? 101 ); 102 static OverlayTypeClass const Cyclone( 103 OVERLAY_CYCLONE_WALL, // Overlay type number. 104 "CYCL", // INI name of overlay. 105 TXT_CYCLONE_WALL, // Full name of overlay. 106 LAND_WALL, // What kind of ground is it? 107 2, // If this is a wall, how many damage levels? 108 10, // If this is a wall, how many damage points can it take per level? 109 true, // Visible on the radar map? 110 false, // Is it a wooden overlay (affected by fire)? 111 true, // Targetable as a destroyable overlay? 112 true, // Crushable by tracked vehicle? 113 false, // Is this harvestable Tiberium? 114 false, // Stops low level bullets in flight? 115 false, // Theater specific art? 116 true, // Is this a wall type? 117 false // Is this a crate? 118 ); 119 static OverlayTypeClass const Brick( 120 OVERLAY_BRICK_WALL, // Overlay type number. 121 "BRIK", // INI name of overlay. 122 TXT_BRICK_WALL, // Full name of overlay. 123 LAND_WALL, // What kind of ground is it? 124 3, // If this is a wall, how many damage levels? 125 70, // If this is a wall, how many damage points can it take per level? 126 true, // Visible on the radar map? 127 false, // Is it a wooden overlay (affected by fire)? 128 true, // Targetable as a destroyable overlay? 129 false, // Crushable by tracked vehicle? 130 false, // Is this harvestable Tiberium? 131 true, // Stops low level bullets in flight? 132 false, // Theater specific art? 133 true, // Is this a wall type? 134 false // Is this a crate? 135 ); 136 static OverlayTypeClass const Barbwire( 137 OVERLAY_BARBWIRE_WALL, // Overlay type number. 138 "BARB", // INI name of overlay. 139 TXT_BARBWIRE_WALL, // Full name of overlay. 140 LAND_WALL, // What kind of ground is it? 141 1, // If this is a wall, how many damage levels? 142 2, // If this is a wall, how many damage points can it take per level? 143 true, // Visible on the radar map? 144 false, // Is it a wooden overlay (affected by fire)? 145 true, // Targetable as a destroyable overlay? 146 true, // Crushable by tracked vehicle? 147 false, // Is this harvestable Tiberium? 148 false, // Stops low level bullets in flight? 149 false, // Theater specific art? 150 true, // Is this a wall type? 151 false // Is this a crate? 152 ); 153 static OverlayTypeClass const Wood( 154 OVERLAY_WOOD_WALL, // Overlay type number. 155 "WOOD", // INI name of overlay. 156 TXT_WOOD_WALL, // Full name of overlay. 157 LAND_WALL, // What kind of ground is it? 158 1, // If this is a wall, how many damage levels? 159 2, // If this is a wall, how many damage points can it take per level? 160 true, // Visible on the radar map? 161 true, // Is it a wooden overlay (affected by fire)? 162 true, // Targetable as a destroyable overlay? 163 true, // Crushable by tracked vehicle? 164 false, // Is this harvestable Tiberium? 165 false, // Stops low level bullets in flight? 166 false, // Theater specific art? 167 true, // Is this a wall type? 168 false // Is this a crate? 169 ); 170 static OverlayTypeClass const Tiberium1( 171 OVERLAY_TIBERIUM1, // Overlay type number. 172 "TI1", // INI name of overlay. 173 TXT_TIBERIUM, // Full name of overlay. 174 LAND_TIBERIUM, // What kind of ground is it? 175 0, // If this is a wall, how many damage levels? 176 0, // If this is a wall, how many damage points can it take per level? 177 true, // Visible on the radar map? 178 false, // Is it a wooden overlay (affected by fire)? 179 false, // Targetable as a destroyable overlay? 180 false, // Crushable by tracked vehicle? 181 true, // Is this harvestable Tiberium? 182 false, // Stops low level bullets in flight? 183 true, // Theater specific art? 184 false, // Is this a wall type? 185 false // Is this a crate? 186 ); 187 static OverlayTypeClass const Tiberium2( 188 OVERLAY_TIBERIUM2, // Overlay type number. 189 "TI2", // INI name of overlay. 190 TXT_TIBERIUM, // Full name of overlay. 191 LAND_TIBERIUM, // What kind of ground is it? 192 0, // If this is a wall, how many damage levels? 193 0, // If this is a wall, how many damage points can it take per level? 194 true, // Visible on the radar map? 195 false, // Is it a wooden overlay (affected by fire)? 196 false, // Targetable as a destroyable overlay? 197 false, // Crushable by tracked vehicle? 198 true, // Is this harvestable Tiberium? 199 false, // Stops low level bullets in flight? 200 true, // Theater specific art? 201 false, // Is this a wall type? 202 false // Is this a crate? 203 ); 204 static OverlayTypeClass const Tiberium3( 205 OVERLAY_TIBERIUM3, // Overlay type number. 206 "TI3", // INI name of overlay. 207 TXT_TIBERIUM, // Full name of overlay. 208 LAND_TIBERIUM, // What kind of ground is it? 209 0, // If this is a wall, how many damage levels? 210 0, // If this is a wall, how many damage points can it take per level? 211 true, // Visible on the radar map? 212 false, // Is it a wooden overlay (affected by fire)? 213 false, // Targetable as a destroyable overlay? 214 false, // Crushable by tracked vehicle? 215 true, // Is this harvestable Tiberium? 216 false, // Stops low level bullets in flight? 217 true, // Theater specific art? 218 false, // Is this a wall type? 219 false // Is this a crate? 220 ); 221 static OverlayTypeClass const Tiberium4( 222 OVERLAY_TIBERIUM4, // Overlay type number. 223 "TI4", // INI name of overlay. 224 TXT_TIBERIUM, // Full name of overlay. 225 LAND_TIBERIUM, // What kind of ground is it? 226 0, // If this is a wall, how many damage levels? 227 0, // If this is a wall, how many damage points can it take per level? 228 true, // Visible on the radar map? 229 false, // Is it a wooden overlay (affected by fire)? 230 false, // Targetable as a destroyable overlay? 231 false, // Crushable by tracked vehicle? 232 true, // Is this harvestable Tiberium? 233 false, // Stops low level bullets in flight? 234 true, // Theater specific art? 235 false, // Is this a wall type? 236 false // Is this a crate? 237 ); 238 static OverlayTypeClass const Tiberium5( 239 OVERLAY_TIBERIUM5, // Overlay type number. 240 "TI5", // INI name of overlay. 241 TXT_TIBERIUM, // Full name of overlay. 242 LAND_TIBERIUM, // What kind of ground is it? 243 0, // If this is a wall, how many damage levels? 244 0, // If this is a wall, how many damage points can it take per level? 245 true, // Visible on the radar map? 246 false, // Is it a wooden overlay (affected by fire)? 247 false, // Targetable as a destroyable overlay? 248 false, // Crushable by tracked vehicle? 249 true, // Is this harvestable Tiberium? 250 false, // Stops low level bullets in flight? 251 true, // Theater specific art? 252 false, // Is this a wall type? 253 false // Is this a crate? 254 ); 255 static OverlayTypeClass const Tiberium6( 256 OVERLAY_TIBERIUM6, // Overlay type number. 257 "TI6", // INI name of overlay. 258 TXT_TIBERIUM, // Full name of overlay. 259 LAND_TIBERIUM, // What kind of ground is it? 260 0, // If this is a wall, how many damage levels? 261 0, // If this is a wall, how many damage points can it take per level? 262 true, // Visible on the radar map? 263 false, // Is it a wooden overlay (affected by fire)? 264 false, // Targetable as a destroyable overlay? 265 false, // Crushable by tracked vehicle? 266 true, // Is this harvestable Tiberium? 267 false, // Stops low level bullets in flight? 268 true, // Theater specific art? 269 false, // Is this a wall type? 270 false // Is this a crate? 271 ); 272 static OverlayTypeClass const Tiberium7( 273 OVERLAY_TIBERIUM7, // Overlay type number. 274 "TI7", // INI name of overlay. 275 TXT_TIBERIUM, // Full name of overlay. 276 LAND_TIBERIUM, // What kind of ground is it? 277 0, // If this is a wall, how many damage levels? 278 0, // If this is a wall, how many damage points can it take per level? 279 true, // Visible on the radar map? 280 false, // Is it a wooden overlay (affected by fire)? 281 false, // Targetable as a destroyable overlay? 282 false, // Crushable by tracked vehicle? 283 true, // Is this harvestable Tiberium? 284 false, // Stops low level bullets in flight? 285 true, // Theater specific art? 286 false, // Is this a wall type? 287 false // Is this a crate? 288 ); 289 static OverlayTypeClass const Tiberium8( 290 OVERLAY_TIBERIUM8, // Overlay type number. 291 "TI8", // INI name of overlay. 292 TXT_TIBERIUM, // Full name of overlay. 293 LAND_TIBERIUM, // What kind of ground is it? 294 0, // If this is a wall, how many damage levels? 295 0, // If this is a wall, how many damage points can it take per level? 296 true, // Visible on the radar map? 297 false, // Is it a wooden overlay (affected by fire)? 298 false, // Targetable as a destroyable overlay? 299 false, // Crushable by tracked vehicle? 300 true, // Is this harvestable Tiberium? 301 false, // Stops low level bullets in flight? 302 true, // Theater specific art? 303 false, // Is this a wall type? 304 false // Is this a crate? 305 ); 306 static OverlayTypeClass const Tiberium9( 307 OVERLAY_TIBERIUM9, // Overlay type number. 308 "TI9", // INI name of overlay. 309 TXT_TIBERIUM, // Full name of overlay. 310 LAND_TIBERIUM, // What kind of ground is it? 311 0, // If this is a wall, how many damage levels? 312 0, // If this is a wall, how many damage points can it take per level? 313 true, // Visible on the radar map? 314 false, // Is it a wooden overlay (affected by fire)? 315 false, // Targetable as a destroyable overlay? 316 false, // Crushable by tracked vehicle? 317 true, // Is this harvestable Tiberium? 318 false, // Stops low level bullets in flight? 319 true, // Theater specific art? 320 false, // Is this a wall type? 321 false // Is this a crate? 322 ); 323 static OverlayTypeClass const Tiberium10( 324 OVERLAY_TIBERIUM10, // Overlay type number. 325 "TI10", // INI name of overlay. 326 TXT_TIBERIUM, // Full name of overlay. 327 LAND_TIBERIUM, // What kind of ground is it? 328 0, // If this is a wall, how many damage levels? 329 0, // If this is a wall, how many damage points can it take per level? 330 true, // Visible on the radar map? 331 false, // Is it a wooden overlay (affected by fire)? 332 false, // Targetable as a destroyable overlay? 333 false, // Crushable by tracked vehicle? 334 true, // Is this harvestable Tiberium? 335 false, // Stops low level bullets in flight? 336 true, // Theater specific art? 337 false, // Is this a wall type? 338 false // Is this a crate? 339 ); 340 static OverlayTypeClass const Tiberium11( 341 OVERLAY_TIBERIUM11, // Overlay type number. 342 "TI11", // INI name of overlay. 343 TXT_TIBERIUM, // Full name of overlay. 344 LAND_TIBERIUM, // What kind of ground is it? 345 0, // If this is a wall, how many damage levels? 346 0, // If this is a wall, how many damage points can it take per level? 347 true, // Visible on the radar map? 348 false, // Is it a wooden overlay (affected by fire)? 349 false, // Targetable as a destroyable overlay? 350 false, // Crushable by tracked vehicle? 351 true, // Is this harvestable Tiberium? 352 false, // Stops low level bullets in flight? 353 true, // Theater specific art? 354 false, // Is this a wall type? 355 false // Is this a crate? 356 ); 357 static OverlayTypeClass const Tiberium12( 358 OVERLAY_TIBERIUM12, // Overlay type number. 359 "TI12", // INI name of overlay. 360 TXT_TIBERIUM, // Full name of overlay. 361 LAND_TIBERIUM, // What kind of ground is it? 362 0, // If this is a wall, how many damage levels? 363 0, // If this is a wall, how many damage points can it take per level? 364 true, // Visible on the radar map? 365 false, // Is it a wooden overlay (affected by fire)? 366 false, // Targetable as a destroyable overlay? 367 false, // Crushable by tracked vehicle? 368 true, // Is this harvestable Tiberium? 369 false, // Stops low level bullets in flight? 370 true, // Theater specific art? 371 false, // Is this a wall type? 372 false // Is this a crate? 373 ); 374 static OverlayTypeClass const Squish( 375 OVERLAY_SQUISH, // Overlay type number. 376 "SQUISH", // INI name of overlay. 377 TXT_SQUISH, // Full name of overlay. 378 LAND_CLEAR, // What kind of ground is it? 379 0, // If this is a wall, how many damage levels? 380 0, // If this is a wall, how many damage points can it take per level? 381 false, // Visible on the radar map? 382 false, // Is it a wooden overlay (affected by fire)? 383 false, // Targetable as a destroyable overlay? 384 false, // Crushable by tracked vehicle? 385 false, // Is this harvestable Tiberium? 386 false, // Stops low level bullets in flight? 387 false, // Theater specific art? 388 false, // Is this a wall type? 389 false // Is this a crate? 390 ); 391 392 static OverlayTypeClass const V12( 393 OVERLAY_V12, // Overlay type number. 394 "V12", // INI name of overlay. 395 TXT_CIV12, // Full name of overlay. 396 LAND_ROCK, // What kind of ground is it? 397 0, // If this is a wall, how many damage levels? 398 0, // If this is a wall, how many damage points can it take per level? 399 false, // Visible on the radar map? 400 false, // Is it a wooden overlay (affected by fire)? 401 false, // Targetable as a destroyable overlay? 402 true, // Crushable by tracked vehicle? 403 false, // Is this harvestable Tiberium? 404 false, // Stops low level bullets in flight? 405 true, // Theater specific art? 406 false, // Is this a wall type? 407 false // Is this a crate? 408 ); 409 static OverlayTypeClass const V13( 410 OVERLAY_V13, // Overlay type number. 411 "V13", // INI name of overlay. 412 TXT_CIV13, // Full name of overlay. 413 LAND_ROCK, // What kind of ground is it? 414 0, // If this is a wall, how many damage levels? 415 0, // If this is a wall, how many damage points can it take per level? 416 false, // Visible on the radar map? 417 false, // Is it a wooden overlay (affected by fire)? 418 false, // Targetable as a destroyable overlay? 419 true, // Crushable by tracked vehicle? 420 false, // Is this harvestable Tiberium? 421 false, // Stops low level bullets in flight? 422 true, // Theater specific art? 423 false, // Is this a wall type? 424 false // Is this a crate? 425 ); 426 static OverlayTypeClass const V14( 427 OVERLAY_V14, // Overlay type number. 428 "V14", // INI name of overlay. 429 TXT_CIV14, // Full name of overlay. 430 LAND_ROCK, // What kind of ground is it? 431 0, // If this is a wall, how many damage levels? 432 0, // If this is a wall, how many damage points can it take per level? 433 false, // Visible on the radar map? 434 false, // Is it a wooden overlay (affected by fire)? 435 false, // Targetable as a destroyable overlay? 436 true, // Crushable by tracked vehicle? 437 false, // Is this harvestable Tiberium? 438 false, // Stops low level bullets in flight? 439 true, // Theater specific art? 440 false, // Is this a wall type? 441 false // Is this a crate? 442 ); 443 static OverlayTypeClass const V15( 444 OVERLAY_V15, // Overlay type number. 445 "V15", // INI name of overlay. 446 TXT_CIV15, // Full name of overlay. 447 LAND_ROCK, // What kind of ground is it? 448 0, // If this is a wall, how many damage levels? 449 0, // If this is a wall, how many damage points can it take per level? 450 false, // Visible on the radar map? 451 false, // Is it a wooden overlay (affected by fire)? 452 false, // Targetable as a destroyable overlay? 453 true, // Crushable by tracked vehicle? 454 false, // Is this harvestable Tiberium? 455 false, // Stops low level bullets in flight? 456 true, // Theater specific art? 457 false, // Is this a wall type? 458 false // Is this a crate? 459 ); 460 static OverlayTypeClass const V16( 461 OVERLAY_V16, // Overlay type number. 462 "V16", // INI name of overlay. 463 TXT_CIV16, // Full name of overlay. 464 LAND_ROCK, // What kind of ground is it? 465 0, // If this is a wall, how many damage levels? 466 0, // If this is a wall, how many damage points can it take per level? 467 false, // Visible on the radar map? 468 false, // Is it a wooden overlay (affected by fire)? 469 false, // Targetable as a destroyable overlay? 470 true, // Crushable by tracked vehicle? 471 false, // Is this harvestable Tiberium? 472 false, // Stops low level bullets in flight? 473 true, // Theater specific art? 474 false, // Is this a wall type? 475 false // Is this a crate? 476 ); 477 static OverlayTypeClass const V17( 478 OVERLAY_V17, // Overlay type number. 479 "V17", // INI name of overlay. 480 TXT_CIV17, // Full name of overlay. 481 LAND_ROCK, // What kind of ground is it? 482 0, // If this is a wall, how many damage levels? 483 0, // If this is a wall, how many damage points can it take per level? 484 false, // Visible on the radar map? 485 false, // Is it a wooden overlay (affected by fire)? 486 false, // Targetable as a destroyable overlay? 487 true, // Crushable by tracked vehicle? 488 false, // Is this harvestable Tiberium? 489 false, // Stops low level bullets in flight? 490 true, // Theater specific art? 491 false, // Is this a wall type? 492 false // Is this a crate? 493 ); 494 static OverlayTypeClass const V18( 495 OVERLAY_V18, // Overlay type number. 496 "V18", // INI name of overlay. 497 TXT_CIV18, // Full name of overlay. 498 LAND_ROCK, // What kind of ground is it? 499 0, // If this is a wall, how many damage levels? 500 0, // If this is a wall, how many damage points can it take per level? 501 false, // Visible on the radar map? 502 false, // Is it a wooden overlay (affected by fire)? 503 false, // Targetable as a destroyable overlay? 504 true, // Crushable by tracked vehicle? 505 false, // Is this harvestable Tiberium? 506 false, // Stops low level bullets in flight? 507 true, // Theater specific art? 508 false, // Is this a wall type? 509 false // Is this a crate? 510 ); 511 static OverlayTypeClass const FlagSpot( 512 OVERLAY_FLAG_SPOT, // Overlay type number. 513 "FPLS", // INI name of overlay. 514 TXT_FLAG_SPOT, // Full name of overlay. 515 LAND_CLEAR, // What kind of ground is it? 516 0, // If this is a wall, how many damage levels? 517 0, // If this is a wall, how many damage points can it take per level? 518 true, // Visible on the radar map? 519 false, // Is it a wooden overlay (affected by fire)? 520 false, // Targetable as a destroyable overlay? 521 false, // Crushable by tracked vehicle? 522 false, // Is this harvestable Tiberium? 523 false, // Stops low level bullets in flight? 524 false, // Theater specific art? 525 false, // Is this a wall type? 526 false // Is this a crate? 527 ); 528 static OverlayTypeClass const WoodCrate( 529 OVERLAY_WOOD_CRATE, // Overlay type number. 530 "WCRATE", // INI name of overlay. 531 TXT_WOOD_CRATE, // Full name of overlay. 532 LAND_CLEAR, // What kind of ground is it? 533 0, // If this is a wall, how many damage levels? 534 0, // If this is a wall, how many damage points can it take per level? 535 false, // Visible on the radar map? 536 false, // Is it a wooden overlay (affected by fire)? 537 false, // Targetable as a destroyable overlay? 538 false, // Crushable by tracked vehicle? 539 false, // Is this harvestable Tiberium? 540 false, // Stops low level bullets in flight? 541 false, // Theater specific art? 542 false, // Is this a wall type? 543 true // Is this a crate? 544 ); 545 static OverlayTypeClass const SteelCrate( 546 OVERLAY_STEEL_CRATE, // Overlay type number. 547 "SCRATE", // INI name of overlay. 548 TXT_STEEL_CRATE, // Full name of overlay. 549 LAND_CLEAR, // What kind of ground is it? 550 0, // If this is a wall, how many damage levels? 551 0, // If this is a wall, how many damage points can it take per level? 552 false, // Visible on the radar map? 553 false, // Is it a wooden overlay (affected by fire)? 554 false, // Targetable as a destroyable overlay? 555 false, // Crushable by tracked vehicle? 556 false, // Is this harvestable Tiberium? 557 false, // Stops low level bullets in flight? 558 false, // Theater specific art? 559 false, // Is this a wall type? 560 true // Is this a crate? 561 ); 562 563 564 OverlayTypeClass const * const OverlayTypeClass::Pointers[OVERLAY_COUNT] = { 565 &Concrete, // OVERLAY_CONCRETE 566 &Sandbag, // OVERLAY_SANDBAG_WALL 567 &Cyclone, // OVERLAY_CYCLONE_WALL 568 &Brick, // OVERLAY_BRICK_WALL 569 &Barbwire, // OVERLAY_BARBWIRE_WALL 570 &Wood, // OVERLAY_WOOD_WALL 571 &Tiberium1, // OVERLAY_TIBERIUM1 572 &Tiberium2, // OVERLAY_TIBERIUM2 573 &Tiberium3, // OVERLAY_TIBERIUM3 574 &Tiberium4, // OVERLAY_TIBERIUM4 575 &Tiberium5, // OVERLAY_TIBERIUM5 576 &Tiberium6, // OVERLAY_TIBERIUM6 577 &Tiberium7, // OVERLAY_TIBERIUM7 578 &Tiberium8, // OVERLAY_TIBERIUM8 579 &Tiberium9, // OVERLAY_TIBERIUM9 580 &Tiberium10, // OVERLAY_TIBERIUM10 581 &Tiberium11, // OVERLAY_TIBERIUM11 582 &Tiberium12, // OVERLAY_TIBERIUM12 583 &Road, // OVERLAY_ROAD 584 &Squish, // OVERLAY_SQUISH 585 &V12, // OVERLAY_V12 586 &V13, // OVERLAY_V13 587 &V14, // OVERLAY_V14 588 &V15, // OVERLAY_V15 589 &V16, // OVERLAY_V16 590 &V17, // OVERLAY_V17 591 &V18, // OVERLAY_V18 592 &FlagSpot, // OVERLAY_FLAG_SPOT 593 &WoodCrate, // OVERLAY_WOOD_CRATE 594 &SteelCrate, // OVERLAY_STEEL_CRATE 595 }; 596 597 598 /*********************************************************************************************** 599 * OverlayTypeClass::OverlayTypeClass -- Constructor for overlay type objects. * 600 * * 601 * This is the constructor for the overlay types. * 602 * * 603 * INPUT: see below... * 604 * * 605 * OUTPUT: none * 606 * * 607 * WARNINGS: none * 608 * * 609 * HISTORY: * 610 * 07/29/1994 JLB : Created. * 611 *=============================================================================================*/ 612 OverlayTypeClass::OverlayTypeClass( 613 OverlayType iconset, 614 char const *ininame, 615 int fullname, 616 LandType ground, 617 int damagelevels, 618 int damagepoints, 619 bool isradarvisible, 620 bool iswooden, 621 bool istarget, 622 bool iscrushable, 623 bool istiberium, 624 bool high, 625 bool theater, 626 bool walltype, 627 bool iscrate) : 628 ObjectTypeClass(false, 629 false, 630 iscrushable, 631 true, 632 false, 633 istarget, 634 true, 635 false, 636 fullname, 637 ininame, 638 ARMOR_NONE, 639 0) 640 { 641 IsRadarVisible = isradarvisible; 642 IsCrate = iscrate; 643 IsWooden = iswooden; 644 IsHigh = high; 645 IsTheater = theater; 646 IsTiberium = istiberium; 647 Type = iconset; 648 Land = ground; 649 IsWall = walltype; 650 DamageLevels = damagelevels; 651 DamagePoints = damagepoints; 652 } 653 654 655 /*********************************************************************************************** 656 * OverlayTypeClass::One_Time -- Loads all the necessary general overlay shape data. * 657 * * 658 * This routine should be called once when the game first starts. It will establish * 659 * pointers to the graphic data of the overlay objects. * 660 * * 661 * INPUT: none * 662 * * 663 * OUTPUT: none * 664 * * 665 * WARNINGS: none * 666 * * 667 * HISTORY: * 668 * 08/12/1994 JLB : Created. * 669 *=============================================================================================*/ 670 void OverlayTypeClass::One_Time(void) 671 { 672 } 673 674 675 /*********************************************************************************************** 676 * OverlayTypeClass::From_Name -- Determine overlay from ASCII name. * 677 * * 678 * This routine is used to determine the overlay number given only * 679 * an ASCII representation. The scenario loader uses this routine * 680 * to construct the map from the INI control file. * 681 * * 682 * INPUT: name -- Pointer to the ASCII name of the overlay. * 683 * * 684 * OUTPUT: Returns with the overlay number. If the name had no match, * 685 * then returns with OVERLAY_NONE. * 686 * * 687 * WARNINGS: none * 688 * * 689 * HISTORY: * 690 * 05/23/1994 JLB : Created. * 691 *=============================================================================================*/ 692 OverlayType OverlayTypeClass::From_Name(char const *name) 693 { 694 if (name) { 695 for (OverlayType index = OVERLAY_FIRST; index < OVERLAY_COUNT; index++) { 696 if (stricmp(As_Reference(index).IniName, name) == 0) { 697 return(index); 698 } 699 } 700 } 701 return(OVERLAY_NONE); 702 } 703 704 705 /*********************************************************************************************** 706 * OverlayTypeClass::Occupy_List -- Determines occupation list. * 707 * * 708 * This routine is used to examine the overlay map and build an * 709 * occupation list. This list is used to render a overlay cursor as * 710 * well as placement of icon numbers. * 711 * * 712 * INPUT: placement -- Is this for placement legality checking only? The normal condition * 713 * is for marking occupation flags. * 714 * * 715 * OUTPUT: Returns with a pointer to the overlay occupation list. * 716 * * 717 * WARNINGS: The return pointer is valid only until the next time that * 718 * this routine is called. * 719 * * 720 * HISTORY: * 721 * 05/23/1994 JLB : Created. * 722 *=============================================================================================*/ 723 short const * OverlayTypeClass::Occupy_List(bool) const 724 { 725 static short _simple[] = {0, REFRESH_EOL}; 726 727 return(_simple); 728 } 729 730 731 /*************************************************************************** 732 * OverlayTypeClass::Radar_Icon -- Gets a pointer to the radar icons * 733 * * 734 * * 735 * INPUT: * 736 * * 737 * OUTPUT: * 738 * * 739 * WARNINGS: * 740 * * 741 * HISTORY: * 742 * 04/19/1995 PWG : Created. * 743 *=========================================================================*/ 744 unsigned char * OverlayTypeClass::Radar_Icon(int data) const 745 { 746 unsigned char *icon = (unsigned char *)Get_Radar_Data(); // Get pointer to radar icons 747 icon += (data * 9) + 2; // move icon ptr to correct icon 748 return(icon); // Return the correct icon 749 } 750 751 752 #ifdef SCENARIO_EDITOR 753 /*********************************************************************************************** 754 * OverlayTypeClass::Display -- Displays a generic representation of overlay. * 755 * * 756 * This routine is used to display a generic view of the overlay * 757 * object. This is necessary for selection in the scenario editor. * 758 * * 759 * INPUT: x,y -- The coordinates to center the display about. * 760 * * 761 * window-- The window to base the coordinates upon. * 762 * * 763 * OUTPUT: none * 764 * * 765 * WARNINGS: none * 766 * * 767 * HISTORY: * 768 * 05/23/1994 JLB : Created. * 769 *=============================================================================================*/ 770 void OverlayTypeClass::Display(int x, int y, WindowNumberType window, HousesType ) const 771 { 772 /* 773 ---------------------------- Draw the shape ------------------------------ 774 */ 775 if (Get_Image_Data()) { 776 int frame = 0; 777 778 if (IsTiberium) { 779 frame = 7; 780 } 781 782 CC_Draw_Shape(Get_Image_Data(), frame, x, y, window, SHAPE_NORMAL|SHAPE_CENTER|SHAPE_WIN_REL); 783 } 784 } 785 786 787 /*********************************************************************************************** 788 * OverlayTypeClass::Prep_For_Add -- Prepares to add overlay to scenario. * 789 * * 790 * This routine prepares a list of overlay objects so that the * 791 * scenario editor can use this list to display a dialog box. The * 792 * selection of a overlay object will allow its placement upon the * 793 * map. * 794 * * 795 * INPUT: none * 796 * * 797 * OUTPUT: none * 798 * * 799 * WARNINGS: none * 800 * * 801 * HISTORY: * 802 * 08/06/1994 JLB : Created * 803 *=============================================================================================*/ 804 void OverlayTypeClass::Prep_For_Add(void) 805 { 806 for (OverlayType index = OVERLAY_FIRST; index < OVERLAY_COUNT; index++) { 807 OverlayTypeClass const & overlay = As_Reference(index); 808 if (overlay.Get_Image_Data() && !overlay.IsWall && (!overlay.IsTiberium || index == OVERLAY_TIBERIUM1)) { 809 Map.Add_To_List(&overlay); 810 } 811 } 812 } 813 #endif 814 815 816 /*********************************************************************************************** 817 * OverlayTypeClass::Create_And_Place -- Creates and places a overlay object on the map. * 818 * * 819 * This support routine is used by the scenario editor to add a overlay object to the map * 820 * and to the game. * 821 * * 822 * INPUT: cell -- The cell to place the overlay object. * 823 * * 824 * OUTPUT: bool; Was the overlay object placed successfully? * 825 * * 826 * WARNINGS: none * 827 * * 828 * HISTORY: * 829 * 05/28/1994 JLB : Created. * 830 *=============================================================================================*/ 831 bool OverlayTypeClass::Create_And_Place(CELL cell, HousesType ) const 832 { 833 if (new OverlayClass(Type, cell)) { 834 return(true); 835 } 836 return(false); 837 } 838 839 840 /*********************************************************************************************** 841 * OverlayTypeClass::Create_One_Of -- Creates an object of this overlay type. * 842 * * 843 * This routine will create an object of this type. For certain overlay objects, such * 844 * as walls, it is actually created as a building. The "building" wall is converted into * 845 * a overlay at the moment of placing down on the map. * 846 * * 847 * INPUT: none * 848 * * 849 * OUTPUT: Returns with a pointer to the appropriate object for this overlay type. * 850 * * 851 * WARNINGS: none * 852 * * 853 * HISTORY: * 854 * 06/18/1994 JLB : Created. * 855 *=============================================================================================*/ 856 ObjectClass * OverlayTypeClass::Create_One_Of(HouseClass *) const 857 { 858 return(new OverlayClass(Type, -1)); 859 } 860 861 862 /*********************************************************************************************** 863 * OverlayTypeClass::Draw_It -- Draws the overlay image at location specified. * 864 * * 865 * This routine will draw the overlay shape at the coordinates specified. It is presumed * 866 * that all the underlying layers have already been rendered by the time this routine is * 867 * called. * 868 * * 869 * INPUT: x, y -- Coordinate (upper left) of cell where overlay image is to be drawn. * 870 * * 871 * data -- Cell specific data that controls the imagery of the overlay. * 872 * * 873 * OUTPUT: none * 874 * * 875 * WARNINGS: none * 876 * * 877 * HISTORY: * 878 * 08/12/1994 JLB : Created. * 879 *=============================================================================================*/ 880 void OverlayTypeClass::Draw_It(int x, int y, int data) const 881 { 882 CC_Draw_Shape(Get_Image_Data(), data, Map.TacPixelX+x+(CELL_PIXEL_W>>1), Map.TacPixelY+y+(CELL_PIXEL_H>>1), WINDOW_MAIN, SHAPE_CENTER|SHAPE_WIN_REL|SHAPE_GHOST, NULL, Map.UnitShadow); 883 } 884 885 886 /*********************************************************************************************** 887 * OverlayTypeClass::Init -- Initialize the overlay graphic data per theater. * 888 * * 889 * This routine will update the overlay graphic data according to the theater specified. * 890 * It is typically called when the scenario is first loaded (theater change). * 891 * * 892 * INPUT: theater -- The theater to load specific data for. * 893 * * 894 * OUTPUT: none * 895 * * 896 * WARNINGS: none * 897 * * 898 * HISTORY: * 899 * 09/01/1994 JLB : Created. * 900 * 4/25/1996 ST : Modified to load theater specific sidebar icons if available * 901 *=============================================================================================*/ 902 void OverlayTypeClass::Init(TheaterType theater) 903 { 904 if (theater != LastTheater){ 905 for (OverlayType index = OVERLAY_FIRST; index < OVERLAY_COUNT; index++) { 906 OverlayTypeClass const & overlay = As_Reference(index); 907 char fullname[_MAX_FNAME+_MAX_EXT]; // Fully constructed iconset name. 908 909 if (overlay.IsTheater) { 910 _makepath(fullname, NULL, NULL, overlay.IniName, Theaters[theater].Suffix); 911 } else { 912 _makepath(fullname, NULL, NULL, overlay.IniName, ".SHP"); 913 } 914 ((void const *&)overlay.ImageData) = MixFileClass::Retrieve(fullname); 915 916 IsTheaterShape = overlay.IsTheater; 917 if (overlay.RadarIcon) delete[] (char *)overlay.RadarIcon; 918 ((void const *&)overlay.RadarIcon) = Get_Radar_Icon(overlay.Get_Image_Data(), 0, -1, 3); 919 IsTheaterShape = false; 920 } 921 } 922 }