JANITORIAL: Add missing references to const function parameters

Applied to all 'const Common::' and 'const Graphics::' instances.
This commit is contained in:
Miro Kropacek
2025-04-06 12:21:42 +02:00
committed by Filippos Karapetis
parent 1b58e6dd90
commit 24dcacfe69
184 changed files with 346 additions and 346 deletions
+2 -2
View File
@@ -32,7 +32,7 @@ using namespace std;
VGMItem::VGMItem() : _dwOffset(0), _unLength(0), _vgmfile(nullptr) {}
VGMItem::VGMItem(VGMFile *thevgmfile, uint32 theOffset, uint32 theLength, const Common::String theName)
VGMItem::VGMItem(VGMFile *thevgmfile, uint32 theOffset, uint32 theLength, const Common::String &theName)
: _vgmfile(thevgmfile),
_name(theName),
_dwOffset(theOffset),
@@ -66,7 +66,7 @@ VGMContainerItem::VGMContainerItem() : VGMItem() {
}
VGMContainerItem::VGMContainerItem(VGMFile *thevgmfile, uint32 theOffset, uint32 theLength,
const Common::String theName)
const Common::String &theName)
: VGMItem(thevgmfile, theOffset, theLength, theName) {
AddContainer(_headers);
AddContainer(_localitems);
+2 -2
View File
@@ -43,7 +43,7 @@ class VGMItem {
public:
VGMItem();
VGMItem(VGMFile *thevgmfile, uint32 theOffset, uint32 theLength = 0,
const Common::String theName = "");
const Common::String &theName = "");
virtual ~VGMItem(void);
public:
@@ -66,7 +66,7 @@ class VGMContainerItem : public VGMItem {
public:
VGMContainerItem();
VGMContainerItem(VGMFile *thevgmfile, uint32 theOffset, uint32 theLength = 0,
const Common::String theName = "");
const Common::String &theName = "");
virtual ~VGMContainerItem(void);
VGMHeader *AddHeader(uint32 offset, uint32 length, const Common::String &name = "Header");
+1 -1
View File
@@ -710,7 +710,7 @@ static void addPathToConf(const Common::String &key, const Common::Path &value,
ConfMan.setPath(key, value, domain);
}
Common::String EngineManager::generateUniqueDomain(const Common::String gameId) {
Common::String EngineManager::generateUniqueDomain(const Common::String &gameId) {
Common::String domainName(gameId);
int suffixN = 1;
while (ConfMan.hasGameDomain(domainName)) {
+4 -4
View File
@@ -50,7 +50,7 @@ UnicodeBiDiText::UnicodeBiDiText(const Common::U32String &str, BiDiParagraph dir
initWithU32String(str);
}
UnicodeBiDiText::UnicodeBiDiText(const Common::String &str, const Common::CodePage page,
UnicodeBiDiText::UnicodeBiDiText(const Common::String &str, const Common::CodePage &page,
uint32 *pbase_dir) : logical(str), _log_to_vis_index(nullptr), _vis_to_log_index(nullptr) {
_pbase_dir = *pbase_dir;
initWithU32String(str.decode(page));
@@ -127,12 +127,12 @@ Common::String bidiByLineHelper(Common::String line, va_list args) {
return UnicodeBiDiText(line, page, pbase_dir).visual.encode(page);
}
String convertBiDiStringByLines(const String &input, const Common::CodePage page, BiDiParagraph dir) {
String convertBiDiStringByLines(const String &input, const Common::CodePage &page, BiDiParagraph dir) {
uint32 pbase_dir = GetFriBiDiParType(dir);
return input.forEachLine(bidiByLineHelper, page, &pbase_dir);
}
String convertBiDiString(const String &input, const Common::Language lang, BiDiParagraph dir) {
String convertBiDiString(const String &input, const Common::Language &lang, BiDiParagraph dir) {
if (lang == Common::HE_ISR) {
return Common::convertBiDiString(input, kWindows1255, dir);
} else if (lang == Common::FA_IRN) {
@@ -142,7 +142,7 @@ String convertBiDiString(const String &input, const Common::Language lang, BiDiP
}
}
String convertBiDiString(const String &input, const Common::CodePage page, BiDiParagraph dir) {
String convertBiDiString(const String &input, const Common::CodePage &page, BiDiParagraph dir) {
return convertBiDiU32String(input.decode(page), dir).visual.encode(page);
}
+4 -4
View File
@@ -50,7 +50,7 @@ public:
UnicodeBiDiText(const Common::U32String &str, BiDiParagraph dir = BIDI_PAR_ON);
/* This constructor shouldn't be used outside of unicode-bidi.cpp file */
UnicodeBiDiText(const Common::String &str, const Common::CodePage page, uint32 *pbase_dir);
UnicodeBiDiText(const Common::String &str, const Common::CodePage &page, uint32 *pbase_dir);
~UnicodeBiDiText();
/**
@@ -65,11 +65,11 @@ public:
/* just call the constructor for convenience */
UnicodeBiDiText convertBiDiU32String(const U32String &input, BiDiParagraph dir = BIDI_PAR_ON);
String convertBiDiString(const String &input, const Common::Language lang, BiDiParagraph dir = BIDI_PAR_ON);
String convertBiDiString(const String &input, const Common::CodePage page, BiDiParagraph dir = BIDI_PAR_ON);
String convertBiDiString(const String &input, const Common::Language &lang, BiDiParagraph dir = BIDI_PAR_ON);
String convertBiDiString(const String &input, const Common::CodePage &page, BiDiParagraph dir = BIDI_PAR_ON);
// calls convertBiDiString for each line in isolation
String convertBiDiStringByLines(const String &input, const Common::CodePage page, BiDiParagraph dir = BIDI_PAR_ON);
String convertBiDiStringByLines(const String &input, const Common::CodePage &page, BiDiParagraph dir = BIDI_PAR_ON);
} // End of namespace Common
@@ -181,7 +181,7 @@ void Events::clearViews() {
_views.clear();
}
void Events::addKeypress(const Common::KeyCode kc) {
void Events::addKeypress(const Common::KeyCode &kc) {
Common::KeyState ks;
ks.keycode = kc;
if (kc >= Common::KEYCODE_SPACE && kc <= Common::KEYCODE_TILDE)
+1 -1
View File
@@ -368,7 +368,7 @@ public:
/**
* Add a keypress to the event queue
*/
void addKeypress(const Common::KeyCode kc);
void addKeypress(const Common::KeyCode &kc);
/**
* Events manager doesn't have any intrinsic drawing
+1 -1
View File
@@ -473,7 +473,7 @@ void AmazonEngine::drawHelpText(const Common::String &msg) {
_events->showCursor();
}
void AmazonEngine::drawHelp(const Common::String str) {
void AmazonEngine::drawHelp(const Common::String &str) {
_events->hideCursor();
if (_useItem == 0) {
_buffer2.copyBuffer(_screen);
+1 -1
View File
@@ -117,7 +117,7 @@ public:
*/
void freeInactivePlayer();
void drawHelp(const Common::String str);
void drawHelp(const Common::String &str);
void establish(int esatabIndex, int sub) override;
+1 -1
View File
@@ -163,7 +163,7 @@ private:
/**
* Loads a ScummVM OGG stream for playback
*/
Audio::AudioStream *loadOGG(const Common::ArchiveMemberPtr member);
Audio::AudioStream *loadOGG(const Common::ArchiveMemberPtr &member);
void playStream(Audio::Mixer::SoundType type, Audio::SoundHandle *handle, Audio::AudioStream *stream, int repeat);
+1 -1
View File
@@ -181,7 +181,7 @@ void AGSWaves::SFX_Filter(ScriptMethodParams &params) {
SFX[sfxNum]._filter = enable;
}
Audio::AudioStream *AGSWaves::loadOGG(const Common::ArchiveMemberPtr member) {
Audio::AudioStream *AGSWaves::loadOGG(const Common::ArchiveMemberPtr &member) {
#ifdef USE_VORBIS
if (member) {
Audio::AudioStream *stream = Audio::makeVorbisStream(member->createReadStream(), DisposeAfterUse::YES);
+6 -6
View File
@@ -335,7 +335,7 @@ void GraphicManager::drawTriangle(Common::Point *p, Color color) {
_scrolls.drawLine(p[2].x, p[2].y, p[0].x, p[0].y, color);
}
void GraphicManager::drawText(Graphics::Surface &surface, const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color) {
void GraphicManager::drawText(Graphics::Surface &surface, const Common::String &text, FontType font, byte fontHeight, int16 x, int16 y, Color color) {
for (uint i = 0; i < text.size(); i++) {
for (int j = 0; j < fontHeight; j++) {
byte pixel = font[(byte)text[i]][j];
@@ -348,14 +348,14 @@ void GraphicManager::drawText(Graphics::Surface &surface, const Common::String t
}
}
void GraphicManager::drawNormalText(const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color) {
void GraphicManager::drawNormalText(const Common::String &text, FontType font, byte fontHeight, int16 x, int16 y, Color color) {
drawText(_surface, text, font, fontHeight, x, y, color);
}
/**
* Draws text double the size of the normal.
*/
void GraphicManager::drawBigText(Graphics::Surface &surface, const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color) {
void GraphicManager::drawBigText(Graphics::Surface &surface, const Common::String &text, FontType font, byte fontHeight, int16 x, int16 y, Color color) {
for (uint i = 0; i < text.size(); i++) {
for (int j = 0; j < fontHeight; j++) {
byte pixel = font[(byte)text[i]][j];
@@ -371,7 +371,7 @@ void GraphicManager::drawBigText(Graphics::Surface &surface, const Common::Strin
}
}
void GraphicManager::drawScrollText(const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color) {
void GraphicManager::drawScrollText(const Common::String &text, FontType font, byte fontHeight, int16 x, int16 y, Color color) {
drawText(_scrolls, text, font, fontHeight, x, y, color);
}
@@ -695,7 +695,7 @@ void GraphicManager::helpDrawHighlight(byte which, Color color) {
drawRectangle(Common::Rect(466, 38 + which * 27, 556, 63 + which * 27), color);
}
void GraphicManager::helpDrawBigText(const Common::String text, int16 x, int16 y, Color color) {
void GraphicManager::helpDrawBigText(const Common::String &text, int16 x, int16 y, Color color) {
drawBigText(_surface, text, _vm->_font, 8, x, y, color);
}
@@ -1058,7 +1058,7 @@ void GraphicManager::drawSprite(AnimationType *sprite, byte picnum, int16 x, int
}
}
void GraphicManager::drawPicture(Graphics::Surface &target, const Graphics::Surface picture, uint16 destX, uint16 destY) {
void GraphicManager::drawPicture(Graphics::Surface &target, const Graphics::Surface &picture, uint16 destX, uint16 destY) {
// Copy the picture to the given place on the screen.
uint16 maxX = picture.w;
uint16 maxY = picture.h;
+6 -6
View File
@@ -66,8 +66,8 @@ public:
Common::Point drawScreenArc(int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color);
void drawPieSlice(int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color);
void drawTriangle(Common::Point *p, Color color);
void drawNormalText(const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color);
void drawScrollText(const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color);
void drawNormalText(const Common::String &text, FontType font, byte fontHeight, int16 x, int16 y, Color color);
void drawScrollText(const Common::String &text, FontType font, byte fontHeight, int16 x, int16 y, Color color);
void drawDigit(int index, int x, int y);
void drawDirection(int index, int x, int y);
void drawScrollShadow(int16 x1, int16 y1, int16 x2, int16 y2);
@@ -104,7 +104,7 @@ public:
// Help's function:
void helpDrawButton(int y, byte which);
void helpDrawHighlight(byte which, Color color);
void helpDrawBigText(const Common::String text, int16 x, int16 y, Color color);
void helpDrawBigText(const Common::String &text, int16 x, int16 y, Color color);
// Shoot em' up's functions:
void seuDrawTitle();
@@ -196,9 +196,9 @@ private:
Graphics::Surface loadPictureGraphic(Common::File &file); // Reads Graphic-planar EGA data.
Graphics::Surface loadPictureSign(Common::File &file, uint16 width, uint16 height); // Reads a tricky type of picture used for the "game over"/"about" scrolls and in the mini-game Nim.
void drawText(Graphics::Surface &surface, const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color);
void drawBigText(Graphics::Surface &surface, const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color);
void drawPicture(Graphics::Surface &target, const Graphics::Surface picture, uint16 destX, uint16 destY);
void drawText(Graphics::Surface &surface, const Common::String &text, FontType font, byte fontHeight, int16 x, int16 y, Color color);
void drawBigText(Graphics::Surface &surface, const Common::String &text, FontType font, byte fontHeight, int16 x, int16 y, Color color);
void drawPicture(Graphics::Surface &target, const Graphics::Surface &picture, uint16 destX, uint16 destY);
// Taken from Free Pascal's Procedure InternalEllipseDefault. Used to replace Pascal's procedure arc.
// Returns the end point of the arc. (Needed in Clock.)
+5 -5
View File
@@ -281,7 +281,7 @@ uint8 Palette::getB(byte index) const {
return _colors[index].b;
}
void Palette::setColorFormat(const Graphics::PixelFormat format) {
void Palette::setColorFormat(const Graphics::PixelFormat &format) {
_format = format;
}
@@ -322,7 +322,7 @@ void Palette::saturatedAddColor(Color &result, const Color &baseColor, signed r,
result.b = CLIP<int>(baseColor.b + b, 0, _format.bMax());
}
Palette::Palette(const Graphics::PixelFormat format, const uint numColors) : _format(format), _colors() {
Palette::Palette(const Graphics::PixelFormat &format, const uint numColors) : _format(format), _colors() {
_colors.resize(numColors);
fillWithBlack();
}
@@ -346,7 +346,7 @@ Palette &Palette::clear() {
return *this;
}
Palette &Palette::load(const byte *buf, const uint size, const Graphics::PixelFormat format, const uint numColors, const EndianType endian) {
Palette &Palette::load(const byte *buf, const uint size, const Graphics::PixelFormat &format, const uint numColors, const EndianType endian) {
assert(format.bytesPerPixel * numColors <= size); // Make sure there's enough input space
assert(format.aLoss == 8); // No alpha
assert(format.rShift / 8 == (format.rShift + MAX<int>(0, format.rBits() - 1)) / 8); // R must be inside one byte
@@ -376,11 +376,11 @@ byte *Palette::save(byte *buf, const uint size, const EndianType endian) const {
return save(buf, size, colorFormat(), colorCount(), endian);
}
byte *Palette::save(byte *buf, const uint size, const Graphics::PixelFormat format, const EndianType endian) const {
byte *Palette::save(byte *buf, const uint size, const Graphics::PixelFormat &format, const EndianType endian) const {
return save(buf, size, format, colorCount(), endian);
}
byte *Palette::save(byte *buf, const uint size, const Graphics::PixelFormat format, const uint numColors, const EndianType endian, const byte firstIndex) const {
byte *Palette::save(byte *buf, const uint size, const Graphics::PixelFormat &format, const uint numColors, const EndianType endian, const byte firstIndex) const {
assert(format.bytesPerPixel * numColors <= size); // Make sure there's enough output space
assert(format.aLoss == 8); // No alpha
assert(format.rShift / 8 == (format.rShift + MAX<int>(0, format.rBits() - 1)) / 8); // R must be inside one byte
+5 -5
View File
@@ -65,7 +65,7 @@ public:
* @param numColors Number of colors
* @note For the default constructed object (i.e. no parameters given) this will hold: empty() && !isValid()
*/
Palette(const Graphics::PixelFormat format = Graphics::PixelFormat(), const uint numColors = 0);
Palette(const Graphics::PixelFormat &format = Graphics::PixelFormat(), const uint numColors = 0);
Palette(const Palette& other);
Palette& operator=(const Palette& other);
@@ -83,7 +83,7 @@ public:
* @param numColors Number of colors to load
* @param endian The endianness of the colors in the input buffer
*/
Palette &load(const byte *buf, const uint size, const Graphics::PixelFormat format, const uint numColors, const EndianType endian);
Palette &load(const byte *buf, const uint size, const Graphics::PixelFormat &format, const uint numColors, const EndianType endian);
/**
* Save the whole palette to buffer in original color format using defined endianness.
@@ -100,7 +100,7 @@ public:
* @param format Output color format
* @param endian The endian type to use
*/
byte *save(byte *buf, const uint size, const Graphics::PixelFormat format, const EndianType endian) const;
byte *save(byte *buf, const uint size, const Graphics::PixelFormat &format, const EndianType endian) const;
/**
* Save (partial) palette to buffer in given color format using defined endianness.
@@ -111,7 +111,7 @@ public:
* @param endian The endian type to use
* @param firstIndex Starting color index (from which onwards to save the colors)
*/
byte *save(byte *buf, const uint size, const Graphics::PixelFormat format, const uint numColors, const EndianType endian, const byte firstIndex = 0) const;
byte *save(byte *buf, const uint size, const Graphics::PixelFormat &format, const uint numColors, const EndianType endian, const byte firstIndex = 0) const;
/**
* Rotate the palette in color range [firstIndex, lastIndex] to the right by one.
@@ -177,7 +177,7 @@ public:
private:
int findMinBrightnessColorIndex(uint minColorIndex = 1);
byte brightness(byte colorIndex);
void setColorFormat(const Graphics::PixelFormat format);
void setColorFormat(const Graphics::PixelFormat &format);
void saturatedAddColor(Color &result, const Color &baseColor, signed r, signed g, signed b) const;
private:
+5 -5
View File
@@ -64,7 +64,7 @@ void Screen::copyRectToSurface(const Graphics::Surface &srcSurface, int destX, i
copyRectToSurface(srcSurface.getBasePtr(0, 0), srcSurface.pitch, srcSurface.w, 0, destX, destY, srcSurface.w, srcSurface.h, false, NONE);
}
void Screen::copyRectToSurface(const Graphics::Surface &srcSurface, int destX, int destY, const Common::Rect srcRect, bool flipX, AlphaBlendMode alpha) {
void Screen::copyRectToSurface(const Graphics::Surface &srcSurface, int destX, int destY, const Common::Rect &srcRect, bool flipX, AlphaBlendMode alpha) {
Common::Rect clipRect = clipRectToScreen(destX, destY, srcRect);
if (clipRect.width() == 0 || clipRect.height() == 0) {
return;
@@ -80,7 +80,7 @@ void Screen::copyRectToSurface(const Graphics::Surface &srcSurface, int destX, i
copyRectToSurface(srcSurface.getBasePtr(clipRect.left, clipRect.top), srcSurface.pitch, srcSurface.w, clipRect.left, destX, destY, clipRect.width(), clipRect.height(), flipX, alpha);
}
void Screen::copyRectToSurface8bpp(const Graphics::Surface &srcSurface, const byte *palette, int destX, int destY, const Common::Rect srcRect, bool flipX, AlphaBlendMode alpha, uint16 scale) {
void Screen::copyRectToSurface8bpp(const Graphics::Surface &srcSurface, const byte *palette, int destX, int destY, const Common::Rect &srcRect, bool flipX, AlphaBlendMode alpha, uint16 scale) {
if (scale != DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE) {
drawScaledSprite(_backSurface, (const byte *)srcSurface.getBasePtr(0, 0),
srcRect.width(), srcRect.height(),
@@ -264,11 +264,11 @@ void Screen::drawScaledSprite(Graphics::Surface *destSurface, const byte *source
}
}
Common::Rect Screen::clipRectToScreen(int destX, int destY, const Common::Rect rect) {
Common::Rect Screen::clipRectToScreen(int destX, int destY, const Common::Rect &rect) {
return clipRectToRect(destX, destY, rect, Common::Rect(320, 200));
}
Common::Rect Screen::clipRectToRect(int destX, int destY, const Common::Rect rect, const Common::Rect containerRect) {
Common::Rect Screen::clipRectToRect(int destX, int destY, const Common::Rect &rect, const Common::Rect &containerRect) {
int16 x, y, w, h;
x = rect.left;
y = rect.top;
@@ -414,7 +414,7 @@ void Screen::copyRectToSurface8bppWrappedY(const Graphics::Surface &srcSurface,
}
}
void Screen::copyRectToSurface8bppWrappedX(const Graphics::Surface &srcSurface, const byte *palette, Common::Rect srcRect,
void Screen::copyRectToSurface8bppWrappedX(const Graphics::Surface &srcSurface, const byte *palette, const Common::Rect &srcRect,
AlphaBlendMode alpha) {
// Copy buffer data to internal buffer
const byte *src = (const byte *)srcSurface.getBasePtr(0, 0);
+5 -5
View File
@@ -78,9 +78,9 @@ public:
Graphics::PixelFormat getPixelFormat() { return _pixelFormat; }
void copyRectToSurface(const Graphics::Surface &srcSurface, int destX, int destY);
void copyRectToSurface(const Graphics::Surface &srcSurface, int destX, int destY, Common::Rect srcRect, bool flipX = false, AlphaBlendMode alpha = NONE);
void copyRectToSurface8bpp(const Graphics::Surface &srcSurface, const byte *palette, int destX, int destY, Common::Rect srcRect, bool flipX = false, AlphaBlendMode alpha = NONE, uint16 scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE);
void copyRectToSurface8bppWrappedX(const Graphics::Surface &srcSurface, const byte *palette, Common::Rect srcRect, AlphaBlendMode alpha = NONE);
void copyRectToSurface(const Graphics::Surface &srcSurface, int destX, int destY, const Common::Rect &srcRect, bool flipX = false, AlphaBlendMode alpha = NONE);
void copyRectToSurface8bpp(const Graphics::Surface &srcSurface, const byte *palette, int destX, int destY, const Common::Rect &srcRect, bool flipX = false, AlphaBlendMode alpha = NONE, uint16 scale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE);
void copyRectToSurface8bppWrappedX(const Graphics::Surface &srcSurface, const byte *palette, const Common::Rect &srcRect, AlphaBlendMode alpha = NONE);
void updateScreen();
void loadPalette(uint16 paletteNum, const byte *palette);
byte *getPalette(uint16 paletteNum);
@@ -89,8 +89,8 @@ public:
void clearScreen();
void drawRect(uint16 colour, Common::Rect rect, int id);
void fillRect(uint16 colour, Common::Rect rect);
Common::Rect clipRectToScreen(int destX, int destY, const Common::Rect rect);
Common::Rect clipRectToRect(int destX, int destY, const Common::Rect rect, const Common::Rect containerRect);
Common::Rect clipRectToScreen(int destX, int destY, const Common::Rect &rect);
Common::Rect clipRectToRect(int destX, int destY, const Common::Rect &rect, const Common::Rect &containerRect);
void setScreenShakeOffset(int16 x, int16 y);
+1 -1
View File
@@ -114,7 +114,7 @@ void ChainedGamesManager::clear() {
_chainedGames.clear();
}
void ChainedGamesManager::push(const Common::String target, const int slot) {
void ChainedGamesManager::push(const Common::String &target, const int slot) {
Game game;
game.target = target;
game.slot = slot;
+1 -1
View File
@@ -699,7 +699,7 @@ public:
/** Clear the chained games manager of any games. */
void clear();
/** Load a game into a slot in the chained games manager. */
void push(const Common::String target, const int slot = -1);
void push(const Common::String &target, const int slot = -1);
/** Pop the last game loaded into the chained games manager. */
bool pop(Common::String &target, int &slot);
/** Returns true if the chained games manager has no elements in the queue. */
+3 -3
View File
@@ -489,14 +489,14 @@ void FreescapeEngine::resetInput() {
rotate(0, 0);
}
Common::Point FreescapeEngine::crossairPosToMousePos(const Common::Point crossairPos) {
Common::Point FreescapeEngine::crossairPosToMousePos(const Common::Point &crossairPos) {
Common::Point mousePos;
mousePos.x = g_system->getWidth() * crossairPos.x / _screenW;
mousePos.y = g_system->getHeight() * crossairPos.y / _screenH;
return mousePos;
}
Common::Point FreescapeEngine::mousePosToCrossairPos(const Common::Point mousePos) {
Common::Point FreescapeEngine::mousePosToCrossairPos(const Common::Point &mousePos) {
Common::Point crossairPos;
crossairPos.x = _screenW * mousePos.x / g_system->getWidth();
crossairPos.y = _screenH * mousePos.y / g_system->getHeight();
@@ -1088,7 +1088,7 @@ Common::Error FreescapeEngine::loadGameStreamExtended(Common::SeekableReadStream
return Common::kNoError;
}
void FreescapeEngine::insertTemporaryMessage(const Common::String message, int deadline) {
void FreescapeEngine::insertTemporaryMessage(const Common::String &message, int deadline) {
_temporaryMessages.insert_at(0, message);
_temporaryMessageDeadlines.insert_at(0, deadline);
}
+3 -3
View File
@@ -388,8 +388,8 @@ public:
int _playerStepIndex;
Common::Array<int> _playerSteps;
Common::Point crossairPosToMousePos(const Common::Point crossairPos);
Common::Point mousePosToCrossairPos(const Common::Point mousePos);
Common::Point crossairPosToMousePos(const Common::Point &crossairPos);
Common::Point mousePosToCrossairPos(const Common::Point &mousePos);
void warpMouseToCrossair(void);
// Effects
@@ -499,7 +499,7 @@ public:
float _farClipPlane;
// Text messages and Fonts
void insertTemporaryMessage(const Common::String message, int deadline);
void insertTemporaryMessage(const Common::String &message, int deadline);
void getLatestMessages(Common::String &message, int &deadline);
void clearTemporalMessages();
Common::StringArray _temporaryMessages;
+4 -4
View File
@@ -85,11 +85,11 @@ public:
virtual void freeTexture(Texture *texture) = 0;
virtual void drawTexturedRect2D(const Common::Rect &screenRect, const Common::Rect &textureRect, Texture *texture) = 0;
virtual void renderSensorShoot(byte color, const Math::Vector3d sensor, const Math::Vector3d player, const Common::Rect viewPort) = 0;
virtual void renderPlayerShootBall(byte color, const Common::Point position, int frame, const Common::Rect viewPort) = 0;
virtual void renderPlayerShootRay(byte color, const Common::Point position, const Common::Rect viewPort) = 0;
virtual void renderSensorShoot(byte color, const Math::Vector3d sensor, const Math::Vector3d player, const Common::Rect &viewPort) = 0;
virtual void renderPlayerShootBall(byte color, const Common::Point &position, int frame, const Common::Rect &viewPort) = 0;
virtual void renderPlayerShootRay(byte color, const Common::Point &position, const Common::Rect &viewPort) = 0;
virtual void renderCrossair(const Common::Point crossairPosition) = 0;
virtual void renderCrossair(const Common::Point &crossairPosition) = 0;
virtual void renderCube(const Math::Vector3d &position, const Math::Vector3d &size, Common::Array<uint8> *colours, Common::Array<uint8> *ecolours, float offset = 0.0);
virtual void renderRectangle(const Math::Vector3d &position, const Math::Vector3d &size, Common::Array<uint8> *colours, Common::Array<uint8> *ecolours, float offset = 0.0);
+4 -4
View File
@@ -224,7 +224,7 @@ void OpenGLRenderer::positionCamera(const Math::Vector3d &pos, const Math::Vecto
glTranslatef(_shakeOffset.x, _shakeOffset.y, 0);
}
void OpenGLRenderer::renderSensorShoot(byte color, const Math::Vector3d sensor, const Math::Vector3d target, const Common::Rect viewArea) {
void OpenGLRenderer::renderSensorShoot(byte color, const Math::Vector3d sensor, const Math::Vector3d target, const Common::Rect &viewArea) {
glEnable(GL_BLEND);
glBlendFunc(GL_ONE_MINUS_DST_COLOR, GL_ZERO);
glColor3ub(255, 255, 255);
@@ -242,7 +242,7 @@ void OpenGLRenderer::renderSensorShoot(byte color, const Math::Vector3d sensor,
glDepthMask(GL_TRUE);
}
void OpenGLRenderer::renderCrossair(const Common::Point crossairPosition) {
void OpenGLRenderer::renderCrossair(const Common::Point &crossairPosition) {
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0, _screenW, _screenH, 0, 0, 1);
@@ -281,7 +281,7 @@ void OpenGLRenderer::renderCrossair(const Common::Point crossairPosition) {
glDepthMask(GL_TRUE);
}
void OpenGLRenderer::renderPlayerShootRay(byte color, const Common::Point position, const Common::Rect viewArea) {
void OpenGLRenderer::renderPlayerShootRay(byte color, const Common::Point &position, const Common::Rect &viewArea) {
uint8 r, g, b;
glMatrixMode(GL_PROJECTION);
@@ -397,7 +397,7 @@ void OpenGLRenderer::drawCelestialBody(Math::Vector3d position, float radius, by
glPopMatrix();
}
void OpenGLRenderer::renderPlayerShootBall(byte color, const Common::Point position, int frame, const Common::Rect viewArea) {
void OpenGLRenderer::renderPlayerShootBall(byte color, const Common::Point &position, int frame, const Common::Rect &viewArea) {
uint8 r, g, b;
glMatrixMode(GL_PROJECTION);
+4 -4
View File
@@ -83,10 +83,10 @@ public:
void freeTexture(Texture *texture) override;
virtual void drawTexturedRect2D(const Common::Rect &screenRect, const Common::Rect &textureRect, Texture *texture) override;
virtual void renderSensorShoot(byte color, const Math::Vector3d sensor, const Math::Vector3d player, const Common::Rect viewPort) override;
virtual void renderPlayerShootBall(byte color, const Common::Point position, int frame, const Common::Rect viewPort) override;
virtual void renderPlayerShootRay(byte color, const Common::Point position, const Common::Rect viewPort) override;
virtual void renderCrossair(const Common::Point crossairPosition) override;
virtual void renderSensorShoot(byte color, const Math::Vector3d sensor, const Math::Vector3d player, const Common::Rect &viewPort) override;
virtual void renderPlayerShootBall(byte color, const Common::Point &position, int frame, const Common::Rect &viewPort) override;
virtual void renderPlayerShootRay(byte color, const Common::Point &position, const Common::Rect &viewPort) override;
virtual void renderCrossair(const Common::Point &crossairPosition) override;
virtual void renderFace(const Common::Array<Math::Vector3d> &vertices) override;
+4 -4
View File
@@ -220,7 +220,7 @@ void OpenGLShaderRenderer::positionCamera(const Math::Vector3d &pos, const Math:
_mvpMatrix = proj * model;
_mvpMatrix.transpose();
}
void OpenGLShaderRenderer::renderSensorShoot(byte color, const Math::Vector3d sensor, const Math::Vector3d target, const Common::Rect viewArea) {
void OpenGLShaderRenderer::renderSensorShoot(byte color, const Math::Vector3d sensor, const Math::Vector3d target, const Common::Rect &viewArea) {
glEnable(GL_BLEND);
glBlendFunc(GL_ONE_MINUS_DST_COLOR, GL_ZERO);
useColor(255, 255, 255);
@@ -245,7 +245,7 @@ float remap(float f, float s) {
return 2. * f / s - 1;
}
void OpenGLShaderRenderer::renderPlayerShootBall(byte color, const Common::Point _position, int frame, const Common::Rect viewArea) {
void OpenGLShaderRenderer::renderPlayerShootBall(byte color, const Common::Point &_position, int frame, const Common::Rect &viewArea) {
uint8 r, g, b;
Math::Matrix4 identity;
@@ -299,7 +299,7 @@ void OpenGLShaderRenderer::renderPlayerShootBall(byte color, const Common::Point
glDepthMask(GL_TRUE);
}
void OpenGLShaderRenderer::renderPlayerShootRay(byte color, const Common::Point position, const Common::Rect viewArea) {
void OpenGLShaderRenderer::renderPlayerShootRay(byte color, const Common::Point &position, const Common::Rect &viewArea) {
uint8 r, g, b;
Math::Matrix4 identity;
@@ -402,7 +402,7 @@ void OpenGLShaderRenderer::drawCelestialBody(Math::Vector3d position, float radi
//_mvpMatrix = mvpMatrix;
}
void OpenGLShaderRenderer::renderCrossair(const Common::Point crossairPosition) {
void OpenGLShaderRenderer::renderCrossair(const Common::Point &crossairPosition) {
Math::Matrix4 identity;
identity(0, 0) = 1.0;
identity(1, 1) = 1.0;
+4 -4
View File
@@ -90,13 +90,13 @@ public:
void freeTexture(Texture *texture) override;
virtual void drawTexturedRect2D(const Common::Rect &screenRect, const Common::Rect &textureRect, Texture *texture) override;
virtual void renderSensorShoot(byte color, const Math::Vector3d sensor, const Math::Vector3d player, const Common::Rect viewPort) override;
virtual void renderPlayerShootBall(byte color, const Common::Point position, int frame, const Common::Rect viewPort) override;
virtual void renderPlayerShootRay(byte color, const Common::Point position, const Common::Rect viewPort) override;
virtual void renderSensorShoot(byte color, const Math::Vector3d sensor, const Math::Vector3d player, const Common::Rect &viewPort) override;
virtual void renderPlayerShootBall(byte color, const Common::Point &position, int frame, const Common::Rect &viewPort) override;
virtual void renderPlayerShootRay(byte color, const Common::Point &position, const Common::Rect &viewPort) override;
void drawCelestialBody(Math::Vector3d position, float radius, uint8 color) override;
void drawSkybox(Texture *texture, Math::Vector3d camera) override;
virtual void renderCrossair(const Common::Point crossairPosition) override;
virtual void renderCrossair(const Common::Point &crossairPosition) override;
virtual void renderFace(const Common::Array<Math::Vector3d> &vertices) override;
+4 -4
View File
@@ -170,7 +170,7 @@ void TinyGLRenderer::positionCamera(const Math::Vector3d &pos, const Math::Vecto
tglTranslatef(-pos.x(), -pos.y(), -pos.z());
}
void TinyGLRenderer::renderSensorShoot(byte color, const Math::Vector3d sensor, const Math::Vector3d player, const Common::Rect viewArea) {
void TinyGLRenderer::renderSensorShoot(byte color, const Math::Vector3d sensor, const Math::Vector3d player, const Common::Rect &viewArea) {
tglEnable(TGL_BLEND);
tglBlendFunc(TGL_ONE_MINUS_DST_COLOR, TGL_ZERO);
tglColor3ub(255, 255, 255);
@@ -185,7 +185,7 @@ void TinyGLRenderer::renderSensorShoot(byte color, const Math::Vector3d sensor,
tglDisable(TGL_BLEND);
}
void TinyGLRenderer::renderPlayerShootBall(byte color, const Common::Point position, int frame, const Common::Rect viewArea) {
void TinyGLRenderer::renderPlayerShootBall(byte color, const Common::Point &position, int frame, const Common::Rect &viewArea) {
/*uint8 r, g, b;
tglMatrixMode(TGL_PROJECTION);
@@ -232,7 +232,7 @@ void TinyGLRenderer::renderPlayerShootBall(byte color, const Common::Point posit
}
void TinyGLRenderer::renderPlayerShootRay(byte color, const Common::Point position, const Common::Rect viewArea) {
void TinyGLRenderer::renderPlayerShootRay(byte color, const Common::Point &position, const Common::Rect &viewArea) {
uint8 r, g, b;
readFromPalette(color, r, g, b); // TODO: should use opposite color
@@ -278,7 +278,7 @@ void TinyGLRenderer::renderPlayerShootRay(byte color, const Common::Point positi
tglDepthMask(TGL_TRUE);
}
void TinyGLRenderer::renderCrossair(const Common::Point crossairPosition) {
void TinyGLRenderer::renderCrossair(const Common::Point &crossairPosition) {
tglMatrixMode(TGL_PROJECTION);
tglLoadIdentity();
tglOrtho(0, _screenW, _screenH, 0, 0, 1);
+4 -4
View File
@@ -85,10 +85,10 @@ public:
virtual void drawTexturedRect2D(const Common::Rect &screenRect, const Common::Rect &textureRect, Texture *texture) override;
void drawSkybox(Texture *texture, Math::Vector3d camera) override;
virtual void renderSensorShoot(byte color, const Math::Vector3d sensor, const Math::Vector3d player, const Common::Rect viewPort) override;
virtual void renderPlayerShootBall(byte color, const Common::Point position, int frame, const Common::Rect viewPort) override;
virtual void renderPlayerShootRay(byte color, const Common::Point position, const Common::Rect viewPort) override;
virtual void renderCrossair(const Common::Point crossairPosition) override;
virtual void renderSensorShoot(byte color, const Math::Vector3d sensor, const Math::Vector3d player, const Common::Rect &viewPort) override;
virtual void renderPlayerShootBall(byte color, const Common::Point &position, int frame, const Common::Rect &viewPort) override;
virtual void renderPlayerShootRay(byte color, const Common::Point &position, const Common::Rect &viewPort) override;
virtual void renderCrossair(const Common::Point &crossairPosition) override;
virtual void renderFace(const Common::Array<Math::Vector3d> &vertices) override;
+2 -2
View File
@@ -115,7 +115,7 @@ uint EmiRegistry::convertSpeechModeFromGUI(bool subtitles, bool speechMute) cons
return 1;
}
bool EmiRegistry::Get(const Common::String key, float &res) const {
bool EmiRegistry::Get(const Common::String &key, float &res) const {
Debug::debug(Debug::Engine, "GetResidualVMPreference(%s)", key.c_str());
if (!_transMap.contains(key))
@@ -150,7 +150,7 @@ bool EmiRegistry::Get(const Common::String key, float &res) const {
return true;
}
void EmiRegistry::Set(const Common::String key, float &value) {
void EmiRegistry::Set(const Common::String &key, float &value) {
Debug::debug(Debug::Engine, "SetResidualVMPreference(%s, %f)", key.c_str(), value);
if (!_transMap.contains(key))
+2 -2
View File
@@ -33,8 +33,8 @@ public:
EmiRegistry();
~EmiRegistry() { }
bool Get(const Common::String key, float &res) const;
void Set(const Common::String key, float &value);
bool Get(const Common::String &key, float &res) const;
void Set(const Common::String &key, float &value);
private:
uint convertVolumeToMixer(uint volume) const;
+1 -1
View File
@@ -613,7 +613,7 @@ MusicEntry *EMISound::initMusicTableDemo(const Common::String &filename) {
return musicTable;
}
void EMISound::initMusicTableRetail(MusicEntry *musicTable, const Common::String filename) {
void EMISound::initMusicTableRetail(MusicEntry *musicTable, const Common::String &filename) {
Common::SeekableReadStream *data = g_resourceloader->openNewStreamFile(filename);
// Remember to check, in case we forgot to copy over those files from the CDs.
+1 -1
View File
@@ -136,7 +136,7 @@ private:
void saveTrack(SoundTrack *track, SaveGame *savedState);
SoundTrack *restoreTrack(SaveGame *savedState);
MusicEntry *initMusicTableDemo(const Common::String &filename);
void initMusicTableRetail(MusicEntry *table, const Common::String filename);
void initMusicTableRetail(MusicEntry *table, const Common::String &filename);
};
extern EMISound *g_emiSound;
+1 -1
View File
@@ -45,7 +45,7 @@ public:
virtual void stopAudioStream() = 0;
void fastForward();
bool isFastForwarding();
virtual void drawString(Graphics::Surface *surface, const Common::String text, int posx, int posy, uint32 color, bool blackBackground) {}
virtual void drawString(Graphics::Surface *surface, const Common::String &text, int posx, int posy, uint32 color, bool blackBackground) {}
virtual void copyfgtobg(uint8 arg) {}
void setOverrideSpeed(bool isOverride);
+3 -3
View File
@@ -321,7 +321,7 @@ void ROQPlayer::redrawRestoreArea(int screenOffset, bool force) {
_restoreArea->right = 0;
}
void writeImage(const Common::String filename, Graphics::Surface &surface) {
void writeImage(const Common::String &filename, Graphics::Surface &surface) {
if (surface.h == 0 || surface.w == 0) {
return;
}
@@ -345,7 +345,7 @@ void writeImage(const Common::String filename, Graphics::Surface &surface) {
#endif
}
void ROQPlayer::dumpAllSurfaces(const Common::String funcname) {
void ROQPlayer::dumpAllSurfaces(const Common::String &funcname) {
TimeDate date;
int curMonth;
g_system->getTimeAndDate(date, true);
@@ -1039,7 +1039,7 @@ void ROQPlayer::createAudioStream(bool stereo) {
g_system->getMixer()->playStream(Audio::Mixer::kSpeechSoundType, &_soundHandle, _audioStream);
}
void ROQPlayer::drawString(Graphics::Surface *surface, const Common::String text, int posx, int posy, uint32 color, bool blackBackground) {
void ROQPlayer::drawString(Graphics::Surface *surface, const Common::String &text, int posx, int posy, uint32 color, bool blackBackground) {
// TODO: fix redraw
#if 0
int screenOffset = 0;
+2 -2
View File
@@ -49,7 +49,7 @@ public:
return _soundHandle;
}
void drawString(Graphics::Surface *surface, const Common::String text, int posx, int posy, uint32 color, bool blackBackground) override;
void drawString(Graphics::Surface *surface, const Common::String &text, int posx, int posy, uint32 color, bool blackBackground) override;
void copyfgtobg(uint8 arg) override;
bool isFileHandled() override { return _isFileHandled; }
@@ -80,7 +80,7 @@ private:
bool processBlockAudioContainer(ROQBlockHeader &blockHeader);
bool playFirstFrame() { return _flagNoPlay; }; // _alpha && !_flagOverlay; }
void clearOverlay();
void dumpAllSurfaces(const Common::String funcname);
void dumpAllSurfaces(const Common::String &funcname);
void paint2(byte i, int destx, int desty);
void paint4(byte i, int destx, int desty);
+1 -1
View File
@@ -75,7 +75,7 @@ public:
virtual bool handleCheat(const Common::String &cheat) {
return false;
}
virtual void handleUnclick(const Common::String &name, Common::Point pnt) {}
virtual void handleUnclick(const Common::String &name, const Common::Point &pnt) {}
virtual ~Handler() {}
};
+1 -1
View File
@@ -452,7 +452,7 @@ public:
*/
}
void handleUnclick(const Common::String &name, const Common::Point pnt) override {
void handleUnclick(const Common::String &name, const Common::Point &pnt) override {
Common::SharedPtr<VideoRoom> room = g_vm->getVideoRoom();
if (_clickTimer >= 0) {
g_vm->cancelTimer(24012);
+1 -1
View File
@@ -1000,7 +1000,7 @@ private:
v += Common::Point(166 * _philWalkPhase, -2 * _philWalkPhase);
return v;
}
void playPhilVideo(const Common::String &name, int callback, const Common::Point videoOffset) {
void playPhilVideo(const Common::String &name, int callback, const Common::Point &videoOffset) {
Persistent *persistent = g_vm->getPersistent();
cancelAllPhils();
if (persistent->_quest == kRescuePhilQuest)
+1 -1
View File
@@ -61,7 +61,7 @@ Common::Action *createKeyBoardAction(const char *id, const Common::U32String &de
return act;
}
Common::Action *createMouseAction(const char *id, const Common::U32String &desc, const char *defaultMap, const Common::EventType type) {
Common::Action *createMouseAction(const char *id, const Common::U32String &desc, const char *defaultMap, const Common::EventType &type) {
Common::Action *act = new Common::Action(id, desc);
act->setEvent(type);
act->addDefaultInputMapping(defaultMap);
+1 -1
View File
@@ -303,7 +303,7 @@ void HypnoEngine::loadGame(const Common::String &nextLevel, int score, int puzzl
error("Function \"%s\" not implemented", __FUNCTION__);
}
void HypnoEngine::loadFonts(const Common::String prefix) {
void HypnoEngine::loadFonts(const Common::String &prefix) {
Common::File file;
Common::Path path = Common::Path(prefix).append("block05.fgx");
+5 -5
View File
@@ -365,7 +365,7 @@ public:
// Fonts
Common::BitArray _font05;
Common::BitArray _font08;
virtual void loadFonts(const Common::String prefix = "");
virtual void loadFonts(const Common::String &prefix = "");
virtual void drawString(const Filename &name, const Common::String &str, int x, int y, int w, uint32 c);
// Conversation
@@ -418,7 +418,7 @@ public:
void loadAssetsFullGame();
void loadAssetsNI();
void loadFonts(const Common::String prefix = "") override;
void loadFonts(const Common::String &prefix = "") override;
void drawString(const Filename &name, const Common::String &str, int x, int y, int w, uint32 c) override;
void changeCursor(const Common::String &cursor) override;
@@ -462,7 +462,7 @@ public:
}
private:
Common::String getLocalizedString(const Common::String name);
Common::String getLocalizedString(const Common::String &name);
uint16 getNextChar(const Common::String &str, uint32 &c);
void drawGlyph(const Common::BitArray &font, int x, int y, int bitoffset, int width, int height, int pitch, uint32 color, bool invert);
void drawKoreanChar(uint16 chr, int &curx, int y, uint32 color);
@@ -523,7 +523,7 @@ public:
Common::String findNextLevel(const Common::String &level) override;
Common::String findNextLevel(const Transition *trans) override;
void loadFonts(const Common::String prefix = "") override;
void loadFonts(const Common::String &prefix = "") override;
void drawString(const Filename &name, const Common::String &str, int x, int y, int w, uint32 c) override;
void showConversation() override;
@@ -555,7 +555,7 @@ private:
void runLock(Code *code);
void runFuseBox(Code *code);
void runGiveUp();
void showScore(const Common::String prefix);
void showScore(const Common::String &prefix);
uint32 _currentPlayerPosition;
uint32 _lastPlayerPosition;
+1 -1
View File
@@ -1175,7 +1175,7 @@ void SpiderEngine::runGiveUp() {
_nextLevel = "mainmenu.mi_";
}
void SpiderEngine::showScore(const Common::String prefix) {
void SpiderEngine::showScore(const Common::String &prefix) {
Common::String fmessage = "%s\nYou finished the ";
fmessage = fmessage + (isDemo() ? "demo" : "game") + " with a score of %d points";
Common::String message = Common::String::format(fmessage.c_str(), prefix.c_str(), _score);
+1 -1
View File
@@ -1155,7 +1155,7 @@ Common::String SpiderEngine::findNextLevel(const Transition *trans) {
return trans->nextLevel;
}
void SpiderEngine::loadFonts(const Common::String prefix) {
void SpiderEngine::loadFonts(const Common::String &prefix) {
HypnoEngine::loadFonts(prefix);
// Additional fonts
_font = FontMan.getFontByUsage(Graphics::FontManager::kConsoleFont);
+1 -1
View File
@@ -323,7 +323,7 @@ void WetEngine::showDemoScore() {
dialog.runModal();
}
Common::String WetEngine::getLocalizedString(const Common::String name) {
Common::String WetEngine::getLocalizedString(const Common::String &name) {
if (name == "name") {
switch (_language) {
case Common::FR_FRA:
+1 -1
View File
@@ -619,7 +619,7 @@ void WetEngine::showCredits() {
}
}
void WetEngine::loadFonts(const Common::String prefix) {
void WetEngine::loadFonts(const Common::String &prefix) {
HypnoEngine::loadFonts(prefix);
if (_language == Common::KO_KOR) {
Common::File file;
+1 -1
View File
@@ -364,7 +364,7 @@ static void copyRectToSurface(void *dstBuffer, const void *srcBuffer, int32 srcP
}
static void copyRectToSurface(Graphics::Surface *dstSurface, Graphics::Surface *srcSurface,
int32 destX, int32 destY, const Common::Rect subRect,
int32 destX, int32 destY, const Common::Rect &subRect,
bool8 colorKeyEnable, uint32 colorKey) {
assert(srcSurface->format == dstSurface->format);
assert(srcSurface->format.bytesPerPixel == 4);
+1 -1
View File
@@ -918,7 +918,7 @@ void Control::getActorFrameDimensions(WidthHeight &dimensions) {
dimensions._height = _actor->_surface->h;
}
void Control::drawActorRect(const Common::Rect r, byte color) {
void Control::drawActorRect(const Common::Rect &r, byte color) {
_vm->_screen->fillSurfaceRect(_actor->_surface, r, color);
_actor->_flags |= Illusions::ACTOR_FLAG_4000;
}
+1 -1
View File
@@ -222,7 +222,7 @@ public:
void updateActorMovement(uint32 deltaTime);
void refreshSequenceCode();
void getActorFrameDimensions(WidthHeight &dimensions);
void drawActorRect(const Common::Rect r, byte color);
void drawActorRect(const Common::Rect &r, byte color);
void fillActor(byte color);
bool isPixelCollision(Common::Point &pt);
public:
+2 -2
View File
@@ -35,7 +35,7 @@ namespace Illusions {
// MenuItem
MenuItem::MenuItem(const Common::String text, BaseMenuAction *action)
MenuItem::MenuItem(const Common::String &text, BaseMenuAction *action)
: _text(text), _action(action) {
}
@@ -63,7 +63,7 @@ BaseMenu::~BaseMenu() {
}
}
void BaseMenu::addText(const Common::String text) {
void BaseMenu::addText(const Common::String &text) {
_text.push_back(text);
}
+2 -2
View File
@@ -42,7 +42,7 @@ const uint kMenuTextSize = 4096;
class MenuItem {
public:
MenuItem(const Common::String text, BaseMenuAction *action);
MenuItem(const Common::String &text, BaseMenuAction *action);
~MenuItem();
void executeAction(const Common::Point &point);
const Common::String& getText() const { return _text; }
@@ -59,7 +59,7 @@ public:
BaseMenu(BaseMenuSystem *menuSystem, uint32 fontId, byte backgroundColor, byte borderColor, byte textColor, byte fieldE,
uint defaultMenuItemIndex);
virtual ~BaseMenu();
void addText(const Common::String text);
void addText(const Common::String &text);
void addMenuItem(MenuItem *menuItem);
uint getHeaderLinesCount();
const Common::String& getHeaderLine(uint index);
+8 -8
View File
@@ -66,12 +66,12 @@ DisplayMan::~DisplayMan() {
delete[] _displayBuffer;
}
void DisplayMan::loadPict(const Common::String filename) {
void DisplayMan::loadPict(const Common::String &filename) {
freePict();
_curBitmap = _vm->_resource->openDataFile(filename, MKTAG('D', 'I', 'F', 'F'));
}
void DisplayMan::loadBackPict(const Common::String fileName, uint16 *highPal) {
void DisplayMan::loadBackPict(const Common::String &fileName, uint16 *highPal) {
_fadePalette = highPal;
_vm->_anim->_noPalChange = true;
readPict(fileName);
@@ -85,7 +85,7 @@ void DisplayMan::loadBackPict(const Common::String fileName, uint16 *highPal) {
_vm->_anim->_noPalChange = false;
}
void DisplayMan::readPict(const Common::String filename, bool playOnce, bool onlyDiffData, byte *memoryBuffer) {
void DisplayMan::readPict(const Common::String &filename, bool playOnce, bool onlyDiffData, byte *memoryBuffer) {
_vm->_anim->stopDiff();
loadPict(filename);
_vm->_anim->setOutputBuffer(memoryBuffer);
@@ -511,7 +511,7 @@ void DisplayMan::freeFont(TextFont **font) {
}
}
uint16 DisplayMan::textLength(TextFont *font, const Common::String text) {
uint16 DisplayMan::textLength(TextFont *font, const Common::String &text) {
uint16 length = 0;
if (font) {
@@ -528,7 +528,7 @@ uint16 DisplayMan::textHeight(TextFont *tf) {
return (tf) ? tf->_height : 0;
}
void DisplayMan::drawText(TextFont *tf, uint16 x, uint16 y, uint16 color, const Common::String text) {
void DisplayMan::drawText(TextFont *tf, uint16 x, uint16 y, uint16 color, const Common::String &text) {
byte *vgaTop = getCurrentDrawingBuffer();
int numChars = text.size();
@@ -652,7 +652,7 @@ void DisplayMan::copyPage(uint16 width, uint16 height, uint16 nheight, uint16 st
}
}
void DisplayMan::doScrollWipe(const Common::String filename) {
void DisplayMan::doScrollWipe(const Common::String &filename) {
_vm->_event->mouseHide();
uint16 width = _vm->_utils->vgaScaleX(320);
uint16 height = _vm->_utils->vgaScaleY(149) + _vm->_utils->svgaCord(2);
@@ -731,7 +731,7 @@ void DisplayMan::doScrollBounce() {
_vm->_event->mouseShow();
}
void DisplayMan::doTransWipe(const Common::String filename) {
void DisplayMan::doTransWipe(const Common::String &filename) {
uint16 lastY, linesLast;
if (_vm->_isHiRes) {
@@ -816,7 +816,7 @@ void DisplayMan::doTransWipe(const Common::String filename) {
// bitMapBuffer will be deleted by the Image destructor
}
void DisplayMan::doTransition(TransitionType transitionType, const Common::String filename) {
void DisplayMan::doTransition(TransitionType transitionType, const Common::String &filename) {
switch (transitionType) {
case kTransitionWipe:
case kTransitionTransporter:
+8 -8
View File
@@ -85,7 +85,7 @@ private:
/**
* Scrolls the display to a new picture from a black screen.
*/
void doScrollWipe(const Common::String filename);
void doScrollWipe(const Common::String &filename);
/**
* Does the scroll bounce. Assumes bitmap already in memory.
@@ -95,7 +95,7 @@ private:
/**
* Does the transporter wipe.
*/
void doTransWipe(const Common::String filename);
void doTransWipe(const Common::String &filename);
/**
* Draws a vertical line.
@@ -110,7 +110,7 @@ private:
/**
* Draws the text to the screen.
*/
void drawText(TextFont *tf, uint16 x, uint16 y, uint16 color, const Common::String text);
void drawText(TextFont *tf, uint16 x, uint16 y, uint16 color, const Common::String &text);
/**
* Gets a line of text for flowText; makes sure that its length is less than
@@ -121,7 +121,7 @@ private:
/**
* Returns the length of a text in the specified font.
*/
uint16 textLength(TextFont *font, const Common::String text);
uint16 textLength(TextFont *font, const Common::String &text);
bool _actionMessageShown;
Common::File *_curBitmap;
@@ -132,19 +132,19 @@ public:
DisplayMan(LabEngine *lab);
virtual ~DisplayMan();
void loadPict(const Common::String filename);
void loadBackPict(const Common::String fileName, uint16 *highPal);
void loadPict(const Common::String &filename);
void loadBackPict(const Common::String &fileName, uint16 *highPal);
/**
* Reads in a picture into the display bitmap.
*/
void readPict(const Common::String filename, bool playOnce = true, bool onlyDiffData = false, byte *memoryBuffer = nullptr);
void readPict(const Common::String &filename, bool playOnce = true, bool onlyDiffData = false, byte *memoryBuffer = nullptr);
void freePict();
/**
* Does a certain number of pre-programmed wipes.
*/
void doTransition(TransitionType transitionType, const Common::String filename);
void doTransition(TransitionType transitionType, const Common::String &filename);
/**
* Changes the front screen to black.
+2 -2
View File
@@ -68,7 +68,7 @@ void Intro::introEatMessages() {
}
}
void Intro::doPictText(const Common::String filename, bool isScreen) {
void Intro::doPictText(const Common::String &filename, bool isScreen) {
Common::String path = Common::String("Lab:rooms/Intro/") + filename;
uint timeDelay = (isScreen) ? 35 : 7;
@@ -191,7 +191,7 @@ void Intro::doPictText(const Common::String filename, bool isScreen) {
} // while(1)
}
void Intro::nReadPict(const Common::String filename, bool playOnce, bool noPalChange, bool doBlack, int wait) {
void Intro::nReadPict(const Common::String &filename, bool playOnce, bool noPalChange, bool doBlack, int wait) {
Common::String finalFileName = Common::String("P:Intro/") + filename;
_vm->updateEvents();
+2 -2
View File
@@ -52,9 +52,9 @@ private:
/**
* Reads in a picture.
*/
void doPictText(const Common::String filename, bool isScreen = false);
void doPictText(const Common::String &filename, bool isScreen = false);
void nReadPict(const Common::String filename, bool playOnce = true, bool noPalChange = false, bool doBlack = false, int wait = 0);
void nReadPict(const Common::String &filename, bool playOnce = true, bool noPalChange = false, bool doBlack = false, int wait = 0);
LabEngine *_vm;
bool _quitIntro;
+2 -2
View File
@@ -281,7 +281,7 @@ private:
/**
* Does what's necessary for the monitor.
*/
void doMonitor(const Common::String background, const Common::String textfile, bool isinteractive, Common::Rect textRect);
void doMonitor(const Common::String &background, const Common::String &textfile, bool isinteractive, Common::Rect textRect);
/**
* Does the things to properly set up the detective notes.
@@ -483,7 +483,7 @@ private:
/**
* Writes the game out to disk.
*/
bool saveGame(int slot, const Common::String desc);
bool saveGame(int slot, const Common::String &desc);
/**
* Reads the game from disk.
+1 -1
View File
@@ -59,7 +59,7 @@ void LargeSet::exclElement(uint16 element) {
_array[(element - 1) >> 4] &= ~(1 << ((element - 1) % 16));
}
bool LargeSet::readInitialConditions(const Common::String fileName) {
bool LargeSet::readInitialConditions(const Common::String &fileName) {
Common::File *file = _vm->_resource->openDataFile(fileName, MKTAG('C', 'O', 'N', '0'));
uint16 conditions = file->readUint16LE();
+1 -1
View File
@@ -45,7 +45,7 @@ public:
bool in(uint16 element);
void inclElement(uint16 element);
void exclElement(uint16 element);
bool readInitialConditions(const Common::String fileName);
bool readInitialConditions(const Common::String &fileName);
private:
LabEngine *_vm;
+2 -2
View File
@@ -58,7 +58,7 @@ byte Music::getSoundFlags() {
return soundFlags;
}
void Music::loadSoundEffect(const Common::String filename, bool loop, bool waitTillFinished) {
void Music::loadSoundEffect(const Common::String &filename, bool loop, bool waitTillFinished) {
stopSoundEffect();
Common::File *file = _vm->_resource->openDataFile(filename, MKTAG('D', 'I', 'F', 'F'));
@@ -131,7 +131,7 @@ bool Music::isSoundEffectActive() const {
return _vm->_mixer->isSoundHandleActive(_sfxHandle);
}
void Music::changeMusic(const Common::String filename, bool storeCurPos, bool seektoStoredPos) {
void Music::changeMusic(const Common::String &filename, bool storeCurPos, bool seektoStoredPos) {
if (storeCurPos)
_storedPos = _musicFile->pos();
+2 -2
View File
@@ -65,7 +65,7 @@ public:
/**
* Changes the background music to something else.
*/
void changeMusic(const Common::String filename, bool storeCurPos, bool seektoStoredPos);
void changeMusic(const Common::String &filename, bool storeCurPos, bool seektoStoredPos);
void resetMusic(bool seekToStoredPos);
@@ -85,7 +85,7 @@ public:
/**
* Reads in a sound effect file. Ignores any graphics.
*/
void loadSoundEffect(const Common::String filename, bool loop, bool waitTillFinished);
void loadSoundEffect(const Common::String &filename, bool loop, bool waitTillFinished);
void stopSoundEffect();
};
+5 -5
View File
@@ -51,7 +51,7 @@ void Resource::readStaticText() {
delete labTextFile;
}
TextFont *Resource::getFont(const Common::String fileName) {
TextFont *Resource::getFont(const Common::String &fileName) {
// TODO: Add support for the font format of the Amiga version
Common::File *dataFile = openDataFile(fileName, MKTAG('V', 'G', 'A', 'F'));
@@ -73,7 +73,7 @@ TextFont *Resource::getFont(const Common::String fileName) {
return textfont;
}
Common::String Resource::getText(const Common::String fileName) {
Common::String Resource::getText(const Common::String &fileName) {
Common::File *dataFile = openDataFile(fileName);
uint32 count = dataFile->size();
@@ -92,7 +92,7 @@ Common::String Resource::getText(const Common::String fileName) {
return str;
}
void Resource::readRoomData(const Common::String fileName) {
void Resource::readRoomData(const Common::String &fileName) {
Common::File *dataFile = openDataFile(fileName, MKTAG('D', 'O', 'R', '1'));
_vm->_manyRooms = dataFile->readUint16LE();
@@ -111,7 +111,7 @@ void Resource::readRoomData(const Common::String fileName) {
delete dataFile;
}
InventoryData *Resource::readInventory(const Common::String fileName) {
InventoryData *Resource::readInventory(const Common::String &fileName) {
Common::File *dataFile = openDataFile(fileName, MKTAG('I', 'N', 'V', '1'));
_vm->_numInv = dataFile->readUint16LE();
@@ -216,7 +216,7 @@ Common::Path Resource::translateFileName(const Common::String &filename) {
return Common::Path(fileNameStrFinal);
}
Common::File *Resource::openDataFile(const Common::String filename, uint32 fileHeader) {
Common::File *Resource::openDataFile(const Common::String &filename, uint32 fileHeader) {
Common::File *dataFile = new Common::File();
dataFile->open(translateFileName(filename));
+5 -5
View File
@@ -96,12 +96,12 @@ public:
Resource(LabEngine *vm);
~Resource() {}
Common::File *openDataFile(const Common::String filename, uint32 fileHeader = 0);
void readRoomData(const Common::String fileName);
InventoryData *readInventory(const Common::String fileName);
Common::File *openDataFile(const Common::String &filename, uint32 fileHeader = 0);
void readRoomData(const Common::String &fileName);
InventoryData *readInventory(const Common::String &fileName);
void readViews(uint16 roomNum);
TextFont *getFont(const Common::String fileName);
Common::String getText(const Common::String fileName);
TextFont *getFont(const Common::String &fileName);
Common::String getText(const Common::String &fileName);
Common::String getStaticText(byte index) const { return _staticText[index]; }
private:
+1 -1
View File
@@ -124,7 +124,7 @@ WARN_UNUSED_RESULT bool readSaveGameHeader(Common::InSaveFile *in, SaveGameHeade
return true;
}
bool LabEngine::saveGame(int slot, const Common::String desc) {
bool LabEngine::saveGame(int slot, const Common::String &desc) {
Common::String fileName = getSaveStateName(slot);
Common::SaveFileManager *saveFileManager = _system->getSavefileManager();
Common::OutSaveFile *file = saveFileManager->openForSaving(fileName);
+1 -1
View File
@@ -438,7 +438,7 @@ void LabEngine::processMonitor(const Common::String &ntext, TextFont *monitorFon
} // while
}
void LabEngine::doMonitor(const Common::String background, const Common::String textfile, bool isinteractive, Common::Rect textRect) {
void LabEngine::doMonitor(const Common::String &background, const Common::String &textfile, bool isinteractive, Common::Rect textRect) {
Common::Rect scaledRect = _utils->vgaRectScale(textRect.left, textRect.top, textRect.right, textRect.bottom);
_monitorTextFilename = textfile;
+2 -2
View File
@@ -235,7 +235,7 @@ void SpecialLocks::doTile(bool showsolution) {
}
}
void SpecialLocks::showTileLock(const Common::String filename, bool showSolution) {
void SpecialLocks::showTileLock(const Common::String &filename, bool showSolution) {
_vm->_anim->_doBlack = true;
_vm->_anim->_noPalChange = true;
_vm->_graphics->readPict(filename);
@@ -348,7 +348,7 @@ void SpecialLocks::changeCombination(uint16 number) {
_vm->_conditions->exclElement(COMBINATIONUNLOCKED);
}
void SpecialLocks::showCombinationLock(const Common::String filename) {
void SpecialLocks::showCombinationLock(const Common::String &filename) {
_vm->_anim->_doBlack = true;
_vm->_anim->_noPalChange = true;
_vm->_graphics->readPict(filename);
+2 -2
View File
@@ -48,14 +48,14 @@ public:
SpecialLocks(LabEngine *vm);
~SpecialLocks();
void showTileLock(const Common::String filename, bool showSolution);
void showTileLock(const Common::String &filename, bool showSolution);
/**
* Processes mouse clicks and changes tile positions.
*/
void tileClick(Common::Point pos);
void showCombinationLock(const Common::String filename);
void showCombinationLock(const Common::String &filename);
/**
* Processes mouse clicks and changes the door combination.
+2 -2
View File
@@ -55,7 +55,7 @@ void SavePoints::push(EntityIndex entity2, EntityIndex entity1, ActionIndex acti
_savepoints.push_back(point);
}
void SavePoints::push(EntityIndex entity2, EntityIndex entity1, ActionIndex action, const Common::String param) {
void SavePoints::push(EntityIndex entity2, EntityIndex entity1, ActionIndex action, const Common::String &param) {
if (_savepoints.size() >= _savePointsMaxSize)
return;
@@ -155,7 +155,7 @@ void SavePoints::call(EntityIndex entity2, EntityIndex entity1, ActionIndex acti
}
}
void SavePoints::call(EntityIndex entity2, EntityIndex entity1, ActionIndex action, const Common::String param) const {
void SavePoints::call(EntityIndex entity2, EntityIndex entity1, ActionIndex action, const Common::String &param) const {
SavePoint point;
point.entity1 = entity1;
point.action = action;
+2 -2
View File
@@ -101,7 +101,7 @@ public:
// Savepoints
void push(EntityIndex entity2, EntityIndex entity1, ActionIndex action, uint32 param = 0);
void push(EntityIndex entity2, EntityIndex entity1, ActionIndex action, const Common::String param);
void push(EntityIndex entity2, EntityIndex entity1, ActionIndex action, const Common::String &param);
void pushAll(EntityIndex entity, ActionIndex action, uint32 param = 0);
void process();
void reset();
@@ -113,7 +113,7 @@ public:
void setCallback(EntityIndex index, Callback *callback);
Callback *getCallback(EntityIndex entity) const;
void call(EntityIndex entity2, EntityIndex entity1, ActionIndex action, uint32 param = 0) const;
void call(EntityIndex entity2, EntityIndex entity1, ActionIndex action, const Common::String param) const;
void call(EntityIndex entity2, EntityIndex entity1, ActionIndex action, const Common::String &param) const;
void callAndProcess();
// Serializable
+1 -1
View File
@@ -62,7 +62,7 @@ void CommandButton::draw(Graphics::ManagedSurface &surface) const {
}
}
bool CommandButton::isInsideBounds(const Common::Point point) const {
bool CommandButton::isInsideBounds(const Common::Point &point) const {
return _data.bounds.contains(point);
}
+1 -1
View File
@@ -96,7 +96,7 @@ public:
~CommandButton() {}
void draw(Graphics::ManagedSurface &surface) const;
bool isInsideBounds(const Common::Point point) const;
bool isInsideBounds(const Common::Point &point) const;
const ControlData &getData() const;
void select();
void unselect();
+1 -1
View File
@@ -632,7 +632,7 @@ public:
void upgradeTargetIfNecessary(const Common::String &target) const;
/** Generate valid, non-repeated domainName for game*/
Common::String generateUniqueDomain(const Common::String gameId);
Common::String generateUniqueDomain(const Common::String &gameId);
private:
/** Find a game across all loaded plugins. */
+1 -1
View File
@@ -185,7 +185,7 @@ void Events::clearViews() {
_views.clear();
}
void Events::addKeypress(const Common::KeyCode kc) {
void Events::addKeypress(const Common::KeyCode &kc) {
Common::KeyState ks;
ks.keycode = kc;
if (kc >= Common::KEYCODE_SPACE && kc <= Common::KEYCODE_TILDE)
+1 -1
View File
@@ -367,7 +367,7 @@ public:
/**
* Add a keypress to the event queue
*/
void addKeypress(const Common::KeyCode kc);
void addKeypress(const Common::KeyCode &kc);
/**
* Add a action to the event queue
+2 -2
View File
@@ -203,7 +203,7 @@ void Window::onMouseMove(int32 x, int32 y) {
void Window::onMouseUp(int32 x, int32 y, int mouseButton) {
}
void Window::onKeyboardEvent(const Common::EventType evtType, bool repeat, const Common::KeyState &keyEvt) {
void Window::onKeyboardEvent(const Common::EventType &evtType, bool repeat, const Common::KeyState &keyEvt) {
}
void Window::onAction(Actions::Action action) {
@@ -430,7 +430,7 @@ static void runDissolveTransition(Graphics::ManagedSurface &surface, const Graph
}
}
static void safeCopyRectToSurface(Graphics::ManagedSurface &surface, const Graphics::ManagedSurface &srcSurface, int destX, int destY, const Common::Rect subRect) {
static void safeCopyRectToSurface(Graphics::ManagedSurface &surface, const Graphics::ManagedSurface &srcSurface, int destX, int destY, const Common::Rect &subRect) {
if (subRect.width() == 0 || subRect.height() == 0)
return;
+1 -1
View File
@@ -124,7 +124,7 @@ public:
virtual void onMouseDown(int32 x, int32 y, int mouseButton);
virtual void onMouseMove(int32 x, int32 y);
virtual void onMouseUp(int32 x, int32 y, int mouseButton);
virtual void onKeyboardEvent(const Common::EventType evtType, bool repeat, const Common::KeyState &keyEvt);
virtual void onKeyboardEvent(const Common::EventType &evtType, bool repeat, const Common::KeyState &keyEvt);
virtual void onAction(Actions::Action action);
protected:
+3 -3
View File
@@ -96,7 +96,7 @@ public:
void onMouseDown(int32 x, int32 y, int mouseButton) override;
void onMouseMove(int32 x, int32 y) override;
void onMouseUp(int32 x, int32 y, int mouseButton) override;
void onKeyboardEvent(const Common::EventType evtType, bool repeat, const Common::KeyState &keyEvt) override;
void onKeyboardEvent(const Common::EventType &evtType, bool repeat, const Common::KeyState &keyEvt) override;
void onAction(MTropolis::Actions::Action action) override;
private:
@@ -132,7 +132,7 @@ void MainWindow::onMouseUp(int32 x, int32 y, int mouseButton) {
}
}
void MainWindow::onKeyboardEvent(const Common::EventType evtType, bool repeat, const Common::KeyState &keyEvt) {
void MainWindow::onKeyboardEvent(const Common::EventType &evtType, bool repeat, const Common::KeyState &keyEvt) {
_runtime->queueOSEvent(Common::SharedPtr<OSEvent>(new KeyboardInputEvent(kOSEventTypeKeyboard, evtType, repeat, keyEvt)));
}
@@ -6699,7 +6699,7 @@ void Runtime::onMouseUp(int32 x, int32 y, Actions::MouseButton mButton) {
_mouseFocusWindow.reset();
}
void Runtime::onKeyboardEvent(const Common::EventType evtType, bool repeat, const Common::KeyState &keyEvt) {
void Runtime::onKeyboardEvent(const Common::EventType &evtType, bool repeat, const Common::KeyState &keyEvt) {
Common::SharedPtr<Window> focusWindow = _keyFocusWindow.lock();
if (focusWindow)
focusWindow->onKeyboardEvent(evtType, repeat, keyEvt);
+1 -1
View File
@@ -1656,7 +1656,7 @@ public:
void onMouseDown(int32 x, int32 y, Actions::MouseButton mButton);
void onMouseMove(int32 x, int32 y);
void onMouseUp(int32 x, int32 y, Actions::MouseButton mButton);
void onKeyboardEvent(const Common::EventType evtType, bool repeat, const Common::KeyState &keyEvt);
void onKeyboardEvent(const Common::EventType &evtType, bool repeat, const Common::KeyState &keyEvt);
void onAction(MTropolis::Actions::Action action);
const Common::Point &getCachedMousePosition() const;
+1 -1
View File
@@ -111,7 +111,7 @@ bool AnimationDecoder::decode(AnimationDecoderCallback *callback) {
return true;
}
void AnimationDecoder::setPartialMode(int fromFrame, int toFrame, const Common::Rect area, uint8 threshold) {
void AnimationDecoder::setPartialMode(int fromFrame, int toFrame, const Common::Rect &area, uint8 threshold) {
_fromFrame = fromFrame;
_toFrame = toFrame;
_area = area;
+1 -1
View File
@@ -64,7 +64,7 @@ public:
* @param area Output surface will be confined to this area.
* @param threshold Source pixels with color index above this threshold will not be replaced.
*/
void setPartialMode(int fromFrame, int toFrame, const Common::Rect area = Common::Rect(), uint8 threshold = 0xFF);
void setPartialMode(int fromFrame, int toFrame, const Common::Rect &area = Common::Rect(), uint8 threshold = 0xFF);
private:
void loadPalette(Common::SeekableReadStream &stream);
+1 -1
View File
@@ -451,7 +451,7 @@ const AgeData Database::_ages[] = {
{ 11, 0, 1, roomsLOGO, 0 }
};
Database::Database(const Common::Platform platform, const Common::Language language, const uint32 localizationType) :
Database::Database(const Common::Platform &platform, const Common::Language &language, const uint32 localizationType) :
_platform(platform),
_language(language),
_localizationType(localizationType),
+1 -1
View File
@@ -161,7 +161,7 @@ class Myst3Engine;
class Database {
public:
Database(const Common::Platform platform, const Common::Language language, const uint32 localizationType);
Database(const Common::Platform &platform, const Common::Language &language, const uint32 localizationType);
~Database();
/**
+1 -1
View File
@@ -80,7 +80,7 @@ GameState::StateData::StateData() {
isAutosave = false;
}
GameState::GameState(const Common::Platform platform, Database *database):
GameState::GameState(const Common::Platform &platform, Database *database):
_platform(platform),
_db(database) {
+1 -1
View File
@@ -47,7 +47,7 @@ enum ViewType {
class GameState {
public:
GameState(const Common::Platform platform, Database *database);
GameState(const Common::Platform &platform, Database *database);
virtual ~GameState();
void newGame();
+1 -1
View File
@@ -382,7 +382,7 @@ void GraphicsManager::rotateBlit(const Graphics::ManagedSurface &src, Graphics::
}
}
void GraphicsManager::crossDissolve(const Graphics::ManagedSurface &from, const Graphics::ManagedSurface &to, byte alpha, const Common::Rect rect, Graphics::ManagedSurface &inResult) {
void GraphicsManager::crossDissolve(const Graphics::ManagedSurface &from, const Graphics::ManagedSurface &to, byte alpha, const Common::Rect &rect, Graphics::ManagedSurface &inResult) {
assert(from.getBounds() == to.getBounds());
inResult.blitFrom(from, rect, Common::Point());
inResult.transBlitFrom(to, rect, Common::Point(), (uint32)-1, false, alpha);
+1 -1
View File
@@ -70,7 +70,7 @@ public:
static void copyToManaged(void *src, Graphics::ManagedSurface &dst, uint srcW, uint srcH, const Graphics::PixelFormat &format, bool verticalFlip = false, bool doubleSize = false);
static void rotateBlit(const Graphics::ManagedSurface &src, Graphics::ManagedSurface &dest, byte rotation);
static void crossDissolve(const Graphics::ManagedSurface &from, const Graphics::ManagedSurface &to, byte alpha, const Common::Rect rect, Graphics::ManagedSurface &inResult);
static void crossDissolve(const Graphics::ManagedSurface &from, const Graphics::ManagedSurface &to, byte alpha, const Common::Rect &rect, Graphics::ManagedSurface &inResult);
// Debug
void debugDrawToScreen(const Graphics::ManagedSurface &surf);
+5 -5
View File
@@ -189,7 +189,7 @@ void Hotspot::moveSpotTo(const CoordType h, const CoordType v) {
_spotArea.moveTo(h, v);
}
void Hotspot::moveSpotTo(const Common::Point pt) {
void Hotspot::moveSpotTo(const Common::Point &pt) {
_spotArea.moveTo(pt);
}
@@ -197,11 +197,11 @@ void Hotspot::moveSpot(const CoordType h, const CoordType v) {
_spotArea.translate(h, v);
}
void Hotspot::moveSpot(const Common::Point pt) {
void Hotspot::moveSpot(const Common::Point &pt) {
_spotArea.translate(pt.x, pt.y);
}
bool Hotspot::pointInSpot(const Common::Point where) const {
bool Hotspot::pointInSpot(const Common::Point &where) const {
return _spotActive && _spotArea.pointInRegion(where);
}
@@ -223,7 +223,7 @@ void HotspotList::deleteHotspots() {
clear();
}
Hotspot *HotspotList::findHotspot(const Common::Point where) {
Hotspot *HotspotList::findHotspot(const Common::Point &where) {
for (HotspotIterator it = begin(); it != end(); it++)
if ((*it)->pointInSpot(where))
return *it;
@@ -231,7 +231,7 @@ Hotspot *HotspotList::findHotspot(const Common::Point where) {
return nullptr;
}
HotSpotID HotspotList::findHotspotID(const Common::Point where) {
HotSpotID HotspotList::findHotspotID(const Common::Point &where) {
Hotspot *hotspot = findHotspot(where);
return hotspot ? hotspot->getObjectID() : kNoHotSpotID;
}
+5 -5
View File
@@ -96,11 +96,11 @@ public:
void getCenter(CoordType&, CoordType&) const;
void moveSpotTo(const CoordType, const CoordType);
void moveSpotTo(const Common::Point);
void moveSpotTo(const Common::Point &);
void moveSpot(const CoordType, const CoordType);
void moveSpot(const Common::Point);
void moveSpot(const Common::Point &);
bool pointInSpot(const Common::Point) const;
bool pointInSpot(const Common::Point &) const;
void setActive();
void setInactive();
@@ -123,8 +123,8 @@ public:
void deleteHotspots();
Hotspot *findHotspot(const Common::Point);
HotSpotID findHotspotID(const Common::Point);
Hotspot *findHotspot(const Common::Point &);
HotSpotID findHotspotID(const Common::Point &);
Hotspot *findHotspotByID(const HotSpotID);
Hotspot *findHotspotByMask(const HotSpotFlags);
+1 -1
View File
@@ -313,7 +313,7 @@ InputBits InputHandler::getClickFilter() {
return kFilterNoInput;
}
void InputHandler::updateCursor(const Common::Point cursorLocation, const Hotspot *cursorSpot) {
void InputHandler::updateCursor(const Common::Point &cursorLocation, const Hotspot *cursorSpot) {
if (_nextHandler)
_nextHandler->updateCursor(cursorLocation, cursorSpot);
}
+1 -1
View File
@@ -427,7 +427,7 @@ public:
virtual void clickInHotspot(const Input &, const Hotspot *);
virtual void activateHotspots();
virtual void updateCursor(const Common::Point, const Hotspot *);
virtual void updateCursor(const Common::Point &, const Hotspot *);
virtual bool isClickInput(const Input &, const Hotspot *);
virtual bool wantsCursor();
+1 -1
View File
@@ -162,7 +162,7 @@ void Movie::setTime(const TimeValue time, const TimeScale scale) {
}
}
void Movie::setRate(const Common::Rational rate) {
void Movie::setRate(const Common::Rational &rate) {
if (_video) {
_video->setRate(rate);
+1 -1
View File
@@ -53,7 +53,7 @@ public:
void setTime(const TimeValue, const TimeScale = 0) override;
void setRate(const Common::Rational) override;
void setRate(const Common::Rational &) override;
void start() override;
void stop() override;
@@ -2574,7 +2574,7 @@ Common::Path Caldoria::getHintMovie(uint hintNum) {
return movieName;
}
void Caldoria::updateCursor(const Common::Point where, const Hotspot *cursorSpot) {
void Caldoria::updateCursor(const Common::Point &where, const Hotspot *cursorSpot) {
if (cursorSpot) {
switch (cursorSpot->getObjectID()) {
case kCa4DEnvironCloseSpotID:
@@ -511,7 +511,7 @@ protected:
CanOpenDoorReason canOpenDoor(DoorTable::Entry &) override;
void doorOpened() override;
void updateCursor(const Common::Point, const Hotspot *) override;
void updateCursor(const Common::Point &, const Hotspot *) override;
FlagsArray<uint16, kNumCaldoriaPrivateFlags> _privateFlags;
+1 -1
View File
@@ -4207,7 +4207,7 @@ void Mars::decreaseRobotShuttleEnergy(const int delta, Common::Point impactPoint
}
}
void Mars::updateCursor(const Common::Point cursorLocation, const Hotspot *cursorSpot) {
void Mars::updateCursor(const Common::Point &cursorLocation, const Hotspot *cursorSpot) {
if (cursorSpot && cursorSpot->getObjectID() == kShuttleViewSpotID) {
if (_weaponSelection != kNoWeapon)
_vm->_cursor->setCurrentFrameIndex(6);
+1 -1
View File
@@ -194,7 +194,7 @@ protected:
void startUpFromSpaceChase();
void transportOutFromSpaceChase(bool);
void spaceChaseClick(const Input &, const HotSpotID);
void updateCursor(const Common::Point, const Hotspot *) override;
void updateCursor(const Common::Point &, const Hotspot *) override;
void playSpaceAmbient();
Common::Path getSoundSpotsName() override;
+1 -1
View File
@@ -3525,7 +3525,7 @@ void FullTSA::doSolve() {
}
}
void FullTSA::updateCursor(const Common::Point where, const Hotspot *cursorSpot) {
void FullTSA::updateCursor(const Common::Point &where, const Hotspot *cursorSpot) {
if (cursorSpot) {
switch (cursorSpot->getObjectID()) {
case kTSA0BEastMonitorSpotID:
+1 -1
View File
@@ -73,7 +73,7 @@ public:
bool canSolve() override;
void doSolve() override;
void updateCursor(const Common::Point, const Hotspot *) override;
void updateCursor(const Common::Point &, const Hotspot *) override;
protected:
enum {
+1 -1
View File
@@ -1972,7 +1972,7 @@ bool PegasusEngine::wantsCursor() {
return _gameMenu == nullptr;
}
void PegasusEngine::updateCursor(const Common::Point, const Hotspot *cursorSpot) {
void PegasusEngine::updateCursor(const Common::Point &, const Hotspot *cursorSpot) {
if (_itemDragger.isTracking()) {
_cursor->setCurrentFrameIndex(5);
} else {
+1 -1
View File
@@ -225,7 +225,7 @@ protected:
void clickInHotspot(const Input &, const Hotspot *) override;
void activateHotspots(void) override;
void updateCursor(const Common::Point, const Hotspot *) override;
void updateCursor(const Common::Point &, const Hotspot *) override;
bool wantsCursor() override;
private:
+1 -1
View File
@@ -91,7 +91,7 @@ TimeValue TimeBase::getTime(const TimeScale scale) {
return _time.getNumerator() * ((scale == 0) ? _preferredScale : scale) / _time.getDenominator();
}
void TimeBase::setRate(const Common::Rational rate) {
void TimeBase::setRate(const Common::Rational &rate) {
_rate = rate;
_lastMillis = 0;
+1 -1
View File
@@ -72,7 +72,7 @@ public:
virtual void setScale(const TimeScale scale) { _preferredScale = scale; }
virtual TimeScale getScale() const { return _preferredScale; }
virtual void setRate(const Common::Rational);
virtual void setRate(const Common::Rational &);
virtual Common::Rational getRate() const { return _rate; }
virtual void start();

Some files were not shown because too many files have changed in this diff Show More