aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sky/autoroute.cpp7
-rw-r--r--engines/sky/control.cpp36
-rw-r--r--engines/sky/disk.cpp7
-rw-r--r--engines/sky/grid.cpp1
-rw-r--r--engines/sky/intro.cpp8
-rw-r--r--engines/sky/mouse.cpp6
-rw-r--r--engines/sky/music/adlibchannel.cpp17
-rw-r--r--engines/sky/music/adlibmusic.cpp9
-rw-r--r--engines/sky/music/gmchannel.cpp14
-rw-r--r--engines/sky/music/gmmusic.cpp9
-rw-r--r--engines/sky/music/mt32music.cpp10
-rw-r--r--engines/sky/music/musicbase.cpp9
-rw-r--r--engines/sky/screen.cpp31
-rw-r--r--engines/sky/sky.cpp10
-rw-r--r--engines/sky/sound.cpp8
-rw-r--r--engines/sky/text.cpp11
16 files changed, 5 insertions, 188 deletions
diff --git a/engines/sky/autoroute.cpp b/engines/sky/autoroute.cpp
index f5740467bc..bd0d18d442 100644
--- a/engines/sky/autoroute.cpp
+++ b/engines/sky/autoroute.cpp
@@ -44,7 +44,6 @@ const int16 AutoRoute::_routeDirections[4] = { -1, 1, -ROUTE_GRID_WIDTH,
const uint16 AutoRoute::_logicCommands[4] = { RIGHTY, LEFTY, DOWNY, UPY };
AutoRoute::AutoRoute(Grid *pGrid, SkyCompact *compact) {
-
_grid = pGrid;
_skyCompact = compact;
_routeGrid = (uint16 *)malloc(ROUTE_GRID_SIZE);
@@ -52,13 +51,11 @@ AutoRoute::AutoRoute(Grid *pGrid, SkyCompact *compact) {
}
AutoRoute::~AutoRoute(void) {
-
free(_routeGrid);
free(_routeBuf);
}
uint16 AutoRoute::checkBlock(uint16 *blockPos) {
-
uint16 retVal = 0xFFFF;
for (uint8 cnt = 0; cnt < 4; cnt++) {
@@ -96,7 +93,6 @@ void AutoRoute::clipCoordY(uint16 y, uint8 &blkY, int16 &initY) {
}
void AutoRoute::initWalkGrid(uint8 screen, uint8 width) {
-
uint16 *wGridPos;
uint8 stretch = 0;
uint8 *screenGrid = _grid->giveGrid(screen);
@@ -129,7 +125,6 @@ void AutoRoute::initWalkGrid(uint8 screen, uint8 width) {
}
bool AutoRoute::calcWalkGrid(uint8 startX, uint8 startY, uint8 destX, uint8 destY) {
-
int16 directionX, directionY;
uint8 roiX, roiY; // Rectangle Of Interest in the walk grid
if (startY > destY) {
@@ -195,7 +190,6 @@ bool AutoRoute::calcWalkGrid(uint8 startX, uint8 startY, uint8 destX, uint8 dest
}
uint16 *AutoRoute::makeRouteData(uint8 startX, uint8 startY, uint8 destX, uint8 destY) {
-
memset(_routeBuf, 0, ROUTE_SPACE);
uint16 *routePos = _routeGrid + (destY + 1) * ROUTE_GRID_WIDTH + destX + 1;
@@ -238,7 +232,6 @@ uint16 *AutoRoute::checkInitMove(uint16 *data, int16 initStaX) {
}
uint16 AutoRoute::autoRoute(Compact *cpt) {
-
uint8 cptScreen = (uint8)cpt->screen;
uint8 cptWidth = (uint8)SkyCompact::getMegaSet(cpt)->gridWidth;
initWalkGrid(cptScreen, cptWidth);
diff --git a/engines/sky/control.cpp b/engines/sky/control.cpp
index a1ac2460eb..f91b41b6f6 100644
--- a/engines/sky/control.cpp
+++ b/engines/sky/control.cpp
@@ -50,7 +50,6 @@
namespace Sky {
ConResource::ConResource(void *pSpData, uint32 pNSprites, uint32 pCurSprite, uint16 pX, uint16 pY, uint32 pText, uint8 pOnClick, OSystem *system, uint8 *screen) {
-
_spriteData = (dataFileHeader *)pSpData;
_numSprites = pNSprites;
_curSprite = pCurSprite;
@@ -63,7 +62,6 @@ ConResource::ConResource(void *pSpData, uint32 pNSprites, uint32 pCurSprite, uin
}
bool ConResource::isMouseOver(uint32 mouseX, uint32 mouseY) {
-
if ((mouseX >= _x) && (mouseY >= _y) && ((uint16)mouseX <= _x + _spriteData->s_width) && ((uint16)mouseY <= _y + _spriteData->s_height))
return true;
else
@@ -71,7 +69,6 @@ bool ConResource::isMouseOver(uint32 mouseX, uint32 mouseY) {
}
void ConResource::drawToScreen(bool doMask) {
-
uint8 *screenPos = _y * GAME_SCREEN_WIDTH + _x + _screen;
uint8 *updatePos = screenPos;
@@ -109,7 +106,6 @@ TextResource::~TextResource(void) {
}
void TextResource::flushForRedraw(void) {
-
if (_oldX < GAME_SCREEN_WIDTH) {
uint16 cpWidth = (PAN_LINE_WIDTH > (GAME_SCREEN_WIDTH - _oldX))?(GAME_SCREEN_WIDTH - _oldX):(PAN_LINE_WIDTH);
for (uint8 cnty = 0; cnty < PAN_CHAR_HEIGHT; cnty++)
@@ -119,7 +115,6 @@ void TextResource::flushForRedraw(void) {
}
void TextResource::drawToScreen(bool doMask) {
-
doMask = true;
uint16 cnty, cntx, cpWidth, cpHeight;
if ((_oldX == _x) && (_oldY == _y) && (_spriteData))
@@ -217,7 +212,6 @@ Control::Control(Common::SaveFileManager *saveFileMan, Screen *screen, Disk *dis
}
ConResource *Control::createResource(void *pSpData, uint32 pNSprites, uint32 pCurSprite, int16 pX, int16 pY, uint32 pText, uint8 pOnClick, uint8 panelType) {
-
if (pText) pText += 0x7000;
if (panelType == MAINPANEL) {
pX += MPNL_X;
@@ -230,7 +224,6 @@ ConResource *Control::createResource(void *pSpData, uint32 pNSprites, uint32 pCu
}
void Control::removePanel(void) {
-
free(_screenBuf);
free(_sprites.controlPanel); free(_sprites.button);
free(_sprites.buttonDown); free(_sprites.savePanel);
@@ -257,7 +250,6 @@ void Control::removePanel(void) {
}
void Control::initPanel(void) {
-
_screenBuf = (uint8 *)malloc(GAME_SCREEN_WIDTH * FULL_SCREEN_HEIGHT);
memset(_screenBuf, 0, GAME_SCREEN_WIDTH * FULL_SCREEN_HEIGHT);
@@ -336,7 +328,6 @@ void Control::initPanel(void) {
}
void Control::buttonControl(ConResource *pButton) {
-
char autoSave[] = "Restore Autosave";
if (pButton == NULL) {
if (_textSprite)
@@ -368,7 +359,6 @@ void Control::buttonControl(ConResource *pButton) {
}
void Control::drawTextCross(uint32 flags) {
-
_bodge->drawToScreen(NO_MASK);
if (!(flags & SF_ALLOW_SPEECH))
drawCross(151, 124);
@@ -377,7 +367,6 @@ void Control::drawTextCross(uint32 flags) {
}
void Control::drawCross(uint16 x, uint16 y) {
-
_text->flushForRedraw();
uint8 *bufPos, *crossPos;
bufPos = _screenBuf + y * GAME_SCREEN_WIDTH + x;
@@ -395,7 +384,6 @@ void Control::drawCross(uint16 x, uint16 y) {
}
void Control::animClick(ConResource *pButton) {
-
if (pButton->_curSprite != pButton->_numSprites -1) {
pButton->_curSprite++;
_text->flushForRedraw();
@@ -412,7 +400,6 @@ void Control::animClick(ConResource *pButton) {
}
void Control::drawMainPanel(void) {
-
memset(_screenBuf, 0, GAME_SCREEN_WIDTH * FULL_SCREEN_HEIGHT);
_system->copyRectToScreen(_screenBuf, GAME_SCREEN_WIDTH, 0, 0, GAME_SCREEN_WIDTH, FULL_SCREEN_HEIGHT);
_controlPanel->drawToScreen(NO_MASK);
@@ -462,10 +449,10 @@ void Control::doLoadSavePanel(void) {
}
void Control::doControlPanel(void) {
-
if (SkyEngine::isDemo()) {
return;
}
+
initPanel();
_savedCharSet = _skyText->giveCurrentCharSet();
@@ -538,7 +525,6 @@ void Control::doControlPanel(void) {
}
uint16 Control::handleClick(ConResource *pButton) {
-
char quitDos[] = "Quit to DOS?";
char restart[] = "Restart?";
@@ -615,7 +601,6 @@ uint16 Control::handleClick(ConResource *pButton) {
}
bool Control::getYesNo(char *text) {
-
bool retVal = false;
bool quitPanel = false;
uint8 mouseType = MOUSE_NORMAL;
@@ -669,7 +654,6 @@ bool Control::getYesNo(char *text) {
}
uint16 Control::doMusicSlide(void) {
-
Common::Point mouse = _system->getEventManager()->getMousePos();
int ofsY = _slide2->_y - mouse.y;
uint8 volume;
@@ -697,7 +681,6 @@ uint16 Control::doMusicSlide(void) {
}
uint16 Control::doSpeedSlide(void) {
-
Common::Point mouse = _system->getEventManager()->getMousePos();
int ofsY = _slide->_y - mouse.y;
uint16 speedDelay = _slide->_y - (MPNL_Y + 93);
@@ -728,7 +711,6 @@ uint16 Control::doSpeedSlide(void) {
}
void Control::toggleFx(ConResource *pButton) {
-
SkyEngine::_systemVars.systemFlags ^= SF_FX_OFF;
if (SkyEngine::_systemVars.systemFlags & SF_FX_OFF) {
pButton->_curSprite = 0;
@@ -745,7 +727,6 @@ void Control::toggleFx(ConResource *pButton) {
}
uint16 Control::toggleText(void) {
-
uint32 flags = SkyEngine::_systemVars.systemFlags & TEXT_FLAG_MASK;
SkyEngine::_systemVars.systemFlags &= ~TEXT_FLAG_MASK;
@@ -772,7 +753,6 @@ uint16 Control::toggleText(void) {
}
void Control::toggleMusic(ConResource *pButton) {
-
SkyEngine::_systemVars.systemFlags ^= SF_MUS_OFF;
if (SkyEngine::_systemVars.systemFlags & SF_MUS_OFF) {
_skyMusic->startMusic(0);
@@ -791,7 +771,6 @@ void Control::toggleMusic(ConResource *pButton) {
}
uint16 Control::shiftDown(uint8 speed) {
-
if (speed == SLOW) {
if (_firstText >= MAX_SAVE_GAMES - MAX_ON_SCREEN)
return 0;
@@ -804,11 +783,11 @@ uint16 Control::shiftDown(uint8 speed) {
else
return 0;
}
+
return SHIFTED;
}
uint16 Control::shiftUp(uint8 speed) {
-
if (speed == SLOW) {
if (_firstText > 0)
_firstText--;
@@ -826,7 +805,6 @@ uint16 Control::shiftUp(uint8 speed) {
}
bool Control::autoSaveExists(void) {
-
bool test = false;
Common::InSaveFile *f;
char fName[20];
@@ -844,7 +822,6 @@ bool Control::autoSaveExists(void) {
}
uint16 Control::saveRestorePanel(bool allowSave) {
-
_keyPressed.reset();
_mouseWheel = 0;
buttonControl(NULL);
@@ -986,7 +963,6 @@ uint16 Control::saveRestorePanel(bool allowSave) {
}
void Control::handleKeyPress(Common::KeyState kbd, Common::String &textBuf) {
-
if (kbd.keycode == Common::KEYCODE_BACKSPACE) { // backspace
if (textBuf.size() > 0)
textBuf.deleteLastChar();
@@ -1012,7 +988,6 @@ void Control::handleKeyPress(Common::KeyState kbd, Common::String &textBuf) {
}
void Control::setUpGameSprites(const Common::StringList &saveGameNames, dataFileHeader **nameSprites, uint16 firstNum, uint16 selectedGame) {
-
char cursorChar[2] = "-";
displayText_t textSpr;
if (!nameSprites[MAX_ON_SCREEN]) {
@@ -1037,7 +1012,6 @@ void Control::setUpGameSprites(const Common::StringList &saveGameNames, dataFile
}
void Control::showSprites(dataFileHeader **nameSprites, bool allowSave) {
-
ConResource *drawResource = new ConResource(NULL, 1, 0, 0, 0, 0, 0, _system, _screenBuf);
for (uint16 cnt = 0; cnt < MAX_ON_SCREEN; cnt++) {
drawResource->setSprite(nameSprites[cnt]);
@@ -1059,7 +1033,6 @@ void Control::showSprites(dataFileHeader **nameSprites, bool allowSave) {
}
void Control::loadDescriptions(Common::StringList &savenames) {
-
savenames.resize(MAX_SAVE_GAMES);
Common::InSaveFile *inf;
@@ -1078,7 +1051,6 @@ void Control::loadDescriptions(Common::StringList &savenames) {
}
bool Control::loadSaveAllowed(void) {
-
if (SkyEngine::_systemVars.systemFlags & SF_CHOOSING)
return false; // texts get lost during load/save, so don't allow it during choosing
if (Logic::_scriptVariables[SCREEN] >= 101)
@@ -1106,7 +1078,6 @@ int Control::displayMessage(const char *altButton, const char *message, ...) {
}
void Control::saveDescriptions(const Common::StringList &list) {
-
Common::OutSaveFile *outf;
outf = _saveFileMan->openForSaving("SKY-VM.SAV");
@@ -1176,7 +1147,6 @@ uint16 Control::saveGameToFile(void) {
#define STOSW(ptr, val) { *(uint16 *)(ptr) = TO_LE_16(val); (ptr) += 2; }
uint32 Control::prepareSaveData(uint8 *destBuf) {
-
uint32 cnt;
memset(destBuf, 0, 4); // space for data size
uint8 *destPos = destBuf + 4;
@@ -1518,7 +1488,6 @@ void Control::restartGame(void) {
}
void Control::delay(unsigned int amount) {
-
Common::Event event;
uint32 start = _system->getMillis();
@@ -1569,7 +1538,6 @@ void Control::delay(unsigned int amount) {
}
void Control::showGameQuitMsg(void) {
-
_skyText->fnSetFont(0);
uint8 *textBuf1 = (uint8 *)malloc(GAME_SCREEN_WIDTH * 14 + sizeof(dataFileHeader));
uint8 *textBuf2 = (uint8 *)malloc(GAME_SCREEN_WIDTH * 14 + sizeof(dataFileHeader));
diff --git a/engines/sky/disk.cpp b/engines/sky/disk.cpp
index a30276f8be..44c38ced77 100644
--- a/engines/sky/disk.cpp
+++ b/engines/sky/disk.cpp
@@ -82,7 +82,6 @@ bool Disk::fileExists(uint16 fileNr) {
// allocate memory, load the file and return a pointer
uint8 *Disk::loadFile(uint16 fileNr) {
-
uint8 cflag;
debug(2, "load file %d,%d (%d)", (fileNr >> 11), (fileNr & 2047), fileNr);
@@ -188,7 +187,6 @@ uint16 *Disk::loadScriptFile(uint16 fileNr) {
}
uint8 *Disk::getFileInfo(uint16 fileNr) {
-
uint16 i;
uint16 *dnrTbl16Ptr = (uint16 *)_dinnerTableArea;
@@ -204,7 +202,6 @@ uint8 *Disk::getFileInfo(uint16 fileNr) {
}
void Disk::fnCacheChip(uint16 *fList) {
-
// fnCacheChip is called after fnCacheFast
uint16 cnt = 0;
while (_buildList[cnt])
@@ -228,7 +225,6 @@ void Disk::fnCacheFast(uint16 *fList) {
}
void Disk::fnCacheFiles(void) {
-
uint16 lCnt, bCnt, targCnt;
targCnt = lCnt = 0;
bool found;
@@ -282,7 +278,6 @@ void Disk::fnCacheFiles(void) {
}
void Disk::refreshFilesList(uint32 *list) {
-
uint8 cnt = 0;
while (_loadedFilesList[cnt]) {
if (SkyEngine::_itemList[_loadedFilesList[cnt] & 2047])
@@ -300,7 +295,6 @@ void Disk::refreshFilesList(uint32 *list) {
}
void Disk::fnMiniLoad(uint16 fileNum) {
-
uint16 cnt = 0;
while (_loadedFilesList[cnt]) {
if (_loadedFilesList[cnt] == fileNum)
@@ -313,7 +307,6 @@ void Disk::fnMiniLoad(uint16 fileNum) {
}
void Disk::fnFlushBuffers(void) {
-
// dump all loaded sprites
uint8 lCnt = 0;
while (_loadedFilesList[lCnt]) {
diff --git a/engines/sky/grid.cpp b/engines/sky/grid.cpp
index 83ca55d00d..d9b7a17351 100644
--- a/engines/sky/grid.cpp
+++ b/engines/sky/grid.cpp
@@ -34,7 +34,6 @@ namespace Sky {
#define GRID_FILE_START 60000
int8 Grid::_gridConvertTable[] = {
-
0, //0
1, //1
2, //2
diff --git a/engines/sky/intro.cpp b/engines/sky/intro.cpp
index 40c53a3686..7be8932bf9 100644
--- a/engines/sky/intro.cpp
+++ b/engines/sky/intro.cpp
@@ -625,7 +625,6 @@ uint16 Intro::_floppyIntroSeq[] = {
};
Intro::Intro(Disk *disk, Screen *screen, MusicBase *music, Sound *sound, Text *text, Audio::Mixer *mixer, OSystem *system) {
-
_skyDisk = disk;
_skyScreen = screen;
_skyMusic = music;
@@ -648,7 +647,6 @@ Intro::~Intro(void) {
}
bool Intro::doIntro(bool floppyIntro) {
-
if (!SkyEngine::isCDVersion())
floppyIntro = true;
@@ -678,7 +676,6 @@ bool Intro::doIntro(bool floppyIntro) {
}
bool Intro::nextPart(uint16 *&data) {
-
uint8 *vData = NULL;
// return false means cancel intro
uint16 command = *data++;
@@ -771,7 +768,6 @@ bool Intro::nextPart(uint16 *&data) {
}
bool Intro::floppyScrollFlirt(void) {
-
uint8 *scrollScreen = (uint8*)malloc(FRAME_SIZE * 2);
memset(scrollScreen, 0, FRAME_SIZE);
memcpy(scrollScreen + FRAME_SIZE, _skyScreen->giveCurrent(), FRAME_SIZE);
@@ -815,7 +811,6 @@ bool Intro::floppyScrollFlirt(void) {
}
bool Intro::commandFlirt(uint16 *&data) {
-
_skyScreen->startSequence(*data++);
while ((*data != COMMANDEND) || _skyScreen->sequenceRunning()) {
while ((_skyScreen->seqFramesLeft() < *data)) {
@@ -854,7 +849,6 @@ bool Intro::commandFlirt(uint16 *&data) {
}
void Intro::showTextBuf(void) {
-
uint16 x = ((dataFileHeader*)_textBuf)->s_x;
uint16 y = ((dataFileHeader*)_textBuf)->s_y;
uint16 width = ((dataFileHeader*)_textBuf)->s_width;
@@ -877,7 +871,6 @@ void Intro::showTextBuf(void) {
}
void Intro::restoreScreen(void) {
-
uint16 x = ((dataFileHeader*)_saveBuf)->s_x;
uint16 y = ((dataFileHeader*)_saveBuf)->s_y;
uint16 width = ((dataFileHeader*)_saveBuf)->s_width;
@@ -893,7 +886,6 @@ void Intro::restoreScreen(void) {
}
bool Intro::escDelay(uint32 msecs) {
-
Common::EventManager *eventMan = _system->getEventManager();
Common::Event event;
if (_relDelay == 0) // first call, init with system time
diff --git a/engines/sky/mouse.cpp b/engines/sky/mouse.cpp
index 1fc9e47539..af9faea628 100644
--- a/engines/sky/mouse.cpp
+++ b/engines/sky/mouse.cpp
@@ -93,7 +93,6 @@ uint32 Mouse::_mouseLincObjects[21] = {
};
Mouse::Mouse(OSystem *system, Disk *skyDisk, SkyCompact *skyCompact) {
-
_skyDisk = skyDisk;
_skyCompact = skyCompact;
_system = system;
@@ -172,7 +171,6 @@ void Mouse::drawNewMouse() {
}
void Mouse::waitMouseNotPressed(int minDelay) {
-
bool mousePressed = true;
uint32 now = _system->getMillis();
Common::Event event;
@@ -205,7 +203,6 @@ void Mouse::waitMouseNotPressed(int minDelay) {
}
void Mouse::spriteMouse(uint16 frameNum, uint8 mouseX, uint8 mouseY) {
-
_currentCursor = frameNum;
byte *newCursor = _miceData;
@@ -301,7 +298,6 @@ void Mouse::resetCursor() {
}
uint16 Mouse::findMouseCursor(uint32 itemNum) {
-
uint8 cnt;
for (cnt = 0; cnt < NO_MAIN_OBJECTS; cnt++) {
if (itemNum == _mouseMainObjects[cnt]) {
@@ -317,7 +313,6 @@ uint16 Mouse::findMouseCursor(uint32 itemNum) {
}
void Mouse::fnOpenCloseHand(bool open) {
-
if ((!open) && (!Logic::_scriptVariables[OBJECT_HELD])) {
spriteMouse(1, 0, 0);
return;
@@ -337,7 +332,6 @@ void Mouse::fnOpenCloseHand(bool open) {
}
bool Mouse::wasClicked(void) {
-
if (_logicClick) {
_logicClick = false;
return true;
diff --git a/engines/sky/music/adlibchannel.cpp b/engines/sky/music/adlibchannel.cpp
index 588057a7c8..52c5a397b3 100644
--- a/engines/sky/music/adlibchannel.cpp
+++ b/engines/sky/music/adlibchannel.cpp
@@ -84,7 +84,6 @@ AdlibChannel::~AdlibChannel(void) {
}
bool AdlibChannel::isActive(void) {
-
return _channelData.channelActive;
}
@@ -97,7 +96,6 @@ void AdlibChannel::updateVolume(uint16 pVolume) {
by all instances of the class.
*/
void AdlibChannel::setRegister(uint8 regNum, uint8 value) {
-
if (_adlibRegMirror[regNum] != value) {
OPLWriteReg (_opl, regNum, value);
_adlibRegMirror[regNum] = value;
@@ -105,7 +103,6 @@ void AdlibChannel::setRegister(uint8 regNum, uint8 value) {
}
void AdlibChannel::stopNote(void) {
-
if (_channelData.note & 0x20) {
_channelData.note &= ~0x20;
setRegister(0xB0 | _channelData.adlibChannelNumber, _channelData.note);
@@ -129,7 +126,6 @@ int32 AdlibChannel::getNextEventTime(void) {
}
uint8 AdlibChannel::process(uint16 aktTime) {
-
if (!_channelData.channelActive) {
return 0;
}
@@ -190,7 +186,6 @@ uint8 AdlibChannel::process(uint16 aktTime) {
}
void AdlibChannel::setupInstrument(uint8 opcode) {
-
uint16 nextNote;
if (_channelData.tremoVibro) {
uint8 newInstrument = _instrumentMap[opcode];
@@ -211,7 +206,6 @@ void AdlibChannel::setupInstrument(uint8 opcode) {
}
void AdlibChannel::setupChannelVolume(uint8 volume) {
-
uint8 resultOp;
uint32 resVol = ((volume + 1) * (_channelData.instrumentData->totOutLev_Op2 + 1)) << 1;
resVol &= 0xFFFF;
@@ -233,7 +227,6 @@ void AdlibChannel::setupChannelVolume(uint8 volume) {
}
void AdlibChannel::adlibSetupInstrument(void) {
-
setRegister(0x60 | _channelData.adlibReg1, _channelData.instrumentData->ad_Op1);
setRegister(0x60 | _channelData.adlibReg2, _channelData.instrumentData->ad_Op2);
setRegister(0x80 | _channelData.adlibReg1, _channelData.instrumentData->sr_Op1);
@@ -246,7 +239,6 @@ void AdlibChannel::adlibSetupInstrument(void) {
}
uint16 AdlibChannel::getNextNote(uint8 param) {
-
int16 freqIndex = ((int16)_channelData.freqOffset) - 0x40;
if (freqIndex >= 0x3F)
freqIndex++;
@@ -264,20 +256,17 @@ uint16 AdlibChannel::getNextNote(uint8 param) {
//- command 90h routines
void AdlibChannel::com90_caseNoteOff(void) {
-
if (_musicData[_channelData.eventDataPtr] == _channelData.lastCommand)
stopNote();
_channelData.eventDataPtr++;
}
void AdlibChannel::com90_stopChannel(void) {
-
stopNote();
_channelData.channelActive = false;
}
void AdlibChannel::com90_setupInstrument(void) {
-
_channelData.channelVolume = 0x7F;
_channelData.freqOffset = 0x40;
_channelData.assignedInstrument = _musicData[_channelData.eventDataPtr];
@@ -291,7 +280,6 @@ uint8 AdlibChannel::com90_updateTempo(void) {
}
void AdlibChannel::com90_getFreqOffset(void) {
-
_channelData.freqOffset = _musicData[_channelData.eventDataPtr++];
if (_channelData.note & 0x20) {
uint16 nextNote = getNextNote(
@@ -303,27 +291,22 @@ void AdlibChannel::com90_getFreqOffset(void) {
}
void AdlibChannel::com90_getChannelVolume(void) {
-
_channelData.channelVolume = _musicData[_channelData.eventDataPtr++];
}
void AdlibChannel::com90_getTremoVibro(void) {
-
_channelData.tremoVibro = _musicData[_channelData.eventDataPtr++];
}
void AdlibChannel::com90_loopMusic(void) {
-
_channelData.eventDataPtr = _channelData.loopPoint;
}
void AdlibChannel::com90_keyOff(void) {
-
stopNote();
}
void AdlibChannel::com90_setLoopPoint(void) {
-
_channelData.loopPoint = _channelData.eventDataPtr;
}
diff --git a/engines/sky/music/adlibmusic.cpp b/engines/sky/music/adlibmusic.cpp
index 4434f4cd68..77852786fd 100644
--- a/engines/sky/music/adlibmusic.cpp
+++ b/engines/sky/music/adlibmusic.cpp
@@ -33,9 +33,7 @@
namespace Sky {
-AdlibMusic::AdlibMusic(Audio::Mixer *pMixer, Disk *pDisk)
- : MusicBase(pDisk) {
-
+AdlibMusic::AdlibMusic(Audio::Mixer *pMixer, Disk *pDisk) : MusicBase(pDisk) {
_driverFileBase = 60202;
_mixer = pMixer;
_sampleRate = pMixer->getOutputRate();
@@ -46,13 +44,11 @@ AdlibMusic::AdlibMusic(Audio::Mixer *pMixer, Disk *pDisk)
}
AdlibMusic::~AdlibMusic(void) {
-
OPLDestroy(_opl);
_mixer->stopHandle(_soundHandle);
}
int AdlibMusic::readBuffer(int16 *data, const int numSamples) {
-
if (_musicData == NULL) {
// no music loaded
memset(data, 0, numSamples * sizeof(int16));
@@ -81,7 +77,6 @@ int AdlibMusic::readBuffer(int16 *data, const int numSamples) {
}
void AdlibMusic::setupPointers(void) {
-
if (SkyEngine::_systemVars.gameVersion == 109) {
// disk demo uses a different adlib driver version, some offsets have changed
//_musicDataLoc = (_musicData[0x11CC] << 8) | _musicData[0x11CB];
@@ -100,7 +95,6 @@ void AdlibMusic::setupPointers(void) {
}
void AdlibMusic::setupChannels(uint8 *channelData) {
-
_numberOfChannels = channelData[0];
channelData++;
for (uint8 cnt = 0; cnt < _numberOfChannels; cnt++) {
@@ -110,7 +104,6 @@ void AdlibMusic::setupChannels(uint8 *channelData) {
}
void AdlibMusic::startDriver(void) {
-
uint16 cnt = 0;
while (_initSequence[cnt] || _initSequence[cnt + 1]) {
OPLWriteReg (_opl, _initSequence[cnt], _initSequence[cnt + 1]);
diff --git a/engines/sky/music/gmchannel.cpp b/engines/sky/music/gmchannel.cpp
index fc35fed391..97ac2ebc28 100644
--- a/engines/sky/music/gmchannel.cpp
+++ b/engines/sky/music/gmchannel.cpp
@@ -30,7 +30,6 @@
namespace Sky {
GmChannel::GmChannel(uint8 *pMusicData, uint16 startOfData, MidiDriver *pMidiDrv, const byte *pInstMap, const byte *veloTab) {
-
_musicData = pMusicData;
_midiDrv = pMidiDrv;
_channelData.midiChannelNumber = 0;
@@ -54,7 +53,6 @@ bool GmChannel::isActive(void) {
}
void GmChannel::updateVolume(uint16 pVolume) {
-
_musicVolume = pVolume;
if (_musicVolume > 0)
_musicVolume = (_musicVolume * 2) / 3 + 43;
@@ -64,7 +62,6 @@ void GmChannel::updateVolume(uint16 pVolume) {
}
void GmChannel::stopNote(void) {
-
// All Notes Off
_midiDrv->send((0xB0 | _channelData.midiChannelNumber) | 0x7B00 | 0 | 0x79000000);
// Reset the Pitch Wheel. See bug #1016556.
@@ -72,7 +69,6 @@ void GmChannel::stopNote(void) {
}
int32 GmChannel::getNextEventTime(void) {
-
int32 retV = 0;
uint8 cnt, lVal = 0;
for (cnt = 0; cnt < 4; cnt++) {
@@ -89,7 +85,6 @@ int32 GmChannel::getNextEventTime(void) {
}
uint8 GmChannel::process(uint16 aktTime) {
-
if (!_channelData.channelActive)
return 0;
@@ -145,13 +140,11 @@ uint8 GmChannel::process(uint16 aktTime) {
//- command 90h routines
void GmChannel::com90_caseNoteOff(void) {
-
_midiDrv->send((0x90 | _channelData.midiChannelNumber) | (_musicData[_channelData.eventDataPtr] << 8));
_channelData.eventDataPtr++;
}
void GmChannel::com90_stopChannel(void) {
-
stopNote();
_channelData.channelActive = false;
}
@@ -169,41 +162,34 @@ uint8 GmChannel::com90_updateTempo(void) {
}
void GmChannel::com90_getPitch(void) {
-
_midiDrv->send((0xE0 | _channelData.midiChannelNumber) | 0 | (_musicData[_channelData.eventDataPtr] << 16));
_channelData.eventDataPtr++;
}
void GmChannel::com90_getChannelVolume(void) {
-
_currentChannelVolume = _musicData[_channelData.eventDataPtr++];
uint8 newVol = (uint8)((_currentChannelVolume * _musicVolume) >> 7);
_midiDrv->send((0xB0 | _channelData.midiChannelNumber) | 0x700 | (newVol << 16));
}
void GmChannel::com90_loopMusic(void) {
-
_channelData.eventDataPtr = _channelData.loopPoint;
}
void GmChannel::com90_keyOff(void) {
-
_midiDrv->send((0x90 | _channelData.midiChannelNumber) | (_channelData.note << 8) | 0);
}
void GmChannel::com90_setLoopPoint(void) {
-
_channelData.loopPoint = _channelData.eventDataPtr;
}
void GmChannel::com90_getChannelPanValue(void) {
-
_midiDrv->send((0xB0 | _channelData.midiChannelNumber) | 0x0A00 | (_musicData[_channelData.eventDataPtr] << 16));
_channelData.eventDataPtr++;
}
void GmChannel::com90_getChannelControl(void) {
-
uint8 conNum = _musicData[_channelData.eventDataPtr++];
uint8 conDat = _musicData[_channelData.eventDataPtr++];
_midiDrv->send((0xB0 | _channelData.midiChannelNumber) | (conNum << 8) | (conDat << 16));
diff --git a/engines/sky/music/gmmusic.cpp b/engines/sky/music/gmmusic.cpp
index 2a1e8dcc1d..46832a8255 100644
--- a/engines/sky/music/gmmusic.cpp
+++ b/engines/sky/music/gmmusic.cpp
@@ -33,13 +33,10 @@
namespace Sky {
void GmMusic::passTimerFunc(void *param) {
-
((GmMusic*)param)->timerCall();
}
-GmMusic::GmMusic(MidiDriver *pMidiDrv, Disk *pDisk)
- : MusicBase(pDisk) {
-
+GmMusic::GmMusic(MidiDriver *pMidiDrv, Disk *pDisk) : MusicBase(pDisk) {
_driverFileBase = 60200;
_midiDrv = pMidiDrv;
int midiRes = _midiDrv->open();
@@ -50,7 +47,6 @@ GmMusic::GmMusic(MidiDriver *pMidiDrv, Disk *pDisk)
}
GmMusic::~GmMusic(void) {
-
_midiDrv->setTimerCallback(NULL, NULL);
if (_currentMusic)
stopMusic();
@@ -64,7 +60,6 @@ GmMusic::~GmMusic(void) {
}
void GmMusic::setVolume(uint16 param) {
-
_musicVolume = param;
for (uint8 cnt = 0; cnt < _numberOfChannels; cnt++)
_channels[cnt]->updateVolume(_musicVolume);
@@ -81,7 +76,6 @@ void GmMusic::timerCall(void) {
}
void GmMusic::setupPointers(void) {
-
if (SkyEngine::_systemVars.gameVersion == 109) {
_musicDataLoc = READ_LE_UINT16(_musicData + 0x79B);
_sysExSequence = _musicData + 0x1EF2;
@@ -92,7 +86,6 @@ void GmMusic::setupPointers(void) {
}
void GmMusic::setupChannels(uint8 *channelData) {
-
_numberOfChannels = channelData[0];
channelData++;
for (uint8 cnt = 0; cnt < _numberOfChannels; cnt++) {
diff --git a/engines/sky/music/mt32music.cpp b/engines/sky/music/mt32music.cpp
index aa784e7437..816a77fa9a 100644
--- a/engines/sky/music/mt32music.cpp
+++ b/engines/sky/music/mt32music.cpp
@@ -33,13 +33,10 @@
namespace Sky {
void MT32Music::passTimerFunc(void *param) {
-
((MT32Music*)param)->timerCall();
}
-MT32Music::MT32Music(MidiDriver *pMidiDrv, Disk *pDisk)
- : MusicBase(pDisk) {
-
+MT32Music::MT32Music(MidiDriver *pMidiDrv, Disk *pDisk) : MusicBase(pDisk) {
_driverFileBase = 60200;
_midiDrv = pMidiDrv;
int midiRes = _midiDrv->open();
@@ -50,7 +47,6 @@ MT32Music::MT32Music(MidiDriver *pMidiDrv, Disk *pDisk)
}
MT32Music::~MT32Music(void) {
-
_midiDrv->close();
_midiDrv->setTimerCallback(NULL, NULL);
delete _midiDrv;
@@ -78,13 +74,11 @@ void MT32Music::setVolume(uint16 volume) {
}
void MT32Music::setupPointers(void) {
-
_musicDataLoc = READ_LE_UINT16(_musicData + 0x7DC);
_sysExSequence = READ_LE_UINT16(_musicData + 0x7E0) + _musicData;
}
void MT32Music::setupChannels(uint8 *channelData) {
-
_numberOfChannels = channelData[0];
channelData++;
for (uint8 cnt = 0; cnt < _numberOfChannels; cnt++) {
@@ -95,7 +89,6 @@ void MT32Music::setupChannels(uint8 *channelData) {
}
bool MT32Music::processPatchSysEx(uint8 *sysExData) {
-
uint8 sysExBuf[15];
uint8 crc = 0;
if (sysExData[0] & 0x80)
@@ -125,7 +118,6 @@ bool MT32Music::processPatchSysEx(uint8 *sysExData) {
}
void MT32Music::startDriver(void) {
-
// setup timbres and patches using SysEx data
uint8* sysExData = _sysExSequence;
uint8 timbreNum = sysExData[0];
diff --git a/engines/sky/music/musicbase.cpp b/engines/sky/music/musicbase.cpp
index 9bf7a62a21..17d022e774 100644
--- a/engines/sky/music/musicbase.cpp
+++ b/engines/sky/music/musicbase.cpp
@@ -31,7 +31,6 @@
namespace Sky {
MusicBase::MusicBase(Disk *pDisk) {
-
_musicData = NULL;
_skyDisk = pDisk;
_currentMusic = 0;
@@ -40,14 +39,12 @@ MusicBase::MusicBase(Disk *pDisk) {
}
MusicBase::~MusicBase(void) {
-
stopMusic();
if (_musicData)
free(_musicData);
}
void MusicBase::loadSection(uint8 pSection) {
-
_mutex.lock();
if (_currentMusic)
stopMusicInternal();
@@ -67,7 +64,6 @@ void MusicBase::loadSection(uint8 pSection) {
}
bool MusicBase::musicIsPlaying(void) {
-
for (uint8 cnt = 0; cnt < _numberOfChannels; cnt++)
if (_channels[cnt]->isActive())
return true;
@@ -75,21 +71,18 @@ bool MusicBase::musicIsPlaying(void) {
}
void MusicBase::stopMusic(void) {
-
_mutex.lock();
stopMusicInternal();
_mutex.unlock();
}
void MusicBase::stopMusicInternal(void) {
-
for (uint8 cnt = 0; cnt < _numberOfChannels; cnt++)
delete _channels[cnt];
_numberOfChannels = 0;
}
void MusicBase::updateTempo(void) {
-
uint16 tempoMul = _musicTempo0 * _musicTempo1;
uint16 divisor = 0x4446390/ 23864;
_tempo = (tempoMul / divisor) << 16;
@@ -97,7 +90,6 @@ void MusicBase::updateTempo(void) {
}
void MusicBase::loadNewMusic(void) {
-
uint16 musicPos;
if (_onNextPoll.musicToProcess > _musicData[_musicDataLoc]) {
error("Music %d requested but doesn't exist in file.", _onNextPoll.musicToProcess);
@@ -123,7 +115,6 @@ void MusicBase::loadNewMusic(void) {
}
void MusicBase::pollMusic(void) {
-
_mutex.lock();
uint8 newTempo;
if (_onNextPoll.musicToProcess != _currentMusic)
diff --git a/engines/sky/screen.cpp b/engines/sky/screen.cpp
index 9ecb838c6b..f632d55e81 100644
--- a/engines/sky/screen.cpp
+++ b/engines/sky/screen.cpp
@@ -58,7 +58,6 @@ uint8 Screen::_top16Colours[16*3] = {
};
Screen::Screen(OSystem *pSystem, Disk *pDisk, SkyCompact *skyCompact) {
-
_system = pSystem;
_skyDisk = pDisk;
_skyCompact = skyCompact;
@@ -93,7 +92,6 @@ Screen::Screen(OSystem *pSystem, Disk *pDisk, SkyCompact *skyCompact) {
}
Screen::~Screen(void) {
-
free(_gameGrid);
if (_currentScreen)
free(_currentScreen);
@@ -102,7 +100,6 @@ Screen::~Screen(void) {
}
void Screen::clearScreen(void) {
-
memset(_currentScreen, 0, FULL_SCREEN_WIDTH * FULL_SCREEN_HEIGHT);
_system->copyRectToScreen(_currentScreen, GAME_SCREEN_WIDTH, 0, 0, GAME_SCREEN_WIDTH, GAME_SCREEN_HEIGHT);
_system->updateScreen();
@@ -114,14 +111,12 @@ void Screen::setFocusRectangle(const Common::Rect& rect) {
//set a new palette, pal is a pointer to dos vga rgb components 0..63
void Screen::setPalette(uint8 *pal) {
-
convertPalette(pal, _palette);
_system->setPalette(_palette, 0, GAME_COLOURS);
_system->updateScreen();
}
void Screen::setPaletteEndian(uint8 *pal) {
-
#ifdef SCUMM_BIG_ENDIAN
uint8 endPalette[256 * 3];
for (uint16 cnt = 0; cnt < 256 * 3; cnt++)
@@ -135,7 +130,6 @@ void Screen::setPaletteEndian(uint8 *pal) {
}
void Screen::halvePalette(void) {
-
uint8 halfPalette[1024];
for (uint8 cnt = 0; cnt < GAME_COLOURS; cnt++) {
halfPalette[(cnt << 2) | 0] = _palette[(cnt << 2) | 0] >> 1;
@@ -147,7 +141,6 @@ void Screen::halvePalette(void) {
}
void Screen::setPalette(uint16 fileNum) {
-
uint8 *tmpPal = _skyDisk->loadFile(fileNum);
if (tmpPal) {
setPalette(tmpPal);
@@ -171,13 +164,11 @@ void Screen::showScreen(uint16 fileNum) {
}
void Screen::showScreen(uint8 *pScreen) {
-
_system->copyRectToScreen(pScreen, 320, 0, 0, GAME_SCREEN_WIDTH, GAME_SCREEN_HEIGHT);
_system->updateScreen();
}
void Screen::convertPalette(uint8 *inPal, uint8* outPal) { //convert 3 byte 0..63 rgb to 4byte 0..255 rgbx
-
int i;
for (i = 0; i < VGA_COLOURS; i++) {
@@ -189,7 +180,6 @@ void Screen::convertPalette(uint8 *inPal, uint8* outPal) { //convert 3 byte 0..6
}
void Screen::recreate(void) {
-
// check the game grid for changed blocks
if (!Logic::_scriptVariables[LAYER_0_ID])
return;
@@ -223,7 +213,6 @@ void Screen::recreate(void) {
}
void Screen::flip(bool doUpdate) {
-
uint32 copyX, copyWidth;
copyX = copyWidth = 0;
for (uint8 cnty = 0; cnty < GRID_Y; cnty++) {
@@ -248,7 +237,6 @@ void Screen::flip(bool doUpdate) {
}
void Screen::fnDrawScreen(uint32 palette, uint32 scroll) {
-
// set up the new screen
fnFadeDown(scroll);
forceRefresh();
@@ -259,7 +247,6 @@ void Screen::fnDrawScreen(uint32 palette, uint32 scroll) {
}
void Screen::fnFadeDown(uint32 scroll) {
-
if (((scroll != 123) && (scroll != 321)) || (SkyEngine::_systemVars.systemFlags & SF_NO_SCROLL)) {
uint32 delayTime = _system->getMillis();
for (uint8 cnt = 0; cnt < 32; cnt++) {
@@ -303,7 +290,6 @@ void Screen::palette_fadedown_helper(uint32 *pal, uint num) {
}
void Screen::paletteFadeUp(uint16 fileNr) {
-
uint8 *pal = _skyDisk->loadFile(fileNr);
if (pal) {
paletteFadeUp(pal);
@@ -313,7 +299,6 @@ void Screen::paletteFadeUp(uint16 fileNr) {
}
void Screen::paletteFadeUp(uint8 *pal) {
-
byte tmpPal[1024];
convertPalette(pal, tmpPal);
@@ -336,7 +321,6 @@ void Screen::paletteFadeUp(uint8 *pal) {
}
void Screen::fnFadeUp(uint32 palNum, uint32 scroll) {
-
//_currentScreen points to new screen,
//_scrollScreen points to graphic showing old room
if ((scroll != 123) && (scroll != 321))
@@ -394,7 +378,6 @@ void Screen::fnFadeUp(uint32 palNum, uint32 scroll) {
}
void Screen::waitForTimer(void) {
-
Common::EventManager *eventMan = _system->getEventManager();
_gotTick = false;
while (!_gotTick) {
@@ -418,14 +401,12 @@ void Screen::waitForSequence(void) {
}
void Screen::handleTimer(void) {
-
_gotTick = true;
if (_seqInfo.running)
processSequence();
}
void Screen::startSequence(uint16 fileNum) {
-
_seqInfo.seqData = _skyDisk->loadFile(fileNum);
_seqInfo.framesLeft = _seqInfo.seqData[0];
_seqInfo.seqDataPos = _seqInfo.seqData + 1;
@@ -435,7 +416,6 @@ void Screen::startSequence(uint16 fileNum) {
}
void Screen::startSequenceItem(uint16 itemNum) {
-
_seqInfo.seqData = (uint8 *)SkyEngine::fetchItem(itemNum);
_seqInfo.framesLeft = _seqInfo.seqData[0] - 1;
_seqInfo.seqDataPos = _seqInfo.seqData + 1;
@@ -445,7 +425,6 @@ void Screen::startSequenceItem(uint16 itemNum) {
}
void Screen::stopSequence() {
-
_seqInfo.running = false;
waitForTimer();
waitForTimer();
@@ -455,7 +434,6 @@ void Screen::stopSequence() {
}
void Screen::processSequence(void) {
-
uint32 screenPos = 0;
_seqInfo.delay--;
@@ -533,14 +511,12 @@ void Screen::processSequence(void) {
//- sprites.asm routines
void Screen::spriteEngine(void) {
-
doSprites(BACK);
sortSprites();
doSprites(FORE);
}
void Screen::sortSprites(void) {
-
StSortList sortList[30];
uint32 currDrawList = DRAW_LIST_NO;
uint32 loadDrawList;
@@ -610,7 +586,6 @@ void Screen::sortSprites(void) {
}
void Screen::doSprites(uint8 layer) {
-
uint16 drawListNum = DRAW_LIST_NO;
uint32 idNum;
uint16* drawList;
@@ -650,7 +625,6 @@ void Screen::doSprites(uint8 layer) {
}
void Screen::drawSprite(uint8 *spriteInfo, Compact *sprCompact) {
-
if (spriteInfo == NULL) {
warning("Screen::drawSprite Can't draw sprite. Data %d was not loaded", sprCompact->frame >> 6);
sprCompact->status = 0;
@@ -739,7 +713,6 @@ void Screen::drawSprite(uint8 *spriteInfo, Compact *sprCompact) {
}
void Screen::vectorToGame(uint8 gridVal) {
-
if (_sprWidth == 0)
return;
uint8 *trgGrid = _gameGrid + _sprY * GRID_X +_sprX;
@@ -751,7 +724,6 @@ void Screen::vectorToGame(uint8 gridVal) {
}
void Screen::vertMaskSub(uint16 *grid, uint32 gridOfs, uint8 *screenPtr, uint32 layerId) {
-
for (uint32 cntx = 0; cntx < _sprHeight; cntx++) { // start_x | block_loop
if (grid[gridOfs]) {
if (!(FROM_LE_16(grid[gridOfs]) & 0x8000)) {
@@ -775,7 +747,6 @@ void Screen::vertMaskSub(uint16 *grid, uint32 gridOfs, uint8 *screenPtr, uint32
}
void Screen::verticalMask(void) {
-
if (_sprWidth == 0)
return;
uint32 startGridOfs = (_sprY + _sprHeight - 1) * GRID_X + _sprX;
@@ -803,7 +774,6 @@ void Screen::verticalMask(void) {
}
void Screen::paintBox(uint16 x, uint16 y) {
-
uint8 *screenPos = _currentScreen + y * GAME_SCREEN_WIDTH + x;
memset(screenPos, 255, 8);
for (uint8 cnt = 1; cnt < 8; cnt++) {
@@ -814,7 +784,6 @@ void Screen::paintBox(uint16 x, uint16 y) {
}
void Screen::showGrid(uint8 *gridBuf) {
-
uint32 gridData = 0;
uint8 bitsLeft = 0;
for (uint16 cnty = 0; cnty < GAME_SCREEN_HEIGHT >> 3; cnty++) {
diff --git a/engines/sky/sky.cpp b/engines/sky/sky.cpp
index da63e432c2..872c039cf3 100644
--- a/engines/sky/sky.cpp
+++ b/engines/sky/sky.cpp
@@ -81,7 +81,6 @@ SkyEngine::SkyEngine(OSystem *syst)
}
SkyEngine::~SkyEngine() {
-
_timer->removeTimerProc(&timerHandler);
delete _skyLogic;
@@ -110,7 +109,6 @@ void SkyEngine::initVirgin() {
}
void SkyEngine::handleKey(void) {
-
if (_keyPressed.keycode && _systemVars.paused) {
_skySound->fnUnPauseFx();
_systemVars.paused = false;
@@ -155,7 +153,6 @@ void SkyEngine::handleKey(void) {
}
Common::Error SkyEngine::go() {
-
_keyPressed.reset();
uint16 result = 0;
@@ -355,7 +352,6 @@ Common::Error SkyEngine::init() {
}
void SkyEngine::initItemList() {
-
//See List.asm for (cryptic) item # descriptions
for (int i = 0; i < 300; i++)
@@ -363,7 +359,6 @@ void SkyEngine::initItemList() {
}
void SkyEngine::loadFixedItems(void) {
-
_itemList[49] = _skyDisk->loadFile(49);
_itemList[50] = _skyDisk->loadFile(50);
_itemList[73] = _skyDisk->loadFile(73);
@@ -383,22 +378,18 @@ void SkyEngine::loadFixedItems(void) {
}
void *SkyEngine::fetchItem(uint32 num) {
-
return _itemList[num];
}
void SkyEngine::timerHandler(void *refCon) {
-
((SkyEngine *)refCon)->gotTimerTick();
}
void SkyEngine::gotTimerTick(void) {
-
_skyScreen->handleTimer();
}
void SkyEngine::delay(int32 amount) {
-
Common::Event event;
uint32 start = _system->getMillis();
@@ -457,7 +448,6 @@ bool SkyEngine::isDemo(void) {
}
bool SkyEngine::isCDVersion(void) {
-
switch (_systemVars.gameVersion) {
case 109:
case 267:
diff --git a/engines/sky/sound.cpp b/engines/sky/sound.cpp
index f15038c0b6..9f15b38378 100644
--- a/engines/sky/sound.cpp
+++ b/engines/sky/sound.cpp
@@ -1036,7 +1036,6 @@ Sound::~Sound(void) {
}
void Sound::playSound(uint32 id, byte *sound, uint32 size, Audio::SoundHandle *handle) {
-
byte flags = 0;
flags |= Audio::Mixer::FLAG_UNSIGNED|Audio::Mixer::FLAG_AUTOFREE;
size -= sizeof(struct dataFileHeader);
@@ -1048,7 +1047,6 @@ void Sound::playSound(uint32 id, byte *sound, uint32 size, Audio::SoundHandle *h
}
void Sound::loadSection(uint8 pSection) {
-
fnStopFx();
_mixer->stopAll();
@@ -1082,7 +1080,6 @@ void Sound::loadSection(uint8 pSection) {
}
void Sound::playSound(uint16 sound, uint16 volume, uint8 channel) {
-
if (channel == 0)
_mixer->stopID(SOUND_CH0);
else
@@ -1128,7 +1125,6 @@ void Sound::playSound(uint16 sound, uint16 volume, uint8 channel) {
}
void Sound::fnStartFx(uint32 sound, uint8 channel) {
-
_saveSounds[channel] = 0xFFFF;
if (sound < 256 || sound > MAX_FX_NUMBER || (SkyEngine::_systemVars.systemFlags & SF_FX_OFF))
return;
@@ -1191,7 +1187,6 @@ void Sound::checkFxQueue(void) {
}
void Sound::restoreSfx(void) {
-
// queue sfx, so they will be started when the player exits the control panel
memset(_sfxQueue, 0, sizeof(_sfxQueue));
uint8 queueSlot = 0;
@@ -1221,7 +1216,6 @@ void Sound::stopSpeech(void) {
}
bool Sound::startSpeech(uint16 textNum) {
-
if (!(SkyEngine::_systemVars.systemFlags & SF_ALLOW_SPEECH))
return false;
uint16 speechFileNum = _speechConvertTable[textNum >> 12] + (textNum & 0xFFF);
@@ -1254,7 +1248,6 @@ bool Sound::startSpeech(uint16 textNum) {
}
void Sound::fnPauseFx(void) {
-
if (!_isPaused) {
_isPaused = true;
_mixer->pauseID(SOUND_CH0, true);
@@ -1263,7 +1256,6 @@ void Sound::fnPauseFx(void) {
}
void Sound::fnUnPauseFx(void) {
-
if (_isPaused) {
_isPaused = false;
_mixer->pauseID(SOUND_CH0, false);
diff --git a/engines/sky/text.cpp b/engines/sky/text.cpp
index 88e42954cb..a219eb86cf 100644
--- a/engines/sky/text.cpp
+++ b/engines/sky/text.cpp
@@ -87,7 +87,6 @@ Text::~Text(void) {
}
void Text::fnSetFont(uint32 fontNr) {
-
struct charSet *newCharSet;
switch (fontNr) {
@@ -111,7 +110,6 @@ void Text::fnSetFont(uint32 fontNr) {
}
void Text::fnTextModule(uint32 textInfoId, uint32 textNo) {
-
fnSetFont(1);
uint16* msgData = (uint16 *)_skyCompact->fetchCpt(textInfoId);
lowTextManager_t textId = lowTextManager(textNo, msgData[1], msgData[2], 209, false);
@@ -123,7 +121,6 @@ void Text::fnTextModule(uint32 textInfoId, uint32 textNo) {
}
void Text::getText(uint32 textNr) { //load text #"textNr" into textBuffer
-
if (patchMessage(textNr))
return;
@@ -185,7 +182,6 @@ void Text::getText(uint32 textNr) { //load text #"textNr" into textBuffer
}
void Text::fnPointerText(uint32 pointedId, uint16 mouseX, uint16 mouseY) {
-
Compact *ptrComp = _skyCompact->fetchCpt(pointedId);
lowTextManager_t text = lowTextManager(ptrComp->cursorText, TEXT_MOUSE_WIDTH, L_CURSOR, 242, false);
Logic::_scriptVariables[CURSOR_ID] = text.compactNum;
@@ -207,7 +203,6 @@ void Text::fnPointerText(uint32 pointedId, uint16 mouseX, uint16 mouseY) {
}
void Text::logicCursor(Compact *textCompact, uint16 mouseX, uint16 mouseY) {
-
textCompact->xcood = (uint16)(mouseX + _mouseOfsX);
textCompact->ycood = (uint16)(mouseY + _mouseOfsY);
if (textCompact->ycood < TOP_LEFT_Y)
@@ -215,7 +210,6 @@ void Text::logicCursor(Compact *textCompact, uint16 mouseX, uint16 mouseY) {
}
bool Text::getTextBit(uint8 **data, uint32 *bitPos) {
-
if (*bitPos) {
(*bitPos)--;
} else {
@@ -247,7 +241,6 @@ displayText_t Text::displayText(uint32 textNum, uint8 *dest, bool centre, uint16
}
displayText_t Text::displayText(char *textPtr, uint8 *dest, bool centre, uint16 pixelWidth, uint8 color) {
-
//Render text pointed to by *textPtr in buffer *dest
uint32 centerTable[10];
uint16 lineWidth = 0;
@@ -353,7 +346,6 @@ displayText_t Text::displayText(char *textPtr, uint8 *dest, bool centre, uint16
}
void Text::makeGameCharacter(uint8 textChar, uint8 *charSetPtr, uint8 *&dest, uint8 color, uint16 bufPitch) {
-
bool maskBit, dataBit;
uint8 charWidth = (uint8)((*(charSetPtr + textChar)) + 1 - _dtCharSpacing);
uint16 data, mask;
@@ -392,7 +384,6 @@ void Text::makeGameCharacter(uint8 textChar, uint8 *charSetPtr, uint8 *&dest, ui
}
lowTextManager_t Text::lowTextManager(uint32 textNum, uint16 width, uint16 logicNum, uint8 color, bool centre) {
-
getText(textNum);
struct displayText_t textInfo = displayText(_textBuffer, NULL, centre, width, color);
@@ -423,7 +414,6 @@ lowTextManager_t Text::lowTextManager(uint32 textNum, uint16 width, uint16 logic
}
void Text::changeTextSpriteColour(uint8 *sprData, uint8 newCol) {
-
dataFileHeader *header = (dataFileHeader *)sprData;
sprData += sizeof(dataFileHeader);
for (uint16 cnt = 0; cnt < header->s_sp_size; cnt++)
@@ -470,7 +460,6 @@ void Text::initHuffTree() {
}
bool Text::patchMessage(uint32 textNum) {
-
uint16 patchIdx = _patchLangIdx[SkyEngine::_systemVars.language];
uint16 patchNum = _patchLangNum[SkyEngine::_systemVars.language];
for (uint16 cnt = 0; cnt < patchNum; cnt++) {