26 #include "common/events.h" 27 #include "common/scummsys.h" 28 #include "common/str-array.h" 29 #include "graphics/font.h" 33 class SaveFileManager;
48 struct DataFileHeader;
51 #define MAX_SAVE_GAMES 999 52 #define MAX_TEXT_LEN 80 53 #define PAN_LINE_WIDTH 184 54 #define PAN_CHAR_HEIGHT 12 55 #define STATUS_WIDTH 146 56 #define MPNL_X 60 // Main Panel 59 #define SPNL_X 20 // Save Panel 67 #define TEXT_FLAG_MASK (SF_ALLOW_SPEECH | SF_ALLOW_TEXT) 69 #define GAME_NAME_X (SPNL_X + 18) // x coordinate of game names 70 #define GAME_NAME_Y (SPNL_Y + SP_TOP_GAP) // start y coord of game names 71 #define MAX_ON_SCREEN ((SP_HEIGHT - SP_TOP_GAP - SP_BOT_GAP) / PAN_CHAR_HEIGHT) // no of save games on screen 72 #define CP_PANEL 60400 // main panel sprite 78 #define WITH_MASK true 82 #define REST_GAME_PANEL 1 83 #define SAVE_GAME_PANEL 2 85 #define RESTORE_A_GAME 4 87 #define SHIFT_DOWN_FAST 6 88 #define SHIFT_DOWN_SLOW 7 89 #define SHIFT_UP_FAST 8 90 #define SHIFT_UP_SLOW 9 91 #define SPEED_SLIDE 10 92 #define MUSIC_SLIDE 11 95 #define TOGGLE_TEXT 14 98 #define QUIT_TO_DOS 17 99 #define RESTORE_AUTO 18 102 #define CANCEL_PRESSED 100 103 #define NAME_TOO_SHORT 101 104 #define GAME_SAVED 102 107 #define RESTARTED 105 108 #define GAME_RESTORED 106 109 #define RESTORE_FAILED 107 110 #define NO_DISK_SPACE 108 111 #define SPEED_CHANGED 109 112 #define QUIT_PANEL 110 117 #define SPEED_MULTIPLY 12 124 #define SAVE_MEGA3 16 125 #define SAVE_GRAFX 32 126 #define SAVE_TURNP 64 128 #define SAVE_FILE_REVISION 6 129 #define OLD_SAVEGAME_TYPE 5 148 ConResource(
void *pSpData, uint32 pNSprites, uint32 pCurSprite, uint16 pX, uint16 pY, uint32 pText, uint8 pOnClick,
OSystem *system, uint8 *screen);
150 void setSprite(
void *pSpData) { _spriteData = (
DataFileHeader *)pSpData; }
151 void setText(uint32 pText) {
if (pText) _text = pText + 0x7000;
else _text = 0; }
152 void setXY(uint16 x, uint16 y) { _x = x; _y = y; }
153 bool isMouseOver(uint32 mouseX, uint32 mouseY);
154 virtual void drawToScreen(
bool doMask);
157 uint32 _numSprites, _curSprite;
168 TextResource(
void *pSpData, uint32 pNSprites, uint32 pCurSprite, uint16 pX, uint16 pY, uint32 pText, uint8 pOnClick,
OSystem *system, uint8 *screen);
170 void drawToScreen(
bool doMask)
override;
171 void flushForRedraw();
181 void setToText(
const char *newText);
182 void setToText(uint16 textNum);
194 Control(
SkyEngine *vm,
Common::SaveFileManager *saveFileMan,
Screen *screen,
Disk *disk,
Mouse *mouse,
Text *text,
MusicBase *music,
Logic *logic,
Sound *sound,
SkyCompact *skyCompact,
OSystem *system,
Common::Keymap *shortcutsKeymap);
195 void doControlPanel();
197 void doLoadSavePanel();
199 void showGameQuitMsg();
200 uint16 quickXRestore(uint16 slot);
201 bool loadSaveAllowed();
202 bool isControlPanelOpen();
205 void drawScrollButtons(
Graphics::Font *font,
Graphics::Surface &screen,
int destX,
int destY,
int newW,
int panelBottom,
int scrollOffset,
int contentBottom, uint32 colorGray,
Common::Rect &scrollUpRect,
Common::Rect &scrollDownRect);
209 uint16 _selectedGame;
210 uint16 saveGameToFile(
bool fromControlPanel,
const char *filename = 0,
bool isAutosave =
false);
216 int displayMessage(MSVC_PRINTF
const char *message, ...)
GCC_PRINTF(2, 3);
219 void initHelpPanel();
223 void drawMainPanel();
230 void delay(
unsigned int amount);
233 bool getYesNo(
char *text, uint bufSize);
236 uint16 doMusicSlide();
237 uint16 doSpeedSlide();
241 uint16 shiftDown(uint8 speed);
242 uint16 shiftUp(uint8 speed);
243 void drawTextCross(uint32 flags);
244 void drawCross(uint16 x, uint16 y);
246 uint16 saveRestorePanel(
bool allowSave);
251 uint32 prepareSaveData(uint8 *destBuf);
253 bool autoSaveExists();
254 uint16 restoreGameFromFile(
bool autoSave);
255 void importOldMegaSet(uint8 **srcPos,
MegaSet *mega);
256 void importOldCompact(
Compact* destCpt, uint8 **srcPos, uint16 numElems, uint16 type,
char *name);
257 uint16 parseSaveData(uint8 *srcBuf);
290 uint32 _curButtonText;
293 uint32 _savedCharSet;
294 uint16 _enteredTextWidth;
296 ConResource *createResource(
void *pSpData, uint32 pNSprites, uint32 pCurSprite, int16 pX, int16 pY, uint32 pText, uint8 pOnClick, uint8 panelType);
301 ConResource *_controlPanel, *_exitButton, *_slide, *_slide2, *_slode;
302 ConResource *_restorePanButton, *_savePanButton, *_dosPanButton, *_restartPanButton, *_fxPanButton, *_musicPanButton;
308 ConResource *_saveButton, *_downFastButton, *_downSlowButton;
309 ConResource *_upFastButton, *_upSlowButton, *_quitButton, *_restoreButton;
312 ConResource *_savePanLookList[6], *_restorePanLookList[7];
316 static char _quitTexts[20][45];
317 static uint8 _crossImg[594];
Definition: control.h:141
Definition: control.h:146
Definition: musicbase.h:55
Definition: atari-screen.h:58
uint32 CustomEventType
Definition: events.h:212
Definition: control.h:166
int FORCEINLINE GCC_PRINTF(2, 0) int vsprintf_s(T(&dst)[N]
Definition: control.h:177
Definition: algorithm.h:29
Definition: control.h:136
Definition: keyboard.h:294
Definition: savefile.h:142
Definition: autoroute.h:28
Definition: control.h:192
Definition: control.h:131