aboutsummaryrefslogtreecommitdiff
path: root/engines/macventure
diff options
context:
space:
mode:
authorBorja Lorente2016-08-19 16:56:44 +0200
committerBorja Lorente2016-08-19 16:56:44 +0200
commitd1ce6793fa7f46935709d4bf7f84d0b13c535193 (patch)
tree4ca2828d6bf781580fda06175afdaf4dbd7a79d4 /engines/macventure
parentb884e6e29f26018f01cbaec5731e7a06f0b10d6e (diff)
downloadscummvm-rg350-d1ce6793fa7f46935709d4bf7f84d0b13c535193.tar.gz
scummvm-rg350-d1ce6793fa7f46935709d4bf7f84d0b13c535193.tar.bz2
scummvm-rg350-d1ce6793fa7f46935709d4bf7f84d0b13c535193.zip
MACVENTURE: Add static array for border names
Diffstat (limited to 'engines/macventure')
-rw-r--r--engines/macventure/datafiles.cpp55
-rw-r--r--engines/macventure/windows.h3
2 files changed, 30 insertions, 28 deletions
diff --git a/engines/macventure/datafiles.cpp b/engines/macventure/datafiles.cpp
index aa47869bcd..d41aa99d4c 100644
--- a/engines/macventure/datafiles.cpp
+++ b/engines/macventure/datafiles.cpp
@@ -32,34 +32,35 @@ namespace MacVenture {
#define MACVENTURE_DATA_BUNDLE Common::String("macventure.zip")
+struct BorderName {
+ MVWindowType type;
+ const char *name;
+};
+
+static const BorderName g_borderNames[] = {
+ {kDocument, "Document"},
+ {kDBox, "DBox"},
+ {kPlainDBox, "PlainDBox"},
+ {kAltBox, "AltBox"},
+ {kNoGrowDoc, "NoGrowDoc"},
+ {kMovableDBox, "MovableDBox"},
+ {kZoomDoc, "ZoomDoc"},
+ {kZoomNoGrow, "ZoomNoGrow"},
+ {kInvWindow, "InvWindow"},
+ {kRDoc16, "RDoc16"},
+ {kRDoc4, "RDoc4"},
+ {kRDoc6, "RDoc6"},
+ {kRDoc10, "RDoc10"},
+ {kNoType, "No type"}
+};
+
Common::String windowTypeName(MVWindowType windowType) {
- switch (windowType) {
- case kDocument:
- return "Document";
- case kDBox:
- return "DBox";
- case kPlainDBox:
- return "PlainDBox";
- case kAltBox:
- return "AltBox";
- case kNoGrowDoc:
- return "NoGrowDoc";
- case kMovableDBox:
- return "MovableDBox";
- case kZoomDoc:
- return "ZoomDoc";
- case kZoomNoGrow:
- return "ZoomNoGrow";
- case kInvWindow:
- return "InvWindow";
- case kRDoc16:
- return "RDoc16";
- case kRDoc4:
- return "RDoc4";
- case kRDoc6:
- return "RDoc6";
- case kRDoc10:
- return "RDoc10";
+ int i = 0;
+ while (g_borderNames[i].type != kNoType) {
+ i++;
+ if (g_borderNames[i].type == windowType) {
+ return g_borderNames[i].name;
+ }
}
return "";
}
diff --git a/engines/macventure/windows.h b/engines/macventure/windows.h
index 1727698ad4..fd3acefa7b 100644
--- a/engines/macventure/windows.h
+++ b/engines/macventure/windows.h
@@ -55,7 +55,8 @@ enum MVWindowType {
kRDoc16 = 0x10,
kRDoc4 = 0x12,
kRDoc6 = 0x14,
- kRDoc10 = 0x16
+ kRDoc10 = 0x16,
+ kNoType = 0xFF
};
struct DrawableObject {