aboutsummaryrefslogtreecommitdiff
path: root/engines/saga
diff options
context:
space:
mode:
Diffstat (limited to 'engines/saga')
-rw-r--r--engines/saga/detection.cpp4
-rw-r--r--engines/saga/font.cpp48
-rw-r--r--engines/saga/saga.cpp3
3 files changed, 7 insertions, 48 deletions
diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp
index faf9cbed80..265008992a 100644
--- a/engines/saga/detection.cpp
+++ b/engines/saga/detection.cpp
@@ -204,7 +204,7 @@ SaveStateList SagaMetaEngine::listSaves(const char *target) const {
// Obtain the last 2 digits of the filename, since they correspond to the save slot
slotNum = atoi(file->c_str() + file->size() - 2);
- if (slotNum >= 0 && slotNum <= 99) {
+ if (slotNum >= 0 && slotNum < MAX_SAVES) {
Common::InSaveFile *in = saveFileMan->openForLoading(*file);
if (in) {
for (int i = 0; i < 3; i++)
@@ -219,7 +219,7 @@ SaveStateList SagaMetaEngine::listSaves(const char *target) const {
return saveList;
}
-int SagaMetaEngine::getMaximumSaveSlot() const { return 99; }
+int SagaMetaEngine::getMaximumSaveSlot() const { return MAX_SAVES - 1; }
void SagaMetaEngine::removeSaveState(const char *target, int slot) const {
char extension[6];
diff --git a/engines/saga/font.cpp b/engines/saga/font.cpp
index d58d1a8900..8b9b45d3ff 100644
--- a/engines/saga/font.cpp
+++ b/engines/saga/font.cpp
@@ -143,10 +143,7 @@ void Font::createOutline(FontData *font) {
int i;
int row;
int newByteWidth;
- int oldByteWidth;
int newRowLength = 0;
- size_t indexOffset = 0;
- int index;
int currentByte;
unsigned char *basePointer;
unsigned char *srcPointer;
@@ -154,57 +151,22 @@ void Font::createOutline(FontData *font) {
unsigned char *destPointer2;
unsigned char *destPointer3;
unsigned char charRep;
- int nextIndex = 0;
-
// Populate new font style character data
for (i = 0; i < FONT_CHARCOUNT; i++) {
newByteWidth = 0;
- oldByteWidth = 0;
- index = font->normal.fontCharEntry[i].index;
- if ((index > 0) || (i == FONT_FIRSTCHAR)) {
- index += indexOffset;
- }
-
- bool skip = false;
-
- if (font->normal.fontCharEntry[i].width != 0 && font->normal.fontCharEntry[i].index < nextIndex) {
- // Some characters are copies of earlier characters.
- // Look up the original, and make sure not to grow the size of
- // the outline font twice.
- skip = true;
- bool found = false;
- for (int j = 0; j < i; j++) {
- if (font->normal.fontCharEntry[i].index == font->normal.fontCharEntry[j].index) {
- index = font->outline.fontCharEntry[j].index;
- found = true;
- break;
- }
- }
- if (!found)
- error("Invalid index backreference in font char %d", i);
- }
- font->outline.fontCharEntry[i].index = index;
+ font->outline.fontCharEntry[i].index = newRowLength;
font->outline.fontCharEntry[i].tracking = font->normal.fontCharEntry[i].tracking;
font->outline.fontCharEntry[i].flag = font->normal.fontCharEntry[i].flag;
- if (font->normal.fontCharEntry[i].width != 0) {
+ if (font->normal.fontCharEntry[i].width != 0)
newByteWidth = getByteLen(font->normal.fontCharEntry[i].width + 2);
- oldByteWidth = getByteLen(font->normal.fontCharEntry[i].width);
-
- if (!skip && newByteWidth > oldByteWidth) {
- indexOffset++;
- }
- }
font->outline.fontCharEntry[i].width = font->normal.fontCharEntry[i].width + 2;
font->outline.fontCharEntry[i].byteWidth = newByteWidth;
- if (!skip) {
- newRowLength += newByteWidth;
- nextIndex = font->normal.fontCharEntry[i].index + oldByteWidth;
- }
+ newRowLength += newByteWidth;
}
debug(2, "New row length: %d", newRowLength);
@@ -220,10 +182,6 @@ void Font::createOutline(FontData *font) {
// Generate outline font representation
for (i = 0; i < FONT_CHARCOUNT; i++) {
- if (i > 0 && font->normal.fontCharEntry[i].index < font->normal.fontCharEntry[i-1].index) {
- // Skip copies
- continue;
- }
for (row = 0; row < font->normal.header.charHeight; row++) {
for (currentByte = 0; currentByte < font->outline.fontCharEntry[i].byteWidth; currentByte++) {
basePointer = font->outline.font + font->outline.fontCharEntry[i].index + currentByte;
diff --git a/engines/saga/saga.cpp b/engines/saga/saga.cpp
index 4acf93d030..2a2a4b993c 100644
--- a/engines/saga/saga.cpp
+++ b/engines/saga/saga.cpp
@@ -29,6 +29,7 @@
#include "common/config-manager.h"
#include "common/system.h"
#include "common/events.h"
+#include "common/EventRecorder.h"
#include "sound/mixer.h"
@@ -114,7 +115,7 @@ SagaEngine::SagaEngine(OSystem *syst, const SAGAGameDescription *gameDesc)
Common::File::addDefaultDirectory(_gameDataDir.getChild("video"));
_displayClip.left = _displayClip.top = 0;
- syst->getEventManager()->registerRandomSource(_rnd, "saga");
+ g_eventRec.registerRandomSource(_rnd, "saga");
}
SagaEngine::~SagaEngine() {