MADS: Slight formatting fixes.

This commit is contained in:
Johannes Schickel 2014-05-27 00:58:25 +02:00
parent 57c5656169
commit 9866aba2e4
20 changed files with 52 additions and 37 deletions

View file

@ -29,8 +29,9 @@
namespace MADS { namespace MADS {
Dialog::Dialog(MADSEngine *vm): _vm(vm), _savedSurface(nullptr), Dialog::Dialog(MADSEngine *vm)
_position(Common::Point(-1, -1)), _width(0), _height(0) { : _vm(vm), _savedSurface(nullptr), _position(Common::Point(-1, -1)),
_width(0), _height(0) {
TEXTDIALOG_CONTENT1 = 0XF8; TEXTDIALOG_CONTENT1 = 0XF8;
TEXTDIALOG_CONTENT2 = 0XF9; TEXTDIALOG_CONTENT2 = 0XF9;
TEXTDIALOG_EDGE = 0XFA; TEXTDIALOG_EDGE = 0XFA;
@ -136,8 +137,8 @@ void Dialog::drawContent(const Common::Rect &r, int seed, byte color1, byte colo
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
TextDialog::TextDialog(MADSEngine *vm, const Common::String &fontName, TextDialog::TextDialog(MADSEngine *vm, const Common::String &fontName,
const Common::Point &pos, int maxChars): const Common::Point &pos, int maxChars)
Dialog(vm) { : Dialog(vm) {
_vm = vm; _vm = vm;
_font = _vm->_font->getFont(fontName); _font = _vm->_font->getFont(fontName);
_position = pos; _position = pos;
@ -363,8 +364,8 @@ void TextDialog::show() {
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
MessageDialog::MessageDialog(MADSEngine *vm, int maxChars, ...): MessageDialog::MessageDialog(MADSEngine *vm, int maxChars, ...)
TextDialog(vm, FONT_INTERFACE, Common::Point(-1, -1), maxChars) { : TextDialog(vm, FONT_INTERFACE, Common::Point(-1, -1), maxChars) {
// Add in passed line list // Add in passed line list
va_list va; va_list va;
va_start(va, maxChars); va_start(va, maxChars);
@ -389,7 +390,8 @@ Dialogs *Dialogs::init(MADSEngine *vm) {
return new Nebular::DialogsNebular(vm); return new Nebular::DialogsNebular(vm);
} }
Dialogs::Dialogs(MADSEngine *vm): _vm(vm) { Dialogs::Dialogs(MADSEngine *vm)
: _vm(vm) {
_pendingDialog = DIALOG_NONE; _pendingDialog = DIALOG_NONE;
} }

View file

@ -35,7 +35,8 @@ namespace MADS {
namespace Dragonsphere { namespace Dragonsphere {
GameDragonsphere::GameDragonsphere(MADSEngine *vm): Game(vm) { GameDragonsphere::GameDragonsphere(MADSEngine *vm)
: Game(vm) {
_surface = new MSurface(MADS_SCREEN_WIDTH, MADS_SCENE_HEIGHT); _surface = new MSurface(MADS_SCREEN_WIDTH, MADS_SCENE_HEIGHT);
_storyMode = STORYMODE_NAUGHTY; _storyMode = STORYMODE_NAUGHTY;
} }

View file

@ -127,7 +127,7 @@ public:
class Section1Handler: public SectionHandler { class Section1Handler: public SectionHandler {
public: public:
Section1Handler(MADSEngine *vm): SectionHandler(vm) {} Section1Handler(MADSEngine *vm) : SectionHandler(vm) {}
// TODO: Properly implement handler methods // TODO: Properly implement handler methods
virtual void preLoadSection() {} virtual void preLoadSection() {}

View file

@ -56,8 +56,9 @@ Game *Game::init(MADSEngine *vm) {
return nullptr; return nullptr;
} }
Game::Game(MADSEngine *vm): _vm(vm), _surface(nullptr), _objects(vm), Game::Game(MADSEngine *vm)
_scene(vm), _screenObjects(vm), _player(vm) { : _vm(vm), _surface(nullptr), _objects(vm), _scene(vm),
_screenObjects(vm), _player(vm) {
_sectionNumber = _priorSectionNumber = 0; _sectionNumber = _priorSectionNumber = 0;
_loadGameSlot = -1; _loadGameSlot = -1;
_lastSave = -1; _lastSave = -1;

View file

@ -59,7 +59,7 @@ class SectionHandler {
protected: protected:
MADSEngine *_vm; MADSEngine *_vm;
public: public:
SectionHandler(MADSEngine *vm): _vm(vm) {} SectionHandler(MADSEngine *vm) : _vm(vm) {}
virtual ~SectionHandler() {} virtual ~SectionHandler() {}
virtual void preLoadSection() = 0; virtual void preLoadSection() = 0;

View file

@ -87,7 +87,7 @@ public:
/** /**
* Constructor * Constructor
*/ */
InventoryObjects(MADSEngine *vm): _vm(vm) {} InventoryObjects(MADSEngine *vm) : _vm(vm) {}
/** /**
* Loads the game's object list * Loads the game's object list

View file

@ -42,7 +42,8 @@ void RandomMessages::reset() {
} }
KernelMessages::KernelMessages(MADSEngine *vm): _vm(vm) { KernelMessages::KernelMessages(MADSEngine *vm)
: _vm(vm) {
for (int i = 0; i < KERNEL_MESSAGES_SIZE; ++i) { for (int i = 0; i < KERNEL_MESSAGES_SIZE; ++i) {
KernelMessage rec; KernelMessage rec;
_entries.push_back(rec); _entries.push_back(rec);

View file

@ -35,7 +35,8 @@ namespace MADS {
namespace Nebular { namespace Nebular {
GameNebular::GameNebular(MADSEngine *vm): Game(vm) { GameNebular::GameNebular(MADSEngine *vm)
: Game(vm) {
_surface = new MSurface(MADS_SCREEN_WIDTH, MADS_SCENE_HEIGHT); _surface = new MSurface(MADS_SCREEN_WIDTH, MADS_SCENE_HEIGHT);
_storyMode = STORYMODE_NAUGHTY; _storyMode = STORYMODE_NAUGHTY;
_difficulty = DIFFICULTY_EASY; _difficulty = DIFFICULTY_EASY;

View file

@ -129,7 +129,7 @@ public:
class Section1Handler: public SectionHandler { class Section1Handler: public SectionHandler {
public: public:
Section1Handler(MADSEngine *vm): SectionHandler(vm) {} Section1Handler(MADSEngine *vm) : SectionHandler(vm) {}
// TODO: Properly implement handler methods // TODO: Properly implement handler methods
virtual void preLoadSection() {} virtual void preLoadSection() {}

View file

@ -28,7 +28,8 @@ namespace MADS {
namespace Nebular { namespace Nebular {
NebularGlobals::NebularGlobals(): Globals() { NebularGlobals::NebularGlobals()
: Globals() {
// Initialize lists // Initialize lists
resize(210); resize(210);
_spriteIndexes.resize(30); _spriteIndexes.resize(30);

View file

@ -934,7 +934,8 @@ const ASound1::CommandPtr ASound1::_commandList[42] = {
&ASound1::command40, &ASound1::command41 &ASound1::command40, &ASound1::command41
}; };
ASound1::ASound1(Audio::Mixer *mixer): ASound(mixer, "asound.001", 0x1520) { ASound1::ASound1(Audio::Mixer *mixer)
: ASound(mixer, "asound.001", 0x1520) {
_cmd23Toggle = false; _cmd23Toggle = false;
// Load sound samples // Load sound samples

View file

@ -336,7 +336,8 @@ void RGBList::copy(RGBList &src) {
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
Fader::Fader(MADSEngine *vm): _vm(vm) { Fader::Fader(MADSEngine *vm)
: _vm(vm) {
_colorFlags[0] = _colorFlags[1] = _colorFlags[2] = true; _colorFlags[0] = _colorFlags[1] = _colorFlags[2] = true;
_colorFlags[3] = false; _colorFlags[3] = false;
_colorValues[0] = _colorValues[1] = 0; _colorValues[0] = _colorValues[1] = 0;

View file

@ -35,7 +35,8 @@ namespace MADS {
namespace Phantom { namespace Phantom {
GamePhantom::GamePhantom(MADSEngine *vm): Game(vm) { GamePhantom::GamePhantom(MADSEngine *vm)
: Game(vm) {
_surface = new MSurface(MADS_SCREEN_WIDTH, MADS_SCENE_HEIGHT); _surface = new MSurface(MADS_SCREEN_WIDTH, MADS_SCENE_HEIGHT);
_storyMode = STORYMODE_NAUGHTY; _storyMode = STORYMODE_NAUGHTY;
} }

View file

@ -103,7 +103,7 @@ public:
class Section1Handler: public SectionHandler { class Section1Handler: public SectionHandler {
public: public:
Section1Handler(MADSEngine *vm): SectionHandler(vm) {} Section1Handler(MADSEngine *vm) : SectionHandler(vm) {}
// TODO: Properly implement handler methods // TODO: Properly implement handler methods
virtual void preLoadSection() {} virtual void preLoadSection() {}

View file

@ -32,7 +32,8 @@ const int Player::_directionListIndexes[32] = {
0, 7, 4, 3, 6, 0, 2, 5, 0, 1, 9, 4, 1, 2, 7, 9, 3, 8, 9, 6, 7, 2, 3, 6, 1, 7, 9, 4, 7, 8, 0, 0 0, 7, 4, 3, 6, 0, 2, 5, 0, 1, 9, 4, 1, 2, 7, 9, 3, 8, 9, 6, 7, 2, 3, 6, 1, 7, 9, 4, 7, 8, 0, 0
}; };
Player::Player(MADSEngine *vm): _vm(vm) { Player::Player(MADSEngine *vm)
: _vm(vm) {
_action = nullptr; _action = nullptr;
_facing = FACING_NORTH; _facing = FACING_NORTH;
_turnToFacing = FACING_NORTH; _turnToFacing = FACING_NORTH;

View file

@ -44,9 +44,10 @@ private:
uint32 _offset; uint32 _offset;
uint32 _size; uint32 _size;
HagEntry(): _offset(0), _size(0) {} HagEntry() : _offset(0), _size(0) {}
HagEntry(Common::String resourceName, uint32 offset, uint32 size): HagEntry(Common::String resourceName, uint32 offset, uint32 size)
_resourceName(resourceName), _offset(offset), _size(size) {} : _resourceName(resourceName), _offset(offset), _size(size) {
}
}; };
class HagIndex { class HagIndex {

View file

@ -58,12 +58,12 @@ public:
/** /**
* Derived file class * Derived file class
*/ */
class File: public Common::File { class File : public Common::File {
public: public:
/** /**
* Constructor * Constructor
*/ */
File(): Common::File() {} File() : Common::File() {}
/** /**
* Constructor * Constructor

View file

@ -30,10 +30,11 @@
namespace MADS { namespace MADS {
Scene::Scene(MADSEngine *vm): _vm(vm), _action(_vm), _depthSurface(vm), Scene::Scene(MADSEngine *vm)
_dirtyAreas(_vm), _dynamicHotspots(vm), _hotspots(vm), : _vm(vm), _action(_vm), _depthSurface(vm),
_kernelMessages(vm), _sequences(vm), _sprites(vm), _spriteSlots(vm), _dirtyAreas(_vm), _dynamicHotspots(vm), _hotspots(vm),
_textDisplay(vm), _userInterface(vm) { _kernelMessages(vm), _sequences(vm), _sprites(vm), _spriteSlots(vm),
_textDisplay(vm), _userInterface(vm) {
_priorSceneId = 0; _priorSceneId = 0;
_nextSceneId = 0; _nextSceneId = 0;
_currentSceneId = 0; _currentSceneId = 0;

View file

@ -65,8 +65,9 @@ public:
PrepType _prepType; PrepType _prepType;
VerbInit() {} VerbInit() {}
VerbInit(int id, VerbType verbType, PrepType prepType): _id(id), VerbInit(int id, VerbType verbType, PrepType prepType)
_verbType(verbType), _prepType(prepType) {} : _id(id), _verbType(verbType), _prepType(prepType) {
}
}; };
class SceneLogic { class SceneLogic {

View file

@ -54,13 +54,14 @@ typedef Common::List<DepthEntry> DepthList;
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
MSprite::MSprite(): MSurface() { MSprite::MSprite()
: MSurface() {
} }
MSprite::MSprite(Common::SeekableReadStream *source, const Common::Array<RGB6> &palette, MSprite::MSprite(Common::SeekableReadStream *source, const Common::Array<RGB6> &palette,
const Common::Rect &bounds): const Common::Rect &bounds)
MSurface(bounds.width(), bounds.height()), : MSurface(bounds.width(), bounds.height()),
_offset(Common::Point(bounds.left, bounds.top)) { _offset(Common::Point(bounds.left, bounds.top)) {
// Load the sprite data // Load the sprite data
loadSprite(source, palette); loadSprite(source, palette);
} }