ODATA.CPP 47 KB

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