Skip to content

Commit

Permalink
FULLPIPE: g_fullpipe -> g_fp for brevity
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Dec 21, 2013
1 parent 9816794 commit 90532c7
Show file tree
Hide file tree
Showing 30 changed files with 795 additions and 795 deletions.
10 changes: 5 additions & 5 deletions engines/fullpipe/behavior.cpp
Expand Up @@ -132,7 +132,7 @@ void BehaviorManager::updateBehavior(BehaviorInfo *behaviorInfo, BehaviorEntry *
mq->sendNextCommand();

bhi->_flags &= 0xFFFFFFFD;
} else if (behaviorInfo->_counter >= bhi->_delay && bhi->_percent && g_fullpipe->_rnd->getRandomNumber(32767) <= entry->_items[i]->_percent) {
} else if (behaviorInfo->_counter >= bhi->_delay && bhi->_percent && g_fp->_rnd->getRandomNumber(32767) <= entry->_items[i]->_percent) {
MessageQueue *mq = new MessageQueue(bhi->_messageQueue, 0, 1);

mq->sendNextCommand();
Expand All @@ -149,7 +149,7 @@ void BehaviorManager::updateStaticAniBehavior(StaticANIObject *ani, int delay, B
MessageQueue *mq = 0;

if (bhe->_flags & 1) {
uint rnd = g_fullpipe->_rnd->getRandomNumber(32767);
uint rnd = g_fp->_rnd->getRandomNumber(32767);
uint runPercent = 0;
for (int i = 0; i < bhe->_itemsCount; i++) {
if (!(bhe->_items[i]->_flags & 1) && bhe->_items[i]->_percent) {
Expand All @@ -164,7 +164,7 @@ void BehaviorManager::updateStaticAniBehavior(StaticANIObject *ani, int delay, B
for (int i = 0; i < bhe->_itemsCount; i++) {
if (!(bhe->_items[i]->_flags & 1) && delay >= bhe->_items[i]->_delay) {
if (bhe->_items[i]->_percent) {
if (g_fullpipe->_rnd->getRandomNumber(32767) <= bhe->_items[i]->_percent) {
if (g_fp->_rnd->getRandomNumber(32767) <= bhe->_items[i]->_percent) {
mq = new MessageQueue(bhe->_items[i]->_messageQueue, 0, 1);
break;
}
Expand Down Expand Up @@ -252,11 +252,11 @@ void BehaviorInfo::initObjectBehavior(GameVar *var, Scene *sc, StaticANIObject *
if (strcmp(var->_value.stringValue, "ROOT"))
break;

GameVar *v1 = g_fullpipe->getGameLoaderGameVar()->getSubVarByName("BEHAVIOR")->getSubVarByName(ani->getName());
GameVar *v1 = g_fp->getGameLoaderGameVar()->getSubVarByName("BEHAVIOR")->getSubVarByName(ani->getName());
if (v1 == var)
return;

sc = g_fullpipe->accessScene(ani->_sceneId);
sc = g_fp->accessScene(ani->_sceneId);
clear();
var = v1;
_itemsCount = var->getSubVarsCount();
Expand Down
4 changes: 2 additions & 2 deletions engines/fullpipe/fullpipe.cpp
Expand Up @@ -40,7 +40,7 @@

namespace Fullpipe {

FullpipeEngine *g_fullpipe = 0;
FullpipeEngine *g_fp = 0;
Vars *g_vars = 0;

FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) {
Expand Down Expand Up @@ -157,7 +157,7 @@ FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc)

_isSaveAllowed = true;

g_fullpipe = this;
g_fp = this;
g_vars = new Vars;
}

Expand Down
2 changes: 1 addition & 1 deletion engines/fullpipe/fullpipe.h
Expand Up @@ -279,7 +279,7 @@ class FullpipeEngine : public ::Engine {

};

extern FullpipeEngine *g_fullpipe;
extern FullpipeEngine *g_fp;
extern Vars *g_vars;

} // End of namespace Fullpipe
Expand Down
54 changes: 27 additions & 27 deletions engines/fullpipe/gameloader.cpp
Expand Up @@ -32,19 +32,19 @@
namespace Fullpipe {

Inventory2 *getGameLoaderInventory() {
return &g_fullpipe->_gameLoader->_inventory;
return &g_fp->_gameLoader->_inventory;
}

MctlCompound *getSc2MctlCompoundBySceneId(int16 sceneId) {
for (uint i = 0; i < g_fullpipe->_gameLoader->_sc2array.size(); i++)
if (g_fullpipe->_gameLoader->_sc2array[i]._sceneId == sceneId)
return (MctlCompound *)g_fullpipe->_gameLoader->_sc2array[i]._motionController;
for (uint i = 0; i < g_fp->_gameLoader->_sc2array.size(); i++)
if (g_fp->_gameLoader->_sc2array[i]._sceneId == sceneId)
return (MctlCompound *)g_fp->_gameLoader->_sc2array[i]._motionController;

return 0;
}

InteractionController *getGameLoaderInteractionController() {
return g_fullpipe->_gameLoader->_interactionController;
return g_fp->_gameLoader->_interactionController;
}

GameLoader::GameLoader() {
Expand All @@ -68,10 +68,10 @@ GameLoader::GameLoader() {
_preloadEntranceId = 0;
_updateCounter = 0;

g_fullpipe->_msgX = 0;
g_fullpipe->_msgY = 0;
g_fullpipe->_msgObjectId2 = 0;
g_fullpipe->_msgId = 0;
g_fp->_msgX = 0;
g_fp->_msgY = 0;
g_fp->_msgObjectId2 = 0;
g_fp->_msgId = 0;
}

GameLoader::~GameLoader() {
Expand All @@ -91,10 +91,10 @@ bool GameLoader::load(MfcArchive &file) {

_gameProject->load(file);

g_fullpipe->_gameProject = _gameProject;
g_fp->_gameProject = _gameProject;

if (g_fullpipe->_gameProjectVersion < 12) {
error("Old gameProjectVersion: %d", g_fullpipe->_gameProjectVersion);
if (g_fp->_gameProjectVersion < 12) {
error("Old gameProjectVersion: %d", g_fp->_gameProjectVersion);
}

_gameName = file.readPascalString();
Expand Down Expand Up @@ -167,7 +167,7 @@ bool GameLoader::gotoScene(int sceneId, int entranceId) {
return false;

if (_sc2array[sc2idx]._entranceDataCount < 1) {
g_fullpipe->_currentScene = st->_scene;
g_fp->_currentScene = st->_scene;
return true;
}

Expand All @@ -186,20 +186,20 @@ bool GameLoader::gotoScene(int sceneId, int entranceId) {
if (sg || (sg = _gameVar->getSubVarByName("OBJSTATES")->addSubVarAsInt("SAVEGAME", 0)) != 0)
sg->setSubVarAsInt("Entrance", entranceId);

if (!g_fullpipe->sceneSwitcher(_sc2array[sc2idx]._entranceData[entranceIdx]))
if (!g_fp->sceneSwitcher(_sc2array[sc2idx]._entranceData[entranceIdx]))
return false;

g_fullpipe->_msgObjectId2 = 0;
g_fullpipe->_msgY = -1;
g_fullpipe->_msgX = -1;
g_fp->_msgObjectId2 = 0;
g_fp->_msgY = -1;
g_fp->_msgX = -1;

g_fullpipe->_currentScene = st->_scene;
g_fp->_currentScene = st->_scene;

MessageQueue *mq1 = g_fullpipe->_currentScene->getMessageQueueById(_sc2array[sc2idx]._entranceData[entranceIdx]->_messageQueueId);
MessageQueue *mq1 = g_fp->_currentScene->getMessageQueueById(_sc2array[sc2idx]._entranceData[entranceIdx]->_messageQueueId);
if (mq1) {
MessageQueue *mq = new MessageQueue(mq1, 0, 0);

StaticANIObject *stobj = g_fullpipe->_currentScene->getStaticANIObject1ById(_field_FA, -1);
StaticANIObject *stobj = g_fp->_currentScene->getStaticANIObject1ById(_field_FA, -1);
if (stobj) {
stobj->_flags &= 0x100;

Expand All @@ -220,7 +220,7 @@ bool GameLoader::gotoScene(int sceneId, int entranceId) {
return false;
}
} else {
StaticANIObject *stobj = g_fullpipe->_currentScene->getStaticANIObject1ById(_field_FA, -1);
StaticANIObject *stobj = g_fp->_currentScene->getStaticANIObject1ById(_field_FA, -1);
if (stobj)
stobj->_flags &= 0xfeff;
}
Expand Down Expand Up @@ -262,8 +262,8 @@ bool GameLoader::preloadScene(int sceneId, int entranceId) {
return false;
}

if (g_fullpipe->_currentScene && g_fullpipe->_currentScene->_sceneId == sceneId)
g_fullpipe->_currentScene = 0;
if (g_fp->_currentScene && g_fp->_currentScene->_sceneId == sceneId)
g_fp->_currentScene = 0;

saveScenePicAniInfos(sceneId);
clearGlobalMessageQueueList1();
Expand Down Expand Up @@ -358,7 +358,7 @@ void GameLoader::applyPicAniInfos(Scene *sc, PicAniInfo **picAniInfo, int picAni
if (!(picAniInfo[i]->type & 1))
continue;

Scene *scNew = g_fullpipe->accessScene(picAniInfo[i]->sceneId);
Scene *scNew = g_fp->accessScene(picAniInfo[i]->sceneId);
if (!scNew)
continue;

Expand Down Expand Up @@ -386,8 +386,8 @@ void GameLoader::saveScenePicAniInfos(int sceneId) {
}

void GameLoader::updateSystems(int counterdiff) {
if (g_fullpipe->_currentScene) {
g_fullpipe->_currentScene->update(counterdiff);
if (g_fp->_currentScene) {
g_fp->_currentScene->update(counterdiff);

_exCommand._messageKind = 17;
_updateCounter++;
Expand Down Expand Up @@ -511,7 +511,7 @@ InputController *FullpipeEngine::getGameLoaderInputController() {
}

MotionController *getCurrSceneSc2MotionController() {
return getSc2MctlCompoundBySceneId(g_fullpipe->_currentScene->_sceneId);
return getSc2MctlCompoundBySceneId(g_fp->_currentScene->_sceneId);
}

} // End of namespace Fullpipe
64 changes: 32 additions & 32 deletions engines/fullpipe/gfx.cpp
Expand Up @@ -100,11 +100,11 @@ bool Background::load(MfcArchive &file) {
addPictureObject(pct);
}

assert(g_fullpipe->_gameProjectVersion >= 4);
assert(g_fp->_gameProjectVersion >= 4);

_bigPictureArray1Count = file.readUint32LE();

assert(g_fullpipe->_gameProjectVersion >= 5);
assert(g_fp->_gameProjectVersion >= 5);

_bigPictureArray2Count = file.readUint32LE();

Expand Down Expand Up @@ -313,7 +313,7 @@ bool GameObject::load(MfcArchive &file) {
_oy = file.readUint32LE();
_priority = file.readUint16LE();

if (g_fullpipe->_gameProjectVersion >= 11) {
if (g_fp->_gameProjectVersion >= 11) {
_field_8 = file.readUint32LE();
}

Expand Down Expand Up @@ -494,7 +494,7 @@ bool Picture::load(MfcArchive &file) {
_y = file.readUint32LE();
_field_44 = file.readUint16LE();

assert(g_fullpipe->_gameProjectVersion >= 2);
assert(g_fp->_gameProjectVersion >= 2);

_width = file.readUint32LE();
_height = file.readUint32LE();
Expand All @@ -508,7 +508,7 @@ bool Picture::load(MfcArchive &file) {
setAOIDs();
}

assert (g_fullpipe->_gameProjectVersion >= 12);
assert (g_fp->_gameProjectVersion >= 12);

_alpha = file.readUint32LE() & 0xff;

Expand All @@ -527,8 +527,8 @@ bool Picture::load(MfcArchive &file) {
}

void Picture::setAOIDs() {
int w = (g_fullpipe->_pictureScale + _width - 1) / g_fullpipe->_pictureScale;
int h = (g_fullpipe->_pictureScale + _height - 1) / g_fullpipe->_pictureScale;
int w = (g_fp->_pictureScale + _width - 1) / g_fp->_pictureScale;
int h = (g_fp->_pictureScale + _height - 1) / g_fp->_pictureScale;

_memoryObject2->_rows = (byte **)malloc(w * sizeof(int *));

Expand Down Expand Up @@ -618,7 +618,7 @@ void Picture::draw(int x, int y, int style, int angle) {

if (!pal) {
//warning("Picture:draw: using global palette");
pal = g_fullpipe->_globalPalette;
pal = g_fp->_globalPalette;
}

Common::Point point;
Expand Down Expand Up @@ -650,7 +650,7 @@ void Picture::drawRotated(int x, int y, int angle) {
}

void Picture::displayPicture() {
if (!g_fullpipe->_gameContinue)
if (!g_fp->_gameContinue)
return;

getData();
Expand All @@ -659,22 +659,22 @@ void Picture::displayPicture() {
if (!_dataSize)
return;

g_fullpipe->_backgroundSurface.fillRect(Common::Rect(0, 0, 800, 600), 0);
g_fullpipe->_system->copyRectToScreen(g_fullpipe->_backgroundSurface.getBasePtr(0, 0), g_fullpipe->_backgroundSurface.pitch, 0, 0, 800, 600);
g_fp->_backgroundSurface.fillRect(Common::Rect(0, 0, 800, 600), 0);
g_fp->_system->copyRectToScreen(g_fp->_backgroundSurface.getBasePtr(0, 0), g_fp->_backgroundSurface.pitch, 0, 0, 800, 600);

draw(0, 0, 0, 0);

g_fullpipe->updateEvents();
g_fullpipe->_system->delayMillis(10);
g_fullpipe->_system->updateScreen();
g_fp->updateEvents();
g_fp->_system->delayMillis(10);
g_fp->_system->updateScreen();

while (g_fullpipe->_gameContinue) {
g_fullpipe->updateEvents();
g_fullpipe->_system->delayMillis(10);
g_fullpipe->_system->updateScreen();
while (g_fp->_gameContinue) {
g_fp->updateEvents();
g_fp->_system->delayMillis(10);
g_fp->_system->updateScreen();

if (g_fullpipe->_keyState == ' ') {
g_fullpipe->_keyState = Common::KEYCODE_INVALID;
if (g_fp->_keyState == ' ') {
g_fp->_keyState = Common::KEYCODE_INVALID;
break;
}
}
Expand Down Expand Up @@ -722,7 +722,7 @@ bool Picture::isPixelHitAtPos(int x, int y) {
}

int Picture::getPixelAtPos(int x, int y) {
return getPixelAtPosEx(x / g_fullpipe->_pictureScale, y / g_fullpipe->_pictureScale);
return getPixelAtPosEx(x / g_fp->_pictureScale, y / g_fp->_pictureScale);

return false;
}
Expand All @@ -731,8 +731,8 @@ int Picture::getPixelAtPosEx(int x, int y) {
if (x < 0 || y < 0)
return 0;

if (x < (g_fullpipe->_pictureScale + _width - 1) / g_fullpipe->_pictureScale &&
y < (g_fullpipe->_pictureScale + _height - 1) / g_fullpipe->_pictureScale &&
if (x < (g_fp->_pictureScale + _width - 1) / g_fp->_pictureScale &&
y < (g_fp->_pictureScale + _height - 1) / g_fp->_pictureScale &&
_memoryObject2 != 0 && _memoryObject2->_rows != 0)
return _memoryObject2->_rows[x][2 * y];

Expand Down Expand Up @@ -785,8 +785,8 @@ bool Bitmap::isPixelAtHitPosRB(int x, int y) {
void Bitmap::putDib(int x, int y, int32 *palette) {
debug(7, "Bitmap::putDib(%d, %d)", x, y);

_x = x - g_fullpipe->_sceneRect.left;
_y = y - g_fullpipe->_sceneRect.top;
_x = x - g_fp->_sceneRect.left;
_y = y - g_fp->_sceneRect.top;

if (_type == MKTAG('R', 'B', '\0', '\0'))
putDibRB(palette);
Expand Down Expand Up @@ -879,7 +879,7 @@ bool Bitmap::putDibRB(int32 *palette, int pX, int pY) {
if (y <= endy) {
if (pX == -1) {
int bgcolor = palette[(pixel >> 8) & 0xff];
curDestPtr = (uint16 *)g_fullpipe->_backgroundSurface.getBasePtr(start1, y);
curDestPtr = (uint16 *)g_fp->_backgroundSurface.getBasePtr(start1, y);
colorFill(curDestPtr, fillLen, bgcolor);
} else {
if (y == pY && pX >= start1 && pX < start1 + fillLen)
Expand Down Expand Up @@ -910,7 +910,7 @@ bool Bitmap::putDibRB(int32 *palette, int pX, int pY) {

if (y <= endy) {
if (pX == -1) {
curDestPtr = (uint16 *)g_fullpipe->_backgroundSurface.getBasePtr(start1, y);
curDestPtr = (uint16 *)g_fp->_backgroundSurface.getBasePtr(start1, y);
paletteFill(curDestPtr, (byte *)srcPtr2, fillLen, (int32 *)palette);
} else {
if (y == pY && pX >= start1 && pX < start1 + fillLen)
Expand All @@ -922,7 +922,7 @@ bool Bitmap::putDibRB(int32 *palette, int pX, int pY) {
}

if (pX == -1)
g_fullpipe->_system->copyRectToScreen(g_fullpipe->_backgroundSurface.getBasePtr(startx, starty), g_fullpipe->_backgroundSurface.pitch, startx, starty, endx + 1 - startx, endy + 1 - starty);
g_fp->_system->copyRectToScreen(g_fp->_backgroundSurface.getBasePtr(startx, starty), g_fp->_backgroundSurface.pitch, startx, starty, endx + 1 - startx, endy + 1 - starty);

return false;
}
Expand Down Expand Up @@ -973,17 +973,17 @@ void Bitmap::putDibCB(int32 *palette) {

if (_flags & 0x1000000) {
for (int y = starty; y < endy; srcPtr -= pitch, y++) {
curDestPtr = (uint16 *)g_fullpipe->_backgroundSurface.getBasePtr(startx, y);
curDestPtr = (uint16 *)g_fp->_backgroundSurface.getBasePtr(startx, y);
copierKeyColor(curDestPtr, srcPtr, endx - startx + 1, _flags & 0xff, (int32 *)palette, cb05_format);
}
} else {
for (int y = starty; y <= endy; srcPtr -= pitch, y++) {
curDestPtr = (uint16 *)g_fullpipe->_backgroundSurface.getBasePtr(startx, y);
curDestPtr = (uint16 *)g_fp->_backgroundSurface.getBasePtr(startx, y);
copier(curDestPtr, srcPtr, endx - startx + 1, (int32 *)palette, cb05_format);
}
}

g_fullpipe->_system->copyRectToScreen(g_fullpipe->_backgroundSurface.getBasePtr(startx, starty), g_fullpipe->_backgroundSurface.pitch, startx, starty, endx + 1 - startx, endy + 1 - starty);
g_fp->_system->copyRectToScreen(g_fp->_backgroundSurface.getBasePtr(startx, starty), g_fp->_backgroundSurface.pitch, startx, starty, endx + 1 - startx, endy + 1 - starty);
}

void Bitmap::colorFill(uint16 *dest, int len, int32 color) {
Expand Down Expand Up @@ -1194,7 +1194,7 @@ bool Shadows::load(MfcArchive &file) {
}

void Shadows::init() {
Scene *scene = g_fullpipe->accessScene(_sceneId);
Scene *scene = g_fp->accessScene(_sceneId);

StaticANIObject *st;
Movement *mov;
Expand Down

0 comments on commit 90532c7

Please sign in to comment.