[Scummvm-git-logs] scummvm master -> 3a1205df71f9bdcd2d3beac97c6b07a752d4d3cb
digitall
noreply at scummvm.org
Sun Jul 9 02:41:19 UTC 2023
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:
3a1205df71 WATCHMAKER: Further Fixes for GCC Compiler Warnings
Commit: 3a1205df71f9bdcd2d3beac97c6b07a752d4d3cb
https://github.com/scummvm/scummvm/commit/3a1205df71f9bdcd2d3beac97c6b07a752d4d3cb
Author: D G Turner (digitall at scummvm.org)
Date: 2023-07-09T03:41:07+01:00
Commit Message:
WATCHMAKER: Further Fixes for GCC Compiler Warnings
Changed paths:
engines/watchmaker/fonts.h
engines/watchmaker/struct.h
engines/watchmaker/sysdef.h
engines/watchmaker/t2d/t2d_internal.h
diff --git a/engines/watchmaker/fonts.h b/engines/watchmaker/fonts.h
index 34202fa229c..5d742dcc92c 100644
--- a/engines/watchmaker/fonts.h
+++ b/engines/watchmaker/fonts.h
@@ -28,12 +28,6 @@
namespace Watchmaker {
-enum class FontKind {
- Standard,
- Computer,
- PDA
-};
-
struct SFont {
uint16 *table = nullptr;
int32 color[MAX_FONT_COLORS] = {};
diff --git a/engines/watchmaker/struct.h b/engines/watchmaker/struct.h
index 7fffaae4b3e..6674b5c962a 100644
--- a/engines/watchmaker/struct.h
+++ b/engines/watchmaker/struct.h
@@ -458,18 +458,28 @@ struct SDDBitmap {
}
};
-enum class FontKind;
struct SDDText {
- SDDText() = default;
+ SDDText() {
+ reset();
+ }
+
SDDText(const char *_text, FontKind _font, FontColor _color, int32 _tnum) : font(_font),
color(_color),
tnum(_tnum) {
Common::strlcpy(this->text, _text, sizeof(this->text));
}
- char text[MAX_STRING_LEN] = {};
- FontKind font; // TODO: Move elsewhere so we can initalize
+
+ void reset() {
+ for(uint i = 0; i < ARRAYSIZE(text); i++) text[i] = '\0';
+ font = FontKind::Standard;
+ color = FontColor::WHITE_FONT;
+ tnum = 0;
+ }
+
+ char text[MAX_STRING_LEN];
+ FontKind font;
FontColor color;
- int32 tnum = 0;
+ int32 tnum;
};
struct SScript {
diff --git a/engines/watchmaker/sysdef.h b/engines/watchmaker/sysdef.h
index 97cb7735bc9..494f9c6a68c 100644
--- a/engines/watchmaker/sysdef.h
+++ b/engines/watchmaker/sysdef.h
@@ -164,6 +164,12 @@ enum FontColor {
MAX_FONT_COLORS = 9
};
+enum class FontKind {
+ Standard,
+ Computer,
+ PDA
+};
+
#define MAX_GOPHERS 3
} // End of namespace Watchmaker
diff --git a/engines/watchmaker/t2d/t2d_internal.h b/engines/watchmaker/t2d/t2d_internal.h
index cc1de94faa5..e9d5adce279 100644
--- a/engines/watchmaker/t2d/t2d_internal.h
+++ b/engines/watchmaker/t2d/t2d_internal.h
@@ -499,18 +499,42 @@
namespace Watchmaker {
struct t2dBUTTON {
- uint8 on = 0; // on/off
+ uint8 on; // on/off
struct SRect lim; // limiti del bottone
- int32 tnum = 0; // numero bitmap col tooltip
+ int32 tnum; // numero bitmap col tooltip
+
+ t2dBUTTON() {
+ reset();
+ }
+
+ void reset() {
+ on = 0;
+ lim.reset();
+ tnum = 0;
+ }
};
struct t2dWINDOW {
- int32 px = 0, py = 0; // poszione finestra
- int32 sy = 0; // scroll interno finestra
- struct SDDBitmap bm[T2D_MAX_BITMAPS_IN_WIN] = {}; // bitmaps ordinate
- struct SDDText text[T2D_MAX_TEXTS_IN_WIN] = {}; // testi
- t2dBUTTON bt[T2D_MAX_BUTTONS_IN_WIN] = {}; // bottoni ordinati
- bool NOTSTRETCHED = false;
+ int32 px, py; // poszione finestra
+ int32 sy; // scroll interno finestra
+ struct SDDBitmap bm[T2D_MAX_BITMAPS_IN_WIN]; // bitmaps ordinate
+ struct SDDText text[T2D_MAX_TEXTS_IN_WIN]; // testi
+ t2dBUTTON bt[T2D_MAX_BUTTONS_IN_WIN]; // bottoni ordinati
+ bool NOTSTRETCHED;
+
+ t2dWINDOW() {
+ reset();
+ }
+
+ void reset() {
+ px = 0;
+ py = 0;
+ sy = 0;
+ for (uint i = 0; i < ARRAYSIZE(bm); i++) bm[i].reset();
+ for (uint i = 0; i < ARRAYSIZE(text); i++) text[i].reset();
+ for (uint i = 0; i < ARRAYSIZE(bt); i++) bt[i].reset();
+ NOTSTRETCHED = false;
+ }
};
struct PDALogS {
More information about the Scummvm-git-logs
mailing list