26 #include "common/events.h" 27 #include "common/scummsys.h" 28 #include "common/str-array.h" 32 class SaveFileManager;
47 struct DataFileHeader;
50 #define MAX_SAVE_GAMES 999 51 #define MAX_TEXT_LEN 80 52 #define PAN_LINE_WIDTH 184 53 #define PAN_CHAR_HEIGHT 12 54 #define STATUS_WIDTH 146 55 #define MPNL_X 60 // Main Panel 58 #define SPNL_X 20 // Save Panel 66 #define TEXT_FLAG_MASK (SF_ALLOW_SPEECH | SF_ALLOW_TEXT) 68 #define GAME_NAME_X (SPNL_X + 18) // x coordinate of game names 69 #define GAME_NAME_Y (SPNL_Y + SP_TOP_GAP) // start y coord of game names 70 #define MAX_ON_SCREEN ((SP_HEIGHT - SP_TOP_GAP - SP_BOT_GAP) / PAN_CHAR_HEIGHT) // no of save games on screen 71 #define CP_PANEL 60400 // main panel sprite 77 #define WITH_MASK true 81 #define REST_GAME_PANEL 1 82 #define SAVE_GAME_PANEL 2 84 #define RESTORE_A_GAME 4 86 #define SHIFT_DOWN_FAST 6 87 #define SHIFT_DOWN_SLOW 7 88 #define SHIFT_UP_FAST 8 89 #define SHIFT_UP_SLOW 9 90 #define SPEED_SLIDE 10 91 #define MUSIC_SLIDE 11 94 #define TOGGLE_TEXT 14 97 #define QUIT_TO_DOS 17 98 #define RESTORE_AUTO 18 101 #define CANCEL_PRESSED 100 102 #define NAME_TOO_SHORT 101 103 #define GAME_SAVED 102 106 #define RESTARTED 105 107 #define GAME_RESTORED 106 108 #define RESTORE_FAILED 107 109 #define NO_DISK_SPACE 108 110 #define SPEED_CHANGED 109 111 #define QUIT_PANEL 110 116 #define SPEED_MULTIPLY 12 123 #define SAVE_MEGA3 16 124 #define SAVE_GRAFX 32 125 #define SAVE_TURNP 64 127 #define SAVE_FILE_REVISION 6 128 #define OLD_SAVEGAME_TYPE 5 137 ConResource(
void *pSpData, uint32 pNSprites, uint32 pCurSprite, uint16 pX, uint16 pY, uint32 pText, uint8 pOnClick,
OSystem *system, uint8 *screen);
139 void setSprite(
void *pSpData) { _spriteData = (
DataFileHeader *)pSpData; }
140 void setText(uint32 pText) {
if (pText) _text = pText + 0x7000;
else _text = 0; }
141 void setXY(uint16 x, uint16 y) { _x = x; _y = y; }
142 bool isMouseOver(uint32 mouseX, uint32 mouseY);
143 virtual void drawToScreen(
bool doMask);
146 uint32 _numSprites, _curSprite;
157 TextResource(
void *pSpData, uint32 pNSprites, uint32 pCurSprite, uint16 pX, uint16 pY, uint32 pText, uint8 pOnClick,
OSystem *system, uint8 *screen);
159 void drawToScreen(
bool doMask)
override;
160 void flushForRedraw();
170 void setToText(
const char *newText);
171 void setToText(uint16 textNum);
183 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);
184 void doControlPanel();
185 void doLoadSavePanel();
187 void showGameQuitMsg();
188 uint16 quickXRestore(uint16 slot);
189 bool loadSaveAllowed();
190 bool isControlPanelOpen();
194 uint16 _selectedGame;
195 uint16 saveGameToFile(
bool fromControlPanel,
const char *filename = 0,
bool isAutosave =
false);
201 int displayMessage(
const char *altButton, MSVC_PRINTF
const char *message, ...)
GCC_PRINTF(3, 4);
206 void drawMainPanel();
213 void delay(
unsigned int amount);
216 bool getYesNo(
char *text, uint bufSize);
219 uint16 doMusicSlide();
220 uint16 doSpeedSlide();
224 uint16 shiftDown(uint8 speed);
225 uint16 shiftUp(uint8 speed);
226 void drawTextCross(uint32 flags);
227 void drawCross(uint16 x, uint16 y);
229 uint16 saveRestorePanel(
bool allowSave);
234 uint32 prepareSaveData(uint8 *destBuf);
236 bool autoSaveExists();
237 uint16 restoreGameFromFile(
bool autoSave);
238 void importOldMegaSet(uint8 **srcPos,
MegaSet *mega);
239 void importOldCompact(
Compact* destCpt, uint8 **srcPos, uint16 numElems, uint16 type,
char *name);
240 uint16 parseSaveData(uint8 *srcBuf);
273 uint32 _curButtonText;
276 uint32 _savedCharSet;
277 uint16 _enteredTextWidth;
279 ConResource *createResource(
void *pSpData, uint32 pNSprites, uint32 pCurSprite, int16 pX, int16 pY, uint32 pText, uint8 pOnClick, uint8 panelType);
284 ConResource *_controlPanel, *_exitButton, *_slide, *_slide2, *_slode;
285 ConResource *_restorePanButton, *_savePanButton, *_dosPanButton, *_restartPanButton, *_fxPanButton, *_musicPanButton;
291 ConResource *_saveButton, *_downFastButton, *_downSlowButton;
292 ConResource *_upFastButton, *_upSlowButton, *_quitButton, *_restoreButton;
295 ConResource *_savePanLookList[6], *_restorePanLookList[7];
299 static char _quitTexts[18][35];
300 static uint8 _crossImg[594];
Definition: control.h:135
Definition: musicbase.h:55
Definition: atari-screen.h:60
uint32 CustomEventType
Definition: events.h:193
Definition: control.h:155
int FORCEINLINE GCC_PRINTF(2, 0) int vsprintf_s(T(&dst)[N]
Definition: control.h:166
Definition: algorithm.h:29
Definition: keyboard.h:294
Definition: savefile.h:142
Definition: autoroute.h:28
Definition: control.h:181
Definition: control.h:130