[Scummvm-git-logs] scummvm master -> b86eb04917c7c87da60b08dbd4d68a707d0bb322
lephilousophe
noreply at scummvm.org
Sun Jan 4 14:35:52 UTC 2026
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
b86eb04917 ULTIMA: Fix build
Commit: b86eb04917c7c87da60b08dbd4d68a707d0bb322
https://github.com/scummvm/scummvm/commit/b86eb04917c7c87da60b08dbd4d68a707d0bb322
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2026-01-04T15:35:35+01:00
Commit Message:
ULTIMA: Fix build
CHAR_WIDTH is defined by limits.h as the bitwidth of a char.
Also fix a member variable shadowing warning.
Changed paths:
engines/ultima/ultima0/gfx/font.cpp
engines/ultima/ultima0/gfx/font.h
engines/ultima/ultima0/gfx/gfx_surface.cpp
engines/ultima/ultima0/views/acknowledgements.cpp
engines/ultima/ultima0/views/dead.cpp
engines/ultima/ultima0/views/dungeon.cpp
engines/ultima/ultima0/views/status.cpp
engines/ultima/ultima0/views/world_map.cpp
diff --git a/engines/ultima/ultima0/gfx/font.cpp b/engines/ultima/ultima0/gfx/font.cpp
index eb90c5a9690..526aa671b20 100644
--- a/engines/ultima/ultima0/gfx/font.cpp
+++ b/engines/ultima/ultima0/gfx/font.cpp
@@ -169,7 +169,7 @@ void Font::writeChar(Graphics::ManagedSurface *dst, uint32 chr,
const byte *GfxData = FONT1 + chr * 8;
Graphics::Surface charArea = dst->getSubArea(Common::Rect(textPos.x, textPos.y,
- textPos.x + CHAR_WIDTH, textPos.y + CHAR_HEIGHT));
+ textPos.x + GLYPH_WIDTH, textPos.y + GLYPH_HEIGHT));
const int w = 1;
const int h = 1;
diff --git a/engines/ultima/ultima0/gfx/font.h b/engines/ultima/ultima0/gfx/font.h
index 233137454e2..d5f80b005e9 100644
--- a/engines/ultima/ultima0/gfx/font.h
+++ b/engines/ultima/ultima0/gfx/font.h
@@ -30,17 +30,17 @@ namespace Ultima {
namespace Ultima0 {
namespace Gfx {
-constexpr int CHAR_HEIGHT = 16;
-constexpr int CHAR_WIDTH = 16;
-constexpr int TEXT_WIDTH = DEFAULT_SCX / CHAR_WIDTH;
-constexpr int TEXT_HEIGHT = DEFAULT_SCY / CHAR_HEIGHT;
+constexpr int GLYPH_HEIGHT = 16;
+constexpr int GLYPH_WIDTH = 16;
+constexpr int TEXT_WIDTH = DEFAULT_SCX / GLYPH_WIDTH;
+constexpr int TEXT_HEIGHT = DEFAULT_SCY / GLYPH_HEIGHT;
class TextRect : public ::Common::Rect {
public:
TextRect() : ::Common::Rect() {}
- TextRect(int left, int top, int right, int bottom) :
- ::Common::Rect(left * CHAR_WIDTH, top * CHAR_HEIGHT,
- (right + 1) * CHAR_WIDTH, (bottom + 1) * CHAR_HEIGHT) {}
+ TextRect(int left_, int top_, int right_, int bottom_) :
+ ::Common::Rect(left_ * GLYPH_WIDTH, top_ * GLYPH_HEIGHT,
+ (right_ + 1) * GLYPH_WIDTH, (bottom_ + 1) * GLYPH_HEIGHT) {}
};
class Font {
diff --git a/engines/ultima/ultima0/gfx/gfx_surface.cpp b/engines/ultima/ultima0/gfx/gfx_surface.cpp
index d4ba51cca71..ffcaa3243fb 100644
--- a/engines/ultima/ultima0/gfx/gfx_surface.cpp
+++ b/engines/ultima/ultima0/gfx/gfx_surface.cpp
@@ -64,8 +64,8 @@ void GfxSurface::writeString(const Common::String &str, Graphics::TextAlign alig
void GfxSurface::writeChar(uint32 chr) {
if (chr >= ' ') {
- Font::writeChar(this, chr, Common::Point(_textPos.x * CHAR_WIDTH,
- _textPos.y * CHAR_HEIGHT), _textColor);
+ Font::writeChar(this, chr, Common::Point(_textPos.x * GLYPH_WIDTH,
+ _textPos.y * GLYPH_HEIGHT), _textColor);
++_textPos.x;
}
@@ -82,9 +82,9 @@ void GfxSurface::newLine() {
_textPos.y = TEXT_HEIGHT - 1;
// Scroll the screen contents up
- blitFrom(*this, Common::Rect(0, CHAR_HEIGHT, DEFAULT_SCX, DEFAULT_SCY),
+ blitFrom(*this, Common::Rect(0, GLYPH_HEIGHT, DEFAULT_SCX, DEFAULT_SCY),
Common::Point(0, 0));
- fillRect(Common::Rect(0, DEFAULT_SCX - CHAR_HEIGHT, DEFAULT_SCX, DEFAULT_SCY), 0);
+ fillRect(Common::Rect(0, DEFAULT_SCX - GLYPH_HEIGHT, DEFAULT_SCX, DEFAULT_SCY), 0);
}
}
diff --git a/engines/ultima/ultima0/views/acknowledgements.cpp b/engines/ultima/ultima0/views/acknowledgements.cpp
index 79d9f787e48..9ea11f9479d 100644
--- a/engines/ultima/ultima0/views/acknowledgements.cpp
+++ b/engines/ultima/ultima0/views/acknowledgements.cpp
@@ -76,7 +76,7 @@ bool Acknowledgements::msgFocus(const FocusMessage &msg) {
s.clear();
// Create a buffer for rendering new lines
- _pendingLine.create(s.w, Gfx::CHAR_HEIGHT);
+ _pendingLine.create(s.w, Gfx::GLYPH_HEIGHT);
return true;
}
@@ -88,12 +88,12 @@ void Acknowledgements::draw() {
s.blitFrom(s, Common::Rect(0, 1, s.w, s.h), Common::Point(0, 0));
s.blitFrom(_pendingLine, Common::Rect(0, 0, _pendingLine.w, 1),
Common::Point(0, s.h - 1));
- _pendingLine.blitFrom(_pendingLine, Common::Rect(0, 1, s.w, Gfx::CHAR_HEIGHT),
+ _pendingLine.blitFrom(_pendingLine, Common::Rect(0, 1, s.w, Gfx::GLYPH_HEIGHT),
Common::Point(0, 0));
}
bool Acknowledgements::tick() {
- _ctr = (_ctr + 1) % Gfx::CHAR_HEIGHT;
+ _ctr = (_ctr + 1) % Gfx::GLYPH_HEIGHT;
if (_ctr == 0) {
if (_lines.empty()) {
showTitle();
diff --git a/engines/ultima/ultima0/views/dead.cpp b/engines/ultima/ultima0/views/dead.cpp
index 06fd830639f..e2cf7a9b13e 100644
--- a/engines/ultima/ultima0/views/dead.cpp
+++ b/engines/ultima/ultima0/views/dead.cpp
@@ -28,7 +28,7 @@ namespace Ultima0 {
namespace Views {
Dead::Dead() : View("Dead") {
- setBounds(Common::Rect(0, DEFAULT_SCY - 4 * Gfx::CHAR_HEIGHT, DEFAULT_SCX, DEFAULT_SCY));
+ setBounds(Common::Rect(0, DEFAULT_SCY - 4 * Gfx::GLYPH_HEIGHT, DEFAULT_SCX, DEFAULT_SCY));
}
void Dead::draw() {
diff --git a/engines/ultima/ultima0/views/dungeon.cpp b/engines/ultima/ultima0/views/dungeon.cpp
index 520a8909168..65a5ad1f5a1 100644
--- a/engines/ultima/ultima0/views/dungeon.cpp
+++ b/engines/ultima/ultima0/views/dungeon.cpp
@@ -54,7 +54,7 @@ void Dungeon::draw() {
s.clear();
// Draw the dungeon view
- Graphics::ManagedSurface dungArea(s, Common::Rect(0, 0, s.w, s.h - Gfx::CHAR_HEIGHT * 4));
+ Graphics::ManagedSurface dungArea(s, Common::Rect(0, 0, s.w, s.h - Gfx::GLYPH_HEIGHT * 4));
Gfx::Dungeon::draw(&dungArea);
// Allow the status area to draw
diff --git a/engines/ultima/ultima0/views/status.cpp b/engines/ultima/ultima0/views/status.cpp
index 76321f44027..f2b12529185 100644
--- a/engines/ultima/ultima0/views/status.cpp
+++ b/engines/ultima/ultima0/views/status.cpp
@@ -27,7 +27,7 @@ namespace Ultima0 {
namespace Views {
Status::Status(const Common::String &name, UIElement *parent) : View(name, parent) {
- setBounds(Common::Rect(0, DEFAULT_SCY - 4 * Gfx::CHAR_HEIGHT, DEFAULT_SCX, DEFAULT_SCY));
+ setBounds(Common::Rect(0, DEFAULT_SCY - 4 * Gfx::GLYPH_HEIGHT, DEFAULT_SCX, DEFAULT_SCY));
}
bool Status::msgFocus(const FocusMessage &msg) {
diff --git a/engines/ultima/ultima0/views/world_map.cpp b/engines/ultima/ultima0/views/world_map.cpp
index 36c6179e911..b108b643d14 100644
--- a/engines/ultima/ultima0/views/world_map.cpp
+++ b/engines/ultima/ultima0/views/world_map.cpp
@@ -51,7 +51,7 @@ void WorldMap::draw() {
auto s = getSurface();
// Draw the map
- Graphics::ManagedSurface mapArea(s, Common::Rect(0, 0, s.w, s.h - Gfx::CHAR_HEIGHT * 4));
+ Graphics::ManagedSurface mapArea(s, Common::Rect(0, 0, s.w, s.h - Gfx::GLYPH_HEIGHT * 4));
Gfx::Map::draw(&mapArea);
// Allow the status area to draw
More information about the Scummvm-git-logs
mailing list