SAGA2: Move backPort to Saga2Engine

This commit is contained in:
a/ 2021-07-17 11:29:23 +09:00
parent 500916b5ca
commit 582952b6a0
7 changed files with 8 additions and 19 deletions

View File

@ -47,7 +47,6 @@ extern int16 currentMapNum;
extern WorldMapData *mapList;
extern StaticPoint16 fineScroll;
extern gPort backPort;
extern SpriteSet *objectSprites, // object sprites
*spellSprites; // spell effect sprites
@ -771,7 +770,7 @@ void DisplayNode::drawObject(void) {
effectFlags |= sprFXTerrainMask;
DrawCompositeMaskedSprite(
backPort,
g_vm->_backPort,
scList,
partCount,
drawPos,
@ -802,7 +801,7 @@ void DisplayNode::drawObject(void) {
indicatorCoords.x = hitBox.x + fineScroll.x + (hitBox.width - indicator.size.x) / 2;
indicatorCoords.y = hitBox.y + fineScroll.y - indicator.size.y - 2;
TBlit(backPort.map, &indicator, indicatorCoords.x, indicatorCoords.y);
TBlit(g_vm->_backPort.map, &indicator, indicatorCoords.x, indicatorCoords.y);
}
}
@ -1000,7 +999,7 @@ void Effectron::drawEffect(void) {
0) <= 5);
DrawCompositeMaskedSprite(
backPort,
g_vm->_backPort,
scList,
1,
drawPos,

View File

@ -110,12 +110,6 @@ GameMode PlayMode = {
Alarm frameAlarm; // 10 fps frame rate
/* ===================================================================== *
Display setup (move to another file later)
* ===================================================================== */
gPort backPort; // background port
/* ===================================================================== *
User controls
* ===================================================================== */
@ -178,7 +172,7 @@ void PlayModeSetup(void) {
}
// Setup the drawing port for the background map
backPort.setMap(&tileDrawMap);
g_vm->_backPort.setMap(&tileDrawMap);
// Allocate bitmap for drag & drop mouse pointer
objPointerMap.size.x = objPointerMap.size.y = 32;

View File

@ -148,6 +148,7 @@ public:
Properties *_properties;
gDisplayPort _mainPort;
gPort _backPort;
bool _autoAggression;
bool _autoWeapon;

View File

@ -494,8 +494,8 @@ bool Speech::displayText(void) {
return false;
// Blit to the port
backPort.setMode(drawModeMatte);
backPort.bltPixels(speechImage,
g_vm->_backPort.setMode(drawModeMatte);
g_vm->_backPort.bltPixels(speechImage,
0, 0,
p.x + fineScroll.x,
p.y + fineScroll.y,

View File

@ -36,7 +36,6 @@ namespace Saga2 {
#define CHARSPERSECOND 22
#define SHORTEST_DURATION TICKSPERSECOND
extern gPort backPort;
void TileToScreenCoords(const TilePoint &tp, Point16 &p);
void TileToScreenCoords(const TilePoint &tp, StaticPoint16 &p);
void updateSpeech();

View File

@ -60,8 +60,6 @@ extern gPixelMap tileDrawMap;
// Color map ranges
extern uint8 *ColorMapRanges;
extern gPort backPort;
/* ===================================================================== *
Exports
* ===================================================================== */

View File

@ -157,8 +157,6 @@ void drawFloatingWindows(gPort &, const Point16 &, const Rect16 &clip);
Imports
* ===================================================================== */
extern gPort backPort;
extern int16 worldCount; // Used as map count as well
extern ObjectID viewCenterObject; // ID of object that view tracks
@ -4442,7 +4440,7 @@ void drawMainDisplay(void) {
Rect16 rect(kTileRectX, kTileRectY, kTileRectWidth, kTileRectHeight);
// Render floating windows
drawFloatingWindows(backPort,
drawFloatingWindows(g_vm->_backPort,
Point16(kTileRectX - fineScroll.x, kTileRectY),
rect);
// Blit it all onto the screen