[Scummvm-git-logs] scummvm master -> 76cdc468636009bd2f825270d1a1a3bb7a4288c9
mgerhardy
martin.gerhardy at gmail.com
Tue Dec 29 11:19:53 UTC 2020
This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
22edc75fbb TWINE: converted rect to Common::Rect
7c7ee66caa TWINE: replaced own implementation with fillRect
53c4643565 TWINE: replaced own blitBox implementation with blitFrom from the surface class
ec419c5fdd TWINE: const for checkClipping
76cdc46863 TWINE: fixed missing reset of background buffer
Commit: 22edc75fbb995d86c252cdb482753911ad8055a6
https://github.com/scummvm/scummvm/commit/22edc75fbb995d86c252cdb482753911ad8055a6
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2020-12-29T12:09:44+01:00
Commit Message:
TWINE: converted rect to Common::Rect
Changed paths:
engines/twine/menu/interface.cpp
engines/twine/menu/interface.h
diff --git a/engines/twine/menu/interface.cpp b/engines/twine/menu/interface.cpp
index 7b1227cd27..400682fd54 100644
--- a/engines/twine/menu/interface.cpp
+++ b/engines/twine/menu/interface.cpp
@@ -241,17 +241,11 @@ void Interface::setClip(const Common::Rect &rect) {
}
void Interface::saveClip() {
- textWindowLeftSave = textWindow.left;
- textWindowTopSave = textWindow.top;
- textWindowRightSave = textWindow.right;
- textWindowBottomSave = textWindow.bottom;
+ textWindowSave = textWindow;
}
void Interface::loadClip() {
- textWindow.left = textWindowLeftSave;
- textWindow.top = textWindowTopSave;
- textWindow.right = textWindowRightSave;
- textWindow.bottom = textWindowBottomSave;
+ textWindow = textWindowSave;
}
void Interface::resetClip() {
diff --git a/engines/twine/menu/interface.h b/engines/twine/menu/interface.h
index ae2eba62cb..faddcb42c8 100644
--- a/engines/twine/menu/interface.h
+++ b/engines/twine/menu/interface.h
@@ -47,10 +47,7 @@ class Interface {
private:
TwinEEngine *_engine;
int32 checkClipping(int32 x, int32 y);
- int32 textWindowTopSave = 0;
- int32 textWindowLeftSave = 0;
- int32 textWindowRightSave = 0;
- int32 textWindowBottomSave = 0;
+ Common::Rect textWindowSave;
public:
Interface(TwinEEngine *engine);
Commit: 7c7ee66caa8c6ec415ec7a1d450ed9b4424f2e0b
https://github.com/scummvm/scummvm/commit/7c7ee66caa8c6ec415ec7a1d450ed9b4424f2e0b
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2020-12-29T12:09:44+01:00
Commit Message:
TWINE: replaced own implementation with fillRect
Changed paths:
engines/twine/menu/interface.cpp
diff --git a/engines/twine/menu/interface.cpp b/engines/twine/menu/interface.cpp
index 400682fd54..84774f00b7 100644
--- a/engines/twine/menu/interface.cpp
+++ b/engines/twine/menu/interface.cpp
@@ -208,29 +208,7 @@ void Interface::drawTransparentBox(const Common::Rect &rect, int32 colorAdj) {
}
void Interface::drawSplittedBox(const Common::Rect &rect, uint8 colorIndex) {
- const int32 left = MAX((int32)SCREEN_TEXTLIMIT_LEFT, (int32)rect.left);
- const int32 top = MAX((int32)SCREEN_TEXTLIMIT_TOP, (int32)rect.top);
- const int32 right = MIN((int32)SCREEN_TEXTLIMIT_RIGHT, (int32)rect.right);
- const int32 bottom = MIN((int32)SCREEN_TEXTLIMIT_BOTTOM, (int32)rect.bottom);
-
- if (left > SCREEN_TEXTLIMIT_RIGHT) {
- return;
- }
- if (right < SCREEN_TEXTLIMIT_LEFT) {
- return;
- }
- if (top > SCREEN_TEXTLIMIT_BOTTOM) {
- return;
- }
- if (bottom < SCREEN_TEXTLIMIT_TOP) {
- return;
- }
-
- uint8 *ptr = (uint8*)_engine->frontVideoBuffer.getBasePtr(left, top);
- for (int32 y = top; y < bottom; y++) {
- memset(ptr, colorIndex, right - left);
- ptr += SCREEN_WIDTH;
- }
+ _engine->frontVideoBuffer.fillRect(rect, colorIndex);
}
void Interface::setClip(const Common::Rect &rect) {
Commit: 53c4643565b5f7edc2a890498fd64af4c27ba3a9
https://github.com/scummvm/scummvm/commit/53c4643565b5f7edc2a890498fd64af4c27ba3a9
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2020-12-29T12:09:44+01:00
Commit Message:
TWINE: replaced own blitBox implementation with blitFrom from the surface class
Changed paths:
engines/twine/menu/interface.cpp
diff --git a/engines/twine/menu/interface.cpp b/engines/twine/menu/interface.cpp
index 84774f00b7..7c8f692582 100644
--- a/engines/twine/menu/interface.cpp
+++ b/engines/twine/menu/interface.cpp
@@ -139,37 +139,8 @@ void Interface::drawLine(int32 startWidth, int32 startHeight, int32 endWidth, in
}
}
-// TODO: this should get replaced by the surface blitting functions
void Interface::blitBox(const Common::Rect &rect, const Graphics::ManagedSurface &source, Graphics::ManagedSurface &dest) {
- const int32 left = MAX((int32)SCREEN_TEXTLIMIT_LEFT, (int32)rect.left);
- const int32 top = MAX((int32)SCREEN_TEXTLIMIT_TOP, (int32)rect.top);
- const int32 right = MIN((int32)SCREEN_TEXTLIMIT_RIGHT, (int32)rect.right);
- const int32 bottom = MIN((int32)SCREEN_TEXTLIMIT_BOTTOM, (int32)rect.bottom);
-
- if (left > SCREEN_TEXTLIMIT_RIGHT) {
- return;
- }
- if (right < SCREEN_TEXTLIMIT_LEFT) {
- return;
- }
- if (top > SCREEN_TEXTLIMIT_BOTTOM) {
- return;
- }
- if (bottom < SCREEN_TEXTLIMIT_TOP) {
- return;
- }
-
- const int8 *s = (const int8 *)source.getBasePtr(left, top);
- int8 *d = (int8 *)dest.getBasePtr(left, top);
-
- const int32 width = right - left + 1;
- const int32 height = bottom - top + 1;
-
- for (int32 j = 0; j < height; j++) {
- memcpy(d, s, width);
- d += SCREEN_WIDTH;
- s += SCREEN_WIDTH;
- }
+ dest.blitFrom(source, rect, Common::Point(rect.left, rect.top));
}
void Interface::drawTransparentBox(const Common::Rect &rect, int32 colorAdj) {
@@ -203,7 +174,7 @@ void Interface::drawTransparentBox(const Common::Rect &rect, int32 colorAdj) {
pos[x] = color + color2;
}
}
- pos += SCREEN_WIDTH;
+ pos += _engine->frontVideoBuffer.pitch;
}
}
Commit: ec419c5fdd006eb0734733d560ac7bd7c6531d4c
https://github.com/scummvm/scummvm/commit/ec419c5fdd006eb0734733d560ac7bd7c6531d4c
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2020-12-29T12:09:44+01:00
Commit Message:
TWINE: const for checkClipping
Changed paths:
engines/twine/menu/interface.cpp
engines/twine/menu/interface.h
diff --git a/engines/twine/menu/interface.cpp b/engines/twine/menu/interface.cpp
index 7c8f692582..5a84bbaedb 100644
--- a/engines/twine/menu/interface.cpp
+++ b/engines/twine/menu/interface.cpp
@@ -34,7 +34,7 @@ const int32 RIGHT = 2; // 0010
const int32 TOP = 4; // 0100
const int32 BOTTOM = 8; // 1000
-int32 Interface::checkClipping(int32 x, int32 y) {
+int32 Interface::checkClipping(int32 x, int32 y) const {
int32 code = INSIDE;
if (x < textWindow.left) {
code |= LEFT;
diff --git a/engines/twine/menu/interface.h b/engines/twine/menu/interface.h
index faddcb42c8..6406552777 100644
--- a/engines/twine/menu/interface.h
+++ b/engines/twine/menu/interface.h
@@ -46,7 +46,7 @@ class TwinEEngine;
class Interface {
private:
TwinEEngine *_engine;
- int32 checkClipping(int32 x, int32 y);
+ int32 checkClipping(int32 x, int32 y) const;
Common::Rect textWindowSave;
public:
Commit: 76cdc468636009bd2f825270d1a1a3bb7a4288c9
https://github.com/scummvm/scummvm/commit/76cdc468636009bd2f825270d1a1a3bb7a4288c9
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2020-12-29T12:18:48+01:00
Commit Message:
TWINE: fixed missing reset of background buffer
regression introduced in 725f75d4afb77831ba4ba5d75cb8ea0dd4c91174
Changed paths:
engines/twine/renderer/screens.cpp
diff --git a/engines/twine/renderer/screens.cpp b/engines/twine/renderer/screens.cpp
index 6f3ed9a4f9..a9ced435c7 100644
--- a/engines/twine/renderer/screens.cpp
+++ b/engines/twine/renderer/screens.cpp
@@ -39,6 +39,7 @@ bool Screens::adelineLogo() {
void Screens::loadMenuImage(bool fadeIn) {
loadImage(RESSHQR_MENUIMG, -1, fadeIn);
+ _engine->workVideoBuffer.blitFrom(_engine->frontVideoBuffer);
}
void Screens::loadCustomPalette(int32 index) {
More information about the Scummvm-git-logs
mailing list