diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2010-05-29 08:12:39 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2010-05-29 08:12:39 +0000 |
commit | 9c6e217f29bb0a76ec153574a3d493b020e5fb60 (patch) | |
tree | b38acde6c091b7f8b0e3205645f9d232f19eeabb /apps/plugins/doom/p_spec.h | |
parent | 6980c1e9988a7c959876ad77b760e042272a9ec2 (diff) | |
download | rockbox-9c6e217f29bb0a76ec153574a3d493b020e5fb60.tar.gz rockbox-9c6e217f29bb0a76ec153574a3d493b020e5fb60.zip |
Doom plugin: In anticipation of moving to the EABI toolchain, because of its assumptions about enums being sized as ints, convert enum typdefs to int or unsigned depending upon whether they have negative values in the enumeration. This should effectively preserve the manner in which it is compiled under the old toolchain and avoids having to closely inspect and possibly change many places in the code.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26368 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/doom/p_spec.h')
-rw-r--r-- | apps/plugins/doom/p_spec.h | 143 |
1 files changed, 84 insertions, 59 deletions
diff --git a/apps/plugins/doom/p_spec.h b/apps/plugins/doom/p_spec.h index 426e7db50d..7ab787c7d8 100644 --- a/apps/plugins/doom/p_spec.h +++ b/apps/plugins/doom/p_spec.h | |||
@@ -193,7 +193,7 @@ | |||
193 | 193 | ||
194 | // define names for the TriggerType field of the general linedefs | 194 | // define names for the TriggerType field of the general linedefs |
195 | 195 | ||
196 | typedef enum | 196 | enum |
197 | { | 197 | { |
198 | WalkOnce, | 198 | WalkOnce, |
199 | WalkMany, | 199 | WalkMany, |
@@ -203,21 +203,23 @@ typedef enum | |||
203 | GunMany, | 203 | GunMany, |
204 | PushOnce, | 204 | PushOnce, |
205 | PushMany, | 205 | PushMany, |
206 | } triggertype_e; | 206 | }; |
207 | typedef unsigned triggertype_e; | ||
207 | 208 | ||
208 | // define names for the Speed field of the general linedefs | 209 | // define names for the Speed field of the general linedefs |
209 | 210 | ||
210 | typedef enum | 211 | enum |
211 | { | 212 | { |
212 | SpeedSlow, | 213 | SpeedSlow, |
213 | SpeedNormal, | 214 | SpeedNormal, |
214 | SpeedFast, | 215 | SpeedFast, |
215 | SpeedTurbo, | 216 | SpeedTurbo, |
216 | } motionspeed_e; | 217 | }; |
218 | typedef unsigned motionspeed_e; | ||
217 | 219 | ||
218 | // define names for the Target field of the general floor | 220 | // define names for the Target field of the general floor |
219 | 221 | ||
220 | typedef enum | 222 | enum |
221 | { | 223 | { |
222 | FtoHnF, | 224 | FtoHnF, |
223 | FtoLnF, | 225 | FtoLnF, |
@@ -227,29 +229,32 @@ typedef enum | |||
227 | FbyST, | 229 | FbyST, |
228 | Fby24, | 230 | Fby24, |
229 | Fby32, | 231 | Fby32, |
230 | } floortarget_e; | 232 | }; |
233 | typedef unsigned floortarget_e; | ||
231 | 234 | ||
232 | // define names for the Changer Type field of the general floor | 235 | // define names for the Changer Type field of the general floor |
233 | 236 | ||
234 | typedef enum | 237 | enum |
235 | { | 238 | { |
236 | FNoChg, | 239 | FNoChg, |
237 | FChgZero, | 240 | FChgZero, |
238 | FChgTxt, | 241 | FChgTxt, |
239 | FChgTyp, | 242 | FChgTyp, |
240 | } floorchange_e; | 243 | }; |
244 | typedef unsigned floorchange_e; | ||
241 | 245 | ||
242 | // define names for the Change Model field of the general floor | 246 | // define names for the Change Model field of the general floor |
243 | 247 | ||
244 | typedef enum | 248 | enum |
245 | { | 249 | { |
246 | FTriggerModel, | 250 | FTriggerModel, |
247 | FNumericModel, | 251 | FNumericModel, |
248 | } floormodel_t; | 252 | }; |
253 | typedef unsigned floormodel_t; | ||
249 | 254 | ||
250 | // define names for the Target field of the general ceiling | 255 | // define names for the Target field of the general ceiling |
251 | 256 | ||
252 | typedef enum | 257 | enum |
253 | { | 258 | { |
254 | CtoHnC, | 259 | CtoHnC, |
255 | CtoLnC, | 260 | CtoLnC, |
@@ -259,49 +264,54 @@ typedef enum | |||
259 | CbyST, | 264 | CbyST, |
260 | Cby24, | 265 | Cby24, |
261 | Cby32, | 266 | Cby32, |
262 | } ceilingtarget_e; | 267 | }; |
268 | typedef unsigned ceilingtarget_e; | ||
263 | 269 | ||
264 | // define names for the Changer Type field of the general ceiling | 270 | // define names for the Changer Type field of the general ceiling |
265 | 271 | ||
266 | typedef enum | 272 | enum |
267 | { | 273 | { |
268 | CNoChg, | 274 | CNoChg, |
269 | CChgZero, | 275 | CChgZero, |
270 | CChgTxt, | 276 | CChgTxt, |
271 | CChgTyp, | 277 | CChgTyp, |
272 | } ceilingchange_e; | 278 | }; |
279 | typedef unsigned ceilingchange_e; | ||
273 | 280 | ||
274 | // define names for the Change Model field of the general ceiling | 281 | // define names for the Change Model field of the general ceiling |
275 | 282 | ||
276 | typedef enum | 283 | enum |
277 | { | 284 | { |
278 | CTriggerModel, | 285 | CTriggerModel, |
279 | CNumericModel, | 286 | CNumericModel, |
280 | } ceilingmodel_t; | 287 | }; |
288 | typedef unsigned ceilingmodel_t; | ||
281 | 289 | ||
282 | // define names for the Target field of the general lift | 290 | // define names for the Target field of the general lift |
283 | 291 | ||
284 | typedef enum | 292 | enum |
285 | { | 293 | { |
286 | F2LnF, | 294 | F2LnF, |
287 | F2NnF, | 295 | F2NnF, |
288 | F2LnC, | 296 | F2LnC, |
289 | LnF2HnF, | 297 | LnF2HnF, |
290 | } lifttarget_e; | 298 | }; |
299 | typedef unsigned lifttarget_e; | ||
291 | 300 | ||
292 | // define names for the door Kind field of the general ceiling | 301 | // define names for the door Kind field of the general ceiling |
293 | 302 | ||
294 | typedef enum | 303 | enum |
295 | { | 304 | { |
296 | OdCDoor, | 305 | OdCDoor, |
297 | ODoor, | 306 | ODoor, |
298 | CdODoor, | 307 | CdODoor, |
299 | CDoor, | 308 | CDoor, |
300 | } doorkind_e; | 309 | }; |
310 | typedef unsigned intdoorkind_e; | ||
301 | 311 | ||
302 | // define names for the locked door Kind field of the general ceiling | 312 | // define names for the locked door Kind field of the general ceiling |
303 | 313 | ||
304 | typedef enum | 314 | enum |
305 | { | 315 | { |
306 | AnyKey, | 316 | AnyKey, |
307 | RCard, | 317 | RCard, |
@@ -311,7 +321,8 @@ typedef enum | |||
311 | BSkull, | 321 | BSkull, |
312 | YSkull, | 322 | YSkull, |
313 | AllKeys, | 323 | AllKeys, |
314 | } keykind_e; | 324 | }; |
325 | typedef unsigned keykind_e; | ||
315 | 326 | ||
316 | ////////////////////////////////////////////////////////////////// | 327 | ////////////////////////////////////////////////////////////////// |
317 | // | 328 | // |
@@ -321,31 +332,34 @@ typedef enum | |||
321 | 332 | ||
322 | //jff 2/23/98 identify the special classes that can share sectors | 333 | //jff 2/23/98 identify the special classes that can share sectors |
323 | 334 | ||
324 | typedef enum | 335 | enum |
325 | { | 336 | { |
326 | floor_special, | 337 | floor_special, |
327 | ceiling_special, | 338 | ceiling_special, |
328 | lighting_special, | 339 | lighting_special, |
329 | } special_e; | 340 | }; |
341 | typedef unsigned special_e; | ||
330 | 342 | ||
331 | //jff 3/15/98 pure texture/type change for better generalized support | 343 | //jff 3/15/98 pure texture/type change for better generalized support |
332 | typedef enum | 344 | enum |
333 | { | 345 | { |
334 | trigChangeOnly, | 346 | trigChangeOnly, |
335 | numChangeOnly, | 347 | numChangeOnly, |
336 | } change_e; | 348 | }; |
349 | typedef unsigned change_e; | ||
337 | 350 | ||
338 | // p_plats | 351 | // p_plats |
339 | 352 | ||
340 | typedef enum | 353 | enum |
341 | { | 354 | { |
342 | up, | 355 | up, |
343 | down, | 356 | down, |
344 | waiting, | 357 | waiting, |
345 | in_stasis | 358 | in_stasis |
346 | } plat_e; | 359 | }; |
360 | typedef unsigned plat_e; | ||
347 | 361 | ||
348 | typedef enum | 362 | enum |
349 | { | 363 | { |
350 | perpetualRaise, | 364 | perpetualRaise, |
351 | downWaitUpStay, | 365 | downWaitUpStay, |
@@ -356,11 +370,12 @@ typedef enum | |||
356 | genPerpetual, | 370 | genPerpetual, |
357 | toggleUpDn, //jff 3/14/98 added to support instant toggle type | 371 | toggleUpDn, //jff 3/14/98 added to support instant toggle type |
358 | 372 | ||
359 | } plattype_e; | 373 | }; |
374 | typedef unsigned plattype_e; | ||
360 | 375 | ||
361 | // p_doors | 376 | // p_doors |
362 | 377 | ||
363 | typedef enum | 378 | enum |
364 | { | 379 | { |
365 | normal, | 380 | normal, |
366 | close30ThenOpen, | 381 | close30ThenOpen, |
@@ -380,11 +395,12 @@ typedef enum | |||
380 | genBlazeClose, | 395 | genBlazeClose, |
381 | genCdO, | 396 | genCdO, |
382 | genBlazeCdO, | 397 | genBlazeCdO, |
383 | } vldoor_e; | 398 | }; |
399 | typedef unsigned vldoor_e; | ||
384 | 400 | ||
385 | // p_ceilng | 401 | // p_ceilng |
386 | 402 | ||
387 | typedef enum | 403 | enum |
388 | { | 404 | { |
389 | lowerToFloor, | 405 | lowerToFloor, |
390 | raiseToHighest, | 406 | raiseToHighest, |
@@ -405,11 +421,12 @@ typedef enum | |||
405 | genCrusher, | 421 | genCrusher, |
406 | genSilentCrusher, | 422 | genSilentCrusher, |
407 | 423 | ||
408 | } ceiling_e; | 424 | }; |
425 | typedef unsigned ceiling_e; | ||
409 | 426 | ||
410 | // p_floor | 427 | // p_floor |
411 | 428 | ||
412 | typedef enum | 429 | enum |
413 | { | 430 | { |
414 | // lower floor to highest surrounding floor | 431 | // lower floor to highest surrounding floor |
415 | lowerFloor, | 432 | lowerFloor, |
@@ -464,21 +481,24 @@ typedef enum | |||
464 | //new types for stair builders | 481 | //new types for stair builders |
465 | buildStair, | 482 | buildStair, |
466 | genBuildStair, | 483 | genBuildStair, |
467 | } floor_e; | 484 | }; |
485 | typedef unsigned floor_e; | ||
468 | 486 | ||
469 | typedef enum | 487 | enum |
470 | { | 488 | { |
471 | build8, // slowly build by 8 | 489 | build8, // slowly build by 8 |
472 | turbo16 // quickly build by 16 | 490 | turbo16 // quickly build by 16 |
473 | 491 | ||
474 | } stair_e; | 492 | }; |
493 | typedef unsigned stair_e; | ||
475 | 494 | ||
476 | typedef enum | 495 | enum |
477 | { | 496 | { |
478 | elevateUp, | 497 | elevateUp, |
479 | elevateDown, | 498 | elevateDown, |
480 | elevateCurrent, | 499 | elevateCurrent, |
481 | } elevator_e; | 500 | }; |
501 | typedef unsigned elevator_e; | ||
482 | 502 | ||
483 | ////////////////////////////////////////////////////////////////// | 503 | ////////////////////////////////////////////////////////////////// |
484 | // | 504 | // |
@@ -487,21 +507,23 @@ typedef enum | |||
487 | ////////////////////////////////////////////////////////////////// | 507 | ////////////////////////////////////////////////////////////////// |
488 | 508 | ||
489 | // texture type enum | 509 | // texture type enum |
490 | typedef enum | 510 | enum |
491 | { | 511 | { |
492 | top, | 512 | top, |
493 | middle, | 513 | middle, |
494 | bottom | 514 | bottom |
495 | 515 | ||
496 | } bwhere_e; | 516 | }; |
517 | typedef unsigned bwhere_e; | ||
497 | 518 | ||
498 | // crush check returns | 519 | // crush check returns |
499 | typedef enum | 520 | enum |
500 | { | 521 | { |
501 | ok, | 522 | ok, |
502 | crushed, | 523 | crushed, |
503 | pastdest | 524 | pastdest |
504 | } result_e; | 525 | }; |
526 | typedef unsigned result_e; | ||
505 | 527 | ||
506 | ////////////////////////////////////////////////////////////////// | 528 | ////////////////////////////////////////////////////////////////// |
507 | // | 529 | // |
@@ -700,6 +722,14 @@ typedef struct | |||
700 | // p_spec | 722 | // p_spec |
701 | 723 | ||
702 | // killough 3/7/98: Add generalized scroll effects | 724 | // killough 3/7/98: Add generalized scroll effects |
725 | enum | ||
726 | { | ||
727 | sc_side, | ||
728 | sc_floor, | ||
729 | sc_ceiling, | ||
730 | sc_carry, | ||
731 | sc_carry_ceiling, // killough 4/11/98: carry objects hanging on ceilings | ||
732 | }; /* type */ | ||
703 | 733 | ||
704 | typedef struct { | 734 | typedef struct { |
705 | thinker_t thinker; // Thinker structure for scrolling | 735 | thinker_t thinker; // Thinker structure for scrolling |
@@ -709,14 +739,7 @@ typedef struct { | |||
709 | fixed_t last_height; // Last known height of control sector | 739 | fixed_t last_height; // Last known height of control sector |
710 | fixed_t vdx, vdy; // Accumulated velocity if accelerative | 740 | fixed_t vdx, vdy; // Accumulated velocity if accelerative |
711 | int accel; // Whether it's accelerative | 741 | int accel; // Whether it's accelerative |
712 | enum | 742 | unsigned type; // Type of scroll effect |
713 | { | ||
714 | sc_side, | ||
715 | sc_floor, | ||
716 | sc_ceiling, | ||
717 | sc_carry, | ||
718 | sc_carry_ceiling, // killough 4/11/98: carry objects hanging on ceilings | ||
719 | } type; // Type of scroll effect | ||
720 | } scroll_t; | 743 | } scroll_t; |
721 | 744 | ||
722 | // phares 3/12/98: added new model of friction for ice/sludge effects | 745 | // phares 3/12/98: added new model of friction for ice/sludge effects |
@@ -730,15 +753,17 @@ typedef struct { | |||
730 | 753 | ||
731 | // phares 3/20/98: added new model of Pushers for push/pull effects | 754 | // phares 3/20/98: added new model of Pushers for push/pull effects |
732 | 755 | ||
756 | enum | ||
757 | { | ||
758 | p_push, | ||
759 | p_pull, | ||
760 | p_wind, | ||
761 | p_current, | ||
762 | }; /* type */ | ||
763 | |||
733 | typedef struct { | 764 | typedef struct { |
734 | thinker_t thinker; // Thinker structure for Pusher | 765 | thinker_t thinker; // Thinker structure for Pusher |
735 | enum | 766 | unsigned type; |
736 | { | ||
737 | p_push, | ||
738 | p_pull, | ||
739 | p_wind, | ||
740 | p_current, | ||
741 | } type; | ||
742 | mobj_t* source; // Point source if point pusher | 767 | mobj_t* source; // Point source if point pusher |
743 | int x_mag; // X Strength | 768 | int x_mag; // X Strength |
744 | int y_mag; // Y Strength | 769 | int y_mag; // Y Strength |