[Scummvm-git-logs] scummvm master -> 06902574b4e3b7ab9073d20426ae0f66f1215677
aquadran
noreply at scummvm.org
Tue Jun 7 23:12:05 UTC 2022
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
06902574b4 GRIM: Janitorial
Commit: 06902574b4e3b7ab9073d20426ae0f66f1215677
https://github.com/scummvm/scummvm/commit/06902574b4e3b7ab9073d20426ae0f66f1215677
Author: PaweÅ KoÅodziejski (aquadran at gmail.com)
Date: 2022-06-08T01:12:00+02:00
Commit Message:
GRIM: Janitorial
Changed paths:
engines/grim/actor.cpp
engines/grim/actor.h
engines/grim/animation.cpp
engines/grim/bitmap.cpp
engines/grim/bitmap.h
engines/grim/color.cpp
engines/grim/costume.cpp
engines/grim/costume.h
engines/grim/costume/anim_component.cpp
engines/grim/costume/bitmap_component.cpp
engines/grim/costume/chore.cpp
engines/grim/costume/colormap_component.cpp
engines/grim/costume/component.cpp
engines/grim/costume/component.h
engines/grim/costume/head.cpp
engines/grim/costume/lua_var_component.cpp
engines/grim/costume/material_component.cpp
engines/grim/costume/mesh_component.cpp
engines/grim/costume/model_component.cpp
engines/grim/costume/sound_component.cpp
engines/grim/costume/sprite_component.cpp
engines/grim/debugger.cpp
engines/grim/detection.cpp
engines/grim/emi/animationemi.cpp
engines/grim/emi/animationemi.h
engines/grim/emi/costume/emihead.h
engines/grim/emi/costume/emiluacode_component.cpp
engines/grim/emi/costume/emiluavar_component.cpp
engines/grim/emi/costume/emitexi_component.cpp
engines/grim/emi/emi.cpp
engines/grim/emi/emi_registry.cpp
engines/grim/emi/layer.cpp
engines/grim/emi/layer.h
engines/grim/emi/lua_v2.cpp
engines/grim/emi/lua_v2.h
engines/grim/emi/lua_v2_actor.cpp
engines/grim/emi/lua_v2_sound.cpp
engines/grim/emi/modelemi.cpp
engines/grim/emi/modelemi.h
engines/grim/emi/poolsound.cpp
engines/grim/emi/poolsound.h
engines/grim/emi/skeleton.cpp
engines/grim/emi/skeleton.h
engines/grim/emi/sound/aifftrack.cpp
engines/grim/emi/sound/aifftrack.h
engines/grim/emi/sound/codecs/scx.cpp
engines/grim/emi/sound/emisound.cpp
engines/grim/emi/sound/emisound.h
engines/grim/emi/sound/mp3track.cpp
engines/grim/emi/sound/mp3track.h
engines/grim/emi/sound/scxtrack.cpp
engines/grim/emi/sound/scxtrack.h
engines/grim/emi/sound/track.cpp
engines/grim/emi/sound/track.h
engines/grim/emi/sound/vimatrack.cpp
engines/grim/emi/sound/vimatrack.h
engines/grim/font.cpp
engines/grim/gfx_base.cpp
engines/grim/gfx_opengl.cpp
engines/grim/gfx_opengl_shaders.cpp
engines/grim/gfx_opengl_shaders.h
engines/grim/gfx_tinygl.cpp
engines/grim/grim.cpp
engines/grim/grim.h
engines/grim/grim_controls.cpp
engines/grim/inputdialog.cpp
engines/grim/iris.cpp
engines/grim/keyframe.cpp
engines/grim/lipsync.cpp
engines/grim/localize.cpp
engines/grim/lua.cpp
engines/grim/lua_v1.cpp
engines/grim/lua_v1_actor.cpp
engines/grim/lua_v1_graphics.cpp
engines/grim/lua_v1_set.cpp
engines/grim/lua_v1_sound.cpp
engines/grim/lua_v1_text.cpp
engines/grim/material.cpp
engines/grim/md5checkdialog.cpp
engines/grim/model.cpp
engines/grim/model.h
engines/grim/movie/bink.cpp
engines/grim/movie/codecs/blocky8.cpp
engines/grim/movie/codecs/codec48.cpp
engines/grim/movie/codecs/smush_decoder.cpp
engines/grim/movie/codecs/smush_decoder.h
engines/grim/movie/movie.h
engines/grim/movie/mpeg.cpp
engines/grim/movie/quicktime.cpp
engines/grim/objectstate.cpp
engines/grim/patchr.cpp
engines/grim/remastered/commentary.cpp
engines/grim/remastered/commentary.h
engines/grim/remastered/hotspot.cpp
engines/grim/remastered/hotspot.h
engines/grim/remastered/lua_remastered.cpp
engines/grim/remastered/overlay.cpp
engines/grim/remastered/overlay.h
engines/grim/resource.cpp
engines/grim/sector.cpp
engines/grim/set.cpp
engines/grim/set.h
engines/grim/sound.cpp
engines/grim/sound.h
engines/grim/sprite.cpp
engines/grim/textobject.cpp
engines/grim/textobject.h
engines/grim/textsplit.cpp
engines/grim/update/lang_filter.cpp
engines/grim/update/mscab.cpp
engines/grim/update/mscab.h
engines/grim/update/packfile.cpp
diff --git a/engines/grim/actor.cpp b/engines/grim/actor.cpp
index e1b4c4931cc..9e298f77560 100644
--- a/engines/grim/actor.cpp
+++ b/engines/grim/actor.cpp
@@ -35,7 +35,6 @@
#include "engines/grim/set.h"
#include "engines/grim/gfx_base.h"
#include "engines/grim/model.h"
-
#include "engines/grim/emi/emi.h"
#include "engines/grim/emi/costumeemi.h"
#include "engines/grim/emi/skeleton.h"
@@ -817,7 +816,7 @@ void Actor::walkForward() {
if (!_followBoxes) {
Math::Vector3d forwardVec(-_moveYaw.getSine() * _pitch.getCosine(),
- _moveYaw.getCosine() * _pitch.getCosine(), _pitch.getSine());
+ _moveYaw.getCosine() * _pitch.getCosine(), _pitch.getSine());
// EMI: Y is up-down, actors use an X-Z plane for movement
if (g_grim->getGameType() == GType_MONKEY4) {
@@ -846,7 +845,7 @@ void Actor::walkForward() {
g_grim->getCurrSet()->findClosestSector(_pos, &currSector, &_pos);
if (!currSector) { // Shouldn't happen...
Math::Vector3d forwardVec(-_moveYaw.getSine() * _pitch.getCosine(),
- _moveYaw.getCosine() * _pitch.getCosine(), _pitch.getSine());
+ _moveYaw.getCosine() * _pitch.getCosine(), _pitch.getSine());
// EMI: Y is up-down, actors use an X-Z plane for movement
if (g_grim->getGameType() == GType_MONKEY4) {
@@ -877,7 +876,7 @@ void Actor::walkForward() {
float z1 = -_moveYaw.getCosine() * (ay - _pitch).getCosine();
float z2 = _moveYaw.getSine() * (ax - _pitch).getCosine();
forwardVec = Math::Vector3d(-_moveYaw.getSine() * ax.getSine() * _pitch.getCosine(),
- _moveYaw.getCosine() * ay.getSine() * _pitch.getCosine(), z1 + z2);
+ _moveYaw.getCosine() * ay.getSine() * _pitch.getCosine(), z1 + z2);
} else {
Math::Angle ax = Math::Vector2d(normal.x(), normal.y()).getAngle();
Math::Angle az = Math::Vector2d(normal.z(), normal.y()).getAngle();
@@ -885,7 +884,7 @@ void Actor::walkForward() {
float y1 = _moveYaw.getCosine() * (az - _pitch).getCosine();
float y2 = _moveYaw.getSine() * (ax - _pitch).getCosine();
forwardVec = Math::Vector3d(-_moveYaw.getSine() * ax.getSine() * _pitch.getCosine(), y1 + y2,
- -_moveYaw.getCosine() * az.getSine() * _pitch.getCosine());
+ -_moveYaw.getCosine() * az.getSine() * _pitch.getCosine());
}
if (backwards)
@@ -1514,8 +1513,8 @@ void Actor::updateWalk() {
if (_path.empty()) {
_walking = false;
_pos = destPos;
-// It seems that we need to allow an already active turning motion to
-// continue or else turning actors away from barriers won't work right
+ // It seems that we need to allow an already active turning motion to
+ // continue or else turning actors away from barriers won't work right
_turning = false;
return;
}
@@ -2020,7 +2019,7 @@ Math::Vector3d Actor::getTangentPos(const Math::Vector3d &pos, const Math::Vecto
Math::Segment2d segment(p1, p2);
// TODO: collision with Box
-// if (_collisionMode == CollisionSphere) {
+// if (_collisionMode == CollisionSphere) {
Math::Vector2d center(p.x(), p.y());
Math::Vector2d inter;
@@ -2034,9 +2033,8 @@ Math::Vector3d Actor::getTangentPos(const Math::Vector3d &pos, const Math::Vecto
return Math::Vector3d(v.getX(), v.getY(), dest.z());
}
-// } else {
-
-// }
+// } else {
+// }
return dest;
}
@@ -2126,8 +2124,7 @@ bool Actor::handleCollisionWith(Actor *actor, CollisionMode mode, Math::Vector3d
// because it seems the original does so.
// if you change this code test this places: the rocks in lb and bv (both when booting directly in the
// set and when coming in from another one) and the poles in xb.
- if (!this->getSphereInfo(true, size1, p1) ||
- !actor->getSphereInfo(false, size2, p2)) {
+ if (!this->getSphereInfo(true, size1, p1) || !actor->getSphereInfo(false, size2, p2)) {
return false;
}
@@ -2570,13 +2567,11 @@ unsigned const int Actor::ActionChore::talkFadeTime = 50;
Actor::ActionChore::ActionChore() :
_costume(nullptr),
_chore(-1) {
-
}
Actor::ActionChore::ActionChore(Costume *cost, int chore) :
_costume(cost),
_chore(chore) {
-
}
void Actor::ActionChore::play(bool fade, unsigned int time) {
diff --git a/engines/grim/actor.h b/engines/grim/actor.h
index 5795e53cc0c..76ea1525ec8 100644
--- a/engines/grim/actor.h
+++ b/engines/grim/actor.h
@@ -25,6 +25,7 @@
#include "engines/grim/pool.h"
#include "engines/grim/object.h"
#include "engines/grim/color.h"
+
#include "math/vector3d.h"
#include "math/angle.h"
#include "math/quat.h"
diff --git a/engines/grim/animation.cpp b/engines/grim/animation.cpp
index bffa3dd1d6c..dad77fef840 100644
--- a/engines/grim/animation.cpp
+++ b/engines/grim/animation.cpp
@@ -194,7 +194,6 @@ void Animation::restoreState(SaveGame *state) {
*/
AnimManager::AnimManager() {
-
}
AnimManager::~AnimManager() {
diff --git a/engines/grim/bitmap.cpp b/engines/grim/bitmap.cpp
index 6f9368acf63..6ad922a3cc7 100644
--- a/engines/grim/bitmap.cpp
+++ b/engines/grim/bitmap.cpp
@@ -119,12 +119,12 @@ bool BitmapData::loadGrimBm(Common::SeekableReadStream *data) {
data->readUint32LE(); //_transparentColor
_format = data->readUint32LE();
_bpp = data->readUint32LE();
-// uint32 redBits = data->readUint32LE();
-// uint32 greenBits = data->readUint32LE();
-// uint32 blueBits = data->readUint32LE();
-// uint32 redShift = data->readUint32LE();
-// uint32 greenShift = data->readUint32LE();
-// uint32 blueShift = data->readUint32LE();
+// uint32 redBits = data->readUint32LE();
+// uint32 greenBits = data->readUint32LE();
+// uint32 blueBits = data->readUint32LE();
+// uint32 redShift = data->readUint32LE();
+// uint32 greenShift = data->readUint32LE();
+// uint32 blueShift = data->readUint32LE();
// Hardcode the format, since the values saved in the files are garbage for some, like "ha_0_elvos.zbm".
Graphics::PixelFormat pixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0);
diff --git a/engines/grim/bitmap.h b/engines/grim/bitmap.h
index 13bc88dae34..f58440289b6 100644
--- a/engines/grim/bitmap.h
+++ b/engines/grim/bitmap.h
@@ -118,7 +118,7 @@ public:
uint32 _numVerts;
uint32 _numLayers;
-// private:
+//private:
Graphics::Surface *_data;
void *_userData;
};
diff --git a/engines/grim/color.cpp b/engines/grim/color.cpp
index dee73fc0d59..260007a96a5 100644
--- a/engines/grim/color.cpp
+++ b/engines/grim/color.cpp
@@ -46,9 +46,7 @@ Color::Color(uint32 c) {
}
uint32 Color::toEncodedValue() {
- return (_vals[0] << 16) |
- (_vals[1] << 8) |
- _vals[2];
+ return (_vals[0] << 16) | (_vals[1] << 8) | _vals[2];
}
Color &Color::operator =(const Color &c) {
@@ -66,4 +64,3 @@ Color &Color::operator =(const Color *c) {
}
} // end of namespace Grim
-
diff --git a/engines/grim/costume.cpp b/engines/grim/costume.cpp
index 7412f10e706..ac544ce394a 100644
--- a/engines/grim/costume.cpp
+++ b/engines/grim/costume.cpp
@@ -166,10 +166,11 @@ void Costume::load(Common::SeekableReadStream *data) {
delete[] tags;
- for (int i = 0; i < _numComponents; i++)
+ for (int i = 0; i < _numComponents; i++) {
if (_components[i]) {
_components[i]->init();
}
+ }
ts.expectString("section chores");
ts.scanString(" numchores %d", 1, &_numChores);
@@ -491,7 +492,7 @@ float Costume::getLookAtRate() const {
}
void Costume::setPosRotate(const Math::Vector3d &pos, const Math::Angle &pitch,
- const Math::Angle &yaw, const Math::Angle &roll) {
+ const Math::Angle &yaw, const Math::Angle &roll) {
_matrix.setPosition(pos);
_matrix.buildFromEuler(yaw, pitch, roll, Math::EO_ZXY);
}
diff --git a/engines/grim/costume.h b/engines/grim/costume.h
index 847b2dfd8d6..1420308a89e 100644
--- a/engines/grim/costume.h
+++ b/engines/grim/costume.h
@@ -85,7 +85,7 @@ public:
virtual void draw();
void getBoundingBox(int *x1, int *y1, int *x2, int *y2);
void setPosRotate(const Math::Vector3d &pos, const Math::Angle &pitch,
- const Math::Angle &yaw, const Math::Angle &roll);
+ const Math::Angle &yaw, const Math::Angle &roll);
Math::Matrix4 getMatrix() const;
Actor *getOwner() const { return _owner; }
diff --git a/engines/grim/costume/anim_component.cpp b/engines/grim/costume/anim_component.cpp
index 64b3504491d..f07f61aa649 100644
--- a/engines/grim/costume/anim_component.cpp
+++ b/engines/grim/costume/anim_component.cpp
@@ -23,12 +23,10 @@
#include "engines/grim/grim.h"
#include "engines/grim/debug.h"
#include "engines/grim/set.h"
-
#include "engines/grim/costume/anim_component.h"
namespace Grim {
-
AnimComponent::AnimComponent(Component *p, int parentID, const char *filename, tag32 t) :
Component(p, parentID, filename, t) {
_overlay = false;
@@ -46,7 +44,7 @@ void AnimComponent::setKey(int val) {
if (!state) {
Set *set = g_grim->getCurrSet();
state = set->addObjectState(set->getSetup(), (_overlay ? ObjectState::OBJSTATE_OVERLAY : ObjectState::OBJSTATE_UNDERLAY),
- _name.c_str(), nullptr, false);
+ _name.c_str(), nullptr, false);
}
_created = true;
diff --git a/engines/grim/costume/bitmap_component.cpp b/engines/grim/costume/bitmap_component.cpp
index 495b792c22d..a872a869c2d 100644
--- a/engines/grim/costume/bitmap_component.cpp
+++ b/engines/grim/costume/bitmap_component.cpp
@@ -23,15 +23,12 @@
#include "engines/grim/grim.h"
#include "engines/grim/debug.h"
#include "engines/grim/set.h"
-
#include "engines/grim/costume/bitmap_component.h"
namespace Grim {
-
BitmapComponent::BitmapComponent(Component *p, int parentID, const char *filename, tag32 t) :
Component(p, parentID, filename, t) {
-
}
void BitmapComponent::setKey(int val) {
diff --git a/engines/grim/costume/chore.cpp b/engines/grim/costume/chore.cpp
index 3478e6bb18b..ed95981df01 100644
--- a/engines/grim/costume/chore.cpp
+++ b/engines/grim/costume/chore.cpp
@@ -22,7 +22,6 @@
#include "engines/grim/costume.h"
#include "engines/grim/savegame.h"
#include "engines/grim/textsplit.h"
-
#include "engines/grim/costume/chore.h"
#include "engines/grim/costume/component.h"
#include "engines/grim/costume/keyframe_component.h"
@@ -33,7 +32,6 @@ namespace Grim {
Chore::Chore(char name[32], int id, Costume *owner, int length, int numTracks) :
_hasPlayed(false), _playing(false), _looping(false), _paused(false), _currTime(-1),
_numTracks(numTracks), _length(length), _choreId(id), _owner(owner) {
-
memcpy(_name, name, 32);
_tracks = new ChoreTrack[_numTracks];
}
diff --git a/engines/grim/costume/colormap_component.cpp b/engines/grim/costume/colormap_component.cpp
index a0705642f85..b1547399e92 100644
--- a/engines/grim/costume/colormap_component.cpp
+++ b/engines/grim/costume/colormap_component.cpp
@@ -22,7 +22,6 @@
#include "engines/grim/costume.h"
#include "engines/grim/resource.h"
#include "engines/grim/colormap.h"
-
#include "engines/grim/costume/colormap_component.h"
namespace Grim {
@@ -39,7 +38,7 @@ ColormapComponent::ColormapComponent(Component *p, int parentID, const char *fil
void ColormapComponent::init() {
if (!_parent)
warning("No parent to apply colormap object on. CMap: %s, Costume: %s",
- _cmap->getFilename().c_str(), _cost->getFilename().c_str());
+ _cmap->getFilename().c_str(), _cost->getFilename().c_str());
}
} // end of namespace Grim
diff --git a/engines/grim/costume/component.cpp b/engines/grim/costume/component.cpp
index b42d39318e3..6793433a146 100644
--- a/engines/grim/costume/component.cpp
+++ b/engines/grim/costume/component.cpp
@@ -28,7 +28,6 @@ namespace Grim {
Component::Component(Component *p, int parentID, const char *name, tag32 t) :
_visible(true), _tag(t), _parentID(parentID), _name(name),
_previousCmap(nullptr), _cmap(nullptr), _cost(nullptr) {
-
setParent(p);
}
diff --git a/engines/grim/costume/component.h b/engines/grim/costume/component.h
index 7a591f526f6..2a4cf038c32 100644
--- a/engines/grim/costume/component.h
+++ b/engines/grim/costume/component.h
@@ -23,6 +23,7 @@
#define GRIM_COMPONENT_H
#include "math/matrix4.h"
+
#include "engines/grim/object.h"
#include "engines/grim/animation.h"
diff --git a/engines/grim/costume/head.cpp b/engines/grim/costume/head.cpp
index 0cd31dcc7f8..f5b5fe836a8 100644
--- a/engines/grim/costume/head.cpp
+++ b/engines/grim/costume/head.cpp
@@ -35,7 +35,7 @@ void Head::Joint::init(ModelNode *node) {
}
void Head::Joint::orientTowards(bool entering, const Math::Vector3d &point, float rate, const Math::Matrix4 &matrix,
- float maxPitch, float maxYaw, float maxRoll, float constrain) {
+ float maxPitch, float maxYaw, float maxRoll, float constrain) {
float step = g_grim->getPerSecond(rate);
float yawStep = step;
float pitchStep = step / 3.0f;
@@ -82,7 +82,7 @@ void Head::Joint::orientTowards(bool entering, const Math::Vector3d &point, floa
// i.e. when you look straight up, your head up vector tilts/arches to point straight backwards.
else if (Math::Vector3d::dotProduct(targetDir, worldUp) <= -0.98f) // Avoid singularity if trying to look straight down.
lookAtTM.buildFromTargetDir(modelFront, targetDir, modelUp, frontDir); // Instead of orienting head towards scene down, orient head towards character "front",
- // i.e. when you look straight down, your head up vector tilts/arches to point straight forwards.
+ // i.e. when you look straight down, your head up vector tilts/arches to point straight forwards.
else
lookAtTM.buildFromTargetDir(modelFront, targetDir, modelUp, worldUp);
// The above specifies the world space orientation of this bone, but we need to output
diff --git a/engines/grim/costume/lua_var_component.cpp b/engines/grim/costume/lua_var_component.cpp
index 1d273ce3800..b6e51c40b0f 100644
--- a/engines/grim/costume/lua_var_component.cpp
+++ b/engines/grim/costume/lua_var_component.cpp
@@ -20,12 +20,10 @@
*/
#include "engines/grim/costume/lua_var_component.h"
-
#include "engines/grim/lua/lua.h"
namespace Grim {
-
LuaVarComponent::LuaVarComponent(Component *p, int parentID, const char *name, tag32 t) :
Component(p, parentID, name, t) {
}
diff --git a/engines/grim/costume/material_component.cpp b/engines/grim/costume/material_component.cpp
index 9a699e90f70..a90b1f4ee40 100644
--- a/engines/grim/costume/material_component.cpp
+++ b/engines/grim/costume/material_component.cpp
@@ -26,16 +26,13 @@
#include "engines/grim/model.h"
#include "engines/grim/material.h"
#include "engines/grim/savegame.h"
-
#include "engines/grim/costume/material_component.h"
#include "engines/grim/costume/model_component.h"
namespace Grim {
-
MaterialComponent::MaterialComponent(Component *p, int parentID, const char *filename, tag32 t) :
Component(p, parentID, filename, t) {
-
Debug::debug(Debug::Costumes, "Constructing MaterialComponent %s", filename);
}
diff --git a/engines/grim/costume/mesh_component.cpp b/engines/grim/costume/mesh_component.cpp
index 6acfd756b09..fa9b79c2d7f 100644
--- a/engines/grim/costume/mesh_component.cpp
+++ b/engines/grim/costume/mesh_component.cpp
@@ -67,7 +67,8 @@ void MeshComponent::reset() {
// closing the inventory causes the hat to appear, while it shouldn't.
// This could however introduce regressions somewhere else, so if there is something
// disappearing or not behaving properly in a costume the cause might be here.
-// _node->_meshVisible = true;
+
+ //_node->_meshVisible = true;
}
int MeshComponent::update(uint /*time*/) {
diff --git a/engines/grim/costume/model_component.cpp b/engines/grim/costume/model_component.cpp
index 4c7030a7386..93afe2214b4 100644
--- a/engines/grim/costume/model_component.cpp
+++ b/engines/grim/costume/model_component.cpp
@@ -27,7 +27,6 @@
#include "engines/grim/gfx_base.h"
#include "engines/grim/colormap.h"
#include "engines/grim/animation.h"
-
#include "engines/grim/costume/model_component.h"
#include "engines/grim/costume/main_model_component.h"
#include "engines/grim/costume/mesh_component.h"
diff --git a/engines/grim/costume/sound_component.cpp b/engines/grim/costume/sound_component.cpp
index 894737e176f..b0d684f5c2e 100644
--- a/engines/grim/costume/sound_component.cpp
+++ b/engines/grim/costume/sound_component.cpp
@@ -23,14 +23,11 @@
#include "engines/grim/set.h"
#include "engines/grim/debug.h"
#include "engines/grim/costume.h"
-
#include "engines/grim/costume/sound_component.h"
-
#include "engines/grim/imuse/imuse.h"
namespace Grim {
-
SoundComponent::SoundComponent(Component *p, int parentID, const char *filename, tag32 t) :
Component(p, parentID, filename, t) {
const char *comma = strchr(filename, ',');
diff --git a/engines/grim/costume/sprite_component.cpp b/engines/grim/costume/sprite_component.cpp
index 49f109b85ed..99f2a490bf3 100644
--- a/engines/grim/costume/sprite_component.cpp
+++ b/engines/grim/costume/sprite_component.cpp
@@ -33,7 +33,6 @@ namespace Grim {
SpriteComponent::SpriteComponent(Component *p, int parentID, const char *filename, tag32 t) :
Component(p, parentID, filename, t), _sprite(nullptr) {
-
}
SpriteComponent::~SpriteComponent() {
diff --git a/engines/grim/debugger.cpp b/engines/grim/debugger.cpp
index 0c575eca645..51200329b37 100644
--- a/engines/grim/debugger.cpp
+++ b/engines/grim/debugger.cpp
@@ -20,6 +20,7 @@
*/
#include "common/config-manager.h"
+
#include "graphics/renderer.h"
#include "engines/grim/debugger.h"
diff --git a/engines/grim/detection.cpp b/engines/grim/detection.cpp
index ccce89df252..8c2796e2659 100644
--- a/engines/grim/detection.cpp
+++ b/engines/grim/detection.cpp
@@ -19,10 +19,10 @@
*
*/
+#include "common/translation.h"
+
#include "engines/advancedDetector.h"
#include "engines/grim/detection.h"
-
-#include "common/translation.h"
#include "engines/grim/debug.h"
static const DebugChannelDef debugFlagList[] = {
diff --git a/engines/grim/emi/animationemi.cpp b/engines/grim/emi/animationemi.cpp
index 59ebe74de4e..a331a256689 100644
--- a/engines/grim/emi/animationemi.cpp
+++ b/engines/grim/emi/animationemi.cpp
@@ -20,11 +20,13 @@
*/
#include "common/stream.h"
+#include "common/textconsole.h"
+
#include "math/vector3d.h"
#include "math/quat.h"
+
#include "engines/grim/resource.h"
#include "engines/grim/emi/animationemi.h"
-#include "common/textconsole.h"
namespace Grim {
diff --git a/engines/grim/emi/animationemi.h b/engines/grim/emi/animationemi.h
index e31c862a1d2..ba26ce25220 100644
--- a/engines/grim/emi/animationemi.h
+++ b/engines/grim/emi/animationemi.h
@@ -23,8 +23,10 @@
#define GRIM_ANIMATIONEMI_H
#include "common/str.h"
+
#include "math/mathfwd.h"
#include "math/quat.h"
+
#include "engines/grim/animation.h"
#include "engines/grim/object.h"
#include "engines/grim/emi/skeleton.h"
diff --git a/engines/grim/emi/costume/emihead.h b/engines/grim/emi/costume/emihead.h
index ae8c08518ca..de881d88d9d 100644
--- a/engines/grim/emi/costume/emihead.h
+++ b/engines/grim/emi/costume/emihead.h
@@ -24,6 +24,7 @@
#include "math/vector3d.h"
#include "math/quat.h"
+
#include "engines/grim/costume/head.h"
namespace Grim {
diff --git a/engines/grim/emi/costume/emiluacode_component.cpp b/engines/grim/emi/costume/emiluacode_component.cpp
index f31770ab91d..b35ae9b3581 100644
--- a/engines/grim/emi/costume/emiluacode_component.cpp
+++ b/engines/grim/emi/costume/emiluacode_component.cpp
@@ -20,8 +20,8 @@
*/
#include "common/debug.h"
-#include "engines/grim/debug.h"
+#include "engines/grim/debug.h"
#include "engines/grim/emi/costume/emiluacode_component.h"
namespace Grim {
diff --git a/engines/grim/emi/costume/emiluavar_component.cpp b/engines/grim/emi/costume/emiluavar_component.cpp
index 17fe46555cf..2769a191c8e 100644
--- a/engines/grim/emi/costume/emiluavar_component.cpp
+++ b/engines/grim/emi/costume/emiluavar_component.cpp
@@ -21,8 +21,8 @@
#include "common/debug.h"
#include "common/textconsole.h"
-#include "engines/grim/debug.h"
+#include "engines/grim/debug.h"
#include "engines/grim/emi/costume/emiluavar_component.h"
namespace Grim {
diff --git a/engines/grim/emi/costume/emitexi_component.cpp b/engines/grim/emi/costume/emitexi_component.cpp
index 15743adfcdf..4e5df92bd85 100644
--- a/engines/grim/emi/costume/emitexi_component.cpp
+++ b/engines/grim/emi/costume/emitexi_component.cpp
@@ -23,7 +23,6 @@
#include "engines/grim/debug.h"
#include "engines/grim/material.h"
#include "engines/grim/savegame.h"
-
#include "engines/grim/emi/costumeemi.h"
#include "engines/grim/emi/modelemi.h"
#include "engines/grim/emi/costume/emimesh_component.h"
diff --git a/engines/grim/emi/emi.cpp b/engines/grim/emi/emi.cpp
index 9934873175e..95df8afbc66 100644
--- a/engines/grim/emi/emi.cpp
+++ b/engines/grim/emi/emi.cpp
@@ -37,13 +37,10 @@ EMIEngine *g_emi = nullptr;
EMIEngine::EMIEngine(OSystem *syst, uint32 gameFlags, GrimGameType gameType, Common::Platform platform, Common::Language language) :
GrimEngine(syst, gameFlags, gameType, platform, language), _sortOrderInvalidated(false), _textObjectsSortOrderInvalidated(true) {
-
g_emi = this;
g_emiregistry = new EmiRegistry();
}
-
-
EMIEngine::~EMIEngine() {
g_emi = nullptr;
delete g_emiregistry;
diff --git a/engines/grim/emi/emi_registry.cpp b/engines/grim/emi/emi_registry.cpp
index 2adc080dc59..3e18135bfb8 100644
--- a/engines/grim/emi/emi_registry.cpp
+++ b/engines/grim/emi/emi_registry.cpp
@@ -31,21 +31,21 @@ namespace Grim {
EmiRegistry *g_emiregistry = nullptr;
const char *EmiRegistry::_translTable[][2] = {
- {"speech_mode", ""}, //Translated key not needed, see below
- {"vocvolume", "speech_volume"},
- {"sfxvolume", "sfx_volume"},
- {"musvolume", "music_volume"},
- {"textspeed", "talkspeed"},
- {"gamma", "gamma"},
- {"joystick_enabled","joystick_enabled"},
- {"analog_mode", "analog_joystick_mode"},
- {"subtitles", "movie_subtitles"},
- {"camera_mode", "camera_relative_mode"},
- {"shadowfx", "shadow_effects"},
- {"vocfx", "audio_effects"},
- {"miscfx", "misc_video_effects"},
- {"moviequality", "movie_quality"},
- {"musicquality", "music_quality"},
+ {"speech_mode", ""}, // Translated key not needed, see below
+ {"vocvolume", "speech_volume"},
+ {"sfxvolume", "sfx_volume"},
+ {"musvolume", "music_volume"},
+ {"textspeed", "talkspeed"},
+ {"gamma", "gamma"},
+ {"joystick_enabled", "joystick_enabled"},
+ {"analog_mode", "analog_joystick_mode"},
+ {"subtitles", "movie_subtitles"},
+ {"camera_mode", "camera_relative_mode"},
+ {"shadowfx", "shadow_effects"},
+ {"vocfx", "audio_effects"},
+ {"miscfx", "misc_video_effects"},
+ {"moviequality", "movie_quality"},
+ {"musicquality", "music_quality"},
{nullptr,nullptr}
};
diff --git a/engines/grim/emi/layer.cpp b/engines/grim/emi/layer.cpp
index e914ee5fe37..1fe7243319e 100644
--- a/engines/grim/emi/layer.cpp
+++ b/engines/grim/emi/layer.cpp
@@ -22,7 +22,6 @@
#include "common/str.h"
#include "engines/grim/emi/layer.h"
-
#include "engines/grim/bitmap.h"
namespace Grim {
@@ -79,4 +78,5 @@ void Layer::restoreState(SaveGame *state) {
_frame = state->readLESint32();
_sortOrder = state->readLESint32();
}
+
}
diff --git a/engines/grim/emi/layer.h b/engines/grim/emi/layer.h
index 2a45ead9abd..9ab448adc3f 100644
--- a/engines/grim/emi/layer.h
+++ b/engines/grim/emi/layer.h
@@ -26,7 +26,6 @@
#include "engines/grim/pool.h"
-
namespace Grim {
class Bitmap;
diff --git a/engines/grim/emi/lua_v2.cpp b/engines/grim/emi/lua_v2.cpp
index 97ce8f14122..97f94b28ebd 100644
--- a/engines/grim/emi/lua_v2.cpp
+++ b/engines/grim/emi/lua_v2.cpp
@@ -112,7 +112,7 @@ void Lua_V2::MakeScreenTextures() {
lua_Object indexObj = lua_getparam(1);
if (!lua_isnil(indexObj) && lua_isnumber(indexObj)) {
- /*int index = (int)lua_getnumber(indexObj);*/
+ //int index = (int)lua_getnumber(indexObj);
// The index does not seem to matter
g_driver->makeScreenTextures();
@@ -123,8 +123,8 @@ void Lua_V2::MakeScreenTextures() {
}
void Lua_V2::ClearSpecialtyTexture() {
- //This seems to be used in the save/load menu
- //Not sure why the specialty textures need to be cleared.
+ // This seems to be used in the save/load menu
+ // Not sure why the specialty textures need to be cleared.
warning("Lua_V2::ClearSpecialtyTexture: stub");
}
@@ -622,7 +622,7 @@ void Lua_V2::NewLayer() {
til = lua_getstring(param1);
sortorder = (int)lua_getnumber(param2);
- //This one is always specified, but also always 0...
+ // This one is always specified, but also always 0...
//zero = (int)lua_getnumber(param3);
Layer *layer = new Layer(til, sortorder);
diff --git a/engines/grim/emi/lua_v2.h b/engines/grim/emi/lua_v2.h
index bd206bf4cd3..46e2d829b4a 100644
--- a/engines/grim/emi/lua_v2.h
+++ b/engines/grim/emi/lua_v2.h
@@ -180,11 +180,11 @@ protected:
DECLARE_LUA_OPCODE(LocalizeString) override;
DECLARE_LUA_OPCODE(WorldToScreen) override;
DECLARE_LUA_OPCODE(RenderModeUser) override;
- //PS2:
+ // PS2:
DECLARE_LUA_OPCODE(GetMemoryCardId);
DECLARE_LUA_OPCODE(OverWorldToScreen);
DECLARE_LUA_OPCODE(SetReplayMode);
- //ResidualVM-hacks:
+ // ResidualVM-hacks:
DECLARE_LUA_OPCODE(GetResidualVMPreference);
DECLARE_LUA_OPCODE(SetResidualVMPreference);
};
diff --git a/engines/grim/emi/lua_v2_actor.cpp b/engines/grim/emi/lua_v2_actor.cpp
index b5cb3c77906..38a1082c78d 100644
--- a/engines/grim/emi/lua_v2_actor.cpp
+++ b/engines/grim/emi/lua_v2_actor.cpp
@@ -23,19 +23,16 @@
#include "engines/grim/emi/lua_v2.h"
#include "engines/grim/lua/lua.h"
-
#include "engines/grim/actor.h"
#include "engines/grim/debug.h"
#include "engines/grim/grim.h"
#include "engines/grim/costume.h"
#include "engines/grim/set.h"
-
#include "engines/grim/emi/emi.h"
#include "engines/grim/emi/costumeemi.h"
#include "engines/grim/emi/skeleton.h"
#include "engines/grim/emi/costume/emichore.h"
#include "engines/grim/emi/costume/emiskel_component.h"
-
#include "engines/grim/lua/lauxlib.h"
namespace Grim {
@@ -44,7 +41,7 @@ void Lua_V2::SetActorLocalAlpha() {
lua_Object actorObj = lua_getparam(1);
lua_Object vertexObj= lua_getparam(2);
lua_Object alphaObj = lua_getparam(3);
- // lua_Object unknownObj = lua_getparam(4);
+ //lua_Object unknownObj = lua_getparam(4);
if (!lua_isuserdata(actorObj) || lua_tag(actorObj) != MKTAG('A','C','T','R'))
return;
@@ -71,7 +68,6 @@ void Lua_V2::SetActorLocalAlpha() {
}
}
-
void Lua_V2::SetActorGlobalAlpha() {
lua_Object actorObj = lua_getparam(1);
lua_Object alphaObj = lua_getparam(2);
@@ -92,10 +88,8 @@ void Lua_V2::SetActorGlobalAlpha() {
mesh = lua_getstring(meshObj);
}
float alpha = lua_getnumber(alphaObj);
- if (alpha == Actor::AlphaOff ||
- alpha == Actor::AlphaReplace ||
- alpha == Actor::AlphaModulate) {
- actor->setAlphaMode((Actor::AlphaMode) (int) alpha, mesh);
+ if (alpha == Actor::AlphaOff || alpha == Actor::AlphaReplace || alpha == Actor::AlphaModulate) {
+ actor->setAlphaMode((Actor::AlphaMode) (int) alpha, mesh);
} else {
actor->setGlobalAlpha(alpha, mesh);
}
@@ -646,8 +640,6 @@ void Lua_V2::SetActorTurnChores() {
actor->setTurnChores(leftChore, rightChore, costume);
}
-
-
void Lua_V2::SetActorTalkChore() {
lua_Object actorObj = lua_getparam(1);
lua_Object indexObj = lua_getparam(2);
@@ -1033,15 +1025,15 @@ void Lua_V2::WalkActorToAvoiding() {
void Lua_V2::WalkActorVector() {
lua_Object actorObj = lua_getparam(1);
- // lua_Object xObj = lua_getparam(3);
- // lua_Object yObj = lua_getparam(4);
- // lua_Object zObj = lua_getparam(5);
- // lua_Object param6Obj = lua_getparam(6);
+ //lua_Object xObj = lua_getparam(3);
+ //lua_Object yObj = lua_getparam(4);
+ //lua_Object zObj = lua_getparam(5);
+ //lua_Object param6Obj = lua_getparam(6);
if (!lua_isuserdata(actorObj) || lua_tag(actorObj) != MKTAG('A', 'C', 'T', 'R'))
return;
- // Actor *actor = static_cast<Actor *>(lua_getuserdata(actorObj));
+ //Actor *actor = static_cast<Actor *>(lua_getuserdata(actorObj));
Actor *actor2 = getactor(actorObj);
// TODO whole below part need rewrote to much original
diff --git a/engines/grim/emi/lua_v2_sound.cpp b/engines/grim/emi/lua_v2_sound.cpp
index f0f835067e6..e1cf8afa628 100644
--- a/engines/grim/emi/lua_v2_sound.cpp
+++ b/engines/grim/emi/lua_v2_sound.cpp
@@ -21,14 +21,14 @@
#include "audio/mixer.h"
#include "audio/audiostream.h"
+
#include "common/system.h"
-#include "engines/grim/set.h"
+#include "engines/grim/set.h"
#include "engines/grim/emi/sound/emisound.h"
#include "engines/grim/emi/lua_v2.h"
#include "engines/grim/emi/poolsound.h"
#include "engines/grim/lua/lua.h"
-
#include "engines/grim/debug.h"
#include "engines/grim/sound.h"
#include "engines/grim/grim.h"
@@ -245,7 +245,6 @@ static Common::String addSoundSuffix(const char *fname) {
return filename;
}
-
void Lua_V2::LoadSound() {
lua_Object strObj = lua_getparam(1);
@@ -272,7 +271,7 @@ void Lua_V2::PlayLoadedSound() {
lua_Object idObj = lua_getparam(1);
lua_Object loopingObj = lua_getparam(2);
lua_Object volumeObj = lua_getparam(3);
- /* FIXME: unknown parameter */
+ // FIXME: unknown parameter
/*lua_Object bool2Obj =*/ lua_getparam(4);
if (!lua_isuserdata(idObj) || lua_tag(idObj) != MKTAG('A', 'I', 'F', 'F')) {
@@ -332,7 +331,7 @@ void Lua_V2::PlayLoadedSoundFrom() {
if (lua_isnumber(volumeOrLoopingObj)) {
volume = (int)lua_getnumber(volumeOrLoopingObj);
- /* special handling if 5th parameter is a boolean */
+ // special handling if 5th parameter is a boolean
if (volume <= 1) {
looping = volume;
volume = (int)lua_getnumber(volumeObj);
@@ -419,7 +418,7 @@ void Lua_V2::PlaySoundFrom() {
lua_Object xObj = lua_getparam(2);
lua_Object yObj = lua_getparam(3);
lua_Object zObj = lua_getparam(4);
- /* FIXME: unknown parameter */
+ // FIXME: unknown parameter
lua_Object volumeOrUnknownObj = lua_getparam(5);
lua_Object volumeObj = lua_getparam(6);
diff --git a/engines/grim/emi/modelemi.cpp b/engines/grim/emi/modelemi.cpp
index 5603f9b4e43..a0764ddc9d1 100644
--- a/engines/grim/emi/modelemi.cpp
+++ b/engines/grim/emi/modelemi.cpp
@@ -21,6 +21,7 @@
#include "common/endian.h"
#include "common/foreach.h"
+
#include "engines/grim/debug.h"
#include "engines/grim/grim.h"
#include "engines/grim/material.h"
@@ -132,9 +133,9 @@ void EMIModel::loadMesh(Common::SeekableReadStream *data) {
int type = data->readUint32LE();
// Check that it is one of the known types
- //3 is no texture vertecies
- //18 is no normals
- //19 is regular
+ // 3 is no texture vertecies
+ // 18 is no normals
+ // 19 is regular
assert(type == 19 || type == 18 || type == 3);
_numVertices = data->readUint32LE();
diff --git a/engines/grim/emi/modelemi.h b/engines/grim/emi/modelemi.h
index 346b843f6c5..3c76581e34e 100644
--- a/engines/grim/emi/modelemi.h
+++ b/engines/grim/emi/modelemi.h
@@ -24,6 +24,7 @@
#include "engines/grim/object.h"
#include "engines/grim/actor.h"
+
#include "math/matrix4.h"
#include "math/vector2d.h"
#include "math/vector3d.h"
diff --git a/engines/grim/emi/poolsound.cpp b/engines/grim/emi/poolsound.cpp
index a5d9fd0ee70..6b4ceb92b72 100644
--- a/engines/grim/emi/poolsound.cpp
+++ b/engines/grim/emi/poolsound.cpp
@@ -20,11 +20,11 @@
*/
#include "common/str.h"
+
#include "engines/grim/emi/sound/emisound.h"
#include "engines/grim/emi/poolsound.h"
#include "engines/grim/resource.h"
-
namespace Grim {
PoolSound::PoolSound() : _filename(""), _loaded(false), _soundId(0) {
@@ -114,4 +114,5 @@ void PoolSound::restoreState(SaveGame *state) {
openFile(state->readString());
}
}
+
}
diff --git a/engines/grim/emi/poolsound.h b/engines/grim/emi/poolsound.h
index ca3f18b2f83..77233a4812d 100644
--- a/engines/grim/emi/poolsound.h
+++ b/engines/grim/emi/poolsound.h
@@ -23,7 +23,9 @@
#define GRIM_POOLSOUND_H
#include "common/endian.h"
+
#include "engines/grim/pool.h"
+
#include "math/vector3d.h"
namespace Grim {
diff --git a/engines/grim/emi/skeleton.cpp b/engines/grim/emi/skeleton.cpp
index beae15f2593..c6882a4b47e 100644
--- a/engines/grim/emi/skeleton.cpp
+++ b/engines/grim/emi/skeleton.cpp
@@ -20,9 +20,11 @@
*/
#include "common/stream.h"
+
#include "math/vector3d.h"
#include "math/vector4d.h"
#include "math/quat.h"
+
#include "engines/grim/debug.h"
#include "engines/grim/emi/animationemi.h"
#include "engines/grim/emi/skeleton.h"
@@ -223,5 +225,4 @@ AnimationLayer* Skeleton::getLayer(int priority) const {
return &_animLayers[priority];
}
-
} // end of namespace Grim
diff --git a/engines/grim/emi/skeleton.h b/engines/grim/emi/skeleton.h
index 39bea59b178..00cd22ac6f6 100644
--- a/engines/grim/emi/skeleton.h
+++ b/engines/grim/emi/skeleton.h
@@ -24,8 +24,10 @@
#include "common/hashmap.h"
#include "common/hash-str.h"
+
#include "math/mathfwd.h"
#include "math/quat.h"
+
#include "engines/grim/object.h"
#include "engines/grim/actor.h"
diff --git a/engines/grim/emi/sound/aifftrack.cpp b/engines/grim/emi/sound/aifftrack.cpp
index 7479bf90794..d69b28c73cf 100644
--- a/engines/grim/emi/sound/aifftrack.cpp
+++ b/engines/grim/emi/sound/aifftrack.cpp
@@ -20,9 +20,11 @@
*/
#include "common/mutex.h"
+
#include "audio/mixer.h"
#include "audio/audiostream.h"
#include "audio/decoders/aiff.h"
+
#include "engines/grim/debug.h"
#include "engines/grim/resource.h"
#include "engines/grim/emi/sound/aifftrack.h"
diff --git a/engines/grim/emi/sound/aifftrack.h b/engines/grim/emi/sound/aifftrack.h
index be6275544d6..48203cd181a 100644
--- a/engines/grim/emi/sound/aifftrack.h
+++ b/engines/grim/emi/sound/aifftrack.h
@@ -24,6 +24,7 @@
#include "common/str.h"
#include "common/stream.h"
+
#include "engines/grim/emi/sound/track.h"
namespace Audio {
diff --git a/engines/grim/emi/sound/codecs/scx.cpp b/engines/grim/emi/sound/codecs/scx.cpp
index b5ae82dd746..3daa8986d89 100644
--- a/engines/grim/emi/sound/codecs/scx.cpp
+++ b/engines/grim/emi/sound/codecs/scx.cpp
@@ -21,9 +21,11 @@
#include "audio/audiostream.h"
#include "audio/decoders/xa.h"
+
#include "common/memstream.h"
#include "common/textconsole.h"
#include "common/stream.h"
+
#include "engines/grim/emi/sound/codecs/scx.h"
namespace Grim {
diff --git a/engines/grim/emi/sound/emisound.cpp b/engines/grim/emi/sound/emisound.cpp
index 5f0267d3237..3fabcda2424 100644
--- a/engines/grim/emi/sound/emisound.cpp
+++ b/engines/grim/emi/sound/emisound.cpp
@@ -25,9 +25,11 @@
#include "common/mutex.h"
#include "common/timer.h"
#include "common/translation.h"
+
#include "audio/audiostream.h"
#include "audio/decoders/raw.h"
#include "audio/mixer.h"
+
#include "engines/grim/debug.h"
#include "engines/grim/sound.h"
#include "engines/grim/grim.h"
@@ -693,7 +695,7 @@ void EMISound::initMusicTable() {
initMusicTableRetail(musicTable, "Textures/FullMonkeyMap2.imt");
initMusicTableRetail(musicTable, "Textures/FullMonkeyMap.imt");
- /* There seem to be 69+60 music tracks, for a total of 125 unique tracks. */
+ // There seem to be 69+60 music tracks, for a total of 125 unique tracks.
int numTracks = 0;
for (int i = 0; i < 126; i++) {
if (!musicTable[i]._filename.empty()) {
diff --git a/engines/grim/emi/sound/emisound.h b/engines/grim/emi/sound/emisound.h
index 308fb40260f..b6c70cfad54 100644
--- a/engines/grim/emi/sound/emisound.h
+++ b/engines/grim/emi/sound/emisound.h
@@ -23,10 +23,12 @@
#define GRIM_MSS_H
#include "audio/mixer.h"
+
#include "common/str.h"
#include "common/stack.h"
#include "common/mutex.h"
#include "common/hashmap.h"
+
#include "math/vector3d.h"
namespace Grim {
diff --git a/engines/grim/emi/sound/mp3track.cpp b/engines/grim/emi/sound/mp3track.cpp
index f4f07b71e3f..e8bc6bfad64 100644
--- a/engines/grim/emi/sound/mp3track.cpp
+++ b/engines/grim/emi/sound/mp3track.cpp
@@ -21,8 +21,10 @@
#include "common/mutex.h"
#include "audio/mixer.h"
+
#include "audio/audiostream.h"
#include "audio/decoders/mp3.h"
+
#include "engines/grim/debug.h"
#include "engines/grim/resource.h"
#include "engines/grim/textsplit.h"
diff --git a/engines/grim/emi/sound/mp3track.h b/engines/grim/emi/sound/mp3track.h
index 9aabe20e80f..f8e5ec6e0ae 100644
--- a/engines/grim/emi/sound/mp3track.h
+++ b/engines/grim/emi/sound/mp3track.h
@@ -24,7 +24,9 @@
#include "common/str.h"
#include "common/stream.h"
+
#include "audio/timestamp.h"
+
#include "engines/grim/emi/sound/track.h"
namespace Audio {
diff --git a/engines/grim/emi/sound/scxtrack.cpp b/engines/grim/emi/sound/scxtrack.cpp
index 1553f0c2bc7..227b4e8bc0e 100644
--- a/engines/grim/emi/sound/scxtrack.cpp
+++ b/engines/grim/emi/sound/scxtrack.cpp
@@ -21,8 +21,10 @@
#include "common/mutex.h"
#include "common/textconsole.h"
+
#include "audio/mixer.h"
#include "audio/audiostream.h"
+
#include "engines/grim/debug.h"
#include "engines/grim/resource.h"
#include "engines/grim/emi/sound/codecs/scx.h"
diff --git a/engines/grim/emi/sound/scxtrack.h b/engines/grim/emi/sound/scxtrack.h
index 0660b997ba9..392e299d87a 100644
--- a/engines/grim/emi/sound/scxtrack.h
+++ b/engines/grim/emi/sound/scxtrack.h
@@ -24,6 +24,7 @@
#include "common/str.h"
#include "common/stream.h"
+
#include "engines/grim/emi/sound/track.h"
namespace Audio {
diff --git a/engines/grim/emi/sound/track.cpp b/engines/grim/emi/sound/track.cpp
index 3db42360591..7a0805a913b 100644
--- a/engines/grim/emi/sound/track.cpp
+++ b/engines/grim/emi/sound/track.cpp
@@ -22,11 +22,13 @@
#include "common/mutex.h"
#include "common/str.h"
#include "common/stream.h"
+#include "common/textconsole.h"
+
#include "audio/mixer.h"
#include "audio/audiostream.h"
+
#include "engines/grim/savegame.h"
#include "engines/grim/emi/sound/track.h"
-#include "common/textconsole.h"
#include "engines/grim/grim.h"
#include "engines/grim/set.h"
diff --git a/engines/grim/emi/sound/track.h b/engines/grim/emi/sound/track.h
index 182c81aedeb..6721293f505 100644
--- a/engines/grim/emi/sound/track.h
+++ b/engines/grim/emi/sound/track.h
@@ -24,6 +24,7 @@
#include "audio/mixer.h"
#include "audio/timestamp.h"
+
#include "math/vector3d.h"
namespace Common {
diff --git a/engines/grim/emi/sound/vimatrack.cpp b/engines/grim/emi/sound/vimatrack.cpp
index b36b14406ed..33182d7daa9 100644
--- a/engines/grim/emi/sound/vimatrack.cpp
+++ b/engines/grim/emi/sound/vimatrack.cpp
@@ -22,9 +22,11 @@
#include "common/stream.h"
#include "common/mutex.h"
#include "common/textconsole.h"
+
#include "audio/audiostream.h"
#include "audio/mixer.h"
#include "audio/decoders/raw.h"
+
#include "engines/grim/debug.h"
#include "engines/grim/resource.h"
#include "engines/grim/imuse/imuse_mcmp_mgr.h"
diff --git a/engines/grim/emi/sound/vimatrack.h b/engines/grim/emi/sound/vimatrack.h
index ff3d3c737dc..37c85cc1ce9 100644
--- a/engines/grim/emi/sound/vimatrack.h
+++ b/engines/grim/emi/sound/vimatrack.h
@@ -23,6 +23,7 @@
#define GRIM_VIMATRACK_H
#include "common/str.h"
+
#include "engines/grim/emi/sound/track.h"
namespace Grim {
diff --git a/engines/grim/font.cpp b/engines/grim/font.cpp
index aa416792f42..7e14351bd15 100644
--- a/engines/grim/font.cpp
+++ b/engines/grim/font.cpp
@@ -38,7 +38,6 @@ Font::Font() :
_fontData(nullptr), _charHeaders(nullptr), _charIndex(nullptr),
_numChars(0), _dataSize(0), _kernedHeight(0), _baseOffsetY(0),
_firstChar(0), _lastChar(0) {
-
}
Font::~Font() {
diff --git a/engines/grim/gfx_base.cpp b/engines/grim/gfx_base.cpp
index ffc7e416587..27454463c2c 100644
--- a/engines/grim/gfx_base.cpp
+++ b/engines/grim/gfx_base.cpp
@@ -51,9 +51,9 @@ GfxBase::GfxBase() :
_screenWidth(0), _screenHeight(0),
_scaleW(1.0f), _scaleH(1.0f), _currentShadowArray(nullptr),
_shadowColorR(255), _shadowColorG(255), _shadowColorB(255) {
- for (unsigned int i = 0; i < _numSpecialtyTextures; i++) {
- _specialtyTextures[i]._isShared = true;
- }
+ for (unsigned int i = 0; i < _numSpecialtyTextures; i++) {
+ _specialtyTextures[i]._isShared = true;
+ }
}
void GfxBase::setShadowMode() {
@@ -213,7 +213,7 @@ Bitmap *GfxBase::createScreenshotBitmap(Graphics::Surface *src, int w, int h, bo
}
void GfxBase::makeScreenTextures() {
- //make a buffer big enough to hold any of the textures
+ // Make a buffer big enough to hold any of the textures
uint8 *buffer = new uint8[256 * 256 * 4];
// TODO: Handle screen resolutions other than 640 x 480
diff --git a/engines/grim/gfx_opengl.cpp b/engines/grim/gfx_opengl.cpp
index 5b65ff42cbc..d17c7fce5d1 100644
--- a/engines/grim/gfx_opengl.cpp
+++ b/engines/grim/gfx_opengl.cpp
@@ -44,7 +44,6 @@
#include "engines/grim/remastered/overlay.h"
#include "engines/grim/registry.h"
-
namespace Grim {
GfxBase *CreateGfxOpenGL() {
@@ -1052,7 +1051,7 @@ void GfxOpenGL::createBitmap(BitmapData *bitmap) {
if (bitmap->_format == 1 || _useDepthShader) {
bitmap->_hasTransparency = false;
bitmap->_numTex = ((bitmap->_width + (BITMAP_TEXTURE_SIZE - 1)) / BITMAP_TEXTURE_SIZE) *
- ((bitmap->_height + (BITMAP_TEXTURE_SIZE - 1)) / BITMAP_TEXTURE_SIZE);
+ ((bitmap->_height + (BITMAP_TEXTURE_SIZE - 1)) / BITMAP_TEXTURE_SIZE);
bitmap->_texIds = new GLuint[bitmap->_numTex * bitmap->_numImages];
textures = (GLuint *)bitmap->_texIds;
glGenTextures(bitmap->_numTex * bitmap->_numImages, textures);
@@ -1119,7 +1118,7 @@ void GfxOpenGL::createBitmap(BitmapData *bitmap) {
int height = (y + BITMAP_TEXTURE_SIZE >= bitmap->_height) ? (bitmap->_height - y) : BITMAP_TEXTURE_SIZE;
glBindTexture(GL_TEXTURE_2D, textures[cur_tex_idx]);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height, format, type,
- texOut + (y * bytes * bitmap->_width) + (bytes * x));
+ texOut + (y * bytes * bitmap->_width) + (bytes * x));
cur_tex_idx++;
}
}
@@ -1491,8 +1490,6 @@ void GfxOpenGL::drawTextObject(const TextObject *text) {
glTexCoord2f(0.0f, 1.0f);
glVertex2f(x, (y + height));
glEnd();
-
-
}
glColor3f(1, 1, 1);
@@ -1590,7 +1587,7 @@ void GfxOpenGL::createTexture(Texture *texture, const uint8 *data, const CMap *c
GLuint *textures = (GLuint *)texture->_texture;
glBindTexture(GL_TEXTURE_2D, textures[0]);
- //Remove darkened lines in EMI intro
+ // Remove darkened lines in EMI intro
if (g_grim->getGameType() == GType_MONKEY4 && clamp) {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
@@ -2019,7 +2016,7 @@ void GfxOpenGL::irisAroundRegion(int x1, int y1, int x2, int y2) {
glColor3f(0.0f, 0.0f, 0.0f);
- //Explicitly cast to avoid problems with C++11
+ // Explicitly cast to avoid problems with C++11
float fx1 = x1;
float fx2 = x2;
float fy1 = y1;
@@ -2129,7 +2126,8 @@ void GfxOpenGL::drawLine(const PrimitiveObject *primitive) {
}
void GfxOpenGL::drawDimPlane() {
- if (_dimLevel == 0.0f) return;
+ if (_dimLevel == 0.0f)
+ return;
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
diff --git a/engines/grim/gfx_opengl_shaders.cpp b/engines/grim/gfx_opengl_shaders.cpp
index 898a2c7438d..ae223b46489 100644
--- a/engines/grim/gfx_opengl_shaders.cpp
+++ b/engines/grim/gfx_opengl_shaders.cpp
@@ -718,7 +718,6 @@ void GfxOpenGLS::getActorScreenBBox(const Actor *actor, Common::Point &p1, Commo
p2.y = 480 - tmp;
}
-
void GfxOpenGLS::startActorDraw(const Actor *actor) {
_currentActor = actor;
glEnable(GL_DEPTH_TEST);
@@ -900,7 +899,6 @@ void GfxOpenGLS::startActorDraw(const Actor *actor) {
}
}
-
void GfxOpenGLS::finishActorDraw() {
_currentActor = nullptr;
glDisable(GL_POLYGON_OFFSET_FILL);
@@ -1016,7 +1014,6 @@ void GfxOpenGLS::destroyShadow(Shadow *shadow) {
}
void GfxOpenGLS::set3DMode() {
-
}
void GfxOpenGLS::translateViewpointStart() {
@@ -1053,8 +1050,7 @@ void GfxOpenGLS::updateEMIModel(const EMIModel* model) {
}
void GfxOpenGLS::drawEMIModelFace(const EMIModel* model, const EMIMeshFace* face) {
- if (face->_flags & EMIMeshFace::kAlphaBlend ||
- face->_flags & EMIMeshFace::kUnknownBlend)
+ if (face->_flags & EMIMeshFace::kAlphaBlend || face->_flags & EMIMeshFace::kUnknownBlend)
glEnable(GL_BLEND);
const EMIModelUserData *mud = (const EMIModelUserData *)model->_userData;
OpenGL::ShaderGL *actorShader;
@@ -1130,7 +1126,6 @@ void GfxOpenGLS::drawDimPlane() {
}
void GfxOpenGLS::drawModelFace(const Mesh *mesh, const MeshFace *face) {
-
}
void GfxOpenGLS::drawSprite(const Sprite *sprite) {
@@ -1487,10 +1482,7 @@ void GfxOpenGLS::drawDepthBitmap(int bitmapId, int x, int y, int w, int h, char
// Sometimes the data pointer is reused by the allocator between bitmaps
// Use the bitmap ID to ensure we don't prevent an expected update
- if (bitmapId == prevId &&
- prevX == x && prevY == y &&
- prevW == w && prevH == h &&
- data == prevData) {
+ if (bitmapId == prevId && prevX == x && prevY == y && prevW == w && prevH == h && data == prevData) {
return;
}
@@ -1657,10 +1649,10 @@ void GfxOpenGLS::createTextObject(TextObject *text) {
float cy = ((character - 1) / 16) / 16.0f;
float charData[] = {
- z, w, cx, cy,
- z + sizeW, w, cx + width, cy,
- z + sizeW, w + sizeH, cx + width, cy + width,
- z, w + sizeH, cx, cy + width
+ z, w, cx, cy,
+ z + sizeW, w, cx + width, cy,
+ z + sizeW, w + sizeH, cx + width, cy + width,
+ z, w + sizeH, cx, cy + width
};
memcpy(cur, charData, 16 * sizeof(float));
cur += 16;
@@ -1749,7 +1741,6 @@ void GfxOpenGLS::copyStoredToDisplay() {
}
void GfxOpenGLS::dimScreen() {
-
}
void GfxOpenGLS::dimRegion(int xin, int yReal, int w, int h, float level) {
@@ -1801,7 +1792,6 @@ void GfxOpenGLS::dimRegion(int xin, int yReal, int w, int h, float level) {
glDeleteTextures(1, &texture);
}
-
void GfxOpenGLS::irisAroundRegion(int x1, int y1, int x2, int y2) {
_irisProgram->use();
_irisProgram->setUniform("color", Math::Vector3d(0.0f, 0.0f, 0.0f));
@@ -1838,7 +1828,6 @@ void GfxOpenGLS::irisAroundRegion(int x1, int y1, int x2, int y2) {
glDepthMask(GL_TRUE);
}
-
void GfxOpenGLS::drawEmergString(int x, int y, const char *text, const Color &fgColor) {
if (!*text)
return;
@@ -1950,7 +1939,6 @@ void GfxOpenGLS::drawRectangle(const PrimitiveObject *primitive) {
drawGenericPrimitive(bottom, 8, primitive);
drawGenericPrimitive(left, 8, primitive);
}
-
}
void GfxOpenGLS::drawLine(const PrimitiveObject *primitive) {
@@ -2003,7 +1991,6 @@ void GfxOpenGLS::prepareMovieFrame(Graphics::Surface* frame) {
#else
_smushSwap = false;
#endif
-
} else if (frame->format == Graphics::PixelFormat(4, 8, 8, 8, 0, 16, 8, 0, 0) || frame->format == Graphics::PixelFormat(4, 8, 8, 8, 8, 16, 8, 0, 24)) {
// frame->format: ARGB
// read in little endian: {B, G, R, A}, swizzle: {R, G, B, A}
@@ -2071,7 +2058,6 @@ void GfxOpenGLS::drawMovieFrame(int offsetX, int offsetY) {
glEnable(GL_DEPTH_TEST);
}
-
void GfxOpenGLS::releaseMovieFrame() {
if (_smushTexId > 0) {
glDeleteTextures(1, &_smushTexId);
@@ -2085,14 +2071,11 @@ const char *GfxOpenGLS::getVideoDeviceName() {
}
void GfxOpenGLS::renderBitmaps(bool render) {
-
}
void GfxOpenGLS::renderZBitmaps(bool render) {
-
}
-
void GfxOpenGLS::createEMIModel(EMIModel *model) {
EMIModelUserData *mud = new EMIModelUserData;
model->_userData = mud;
diff --git a/engines/grim/gfx_opengl_shaders.h b/engines/grim/gfx_opengl_shaders.h
index 78cd862b8dd..b60f2ab4d01 100644
--- a/engines/grim/gfx_opengl_shaders.h
+++ b/engines/grim/gfx_opengl_shaders.h
@@ -24,7 +24,9 @@
#include "engines/grim/actor.h"
#include "engines/grim/gfx_base.h"
+
#include "graphics/opengl/shader.h"
+
#include "common/stack.h"
#include "common/rect.h"
@@ -38,8 +40,8 @@ public:
/**
* Creates a render-context.
*
- * @param screenW the width of the context
- * @param screenH the height of the context
+ * @param screenW the width of the context
+ * @param screenH the height of the context
*/
void setupScreen(int screenW, int screenH) override;
@@ -61,7 +63,7 @@ public:
void clearDepthBuffer() override;
/**
- * Swap the buffers, making the drawn screen visible
+ * Swap the buffers, making the drawn screen visible
*/
void flipBuffer() override;
@@ -112,7 +114,7 @@ public:
*
* the external bitmap might have its data changed by this function,
*
- * @param bitmap the bitmap to be prepared
+ * @param bitmap the bitmap to be prepared
* @see destroyBitmap
* @see drawBitmap
*/
@@ -122,7 +124,7 @@ public:
* Draws a bitmap
* before this is safe to use, createBitmap MUST have been called
*
- * @param bitmap the bitmap to be drawn
+ * @param bitmap the bitmap to be drawn
* @see createBitmap
* @see destroyBitmap
*/
@@ -133,7 +135,7 @@ public:
* after this is called, it is safe to dispose of or change the external
* bitmapdata.
*
- * @param bitmap the bitmap to be destroyed
+ * @param bitmap the bitmap to be destroyed
* @see createBitmap
* @see drawBitmap
*/
@@ -179,9 +181,9 @@ public:
* Prepare a movie-frame for drawing
* performing any necessary conversion
*
- * @param width the width of the movie-frame.
- * @param height the height of the movie-frame.
- * @param bitmap a pointer to the data for the movie-frame.
+ * @param width the width of the movie-frame.
+ * @param height the height of the movie-frame.
+ * @param bitmap a pointer to the data for the movie-frame.
* @see drawMovieFrame
* @see releaseMovieFrame
*/
@@ -287,5 +289,7 @@ private:
GLuint _blastVBO;
GLuint _storedDisplay;
};
+
}
+
#endif
diff --git a/engines/grim/gfx_tinygl.cpp b/engines/grim/gfx_tinygl.cpp
index d4aae2e20a6..cc6b5641f7f 100644
--- a/engines/grim/gfx_tinygl.cpp
+++ b/engines/grim/gfx_tinygl.cpp
@@ -471,7 +471,7 @@ void GfxTinyGL::startActorDraw(const Actor *actor) {
tglEnable(TGL_POLYGON_OFFSET_FILL);
tglDisable(TGL_LIGHTING);
tglDisable(TGL_TEXTURE_2D);
- // tglColor3f(0.0f, 1.0f, 0.0f); // debug draw color
+ //tglColor3f(0.0f, 1.0f, 0.0f); // debug draw color
if (g_grim->getGameType() == GType_GRIM) {
tglColor3ub(_shadowColorR, _shadowColorG, _shadowColorB);
} else {
@@ -1323,7 +1323,7 @@ void GfxTinyGL::irisAroundRegion(int x1, int y1, int x2, int y2) {
tglColor3f(0.0f, 0.0f, 0.0f);
- //Explicitly cast to avoid problems with C++11
+ // Explicitly cast to avoid problems with C++11
float fx1 = x1;
float fx2 = x2;
float fy1 = y1;
@@ -1381,7 +1381,7 @@ void GfxTinyGL::drawRectangle(const PrimitiveObject *primitive) {
tglVertex2f(x1, y2 + 1);
tglEnd();
} else {
- // tglLineWidth(_scaleW); // Not implemented in TinyGL
+ //tglLineWidth(_scaleW); // Not implemented in TinyGL
tglBegin(TGL_LINE_LOOP);
tglVertex2f(x1, y1);
tglVertex2f(x2 + 1, y1);
@@ -1417,7 +1417,7 @@ void GfxTinyGL::drawLine(const PrimitiveObject *primitive) {
tglColor3ub(color.getRed(), color.getGreen(), color.getBlue());
-// tglLineWidth(_scaleW); // Not implemented in TinyGL
+ //tglLineWidth(_scaleW); // Not implemented in TinyGL
tglBegin(TGL_LINES);
tglVertex2f(x1, y1);
diff --git a/engines/grim/grim.cpp b/engines/grim/grim.cpp
index 392fb19b733..3c863869738 100644
--- a/engines/grim/grim.cpp
+++ b/engines/grim/grim.cpp
@@ -78,10 +78,8 @@
#include "engines/grim/remastered/overlay.h"
#include "engines/grim/remastered/lua_remastered.h"
#include "engines/grim/remastered/commentary.h"
-
#include "engines/grim/imuse/imuse.h"
#include "engines/grim/emi/sound/emisound.h"
-
#include "engines/grim/lua/lua.h"
namespace Grim {
@@ -110,7 +108,7 @@ GrimEngine::GrimEngine(OSystem *syst, uint32 gameFlags, GrimGameType gameType, C
g_movie = nullptr;
g_imuse = nullptr;
- //Set default settings
+ // Set default settings
ConfMan.registerDefault("use_arb_shaders", true);
_showFps = ConfMan.getBool("show_fps");
@@ -186,7 +184,7 @@ GrimEngine::GrimEngine(OSystem *syst, uint32 gameFlags, GrimGameType gameType, C
SearchMan.addSubDirectoryMatching(gameDataDir, "widescreen");
- //Remastered:
+ // Remastered:
if (isRemastered()) {
for (uint32 i = 0; i < kNumCutscenes; i++) {
_cutsceneEnabled[i] = false;
@@ -349,11 +347,11 @@ Common::Error GrimEngine::run() {
MD5CheckDialog d;
if (!d.runModal()) {
Common::U32String confirmString = Common::U32String::format(_(
- "ScummVM found some problems with your game data files.\n"
- "Running ScummVM nevertheless may cause game bugs or even crashes.\n"
- "Do you still want to run %s?"),
- GType_MONKEY4 == getGameType() ? "Escape From Monkey Island" : "Grim Fandango"
- );
+ "ScummVM found some problems with your game data files.\n"
+ "Running ScummVM nevertheless may cause game bugs or even crashes.\n"
+ "Do you still want to run %s?"),
+ GType_MONKEY4 == getGameType() ? "Escape From Monkey Island" : "Grim Fandango"
+ );
GUI::MessageDialog msg(confirmString, _("Yes"), _("No"));
if (msg.runModal() != GUI::kMessageOK) {
return Common::kUserCanceled;
@@ -1181,7 +1179,7 @@ void GrimEngine::savegameRestore() {
g_imuse->pause(true);
g_movie->pause(true);
if (g_registry)
- g_registry->save();
+ g_registry->save();
_selectedActor = nullptr;
delete _currSet;
@@ -1572,8 +1570,7 @@ void GrimEngine::buildActiveActorsList() {
_activeActors.clear();
foreach (Actor *a, Actor::getPool()) {
- if (((_mode == NormalMode || _mode == DrawMode) && a->isDrawableInSet(_currSet->getName())) ||
- a->isInOverworld()) {
+ if (((_mode == NormalMode || _mode == DrawMode) && a->isDrawableInSet(_currSet->getName())) || a->isInOverworld()) {
_activeActors.push_back(a);
}
}
diff --git a/engines/grim/grim.h b/engines/grim/grim.h
index 36e669961c1..6ee90e483a3 100644
--- a/engines/grim/grim.h
+++ b/engines/grim/grim.h
@@ -23,13 +23,12 @@
#define GRIM_ENGINE_H
#include "engines/engine.h"
+#include "engines/advancedDetector.h"
#include "common/str-array.h"
#include "common/hashmap.h"
#include "common/events.h"
-#include "engines/advancedDetector.h"
-
#include "engines/grim/textobject.h"
#include "engines/grim/iris.h"
#include "engines/grim/detection.h"
diff --git a/engines/grim/grim_controls.cpp b/engines/grim/grim_controls.cpp
index f46073a97f7..a576356b713 100644
--- a/engines/grim/grim_controls.cpp
+++ b/engines/grim/grim_controls.cpp
@@ -20,6 +20,7 @@
*/
#include "common/events.h"
+
#include "engines/grim/lua.h"
#include "engines/grim/grim.h"
#include "engines/grim/debugger.h"
@@ -228,7 +229,7 @@ const ControlDescriptor controls[] = {
{ "AXIS_MOUSE_Y", KEYCODE_AXIS_MOUSE_Y },
{ "AXIS_MOUSE_Z", KEYCODE_AXIS_MOUSE_Z },
-//PS2
+// PS2
{ "KEY_JOY1_SQUARE", KEYCODE_JOY1_X },
{ "KEY_JOY1_TRIANGLE", KEYCODE_JOY1_Y },
{ "KEY_JOY1_CIRCLE", KEYCODE_JOY1_B },
diff --git a/engines/grim/inputdialog.cpp b/engines/grim/inputdialog.cpp
index ab3f418cc18..5c8caa0683c 100644
--- a/engines/grim/inputdialog.cpp
+++ b/engines/grim/inputdialog.cpp
@@ -71,7 +71,7 @@ InputDialog::InputDialog(const Common::String &message, const Common::String &st
int height = 10;
for (int i = 0; i < lineCount; i++) {
new GUI::StaticTextWidget(this, 10, height, maxlineWidth, kLineHeight,
- lines[i], Graphics::kTextAlignCenter);
+ lines[i], Graphics::kTextAlignCenter);
height += kLineHeight;
}
height += 10;
diff --git a/engines/grim/iris.cpp b/engines/grim/iris.cpp
index d3521cdd179..38135c34082 100644
--- a/engines/grim/iris.cpp
+++ b/engines/grim/iris.cpp
@@ -28,11 +28,9 @@ namespace Grim {
Iris::Iris() : _playing(false), _direction(Open), _x1(0), _y1(0), _x2(0), _y2(0),
_targetX(0), _targetY(0), _length(0), _currTime(0) {
-
}
Iris::~Iris() {
-
}
void Iris::play(Iris::Direction dir, int x, int y, int length) {
diff --git a/engines/grim/keyframe.cpp b/engines/grim/keyframe.cpp
index 0bcace067ea..ae2956b8119 100644
--- a/engines/grim/keyframe.cpp
+++ b/engines/grim/keyframe.cpp
@@ -56,8 +56,10 @@ void KeyframeAnim::loadBinary(Common::SeekableReadStream *data) {
// Next four bytes are the frames per second
// The fps value seems to be ignored and causes the animation the first time manny
// enters the kitchen of the Blue Casket to go out of sync. So we force it to 15.
-// _fps = data->readFloatLE();
+
+ //_fps = data->readFloatLE();
_fps = 15.;
+
// Next four bytes are the number of frames
data->seek(56, SEEK_SET);
_numFrames = data->readUint32LE();
@@ -280,10 +282,10 @@ void KeyframeAnim::KeyframeNode::animate(ModelNode &node, float frame, float fad
Math::Angle roll = _entries[low]._roll;
/** @bug Interpolating between two orientations specified by Euler angles (yaw/pitch/roll)
- * by linearly interpolating the YPR values does not compute proper in-between
- * poses, i.e. the rotation from start to finish does not go via the shortest arc.
- * Though, if the start and end poses are very similar to each other, this can look
- * acceptable without visual artifacts.
+ * by linearly interpolating the YPR values does not compute proper in-between
+ * poses, i.e. the rotation from start to finish does not go via the shortest arc.
+ * Though, if the start and end poses are very similar to each other, this can look
+ * acceptable without visual artifacts.
*/
if (useDelta) {
pos += dt * _entries[low]._dpos;
diff --git a/engines/grim/lipsync.cpp b/engines/grim/lipsync.cpp
index 3b75f9f6a2e..5375593b01a 100644
--- a/engines/grim/lipsync.cpp
+++ b/engines/grim/lipsync.cpp
@@ -31,7 +31,6 @@ namespace Grim {
template class ObjectPtr<LipSync>;
-
LipSync::LipSync(const Common::String &filename, Common::SeekableReadStream *data) :
Object(), _fname(filename) {
@@ -83,7 +82,7 @@ int LipSync::getAnim(int pos) {
if ((i + 1) < _numEntries) {
frame2 = _entries[i + 1].frame;
} else {
- frame2 = (unsigned int) - 1L;
+ frame2 = (uint) - 1L;
}
if ((pos >= frame1) && (pos < frame2)) {
return _entries[i].anim;
diff --git a/engines/grim/localize.cpp b/engines/grim/localize.cpp
index d270ca81063..ff91684e7f9 100644
--- a/engines/grim/localize.cpp
+++ b/engines/grim/localize.cpp
@@ -106,15 +106,15 @@ Localizer::Localizer() {
char *nextline = data;
Common::String last_entry;
- //Read file till end
+ // Read file till end
for (char *line = data + 4; nextline != nullptr && (line - data <= filesize); nextline != nullptr && (line = nextline + 1)) {
nextline = strchr(line, '\n');
- //if there is no next line we arrived the last one
+ // If there is no next line we arrived the last one
if (nextline == nullptr) {
nextline = strchr(line, '\0');
}
- //in grim we have to exit on first empty line else skip line
+ // In grim we have to exit on first empty line else skip line
if (*line == '\r') {
if (g_grim->getGameType() == GType_GRIM) {
break;
@@ -124,7 +124,7 @@ Localizer::Localizer() {
continue;
}
- //EMI has an garbage line which should be ignored
+ // EMI has an garbage line which should be ignored
if (g_grim->getGameType() == GType_MONKEY4 && *line == '\x1A')
continue;
diff --git a/engines/grim/lua.cpp b/engines/grim/lua.cpp
index 90e8e09ad2e..7fd520e319a 100644
--- a/engines/grim/lua.cpp
+++ b/engines/grim/lua.cpp
@@ -41,7 +41,6 @@
#include "engines/grim/gfx_base.h"
#include "engines/grim/model.h"
#include "engines/grim/primitives.h"
-
#include "engines/grim/lua/lauxlib.h"
#include "engines/grim/lua/luadebug.h"
#include "engines/grim/lua/lualib.h"
@@ -102,7 +101,6 @@ void LuaObjects::pushObjects() const {
}
}
-
LuaBase *LuaBase::s_instance = nullptr;
LuaBase::LuaBase() :
@@ -398,7 +396,7 @@ bool LuaBase::findCostume(lua_Object costumeObj, Actor *actor, Costume **costume
if (lua_isnil(costumeObj))
return true;
if (lua_isnumber(costumeObj)) {
- /* int num = (int)lua_getnumber(costumeObj);*/
+ //int num = (int)lua_getnumber(costumeObj);
error("findCostume: search by Id not implemented");
// TODO get costume by ID ?
}
diff --git a/engines/grim/lua_v1.cpp b/engines/grim/lua_v1.cpp
index 1b2a1263154..71b00f0a42d 100644
--- a/engines/grim/lua_v1.cpp
+++ b/engines/grim/lua_v1.cpp
@@ -330,7 +330,7 @@ void Lua_V1::Enumerate3DDevices() {
lua_Object numObj = lua_getparam(1);
if (!lua_isnumber(numObj))
return;
-/* int num = (int)lua_getnumber(numObj);*/
+ //int num = (int)lua_getnumber(numObj);
lua_pushobject(result);
lua_pushnumber(-1.0);
if (g_driver->isHardwareAccelerated()) {
@@ -513,7 +513,7 @@ void Lua_V1::GetControlState() {
lua_pushnumber(g_grim->getControlAxis(num));
else {
pushbool(g_grim->getControlState(num)); // key down, originaly it push number if key down
- //pushnil or number, what is is ?
+ // pushnil or number, what is is ?
}
}
@@ -532,8 +532,8 @@ void Lua_V1::GetSpeechMode() {
}
void Lua_V1::GetDiskFreeSpace() {
- //the ps2 version of emi wants more than 600 KB
- //grim: amount of free space in MB, used for creating saves
+ // The ps2 version of emi wants more than 600 KB
+ // Grim: amount of free space in MB, used for creating saves
lua_pushnumber(700);
}
@@ -610,7 +610,7 @@ void Lua_V1::SubmitSaveGameData() {
}
savedState->endSection();
- //give ps2 saves a human-readable name
+ // Give ps2 saves a human-readable name
if (g_grim->getGameType() == GType_MONKEY4 &&
g_grim->getGamePlatform() == Common::kPlatformPS2) {
savedState->beginSection('PS2S');
diff --git a/engines/grim/lua_v1_actor.cpp b/engines/grim/lua_v1_actor.cpp
index b3ced73b2e1..a8c59833aa6 100644
--- a/engines/grim/lua_v1_actor.cpp
+++ b/engines/grim/lua_v1_actor.cpp
@@ -28,7 +28,6 @@
#include "engines/grim/set.h"
#include "engines/grim/model.h"
#include "engines/grim/gfx_base.h"
-
#include "engines/grim/lua/lauxlib.h"
namespace Grim {
@@ -767,7 +766,7 @@ void Lua_V1::GetActorCostume() {
if (lua_isnil(costumeObj)) {
// dummy
} else if (lua_isnumber(costumeObj)) {
-/* int num = (int)lua_getnumber(costumeObj);*/
+ //int num = (int)lua_getnumber(costumeObj);
error("GetActorCostume: implement number Id");
} else
return;
@@ -1220,16 +1219,15 @@ void Lua_V1::PointActorAt() {
void Lua_V1::WalkActorVector() {
lua_Object actorObj = lua_getparam(1);
lua_Object actor2Obj = lua_getparam(2);
-// lua_Object xObj = lua_getparam(3);
-// lua_Object yObj = lua_getparam(4);
-// lua_Object zObj = lua_getparam(5);
-// lua_Object param6Obj = lua_getparam(6);
+ //lua_Object xObj = lua_getparam(3);
+ //lua_Object yObj = lua_getparam(4);
+ //lua_Object zObj = lua_getparam(5);
+ //lua_Object param6Obj = lua_getparam(6);
- if (!lua_isuserdata(actorObj) || lua_tag(actorObj) != MKTAG('A','C','T','R') ||
- !lua_isuserdata(actor2Obj) || lua_tag(actor2Obj) != MKTAG('A','C','T','R'))
+ if (!lua_isuserdata(actorObj) || lua_tag(actorObj) != MKTAG('A','C','T','R') || !lua_isuserdata(actor2Obj) || lua_tag(actor2Obj) != MKTAG('A','C','T','R'))
return;
-// Actor *actor = static_cast<Actor *>(lua_getuserdata(actorObj));
+ //Actor *actor = static_cast<Actor *>(lua_getuserdata(actorObj));
Actor *actor2 = getactor(actor2Obj);
// TODO whole below part need rewrote to much original
@@ -1392,17 +1390,17 @@ void Lua_V1::SetActorFollowBoxes() {
void Lua_V1::SetActorConstrain() {
lua_Object actorObj = lua_getparam(1);
-// lua_Object constrainObj = lua_getparam(2);
+ //lua_Object constrainObj = lua_getparam(2);
if (!lua_isuserdata(actorObj) || lua_tag(actorObj) != MKTAG('A','C','T','R'))
return;
-// Actor *actor = static_cast<Actor *>(lua_getuserdata(actorObj));
-// bool constrain = !lua_isnil(constrainObj);
+ //Actor *actor = static_cast<Actor *>(lua_getuserdata(actorObj));
+ //bool constrain = !lua_isnil(constrainObj);
// FIXME that below should be enabled, but for now it's disabled realated to
// above func SetActorFollowBoxes.
-// actor->setConstrain(constrain);
+ //actor->setConstrain(constrain);
}
void Lua_V1::GetVisibleThings() {
diff --git a/engines/grim/lua_v1_graphics.cpp b/engines/grim/lua_v1_graphics.cpp
index b35bcc99a5c..ca9946c1432 100644
--- a/engines/grim/lua_v1_graphics.cpp
+++ b/engines/grim/lua_v1_graphics.cpp
@@ -27,10 +27,8 @@
#include "engines/grim/iris.h"
#include "engines/grim/gfx_base.h"
#include "engines/grim/set.h"
-#include "actor.h"
-
+#include "engines/grim/actor.h"
#include "engines/grim/movie/movie.h"
-
#include "engines/grim/lua/lua.h"
namespace Grim {
@@ -66,7 +64,7 @@ void Lua_V1::BlastImage() {
int x = (int)lua_getnumber(xObj);
int y = (int)lua_getnumber(yObj);
-// bool transparent = getbool(4); // TODO transparent/masked copy into display
+ //bool transparent = getbool(4); // TODO transparent/masked copy into display
bitmap->draw(x, y);
}
diff --git a/engines/grim/lua_v1_set.cpp b/engines/grim/lua_v1_set.cpp
index 6e5d460437c..9c3743a698c 100644
--- a/engines/grim/lua_v1_set.cpp
+++ b/engines/grim/lua_v1_set.cpp
@@ -26,7 +26,6 @@
#include "engines/grim/actor.h"
#include "engines/grim/grim.h"
#include "engines/grim/set.h"
-
#include "engines/grim/lua/lauxlib.h"
namespace Grim {
diff --git a/engines/grim/lua_v1_sound.cpp b/engines/grim/lua_v1_sound.cpp
index 4716a5ca894..9d7725aa66b 100644
--- a/engines/grim/lua_v1_sound.cpp
+++ b/engines/grim/lua_v1_sound.cpp
@@ -27,9 +27,7 @@
#include "engines/grim/actor.h"
#include "engines/grim/savegame.h"
#include "engines/grim/set.h"
-
#include "engines/grim/imuse/imuse.h"
-
#include "engines/grim/lua/lauxlib.h"
namespace Grim {
diff --git a/engines/grim/lua_v1_text.cpp b/engines/grim/lua_v1_text.cpp
index e9f792496ca..6b75ef94eb6 100644
--- a/engines/grim/lua_v1_text.cpp
+++ b/engines/grim/lua_v1_text.cpp
@@ -31,7 +31,6 @@
#include "engines/grim/resource.h"
#include "engines/grim/inputdialog.h"
#include "engines/grim/textobject.h"
-
#include "engines/grim/lua/lauxlib.h"
namespace Grim {
@@ -281,7 +280,7 @@ void Lua_V1::SayLine() {
if ((lua_isuserdata(paramObj) && lua_tag(paramObj) == MKTAG('A','C','T','R'))
|| lua_isstring(paramObj) || lua_istable(paramObj)) {
- Actor *actor = nullptr;//some_Actor, maybe some current actor
+ Actor *actor = nullptr;// some Actor, maybe some current actor
if (lua_isuserdata(paramObj) && lua_tag(paramObj) == MKTAG('A','C','T','R')) {
actor = getactor(paramObj);
paramObj = lua_getparam(paramId++);
@@ -302,7 +301,7 @@ void Lua_V1::SayLine() {
paramObj = lua_getparam(paramId++);
}
- actor->sayLine(msgId, background, x, y); //background, vol, pan, x, y
+ actor->sayLine(msgId, background, x, y); // background, vol, pan, x, y
}
}
}
@@ -336,7 +335,7 @@ void Lua_V1::PrintLine() {
msg = parseMsgText(tmpstr, msgId);
}
if (!msg.empty()) {
-// actor->sayLine(msg.c_str(), msgId); //background, vol, pan, x, y
+ //actor->sayLine(msg.c_str(), msgId); //background, vol, pan, x, y
}
}
}
diff --git a/engines/grim/material.cpp b/engines/grim/material.cpp
index cfcc08a3b01..ee4d039170d 100644
--- a/engines/grim/material.cpp
+++ b/engines/grim/material.cpp
@@ -20,8 +20,10 @@
*/
#include "common/endian.h"
+
#include "image/tga.h"
#include "image/png.h"
+
#include "graphics/surface.h"
#include "engines/grim/grim.h"
@@ -155,7 +157,6 @@ static void loadTGA(Common::SeekableReadStream *data, Texture *t) {
}
void MaterialData::initEMI(Common::SeekableReadStream *data) {
-
if (_fname.hasSuffix(".sur")) { // This expects that we want all the materials in the sur-file
Common::Array<Common::String> texFileNames;
char readFileName[64];
diff --git a/engines/grim/md5checkdialog.cpp b/engines/grim/md5checkdialog.cpp
index 59f36f972a6..9b91d47567f 100644
--- a/engines/grim/md5checkdialog.cpp
+++ b/engines/grim/md5checkdialog.cpp
@@ -67,8 +67,7 @@ MD5CheckDialog::MD5CheckDialog() :
// Each line is represented by one static text item.
int height = 10;
for (int i = 0; i < lineCount; i++) {
- new GUI::StaticTextWidget(this, 10, height, maxlineWidth, kLineHeight,
- lines[i], Graphics::kTextAlignCenter);
+ new GUI::StaticTextWidget(this, 10, height, maxlineWidth, kLineHeight, lines[i], Graphics::kTextAlignCenter);
height += kLineHeight;
}
height += 20;
diff --git a/engines/grim/model.cpp b/engines/grim/model.cpp
index a506cb859e0..c643fc2fe80 100644
--- a/engines/grim/model.cpp
+++ b/engines/grim/model.cpp
@@ -35,13 +35,11 @@
namespace Grim {
-
/**
* @class Model
*/
Model::Model(const Common::String &filename, Common::SeekableReadStream *data, CMap *cmap, Model *parent) :
Object(), _parent(parent), _numMaterials(0), _numGeosets(0), _cmap(cmap), _fname(filename) {
-
if (data->readUint32BE() == MKTAG('L','D','O','M'))
loadBinary(data);
else {
@@ -395,10 +393,8 @@ Mesh::Mesh() :
_vertices(nullptr), _verticesI(nullptr), _vertNormals(nullptr),
_numTextureVerts(0), _textureVerts(nullptr), _faces(nullptr), _userData(nullptr) {
_name[0] = '\0';
-
}
-
Mesh::~Mesh() {
g_driver->destroyMesh(this);
diff --git a/engines/grim/model.h b/engines/grim/model.h
index bfe68c23dd7..bdc5e408b41 100644
--- a/engines/grim/model.h
+++ b/engines/grim/model.h
@@ -23,6 +23,7 @@
#define GRIM_MODEL_H
#include "engines/grim/object.h"
+
#include "math/matrix4.h"
#include "math/quat.h"
diff --git a/engines/grim/movie/bink.cpp b/engines/grim/movie/bink.cpp
index aa78611b726..9e42b2b80e5 100644
--- a/engines/grim/movie/bink.cpp
+++ b/engines/grim/movie/bink.cpp
@@ -23,15 +23,17 @@
#include "common/memstream.h"
#include "common/stream.h"
#include "common/substream.h"
+
+#include "graphics/surface.h"
+
#include "engines/grim/grim.h"
#include "engines/grim/localize.h"
#include "engines/grim/textobject.h"
#include "engines/grim/textsplit.h"
-#include "graphics/surface.h"
-#include "video/bink_decoder.h"
-
#include "engines/grim/movie/bink.h"
+#include "video/bink_decoder.h"
+
#ifdef USE_BINK
namespace Grim {
diff --git a/engines/grim/movie/codecs/blocky8.cpp b/engines/grim/movie/codecs/blocky8.cpp
index 8f28fbb1add..4bb4e46daf6 100644
--- a/engines/grim/movie/codecs/blocky8.cpp
+++ b/engines/grim/movie/codecs/blocky8.cpp
@@ -69,19 +69,19 @@ namespace Grim {
} while (0)
static const int8 blocky8_table_small1[] = {
- 0, 1, 2, 3, 3, 3, 3, 2, 1, 0, 0, 0, 1, 2, 2, 1,
+ 0, 1, 2, 3, 3, 3, 3, 2, 1, 0, 0, 0, 1, 2, 2, 1,
};
static const int8 blocky8_table_small2[] = {
- 0, 0, 0, 0, 1, 2, 3, 3, 3, 3, 2, 1, 1, 1, 2, 2,
+ 0, 0, 0, 0, 1, 2, 3, 3, 3, 3, 2, 1, 1, 1, 2, 2,
};
static const int8 blocky8_table_big1[] = {
- 0, 2, 5, 7, 7, 7, 7, 7, 7, 5, 2, 0, 0, 0, 0, 0,
+ 0, 2, 5, 7, 7, 7, 7, 7, 7, 5, 2, 0, 0, 0, 0, 0,
};
static const int8 blocky8_table_big2[] = {
- 0, 0, 0, 0, 1, 3, 4, 6, 7, 7, 7, 7, 6, 4, 3, 1,
+ 0, 0, 0, 0, 1, 3, 4, 6, 7, 7, 7, 7, 6, 4, 3, 1,
};
static const int8 blocky8_table[] = {
@@ -343,16 +343,8 @@ extern "C" {
#endif
}
-extern "C" void ARM_Blocky8_decode2( byte *dst,
- const byte *src,
- int width,
- int height,
- const byte *param_ptr,
- int16 *_table,
- byte *_tableBig,
- int32 offset1,
- int32 offset2,
- byte *_tableSmall);
+extern "C" void ARM_Blocky8_decode2(byte *dst, const byte *src, int width, int height, const byte *param_ptr,
+ int16 *_table, byte *_tableBig, int32 offset1, int32 offset2, byte *_tableSmall);
#define decode2(SRC,DST,WIDTH,HEIGHT,PARAM) \
ARM_Blocky8_decode2(SRC,DST,WIDTH,HEIGHT,PARAM,_table,_tableBig, \
diff --git a/engines/grim/movie/codecs/codec48.cpp b/engines/grim/movie/codecs/codec48.cpp
index 32d3655dfb9..710c6b1e474 100644
--- a/engines/grim/movie/codecs/codec48.cpp
+++ b/engines/grim/movie/codecs/codec48.cpp
@@ -283,7 +283,6 @@ void Codec48Decoder::decode3(byte *dst, const byte *src, int bufOffset) {
for (int j = 0; j < _blockX; j++) {
byte opcode = *src++;
-
switch (opcode) {
case 0xFF: {
// Interpolate a 4x4 block based on 1 pixel, then scale to 8x8
diff --git a/engines/grim/movie/codecs/smush_decoder.cpp b/engines/grim/movie/codecs/smush_decoder.cpp
index 885508e5e69..0af5e1b67be 100644
--- a/engines/grim/movie/codecs/smush_decoder.cpp
+++ b/engines/grim/movie/codecs/smush_decoder.cpp
@@ -32,7 +32,6 @@
#include "audio/decoders/raw.h"
#include "engines/grim/debug.h"
-
#include "engines/grim/movie/codecs/codec48.h"
#include "engines/grim/movie/codecs/blocky8.h"
#include "engines/grim/movie/codecs/blocky16.h"
@@ -725,5 +724,4 @@ void SmushDecoder::SmushAudioTrack::skipSamples(int sampleCount) {
delete[] tempBuffer;
}
-
} // end of namespace Grim
diff --git a/engines/grim/movie/codecs/smush_decoder.h b/engines/grim/movie/codecs/smush_decoder.h
index 973af1a5d25..e53d92e70ae 100644
--- a/engines/grim/movie/codecs/smush_decoder.h
+++ b/engines/grim/movie/codecs/smush_decoder.h
@@ -71,7 +71,7 @@ protected:
Graphics::PixelFormat getPixelFormat() const override { return _format; }
int getCurFrame() const override { return _curFrame; }
void setCurFrame(int frame) { _curFrame = frame; }
- int getFrameCount() const override { return _nbframes; }
+ int getFrameCount() const override { return _nbframes; }
Common::Rational getFrameRate() const override { return _frameRate; }
void setMsPerFrame(int ms);
diff --git a/engines/grim/movie/movie.h b/engines/grim/movie/movie.h
index 7cd2aec6a7d..a4f61111a96 100644
--- a/engines/grim/movie/movie.h
+++ b/engines/grim/movie/movie.h
@@ -170,7 +170,6 @@ protected:
virtual void restore(SaveGame *state) {}
};
-
// Factory-like functions:
MoviePlayer *CreateMpegPlayer();
diff --git a/engines/grim/movie/mpeg.cpp b/engines/grim/movie/mpeg.cpp
index 73b213084db..9a082282106 100644
--- a/engines/grim/movie/mpeg.cpp
+++ b/engines/grim/movie/mpeg.cpp
@@ -20,11 +20,12 @@
*/
#include "common/system.h"
+
#include "video/mpegps_decoder.h"
+
#include "engines/grim/movie/mpeg.h"
#include "engines/grim/grim.h"
-
#ifdef USE_MPEG2
namespace Grim {
diff --git a/engines/grim/movie/quicktime.cpp b/engines/grim/movie/quicktime.cpp
index 55ebe284d03..17cf61aa236 100644
--- a/engines/grim/movie/quicktime.cpp
+++ b/engines/grim/movie/quicktime.cpp
@@ -20,7 +20,9 @@
*/
#include "common/system.h"
+
#include "video/qt_decoder.h"
+
#include "engines/grim/movie/quicktime.h"
#include "engines/grim/grim.h"
diff --git a/engines/grim/objectstate.cpp b/engines/grim/objectstate.cpp
index aa6352bfa60..5a8a95e0772 100644
--- a/engines/grim/objectstate.cpp
+++ b/engines/grim/objectstate.cpp
@@ -28,7 +28,6 @@ namespace Grim {
ObjectState::ObjectState(int setup, ObjectState::Position position, const char *bitmap, const char *zbitmap, bool transparency) :
_setupID(setup), _pos(position), _visibility(false) {
-
_bitmap = Bitmap::create(bitmap);
if (zbitmap) {
_zbitmap = Bitmap::create(zbitmap);
@@ -38,7 +37,6 @@ ObjectState::ObjectState(int setup, ObjectState::Position position, const char *
ObjectState::ObjectState() :
_bitmap(nullptr), _zbitmap(nullptr) {
-
}
ObjectState::~ObjectState() {
diff --git a/engines/grim/patchr.cpp b/engines/grim/patchr.cpp
index 00dc170fe4c..927fc19124a 100644
--- a/engines/grim/patchr.cpp
+++ b/engines/grim/patchr.cpp
@@ -51,7 +51,7 @@ private:
static const uint32 _kDiffBufferSize, _kHeaderSize, _kMd5size;
static const uint16 _kVersionMajor, _kVersionMinor;
- //Flags
+ // Flags
enum Flags {
FLAG_MIX_DIFF_EXTRA = 1 << 0,
FLAG_COMPRESS_CTRL = 1 << 1
@@ -268,11 +268,12 @@ bool PatchedFile::readNextInst() {
//Sanity checks
if (_ctrl->err() ||
- (int32(_diffCopy) > _file->size() - _file->pos()) ||
- (int32(_diffCopy) > _diff->size() - _diff->pos()) ||
- (int32(_extraCopy) > _extra->size() - _extra->pos()) ||
- (_jump > _file->size() - _file->pos()))
+ (int32(_diffCopy) > _file->size() - _file->pos()) ||
+ (int32(_diffCopy) > _diff->size() - _diff->pos()) ||
+ (int32(_extraCopy) > _extra->size() - _extra->pos()) ||
+ (_jump > _file->size() - _file->pos())) {
error("%s: Corrupted patchfile. istrleft = %d", _patchName.c_str(), _instrLeft);
+ }
--_instrLeft;
return true;
diff --git a/engines/grim/remastered/commentary.cpp b/engines/grim/remastered/commentary.cpp
index 503f8703bb1..39de223d5ad 100644
--- a/engines/grim/remastered/commentary.cpp
+++ b/engines/grim/remastered/commentary.cpp
@@ -39,7 +39,7 @@ class Comment {
Common::String _name;
Common::String _filename;
Common::Array<CommentLine> _lines;
- bool _hasHeard; //TODO: Should be saved
+ bool _hasHeard; // TODO: Should be saved
public:
Comment(const Common::String &name, const Common::String &filename);
Common::String getName() const;
diff --git a/engines/grim/remastered/commentary.h b/engines/grim/remastered/commentary.h
index 13778a341dc..74b495c8aa0 100644
--- a/engines/grim/remastered/commentary.h
+++ b/engines/grim/remastered/commentary.h
@@ -24,6 +24,7 @@
#include "common/str.h"
#include "common/hash-str.h"
+
namespace Grim {
class Comment;
diff --git a/engines/grim/remastered/hotspot.cpp b/engines/grim/remastered/hotspot.cpp
index fec4d486c80..b8c96f7ab24 100644
--- a/engines/grim/remastered/hotspot.cpp
+++ b/engines/grim/remastered/hotspot.cpp
@@ -21,18 +21,13 @@
#include "engines/grim/remastered/hotspot.h"
-
namespace Grim {
Hotspot::Hotspot(const Common::String &name, int x, int y, int width, int height) :
_name(name), _x(x), _y(y), _width(width), _height(height), _rect(Math::Vector2d(_x, _y), Math::Vector2d(_x + _width, _y + _height)) {
-
}
Hotspot::~Hotspot() {
-
}
-
-
}
diff --git a/engines/grim/remastered/hotspot.h b/engines/grim/remastered/hotspot.h
index d72cb9ab3f8..7eed29c7043 100644
--- a/engines/grim/remastered/hotspot.h
+++ b/engines/grim/remastered/hotspot.h
@@ -30,13 +30,11 @@
namespace Grim {
-
class Hotspot : public PoolObject<Hotspot> {
public:
Hotspot(const Common::String &name, int x, int y, int width, int height);
~Hotspot();
-
static int32 getStaticTag() { return MKTAG('H','O','T','S'); }
//private:
diff --git a/engines/grim/remastered/lua_remastered.cpp b/engines/grim/remastered/lua_remastered.cpp
index 6573369f0f4..ded96d999d4 100644
--- a/engines/grim/remastered/lua_remastered.cpp
+++ b/engines/grim/remastered/lua_remastered.cpp
@@ -27,20 +27,16 @@
#include "engines/grim/remastered/lua_remastered.h"
#include "engines/grim/remastered/overlay.h"
#include "engines/grim/remastered/hotspot.h"
-
#include "engines/grim/grim.h"
#include "engines/grim/font.h"
#include "engines/grim/resource.h"
#include "engines/grim/registry.h"
-
#include "engines/grim/localize.h"
-
#include "engines/grim/lua/lauxlib.h"
#include "engines/grim/lua/luadebug.h"
namespace Grim {
-
void Lua_Remastered::WidescreenCorrectionFactor() {
warning("Stub function: WidescreenCorrectionFactor, returns 1");
lua_pushnumber(1);
@@ -213,7 +209,6 @@ void Lua_Remastered::QueryActiveHotspots() {
lua_settable();
}
-
lua_pushobject(result);
}
@@ -399,7 +394,7 @@ void Lua_Remastered::AddHotspot() {
assert(lua_isnumber(param5));
assert(lua_isnumber(param6));
assert(lua_isnumber(param7));
-// assert(lua_isnumber(param8));
+ //assert(lua_isnumber(param8));
assert(lua_isnumber(param11));
const char *p9str = "nil";
@@ -526,7 +521,7 @@ void Lua_Remastered::FindSaveGames() {
void Lua_Remastered::Load() {
lua_Object fileName = lua_getparam(1);
-// lua_Object param2 = lua_getparam(2);
+ //lua_Object param2 = lua_getparam(2);
if (lua_isnil(fileName)) {
g_grim->loadGame("");
@@ -618,7 +613,6 @@ STUB_FUNC(Lua_Remastered::GetCrossSaveStatus)
STUB_FUNC(Lua_Remastered::GetFloorWalkPos)
STUB_FUNC(Lua_Remastered::CursorMovieEnabled)
-
struct luaL_reg remasteredMainOpcodes[] = {
{ "GetPlatform", LUA_OPCODE(Lua_Remastered, GetPlatform) },
{ "GetLanguage", LUA_OPCODE(Lua_Remastered, GetLanguage) },
diff --git a/engines/grim/remastered/overlay.cpp b/engines/grim/remastered/overlay.cpp
index 9d37334a0b1..5b499ca09ce 100644
--- a/engines/grim/remastered/overlay.cpp
+++ b/engines/grim/remastered/overlay.cpp
@@ -20,7 +20,9 @@
*/
#include "image/png.h"
+
#include "graphics/surface.h"
+
#include "engines/grim/remastered/overlay.h"
#include "engines/grim/resource.h"
#include "engines/grim/material.h"
@@ -34,7 +36,6 @@ Overlay::Overlay(const Common::String &filename, Common::SeekableReadStream *dat
}
Overlay::~Overlay() {
-
}
void Overlay::draw() {
diff --git a/engines/grim/remastered/overlay.h b/engines/grim/remastered/overlay.h
index d3a4ec6ef13..cb9268aa146 100644
--- a/engines/grim/remastered/overlay.h
+++ b/engines/grim/remastered/overlay.h
@@ -26,7 +26,6 @@
#include "engines/grim/pool.h"
-
namespace Grim {
class Material;
@@ -44,8 +43,6 @@ public:
static int32 getStaticTag() { return MKTAG('O','V','E','R'); }
-
-
//private:
Material *_material;
float _x;
diff --git a/engines/grim/resource.cpp b/engines/grim/resource.cpp
index a126ac1b572..f6b3bd35e72 100644
--- a/engines/grim/resource.cpp
+++ b/engines/grim/resource.cpp
@@ -78,7 +78,7 @@ ResourceLoader::ResourceLoader() {
Lab *l;
Common::ArchiveMemberList files, updFiles;
- //Load the update from the executable, if needed
+ // Load the update from the executable, if needed
const char *updateFilename = nullptr;
if ((g_grim->getGameType() == GType_GRIM && !g_grim->isRemastered())
|| g_grim->getGameType() == GType_MONKEY4) {
@@ -141,11 +141,11 @@ ResourceLoader::ResourceLoader() {
SearchMan.listMatchingMembers(files, "commentary.lab");
SearchMan.listMatchingMembers(files, "images.lab");
}
- //Sort the archives in order to ensure that they are loaded with the correct order
+ // Sort the archives in order to ensure that they are loaded with the correct order
Common::sort(files.begin(), files.end(), LabListComperator());
- //Check the presence of datausr.lab and if the user wants to load it.
- //In this case put it in the top of the list
+ // Check the presence of datausr.lab and if the user wants to load it.
+ // In this case put it in the top of the list
const char *datausr_name = "datausr.lab";
if (SearchMan.hasFile(datausr_name) && ConfMan.getBool("datausr_load")) {
warning("%s", "Loading datausr.lab. Please note that the ScummVM team doesn't provide support for using such patches");
@@ -165,9 +165,8 @@ ResourceLoader::ResourceLoader() {
SearchMan.listMatchingMembers(files, "tile.lab");
SearchMan.listMatchingMembers(files, "voice.lab");
} else {
-
- //Keep i9n.m4b before patch.m4b for a better efficiency
- //in decompressing from Monkey Update.exe
+ // Keep i9n.m4b before patch.m4b for a better efficiency
+ // in decompressing from Monkey Update.exe
SearchMan.listMatchingMembers(files, "i9n.m4b");
SearchMan.listMatchingMembers(files, "patch.m4b");
SearchMan.listMatchingMembers(files, "art???.m4b");
@@ -181,8 +180,8 @@ ResourceLoader::ResourceLoader() {
SearchMan.listMatchingMembers(files, "???.m4b");
}
- //Check the presence of datausr.m4b and if the user wants to load it.
- //In this case put it in the top of the list
+ // Check the presence of datausr.m4b and if the user wants to load it.
+ // In this case put it in the top of the list
const char *datausr_name = "datausr.m4b";
if (SearchMan.hasFile(datausr_name) && ConfMan.getBool("datausr_load")) {
warning("%s", "Loading datausr.m4b. Please note that the ScummVM team doesn't provide support for using such patches");
@@ -194,13 +193,13 @@ ResourceLoader::ResourceLoader() {
if (files.empty())
error("%s", "Cannot find game data - check configuration file");
- //load labs
+ // Load labs
int priority = files.size();
for (Common::ArchiveMemberList::const_iterator x = files.begin(); x != files.end(); ++x) {
Common::String filename = (*x)->getName();
filename.toLowercase();
- //Avoid duplicates
+ // Avoid duplicates
if (SearchMan.hasArchive(filename))
continue;
@@ -250,7 +249,6 @@ Common::SeekableReadStream *ResourceLoader::getFileFromCache(const Common::Strin
return nullptr;
return new Common::MemoryReadStream(entry->resPtr, entry->len);
-
}
ResourceLoader::ResourceCache *ResourceLoader::getEntryFromCache(const Common::String &filename) const {
diff --git a/engines/grim/sector.cpp b/engines/grim/sector.cpp
index 964a1cd2a66..dda177ffbbd 100644
--- a/engines/grim/sector.cpp
+++ b/engines/grim/sector.cpp
@@ -166,8 +166,7 @@ void Sector::load(TextSplitter &ts) {
// Repeat the last vertex for convenience
_vertices[_numVertices] = _vertices[0];
- _normal = Math::Vector3d::crossProduct(_vertices[1] - _vertices[0],
- _vertices[_numVertices - 1] - _vertices[0]);
+ _normal = Math::Vector3d::crossProduct(_vertices[1] - _vertices[0], _vertices[_numVertices - 1] - _vertices[0]);
float length = _normal.getMagnitude();
if (length > 0)
_normal /= length;
@@ -197,8 +196,7 @@ void Sector::loadBinary(Common::SeekableReadStream *data) {
// Repeat the last vertex for convenience
_vertices[_numVertices] = _vertices[0];
- _normal = Math::Vector3d::crossProduct(_vertices[1] - _vertices[0],
- _vertices[_numVertices - 1] - _vertices[0]);
+ _normal = Math::Vector3d::crossProduct(_vertices[1] - _vertices[0], _vertices[_numVertices - 1] - _vertices[0]);
float length = _normal.getMagnitude();
if (length > 0)
_normal /= length;
@@ -327,7 +325,6 @@ bool Sector::isPointInSector(const Math::Vector3d &point) const {
// Calculate the distance of the point from the plane of the sector.
// Return false if it isn't within a margin.
if (_height < 9000.f) { // No need to check when height is 9999.
-
float dist = distanceToPoint(point);
if (fabsf(dist) > _height + 0.01) // Add an error margin
@@ -412,13 +409,13 @@ Common::List<Math::Line3d> Sector::getBridgesTo(Sector *sector) const {
// The value of at least 0.1 was chosen to fix a path finding issue
// in set pac when guybrush tried to reach the pile of rocks.
if (fabs(getProjectionToPlane((*it).begin()).y() - sector->getProjectionToPlane((*it).begin()).y()) > 0.1f ||
- fabs(getProjectionToPlane((*it).end()).y() - sector->getProjectionToPlane((*it).end()).y()) > 0.1f) {
+ fabs(getProjectionToPlane((*it).end()).y() - sector->getProjectionToPlane((*it).end()).y()) > 0.1f) {
it = bridges.erase(it);
continue;
}
} else {
if (fabs(getProjectionToPlane((*it).begin()).z() - sector->getProjectionToPlane((*it).begin()).z()) > 0.01f ||
- fabs(getProjectionToPlane((*it).end()).z() - sector->getProjectionToPlane((*it).end()).z()) > 0.01f) {
+ fabs(getProjectionToPlane((*it).end()).z() - sector->getProjectionToPlane((*it).end()).z()) > 0.01f) {
it = bridges.erase(it);
continue;
}
@@ -548,15 +545,14 @@ Sector &Sector::operator=(const Sector &other) {
bool Sector::operator==(const Sector &other) const {
bool ok = _numVertices == other._numVertices &&
- _id == other._id &&
- _name == other._name &&
- _type == other._type &&
- _visible == other._visible;
+ _id == other._id &&
+ _name == other._name &&
+ _type == other._type &&
+ _visible == other._visible;
for (int i = 0; i < _numVertices + 1; ++i) {
ok = ok && _vertices[i] == other._vertices[i];
}
- ok = ok && _height == other._height &&
- _normal == other._normal;
+ ok = ok && _height == other._height && _normal == other._normal;
return ok;
}
diff --git a/engines/grim/set.cpp b/engines/grim/set.cpp
index b4052dc9cdb..7af6cdebc61 100644
--- a/engines/grim/set.cpp
+++ b/engines/grim/set.cpp
@@ -30,7 +30,6 @@
#include "engines/grim/resource.h"
#include "engines/grim/bitmap.h"
#include "engines/grim/gfx_base.h"
-
#include "engines/grim/sound.h"
#include "engines/grim/emi/sound/emisound.h"
@@ -58,7 +57,6 @@ Set::Set() :
_numLights(0), _numSectors(0), _numObjectStates(0), _minVolume(0),
_maxVolume(0), _numCmaps(0), _numShadows(0), _currSetup(nullptr),
_setups(nullptr), _lights(nullptr), _sectors(nullptr), _shadows(nullptr) {
-
setupOverworldLights();
}
@@ -263,25 +261,25 @@ void Set::saveState(SaveGame *savedState) const {
savedState->writeLESint32((*i)->getId());
}
- //Setups
+ // Setups
savedState->writeLESint32(_numSetups);
for (int i = 0; i < _numSetups; ++i) {
_setups[i].saveState(savedState);
}
- //Sectors
+ // Sectors
savedState->writeLESint32(_numSectors);
for (int i = 0; i < _numSectors; ++i) {
_sectors[i]->saveState(savedState);
}
- //Lights
+ // Lights
savedState->writeLESint32(_numLights);
for (int i = 0; i < _numLights; ++i) {
_lights[i].saveState(savedState);
}
- //Shadows
+ // Shadows
savedState->writeLESint32(_numShadows);
for (int i = 0; i < _numShadows; ++i) {
_shadows[i].saveState(savedState);
@@ -435,7 +433,7 @@ void Set::Setup::saveState(SaveGame *savedState) const {
savedState->writeLESint32(0);
}
- //bkgndZBm
+ // bkgndZBm
if (_bkgndZBm) {
savedState->writeLESint32(_bkgndZBm->getId());
} else {
@@ -638,11 +636,11 @@ void Light::loadBinary(Common::SeekableReadStream *data) {
}
void Light::saveState(SaveGame *savedState) const {
- //name
+ // name
savedState->writeString(_name);
savedState->writeBool(_enabled);
- //type
+ // type
savedState->writeLEUint32(_type);
savedState->writeVector3d(_pos);
@@ -1035,12 +1033,12 @@ void Set::calculateSoundPosition(const Math::Vector3d &pos, int minVol, int maxV
// TODO: The volume and pan needs to be updated when the setup changes.
// Note: This is only used in Grim. See SoundTrack::updatePosition for the corresponding implementation in EMI.
- /* distance calculation */
+ // distance calculation
Math::Vector3d cameraPos = _currSetup->_pos;
Math::Vector3d vector = pos - cameraPos;
float distance = vector.getMagnitude();
float diffVolume = maxVol - minVol;
- //This 8.f is a guess, so it may need some adjusting
+ // This 8.f is a guess, so it may need some adjusting
int newVolume = (int)(8.f * diffVolume / distance);
newVolume += minVol;
if (newVolume > _maxVolume)
@@ -1056,11 +1054,10 @@ void Set::calculateSoundPosition(const Math::Vector3d &pos, int minVol, int maxV
float cosr = cos(roll);
// Rotate the up vector by roll.
up = up * cosr + Math::Vector3d::crossProduct(cameraVector, up) * sin(roll) +
- cameraVector * Math::Vector3d::dotProduct(cameraVector, up) * (1 - cosr);
+ cameraVector * Math::Vector3d::dotProduct(cameraVector, up) * (1 - cosr);
right = Math::Vector3d::crossProduct(cameraVector, up);
right.normalize();
- angle = atan2(Math::Vector3d::dotProduct(vector, right),
- Math::Vector3d::dotProduct(vector, cameraVector));
+ angle = atan2(Math::Vector3d::dotProduct(vector, right), Math::Vector3d::dotProduct(vector, cameraVector));
float pan = sin(angle);
balance = (int)((pan + 1.f) / 2.f * 127.f + 0.5f);
diff --git a/engines/grim/set.h b/engines/grim/set.h
index 9f8a4860295..547be6bbfdf 100644
--- a/engines/grim/set.h
+++ b/engines/grim/set.h
@@ -27,6 +27,7 @@
#include "engines/grim/color.h"
#include "engines/grim/sector.h"
#include "engines/grim/objectstate.h"
+
#include "math/quat.h"
#include "math/frustum.h"
diff --git a/engines/grim/sound.cpp b/engines/grim/sound.cpp
index 7173771bb38..91334089d77 100644
--- a/engines/grim/sound.cpp
+++ b/engines/grim/sound.cpp
@@ -98,7 +98,6 @@ void SoundPlayer::restoreState(SaveGame *savedState) {
}
}
-
void SoundPlayer::saveState(SaveGame *savedState) {
if (g_grim->getGameType() == GType_GRIM) {
g_imuse->saveState(savedState);
diff --git a/engines/grim/sound.h b/engines/grim/sound.h
index 45278d54267..cb9267615be 100644
--- a/engines/grim/sound.h
+++ b/engines/grim/sound.h
@@ -40,7 +40,7 @@ public:
void setMusicState(int stateId);
void flushTracks();
-// Save/Load:
+ // Save/Load:
void restoreState(SaveGame *savedState);
void saveState(SaveGame *savedState);
};
diff --git a/engines/grim/sprite.cpp b/engines/grim/sprite.cpp
index ec7fb0c6349..64bade102ba 100644
--- a/engines/grim/sprite.cpp
+++ b/engines/grim/sprite.cpp
@@ -27,7 +27,6 @@
#include "engines/grim/gfx_base.h"
#include "engines/grim/emi/costumeemi.h"
-
namespace Grim {
Sprite::Sprite() :
@@ -35,7 +34,6 @@ Sprite::Sprite() :
_flags1(0), _flags2(0) {
}
-
void Sprite::draw() const {
if (!_visible)
return;
diff --git a/engines/grim/textobject.cpp b/engines/grim/textobject.cpp
index 87423a42ada..9eb5b1b767e 100644
--- a/engines/grim/textobject.cpp
+++ b/engines/grim/textobject.cpp
@@ -20,6 +20,7 @@
*/
#include "common/unicode-bidi.h"
+
#include "engines/grim/debug.h"
#include "engines/grim/grim.h"
#include "engines/grim/textobject.h"
@@ -346,7 +347,6 @@ void TextObject::draw() {
warning("TextObject::draw: Unknown justification code (%d)", _justify);
g_driver->drawTextObject(this);
-
}
void TextObject::update() {
diff --git a/engines/grim/textobject.h b/engines/grim/textobject.h
index c4d02c2d412..3c0adac5c93 100644
--- a/engines/grim/textobject.h
+++ b/engines/grim/textobject.h
@@ -81,8 +81,7 @@ class TextObjectDefaults : public TextObjectCommon {
};
-class TextObject : public PoolObject<TextObject>,
- public TextObjectCommon {
+class TextObject : public PoolObject<TextObject>, public TextObjectCommon {
public:
TextObject();
~TextObject();
diff --git a/engines/grim/textsplit.cpp b/engines/grim/textsplit.cpp
index 2152288de8d..c25a8298c59 100644
--- a/engines/grim/textsplit.cpp
+++ b/engines/grim/textsplit.cpp
@@ -242,7 +242,6 @@ static void parse(const char *line, const char *fmt, int field_count, va_list va
}
}
-
TextSplitter::TextSplitter(const Common::String &fname, Common::SeekableReadStream *data) : _fname(fname) {
char *line;
int i;
diff --git a/engines/grim/update/lang_filter.cpp b/engines/grim/update/lang_filter.cpp
index 71c4e45a6da..7985790a920 100644
--- a/engines/grim/update/lang_filter.cpp
+++ b/engines/grim/update/lang_filter.cpp
@@ -86,7 +86,7 @@ int LangFilter::listMembers(Common::ArchiveMemberList &list) const {
_arc->listMembers(orgList);
int num = 0;
- //Search only files with the right language and create a list with their basenames
+ // Search only files with the right language and create a list with their basenames
for (Common::ArchiveMemberList::const_iterator it = orgList.begin(); it != orgList.end(); ++it) {
orgName = (*it)->getName();
if (orgName.hasPrefix(kLanguages1[_lang]) || orgName.hasPrefix(kLanguages1[kCommon]))
@@ -96,7 +96,7 @@ int LangFilter::listMembers(Common::ArchiveMemberList &list) const {
while (orgName[i++] != '/') {;}
name = Common::String(orgName.c_str() + i);
- //If the file is a subfolder, reject it
+ // If the file is a subfolder, reject it
if (name.contains('/'))
continue;
} else
@@ -119,7 +119,7 @@ Common::SeekableReadStream *LangFilter::createReadStreamForMember(const Common::
if (!_arc)
return nullptr;
- //Search the right file
+ // Search the right file
Common::String fullName;
Common::List<Common::String> namesToTry;
namesToTry.push_front(kLanguages1[_lang] + name);
diff --git a/engines/grim/update/mscab.cpp b/engines/grim/update/mscab.cpp
index 8cdb64efa95..9731776e271 100644
--- a/engines/grim/update/mscab.cpp
+++ b/engines/grim/update/mscab.cpp
@@ -46,7 +46,7 @@ MsCabinet::MsCabinet(Common::SeekableReadStream *data) :
if (!_data)
return;
- //CFHEADER PARSING
+ // CFHEADER PARSING
// Verify Head-signature
uint32 tag = _data->readUint32BE();
@@ -72,7 +72,7 @@ MsCabinet::MsCabinet(Common::SeekableReadStream *data) :
if (numFolders == 0 || numFiles == 0)
return;
- //This implementation doesn't support multicabinet and reserved fields
+ // This implementation doesn't support multicabinet and reserved fields
uint16 flags = _data->readUint16LE();
if (flags != 0)
return;
@@ -97,7 +97,7 @@ MsCabinet::MsCabinet(Common::SeekableReadStream *data) :
_folderMap[i] = fEntry;
}
- //CFFILEs PARSING
+ // CFFILEs PARSING
_data->seek(filesOffset);
if (_data->err())
return;
@@ -171,12 +171,12 @@ Common::SeekableReadStream *MsCabinet::createReadStreamForMember(const Common::P
const FileEntry &entry = _fileMap[name];
- //Check if the file has already been decompressed and it's in the cache,
+ // Check if the file has already been decompressed and it's in the cache,
// otherwise decompress it and put it in the cache
if (_cache.contains(name))
fileBuf = _cache[name];
else {
- //Check if the decompressor should be reinitialized
+ // Check if the decompressor should be reinitialized
if (!_decompressor || entry.folder != _decompressor->getFolder()) {
delete _decompressor;
@@ -196,7 +196,7 @@ MsCabinet::Decompressor::Decompressor(const MsCabinet::FolderEntry *folder, Comm
_curFolder(folder), _data(data), _curBlock(-1), _compressedBlock(nullptr), _decompressedBlock(nullptr), _fileBuf(nullptr),
_inBlockEnd(0), _inBlockStart(0), _endBlock(0), _startBlock(0) {
- //Alloc the decompression buffers
+ // Alloc the decompression buffers
_compressedBlock = new byte[kCabInputmax];
_decompressedBlock = new byte[kCabBlockSize];
}
@@ -217,7 +217,7 @@ bool MsCabinet::Decompressor::decompressFile(byte *&fileBuf, const FileEntry &en
byte *buf_tmp, *dict;
bool decRes;
- //Sanity checks
+ // Sanity checks
if (!_compressedBlock || entry.folder != _curFolder)
return false;
@@ -226,17 +226,17 @@ bool MsCabinet::Decompressor::decompressFile(byte *&fileBuf, const FileEntry &en
_endBlock = (entry.folderOffset + entry.length) / kCabBlockSize;
_inBlockEnd = (entry.folderOffset + entry.length) % kCabBlockSize;
- //Check if the decompressor should be reinitialized
+ // Check if the decompressor should be reinitialized
if (_curBlock > _startBlock || _curBlock == -1) {
_data->seek(entry.folder->offset);
- //Check the compression method (only mszip supported)
+ // Check the compression method (only mszip supported)
if (entry.folder->comp_type != kMszipCompression)
return false;
- _curBlock = -1; //No block decompressed
+ _curBlock = -1; // No block decompressed
}
- //Check if the file is contained in the folder
+ // Check if the file is contained in the folder
if ((entry.length + entry.folderOffset) / kCabBlockSize > entry.folder->num_blocks)
return false;
@@ -244,7 +244,7 @@ bool MsCabinet::Decompressor::decompressFile(byte *&fileBuf, const FileEntry &en
buf_tmp = _fileBuf;
- //if a part of this file has been decompressed in the last block, make a copy of it
+ // If a part of this file has been decompressed in the last block, make a copy of it
copyBlock(buf_tmp);
while ((_curBlock + 1) <= _endBlock) {
@@ -260,15 +260,15 @@ bool MsCabinet::Decompressor::decompressFile(byte *&fileBuf, const FileEntry &en
if (compressedLen > kCabInputmax || uncompressedLen > kCabBlockSize)
return false;
- //Read the compressed block
+ // Read the compressed block
if (_data->read(_compressedBlock, compressedLen) != compressedLen)
return false;
- //Check the CK header
+ // Check the CK header
if (_compressedBlock[0] != 'C' || _compressedBlock[1] != 'K')
return false;
- //Decompress the block. If it isn't the first, provide the previous block as dictonary
+ // Decompress the block. If it isn't the first, provide the previous block as dictonary
dict = (_curBlock >= 0) ? _decompressedBlock : nullptr;
decRes = Common::inflateZlibHeaderless(_decompressedBlock, uncompressedLen, _compressedBlock + 2, compressedLen - 2, dict, kCabBlockSize);
if (!decRes)
@@ -276,7 +276,7 @@ bool MsCabinet::Decompressor::decompressFile(byte *&fileBuf, const FileEntry &en
_curBlock++;
- //Copy the decompressed data, if needed
+ // Copy the decompressed data, if needed
copyBlock(buf_tmp);
}
diff --git a/engines/grim/update/mscab.h b/engines/grim/update/mscab.h
index 96484f3d25d..e3ecfc8fe78 100644
--- a/engines/grim/update/mscab.h
+++ b/engines/grim/update/mscab.h
@@ -46,15 +46,15 @@ private:
Common::SeekableReadStream *_data;
struct FolderEntry {
- uint16 comp_type; //The compression type
- uint16 num_blocks; //The total number of data blocks used by this folder
- uint32 offset; //The cabinet offset of first datablock
+ uint16 comp_type; // The compression type
+ uint16 num_blocks; // The total number of data blocks used by this folder
+ uint32 offset; // The cabinet offset of first datablock
};
struct FileEntry {
- uint32 length; //Uncompressed size of the file in bytes
- FolderEntry *folder; //Folder holding this file
- uint32 folderOffset; //Uncompressed offset in the folder
+ uint32 length; // Uncompressed size of the file in bytes
+ FolderEntry *folder; // Folder holding this file
+ uint32 folderOffset; // Uncompressed offset in the folder
};
typedef Common::HashMap<Common::String, FileEntry, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> FileMap;
@@ -65,7 +65,7 @@ private:
Common::String readString(Common::ReadStream *stream);
- //Decompressor
+ // Decompressor
class Decompressor {
public:
Decompressor(const FolderEntry *folder, Common::SeekableReadStream *_data);
@@ -93,7 +93,7 @@ private:
mutable Decompressor *_decompressor;
- //Cache
+ // Cache
typedef Common::HashMap<Common::String, byte *, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> CacheMap;
mutable CacheMap _cache;
};
diff --git a/engines/grim/update/packfile.cpp b/engines/grim/update/packfile.cpp
index 5451926e2c8..e3e51e33fb9 100644
--- a/engines/grim/update/packfile.cpp
+++ b/engines/grim/update/packfile.cpp
@@ -39,14 +39,14 @@ PackFile::PackFile(Common::SeekableReadStream *data):
_orgStream->seek(_knownOffsets[i]);
- //Check for content signature
+ // Check for content signature
magicContainer = _orgStream->readUint32BE();
if (!err() && magicContainer == MKTAG('1','C','N','T')) {
key = _orgStream->readUint32LE();
createCodeTable(key);
_offset = _orgStream->pos();
- //Check for cabinet signature
+ // Check for cabinet signature
magicCabinet = readUint32BE();
if (!err() && magicCabinet == MKTAG('M','S','C','F'))
break;
@@ -63,10 +63,8 @@ PackFile::PackFile(Common::SeekableReadStream *data):
_orgStream->seek(_offset);
}
-
PackFile::~PackFile() {
delete[] _codeTable;
-
delete _orgStream;
}
More information about the Scummvm-git-logs
mailing list