aboutsummaryrefslogtreecommitdiff
path: root/sword2/sword2.h
diff options
context:
space:
mode:
authorTorbjörn Andersson2005-02-19 14:02:16 +0000
committerTorbjörn Andersson2005-02-19 14:02:16 +0000
commit43cfe01f3d8d2307a23933920cce43740871f367 (patch)
treefe56072f944bc980981d5f0cfe1683116645d076 /sword2/sword2.h
parent0de5fa2f33147529edcf4dccd24a2750b23a2867 (diff)
downloadscummvm-rg350-43cfe01f3d8d2307a23933920cce43740871f367.tar.gz
scummvm-rg350-43cfe01f3d8d2307a23933920cce43740871f367.tar.bz2
scummvm-rg350-43cfe01f3d8d2307a23933920cce43740871f367.zip
This is the second part of the BS2 restructuring. There are two new
classes: Screen and Mouse. Screen handles most of the drawing, except the mouse cursor and in-game menus. The old Graphics class is no more. I've also fixed some "reverse stereo" regressions from the first part of the restructuring. I'm not sure what the next step will be, but hopefully it will be smaller than this one was. svn-id: r16812
Diffstat (limited to 'sword2/sword2.h')
-rw-r--r--sword2/sword2.h175
1 files changed, 4 insertions, 171 deletions
diff --git a/sword2/sword2.h b/sword2/sword2.h
index c51202b447..8de53d64e4 100644
--- a/sword2/sword2.h
+++ b/sword2/sword2.h
@@ -36,8 +36,6 @@
#include "sword2/build_display.h"
#include "sword2/header.h"
#include "sword2/icons.h"
-#include "sword2/layers.h"
-#include "sword2/mouse.h"
#include "sword2/object.h"
#include "sword2/save_rest.h"
@@ -56,6 +54,8 @@ enum {
class MemoryManager;
class ResourceManager;
class Sound;
+class Screen;
+class Mouse;
class Graphics;
class Logic;
class FontRenderer;
@@ -96,67 +96,6 @@ private:
uint32 _bootParam;
int32 _saveSlot;
- // structure filled out by each object to register its graphic printing
- // requrements
-
- struct BuildUnit {
- int16 x;
- int16 y;
- uint16 scaled_width;
- uint16 scaled_height;
- int16 sort_y;
- uint32 anim_resource;
- uint16 anim_pc;
-
- // Denotes a scaling sprite at print time - and holds the
- // scaling value for the shrink routine
-
- uint16 scale;
-
- // Non-zero means this item is a layer - retrieve from
- // background layer and send to special renderer
-
- uint16 layer_number;
-
- // True means we want this frame to be affected by the shading
- // mask
-
- bool shadingFlag;
- };
-
- BuildUnit _bgp0List[MAX_bgp0_sprites];
- BuildUnit _bgp1List[MAX_bgp1_sprites];
- BuildUnit _backList[MAX_back_sprites];
- BuildUnit _sortList[MAX_sort_sprites];
- BuildUnit _foreList[MAX_fore_sprites];
- BuildUnit _fgp0List[MAX_fgp0_sprites];
- BuildUnit _fgp1List[MAX_fgp1_sprites];
-
- // Holds the order of the sort list, i.e. the list stays static and we
- // sort this array.
-
- uint16 _sortOrder[MAX_sort_sprites];
-
- // Last palette used - so that we can restore the correct one after a
- // pause (which dims the screen) and it's not always the main screen
- // palette that we want, eg. during the eclipse
-
- // This flag gets set in startNewPalette() and setFullPalette()
-
- uint32 _lastPaletteRes;
-
- void drawBackPar0Frames();
- void drawBackPar1Frames();
- void drawBackFrames();
- void drawSortFrames(byte *file);
- void drawForeFrames();
- void drawForePar0Frames();
- void drawForePar1Frames();
-
- void startNewPalette();
- void processLayer(byte *file, uint32 layer_number);
- void processImage(BuildUnit *build_unit);
-
void getPlayerStructures();
void putPlayerStructures();
@@ -168,12 +107,6 @@ private:
void pauseGame();
void unpauseGame();
- MenuObject _tempList[TOTAL_engine_pockets];
- uint32 _totalTemp;
-
- MenuObject _masterMenuList[TOTAL_engine_pockets];
- uint32 _totalMasters;
-
uint32 _totalStartups;
uint32 _totalScreenManagers;
uint32 _startRes;
@@ -208,7 +141,8 @@ public:
MemoryManager *_memory;
ResourceManager *_resman;
Sound *_sound;
- Graphics *_graphics;
+ Screen *_screen;
+ Mouse *_mouse;
Logic *_logic;
FontRenderer *_fontRenderer;
Gui *_gui;
@@ -221,9 +155,6 @@ public:
uint32 _controlsFontId;
uint32 _redFontId;
- int16 _mouseX;
- int16 _mouseY;
-
uint32 setEventFilter(uint32 filter);
void parseEvents();
@@ -232,36 +163,6 @@ public:
MouseEvent *mouseEvent();
KeyboardEvent *keyboardEvent();
- void resetRenderLists();
- void buildDisplay();
- void displayMsg(byte *text, int time);
- void setFullPalette(int32 palRes);
-
- int32 registerFrame(int32 *params);
- void registerFrame(int32 *params, BuildUnit *build_unit);
-
- // The debugger wants to access these
-
- uint32 _curBgp0;
- uint32 _curBgp1;
- uint32 _curBack;
- uint32 _curSort;
- uint32 _curFore;
- uint32 _curFgp0;
- uint32 _curFgp1;
-
- // Debugging stuff
-
- uint32 _largestLayerArea;
- uint32 _largestSpriteArea;
- char _largestLayerInfo[128];
- char _largestSpriteInfo[128];
-
- // 'frames per second' counting stuff
- uint32 _fps;
- uint32 _cycleTime;
- uint32 _frameCount;
-
bool _wantSfxDebug;
int32 _gameCycle;
@@ -271,74 +172,10 @@ public:
bool _stepOneCycle;
#endif
- int32 initBackground(int32 res, int32 new_palette);
-
#if RIGHT_CLICK_CLEARS_LUGGAGE
bool heldIsInInventory();
#endif
- int menuClick(int menu_items);
-
- void addMenuObject(MenuObject *obj);
- void buildMenu();
- void buildSystemMenu();
-
- // _thisScreen describes the current back buffer and its in-game scroll
- // positions, etc.
-
- ScreenInfo _thisScreen;
-
- uint32 _curMouse;
- MouseUnit _mouseList[TOTAL_mouse_list];
-
- // Set by checkMouseList()
- uint32 _mouseTouching;
- uint32 _oldMouseTouching;
-
- uint32 _menuSelectedPos;
-
- // If it's NORMAL_MOUSE_ID (ie. normal pointer) then it's over a floor
- // area (or hidden hot-zone)
-
- uint32 _mousePointerRes;
-
- uint32 _mouseMode;
- bool _examiningMenuIcon;
-
- bool _mouseStatus; // Human 0 on/1 off
- bool _mouseModeLocked; // 0 not !0 mode cannot be changed from
- // normal mouse to top menu (i.e. when
- // carrying big objects)
- uint32 _realLuggageItem; // Last minute for pause mode
- uint32 _currentLuggageResource;
- uint32 _oldButton; // For the re-click stuff - must be
- // the same button you see
- uint32 _buttonClick;
- uint32 _pointerTextBlocNo;
- uint32 _playerActivityDelay; // Player activity delay counter
-
- void resetMouseList();
-
- void normalMouse();
- void menuMouse();
- void dragMouse();
- void systemMenuMouse();
-
- void mouseOnOff();
- uint32 checkMouseList();
- void mouseEngine();
-
- void setMouse(uint32 res);
- void setLuggage(uint32 res);
-
- void clearPointerText();
-
- void createPointerText(uint32 text_id, uint32 pointer_res);
- void monitorPlayerActivity();
- void noHuman();
-
- void registerMouse(ObjectMouse *ob_mouse);
-
byte *fetchPalette(byte *screenFile);
ScreenHeader *fetchScreenHeader(byte *screenFile);
LayerHeader *fetchLayerHeader(byte *screenFile, uint16 layerNo);
@@ -395,10 +232,6 @@ public:
uint32 restoreFromBuffer(byte *buffer, uint32 size);
uint32 findBufferSize();
- uint8 _scrollFraction;
-
- void setScrolling();
-
bool _gamePaused;
bool _graphicsLevelFudged;