22#if !defined(SCUMM_INSANE_REBEL2_H) && defined(ENABLE_SCUMM_7_8)
23#define SCUMM_INSANE_REBEL2_H
25#include "scumm/nut_renderer.h"
27#include "scumm/smush/smush_player.h"
29#include "scumm/insane/insane.h"
30#include "scumm/insane/rebel/rebel_audio.h"
31#include "scumm/insane/rebel/rebel_gamepad.h"
32#include "scumm/insane/rebel/rebel_touch.h"
33#include "scumm/insane/rebel2/releases.h"
35#include "common/keyboard.h"
36#include "common/list.h"
37#include "common/rect.h"
38#include "common/events.h"
39#include "common/queue.h"
41#include "audio/audiostream.h"
42#include "audio/mixer.h"
44#include "graphics/surface.h"
47class QueuingAudioStream;
56 InsaneRebel2(ScummEngine_v7 *scumm);
59 const Rebel2Release _release;
64 bool _menuInputActive;
65 bool _virtualKeyboardActive;
71 kStatePilotSelect = 2,
72 kStateChapterSelect = 3,
77 kStateDifficultySelect = 7,
91 int _menuInactivityTimer;
92 bool _menuInactivityTimedOut;
95 bool _menuSelectionConfirmed;
96 bool _levelUnlocked[16];
99 int processMenuInput();
104 static int parseFormatCode(
const char *&str,
int &outColor);
106 int getMenuStringWidth(
const char *str)
const;
107 void drawMenuString(
byte *renderBitmap,
const char *str,
int x,
int y,
int defaultColor = 1);
108 void drawMenuStringCentered(
byte *renderBitmap,
const char *str,
int cx,
int y,
int defaultColor = 1);
109 void drawMenuStringRight(
byte *renderBitmap,
const char *str,
int rx,
int y,
int defaultColor = 1);
111 void drawMenuItems(
byte *renderBitmap,
int pitch,
int width,
int height,
112 const char **items,
int numItems,
int selection,
113 bool leftAligned =
false);
114 void drawMenuOverlay(
byte *renderBitmap,
int pitch,
int width,
int height);
117 bool isMenuTextInputActive()
const;
118 void setVirtualKeyboardVisible(
bool visible);
119 void updateMenuVirtualKeyboard();
122 enum ChapterSelectResult {
123 kChapterSelectBack = 2,
124 kChapterSelectPlay = 5,
125 kChapterSelectQuit = 0
128 int _chapterSelection;
129 int _chapterItemCount;
130 int _selectedChapter;
132 bool _chapterUnlocked[16];
133 bool _debugUnlockAll;
136 void unlockAllChapters();
137 void updateChapterUnlocks();
138 int runChapterSelect();
139 void drawChapterSelectOverlay(
byte *renderBitmap,
int pitch,
int width,
int height);
140 int processChapterSelectInput();
141 void drawPreviewBox(
byte *renderBitmap,
int pitch,
int width,
int height);
143 int16 _previewOffsetX;
144 int16 _previewOffsetY;
146 void drawChapterInfoLine(
byte *renderBitmap,
int pitch,
int width,
int height);
147 void drawPilotInfoLines(
byte *renderBitmap);
152 static const int kMaxRankings = 15;
154 struct RankingEntry {
162 RankingEntry _rankings[kMaxRankings];
165 void initDefaultRankings();
166 void insertRanking(
const char *name, int32 score, int32 rating, int16 difficulty, int16 chapter);
167 void showTopPilots();
168 void drawTopPilotsOverlay(
byte *renderBitmap,
int pitch,
int width,
int height);
170 int _topPilotsFrameCount;
171 int _topPilotsMaxFrames;
174 void showOptionsMenu();
175 void drawOptionsOverlay(
byte *renderBitmap,
int pitch,
int width,
int height);
176 int processOptionsInput();
178 int _optionsSelection;
179 int _optionsItemCount;
180 bool _optionsExitRequested;
181 bool _optMusicEnabled;
183 bool _optVoicesEnabled;
184 bool _optTextEnabled;
185 bool _optControlsFlipped;
190 static const int kMaxPilots = 10;
191 static const int kMaxPilotNameLen = 15;
192 static const int kNumLevels = 16;
195 char name[kMaxPilotNameLen + 1];
196 int32 score[kNumLevels];
197 int32 lives[kNumLevels];
198 int32 damage[kNumLevels];
199 int16 rating[kNumLevels];
202 void init(
int firstLevel = 1,
int initialLives = 4) {
203 memset(name, 0,
sizeof(name));
204 memset(rating, 0,
sizeof(rating));
206 for (
int i = 0; i < kNumLevels; i++) {
211 if (firstLevel >= 1 && firstLevel <= kNumLevels) {
212 lives[firstLevel - 1] = initialLives;
213 damage[firstLevel - 1] = 0;
218 PilotData _pilots[kMaxPilots];
225 int createNewPilot();
226 void deletePilot(
int index);
227 void copyPilot(
int srcIndex);
229 void updatePilotProgress(
int levelIndex, int32 score, int32 lives, int32 damage, int32 rating);
232 bool selectPilot(
int index);
235 Common::Error loadGameState(
int slot,
bool startupLoad =
false);
236 bool _pilotLoadRequested;
238 enum LevelSelectResult {
239 kLevelSelectBack = 0,
240 kLevelSelectPlay = 1,
245 kPilotModeSelect = 0,
246 kPilotModeNameInput = 1,
247 kPilotModeDifficulty = 2,
248 kPilotModeCopySelect = 3,
249 kPilotModeDeleteSelect = 4
251 PilotMenuMode _pilotMenuMode;
258 int _difficultySelection;
260 int runLevelSelect();
261 void drawLevelSelectOverlay(
byte *renderBitmap,
int pitch,
int width,
int height);
262 int processLevelSelectInput();
270 kLevelReturnToMenu = 4
274 void playIntroSequence();
275 void playMissionBriefing();
276 int runLevel(
int levelId);
277 void playLevelBegin(
int levelId);
278 void playLevelEnd(
int levelId);
279 void playLevelEnd(
int levelId,
int accuracy,
int flightErrors,
bool skillBonus);
280 void playLevelRetry(
int levelId);
281 void playLevelGameOver(
int levelId);
282 void playEndingSequence();
283 void playCreditsSequence();
307 struct WaveEndResult {
308 WaveEndResult() : creditedBits(0), died(false), quit(false), completed(false), skipped(false) {}
310 bool shouldStop()
const {
return died || quit || completed || skipped; }
319 WaveEndResult processWaveEnd(int16 mask, int16 *budget, int16 threshold, uint16 flags);
322 bool playLevelSegment(
const char *filename, uint16 flags,
bool recordFrame =
true);
323 void enableIOSGamepadController();
324 void restoreIOSGamepadController();
326 int calculateAccuracy(
int kills,
int misses)
const;
328 bool handleLevelDeath(
int levelId,
int phase,
const char *deathVideo,
const char *retryVideo,
int &levelResult);
329 void resetLevelAttemptState(
int initialPhase);
330 void resetLevelPhaseState(
bool clearEnemies);
331 void clearEmbeddedHudFrames();
332 void resetLevelWaveState();
333 void resetExplosions();
334 void resetHandler7FlightState();
336 int getRandomVariant(
int max);
337 Common::String selectDeathVideoVariant(
int levelId,
int phase,
int frame);
338 void playCinematic(
const char *filename, int16 flags = 0x28);
341 void playVideoWithText(
const char *filename,
int textID,
int textX,
int textY,
342 int fadeInFrame,
int fadeOutFrame);
344 bool _textOverlayActive;
348 int _textOverlayFadeIn;
349 int _textOverlayFadeOut;
351 void renderTextOverlay(
byte *renderBitmap,
int pitch,
int width,
int height,
int curFrame);
352 void renderLevelEndStatsOverlay(
byte *renderBitmap,
int pitch,
int width,
int height, int32 curFrame, int32 maxFrame);
353 void drawLevelEndTextBlock(
byte *renderBitmap,
const char *text,
int centerX,
int y);
354 void prepareLevelEndStats(
int levelId,
int accuracy,
int flightErrors,
bool skillBonus);
355 int calculateLevelEndRating(
int accuracy,
int accLow,
int accHigh,
int flightErrors,
int errLow,
int errHigh,
bool skillBonus)
const;
357 struct LevelEndStatsOverlay {
362 int titleStartBeforeEnd;
363 int titleEndBeforeEnd;
365 bool hasFlightErrors;
374 LevelEndStatsOverlay _levelEndStats;
375 void playLevelDeathVariant(
int levelId,
int phase,
int frame);
376 void playLevelRetryVariant(
int levelId,
int phase);
378 void centerGameplayAim();
379 bool _gameplaySectionActive;
380 RebelIOSGamepadControllerState _iosGamepadControllerState;
381 RebelTouchTapDetector _touchTapDetector;
385 int _rebelDeathCause;
386 bool _skipSectionRequested;
389 NutRenderer *_smush_cockpitNut;
390 NutRenderer *_rebelMsgFont;
392 NutRenderer *_smush_talkfontNut;
393 NutRenderer *_smush_smalfontNut;
394 NutRenderer *_smush_titlefontNut;
395 NutRenderer *_smush_povfontNut;
397 byte _savedPausePalette[768];
399 bool _pauseOverlayActive;
401 bool _introCursorPushed;
404 int32 processMouse()
override;
405 bool isTouchscreenActive()
const;
406 bool isSkippableVideoState()
const;
410 void resetMenuGamepadAxis();
412 bool handleMenuRawJoystickAxisEvent(
const Common::Event &event);
413 void updateMenuGamepadAxisKey(int16 oldAxisX, int16 oldAxisY);
414 void queueMenuGamepadAxisKey(Common::KeyCode keycode);
415 void updateGameplayAimFromGamepad();
416 void warpGameplayMouseNow(
int x,
int y);
418 int16 _joystickAxisX;
419 int16 _joystickAxisY;
421 bool _gamepadAimActive;
422 uint32 _gameplayMouseSettleUntil;
423 uint32 _lastGameplayMenuCloseTime;
424 uint32 _lastMenuGamepadNavigationTime;
425 int16 _menuGamepadAxisX;
426 int16 _menuGamepadAxisY;
427 int _menuGamepadRawAxis;
428 int16 _menuGamepadRawAxisX;
429 int16 _menuGamepadRawAxisY;
430 void openGameplayMainMenu(SmushPlayer *splayer);
431 void openMenuMainMenu(SmushPlayer *splayer);
432 bool isBitSet(
int n)
override;
433 void setBit(
int n)
override;
435 int getHandler()
const {
return _rebelHandler; }
436 int getHandler25GrdSpriteMode()
const {
return _grdSpriteMode; }
437 bool isHiRes()
const;
439 void iactRebel2Scene1(
byte *renderBitmap, int32 codecparam, int32 setupsan12,
441 int16 par1, int16 par2, int16 par3, int16 par4);
445 void iactRebel2Opcode6(
byte *renderBitmap,
Common::SeekableReadStream &b, int32 chunkSize, int16 par2, int16 par3, int16 par4);
446 void updateOpcode6Handler(int16 par2);
451 void handleOpcode6GenericInit(int16 par4);
452 void updateOpcode6GenericFlightState();
454 void iactRebel2Opcode8(
byte *renderBitmap,
Common::SeekableReadStream &b, int32 chunkSize, int16 par2, int16 par3, int16 par4);
460 void loadOpcode8EmbeddedAnim(
byte *renderBitmap,
Common::SeekableReadStream &b, int64 startPos, int64 remaining, int16 par3, int16 par4);
461 bool handleOpcode8EmbeddedAnim(
byte *renderBitmap,
byte *animData, int32 animDataSize, int16 par3, int16 par4);
464 void procPostRendering(
byte *renderBitmap, int32 codecparam, int32 setupsan12,
465 int32 setupsan13, int32 curFrame, int32 maxFrame)
override;
467 void procIACT(
byte *renderBitmap, int32 codecparam, int32 setupsan12,
469 int16 par1, int16 par2, int16 par3, int16 par4)
override;
471 void renderStatusBarBackground(
byte *renderBitmap,
int pitch,
int width,
int height,
472 int videoWidth,
int videoHeight,
int statusBarY);
474 void updatePostRenderScroll(
int width,
int height);
475 void updatePostRenderDeath();
476 void renderPostRenderMenuCursor(
byte *renderBitmap,
int pitch,
int width,
int height);
477 bool handlePostRenderMenuModes(
byte *renderBitmap,
int pitch,
int width,
int height,
bool introPlaying);
478 bool handlePostRenderIntro(
byte *renderBitmap,
int pitch,
int width,
int height, int32 curFrame, int32 maxFrame);
479 void prepareHandler7Viewport(
byte *renderBitmap,
int pitch,
int width,
int height);
480 void renderGameplayPostFrame(
byte *renderBitmap,
int pitch,
int width,
int height,
481 int videoWidth,
int videoHeight,
int statusBarY, int32 curFrame);
482 void updateGameplayDamageEffects(
byte *renderBitmap,
int pitch,
int width,
int height);
483 void updateGameplayTimedTick(int32 curFrame);
484 void checkGameplayPostRenderCollisions(
byte *renderBitmap,
int pitch,
int width,
int height, int32 curFrame);
486 void renderTurretHudOverlays(
byte *renderBitmap,
int pitch,
int width,
int height, int32 curFrame);
487 void renderEmbeddedHudOverlays(
byte *renderBitmap,
int pitch,
int width,
int height);
488 void renderStatusBarSprites(
byte *renderBitmap,
int pitch,
int width,
int height,
489 int statusBarY, int32 curFrame);
491 void renderHandler7Ship(
byte *renderBitmap,
int pitch,
int width,
int height);
492 void renderHandler7FlySprite(
byte *renderBitmap,
int pitch,
int width,
int height,
493 bool renderHiRes,
int renderScale,
int nativeViewX,
int nativeViewY,
494 int nativeX,
int nativeY, NutRenderer *nut,
int spriteIndex);
496 void renderHandler8Ship(
byte *renderBitmap,
int pitch,
int width,
int height);
497 void renderVehicleShotImpacts(
byte *renderBitmap,
int pitch,
int width,
int height);
499 void renderFallbackShip(
byte *renderBitmap,
int pitch,
int width,
int height);
500 void renderEnemyOverlays(
byte *renderBitmap,
int pitch,
int width,
int height,
int videoWidth);
501 void renderExplosions(
byte *renderBitmap,
int pitch,
int width,
int height);
502 void renderLaserShots(
byte *renderBitmap,
int pitch,
int width,
int height);
503 void renderCrosshair(
byte *renderBitmap,
int pitch,
int width,
int height);
504 void renderHandler8MonitorEffect(
byte *renderBitmap,
int pitch,
int width,
int height);
505 void renderHandler8PovOverlay(
byte *renderBitmap,
int pitch,
int width,
int height);
506 Common::Point getHandler7ProjectedPointFor(int16 x, int16 y);
511 void frameEndCleanup();
517 bool loadTurretHudOverlay(
byte *animData, int32 size, int16 selector);
518 bool loadHandler8ShipSprites(
byte *animData, int32 size, int16 par4);
519 bool loadHandler25GrdSprites(
byte *animData, int32 size, int16 par4);
524 bool loadLevel2Background(
byte *animData, int32 size,
byte *renderBitmap);
527 void procPreRendering(
byte *renderBitmap)
override;
530 void drawTexturedLine(
byte *dst,
int pitch,
int width,
int height,
int x0,
int y0,
int x1,
int y1, NutRenderer *nut,
int spriteIdx,
int v,
bool mask231 =
true);
533 struct LaserTexture {
538 LaserTexture _laserTexture;
541 byte _edgeTable[256 * 256];
542 int16 _rebelDetailMode;
544 void initEdgeTable(
const byte *data);
546 void drawEdgeHighlightLine(
byte *dst,
int pitch,
int width,
int height,
547 int16 x0, int16 y0, int16 x1, int16 y1,
548 int16 clipLeft, int16 clipTop, int16 clipRight, int16 clipBottom);
550 void initLaserTexture(NutRenderer *nut,
int spriteIdx);
551 void freeLaserTexture();
553 void drawLaserBeam(
byte *dst,
int pitch,
int width,
int height,
554 int16 gunX, int16 gunY, int16 targetX, int16 targetY,
555 int16 animFrame, int16 maxFrames,
556 int16 widthScale, int16 heightScale, int16 thickness);
557 void renderNutSprite(
byte *dst,
int pitch,
int width,
int height,
int x,
int y, NutRenderer *nut,
int spriteIdx);
558 void renderNutSpriteMirrored(
byte *dst,
int pitch,
int width,
int height,
int x,
int y, NutRenderer *nut,
int spriteIdx,
bool mirror);
568 bool explosionComplete;
569 byte *savedBackground;
574 void initEnemyStruct(
int id, int32 x, int32 y, int32 w, int32 h,
bool active,
bool destroyed, int32 explosionFrame,
int type = 0);
577 Common::Point getTargetHitHalfExtents(
const enemy &target)
const;
578 bool isTargetUnderAim(
const enemy &target,
const Common::Point &aim)
const;
585 int _rebelStatusBarSprite;
588 struct EmbeddedSanFrame {
597 EmbeddedSanFrame _rebelEmbeddedHud[16];
598 byte _rebelEmbeddedCodec45Palette[0x300];
599 byte _rebelEmbeddedCodec45Lookup[0x8000];
601 void loadEmbeddedSan(
int userId,
byte *animData, int32 size,
byte *renderBitmap)
override;
602 void renderEmbeddedFrame(
byte *renderBitmap,
const EmbeddedSanFrame &frame,
int userId);
603 void drawHandler25CorridorOverlay(
byte *renderBitmap);
605 int16 _rebelLinks[512][3];
606 void clearBit(
int n);
607 bool isShootingAllowed();
618 enum ExplosionFrameAdvance {
619 kExplosionAdvanceAfterDraw,
620 kExplosionAdvanceBeforeDraw
623 Explosion _explosions[5];
624 void spawnExplosion(
int x,
int y,
int objectHalfWidth,
int dx = 0,
int dy = 0);
627 struct CollisionZone {
639 static const int kMaxCollisionZones = 5;
640 CollisionZone _primaryZones[kMaxCollisionZones];
641 CollisionZone _secondaryZones[kMaxCollisionZones];
642 int _primaryZoneCount;
643 int _secondaryZoneCount;
645 int16 _corridorLeftX;
647 int16 _corridorRightX;
648 int16 _corridorBottomY;
653 void resetCollisionZones();
654 void checkCollisionZones(
byte *renderBitmap,
int pitch,
int width,
int height, int32 curFrame);
657 void checkHandler7CollisionZones(
byte *renderBitmap,
int pitch,
int width,
int height, int32 curFrame);
658 bool isHandler7ShipInsideObstacleZone(
const CollisionZone &zone,
int margin);
659 void applyHandler7ObstacleHit(
const CollisionZone &zone,
int zoneIndex);
660 void awardHandler7DodgeScore();
661 void checkHandler7ObstacleZones(uint16 &warningMask);
662 bool applyPlayerDamage(
int damage);
663 bool applyHandler7WallDamage(
int wallDamage);
664 void resetHandler7HorizontalVelocity(int16 velocity);
665 void checkHandler7TopBoundary(
const CollisionZone &zone, int16 vMargin,
int wallDamage, uint16 &warningMask);
666 void checkHandler7BottomBoundary(
const CollisionZone &zone, int16 vMargin,
int wallDamage, uint16 &warningMask);
667 void checkHandler7LeftBoundary(
const CollisionZone &zone, int16 hMargin,
int wallDamage);
668 void checkHandler7RightBoundary(
const CollisionZone &zone, int16 hMargin,
int wallDamage);
669 void checkHandler7BoundaryZones(uint16 &warningMask);
670 void renderHandler7WarningCues(
byte *renderBitmap,
int pitch,
int width,
int height, int32 curFrame, uint16 warningMask);
671 void updateLevel7Fork(int32 curFrame);
672 void updateLevel15TypeSwitch(int32 curFrame);
673 void updateLevel9WaveReset(int32 curFrame);
683 int _hiResPresentationViewX;
684 int _hiResPresentationViewY;
685 int _gameplayPresentationClipBottom;
688 void triggerDamageEffect();
689 void initDamageFlash();
690 void updateDamageFlashPalette();
691 void updateDamageEffect(
byte *renderBitmap,
int pitch,
int width,
int height);
692 void resetDamageFlash();
693 void restoreDamageFlashPalette();
695 int16 _damageFlashCounter;
696 int16 _damageHighFlashCounter;
697 int16 _damageShakeCounter;
698 byte _damageSavedPalette[0x300];
699 byte _damageRestorePalette[0x300];
700 bool _damageRestorePaletteValid;
703 bool _rebelOp6Initialized;
704 int _rebelHitCounter;
705 int _rebelKillCounter;
707 bool _rebelMovieMode;
711 int _rebelPhaseState;
717 int _rebelDamageLevel;
719 int _rebelControlMode;
720 int _rebelInputThrottle;
722 int _rebelViewOffsetX;
723 int _rebelViewOffsetY;
724 int _rebelViewOffset2X;
725 int _rebelViewOffset2Y;
730 short _rebelValueCounters[10];
731 short _rebelGaugeBlink[10];
732 int _rebelLastCounter;
735 int16 _turretShakeRingX[15];
736 int16 _turretShakeRingY[15];
738 bool _rebelShieldGateActive;
739 bool _rebelShieldDestroyed;
740 bool _rebelReactorMode;
741 bool _rebelGaugeArmed;
742 int _rebelLastArmedSlot;
743 void resetGaugeCounters();
744 void resetShieldGauge();
745 void decrementGaugeGroup(
int slot,
int targetId);
756 TurretShot _turretShots[2];
757 int16 _turretShotSeqCounter;
764 VehicleShot _vehicleShots[2];
766 struct VehicleShotImpact {
772 VehicleShotImpact _vehicleShotImpacts[7];
773 int16 _vehicleShotImpactIndex;
785 SpaceShot _spaceShots[2];
786 int16 _spaceShotDirection;
787 int16 _flyLeftGunX[35];
788 int16 _flyLeftGunY[35];
789 int16 _flyRightGunX[35];
790 int16 _flyRightGunY[35];
791 bool _flyLeftGunTableLoaded;
792 bool _flyRightGunTableLoaded;
794 void spawnTurretShot(
int x,
int y);
795 void spawnVehicleShot(
int x,
int y);
796 void spawnSpaceShot(
int x,
int y);
797 void spawnHandler25Shot(
int x,
int y);
798 void spawnShot(
int x,
int y);
800 void renderExplosionFrame(
byte *renderBitmap,
int pitch,
int width,
int height,
801 Explosion &explosion,
int screenX,
int screenY, ExplosionFrameAdvance advance,
802 bool resolutionDependentScale);
803 void renderTurretExplosions(
byte *renderBitmap,
int pitch,
int width,
int height);
804 void renderVehicleExplosions(
byte *renderBitmap,
int pitch,
int width,
int height);
805 void renderSpaceExplosions(
byte *renderBitmap,
int pitch,
int width,
int height);
806 void renderHandler25Explosions(
byte *renderBitmap,
int pitch,
int width,
int height);
808 void renderTurretLaserShots(
byte *renderBitmap,
int pitch,
int width,
int height);
809 void renderVehicleLaserShots(
byte *renderBitmap,
int pitch,
int width,
int height);
810 void renderSpaceLaserShots(
byte *renderBitmap,
int pitch,
int width,
int height);
811 void renderHandler25LaserShots(
byte *renderBitmap,
int pitch,
int width,
int height);
813 int16 getShotMaxDuration();
816 NutRenderer *_shipSprite;
817 NutRenderer *_shipSprite2;
818 NutRenderer *_shipOverlay1;
819 NutRenderer *_shipOverlay2;
821 byte *_level2Background;
822 bool _level2BackgroundLoaded;
828 int16 _shipLevelMode;
829 char _handler8HudGlyph;
830 int16 _handler8HudMessageTimer;
831 int16 _handler8HudMessageIndex;
834 int16 _movementRangeLimit;
837 int16 _flyControlMode;
840 uint32 _prevMouseButtons;
843 int16 _rapidFireCounter;
845 int16 _shipDirectionIndex;
846 int16 _shipDirectionH;
847 int16 _shipDirectionV;
850 NutRenderer *_flyShipSprite;
851 NutRenderer *_flyLaserSprite;
852 NutRenderer *_flyTargetSprite;
853 NutRenderer *_flyHiResSprite;
854 int16 _flyEffectAnimCounter;
855 int16 _flyOverlayRepeatCount;
857 int16 _flyShipScreenX;
858 int16 _flyShipScreenY;
861 bool _level7ForkActive;
862 bool _level7TookRightFork;
864 int16 _smoothedVelocity;
865 int16 _verticalInput;
866 int16 _velocityHistory[25];
867 int16 _windHistoryX[15];
868 int16 _windHistoryY[15];
878 NutRenderer *_grd001Sprite;
879 NutRenderer *_grd002Sprite;
880 NutRenderer *_grd005Sprite;
882 int16 _grdShotOriginX[30];
883 int16 _grdShotOriginY[30];
884 bool _grdShotOriginTableLoaded;
886 int16 _grdSpriteMode;
888 void renderHandler25ShipPre(
byte *renderBitmap,
int pitch,
int width,
int height);
889 void renderHandler25Ship(
byte *renderBitmap,
int pitch,
int width,
int height);
892 NutRenderer *_hudOverlayNut;
893 NutRenderer *_hudOverlay2Nut;
898 typedef Rebel2DifficultyParams LevelDifficultyParams;
900 static const LevelDifficultyParams kDifficultyTable[6][17];
902 int getDifficultyRow()
const;
903 LevelDifficultyParams getDifficultyParams()
const;
904 int16 getWaveBudgetBase(
int phase)
const;
905 bool _level15SecondHalf;
907 void addScore(
int points);
908 void renderScoreHUD(
byte *renderBitmap,
int pitch,
int width,
int height,
int statusBarY);
910 void showPauseOverlay();
911 void hidePauseOverlay();
913 int _targetLockTimer;
918 void initAudio(
int sampleRate);
919 void terminateAudio();
920 void resetVideoAudio();
921 void processAudioFrame(int16 feedSize);
922 void queueAudioData(
int trackIdx, uint8 *data, int32 size,
int volume,
int pan);
925 static const int kRA2NumSfx = 8;
927 byte *_sfxData[kRA2NumSfx];
928 uint32 _sfxSize[kRA2NumSfx];
933 void playSfx(
int slot,
int volume,
int pan);
936 static const int kRA2NumAuxSfx = 4;
937 static const int kRA2AuxBufSize = 30000;
939 byte *_auxSfxData[kRA2NumAuxSfx];
940 uint32 _auxSfxSize[kRA2NumAuxSfx];
943 void loadAuxSfx(
int buffer,
const byte *data, uint32 size);
944 void playAuxSfx(
int buffer,
int volume,
int pan);