aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 {