PRINCE: Remove trailing whitespace

This commit is contained in:
Filippos Karapetis 2014-10-28 16:21:53 +02:00
parent 8d11226723
commit 0f0ca25e43
18 changed files with 38 additions and 38 deletions

View File

@ -132,7 +132,7 @@ int16 Animation::getPhaseOffsetX(int phaseIndex) const {
if (phaseIndex < _phaseCount) {
return _phaseList[phaseIndex]._phaseOffsetX;
} else {
error("getPhaseOffsetX() phaseIndex: %d, phaseCount: %d", phaseIndex, _phaseCount);
error("getPhaseOffsetX() phaseIndex: %d, phaseCount: %d", phaseIndex, _phaseCount);
}
}
@ -140,7 +140,7 @@ int16 Animation::getPhaseOffsetY(int phaseIndex) const {
if (phaseIndex < _phaseCount) {
return _phaseList[phaseIndex]._phaseOffsetY;
} else {
error("getPhaseOffsetY() phaseIndex: %d, phaseCount: %d", phaseIndex, _phaseCount);
error("getPhaseOffsetY() phaseIndex: %d, phaseCount: %d", phaseIndex, _phaseCount);
}
}
@ -148,7 +148,7 @@ int16 Animation::getPhaseFrameIndex(int phaseIndex) const {
if (phaseIndex < _phaseCount) {
return _phaseList[phaseIndex]._phaseToFrameIndex;
} else {
error("getPhaseFrameIndex() phaseIndex: %d, phaseCount: %d", phaseIndex, _phaseCount);
error("getPhaseFrameIndex() phaseIndex: %d, phaseCount: %d", phaseIndex, _phaseCount);
}
}

View File

@ -35,7 +35,7 @@ public:
Animation();
~Animation();
bool loadStream(Common::SeekableReadStream &stream);
int16 getLoopCount() const;
int32 getPhaseCount() const;
int32 getFrameCount() const;

View File

@ -64,7 +64,7 @@ bool PtcArchive::open(const Common::String &filename) {
byte *fileTableEnd = fileTable + fileTableSize;
_stream->read(fileTable, fileTableSize);
decrypt(fileTable, fileTableSize);
for (byte *fileItem = fileTable; fileItem < fileTableEnd; fileItem += 32) {
FileEntry item;
Common::String name = (const char*)fileItem;

View File

@ -30,7 +30,7 @@
namespace Prince {
class Cursor {
public:
public:
Cursor();
~Cursor();

View File

@ -194,7 +194,7 @@ void GraphicsMan::drawTransparentDrawNode(Graphics::Surface *screen, DrawNode *d
/**
* Similar to drawTransparentDrawNode but with additional anti-aliasing code for sprite drawing.
* Edge smoothing is based on 256 x 256 table of colors transition.
* Algorithm is checking if currently drawing pixel is located next to the edge of sprite and if it makes jagged line.
* Algorithm is checking if currently drawing pixel is located next to the edge of sprite and if it makes jagged line.
* If it does then this pixel is set with color from transition table calculated of original background pixel color
* and sprite's edge pixel color.
*/

View File

@ -35,7 +35,7 @@ class GraphicsMan {
public:
GraphicsMan(PrinceEngine *vm);
~GraphicsMan();
void update(Graphics::Surface *screen);
void change();

View File

@ -129,7 +129,7 @@ int Hero::getScaledValue(int size) {
Graphics::Surface *Hero::zoomSprite(Graphics::Surface *heroFrame) {
Graphics::Surface *zoomedFrame = new Graphics::Surface();
zoomedFrame->create(_scaledFrameXSize, _scaledFrameYSize, Graphics::PixelFormat::createFormatCLUT8());
int sprZoomX;
int sprZoomY = _vm->_scaleValue;
uint xSource = 0;

View File

@ -129,7 +129,7 @@ public:
void drawHeroShadow(Graphics::Surface *heroFrame);
void freeOldMove();
void freeHeroAnim();
uint16 _number;
uint16 _visible;
int16 _state;
@ -170,7 +170,7 @@ public:
int _color; // subtitles color
uint32 _animSetNr; // number of animation set
Common::Array<Animation *> _moveSet; // MoveAnims MoveSet
uint32 _moveDelay;
uint32 _shadMinus;

View File

@ -38,7 +38,7 @@ MhwanhDecoder::~MhwanhDecoder() {
void MhwanhDecoder::destroy() {
if (_surface != nullptr) {
_surface->free();
delete _surface;
delete _surface;
_surface = nullptr;
}
if (_palette != nullptr) {
@ -57,7 +57,7 @@ bool MhwanhDecoder::loadStream(Common::SeekableReadStream &stream) {
_palette[i * 3] = stream.readByte();
_palette[i * 3 + 1] = stream.readByte();
_palette[i * 3 + 2] = stream.readByte();
}
}
_surface = new Graphics::Surface();
_surface->create(640, 480, Graphics::PixelFormat::createFormatCLUT8());

View File

@ -50,7 +50,7 @@ public:
void setData(AttrId dataId, uint16 value);
uint16 getData(AttrId dataId);
bool _visible;
bool _visible;
uint16 _type;
uint16 _mask;
Common::Rect _rect;

View File

@ -79,7 +79,7 @@ bool Object::loadFromStream(Common::SeekableReadStream &stream) {
_flags = stream.readUint16LE();
_z = stream.readUint16LE();
stream.seek(pos + 16);
return true;

View File

@ -62,7 +62,7 @@ public:
private:
void loadSurface(Common::SeekableReadStream &stream);
Graphics::Surface *_surface;
Graphics::Surface *_surface;
};
} // End of namespace Prince

View File

@ -213,11 +213,11 @@ GUI::Debugger *PrinceEngine::getDebugger() {
void PrinceEngine::init() {
const Common::FSNode gameDataDir(ConfMan.get("path"));
debugEngine("Adding all path: %s", gameDataDir.getPath().c_str());
PtcArchive *all = new PtcArchive();
if (!all->open("all/databank.ptc"))
if (!all->open("all/databank.ptc"))
error("Can't open all/databank.ptc");
PtcArchive *voices = new PtcArchive();
@ -261,7 +261,7 @@ void PrinceEngine::init() {
_variaTxt = new VariaTxt();
Resource::loadResource(_variaTxt, "variatxt.dat", true);
_cursor1 = new Cursor();
Resource::loadResource(_cursor1, "mouse1.cur", true);
@ -705,7 +705,7 @@ void PrinceEngine::freeAllSamples() {
}
bool PrinceEngine::loadSample(uint32 sampleSlot, const Common::String &streamName) {
// FIXME: This is just a workaround streamName is a path
// FIXME: This is just a workaround streamName is a path
// SOUND\\SCIERKA1.WAV for now only last path component is used
Common::String normalizedPath = lastPathComponent(streamName, '\\');
@ -756,7 +756,7 @@ bool PrinceEngine::loadVoice(uint32 slot, uint32 sampleSlot, const Common::Strin
}
id = sampleStream->readUint32LE();
debugEngine("SetVoice slot %d time %04x", slot, id);
debugEngine("SetVoice slot %d time %04x", slot, id);
id <<= 3;
id /= 22050;
id += 2;
@ -768,7 +768,7 @@ bool PrinceEngine::loadVoice(uint32 slot, uint32 sampleSlot, const Common::Strin
_secondHero->_talkTime = id;
}
debugEngine("SetVoice slot %d time %04x", slot, id);
debugEngine("SetVoice slot %d time %04x", slot, id);
sampleStream->seek(SEEK_SET);
_audioStream[sampleSlot] = Audio::makeWAVStream(sampleStream, DisposeAfterUse::NO);
delete sampleStream;
@ -4321,7 +4321,7 @@ int PrinceEngine::scanDirectionsFindNext(byte *tempCoordsBuf, int xDiff, int yDi
tempCoordsBuf += 4;
if (tempCoordsBuf == _coords) {
direction = tempX;
direction = tempX;
break;
}

View File

@ -242,7 +242,7 @@ struct DebugChannel {
enum Type {
kScript,
kEngine
kEngine
};
};
@ -658,7 +658,7 @@ private:
Common::Array<Mob> _invMobList;
bool _flicLooped;
void mainLoop();
};

View File

@ -40,7 +40,7 @@ public:
Graphics::Surface *getSurface() const { return _surface; }
private:
void loadSurface(Common::SeekableReadStream &stream);
Graphics::Surface *_surface;
Graphics::Surface *_surface;
};
} // End of namespace Prince

View File

@ -41,13 +41,13 @@ namespace Resource {
bool loadResource(T *resource, const char *resourceName, bool required) {
Common::ScopedPtr<Common::SeekableReadStream> stream(SearchMan.createReadStreamForMember(resourceName));
if (!stream) {
if (required)
if (required)
error("Can't load %s", resourceName);
return false;
}
return loadFromStream(*resource, *stream);
}
}
template <typename T>
bool loadResource(Common::Array<T> &array, Common::SeekableReadStream &stream, bool required = true) {
@ -82,7 +82,7 @@ namespace Resource {
}
// FIXME: This is stupid. Maybe loadFromStream should be helper method that returns initiailzed object
while (true) {
while (true) {
T* t = new T();
if (!t->loadFromStream(*stream)) {
delete t;

View File

@ -480,7 +480,7 @@ bool PrinceEngine::loadGame(int slotNumber) {
saveFile->read(dataBuffer, size);
readStream = new Common::MemoryReadStream(dataBuffer, size, DisposeAfterUse::YES);
delete saveFile;
// Check to see if it's a ScummVM savegame or not
char buffer[kSavegameStrSize + 1];
readStream->read(buffer, kSavegameStrSize + 1);
@ -507,7 +507,7 @@ bool PrinceEngine::loadGame(int slotNumber) {
// TODO
//syncSpeechSettings();
return true;
}

View File

@ -43,7 +43,7 @@ Room::Room() {}
bool Room::loadRoom(byte *roomData) {
int roomSize = 64;
Common::MemoryReadStream roomStream(roomData, roomSize);
_mobs = roomStream.readSint32LE();
_backAnim = roomStream.readSint32LE();
_obj = roomStream.readSint32LE();
@ -131,7 +131,7 @@ bool Script::loadStream(Common::SeekableReadStream &stream) {
_scriptInfo.invObjGive = scriptDataStream.readSint32LE();
_scriptInfo.stdGiveItem = scriptDataStream.readSint32LE();
_scriptInfo.goTester = scriptDataStream.readSint32LE();
return true;
}
@ -427,7 +427,7 @@ int32 InterpreterFlags::getFlagValue(Flags::Id flagId) {
return _flags[(uint32)flagId - kFlagMask];
}
Interpreter::Interpreter(PrinceEngine *vm, Script *script, InterpreterFlags *flags) :
Interpreter::Interpreter(PrinceEngine *vm, Script *script, InterpreterFlags *flags) :
_vm(vm), _script(script), _flags(flags),
_stacktop(0), _opcodeNF(false), _opcodeEnd(false),
_waitFlag(0), _result(true) {
@ -479,8 +479,8 @@ uint32 Interpreter::step(uint32 opcodePC) {
if (_lastOpcode >= kNumOpcodes)
error(
"Trying to execute unknown opcode @0x%04X: %02d",
_currentInstruction,
"Trying to execute unknown opcode @0x%04X: %02d",
_currentInstruction,
_lastOpcode);
// Execute the current opcode
@ -570,7 +570,7 @@ int32 Interpreter::readScriptFlagValue() {
return value;
}
Flags::Id Interpreter::readScriptFlagId() {
Flags::Id Interpreter::readScriptFlagId() {
return (Flags::Id)readScript16();
}
@ -1689,7 +1689,7 @@ void Interpreter::O_POPSTRING() {
void Interpreter::O_SETFGCODE() {
int32 offset = readScript32();
_fgOpcodePC = _currentInstruction + offset - 4;
_fgOpcodePC = _currentInstruction + offset - 4;
debugInterpreter("O_SETFGCODE next %08x, offset %08x", _fgOpcodePC, offset);
}