Small cleanup (remove extra whitespaces, add some comments, fix

indentation, reduce include dependencies, ...)
This commit is contained in:
Jordi Vilalta Prat 2010-01-24 23:23:39 +08:00 committed by Scott Thomas
parent 914db18fb9
commit 23ac0019e7
17 changed files with 135 additions and 182 deletions

View file

@ -27,7 +27,6 @@
#include "engines/stark/adpcm.h"
#include "common/endian.h"
#include "sound/audiostream.h"

View file

@ -26,7 +26,6 @@
#ifndef SOUND_ADPCM_H
#define SOUND_ADPCM_H
#include "common/sys.h"
#include "common/stream.h"
#include "sound/audiostream.h"
@ -75,4 +74,4 @@ Audio::AudioStream *makeADPCMStream(
} // End of namespace Audio
#endif
#endif // SOUND_ADPCM_H

View file

@ -26,8 +26,6 @@
#include "engines/stark/archive.h"
#include "common/debug.h"
#include "common/endian.h"
#include "common/util.h"
namespace Stark {
@ -68,5 +66,4 @@ void XARCArchive::close() {
//inline Common::String XARCArchive::readString(Common::SeekableReadStream *stream){
} // End of namespace Stark

View file

@ -26,10 +26,7 @@
#ifndef STARK_ARCHIVE_H
#define STARK_ARCHIVE_H
#include "common/array.h"
#include "common/file.h"
#include "common/str.h"
#include "common/stream.h"
namespace Stark {
@ -80,6 +77,6 @@ private:
uint32 *_offsets;
};
}
} // End of namespace Stark
#endif
#endif // STARK_ARCHIVE_H

View file

@ -59,6 +59,6 @@ public:
}
};
} // end of namespace Stark
} // End of namespace Stark
#endif
#endif // STARK_COLOR_H

View file

@ -36,8 +36,8 @@ struct Shadow;
class GfxBase {
public:
GfxBase() { ; }
virtual ~GfxBase() { ; }
GfxBase() { }
virtual ~GfxBase() { }
struct TextObjectHandle {
uint16 *bitmapData;
@ -102,6 +102,6 @@ protected:
extern GfxBase *g_driver;
} // end of namespace Stark
} // End of namespace Stark
#endif
#endif // STARK_GFX_BASE_H

View file

@ -23,14 +23,19 @@
*
*/
#include "common/endian.h"
#include "engines/stark/gfx_opengl.h"
#include "common/system.h"
#include "engines/stark/gfx_opengl.h"
#include "engines/stark/stark.h"
#ifdef USE_OPENGL
#ifdef SDL_BACKEND
#include <SDL_opengl.h>
#else
#include <GL/gl.h>
#include <GL/glu.h>
#endif
namespace Stark {
GfxOpenGL::GfxOpenGL() {
@ -176,6 +181,6 @@ void GfxOpenGL::drawSurface(Graphics::Surface* surface) {
glDrawPixels(surface->w, surface->h, GL_RGB, GL_UNSIGNED_BYTE, surface->pixels);
}
} // end of namespace Stark
} // End of namespace Stark
#endif
#endif // USE_OPENGL

View file

@ -30,13 +30,6 @@
#ifdef USE_OPENGL
#ifdef SDL_BACKEND
#include <SDL_opengl.h>
#else
#include <GL/gl.h>
#include <GL/glu.h>
#endif
namespace Stark {
class GfxOpenGL : public GfxBase {
@ -63,14 +56,12 @@ byte *setupScreen(int screenW, int screenH, bool fullscreen);
void drawSurface(Graphics::Surface *bmp);
protected:
private:
byte *_storedDisplay;
};
} // end of namespace Stark
} // End of namespace Stark
#endif
#endif // USE_OPENGL
#endif
#endif // STARK_GFX_OPENGL_H

View file

@ -25,14 +25,8 @@
#include "engines/stark/sound.h"
#include "engines/stark/adpcm.h"
#include "engines/stark/archive.h"
#include "sound/audiostream.h"
#include "common/debug.h"
#include "common/endian.h"
#include "common/util.h"
namespace Stark {
ISS::ISS(Common::SeekableReadStream *str) {
@ -71,7 +65,6 @@ ISS::ISS(Common::SeekableReadStream *str){
_stream = Stark::makeADPCMStream(str, true, size, Stark::kADPCMISS, freq, channels, blockSize);
}
}
} // End of namespace Stark

12
sound.h
View file

@ -26,9 +26,6 @@
#ifndef STARK_SOUND_H
#define STARK_SOUND_H
#include "common/array.h"
#include "common/file.h"
#include "common/str.h"
#include "common/stream.h"
#include "sound/audiostream.h"
@ -41,13 +38,8 @@ public:
~ISS() { }
Audio::AudioStream *_stream;
private:
protected:
};
}
} // End of namespace Stark
#endif
#endif // STARK_SOUND_H

View file

@ -23,21 +23,16 @@
*
*/
#include "common/events.h"
#include "common/config-manager.h"
#include "engines/stark/gfx_opengl.h"
#include "engines/stark/stark.h"
#include "engines/stark/adpcm.h"
#include "engines/stark/sound.h"
#include "engines/stark/gfx_opengl.h"
#include "engines/stark/xmg.h"
#include "common/config-manager.h"
#include "common/events.h"
#include "sound/mixer.h"
namespace Stark {
StarkEngine *g_stark = NULL;
GfxBase *g_driver = NULL;
StarkEngine::StarkEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) {
@ -45,9 +40,6 @@ StarkEngine::StarkEngine(OSystem *syst, const ADGameDescription *gameDesc) : Eng
_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume"));
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
g_stark = this;
}
StarkEngine::~StarkEngine() {
@ -75,7 +67,7 @@ Common::Error StarkEngine::run() {
g_driver->clearScreen();
// Start running
g_stark->mainLoop();
mainLoop();
return Common::kNoError;
}
@ -144,4 +136,5 @@ void StarkEngine::updateDisplayScene(){
void StarkEngine::doFlip() {
g_driver->flipBuffer();
}
} // end of namespace Stark
} // End of namespace Stark

15
stark.h
View file

@ -30,7 +30,6 @@
#include "engines/engine.h"
#include "engines/stark/archive.h"
#include "engines/stark/xrc.h"
namespace Stark {
@ -50,21 +49,21 @@ public:
StarkEngine(OSystem *syst, const ADGameDescription *gameDesc);
virtual ~StarkEngine();
void updateDisplayScene();
void doFlip();
void mainLoop();
protected:
// Engine APIs
virtual Common::Error run();
private:
void updateDisplayScene();
void doFlip();
void mainLoop();
const ADGameDescription *_gameDescription;
XARCArchive _xArchive;
};
} // end of namespace Stark
} // End of namespace Stark
#endif
#endif // STARK_H

View file

@ -23,8 +23,6 @@
*
*/
#include "common/util.h"
#include "engines/stark/xmg.h"
namespace Stark {
@ -96,7 +94,6 @@ Graphics::Surface *XMGDecoder::decodeImage(Common::SeekableReadStream *stream) {
}
break;
}
}
_pixels = 0;
@ -125,7 +122,6 @@ void XMGDecoder::processYCrCb(uint16 count){
_pixels += 6;
}
_currX += 2 * count;
}
void XMGDecoder::processTrans(uint16 count) {
@ -200,4 +196,4 @@ void XMGDecoder::processRGB(uint16 count){
_currX += 2 * count;
}
} // end of namespace Stark
} // End of namespace Stark

6
xmg.h
View file

@ -26,7 +26,6 @@
#ifndef STARK_XMG_H
#define STARK_XMG_H
#include "common/sys.h"
#include "common/stream.h"
#include "graphics/surface.h"
@ -71,7 +70,6 @@ private:
uint32 _currX, _currY;
};
} // end of namespace Stark
#endif
} // End of namespace Stark
#endif // STARK_XMG_H

View file

@ -26,8 +26,6 @@
#include "engines/stark/xrc.h"
#include "common/debug.h"
#include "common/endian.h"
#include "common/util.h"
namespace Stark {

8
xrc.h
View file

@ -26,8 +26,6 @@
#ifndef STARK_XRC_H
#define STARK_XRC_H
#include "common/array.h"
#include "common/file.h"
#include "common/str.h"
#include "common/stream.h"
@ -55,10 +53,8 @@ private:
} *_xrcRoot;
void readEntry(Common::SeekableReadStream *stream, xrcEntry *parent);
protected:
};
}
} // End of namespace Stark
#endif
#endif // STARK_XRC_H