[Scummvm-git-logs] scummvm branch-2-5 -> 077ba2a8ae9217c7a18518a308f36042da1ca682
athrxx
noreply at scummvm.org
Sun Dec 5 14:15:11 UTC 2021
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
df104edb5d KYRA: (EOB/LOL) - reduce calls to updateScreen
8580624c09 KYRA: (FM-Towns) - fix minor font glitch
1b7b4b73e5 KYRA: (EOB/PC98) - improve final sequence (king scene) for enabled vsync option
077ba2a8ae KYRA: minor metaengine fix
Commit: df104edb5de26064abd8bdd7a58f9a1fae731ef0
https://github.com/scummvm/scummvm/commit/df104edb5de26064abd8bdd7a58f9a1fae731ef0
Author: athrxx (athrxx at scummvm.org)
Date: 2021-12-05T15:11:44+01:00
Commit Message:
KYRA: (EOB/LOL) - reduce calls to updateScreen
(to improve performance with enabled vsync option)
Changed paths:
engines/kyra/engine/items_eob.cpp
engines/kyra/gui/gui_eob.cpp
engines/kyra/sequence/sequences_darkmoon.cpp
engines/kyra/sequence/sequences_eob.cpp
engines/kyra/text/text_rpg.cpp
diff --git a/engines/kyra/engine/items_eob.cpp b/engines/kyra/engine/items_eob.cpp
index d55a464c5a..5e481ea9b0 100644
--- a/engines/kyra/engine/items_eob.cpp
+++ b/engines/kyra/engine/items_eob.cpp
@@ -209,6 +209,8 @@ int EoBCoreEngine::deleteInventoryItem(int charIndex, int slot) {
if (_currentControlMode == 0)
gui_drawCharPortraitWithStats(charIndex);
+
+ _screen->updateScreen();
}
return _items[itm].value;
@@ -332,6 +334,8 @@ bool EoBCoreEngine::deletePartyItems(int16 itemType, int16 itemValue) {
}
}
+ _screen->updateScreen();
+
return res;
}
diff --git a/engines/kyra/gui/gui_eob.cpp b/engines/kyra/gui/gui_eob.cpp
index 4cc75d9011..ed4c65e0f7 100644
--- a/engines/kyra/gui/gui_eob.cpp
+++ b/engines/kyra/gui/gui_eob.cpp
@@ -207,6 +207,7 @@ void EoBCoreEngine::gui_drawCharPortraitWithStats(int index, bool screenUpdt) {
gui_drawInventoryItem(27, 1, 2);
_screen->setFont(cf);
+ _screen->updateScreen();
} else {
_screen->setFont(cf);
@@ -541,7 +542,6 @@ void EoBCoreEngine::gui_drawInventoryItem(int slot, int redraw, int pageNum) {
drawItemIconShape(pageNum, item, x, y);
}
_screen->_curPage = cp;
- _screen->updateScreen();
}
void EoBCoreEngine::gui_drawCharacterStatsPage() {
@@ -1490,6 +1490,8 @@ void EoBCoreEngine::gui_processInventorySlotClick(int slot) {
setHandItem(itm);
}
+ _screen->updateScreen();
+
} else if (slot == 27) {
gui_displayMap();
@@ -1498,6 +1500,7 @@ void EoBCoreEngine::gui_processInventorySlotClick(int slot) {
_characters[_updateCharNum].inventory[slot] = ih;
gui_drawInventoryItem(slot, 1, 0);
recalcArmorClass(_updateCharNum);
+ _screen->updateScreen();
}
}
@@ -2147,10 +2150,12 @@ int GUI_EoB::simpleMenu_process(int sd, const char *const *strings, void *b, int
if (_vm->gameFlags().platform == Common::kPlatformSegaCD) {
_vm->_txt->printShadedText(strings[simpleMenu_getMenuItem(currentItem, menuItemsMask, itemOffset)], 4, (sd == 8 ? 2 : 20) + currentItem * lineH, _menuTextColor, _menuShadowColor);
_vm->_txt->printShadedText(strings[simpleMenu_getMenuItem(newItem, menuItemsMask, itemOffset)], 4, (sd == 8 ? 2 : 20) + newItem * lineH, _menuHighlightColor, _menuShadowColor);
+ _screen->sega_getRenderer()->render(0, 6, 20, 26, 5);
} else {
_screen->printText(strings[simpleMenu_getMenuItem(currentItem, menuItemsMask, itemOffset)], x, y + currentItem * lineH, _menuTextColor, 0);
_screen->printText(strings[simpleMenu_getMenuItem(newItem, menuItemsMask, itemOffset)], x, y + newItem * lineH, _menuHighlightColor, 0);
}
+ _screen->updateScreen();
}
if (result != -1) {
diff --git a/engines/kyra/sequence/sequences_darkmoon.cpp b/engines/kyra/sequence/sequences_darkmoon.cpp
index 9a1f337a29..f698def285 100644
--- a/engines/kyra/sequence/sequences_darkmoon.cpp
+++ b/engines/kyra/sequence/sequences_darkmoon.cpp
@@ -209,10 +209,8 @@ int DarkMoonEngine::mainMenuLoop() {
_gui->simpleMenu_setup(6, 0, _mainMenuStrings, -1, 0, 0, _configRenderMode == Common::kRenderCGA ? 1 : guiSettings()->colors.guiColorWhite, guiSettings()->colors.guiColorLightRed, guiSettings()->colors.guiColorBlack);
_screen->updateScreen();
- while (sel == -1 && !shouldQuit()) {
+ while (sel == -1 && !shouldQuit())
sel = _gui->simpleMenu_process(6, _mainMenuStrings, 0, -1, 0);
- _screen->updateScreen();
- }
} while ((sel < 0 || sel > 5) && !shouldQuit());
if (_flags.platform == Common::kPlatformFMTowns && sel == 2) {
@@ -229,10 +227,8 @@ void DarkMoonEngine::townsUtilitiesMenu() {
do {
_gui->simpleMenu_setup(8, 0, _utilMenuStrings, -1, 0, 0, _configRenderMode == Common::kRenderCGA ? 1 : guiSettings()->colors.guiColorWhite, guiSettings()->colors.guiColorLightRed, guiSettings()->colors.guiColorBlack);
_screen->updateScreen();
- while (sel == -1 && !shouldQuit()) {
+ while (sel == -1 && !shouldQuit())
sel = _gui->simpleMenu_process(8, _utilMenuStrings, 0, -1, 0);
- _screen->updateScreen();
- }
if (sel == 0) {
_config2431 ^= true;
sel = -1;
diff --git a/engines/kyra/sequence/sequences_eob.cpp b/engines/kyra/sequence/sequences_eob.cpp
index d0ec693ffc..fbe835999b 100644
--- a/engines/kyra/sequence/sequences_eob.cpp
+++ b/engines/kyra/sequence/sequences_eob.cpp
@@ -2281,12 +2281,8 @@ int EoBEngine::mainMenuLoop() {
_screen->sega_getRenderer()->render(0);
_screen->updateScreen();
- while (sel == -1 && !shouldQuit()) {
+ while (sel == -1 && !shouldQuit())
sel = _gui->simpleMenu_process(8, _mainMenuStrings, 0, -1, 0);
- if (_flags.platform == Common::kPlatformSegaCD)
- _screen->sega_getRenderer()->render(0, 6, 20, 26, 5);
- _screen->updateScreen();
- }
} while ((sel < 0 || sel > 5) && !shouldQuit());
return sel + 1;
diff --git a/engines/kyra/text/text_rpg.cpp b/engines/kyra/text/text_rpg.cpp
index 8ad3b5902e..f2166894af 100644
--- a/engines/kyra/text/text_rpg.cpp
+++ b/engines/kyra/text/text_rpg.cpp
@@ -196,6 +196,7 @@ void TextDisplayer_rpg::displayText(char *str, ...) {
switch (c - 1) {
case 0:
printLine(_currentLine);
+ _screen->updateScreen();
textPageBreak();
_numCharsPrinted = 0;
break;
@@ -264,6 +265,7 @@ void TextDisplayer_rpg::displayText(char *str, ...) {
printLine(_currentLine);
_screen->setFont(of);
+ _screen->updateScreen();
}
char TextDisplayer_rpg::parseCommand() {
@@ -331,6 +333,7 @@ void TextDisplayer_rpg::printLine(char *str) {
while (_textDimData[sdx].line >= lines) {
if ((lines - _waitButtonSpace) <= _lineCount && _allowPageBreak) {
_lineCount = 0;
+ _screen->updateScreen();
textPageBreak();
_numCharsPrinted = 0;
}
@@ -505,7 +508,6 @@ void TextDisplayer_rpg::printLine(char *str) {
_screen->printText(str, x1 & ~3, (y + 8) & ~7, col, 0);
} else {
_screen->printText(str, x1, y, col, _textDimData[sdx].color2);
- _screen->updateScreen();
}
_textDimData[sdx].column += lw;
Commit: 8580624c09bbbad0cb7b8e81151494b6b91211a2
https://github.com/scummvm/scummvm/commit/8580624c09bbbad0cb7b8e81151494b6b91211a2
Author: athrxx (athrxx at scummvm.org)
Date: 2021-12-05T15:13:07+01:00
Commit Message:
KYRA: (FM-Towns) - fix minor font glitch
Changed paths:
engines/kyra/graphics/screen.cpp
engines/kyra/graphics/screen.h
engines/kyra/graphics/screen_eob.h
engines/kyra/graphics/screen_eob_towns.cpp
diff --git a/engines/kyra/graphics/screen.cpp b/engines/kyra/graphics/screen.cpp
index 5dd924d9ab..5e30665365 100644
--- a/engines/kyra/graphics/screen.cpp
+++ b/engines/kyra/graphics/screen.cpp
@@ -3794,24 +3794,21 @@ void AMIGAFont::unload() {
SJISFont::SJISFont(Common::SharedPtr<Graphics::FontSJIS> &font, const uint8 invisColor, bool is16Color, bool drawOutline, int extraSpacing)
: _colorMap(0), _font(font), _invisColor(invisColor), _isTextMode(is16Color), _style(kStyleNone), _drawOutline(drawOutline), _sjisWidthOffset(extraSpacing) {
assert(_font);
- _sjisWidth = _font->getMaxFontWidth() >> 1;
- _fontHeight = _font->getFontHeight() >> 1;
- _asciiWidth = _font->getCharWidth('a') >> 1;
}
int SJISFont::getHeight() const {
- return _fontHeight;
+ return _font->getFontHeight() >> 1;
}
int SJISFont::getWidth() const {
- return _sjisWidth + _sjisWidthOffset;
+ return (_font->getMaxFontWidth() >> 1) + _sjisWidthOffset;
}
int SJISFont::getCharWidth(uint16 c) const {
if (c <= 0x7F || (c >= 0xA1 && c <= 0xDF))
- return _asciiWidth;
+ return _font->getCharWidth('a') >> 1;
else
- return _sjisWidth + _sjisWidthOffset;
+ return getWidth();
}
void SJISFont::setColorMap(const uint8 *src) {
diff --git a/engines/kyra/graphics/screen.h b/engines/kyra/graphics/screen.h
index fc0ea505bb..a66fb227d4 100644
--- a/engines/kyra/graphics/screen.h
+++ b/engines/kyra/graphics/screen.h
@@ -240,8 +240,6 @@ public:
protected:
const uint8 *_colorMap;
Common::SharedPtr<Graphics::FontSJIS> _font;
- int _sjisWidth, _asciiWidth;
- int _fontHeight;
const bool _drawOutline;
int _style;
diff --git a/engines/kyra/graphics/screen_eob.h b/engines/kyra/graphics/screen_eob.h
index 5f6ab1bd93..c0b87d9243 100644
--- a/engines/kyra/graphics/screen_eob.h
+++ b/engines/kyra/graphics/screen_eob.h
@@ -381,6 +381,10 @@ public:
SJISFontLarge(Common::SharedPtr<Graphics::FontSJIS> &font);
~SJISFontLarge() override {}
+ int getHeight() const override;
+ int getWidth() const override;
+ int getCharWidth(uint16 c) const override;
+
bool usesOverlay() const override { return false; }
void drawChar(uint16 c, byte *dst, int pitch, int) const override;
};
diff --git a/engines/kyra/graphics/screen_eob_towns.cpp b/engines/kyra/graphics/screen_eob_towns.cpp
index ce2bbe19e8..a2e9a03c47 100644
--- a/engines/kyra/graphics/screen_eob_towns.cpp
+++ b/engines/kyra/graphics/screen_eob_towns.cpp
@@ -97,9 +97,21 @@ void Screen_EoB::shadeRect(int x1, int y1, int x2, int y2, int shadingLevel) {
}
SJISFontLarge::SJISFontLarge(Common::SharedPtr<Graphics::FontSJIS> &font) : SJISFont(font, 0, false, false, 0) {
- _sjisWidth = _font->getMaxFontWidth();
- _fontHeight = _font->getFontHeight();
- _asciiWidth = _font->getCharWidth('a');
+}
+
+int SJISFontLarge::getHeight() const {
+ return _font->getFontHeight();
+}
+
+int SJISFontLarge::getWidth() const {
+ return _font->getMaxFontWidth();
+}
+
+int SJISFontLarge::getCharWidth(uint16 c) const {
+ if (c <= 0x7F || (c >= 0xA1 && c <= 0xDF))
+ return _font->getCharWidth('a');
+ else
+ return getWidth();
}
void SJISFontLarge::drawChar(uint16 c, byte *dst, int pitch, int) const {
Commit: 1b7b4b73e550d865a97f944096e3ed8332997e26
https://github.com/scummvm/scummvm/commit/1b7b4b73e550d865a97f944096e3ed8332997e26
Author: athrxx (athrxx at scummvm.org)
Date: 2021-12-05T15:13:38+01:00
Commit Message:
KYRA: (EOB/PC98) - improve final sequence (king scene) for enabled vsync option
Changed paths:
engines/kyra/sequence/sequences_eob.cpp
diff --git a/engines/kyra/sequence/sequences_eob.cpp b/engines/kyra/sequence/sequences_eob.cpp
index fbe835999b..1bfdad98c5 100644
--- a/engines/kyra/sequence/sequences_eob.cpp
+++ b/engines/kyra/sequence/sequences_eob.cpp
@@ -1411,6 +1411,8 @@ void EoBPC98FinalePlayer::king() {
static uint8 xOff[] = { 0, 48, 96, 152 };
static uint8 maxW[] = { 48, 48, 56, 48 };
+ uint32 nextScreenUpdate = _vm->_system->getMillis();
+
for (int i = 0; i < 4 && !_vm->skipFlag() && !_vm->shouldQuit(); ++i) {
const uint8 *xypos = xydata;
uint16 cx = xOff[i];
@@ -1424,14 +1426,20 @@ void EoBPC98FinalePlayer::king() {
if (col)
_screen->setPagePixel(0, cx + x + 64, y + 84, col);
if (ii % 48 == 0) {
- _screen->updateScreen();
uint32 cur = _vm->_system->getMillis();
+ if (cur >= nextScreenUpdate) {
+ _screen->updateScreen();
+ nextScreenUpdate += 16;
+ }
if (nextDelay > cur)
_vm->_system->delayMillis(nextDelay - cur);
nextDelay += 5;
}
}
- _screen->updateScreen();
+ if (_vm->_system->getMillis() >= nextScreenUpdate) {
+ _screen->updateScreen();
+ nextScreenUpdate += 16;
+ }
}
printSubtitle(_strings[5], 9, 24, 225);
Commit: 077ba2a8ae9217c7a18518a308f36042da1ca682
https://github.com/scummvm/scummvm/commit/077ba2a8ae9217c7a18518a308f36042da1ca682
Author: athrxx (athrxx at scummvm.org)
Date: 2021-12-05T15:14:10+01:00
Commit Message:
KYRA: minor metaengine fix
Changed paths:
engines/kyra/metaengine.cpp
diff --git a/engines/kyra/metaengine.cpp b/engines/kyra/metaengine.cpp
index f931ff17d1..57175bc582 100644
--- a/engines/kyra/metaengine.cpp
+++ b/engines/kyra/metaengine.cpp
@@ -212,7 +212,7 @@ SaveStateDescriptor KyraMetaEngine::querySaveMetaInfos(const char *target, int s
// The same goes for the 'Autosave', which is slot 999. Slot 0 will also
// be protected in Kyra 1-3, since it's the 'restart game' save.
desc.setWriteProtectedFlag((slot == 0 && !nonKyraGame) || slot >= 990);
- if (slot == 0 && !nonKyraGame)
+ if (slot == getAutosaveSlot())
desc.setAutosave(true);
desc.setThumbnail(header.thumbnail);
@@ -226,7 +226,7 @@ SaveStateDescriptor KyraMetaEngine::querySaveMetaInfos(const char *target, int s
// The same goes for the 'Autosave', which is slot 999. Slot 0 will also
// be protected in Kyra 1-3, since it's the 'restart game' save.
desc.setWriteProtectedFlag((slot == 0 && !nonKyraGame) || slot >= 990);
- if (slot == 0 && !nonKyraGame)
+ if (slot == getAutosaveSlot())
desc.setAutosave(true);
return desc;
More information about the Scummvm-git-logs
mailing list