[Scummvm-git-logs] scummvm master -> 289171b8d9add844d5a11f390deeb806995da773
yuv422
yuv422 at users.noreply.github.com
Fri Feb 28 01:13:43 UTC 2020
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
289171b8d9 DRAGONS: Fixed background color on text. Fixed font layer draw priority
Commit: 289171b8d9add844d5a11f390deeb806995da773
https://github.com/scummvm/scummvm/commit/289171b8d9add844d5a11f390deeb806995da773
Author: Eric Fry (yuv422 at users.noreply.github.com)
Date: 2020-02-28T12:07:49+11:00
Commit Message:
DRAGONS: Fixed background color on text. Fixed font layer draw priority
Changed paths:
engines/dragons/font.cpp
engines/dragons/scene.cpp
diff --git a/engines/dragons/font.cpp b/engines/dragons/font.cpp
index f59a0da2f3..5aa331b2e4 100644
--- a/engines/dragons/font.cpp
+++ b/engines/dragons/font.cpp
@@ -69,14 +69,13 @@ Graphics::Surface *Font::render(uint16 *text, uint16 length) {
}
void Font::renderToSurface(Graphics::Surface *surface, int16 x, int16 y, uint16 *text, uint16 length) {
- if (x < 0 || y < 0 || x + length * 8 >= DRAGONS_SCREEN_WIDTH || y + 8 >= DRAGONS_SCREEN_HEIGHT) {
+ if (x < 0 || y < 0 || x + length * 8 > surface->w || y + 8 > surface->h) {
return;
}
byte *startPixelOffset = (byte *)surface->getPixels() + y * surface->pitch + x * surface->format.bytesPerPixel;
for (int i = 0; i < length; i++) {
byte *pixels = startPixelOffset;
pixels += i * 8;
-// debug("char: %d size: %d %d", (text[i] - 0x20), _numChars, (30 + i));
byte *data = _pixels + mapChar(text[i]) * 64;
for (int j = 0; j < 8; j++) {
memcpy(pixels, data, 8);
@@ -170,7 +169,7 @@ void FontManager::updatePalette() {
uint16 *palette_f2_font_maybe = (uint16 *)_screen->getPalette(2);
uint16 cursor3 = 0x14a5 | 0x8000;
if (_vm->isFlagSet(ENGINE_FLAG_200)) {
- updatePalEntry(palette_f2_font_maybe, 1, 0);
+ updatePalEntry(palette_f2_font_maybe, 3, cursor3);
if (!_vm->isUnkFlagSet(ENGINE_UNK1_FLAG_1)) {
updatePalEntry(palette_f2_font_maybe, 16, cursor3);
} else {
diff --git a/engines/dragons/scene.cpp b/engines/dragons/scene.cpp
index 03a193aabe..a1bc2483b6 100644
--- a/engines/dragons/scene.cpp
+++ b/engines/dragons/scene.cpp
@@ -340,17 +340,24 @@ void Scene::draw() {
for (uint16 priority = 1; priority < 16; priority++) {
if (priority == 7 && _vm->isFlagSet(ENGINE_FLAG_200)) {
_vm->_fontManager->updatePalette();
+ _vm->_fontManager->draw();
}
- if (priority == _stage->getBgLayerPriority()) {
- drawBgLayer(0, rect, _stage->getBgLayer());
- } else if (priority == _stage->getMgLayerPriority()) {
- drawBgLayer(1, rect, _stage->getMgLayer());
- } else if (priority == _stage->getFgLayerPriority()) {
- drawBgLayer(2, rect, _stage->getFgLayer());
- } else if (priority == 5) {
- if (_vm->isFlagSet(ENGINE_FLAG_80)) {
- _vm->_inventory->draw();
+ if (_vm->isFlagSet(ENGINE_FLAG_200)) {
+ if (priority == 5) {
+ if (_vm->isFlagSet(ENGINE_FLAG_80)) {
+ _vm->_inventory->draw();
+ }
+ }
+
+ if (priority == _stage->getFgLayerPriority()) {
+ drawBgLayer(2, rect, _stage->getFgLayer());
+ }
+ if (priority == _stage->getMgLayerPriority()) {
+ drawBgLayer(1, rect, _stage->getMgLayer());
+ }
+ if (priority == _stage->getBgLayerPriority()) {
+ drawBgLayer(0, rect, _stage->getBgLayer());
}
}
@@ -386,7 +393,6 @@ void Scene::draw() {
}
}
}
- _vm->_fontManager->draw();
if (_vm->_credits->isRunning()) {
_vm->_credits->draw();
}
More information about the Scummvm-git-logs
mailing list