SCI: Remove trailing whitespace

This commit is contained in:
Filippos Karapetis 2014-10-28 16:17:06 +02:00
parent 6bdb362370
commit 9783f0bbd9
14 changed files with 42 additions and 42 deletions

View file

@ -664,7 +664,7 @@ bool Console::cmdDiskDump(int argc, const char **argv) {
int resNumFrom = 0; int resNumFrom = 0;
int resNumTo = 0; int resNumTo = 0;
int resNumCur = 0; int resNumCur = 0;
if (argc != 3) { if (argc != 3) {
debugPrintf("Dumps the specified resource to disk as a patch file\n"); debugPrintf("Dumps the specified resource to disk as a patch file\n");
debugPrintf("Usage: %s <resource type> <resource number>\n", argv[0]); debugPrintf("Usage: %s <resource type> <resource number>\n", argv[0]);
@ -672,7 +672,7 @@ bool Console::cmdDiskDump(int argc, const char **argv) {
cmdResourceTypes(argc, argv); cmdResourceTypes(argc, argv);
return true; return true;
} }
if (strcmp(argv[2], "*") == 0) { if (strcmp(argv[2], "*") == 0) {
resNumFrom = 0; resNumFrom = 0;
resNumTo = 65535; resNumTo = 65535;

View file

@ -145,7 +145,7 @@ public:
*/ */
Kernel(ResourceManager *resMan, SegManager *segMan); Kernel(ResourceManager *resMan, SegManager *segMan);
~Kernel(); ~Kernel();
void init(); void init();
uint getSelectorNamesSize() const; uint getSelectorNamesSize() const;
@ -161,7 +161,7 @@ public:
* @return The appropriate selector ID, or -1 on error * @return The appropriate selector ID, or -1 on error
*/ */
int findSelector(const char *selectorName) const; int findSelector(const char *selectorName) const;
bool selectorNamesAvailable(); bool selectorNamesAvailable();
// Script dissection/dumping functions // Script dissection/dumping functions

View file

@ -98,7 +98,7 @@ private:
void enablePatch(const SciScriptPatcherEntry *patchTable, const char *searchDescription); void enablePatch(const SciScriptPatcherEntry *patchTable, const char *searchDescription);
int32 findSignature(const SciScriptPatcherEntry *patchEntry, SciScriptPatcherRuntimeEntry *runtimeEntry, const byte *scriptData, const uint32 scriptSize, bool isMacSci11); int32 findSignature(const SciScriptPatcherEntry *patchEntry, SciScriptPatcherRuntimeEntry *runtimeEntry, const byte *scriptData, const uint32 scriptSize, bool isMacSci11);
void applyPatch(const SciScriptPatcherEntry *patchEntry, byte *scriptData, const uint32 scriptSize, int32 signatureOffset, bool isMacSci11); void applyPatch(const SciScriptPatcherEntry *patchEntry, byte *scriptData, const uint32 scriptSize, int32 signatureOffset, bool isMacSci11);
Selector *_selectorIdTable; Selector *_selectorIdTable;
SciScriptPatcherRuntimeEntry *_runtimeTable; SciScriptPatcherRuntimeEntry *_runtimeTable;
}; };

View file

@ -46,7 +46,7 @@ void GfxPaint32::fillRect(Common::Rect rect, byte color) {
Common::Rect clipRect = rect; Common::Rect clipRect = rect;
clipRect.clip(_screen->getWidth(), _screen->getHeight()); clipRect.clip(_screen->getWidth(), _screen->getHeight());
for (y = clipRect.top; y < clipRect.bottom; y++) { for (y = clipRect.top; y < clipRect.bottom; y++) {
for (x = clipRect.left; x < clipRect.right; x++) { for (x = clipRect.left; x < clipRect.right; x++) {
_screen->putPixel(x, y, GFX_SCREEN_MASK_VISUAL, color, 0, 0); _screen->putPixel(x, y, GFX_SCREEN_MASK_VISUAL, color, 0, 0);

View file

@ -246,7 +246,7 @@ void GfxPicture::drawCelData(byte *inbuffer, int size, int headerPos, int rlePos
int16 y, lastY, x, leftX, rightX; int16 y, lastY, x, leftX, rightX;
int pixelCount; int pixelCount;
uint16 width, height; uint16 width, height;
// if the picture is not an overlay and we are also not in EGA mode, use priority 0 // if the picture is not an overlay and we are also not in EGA mode, use priority 0
if (!isEGA && !_addToFlag) if (!isEGA && !_addToFlag)
priority = 0; priority = 0;
@ -362,7 +362,7 @@ void GfxPicture::drawCelData(byte *inbuffer, int size, int headerPos, int rlePos
ptr = celBitmap; ptr = celBitmap;
ptr += skipCelBitmapPixels; ptr += skipCelBitmapPixels;
ptr += skipCelBitmapLines * width; ptr += skipCelBitmapLines * width;
if ((!isEGA) || (priority < 16)) { if ((!isEGA) || (priority < 16)) {
// VGA + EGA, EGA only checks priority, when given priority is below 16 // VGA + EGA, EGA only checks priority, when given priority is below 16
if (!_mirroredFlag) { if (!_mirroredFlag) {

View file

@ -134,34 +134,34 @@ void Portrait::init() {
// raw lip-sync ID table follows // raw lip-sync ID table follows
uint32 lipSyncIDTableSize; uint32 lipSyncIDTableSize;
lipSyncIDTableSize = READ_LE_UINT32(data); lipSyncIDTableSize = READ_LE_UINT32(data);
data += 4; data += 4;
assert( lipSyncIDTableSize == (_lipSyncIDCount * 4) ); assert( lipSyncIDTableSize == (_lipSyncIDCount * 4) );
_lipSyncIDTable = data; _lipSyncIDTable = data;
data += lipSyncIDTableSize; data += lipSyncIDTableSize;
// raw lip-sync frame table follows // raw lip-sync frame table follows
uint32 lipSyncDataTableSize; uint32 lipSyncDataTableSize;
uint32 lipSyncDataTableLastOffset; uint32 lipSyncDataTableLastOffset;
byte lipSyncData; byte lipSyncData;
uint16 lipSyncDataNr; uint16 lipSyncDataNr;
uint16 lipSyncCurOffset; uint16 lipSyncCurOffset;
lipSyncDataTableSize = READ_LE_UINT32(data); lipSyncDataTableSize = READ_LE_UINT32(data);
data += 4; data += 4;
assert( lipSyncDataTableSize == 0x220 ); // always this size, just a safety-check assert( lipSyncDataTableSize == 0x220 ); // always this size, just a safety-check
_lipSyncData = data; _lipSyncData = data;
lipSyncDataTableLastOffset = lipSyncDataTableSize - 1; lipSyncDataTableLastOffset = lipSyncDataTableSize - 1;
_lipSyncDataOffsetTable = new uint16[ _lipSyncIDCount ]; _lipSyncDataOffsetTable = new uint16[ _lipSyncIDCount ];
lipSyncDataNr = 0; lipSyncDataNr = 0;
lipSyncCurOffset = 0; lipSyncCurOffset = 0;
while ( (lipSyncCurOffset < lipSyncDataTableSize) && (lipSyncDataNr < _lipSyncIDCount) ) { while ( (lipSyncCurOffset < lipSyncDataTableSize) && (lipSyncDataNr < _lipSyncIDCount) ) {
// We are currently at the start of ID-frame data // We are currently at the start of ID-frame data
_lipSyncDataOffsetTable[lipSyncDataNr] = lipSyncCurOffset; _lipSyncDataOffsetTable[lipSyncDataNr] = lipSyncCurOffset;
// Look for end of ID-frame data // Look for end of ID-frame data
lipSyncData = *data++; lipSyncCurOffset++; lipSyncData = *data++; lipSyncCurOffset++;
while ( (lipSyncData != 0xFF) && (lipSyncCurOffset < lipSyncDataTableLastOffset) ) { while ( (lipSyncData != 0xFF) && (lipSyncCurOffset < lipSyncDataTableLastOffset) ) {
@ -195,7 +195,7 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint
Resource *syncResource = _resMan->findResource(syncResourceId, true); Resource *syncResource = _resMan->findResource(syncResourceId, true);
uint syncOffset = 0; uint syncOffset = 0;
#endif #endif
#ifdef DEBUG_PORTRAIT #ifdef DEBUG_PORTRAIT
// prints out the current lip sync ASCII data // prints out the current lip sync ASCII data
char debugPrint[4000]; char debugPrint[4000];
@ -246,7 +246,7 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint
warning("kPortrait: no rave resource %d %X", resourceId, audioNumber); warning("kPortrait: no rave resource %d %X", resourceId, audioNumber);
return; return;
} }
// Do animation depending on rave resource till audio is done playing // Do animation depending on rave resource till audio is done playing
int16 raveTicks; int16 raveTicks;
uint16 raveID; uint16 raveID;
@ -264,7 +264,7 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint
raveTicks = raveGetTicks(raveResource, &raveOffset); raveTicks = raveGetTicks(raveResource, &raveOffset);
if (raveTicks < 0) if (raveTicks < 0)
break; break;
// get lipSyncID // get lipSyncID
raveID = raveGetID(raveResource, &raveOffset); raveID = raveGetID(raveResource, &raveOffset);
if (raveID) { if (raveID) {
@ -272,7 +272,7 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint
} else { } else {
raveLipSyncData = NULL; raveLipSyncData = NULL;
} }
timerPosition += raveTicks; timerPosition += raveTicks;
// Wait till syncTime passed, then show specific animation bitmap // Wait till syncTime passed, then show specific animation bitmap
@ -287,7 +287,7 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint
curPosition = _audio->getAudioPosition(); curPosition = _audio->getAudioPosition();
} while ((curPosition != -1) && (curPosition < timerPosition) && (!userAbort)); } while ((curPosition != -1) && (curPosition < timerPosition) && (!userAbort));
} }
if (raveLipSyncData) { if (raveLipSyncData) {
// lip sync data is // lip sync data is
// Tick:Byte, Bitmap-Nr:BYTE // Tick:Byte, Bitmap-Nr:BYTE
@ -308,7 +308,7 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint
} while ((curPosition != -1) && (curPosition < timerPositionWithin) && (!userAbort)); } while ((curPosition != -1) && (curPosition < timerPositionWithin) && (!userAbort));
raveLipSyncBitmapNr = *raveLipSyncData++; raveLipSyncBitmapNr = *raveLipSyncData++;
// bitmap nr within sync data is base 1, we need base 0 // bitmap nr within sync data is base 1, we need base 0
raveLipSyncBitmapNr--; raveLipSyncBitmapNr--;
@ -319,7 +319,7 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint
} else { } else {
warning("kPortrait: rave lip sync data tried to draw non-existent bitmap %d", raveLipSyncBitmapNr); warning("kPortrait: rave lip sync data tried to draw non-existent bitmap %d", raveLipSyncBitmapNr);
} }
raveLipSyncTicks = *raveLipSyncData++; raveLipSyncTicks = *raveLipSyncData++;
} }
} }
@ -372,7 +372,7 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint
} }
} }
#endif #endif
// Reset the portrait bitmap to "closed mouth" state (rave.dll seems to do the same) // Reset the portrait bitmap to "closed mouth" state (rave.dll seems to do the same)
drawBitmap(0); drawBitmap(0);
bitsShow(); bitsShow();
@ -393,10 +393,10 @@ int16 Portrait::raveGetTicks(Resource *resource, uint *offset) {
byte *curData = resource->data + curOffset; byte *curData = resource->data + curOffset;
byte curByte; byte curByte;
uint16 curValue = 0; uint16 curValue = 0;
if (curOffset >= resource->size) if (curOffset >= resource->size)
return -1; return -1;
while (curOffset < resource->size) { while (curOffset < resource->size) {
curByte = *curData++; curOffset++; curByte = *curData++; curOffset++;
if ( curByte == ' ' ) if ( curByte == ' ' )
@ -418,7 +418,7 @@ uint16 Portrait::raveGetID(Resource *resource, uint *offset) {
byte *curData = resource->data + curOffset; byte *curData = resource->data + curOffset;
byte curByte = 0; byte curByte = 0;
uint16 curValue = 0; uint16 curValue = 0;
while (curOffset < resource->size) { while (curOffset < resource->size) {
curByte = *curData++; curOffset++; curByte = *curData++; curOffset++;
if ( curByte == ' ' ) if ( curByte == ' ' )
@ -429,7 +429,7 @@ uint16 Portrait::raveGetID(Resource *resource, uint *offset) {
curValue |= curByte; curValue |= curByte;
} }
} }
*offset = curOffset; *offset = curOffset;
return curValue; return curValue;
} }
@ -440,17 +440,17 @@ byte *Portrait::raveGetLipSyncData(uint16 raveID) {
byte *lipSyncIDPtr = _lipSyncIDTable; byte *lipSyncIDPtr = _lipSyncIDTable;
byte lipSyncIDByte1, lipSyncIDByte2; byte lipSyncIDByte1, lipSyncIDByte2;
uint16 lipSyncID; uint16 lipSyncID;
lipSyncIDPtr++; // skip over first byte lipSyncIDPtr++; // skip over first byte
while (lipSyncIDNr < _lipSyncIDCount) { while (lipSyncIDNr < _lipSyncIDCount) {
lipSyncIDByte1 = *lipSyncIDPtr++; lipSyncIDByte1 = *lipSyncIDPtr++;
lipSyncIDByte2 = *lipSyncIDPtr++; lipSyncIDByte2 = *lipSyncIDPtr++;
lipSyncID = ( lipSyncIDByte1 << 8 ) | lipSyncIDByte2; lipSyncID = ( lipSyncIDByte1 << 8 ) | lipSyncIDByte2;
if ( lipSyncID == raveID ) { if ( lipSyncID == raveID ) {
return _lipSyncData + _lipSyncDataOffsetTable[lipSyncIDNr]; return _lipSyncData + _lipSyncDataOffsetTable[lipSyncIDNr];
} }
lipSyncIDNr++; lipSyncIDNr++;
lipSyncIDPtr += 2; // ID is every 4 bytes lipSyncIDPtr += 2; // ID is every 4 bytes
} }

View file

@ -72,7 +72,7 @@ private:
Common::String _resourceName; Common::String _resourceName;
byte *_fileData; byte *_fileData;
uint32 _lipSyncIDCount; uint32 _lipSyncIDCount;
byte *_lipSyncIDTable; byte *_lipSyncIDTable;

View file

@ -50,7 +50,7 @@ GfxScreen::GfxScreen(ResourceManager *resMan) : _resMan(resMan) {
_upscaledHires = GFX_SCREEN_UPSCALED_640x480; _upscaledHires = GFX_SCREEN_UPSCALED_640x480;
#endif #endif
} }
if (g_sci->getPlatform() == Common::kPlatformMacintosh) { if (g_sci->getPlatform() == Common::kPlatformMacintosh) {
if (getSciVersion() <= SCI_VERSION_01) if (getSciVersion() <= SCI_VERSION_01)
_upscaledHires = GFX_SCREEN_UPSCALED_480x300; _upscaledHires = GFX_SCREEN_UPSCALED_480x300;
@ -232,7 +232,7 @@ void GfxScreen::copyRectToScreen(const Common::Rect &rect, int16 x, int16 y) {
} else { } else {
int rectHeight = _upscaledHeightMapping[rect.bottom] - _upscaledHeightMapping[rect.top]; int rectHeight = _upscaledHeightMapping[rect.bottom] - _upscaledHeightMapping[rect.top];
int rectWidth = _upscaledWidthMapping[rect.right] - _upscaledWidthMapping[rect.left]; int rectWidth = _upscaledWidthMapping[rect.right] - _upscaledWidthMapping[rect.left];
g_system->copyRectToScreen(_activeScreen + _upscaledHeightMapping[rect.top] * _displayWidth + _upscaledWidthMapping[rect.left], _displayWidth, _upscaledWidthMapping[x], _upscaledHeightMapping[y], rectWidth, rectHeight); g_system->copyRectToScreen(_activeScreen + _upscaledHeightMapping[rect.top] * _displayWidth + _upscaledWidthMapping[rect.left], _displayWidth, _upscaledWidthMapping[x], _upscaledHeightMapping[y], rectWidth, rectHeight);
} }
} }
@ -329,7 +329,7 @@ void GfxScreen::drawLine(Common::Point startPoint, Common::Point endPoint, byte
int16 top = CLIP<int16>(startPoint.y, 0, maxHeight); int16 top = CLIP<int16>(startPoint.y, 0, maxHeight);
int16 right = CLIP<int16>(endPoint.x, 0, maxWidth); int16 right = CLIP<int16>(endPoint.x, 0, maxWidth);
int16 bottom = CLIP<int16>(endPoint.y, 0, maxHeight); int16 bottom = CLIP<int16>(endPoint.y, 0, maxHeight);
//set_drawing_flag //set_drawing_flag
byte drawMask = getDrawingMask(color, priority, control); byte drawMask = getDrawingMask(color, priority, control);

View file

@ -367,7 +367,7 @@ void GfxView::initData(GuiResourceId resourceId) {
default: default:
error("ViewType was not detected, can't continue"); error("ViewType was not detected, can't continue");
} }
// Inject our own views // Inject our own views
// Currently only used for Dual mode (speech + text) for games, that do not have a "dual" icon already // Currently only used for Dual mode (speech + text) for games, that do not have a "dual" icon already
// Which is Laura Bow 2 + King's Quest 6 // Which is Laura Bow 2 + King's Quest 6

View file

@ -76,8 +76,8 @@ MODULE_OBJS := \
sound/drivers/midi.o \ sound/drivers/midi.o \
sound/drivers/pcjr.o \ sound/drivers/pcjr.o \
video/seq_decoder.o video/seq_decoder.o
ifdef ENABLE_SCI32 ifdef ENABLE_SCI32
MODULE_OBJS += \ MODULE_OBJS += \
engine/kgraphics32.o \ engine/kgraphics32.o \

View file

@ -110,7 +110,7 @@ bool Resource::loadFromAudioVolumeSCI11(Common::SeekableReadStream *file) {
unalloc(); unalloc();
return false; return false;
} }
_headerSize = file->readByte(); _headerSize = file->readByte();
if (type == kResourceTypeAudio) { if (type == kResourceTypeAudio) {

View file

@ -219,7 +219,7 @@ Common::Error SciEngine::run() {
// Add the after market GM patches for the specified game, if they exist // Add the after market GM patches for the specified game, if they exist
_resMan->addNewGMPatch(_gameId); _resMan->addNewGMPatch(_gameId);
_gameObjectAddress = _resMan->findGameObject(); _gameObjectAddress = _resMan->findGameObject();
_scriptPatcher = new ScriptPatcher(); _scriptPatcher = new ScriptPatcher();
SegManager *segMan = new SegManager(_resMan, _scriptPatcher); SegManager *segMan = new SegManager(_resMan, _scriptPatcher);
@ -896,7 +896,7 @@ void SciEngine::syncSoundSettings() {
bool SciEngine::speechAndSubtitlesEnabled() { bool SciEngine::speechAndSubtitlesEnabled() {
bool subtitlesOn = ConfMan.getBool("subtitles"); bool subtitlesOn = ConfMan.getBool("subtitles");
bool speechOn = !ConfMan.getBool("speech_mute"); bool speechOn = !ConfMan.getBool("speech_mute");
if (isCD() && subtitlesOn && speechOn) if (isCD() && subtitlesOn && speechOn)
return true; return true;
return false; return false;
@ -936,7 +936,7 @@ void SciEngine::updateScummVMAudioOptions() {
// depending on the in-game settings // depending on the in-game settings
if (isCD() && getSciVersion() == SCI_VERSION_1_1) { if (isCD() && getSciVersion() == SCI_VERSION_1_1) {
uint16 ingameSetting = _gamestate->variables[VAR_GLOBAL][90].getOffset(); uint16 ingameSetting = _gamestate->variables[VAR_GLOBAL][90].getOffset();
switch (ingameSetting) { switch (ingameSetting) {
case 1: case 1:
// subtitles // subtitles

View file

@ -142,7 +142,7 @@ void SciMusic::init() {
_driverLastChannel = _pMidiDrv->getLastChannel(); _driverLastChannel = _pMidiDrv->getLastChannel();
if (getSciVersion() <= SCI_VERSION_0_LATE) if (getSciVersion() <= SCI_VERSION_0_LATE)
_globalReverb = _pMidiDrv->getReverb(); // Init global reverb for SCI0 _globalReverb = _pMidiDrv->getReverb(); // Init global reverb for SCI0
_currentlyPlayingSample = NULL; _currentlyPlayingSample = NULL;
} }

View file

@ -264,7 +264,7 @@ private:
int _driverFirstChannel; int _driverFirstChannel;
int _driverLastChannel; int _driverLastChannel;
MusicEntry *_currentlyPlayingSample; MusicEntry *_currentlyPlayingSample;
}; };