aboutsummaryrefslogtreecommitdiff
path: root/sky
diff options
context:
space:
mode:
Diffstat (limited to 'sky')
-rw-r--r--sky/autoroute.h6
-rw-r--r--sky/control.cpp121
-rw-r--r--sky/control.h4
-rw-r--r--sky/disk.cpp2
-rw-r--r--sky/intro.cpp4
-rw-r--r--sky/logic.cpp17
-rw-r--r--sky/music/adlibchannel.cpp10
-rw-r--r--sky/music/adlibmusic.cpp2
-rw-r--r--sky/music/gmmusic.cpp27
-rw-r--r--sky/music/mt32music.cpp2
-rw-r--r--sky/music/musicbase.cpp65
-rw-r--r--sky/rnc_deco.cpp8
-rw-r--r--sky/screen.cpp15
-rw-r--r--sky/text.cpp41
-rw-r--r--sky/text.h4
15 files changed, 165 insertions, 163 deletions
diff --git a/sky/autoroute.h b/sky/autoroute.h
index e73d713761..79ca196a31 100644
--- a/sky/autoroute.h
+++ b/sky/autoroute.h
@@ -37,15 +37,15 @@ private:
uint16 checkBlock(uint16 *blockPos);
void clipCoordX(uint16 x, uint8 &blkX, int16 &initX);
void clipCoordY(uint16 y, uint8 &blkY, int16 &initY);
- void initWalkGrid(uint8 screen, uint8 width);
+ void initWalkGrid(uint8 screen, uint8 width);
bool calcWalkGrid(uint8 startX, uint8 startY, uint8 destX, uint8 destY);
- uint16 *makeRouteData(uint8 startX, uint8 startY, uint8 destX, uint8 destY);
+ uint16 *makeRouteData(uint8 startX, uint8 startY, uint8 destX, uint8 destY);
uint16 *checkInitMove(uint16 *data, int16 initStaX);
SkyGrid *_grid;
uint16 *_routeGrid;
uint16 *_routeBuf;
static const int16 _routeDirections[4];
- static const uint16 _logicCommands[4];
+ static const uint16 _logicCommands[4];
};
#endif // AUTOROUTE_H
diff --git a/sky/control.cpp b/sky/control.cpp
index 21c475f108..d83d06410d 100644
--- a/sky/control.cpp
+++ b/sky/control.cpp
@@ -99,7 +99,7 @@ SkyTextResource::~SkyTextResource(void) {
}
void SkyTextResource::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++)
@@ -220,7 +220,7 @@ SkyConResource *SkyControl::createResource(void *pSpData, uint32 pNSprites, uint
}
void SkyControl::removePanel(void) {
-
+
free(_screenBuf);
free(_sprites.controlPanel); free(_sprites.button);
free(_sprites.buttonDown); free(_sprites.savePanel);
@@ -259,7 +259,7 @@ void SkyControl::initPanel(void) {
_sprites.musicBodge = NULL;
else
_sprites.musicBodge = _skyDisk->loadFile(60509, NULL);
-
+
//Main control panel: X Y Text OnClick
_controlPanel = createResource(_sprites.controlPanel, 1, 0, 0, 0, 0, DO_NOTHING, MAINPANEL);
_exitButton = createResource( _sprites.button, 3, 0, 16, 125, 50, EXIT, MAINPANEL);
@@ -276,9 +276,9 @@ void SkyControl::initPanel(void) {
_fxPanButton = createResource( _sprites.button, 3, 2, 58, 99, 86, TOGGLE_FX, MAINPANEL);
if (SkyEngine::isCDVersion()) { // CD Version: Toggle text/speech
- _musicPanButton = createResource( _sprites.button, 3, 0, 58, 119, 52, TOGGLE_TEXT, MAINPANEL);
+ _musicPanButton = createResource( _sprites.button, 3, 0, 58, 119, 52, TOGGLE_TEXT, MAINPANEL);
} else { // disk version: toggle music on/off
- _musicPanButton = createResource( _sprites.button, 3, 0, 58, 119, 91, TOGGLE_MS, MAINPANEL);
+ _musicPanButton = createResource( _sprites.button, 3, 0, 58, 119, 91, TOGGLE_MS, MAINPANEL);
}
_bodge = createResource( _sprites.musicBodge, 2, 1, 98, 115, 0, DO_NOTHING, MAINPANEL);
_yesNo = createResource( _sprites.yesNo, 1, 0, -2, 40, 0, DO_NOTHING, MAINPANEL);
@@ -304,7 +304,7 @@ void SkyControl::initPanel(void) {
_quitButton = createResource( _sprites.button, 3, 0, 72, 129, 49, SP_CANCEL, SAVEPANEL);
_restoreButton = createResource( _sprites.button, 3, 0, 29, 129, 51, RESTORE_A_GAME, SAVEPANEL);
_autoSaveButton = createResource( _sprites.button, 3, 0, 115, 129, 0x8FFF, RESTORE_AUTO, SAVEPANEL);
-
+
_savePanLookList[0] = _saveButton;
_restorePanLookList[0] = _restoreButton;
_restorePanLookList[1] = _savePanLookList[1] = _downSlowButton;
@@ -424,7 +424,7 @@ void SkyControl::doLoadSavePanel(void) {
_savedMouse = _skyMouse->giveCurrentMouseType();
_savedCharSet = _skyText->giveCurrentCharSet();
_skyText->fnSetFont(0);
- _skyMouse->spriteMouse(MOUSE_NORMAL,0,0);
+ _skyMouse->spriteMouse(MOUSE_NORMAL, 0, 0);
_lastButton = -1;
_curButtonText = 0;
_textSprite = NULL;
@@ -461,7 +461,7 @@ void SkyControl::doControlPanel(void) {
_savedMouse = _skyMouse->giveCurrentMouseType();
- _skyMouse->spriteMouse(MOUSE_NORMAL,0,0);
+ _skyMouse->spriteMouse(MOUSE_NORMAL, 0, 0);
bool quitPanel = false;
_lastButton = -1;
_curButtonText = 0;
@@ -617,14 +617,14 @@ bool SkyControl::getYesNo(char *text) {
if ((_mouseX >= 77) && (_mouseX <= 114)) { // over 'yes'
wantMouse = MOUSE_CROSS;
if (_mouseClicked) {
- quitPanel = true;
- retVal = true;
+ quitPanel = true;
+ retVal = true;
}
} else if ((_mouseX >= 156) && (_mouseX <= 193)) { // over 'no'
wantMouse = MOUSE_CROSS;
if (_mouseClicked) {
- quitPanel = true;
- retVal = false;
+ quitPanel = true;
+ retVal = false;
}
} else
wantMouse = MOUSE_NORMAL;
@@ -716,7 +716,6 @@ uint16 SkyControl::toggleText(void) {
uint32 flags = SkyEngine::_systemVars.systemFlags & TEXT_FLAG_MASK;
SkyEngine::_systemVars.systemFlags &= ~TEXT_FLAG_MASK;
-
if (flags == SF_ALLOW_TEXT) {
flags = SF_ALLOW_SPEECH;
_statusBar->setToText(0x7000 + 21); // speech only
@@ -737,7 +736,7 @@ uint16 SkyControl::toggleText(void) {
}
void SkyControl::toggleMusic(void) {
-
+
if (SkyEngine::_systemVars.systemFlags & SF_MUS_OFF) {
SkyEngine::_systemVars.systemFlags &= ~SF_MUS_OFF;
_skyMusic->startMusic(SkyEngine::_systemVars.currentMusic);
@@ -785,12 +784,12 @@ bool SkyControl::autoSaveExists(void) {
if (SkyEngine::isCDVersion())
strcpy(fName, "SKY-VM-CD.ASD");
else
- sprintf(fName, "SKY-VM%03d.ASD", SkyEngine::_systemVars.gameVersion);
+ sprintf(fName, "SKY-VM%03d.ASD", SkyEngine::_systemVars.gameVersion);
SaveFileManager *mgr = _system->get_savefile_manager();
f = mgr->open_savefile(fName, _savePath, false);
if (f != NULL) {
- test = true;
- delete f;
+ test = true;
+ delete f;
}
delete mgr;
return test;
@@ -884,7 +883,7 @@ uint16 SkyControl::saveRestorePanel(bool allowSave) {
clickRes = handleClick(lookList[cnt]);
- if (clickRes == SHIFTED) {
+ if (clickRes == SHIFTED) {
_selectedGame = _firstText;
refreshNames = true;
}
@@ -922,7 +921,7 @@ uint16 SkyControl::saveRestorePanel(bool allowSave) {
force_keyboard(false);
#endif
- return clickRes;
+ return clickRes;
}
bool SkyControl::checkKeyList(uint8 key) {
@@ -944,7 +943,7 @@ void SkyControl::handleKeyPress(uint8 key, uint8 *textBuf) {
} else {
if (_enteredTextWidth >= PAN_LINE_WIDTH - 10)
return;
- if (((key >= 'A') && (key <= 'Z')) || ((key >= 'a') && (key <= 'z')) ||
+ if (((key >= 'A') && (key <= 'Z')) || ((key >= 'a') && (key <= 'z')) ||
((key >= '0') && (key <= '9')) || checkKeyList(key)) {
uint8 strLen = 0;
while (textBuf[0]) {
@@ -952,7 +951,7 @@ void SkyControl::handleKeyPress(uint8 key, uint8 *textBuf) {
strLen++;
}
if (strLen < MAX_TEXT_LEN) {
- textBuf[0] = key;
+ textBuf[0] = key;
textBuf[1] = 0;
}
}
@@ -1085,7 +1084,7 @@ void SkyControl::doAutoSave(void) {
if (SkyEngine::isCDVersion())
strcpy(fName, "SKY-VM-CD.ASD");
else
- sprintf(fName, "SKY-VM%03d.ASD", SkyEngine::_systemVars.gameVersion);
+ sprintf(fName, "SKY-VM%03d.ASD", SkyEngine::_systemVars.gameVersion);
SaveFile *outf;
SaveFileManager *mgr = _system->get_savefile_manager();
outf = mgr->open_savefile(fName, _savePath, true);
@@ -1256,7 +1255,7 @@ uint32 SkyControl::prepareSaveData(uint8 *destBuf) {
STOSW(destPos, _skySound->_saveSounds[0]);
STOSW(destPos, _skySound->_saveSounds[1]);
- STOSD(destPos, _skyMusic->giveCurrentMusic());
+ STOSD(destPos, _skyMusic->giveCurrentMusic());
STOSD(destPos, _savedCharSet);
STOSD(destPos, _savedMouse);
STOSD(destPos, SkyEngine::_systemVars.currentPalette);
@@ -1781,43 +1780,43 @@ char SkyControl::_quitTexts[16][35] = {
};
uint8 SkyControl::_crossImg[594] = {
- 0xFF, 0xFF, 0xFF, 0xFF, 0x09, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0B, 0x61, 0xFF, 0xFF, 0xFF, 0xFF, 0x4F, 0x4D, 0x61,
- 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0x08, 0x4E, 0x53, 0x50, 0x4F, 0x0C, 0x4D, 0x4E, 0x51, 0x58, 0x58, 0x54, 0x4E, 0x08, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x4E, 0x54, 0x58, 0x50, 0x4E, 0xFF,
- 0xFF, 0xFF, 0xFF, 0x50, 0x4E, 0x54, 0x58, 0x58, 0x54, 0x4E, 0x0C, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0x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0x61, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x61, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x61, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF
};
diff --git a/sky/control.h b/sky/control.h
index 7fae6b948a..29111b3f74 100644
--- a/sky/control.h
+++ b/sky/control.h
@@ -179,7 +179,7 @@ public:
void doAutoSave(void);
uint16 quickXRestore(uint16 slot);
bool loadSaveAllowed(void);
-
+
private:
void initPanel(void);
void removePanel(void);
@@ -271,7 +271,7 @@ private:
uint16 _savedMouse;
uint32 _savedCharSet;
uint16 _enteredTextWidth;
-
+
SkyConResource *createResource(void *pSpData, uint32 pNSprites, uint32 pCurSprite, int16 pX, int16 pY, uint32 pText, uint8 pOnClick, uint8 panelType);
dataFileHeader *_textSprite;
diff --git a/sky/disk.cpp b/sky/disk.cpp
index 61c4fc87db..ad9b1fedcd 100644
--- a/sky/disk.cpp
+++ b/sky/disk.cpp
@@ -413,7 +413,7 @@ void SkyDisk::dumpFile(uint16 fileNr) {
filePtr = loadFile(fileNr, NULL);
sprintf(buf, "dumps/file-%d.dmp", fileNr);
-
+
out.open(buf, "", File::kFileReadMode);
if (out.isOpen() == false) {
out.open(buf, "", File::kFileWriteMode);
diff --git a/sky/intro.cpp b/sky/intro.cpp
index 3093702b79..764890bc7d 100644
--- a/sky/intro.cpp
+++ b/sky/intro.cpp
@@ -895,9 +895,9 @@ bool SkyIntro::escDelay(uint32 msecs) {
}
}
#ifdef _WIN32_WCE
- uint8 nDelay = (msecs > 15)?(15):((uint8)msecs);
+ uint8 nDelay = (msecs > 15) ? (15) : ((uint8)msecs);
#else
- uint8 nDelay = (msecs > 50)?(50):((uint8)msecs);
+ uint8 nDelay = (msecs > 50) ? (50) : ((uint8)msecs);
#endif
_system->delay_msecs(nDelay);
msecs -= nDelay;
diff --git a/sky/logic.cpp b/sky/logic.cpp
index 4157cbb39b..1ab0ab4c40 100644
--- a/sky/logic.cpp
+++ b/sky/logic.cpp
@@ -78,7 +78,7 @@ SkyLogic::SkyLogic(SkyScreen *skyScreen, SkyDisk *skyDisk, SkyText *skyText, Sky
for (int i = 0; i < ARRAYSIZE(_moduleList); i++)
_moduleList[i] = 0;
_stackPtr = 0;
-
+
_currentSection = 0xFF; //force music & sound reload
initScriptVariables();
}
@@ -345,7 +345,7 @@ void SkyLogic::mainAnim() {
C_ANIM_UP + _compact->extCompact->megaSet + dir * 4);
uint16 arAnimIndex = _compact->extCompact->arAnimIndex;
- if (!animList[arAnimIndex/2]) {
+ if (!animList[arAnimIndex / 2]) {
arAnimIndex = 0;
_compact->extCompact->arAnimIndex = 0; // reset
}
@@ -1205,7 +1205,7 @@ script:
switch (command) {
case 0: // push_variable
- push( _scriptVariables[READ_LE_UINT16(scriptData++)/4] );
+ push( _scriptVariables[READ_LE_UINT16(scriptData++) / 4] );
break;
case 1: // less_than
a = pop();
@@ -1239,10 +1239,10 @@ script:
a = pop();
if (!a)
- scriptData += s/2;
+ scriptData += s / 2;
break;
case 6: // pop_var
- b = _scriptVariables[READ_LE_UINT16(scriptData++)/4] = pop();
+ b = _scriptVariables[READ_LE_UINT16(scriptData++) / 4] = pop();
break;
case 7: // minus
a = pop();
@@ -1256,7 +1256,7 @@ script:
break;
case 9: // skip_always
s = READ_LE_UINT16(scriptData++);
- scriptData += s/2;
+ scriptData += s / 2;
break;
case 10: // if_or
a = pop();
@@ -1306,7 +1306,7 @@ script:
do {
if (a == READ_LE_UINT16(scriptData)) {
- scriptData += READ_LE_UINT16(scriptData + 1)/2;
+ scriptData += READ_LE_UINT16(scriptData + 1) / 2;
scriptData++;
break;
}
@@ -1335,7 +1335,7 @@ script:
int16 t = READ_LE_UINT16(scriptData++);
a = pop();
if (a)
- scriptData += t/2;
+ scriptData += t / 2;
break;
}
case 13:
@@ -2538,4 +2538,3 @@ void SkyLogic::stdSpeak(Compact *target, uint32 textNum, uint32 animNum, uint32
target->logic = L_TALK;
}
-
diff --git a/sky/music/adlibchannel.cpp b/sky/music/adlibchannel.cpp
index a206d5f1f9..231a434230 100644
--- a/sky/music/adlibchannel.cpp
+++ b/sky/music/adlibchannel.cpp
@@ -24,8 +24,7 @@
#include "sky/music/adlibchannel.h"
#include "sky/sky.h"
-SkyAdlibChannel::SkyAdlibChannel(FM_OPL *opl, uint8 *pMusicData, uint16 startOfData)
-{
+SkyAdlibChannel::SkyAdlibChannel(FM_OPL *opl, uint8 *pMusicData, uint16 startOfData) {
_opl = opl;
_musicData = pMusicData;
_channelData.startOfData = startOfData;
@@ -50,7 +49,7 @@ SkyAdlibChannel::SkyAdlibChannel(FM_OPL *opl, uint8 *pMusicData, uint16 startOfD
//_registerTable = _musicData + 0xE35;
//_opOutputTable = _musicData + 0xE47;
//_adlibRegMirror = _musicData + 0xF4A;
-
+
instrumentDataLoc = READ_LE_UINT16(_musicData + 0x1204);
_frequenceTable = (uint16*)(_musicData + 0x868);
_registerTable = _musicData + 0xE68;
@@ -106,8 +105,7 @@ void SkyAdlibChannel::stopNote(void) {
}
}
-int32 SkyAdlibChannel::getNextEventTime(void)
-{
+int32 SkyAdlibChannel::getNextEventTime(void) {
int32 retV = 0;
uint8 cnt, lVal;
for (cnt = 0; cnt < 4; cnt++) {
@@ -135,7 +133,7 @@ uint8 SkyAdlibChannel::process(uint16 aktTime) {
while ((_channelData.nextEventTime < 0) && (_channelData.channelActive)) {
opcode = _musicData[_channelData.eventDataPtr];
_channelData.eventDataPtr++;
- if (opcode&0x80) {
+ if (opcode & 0x80) {
if (opcode == 0xFF) {
// dummy opcode
} else if (opcode >= 0x90) {
diff --git a/sky/music/adlibmusic.cpp b/sky/music/adlibmusic.cpp
index d8f80d772a..bfb48ec01f 100644
--- a/sky/music/adlibmusic.cpp
+++ b/sky/music/adlibmusic.cpp
@@ -83,7 +83,7 @@ void SkyAdlibMusic::premixerCall(int16 *data, uint len) {
_nextMusicPoll = _sampleRate/50;
}
}
-
+
// Convert mono data to stereo
for (int i = (origLen - 1); i >= 0; i--) {
origData[2 * i] = origData[2 * i + 1] = origData[i];
diff --git a/sky/music/gmmusic.cpp b/sky/music/gmmusic.cpp
index 4bdef54e46..b19486f7d1 100644
--- a/sky/music/gmmusic.cpp
+++ b/sky/music/gmmusic.cpp
@@ -115,17 +115,18 @@ byte SkyGmMusic::_mt32_to_gm[128] = {
};
uint8 SkyGmMusic::_veloTab[128] = {
-0x00, 0x40, 0x41, 0x41, 0x42, 0x42, 0x43, 0x43, 0x44, 0x44,
-0x45, 0x45, 0x46, 0x46, 0x47, 0x47, 0x48, 0x48, 0x49, 0x49,
-0x4A, 0x4A, 0x4B, 0x4B, 0x4C, 0x4C, 0x4D, 0x4D, 0x4E, 0x4E,
-0x4F, 0x4F, 0x50, 0x50, 0x51, 0x51, 0x52, 0x52, 0x53, 0x53,
-0x54, 0x54, 0x55, 0x55, 0x56, 0x56, 0x57, 0x57, 0x58, 0x58,
-0x59, 0x59, 0x5A, 0x5A, 0x5B, 0x5B, 0x5C, 0x5C, 0x5D, 0x5D,
-0x5E, 0x5E, 0x5F, 0x5F, 0x60, 0x60, 0x61, 0x61, 0x62, 0x62,
-0x63, 0x63, 0x64, 0x64, 0x65, 0x65, 0x66, 0x66, 0x67, 0x67,
-0x68, 0x68, 0x69, 0x69, 0x6A, 0x6A, 0x6B, 0x6B, 0x6C, 0x6C,
-0x6D, 0x6D, 0x6E, 0x6E, 0x6F, 0x6F, 0x70, 0x70, 0x71, 0x71,
-0x72, 0x72, 0x73, 0x73, 0x74, 0x74, 0x75, 0x75, 0x76, 0x76,
-0x77, 0x77, 0x78, 0x78, 0x79, 0x79, 0x7A, 0x7A, 0x7B, 0x7B,
-0x7C, 0x7C, 0x7D, 0x7D, 0x7E, 0x7E, 0x7F, 0x7F };
+ 0x00, 0x40, 0x41, 0x41, 0x42, 0x42, 0x43, 0x43, 0x44, 0x44,
+ 0x45, 0x45, 0x46, 0x46, 0x47, 0x47, 0x48, 0x48, 0x49, 0x49,
+ 0x4A, 0x4A, 0x4B, 0x4B, 0x4C, 0x4C, 0x4D, 0x4D, 0x4E, 0x4E,
+ 0x4F, 0x4F, 0x50, 0x50, 0x51, 0x51, 0x52, 0x52, 0x53, 0x53,
+ 0x54, 0x54, 0x55, 0x55, 0x56, 0x56, 0x57, 0x57, 0x58, 0x58,
+ 0x59, 0x59, 0x5A, 0x5A, 0x5B, 0x5B, 0x5C, 0x5C, 0x5D, 0x5D,
+ 0x5E, 0x5E, 0x5F, 0x5F, 0x60, 0x60, 0x61, 0x61, 0x62, 0x62,
+ 0x63, 0x63, 0x64, 0x64, 0x65, 0x65, 0x66, 0x66, 0x67, 0x67,
+ 0x68, 0x68, 0x69, 0x69, 0x6A, 0x6A, 0x6B, 0x6B, 0x6C, 0x6C,
+ 0x6D, 0x6D, 0x6E, 0x6E, 0x6F, 0x6F, 0x70, 0x70, 0x71, 0x71,
+ 0x72, 0x72, 0x73, 0x73, 0x74, 0x74, 0x75, 0x75, 0x76, 0x76,
+ 0x77, 0x77, 0x78, 0x78, 0x79, 0x79, 0x7A, 0x7A, 0x7B, 0x7B,
+ 0x7C, 0x7C, 0x7D, 0x7D, 0x7E, 0x7E, 0x7F, 0x7F
+};
diff --git a/sky/music/mt32music.cpp b/sky/music/mt32music.cpp
index f30b2969a2..81937d77cb 100644
--- a/sky/music/mt32music.cpp
+++ b/sky/music/mt32music.cpp
@@ -33,7 +33,7 @@ SkyMT32Music::SkyMT32Music(MidiDriver *pMidiDrv, SkyDisk *pSkyDisk, OSystem *sys
: SkyMusicBase(pSkyDisk, system) {
_driverFileBase = 60200;
- _midiDrv = pMidiDrv;
+ _midiDrv = pMidiDrv;
int midiRes = _midiDrv->open();
if (midiRes != 0) {
error("Can't open midi device. Errorcode: %d",midiRes);
diff --git a/sky/music/musicbase.cpp b/sky/music/musicbase.cpp
index 368a9c308d..640aa64bc4 100644
--- a/sky/music/musicbase.cpp
+++ b/sky/music/musicbase.cpp
@@ -35,16 +35,19 @@ SkyMusicBase::SkyMusicBase(SkyDisk *pSkyDisk, OSystem *system) {
_mutex = _system->create_mutex();
}
-SkyMusicBase::~SkyMusicBase(void)
-{
- if (_musicData) free(_musicData);
+SkyMusicBase::~SkyMusicBase(void) {
+
+ if (_musicData)
+ free(_musicData);
}
-void SkyMusicBase::loadSection(uint8 pSection)
-{
+void SkyMusicBase::loadSection(uint8 pSection) {
+
_system->lock_mutex(_mutex);
- if (_currentMusic) stopMusic();
- if (_musicData) free(_musicData);
+ if (_currentMusic)
+ stopMusic();
+ if (_musicData)
+ free(_musicData);
_currentSection = pSection;
_musicData = _skyDisk->loadFile(_driverFileBase + FILES_PER_SECTION * pSection, NULL);
_allowedCommands = 0;
@@ -60,16 +63,16 @@ void SkyMusicBase::loadSection(uint8 pSection)
_system->unlock_mutex(_mutex);
}
-bool SkyMusicBase::musicIsPlaying(void)
-{
+bool SkyMusicBase::musicIsPlaying(void) {
+
for (uint8 cnt = 0; cnt < _numberOfChannels; cnt++)
if (_channels[cnt]->isActive())
return true;
return false;
}
-void SkyMusicBase::musicCommand(uint16 command)
-{
+void SkyMusicBase::musicCommand(uint16 command) {
+
if (_musicData == NULL) {
debug(1,"Got music command but driver is not yet loaded");
return ;
@@ -92,7 +95,7 @@ void SkyMusicBase::musicCommand(uint16 command)
debug(1,"SkyMusic: ignored direct call to driverPoll().");
break;
case 4:
- startMusic(command&0xFF);
+ startMusic(command & 0xFF);
break;
case 6:
reinitFM();
@@ -101,22 +104,22 @@ void SkyMusicBase::musicCommand(uint16 command)
stopMusic();
break;
case 13:
- setFMVolume(command&0xFF);
+ setFMVolume(command & 0xFF);
break;
default:
- debug(1,"musicCommand %d ignored.",command>>8);
+ debug(1,"musicCommand %d ignored.",command >> 8);
}
}
-void SkyMusicBase::setFMVolume(uint16 param)
-{
+void SkyMusicBase::setFMVolume(uint16 param) {
+
_musicVolume = param;
for (uint8 cnt = 0; cnt < _numberOfChannels; cnt++)
_channels[cnt]->updateVolume(_musicVolume);
}
-void SkyMusicBase::stopMusic(void)
-{
+void SkyMusicBase::stopMusic(void) {
+
for (uint8 cnt = 0; cnt < _numberOfChannels; cnt++) {
_channels[cnt]->stopNote();
delete _channels[cnt];
@@ -124,16 +127,16 @@ void SkyMusicBase::stopMusic(void)
_numberOfChannels = 0;
}
-void SkyMusicBase::updateTempo(void)
-{
- uint16 tempoMul = _musicTempo0*_musicTempo1;
- uint16 divisor = 0x4446390/23864;
- _tempo = (tempoMul / divisor)<<16;
- _tempo |= (((tempoMul%divisor)<<16) | (tempoMul/divisor)) / divisor;
+void SkyMusicBase::updateTempo(void) {
+
+ uint16 tempoMul = _musicTempo0 * _musicTempo1;
+ uint16 divisor = 0x4446390/ 23864;
+ _tempo = (tempoMul / divisor) << 16;
+ _tempo |= (((tempoMul%divisor) << 16) | (tempoMul / divisor)) / divisor;
}
-void SkyMusicBase::loadNewMusic(void)
-{
+void SkyMusicBase::loadNewMusic(void) {
+
uint16 musicPos;
if (_onNextPoll.musicToProcess > _musicData[_musicDataLoc]) {
error("Music %d requested but doesn't exist in file.", _onNextPoll.musicToProcess);
@@ -145,9 +148,9 @@ void SkyMusicBase::loadNewMusic(void)
_currentMusic = _onNextPoll.musicToProcess;
if (_currentMusic != 0) {
- musicPos = (_musicData[_musicDataLoc+2]<<8) | _musicData[_musicDataLoc+1];
- musicPos += _musicDataLoc+((_currentMusic-1)<<1);
- musicPos = ((_musicData[musicPos+1]<<8) | _musicData[musicPos]) + _musicDataLoc;
+ musicPos = (_musicData[_musicDataLoc + 2] << 8) | _musicData[_musicDataLoc+1];
+ musicPos += _musicDataLoc+((_currentMusic-1) << 1);
+ musicPos = ((_musicData[musicPos+1] << 8) | _musicData[musicPos]) + _musicDataLoc;
_musicTempo0 = _musicData[musicPos];
_musicTempo1 = _musicData[musicPos+1];
@@ -158,8 +161,8 @@ void SkyMusicBase::loadNewMusic(void)
}
}
-void SkyMusicBase::pollMusic(void)
-{
+void SkyMusicBase::pollMusic(void) {
+
_system->lock_mutex(_mutex);
uint8 newTempo;
if (_onNextPoll.doReInit) startDriver();
diff --git a/sky/rnc_deco.cpp b/sky/rnc_deco.cpp
index 95a1ee7b33..10a2cb2a02 100644
--- a/sky/rnc_deco.cpp
+++ b/sky/rnc_deco.cpp
@@ -92,7 +92,7 @@ uint16 RncDecoder::inputBits(uint8 amount) {
if (newBitCount < 0) {
newBitCount += amount;
- remBits = (newBitBuffh << (16-newBitCount));
+ remBits = (newBitBuffh << (16 - newBitCount));
newBitBuffh >>= newBitCount;
newBitBuffl >>= newBitCount;
newBitBuffl |= remBits;
@@ -101,7 +101,7 @@ uint16 RncDecoder::inputBits(uint8 amount) {
amount -= newBitCount;
newBitCount = 16 - amount;
}
- remBits = (newBitBuffh << (16-amount));
+ remBits = (newBitBuffh << (16 - amount));
_bitBuffh = newBitBuffh >> amount;
_bitBuffl = (newBitBuffl >> amount) | remBits;
_bitCount = (uint8)newBitCount;
@@ -134,7 +134,7 @@ void RncDecoder::makeHufftable(uint16 *table) {
a |= ((b >> j) & 1) << (bitLength - j - 1);
*table++ = a;
- *(table + 0x1e) = (huffLength[i] << 8)|(i & 0x00FF);
+ *(table + 0x1e) = (huffLength[i] << 8) | (i & 0x00FF);
huffCode += 1 << (16 - bitLength);
}
}
@@ -253,7 +253,7 @@ int32 RncDecoder::unpackM1(const void *input, void *output, uint16 key) {
if (crcBlock((uint8 *)output, unpackLen) != crcUnpacked)
return UNPACKED_CRC;
-
+
// all is done..return the amount of unpacked bytes
return unpackLen;
}
diff --git a/sky/screen.cpp b/sky/screen.cpp
index 467756ea40..43f9485336 100644
--- a/sky/screen.cpp
+++ b/sky/screen.cpp
@@ -28,8 +28,7 @@
#include "sky/skydefs.h"
#include "sky/struc.h"
-uint8 SkyScreen::_top16Colours[16*3] =
-{
+uint8 SkyScreen::_top16Colours[16*3] = {
0, 0, 0,
38, 38, 38,
63, 63, 63,
@@ -155,7 +154,7 @@ void SkyScreen::showScreen(uint8 *pScreen) {
}
void SkyScreen::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++) {
@@ -384,7 +383,8 @@ void SkyScreen::waitForSequence(void) {
void SkyScreen::handleTimer(void) {
_gotTick = true;
- if (_seqInfo.running) processSequence();
+ if (_seqInfo.running)
+ processSequence();
}
void SkyScreen::startSequence(uint16 fileNum) {
@@ -485,7 +485,8 @@ void SkyScreen::processSequence(void) {
}
if (_seqInfo.framesLeft == 0) {
_seqInfo.running = false;
- if (!_seqInfo.runningItem) free(_seqInfo.seqData);
+ if (!_seqInfo.runningItem)
+ free(_seqInfo.seqData);
_seqInfo.seqData = _seqInfo.seqDataPos = NULL;
}
}
@@ -527,7 +528,7 @@ void SkyScreen::sortSprites(void) {
dataFileHeader *spriteData =
(dataFileHeader *)SkyEngine::fetchItem(spriteComp->frame >> 6);
if (!spriteData) {
- debug(9,"Missing file %d",spriteComp->frame >> 6);
+ debug(9,"Missing file %d", spriteComp->frame >> 6);
spriteComp->status = 0;
} else {
sortList[spriteCnt].yCood = spriteComp->ycood + spriteData->s_offset_y + spriteData->s_height;
@@ -587,7 +588,7 @@ void SkyScreen::doSprites(uint8 layer) {
(spriteData->screen == SkyLogic::_scriptVariables[SCREEN])) {
uint8 *toBeDrawn = (uint8 *)SkyEngine::fetchItem(spriteData->frame >> 6);
if (!toBeDrawn) {
- debug(9, "Spritedata %d not loaded",spriteData->frame >> 6);
+ debug(9, "Spritedata %d not loaded", spriteData->frame >> 6);
spriteData->status = 0;
} else {
drawSprite(toBeDrawn, spriteData);
diff --git a/sky/text.cpp b/sky/text.cpp
index a05c730f96..b601945f2b 100644
--- a/sky/text.cpp
+++ b/sky/text.cpp
@@ -62,7 +62,8 @@ SkyText::SkyText(SkyDisk *skyDisk) {
if (SkyEngine::isCDVersion()) {
_preAfterTableArea = _skyDisk->loadFile(60522, NULL);
- } else _preAfterTableArea = NULL;
+ } else
+ _preAfterTableArea = NULL;
}
SkyText::~SkyText(void) {
@@ -259,7 +260,7 @@ void SkyText::getText(uint32 textNr) { //load text #"textNr" into textBuffer
return ;
uint32 sectionNo = (textNr & 0x0F000) >> 12;
-
+
if (SkyEngine::_itemList[FIRST_TEXT_SEC + sectionNo] == (void **)NULL) { //check if already loaded
debug(5, "Loading Text item(s) for Section %d", (sectionNo>>2));
@@ -267,13 +268,13 @@ void SkyText::getText(uint32 textNr) { //load text #"textNr" into textBuffer
SkyEngine::_itemList[FIRST_TEXT_SEC + sectionNo] = (void **)_skyDisk->loadFile((uint16)fileNo, NULL);
}
_textItemPtr = (uint8 *)SkyEngine::_itemList[FIRST_TEXT_SEC + sectionNo];
-
+
uint32 offset = 0;
uint32 nr32MsgBlocks = (textNr & 0x0fe0);
uint32 skipBytes;
byte *blockPtr;
bool bitSeven;
-
+
if (nr32MsgBlocks) {
blockPtr = (byte *)(_textItemPtr + 4);
nr32MsgBlocks >>= 5;
@@ -290,17 +291,17 @@ void SkyText::getText(uint32 textNr) { //load text #"textNr" into textBuffer
remItems &= 0x0fe0;
remItems += READ_LE_UINT16(_textItemPtr);
blockPtr = _textItemPtr + remItems;
-
+
do {
skipBytes = *blockPtr++;
bitSeven = (bool)((skipBytes >> (7)) & 0x1);
skipBytes &= ~(1UL << 7);
-
+
if (bitSeven)
skipBytes <<= 3;
-
+
offset += skipBytes;
-
+
} while (--textNr);
}
@@ -352,7 +353,7 @@ void SkyText::logicCursor(Compact *textCompact, uint16 mouseX, uint16 mouseY) {
}
bool SkyText::getTBit() {
-
+
if (_shiftBits) {
(_shiftBits)--;
} else {
@@ -369,7 +370,7 @@ displayText_t SkyText::displayText(uint8 *dest, bool centre, uint16 pixelWidth,
}
displayText_t SkyText::displayText(char *textPtr, uint8 *dest, bool centre, uint16 pixelWidth, uint8 color) {
-
+
//Render text pointed to by *textPtr in buffer *dest
uint8 textChar;
@@ -377,7 +378,7 @@ displayText_t SkyText::displayText(char *textPtr, uint8 *dest, bool centre, uint
char *lastSpace = curPos;
byte *centerTblPtr = _centreTable;
uint16 lineWidth = 0;
-
+
_dtCol = color;
_dtLineWidth = pixelWidth;
_dtLines = 0;
@@ -403,12 +404,12 @@ displayText_t SkyText::displayText(char *textPtr, uint8 *dest, bool centre, uint
lastSpace = curPos; //keep track of last space
*(uint32 *)centerTblPtr = TO_LE_32(lineWidth);
}
-
+
lineWidth += *(_characterSet+textChar); //add character width
lineWidth += (uint16)_dtCharSpacing; //include character spacing
-
+
if (pixelWidth <= lineWidth) {
-
+
if (*(lastSpace-1) == 10)
error("line width exceeded!");
@@ -449,7 +450,7 @@ displayText_t SkyText::displayText(char *textPtr, uint8 *dest, bool centre, uint
((struct dataFileHeader *)curDest)->s_sp_size = (uint16)(_dtLineWidth * _charHeight * _dtLines);
((struct dataFileHeader *)curDest)->s_offset_x = 0;
((struct dataFileHeader *)curDest)->s_offset_y = 0;
-
+
//reset position
curPos = textPtr;
@@ -459,7 +460,7 @@ displayText_t SkyText::displayText(char *textPtr, uint8 *dest, bool centre, uint
do {
if (_dtCentre) {
-
+
uint32 width = _dtLineWidth;
width -= READ_LE_UINT32(centerTblPtr);
centerTblPtr += 4;
@@ -479,7 +480,7 @@ displayText_t SkyText::displayText(char *textPtr, uint8 *dest, bool centre, uint
prevDest = curDest;
} while (textChar >= 10);
-
+
struct displayText_t ret;
ret.textData = _dtData;
ret.textWidth = _dtLastWidth;
@@ -498,7 +499,7 @@ void SkyText::makeGameCharacter(uint8 textChar, uint8 *charSetPtr, uint8 *&dest,
for (int i = 0; i < _charHeight; i++) {
byte *prevPos = curPos;
-
+
data = READ_BE_UINT16(charSpritePtr);
mask = READ_BE_UINT16(charSpritePtr + 2);
charSpritePtr += 4;
@@ -524,7 +525,7 @@ void SkyText::makeGameCharacter(uint8 textChar, uint8 *charSetPtr, uint8 *&dest,
curPos = prevPos;
curPos += _dtLineWidth;
}
-
+
//update position
dest = startPos + charWidth + _dtCharSpacing*2 - 1;
@@ -535,7 +536,7 @@ lowTextManager_t SkyText::lowTextManager(uint32 textNum, uint16 width, uint16 lo
getText(textNum);
struct displayText_t textInfo = displayText(NULL, centre, width, color);
-
+
_lowTextWidth = textInfo.textWidth;
byte *textData = textInfo.textData;
diff --git a/sky/text.h b/sky/text.h
index ed5bfa6630..a29a653bc6 100644
--- a/sky/text.h
+++ b/sky/text.h
@@ -77,7 +77,7 @@ protected:
uint32 charHeight;
uint32 charSpacing;
} _mainCharacterSet, _linkCharacterSet, _controlCharacterSet;
-
+
uint32 _curCharSet;
uint8 *_characterSet;
uint8 _charHeight;
@@ -85,7 +85,7 @@ protected:
char _textBuffer[1024];
uint8 _centreTable[40];
-
+
uint8 *_mouseTextData; //space for the mouse text
uint8 _dtCol;
uint16 _dtLineWidth; //width of line in pixels