From 9959d8888c5739d6668778b485ae6c0258993ae1 Mon Sep 17 00:00:00 2001 From: Sc0rch Date: Fri, 18 Nov 2011 06:28:11 +0000 Subject: [PATCH] MapRender: First release (FormEditorCommon, FormEditorProperties, Map, MapBG, MapCommon, MapEditor, MapRenderTest. git-svn-id: svn://ultimatepp.org/upp/trunk@4180 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- bazaar/FormEditorCommon/FormEditorCommon.h | 9 + bazaar/FormEditorCommon/FormEditorCommon.upp | 18 + bazaar/FormEditorCommon/IHistory.h | 51 + bazaar/FormEditorCommon/IPartBase.h | 17 + bazaar/FormEditorCommon/Logger.h | 54 + bazaar/FormEditorCommon/MenuBarEx.cpp | 17 + bazaar/FormEditorCommon/MenuBarEx.h | 33 + bazaar/FormEditorCommon/Utils.h | 48 + bazaar/FormEditorCommon/hypercall.h | 250 ++++ bazaar/FormEditorCommon/init | 4 + bazaar/FormEditorProperties/Common.h | 74 ++ .../FormEditorProperties.h | 8 + .../FormEditorProperties.icpp | 4 + .../FormEditorProperties.lay | 6 + .../FormEditorProperties.t | 34 + .../FormEditorProperties.upp | 25 + bazaar/FormEditorProperties/Properties.h | 81 ++ .../FormEditorProperties/PropertiesEditor.h | 204 ++++ bazaar/FormEditorProperties/PropertiesMacro.h | 65 + bazaar/FormEditorProperties/Property.cpp | 57 + bazaar/FormEditorProperties/Property.h | 44 + bazaar/FormEditorProperties/PropertyCaller.h | 35 + bazaar/FormEditorProperties/PropertyEdits.cpp | 230 ++++ bazaar/FormEditorProperties/PropertyEdits.h | 205 ++++ bazaar/FormEditorProperties/init | 9 + bazaar/Map/Map.h | 7 + bazaar/Map/Map.icpp | 4 + bazaar/Map/Map.t | 157 +++ bazaar/Map/Map.upp | 29 + bazaar/Map/MapCtrl.iml | 9 + bazaar/Map/MapEvents.cpp | 253 ++++ bazaar/Map/MapLayer.iml | 9 + bazaar/Map/MapLevel.cpp | 54 + bazaar/Map/MapLevel.h | 199 +++ bazaar/Map/MapLevel.iml | 57 + bazaar/Map/MapNavigation.cpp | 260 ++++ bazaar/Map/MapRender.cpp | 51 + bazaar/Map/MapRenderInfo.cpp | 52 + bazaar/Map/MapSerialize.h | 413 +++++++ bazaar/Map/MapView.cpp | 316 +++++ bazaar/Map/MapView.h | 98 ++ bazaar/Map/MapView.iml | 1066 +++++++++++++++++ bazaar/Map/MapView.lay | 15 + bazaar/Map/MapViewEvents.cpp | 89 ++ bazaar/Map/MapViewSearch.cpp | 27 + bazaar/Map/init | 9 + bazaar/MapBG/FileUtils.h | 91 ++ bazaar/MapBG/MapBG.cpp | 119 ++ bazaar/MapBG/MapBG.h | 39 + bazaar/MapBG/MapBG.upp | 15 + bazaar/MapBG/MipMap.cpp | 37 + bazaar/MapBG/MipMap.h | 161 +++ bazaar/MapBG/MipMapGen.cpp | 217 ++++ bazaar/MapBG/MipMapGen.h | 9 + bazaar/MapBG/init | 6 + bazaar/MapCommon/ButtonItem.cpp | 51 + bazaar/MapCommon/ButtonItem.h | 32 + bazaar/MapCommon/ButtonItemEvents.cpp | 18 + bazaar/MapCommon/IMapEvent.h | 28 + bazaar/MapCommon/IMapItem.cpp | 34 + bazaar/MapCommon/IMapItem.h | 84 ++ bazaar/MapCommon/IMapItemState.cpp | 81 ++ bazaar/MapCommon/IMapRender.cpp | 121 ++ bazaar/MapCommon/IMapRender.h | 118 ++ bazaar/MapCommon/IMapRenderEvents.cpp | 133 ++ bazaar/MapCommon/IMapRenderInfo.h | 27 + bazaar/MapCommon/IMapRenderStates.cpp | 30 + bazaar/MapCommon/MapCommon.h | 9 + bazaar/MapCommon/MapCommon.upp | 25 + bazaar/MapCommon/PolygonItem.cpp | 126 ++ bazaar/MapCommon/PolygonItem.h | 45 + bazaar/MapCommon/PolygonItemEvents.cpp | 43 + bazaar/MapCommon/init | 5 + bazaar/MapEditor/LevelEditor.cpp | 142 +++ bazaar/MapEditor/LevelEditor.h | 44 + bazaar/MapEditor/LevelEditorItem.cpp | 110 ++ bazaar/MapEditor/LevelEditorLayer.cpp | 41 + bazaar/MapEditor/LevelEditorTools.cpp | 18 + bazaar/MapEditor/MapEditor.cpp | 76 ++ bazaar/MapEditor/MapEditor.h | 48 + bazaar/MapEditor/MapEditor.iml | 9 + bazaar/MapEditor/MapEditor.lay | 34 + bazaar/MapEditor/MapEditor.t | 167 +++ bazaar/MapEditor/MapEditor.upp | 24 + bazaar/MapEditor/MapEditorLang.icpp | 4 + bazaar/MapEditor/MapEditorLevel.cpp | 138 +++ bazaar/MapEditor/MapEditorMap.cpp | 95 ++ bazaar/MapEditor/init | 9 + bazaar/MapEditor/main.cpp | 8 + bazaar/MapRenderTest/MapRenderTest.upp | 10 + bazaar/MapRenderTest/init | 5 + bazaar/MapRenderTest/main.cpp | 43 + 92 files changed, 7485 insertions(+) create mode 100644 bazaar/FormEditorCommon/FormEditorCommon.h create mode 100644 bazaar/FormEditorCommon/FormEditorCommon.upp create mode 100644 bazaar/FormEditorCommon/IHistory.h create mode 100644 bazaar/FormEditorCommon/IPartBase.h create mode 100644 bazaar/FormEditorCommon/Logger.h create mode 100644 bazaar/FormEditorCommon/MenuBarEx.cpp create mode 100644 bazaar/FormEditorCommon/MenuBarEx.h create mode 100644 bazaar/FormEditorCommon/Utils.h create mode 100644 bazaar/FormEditorCommon/hypercall.h create mode 100644 bazaar/FormEditorCommon/init create mode 100644 bazaar/FormEditorProperties/Common.h create mode 100644 bazaar/FormEditorProperties/FormEditorProperties.h create mode 100644 bazaar/FormEditorProperties/FormEditorProperties.icpp create mode 100644 bazaar/FormEditorProperties/FormEditorProperties.lay create mode 100644 bazaar/FormEditorProperties/FormEditorProperties.t create mode 100644 bazaar/FormEditorProperties/FormEditorProperties.upp create mode 100644 bazaar/FormEditorProperties/Properties.h create mode 100644 bazaar/FormEditorProperties/PropertiesEditor.h create mode 100644 bazaar/FormEditorProperties/PropertiesMacro.h create mode 100644 bazaar/FormEditorProperties/Property.cpp create mode 100644 bazaar/FormEditorProperties/Property.h create mode 100644 bazaar/FormEditorProperties/PropertyCaller.h create mode 100644 bazaar/FormEditorProperties/PropertyEdits.cpp create mode 100644 bazaar/FormEditorProperties/PropertyEdits.h create mode 100644 bazaar/FormEditorProperties/init create mode 100644 bazaar/Map/Map.h create mode 100644 bazaar/Map/Map.icpp create mode 100644 bazaar/Map/Map.t create mode 100644 bazaar/Map/Map.upp create mode 100644 bazaar/Map/MapCtrl.iml create mode 100644 bazaar/Map/MapEvents.cpp create mode 100644 bazaar/Map/MapLayer.iml create mode 100644 bazaar/Map/MapLevel.cpp create mode 100644 bazaar/Map/MapLevel.h create mode 100644 bazaar/Map/MapLevel.iml create mode 100644 bazaar/Map/MapNavigation.cpp create mode 100644 bazaar/Map/MapRender.cpp create mode 100644 bazaar/Map/MapRenderInfo.cpp create mode 100644 bazaar/Map/MapSerialize.h create mode 100644 bazaar/Map/MapView.cpp create mode 100644 bazaar/Map/MapView.h create mode 100644 bazaar/Map/MapView.iml create mode 100644 bazaar/Map/MapView.lay create mode 100644 bazaar/Map/MapViewEvents.cpp create mode 100644 bazaar/Map/MapViewSearch.cpp create mode 100644 bazaar/Map/init create mode 100644 bazaar/MapBG/FileUtils.h create mode 100644 bazaar/MapBG/MapBG.cpp create mode 100644 bazaar/MapBG/MapBG.h create mode 100644 bazaar/MapBG/MapBG.upp create mode 100644 bazaar/MapBG/MipMap.cpp create mode 100644 bazaar/MapBG/MipMap.h create mode 100644 bazaar/MapBG/MipMapGen.cpp create mode 100644 bazaar/MapBG/MipMapGen.h create mode 100644 bazaar/MapBG/init create mode 100644 bazaar/MapCommon/ButtonItem.cpp create mode 100644 bazaar/MapCommon/ButtonItem.h create mode 100644 bazaar/MapCommon/ButtonItemEvents.cpp create mode 100644 bazaar/MapCommon/IMapEvent.h create mode 100644 bazaar/MapCommon/IMapItem.cpp create mode 100644 bazaar/MapCommon/IMapItem.h create mode 100644 bazaar/MapCommon/IMapItemState.cpp create mode 100644 bazaar/MapCommon/IMapRender.cpp create mode 100644 bazaar/MapCommon/IMapRender.h create mode 100644 bazaar/MapCommon/IMapRenderEvents.cpp create mode 100644 bazaar/MapCommon/IMapRenderInfo.h create mode 100644 bazaar/MapCommon/IMapRenderStates.cpp create mode 100644 bazaar/MapCommon/MapCommon.h create mode 100644 bazaar/MapCommon/MapCommon.upp create mode 100644 bazaar/MapCommon/PolygonItem.cpp create mode 100644 bazaar/MapCommon/PolygonItem.h create mode 100644 bazaar/MapCommon/PolygonItemEvents.cpp create mode 100644 bazaar/MapCommon/init create mode 100644 bazaar/MapEditor/LevelEditor.cpp create mode 100644 bazaar/MapEditor/LevelEditor.h create mode 100644 bazaar/MapEditor/LevelEditorItem.cpp create mode 100644 bazaar/MapEditor/LevelEditorLayer.cpp create mode 100644 bazaar/MapEditor/LevelEditorTools.cpp create mode 100644 bazaar/MapEditor/MapEditor.cpp create mode 100644 bazaar/MapEditor/MapEditor.h create mode 100644 bazaar/MapEditor/MapEditor.iml create mode 100644 bazaar/MapEditor/MapEditor.lay create mode 100644 bazaar/MapEditor/MapEditor.t create mode 100644 bazaar/MapEditor/MapEditor.upp create mode 100644 bazaar/MapEditor/MapEditorLang.icpp create mode 100644 bazaar/MapEditor/MapEditorLevel.cpp create mode 100644 bazaar/MapEditor/MapEditorMap.cpp create mode 100644 bazaar/MapEditor/init create mode 100644 bazaar/MapEditor/main.cpp create mode 100644 bazaar/MapRenderTest/MapRenderTest.upp create mode 100644 bazaar/MapRenderTest/init create mode 100644 bazaar/MapRenderTest/main.cpp diff --git a/bazaar/FormEditorCommon/FormEditorCommon.h b/bazaar/FormEditorCommon/FormEditorCommon.h new file mode 100644 index 000000000..6fad11b59 --- /dev/null +++ b/bazaar/FormEditorCommon/FormEditorCommon.h @@ -0,0 +1,9 @@ +#ifndef FORM_EDITOR_COMMON__FORM_EDITOR_COMMON_H +#define FORM_EDITOR_COMMON__FORM_EDITOR_COMMON_H + +#include "Logger.h" +#include "IHistory.h" +#include "IPartBase.h" +#include "MenuBarEx.h" + +#endif diff --git a/bazaar/FormEditorCommon/FormEditorCommon.upp b/bazaar/FormEditorCommon/FormEditorCommon.upp new file mode 100644 index 000000000..4e3b36998 --- /dev/null +++ b/bazaar/FormEditorCommon/FormEditorCommon.upp @@ -0,0 +1,18 @@ +uses + CtrlLib; + +file + "Hypercall Library" readonly separator, + hypercall.h, + Main readonly separator, + Utils.h, + Logger.h, + IHistory.h, + IPartBase.h, + MenuBarEx.h, + MenuBarEx.cpp, + FormEditorCommon.h; + +mainconfig + "" = "GUI SSE2"; + diff --git a/bazaar/FormEditorCommon/IHistory.h b/bazaar/FormEditorCommon/IHistory.h new file mode 100644 index 000000000..866a4e9ad --- /dev/null +++ b/bazaar/FormEditorCommon/IHistory.h @@ -0,0 +1,51 @@ +#ifndef FORM_EDITOR_COMMON__I_HISTORY_H +#define FORM_EDITOR_COMMON__I_HISTORY_H + +#include +using namespace Upp; + +class IHistoryItem +{ +public: + virtual ~IHistoryItem() {} + + virtual String SetDesc(const char* desc) { return String(); } + virtual String GetDesc() const = 0; + virtual void Undo() = 0; + virtual void Do() = 0; +}; + +// Group action +class HBatchAction : public IHistoryItem +{ + Array _Actions; + String _Desc; + +public: + virtual HBatchAction& Add(IHistoryItem* item) { _Actions.Add(item); return *this; } + virtual ~HBatchAction() + { + for (int i = 0; i < _Actions.GetCount(); ++i) + if (_Actions[i]) + delete _Actions[i]; + } + + virtual String SetDesc(const char* desc) { return _Desc = String(desc); } + virtual String GetDesc() const { return _Desc; } + + virtual void Undo() + { + for (int i = _Actions.GetCount() - 1; i >= 0; --i) + if (_Actions[i]) + _Actions[i]->Undo(); + } + + virtual void Do() + { + for (int i = 0; i < _Actions.GetCount(); ++i) + if (_Actions[i]) + _Actions[i]->Do(); + } +}; + +#endif diff --git a/bazaar/FormEditorCommon/IPartBase.h b/bazaar/FormEditorCommon/IPartBase.h new file mode 100644 index 000000000..7e1446c6f --- /dev/null +++ b/bazaar/FormEditorCommon/IPartBase.h @@ -0,0 +1,17 @@ +#ifndef FORM_EDITOR_COMMON__I_PART_BASE_H +#define FORM_EDITOR_COMMON__I_PART_BASE_H + +#include "IHistory.h" + +class IPartBase +{ +public: + virtual ~IPartBase() {} + + virtual String GetObjectClass() const { return String(); } + virtual String GetObjectWidgetClass() const { return String(); } + + virtual void AddToHistory(IHistoryItem* item) {} +}; + +#endif diff --git a/bazaar/FormEditorCommon/Logger.h b/bazaar/FormEditorCommon/Logger.h new file mode 100644 index 000000000..5f80bae3e --- /dev/null +++ b/bazaar/FormEditorCommon/Logger.h @@ -0,0 +1,54 @@ +#ifndef FORM_EDITOR_COMMON__LOGGER_H +#define FORM_EDITOR_COMMON__LOGGER_H + +#include "Utils.h" + +#define LLOG(text) ToLog(text) +#define LLOGF(text) ToLog(text, __FILE__, __LINE__, __FUNCTION__) +#define LDUMP(text) ToLog(String(#text) + " = " + AsString(text)) +#define LERROR(text) ToLog(String(t_("ERROR: ")) + text, __FILE__, __LINE__, __FUNCTION__) +#define LWARNING(text) ToLog(String(t_("WARNING: ")) + text, __FILE__, __LINE__, __FUNCTION__) + +static StaticMutex __LogMutex; +static bool __Created = false; +inline bool CreateLogFile() +{ + Mutex::Lock __(__LogMutex); + if (__Created) return true; + FileOut f; + if (!f.Open(ConfigFileEx(GetFileTitle(GetExeFilePath()) + "Log.txt"))) + { + LOG(t_("ERROR: LOG-file \"FormEditorLog.txt\" not created!")); + return false; + } + f.PutLine(t_("LOG created.")); + f.Close(); + return __Created = true; +} + +inline String ToLog(const char *text) +{ + Mutex::Lock __(__LogMutex); + CreateLogFile(); + FileAppend f; + if (!f.Open(ConfigFileEx(GetFileTitle(GetExeFilePath()) + "Log.txt"))) + return String(text); + f.PutLine(FormatTime(GetSysTime(), "DD.MM.YYYY hh:mm:ss ") + text); + f.Close(); + return String(text); +} + +inline String ToLog(const char *text, const char* file, int line, const char* method) +{ + Mutex::Lock __(__LogMutex); + CreateLogFile(); + FileAppend f; + if (!f.Open(ConfigFileEx(GetFileTitle(GetExeFilePath()) + "Log.txt"))) + return String(text); + f.PutLine(FormatTime(GetSysTime(), "DD.MM.YYYY hh:mm:ss ") + text + + NFormat(t_(" (file \"%s\", line %d: \"%s\")"), file, line, method)); + f.Close(); + return String(text) + " (доп. информация в лог-файле)"; +} + +#endif diff --git a/bazaar/FormEditorCommon/MenuBarEx.cpp b/bazaar/FormEditorCommon/MenuBarEx.cpp new file mode 100644 index 000000000..e94f7c857 --- /dev/null +++ b/bazaar/FormEditorCommon/MenuBarEx.cpp @@ -0,0 +1,17 @@ +#include "MenuBarEx.h" + +MenuBarEx& MenuBarEx::AddMenuHeader(const char* title) +{ + MenuHeader& r = _Headers.Add().Title(title).CY(16); + if (_Headers.GetCount() == 1) + { + AddMenu(r, 100, 20); + r.TopPos(0, 20).HSizePos(); + } + else + { + AddMenu(r, 100, 30); + r.TopPos(5, 25).HSizePos(); + } + return *this; +} diff --git a/bazaar/FormEditorCommon/MenuBarEx.h b/bazaar/FormEditorCommon/MenuBarEx.h new file mode 100644 index 000000000..9281a7bab --- /dev/null +++ b/bazaar/FormEditorCommon/MenuBarEx.h @@ -0,0 +1,33 @@ +#ifndef FORM_EDITOR_COMMON__MENU_BAR_EX_H +#define FORM_EDITOR_COMMON__MENU_BAR_EX_H + +#include +using namespace Upp; + +class MenuBarEx : public MenuBar +{ + class MenuHeader : public Ctrl + { + String _Title; + int _CY; + + public: + MenuHeader() : _CY(0) {} + MenuHeader& Title(const char* title) { _Title = String(title); return *this; } + MenuHeader& CY(int cy) { _CY = cy; return *this; } + virtual void Paint(Draw& w) + { + Rect r = GetRect(); + w.DrawRect(r, LtGray()); + w.DrawText(5, r.top + _CY / 2 - StdFont().GetHeight() / 2, _Title, + StdFont(), Blue()); + } + }; + + Array _Headers; + +public: + MenuBarEx& AddMenuHeader(const char* title); +}; + +#endif diff --git a/bazaar/FormEditorCommon/Utils.h b/bazaar/FormEditorCommon/Utils.h new file mode 100644 index 000000000..3b9544895 --- /dev/null +++ b/bazaar/FormEditorCommon/Utils.h @@ -0,0 +1,48 @@ +#ifndef FORM_EDITOR_COMMON__UTILS_H +#define FORM_EDITOR_COMMON__UTILS_H + +#include +using namespace Upp; + +// Returns fullpath to the file in the exe-file directory +inline String ConfigFileEx(const char* fp) +{ + return AppendFileName( GetFileDirectory(GetExeFilePath()), String(fp) ); +} + +// Converts const char* text to String +inline String AsString(const char* s) { return String(s); } + +// Saves Image to String +inline String AsString(Image mIcon) +{ + return StoreAsString(mIcon); +} + +// Loads Image from String +inline Image ToImage(const String& icon) +{ + Image r; + return LoadFromString(r, icon) ? r : Image(); +} + +// Returns the bool-value from any type of value +inline bool ToBool(const Value& v) +{ + if (v.GetType() == BOOL_V) return (bool)v; + else return v.ToString() == "true" || ScanInt(v.ToString()) == 1; +} + +// Extended VectorMap, supports adding elements in one line +template class VectorMapEx : public VectorMap +{ +public: + virtual ~VectorMapEx() {} + VectorMapEx& Add(const U& u, const T& t) + { + VectorMap::Add(u, t); + return *this; + } +}; + +#endif diff --git a/bazaar/FormEditorCommon/hypercall.h b/bazaar/FormEditorCommon/hypercall.h new file mode 100644 index 000000000..9a2b8b3e7 --- /dev/null +++ b/bazaar/FormEditorCommon/hypercall.h @@ -0,0 +1,250 @@ +// Created by ReC (rev.4) 19 april 2011 + +//============================================================================ +// Check template generation settings +//============================================================================ + +// Name of the template class +#ifndef HC_TEMPLATE_NAME +#error "Please define HC_TEMPLATE_NAME" +#endif + +// Caller prototype for non-void functions +#ifndef HC_NORMAL_CALLER +#error "Please define HC_NORMAL_CALLER" +#endif + +// Caller prototype for void functions +#ifndef HC_VOID_CALLER +#error "Please define HC_VOID_CALLER" +#endif + +// How to extract and convert argument to required type +#ifndef HC_ARGUMENT +#error "Please define HC_ARGUMENT" +#endif + +#ifndef HC_BASE_CLASS +#error "Please define HC_BASE_CLASS" +#endif + + +//============================================================================ +// Some helpers to simplify shitty-coding +//============================================================================ + +// EXPANDS2(A, B) -> A1 B, A2 B +#define EXPANDS1(Prefix,Suffix) Prefix##1 Suffix +#define EXPANDS2(Prefix,Suffix) EXPANDS1(Prefix,Suffix), Prefix##2 Suffix +#define EXPANDS3(Prefix,Suffix) EXPANDS2(Prefix,Suffix), Prefix##3 Suffix +#define EXPANDS4(Prefix,Suffix) EXPANDS3(Prefix,Suffix), Prefix##4 Suffix +#define EXPANDS5(Prefix,Suffix) EXPANDS4(Prefix,Suffix), Prefix##5 Suffix +#define EXPANDS6(Prefix,Suffix) EXPANDS5(Prefix,Suffix), Prefix##6 Suffix +#define EXPANDS7(Prefix,Suffix) EXPANDS6(Prefix,Suffix), Prefix##7 Suffix +#define EXPANDS8(Prefix,Suffix) EXPANDS7(Prefix,Suffix), Prefix##8 Suffix +#define EXPANDS9(Prefix,Suffix) EXPANDS8(Prefix,Suffix), Prefix##9 Suffix +#define EXPANDS10(Prefix,Suffix) EXPANDS9(Prefix,Suffix), Prefix##10 Suffix + +// EXPAND2(A) -> A1, A2 +#define EXPAND1(Prefix) Prefix##1 +#define EXPAND2(Prefix) EXPAND1(Prefix), Prefix##2 +#define EXPAND3(Prefix) EXPAND2(Prefix), Prefix##3 +#define EXPAND4(Prefix) EXPAND3(Prefix), Prefix##4 +#define EXPAND5(Prefix) EXPAND4(Prefix), Prefix##5 +#define EXPAND6(Prefix) EXPAND5(Prefix), Prefix##6 +#define EXPAND7(Prefix) EXPAND6(Prefix), Prefix##7 +#define EXPAND8(Prefix) EXPAND7(Prefix), Prefix##8 +#define EXPAND9(Prefix) EXPAND8(Prefix), Prefix##9 +#define EXPAND10(Prefix) EXPAND9(Prefix), Prefix##10 + +// COPY2(A) -> A, A +#define COPY1(Prefix) Prefix +#define COPY2(Prefix) COPY1(Prefix), Prefix +#define COPY3(Prefix) COPY2(Prefix), Prefix +#define COPY4(Prefix) COPY3(Prefix), Prefix +#define COPY5(Prefix) COPY4(Prefix), Prefix +#define COPY6(Prefix) COPY5(Prefix), Prefix +#define COPY7(Prefix) COPY6(Prefix), Prefix +#define COPY8(Prefix) COPY7(Prefix), Prefix +#define COPY9(Prefix) COPY8(Prefix), Prefix +#define COPY10(Prefix) COPY9(Prefix), Prefix + +#define ARG1(Prefix) HC_ARGUMENT(1, P##1) +#define ARG2(Prefix) ARG1(Prefix), HC_ARGUMENT(2, Prefix##2) +#define ARG3(Prefix) ARG2(Prefix), HC_ARGUMENT(3, Prefix##3) +#define ARG4(Prefix) ARG3(Prefix), HC_ARGUMENT(4, Prefix##4) +#define ARG5(Prefix) ARG4(Prefix), HC_ARGUMENT(5, Prefix##5) +#define ARG6(Prefix) ARG5(Prefix), HC_ARGUMENT(6, Prefix##6) +#define ARG7(Prefix) ARG6(Prefix), HC_ARGUMENT(7, Prefix##7) +#define ARG8(Prefix) ARG7(Prefix), HC_ARGUMENT(8, Prefix##8) +#define ARG9(Prefix) ARG8(Prefix), HC_ARGUMENT(9, Prefix##9) +#define ARG10(Prefix) ARG9(Prefix), HC_ARGUMENT(10, Prefix##10) + +//============================================================================ +// And now bunch of templates ... +//============================================================================ + +// Templates for functions with return value +template +struct HC_TEMPLATE_NAME HC_BASE_CLASS { + HC_NORMAL_CALLER(C, R, (EXPAND10(P)), (ARG10(P))) +}; + +template +struct HC_TEMPLATE_NAME HC_BASE_CLASS { + HC_NORMAL_CALLER(C, R, (EXPAND9(P)), (ARG9(P))) +}; + +template +struct HC_TEMPLATE_NAME HC_BASE_CLASS { + HC_NORMAL_CALLER(C, R, (EXPAND8(P)), (ARG8(P))) +}; + +template +struct HC_TEMPLATE_NAME HC_BASE_CLASS { + HC_NORMAL_CALLER(C, R, (EXPAND7(P)), (ARG7(P))) +}; + +template +struct HC_TEMPLATE_NAME HC_BASE_CLASS { + HC_NORMAL_CALLER(C, R, (EXPAND6(P)), (ARG6(P))) +}; + +template +struct HC_TEMPLATE_NAME HC_BASE_CLASS { + HC_NORMAL_CALLER(C, R, (EXPAND5(P)), (ARG5(P))) +}; + +template +struct HC_TEMPLATE_NAME HC_BASE_CLASS { + HC_NORMAL_CALLER(C, R, (EXPAND4(P)), (ARG4(P))) +}; + +template +struct HC_TEMPLATE_NAME HC_BASE_CLASS { + HC_NORMAL_CALLER(C, R, (EXPAND3(P)), (ARG3(P))) +}; + +template +struct HC_TEMPLATE_NAME HC_BASE_CLASS { + HC_NORMAL_CALLER(C, R, (EXPAND2(P)), (ARG2(P))) +}; + +template +struct HC_TEMPLATE_NAME HC_BASE_CLASS { + HC_NORMAL_CALLER(C, R, (EXPAND1(P)), (ARG1(P))) +}; + +template +struct HC_TEMPLATE_NAME HC_BASE_CLASS { + HC_NORMAL_CALLER(C, R, (), ()) +}; + +// Templates for functions without return value +template +struct HC_TEMPLATE_NAME HC_BASE_CLASS { + HC_VOID_CALLER(C, (EXPAND10(P)), (ARG10(P))) +}; + +template +struct HC_TEMPLATE_NAME HC_BASE_CLASS { + HC_VOID_CALLER(C, (EXPAND9(P)), (ARG9(P))) +}; + +template +struct HC_TEMPLATE_NAME HC_BASE_CLASS { + HC_VOID_CALLER(C, (EXPAND8(P)), (ARG8(P))) +}; + +template +struct HC_TEMPLATE_NAME HC_BASE_CLASS { + HC_VOID_CALLER(C, (EXPAND7(P)), (ARG7(P))) +}; + +template +struct HC_TEMPLATE_NAME HC_BASE_CLASS { + HC_VOID_CALLER(C, (EXPAND6(P)), (ARG6(P))) +}; + +template +struct HC_TEMPLATE_NAME HC_BASE_CLASS { + HC_VOID_CALLER(C, (EXPAND5(P)), (ARG5(P))) +}; + +template +struct HC_TEMPLATE_NAME HC_BASE_CLASS { + HC_VOID_CALLER(C, (EXPAND4(P)), (ARG4(P))) +}; + +template +struct HC_TEMPLATE_NAME HC_BASE_CLASS { + HC_VOID_CALLER(C, (EXPAND3(P)), (ARG3(P))) +}; + +template +struct HC_TEMPLATE_NAME HC_BASE_CLASS { + HC_VOID_CALLER(C, (EXPAND2(P)), (ARG2(P))) +}; + +template +struct HC_TEMPLATE_NAME HC_BASE_CLASS { + HC_VOID_CALLER(C, (EXPAND1(P)), (ARG1(P))) +}; + +template +struct HC_TEMPLATE_NAME HC_BASE_CLASS { + HC_VOID_CALLER(C, (), ()) +}; + +//============================================================================ +// Undefine all macroshit +//============================================================================ +#undef EXPAND1 +#undef EXPAND2 +#undef EXPAND3 +#undef EXPAND4 +#undef EXPAND5 +#undef EXPAND6 +#undef EXPAND7 +#undef EXPAND8 +#undef EXPAND9 +#undef EXPAND10 + +#undef EXPANDS1 +#undef EXPANDS2 +#undef EXPANDS3 +#undef EXPANDS4 +#undef EXPANDS5 +#undef EXPANDS6 +#undef EXPANDS7 +#undef EXPANDS8 +#undef EXPANDS9 +#undef EXPANDS10 + +#undef COPY1 +#undef COPY2 +#undef COPY3 +#undef COPY4 +#undef COPY5 +#undef COPY6 +#undef COPY7 +#undef COPY8 +#undef COPY9 +#undef COPY10 + +#undef ARG1 +#undef ARG2 +#undef ARG3 +#undef ARG4 +#undef ARG5 +#undef ARG6 +#undef ARG7 +#undef ARG8 +#undef ARG9 +#undef ARG10 + +#undef HC_TEMPLATE_NAME +#undef HC_NORMAL_CALLER +#undef HC_VOID_CALLER +#undef HC_ARGUMENT +#undef HC_BASE_CLASS diff --git a/bazaar/FormEditorCommon/init b/bazaar/FormEditorCommon/init new file mode 100644 index 000000000..3f085d223 --- /dev/null +++ b/bazaar/FormEditorCommon/init @@ -0,0 +1,4 @@ +#ifndef _FormEditorCommon_icpp_init_stub +#define _FormEditorCommon_icpp_init_stub +#include "CtrlLib/init" +#endif diff --git a/bazaar/FormEditorProperties/Common.h b/bazaar/FormEditorProperties/Common.h new file mode 100644 index 000000000..f9962be66 --- /dev/null +++ b/bazaar/FormEditorProperties/Common.h @@ -0,0 +1,74 @@ +#ifndef FORM_EDITOR_PROPERTIES__COMMON_H +#define FORM_EDITOR_PROPERTIES__COMMON_H + +#include +#include + +/////////////////////////////////////////////////////////////////////////////////////////////// +// For PropertyCaller automatic argument conversion +/////////////////////////////////////////////////////////////////////////////////////////////// + +class SProperty +{ +public: + SProperty(const Vector& args) { _args <<= args; } + SProperty& operator=(const Value& v) { Return = v; return *this; } + Value GetArg(int i) { if (i < 0 || i >= _args.GetCount()) return Value(); return _args[i]; } + Value Return; +private: + Vector _args; +}; + +template void PropReturn(P p, SProperty& e) { } +template<> inline void PropReturn(EscValue p, SProperty& e) { e = p.ToString(); } +template<> inline void PropReturn(WString p, SProperty& e) { e = p.ToString(); } +template<> inline void PropReturn(String p, SProperty& e) { e = p; } +template<> inline void PropReturn(double p, SProperty& e) { e = p; } +template<> inline void PropReturn(dword p, SProperty& e) { e = (int)p; } +template<> inline void PropReturn(char* p, SProperty& e) { e = String(p); } +template<> inline void PropReturn(bool p, SProperty& e) { e = (int)p; } +template<> inline void PropReturn(long p, SProperty& e) { e = (int)p; } +template<> inline void PropReturn(int p, SProperty& e) { e = p; } +template<> inline void PropReturn(Size p, SProperty& e) { e = p; } +template<> inline void PropReturn(Rect p, SProperty& e) { e = p; } +template<> inline void PropReturn(Point p, SProperty& e) { e = p; } +template<> inline void PropReturn(Color p, SProperty& e) { e = p; } + +template<> inline void PropReturn(const EscValue& p, SProperty& e){ e = p.ToString();} +template<> inline void PropReturn(const WString& p, SProperty& e) { e = p.ToString(); } +template<> inline void PropReturn(const String& p, SProperty& e) { e = p; } +template<> inline void PropReturn(const double& p, SProperty& e) { e = p; } +template<> inline void PropReturn(const dword& p, SProperty& e) { e = (int)p; } +template<> inline void PropReturn(const char* p, SProperty& e) { e = String(p); } +template<> inline void PropReturn(const bool& p, SProperty& e) { e = p; } +template<> inline void PropReturn(const long& p, SProperty& e) { e = (int)p; } +template<> inline void PropReturn(const int& p, SProperty& e) { e = p; } +template<> inline void PropReturn(const Size& p, SProperty& e) { e = p; } +template<> inline void PropReturn(const Rect& p, SProperty& e) { e = p; } +template<> inline void PropReturn(const Point& p, SProperty& e) { e = p; } +template<> inline void PropReturn(const Color& p, SProperty& e) { e = p; } + +class ValueConvert +{ +private: + String _Str; + Value _Val; + +public: + virtual ~ValueConvert() {} + ValueConvert(const Value& v) { if (IsString(v)) _Str = v.ToString(); else _Val = v; } + operator const char*() const { return (const char*)_Str; } + String ToString() const { return _Str; } + operator String() const { return _Str; } + operator Value() const { return _Val; } + operator dword() const { return ScanInt(_Val.ToString()); } + operator Color() const { if (_Val.GetType() == COLOR_V) return _Val; return Color(); } + operator Point() const { if (_Val.GetType() == POINT_V) return _Val; return Point(); } + operator Rect() const { if (_Val.GetType() == RECT_V) return _Val; return Rect(); } + operator Size() const { if (_Val.GetType() == SIZE_V) return _Val; return Size(); } + operator bool() const { return ToBool(_Val); } + operator int () const { return ScanInt(_Val.ToString()); } + operator double() const { return ScanDouble(_Val.ToString()); } +}; + +#endif diff --git a/bazaar/FormEditorProperties/FormEditorProperties.h b/bazaar/FormEditorProperties/FormEditorProperties.h new file mode 100644 index 000000000..8697fcd6a --- /dev/null +++ b/bazaar/FormEditorProperties/FormEditorProperties.h @@ -0,0 +1,8 @@ +#ifndef FORM_EDITOR_PROPERTIES__FORM_EDITOR_PROPERTIES_H +#define FORM_EDITOR_PROPERTIES__FORM_EDITOR_PROPERTIES_H + +#include "PropertiesEditor.h" +#include "PropertiesMacro.h" +#include "Properties.h" + +#endif diff --git a/bazaar/FormEditorProperties/FormEditorProperties.icpp b/bazaar/FormEditorProperties/FormEditorProperties.icpp new file mode 100644 index 000000000..0dd159eea --- /dev/null +++ b/bazaar/FormEditorProperties/FormEditorProperties.icpp @@ -0,0 +1,4 @@ +#include "Common.h" + +#define TFILE +#include diff --git a/bazaar/FormEditorProperties/FormEditorProperties.lay b/bazaar/FormEditorProperties/FormEditorProperties.lay new file mode 100644 index 000000000..b544bc552 --- /dev/null +++ b/bazaar/FormEditorProperties/FormEditorProperties.lay @@ -0,0 +1,6 @@ +LAYOUT(PropertiesLayout, 296, 460) + ITEM(ExpanderCtrl, propGroups, HSizePosZ(8, 8).VSizePosZ(8, 44)) + ITEM(Button, cancel, SetLabel(t_("Cancel")).RightPosZ(8, 80).BottomPosZ(8, 28)) + ITEM(Button, ok, SetLabel(t_("Save")).RightPosZ(92, 80).BottomPosZ(8, 28)) +END_LAYOUT + diff --git a/bazaar/FormEditorProperties/FormEditorProperties.t b/bazaar/FormEditorProperties/FormEditorProperties.t new file mode 100644 index 000000000..2c0212494 --- /dev/null +++ b/bazaar/FormEditorProperties/FormEditorProperties.t @@ -0,0 +1,34 @@ +#ifdef _MSC_VER +#pragma setlocale("C") +#endif +// FormEditorProperties.lay + +T_("Cancel") +ruRU("\320\236\321\202\320\274\320\265\320\275\320\260") + +T_("Save") +ruRU("\320\241\320\276\321\205\321\200\320\260\320\275\320\270\321\202\321\214") + + +// PropertiesEditor.h + +T_("Properties") +ruRU("\320\241\320\262\320\276\320\271\321\201\321\202\320\262\320\260") + +T_("No properties for object!") +ruRU("\320\235\320\265\321\202 \321\201\320\262\320\276\320\271\321\201\321\202\320\262 " + "\320\264\320\273\321\217 \320\276\320\261\321\212\320\265\320\272\321\202\320\260!") + +T_("Others") +ruRU("\320\237\321\200\320\276\321\207\320\270\320\265") + +T_("Unable to change the property: NULL-pointer.") +ruRU("\320\235\320\265\320\262\320\276\320\267\320\274\320\276\320\266\320\275\320\276 " + "\320\270\320\267\320\274\320\265\320\275\320\270\321\202\321\214 \321\201\320\262\320\276\320\271\321\201\321\202\320\262\320\276: " + "NULL-\321\203\320\272\320\260\320\267\320\260\321\202\320\265\320\273\321\214.") + +T_("Property of the object (type \"%s\"), named \"%s\", changed to: \"%s\"") +ruRU("\320\241\320\262\320\276\320\271\321\201\321\202\320\262\320\276 \320\276\320\261\321\212\320\265\320\272\321\202\320\260 " + "(\321\202\320\270\320\277 \"%s\") \321\201 \320\270\320\274\320\265\320\275\320\265\320\274 " + "\"%s\", \320\270\320\267\320\274\320\265\320\275\320\270\320\273\320\276\321\201\321\214 " + "\320\275\320\260: \"%s\"") diff --git a/bazaar/FormEditorProperties/FormEditorProperties.upp b/bazaar/FormEditorProperties/FormEditorProperties.upp new file mode 100644 index 000000000..f70bd9ac9 --- /dev/null +++ b/bazaar/FormEditorProperties/FormEditorProperties.upp @@ -0,0 +1,25 @@ +uses + CtrlLib, + FormEditorCommon, + ExpandFrame; + +file + Basis readonly separator, + Common.h, + PropertyCaller.h, + Properties readonly separator, + FormEditorProperties.lay, + FormEditorProperties.h, + FormEditorProperties.t, + FormEditorProperties.icpp, + PropertiesMacro.h, + PropertiesEditor.h, + Properties.h, + Property.h, + Property.cpp, + PropertyEdits.h, + PropertyEdits.cpp; + +mainconfig + "" = "GUI"; + diff --git a/bazaar/FormEditorProperties/Properties.h b/bazaar/FormEditorProperties/Properties.h new file mode 100644 index 000000000..78de9d56b --- /dev/null +++ b/bazaar/FormEditorProperties/Properties.h @@ -0,0 +1,81 @@ +#ifndef FORM_EDITOR_PROPERTIES__PROPERTIES_H +#define FORM_EDITOR_PROPERTIES__PROPERTIES_H + +#include "PropertiesEditor.h" + +template +class PropertiesBase : public IPartBase +{ +public: + PropertiesBase(T* c) : _This(c) {} + virtual ~PropertiesBase() {} + + virtual void InitProperties() {} + virtual int OpenProperties(); + virtual void ClearProperties() { GetProperties().Clear(); } + virtual int ExecuteProperties(const Size& wndSize = Null); + + Array& GetProperties() { return _Properties; } + const Array& GetProperties() const { return _Properties; } + + int GetPropertyGroupCount() const { return GetPropertiesGroups().GetCount(); } + Vector GetPropertiesGroups() const; + Array GetPropertiesByGroup(const String& group); + + T* GetObject() { return _This; } + +private: + T* _This; + Array _Properties; +}; + +template +Vector PropertiesBase::GetPropertiesGroups() const +{ + const Array& props = GetProperties(); + Vector result; + for (int i = 0; i < props.GetCount(); ++i) + { + bool found = false; + for (int j = 0; j < result.GetCount(); ++j) + if (props[i].MetaString("Group") == result[j]) + { + found = true; + break; + } + if (!found) + result << props[i].MetaString("Group"); + } + return result; +} + +template +Array PropertiesBase::GetPropertiesByGroup(const String& group) +{ + Array& props = GetProperties(); + Array result; + for (int i = 0; i < props.GetCount(); ++i) + { + if (props[i].MetaString("Group") == group) + result.Add(&props[i]); + } + return result; +} + +template +int PropertiesBase::OpenProperties() +{ + return PropertiesWindow >(this).Execute(); +} + +template +int PropertiesBase::ExecuteProperties(const Size& wndSize) +{ + PropertiesWindow > wnd(this); + if (!IsNull(wndSize)) + wnd.GetWorkArea().CenterRect(wndSize); + int r = wnd.Execute(); + return r; +} + +#endif diff --git a/bazaar/FormEditorProperties/PropertiesEditor.h b/bazaar/FormEditorProperties/PropertiesEditor.h new file mode 100644 index 000000000..6b9125e78 --- /dev/null +++ b/bazaar/FormEditorProperties/PropertiesEditor.h @@ -0,0 +1,204 @@ +#ifndef FORM_EDITOR_PROPERTIES__PROPERTIES_EDITOR_H +#define FORM_EDITOR_PROPERTIES__PROPERTIES_EDITOR_H + +#include "Property.h" +#include "PropertyCaller.h" +#include +#include + +#define LAYOUTFILE +#include + +template +class PropertiesWindowBase : public WithPropertiesLayout +{ + typedef PropertiesWindowBase CLASSNAME; + +protected: + T* GetProperties() { return _Properties; } + virtual void Cancel(); + virtual void Load(); + virtual void Save(); + +public: + PropertiesWindowBase(T* p); + virtual ~PropertiesWindowBase(); + virtual String GetObjectWidgetClass() const { return String(); } + virtual int Execute(); + +private: + T* _Properties; + Array _Panes; +}; + +template +PropertiesWindowBase::PropertiesWindowBase(T* p) +{ + CtrlLayoutOKCancel(*this, t_("Properties")); + ToolWindow().Sizeable(); + _Properties = p; + _Properties->InitProperties(); + Load(); +} + +template +PropertiesWindowBase::~PropertiesWindowBase() +{ + _Properties->ClearProperties(); +} + +template +int PropertiesWindowBase::Execute() +{ + if (!_Properties->GetProperties().GetCount()) + { + PromptOK(t_("No properties for object!")); + return IDCANCEL; + } + int r = WithPropertiesLayout::Execute(); + r == IDOK ? Save() : Cancel(); + return r; +} + +template +void PropertiesWindowBase::Load() +{ + Vector groups = _Properties->GetPropertiesGroups(); + propGroups.Clear(); + _Panes.Clear(); + + for (int i = 0; i < groups.GetCount(); ++i) + { + if (groups[i].IsEmpty()) + groups[i] = t_("Others"); + Array gProps = _Properties->GetPropertiesByGroup(groups[i]); + StaticRect& pane = _Panes.Add(); + int paneCY = 10; + for (int j = 0; j < gProps.GetCount(); ++j) + { + gProps[j]->ToPane(pane, paneCY, 5); + } + paneCY += 15; + propGroups.AddExpander(pane, true, paneCY).SetTitle(groups[i]); + } +} + +template +void PropertiesWindowBase::Save() +{ + Array& props = _Properties->GetProperties(); + for (int i = 0; i < props.GetCount(); ++i) + if (props[i].IsChanged()) + props[i].Apply(); + Break(); +} + +template +void PropertiesWindowBase::Cancel() +{ + Array& props = _Properties->GetProperties(); + for (int i = 0; i < props.GetCount(); ++i) + if (props[i].IsChanged()) + props[i].Restore(); + Break(); +} + +template +class PropertiesWindowHistory +{ + class HChangeProperty : public IHistoryItem + { + String _Name; + Value _Last; + Value _Next; + int _Prop; + T* _Ptr; + + public: + HChangeProperty(T* obj, String name, int prop, Value last, Value v) + : _Ptr(obj), _Name(name), _Prop(prop), _Last(last), _Next(v) {} + virtual ~HChangeProperty() {} + + virtual String GetDesc() const; + virtual void Undo(); + virtual void Do(); + }; + +public: + PropertiesWindowHistory(T* p) : _Properties(p) {} + +private: + T* _Properties; + +protected: + virtual void Save(); +}; + +template +void PropertiesWindowHistory::Save() +{ + Array& props = _Properties->GetProperties(); + for (int i = 0; i < props.GetCount(); ++i) + if (props[i].IsChanged()) + { + T* c = _Properties->GetObject(); + if (!c) continue; + Value v; + props[i].Get(v, Vector()); + c->AddToHistory(new HChangeProperty(c, props[i].MetaString("Name"), + i, props[i].GetLast(), v)); + } +} + +// History: Property changes +template +void PropertiesWindowHistory::HChangeProperty::Do() +{ + if (!_Ptr) return; + _Ptr->InitProperties(); + Property& prop = _Ptr->GetProperties()[_Prop]; + prop.Set(Vector() << _Next); + _Ptr->ClearProperties(); +} + +template +void PropertiesWindowHistory::HChangeProperty::Undo() +{ + if (!_Ptr) return; + _Ptr->InitProperties(); + Property& prop = _Ptr->GetProperties()[_Prop]; + prop.Set(Vector() << _Last); + _Ptr->ClearProperties(); +} + +template +String PropertiesWindowHistory::HChangeProperty::GetDesc() const +{ + if (!_Ptr) return String(t_("Unable to change the property: NULL-pointer.")); + return NFormat(t_("Property of the object (type \"%s\"), named \"%s\", changed to: \"%s\""), + _Ptr->GetObjectWidgetClass(), _Name, _Next.ToString()); +} + +template +class PropertiesWindow : public PropertiesWindowBase, public PropertiesWindowHistory +{ +public: + PropertiesWindow(T* p) : PropertiesWindowBase(p), PropertiesWindowHistory(p) + { _useHistory = false; } + virtual ~PropertiesWindow() {} + + virtual void Save() + { + PropertiesWindowBase::Save(); + + if (_useHistory) + PropertiesWindowHistory::Save(); + } + + bool UseHistory(bool flag = true) { _useHistory = flag; } + +private: + bool _useHistory; +}; + +#endif diff --git a/bazaar/FormEditorProperties/PropertiesMacro.h b/bazaar/FormEditorProperties/PropertiesMacro.h new file mode 100644 index 000000000..d1b27b3c4 --- /dev/null +++ b/bazaar/FormEditorProperties/PropertiesMacro.h @@ -0,0 +1,65 @@ +#ifndef FORM_EDITOR_PROPERTIES__PROPERTIES_MACRO_H +#define FORM_EDITOR_PROPERTIES__PROPERTIES_MACRO_H + +/////////////////////////////////////////////////////////////////////////////////////////////// +// Properties declaration macros +/////////////////////////////////////////////////////////////////////////////////////////////// + +#define PROPS_INIT_PROPERTIES virtual void InitProperties() \ + { + +#define PROPS_INIT_PROPERTIES_END \ + } + +#define PROPS_DEFINE_PROPERTY(MethodSet, MethodGet) \ + GetProperties().Add().SetCalls(THISBACK(PropSet##MethodSet), THISBACK(PropGet##MethodGet)) \ + PROPS_SET_NAME(#MethodSet)PROPS_GET_NAME(#MethodGet) + +// Meta info for property +#define PROPS_SET_NAME(Name) .AddMetaInfo("SetMethodName", Name) +#define PROPS_GET_NAME(Name) .AddMetaInfo("GetMethodName", Name) +#define PROPS_GROUP(Group) .AddMetaInfo("Group", Group) +#define PROPS_NAME(Name) .AddMetaInfo("Name", Name) +#define PROPS_HINT(Hint) .AddMetaInfo("Hint", Hint) +#define PROPS_DEFAULT(Default) .SetDefault(Default) +#define PROPS_TYPE(EditType, Notify) .SetEdit(new EditType, Notify) + +// Ends property description +#define PROPS_PROPERTY_END \ + ; + +/////////////////////////////////////////////////////////////////////////////////////////////// +// Properties implementation macros +/////////////////////////////////////////////////////////////////////////////////////////////// + +#define PROPS_METHOD_SET(MethodName, ...) \ + void PropSet##MethodName(const Vector& args) \ + { \ + SProperty c(args); \ + PropertyCaller::call(*this, &CLASSNAME::MethodName, c); \ + } + +#define PROPS_METHOD_GET(MethodName, ...) \ + void PropGet##MethodName(Value& v, const Vector& args) \ + { \ + SProperty c(args); \ + PropertyCaller::call(*this, &CLASSNAME::MethodName, c); \ + v = c.Return; \ + } + +#define PROPS_CLASS_METHOD_SET(ClassName, MethodName, ...) \ + void PropSet##MethodName(const Vector& args) \ + { \ + SProperty c(args); \ + PropertyCaller::call(GetCtrl(), &ClassName::MethodName, c); \ + } + +#define PROPS_CLASS_METHOD_GET(ClassName, MethodName, ...) \ + void PropGet##MethodName(Value& v, const Vector& args) \ + { \ + SProperty c(args); \ + PropertyCaller::call(GetCtrl(), &ClassName::MethodName, c); \ + v = c.Return; \ + } + +#endif diff --git a/bazaar/FormEditorProperties/Property.cpp b/bazaar/FormEditorProperties/Property.cpp new file mode 100644 index 000000000..d8548dc96 --- /dev/null +++ b/bazaar/FormEditorProperties/Property.cpp @@ -0,0 +1,57 @@ +#include "Property.h" + +Property& Property::SetCalls(Callback1&> set, + Callback2&> get) +{ + Set = set; + Get = get; + return *this; +} + +Property& Property::SetEdit(IEditCtrl* edit, bool notify) +{ + if (_Edit) _Edit->Release(); + if (!edit) return *this; + _Edit = edit; + _Edit->Retain(); + _Edit->SetNotify(notify); + _Edit->AttachObserver(this); + return *this; +} + +Property& Property::ToPane(Ctrl& c, int& cy, int space) +{ + Value v; + Get(v, Vector()); + _Last = v; + if (!_Edit) { _Edit = new CEditField(); _Edit->Retain(); } + _Edit->SetLabel(MetaString("Name")); + _Edit->SetData(v); + _Edit->Set(c, cy); + cy += space; + return *this; +} + +bool Property::IsDefault() const +{ + Value v; + Get(v, Vector()); + if ((v.GetType() == BOOL_V || v.GetType() == INT_V) && + (_Default.GetType() == BOOL_V || _Default.GetType() == INT_V)) + return _Default == v; + return _Default.ToString() == v.ToString(); +} + +bool Property::IsChanged() const +{ + Value v; + Get(v, Vector()); + + bool changed = ((v.GetType() == BOOL_V || v.GetType() == INT_V) && + (_Last.GetType() == BOOL_V || _Last.GetType() == INT_V)) + ? (_Last != v) + : (_Last.ToString() != v.ToString()); + if (!changed && _Edit) + return v != _Edit->GetData(); + return changed; +} diff --git a/bazaar/FormEditorProperties/Property.h b/bazaar/FormEditorProperties/Property.h new file mode 100644 index 000000000..95c98f894 --- /dev/null +++ b/bazaar/FormEditorProperties/Property.h @@ -0,0 +1,44 @@ +#ifndef FORM_EDITOR_PROPERTIES__PROPERTY_H +#define FORM_EDITOR_PROPERTIES__PROPERTY_H + +#include +#include "PropertyEdits.h" + +class Property : public IObserver +{ +public: + Property() : _Edit(NULL), _Default(String()) {} + virtual ~Property() { if (_Edit) _Edit->Release(); } + virtual void OnUpdate(ISubject* s) { Set(Vector() << _Edit->GetData()); } + + Property& SetCalls(Callback1&> set, + Callback2&> get); + + Property& AddMetaInfo(const String& s, const Value& v){ _Meta.Add(s, v); return *this; } + Property& SetDefault(const Value& val) { _Default = val; return *this; } + Property& SetEdit(IEditCtrl* edit, bool notify); + Property& ToPane(Ctrl& c, int& cy, int space); + + void RestoreDefault() { Set(Vector() << _Default); } + void Restore() { Set(Vector() << _Last); } + void Apply() { Set(Vector() << _Edit->GetData()); } + bool IsDefault() const; + bool IsChanged() const; + void Serialize(Stream& s) { s % _Last; } + + Value GetLast() const { return _Last; } + Value GetDefault() const { return _Default; } + Value GetMetaInfo(const char* s) const { return _Meta.Get(String(s), Value()); } + String MetaString(const char* s) const { return _Meta.Get(String(s), Value()).ToString(); } + + Callback1&> Set; + Callback2&> Get; + +private: + Value _Last; + Value _Default; + IEditCtrl* _Edit; + VectorMap _Meta; +}; + +#endif diff --git a/bazaar/FormEditorProperties/PropertyCaller.h b/bazaar/FormEditorProperties/PropertyCaller.h new file mode 100644 index 000000000..d11e14670 --- /dev/null +++ b/bazaar/FormEditorProperties/PropertyCaller.h @@ -0,0 +1,35 @@ +#ifndef FORM_EDITOR_PROPERTIES__PROPERTY_CALLER_H +#define FORM_EDITOR_PROPERTIES__PROPERTY_CALLER_H + +#include "Common.h" + +#define HC_TEMPLATE_NAME PropertyCaller + +// Prototype for non-void functions +#define HC_NORMAL_CALLER(Class, Return, ArgList, Args) \ +static void call(Class &object, Return (Class::*method)ArgList, SProperty& c) { \ + PropReturn((object.*method)Args, c); \ +} \ +static void call(const Class &object, Return (Class::*method)ArgList const, SProperty& c) { \ + PropReturn((object.*method)Args, c); \ +} + +// Prototype for void functions +#define HC_VOID_CALLER(Class, ArgList, Args) \ +static void call(Class &object, void (Class::*method)ArgList, SProperty& c) { \ + (object.*method)Args; \ +} \ +static void call(const Class &object, void (Class::*method)ArgList const, SProperty& c) { \ + (object.*method)Args; \ +} + +// Argument conversion +#define HC_ARGUMENT(Pos, Type) (Type)ValueConvert(c.GetArg(Pos-1)) + +// No base class +#define HC_BASE_CLASS + +// Generate now! +#include + +#endif diff --git a/bazaar/FormEditorProperties/PropertyEdits.cpp b/bazaar/FormEditorProperties/PropertyEdits.cpp new file mode 100644 index 000000000..c72e2ce06 --- /dev/null +++ b/bazaar/FormEditorProperties/PropertyEdits.cpp @@ -0,0 +1,230 @@ +#include "PropertyEdits.h" + +#define TEXT_DEFAULT_LEFT 5 +#define TEXT_DEFAULT_RIGHT 120 +#define EDIT_DEFAULT_LEFT 120 +#define EDIT_DEFAULT_RIGHT 5 + +// Edit field for text +CEditField::CEditField() +{ + _Label.HSizePosZ(TEXT_DEFAULT_LEFT, TEXT_DEFAULT_RIGHT); + _Edit.HSizePosZ(EDIT_DEFAULT_LEFT, EDIT_DEFAULT_RIGHT); + _Edit.WhenAction = THISBACK(Notify); +} + +CEditField::CEditField(int (*filter)(int)) +{ + _Label.HSizePosZ(TEXT_DEFAULT_LEFT, TEXT_DEFAULT_RIGHT); + _Edit.HSizePosZ(EDIT_DEFAULT_LEFT, EDIT_DEFAULT_RIGHT); + _Edit.WhenAction = THISBACK(Notify); + _Edit.SetFilter(filter); +} + +void CEditField::Set(Ctrl& c, int& cy) +{ + _Label.TopPosZ(cy, _Edit.GetStdSize().cy); + _Edit.TopPosZ(cy, _Edit.GetStdSize().cy); + cy += _Edit.GetStdSize().cy; + c.Add(_Label); + c.Add(_Edit); +} + +// Button +CButton::CButton(const char* label, const Callback& call) +{ + _Label.HSizePosZ(TEXT_DEFAULT_LEFT, TEXT_DEFAULT_RIGHT); + _Edit.HSizePosZ(EDIT_DEFAULT_LEFT, EDIT_DEFAULT_RIGHT); + + _Edit.SetLabel(label); + _Edit.WhenPush = call; +} + +void CButton::Set(Ctrl& c, int& cy) +{ + _Label.TopPosZ(cy, EditField().GetStdSize().cy); + _Edit.TopPosZ(cy, EditField().GetStdSize().cy); + cy += _Edit.GetStdSize().cy; + c.Add(_Label); + c.Add(_Edit); +} + +// Edit field for numbers +CEditIntSpin::CEditIntSpin(int min, int max) +{ + _Label.HSizePosZ(TEXT_DEFAULT_LEFT, TEXT_DEFAULT_RIGHT); + _Edit.HSizePosZ(EDIT_DEFAULT_LEFT, EDIT_DEFAULT_RIGHT); + _Edit.Min(min).Max(max); + _Edit.WhenAction = THISBACK(Notify); +} + +void CEditIntSpin::Set(Ctrl& c, int& cy) +{ + _Label.TopPosZ(cy, _Edit.GetStdSize().cy); + _Edit.TopPosZ(cy, _Edit.GetStdSize().cy); + cy += _Edit.GetStdSize().cy; + c.Add(_Label); + c.Add(_Edit); +} + +void CEditIntSpin::SetData(const Value& data) +{ + if (data.GetType() == INT_V) + _Edit.SetData(data); + else + _Edit.SetData(10); +} + +// Edit field for double-type +CEditDouble::CEditDouble(double min, double max) +{ + _Label.HSizePosZ(TEXT_DEFAULT_LEFT, TEXT_DEFAULT_RIGHT); + _Edit.HSizePosZ(EDIT_DEFAULT_LEFT, EDIT_DEFAULT_RIGHT); + _Edit.Min(min).Max(max); + _Edit.WhenAction = THISBACK(Notify); +} + +void CEditDouble::Set(Ctrl& c, int& cy) +{ + _Label.TopPosZ(cy, _Edit.GetStdSize().cy); + _Edit.TopPosZ(cy, _Edit.GetStdSize().cy); + cy += _Edit.GetStdSize().cy; + c.Add(_Label); + c.Add(_Edit); +} + +void CEditDouble::SetData(const Value& data) +{ + _Edit.SetData(ScanDouble(data.ToString())); +} + +// Edit field for boolean +CEditBool::CEditBool() +{ + _Edit.HSizePosZ(10, 10); + _Edit.WhenAction = THISBACK(Notify); +} + +void CEditBool::Set(Ctrl& c, int& cy) +{ + _Edit.TopPosZ(cy, _Edit.GetStdSize().cy); + cy += _Edit.GetStdSize().cy; + c.Add(_Edit); +} + +void CEditBool::SetData(const Value& data) +{ + if (data.GetType() == BOOL_V || data.GetType() == INT_V) + _Edit.Set(data); +} + +// Dropping list +CDropList::CDropList(const VectorMapEx& list, int defaultIndex) +{ + _Label.HSizePosZ(TEXT_DEFAULT_LEFT, TEXT_DEFAULT_RIGHT); + _Edit .HSizePosZ(EDIT_DEFAULT_LEFT, EDIT_DEFAULT_RIGHT); + _Edit .WhenAction = THISBACK(Notify); + + for (int i = 0; i < list.GetCount(); ++i) + _Edit.Add(list.GetKey(i), list[i]); + if (_Edit.GetCount()) _Edit.SetIndex(defaultIndex); +} + +void CDropList::Set(Ctrl& c, int& cy) +{ + _Label.TopPosZ(cy, _Edit.GetStdSize().cy); + _Edit.TopPosZ(cy, _Edit.GetStdSize().cy); + cy += _Edit.GetStdSize().cy; + c.Add(_Label); + c.Add(_Edit); +} + +void CDropList::SetData(const Value& data) +{ + bool found = false; + for (int i = 0; i < _Edit.GetCount(); ++i) + if (_Edit.GetValue(i) == data) + { + _Edit.SetIndex(i); + found = true; + break; + } + if (!found) + _Edit.SetData(data); +} + +// Edit field for text +CEditColor::CEditColor() +{ + _Label.HSizePosZ(TEXT_DEFAULT_LEFT, TEXT_DEFAULT_RIGHT); + _Edit.HSizePosZ(EDIT_DEFAULT_LEFT, EDIT_DEFAULT_RIGHT); + _Edit.WhenAction = THISBACK(Notify); +} + +void CEditColor::Set(Ctrl& c, int& cy) +{ + _Label.TopPosZ(cy, _Edit.GetStdSize().cy); + _Edit.TopPosZ(cy, _Edit.GetStdSize().cy); + cy += _Edit.GetStdSize().cy; + c.Add(_Label); + c.Add(_Edit); +} + +// Edit field for simple doc +CDocEdit::CDocEdit() +{ + _Label.HSizePosZ(TEXT_DEFAULT_LEFT, TEXT_DEFAULT_RIGHT); + _Edit.HSizePosZ(EDIT_DEFAULT_LEFT, EDIT_DEFAULT_RIGHT); + _Edit.WhenAction = THISBACK(Notify); +} + +void CDocEdit::Set(Ctrl& c, int& cy) +{ + _Label.TopPosZ(cy, _Label.GetStdSize().cy); + _Edit.TopPosZ(cy, 100); + cy += 100; + c.Add(_Label); + c.Add(_Edit); +} + +// Edit field for size +CEditSize::CEditSize(int min, int max) +{ + _CX.Min(min).Max(max); + _CY.Min(min).Max(max); + _CX.WhenAction = THISBACK(Notify); + _CY.WhenAction = THISBACK(Notify); + _Label.HSizePosZ(TEXT_DEFAULT_LEFT, TEXT_DEFAULT_RIGHT); + _Size.HSizePosZ(EDIT_DEFAULT_LEFT, EDIT_DEFAULT_RIGHT); + _Size.Add(_CX.SizePos()); + _Size.Add(_CY.SizePos()); +} + +void CEditSize::Set(Ctrl& c, int& cy) +{ + c.Add(_Label.TopPosZ(cy, _CY.GetStdSize().cy)); + c.Add(_Size.TopPosZ(cy, _CY.GetStdSize().cy)); + + cy += _CY.GetStdSize().cy; +} + +void CEditSize::SetData(const Value& data) +{ + if (data.GetType() == SIZE_V) + { + Size sz = data; + _CX.SetData(sz.cx); + _CY.SetData(sz.cy); + } +} + +// Edit field for point +void CEditPoint::SetData(const Value& data) +{ + if (data.GetType() == POINT_V) + { + Point p = data; + _CX.SetData(p.x); + _CY.SetData(p.y); + } +} diff --git a/bazaar/FormEditorProperties/PropertyEdits.h b/bazaar/FormEditorProperties/PropertyEdits.h new file mode 100644 index 000000000..a20c0b5f6 --- /dev/null +++ b/bazaar/FormEditorProperties/PropertyEdits.h @@ -0,0 +1,205 @@ +#ifndef FORM_EDITOR_PROPERTIES__PROPERTY_EDITS_H +#define FORM_EDITOR_PROPERTIES__PROPERTY_EDITS_H + +#include + +class ISubject; +class IObserver : public Pte +{ +public: + virtual void OnUpdate(ISubject* s) = 0; +}; + +class ISubject +{ + Vector > _Observers; + Atomic _Refcount; + bool _Notify; + +public: + ISubject() { _Notify = false; AtomicWrite(_Refcount, 0); } + void Retain() { AtomicInc(_Refcount); } + void Release() { if (AtomicDec(_Refcount) == 0) delete this; } + virtual ~ISubject() {} + + virtual void AttachObserver(Ptr p) { if (p) _Observers.Add(p); } + virtual void SetNotify(bool flag) { _Notify = flag; } + virtual void Notify() + { + if (_Notify) + for (int i = 0; i < _Observers.GetCount(); ++i) + if (_Observers[i]) _Observers[i]->OnUpdate(this); + } +}; + +class IEditCtrl : public ISubject +{ +public: + virtual ~IEditCtrl() {} + virtual void Set(Ctrl& c, int& cy) = 0; + virtual void SetData(const Value& data) = 0; + virtual void SetLabel(const String& label) = 0; + virtual Value GetData() const = 0; +}; + +// Edit field for text +class CEditField : public IEditCtrl +{ + typedef CEditField CLASSNAME; + EditField _Edit; + Label _Label; + +public: + CEditField(); + CEditField(int (*filter)(int)); + virtual ~CEditField() {} + virtual void Set(Ctrl& c, int& cy); + virtual void SetData(const Value& data) { _Edit.SetData(data); } + virtual void SetLabel(const String& label) { _Label.SetLabel(label + ":"); } + virtual Value GetData() const { return _Edit.GetData(); } +}; + +// Button +class CButton : public IEditCtrl +{ + typedef CButton CLASSNAME; + Button _Edit; + Label _Label; + +public: + CButton(const char* label, const Callback& call); + virtual ~CButton() {} + virtual void Set(Ctrl& c, int& cy); + virtual void SetData(const Value& data) {} + virtual void SetLabel(const String& label) { _Label.SetLabel(label + ":"); } + virtual Value GetData() const { return Value(); } +}; + +// Edit field for numbers +class CEditIntSpin : public IEditCtrl +{ + typedef CEditIntSpin CLASSNAME; + EditIntSpin _Edit; + Label _Label; + +public: + CEditIntSpin(int min, int max); + virtual ~CEditIntSpin() {} + virtual void Set(Ctrl& c, int& cy); + virtual void SetData(const Value& data); + virtual void SetLabel(const String& label) { _Label.SetLabel(label + ":"); } + virtual Value GetData() const { return _Edit.GetData(); } +}; + +// Edit field for double-type +class CEditDouble : public IEditCtrl +{ + typedef CEditDouble CLASSNAME; + EditDouble _Edit; + Label _Label; + +public: + CEditDouble(double min, double max); + virtual ~CEditDouble() {} + virtual void Set(Ctrl& c, int& cy); + virtual void SetData(const Value& data); + virtual void SetLabel(const String& label) { _Label.SetLabel(label + ":"); } + virtual Value GetData() const { return _Edit.GetData(); } +}; + +// Edit field for boolean +class CEditBool : public IEditCtrl +{ + typedef CEditBool CLASSNAME; + Option _Edit; + +public: + CEditBool(); + virtual ~CEditBool() {} + virtual void Set(Ctrl& c, int& cy); + virtual void SetData(const Value& data); + virtual void SetLabel(const String& label) { _Edit.SetLabel(label); } + virtual Value GetData() const { return _Edit.Get(); } +}; + +// Dropping list +class CDropList : public IEditCtrl +{ + typedef CDropList CLASSNAME; + DropList _Edit; + Label _Label; + +public: + CDropList(const VectorMapEx& list, int defaultIndex = 0); + virtual ~CDropList() {} + virtual void Set(Ctrl& c, int& cy); + virtual void SetData(const Value& data); + virtual void SetLabel(const String& label) { _Label.SetLabel(label + ":"); } + virtual Value GetData() const { return _Edit.GetValue(); } +}; + +// Edit color +class CEditColor : public IEditCtrl +{ + typedef CEditColor CLASSNAME; + ColorPusher _Edit; + Label _Label; + +public: + CEditColor(); + virtual ~CEditColor() {} + virtual void Set(Ctrl& c, int& cy); + virtual void SetData(const Value& data) { _Edit.SetData(data); } + virtual void SetLabel(const String& label) { _Label.SetLabel(label + ":"); } + virtual Value GetData() const { return _Edit.GetData(); } +}; + +// Edit doc +class CDocEdit : public IEditCtrl +{ + typedef CEditColor CLASSNAME; + DocEdit _Edit; + Label _Label; + +public: + CDocEdit(); + virtual ~CDocEdit() {} + virtual void Set(Ctrl& c, int& cy); + virtual void SetData(const Value& data) { _Edit.SetData(data); } + virtual void SetLabel(const String& label) { _Label.SetLabel(label + ":"); } + virtual Value GetData() const { return _Edit.GetData(); } +}; + +// Edit field for size +class CEditSize : public IEditCtrl +{ + typedef CEditSize CLASSNAME; + friend class CEditPoint; + EditIntSpin _CX; + EditIntSpin _CY; + Splitter _Size; + Label _Label; + +public: + CEditSize(int min, int max); + virtual ~CEditSize() {} + virtual void Set(Ctrl& c, int& cy); + virtual void SetData(const Value& data); + virtual void SetLabel(const String& label) { _Label.SetLabel(label + ":"); } + virtual Value GetData() const { return Size( _CX.GetData(), _CY.GetData()); } +}; + +// Edit field for point +class CEditPoint : public CEditSize +{ + typedef CEditPoint CLASSNAME; + +public: + CEditPoint(int min, int max) : CEditSize(min, max) {} + virtual ~CEditPoint() {} + virtual void SetData(const Value& data); + virtual void SetLabel(const String& label) { _Label.SetLabel(label + ":"); } + virtual Value GetData() const { return Point(_CX.GetData(), _CY.GetData()); } +}; + +#endif diff --git a/bazaar/FormEditorProperties/init b/bazaar/FormEditorProperties/init new file mode 100644 index 000000000..2289318fc --- /dev/null +++ b/bazaar/FormEditorProperties/init @@ -0,0 +1,9 @@ +#ifndef _FormEditorProperties_icpp_init_stub +#define _FormEditorProperties_icpp_init_stub +#include "CtrlLib/init" +#include "FormEditorCommon/init" +#include "ExpandFrame/init" +#define BLITZ_INDEX__ FBF5B444DA4360EC5FCE19D15538383D2 +#include "FormEditorProperties.icpp" +#undef BLITZ_INDEX__ +#endif diff --git a/bazaar/Map/Map.h b/bazaar/Map/Map.h new file mode 100644 index 000000000..62eee96f8 --- /dev/null +++ b/bazaar/Map/Map.h @@ -0,0 +1,7 @@ +#ifndef MAP__MAP_H +#define MAP__MAP_H + +#include "MapView.h" +#include "MapSerialize.h" + +#endif diff --git a/bazaar/Map/Map.icpp b/bazaar/Map/Map.icpp new file mode 100644 index 000000000..26a776e54 --- /dev/null +++ b/bazaar/Map/Map.icpp @@ -0,0 +1,4 @@ +#include "Map.h" + +#define TFILE +#include diff --git a/bazaar/Map/Map.t b/bazaar/Map/Map.t new file mode 100644 index 000000000..c1a30395f --- /dev/null +++ b/bazaar/Map/Map.t @@ -0,0 +1,157 @@ +#ifdef _MSC_VER +#pragma setlocale("C") +#endif +// MapSerialize.h + +T_("Room properties") +ruRU("\320\241\320\262\320\276\320\271\321\201\321\202\320\262\320\260 \320\272\320\276\320\274\320\275\320\260\321\202\321\213") + +T_("Name") +ruRU("\320\235\320\260\320\267\320\262\320\260\320\275\320\270\320\265") + +T_("Sets the name of the room") +ruRU("\320\243\321\201\321\202\320\260\320\275\320\260\320\262\320\273\320\270\320\262\320\260\320\265\321\202 " + "\320\275\320\260\320\267\320\262\320\260\320\275\320\270\320\265 \320\264\320\273\321\217 " + "\320\272\320\276\320\274\320\275\320\260\321\202\321\213") + +T_("Description") +ruRU("\320\236\320\277\320\270\321\201\320\260\320\275\320\270\320\265") + +T_("Sets the description of the room") +ruRU("\320\243\321\201\321\202\320\260\320\275\320\260\320\262\320\273\320\270\320\262\320\260\320\265\321\202 " + "\320\276\320\277\320\270\321\201\320\260\320\275\320\270\320\265 \320\272\320\276\320\274\320\275\320\260\321\202\321\213") + +T_("Tags") +ruRU("\320\242\320\265\320\263\320\270") + +T_("Sets the tags of the room") +ruRU("\320\243\321\201\321\202\320\260\320\275\320\260\320\262\320\273\320\270\320\262\320\260\320\265\321\202 \321\202\320\265\320\263\320\270 \320\264\320\273\321\217 \320\277\320\276\320\270\321\201\320\272\320\260 \320\272\320\276\320\274\320\275\320\260\321\202\321\213") + +T_("Room number") +ruRU("\320\235\320\276\320\274\320\265\321\200 \320\272\320\276\320\274\320\275\320\260\321\202\321\213") + +T_("Sets the number of the room") +ruRU("\320\243\321\201\321\202\320\260\320\275\320\260\320\262\320\273\320\270\320\262\320\260\320\265\321\202 " + "\320\275\320\276\320\274\320\265\321\200 \320\272\320\276\320\274\320\275\320\260\321\202\321\213") + +T_("Logo path") +ruRU("\320\237\321\203\321\202\321\214 \320\272 \320\273\320\276\320\263\320\276\321\202\320\270\320\277\321\203") + +T_("Sets the path to the room logo") +ruRU("\320\243\321\201\321\202\320\260\320\275\320\260\320\262\320\273\320\270\320\262\320\260\320\265\321\202 " + "\320\277\321\203\321\202\321\214 \320\272 \321\204\320\260\320\271\320\273\321\203 " + "\320\273\320\276\320\263\320\276\321\202\320\270\320\277\320\260") + +T_("Discount properties") +ruRU("\320\241\320\262\320\276\320\271\321\201\321\202\320\262\320\260 \321\201\320\272\320\270\320\264\320\276\320\272") + +T_("Discount") +ruRU("\320\241\320\272\320\270\320\264\320\272\320\270, \320\272\320\276\320\273-\320\262\320\276") + +T_("Sets the number of the room discounts") +ruRU("\320\243\321\201\321\202\320\260\320\275\320\260\320\262\320\273\320\270\320\262\320\260\320\265\321\202 " + "\320\272\320\276\320\273-\320\262\320\276 \321\201\320\272\320\270\320\264\320\276\320\272 " + "\320\262 \321\215\321\202\320\276\320\274 \320\277\320\276\320\274\320\265\321\211\320\265\320\275\320\270\320\270") + +T_("Layer properties") +ruRU("\320\241\320\262\320\276\320\271\321\201\321\202\320\262\320\276 \321\201\320\273\320\276\321\217") + +T_("Sets the name of the layer") +ruRU("\320\243\321\201\321\202\320\260\320\275\320\260\320\262\320\273\320\270\320\262\320\260\320\265\321\202 " + "\320\275\320\260\320\267\320\262\320\260\320\275\320\270\320\265 \321\201\320\273\320\276\321\217") + +T_("Level properties") +ruRU("\320\241\320\262\320\276\320\271\321\201\321\202\320\262\320\260 \321\215\321\202\320\260\320\266\320\260/\321\203\321\200\320\276\320\262\320\275\321\217") + +T_("Sets the name of the level") +ruRU("\320\243\321\201\321\202\320\260\320\275\320\260\320\262\320\273\320\270\320\262\320\260\320\265\321\202 " + "\320\275\320\260\320\267\320\262\320\260\320\275\320\270\321\217 \320\264\320\273\321\217 " + "\321\215\321\202\320\260\320\266\320\260/\321\203\321\200\320\276\320\262\320\275\321\217") + +T_("Sets the description of the level") +ruRU("\320\243\321\201\321\202\320\260\320\275\320\260\320\262\320\273\320\270\320\262\320\260\320\265\321\202 " + "\320\276\320\277\320\270\321\201\320\260\320\275\320\270\320\265 \320\264\320\273\321\217 " + "\321\215\321\202\320\260\320\266\320\260/\321\203\321\200\320\276\320\262\320\275\321\217") + +T_("BG properties") +ruRU("\320\241\320\262\320\276\320\271\321\201\321\202\320\262\320\260 \320\272\320\260\321\200\321\202\321\213 " + "(\320\276\321\201\320\275\320\276\320\262\321\213)") + +T_("Source map image") +ruRU("\320\230\321\201\321\205\320\276\320\264\320\275\320\260\321\217 \320\272\320\260\321\200\321\202\320\260") + +T_("Sets the background map of the level") +ruRU("\320\243\321\201\321\202\320\260\320\275\320\260\320\262\320\273\320\270\320\262\320\260\320\265\321\202 " + "\320\270\320\267\320\276\320\261\321\200\320\260\320\266\320\265\320\275\320\270\320\265 " + "\320\272\320\260\321\200\321\202\321\213 \320\262 \321\204\320\276\320\275\320\265") + +T_("None selected") +ruRU("\320\235\320\265 \320\262\321\213\320\261\321\200\320\260\320\275\320\276") + +T_("Start page size") +ruRU("\320\235\320\260\321\207\320\260\320\273\321\214\320\275\321\213\320\271 " + "\321\200\320\260\320\267\320\274\320\265\321\200") + +T_("Sets the page size at the start of level calculation") +ruRU("\320\243\321\201\321\202\320\260\320\275\320\260\320\262\320\273\320\270\320\262\320\260\320\265\321\202 " + "\320\275\320\260\321\207\320\260\320\273\321\214\320\275\321\213\320\271 " + "\321\200\320\260\320\267\320\274\320\265\321\200 \320\272\320\260\321\200\321\202\321\213 " + "\320\264\320\273\321\217 \321\200\320\260\321\201\321\207\320\265\321\202\320\276\320\262 " + "(\320\277\321\200\320\270 \320\274\320\260\320\272\321\201\320\270\320\274\320\260\320\273\321\214\320\275\320\276\320\274 " + "\320\276\321\202\320\264\320\260\320\273\320\265\320\275\320\270\320\270)") + +T_("Mipmap size") +ruRU("\320\240\320\260\320\267\320\274\320\265\321\200 \321\217\321\207\320\265\320\271\320\272\320\270") + +T_("Sets the mipmap size") +ruRU("\320\243\321\201\321\202\320\260\320\275\320\260\320\262\320\273\320\270\320\262\320\260\320\265\321\202 " + "\321\200\320\260\320\267\320\274\320\265\321\200 \321\217\321\207\320\265\320\271\320\272\320\270 " + "\320\272\320\260\321\200\321\202\321\213 (\321\207\320\265\320\274 \320\274\320\265\320\275\321\214\321\210\320\265 " + "\321\200\320\260\320\267\320\274\320\265\321\200, \321\202\320\265\320\274 " + "\320\261\320\276\320\273\321\214\321\210\320\265 \321\204\320\260\320\271\320\273\320\276\320\262 " + "\320\261\321\203\320\264\320\265\321\202 \321\201\320\276\320\267\320\264\320\260\320\275\320\276") + +T_("Zoom step (dx)") +ruRU("\320\232\320\276\321\215\321\204. \321\203\320\262\320\265\320\273\320\270\321\207\320\265\320\275\320\270\321\217") + +T_("Sets the zoom value between two zoom levels") +ruRU("\320\243\321\201\321\202\320\260\320\275\320\260\320\262\320\273\320\270\320\262\320\260\320\265\321\202 " + "\320\272\320\276\321\215\321\204\321\204\320\270\321\206\320\270\320\265\320\275\321\202 " + "\321\203\320\262\320\265\320\273\320\270\321\207\320\265\320\275\320\270\321\217 " + "\320\276\321\202 \321\202\320\265\320\272\321\203\321\211\320\265\320\263\320\276 " + "\321\203\321\200\320\276\320\262\320\275\321\217 \320\267\321\203\320\274\320\260 " + "\320\272 \321\201\320\273\320\265\320\264\321\203\321\216\321\211\320\265\320\274\321\203 " + "(\321\207\320\265\320\274 \320\261\320\276\320\273\321\214\321\210\320\265 " + "\320\267\320\275\320\260\321\207\320\265\320\275\320\270\320\265, \321\202\320\265\320\274 " + "\321\201\320\270\320\273\321\214\320\275\320\265\320\265 \321\203\320\262\320\265\320\273\320\270\321\207\320\265\320\275\320\270\320\265 " + "\320\277\320\276\321\201\320\273\320\265 \320\277\321\200\320\270\320\261\320\273\320\270\320\266\320\265\320\275\320\270\321\217)") + +T_("Calculates mipmaps for the map background for zoom and translate") +ruRU("\320\240\320\260\321\201\321\201\321\207\320\270\321\202\321\213\320\262\320\260\320\265\321\202 " + "mipmap-\320\270\320\267\320\276\320\261\321\200\320\260\320\266\320\265\320\275\320\270\321\217 " + "\320\264\320\273\321\217 \320\276\321\201\320\275\320\276\320\262\321\213 " + "\320\272\320\260\321\200\321\202\321\213 \321\215\321\202\320\260\320\266\320\260 " + "(\320\264\320\273\321\217 \320\277\321\200\320\270\320\261\320\273\320\270\320\266\320\265\320\275\320\270\321\217 " + "\320\270 \321\201\320\274\320\265\321\211\320\265\320\275\320\270\321\217)") + +T_("Calculate") +ruRU("\320\240\320\260\321\201\321\201\321\207\320\270\321\202\320\260\321\202\321\214...") + +T_("Map properties") +ruRU("\320\241\320\262\320\276\320\271\321\201\321\202\320\262\320\260 \320\272\320\260\321\200\321\202\321\213") + +T_("Sets the name of the map") +ruRU("\320\243\321\201\321\202\320\260\320\275\320\260\320\262\320\273\320\270\320\262\320\260\320\265\321\202 " + "\320\275\320\260\320\267\320\262\320\260\320\275\320\270\320\265 \320\272\320\260\321\200\321\202\321\213") + + +// MapView.lay + +T_("X") +ruRU("") + + +// MapView.cpp + +T_("MapCtrl View") +ruRU("\320\237\321\200\320\276\321\201\320\274\320\276\321\202\321\200 \320\272\320\260\321\200\321\202\321\213") diff --git a/bazaar/Map/Map.upp b/bazaar/Map/Map.upp new file mode 100644 index 000000000..39264b7ad --- /dev/null +++ b/bazaar/Map/Map.upp @@ -0,0 +1,29 @@ +uses + CtrlLib, + MapBG, + FormEditorProperties; + +file + Map.t, + Map.h, + Map.icpp, + MapSerialize.h, + Map readonly separator, + MapLevel.iml, + MapLevel.h, + MapLevel.cpp, + MapEvents.cpp, + MapRender.cpp, + MapRenderInfo.cpp, + MapNavigation.cpp, + Viewer readonly separator, + MapView.lay, + MapView.iml, + MapView.h, + MapView.cpp, + MapViewEvents.cpp, + MapViewSearch.cpp; + +mainconfig + "" = "GUI SSE2"; + diff --git a/bazaar/Map/MapCtrl.iml b/bazaar/Map/MapCtrl.iml new file mode 100644 index 000000000..81ae6638b --- /dev/null +++ b/bazaar/Map/MapCtrl.iml @@ -0,0 +1,9 @@ +PREMULTIPLIED +IMAGE_ID(TestIcon) + +IMAGE_BEGIN_DATA +IMAGE_DATA(120,156,237,149,209,14,64,17,12,67,247,41,254,255,39,241,44,110,114,215,117,22,210,134,55,233,41,54,172,89,51,73) +IMAGE_DATA(66,213,231,248,154,21,204,236,44,8,155,149,193,235,201,204,16,241,137,102,96,236,1,245,96,222,33,226,197,174,225,155) +IMAGE_DATA(248,89,111,9,210,63,226,139,127,154,159,145,225,166,254,95,215,87,188,191,172,12,149,127,32,235,12,87,31,79,255,176) +IMAGE_DATA(106,104,231,249,119,70,217,145,12,44,182,39,75,22,83,122,83,3,28,41,138,196,0,0,0,0,0,0,0,0,0,0) +IMAGE_END_DATA(128, 1) diff --git a/bazaar/Map/MapEvents.cpp b/bazaar/Map/MapEvents.cpp new file mode 100644 index 000000000..8f4f6ed90 --- /dev/null +++ b/bazaar/Map/MapEvents.cpp @@ -0,0 +1,253 @@ +#include "MapLevel.h" + +bool MapLevel::Zoom(int level) +{ + _zoomLevel = level; + for (int i = 0; i < _layers.GetCount(); ++i) + if (_layers[i]) + { + if (!_layers[i]->Zoom(level)) + return false; + } + + return true; +} + +bool MapLevel::ProcessLeftDouble(Point p, dword keyflags) +{ + p = SceneToView(p); + + for (int i = 0; i < _layers.GetCount(); ++i) + if (_layers[i] && _layers[i]->IsShown()) + { + if (_layers[i]->ProcessLeftDouble(p, keyflags)) + { + Refresh(); + return true; + } + } + + bool r = IMapRender::ProcessLeftDouble(p, keyflags); + if (r) Refresh(); + return r; +} + +bool MapLevel::ProcessLeftDown(Point p, dword keyflags) +{ + p = SceneToView(p); + + DUMP(IsEditMode()); + if (IsEditMode()) + _currPoint = GetEditPointIndex(p); + + if (!_highQuality) + NoAA(); + +// StatesOff(STATE_SELECTED); + for (int i = 0; i < _layers.GetCount(); ++i) + if (_layers[i] && _layers[i]->IsShown()) + { + if (_layers[i]->ProcessLeftDown(p, keyflags)) + { + Refresh(); + return true; + } + } + + bool r = IMapRender::ProcessLeftDown(p, keyflags); + if (r) Refresh(); + return r; +} + +bool MapLevel::ProcessLeftDrag(Point p, dword keyflags) +{ + p = SceneToView(p); + + for (int i = 0; i < _layers.GetCount(); ++i) + if (_layers[i] && _layers[i]->IsShown()) + { + if (_layers[i]->ProcessLeftDrag(p, keyflags)) + { + Refresh(); + return true; + } + } + + bool r = IMapRender::ProcessLeftDrag(p, keyflags); + if (r) Refresh(); + return r; +} + +bool MapLevel::ProcessLeftUp(Point p, dword keyflags) +{ + p = SceneToView(p); + + if (IsEditMode()) + _currPoint = -1; + + for (int i = 0; i < _layers.GetCount(); ++i) + if (_layers[i] && _layers[i]->IsShown()) + { + if (_layers[i]->ProcessLeftUp(p, keyflags)) + { + Refresh(); + return true; + } + } + + bool r = IMapRender::ProcessLeftUp(p, keyflags); + if (!_highQuality) + Subpixel(); + if (r || !_highQuality) Refresh(); + return r; +} + +bool MapLevel::ProcessRightDouble(Point p, dword keyflags) +{ + p = SceneToView(p); + + for (int i = 0; i < _layers.GetCount(); ++i) + if (_layers[i] && _layers[i]->IsShown()) + { + if (_layers[i]->ProcessRightDouble(p, keyflags)) + { + Refresh(); + return true; + } + } + + bool r = IMapRender::ProcessRightDouble(p, keyflags); + if (r) Refresh(); + return r; +} + +bool MapLevel::ProcessRightDown(Point p, dword keyflags) +{ + p = SceneToView(p); + + if (IsEditMode()) + { + AddEditPoint(p); + WhenChangePoint(); + Refresh(); + } + + for (int i = 0; i < _layers.GetCount(); ++i) + if (_layers[i] && _layers[i]->IsShown()) + { + if (_layers[i]->ProcessRightDown(p, keyflags)) + { + Refresh(); + return true; + } + } + + bool r = IMapRender::ProcessRightDown(p, keyflags); + if (r) Refresh(); + return r; +} + +bool MapLevel::ProcessRightDrag(Point p, dword keyflags) +{ + p = SceneToView(p); + + for (int i = 0; i < _layers.GetCount(); ++i) + if (_layers[i] && _layers[i]->IsShown()) + { + if (_layers[i]->ProcessRightDrag(p, keyflags)) + { + Refresh(); + return true; + } + } + + bool r = IMapRender::ProcessRightDrag(p, keyflags); + if (r) Refresh(); + return r; +} + +bool MapLevel::ProcessRightUp(Point p, dword keyflags) +{ + p = SceneToView(p); + + for (int i = 0; i < _layers.GetCount(); ++i) + if (_layers[i] && _layers[i]->IsShown()) + { + if (_layers[i]->ProcessRightUp(p, keyflags)) + { + Refresh(); + return true; + } + } + + bool r = IMapRender::ProcessRightUp(p, keyflags); + if (r) Refresh(); + return r; +} + +bool MapLevel::ProcessMouseMove(Point p, dword keyflags) +{ + p = SceneToView(p); + + if (IsEditMode()) + { + _editModePos = p; + + if (_currPoint != -1) + { + SetEditPoint(_currPoint, p); + Refresh(); + return true; + } + } + + for (int i = 0; i < _layers.GetCount(); ++i) + if (_layers[i] && _layers[i]->IsShown()) + { + if (_layers[i]->ProcessMouseMove(p, keyflags)) + { + Refresh(); + return true; + } + } + + bool r = IMapRender::ProcessMouseMove(p, keyflags); + if (r) Refresh(); + return r; +} + +bool MapLevel::ProcessMouseEnter() +{ + for (int i = 0; i < _layers.GetCount(); ++i) + if (_layers[i] && _layers[i]->IsShown()) + { + if (_layers[i]->ProcessMouseEnter()) + { + Refresh(); + return true; + } + } + + bool r = IMapRender::ProcessMouseEnter(); + if (r) Refresh(); + return r; +} + +bool MapLevel::ProcessMouseLeave() +{ + for (int i = 0; i < _layers.GetCount(); ++i) + if (_layers[i] && _layers[i]->IsShown()) + { + if (_layers[i]->ProcessMouseLeave()) + { + Refresh(); + return true; + } + } + + bool r = IMapRender::ProcessMouseLeave(); + if (!_highQuality) + Subpixel(); + if (r || !_highQuality) Refresh(); + return r; +} diff --git a/bazaar/Map/MapLayer.iml b/bazaar/Map/MapLayer.iml new file mode 100644 index 000000000..81ae6638b --- /dev/null +++ b/bazaar/Map/MapLayer.iml @@ -0,0 +1,9 @@ +PREMULTIPLIED +IMAGE_ID(TestIcon) + +IMAGE_BEGIN_DATA +IMAGE_DATA(120,156,237,149,209,14,64,17,12,67,247,41,254,255,39,241,44,110,114,215,117,22,210,134,55,233,41,54,172,89,51,73) +IMAGE_DATA(66,213,231,248,154,21,204,236,44,8,155,149,193,235,201,204,16,241,137,102,96,236,1,245,96,222,33,226,197,174,225,155) +IMAGE_DATA(248,89,111,9,210,63,226,139,127,154,159,145,225,166,254,95,215,87,188,191,172,12,149,127,32,235,12,87,31,79,255,176) +IMAGE_DATA(106,104,231,249,119,70,217,145,12,44,182,39,75,22,83,122,83,3,28,41,138,196,0,0,0,0,0,0,0,0,0,0) +IMAGE_END_DATA(128, 1) diff --git a/bazaar/Map/MapLevel.cpp b/bazaar/Map/MapLevel.cpp new file mode 100644 index 000000000..f2ebe8c2f --- /dev/null +++ b/bazaar/Map/MapLevel.cpp @@ -0,0 +1,54 @@ +#include "MapLevel.h" + +#define IMAGECLASS MapLevelImg +#define IMAGEFILE +#include + +MapLevel::MapLevel() + : IMapRender(this), _highQuality(true), _editMode(false), _currPoint(-1), + _pagePos(Point(0, 0)), _editModePos(Point(0, 0)), _zoomLevel(-1) +{ + SetTopRender(this); + BackPaint(); +} + +void MapLevel::ClearBG() +{ + for (int i = 0; i < _layers.GetCount(); ++i) + if (_layers[i]) + delete _layers[i]; + _layers.Clear(); +} + +bool MapLevel::LoadMap(const char* fp) +{ + _zoomLevel = -1; + if (!AddLayer(0)->Load(fp)) + { + LOG("MapLevel: Error while creating MapBG-layer!"); + return false; + } + if (!LoadFromXMLFile(_zoomLevels, + AppendFileName( GetFileDirectory(fp), AppendExt(GetFileTitle(fp), ".zoom") ))) + { + LOG(NFormat("MapLevel: Error while loading zoom-levels from file %s", fp)); + return false; + } + + if (_zoomLevels.GetCount()) + _zoomLevel = 0; + + Subpixel(); + Zoom(_zoomLevel); + MoveTo(Point(0, 0)); + + return true; +} + +void MapLevel::UpdateMap() +{ + if (_layers.GetCount()) + if (_layers[0]) + _layers[0]->PerformState(PERFORM_INIT); + Refresh(); +} diff --git a/bazaar/Map/MapLevel.h b/bazaar/Map/MapLevel.h new file mode 100644 index 000000000..d3e3118ec --- /dev/null +++ b/bazaar/Map/MapLevel.h @@ -0,0 +1,199 @@ +#ifndef MAP_RENDER__MAP_RENDER_H +#define MAP_RENDER__MAP_RENDER_H + +#include +#include + +#define IMAGECLASS MapLevelImg +#define IMAGEFILE +#include + +class MapLevel : public Ctrl, public IMapRender +{ +public: + MapLevel(); + virtual ~MapLevel() { ClearBG(); } + + // render +public: + virtual void Render(Draw* w); + virtual void RenderInfo(Draw* w); + + virtual Rect GetRenderRect(); + virtual Point GetPageOffset(); + virtual Rect GetPageRect(); + + virtual void Layout() { PagePos(GetPagePos()); UpdateMap(); } + virtual void Paint(Draw& w); + virtual void ClearBG(); + virtual bool Zoom(int level); + virtual Rect GetRect(); + + virtual double GetZoom(int i) { return _zoomLevels[i].GetZoom(); } + virtual int GetZoomCount() { return _zoomLevels.GetCount(); } + virtual int GetCurrentZoom() { return _zoomLevel; } + + virtual void RefreshView(); + + // settings + bool LoadMap(const char* fp); + void UpdateMap(); + + template + Ptr AddLayer(int pos) + { + T* render = new T(this); + _layers.Add(pos, render); + Sort(_layers); + Refresh(); + return render; + } + + int GetRenderCount() { return _layers.GetCount(); } + Ptr GetRender(int i) { return _layers[i]; } + + MapLevel& HighQuality(bool flag = true) { _highQuality = flag; Refresh(); return *this; } + MapLevel& EditMode(bool flag = true) { _editMode = flag; Refresh(); return *this; } + MapLevel& NoEditMode() { EditMode(false); return *this; } + + // navigation +public: + MapLevel& PagePos(const Point& p); + + MapLevel& MoveTo(const Point& p); + MapLevel& MoveBy(const Point& p); + + MapLevel& ZoomTo(int zoom); + MapLevel& ZoomIn(); + MapLevel& ZoomOut(); + + virtual Point SceneToView(const Point& p); + virtual Size SceneToView(const Size& sz); + virtual Rect SceneToView(const Rect& rt); + virtual Point ViewToScene(const Point& p); + virtual Size ViewToScene(const Size& sz); + virtual Rect ViewToScene(const Rect& rt); + + virtual Array SceneToView(const Array& p); + virtual Vector SceneToView(const Vector& p); + + virtual Array ViewToScene(const Array& p); + virtual Vector ViewToScene(const Vector& p); + + virtual Rect CurrentViewRect(); + virtual Rect CurrentSceneRect(); + +protected: + Point PointZoomIn(); + Point PointZoomOut(); + + // events +public: + virtual void LeftDouble (Point p, dword keyflags) { ProcessLeftDown(p, keyflags); } + virtual void LeftDown (Point p, dword keyflags) { ProcessLeftDown(p, keyflags); } + virtual void LeftDrag (Point p, dword keyflags) { ProcessLeftDrag(p, keyflags); } + virtual void LeftUp (Point p, dword keyflags) { ProcessLeftUp (p, keyflags); } + + virtual void RightDouble(Point p, dword keyflags) { ProcessRightDown(p, keyflags); } + virtual void RightDrag (Point p, dword keyflags) { ProcessRightDrag(p, keyflags); } + virtual void RightUp (Point p, dword keyflags) { ProcessRightUp (p, keyflags); } + + virtual void MouseMove (Point p, dword keyflags) { ProcessMouseMove(p, keyflags); } + + virtual void MouseEnter() { ProcessMouseEnter(); Subpixel(); Refresh(); } + virtual void MouseLeave() { ProcessMouseLeave(); Subpixel(); Refresh(); } + + virtual bool ProcessLeftDouble (Point p, dword keyflags); + virtual bool ProcessLeftDown (Point p, dword keyflags); + virtual bool ProcessLeftDrag (Point p, dword keyflags); + virtual bool ProcessLeftUp (Point p, dword keyflags); + + virtual bool ProcessRightDouble(Point p, dword keyflags); + virtual bool ProcessRightDown (Point p, dword keyflags); + virtual bool ProcessRightDrag (Point p, dword keyflags); + virtual bool ProcessRightUp (Point p, dword keyflags); + + virtual bool ProcessMouseMove (Point p, dword keyflags); + + virtual bool ProcessMouseEnter(); + virtual bool ProcessMouseLeave(); + +public: + void SetLevelName(const char* name) { _levelName = name; } + void SetLevelDesc(const char* desc) { _levelDesc = desc; } + + String GetLevelName() const { return _levelName; } + String GetLevelDesc() const { return _levelDesc; } + + Point GetMousePos() const { return _editModePos; } + bool IsEditMode() const { return _editMode; } + + int GetEditPointIndex(const Point& p) const + { + Rect r(Point(p.x - 8, p.y - 8), Size(16, 16)); + for (int i = _editModePoints.GetCount() - 1; i >= 0; --i) + { + if (Rect(Point(_editModePoints[i].x - 8, _editModePoints[i].y - 8), Size(16, 16)) + .Intersects(r)) + return i; + } + + return -1; + } + + void SetEditPoint(int index, const Point& p) + { + if (index < 0 || index >= _editModePoints.GetCount()) + return; + _editModePoints[index] = p; + WhenChangePoint(); + } + + void AddEditPoint(const Point& p) + { + if (p.x < 0 || p.y < 0) + return; + + Rect r(Point(p.x - 8, p.y - 8), Size(16, 16)); + bool found = false; + + for (int i = _editModePoints.GetCount() - 1; i >= 0; --i) + { + Rect er(Point(_editModePoints[i].x - 8, _editModePoints[i].y - 8), Size(16, 16)); + if ( er.Intersects(r)) + { + _editModePoints.Remove(i); + found = true; + } + } + + if (!found) + _editModePoints << p; + else + _currPoint = -1; + + Refresh(); + } + + Callback WhenChangePoint; + void ClearEditPoints() { _editModePoints.Clear(); } + Array& GetEditPoints() { return _editModePoints; } + const Array& GetEditPoints() const { return _editModePoints; } + +private: + String _levelName; + String _levelDesc; + + int _currPoint; + bool _editMode; + Point _editModePos; + Array _editModePoints; + + bool _highQuality; + int _zoomLevel; + Point _pagePos; + Vector _zoomLevels; + VectorMap > _layers; +}; + +#endif diff --git a/bazaar/Map/MapLevel.iml b/bazaar/Map/MapLevel.iml new file mode 100644 index 000000000..744353e77 --- /dev/null +++ b/bazaar/Map/MapLevel.iml @@ -0,0 +1,57 @@ +PREMULTIPLIED +IMAGE_ID(TestIcon) + +IMAGE_BEGIN_DATA +IMAGE_DATA(120,156,197,87,75,108,148,85,20,102,71,103,58,239,233,204,252,175,153,41,180,208,74,75,11,27,59,21,73,0,165,198) +IMAGE_DATA(200,198,240,232,86,17,87,6,72,192,168,193,165,60,182,210,2,43,121,24,37,130,59,67,97,73,177,137,206,163,8,178) +IMAGE_DATA(22,116,11,46,69,87,208,30,207,119,206,189,119,166,165,152,248,72,252,147,63,255,63,247,191,247,60,191,243,157,51,171) +IMAGE_DATA(122,87,245,174,122,222,21,133,62,5,65,68,81,16,154,187,76,149,192,167,170,31,146,124,143,42,178,94,241,177,30,202) +IMAGE_DATA(93,13,42,84,246,3,26,88,187,94,246,96,45,100,57,144,133,189,229,40,112,103,158,167,119,107,237,101,209,181,198,243) +IMAGE_DATA(249,108,153,202,161,177,193,200,176,122,35,43,55,44,81,232,71,84,137,202,252,12,120,127,69,244,84,140,221,85,175,234) +IMAGE_DATA(108,47,123,145,216,104,237,133,174,78,221,59,95,153,112,123,195,48,164,163,147,69,154,59,157,165,199,179,49,122,120,61) +IMAGE_DATA(65,51,39,178,244,210,144,199,49,240,105,67,95,72,123,182,151,232,220,225,30,58,195,247,217,247,10,244,201,254,60,175) +IMAGE_DATA(21,37,110,216,83,227,189,223,156,202,210,163,153,4,253,113,51,70,119,46,165,233,232,190,28,199,200,99,27,61,177,127) +IMAGE_DATA(203,120,219,134,106,24,72,188,134,251,2,154,155,206,18,53,98,180,216,140,241,179,155,159,221,68,205,184,60,111,95,204) +IMAGE_DATA(16,213,241,59,205,119,146,191,175,166,133,249,184,121,79,208,227,155,9,186,117,134,207,55,19,230,92,194,157,93,228,239) +IMAGE_DATA(119,47,229,104,195,154,192,248,169,185,216,52,50,42,239,240,251,242,177,30,149,85,231,115,173,120,91,78,67,109,160,150) +IMAGE_DATA(202,211,59,161,119,195,124,103,155,173,46,61,23,163,167,173,152,232,21,153,114,175,166,111,167,50,28,163,178,196,27,186) +IMAGE_DATA(45,46,198,55,150,88,111,151,145,157,84,253,117,227,67,203,250,147,164,133,70,220,252,142,233,154,253,214,74,169,46,190) +IMAGE_DATA(23,69,78,178,109,31,191,139,61,198,230,137,177,162,224,0,184,129,239,200,199,185,131,5,145,5,155,23,90,122,22,239) +IMAGE_DATA(98,71,195,196,3,178,90,73,151,27,177,181,158,146,111,139,236,155,205,195,194,188,137,83,163,187,35,134,106,243,2,251) +IMAGE_DATA(52,117,168,232,234,107,185,126,181,89,125,134,255,54,142,118,77,100,179,92,213,1,27,77,12,172,222,70,186,141,155,150) +IMAGE_DATA(205,163,137,105,61,38,121,58,123,40,47,120,179,181,130,231,201,253,158,200,178,120,83,95,227,138,5,232,107,116,41,214) +IMAGE_DATA(144,103,19,115,205,109,98,9,70,229,140,141,153,137,63,246,225,22,91,249,247,244,161,130,212,137,112,135,169,243,26,242) +IMAGE_DATA(223,138,59,236,203,94,150,137,39,244,222,255,58,41,245,164,177,79,168,45,136,187,201,141,172,127,159,113,113,110,99,47) +IMAGE_DATA(174,241,179,118,242,222,218,70,95,240,135,123,116,100,88,108,64,237,126,249,113,182,237,87,75,113,123,249,88,142,134,214) +IMAGE_DATA(250,194,111,176,119,124,56,162,7,87,172,111,49,250,109,54,33,124,128,250,65,93,157,120,187,224,242,45,50,108,45,3) +IMAGE_DATA(131,188,246,197,71,25,229,39,214,185,105,100,179,242,165,175,220,243,193,222,156,201,153,198,109,238,116,74,245,250,85,122) +IMAGE_DATA(119,87,145,118,214,60,193,203,96,191,47,181,142,125,88,131,31,101,191,40,252,183,123,155,199,156,211,81,51,245,132,195) +IMAGE_DATA(21,236,120,113,132,237,12,139,194,157,150,127,148,107,203,52,59,157,113,251,16,183,55,119,148,132,135,107,236,51,226,6) +IMAGE_DATA(110,170,24,62,159,57,94,160,107,39,211,242,187,55,8,196,255,137,49,175,125,190,97,114,216,104,199,29,24,250,112,111) +IMAGE_DATA(129,117,85,69,110,103,207,1,30,144,95,173,85,173,155,73,214,143,88,237,28,11,68,230,157,11,41,135,89,112,213,150) +IMAGE_DATA(33,229,14,241,159,249,127,254,66,218,97,66,242,216,140,153,88,26,30,152,239,102,236,103,159,233,69,218,23,124,199,19) +IMAGE_DATA(90,71,49,193,41,108,67,14,128,3,216,30,68,90,47,211,135,179,242,13,121,12,3,143,227,94,112,124,235,248,203,242) +IMAGE_DATA(143,173,101,182,227,135,139,41,215,59,157,255,166,6,159,182,86,27,44,91,238,78,74,62,97,27,48,16,153,154,69,220) +IMAGE_DATA(107,67,129,244,100,93,243,105,238,211,188,244,24,244,41,96,228,29,198,203,157,243,153,165,245,140,30,112,49,237,228,44) +IMAGE_DATA(209,207,54,89,140,90,174,87,174,141,211,47,87,146,226,47,244,62,186,145,228,126,152,119,125,25,121,223,205,121,218,49) +IMAGE_DATA(86,146,181,161,126,224,165,104,234,219,167,123,156,19,200,65,189,226,137,254,132,126,220,153,127,244,63,244,198,159,175,166) +IMAGE_DATA(149,191,90,93,38,110,202,59,100,121,189,145,146,167,250,168,115,0,244,156,57,152,211,25,133,101,94,59,158,98,158,79) +IMAGE_DATA(209,216,176,39,62,238,223,149,215,190,49,175,62,77,29,236,121,198,127,197,80,72,51,167,114,244,164,217,213,198,160,229) +IMAGE_DATA(150,219,73,99,79,23,199,32,47,113,135,223,152,41,118,111,247,233,238,133,172,244,52,172,221,251,44,35,186,246,240,58) +IMAGE_DATA(106,108,223,54,95,207,214,181,15,29,120,157,245,115,253,128,111,58,241,143,94,116,224,141,130,244,49,219,179,44,15,144) +IMAGE_DATA(201,9,120,103,176,95,115,37,250,57,110,192,211,131,175,210,110,246,1,102,49,179,68,6,211,71,246,230,197,23,96,26) +IMAGE_DATA(243,140,114,110,176,4,255,3,235,214,147,229,32,156,237,196,139,229,82,244,68,212,155,230,189,44,49,56,241,86,206,196) +IMAGE_DATA(54,193,216,203,152,218,212,121,12,178,6,120,158,249,245,134,241,133,253,7,126,144,35,212,211,242,249,15,121,132,79,71) +IMAGE_DATA(38,123,58,102,13,211,231,235,90,83,143,103,185,119,30,206,115,175,204,115,174,50,142,131,237,140,240,227,249,148,204,110) +IMAGE_DATA(147,219,74,194,229,191,223,50,223,217,23,188,131,251,108,223,125,86,127,187,23,2,179,228,250,85,91,190,205,161,173,205) +IMAGE_DATA(206,58,117,115,150,237,187,166,7,219,30,57,45,61,55,20,158,30,29,29,93,113,14,6,143,34,190,168,109,244,21,199) +IMAGE_DATA(157,205,165,115,137,244,148,14,94,117,58,155,166,47,202,124,104,99,147,228,153,75,251,8,124,172,172,224,187,189,48,143) +IMAGE_DATA(33,63,216,3,46,71,204,158,218,89,198,206,37,174,223,118,155,25,44,166,53,139,249,199,205,29,113,23,151,159,174,164) +IMAGE_DATA(164,95,129,243,87,138,251,242,107,176,111,64,106,90,102,2,174,243,251,87,149,63,68,87,35,177,44,206,172,231,59,147) +IMAGE_DATA(147,70,183,241,221,204,65,252,237,243,99,89,199,11,240,169,115,230,254,171,107,96,221,160,235,115,192,50,106,10,177,104) +IMAGE_DATA(251,219,145,27,206,201,147,121,211,103,234,186,142,62,54,185,221,115,120,138,254,134,110,123,109,222,52,226,234,8,220,130) +IMAGE_DATA(25,228,253,201,60,205,78,101,59,112,215,198,255,195,235,113,169,175,125,252,63,164,151,185,5,103,241,31,9,231,39,94) +IMAGE_DATA(125,237,111,233,238,188,214,120,101,238,121,190,240,131,198,209,23,238,222,208,231,203,124,128,217,199,250,104,251,136,252,231) +IMAGE_DATA(227,126,60,216,191,238,31,235,93,126,161,54,42,94,32,186,43,65,73,245,132,190,235,165,194,43,38,95,47,244,253,119) +IMAGE_DATA(122,87,186,182,142,215,220,188,167,207,240,95,197,248,255,188,254,4,184,236,29,214,0,0,0,0,0,0,0,0,0,0) +IMAGE_END_DATA(1664, 1) diff --git a/bazaar/Map/MapNavigation.cpp b/bazaar/Map/MapNavigation.cpp new file mode 100644 index 000000000..960b2e4e4 --- /dev/null +++ b/bazaar/Map/MapNavigation.cpp @@ -0,0 +1,260 @@ +#include "MapLevel.h" + +MapLevel& MapLevel::PagePos(const Point& p) +{ + Size rsz = GetRenderSize(); + Size psz = GetPageSize(); + + if ( psz.cx < rsz.cx ) + { + if (p.x < 0) + _pagePos.x = 0; + else if (p.x >= rsz.cx - psz.cx) + _pagePos.x = rsz.cx - psz.cx - 1; + else + _pagePos.x = p.x; + } + else + { + _pagePos.x = 0; + } + + if ( psz.cy < rsz.cy ) + { + if (p.y < 0) + _pagePos.y = 0; + else if (p.y >= rsz.cy - psz.cy) + _pagePos.y = rsz.cy - psz.cy - 1; + else + _pagePos.y = p.y; + } + else + { + _pagePos.y = 0; + } + + return *this; +} + +MapLevel& MapLevel::MoveTo(const Point& p) +{ + PagePos(p); + UpdateMap(); + return *this; +} + +MapLevel& MapLevel::MoveBy(const Point& p) +{ + PagePos(GetPagePos() + p); + UpdateMap(); + return *this; +} + +Point MapLevel::PointZoomIn() +{ + if (!_zoomLevels.GetCount()) + return Point(0, 0); + + int newZoom = _zoomLevel + 1; + if (newZoom >= _zoomLevels.GetCount()) + return Point(0, 0); + + _zoomLevel = newZoom; + + // before + Point s = GetPagePos(); + Size ss = GetSize(); + + // after + double x = (double)s.x * _zoomLevels[_zoomLevel].GetZoom(); + double y = (double)s.y * _zoomLevels[_zoomLevel].GetZoom(); + + double cx = (double)ss.cx * _zoomLevels[_zoomLevel].GetZoom(); + double cy = (double)ss.cy * _zoomLevels[_zoomLevel].GetZoom(); + + // calculating new pos + x -= (ss.cx - cx) / 2; + y -= (ss.cy - cy) / 2; + Point pos = Point((int)x, (int)y); + + return pos; +} + +Point MapLevel::PointZoomOut() +{ + if (!_zoomLevels.GetCount()) + return Point(0, 0); + + int newZoom = _zoomLevel - 1; + if (newZoom < 0) + return Point(0, 0); + + _zoomLevel = newZoom; + + // before + Point s = GetPagePos(); + Size ss = GetPageSize(); + + // after + double x = (double)s.x / _zoomLevels[_zoomLevel].GetZoom(); + double y = (double)s.y / _zoomLevels[_zoomLevel].GetZoom(); + + double cx = (double)ss.cx / _zoomLevels[_zoomLevel].GetZoom(); + double cy = (double)ss.cy / _zoomLevels[_zoomLevel].GetZoom(); + + // calculating new pos + x -= (ss.cx - cx) / 2; + y -= (ss.cy - cy) / 2; + Point pos = Point((int)x, (int)y); + + return pos; +} + +MapLevel& MapLevel::ZoomTo(int zoom) +{ + if (zoom == _zoomLevel) + return *this; + + Point pos = Point(0, 0); + + if (zoom > _zoomLevel) + { + for (int i = _zoomLevel; i < zoom; ++i) + pos = PointZoomIn(); + } + + if (zoom < _zoomLevel) + { + for (int i = _zoomLevel; i > zoom; --i) + pos = PointZoomOut(); + } + + Zoom(_zoomLevel); + MoveTo(pos); + + return *this; +} + +MapLevel& MapLevel::ZoomIn() +{ + Point pos = PointZoomIn(); + Zoom(_zoomLevel); + MoveTo(pos); + return *this; +} + +MapLevel& MapLevel::ZoomOut() +{ + Point pos = PointZoomOut(); + Zoom(_zoomLevel); + MoveTo(pos); + return *this; +} + +Point MapLevel::SceneToView(const Point& p) +{ + if (!GetZoomCount()) + return p; + + Point res = p - GetPageOffset() + GetPagePos(); + for (int i = GetCurrentZoom() + 1; i < GetZoomCount(); ++i) + res = Point((double)res.x * GetZoom(i), (double)res.y * GetZoom(i)); + + return res; +} + +Point MapLevel::ViewToScene(const Point& p) +{ + if (!GetZoomCount()) + return p; + + Point res = p; + for (int i = GetZoomCount() - 1; i > GetCurrentZoom(); --i) + res = Point((double)res.x / GetZoom(i), (double)res.y / GetZoom(i)); + + return res + GetPageOffset() - GetPagePos(); +} + +Size MapLevel::SceneToView(const Size& p) +{ + if (!GetZoomCount()) + return p; + + Size res = p; + for (int i = GetCurrentZoom() + 1; i < GetZoomCount(); ++i) + res = Size((double)res.cx * GetZoom(i), (double)res.cy * GetZoom(i)); + + return res; +} + +Size MapLevel::ViewToScene(const Size& p) +{ + if (!GetZoomCount()) + return p; + + Size res = p; + for (int i = GetZoomCount() - 1; i > GetCurrentZoom(); --i) + res = Size((double)res.cx / GetZoom(i), (double)res.cx / GetZoom(i)); + + return res; +} + +Rect MapLevel::SceneToView(const Rect& rt) +{ + return GetZoomCount() > 0 ? Rect(SceneToView(rt.TopLeft()), SceneToView(rt.GetSize())) : rt; +} + +Rect MapLevel::ViewToScene(const Rect& rt) +{ + return GetZoomCount() > 0 ? Rect(ViewToScene(rt.TopLeft()), ViewToScene(rt.GetSize())) : rt; +} + +Array MapLevel::SceneToView(const Array& p) +{ + if (!GetZoomCount()) + return p; + Array res; + for (int i = 0; i < p.GetCount(); ++i) + res << SceneToView(p[i]); + return res; +} + +Array MapLevel::ViewToScene(const Array& p) +{ + if (!GetZoomCount()) + return p; + Array res; + for (int i = 0; i < p.GetCount(); ++i) + res << ViewToScene(p[i]); + return res; +} + +Vector MapLevel::SceneToView(const Vector& p) +{ + if (!GetZoomCount()) + return p; + Vector res; + for (int i = 0; i < p.GetCount(); ++i) + res << SceneToView(p[i]); + return res; +} + +Vector MapLevel::ViewToScene(const Vector& p) +{ + if (!GetZoomCount()) + return p; + Vector res; + for (int i = 0; i < p.GetCount(); ++i) + res << ViewToScene(p[i]); + return res; +} + +Rect MapLevel::CurrentViewRect() +{ + return SceneToView(CurrentSceneRect()); +} + +Rect MapLevel::CurrentSceneRect() +{ + return GetPageRect() - GetPagePos(); +} diff --git a/bazaar/Map/MapRender.cpp b/bazaar/Map/MapRender.cpp new file mode 100644 index 000000000..5afe3e387 --- /dev/null +++ b/bazaar/Map/MapRender.cpp @@ -0,0 +1,51 @@ +#include "MapLevel.h" + +void MapLevel::Paint(Draw& w) +{ + w.DrawRect(Ctrl::GetSize(), SColorPaper()); + Render(&w); +} + +void MapLevel::Render(Draw* w) +{ + for (int i = 0; i < _layers.GetCount(); ++i) + if (_layers[i] && _layers[i]->IsShown()) + _layers[i]->Render(w); + IMapRender::Render(w); + RenderInfo(w); + + if (IsEditMode()) + for (int i = 0; i < _editModePoints.GetCount(); ++i) + { + Point p = ViewToScene(_editModePoints[i]); + Rect r(Point(p.x - 4, p.y - 4), Size(8, 8)); + + w->DrawRect(r, Black()); + r.Deflate(1, 1); + + w->DrawRect(r, LtRed()); + } +} + +void RenderText(Draw* w, Point pos, const char* text) +{ + Size sz = GetTextSize(text, StdFont()); + Rect r(pos, sz + Size(8, 8)); + w->DrawRect(r, Black()); + r.Deflate(1, 1); + w->DrawRect(r, White()); + w->DrawText(pos.x + 4, pos.y + 4, text); +} + +void MapLevel::RenderInfo(Draw* w) +{ + if (!IsEditMode()) + return; + +// RenderText(w, Point(100, 11), "Pos: " + GetMousePos().ToString()); +} + +void MapLevel::RefreshView() +{ + Refresh(); +} diff --git a/bazaar/Map/MapRenderInfo.cpp b/bazaar/Map/MapRenderInfo.cpp new file mode 100644 index 000000000..9666424b7 --- /dev/null +++ b/bazaar/Map/MapRenderInfo.cpp @@ -0,0 +1,52 @@ +#include "MapLevel.h" + +Rect MapLevel::GetRect() +{ + Point p1(INT_MAX, INT_MAX); + Point p2(INT_MIN, INT_MIN); + + bool found = false; + for (int i = 0; i < _layers.GetCount(); ++i) + if (_layers[i]) + { + Rect r = _layers[i]->GetRenderRect(); + + if (r.BottomRight().x > p2.x) + p2.x = r.BottomRight().x; + + if (r.BottomRight().y > p2.y) + p2.y = r.BottomRight().y; + + if (r.TopLeft().x < p1.x) + p1.x = r.TopLeft().x; + + if (r.TopLeft().y < p1.y) + p1.y = r.TopLeft().y; + + found = true; + } + + return found ? Rect(p1, p2) : Rect(Point(0, 0), Size(0, 0)); +} + +Point MapLevel::GetPageOffset() +{ + Size rsz = GetRenderSize(); + Size psz = GetPageSize(); + Point r = Point(0, 0); + + if (rsz.cx < psz.cx) r.x = (psz.cx - rsz.cx) / 2; + if (rsz.cy < psz.cy) r.y = (psz.cy - rsz.cy) / 2; + + return r; +} + +Rect MapLevel::GetRenderRect() +{ + return GetRect(); +} + +Rect MapLevel::GetPageRect() +{ + return Rect(_pagePos, GetSize()); +} diff --git a/bazaar/Map/MapSerialize.h b/bazaar/Map/MapSerialize.h new file mode 100644 index 000000000..23022404b --- /dev/null +++ b/bazaar/Map/MapSerialize.h @@ -0,0 +1,413 @@ +#ifndef MAP__MAP_SERIALIZE_H +#define MAP__MAP_SERIALIZE_H + +#include +using namespace Upp; + +#include + +inline int CharFilterMapName(int c) +{ + return c >= 32 && c < 128 && c != '\"' ? c : 0; +} + +class MapItemProp : public PropertiesBase +{ +public: + MapItemProp() : PropertiesBase(this) {} +}; + +class Room : public MapItemProp +{ + typedef Room CLASSNAME; + +public: + Room() : number(0), discount(0) {} + virtual ~Room() {} + + PROPS_INIT_PROPERTIES + PROPS_DEFINE_PROPERTY(SetName, GetName) + PROPS_GROUP(t_("Room properties")) + PROPS_NAME(t_("Name")) + PROPS_HINT(t_("Sets the name of the room")) + PROPS_TYPE(CEditField(), true) + PROPS_PROPERTY_END + + PROPS_DEFINE_PROPERTY(SetDesc, GetDesc) + PROPS_GROUP(t_("Room properties")) + PROPS_NAME(t_("Description")) + PROPS_HINT(t_("Sets the description of the room")) + PROPS_TYPE(CDocEdit(), true) + PROPS_PROPERTY_END + + PROPS_DEFINE_PROPERTY(SetTags, GetTags) + PROPS_GROUP(t_("Room properties")) + PROPS_NAME(t_("Tags")) + PROPS_HINT(t_("Sets the tags of the room")) + PROPS_TYPE(CEditField(), true) + PROPS_PROPERTY_END + + PROPS_DEFINE_PROPERTY(SetNumber, GetNumber) + PROPS_GROUP(t_("Room properties")) + PROPS_NAME(t_("Room number")) + PROPS_HINT(t_("Sets the number of the room")) + PROPS_TYPE(CEditIntSpin(0, INT_MAX), true) + PROPS_PROPERTY_END + + PROPS_DEFINE_PROPERTY(SetLogoPath, GetLogoPath) + PROPS_GROUP(t_("Room properties")) + PROPS_NAME(t_("Logo path")) + PROPS_HINT(t_("Sets the path to the room logo")) + PROPS_TYPE(CEditField(), true) + PROPS_PROPERTY_END + + PROPS_DEFINE_PROPERTY(SetDiscount, GetDiscount) + PROPS_GROUP(t_("Discount properties")) + PROPS_NAME(t_("Discount")) + PROPS_HINT(t_("Sets the number of the room discounts")) + PROPS_TYPE(CEditIntSpin(0, INT_MAX), true) + PROPS_PROPERTY_END + PROPS_INIT_PROPERTIES_END + + PROPS_METHOD_SET(SetName, void, const char*); + PROPS_METHOD_GET(GetName, String); + + PROPS_METHOD_SET(SetDesc, void, const char*); + PROPS_METHOD_GET(GetDesc, String); + + PROPS_METHOD_SET(SetTags, void, const char*); + PROPS_METHOD_GET(GetTags, String); + + PROPS_METHOD_SET(SetNumber, void, int); + PROPS_METHOD_GET(GetNumber, int); + + PROPS_METHOD_SET(SetDiscount, void, int); + PROPS_METHOD_GET(GetDiscount, int); + + PROPS_METHOD_SET(SetLogoPath, void, const char*); + PROPS_METHOD_GET(GetLogoPath, String); + +public: + void SetName(const char* s) { name = s; } + String GetName() const { return name; } + + void SetDesc(const char* s) { desc = s; } + String GetDesc() const { return desc; } + + void SetTags(const char* s) { tags = s; } + String GetTags() const { return tags; } + + void SetNumber(int n) { number = n; } + int GetNumber() const { return number; } + + void SetDiscount(int n) { discount = n; } + int GetDiscount() const { return discount; } + + void SetLogoPath(const char* s) { logo = s; } + String GetLogoPath() const { return logo; } + + Room& AddVertice(const Point& p) { vertices.Add(p); return *this; } + Room& AddVertice(int x, int y) { vertices.Add(Point(x, y)); return *this; } + + Array& GetVertices() { return vertices; } + const Array& GetVertices() const { return vertices; } + +public: + void Xmlize(XmlIO& xml) + { + xml ("polygon", "point", vertices) + ("number", number) + ("logo", logo) + ("name", name) + ("desc", desc) + ("tags", tags) + ("discount", discount); + } + +public: + Room(const Room& other) + { + vertices <<= other.vertices; + number = other.number; + logo = other.logo; + name = other.name; + desc = other.desc; + tags = other.tags; + discount = other.discount; + } + + Room& operator=(const Room& other) + { + vertices <<= other.vertices; + number = other.number; + logo = other.logo; + name = other.name; + desc = other.desc; + tags = other.tags; + discount = other.discount; + return *this; + } + + void SetRoom(const Room& other) + { + *this = other; + } + +protected: + Array vertices; + String logo; + String name; + String desc; + String tags; + int discount; + int number; +}; + +class Layer : public MapItemProp +{ + typedef Layer CLASSNAME; + +public: + virtual ~Layer() {} + + PROPS_INIT_PROPERTIES + PROPS_DEFINE_PROPERTY(SetName, GetName) + PROPS_GROUP(t_("Layer properties")) + PROPS_NAME(t_("Name")) + PROPS_HINT(t_("Sets the name of the layer")) + PROPS_TYPE(CEditField(), true) + PROPS_PROPERTY_END + PROPS_INIT_PROPERTIES_END + + PROPS_METHOD_SET(SetName, void, const char*); + PROPS_METHOD_GET(GetName, String); + +public: + void SetName(const char* s) { name = s; } + String GetName() const { return name; } + + Array& GetRooms() { return rooms; } + const Array& GetRooms() const { return rooms; } + +public: + void Xmlize(XmlIO& xml) + { + xml ("name", name) + ("rooms", "room", rooms); + } + +public: + Layer() {} + Layer(const Layer& other) + { + rooms <<= other.rooms; + name = other.name; + } + +private: + Array rooms; + String name; +}; + +class Level : public MapItemProp +{ + typedef Level CLASSNAME; + +public: + Level() + : zoomDX(1.2), + pageSize(Size(736, 420)), + cellSize(Size(128, 128)) + {} + virtual ~Level() {} + + PROPS_INIT_PROPERTIES + // Level properties + PROPS_DEFINE_PROPERTY(SetName, GetName) + PROPS_GROUP(t_("Level properties")) + PROPS_NAME(t_("Name")) + PROPS_HINT(t_("Sets the name of the level")) + PROPS_TYPE(CEditField(), true) + PROPS_PROPERTY_END + + PROPS_DEFINE_PROPERTY(SetDesc, GetDesc) + PROPS_GROUP(t_("Level properties")) + PROPS_NAME(t_("Description")) + PROPS_HINT(t_("Sets the description of the level")) + PROPS_TYPE(CDocEdit(), true) + PROPS_PROPERTY_END + + // BG properties + PROPS_DEFINE_PROPERTY(SetMapBG, GetMapBG) + PROPS_GROUP(t_("BG properties")) + PROPS_DEFAULT("") + PROPS_NAME(t_("Source map image")) + PROPS_HINT(t_("Sets the background map of the level")) + PROPS_TYPE(CDropList(FillMapList(VectorMapEx() + .Add(t_("None selected"), ""))), true) + PROPS_PROPERTY_END + + PROPS_DEFINE_PROPERTY(SetPageSize, GetPageSize) + PROPS_GROUP(t_("BG properties")) + PROPS_NAME(t_("Start page size")) + PROPS_HINT(t_("Sets the page size at the start of level calculation")) + PROPS_TYPE(CEditSize(100, INT_MAX), true) + PROPS_PROPERTY_END + + PROPS_DEFINE_PROPERTY(SetCellSize, GetCellSize) + PROPS_GROUP(t_("BG properties")) + PROPS_NAME(t_("Mipmap size")) + PROPS_HINT(t_("Sets the mipmap size")) + PROPS_TYPE(CEditSize(100, INT_MAX), true) + PROPS_PROPERTY_END + + PROPS_DEFINE_PROPERTY(SetZoomDX, GetZoomDX) + PROPS_GROUP(t_("BG properties")) + PROPS_NAME(t_("Zoom step (dx)")) + PROPS_HINT(t_("Sets the zoom value between two zoom levels")) + PROPS_TYPE(CEditDouble(1.0, (double)INT_MAX), true) + PROPS_PROPERTY_END + + PROPS_DEFINE_PROPERTY(SetNull, GetNull) + PROPS_GROUP(t_("BG properties")) + PROPS_NAME("") + PROPS_HINT(t_("Calculates mipmaps for the map background for zoom and translate")) + PROPS_TYPE(CButton(t_("Calculate"), THISBACK(OnCalculate)), true) + PROPS_PROPERTY_END + PROPS_INIT_PROPERTIES_END + + PROPS_METHOD_SET(SetName, void, const char*); + PROPS_METHOD_GET(GetName, String); + + PROPS_METHOD_SET(SetDesc, void, const char*); + PROPS_METHOD_GET(GetDesc, String); + + PROPS_METHOD_SET(SetMapBG, void, const char*); + PROPS_METHOD_GET(GetMapBG, String); + + PROPS_METHOD_SET(SetZoomDX, void, double); + PROPS_METHOD_GET(GetZoomDX, double); + + PROPS_METHOD_SET(SetPageSize, void, const Size&); + PROPS_METHOD_GET(GetPageSize, Size); + + PROPS_METHOD_SET(SetCellSize, void, const Size&); + PROPS_METHOD_GET(GetCellSize, Size); + + PROPS_METHOD_SET(SetNull, void, const char*); + PROPS_METHOD_GET(GetNull, String); + +public: + void SetName(const char* s) { name = s; } + String GetName() const { return name; } + + void SetDesc(const char* s) { desc = s; } + String GetDesc() const { return desc; } + + void SetMapBG(const char* s) { mapPath = s; } + String GetMapBG() const { return mapPath; } + + void SetZoomDX(double n) { zoomDX = n; } + double GetZoomDX() const { return zoomDX; } + + void SetPageSize(const Size& sz) { pageSize = sz; } + Size GetPageSize() { return pageSize; } + + void SetCellSize(const Size& sz) { cellSize = sz; } + Size GetCellSize() { return cellSize; } + + void SetNull(const char* s) {} + String GetNull() { return String(); } + + Array& GetLayers() { return layers; } + const Array& GetLayers() const { return layers; } + + VectorMapEx& FillMapList(VectorMapEx& mapList) + { + WhenMapList(mapList); + return mapList; + } + + void OnCalculate() { WhenCalculate(*this); } + Callback1 WhenCalculate; + Callback1&> WhenMapList; + +public: + void Xmlize(XmlIO& xml) + { + xml ("name", name) + ("desc", desc) + ("zoomDX", zoomDX) + ("mapPath", mapPath) + ("pageSize", pageSize) + ("cellSize", cellSize) + ("layers", "layer", layers); + } + +public: + Level(const Level& other) + { + pageSize = other.pageSize; + cellSize = other.cellSize; + zoomDX = other.zoomDX; + name = other.name; + desc = other.desc; + mapPath = other.mapPath; + layers <<= other.layers; + } + +private: + Size pageSize; + Size cellSize; + double zoomDX; + String name; + String desc; + String mapPath; + Array layers; +}; + +class Map : public MapItemProp +{ + typedef Map CLASSNAME; + +public: + virtual ~Map() {} + + PROPS_INIT_PROPERTIES + PROPS_DEFINE_PROPERTY(SetName, GetName) + PROPS_GROUP(t_("Map properties")) + PROPS_NAME(t_("Name")) + PROPS_HINT(t_("Sets the name of the map")) + PROPS_TYPE(CEditField(CharFilterMapName), true) + PROPS_PROPERTY_END + PROPS_INIT_PROPERTIES_END + + PROPS_METHOD_SET(SetName, void, const char*); + PROPS_METHOD_GET(GetName, String); + +public: + void SetName(const char* s) { _name = s; } + String GetName() const { return _name; } + + Array& GetLevels() { return _levels; } + const Array& GetLevels() const { return _levels; } + +public: + void Xmlize(XmlIO& xml) + { + xml ("_name", _name) + ("_levels", "level", _levels); + } + + void Clear() + { + _levels.Clear(); + _name .Clear(); + } + +private: + Array _levels; + String _name; +}; + +#endif diff --git a/bazaar/Map/MapView.cpp b/bazaar/Map/MapView.cpp new file mode 100644 index 000000000..560d98a09 --- /dev/null +++ b/bazaar/Map/MapView.cpp @@ -0,0 +1,316 @@ +#include "MapView.h" + +#define IMAGECLASS MapViewImg +#define IMAGEFILE +#include + +#define SetButtonStyle(but,im1,im2) \ + static Button::Style but##_style = Button::StyleNormal(); \ + but##_style.look[0] = MapViewImg::im1(); \ + but##_style.look[1] = MapViewImg::im1(); \ + but##_style.look[2] = MapViewImg::im2(); \ + but##_style.look[3] = MapViewImg::im2(); \ + but.SetStyle(but##_style); + +MapView::MapView() +{ + CtrlLayout(*this, t_("MapCtrl View")); + MinimizeBox().MinimizeBox().Sizeable(); + + // init values + _mousePos = Point(0, 0); + _drag = false; + _move = false; + _level = -1; + + HideZoomSlider(); + HideSearch(); + + // init layout + ZoomInBtn .NoWantFocus(); + ZoomOutBtn .NoWantFocus(); + + MoveUpBtn .NoWantFocus(); + MoveDownBtn .NoWantFocus(); + MoveLeftBtn .NoWantFocus(); + MoveRightBtn.NoWantFocus(); + + LevelUpBtn .NoWantFocus(); + LevelDownBtn.NoWantFocus(); + + MoveUpBtn .WhenPush = MoveUpBtn .WhenRepeat = THISBACK(OnMoveUp); + MoveDownBtn .WhenPush = MoveDownBtn .WhenRepeat = THISBACK(OnMoveDown); + MoveLeftBtn .WhenPush = MoveLeftBtn .WhenRepeat = THISBACK(OnMoveLeft); + MoveRightBtn.WhenPush = MoveRightBtn.WhenRepeat = THISBACK(OnMoveRight); + + ZoomInBtn .WhenPush = ZoomInBtn .WhenRepeat = THISBACK(OnZoomIn); + ZoomOutBtn.WhenPush = ZoomOutBtn.WhenRepeat = THISBACK(OnZoomOut); + ZoomSlider.WhenAction = THISBACK(OnZoomSlide); + + LevelUpBtn .WhenPush = THISBACK(OnLevelUp); + LevelDownBtn.WhenPush = THISBACK(OnLevelDown); + + Search.WhenAction = THISBACK(OnSearch); + Search.WhenEnter = THISBACK(OnSearch); + ClearSearchBtn <<= THISBACK(OnSearchClear); + + SetButtonStyle(MoveUpBtn, map_button_up_1, map_button_up_2); + SetButtonStyle(MoveDownBtn, map_button_down_1, map_button_down_2); + SetButtonStyle(MoveLeftBtn, map_button_left_1, map_button_left_2); + SetButtonStyle(MoveRightBtn, map_button_right_1, map_button_right_2); + + SetButtonStyle(ZoomInBtn, map_button_zoom_in_1, map_button_zoom_in_2); + SetButtonStyle(ZoomOutBtn, map_button_zoom_out_1, map_button_zoom_out_2); + + SetButtonStyle(LevelUpBtn, map_button_zoom_in_1, map_button_zoom_in_2); + SetButtonStyle(LevelDownBtn, map_button_zoom_out_1, map_button_zoom_out_2); +} + +void MapView::OnLevelUp() +{ + _level++; + SetCurrentLevel(_level); + UpdateButtons(); +} + +void MapView::OnLevelDown() +{ + _level--; + SetCurrentLevel(_level); + UpdateButtons(); +} + +void MapView::OnMoveUp() +{ + if (GetCurrentLevel()) + GetCurrentLevel()->MoveBy(Point(0, -100)); +} + +void MapView::OnMoveDown() +{ + if (GetCurrentLevel()) + GetCurrentLevel()->MoveBy(Point(0, 100)); +} + +void MapView::OnMoveLeft() +{ + if (GetCurrentLevel()) + GetCurrentLevel()->MoveBy(Point(-100, 0)); +} + +void MapView::OnMoveRight() +{ + if (GetCurrentLevel()) + GetCurrentLevel()->MoveBy(Point( 100, 0)); +} + +void MapView::OnZoomIn() +{ + MapLevel* level = GetCurrentLevel(); + if (!level) return; + + level->ZoomIn(); + UpdateButtons(); + ZoomSlider <<= level->GetCurrentZoom(); +} + +void MapView::OnZoomOut() +{ + MapLevel* level = GetCurrentLevel(); + if (!level) return; + + level->ZoomOut(); + UpdateButtons(); + ZoomSlider <<= level->GetCurrentZoom(); +} + +void MapView::OnZoomSlide() +{ + MapLevel* level = GetCurrentLevel(); + if (!level) return; + + int zoom = ~ZoomSlider; + level->ZoomTo(zoom); + UpdateButtons(); +} + +void MapView::UpdateButtons() +{ + MapLevel* level = GetCurrentLevel(); + if (!level) + { + ZoomInBtn .Disable(); + ZoomOutBtn .Disable(); + LevelUpBtn .Disable(); + LevelDownBtn.Disable(); + + MoveUpBtn .Disable(); + MoveDownBtn .Disable(); + MoveLeftBtn .Disable(); + MoveRightBtn.Disable(); + return; + } + + int total = level->GetZoomCount(); + int zoom = level->GetCurrentZoom(); + + ZoomInBtn .Enable(zoom >= 0 && zoom < total - 1); + ZoomOutBtn.Enable(zoom >= 1 && zoom < total); + + LevelUpBtn .Enable(_level < _levels.GetCount() - 1); + LevelDownBtn.Enable(_level > 0); +} + +void MapView::ShowZoomSlider(bool flag) +{ + ZoomSlider.Show(flag); +} + +void MapView::ShowNavButtons(bool flag) +{ + MoveUpBtn .Show(flag); + MoveDownBtn .Show(flag); + MoveLeftBtn .Show(flag); + MoveRightBtn.Show(flag); +} + +void MapView::ShowLevelsCtrl(bool flag) +{ + LevelName .Show(flag); + LevelUpBtn .Show(flag); + LevelDownBtn.Show(flag); +} + +void MapView::ShowSearch(bool flag) +{ + Search .Show(flag); + ClearSearchBtn.Show(flag); +} + +void MapView::SetCurrentLevel(int level) +{ + MapLevel* p = GetLevel(level); + if (!p) + { + _level = -1; + return; + } + + _level = level; + + for (int i = 0; i < _levels.GetCount(); ++i) + _levels[i].Hide(); + + p->Show(); + ZoomSlider.Range(p->GetZoomCount() - 1).Step(1); + ZoomSlider <<= p->GetCurrentZoom(); + LevelName.SetLabel(p->GetLevelName()); + UpdateButtons(); +} + +bool MapView::LoadMap(Map& map, bool editMode) +{ + for (int i = 0; i < _levels.GetCount(); ++i) + RemoveChild(&_levels[i]); + _levels.Clear(); + + for (int i = 0; i < map.GetLevels().GetCount(); ++i) + { + MapLevel& level = _levels.Add(); + AddChildBefore(&level.SizePos(), GetFirstChild()); + level.IgnoreMouse(); + level.Hide(); + + String fp = AppendFileName( + AppendFileName( GetFileDirectory(GetExeFilePath()), "Mipmaps"), + NFormat("%s-%d.xml", map.GetName(), i + 1) + ); + + level.SetLevelName(map.GetLevels()[i].GetName()); + level.SetLevelDesc(map.GetLevels()[i].GetDesc()); + level.LoadMap(fp); + level.EditMode(editMode); + + for (int j = 0; j < map.GetLevels()[i].GetLayers().GetCount(); ++j) + { + Ptr layer = level.AddItem(); + +/* Array& rooms = map.GetLevels()[i].GetLayers()[j].GetRooms(); + for (int r = 0; r < rooms.GetCount(); ++r) + { + Ptr room = layer->AddItem(); + for (int v = 0; v < rooms[r].GetVertices().GetCount(); ++v) + room->AddVertice(rooms[r].GetVertices()[v]); + room->SetRoom(rooms[r]); + if (editMode) + room->StateOn(STATE_EDIT); + }*/ + + for (int rx = 0; rx < 10; ++rx) + for (int ry = 0; ry < 10; ++ry) + { + Ptr room = layer->AddItem(); + room->AddVertice( 0 * rx, 0 * ry); + room->AddVertice(40 * rx, 0 * ry); + room->AddVertice(40 * rx, 40 * ry); + room->AddVertice( 0 * rx, 40 * ry); + room->SetRoom(rooms[r]); + if (editMode) + room->StateOn(STATE_EDIT); + } + } + } + + SetCurrentLevel(_levels.GetCount() ? 0 : -1); + return true; +} + +bool MapView::LoadMap(const char* fp, bool editMode) +{ + Map map; + if (!LoadFromXMLFile(map, fp)) + return false; + + return LoadMap(map, editMode); +} + +bool MapView::UpdateLevel(Level& level, int pos, bool editMode) +{ + if (pos < 0 || pos >= _levels.GetCount()) + return false; + + MapLevel& mapLevel = _levels[pos]; + mapLevel.EditMode(editMode); + + if (mapLevel.GetItems().GetCount() != level.GetLayers().GetCount()) + mapLevel.Clear(); + + Vector >& mapLayers = mapLevel.GetItems(); + + for (int j = 0; j < level.GetLayers().GetCount(); ++j) + { + IMapRender* mapLayer = + (j < mapLayers.GetCount()) + ? dynamic_cast(~mapLayers[j]) + : ~mapLevel.AddItem(); + + Vector >& mapRooms = mapLayer->GetItems(); + Array& rooms = level.GetLayers()[j].GetRooms(); + mapLayer->Clear(); + + for (int r = 0; r < rooms.GetCount(); ++r) + { + Ptr mapRoom = + mapLayer->AddItem(); + + mapRoom->GetVertices().Clear(); + for (int v = 0; v < rooms[r].GetVertices().GetCount(); ++v) + mapRoom->AddVertice(rooms[r].GetVertices()[v]); + mapRoom->SetRoom(rooms[r]); + if (editMode) + mapRoom->StateOn(STATE_EDIT); + } + } + + Refresh(); +} diff --git a/bazaar/Map/MapView.h b/bazaar/Map/MapView.h new file mode 100644 index 000000000..2dadd6157 --- /dev/null +++ b/bazaar/Map/MapView.h @@ -0,0 +1,98 @@ +#ifndef MAP_VIEW__H +#define MAP_VIEW__H + +#include "MapLevel.h" +#include "MapSerialize.h" + +#define LAYOUTFILE +#include + +#define IMAGECLASS MapViewImg +#define IMAGEFILE +#include + +class MapView : public WithMapViewLayout +{ + typedef MapView CLASSNAME; + +public: + MapView(); + virtual ~MapView() {} + virtual void Layout(); + + virtual void LeftDouble (Point p, dword keyflags); + virtual void LeftDown (Point p, dword keyflags); + virtual void LeftDrag (Point p, dword keyflags); + virtual void LeftUp (Point p, dword keyflags); + + virtual void RightDouble(Point p, dword keyflags); + virtual void RightDown (Point p, dword keyflags); + virtual void RightDrag (Point p, dword keyflags); + virtual void RightUp (Point p, dword keyflags); + + virtual void MouseMove (Point p, dword keyflags); + + virtual void MouseEnter(); + virtual void MouseLeave(); + + void OnLevelUp(); + void OnLevelDown(); + + void OnMoveUp(); + void OnMoveDown(); + void OnMoveLeft(); + void OnMoveRight(); + + void OnZoomIn(); + void OnZoomOut(); + void OnZoomSlide(); + void UpdateButtons(); + + void DoSearch(const String& data); + void OnSearch(); + void OnSearchClear(); + + void ShowNavButtons(bool flag = true); + void HideNavButtons() { ShowNavButtons(false); } + + void ShowZoomSlider(bool flag = true); + void HideZoomSlider() { ShowZoomSlider(false); } + + void ShowLevelsCtrl(bool flag = true); + void HideLevelsCtrl() { ShowLevelsCtrl(false); } + + void ShowSearch(bool flag = true); + void HideSearch() { ShowSearch(false); } + + bool UpdateLevel(Level& level, int pos, bool editMode = false); + bool LoadMap(Map& map, bool editMode = false); + bool LoadMap(const char* fp, bool editMode = false); + + MapView& HighQuality(bool flag = true) + { + for (int i = 0; i < GetLevelCount(); ++i) + GetLevel(i)->HighQuality(flag); + return *this; + } + + MapLevel* GetCurrentLevel() { return GetLevel(_level); } + MapLevel* GetLevel(int i) + { + return (i < 0 || i >= GetLevelCount()) + ? NULL + : &_levels[i]; + } + + int GetLevelCount() const { return _levels.GetCount(); } + void SetCurrentLevel(int level); + +private: + int _level; + bool _drag; + bool _move; + Point _mousePos; + + Array _levels; +}; + +#endif diff --git a/bazaar/Map/MapView.iml b/bazaar/Map/MapView.iml new file mode 100644 index 000000000..e33adc39e --- /dev/null +++ b/bazaar/Map/MapView.iml @@ -0,0 +1,1066 @@ +PREMULTIPLIED +IMAGE_ID(map_button_zoom_out_2) +IMAGE_ID(map_button_zoom_out_1) +IMAGE_ID(map_button_zoom_in_2) +IMAGE_ID(map_button_zoom_in_1) +IMAGE_ID(map_button_up_2) +IMAGE_ID(map_button_up_1) +IMAGE_ID(map_button_right_2) +IMAGE_ID(map_button_right_1) +IMAGE_ID(map_button_left_2) +IMAGE_ID(map_button_left_1) +IMAGE_ID(map_button_down_2) +IMAGE_ID(map_button_down_1) +IMAGE_ID(floor_1) +IMAGE_ID(floor_2) +IMAGE_ID(floor_in) + +IMAGE_BEGIN_DATA +IMAGE_DATA(120,156,237,93,91,76,85,87,26,94,173,22,29,20,168,214,10,114,233,180,22,168,216,138,35,160,5,181,114,145,25,75) +IMAGE_DATA(198,10,237,24,103,94,170,17,95,172,19,47,29,77,4,84,240,69,19,181,13,141,76,38,193,75,58,154,166,35,135,41) +IMAGE_DATA(142,154,8,62,48,41,245,65,198,164,120,59,220,84,14,151,2,182,82,44,42,120,215,53,235,247,252,43,103,185,221,135) +IMAGE_DATA(179,54,103,159,179,247,158,57,59,249,94,140,231,255,191,111,173,127,93,246,218,235,11,36,157,164,19,63,60,47,232,12) +IMAGE_DATA(179,62,122,235,52,123,123,168,113,121,81,192,40,157,33,198,54,170,29,212,244,138,28,71,51,188,132,8,66,140,25,33) +IMAGE_DATA(248,239,121,188,209,228,249,246,240,87,27,168,105,230,90,185,198,177,12,191,98,8,102,24,135,24,63,66,240,223,7,99) +IMAGE_DATA(204,177,196,213,38,98,91,40,219,192,95,154,199,8,90,129,111,40,195,203,136,137,136,87,24,38,105,196,43,194,239,121) +IMAGE_DATA(188,80,204,193,219,98,140,143,219,64,140,165,166,153,235,157,128,156,39,51,68,48,68,50,68,49,68,51,196,48,188,198) +IMAGE_DATA(240,107,73,188,134,191,137,198,24,145,24,115,50,230,152,32,180,131,90,27,232,161,95,77,119,144,160,57,140,56,251,101) +IMAGE_DATA(50,242,3,190,111,48,188,201,16,199,240,22,67,2,195,116,134,183,17,239,8,152,129,16,255,141,255,191,233,248,219,105) +IMAGE_DATA(12,241,24,243,13,204,17,137,57,39,34,7,222,6,65,68,189,6,70,170,155,215,56,239,107,168,183,80,65,51,244,203) +IMAGE_DATA(235,168,53,1,181,204,98,72,97,152,195,144,202,48,23,49,143,97,190,7,204,19,254,127,42,198,72,193,152,51,48,71) +IMAGE_DATA(28,230,140,18,218,32,20,185,241,26,240,70,191,216,223,92,55,204,59,208,206,80,119,83,136,179,62,129,7,244,83,18) +IMAGE_DATA(114,5,254,25,12,217,12,139,24,114,24,126,207,176,152,225,3,73,44,198,223,228,96,140,108,140,57,31,115,64,46,168) +IMAGE_DATA(145,120,228,16,137,156,194,144,163,168,95,171,118,119,186,97,190,121,149,56,219,27,106,112,58,242,72,3,110,17,17,17) +IMAGE_DATA(203,87,173,90,181,255,192,129,3,245,54,155,205,126,230,204,153,235,93,93,93,212,27,216,237,246,33,136,5,49,33,54) +IMAGE_DATA(228,192,118,152,139,185,167,35,151,104,228,246,178,23,250,197,90,31,77,92,117,30,134,177,33,7,244,53,212,31,212,99) +IMAGE_DATA(122,124,124,252,26,224,230,173,78,89,64,174,217,179,103,111,198,54,152,131,92,226,20,250,121,253,143,38,242,181,175,236) +IMAGE_DATA(115,152,67,96,44,77,18,116,207,196,190,94,88,82,82,114,172,179,179,147,26,1,200,61,110,220,184,60,228,50,83,208) +IMAGE_DATA(63,9,57,243,249,79,102,236,43,117,195,94,2,230,80,88,107,97,76,65,109,37,66,46,150,243,195,234,234,106,135,81) +IMAGE_DATA(186,57,128,3,112,33,206,49,0,220,98,145,43,112,14,65,13,50,181,47,106,15,194,186,129,250,129,181,21,214,23,152) +IMAGE_DATA(211,82,205,162,91,69,63,204,131,239,32,215,8,242,236,216,23,251,222,157,238,23,133,62,231,181,14,107,42,172,179,176) +IMAGE_DATA(214,100,194,120,51,90,175,18,21,21,21,151,24,183,44,228,56,13,57,243,218,247,212,247,195,245,57,212,58,140,167,249) +IMAGE_DATA(75,151,46,45,237,232,232,160,102,68,126,126,254,62,198,241,61,228,10,156,167,16,215,188,23,228,65,187,56,183,143,39) +IMAGE_DATA(174,249,13,218,113,14,212,213,197,139,23,7,141,214,232,14,192,13,107,31,230,254,4,161,239,199,147,231,231,124,53,237) +IMAGE_DATA(226,220,62,25,199,206,12,179,247,185,208,247,251,137,115,15,148,136,220,65,67,24,106,122,73,69,187,114,126,231,245,14) +IMAGE_DATA(53,3,235,6,236,33,178,78,158,60,233,104,111,239,160,102,6,112,196,113,159,140,220,97,206,159,128,154,212,198,188,114) +IMAGE_DATA(172,67,141,76,20,235,157,97,81,123,123,59,181,2,88,221,255,129,241,125,23,235,62,26,181,140,119,51,230,69,237,226) +IMAGE_DATA(88,135,189,50,172,107,115,217,62,170,192,104,77,178,0,174,196,185,222,191,141,26,64,75,8,113,173,117,74,237,226,60) +IMAGE_DATA(167,28,235,239,165,164,164,20,177,130,167,86,64,118,118,246,78,198,121,129,98,204,135,186,153,239,68,237,124,93,15,103) +IMAGE_DATA(152,74,156,235,69,198,134,13,27,142,56,28,14,106,5,0,87,226,220,235,255,6,53,132,19,215,58,239,78,59,159,227) +IMAGE_DATA(97,94,228,235,58,204,115,153,44,94,133,209,154,52,104,175,0,206,200,253,77,212,226,110,174,87,106,231,123,154,88,252) +IMAGE_DATA(125,22,139,103,51,90,147,6,237,54,226,156,235,147,80,3,223,223,202,106,231,235,27,172,21,11,33,94,91,91,27,181) +IMAGE_DATA(2,80,123,54,113,173,115,83,60,104,31,229,70,59,236,143,179,45,170,61,197,141,246,81,30,180,71,10,218,127,203,226) +IMAGE_DATA(85,26,173,73,131,246,74,224,44,104,143,116,163,93,237,172,130,107,143,231,218,215,175,223,80,121,245,106,27,213,130,239) +IMAGE_DATA(234,190,163,167,106,78,121,141,127,215,214,82,187,189,81,58,47,112,21,180,199,123,175,125,61,211,126,149,202,226,235,175) +IMAGE_DATA(190,162,95,148,126,161,27,254,86,246,87,56,187,147,202,13,92,141,210,126,238,220,57,93,117,115,156,170,169,49,76,251) +IMAGE_DATA(21,22,87,6,190,210,94,195,180,203,228,247,137,246,43,87,168,44,170,190,169,210,85,247,190,242,114,218,220,210,34,149) +IMAGE_DATA(91,131,118,169,121,94,171,118,64,67,67,3,61,123,246,172,46,104,110,110,150,206,171,208,62,220,60,239,78,251,51,235) +IMAGE_DATA(251,186,117,235,108,151,47,95,161,86,0,112,37,218,214,247,97,247,117,78,237,151,169,21,128,218,23,18,249,125,221,176) +IMAGE_DATA(251,121,22,175,194,104,77,178,88,235,212,62,210,253,188,248,30,7,223,63,51,173,164,29,184,18,237,239,113,226,251,59) +IMAGE_DATA(188,239,243,247,247,244,21,43,86,28,108,109,189,76,173,128,181,107,215,241,247,247,153,68,254,253,93,121,110,243,58,193) +IMAGE_DATA(115,155,164,164,164,162,214,214,86,106,5,100,102,102,194,185,13,156,211,203,158,219,168,157,215,193,221,143,167,231,117,201) +IMAGE_DATA(201,201,5,70,107,146,5,112,37,207,159,215,241,51,122,79,231,180,240,13,235,185,115,218,150,150,86,106,5,120,113,78) +IMAGE_DATA(235,238,124,62,243,240,225,195,151,90,216,222,202,204,56,122,244,40,63,159,79,34,114,231,243,226,152,119,251,93,38,55) +IMAGE_DATA(47,175,20,246,149,102,6,112,36,206,239,50,51,20,99,221,221,119,25,181,249,142,127,119,23,235,62,187,254,63,103,7) +IMAGE_DATA(155,154,91,168,25,1,220,132,239,113,211,136,235,30,130,204,247,56,143,223,97,115,115,115,75,155,216,222,218,140,0,110) +IMAGE_DATA(216,231,252,59,44,223,211,200,124,135,85,126,127,15,33,174,239,239,112,87,238,233,247,247,178,178,178,250,166,166,38,106) +IMAGE_DATA(38,28,58,116,72,230,251,251,112,247,78,164,238,93,4,7,7,231,85,85,85,57,140,214,203,1,92,134,185,119,225,169) +IMAGE_DATA(207,213,180,243,187,101,252,187,36,191,111,3,115,72,90,48,203,245,13,203,217,200,114,27,9,224,16,172,207,125,27,53) +IMAGE_DATA(253,106,247,172,18,177,141,179,54,111,46,56,214,216,200,120,24,0,200,77,156,239,107,195,221,179,210,114,199,78,28,247) +IMAGE_DATA(238,238,215,197,18,215,253,186,5,225,225,225,203,119,236,220,89,107,111,108,164,254,192,222,189,123,235,99,99,99,215,176) +IMAGE_DATA(220,233,68,253,126,93,24,25,217,253,58,181,190,87,222,39,133,123,149,240,142,0,251,166,89,88,3,25,172,13,62,94) +IMAGE_DATA(178,100,73,233,142,29,59,107,191,252,242,239,118,68,35,162,73,35,26,5,216,33,38,196,134,28,196,249,158,2,125,45) +IMAGE_DATA(222,171,140,34,222,223,171,28,78,63,191,71,172,118,159,118,22,246,1,220,5,134,254,128,57,23,206,141,126,71,156,119) +IMAGE_DATA(98,223,39,206,251,177,50,120,31,127,179,8,99,100,97,204,121,152,35,9,115,198,33,135,41,68,191,251,180,162,118,229) +IMAGE_DATA(61,106,24,67,48,135,192,62,145,223,29,135,252,48,14,96,109,129,121,118,38,242,227,119,169,97,111,157,170,17,239,18) +IMAGE_DATA(215,29,234,36,140,9,177,19,48,23,191,67,236,139,123,212,162,126,222,255,202,251,243,226,93,114,104,251,104,228,52,21) +IMAGE_DATA(249,193,25,233,91,216,38,9,26,49,13,127,27,143,177,166,98,236,104,204,229,233,254,188,200,125,164,143,24,67,173,6) +IMAGE_DATA(68,159,8,172,43,48,230,224,172,128,123,39,68,255,132,22,68,9,191,143,192,152,175,98,14,209,63,226,43,223,196,112) +IMAGE_DATA(250,69,239,8,172,161,220,47,19,66,158,245,204,192,216,152,56,66,76,16,226,132,98,108,127,250,101,100,219,128,183,131) +IMAGE_DATA(232,149,82,250,165,60,249,166,148,255,47,88,136,51,86,136,239,79,159,148,248,188,64,212,219,64,205,31,167,244,201,105) +IMAGE_DATA(133,50,142,145,254,56,241,81,230,20,219,66,111,111,164,39,79,164,191,52,171,61,238,248,248,26,102,126,204,173,49,96) +IMAGE_DATA(8,215,245,249,127,27,0,254,154,244,100,39,63,127,60,90,22,188,128,33,60,96,8,15,24,194,3,134,240,128,33,60) +IMAGE_DATA(96,8,255,159,48,132,199,196,196,44,223,180,105,211,254,19,39,78,212,159,62,125,218,222,209,209,113,157,122,249,12,12) +IMAGE_DATA(12,12,65,44,136,9,177,33,7,49,145,33,60,49,49,113,13,112,243,86,167,236,3,185,50,50,50,12,55,132,151,149) +IMAGE_DATA(149,29,123,242,228,9,53,2,144,59,36,36,196,239,134,112,150,243,195,11,23,46,56,140,210,205,1,28,128,11,241,147) +IMAGE_DATA(33,156,235,126,252,248,49,53,3,4,253,62,55,132,31,63,126,188,222,104,189,74,212,213,213,249,220,16,158,159,159,95) +IMAGE_DATA(106,180,78,119,216,184,113,163,207,12,225,80,87,253,253,253,131,143,30,61,162,102,4,112,195,218,215,221,16,190,114,229) +IMAGE_DATA(202,82,163,245,121,194,167,159,254,197,39,134,240,134,134,115,142,135,15,31,81,51,3,56,18,31,24,194,31,60,124,72) +IMAGE_DATA(173,0,86,247,186,26,194,23,44,88,80,240,224,193,3,106,5,0,87,162,163,33,156,197,43,186,207,226,90,1,185,121) +IMAGE_DATA(121,186,26,194,183,111,223,126,228,254,253,251,212,10,0,174,68,71,67,56,139,87,113,239,222,61,106,5,0,87,162,163) +IMAGE_DATA(33,188,164,164,196,118,247,238,93,106,5,0,87,162,163,33,28,226,221,185,115,135,90,1,168,93,55,67,120,113,113,137) +IMAGE_DATA(109,104,232,14,181,2,128,43,209,209,16,94,92,92,92,57,52,52,68,173,0,224,74,116,52,132,67,188,193,193,33,170) +IMAGE_DATA(5,182,35,21,244,179,221,123,188,198,254,242,125,180,173,205,33,157,87,161,221,107,115,236,182,109,197,149,183,111,15,82) +IMAGE_DATA(89,228,45,254,128,198,68,70,233,134,132,184,248,167,70,119,153,220,192,85,79,237,91,183,109,171,188,117,251,54,149,193) +IMAGE_DATA(249,243,231,117,213,205,177,103,215,110,169,252,192,85,87,237,91,183,86,222,188,117,139,202,0,12,225,190,208,190,123,215) +IMAGE_DATA(46,169,252,192,85,119,237,55,111,82,89,252,121,245,39,186,234,158,157,148,76,123,122,123,165,114,107,208,46,53,207,111) +IMAGE_DATA(97,241,6,88,92,45,248,254,251,6,250,237,183,117,186,160,187,167,71,58,239,150,103,181,123,109,8,47,42,218,98,187) +IMAGE_DATA(241,203,0,181,2,128,43,209,209,16,94,88,84,100,235,191,241,11,181,2,128,43,209,209,16,94,88,88,84,241,115,255) +IMAGE_DATA(13,106,5,48,174,186,26,194,11,10,11,43,250,126,238,167,86,0,112,37,58,26,194,87,175,254,228,96,95,95,31,181) +IMAGE_DATA(2,10,10,10,116,53,132,167,166,165,21,93,103,113,173,128,156,156,28,93,13,225,169,169,105,5,63,93,239,163,86,0) +IMAGE_DATA(112,37,58,27,194,175,253,248,19,181,2,124,97,8,175,58,250,175,75,189,215,126,164,102,70,109,109,173,79,12,225,203) +IMAGE_DATA(254,248,167,210,158,222,107,212,204,0,142,196,71,134,240,166,230,214,193,238,238,94,106,70,0,55,95,26,194,151,45,91) +IMAGE_DATA(86,218,221,221,67,205,8,224,70,124,108,8,63,112,240,96,125,215,15,221,212,76,176,85,254,211,47,134,112,248,163,7) +IMAGE_DATA(213,53,167,28,157,93,63,80,51,0,184,248,211,16,14,185,78,86,215,56,58,58,187,168,145,0,14,58,253,1,6,53) +IMAGE_DATA(253,195,26,194,139,75,74,142,181,119,116,82,35,0,185,137,193,134,112,248,3,48,123,62,251,188,182,205,209,78,253,129) +IMAGE_DATA(242,242,125,245,240,71,94,136,137,12,225,172,13,62,254,232,163,165,165,187,247,124,94,251,245,63,142,216,17,141,136,38) +IMAGE_DATA(141,104,20,96,135,152,16,27,114,144,128,33,60,96,8,15,24,194,3,134,240,128,33,92,79,221,178,109,16,48,132,7) +IMAGE_DATA(12,225,1,67,184,239,97,230,199,212,26,255,11,146,5,91,235,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) +IMAGE_END_DATA(2880, 2) + +IMAGE_BEGIN_DATA +IMAGE_DATA(120,156,237,157,123,80,84,215,29,199,111,19,99,17,138,248,136,130,40,214,40,65,48,245,197,83,16,129,144,180,169,241) +IMAGE_DATA(1,66,157,198,153,152,198,199,63,105,17,28,75,134,5,121,104,35,102,38,10,232,166,211,169,96,71,13,12,162,109,76) +IMAGE_DATA(140,51,62,18,215,17,117,148,209,142,138,187,139,128,242,140,209,136,111,5,223,122,122,126,236,185,114,184,123,151,189,187) +IMAGE_DATA(252,150,189,78,247,206,124,254,113,246,254,206,249,254,126,191,243,184,247,158,31,10,177,66,172,224,224,235,23,200,168,245) +IMAGE_DATA(194,214,169,118,127,88,234,207,43,140,87,145,121,133,195,89,126,144,211,202,247,177,31,229,53,142,254,140,95,218,129,120) +IMAGE_DATA(175,104,171,159,96,238,143,190,242,129,156,102,81,171,168,207,141,50,128,225,78,241,160,252,202,78,60,24,238,204,158,155) +IMAGE_DATA(208,229,19,222,23,142,246,129,37,205,162,94,119,214,223,129,20,47,202,32,202,16,198,80,202,235,54,50,148,187,127,16) +IMAGE_DATA(99,32,231,147,1,172,237,158,124,128,165,153,215,45,106,30,192,233,29,196,250,59,156,226,67,241,165,140,164,140,162,248) +IMAGE_DATA(81,70,83,126,173,144,209,236,158,81,204,134,47,179,57,156,249,101,48,231,7,107,62,192,208,45,198,26,242,13,226,236) +IMAGE_DATA(193,218,31,194,250,52,130,245,117,12,101,28,229,77,202,120,74,16,101,2,229,45,198,111,56,38,50,248,127,19,127,55) +IMAGE_DATA(129,221,27,72,9,96,54,223,96,62,241,101,109,130,175,189,100,124,128,161,95,170,91,140,181,167,96,242,253,48,214,15) +IMAGE_DATA(136,149,63,235,43,104,153,66,9,165,132,83,166,81,162,24,211,41,209,86,152,206,253,126,26,179,1,182,130,153,237,32) +IMAGE_DATA(230,87,240,3,248,218,91,48,249,31,226,224,129,164,95,78,183,59,107,3,252,237,195,52,67,63,32,78,83,89,63,161) +IMAGE_DATA(255,113,148,119,41,239,81,102,82,102,49,230,40,100,54,251,253,76,102,227,183,148,183,41,51,152,63,68,63,64,94,141) +IMAGE_DATA(17,76,254,135,177,0,227,14,114,192,173,23,250,249,241,45,213,253,58,107,11,252,30,196,52,67,127,98,61,60,60,146) +IMAGE_DATA(230,207,159,95,84,88,88,168,219,185,115,167,225,196,137,19,109,173,173,173,164,55,24,12,134,14,176,181,121,243,230,170) +IMAGE_DATA(37,75,150,148,248,248,248,252,137,249,1,242,34,132,249,29,114,14,114,96,184,5,253,74,181,75,231,53,24,223,3,56) +IMAGE_DATA(221,48,247,192,216,131,177,25,70,137,161,253,249,8,244,246,86,167,82,168,47,244,97,97,97,25,130,41,191,192,239,147) +IMAGE_DATA(5,211,156,48,90,162,159,207,127,37,250,249,92,127,141,211,61,148,197,27,116,67,190,69,80,226,87,172,88,81,222,210) +IMAGE_DATA(210,66,156,1,228,2,205,181,121,44,7,96,142,25,207,233,247,98,185,218,95,80,150,251,114,185,14,254,131,185,4,230) +IMAGE_DATA(241,177,44,222,211,104,155,9,16,107,103,233,22,57,126,252,248,213,128,128,128,63,11,166,121,6,244,195,252,51,138,229) +IMAGE_DATA(232,64,22,59,37,177,231,99,46,230,186,23,243,35,204,107,176,238,192,124,22,191,99,199,14,189,179,117,139,232,245,250) +IMAGE_DATA(118,166,63,138,229,228,56,22,171,33,66,87,238,247,227,98,111,73,187,52,230,67,153,31,97,60,193,252,26,155,151,151) +IMAGE_DATA(183,219,217,122,165,236,219,183,175,145,230,98,34,139,205,4,22,171,225,10,99,47,55,206,33,230,176,126,190,193,252,25) +IMAGE_DATA(5,115,76,115,115,51,81,35,16,19,136,141,96,90,123,32,247,125,89,236,61,132,174,113,111,77,59,63,206,71,178,152) +IMAGE_DATA(195,254,34,190,162,162,66,239,108,141,61,1,107,142,96,154,251,197,216,195,184,135,189,152,91,15,121,207,231,187,27,203) +IMAGE_DATA(149,97,236,254,183,212,30,115,145,220,220,206,216,199,8,166,117,15,198,61,236,193,6,89,201,123,185,124,247,97,247,131) +IMAGE_DATA(157,216,130,130,2,93,83,83,51,81,51,213,213,231,218,5,211,158,18,242,116,188,130,188,151,142,117,88,23,7,179,251) +IMAGE_DATA(196,124,127,247,216,177,99,109,77,77,77,4,131,11,23,46,144,237,229,229,100,67,209,6,82,178,169,152,156,59,119,14) +IMAGE_DATA(197,46,64,231,252,191,112,121,239,199,242,94,156,239,123,210,222,159,27,235,48,191,195,190,21,214,243,100,172,190,1,223) +IMAGE_DATA(126,243,77,167,110,17,208,143,101,59,57,57,121,131,96,90,239,97,126,30,195,198,174,167,32,191,214,201,205,115,224,171) +IMAGE_DATA(209,226,88,15,13,11,211,52,82,187,88,148,151,149,119,211,14,96,217,94,190,124,249,118,110,204,195,26,37,174,117,114) +IMAGE_DATA(243,157,84,187,39,55,207,129,239,162,67,67,67,179,26,27,27,9,22,178,218,145,108,83,237,59,4,211,94,127,42,55) +IMAGE_DATA(223,121,113,243,157,84,59,191,167,25,200,124,5,62,155,4,62,164,218,87,190,100,218,227,5,211,94,204,95,48,159,235) +IMAGE_DATA(45,105,119,147,104,239,156,227,169,246,108,92,237,101,142,212,190,147,246,249,29,193,244,140,11,123,156,17,118,104,31,203) +IMAGE_DATA(180,199,81,237,57,13,13,13,4,11,57,237,88,182,153,118,113,157,147,211,254,170,21,237,222,76,251,148,151,80,251,191) +IMAGE_DATA(5,211,187,30,81,187,175,5,237,210,231,86,94,251,56,123,181,215,213,213,145,67,186,67,228,192,129,3,178,148,108,218) +IMAGE_DATA(100,166,221,210,111,1,163,209,104,175,246,0,12,237,23,47,54,16,165,108,221,178,197,76,91,111,248,199,151,127,39,6) +IMAGE_DATA(131,81,81,219,105,105,104,218,167,118,105,191,72,148,112,234,212,41,84,221,47,242,98,255,1,69,237,167,165,165,57,77) +IMAGE_DATA(251,153,51,103,28,162,189,178,178,210,41,218,67,168,246,11,212,174,82,118,237,218,133,170,27,198,80,109,109,173,162,182) +IMAGE_DATA(17,181,119,142,247,144,144,144,28,120,254,176,5,189,94,79,78,158,60,41,139,220,124,96,233,183,167,79,159,182,169,93) +IMAGE_DATA(53,104,239,137,178,82,243,53,14,203,54,146,246,177,188,246,250,250,11,4,11,57,237,88,182,83,83,211,122,187,190,119) +IMAGE_DATA(219,215,153,180,215,19,44,228,181,227,216,78,77,77,237,237,190,174,219,126,62,56,36,36,27,87,123,169,195,180,47,51) +IMAGE_DATA(105,183,103,63,47,251,28,71,227,190,242,101,209,78,227,110,235,115,92,143,207,239,193,193,33,89,117,117,245,4,11,57) +IMAGE_DATA(237,88,182,83,82,82,109,125,126,239,241,189,13,141,187,6,246,232,88,236,219,187,183,155,238,138,138,10,52,219,203,150) +IMAGE_DATA(45,179,247,189,141,197,247,117,152,218,129,31,190,255,129,148,125,85,74,190,251,246,59,98,160,207,42,88,118,19,19,19) +IMAGE_DATA(237,125,95,103,241,61,173,78,119,168,173,182,182,142,168,29,127,127,127,91,222,211,10,18,237,178,239,231,63,255,252,115) +IMAGE_DATA(29,236,43,213,12,221,7,218,250,126,94,212,222,211,119,153,200,224,224,224,140,243,212,190,154,209,100,102,218,251,93,166) +IMAGE_DATA(167,239,113,176,86,198,111,219,246,149,190,230,124,45,81,43,222,222,222,246,126,143,179,250,29,22,98,95,115,254,60,81) +IMAGE_DATA(35,41,41,41,229,44,230,182,126,135,149,230,61,255,253,93,140,125,231,247,119,141,70,179,187,166,166,134,168,9,250,204) +IMAGE_DATA(220,232,238,254,226,251,123,144,96,219,247,247,158,98,47,158,187,8,98,182,227,97,222,115,182,94,145,170,170,170,118,150) +IMAGE_DATA(235,210,115,23,131,5,219,206,93,40,57,111,211,121,206,40,127,237,218,131,70,218,182,51,249,154,198,155,174,105,112,222) +IMAGE_DATA(4,206,36,78,22,236,63,111,99,41,246,158,130,252,57,171,183,63,252,112,97,49,248,221,104,164,125,233,99,180,218,47) +IMAGE_DATA(171,104,158,243,231,172,96,92,250,9,246,157,179,146,198,190,167,243,117,176,238,193,26,26,67,243,109,97,126,126,254,65) +IMAGE_DATA(216,155,245,5,91,182,110,213,195,156,43,116,157,175,155,196,226,45,234,134,53,77,122,190,212,154,110,57,253,214,206,85) +IMAGE_DATA(78,97,237,199,184,187,187,207,155,59,119,110,81,126,254,90,221,150,45,91,13,12,35,163,198,70,140,28,6,173,86,91) +IMAGE_DATA(69,115,172,132,141,235,56,22,235,96,22,3,136,133,244,92,165,61,186,165,250,229,206,211,194,248,135,61,3,60,235,192) +IMAGE_DATA(51,226,4,230,131,112,214,39,88,103,224,25,18,246,87,191,19,76,103,98,127,47,152,206,199,42,229,61,161,235,44,109) +IMAGE_DATA(60,211,11,123,244,8,166,25,230,29,200,241,49,130,249,121,90,71,157,39,22,199,63,180,195,159,163,6,223,195,121,111) +IMAGE_DATA(136,195,100,214,63,241,44,181,120,158,218,22,34,132,238,103,168,193,183,252,57,106,208,12,227,15,98,45,158,163,118,71) +IMAGE_DATA(210,205,107,231,245,203,157,159,7,31,64,30,140,98,126,128,245,192,95,232,58,67,31,200,250,108,11,129,236,222,0,102) +IMAGE_DATA(103,28,211,203,159,159,135,182,29,117,126,94,170,95,174,110,66,244,129,88,35,50,76,232,94,59,193,215,79,216,138,88) +IMAGE_DATA(51,1,235,171,55,179,13,235,141,181,186,9,190,207,24,151,84,191,165,122,25,79,206,23,131,88,63,135,216,201,96,6) +IMAGE_DATA(216,241,226,244,138,181,67,142,174,151,145,211,207,251,64,204,3,209,15,114,181,82,98,189,148,136,181,186,40,190,62,202) +IMAGE_DATA(157,179,229,172,58,41,57,253,162,15,120,63,244,19,204,107,228,248,58,57,91,144,218,112,102,125,28,127,73,219,148,250) +IMAGE_DATA(2,187,54,178,167,154,200,190,210,44,119,89,234,143,163,81,243,165,126,157,174,130,112,180,235,255,109,0,88,155,248,48) +IMAGE_DATA(39,61,126,226,115,21,132,187,10,194,93,5,225,174,130,112,87,65,184,171,32,220,85,16,222,135,5,225,158,158,158,73) +IMAGE_DATA(75,151,46,45,42,43,43,211,29,61,122,212,208,220,220,220,70,122,121,221,190,125,187,3,108,237,217,179,167,42,61,61) +IMAGE_DATA(189,196,207,207,79,85,5,225,180,63,31,129,222,222,234,84,122,29,57,114,68,31,23,23,231,244,130,240,53,107,214,148) +IMAGE_DATA(63,127,254,156,56,3,200,5,154,107,125,94,16,78,219,76,40,45,45,213,57,75,183,72,83,83,211,213,73,147,38,245) +IMAGE_DATA(105,65,120,101,101,165,254,217,179,103,68,13,220,186,117,171,125,226,196,137,125,82,16,174,213,106,119,59,91,175,148,234) +IMAGE_DATA(234,234,70,154,139,14,45,8,143,141,141,205,112,182,78,75,64,76,4,7,22,132,31,62,124,88,255,244,233,83,162,86) +IMAGE_DATA(96,205,17,28,80,16,30,19,19,155,225,108,109,214,216,184,81,235,144,130,240,109,219,182,233,158,60,121,74,212,204,245) +IMAGE_DATA(235,55,28,82,16,222,208,208,208,246,248,201,19,130,1,221,175,145,228,196,121,196,207,119,36,137,8,9,237,60,40,135) +IMAGE_DATA(101,155,206,249,168,5,225,116,14,77,126,252,248,49,193,98,121,106,106,167,110,17,208,143,101,251,227,69,139,80,11,194) +IMAGE_DATA(99,98,98,52,143,168,93,44,146,18,18,187,105,7,176,108,175,90,189,26,181,32,156,106,207,122,244,232,17,193,66,86) +IMAGE_DATA(59,146,237,85,171,86,161,22,132,207,152,49,99,229,195,135,15,9,22,114,218,177,108,51,237,104,5,225,84,123,246,131) +IMAGE_DATA(7,15,8,22,73,9,9,102,218,177,108,231,229,229,161,22,132,71,71,71,231,220,191,127,159,96,49,111,142,185,118,44) +IMAGE_DATA(219,76,59,90,65,56,104,239,232,184,79,176,144,211,142,101,59,55,55,15,181,32,220,164,189,131,40,165,173,237,26,249) +IMAGE_DATA(87,113,9,41,88,183,94,150,240,224,16,51,237,150,126,11,52,54,54,41,110,59,55,55,23,181,72,18,180,183,183,119) +IMAGE_DATA(16,165,188,19,27,103,166,173,55,4,189,25,64,26,26,26,21,181,141,168,189,179,48,120,250,244,232,156,123,247,218,137) +IMAGE_DATA(18,142,29,61,134,170,91,100,253,23,235,20,181,159,147,131,173,125,122,206,221,123,247,136,18,206,158,61,235,16,237,21) +IMAGE_DATA(219,43,20,181,159,157,147,131,174,253,206,221,187,68,41,41,159,124,130,170,59,158,142,161,203,87,174,40,106,59,59,59) +IMAGE_DATA(27,117,188,119,106,191,115,135,216,2,20,44,66,241,190,28,241,50,243,129,165,223,66,65,184,45,237,98,107,143,162,218) +IMAGE_DATA(111,83,187,88,36,204,154,109,166,29,203,246,74,28,237,47,214,247,200,168,168,156,155,183,110,19,44,228,180,99,217,206) +IMAGE_DATA(202,90,137,90,16,30,25,25,149,115,227,230,45,130,197,28,25,237,88,182,51,179,178,80,11,194,105,220,179,175,223,184) +IMAGE_DATA(73,176,152,243,254,44,51,237,88,182,51,51,179,80,11,194,167,69,70,173,188,118,253,6,193,66,78,59,150,109,77,102) +IMAGE_DATA(38,106,65,120,100,100,100,214,181,107,215,8,22,178,218,145,108,107,52,26,212,130,240,105,145,145,154,54,106,23,139,252) +IMAGE_DATA(207,214,116,211,189,224,143,31,160,217,206,208,104,208,11,194,175,210,231,19,76,180,27,181,100,246,204,247,201,167,127,77) +IMAGE_DATA(39,13,244,89,5,203,238,7,11,22,160,23,132,159,60,245,223,182,43,63,95,37,106,39,48,48,16,189,32,92,171,213) +IMAGE_DATA(234,46,95,249,153,168,153,186,250,122,135,20,132,135,71,68,100,252,116,249,10,81,51,127,251,108,141,195,10,194,255,243) +IMAGE_DATA(245,46,253,165,75,151,137,90,25,49,98,132,195,10,194,195,195,195,51,46,93,250,137,168,145,244,244,79,29,94,16,190) +IMAGE_DATA(106,245,234,221,173,63,94,34,106,98,255,129,239,249,63,200,238,208,130,240,194,194,34,93,75,235,143,68,13,232,13,198) +IMAGE_DATA(118,246,199,200,251,172,32,188,160,176,240,96,115,75,43,113,38,123,247,237,111,12,8,24,239,148,130,240,197,139,151,20) +IMAGE_DATA(87,159,211,183,55,53,183,144,190,166,184,196,236,63,222,232,243,130,112,154,111,11,215,173,47,56,8,123,179,190,96,123) +IMAGE_DATA(69,133,62,180,251,127,184,226,244,130,112,136,65,82,210,31,138,190,88,87,160,43,223,94,97,96,24,25,53,54,98,228) +IMAGE_DATA(48,252,115,83,113,213,199,139,22,151,176,113,29,39,184,10,194,93,5,225,174,130,112,87,65,184,171,32,28,83,183,84) +IMAGE_DATA(63,239,3,49,15,92,5,225,174,130,112,87,65,184,227,81,243,165,122,157,255,3,23,24,52,91,0,0,0,0,0,0) +IMAGE_END_DATA(3136, 2) + +IMAGE_BEGIN_DATA +IMAGE_DATA(120,156,237,157,75,108,84,215,25,199,79,90,2,4,67,131,11,120,156,196,193,67,109,227,188,156,212,105,147,52,198,216) +IMAGE_DATA(19,131,67,82,154,85,186,5,97,150,8,144,97,19,186,64,98,227,186,18,143,70,42,9,66,178,20,16,65,56,72,29) +IMAGE_DATA(71,114,20,123,65,167,2,55,241,35,9,47,123,252,6,3,203,172,241,250,246,252,185,231,100,14,215,247,142,103,252,224) +IMAGE_DATA(220,25,255,175,244,91,68,193,115,239,177,252,253,244,125,223,249,230,92,241,234,83,245,194,210,245,20,33,36,175,200,135) +IMAGE_DATA(203,246,239,144,16,98,135,92,184,130,158,253,87,138,95,19,66,242,10,29,219,185,226,45,63,55,153,235,89,38,121,218) +IMAGE_DATA(96,185,98,5,33,36,167,88,110,160,227,25,241,237,245,87,216,156,21,228,40,237,38,237,163,149,146,103,20,171,36,5) +IMAGE_DATA(146,213,132,144,156,4,241,139,56,214,49,141,248,214,30,51,221,21,22,103,165,115,20,158,91,123,9,107,251,141,228,89) +IMAGE_DATA(201,90,201,111,21,235,36,235,9,33,57,5,226,86,199,48,226,25,113,141,248,214,14,67,220,155,222,210,185,150,13,103) +IMAGE_DATA(5,57,74,231,80,207,136,148,159,10,133,187,182,34,73,177,228,121,201,11,146,18,201,139,146,141,146,82,66,72,78,128) +IMAGE_DATA(120,69,220,34,126,17,199,136,103,196,53,226,27,30,67,188,195,93,136,127,228,41,200,183,76,103,121,243,172,197,188,204) +IMAGE_DATA(251,248,229,81,120,70,184,86,251,233,121,181,182,168,164,76,82,33,169,148,188,44,121,69,242,170,226,53,131,42,66,72) +IMAGE_DATA(40,48,227,82,199,42,226,22,241,139,56,70,60,35,174,55,9,55,206,17,239,17,225,198,63,60,176,70,184,206,130,31) +IMAGE_DATA(130,106,195,197,184,188,185,148,238,71,121,29,5,207,150,168,231,175,80,235,194,186,171,37,127,148,188,45,249,147,164,70) +IMAGE_DATA(177,69,82,75,8,9,53,136,83,29,179,136,95,196,49,226,25,113,141,248,70,156,35,222,17,247,37,194,245,0,114,45) +IMAGE_DATA(120,1,126,208,181,161,95,142,181,144,151,159,167,112,95,56,19,181,30,106,215,136,72,57,170,82,61,255,155,106,93,88) +IMAGE_DATA(107,76,178,93,178,67,242,161,100,167,226,35,66,72,78,160,99,22,241,139,56,70,60,199,132,27,223,136,243,63,8,55) +IMAGE_DATA(238,95,146,252,78,164,156,5,63,192,19,232,103,45,166,175,252,60,133,58,84,231,82,112,39,114,191,168,72,57,10,190) +IMAGE_DATA(133,135,27,176,166,198,198,198,150,99,199,142,117,94,190,124,121,72,94,211,15,30,60,112,8,33,185,13,226,25,113,141) +IMAGE_DATA(248,150,113,254,129,138,119,120,235,45,201,235,202,7,155,148,31,54,136,84,142,181,114,17,124,53,155,167,208,147,130,59) +IMAGE_DATA(203,133,91,203,106,71,109,43,46,46,222,123,234,212,169,255,208,77,132,228,63,136,115,25,239,137,202,202,202,3,194,205) +IMAGE_DATA(183,106,149,15,208,235,66,109,136,126,22,106,175,66,145,170,9,23,202,87,233,60,85,168,238,139,189,129,205,146,55,132) +IMAGE_DATA(155,3,190,39,29,213,116,242,228,201,196,253,251,247,29,66,200,210,3,249,214,230,205,155,225,44,228,89,239,74,126,47) +IMAGE_DATA(220,28,11,190,208,53,225,154,5,244,149,185,223,231,245,84,177,186,47,234,82,244,164,144,75,53,30,58,116,232,210,224) +IMAGE_DATA(224,224,180,237,223,21,33,196,62,135,15,31,110,23,110,95,171,86,121,2,253,247,168,225,171,133,168,7,189,115,9,43) +IMAGE_DATA(68,170,238,211,249,148,246,212,214,130,130,130,191,194,165,182,127,55,132,144,112,209,221,221,61,133,90,75,122,162,78,184) +IMAGE_DATA(53,161,233,43,93,15,154,253,246,108,92,229,173,253,48,151,176,74,164,250,83,27,13,79,213,201,92,111,127,87,87,215) +IMAGE_DATA(148,237,223,9,33,36,156,220,190,125,123,90,213,132,245,134,175,74,85,222,3,175,232,253,193,101,89,230,86,222,218,15) +IMAGE_DATA(53,37,246,27,177,223,135,62,58,250,83,152,169,216,10,95,202,231,120,120,239,222,61,135,16,66,130,48,124,85,167,242) +IMAGE_DATA(28,244,175,208,111,223,160,252,98,246,174,50,113,149,153,83,153,181,31,106,75,236,59,98,70,21,125,244,45,168,251,144) +IMAGE_DATA(79,217,254,29,16,66,114,3,248,74,213,131,181,202,35,21,202,43,186,119,149,77,45,232,151,83,225,251,61,168,253,162) +IMAGE_DATA(194,157,75,192,126,95,99,123,251,87,67,182,215,78,8,201,45,190,253,182,107,74,184,253,118,236,15,98,158,1,243,87) +IMAGE_DATA(186,22,68,175,105,121,22,174,242,230,84,248,222,140,174,253,48,151,26,219,187,119,111,219,212,212,61,135,16,66,178,165) +IMAGE_DATA(185,249,16,246,7,49,207,128,222,85,165,242,11,122,76,152,99,208,251,130,233,250,86,65,57,85,68,185,15,243,232,53) +IMAGE_DATA(168,253,110,221,186,53,61,53,53,229,16,66,200,92,192,172,184,112,107,65,204,183,227,251,56,197,89,228,86,230,222,159) +IMAGE_DATA(217,167,122,65,185,15,14,108,56,113,226,68,194,246,58,9,33,185,77,123,123,251,144,112,231,219,223,50,114,171,117,34) +IMAGE_DATA(213,183,50,247,4,131,92,165,231,62,209,155,215,125,42,212,149,53,232,139,221,149,247,33,36,136,158,158,30,231,243,211) +IMAGE_DATA(167,157,79,255,249,169,243,117,71,135,245,231,33,225,165,162,162,226,128,202,173,170,84,237,86,36,102,223,19,244,171,255) +IMAGE_DATA(144,143,61,39,220,239,250,97,143,49,214,220,220,220,126,247,238,93,135,16,63,224,41,56,202,228,145,175,66,240,108,36) +IMAGE_DATA(124,28,63,126,60,33,220,190,21,250,224,122,79,176,112,150,58,208,116,149,89,255,33,47,195,220,39,206,170,121,95,254) +IMAGE_DATA(45,254,108,123,125,36,156,248,121,138,190,34,233,64,223,91,184,123,130,152,45,192,124,40,230,173,214,27,117,96,144,171) +IMAGE_DATA(204,253,63,244,227,49,163,85,170,234,191,45,200,215,108,175,141,132,147,116,158,250,197,87,113,250,138,204,100,251,246,237) +IMAGE_DATA(45,70,29,24,53,234,192,149,1,61,43,179,87,165,231,212,177,255,135,254,60,102,182,234,155,154,154,218,238,220,185,227) +IMAGE_DATA(16,98,210,115,109,118,79,153,190,178,253,188,36,92,28,61,122,180,83,184,231,245,225,44,6,204,154,99,63,240,89,163) +IMAGE_DATA(103,53,155,171,214,170,159,209,189,170,134,179,103,207,246,219,94,23,9,23,65,158,234,144,78,186,121,243,166,243,249,191) +IMAGE_DATA(78,251,254,63,219,207,77,194,195,165,75,151,176,31,184,77,184,115,6,21,170,71,190,86,248,247,215,189,125,245,85,170) +IMAGE_DATA(191,133,62,23,230,63,177,167,216,40,63,51,105,123,93,36,60,244,92,187,22,224,169,248,47,255,38,216,87,113,107,207) +IMAGE_DATA(77,194,133,252,27,65,207,234,125,213,19,175,20,143,247,215,211,185,10,189,247,2,241,248,92,21,62,99,199,228,228,29) +IMAGE_DATA(135,16,112,237,106,176,167,188,255,54,157,175,108,175,131,132,3,225,158,127,252,142,218,199,43,81,254,41,16,51,247,2) +IMAGE_DATA(131,92,133,159,65,111,30,61,250,15,38,39,39,29,66,210,123,202,255,103,110,222,72,231,43,251,107,34,118,17,238,187) +IMAGE_DATA(38,244,94,224,124,93,245,161,237,245,16,251,92,189,122,213,215,83,241,12,156,115,227,198,13,250,138,248,18,224,170,213) +IMAGE_DATA(115,205,171,38,228,103,146,165,11,92,19,228,169,108,62,195,207,87,223,116,126,99,125,125,196,30,11,144,87,61,214,175) +IMAGE_DATA(154,152,152,112,200,210,165,187,187,123,166,167,254,29,207,250,115,174,95,191,62,195,87,248,111,219,235,35,246,152,99,191) +IMAGE_DATA(42,112,31,240,226,197,139,73,219,107,34,246,24,24,24,152,183,167,52,94,95,93,110,255,202,250,250,136,29,228,223,66) +IMAGE_DATA(54,251,128,66,100,48,95,117,230,204,153,254,241,241,9,135,44,93,190,251,223,119,78,119,87,247,163,190,213,124,63,235) +IMAGE_DATA(246,224,224,163,207,186,114,229,138,51,60,60,98,125,109,196,14,95,126,121,49,155,249,42,63,87,205,152,91,223,179,103) +IMAGE_DATA(79,219,248,248,184,67,8,33,11,197,193,131,7,113,238,94,76,100,63,183,158,246,251,128,182,215,69,8,201,47,26,26) +IMAGE_DATA(26,230,242,125,192,89,207,89,72,36,254,251,179,237,181,17,66,242,131,31,127,252,201,239,156,5,243,188,189,57,159,95) +IMAGE_DATA(117,224,192,193,246,177,177,113,135,16,66,230,75,107,235,63,244,249,85,111,138,204,207,175,242,246,172,124,207,5,141,68) +IMAGE_DATA(34,77,99,99,99,14,33,132,204,23,233,19,125,230,122,54,231,130,154,174,74,123,222,122,107,107,107,194,246,26,9,33) +IMAGE_DATA(185,205,133,11,23,230,123,222,122,70,239,177,25,24,248,97,122,116,116,204,33,132,144,185,96,228,84,126,239,177,201,228) +IMAGE_DATA(125,166,65,239,7,68,110,133,185,208,71,125,171,221,187,119,183,141,142,142,58,132,16,146,45,251,247,239,159,239,251,1) +IMAGE_DATA(211,229,86,230,123,151,49,11,223,120,250,179,207,250,71,228,125,9,33,36,83,58,58,58,244,123,151,177,247,55,223,247) +IMAGE_DATA(46,251,229,86,232,91,161,71,95,166,114,54,212,130,31,199,229,125,135,71,70,29,66,8,153,141,190,254,129,135,232,33) +IMAGE_DATA(9,183,246,195,140,121,185,242,138,62,87,97,69,134,57,85,186,220,10,189,121,228,104,250,93,241,213,146,173,184,111,95) +IMAGE_DATA(127,255,195,225,145,17,135,16,66,130,144,158,152,46,47,47,199,251,0,235,132,219,75,66,237,135,121,170,13,34,179,189) +IMAGE_DATA(191,217,114,43,125,246,2,114,51,93,11,110,84,247,193,253,234,34,145,200,158,120,92,230,87,195,35,14,33,132,120,233) +IMAGE_DATA(235,235,127,168,60,85,47,220,30,21,230,62,75,149,79,116,237,231,221,251,203,196,85,222,220,74,215,130,5,234,115,35) +IMAGE_DATA(234,62,47,41,95,33,191,250,248,252,249,243,67,195,195,195,14,33,132,104,226,241,248,148,170,251,234,12,79,69,133,187) +IMAGE_DATA(239,135,185,79,179,246,203,38,167,10,242,213,211,34,213,187,42,52,124,133,252,10,245,224,22,73,227,174,93,187,218,122) +IMAGE_DATA(251,250,166,147,242,25,9,33,75,155,125,251,246,97,191,15,125,244,90,149,215,152,158,210,61,42,189,239,231,61,167,106) +IMAGE_DATA(46,174,210,181,160,158,103,55,125,133,122,16,253,43,244,219,209,215,143,97,182,189,165,229,239,137,100,82,62,47,33,100) +IMAGE_DATA(201,113,238,220,249,161,162,162,34,204,79,53,40,47,188,161,242,154,82,143,167,204,30,85,182,181,95,54,190,66,61,136) +IMAGE_DATA(122,19,253,118,236,15,98,158,1,239,165,71,142,181,13,207,122,228,200,145,206,222,222,222,233,100,50,233,16,66,242,23) +IMAGE_DATA(196,121,75,75,75,162,172,172,12,125,41,204,163,35,151,66,205,135,185,4,236,247,189,168,124,161,235,190,133,244,212,108) +IMAGE_DATA(190,210,253,43,236,15,98,223,49,42,92,119,86,169,103,132,179,222,147,236,168,174,174,254,27,242,193,47,190,56,55,244) +IMAGE_DATA(253,247,189,211,67,67,73,135,16,146,187,32,142,17,207,159,124,114,164,179,62,22,195,185,46,168,245,26,148,163,240,189) +IMAGE_DATA(153,215,149,15,54,41,63,108,80,190,240,214,125,11,229,169,116,190,66,255,10,253,123,236,55,34,167,211,57,214,38,195) +IMAGE_DATA(89,168,81,223,81,207,31,19,238,249,127,56,175,20,103,193,255,89,178,83,242,23,201,71,132,144,208,179,83,129,248,133) +IMAGE_DATA(155,144,63,197,132,27,223,168,245,80,87,85,9,55,254,241,189,25,248,0,189,34,248,1,158,208,251,125,139,229,41,125) +IMAGE_DATA(249,249,10,243,12,200,229,224,74,204,52,172,83,207,134,103,140,10,247,156,135,151,213,243,227,220,63,228,91,111,171,117) +IMAGE_DATA(189,43,169,17,110,254,85,75,8,9,53,136,211,26,5,226,23,113,140,120,198,222,26,226,27,113,142,120,71,174,82,34) +IMAGE_DATA(220,190,20,106,46,157,75,193,19,79,194,83,250,242,190,75,194,204,177,180,179,240,108,58,207,122,78,164,188,85,166,214) +IMAGE_DATA(82,169,214,245,138,112,123,92,224,53,131,42,66,72,40,48,227,82,199,42,226,22,241,139,56,70,60,35,174,163,194,237) +IMAGE_DATA(71,161,214,67,220,35,103,129,7,214,136,199,115,41,204,63,205,103,191,47,219,203,188,143,206,177,150,137,153,206,66,206) +IMAGE_DATA(87,168,158,27,181,42,242,45,184,11,223,131,46,81,107,195,62,98,41,33,36,39,64,188,34,110,17,191,136,99,184,9) +IMAGE_DATA(249,19,252,132,28,10,241,142,184,71,252,195,81,232,75,161,246,242,203,165,22,219,83,230,149,137,179,86,137,148,183,80) +IMAGE_DATA(35,234,156,11,192,97,235,9,33,57,5,226,86,199,48,226,25,113,109,250,201,172,245,180,163,252,222,241,247,164,47,239) +IMAGE_DATA(253,189,206,210,222,210,238,210,254,194,30,226,106,66,72,78,130,248,213,94,2,200,159,16,227,58,135,210,181,158,55,143) +IMAGE_DATA(178,225,40,239,229,231,44,237,45,175,187,116,79,30,172,32,132,228,20,58,118,205,120,214,110,210,132,209,81,222,203,251) +IMAGE_DATA(124,65,238,34,132,228,7,58,182,131,98,63,87,174,160,231,39,132,228,47,249,112,217,254,29,18,66,22,150,39,118,253) +IMAGE_DATA(31,226,181,246,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) +IMAGE_END_DATA(2912, 1) + +IMAGE_BEGIN_DATA +IMAGE_DATA(120,156,237,157,91,108,20,215,25,199,79,90,2,4,219,13,46,16,108,179,198,166,196,56,78,48,105,82,146,52,198,24) +IMAGE_DATA(135,75,8,208,8,137,230,165,170,42,21,90,53,37,224,64,145,26,1,85,10,2,210,40,109,224,161,117,154,23,68,16) +IMAGE_DATA(32,48,198,68,42,86,110,16,204,237,137,135,96,47,24,72,72,147,197,197,129,128,177,195,197,203,29,166,231,207,156,147) +IMAGE_DATA(61,30,207,120,189,190,48,187,246,127,164,223,3,194,222,153,177,244,255,233,251,190,115,118,70,60,118,223,4,225,211,113) +IMAGE_DATA(31,33,164,71,209,19,14,191,255,134,132,16,127,72,132,195,235,218,127,160,248,33,33,164,71,161,179,157,40,222,114,115) +IMAGE_DATA(147,121,63,125,36,247,27,244,85,244,35,132,36,20,125,13,116,158,145,111,167,191,226,205,89,94,142,210,110,210,62,234) +IMAGE_DATA(47,121,64,49,64,146,36,73,38,132,36,36,200,47,114,172,51,141,124,107,143,153,238,138,23,103,181,229,40,92,183,246) +IMAGE_DATA(18,238,237,71,146,7,37,3,37,63,86,12,146,12,38,132,36,20,200,173,206,48,242,140,92,35,223,218,97,200,189,233) +IMAGE_DATA(45,93,107,249,225,44,47,71,233,26,234,1,17,241,83,170,176,239,237,33,73,154,36,67,50,76,18,144,100,74,134,75) +IMAGE_DATA(178,8,33,9,1,242,138,220,34,191,200,49,242,140,92,35,223,240,24,242,14,119,33,255,168,83,80,111,153,206,114,214) +IMAGE_DATA(89,221,121,152,231,113,171,163,112,141,112,173,246,83,134,186,183,108,201,72,73,142,36,87,146,39,121,84,242,152,98,180) +IMAGE_DATA(65,62,33,36,46,48,115,169,179,138,220,34,191,200,49,242,140,92,143,16,118,206,145,247,161,194,206,63,60,144,34,108) +IMAGE_DATA(103,193,15,94,189,97,119,28,206,90,74,207,163,156,142,130,103,3,234,250,115,212,125,225,190,159,144,140,149,60,45,249) +IMAGE_DATA(185,164,64,49,78,82,72,8,137,107,144,83,157,89,228,23,57,70,158,145,107,228,27,57,71,222,145,251,128,176,61,128) +IMAGE_DATA(90,11,94,128,31,116,111,232,86,99,117,229,225,230,41,156,23,206,68,175,135,222,117,168,136,56,42,87,93,255,147,234) +IMAGE_DATA(190,112,175,197,146,201,146,169,146,105,146,25,138,23,9,33,9,129,206,44,242,139,28,35,207,197,194,206,55,114,254,51) +IMAGE_DATA(97,231,254,17,201,79,68,196,89,240,3,60,129,121,86,119,250,202,205,83,232,67,117,45,5,119,162,246,203,22,17,71) +IMAGE_DATA(193,183,240,240,68,220,211,172,89,179,222,40,45,45,173,60,112,224,64,237,133,11,23,194,22,15,30,60,18,254,64,158) +IMAGE_DATA(145,107,228,91,230,252,5,149,119,120,235,41,201,24,229,131,17,202,15,67,68,164,198,234,223,13,190,138,230,41,204,164) +IMAGE_DATA(224,206,135,133,221,203,106,71,77,202,204,204,156,179,105,211,166,221,116,19,15,30,61,255,64,206,55,110,220,88,53,102) +IMAGE_DATA(204,152,18,97,215,91,133,202,7,152,117,161,55,196,60,11,189,87,170,136,244,132,93,229,171,182,60,149,170,206,139,181) +IMAGE_DATA(129,81,146,199,133,93,3,62,39,29,53,123,195,134,13,85,119,238,220,177,8,33,189,143,253,251,247,215,42,103,161,206) +IMAGE_DATA(122,86,242,83,97,215,88,240,133,238,9,83,186,208,87,230,122,159,211,83,105,234,188,232,75,49,147,66,45,53,101,229) +IMAGE_DATA(202,149,91,224,87,191,255,86,132,16,255,89,181,106,85,153,176,231,90,133,202,19,152,191,103,27,190,234,138,126,208,185) +IMAGE_DATA(47,161,159,136,244,125,186,158,210,158,26,159,146,146,242,210,190,125,251,106,111,223,190,109,17,66,136,38,24,12,134,2) +IMAGE_DATA(129,192,108,233,137,34,97,247,132,166,175,116,63,104,206,219,99,113,149,179,247,195,190,132,1,34,50,159,26,110,120,170) +IMAGE_DATA(40,63,63,127,126,77,77,77,200,239,191,9,33,36,62,105,106,106,10,75,79,160,39,156,96,248,42,75,213,61,240,138) +IMAGE_DATA(94,31,236,19,99,109,229,236,253,208,83,98,189,17,235,125,152,163,99,62,133,61,21,227,225,75,121,29,205,126,255,45) +IMAGE_DATA(8,33,241,141,225,171,34,85,231,96,126,133,121,251,16,229,23,115,118,213,30,87,153,53,149,217,251,161,183,196,186,35) +IMAGE_DATA(246,168,98,142,62,14,125,95,117,117,117,232,214,173,91,22,33,132,68,163,177,177,49,172,250,193,66,229,145,28,229,21) +IMAGE_DATA(61,187,138,165,23,116,171,169,240,253,30,244,126,217,194,222,151,128,245,190,41,123,246,236,173,245,251,222,9,33,137,197) +IMAGE_DATA(161,67,213,33,97,207,219,177,62,136,253,12,216,127,165,123,65,204,154,250,198,224,42,103,77,133,239,205,232,222,15,251) +IMAGE_DATA(82,139,23,45,90,180,246,230,205,91,22,33,132,196,202,138,21,43,176,62,136,253,12,152,93,229,42,191,96,198,132,125) +IMAGE_DATA(12,122,93,176,173,185,149,87,77,53,84,185,15,251,209,11,208,251,53,156,63,31,190,113,243,166,69,8,33,29,33,16) +IMAGE_DATA(8,204,17,118,47,136,253,237,248,62,78,90,12,181,149,185,246,103,206,169,134,41,247,193,129,19,223,91,191,190,234,198) +IMAGE_DATA(141,27,22,33,132,116,148,170,61,123,106,133,189,191,253,41,163,182,26,36,34,115,43,115,77,208,203,85,122,223,39,102) +IMAGE_DATA(243,122,78,133,190,178,64,186,112,246,117,121,30,66,188,120,127,251,118,43,111,84,174,149,153,49,204,90,88,242,170,239) +IMAGE_DATA(215,67,226,151,209,163,71,151,168,218,42,95,245,110,15,137,232,107,130,110,253,31,234,177,116,97,127,215,15,107,140,197) +IMAGE_DATA(203,151,47,47,187,126,253,186,69,136,27,239,87,108,191,235,40,147,187,190,138,131,107,35,241,199,186,117,235,170,132,61) +IMAGE_DATA(183,194,28,92,175,9,166,70,233,3,77,87,153,253,31,234,50,236,251,196,179,106,158,63,113,226,196,185,107,215,174,89) +IMAGE_DATA(132,56,217,94,81,209,202,83,154,5,37,37,190,95,31,137,63,206,158,61,27,22,246,154,32,246,22,96,127,40,246,91) +IMAGE_DATA(13,54,250,64,47,87,153,235,127,152,199,99,143,86,150,234,255,198,161,94,187,122,245,170,69,136,147,237,219,182,121,122) +IMAGE_DATA(234,123,95,205,47,241,253,58,73,252,49,115,230,204,55,140,62,48,219,232,3,251,123,204,172,204,89,149,222,167,142,245) +IMAGE_DATA(63,204,231,177,103,107,194,130,5,11,214,94,185,114,197,34,196,164,162,60,186,167,76,95,249,125,189,36,190,88,179,102) +IMAGE_DATA(77,165,176,159,215,135,103,49,96,175,57,214,3,31,52,102,86,209,92,53,80,253,142,158,85,77,172,168,168,56,24,14) +IMAGE_DATA(95,177,8,209,108,243,240,212,171,210,73,71,14,31,177,242,114,70,185,254,159,223,215,77,226,135,93,187,62,197,122,224) +IMAGE_DATA(36,97,239,51,200,81,51,242,129,194,125,190,238,156,171,15,80,243,45,204,185,176,255,19,107,138,83,118,238,220,117,52) +IMAGE_DATA(28,14,91,132,128,109,91,203,221,61,53,111,254,247,63,115,216,203,87,198,207,144,222,205,233,211,103,48,179,122,94,205) +IMAGE_DATA(196,115,69,203,249,122,91,174,194,236,61,73,180,220,87,133,207,152,218,220,28,182,8,1,229,101,91,93,61,85,34,29) +IMAGE_DATA(228,252,217,96,240,176,171,175,220,126,150,244,78,132,253,252,227,103,212,58,94,64,249,39,73,180,94,11,244,114,21,126) +IMAGE_DATA(7,179,121,204,232,95,184,124,185,217,34,100,171,151,167,230,206,243,252,157,96,77,208,221,87,109,252,14,233,61,8,251) +IMAGE_DATA(93,19,122,45,176,179,174,154,118,233,242,101,139,244,110,202,202,202,92,61,53,95,58,39,218,239,214,212,212,120,250,202) +IMAGE_DATA(239,251,34,254,226,225,170,228,142,214,85,23,47,93,178,72,239,165,186,186,218,195,83,115,99,250,12,55,95,253,101,201) +IMAGE_DATA(82,223,239,143,248,71,23,212,85,45,230,85,23,47,94,180,72,239,229,239,111,190,213,218,83,127,156,27,243,231,28,58) +IMAGE_DATA(116,168,149,175,240,111,191,239,143,248,71,7,231,85,158,235,128,31,126,244,209,209,11,242,115,73,239,100,239,222,125,45) +IMAGE_DATA(252,50,79,122,170,163,159,245,217,103,45,125,245,155,95,253,218,247,251,35,254,80,87,87,23,203,58,160,16,237,216,95) +IMAGE_DATA(181,121,203,150,131,77,223,93,176,72,239,165,114,71,165,245,214,223,222,180,54,109,218,220,233,207,250,252,139,19,119,63) +IMAGE_DATA(235,221,127,191,107,213,215,215,251,126,111,196,31,62,248,224,195,88,246,87,185,185,170,213,190,245,87,94,153,183,182,177) +IMAGE_DATA(233,59,139,16,66,186,138,37,75,151,226,185,123,197,34,246,125,235,158,223,7,204,203,203,43,57,223,216,100,17,66,72) +IMAGE_DATA(87,49,109,250,244,142,124,31,48,234,115,22,170,107,130,231,26,206,55,90,132,16,210,89,190,250,58,228,246,156,5,243) +IMAGE_DATA(121,123,29,126,126,213,226,197,139,203,26,26,26,44,66,8,233,44,165,165,239,232,231,87,61,41,218,255,252,42,231,204) +IMAGE_DATA(202,245,185,160,233,25,25,179,207,201,115,16,66,72,103,201,200,200,208,207,92,143,229,185,160,166,171,218,124,222,250,63) +IMAGE_DATA(255,85,90,117,246,92,131,69,8,33,29,229,63,59,118,116,246,121,235,81,223,99,147,156,156,252,210,137,47,191,12,159) +IMAGE_DATA(249,246,172,69,8,33,29,33,61,61,163,173,247,216,180,231,125,166,94,239,7,68,109,133,125,161,119,231,86,127,120,249) +IMAGE_DATA(229,181,167,207,124,107,17,66,72,172,252,249,181,215,58,251,126,192,182,106,43,243,189,203,216,11,63,229,189,245,235,15) +IMAGE_DATA(126,115,250,140,69,8,33,237,229,211,221,187,245,123,151,177,246,215,217,247,46,187,213,86,152,91,97,70,63,82,213,108) +IMAGE_DATA(5,73,73,73,191,220,185,107,119,168,190,254,180,69,8,33,209,56,118,252,139,102,204,144,132,221,251,97,143,249,195,202) +IMAGE_DATA(43,250,185,10,253,218,89,83,181,85,91,97,54,143,26,77,191,43,254,9,201,120,156,247,216,241,207,155,235,235,191,177) +IMAGE_DATA(8,33,196,11,233,137,112,110,110,46,222,7,88,36,236,89,18,122,63,236,167,26,34,218,183,246,23,173,182,210,207,94) +IMAGE_DATA(64,109,166,123,193,225,234,60,56,95,81,122,122,250,111,63,217,185,43,116,170,190,222,34,132,16,39,71,143,29,111,86) +IMAGE_DATA(158,154,32,236,25,21,246,125,102,41,159,232,222,207,185,246,215,30,87,57,107,43,221,11,38,169,207,29,170,206,243,136) +IMAGE_DATA(242,213,120,244,131,229,229,219,106,235,254,119,202,34,132,16,205,199,31,127,18,74,74,186,219,247,21,25,158,202,22,246) +IMAGE_DATA(186,31,246,125,154,189,95,44,53,149,151,175,238,23,145,217,85,170,225,43,212,87,232,7,199,73,166,204,249,221,239,215) +IMAGE_DATA(30,62,114,52,124,178,238,148,69,8,233,221,252,105,209,34,172,247,97,142,94,168,234,26,211,83,122,70,165,215,253,156) +IMAGE_DATA(207,169,234,136,171,116,47,168,247,179,155,190,66,63,136,249,21,230,237,152,235,23,167,165,165,205,126,123,245,234,170,208) +IMAGE_DATA(201,58,139,16,210,251,40,219,90,94,43,61,128,253,83,19,149,23,30,87,117,77,150,195,83,230,140,42,214,222,47,22) +IMAGE_DATA(95,161,31,68,191,137,121,59,214,7,177,159,1,239,165,71,141,53,9,215,250,215,101,203,42,131,193,195,225,175,67,39) +IMAGE_DATA(45,66,72,207,5,57,255,199,219,171,171,114,114,70,97,46,133,253,232,168,165,208,243,97,95,2,214,251,50,149,47,116) +IMAGE_DATA(223,215,149,158,138,230,43,61,191,194,250,32,214,29,179,133,237,206,124,117,141,112,214,115,146,169,99,199,142,93,178,112) +IMAGE_DATA(225,194,178,205,91,202,106,171,107,130,225,255,126,21,178,8,33,137,11,114,140,60,191,254,250,178,202,73,147,39,227,185) +IMAGE_DATA(46,232,245,38,42,71,225,123,51,99,148,15,70,40,63,12,81,190,112,246,125,93,229,169,182,124,133,249,21,230,247,88) +IMAGE_DATA(111,68,77,167,107,172,17,134,179,208,163,62,163,174,191,88,216,207,255,195,243,74,241,44,248,233,146,25,146,95,72,94) +IMAGE_DATA(36,132,196,61,51,20,200,47,220,132,250,169,88,216,249,70,175,135,190,42,95,216,249,199,247,102,224,3,204,138,224,7) +IMAGE_DATA(120,66,175,247,117,151,167,244,225,230,43,236,103,64,45,7,87,98,79,195,32,117,109,184,198,108,97,63,231,33,79,93) +IMAGE_DATA(63,158,251,135,122,235,105,117,95,207,74,10,132,93,127,21,18,66,226,26,228,180,64,129,252,34,199,200,51,214,214,144) +IMAGE_DATA(111,228,28,121,71,173,18,16,246,92,10,61,151,174,165,224,137,123,225,41,125,56,223,37,97,214,88,218,89,184,54,93) +IMAGE_DATA(103,165,139,136,183,70,170,123,201,85,247,245,168,176,103,92,96,180,65,62,33,36,46,48,115,169,179,138,220,34,191,200) +IMAGE_DATA(49,242,140,92,103,11,123,30,133,94,15,185,71,205,2,15,164,136,150,181,20,246,63,117,102,189,47,214,195,60,143,174) +IMAGE_DATA(177,250,136,214,206,66,205,151,170,174,27,189,42,234,45,184,11,223,131,14,168,123,195,58,98,22,33,36,33,64,94,145) +IMAGE_DATA(91,228,23,57,134,155,80,63,193,79,168,161,144,119,228,30,249,135,163,48,151,66,239,229,86,75,117,183,167,204,163,61) +IMAGE_DATA(206,26,32,34,222,66,143,168,107,46,0,135,13,38,132,36,20,200,173,206,48,242,140,92,155,126,50,123,61,237,40,183) +IMAGE_DATA(119,252,221,235,195,121,126,167,179,180,183,180,187,180,191,176,134,152,76,8,73,72,144,95,237,37,128,250,9,25,215,53) +IMAGE_DATA(148,238,245,156,117,148,31,142,114,30,110,206,210,222,114,186,75,207,228,65,63,66,72,66,161,179,107,230,89,187,73,19) +IMAGE_DATA(143,142,114,30,206,235,243,114,23,33,164,103,160,179,237,149,253,68,57,188,174,159,16,210,115,233,9,135,223,127,67,66) +IMAGE_DATA(72,215,114,207,142,255,3,79,235,152,232,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) +IMAGE_END_DATA(3040, 1) + +IMAGE_BEGIN_DATA +IMAGE_DATA(120,156,237,217,223,79,20,89,22,7,240,235,136,136,180,32,63,212,102,68,80,108,126,138,142,252,146,69,135,1,182,135) +IMAGE_DATA(94,92,157,73,102,163,127,192,250,106,22,215,248,50,160,99,240,97,197,77,140,238,76,118,162,241,9,93,81,24,146,109) +IMAGE_DATA(30,72,70,119,18,201,78,214,140,96,140,10,52,8,254,66,125,244,157,231,218,123,168,115,237,75,77,85,55,48,2,221) +IMAGE_DATA(213,223,78,78,52,118,117,213,249,212,61,247,220,91,165,104,20,229,171,196,202,126,86,217,132,219,62,118,198,133,70,60) +IMAGE_DATA(125,156,12,31,105,177,218,38,244,239,227,233,62,56,89,117,91,18,199,154,8,161,142,177,222,147,88,189,15,78,94,229) +IMAGE_DATA(76,150,177,150,35,69,198,186,8,145,162,29,155,44,194,247,195,233,62,172,212,199,206,108,245,146,39,85,198,122,25,105) +IMAGE_DATA(50,210,101,100,68,136,116,62,110,61,255,110,157,176,191,15,43,121,15,156,204,202,235,17,166,97,131,140,76,25,217,50) +IMAGE_DATA(54,201,240,202,200,145,241,177,140,45,90,124,204,255,238,229,227,178,249,119,27,248,60,30,17,190,15,78,247,96,169,63) +IMAGE_DATA(118,99,173,155,105,188,210,57,239,141,108,33,91,158,140,237,50,118,200,40,148,81,36,163,88,139,34,254,247,29,124,92) +IMAGE_DATA(30,255,206,203,231,201,228,243,174,23,115,239,193,114,213,128,126,126,125,172,105,142,122,56,183,44,25,155,57,239,124,182) +IMAGE_DATA(144,173,76,198,110,25,123,100,84,201,168,177,137,42,254,126,55,31,95,204,191,207,231,243,109,230,243,167,243,245,82,196) +IMAGE_DATA(220,26,88,42,127,164,177,166,154,164,113,217,196,57,110,19,230,56,238,100,11,185,234,100,212,203,104,148,225,151,209,44) +IMAGE_DATA(35,160,69,51,255,123,35,31,87,199,191,219,195,231,41,226,243,110,225,235,100,242,117,35,213,192,82,186,169,23,209,24) +IMAGE_DATA(208,220,164,185,154,207,57,150,11,115,12,41,255,6,25,159,123,60,158,35,213,213,213,167,142,31,63,222,123,229,202,149) +IMAGE_DATA(225,155,55,111,134,110,222,186,53,126,235,125,244,132,174,94,189,58,124,226,196,137,222,154,154,154,83,116,60,253,142,127) +IMAGE_DATA(95,199,231,43,231,243,231,243,245,178,249,250,169,75,228,119,114,83,205,81,95,166,49,200,21,102,109,82,157,86,114,174) +IMAGE_DATA(77,50,90,190,250,234,79,223,93,190,124,121,248,217,179,103,134,25,207,141,103,207,159,27,207,41,94,188,48,94,188,143) +IMAGE_DATA(151,198,203,151,225,120,245,234,149,65,247,226,240,225,195,223,209,121,248,124,117,124,254,50,190,94,46,95,63,131,243,249) +IMAGE_DATA(208,126,125,126,43,247,122,190,30,205,191,173,194,28,11,154,163,181,194,28,167,150,191,180,182,246,12,14,14,190,155,154) +IMAGE_DATA(82,230,133,219,85,252,239,222,189,119,178,30,122,248,30,52,240,117,118,243,117,183,114,30,25,156,151,238,255,45,246,104) +IMAGE_DATA(110,170,61,234,71,52,39,247,201,248,188,170,170,234,212,221,187,131,239,38,167,166,140,169,217,248,237,246,87,211,211,198) +IMAGE_DATA(180,140,123,242,30,208,124,16,230,92,216,199,215,45,230,60,62,164,95,175,245,36,49,183,206,149,187,68,152,53,72,189) +IMAGE_DATA(169,165,173,173,125,96,114,114,210,152,156,156,50,150,194,110,198,107,163,163,163,99,64,152,53,80,207,215,47,177,248,85) +IMAGE_DATA(253,39,137,133,215,190,117,142,211,158,138,250,41,237,51,104,126,229,233,110,217,151,14,95,255,215,141,208,211,167,228,94) +IMAGE_DATA(122,59,197,15,63,252,16,162,235,90,252,121,156,223,6,206,55,89,44,124,238,91,107,157,206,67,253,148,246,24,106,126) +IMAGE_DATA(87,176,251,72,176,191,127,122,66,186,151,211,254,250,245,107,227,246,237,219,211,188,30,144,127,15,231,149,203,121,166,115) +IMAGE_DATA(222,11,169,125,187,90,167,57,68,123,10,218,119,250,132,217,103,246,211,125,15,6,131,210,253,212,88,9,187,230,167,241) +IMAGE_DATA(223,207,121,249,56,207,44,17,158,251,243,173,125,187,49,167,26,162,185,68,123,11,218,103,80,159,109,238,236,236,28,156) +IMAGE_DATA(152,152,48,86,210,78,113,241,226,197,65,97,238,141,106,57,191,109,156,175,170,253,249,142,189,221,152,211,30,130,106,137) +IMAGE_DATA(122,42,237,49,154,228,167,115,214,29,3,246,55,111,222,24,129,64,160,83,152,123,128,42,206,51,55,194,216,47,100,204) +IMAGE_DATA(233,121,162,64,132,107,253,200,253,161,161,153,88,178,143,141,141,205,240,220,87,181,95,192,121,207,119,236,245,222,174,207) +IMAGE_DATA(115,186,135,212,71,105,127,237,239,236,60,127,119,92,185,99,196,78,193,107,159,159,243,180,27,123,189,231,59,217,213,179) +IMAGE_DATA(25,245,74,154,55,219,101,236,162,123,234,245,122,143,142,143,79,24,177,104,167,200,201,201,249,51,143,253,46,206,123,51) +IMAGE_DATA(59,212,51,159,157,221,90,239,244,124,64,251,4,234,153,244,92,61,59,207,143,29,59,214,27,203,246,147,39,79,246,138) +IMAGE_DATA(240,188,47,228,252,51,216,227,84,247,186,93,239,113,180,158,211,179,195,239,100,180,252,231,167,159,222,197,178,253,254,253) +IMAGE_DATA(251,239,132,185,231,163,158,95,202,249,103,91,234,222,206,174,247,119,170,147,77,92,55,212,59,234,125,190,194,227,161,241) +IMAGE_DATA(113,35,150,237,111,223,190,53,74,74,74,90,101,190,159,114,221,111,99,71,154,112,238,247,250,92,87,253,157,158,145,105) +IMAGE_DATA(175,80,161,234,61,30,236,92,247,141,156,55,229,111,237,247,186,221,110,109,163,57,66,239,72,104,159,72,125,179,185,171) +IMAGE_DATA(235,90,40,30,236,125,125,125,33,97,62,235,85,115,254,106,206,91,215,58,171,157,246,255,244,28,148,197,115,165,148,231) +IMAGE_DATA(78,203,47,191,220,159,137,7,59,207,249,63,112,222,37,60,134,153,14,253,206,106,87,125,142,158,139,104,143,72,207,202) +IMAGE_DATA(7,229,160,27,241,96,167,144,249,30,16,230,123,158,50,30,195,44,30,211,228,8,118,213,227,55,114,159,40,231,190,241) +IMAGE_DATA(69,156,217,15,242,152,237,228,49,84,189,62,154,61,77,252,170,199,251,254,26,103,246,67,194,220,227,208,216,229,243,88) +IMAGE_DATA(218,173,115,42,244,245,141,246,67,180,39,254,68,70,67,101,101,229,233,56,179,127,193,245,90,206,245,27,201,110,93,219) +IMAGE_DATA(149,157,222,9,52,74,251,55,113,102,255,82,152,239,52,118,45,192,174,239,227,119,176,189,73,218,207,36,144,221,203,246) +IMAGE_DATA(138,4,181,251,92,96,223,13,251,162,236,149,176,187,222,110,125,71,7,59,236,176,195,14,59,236,176,195,14,59,236,176) +IMAGE_DATA(195,14,59,236,176,195,14,59,236,176,195,14,59,236,176,195,14,59,236,176,195,14,59,236,176,195,14,59,236,176,195,14) +IMAGE_DATA(59,236,176,195,14,59,236,176,195,14,59,236,176,195,14,59,236,176,195,14,59,236,176,195,14,59,236,176,195,14,59,236) +IMAGE_DATA(176,195,14,59,236,176,195,14,59,236,176,195,14,59,236,176,195,14,59,236,176,195,14,59,236,176,195,14,59,236,176,195) +IMAGE_DATA(14,59,236,176,195,14,59,236,176,195,62,199,62,54,54,102,60,120,240,96,246,207,68,178,15,15,63,48,190,253,199,183) +IMAGE_DATA(179,113,249,159,223,27,143,31,63,78,24,251,157,219,119,222,219,195,254,39,9,97,255,249,191,63,207,177,43,255,147,39) +IMAGE_DATA(79,92,111,167,249,30,252,119,48,170,223,173,118,234,243,209,252,110,182,211,26,23,12,58,251,221,110,167,245,221,201,63) +IMAGE_DATA(162,251,93,106,167,245,173,223,201,63,50,226,122,123,84,191,203,237,180,190,219,250,191,39,255,168,235,237,212,223,251,131) +IMAGE_DATA(253,182,254,68,176,83,143,183,218,41,220,110,39,55,205,113,171,251,86,247,45,87,219,159,60,182,119,95,239,234,154,253) +IMAGE_DATA(157,91,237,143,163,184,221,218,231,233,25,214,206,125,77,185,93,186,190,63,154,143,219,133,246,71,143,30,205,207,237,50) +IMAGE_DATA(123,36,55,29,239,214,231,184,209,209,177,8,238,41,87,63,191,91,223,89,217,185,19,197,78,110,58,62,17,222,215,77) +IMAGE_DATA(76,60,53,186,111,116,243,126,173,123,246,248,68,121,79,155,232,255,55,1,59,236,176,195,14,59,236,176,195,14,59,236) +IMAGE_DATA(176,195,14,59,236,176,195,14,59,236,176,195,14,59,236,176,195,14,59,236,176,195,14,59,236,176,195,14,59,236,176,195) +IMAGE_DATA(14,59,236,176,195,14,59,236,176,195,14,59,236,176,195,14,59,236,176,195,14,59,236,176,195,14,59,236,176,195,14,59) +IMAGE_DATA(236,176,195,14,59,236,176,195,14,59,236,176,195,14,59,236,176,195,14,59,236,176,195,14,59,236,176,195,14,59,236,176) +IMAGE_DATA(195,14,59,236,176,195,14,59,236,75,104,79,146,145,34,35,29,246,89,123,5,236,9,103,223,225,2,251,174,69,216,55) +IMAGE_DATA(179,125,79,2,217,215,106,246,2,182,55,74,251,55,46,182,175,114,176,127,34,163,65,218,79,199,161,253,83,25,229,243) +IMAGE_DATA(180,175,230,239,210,100,108,146,177,157,123,197,103,210,126,42,206,236,135,100,236,103,123,254,2,236,235,249,216,109,92,51) +IMAGE_DATA(84,59,95,198,169,125,167,140,60,25,217,236,74,158,135,61,155,239,215,78,62,199,161,56,179,255,81,70,157,140,50,25) +IMAGE_DATA(91,101,100,201,240,68,177,39,243,49,89,252,155,50,62,199,129,56,179,183,200,168,149,81,34,35,151,61,169,81,236,107) +IMAGE_DATA(248,152,76,25,91,100,20,203,216,43,35,208,213,117,109,60,30,236,125,125,125,33,153,111,179,140,26,25,69,236,200,16) +IMAGE_DATA(230,179,202,26,139,93,88,236,235,248,216,28,25,133,50,170,100,252,254,235,175,219,6,226,193,126,246,236,217,1,153,111) +IMAGE_DATA(147,48,159,69,124,236,216,160,217,63,210,220,202,110,183,191,81,235,220,103,141,141,77,231,226,193,30,8,4,206,137,240) +IMAGE_DATA(126,182,128,29,233,236,74,138,96,183,246,122,213,239,234,82,83,61,71,98,221,30,10,133,102,168,55,105,125,46,79,56) +IMAGE_DATA(175,111,186,221,218,239,244,57,79,115,199,255,183,115,231,6,99,217,126,233,210,165,65,202,83,70,181,54,215,51,133,125) +IMAGE_DATA(143,183,179,91,223,97,20,112,253,212,203,61,78,123,44,219,247,238,221,219,110,169,119,175,101,174,219,217,173,115,94,175) +IMAGE_DATA(123,90,235,74,133,185,102,4,174,93,187,30,138,69,59,247,247,0,231,89,202,121,235,245,110,55,215,157,234,158,214,58) +IMAGE_DATA(213,239,169,95,210,115,77,189,207,87,216,26,139,246,226,226,226,86,30,243,61,34,220,223,51,132,253,186,238,100,87,239) +IMAGE_DATA(238,168,47,166,89,198,126,118,222,183,181,181,13,196,146,189,163,163,131,214,53,63,231,167,143,121,26,59,244,181,205,206) +IMAGE_DATA(30,109,236,105,254,208,254,126,159,140,150,96,48,56,29,11,246,59,119,238,76,11,115,31,183,143,243,43,88,224,152,219) +IMAGE_DATA(217,233,94,233,251,123,234,153,212,59,233,93,78,189,215,235,61,58,52,52,52,179,146,246,209,209,209,153,156,156,156,163) +IMAGE_DATA(92,235,21,34,220,219,213,179,203,90,17,185,199,69,243,83,143,164,189,1,61,215,210,122,73,123,100,218,235,53,20,22) +IMAGE_DATA(22,182,14,13,15,207,172,132,157,220,60,199,27,56,159,18,206,111,19,231,27,173,183,71,178,235,61,159,214,71,170,33) +IMAGE_DATA(90,51,232,217,150,246,13,52,183,154,76,255,131,153,229,180,107,238,38,206,163,140,243,242,114,158,30,241,235,222,62,31) +IMAGE_DATA(187,221,216,171,218,167,125,2,205,165,237,154,191,129,234,191,191,191,127,122,57,236,63,254,120,123,154,235,188,65,115,111) +IMAGE_DATA(231,188,50,197,226,106,221,105,236,149,63,133,207,155,101,241,83,189,209,124,107,105,111,111,31,88,74,59,247,243,22,190) +IMAGE_DATA(94,149,197,157,197,249,169,190,190,90,44,124,204,35,249,105,14,165,105,126,170,51,154,103,212,103,168,207,250,105,14,220) +IMAGE_DATA(184,113,35,244,33,237,189,189,189,161,162,162,34,170,113,63,95,167,130,175,187,77,115,167,137,185,115,124,177,238,104,126) +IMAGE_DATA(85,255,52,191,168,191,80,127,165,245,133,106,144,198,36,80,93,93,221,126,254,252,223,7,31,62,124,56,179,24,251,200) +IMAGE_DATA(200,200,204,133,11,23,6,107,106,106,104,159,26,224,243,214,240,117,138,248,186,94,17,174,243,15,233,142,228,87,245,79) +IMAGE_DATA(125,133,250,42,173,43,180,174,210,190,130,246,85,181,156,171,223,227,241,28,246,251,253,231,78,159,62,61,208,221,125,51) +IMAGE_DATA(20,201,222,211,211,19,58,115,230,204,64,115,115,51,61,135,210,243,152,159,207,83,203,231,45,229,235,108,225,235,102,136) +IMAGE_DATA(15,87,231,11,241,171,254,79,235,9,173,167,84,123,180,159,242,113,142,244,60,65,207,83,117,156,127,147,48,223,167,180) +IMAGE_DATA(176,139,222,169,29,228,63,15,240,191,55,243,113,245,252,187,106,62,79,41,159,119,43,95,39,155,175,171,250,249,82,185) +IMAGE_DATA(163,249,213,28,160,49,216,168,221,3,26,31,170,205,50,206,159,222,163,80,205,214,178,139,98,159,246,247,90,254,190,146) +IMAGE_DATA(143,47,227,223,23,104,230,141,34,60,214,235,150,201,237,228,79,210,238,1,237,31,211,180,123,64,115,145,106,51,143,243) +IMAGE_DATA(247,177,165,132,93,214,40,225,239,125,124,124,30,255,222,171,153,211,248,58,202,156,180,76,110,245,177,254,95,150,170,1) +IMAGE_DATA(218,55,167,112,110,52,46,244,220,156,201,121,211,123,163,28,182,208,123,211,173,54,145,203,223,231,240,241,27,249,247,27) +IMAGE_DATA(248,124,169,124,254,100,97,63,214,75,237,86,31,187,119,188,250,61,80,115,193,195,121,167,179,129,198,46,43,66,100,240) +IMAGE_DATA(113,233,252,59,143,8,215,182,110,182,123,207,188,220,31,235,245,173,115,65,221,7,26,175,117,28,52,126,30,17,190,47) +IMAGE_DATA(234,239,169,218,49,41,98,174,215,174,182,87,202,108,253,56,221,3,21,234,94,168,72,182,9,253,251,36,203,239,99,209) +IMAGE_DATA(108,253,88,243,211,239,133,245,126,56,133,58,214,233,92,241,240,113,202,125,49,225,134,79,76,57,255,15,189,108,161,125) +IMAGE_END_DATA(3072, 1) + +IMAGE_BEGIN_DATA +IMAGE_DATA(120,156,237,217,89,80,84,217,25,7,240,227,136,136,54,141,44,42,32,160,34,178,41,224,2,65,112,176,65,132,193,113) +IMAGE_DATA(41,199,229,101,242,164,111,177,148,25,243,50,41,113,28,227,140,75,82,19,77,140,230,213,7,181,70,146,210,84,18,106) +IMAGE_DATA(226,58,184,144,23,147,200,162,141,227,58,184,141,163,32,136,75,187,235,205,249,232,239,134,195,157,123,27,97,4,186,155) +IMAGE_DATA(127,87,125,53,22,125,251,222,239,119,207,119,190,115,238,29,145,47,38,14,16,125,251,25,96,18,254,246,49,51,118,53) +IMAGE_DATA(124,233,99,101,120,71,137,129,38,161,126,239,75,247,193,202,170,218,2,56,6,121,8,253,24,227,61,241,214,251,96,229) +IMAGE_DATA(213,157,129,50,6,115,4,201,24,226,33,130,148,99,3,69,251,253,176,186,15,125,245,49,51,27,189,228,25,42,35,88) +IMAGE_DATA(134,93,70,136,140,80,15,17,194,199,5,243,239,134,8,243,251,208,151,247,192,202,172,123,109,194,109,24,38,35,76,70) +IMAGE_DATA(132,140,17,50,34,101,68,201,136,150,49,74,137,104,254,123,36,31,23,193,191,27,198,231,177,137,246,251,96,117,15,122) +IMAGE_DATA(250,99,54,214,170,153,198,43,132,243,30,206,22,178,197,201,24,43,99,156,140,241,50,18,101,36,41,145,200,127,31,199) +IMAGE_DATA(199,197,241,239,34,249,60,97,124,222,96,209,241,30,244,86,13,168,231,87,199,154,230,168,141,115,11,151,49,146,243,30) +IMAGE_DATA(205,22,178,165,202,72,151,49,73,198,84,25,89,38,49,149,191,79,231,227,147,248,247,163,249,124,35,249,252,33,124,189) +IMAGE_DATA(32,209,177,6,122,202,239,105,172,169,38,105,92,70,112,142,99,132,123,28,39,176,133,92,57,50,242,100,228,203,40,148) +IMAGE_DATA(81,36,163,88,137,34,254,123,62,31,151,195,191,155,196,231,73,228,243,142,226,235,132,241,117,61,213,64,79,186,169,23) +IMAGE_DATA(209,24,208,220,164,185,58,154,115,156,40,220,99,72,249,59,100,204,10,14,14,94,146,59,125,122,89,89,217,154,242,189) +IMAGE_DATA(123,203,79,29,56,112,192,121,224,224,193,250,131,135,14,213,31,106,139,195,206,125,251,246,157,250,236,179,117,229,51,102) +IMAGE_DATA(204,40,179,219,237,75,232,119,252,251,28,62,223,68,62,255,104,190,94,4,95,127,104,15,249,173,220,84,115,212,151,105) +IMAGE_DATA(12,98,132,187,54,169,78,167,112,174,5,50,74,62,252,240,231,219,246,236,217,115,234,110,115,139,214,220,114,79,107,185) +IMAGE_DATA(215,170,221,107,189,175,221,191,47,227,193,3,237,193,195,135,218,195,135,143,180,71,143,92,154,203,69,241,88,123,252,248) +IMAGE_DATA(177,246,228,201,19,109,255,254,253,167,150,46,93,186,141,206,195,231,203,225,243,167,242,245,98,248,250,161,156,207,219,246) +IMAGE_DATA(171,243,91,119,7,243,245,104,254,197,10,247,88,208,28,205,22,238,113,42,249,228,147,95,237,61,93,93,221,216,212,212) +IMAGE_DATA(164,53,53,221,213,186,99,127,250,244,169,246,236,217,51,237,210,229,203,141,235,215,175,223,203,247,192,193,215,73,231,235) +IMAGE_DATA(198,114,30,161,156,151,234,255,41,246,206,220,84,123,212,143,104,78,230,202,152,53,109,218,180,178,127,255,231,191,141,183) +IMAGE_DATA(239,52,106,141,109,238,159,110,127,246,252,185,246,92,198,229,43,87,26,29,14,71,153,112,207,133,92,190,110,18,231,241) +IMAGE_DATA(54,253,106,173,7,136,142,117,174,187,147,133,187,6,169,55,149,124,254,249,23,21,183,126,184,173,253,112,251,142,214,19) +IMAGE_DATA(246,231,47,94,104,47,94,188,212,182,109,251,99,133,112,215,64,30,95,63,217,224,215,235,63,64,116,189,246,141,115,156) +IMAGE_DATA(246,84,212,79,105,159,65,243,43,78,117,219,108,182,197,251,246,255,213,121,243,251,91,90,111,216,41,142,31,63,238,148) +IMAGE_DATA(253,112,177,193,31,199,249,13,227,124,3,69,215,231,190,177,214,233,60,212,79,105,143,161,207,239,201,109,110,217,191,15) +IMAGE_DATA(31,57,218,112,243,230,45,173,55,237,47,95,190,212,106,107,107,27,120,61,32,255,36,206,43,134,243,12,225,188,187,82) +IMAGE_DATA(251,102,181,78,115,136,246,20,180,239,76,16,238,62,51,157,198,251,224,161,195,210,253,189,214,23,246,87,175,94,233,126) +IMAGE_DATA(26,255,233,156,87,2,231,25,46,218,231,254,155,214,190,217,152,83,13,209,92,162,189,5,237,51,168,207,22,109,217,250) +IMAGE_DATA(251,202,235,55,110,106,125,105,167,216,181,107,87,165,112,239,141,178,57,191,49,156,175,94,251,111,58,246,102,99,78,123) +IMAGE_DATA(8,170,37,234,169,180,199,40,40,46,126,111,211,181,235,55,52,111,176,83,44,92,184,112,147,112,239,1,166,114,158,49) +IMAGE_DATA(30,198,190,43,99,78,207,19,241,162,189,214,151,156,57,235,116,121,147,189,181,181,213,197,115,95,175,253,120,206,251,77) +IMAGE_DATA(199,94,237,237,234,60,167,123,72,125,148,246,215,133,91,182,108,253,230,234,181,235,154,55,217,95,191,126,173,109,223,190) +IMAGE_DATA(157,214,190,66,206,211,108,236,213,158,111,101,215,159,205,168,87,210,188,25,43,35,141,238,105,84,84,212,178,134,171,215) +IMAGE_DATA(52,111,180,83,196,197,197,45,229,177,79,227,188,71,178,67,127,230,51,179,27,235,157,158,15,104,159,64,61,147,158,171) +IMAGE_DATA(219,230,249,170,85,191,44,247,102,251,134,13,27,202,69,251,188,31,207,249,135,178,199,170,238,85,187,218,227,104,61,167) +IMAGE_DATA(103,135,105,50,74,78,86,253,171,209,155,237,87,175,94,109,20,238,61,31,245,252,20,206,63,194,80,247,102,118,181,191) +IMAGE_DATA(83,157,140,224,186,161,222,145,151,152,152,248,209,149,239,26,52,111,182,211,39,35,35,163,84,230,251,46,215,253,24,118) +IMAGE_DATA(216,133,117,191,87,231,186,222,223,233,25,153,246,10,180,135,43,248,120,213,170,114,95,176,115,221,231,115,222,148,191,177) +IMAGE_DATA(223,171,118,179,181,141,230,8,189,35,161,125,34,245,205,162,175,246,150,59,125,193,94,85,85,229,20,238,103,189,76,206) +IMAGE_DATA(95,159,243,198,181,206,104,167,253,63,61,7,133,243,92,73,225,185,83,82,83,91,231,242,5,59,207,249,247,56,239,100) +IMAGE_DATA(30,195,48,139,126,103,180,235,125,142,158,139,104,143,72,207,202,115,46,95,105,208,124,193,78,31,153,239,108,225,126,207) +IMAGE_DATA(147,202,99,24,206,99,26,232,193,174,247,248,225,220,39,38,114,223,152,231,99,246,57,60,102,19,120,12,245,94,223,153) +IMAGE_DATA(221,46,126,220,227,63,246,49,251,92,225,222,227,208,216,141,230,177,52,91,231,244,80,215,55,218,15,209,158,56,67,134) +IMAGE_DATA(35,51,43,107,141,143,217,231,113,189,78,228,250,245,100,55,174,237,186,157,222,9,228,75,251,167,62,102,159,47,220,239) +IMAGE_DATA(52,210,186,96,87,247,241,227,216,94,32,237,107,251,145,61,146,237,147,251,169,61,193,15,236,233,176,119,203,62,5,118) +IMAGE_DATA(191,183,27,223,209,193,14,59,236,176,195,14,59,236,176,195,14,59,236,176,195,14,59,236,176,195,14,59,236,176,195,14) +IMAGE_DATA(59,236,176,195,14,59,236,176,195,14,59,236,176,195,14,59,236,176,195,14,59,236,176,195,14,59,236,176,195,14,59,236) +IMAGE_DATA(176,195,14,59,236,176,195,14,59,236,176,195,14,59,236,176,195,14,59,236,176,195,14,59,236,176,195,14,59,236,176,195) +IMAGE_DATA(14,59,236,176,195,14,59,236,176,195,14,59,236,176,195,14,59,236,176,195,14,59,236,176,195,14,59,236,176,119,176,95) +IMAGE_DATA(184,120,81,59,113,226,132,118,241,210,165,126,101,63,118,236,184,22,55,42,166,45,82,19,147,180,154,218,218,126,99,223) +IMAGE_DATA(188,105,243,255,237,186,191,182,182,174,95,216,247,236,222,211,193,174,251,235,234,206,248,189,157,230,251,138,95,44,55,245) +IMAGE_DATA(159,105,243,251,183,157,250,188,149,255,236,153,179,126,111,167,53,110,229,114,115,191,243,236,89,191,183,211,250,190,114,249) +IMAGE_DATA(10,83,127,189,211,233,247,118,90,223,75,173,252,245,245,126,111,167,245,189,116,197,74,83,255,185,115,231,252,222,78,235) +IMAGE_DATA(187,169,63,137,252,223,250,189,157,214,247,143,86,150,154,248,147,251,133,157,214,56,163,157,194,223,237,180,183,161,57,110) +IMAGE_DATA(116,47,90,240,129,95,219,235,228,158,222,204,93,52,115,166,214,34,127,231,175,246,90,43,119,1,185,91,252,182,207,215) +IMAGE_DATA(212,212,154,186,103,73,119,115,115,179,223,174,239,213,53,53,150,238,187,119,239,250,237,190,174,186,186,218,210,77,191,241) +IMAGE_DATA(215,253,252,233,211,158,221,254,250,28,119,254,252,5,115,119,126,129,214,216,216,228,215,207,239,198,119,86,20,133,210,125) +IMAGE_DATA(71,30,239,239,239,109,140,118,114,223,150,199,247,135,247,117,55,110,222,212,22,204,157,215,230,254,96,222,124,121,236,237) +IMAGE_DATA(126,243,158,182,191,255,191,9,216,97,135,29,118,216,97,135,29,118,216,97,135,29,118,216,97,135,29,118,216,97,135,29) +IMAGE_DATA(118,216,97,135,29,118,216,97,135,29,118,216,97,135,29,118,216,97,135,29,118,216,97,135,29,118,216,97,135,29,118,216) +IMAGE_DATA(97,135,29,118,216,97,135,29,118,216,97,135,29,118,216,97,135,29,118,216,97,135,29,118,216,97,135,29,118,216,97,135) +IMAGE_DATA(29,118,216,97,135,29,118,216,97,135,29,118,216,97,135,29,118,216,97,135,29,118,216,97,135,29,118,216,97,239,65,123) +IMAGE_DATA(128,140,32,25,33,176,183,217,39,195,222,239,236,227,252,192,158,214,13,251,72,182,79,234,71,246,193,138,61,158,237,249) +IMAGE_DATA(210,254,169,31,219,7,88,216,51,100,56,164,125,141,15,218,223,149,49,241,13,237,3,249,59,187,140,17,50,198,114,175) +IMAGE_DATA(152,145,153,153,85,230,99,246,185,50,166,179,125,116,23,236,193,124,236,24,174,25,170,157,249,62,106,159,32,35,78,70) +IMAGE_DATA(4,187,2,223,192,30,193,247,107,2,159,99,174,143,217,223,151,145,35,35,85,70,172,140,112,25,182,78,236,129,124,76) +IMAGE_DATA(56,255,38,149,207,49,219,199,236,37,50,178,101,36,203,136,97,207,208,78,236,131,248,152,48,25,163,100,36,201,248,153) +IMAGE_DATA(140,226,175,246,150,215,251,130,189,170,170,202,41,243,45,146,145,37,35,145,29,161,194,253,172,50,200,96,23,6,251,16) +IMAGE_DATA(62,54,74,198,120,25,83,101,204,92,187,118,93,133,47,216,119,236,216,81,33,243,45,16,238,103,145,4,118,12,83,236) +IMAGE_DATA(239,40,110,221,110,182,191,209,215,185,25,179,102,21,109,244,5,251,162,69,139,54,138,246,253,108,60,59,66,216,21,224) +IMAGE_DATA(193,110,236,245,122,191,203,177,217,108,75,188,221,222,218,218,234,162,222,164,244,185,56,97,189,190,169,118,99,191,83,231) +IMAGE_DATA(60,205,157,194,47,191,252,93,165,55,219,119,239,222,93,73,121,202,200,84,230,122,152,48,239,241,102,118,227,59,140,120) +IMAGE_DATA(174,159,188,172,172,172,213,222,108,207,207,207,95,109,168,247,72,195,92,55,179,27,231,188,90,247,180,214,165,8,247,154) +IMAGE_DATA(81,92,254,231,191,56,189,209,126,242,228,73,234,239,197,156,103,10,231,173,214,187,217,92,183,170,123,90,235,244,126,79) +IMAGE_DATA(253,146,158,107,242,18,147,146,74,189,209,158,145,145,81,202,99,62,73,180,247,247,80,97,190,174,91,217,245,119,119,212) +IMAGE_DATA(23,237,134,177,111,155,247,235,214,253,186,194,155,236,219,183,111,167,117,173,144,243,83,199,220,206,14,117,109,51,179,119) +IMAGE_DATA(54,246,52,127,104,127,159,43,163,228,224,193,67,13,222,96,175,171,171,107,16,238,125,92,46,231,23,223,197,49,55,179) +IMAGE_DATA(211,189,82,247,247,212,51,169,119,210,187,156,188,168,168,232,101,206,250,115,174,190,180,183,180,180,184,98,99,99,151,113) +IMAGE_DATA(173,79,22,237,189,93,127,118,25,44,60,247,184,206,252,212,35,105,111,64,207,181,180,94,210,30,153,246,122,142,228,228) +IMAGE_DATA(228,210,115,223,158,119,245,133,157,220,233,233,233,52,199,29,156,79,50,231,55,130,243,237,172,183,123,178,171,61,159,214) +IMAGE_DATA(71,170,33,90,51,232,217,150,246,13,52,183,10,220,254,11,174,222,180,55,55,55,235,238,2,206,35,149,243,138,228,60) +IMAGE_DATA(109,226,199,189,253,77,236,102,99,175,215,62,237,19,104,46,141,85,252,142,232,232,232,101,71,142,126,211,208,27,246,234) +IMAGE_DATA(234,154,6,174,115,135,226,30,203,121,133,137,238,213,186,213,216,235,254,32,62,111,184,193,79,245,70,243,173,228,139,13) +IMAGE_DATA(27,42,122,210,254,135,109,219,168,159,151,240,245,166,26,220,225,156,159,222,215,7,138,174,143,185,39,63,205,33,187,226) +IMAGE_DATA(167,58,163,121,70,125,134,250,108,97,74,74,74,233,223,254,254,15,231,219,180,87,30,59,230,76,75,75,163,26,47,228) +IMAGE_DATA(235,76,230,235,142,81,220,118,209,113,142,119,215,221,153,95,175,127,154,95,212,95,168,191,210,250,66,53,72,99,82,156) +IMAGE_DATA(147,155,187,122,199,142,63,85,94,185,242,157,171,59,246,59,119,238,184,118,238,220,89,233,112,56,104,159,90,204,231,205) +IMAGE_DATA(226,235,36,242,117,35,69,123,157,191,77,183,39,191,94,255,212,87,168,175,210,186,66,235,42,237,43,104,95,149,205,185) +IMAGE_DATA(22,218,130,131,23,191,63,103,206,198,205,191,249,109,197,215,95,255,211,233,201,126,228,200,81,231,214,173,91,43,22,44) +IMAGE_DATA(88,64,207,161,244,60,86,200,231,201,230,243,166,240,117,70,241,117,67,197,219,171,243,174,248,245,254,79,235,9,173,167) +IMAGE_DATA(84,123,180,159,74,224,28,233,121,130,158,167,114,56,255,2,225,126,159,82,194,46,122,167,54,135,255,59,155,255,94,196) +IMAGE_DATA(199,229,241,239,50,249,60,41,124,222,88,190,78,4,95,87,239,231,61,229,238,204,175,207,1,26,131,225,202,61,160,241) +IMAGE_DATA(161,218,76,229,252,233,61,10,213,108,54,187,40,114,149,127,103,243,247,83,248,248,84,254,125,188,98,30,46,218,199,122) +IMAGE_DATA(72,47,185,173,252,1,202,61,160,253,163,93,185,7,52,23,169,54,227,56,255,4,182,36,179,203,24,201,252,125,2,31) +IMAGE_DATA(31,199,191,143,84,204,118,190,142,110,14,232,37,183,254,49,254,191,44,189,6,104,223,28,196,185,209,184,208,115,115,24) +IMAGE_DATA(231,77,239,141,162,216,66,239,77,99,77,34,134,191,143,226,227,135,243,239,135,241,249,134,242,249,3,133,249,88,247,180) +IMAGE_DATA(91,255,152,189,227,85,239,129,62,23,108,156,119,8,27,104,236,194,61,68,40,31,23,194,191,179,137,246,218,86,205,102) +IMAGE_DATA(239,153,123,251,99,188,190,113,46,232,247,129,198,107,8,7,141,159,77,180,223,23,253,223,67,149,99,130,68,71,175,89) +IMAGE_DATA(109,247,149,217,248,177,186,7,122,232,247,66,143,64,147,80,191,15,48,252,222,27,205,198,143,49,63,245,94,24,239,135) +IMAGE_DATA(85,232,199,90,157,203,23,62,86,185,119,39,252,225,227,85,206,255,1,120,79,65,183,0,0,0,0,0,0,0,0,0) +IMAGE_END_DATA(3264, 1) + +IMAGE_BEGIN_DATA +IMAGE_DATA(120,156,237,217,223,79,20,89,22,7,240,235,200,34,10,142,252,80,64,70,1,149,6,127,49,10,194,248,99,88,97,27) +IMAGE_DATA(24,116,220,141,179,113,255,1,119,223,140,24,215,151,241,199,24,125,1,55,49,178,99,198,104,124,194,137,10,196,100,224) +IMAGE_DATA(193,100,52,38,146,152,152,65,198,89,4,105,240,183,168,143,190,247,115,239,253,82,231,14,151,178,170,1,71,176,187,249) +IMAGE_DATA(118,114,18,133,234,170,243,169,123,238,169,123,11,85,173,214,205,81,31,231,51,103,18,145,8,159,201,56,39,27,241,240) +IMAGE_DATA(241,203,253,19,137,185,147,8,115,108,188,220,7,47,171,237,73,210,241,39,43,146,61,194,254,125,146,122,247,126,196,218) +IMAGE_DATA(61,240,51,27,43,76,243,116,164,232,152,47,177,64,71,170,68,154,245,239,5,214,49,41,242,61,115,79,204,189,136,133) +IMAGE_DATA(123,224,190,190,25,31,219,107,156,240,125,170,99,145,142,116,29,25,58,50,61,34,67,126,191,72,142,79,83,99,247,195) +IMAGE_DATA(190,15,230,90,31,227,30,120,141,179,49,167,168,241,94,120,22,235,200,214,145,171,99,169,142,60,29,203,60,34,79,126) +IMAGE_DATA(159,43,199,47,150,239,219,247,33,69,141,191,7,238,58,152,206,143,95,109,207,147,220,22,42,103,236,178,36,127,120,150) +IMAGE_DATA(235,40,212,177,74,71,64,71,137,142,213,58,214,88,177,90,126,30,144,227,10,229,123,121,114,158,44,57,239,66,185,206) +IMAGE_DATA(60,229,63,23,102,194,109,204,168,201,52,201,13,99,133,113,195,56,174,16,11,108,165,58,54,234,168,208,241,133,142,205) +IMAGE_DATA(58,182,88,177,89,126,142,223,151,201,241,107,228,251,43,228,124,185,114,254,116,185,158,153,11,94,53,48,19,110,244,40) +IMAGE_DATA(212,36,230,107,142,228,184,82,57,99,136,252,55,137,173,74,71,141,142,90,29,95,233,216,161,99,167,21,59,228,231,181) +IMAGE_DATA(114,92,149,124,111,147,156,103,181,156,119,153,92,39,83,174,155,58,205,126,47,55,230,157,25,235,37,202,169,205,21,98) +IMAGE_DATA(254,92,71,165,228,31,212,209,80,87,87,215,116,252,248,241,235,237,237,237,161,254,254,254,240,243,231,47,34,207,159,63) +IMAGE_DATA(31,141,103,136,103,207,34,125,125,125,225,43,87,174,134,142,29,59,118,61,24,12,54,201,253,8,202,121,42,229,188,37) +IMAGE_DATA(114,157,60,185,174,169,129,148,105,240,123,185,77,141,163,15,97,12,48,47,81,155,235,149,83,179,200,181,46,16,8,52) +IMAGE_DATA(158,62,125,186,123,96,96,32,252,242,229,203,200,139,23,47,126,15,47,59,226,233,83,196,211,209,248,237,183,255,133,79) +IMAGE_DATA(157,250,79,119,81,81,81,35,206,39,231,173,144,235,4,228,186,57,146,135,153,3,31,202,239,231,70,191,65,205,97,254) +IMAGE_DATA(21,40,103,44,54,232,216,170,35,152,155,155,251,207,142,142,142,208,203,145,145,8,204,38,166,106,71,60,121,130,120,18) +IMAGE_DATA(185,124,249,114,72,238,65,80,174,179,65,174,91,32,121,100,74,94,31,194,31,173,206,141,187,80,57,253,168,92,57,99) +IMAGE_DATA(210,112,240,224,191,59,70,180,25,241,33,237,136,199,143,159,68,246,239,223,223,129,235,200,245,202,229,250,133,150,255,67) +IMAGE_DATA(212,191,189,102,49,125,205,212,185,237,70,13,110,215,99,189,247,231,159,111,104,242,171,200,116,218,31,63,126,28,233,234) +IMAGE_DATA(234,26,201,201,201,217,139,235,202,245,109,191,169,127,187,255,77,197,110,143,121,146,26,235,231,232,43,152,95,5,150,187) +IMAGE_DATA(186,184,184,184,241,225,195,135,225,87,175,224,158,126,251,35,29,247,122,127,13,203,28,168,177,252,5,146,95,186,26,235) +IMAGE_DATA(255,73,83,28,123,247,152,99,14,225,121,130,190,138,254,130,121,134,122,219,110,187,103,210,62,252,8,254,94,227,223,46) +IMAGE_DATA(249,148,72,126,75,36,95,123,238,79,198,238,87,235,88,87,225,185,130,254,138,53,74,21,234,220,118,207,180,125,248,209) +IMAGE_DATA(163,200,189,123,189,97,169,255,42,201,43,32,121,102,169,169,215,190,109,199,186,25,235,71,212,16,230,18,158,171,120,190) +IMAGE_DATA(160,207,54,220,188,121,115,228,245,235,215,145,143,105,31,30,126,20,233,236,236,28,81,78,255,219,42,249,173,144,124,211) +IMAGE_DATA(37,255,228,73,216,237,121,110,250,58,158,27,88,71,98,61,133,154,194,220,10,30,58,116,168,3,238,88,176,15,15,15) +IMAGE_DATA(71,14,31,62,124,93,57,207,63,228,183,90,242,93,44,249,155,190,31,109,222,71,27,115,236,47,240,76,173,194,28,55) +IMAGE_DATA(238,88,177,15,233,88,229,204,253,42,201,115,213,20,199,222,221,219,211,172,49,199,189,196,94,163,254,218,181,107,161,88) +IMAGE_DATA(180,95,186,244,99,8,249,73,158,246,216,155,121,111,247,124,191,49,55,189,29,239,16,240,204,192,252,193,126,162,170,178) +IMAGE_DATA(178,242,176,237,142,37,251,208,208,112,164,172,172,236,136,140,125,169,228,157,35,142,104,61,223,93,239,120,62,98,157,96) +IMAGE_DATA(122,59,246,83,193,150,150,150,238,88,182,55,53,53,117,43,103,222,111,82,99,61,63,67,60,126,117,111,219,237,122,199) +IMAGE_DATA(243,18,235,6,236,39,119,132,66,161,112,44,219,123,122,122,194,202,217,255,33,223,181,146,191,93,247,246,58,215,107,174) +IMAGE_DATA(163,47,98,109,144,109,215,123,125,125,125,211,155,55,111,34,177,108,31,26,26,138,84,215,212,96,255,251,103,171,238,179) +IMAGE_DATA(197,147,226,51,231,237,103,155,153,235,166,191,227,61,74,205,201,147,39,175,199,131,253,219,111,71,159,119,127,81,206,90) +IMAGE_DATA(207,238,247,238,57,239,174,119,99,79,183,230,58,158,153,117,232,239,241,96,111,109,189,100,250,61,242,46,182,230,252,2) +IMAGE_DATA(245,110,191,243,122,174,99,63,248,153,114,214,51,120,102,52,192,29,15,246,80,104,40,34,115,126,179,244,170,101,226,241) +IMAGE_DATA(234,119,94,61,62,83,190,99,250,220,206,56,179,239,210,177,205,234,119,246,250,62,154,221,236,93,150,203,119,113,142,93) +IMAGE_DATA(113,102,255,155,114,158,243,88,223,99,111,235,238,245,94,118,251,249,150,175,99,93,60,218,245,26,231,168,26,235,245,133) +IMAGE_DATA(202,217,215,46,156,130,189,64,236,95,226,62,198,153,253,152,114,246,245,120,183,107,63,231,204,218,118,50,246,245,82,59) +IMAGE_DATA(241,102,255,78,231,92,173,156,125,141,151,221,253,183,172,68,178,31,87,206,251,44,216,87,42,255,245,77,34,219,55,138) +IMAGE_DATA(61,231,61,236,165,9,96,95,69,251,172,179,151,209,254,206,59,12,218,105,167,157,118,218,105,167,157,118,218,105,167,157) +IMAGE_DATA(118,218,105,167,157,118,218,105,167,157,118,218,105,167,157,118,218,105,167,157,118,218,105,167,157,118,218,105,167,157,118,218) +IMAGE_DATA(105,167,157,118,218,105,167,157,118,218,105,167,157,118,218,105,167,157,118,218,105,167,157,118,218,105,167,157,118,218,105,167) +IMAGE_DATA(157,118,218,105,167,157,118,218,105,167,157,118,218,105,167,157,118,218,105,167,157,118,218,105,167,157,118,218,105,167,157,118) +IMAGE_DATA(218,105,167,157,118,218,105,167,253,15,218,97,233,236,236,140,124,255,223,239,35,87,46,95,25,181,204,6,59,44,151,90) +IMAGE_DATA(91,71,221,38,110,222,184,153,240,118,88,220,238,217,96,247,115,159,255,225,92,228,225,224,96,194,218,97,241,115,247,245) +IMAGE_DATA(245,37,108,175,131,37,154,59,81,251,124,52,247,131,7,15,18,246,25,7,195,143,209,220,9,250,124,143,230,238,127,208) +IMAGE_DATA(159,176,107,155,168,238,254,254,132,94,215,181,93,105,139,226,78,236,53,173,219,141,128,123,54,172,231,207,159,59,247,142) +IMAGE_DATA(189,171,179,107,86,216,7,6,30,250,248,59,19,222,254,114,212,63,16,197,159,216,118,60,223,71,253,63,248,251,19,217) +IMAGE_DATA(62,234,215,61,206,203,143,189,123,162,219,17,253,209,252,9,110,71,127,247,245,255,212,153,240,246,137,252,137,110,143,230) +IMAGE_DATA(191,115,231,78,194,219,241,124,199,94,198,237,79,244,119,86,246,186,14,123,88,219,223,219,251,235,172,177,35,6,7,7) +IMAGE_DATA(71,107,61,145,223,89,241,111,19,180,211,78,59,237,180,211,78,59,237,180,211,78,59,237,180,211,78,59,237,180,211,78) +IMAGE_DATA(59,237,180,211,78,59,237,180,211,78,59,237,180,211,78,59,237,180,211,78,59,237,180,211,78,59,237,180,211,78,59,237) +IMAGE_DATA(180,211,78,59,237,180,211,78,59,237,180,211,78,59,237,180,211,78,59,237,180,211,78,59,237,180,211,78,59,237,180,211) +IMAGE_DATA(78,59,237,180,211,78,59,237,180,211,78,59,237,180,211,78,59,237,180,211,78,59,237,180,211,78,59,237,180,211,78,251) +IMAGE_DATA(31,176,127,170,35,69,71,210,44,177,111,164,125,214,218,87,190,167,125,125,156,219,55,136,61,123,150,217,171,197,190,98) +IMAGE_DATA(150,217,191,211,57,111,247,176,207,155,130,125,157,142,47,117,252,53,206,236,199,196,254,185,143,125,206,4,246,124,177,111) +IMAGE_DATA(211,177,43,158,236,217,217,217,255,146,122,69,175,46,212,177,68,199,66,241,205,245,177,39,139,61,75,199,114,29,107,117) +IMAGE_DATA(108,213,241,117,60,217,81,167,82,175,235,164,126,23,139,107,34,123,170,142,76,29,203,116,172,209,177,69,199,206,56,179) +IMAGE_DATA(127,45,99,182,86,198,48,75,236,201,81,236,88,235,46,208,145,161,35,79,71,137,142,47,116,124,21,10,133,194,241,96) +IMAGE_DATA(255,229,151,158,176,206,183,65,242,94,45,99,152,41,99,234,182,43,151,29,235,253,116,29,75,117,4,116,108,210,81,123) +IMAGE_DATA(237,218,181,80,60,216,91,91,47,133,116,190,117,58,42,36,255,60,241,152,125,140,151,253,19,203,142,61,15,214,66,88) +IMAGE_DATA(15,98,109,84,115,232,208,161,142,120,176,239,219,183,175,67,141,95,207,230,42,239,61,156,114,217,147,164,31,44,148,222) +IMAGE_DATA(136,30,57,186,174,45,41,41,57,16,15,246,85,69,69,7,212,187,61,222,235,217,110,219,221,207,185,44,171,223,109,198) +IMAGE_DATA(28,234,233,233,121,27,203,246,91,183,110,189,149,185,190,89,242,94,102,245,57,119,143,247,178,155,126,103,230,124,145,142) +IMAGE_DATA(114,83,247,177,108,183,234,189,92,242,94,42,142,5,62,115,221,93,247,56,38,69,234,36,91,234,6,107,219,109,185,185) +IMAGE_DATA(185,123,99,217,158,147,147,179,87,57,107,177,245,146,183,189,142,247,154,235,110,187,93,247,120,54,124,166,156,103,29,250) +IMAGE_DATA(102,176,165,165,229,118,44,218,155,155,79,221,70,126,146,103,137,228,157,233,170,247,104,118,247,179,206,244,123,172,137,209) +IMAGE_DATA(59,182,165,166,166,254,99,112,112,48,28,75,246,158,123,247,194,200,75,198,188,84,242,117,191,163,243,171,119,247,216,155) +IMAGE_DATA(126,111,122,30,238,97,177,146,121,95,95,95,223,28,75,246,221,187,119,159,85,99,243,188,88,242,181,123,156,87,127,159) +IMAGE_DATA(236,216,99,222,96,93,140,53,34,214,75,117,103,206,156,233,142,5,123,115,115,115,183,114,214,50,155,37,191,2,201,119) +IMAGE_DATA(42,99,110,219,221,99,143,121,131,158,137,181,130,169,253,61,55,110,220,24,249,152,246,206,206,174,17,228,161,198,106,125) +IMAGE_DATA(149,228,105,207,115,247,126,61,218,199,107,236,209,43,177,23,194,243,18,235,68,172,153,170,48,199,108,255,76,218,59,187) +IMAGE_DATA(70,221,152,227,85,146,79,64,242,91,44,249,78,101,204,189,198,222,236,237,76,237,99,141,132,125,17,250,104,153,248,127) +IMAGE_DATA(31,255,153,178,139,123,143,184,203,36,159,229,146,159,169,117,179,111,153,236,152,123,249,77,237,99,31,132,117,2,230,82) +IMAGE_DATA(190,237,215,209,112,226,196,137,235,51,97,63,124,228,200,117,229,172,221,108,119,190,228,149,46,121,78,181,214,253,252,166) +IMAGE_DATA(246,205,220,183,253,232,169,120,39,134,189,114,109,69,69,229,209,187,119,239,190,157,14,251,237,219,221,111,203,203,203,143) +IMAGE_DATA(226,58,114,189,13,114,125,219,109,230,248,84,107,221,207,110,106,223,203,111,230,63,250,12,250,63,222,145,53,28,60,120) +IMAGE_DATA(176,125,96,96,32,252,33,236,247,239,223,15,55,54,54,182,43,103,172,183,203,117,74,213,216,252,246,115,191,239,152,79) +IMAGE_DATA(228,55,245,143,249,133,103,41,222,129,99,239,128,26,196,123,158,26,228,186,103,207,158,179,23,47,94,236,125,31,251,249) +IMAGE_DATA(243,23,122,191,249,230,239,103,197,92,35,231,45,147,235,172,148,235,46,81,227,235,252,67,185,39,242,99,127,128,126,138) +IMAGE_DATA(53,4,246,200,168,61,140,5,222,145,149,75,174,24,167,58,244,227,218,218,218,38,93,15,29,184,23,109,109,237,161,182) +IMAGE_DATA(182,182,33,196,85,196,213,171,161,11,23,46,244,30,56,112,160,35,24,12,54,73,255,174,147,239,111,145,243,173,147,243) +IMAGE_DATA(231,203,245,178,228,250,11,166,201,61,145,31,253,20,123,125,188,227,194,24,224,29,73,129,228,136,117,6,230,100,133,228) +IMAGE_DATA(143,222,132,191,23,4,197,85,111,69,157,252,188,90,142,219,34,223,219,32,231,9,200,121,243,228,58,25,114,221,249,211) +IMAGE_DATA(236,118,251,77,255,75,82,99,123,62,212,28,198,0,107,138,108,201,17,227,131,181,70,177,228,95,42,150,114,113,33,42) +IMAGE_DATA(173,127,151,203,239,75,229,248,98,249,126,190,156,47,91,206,255,169,92,207,236,205,146,212,187,239,31,167,227,99,159,223) +IMAGE_DATA(171,6,210,36,55,140,11,214,24,185,146,55,158,189,133,202,153,167,216,87,7,196,102,34,32,63,95,41,199,45,151,239) +IMAGE_DATA(229,202,121,50,228,188,105,42,250,88,79,151,219,254,184,253,166,6,204,61,192,184,160,38,177,206,200,148,252,81,171,57) +IMAGE_DATA(226,89,42,54,19,75,229,231,57,114,220,98,249,222,34,57,79,170,26,111,54,99,61,93,53,62,209,199,171,6,204,61) +IMAGE_DATA(72,86,227,239,131,169,7,68,186,21,25,174,255,155,99,210,212,120,111,178,242,55,207,180,219,254,120,221,3,175,251,128) +IMAGE_DATA(192,28,157,31,37,82,172,99,221,222,88,50,219,31,247,223,57,220,247,193,220,11,115,63,252,194,28,99,127,207,237,141) +IMAGE_DATA(37,183,251,227,149,167,185,23,38,230,122,132,253,123,191,115,196,211,199,207,48,149,72,180,79,76,24,255,15,238,24,171) +IMAGE_DATA(62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) +IMAGE_END_DATA(3136, 1) + +IMAGE_BEGIN_DATA +IMAGE_DATA(120,156,237,217,91,80,85,215,25,7,240,101,164,138,92,148,139,114,19,4,181,7,80,1,21,49,168,161,128,64,130,151) +IMAGE_DATA(84,235,165,15,233,147,182,47,117,20,199,62,212,166,26,227,104,49,105,166,213,142,29,251,234,131,90,161,29,125,104,156) +IMAGE_DATA(84,241,130,29,105,31,108,27,1,57,104,110,4,168,68,5,133,224,229,120,215,221,245,119,127,107,88,108,246,70,48,2) +IMAGE_DATA(231,28,190,51,243,205,40,156,179,247,247,219,235,91,223,90,235,32,242,196,140,17,98,104,94,35,250,16,254,240,234,139) +IMAGE_DATA(179,175,225,11,47,167,220,95,163,24,217,135,80,239,245,149,231,96,103,213,61,1,50,190,167,197,40,155,208,127,31,32) +IMAGE_DATA(122,62,15,111,123,6,78,102,101,133,105,180,140,64,25,99,40,130,100,4,83,132,104,255,14,210,222,19,72,159,83,207) +IMAGE_DATA(68,61,11,111,120,6,214,251,171,241,209,189,202,9,223,88,25,227,100,132,201,8,151,17,97,19,225,244,251,113,244,254) +IMAGE_DATA(16,209,245,60,244,231,160,238,53,20,207,192,110,156,149,57,80,116,247,194,51,94,70,148,140,24,25,177,50,226,100,196) +IMAGE_DATA(219,68,28,253,62,134,222,63,158,62,175,63,135,64,209,253,25,88,235,96,32,95,78,181,61,154,114,11,21,230,216,69) +IMAGE_DATA(82,254,240,36,200,72,146,49,85,134,75,70,138,140,84,25,211,180,72,165,159,187,232,125,73,244,185,56,186,78,36,93) +IMAGE_DATA(55,148,238,51,90,56,207,133,193,112,43,51,106,50,132,114,195,88,97,220,48,142,147,201,2,91,186,140,89,50,178,100) +IMAGE_DATA(188,46,35,91,198,60,45,178,233,231,248,253,108,122,255,52,250,252,100,186,94,12,93,63,140,238,167,230,130,93,13,12) +IMAGE_DATA(134,27,61,10,53,137,249,26,77,57,78,17,230,24,34,255,57,100,203,145,145,47,163,80,198,91,50,22,201,88,172,197) +IMAGE_DATA(34,250,121,33,189,47,135,62,55,135,174,147,74,215,141,167,251,68,208,125,131,7,216,111,231,198,188,83,99,61,65,152) +IMAGE_DATA(181,57,153,204,25,50,230,82,254,5,50,138,151,47,95,190,107,207,158,61,199,78,157,58,237,190,122,245,154,231,238,93) +IMAGE_DATA(143,113,231,206,93,227,246,157,59,198,173,219,183,141,91,183,110,25,205,205,205,158,79,62,249,187,251,195,223,126,116,108) +IMAGE_DATA(241,146,37,187,232,121,20,208,117,230,210,117,83,232,62,113,116,95,85,3,129,3,224,183,115,171,26,71,31,194,24,96) +IMAGE_DATA(94,162,54,211,132,89,179,200,181,40,45,45,173,100,255,254,253,149,173,173,173,158,251,247,239,27,247,238,221,51,60,30) +IMAGE_DATA(132,199,176,179,119,202,232,248,182,211,104,239,248,214,184,217,222,97,52,124,221,232,217,183,239,79,149,169,169,169,37,184) +IMAGE_DATA(30,93,55,139,238,227,162,251,70,83,30,106,14,188,42,191,147,27,253,6,53,135,249,151,40,204,177,152,41,99,190,140) +IMAGE_DATA(130,248,248,248,159,86,158,61,235,126,248,232,145,241,240,225,67,227,193,131,7,198,203,216,111,220,108,55,110,220,184,97) +IMAGE_DATA(180,201,248,219,199,31,187,233,25,20,208,125,102,210,125,19,41,143,8,202,235,85,248,123,171,115,229,78,18,102,63,202) +IMAGE_DATA(20,230,152,20,239,220,185,179,252,209,227,199,198,35,184,95,161,189,181,237,134,113,237,122,171,241,203,205,155,203,113,31) +IMAGE_DATA(186,95,38,221,63,73,243,191,138,250,215,247,44,170,175,169,58,215,221,168,193,92,57,214,107,47,92,168,110,124,252,248) +IMAGE_DATA(137,49,144,246,171,215,174,27,167,207,156,105,140,141,141,93,139,251,210,253,117,191,170,127,189,255,245,199,174,143,121,128) +IMAGE_DATA(232,234,231,232,43,152,95,137,154,59,47,61,61,189,164,189,189,221,243,228,201,19,99,48,236,223,92,189,102,92,186,252) +IMAGE_DATA(185,39,37,37,5,115,32,95,243,39,82,126,97,162,171,255,7,244,115,236,173,99,142,57,132,245,4,125,21,253,5,243) +IMAGE_DATA(12,245,150,11,119,71,71,199,115,247,96,218,91,90,174,74,255,103,202,159,75,249,164,80,126,19,40,95,125,238,247,197) +IMAGE_DATA(238,84,235,216,87,97,93,65,127,197,30,37,7,117,14,247,211,167,79,141,161,176,183,180,124,99,212,95,186,236,137,49) +IMAGE_DATA(235,63,135,242,114,81,158,145,162,255,181,175,219,177,111,198,254,17,53,132,185,132,117,21,235,11,250,108,113,109,109,109) +IMAGE_DATA(35,220,67,105,191,210,210,98,156,56,81,209,40,204,254,55,159,242,155,76,249,134,81,254,163,250,96,215,231,185,234,235) +IMAGE_DATA(88,55,176,143,196,126,10,53,133,185,85,80,90,90,90,174,220,67,109,111,254,223,21,99,251,246,29,199,132,185,254,33) +IMAGE_DATA(191,84,202,119,60,229,175,250,126,111,243,190,183,49,199,249,2,107,106,78,70,70,70,201,179,103,207,12,111,178,55,53) +IMAGE_DATA(95,49,146,147,159,207,253,28,202,115,106,63,199,222,218,219,67,180,49,199,179,196,89,227,205,115,231,206,185,189,209,94) +IMAGE_DATA(254,151,191,186,145,31,229,169,143,189,154,247,122,207,119,26,115,213,219,241,29,2,214,12,204,31,156,39,114,242,243,243) +IMAGE_DATA(223,133,219,27,237,141,77,205,70,86,86,214,175,105,236,211,41,239,104,114,244,214,243,173,245,142,245,17,251,4,213,219) +IMAGE_DATA(113,158,42,56,120,240,96,165,55,219,127,247,251,221,149,194,156,247,115,68,87,207,15,39,143,83,221,235,118,189,222,177) +IMAGE_DATA(94,98,223,128,243,228,162,206,206,78,143,55,219,107,107,47,122,132,121,254,67,190,211,41,127,189,238,245,125,174,221,92) +IMAGE_DATA(71,95,196,222,32,74,175,247,149,43,87,238,50,228,203,155,237,95,55,54,25,133,69,69,56,255,254,64,171,251,40,242) +IMAGE_DATA(4,58,204,121,125,109,83,115,93,245,119,124,143,146,191,111,223,190,99,190,96,223,182,109,59,214,187,133,194,220,235,233) +IMAGE_DATA(253,222,58,231,173,245,174,236,97,218,92,199,154,89,84,85,85,229,246,5,251,225,178,114,213,239,145,119,178,54,231,131) +IMAGE_DATA(68,207,126,103,183,174,227,60,56,81,152,251,25,172,25,197,6,189,188,221,254,85,67,163,65,115,62,155,122,85,60,121) +IMAGE_DATA(236,250,157,93,143,143,160,207,168,62,183,216,199,236,75,101,44,208,250,157,190,191,239,205,174,206,46,9,244,89,92,99) +IMAGE_DATA(169,143,217,127,40,204,117,30,251,123,156,109,173,189,222,206,174,175,111,147,100,204,240,69,251,156,57,89,91,68,87,175) +IMAGE_DATA(79,18,230,185,54,180,31,246,68,178,191,129,231,232,83,246,172,172,173,194,60,215,227,187,93,125,157,83,123,219,190,216) +IMAGE_DATA(211,168,118,124,205,254,158,204,57,79,152,231,26,59,187,245,111,89,254,100,223,38,204,239,179,96,159,34,156,247,55,254) +IMAGE_DATA(108,159,69,246,232,151,176,167,251,129,125,42,219,135,157,125,54,219,123,124,135,193,118,182,179,157,237,108,103,59,219,217) +IMAGE_DATA(206,118,182,179,157,237,108,103,59,219,217,206,118,182,179,157,237,108,103,59,219,217,206,118,182,179,157,237,108,103,59,219) +IMAGE_DATA(217,206,118,182,179,157,237,108,103,59,219,217,206,118,182,179,157,237,108,103,59,219,217,206,118,182,179,157,237,108,103,59) +IMAGE_DATA(219,217,206,118,182,179,157,237,108,103,59,219,217,206,118,182,179,157,237,108,103,59,219,217,206,118,182,179,157,237,108,103) +IMAGE_DATA(59,219,217,206,118,182,179,157,237,108,103,59,219,217,206,118,182,179,157,237,108,103,59,219,191,163,253,218,245,235,198,134) +IMAGE_DATA(117,235,141,132,184,137,198,242,165,111,75,79,203,176,176,95,151,150,130,188,252,231,110,21,31,125,240,161,223,219,91,91) +IMAGE_DATA(219,122,184,135,131,189,77,58,10,109,220,211,92,201,198,103,159,127,225,183,118,88,10,243,23,218,186,63,253,244,130,223) +IMAGE_DATA(246,186,222,220,23,46,92,240,219,62,127,243,230,77,71,119,117,117,181,223,174,113,237,237,237,70,145,131,187,166,166,198) +IMAGE_DATA(111,215,247,142,142,14,71,119,109,77,173,223,238,109,58,164,161,104,161,131,187,246,162,95,239,235,86,46,255,145,173,251) +IMAGE_DATA(226,197,58,191,223,211,90,221,136,58,233,30,14,251,249,105,201,41,61,236,27,55,148,12,11,251,165,75,151,237,253,235) +IMAGE_DATA(55,248,189,253,225,115,255,37,233,79,238,225,47,145,126,127,183,99,125,191,84,95,255,188,199,245,240,203,179,171,191,219) +IMAGE_DATA(177,175,171,119,187,109,253,56,187,251,187,29,251,121,119,157,147,127,157,223,219,113,142,171,171,171,179,247,255,124,157,223) +IMAGE_DATA(219,113,126,199,222,198,206,191,94,250,253,221,142,245,29,123,90,59,255,161,67,135,253,222,142,245,29,103,25,171,223,223) +IMAGE_DATA(191,179,210,247,117,56,195,234,254,179,103,255,49,108,236,88,223,191,248,242,75,163,236,112,153,95,127,103,197,127,155,96) +IMAGE_DATA(59,219,217,206,118,182,179,157,237,108,103,59,219,217,206,118,182,179,157,237,108,103,59,219,217,206,118,182,179,157,237,108) +IMAGE_DATA(103,59,219,217,206,118,182,179,157,237,108,103,59,219,217,206,118,182,179,157,237,108,103,59,219,217,206,118,182,179,157,237) +IMAGE_DATA(108,103,59,219,217,206,118,182,179,157,237,108,103,59,219,217,206,118,182,179,157,237,108,103,59,219,217,206,118,182,179,157) +IMAGE_DATA(237,108,103,59,219,217,206,118,182,179,157,237,108,103,59,219,217,206,118,182,179,157,237,108,103,59,219,217,206,118,182,179) +IMAGE_DATA(157,237,223,193,62,86,70,160,140,128,97,98,159,197,246,97,107,159,242,146,246,52,31,183,207,36,123,212,48,179,231,145) +IMAGE_DATA(125,242,48,179,191,39,115,206,181,177,143,238,135,125,134,140,55,100,188,237,99,246,173,100,207,112,176,143,120,129,125,18) +IMAGE_DATA(217,23,200,88,234,75,246,232,232,232,159,81,189,162,87,39,201,152,32,35,148,124,35,29,236,163,200,30,41,35,65,198) +IMAGE_DATA(116,25,243,101,44,241,37,59,234,148,234,117,6,213,239,120,114,189,200,30,44,35,66,70,188,140,105,50,230,201,88,236) +IMAGE_DATA(99,246,37,52,102,211,105,12,35,201,62,170,23,59,246,186,65,50,194,101,196,201,72,145,241,186,140,183,58,59,59,61) +IMAGE_DATA(190,96,175,174,169,245,200,124,139,41,239,84,26,195,8,26,83,171,93,88,236,216,239,135,201,136,149,225,146,49,71,70) +IMAGE_DATA(97,85,85,149,219,23,236,135,203,202,221,50,223,34,25,89,148,127,28,121,212,57,198,206,254,154,102,199,153,7,123,33) +IMAGE_DATA(236,7,177,55,202,47,45,45,45,247,5,251,166,77,155,202,69,247,253,108,140,176,63,195,9,139,61,128,250,65,40,245) +IMAGE_DATA(70,244,200,231,251,218,140,140,140,141,190,96,119,185,92,27,69,207,30,111,183,182,235,118,235,58,23,169,245,187,108,204) +IMAGE_DATA(161,166,166,166,54,111,182,87,253,243,95,109,52,215,179,41,239,120,173,207,89,123,188,157,93,245,59,53,231,191,47,35) +IMAGE_DATA(83,213,189,55,219,55,109,250,133,170,247,76,202,59,150,28,65,14,115,221,90,247,120,79,32,213,73,20,213,13,246,182) +IMAGE_DATA(11,18,18,18,214,122,179,61,38,38,102,173,48,247,98,105,148,183,190,143,183,155,235,86,187,94,247,88,27,38,10,115) +IMAGE_DATA(173,67,223,44,56,120,240,224,25,111,180,239,222,189,231,12,242,163,60,83,40,239,8,75,189,247,102,183,174,117,170,223) +IMAGE_DATA(99,79,140,222,177,32,52,52,116,53,214,122,111,178,95,172,171,247,4,7,7,175,166,49,79,167,124,173,223,209,57,213) +IMAGE_DATA(187,117,236,85,191,87,61,15,207,48,89,208,188,95,177,98,197,7,222,100,95,181,250,199,123,69,215,60,79,166,124,245) +IMAGE_DATA(30,103,215,223,251,58,246,152,55,216,23,99,143,136,253,82,209,129,3,7,42,189,193,190,123,207,31,42,133,185,151,201) +IMAGE_DATA(166,252,18,41,223,254,140,185,110,183,142,61,230,13,122,38,246,10,170,246,87,213,212,212,52,14,165,189,226,228,169,70) +IMAGE_DATA(89,235,171,68,87,173,79,165,60,245,121,110,61,175,247,246,178,27,123,244,74,156,133,176,94,98,159,136,61,83,14,230) +IMAGE_DATA(62,252,67,97,63,121,234,116,99,112,72,8,230,120,14,229,227,162,252,198,83,190,253,25,115,187,177,87,103,59,85,251) +IMAGE_DATA(216,35,225,92,132,62,58,155,252,171,170,171,171,27,7,211,126,242,212,25,53,222,57,148,71,10,229,53,65,116,213,186) +IMAGE_DATA(58,183,244,117,204,237,252,170,246,113,14,194,62,1,115,105,146,238,151,81,188,119,239,31,143,13,134,125,231,111,74,143) +IMAGE_DATA(9,115,239,166,187,39,81,94,97,148,103,127,107,221,201,175,106,95,205,125,221,143,158,138,239,196,112,86,46,204,205,205) +IMAGE_DATA(219,210,208,208,208,54,16,246,127,255,231,191,109,217,217,217,91,112,31,186,223,76,186,191,238,86,115,188,191,181,238,100) +IMAGE_DATA(87,181,111,231,87,243,31,125,6,253,31,223,145,21,239,216,177,163,76,230,236,121,21,246,175,26,26,60,155,127,245,110) +IMAGE_DATA(153,48,199,58,151,238,147,46,186,230,183,147,251,101,199,252,69,126,85,255,152,95,88,75,241,29,56,206,14,168,65,124) +IMAGE_DATA(207,147,143,92,215,172,89,179,247,232,209,163,231,95,198,126,232,208,159,207,191,243,206,79,246,146,57,159,174,59,155,238) +IMAGE_DATA(51,133,238,59,65,116,175,243,87,229,126,145,31,231,3,244,83,236,33,112,70,70,237,97,44,240,29,89,38,229,138,113) +IMAGE_DATA(42,194,122,176,108,217,178,93,239,191,191,189,252,200,145,35,231,43,42,78,186,43,42,42,234,79,200,56,126,226,68,253) +IMAGE_DATA(241,227,199,221,101,229,229,231,183,108,217,90,190,100,201,210,93,33,102,255,46,162,207,207,163,235,205,160,235,79,162,251) +IMAGE_DATA(69,210,253,131,6,200,253,34,63,250,41,206,250,248,142,11,99,128,239,72,18,41,71,236,51,48,39,179,40,127,244,38) +IMAGE_DATA(252,189,160,128,92,111,106,81,68,63,207,163,247,205,163,207,205,164,235,184,232,186,113,116,159,112,186,239,152,1,118,91) +IMAGE_DATA(253,170,255,5,136,174,51,31,106,14,99,128,61,69,20,229,136,241,193,94,35,153,242,79,39,75,38,185,16,115,181,127) +IMAGE_DATA(103,210,239,211,233,253,201,244,249,73,116,189,40,186,254,88,186,159,58,155,5,136,158,223,63,14,196,75,191,190,93,13) +IMAGE_DATA(132,80,110,24,23,236,49,98,40,111,172,189,73,194,156,167,56,87,187,200,166,194,69,63,159,66,239,75,160,207,197,208) +IMAGE_DATA(117,194,233,186,33,162,247,177,30,40,183,254,178,250,85,13,168,103,128,113,65,77,98,159,17,65,249,163,86,163,201,19) +IMAGE_DATA(75,54,21,177,244,243,104,122,223,120,250,220,56,186,78,176,232,110,86,99,61,80,53,254,162,151,93,13,168,103,48,74) +IMAGE_DATA(116,127,14,170,30,16,97,90,132,91,254,175,222,19,34,186,123,71,9,103,243,96,187,245,151,221,51,176,123,14,8,204) +IMAGE_DATA(209,49,189,68,160,246,94,171,215,155,204,250,203,250,119,14,235,115,80,207,66,61,15,167,80,239,209,63,103,245,122,147) +IMAGE_DATA(219,250,178,203,83,61,11,21,35,109,66,255,189,211,53,124,233,229,100,232,79,248,219,203,43,140,255,7,56,120,83,228) +IMAGE_END_DATA(3296, 1) + +IMAGE_BEGIN_DATA +IMAGE_DATA(120,156,237,157,75,108,84,215,25,199,79,90,74,8,134,130,1,63,104,76,108,138,141,243,114,90,151,36,77,108,176,29) +IMAGE_DATA(131,33,41,205,170,108,65,152,37,2,100,216,132,46,144,216,184,174,196,163,145,74,130,144,44,5,68,16,14,82,237,72) +IMAGE_DATA(142,98,47,136,43,112,19,63,154,242,242,216,248,5,6,150,89,227,245,237,249,115,207,151,57,190,204,157,151,31,247,206) +IMAGE_DATA(248,127,165,223,2,9,207,220,99,249,255,211,247,125,231,204,29,245,198,11,181,42,160,235,5,66,72,86,145,45,87,208) +IMAGE_DATA(191,71,66,200,194,147,9,151,223,189,255,194,240,75,66,72,86,33,217,206,20,111,37,114,211,18,205,175,44,150,26,94) +IMAGE_DATA(36,132,100,20,146,93,59,207,200,183,215,95,97,115,86,44,71,121,221,36,107,124,201,176,92,147,163,89,65,8,201,72) +IMAGE_DATA(144,95,228,88,50,189,76,69,61,102,187,43,44,206,138,231,40,113,19,214,131,181,253,90,179,74,179,90,179,198,176,86) +IMAGE_DATA(179,142,16,146,81,32,183,146,97,228,25,185,70,190,145,115,241,23,242,47,181,138,212,90,65,56,43,25,71,137,159,114) +IMAGE_DATA(149,187,182,60,77,129,102,189,230,101,77,145,102,131,230,21,77,49,33,36,35,64,94,145,91,228,23,57,254,141,166,80) +IMAGE_DATA(147,175,92,143,33,239,182,183,80,111,73,173,21,171,206,154,207,203,126,31,241,165,215,81,82,59,225,254,215,155,117,149) +IMAGE_DATA(104,54,105,202,52,229,154,215,52,175,107,222,48,188,105,81,65,8,9,5,118,46,37,171,200,45,242,139,28,35,207,200) +IMAGE_DATA(117,137,114,29,6,119,33,247,168,79,224,129,149,202,117,150,212,89,210,27,206,183,175,188,181,148,204,200,197,81,171,204) +IMAGE_DATA(61,162,126,18,63,149,153,117,97,221,191,215,188,173,121,87,243,158,230,125,77,149,166,90,179,149,16,18,106,144,211,42) +IMAGE_DATA(3,242,139,28,35,207,149,202,205,55,114,142,188,111,84,110,254,81,111,161,214,130,179,224,7,187,55,244,214,88,115,121) +IMAGE_DATA(197,242,20,222,23,206,68,205,39,117,84,145,185,215,114,115,255,127,208,252,209,172,181,78,179,93,179,83,243,145,230,79) +IMAGE_DATA(154,221,154,63,107,62,38,132,132,158,221,6,228,119,151,102,135,114,115,141,124,195,95,91,148,155,123,228,255,183,202,245) +IMAGE_DATA(1,106,23,248,1,158,176,107,172,249,240,85,44,79,161,15,197,94,0,156,9,119,162,246,43,81,81,71,193,183,240,240) +IMAGE_DATA(7,88,83,101,101,229,95,15,30,60,216,246,197,23,23,35,63,252,208,55,29,137,12,59,132,144,204,5,57,70,158,63) +IMAGE_DATA(249,228,120,103,109,93,93,179,113,87,189,241,214,59,154,183,140,15,54,26,63,228,169,104,141,181,108,30,124,229,231,41) +IMAGE_DATA(153,75,73,45,133,158,21,189,236,22,227,168,237,249,249,249,7,142,31,63,222,217,215,215,55,61,60,60,236,16,66,178) +IMAGE_DATA(23,228,188,185,185,185,103,211,166,77,135,149,91,111,109,53,53,11,102,93,165,202,157,103,193,23,185,42,218,19,206,149) +IMAGE_DATA(175,226,121,10,239,135,218,14,251,2,155,149,235,80,212,128,117,5,5,5,141,205,205,127,235,25,30,30,113,8,33,139) +IMAGE_DATA(143,139,23,47,69,80,171,40,183,206,130,23,126,167,220,26,11,123,137,152,99,173,153,99,95,217,251,125,50,159,178,61) +IMAGE_DATA(85,108,222,31,179,53,212,82,13,123,247,238,109,237,235,239,159,30,30,209,247,76,8,89,212,96,238,163,220,222,16,53) +IMAGE_DATA(22,102,215,152,191,151,120,124,101,247,131,233,236,15,218,158,90,98,60,37,243,41,241,212,171,230,253,183,229,228,228,252) +IMAGE_DATA(229,210,165,75,145,17,125,127,132,16,34,180,183,183,79,105,63,236,209,158,168,81,110,79,104,251,74,250,65,123,222,158) +IMAGE_DATA(138,171,188,189,31,206,37,96,126,143,51,9,232,55,209,247,149,27,79,213,232,158,111,127,123,123,199,212,200,200,125,135) +IMAGE_DATA(16,66,188,244,247,15,60,45,45,45,197,28,171,214,242,85,177,241,201,106,21,221,31,92,162,82,235,5,189,189,31,122) +IMAGE_DATA(74,236,55,98,191,15,115,116,204,167,42,77,61,181,167,127,96,224,233,200,125,125,79,132,16,226,131,246,196,180,241,85) +IMAGE_DATA(141,169,115,80,239,96,222,158,103,252,98,207,174,146,113,149,93,83,73,239,135,26,13,189,37,246,29,177,223,135,57,122) +IMAGE_DATA(21,250,190,246,14,93,79,221,31,117,8,33,36,17,253,3,131,79,77,63,136,249,21,230,237,165,198,43,50,187,146,94) +IMAGE_DATA(48,153,218,42,86,77,37,189,95,137,114,207,37,224,108,103,195,185,207,62,27,184,63,58,234,16,66,72,178,116,232,250) +IMAGE_DATA(70,185,243,118,236,15,226,60,3,206,95,97,6,46,189,224,210,36,107,171,88,53,21,62,55,131,207,41,162,247,67,237) +IMAGE_DATA(86,183,111,223,190,214,81,253,190,132,16,146,42,135,14,29,194,254,32,206,51,96,118,133,94,16,179,37,204,152,86,170) +IMAGE_DATA(232,190,96,188,218,202,175,166,42,48,238,195,121,116,244,126,123,6,7,255,59,61,58,58,230,16,66,72,58,20,20,20) +IMAGE_DATA(224,252,21,122,65,204,148,240,121,156,66,171,182,74,52,183,178,247,254,236,57,213,203,198,125,112,96,125,75,75,75,207) +IMAGE_DATA(216,216,152,67,8,33,233,114,249,242,229,136,114,207,183,191,99,213,86,107,85,116,110,101,239,9,250,185,74,206,167,99) +IMAGE_DATA(54,47,115,42,244,149,85,56,147,30,244,26,9,33,217,129,85,91,85,152,222,45,95,37,222,19,140,213,255,161,30,195) +IMAGE_DATA(243,167,48,171,127,54,167,58,124,248,72,219,216,216,184,67,8,33,179,165,165,229,239,61,202,157,91,193,47,120,158,12) +IMAGE_DATA(246,4,115,85,252,25,187,237,42,187,255,67,93,134,243,233,120,86,205,206,158,158,127,255,52,62,62,238,16,66,200,108) +IMAGE_DATA(249,241,199,255,77,171,232,158,32,206,135,110,240,244,129,126,174,178,247,255,48,143,199,25,173,98,211,255,85,151,149,149) +IMAGE_DATA(29,14,122,109,132,144,236,162,190,190,190,217,234,3,75,172,62,112,153,207,204,202,158,85,201,57,117,236,255,97,62,143) +IMAGE_DATA(51,91,181,251,247,239,111,13,122,93,132,144,236,226,200,145,35,56,191,80,167,220,231,6,227,172,57,246,3,87,89,51) +IMAGE_DATA(171,68,174,90,109,126,70,102,85,245,231,207,159,31,24,31,159,112,200,226,229,251,255,124,239,116,119,117,59,55,110,220) +IMAGE_DATA(152,245,107,221,27,26,122,246,90,215,175,95,127,246,153,177,160,215,70,130,225,203,47,175,96,63,16,207,11,126,219,204) +IMAGE_DATA(172,214,27,255,196,154,175,123,231,234,203,205,124,11,115,46,156,255,196,158,98,195,149,43,87,134,39,38,38,28,178,56) +IMAGE_DATA(25,28,28,116,62,253,199,167,63,211,254,175,246,180,95,235,214,173,91,206,231,255,60,247,243,107,93,107,251,42,240,245) +IMAGE_DATA(145,96,208,127,11,152,89,237,52,51,241,114,53,115,190,30,207,85,152,189,231,168,153,231,170,240,26,187,130,94,19,9) +IMAGE_DATA(150,238,238,238,25,174,74,215,87,94,79,1,252,59,232,245,145,224,208,126,249,80,185,159,221,123,213,236,231,173,49,30) +IMAGE_DATA(242,238,5,250,185,10,63,131,217,60,102,244,31,78,76,78,58,100,241,114,251,246,237,231,92,245,204,87,237,237,41,189) +IMAGE_DATA(134,215,83,224,155,206,111,2,95,31,9,14,229,126,215,132,236,5,206,214,85,31,77,234,215,36,139,27,204,169,252,124) +IMAGE_DATA(149,232,103,253,60,213,145,196,207,146,236,198,199,85,43,210,173,171,130,94,15,9,7,55,111,220,140,233,171,120,206,185) +IMAGE_DATA(115,251,14,61,69,124,153,131,186,106,198,188,106,114,242,129,67,8,136,239,171,153,255,247,206,157,120,158,10,126,45,36) +IMAGE_DATA(120,210,156,87,249,238,3,94,189,122,117,248,193,131,7,14,33,160,247,166,191,175,228,255,196,243,84,208,247,79,194,129) +IMAGE_DATA(254,27,73,101,31,80,169,36,206,87,93,184,112,97,32,232,117,145,112,209,123,179,215,199,87,29,113,60,213,17,248,125) +IMAGE_DATA(147,240,160,107,160,84,206,87,197,114,213,115,231,214,27,27,27,91,131,94,23,9,31,126,190,138,197,215,244,20,241,112) +IMAGE_DATA(226,196,137,78,149,222,185,245,184,159,7,124,248,240,161,67,136,151,222,222,196,190,130,167,130,190,79,18,62,118,236,216) +IMAGE_DATA(145,206,231,1,19,62,103,65,255,77,254,20,244,218,72,56,137,231,171,175,59,232,41,242,60,119,239,222,141,245,156,133) +IMAGE_DATA(117,42,241,115,22,18,62,191,170,169,169,169,45,232,245,145,240,18,203,87,244,20,241,227,212,169,83,242,252,170,45,42) +IMAGE_DATA(249,231,87,121,103,86,49,159,11,90,88,88,216,248,112,106,202,33,196,15,248,234,243,115,231,162,158,10,193,61,145,112) +IMAGE_DATA(130,185,146,74,253,185,160,182,171,226,62,111,253,244,233,211,61,83,250,125,8,33,36,93,218,218,218,102,251,188,245,164) +IMAGE_DATA(190,199,6,125,102,208,107,37,132,100,46,186,71,139,247,61,54,201,124,71,160,223,247,3,202,119,195,163,175,172,59,112) +IMAGE_DATA(224,64,235,212,212,35,135,16,66,82,165,169,233,232,108,191,31,48,94,109,101,127,239,50,102,246,13,109,109,95,69,30) +IMAGE_DATA(61,122,228,16,66,72,178,124,251,109,151,124,239,242,251,106,246,223,187,28,171,182,194,220,10,51,122,156,213,194,217,208) +IMAGE_DATA(106,244,130,93,93,93,83,65,175,157,16,146,25,220,187,119,111,26,251,115,202,237,253,224,17,217,251,147,231,42,188,168) +IMAGE_DATA(18,127,143,105,162,218,10,179,121,212,104,210,11,86,106,182,225,125,245,251,63,13,250,119,64,8,9,55,240,212,230,205) +IMAGE_DATA(155,177,239,87,163,220,51,80,232,253,112,158,42,79,37,183,247,151,168,182,146,103,47,160,54,67,141,134,94,240,21,229) +IMAGE_DATA(158,15,197,251,213,232,247,63,132,250,234,241,227,199,14,33,132,120,177,60,85,171,220,25,21,206,125,226,51,49,210,251) +IMAGE_DATA(229,168,231,247,254,146,113,149,183,182,178,123,193,213,230,245,139,45,95,109,67,63,120,237,218,181,72,208,191,19,66,72) +IMAGE_DATA(184,232,238,238,158,50,125,95,141,229,169,18,229,238,251,229,170,244,122,191,120,190,146,243,161,43,204,235,23,122,124,85) +IMAGE_DATA(173,105,56,122,244,232,213,161,161,161,233,160,127,63,132,144,224,57,118,236,24,246,251,48,71,223,106,60,97,123,74,102) +IMAGE_DATA(84,178,239,7,207,164,90,83,121,93,37,189,160,215,87,82,95,97,126,133,57,25,246,7,63,128,67,207,156,57,211,19) +IMAGE_DATA(244,239,137,16,18,12,232,177,76,207,135,115,9,216,239,195,51,20,202,141,47,196,83,56,159,96,207,168,210,245,84,50) +IMAGE_DATA(190,146,249,21,230,237,248,204,32,206,51,160,198,67,141,181,29,103,189,206,158,61,251,93,36,18,153,126,242,228,137,67) +IMAGE_DATA(8,201,94,144,115,157,247,158,242,242,114,56,10,231,209,183,26,31,224,92,2,246,251,54,152,250,70,250,190,185,244,84) +IMAGE_DATA(178,190,194,254,32,246,29,75,148,235,206,10,203,89,240,234,174,134,134,134,230,147,39,79,118,194,183,116,23,33,217,1) +IMAGE_DATA(242,140,92,35,223,202,125,14,113,189,113,20,62,55,243,150,241,193,70,227,135,60,227,139,185,234,251,82,241,21,230,97) +IMAGE_DATA(216,31,196,126,35,106,58,56,179,200,220,155,56,11,61,234,123,230,254,235,148,235,91,244,175,120,22,252,110,195,199,132) +IMAGE_DATA(144,140,64,50,139,252,34,199,200,115,157,114,243,141,156,227,115,45,21,202,157,99,227,115,51,240,129,244,124,240,132,236) +IMAGE_DATA(247,205,151,167,228,138,229,43,156,103,64,45,39,53,214,90,115,111,226,44,212,126,175,153,251,199,153,44,212,91,239,154) +IMAGE_DATA(117,85,25,170,205,90,9,33,225,5,57,149,204,34,191,200,49,242,140,92,35,223,200,57,242,142,220,23,41,215,3,232) +IMAGE_DATA(185,164,150,130,39,22,194,83,114,121,191,75,98,137,138,214,88,94,103,97,150,133,218,15,125,106,137,114,207,188,99,45) +IMAGE_DATA(229,102,93,175,43,119,198,5,222,180,168,32,132,132,2,59,151,146,85,228,22,249,69,142,145,103,228,26,126,66,206,145) +IMAGE_DATA(119,244,87,200,63,60,176,82,185,189,151,56,10,190,88,8,79,201,101,251,74,106,44,220,195,82,53,211,89,168,249,114) +IMAGE_DATA(85,212,91,133,102,45,120,198,76,145,89,27,206,149,22,19,66,50,2,228,21,185,69,126,145,99,228,25,185,70,190,81) +IMAGE_DATA(67,33,239,248,252,48,242,15,71,97,46,5,47,196,170,165,230,219,83,246,229,231,44,187,206,90,174,162,222,194,26,224) +IMAGE_DATA(218,53,6,56,108,29,33,36,163,64,110,37,195,200,51,114,141,124,35,231,152,71,73,175,103,59,42,214,119,252,45,244) +IMAGE_DATA(229,125,127,175,179,164,214,130,95,95,82,81,127,97,77,43,8,33,25,9,242,139,28,75,166,145,111,219,79,177,122,189) +IMAGE_DATA(160,28,229,189,252,156,37,136,187,132,165,42,234,49,66,72,230,176,212,66,242,44,110,18,194,232,40,239,229,189,63,219) +IMAGE_DATA(93,94,127,17,66,50,31,201,182,95,246,51,225,242,187,119,66,72,118,147,13,87,208,191,67,66,200,220,178,96,215,255) +IMAGE_DATA(1,85,205,246,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) +IMAGE_END_DATA(2912, 1) + +IMAGE_BEGIN_DATA +IMAGE_DATA(120,156,237,157,91,108,20,215,25,199,79,90,74,8,182,203,61,177,205,58,54,109,192,113,130,105,83,72,154,24,48,14) +IMAGE_DATA(215,0,141,144,40,47,85,85,169,208,170,41,1,7,138,212,8,168,82,16,151,70,105,3,15,173,211,188,88,4,1,2) +IMAGE_DATA(99,76,164,98,229,6,193,220,158,120,8,182,193,64,66,154,44,46,14,4,140,29,46,94,238,48,61,127,230,28,246,120) +IMAGE_DATA(152,241,94,108,51,187,246,127,164,223,3,194,222,157,177,244,255,233,251,190,115,102,70,60,253,208,56,225,211,241,16,33) +IMAGE_DATA(164,75,209,85,14,191,255,142,132,144,7,79,50,28,94,231,254,61,197,247,9,33,93,10,157,237,100,241,86,36,55,245) +IMAGE_DATA(144,252,192,160,167,226,97,66,72,82,161,179,107,230,25,249,118,250,43,209,156,229,230,40,167,155,244,53,62,162,232,45) +IMAGE_DATA(73,145,164,18,66,146,18,228,23,57,214,153,238,37,194,30,51,221,149,40,206,106,203,81,218,77,184,30,92,219,15,37) +IMAGE_DATA(125,36,125,37,253,21,3,36,3,9,33,73,5,114,171,51,140,60,35,215,200,55,114,174,253,133,252,235,90,69,215,90) +IMAGE_DATA(126,56,43,26,71,105,63,245,19,246,181,13,146,60,38,201,144,12,150,4,36,89,146,199,37,217,132,144,164,0,121,69) +IMAGE_DATA(110,145,95,228,56,83,146,46,121,84,216,30,67,222,77,111,161,222,210,181,150,91,157,213,153,135,249,61,218,151,78,71) +IMAGE_DATA(233,218,9,231,159,161,174,43,71,242,99,201,80,73,174,36,79,242,148,228,105,197,112,131,124,66,72,66,96,230,82,103) +IMAGE_DATA(21,185,69,126,145,99,228,25,185,206,17,182,195,224,46,228,30,245,9,60,144,38,108,103,233,58,75,247,134,157,237,43) +IMAGE_DATA(103,45,165,103,228,218,81,125,212,57,162,126,210,126,26,170,174,11,215,253,83,201,40,201,115,146,231,37,47,72,10,36) +IMAGE_DATA(163,37,99,8,33,9,13,114,90,160,64,126,145,99,228,249,25,97,231,27,57,71,222,135,8,59,255,168,183,80,107,193) +IMAGE_DATA(89,240,131,217,27,58,107,172,142,60,220,60,133,239,133,51,81,243,233,58,42,160,206,53,87,157,255,207,36,63,87,215) +IMAGE_DATA(90,36,153,32,153,44,153,42,153,38,153,46,249,133,228,101,66,72,194,51,93,129,252,78,145,76,20,118,174,145,111,248) +IMAGE_DATA(107,164,176,115,143,252,255,72,216,62,64,237,2,63,192,19,102,141,213,25,190,114,243,20,250,80,172,5,192,153,112,39) +IMAGE_DATA(106,191,28,17,118,20,124,11,15,191,136,107,26,53,106,212,146,133,11,23,150,109,222,82,86,87,93,83,27,250,239,87) +IMAGE_DATA(65,139,16,146,188,32,199,200,243,27,111,44,171,156,48,113,226,106,229,174,241,202,91,207,74,70,40,31,12,81,126,24) +IMAGE_DATA(36,194,53,86,175,78,240,149,151,167,244,92,74,215,82,232,89,209,203,142,84,142,154,144,158,158,62,231,175,203,150,85) +IMAGE_DATA(214,214,30,14,125,29,60,105,17,66,186,46,200,249,63,222,94,83,53,116,232,176,98,97,215,91,99,84,205,130,89,215) +IMAGE_DATA(19,194,158,103,193,23,253,68,184,39,236,40,95,181,229,41,124,31,106,59,172,11,12,19,182,67,81,3,22,73,71,205) +IMAGE_DATA(126,123,205,154,170,224,201,122,139,16,210,253,40,219,90,94,135,90,69,216,117,22,188,240,19,97,215,88,88,75,196,28) +IMAGE_DATA(171,127,7,251,202,92,239,211,243,41,211,83,217,234,251,49,91,67,45,53,105,206,239,126,95,122,248,200,209,208,201,250) +IMAGE_DATA(83,22,33,164,123,243,167,69,139,202,132,221,27,162,198,194,236,26,243,247,28,135,175,204,126,48,158,245,65,211,83,61) +IMAGE_DATA(148,167,244,124,74,123,234,73,245,253,99,83,82,82,126,89,94,190,173,174,254,127,167,44,66,8,209,124,252,241,39,193) +IMAGE_DATA(148,148,212,89,210,19,133,194,238,9,77,95,233,126,208,156,183,199,226,42,103,239,135,125,9,152,223,99,79,2,250,77) +IMAGE_DATA(244,125,185,202,83,133,25,25,25,191,253,100,231,174,224,169,134,6,139,16,66,156,28,61,118,188,37,55,55,23,115,172) +IMAGE_DATA(113,134,175,178,149,79,250,138,240,250,96,15,17,91,47,232,236,253,208,83,98,189,17,235,125,152,163,99,62,133,190,111) +IMAGE_DATA(108,106,106,234,172,99,199,63,111,105,104,248,198,34,132,16,47,164,39,66,202,87,133,170,206,65,189,131,121,251,32,229) +IMAGE_DATA(23,115,118,21,141,171,204,154,74,247,126,168,209,208,91,98,221,17,235,125,152,163,23,160,239,219,185,107,119,176,161,225) +IMAGE_DATA(180,69,8,33,145,56,118,252,139,22,212,55,194,158,95,97,222,254,132,242,138,158,93,233,94,48,154,218,202,173,166,210) +IMAGE_DATA(189,95,142,176,247,37,96,111,231,164,247,214,175,63,248,205,233,51,22,33,132,68,203,167,187,119,7,133,61,111,199,250) +IMAGE_DATA(32,246,51,96,255,21,102,224,186,23,236,25,101,109,229,86,83,225,190,25,220,167,136,222,15,181,91,209,31,94,121,165) +IMAGE_DATA(244,244,153,111,45,66,8,137,149,63,191,254,58,214,7,177,159,1,179,43,244,130,152,45,97,198,148,38,194,235,130,109) +IMAGE_DATA(213,86,94,53,213,99,202,125,216,143,94,128,26,238,196,151,95,134,206,124,123,214,34,132,144,120,200,200,200,196,254,43) +IMAGE_DATA(244,130,152,41,225,126,156,116,163,182,138,52,183,50,215,254,204,57,213,96,229,62,56,112,252,63,255,85,82,117,246,92) +IMAGE_DATA(163,69,8,33,241,242,159,29,59,234,132,189,191,253,89,163,182,26,32,194,115,43,115,77,208,203,85,122,127,58,102,243) +IMAGE_DATA(122,78,133,190,178,32,35,51,115,246,185,198,70,139,16,66,218,75,102,230,189,218,42,95,245,110,143,138,200,107,130,110) +IMAGE_DATA(253,31,234,49,60,127,10,179,250,187,115,170,197,139,23,151,53,202,239,32,132,144,246,82,82,242,78,149,176,231,86,240) +IMAGE_DATA(11,158,39,131,53,193,126,162,237,25,187,233,42,179,255,67,93,134,253,233,120,86,205,228,234,154,218,115,141,231,155,44) +IMAGE_DATA(66,8,105,47,95,125,29,12,137,240,154,32,246,135,102,57,250,64,47,87,153,235,127,152,199,99,143,86,182,234,255,70) +IMAGE_DATA(231,229,229,21,159,111,106,182,8,33,164,163,152,58,109,218,106,163,15,204,49,250,192,94,30,51,43,115,86,165,247,169) +IMAGE_DATA(99,253,15,243,121,236,217,26,247,234,171,243,74,155,154,191,179,8,33,164,163,88,178,116,41,246,47,20,9,251,185,193) +IMAGE_DATA(216,107,142,245,192,62,198,204,42,146,171,250,170,223,209,179,170,241,155,183,108,57,216,252,221,5,139,116,95,42,119,84) +IMAGE_DATA(90,111,253,237,77,107,211,166,205,237,254,172,207,191,56,113,247,179,222,253,247,187,86,67,67,131,239,215,70,252,225,131) +IMAGE_DATA(15,62,196,122,32,158,23,60,74,205,172,50,148,127,220,230,235,206,185,122,111,53,223,194,156,11,251,63,177,166,56,233) +IMAGE_DATA(195,143,62,58,122,225,226,69,139,116,79,246,238,221,103,101,101,14,190,199,188,63,206,141,251,179,62,251,236,144,149,55) +IMAGE_DATA(116,216,189,207,250,205,175,126,237,251,245,17,127,168,175,175,199,204,106,178,154,137,231,138,214,243,245,182,92,133,217,123) +IMAGE_DATA(138,104,189,175,10,159,49,229,162,252,92,210,125,249,251,155,111,181,114,21,152,47,125,21,235,231,28,58,212,218,83,0) +IMAGE_DATA(255,246,251,250,136,127,72,191,188,36,236,123,247,158,84,235,121,253,149,135,156,107,129,94,174,194,239,96,54,143,25,253) +IMAGE_DATA(75,23,47,93,178,72,247,165,186,186,250,62,87,221,245,213,220,185,49,125,134,211,83,224,47,75,150,250,126,125,196,63) +IMAGE_DATA(132,253,174,9,189,22,216,94,87,77,189,116,249,178,69,186,55,101,101,101,30,190,154,23,241,119,107,106,106,92,61,85) +IMAGE_DATA(28,197,239,146,174,141,135,171,82,227,173,171,46,95,110,177,8,217,90,182,213,213,87,112,142,215,239,212,214,212,122,122) +IMAGE_DATA(202,239,235,33,254,211,1,117,85,171,121,85,75,75,200,34,4,148,123,249,106,222,252,251,126,182,182,246,176,187,167,92) +IMAGE_DATA(126,150,116,79,226,156,87,121,174,3,238,220,185,235,104,40,20,178,8,1,219,182,150,187,250,234,53,233,32,253,51,135) +IMAGE_DATA(15,31,113,245,148,249,51,164,123,115,250,244,153,88,214,1,133,136,98,127,85,69,69,197,193,80,232,138,69,136,102,91) +IMAGE_DATA(249,54,119,95,205,47,182,142,120,121,74,254,159,223,231,77,18,135,93,187,62,141,101,127,149,155,171,238,219,183,190,96) +IMAGE_DATA(193,130,210,43,87,174,88,132,152,84,120,248,202,141,5,210,83,126,159,47,73,44,214,174,93,91,41,226,219,183,238,121) +IMAGE_DATA(63,224,240,225,195,139,175,94,189,106,17,226,100,251,182,200,190,130,167,252,62,79,146,120,204,152,49,35,158,251,1,35) +IMAGE_DATA(62,103,225,196,137,19,231,174,93,187,102,17,226,100,123,69,133,183,167,138,139,125,63,63,146,120,156,61,123,214,237,57) +IMAGE_DATA(11,3,69,228,231,44,68,124,126,213,242,229,203,203,174,95,191,110,17,226,198,251,21,219,239,243,212,194,226,215,124,63) +IMAGE_DATA(47,146,152,172,91,183,78,63,191,106,164,136,254,249,85,206,153,149,235,115,65,3,129,192,236,235,55,110,88,132,120,241) +IMAGE_DATA(254,246,237,86,222,176,220,176,167,18,224,156,72,98,130,185,146,136,253,185,160,166,171,218,124,222,250,123,235,215,87,221) +IMAGE_DATA(144,223,67,8,33,241,82,181,103,79,123,159,183,30,241,61,54,105,105,105,179,26,207,159,15,221,184,121,211,34,132,144) +IMAGE_DATA(120,144,61,90,91,239,177,137,230,29,129,94,239,7,212,239,134,71,95,89,180,104,209,162,210,155,55,111,89,132,16,18) +IMAGE_DATA(43,43,86,172,104,239,251,1,219,170,173,204,247,46,99,102,63,105,207,158,189,117,183,110,221,178,8,33,36,90,14,29) +IMAGE_DATA(170,214,239,93,126,65,180,255,189,203,110,181,21,230,86,152,209,99,175,22,246,134,142,70,47,88,93,93,29,244,251,218) +IMAGE_DATA(9,33,201,65,83,83,83,40,16,8,204,22,118,239,7,143,232,181,63,253,92,133,135,69,228,247,152,70,170,173,48,155) +IMAGE_DATA(71,141,166,123,193,103,36,99,241,189,205,205,205,45,183,111,223,182,8,33,196,11,233,137,80,126,126,62,214,253,10,133) +IMAGE_DATA(189,7,10,189,31,246,83,13,18,209,173,253,69,170,173,244,179,23,80,155,161,70,67,47,248,184,176,247,135,226,251,10) +IMAGE_DATA(229,247,207,175,169,169,9,250,253,183,32,132,36,38,134,167,198,9,123,70,133,125,159,184,39,70,247,126,41,226,254,181) +IMAGE_DATA(191,104,92,229,172,173,204,94,176,175,250,252,108,195,87,99,209,15,238,219,183,175,206,239,191,9,33,36,177,168,173,173) +IMAGE_DATA(13,170,190,175,208,240,84,142,176,215,253,250,137,248,122,191,182,124,165,247,135,166,170,207,79,119,248,106,180,100,210,202) +IMAGE_DATA(149,43,183,92,184,112,33,116,231,206,29,139,16,210,189,89,181,106,21,214,251,48,71,31,163,60,97,122,74,207,168,244) +IMAGE_DATA(186,31,60,19,107,77,229,116,149,238,5,157,190,210,245,21,230,87,152,147,97,125,240,197,172,172,172,217,27,54,108,168) +IMAGE_DATA(242,251,239,68,8,241,135,253,251,247,215,141,24,49,2,61,31,246,37,96,189,15,207,80,200,85,190,208,158,194,254,4) +IMAGE_DATA(115,70,21,175,167,162,241,149,158,95,97,222,142,123,6,177,159,1,53,30,106,172,9,210,89,115,54,109,218,180,27,117) +IMAGE_DATA(150,197,131,7,143,46,125,32,231,27,55,110,172,82,142,194,126,244,49,202,7,216,151,128,245,190,44,85,223,232,190,175) +IMAGE_DATA(35,61,21,173,175,176,62,136,117,199,28,97,187,51,223,112,22,188,58,101,230,204,153,171,75,74,74,42,15,28,56,80) +IMAGE_DATA(71,119,241,224,209,53,14,228,25,185,70,190,133,253,28,226,241,202,81,184,111,102,132,242,193,16,229,135,65,202,23,29) +IMAGE_DATA(213,247,197,226,43,204,195,176,62,136,245,70,212,116,112,102,64,157,155,118,22,122,212,231,213,249,23,9,219,183,232,95) +IMAGE_DATA(241,44,248,233,138,151,9,33,73,129,206,44,242,139,28,35,207,69,194,206,55,114,142,251,90,242,133,61,199,198,125,51) +IMAGE_DATA(240,129,238,249,224,9,189,222,215,89,158,210,135,155,175,176,159,1,181,156,174,177,6,168,115,211,206,66,237,151,167,206) +IMAGE_DATA(31,123,178,80,111,61,167,174,171,64,49,90,93,43,33,36,113,65,78,117,102,145,95,228,24,121,70,174,145,111,228,28) +IMAGE_DATA(121,71,238,3,194,246,0,122,46,93,75,193,19,15,194,83,250,112,190,75,162,135,8,215,88,78,103,97,150,133,218,15) +IMAGE_DATA(125,106,142,176,247,188,227,90,114,213,117,61,37,236,25,23,24,110,144,79,8,73,8,204,92,234,172,34,183,200,47,114) +IMAGE_DATA(140,60,35,215,240,19,114,142,188,163,191,66,254,225,129,52,97,247,94,218,81,240,197,131,240,148,62,76,95,233,26,11) +IMAGE_DATA(231,208,83,180,118,22,106,190,126,34,236,173,116,117,45,120,198,76,64,93,27,246,149,102,19,66,146,2,228,21,185,69) +IMAGE_DATA(126,145,99,228,25,185,70,190,81,67,33,239,184,127,24,249,135,163,48,151,130,23,220,106,169,206,246,148,121,120,57,203) +IMAGE_DATA(172,179,122,139,176,183,112,13,112,109,127,5,28,54,144,16,146,84,32,183,58,195,200,51,114,141,124,35,231,152,71,233) +IMAGE_DATA(94,207,116,148,219,59,254,30,244,225,252,126,167,179,116,173,5,191,62,34,194,254,194,53,165,18,66,146,18,228,23,57) +IMAGE_DATA(214,153,70,190,77,63,185,245,122,126,57,202,121,120,57,75,163,221,165,233,41,194,30,35,132,36,15,61,13,116,158,181) +IMAGE_DATA(155,52,137,232,40,231,225,60,63,211,93,78,127,17,66,146,31,157,109,175,236,39,195,225,117,238,132,144,174,77,87,56) +IMAGE_DATA(252,254,27,18,66,58,150,7,118,252,31,232,152,152,232,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) +IMAGE_END_DATA(3040, 1) + +IMAGE_BEGIN_DATA +IMAGE_DATA(120,156,237,219,203,78,26,113,20,199,113,150,52,194,116,193,165,209,46,156,198,70,106,187,96,98,99,44,162,225,82,164) +IMAGE_DATA(80,180,66,81,139,66,65,137,90,40,114,105,65,139,218,180,190,193,60,2,143,50,143,192,163,204,35,156,242,91,208,18) +IMAGE_DATA(67,188,98,156,249,247,156,228,179,33,176,224,124,195,127,51,127,44,63,44,175,44,163,152,233,105,79,50,178,252,78,205) +IMAGE_DATA(230,10,218,217,207,223,196,70,3,251,196,94,177,223,145,132,186,230,184,221,79,148,68,98,181,211,248,214,210,79,78,127) +IMAGE_DATA(17,187,95,216,51,246,141,189,223,95,83,183,146,217,206,105,199,237,51,98,15,3,251,71,135,81,118,13,133,35,234,113) +IMAGE_DATA(251,148,152,49,44,248,151,206,239,218,84,146,30,203,249,66,177,219,58,58,33,102,44,232,130,62,183,233,234,114,185,149) +IMAGE_DATA(175,149,154,222,108,181,137,25,19,250,160,211,205,186,186,122,93,171,250,247,230,17,49,99,67,39,244,186,78,87,187,36) +IMAGE_DATA(201,165,242,161,94,111,180,136,153,3,122,161,219,85,109,183,182,115,221,90,189,73,204,92,208,237,178,174,75,75,1,181) +IMAGE_DATA(90,107,16,51,39,244,27,214,213,233,116,42,135,213,58,49,115,67,199,139,109,63,36,63,106,229,74,141,152,185,161,227) +IMAGE_DATA(96,215,137,137,167,193,114,165,74,76,12,232,217,111,27,12,133,59,95,74,21,98,98,64,207,126,219,124,161,168,239,31) +IMAGE_DATA(148,137,137,1,61,209,117,114,82,78,238,31,148,136,137,5,93,231,223,248,212,226,222,1,49,177,160,107,44,158,208,118) +IMAGE_DATA(139,251,196,196,130,174,59,187,123,196,196,148,47,236,50,65,125,206,239,48,65,229,114,121,38,168,44,19,86,102,43,199) +IMAGE_DATA(4,245,41,147,101,130,10,4,195,218,198,102,134,152,88,208,213,235,85,212,245,245,77,98,98,65,215,241,241,137,100,58) +IMAGE_DATA(189,65,76,44,232,138,231,5,137,196,170,158,74,165,137,137,1,61,251,207,248,102,103,95,119,146,189,215,152,24,208,179) +IMAGE_DATA(223,214,225,112,6,87,215,82,196,196,128,158,131,247,106,124,62,191,182,178,178,70,204,220,208,241,226,93,56,73,146,240) +IMAGE_DATA(223,75,98,230,134,142,195,238,177,206,204,188,84,227,241,4,49,115,66,191,97,93,251,179,176,176,216,141,197,222,19,51) +IMAGE_DATA(23,116,187,172,43,198,106,125,36,135,66,111,245,104,52,70,204,28,208,11,221,174,106,139,177,217,237,74,176,247,254,229) +IMAGE_DATA(222,231,152,177,161,19,122,93,167,235,223,190,54,187,18,8,132,244,72,36,74,204,152,208,7,157,110,210,245,223,249,108) +IMAGE_DATA(149,231,230,230,187,225,112,132,152,177,160,11,250,220,166,235,224,200,242,179,243,222,153,78,204,24,208,227,174,77,7,199) +IMAGE_DATA(102,179,41,94,175,162,245,206,1,98,15,3,251,71,135,81,118,29,156,177,49,155,226,241,188,232,248,253,139,250,67,127) +IMAGE_DATA(215,255,1,246,140,125,99,239,247,213,116,216,56,28,206,228,212,212,115,149,127,207,163,133,125,98,175,216,239,93,250,252) +IMAGE_DATA(1,100,173,143,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) +IMAGE_END_DATA(704, 1) + +IMAGE_BEGIN_DATA +IMAGE_DATA(120,156,237,218,77,110,130,96,20,133,97,167,58,192,129,38,149,142,28,217,248,255,151,14,140,74,109,109,211,70,165,162) +IMAGE_DATA(182,107,233,212,29,176,4,150,194,18,92,10,75,160,57,3,162,105,173,69,248,204,21,61,95,242,204,47,247,13,16,35) +IMAGE_DATA(169,175,84,53,165,226,220,220,20,172,74,165,102,247,122,125,119,54,155,251,164,6,246,137,189,98,191,74,66,133,60,154) +IMAGE_DATA(166,181,154,205,182,243,250,58,241,164,119,112,13,176,103,236,27,123,63,101,83,222,159,178,176,127,213,141,241,124,144,190) +IMAGE_DATA(46,218,42,149,238,214,113,155,166,211,233,226,112,56,218,72,95,11,253,134,46,232,19,165,43,238,125,190,83,207,27,250) +IMAGE_DATA(28,251,140,214,180,108,235,237,109,234,153,166,229,211,121,67,39,244,10,247,28,206,20,217,53,89,208,11,221,254,107,107) +IMAGE_DATA(24,143,27,233,89,233,120,232,118,168,107,181,90,183,165,103,164,232,208,239,175,119,172,244,108,20,223,190,119,111,175,55) +IMAGE_DATA(112,165,231,162,248,208,113,183,107,46,151,31,73,207,68,234,160,103,208,182,221,238,56,243,249,194,167,203,128,158,65,219) +IMAGE_DATA(201,100,234,73,207,67,234,160,39,186,22,10,186,37,61,11,169,135,174,181,90,221,150,158,131,212,67,215,126,127,224,74) +IMAGE_DATA(207,65,234,177,235,101,179,172,37,17,17,17,17,17,253,48,24,24,238,98,177,242,233,178,160,107,189,222,176,165,231,32) +IMAGE_DATA(245,208,85,215,117,75,122,14,82,15,93,241,127,193,116,106,122,210,179,144,58,232,25,252,199,215,233,116,29,233,121,72) +IMAGE_DATA(29,244,12,218,230,243,249,145,244,60,164,14,122,238,126,87,51,28,62,184,203,229,135,79,201,134,142,63,191,133,203,102) +IMAGE_DATA(179,45,233,185,40,62,116,220,247,29,107,163,209,180,165,103,163,232,208,111,95,215,224,60,61,61,111,164,103,164,227,161) +IMAGE_DATA(219,161,174,56,153,76,166,56,155,189,123,210,179,82,120,232,133,110,255,181,13,222,189,236,155,12,232,244,215,59,150,125) +IMAGE_DATA(147,43,74,215,221,231,243,120,252,178,89,173,62,125,58,47,232,18,246,57,124,232,148,203,149,181,244,181,208,22,122,196) +IMAGE_DATA(109,186,123,112,239,27,198,131,43,125,93,215,12,251,143,250,12,14,219,184,219,189,119,76,115,238,73,95,235,53,192,158) +IMAGE_DATA(177,239,83,54,221,119,116,253,214,194,239,101,222,207,106,97,159,216,43,246,27,167,207,55,20,8,230,72,0,0,0,0) +IMAGE_END_DATA(544, 1) + +IMAGE_BEGIN_DATA +IMAGE_DATA(120,156,237,156,49,74,4,65,16,69,39,16,68,204,20,217,100,17,81,52,17,212,216,200,3,24,24,152,106,108,42,8) +IMAGE_DATA(194,70,230,34,134,27,122,3,15,96,226,17,60,138,71,80,126,208,216,172,187,58,59,83,179,53,93,251,10,94,94,83) +IMAGE_DATA(143,153,166,167,187,170,186,175,14,43,139,56,62,93,191,184,188,217,122,190,125,28,190,143,223,14,190,192,6,213,83,117) +IMAGE_DATA(85,125,77,68,213,140,225,238,234,201,245,221,224,229,233,117,239,211,187,6,203,128,234,172,122,171,238,93,58,229,253,244) +IMAGE_DATA(69,245,183,118,124,126,181,249,224,253,92,240,131,124,180,117,186,49,88,217,25,141,183,63,188,159,5,126,35,47,242,211) +IMAGE_DATA(196,171,222,125,214,212,126,35,63,243,126,163,241,90,14,243,248,213,123,142,215,178,144,175,58,223,103,214,215,50,145,183) +IMAGE_DATA(191,188,106,191,236,157,35,52,71,254,102,173,177,222,185,65,123,166,173,189,252,151,136,129,60,230,94,247,143,214,206,188) +IMAGE_DATA(115,2,59,228,51,185,213,255,74,239,124,192,14,249,76,110,217,243,196,66,62,229,85,231,72,222,185,128,61,233,252,213) +IMAGE_DATA(59,15,176,135,115,245,184,224,21,0,0,0,0,0,150,13,246,65,49,73,247,215,189,243,0,123,82,95,130,119,30,96) +IMAGE_DATA(79,234,55,225,28,40,22,233,28,136,243,219,120,228,231,183,220,187,136,69,126,239,130,251,82,113,152,188,47,197,61,199) +IMAGE_DATA(56,204,234,49,96,63,84,54,179,238,39,167,160,175,160,76,254,235,43,80,208,15,84,30,117,251,129,210,218,139,223,50) +IMAGE_DATA(160,79,51,38,77,188,230,223,103,214,223,126,210,166,111,62,15,230,93,244,11,139,121,23,121,48,167,198,159,46,230,212) +IMAGE_DATA(76,58,102,190,212,226,88,196,124,169,105,193,92,184,110,176,154,11,247,13,154,22,148,28,0,0,0,0,0,0,0,0) +IMAGE_END_DATA(416, 1) diff --git a/bazaar/Map/MapView.lay b/bazaar/Map/MapView.lay new file mode 100644 index 000000000..ec299b31a --- /dev/null +++ b/bazaar/Map/MapView.lay @@ -0,0 +1,15 @@ +LAYOUT(MapViewLayout, 508, 356) + ITEM(Button, LevelDownBtn, RightPosZ(80, 28).TopPosZ(4, 28)) + ITEM(Button, LevelUpBtn, RightPosZ(4, 28).TopPosZ(4, 28)) + ITEM(Button, ZoomInBtn, LeftPosZ(36, 28).TopPosZ(4, 28)) + ITEM(Button, ClearSearchBtn, SetLabel(t_("X")).RightPosZ(4, 28).BottomPosZ(4, 28)) + ITEM(Button, ZoomOutBtn, LeftPosZ(4, 28).TopPosZ(4, 28)) + ITEM(Button, MoveLeftBtn, LeftPosZ(4, 28).VCenterPosZ(112, 2)) + ITEM(Button, MoveRightBtn, RightPosZ(4, 28).VCenterPosZ(112, 2)) + ITEM(Button, MoveDownBtn, HCenterPosZ(112, -4).BottomPosZ(4, 28)) + ITEM(Button, MoveUpBtn, HCenterPosZ(112, -4).TopPosZ(4, 28)) + ITEM(Label, LevelName, SetAlign(ALIGN_CENTER).RightPosZ(32, 48).TopPosZ(4, 28)) + ITEM(SliderCtrl, ZoomSlider, LeftPosZ(68, 84).TopPosZ(4, 28)) + ITEM(EditField, Search, RightPosZ(36, 120).BottomPosZ(4, 28)) +END_LAYOUT + diff --git a/bazaar/Map/MapViewEvents.cpp b/bazaar/Map/MapViewEvents.cpp new file mode 100644 index 000000000..493ebfafa --- /dev/null +++ b/bazaar/Map/MapViewEvents.cpp @@ -0,0 +1,89 @@ +#include "MapView.h" + +void MapView::Layout() +{ + if (GetCurrentLevel()) + GetCurrentLevel()->Refresh(); + TopWindow::Layout(); +} + +void MapView::LeftDouble(Point p, dword keyflags) +{ + if (GetCurrentLevel()) + GetCurrentLevel()->ProcessLeftDouble(p, keyflags); +} + +void MapView::LeftDown(Point p, dword keyflags) +{ + if (GetCurrentLevel()) + GetCurrentLevel()->ProcessLeftDown(p, keyflags); + + _mousePos = p; + _move = true; +} + +void MapView::LeftDrag(Point p, dword keyflags) +{ + if (GetCurrentLevel() && GetCurrentLevel()->ProcessLeftDrag(p, keyflags)) + return; + _drag = true; +} + +void MapView::LeftUp(Point p, dword keyflags) +{ + if (GetCurrentLevel() && GetCurrentLevel()->ProcessLeftUp(p, keyflags)) + return; + _move = false; + _drag = false; +} + +void MapView::RightDouble(Point p, dword keyflags) +{ + if (GetCurrentLevel()) + GetCurrentLevel()->ProcessRightDouble(p, keyflags); +} + +void MapView::RightDown(Point p, dword keyflags) +{ + if (GetCurrentLevel()) + GetCurrentLevel()->ProcessRightDown(p, keyflags); +} + +void MapView::RightDrag(Point p, dword keyflags) +{ + if (GetCurrentLevel() && GetCurrentLevel()->ProcessRightDrag(p, keyflags)) + return; +} + +void MapView::RightUp(Point p, dword keyflags) +{ + if (GetCurrentLevel() && GetCurrentLevel()->ProcessRightUp(p, keyflags)) + return; +} + +void MapView::MouseMove(Point p, dword keyflags) +{ + MapLevel* level = GetCurrentLevel(); + if (!level) return; + + if (level->ProcessMouseMove(p, keyflags)) + return; + + if (_move) + { + level->MoveBy(_mousePos - p); + _mousePos = p; + } +} + +void MapView::MouseEnter() +{ + _move = false; + _drag = false; +} + +void MapView::MouseLeave() +{ + _move = false; + _drag = false; +} diff --git a/bazaar/Map/MapViewSearch.cpp b/bazaar/Map/MapViewSearch.cpp new file mode 100644 index 000000000..353936c0c --- /dev/null +++ b/bazaar/Map/MapViewSearch.cpp @@ -0,0 +1,27 @@ +#include "MapView.h" + +void MapView::DoSearch(const String& data) +{ + if (GetCurrentLevel()) + GetCurrentLevel()->PerformStates(PERFORM_SEARCH, data); + Refresh(); +} + +void MapView::OnSearch() +{ + if (GetCurrentLevel()) + GetCurrentLevel()->StatesOff(STATE_SELECTED); + DoSearch((~Search).ToString()); +} + +void MapView::OnSearchClear() +{ + MapLevel* level = GetCurrentLevel(); + if (!level) return; + + level->StatesOff(STATE_SELECTED); + level->StatesOff(STATE_FOUND); + Search.Clear(); + + Refresh(); +} diff --git a/bazaar/Map/init b/bazaar/Map/init new file mode 100644 index 000000000..c69d75317 --- /dev/null +++ b/bazaar/Map/init @@ -0,0 +1,9 @@ +#ifndef _Map_icpp_init_stub +#define _Map_icpp_init_stub +#include "CtrlLib/init" +#include "MapBG/init" +#include "FormEditorProperties/init" +#define BLITZ_INDEX__ FDCB0E40879C2D486297E4287E58D5ECF +#include "Map.icpp" +#undef BLITZ_INDEX__ +#endif diff --git a/bazaar/MapBG/FileUtils.h b/bazaar/MapBG/FileUtils.h new file mode 100644 index 000000000..6db090743 --- /dev/null +++ b/bazaar/MapBG/FileUtils.h @@ -0,0 +1,91 @@ +#ifndef MAP_BG__FILE_UTILS_H +#define MAP_BG__FILE_UTILS_H + +#include +using namespace Upp; + +inline bool IsValidPath(const String& fp) +{ + return fp.Left(1) != "." && fp.Left(2) != ".."; +} + +inline bool IsFolder(const String& fp) +{ + return fp.GetCount() ? fp[fp.GetCount() - 1] == '/' : false; +} + +static Vector GetDirectoryFiles(const String& dir, const String& search = "*", + String prefix = String()) +{ + FindFile ff(AppendFileName(dir, search)); + Vector r; + + while (ff) + { + if (ff.IsFolder()) + { + prefix.IsEmpty() + ? r.Append( GetDirectoryFiles(AppendFileName(dir, ff.GetName()), ff.GetName()) ) + : r.Append( GetDirectoryFiles(AppendFileName(dir, ff.GetName()), + AppendFileName(prefix, ff.GetName())) ); + } + if (ff.IsFile()) + { + prefix.IsEmpty() + ? r.Add(ff.GetName()) + : r.Add(AppendFileName(prefix, ff.GetName())); + } + ff.Next(); + } + + return r; +} + +static Vector GetSubDirectories(const String& dir, String prefix = String()) +{ + FindFile ff(AppendFileName(dir, "*")); + Vector r; + + while (ff) + { + if (ff.IsFolder()) + { + Vector files = GetSubDirectories(AppendFileName(dir, ff.GetName()), + ff.GetName()); + + if (files.GetCount()) + r.Append(files); + + prefix.IsEmpty() + ? r.Add(ff.GetName()) + : r.Add(AppendFileName(prefix, ff.GetName())); + } + ff.Next(); + } + + return r; +} + +static bool RemoveDirectory(const String& dir) +{ + if (!DirectoryExists(dir)) + return true; + + Vector files = GetDirectoryFiles(dir); + bool done = true; + + for (int i = files.GetCount() - 1; i >= 0; --i) + { + done &= FileDelete( AppendFileName(dir, files[i]) ); + } + + Vector folders = GetSubDirectories(dir); + for (int i = 0; i < folders.GetCount(); ++i) + { + done &= DirectoryDelete( AppendFileName(dir, folders[i]) ); + } + + return done &= DirectoryDelete(dir); +} + +#endif diff --git a/bazaar/MapBG/MapBG.cpp b/bazaar/MapBG/MapBG.cpp new file mode 100644 index 000000000..e538f5cd9 --- /dev/null +++ b/bazaar/MapBG/MapBG.cpp @@ -0,0 +1,119 @@ +#include "MapBG.h" + +MapBG::MapBG(IMapRender* render) + : IMapRender(render), _recalc(true), _currLevel(-1), _virtPage(Size(0, 0)), + _cachePageSize(CACHE_PAGE_SIZE), _cachePageInitSize(CACHE_PAGE_INIT_SIZE) +{} + +void MapBG::Render(Draw* w) +{ + if (_currLevel < 0 || _currLevel >= _levels.GetCount() || !GetTopRender()) + return; + + MipMapLevel& level = _levels[_currLevel]; + + Point offset = GetTopRender()->GetPageOffset(); + Rect page = GetTopRender()->GetPageRect(); + Point lt = GetTopRender()->GetPagePos(); + + for (int i = 0; i < level.GetMipMaps().GetCount(); ++i) + { + Rect itemRect(level.GetMipMaps().GetKey(i), level.GetBlockSize()); + + if (page.Intersects(itemRect)) + if (level.GetMipMaps()[i]) + { + level.GetMipMaps()[i] + ->Render(w, + itemRect + .Offseted(-lt) + .Offseted(offset)); + } + } + + IMapRender::Render(w); +} + +void MapBG::StatePerformed(dword state, const String& param) +{ + if (_currLevel < 0 || _currLevel >= _levels.GetCount()) + return; + + MipMapLevel& level = _levels[_currLevel]; + Rect pageRect = GetPageRect(); + + if (_recalc || !_virtPage.Contains(GetPageRect())) + { + _virtPage = pageRect.Inflated(level.GetBlockSize() * _cachePageInitSize); + _recalc = true; + } + + Rect currVirtualPage = _virtPage.Inflated(level.GetBlockSize() * _cachePageSize); + + if (!_recalc) + return; + + for (int i = 0; i < level.GetMipMaps().GetCount(); ++i) + { + Point pi = level.GetMipMaps().GetKey(i); + Rect itemRect(pi, level.GetBlockSize()); + + if (!level.GetMipMaps()[i]) + continue; + + if (currVirtualPage.Intersects(itemRect)) + { + level.GetMipMaps()[i]->Prepare( + AppendFileName(_mapDir, NFormat("%d-%d-%d.png", _currLevel, pi.x, pi.y)), + level.GetBlockSize() + ); + } + else + level.GetMipMaps()[i]->Release(); + } + + _recalc = false; +} + +bool MapBG::Load(const char* fp) +{ + if (!FileExists(fp)) + { + LOG(NFormat("MapBG: File not exists, \"%s\"", fp)); + return false; + } + + if (!LoadFromXMLFile(_levels, fp)) + { + LOG("MapBG: Error while loading map from XML-file!"); + return false; + } + + _mapDir = AppendFileName(GetFileDirectory(fp), GetFileTitle(fp)); + _currLevel = _levels.GetCount() > 0 ? 0 : -1; + if (_currLevel < 0) + { + LOG("MapBG: No zoom levels found in map!"); + return false; + } + _recalc = true; + + return true; +} + +bool MapBG::Zoom(int level) +{ + if (level < 0 || level >= _levels.GetCount()) + return false; + _currLevel = level; + _recalc = true; + return true; +} + +Rect MapBG::GetRect() +{ + if (_currLevel < 0 || _currLevel >= _levels.GetCount()) + return Size(0, 0); + + return Rect(Point(0, 0), _levels[_currLevel].GetTotalSize()); +} diff --git a/bazaar/MapBG/MapBG.h b/bazaar/MapBG/MapBG.h new file mode 100644 index 000000000..c908ef8c9 --- /dev/null +++ b/bazaar/MapBG/MapBG.h @@ -0,0 +1,39 @@ +#ifndef MAP_BG__MAP_BG_H +#define MAP_BG__MAP_BG_H + +#include +#include "MipMapGen.h" +#include "MipMap.h" + +#define CACHE_PAGE_INIT_SIZE Size(2, 2) +#define CACHE_PAGE_SIZE Size(4, 4) + +class MapBG : public IMapRender +{ +public: + MapBG(IMapRender* render); + virtual ~MapBG() {} + + virtual void Render(Draw* w); + virtual Rect GetRect(); + + virtual void StatePerformed(dword state, const String& param = String()); + virtual bool Load(const char* fp); + virtual bool Zoom(int level); + + virtual Rect GetRenderRect() { return GetRect(); } + + virtual String GetItemType() { return "MapBG"; } + +protected: + Size _cachePageInitSize; + Size _cachePageSize; + int _currLevel; + bool _recalc; + Rect _virtPage; + String _mapDir; + + Vector _levels; +}; + +#endif diff --git a/bazaar/MapBG/MapBG.upp b/bazaar/MapBG/MapBG.upp new file mode 100644 index 000000000..8dc0519c8 --- /dev/null +++ b/bazaar/MapBG/MapBG.upp @@ -0,0 +1,15 @@ +uses + Painter, + CtrlLib, + MapCommon, + Painter; + +file + FileUtils.h, + MipMapGen.h, + MipMapGen.cpp, + MipMap.h, + MipMap.cpp, + MapBG.h, + MapBG.cpp; + diff --git a/bazaar/MapBG/MipMap.cpp b/bazaar/MapBG/MipMap.cpp new file mode 100644 index 000000000..3d12e8a08 --- /dev/null +++ b/bazaar/MapBG/MipMap.cpp @@ -0,0 +1,37 @@ +#include "MipMap.h" +#include + +void MipMapItem::Render(Draw* w, const Rect& r) +{ + if (w) + w->DrawImage(r, _mipMap); +} + +void MipMapItem::Prepare(const char* fp, const Size& sz) +{ + if (_ready) + return; + _ready = true; + + FileIn in(fp); + One r = StreamRaster::OpenAny(in); + if (!r) + { + LOG(NFormat("Ошибка при загрузке файла карты: %s", fp)); + ImageBuffer ib(sz); + BufferPainter sw(ib); + sw.DrawRect(sz, Yellow()); + _mipMap = ib; + return; + } + + _mipMap = r->GetImage(); +} + +void MipMapItem::Release() +{ + if (!_ready) + return; + _mipMap.Clear(); + _ready = false; +} diff --git a/bazaar/MapBG/MipMap.h b/bazaar/MapBG/MipMap.h new file mode 100644 index 000000000..d1c62ac1a --- /dev/null +++ b/bazaar/MapBG/MipMap.h @@ -0,0 +1,161 @@ +#ifndef MAP_BG__MAP_COMMON_H +#define MAP_BG__MAP_COMMON_H + +#include "FileUtils.h" + +#include +using namespace Upp; + +class IMipMapItem : public Moveable, public Pte +{ +public: + virtual ~IMipMapItem() {} + + virtual void Prepare(const char* fp, const Size& sz) = 0; + virtual void Release() = 0; + + virtual void Render(Draw* w, const Rect& r) = 0; + virtual void Xmlize(XmlIO xml) {} +}; + +class MipMapItem : public IMipMapItem +{ +public: + MipMapItem() : _ready(false) {} + virtual ~MipMapItem() {} + + virtual void Prepare(const char* fp, const Size& sz); + virtual void Release(); + + virtual void Render(Draw* w, const Rect& r); + +private: + bool _ready; + Image _mipMap; +}; + +class MipMapLevel : public Moveable +{ +public: + MipMapLevel() {} + MipMapLevel(const MipMapLevel& other) + { + _blockX = other._blockX; + _blockY = other._blockY; + _totalX = other._totalX; + _totalY = other._totalY; + _zoomDX = other._zoomDX; + _totalSizeX = other._totalSizeX; + _totalSizeY = other._totalSizeY; + _mipMaps <<= other._mipMaps; + } + + virtual ~MipMapLevel() { Clear(); } + void Clear() + { + for (int i = 0; i < _mipMaps.GetCount(); ++i) + if (_mipMaps[i]) + delete _mipMaps[i]; + _mipMaps.Clear(); + } + + void Release() + { + for (int i = 0; i < _mipMaps.GetCount(); ++i) + if (_mipMaps[i]) + _mipMaps[i]->Release(); + } + + MipMapLevel& BlockCX (int i) { Mutex::Lock _(_mutex); _blockX = i; return *this; } + MipMapLevel& BlockCY (int i) { Mutex::Lock _(_mutex); _blockY = i; return *this; } + MipMapLevel& TotalCX (int i) { Mutex::Lock _(_mutex); _totalX = i; return *this; } + MipMapLevel& TotalCY (int i) { Mutex::Lock _(_mutex); _totalY = i; return *this; } + MipMapLevel& TotalSizeCX(int i) { Mutex::Lock _(_mutex); _totalSizeX = i; return *this; } + MipMapLevel& TotalSizeCY(int i) { Mutex::Lock _(_mutex); _totalSizeY = i; return *this; } + MipMapLevel& ZoomDX( double dx) { Mutex::Lock _(_mutex); _zoomDX = dx; return *this; } + + int GetBlockCX() { Mutex::Lock _(_mutex); return _blockX; } + int GetBlockCY() { Mutex::Lock _(_mutex); return _blockY; } + int GetTotalCX() { Mutex::Lock _(_mutex); return _totalX; } + int GetTotalCY() { Mutex::Lock _(_mutex); return _totalY; } + int GetTotalSizeCX() { Mutex::Lock _(_mutex); return _totalSizeX; } + int GetTotalSizeCY() { Mutex::Lock _(_mutex); return _totalSizeY; } + double GetZoomDX() { Mutex::Lock _(_mutex); return _zoomDX; } + + Size GetBlockSize() { Mutex::Lock _(_mutex); return Size(_blockX, _blockY); } + Size GetTotalSize() { Mutex::Lock _(_mutex); return Size(_totalSizeX, _totalSizeY); } + Size GetTotalBlockSize() { Mutex::Lock _(_mutex); return Size(_totalX, _totalY); } + + MipMapLevel& AddMipMap(const Point& p, Ptr item) + { + Mutex::Lock _(_mutex); + _mipMaps.Add(p, item); + return *this; + } + + const VectorMap >& GetMipMaps() const { return _mipMaps; } + VectorMap >& GetMipMaps() { return _mipMaps; } + + void Xmlize(XmlIO xml) + { + Mutex::Lock _(_mutex); + + xml ("blockX", _blockX) + ("blockY", _blockY) + ("totalX", _totalX) + ("totalY", _totalY) + ("zoomDX", _zoomDX) + ("totalSizeX", _totalSizeX) + ("totalSizeY", _totalSizeY); + + if (xml.IsStoring()) + { + Vector keys = _mipMaps.GetKeys(); + xml("mipmaps", keys); + } + else + { + Vector keys; + xml("mipmaps", keys); + + Clear(); + for (int i = 0; i < keys.GetCount(); ++i) + AddMipMap(keys[i], new MipMapItem()); + } + } + +private: + Mutex _mutex; + int _blockX; + int _blockY; + int _totalX; + int _totalY; + int _totalSizeX; + int _totalSizeY; + double _zoomDX; + VectorMap > _mipMaps; +}; + +class MapZoomLevel : public Moveable +{ +public: + MapZoomLevel() : _zoomDX(1.0) {} + MapZoomLevel(double zx) : _zoomDX(zx) {} + MapZoomLevel(const MapZoomLevel& other) { _zoomDX = other._zoomDX; } + virtual ~MapZoomLevel() {} + + MapZoomLevel& Zoom( double dx) { Mutex::Lock _(_mutex); _zoomDX = dx; return *this; } + double GetZoom() { Mutex::Lock _(_mutex); return _zoomDX; } + + void Xmlize(XmlIO xml) + { + Mutex::Lock _(_mutex); + xml("zoomDX", _zoomDX); + } + +private: + Mutex _mutex; + double _zoomDX; +}; + +#endif diff --git a/bazaar/MapBG/MipMapGen.cpp b/bazaar/MapBG/MipMapGen.cpp new file mode 100644 index 000000000..ed2f66943 --- /dev/null +++ b/bazaar/MapBG/MipMapGen.cpp @@ -0,0 +1,217 @@ +#include "MipMapGen.h" +#include "MipMap.h" +#include + +static StaticMutex LevelsMutex; +static Vector Levels; +static Vector ZoomLevels; + +bool CalcLevel(Image& img, int& step, int blocks, int zoomLevel, const String& dir, Progress& p, + const Size& totalSize, int cx, int cy, double zx); +void CalcCount(Image& img, int cx, int cy, int& step); +int GetScalesTotal(Image& img, const Size& sz, double zoom); +int GetBlocksTotal(Image& img, const Size& sz, const Size& cellSize, double zoom); +Size GetScaledSize(Image& img, const Size& sz, double zoom, int level); +Image GetScaledMap(Image& img, const Size& sz); +Image GetScaledMap(Image& img, const Size& sz, double zoom, int level); + +bool Calculate(int cx, int cy, int px, int py, double zx, const String& name, Image& img) +{ + Mutex::Lock __(LevelsMutex); + + Levels.Clear(); + ZoomLevels.Clear(); + + // getting data + Size sz = Size(cx, cy); + Size ps = Size(px, py); + + // preparing directory + String dir = AppendFileName( AppendFileName(GetFileDirectory(GetExeFilePath()), "Mipmaps"), + name); + RemoveDirectory(dir); + RealizeDirectory(dir); + + String xmlFile = AppendFileName( + AppendFileName(GetFileDirectory(GetExeFilePath()), "Mipmaps"), + name + ".xml"); + + String zoomFile = AppendFileName( + AppendFileName(GetFileDirectory(GetExeFilePath()), "Mipmaps"), + name.ToString() + ".zoom"); + + FileDelete(xmlFile); + FileDelete(zoomFile); + + // generating first level + Levels.Clear(); + + int blocks = GetBlocksTotal(img, ps, sz, zx); + int total = GetScalesTotal(img, ps, zx); + int count = 0; + + Progress p; + p.Create(); + + Size last = Null; + for (int i = 0; i < total - 1; ++i) + { + Image scaledMap = GetScaledMap(img, ps, zx, i + 1); + + if (i == total - 2) + last = scaledMap.GetSize(); + if (!CalcLevel(scaledMap, count, blocks, i, dir, p, scaledMap.GetSize(), cx, cy, + (i == total - 1) ? 1.0 : zx)) + break; + } + + if (!IsNull(last)) + CalcLevel(img, count, blocks, total - 1, dir, p, img.GetSize(), cx, cy, + (double)img.GetSize().cx / last.cx); + p.Close(); + + if (!StoreAsXMLFile(Levels, "levels", xmlFile)) + { + Exclamation("Ошибка при сохранении XML-файла карты!"); + return false; + } + + if (!StoreAsXMLFile(ZoomLevels, "zoomLevels", zoomFile)) + { + Exclamation("Ошибка при сохранении XML-файла значений zoom!"); + return false; + } + + return true; +} + +bool CalcLevel(Image& img, int& step, int blocks, int zoomLevel, const String& dir, Progress& p, + const Size& totalSize, int cx, int cy, double zx) +{ + Size sz = Size(cx, cy); + + double ratio = (double)img.GetSize().cx / img.GetSize().cy; + int xt = img.GetSize().cx / cx + (img.GetSize().cx % cx ? 1 : 0); + int yt = img.GetSize().cy / cy + (img.GetSize().cy % cy ? 1 : 0); + + MipMapLevel level; + level + .TotalCX(xt).TotalCY(yt).BlockCX(cx).BlockCY(cy).ZoomDX(zx) + .TotalSizeCX(totalSize.cx) + .TotalSizeCY(totalSize.cy); + + ZoomLevels.Add(MapZoomLevel(zx)); + + int count = 0; + for (int i = 0; i < xt; ++i) + for (int j = 0; j < yt; ++j) + { + p.Title(NFormat("Блок %d из %d [%d, %d]", step + 1, blocks, cx, cy)); + + ImageBuffer ib(cx, cy); + BufferPainter sw(ib); + sw.DrawRect(ib.GetSize(), White()); + sw.DrawImage(ib.GetSize(), img, Rect(Point(i * cx, j * cy), ib.GetSize())); + + PNGEncoder en; + if (!en.SaveFile(AppendFileName(dir, NFormat("%d-%d-%d.png", zoomLevel, + i * cx, j * cy)), Rescale(ib, sz, ib.GetSize()))) + { + Exclamation("Ошибка при сохранении MipMap-изображения!"); + return false; + } + + level.AddMipMap( Point(i * cx, j * cy), new MipMapItem() ); + p.Set(step++, blocks); + } + + // xml part + Levels.Add(level); + return true; +} + +void CalcCount(Image& img, int cx, int cy, int& step) +{ + Size sz = img.GetSize(); + int xt = sz.cx / cx + (sz.cx % cx ? 1 : 0); + int yt = sz.cy / cy + (sz.cy % cy ? 1 : 0); + + for (int i = 0; i < xt; ++i) + for (int j = 0; j < yt; ++j) + { + step++; + } +} + +Image GetScaledMap(Image& img, const Size& sz) +{ + double scale = min((double)sz.cx / img.GetSize().cx, (double)sz.cy / img.GetSize().cy); + return Rescale(img, img.GetSize() * scale, img.GetSize()); +} + +Image GetScaledMap(Image& img, const Size& sz, double zoom, int level) +{ + return Rescale(img, GetScaledSize(img, sz, zoom, level), img.GetSize()); +} + +Size GetScaledSize(Image& img, const Size& sz, double zoom, int level) +{ + if (!level) return sz; + + double scale = min((double)sz.cx / img.GetSize().cx, (double)sz.cy / img.GetSize().cy); + Size mapSize = img.GetSize() * scale; + double ratio = (double)img.GetSize().cx / img.GetSize().cy; + double w = (double)mapSize.cx; + + for (int i = 1; i < level; ++i) + w *= zoom; + + if (w > img.GetSize().cx || w / ratio > img.GetSize().cy) + return img.GetSize(); + + return Size(fabs(w), fabs(w / ratio)); +} + +int GetScalesTotal(Image& img, const Size& sz, double zoom) +{ + int totalCount = 0; + Size check(0, 0); + for(;;) + { + Size scaledSize = GetScaledSize(img, sz, zoom, totalCount + 1); + + bool found = false; + if (check == Size(0, 0)) + check = scaledSize; + else + { + if (check == scaledSize) + found = true; + else + check = scaledSize; + } + + if (found) + break; + + totalCount++; + } + + return totalCount; +} + +int GetBlocksTotal(Image& img, const Size& sz, const Size& cellSize, double zoom) +{ + int total = GetScalesTotal(img, sz, zoom); + int count = 0; + + for (int i = 0; i < total - 1; ++i) + { + Image scaledMap = GetScaledMap(img, sz, zoom, i + 1); + if (i < total - 1) + CalcCount(scaledMap, cellSize.cx, cellSize.cy, count); + if (i == total - 1) + CalcCount(img, cellSize.cx, cellSize.cy, count); + } + return count; +} diff --git a/bazaar/MapBG/MipMapGen.h b/bazaar/MapBG/MipMapGen.h new file mode 100644 index 000000000..c29fc295d --- /dev/null +++ b/bazaar/MapBG/MipMapGen.h @@ -0,0 +1,9 @@ +#ifndef MAP_BG__MIP_MAP_GEN_H +#define MAP_BG__MIP_MAP_GEN_H + +#include +using namespace Upp; + +bool Calculate(int cx, int cy, int px, int py, double zx, const String& name, Image& img); + +#endif diff --git a/bazaar/MapBG/init b/bazaar/MapBG/init new file mode 100644 index 000000000..54fa1a907 --- /dev/null +++ b/bazaar/MapBG/init @@ -0,0 +1,6 @@ +#ifndef _MapBG_icpp_init_stub +#define _MapBG_icpp_init_stub +#include "Painter/init" +#include "CtrlLib/init" +#include "MapCommon/init" +#endif diff --git a/bazaar/MapCommon/ButtonItem.cpp b/bazaar/MapCommon/ButtonItem.cpp new file mode 100644 index 000000000..1b5e56887 --- /dev/null +++ b/bazaar/MapCommon/ButtonItem.cpp @@ -0,0 +1,51 @@ +#include "ButtonItem.h" +#include "IMapRender.h" + +ButtonItem::ButtonItem(IMapRender* render) + : IMapItem(render), _pos(Null) +{} + +Rect ButtonItem::GetRect() +{ + return Rect(); +} + +Point ButtonItem::GetCenter() +{ + return GetRect().CenterPoint(); +} + +bool ButtonItem::Contains(const Point& p) +{ + if (!GetParent() || !GetTopRender()) + return false; + Point pos = GetTopRender()->ViewToScene(_pos == Null ? GetParent()->GetTopLeft() : _pos); + Rect r = Rect(Point(pos.x - _icon.GetSize().cx / 2 - 5, pos.y - _icon.GetSize().cy / 2 - 5), + _icon.GetSize() + Size(10, 10)); + return r.Contains(GetTopRender()->ViewToScene(p)); +} + +void ButtonItem::Render(Draw* w) +{ + if (!GetParent() || !GetTopRender()) + return; + if (!GetParent()->IsState(STATE_SELECTED)) + return; + LOG("Render"); + Point p = GetTopRender()->ViewToScene(_pos == Null ? GetParent()->GetTopLeft() : _pos); + w->DrawImage(p.x - _icon.GetSize().cx / 2, p.y - _icon.GetSize().cy / 2, _icon); +} + +ButtonItem* ButtonItem::SetIcon(const Image& icon) +{ + _icon = icon; + GetTopRender()->RefreshView(); + return this; +} + +ButtonItem* ButtonItem::SetPos(const Point& pos) +{ + _pos = pos; + GetTopRender()->RefreshView(); + return this; +} diff --git a/bazaar/MapCommon/ButtonItem.h b/bazaar/MapCommon/ButtonItem.h new file mode 100644 index 000000000..e126867f7 --- /dev/null +++ b/bazaar/MapCommon/ButtonItem.h @@ -0,0 +1,32 @@ +#ifndef MAP_COMMON__ICON_ITEM_H +#define MAP_COMMON__ICON_ITEM_H + +#include "IMapItem.h" + +class ButtonItem : public IMapItem +{ +public: + ButtonItem(IMapRender* render); + virtual ~ButtonItem() {} + + virtual void Render(Draw* w); + + virtual bool ProcessLeftDown(Point p, dword keyflags); + + virtual void StatePerformed (dword state, const String& param = String()); + virtual bool Contains(const Point& p); + virtual Point GetCenter(); + virtual Rect GetRect(); + + virtual String GetItemType() { return "ButtonItem"; } + +public: + virtual ButtonItem* SetIcon(const Image& icon); + virtual ButtonItem* SetPos(const Point& pos); + +private: + Image _icon; + Point _pos; +}; + +#endif diff --git a/bazaar/MapCommon/ButtonItemEvents.cpp b/bazaar/MapCommon/ButtonItemEvents.cpp new file mode 100644 index 000000000..abe1a3000 --- /dev/null +++ b/bazaar/MapCommon/ButtonItemEvents.cpp @@ -0,0 +1,18 @@ +#include "ButtonItem.h" +#include "IMapRender.h" + +void ButtonItem::StatePerformed(dword state, const String& param) +{ +} + +bool ButtonItem::ProcessLeftDown(Point p, dword keyflags) +{ + if (Contains(p)) + { + if (GetParent() && GetParent()->IsState(STATE_SELECTED)) + PromptOK("Getted!"); + return true; + } + + return false; +} diff --git a/bazaar/MapCommon/IMapEvent.h b/bazaar/MapCommon/IMapEvent.h new file mode 100644 index 000000000..6dd6b2030 --- /dev/null +++ b/bazaar/MapCommon/IMapEvent.h @@ -0,0 +1,28 @@ +#ifndef MAP_COMMON__I_MAP_EVENT_H +#define MAP_COMMON__I_MAP_EVENT_H + +#include +using namespace Upp; + +class IMapEvent +{ +public: + virtual ~IMapEvent() {} + + virtual bool ProcessLeftDouble (Point p, dword keyflags) { return false; } + virtual bool ProcessLeftDown (Point p, dword keyflags) { return false; } + virtual bool ProcessLeftDrag (Point p, dword keyflags) { return false; } + virtual bool ProcessLeftUp (Point p, dword keyflags) { return false; } + + virtual bool ProcessRightDouble(Point p, dword keyflags) { return false; } + virtual bool ProcessRightDown (Point p, dword keyflags) { return false; } + virtual bool ProcessRightDrag (Point p, dword keyflags) { return false; } + virtual bool ProcessRightUp (Point p, dword keyflags) { return false; } + + virtual bool ProcessMouseMove (Point p, dword keyflags) { return false; } + + virtual bool ProcessMouseEnter() { return false; } + virtual bool ProcessMouseLeave() { return false; } +}; + +#endif diff --git a/bazaar/MapCommon/IMapItem.cpp b/bazaar/MapCommon/IMapItem.cpp new file mode 100644 index 000000000..c62870147 --- /dev/null +++ b/bazaar/MapCommon/IMapItem.cpp @@ -0,0 +1,34 @@ +#include "IMapItem.h" +#include "IMapRender.h" + +Vector > IMapItem::_globalItemList; + +IMapItem::IMapItem(IMapRender* parent) +{ + IMapItem::RegisterInGlobalList(this); + StateOn(STATE_SHOWN); + + _topRender = NULL; + _parent = parent; + + if (_parent && _parent->GetTopRender()) + _topRender = _parent->GetTopRender(); +} + +void IMapItem::RegisterInGlobalList(Ptr item) +{ + _globalItemList.Add(item); +} + +void IMapItem::UnregisterFromGlobalList(Ptr item) +{ + for (int i = _globalItemList.GetCount() - 1; i >= 0; --i) + if (_globalItemList[i] == item) + _globalItemList.Remove(i); +} + +double IMapItem::GetOpacity() { return GetParent()->GetOpacity(); } +dword IMapItem::GetQuality() { return GetParent()->GetQuality(); } +Color IMapItem::GetClearColor() { return GetParent()->GetClearColor(); } +dword IMapItem::GetRenderType() { return GetParent()->GetRenderType(); } +Rect IMapItem::GetRenderRect() { return GetParent()->GetRenderRect(); } \ No newline at end of file diff --git a/bazaar/MapCommon/IMapItem.h b/bazaar/MapCommon/IMapItem.h new file mode 100644 index 000000000..6841153d7 --- /dev/null +++ b/bazaar/MapCommon/IMapItem.h @@ -0,0 +1,84 @@ +#ifndef MAP_COMMON__I_MAP_ITEM_H +#define MAP_COMMON__I_MAP_ITEM_H + +#include "IMapEvent.h" +#include + +enum +{ + STATE_SHOWN, + STATE_SELECTED, + STATE_FOUND, + STATE_EDIT, + + PERFORM_INIT, + PERFORM_UPDATE, + PERFORM_RELEASE, + PERFORM_SEARCH +}; + +class IMapRender; +class IMapItem : public Pte, public IMapEvent +{ +public: + IMapItem(IMapRender* parent); + virtual ~IMapItem() { Clear(); } + + virtual void Render(Painter* w) { Render((Draw*)w); } + virtual void Render(Draw* w) = 0; + + virtual bool Contains(const Point& p) { return GetRect().Contains(p); } + virtual Point GetTopLeft() { return GetRect().TopLeft(); } + virtual Point GetCenter() { return GetRect().CenterPoint(); } + virtual Rect GetRect() = 0; + virtual void Clear() {} + virtual Rect GetRenderRect(); + + virtual void StatePerformed (dword state, const String& param = String()) {} + virtual void StateChanged (dword state) {} + virtual void StateOff (dword state); + virtual void StateOn (dword state); + virtual bool IsState (dword state); + virtual void PerformState (dword state, const String& param = String()); + + static void StatesPerformed(dword state, const String& param = String()); + static void StatesChanged (dword state); + static void StatesOff (dword state); + static void StatesOn (dword state); + static bool IsAnyState (dword state); + static void PerformStates (dword state, const String& param = String()); + +public: + bool IsShown() { return IsState(STATE_SHOWN); } + bool IsFound() { return IsState(STATE_FOUND); } + bool IsSelected() { return IsState(STATE_SELECTED); } + + void SetParent(Ptr parent) { _parent = parent; } + IMapRender* GetParent() { return _parent; } + + void SetTopRender(Ptr render) { _topRender = render; } + IMapRender* GetTopRender() { return _topRender; } + + virtual String GetItemType() = 0; + + virtual double GetOpacity(); + virtual dword GetQuality(); + virtual Color GetClearColor(); + virtual dword GetRenderType(); + + virtual Vector >& GetItems() { return _globalItemList; } + const virtual Vector >& GetItems() const { return _globalItemList; } + +protected: + static void RegisterInGlobalList(Ptr item); + static void UnregisterFromGlobalList(Ptr item); + +private: + IMapRender* _topRender; + IMapRender* _parent; + + Vector _states; + static Vector > _globalItemList; +}; + +#endif diff --git a/bazaar/MapCommon/IMapItemState.cpp b/bazaar/MapCommon/IMapItemState.cpp new file mode 100644 index 000000000..10a7c5c96 --- /dev/null +++ b/bazaar/MapCommon/IMapItemState.cpp @@ -0,0 +1,81 @@ +#include "IMapItem.h" +#include "IMapRender.h" + +void IMapItem::PerformState(dword state, const String& param) +{ + StatesPerformed(state, param); +} + +void IMapItem::StateOff(dword state) +{ + for (int i = 0; i < _states.GetCount(); ++i) + if (_states[i] == state) + { + _states.Remove(i); + StateChanged(state); + return; + } +} + +void IMapItem::StateOn(dword state) +{ + for (int i = 0; i < _states.GetCount(); ++i) + if (_states[i] == state) + return; + _states.Add(state); + StateChanged(state); +} + +bool IMapItem::IsState(dword state) +{ + for (int i = 0; i < _states.GetCount(); ++i) + if (_states[i] == state) + return true; + return false; +} + +void IMapItem::PerformStates(dword state, const String& param) +{ + for (int i = 0; i < _globalItemList.GetCount(); ++i) + if (_globalItemList[i]) + _globalItemList[i]->PerformState(state, param); +} + +void IMapItem::StatesOff(dword state) +{ + for (int i = 0; i < _globalItemList.GetCount(); ++i) + if (_globalItemList[i]) + _globalItemList[i]->StateOff(state); +} + +void IMapItem::StatesOn(dword state) +{ + for (int i = 0; i < _globalItemList.GetCount(); ++i) + if (_globalItemList[i]) + _globalItemList[i]->StateOn(state); +} + +bool IMapItem::IsAnyState(dword state) +{ + for (int i = 0; i < _globalItemList.GetCount(); ++i) + if (_globalItemList[i]) + { + if (_globalItemList[i]->IsState(state)) + return true; + } + return false; +} + +void IMapItem::StatesChanged(dword state) +{ + for (int i = 0; i < _globalItemList.GetCount(); ++i) + if (_globalItemList[i]) + _globalItemList[i]->StateChanged(state); +} + +void IMapItem::StatesPerformed(dword state, const String& param) +{ + for (int i = 0; i < _globalItemList.GetCount(); ++i) + if (_globalItemList[i]) + _globalItemList[i]->StatePerformed(state, param); +} diff --git a/bazaar/MapCommon/IMapRender.cpp b/bazaar/MapCommon/IMapRender.cpp new file mode 100644 index 000000000..0be695774 --- /dev/null +++ b/bazaar/MapCommon/IMapRender.cpp @@ -0,0 +1,121 @@ +#include "IMapRender.h" + +IMapRender::IMapRender(IMapRender* render) + : IMapItem(render), _renderType(RENDER_DRAW), _quality(MODE_NOAA), _opacity(-1), + _clearColor(RGBAZero()) +{} + +void IMapRender::Clear() +{ + for (int i = 0; i < _items.GetCount(); ++i) + if (_items[i]) + delete _items[i]; + _items.Clear(); +} + +void IMapRender::Render(Draw* w) +{ + if (!w || !IsShown()) + return; + +/* Rect r = GetRenderRect(); + Size rsz = r.GetSize(); + Size vsz = CurrentSceneSize(); + int px = 0; + int py = 0; + + if (rsz.cx > vsz.cx) + rsz.cx = vsz.cx; + else + px = r.TopLeft().x; + + if (rsz.cy > vsz.cy) + rsz.cy = vsz.cy; + else + py = r.TopLeft().y;*/ + + Size rsz = GetPageRect().GetSize(); + + if (_renderType == RENDER_PAINTER) + { + ImageBuffer ib(rsz); + BufferPainter sw(ib, _quality); + sw.Clear(_clearColor); +// if (_opacity >= 0) +// sw.Opacity(_opacity); + sw.Opacity(0.5); + + RenderItems(&sw); + w->DrawImage(0, 0, ib); + } + else + RenderItems(w); +} + +void IMapRender::RenderItems(Draw* w) +{ + Rect view = CurrentViewRect(); + Vector selected; + + for (int i = 0; i < _items.GetCount(); ++i) + { + if (!_items[i] || !_items[i]->IsShown()) + continue; + + if (!view.Intersects(_items[i]->GetRect())) + continue; + + if (_items[i]->IsSelected()) + { + selected << i; + continue; + } + + _items[i]->Render(w); + } + + for (int i = 0; i < selected.GetCount(); ++i) + { + _items[selected[i]]->Render(w); + } +} + +IMapRender* IMapRender::Antialiased(bool use, bool subpixel) +{ + _quality = use ? (use + subpixel) : 0; + _renderType = RENDER_PAINTER; + return this; +} + +IMapRender* IMapRender::Subpixel() +{ + _renderType = RENDER_PAINTER; + _quality = MODE_SUBPIXEL; + return this; +} + +IMapRender* IMapRender::NoAA() +{ + _renderType = RENDER_DRAW; + _quality = MODE_NOAA; + return this; +} + +Rect IMapRender::GetRect() +{ + Point rb = Point(INT_MAX, INT_MAX); + Point lt = Point(-1, -1); + + for (int i = 0; i < _items.GetCount(); i++) + { + Rect r = _items[i]->GetRect(); + + lt.x = min(r.TopLeft().x, lt.x); + lt.y = min(r.TopLeft().y, lt.y); + + rb.x = max(r.BottomRight().x, rb.x); + rb.y = max(r.BottomRight().y, rb.y); + } + + return Rect(lt, rb); +} diff --git a/bazaar/MapCommon/IMapRender.h b/bazaar/MapCommon/IMapRender.h new file mode 100644 index 000000000..90581be61 --- /dev/null +++ b/bazaar/MapCommon/IMapRender.h @@ -0,0 +1,118 @@ +#ifndef MAP_COMMON__I_MAP_RENDER_H +#define MAP_COMMON__I_MAP_RENDER_H + +#include "IMapItem.h" +#include "IMapRenderInfo.h" + +class IMapRender : public IMapItem, public IMapRenderInfo +{ +public: + IMapRender(IMapRender* render); + virtual ~IMapRender() { Clear(); } + + virtual void RenderItems(Draw* w); + virtual void Render(Draw* w); + + virtual Rect GetPageRect() { return GetTopRender() ? GetTopRender()->GetPageRect() : Null; } + virtual Point GetPageOffset() { return GetTopRender() ? GetTopRender()->GetPageOffset() : Null; } + virtual Rect GetRenderRect() { return GetTopRender() ? GetTopRender()->GetRenderRect() : Null; } + + virtual void RefreshView() { if (GetTopRender()) GetTopRender()->RefreshView(); } + + virtual bool Load(const char* fp) { return false; } + virtual bool Zoom(int level) { return false; } + virtual Rect GetRect(); + + virtual double GetZoom(int i) { return GetTopRender() ? GetTopRender()->GetZoom(i) : 1.0; } + virtual int GetZoomCount() { return GetTopRender() ? GetTopRender()->GetZoomCount() : 0; } + virtual int GetCurrentZoom() { return GetTopRender() ? GetTopRender()->GetCurrentZoom() : 0; } + + virtual String GetItemType() { return "IMapRender"; } + + IMapRender* Antialiased(bool use = true, bool subpixel = false); + IMapRender* Subpixel(); + IMapRender* NoAA(); + + IMapRender* ClearColor(const Color& c) { _clearColor = c; return this; } + IMapRender* Opacity(double value) { _opacity = value; return this; } + virtual void Clear(); + + virtual double GetOpacity() { return _opacity; } + virtual dword GetQuality() { return _quality; } + virtual Color GetClearColor() { return _clearColor; } + virtual dword GetRenderType() { return _renderType; } + + virtual Point SceneToView(const Point& p) { return GetTopRender() ? GetTopRender()->SceneToView(p) : p; } + virtual Size SceneToView(const Size& sz) { return GetTopRender() ? GetTopRender()->SceneToView(sz) : sz; } + virtual Rect SceneToView(const Rect& rt) { return GetTopRender() ? GetTopRender()->SceneToView(rt) : rt; } + virtual Array SceneToView(const Array& p) { return GetTopRender() ? GetTopRender()->SceneToView(p) : p; } + virtual Vector SceneToView(const Vector& p) { return GetTopRender() ? GetTopRender()->SceneToView(p) : p; } + + virtual Point ViewToScene(const Point& p) { return GetTopRender() ? GetTopRender()->ViewToScene(p) : p; } + virtual Size ViewToScene(const Size& sz) { return GetTopRender() ? GetTopRender()->ViewToScene(sz) : sz; } + virtual Rect ViewToScene(const Rect& rt) { return GetTopRender() ? GetTopRender()->ViewToScene(rt) : rt; } + virtual Array ViewToScene(const Array& p) { return GetTopRender() ? GetTopRender()->ViewToScene(p) : p; } + virtual Vector ViewToScene(const Vector& p) { return GetTopRender() ? GetTopRender()->ViewToScene(p) : p; } + + virtual Rect CurrentViewRect() { return GetTopRender() ? GetTopRender()->CurrentViewRect() : GetRect(); } + virtual Rect CurrentViewSize() { return CurrentViewRect().GetSize(); } + virtual Rect CurrentSceneRect() { return GetTopRender() ? GetTopRender()->CurrentSceneRect() : GetRect(); } + virtual Size CurrentSceneSize() { return CurrentSceneRect().GetSize(); } + + template + Ptr AddItem() { T* t = new T(this); _items.Add(t); return t; } + virtual Vector >& GetItems() { return _items; } + const virtual Vector >& GetItems() const { return _items; } + +public: + virtual void StateOff(dword state); + virtual void StateOn (dword state); + virtual bool IsState (dword state); + virtual void PerformState(dword state, const String& param = String()); + +public: + virtual bool ProcessLeftDouble (Point p, dword keyflags); + virtual bool ProcessLeftDown (Point p, dword keyflags); + virtual bool ProcessLeftDrag (Point p, dword keyflags); + virtual bool ProcessLeftUp (Point p, dword keyflags); + + virtual bool ProcessRightDouble(Point p, dword keyflags); + virtual bool ProcessRightDown (Point p, dword keyflags); + virtual bool ProcessRightDrag (Point p, dword keyflags); + virtual bool ProcessRightUp (Point p, dword keyflags); + + virtual bool ProcessMouseMove (Point p, dword keyflags); + + virtual bool ProcessMouseEnter(); + virtual bool ProcessMouseLeave(); + +protected: + dword _renderType; + dword _quality; + double _opacity; + Color _clearColor; + Vector > _items; + enum { RENDER_DRAW, RENDER_PAINTER }; +}; + +#define ZOOM_FUNCTIONS_DECLARE(Type) \ +inline Type ViewToScene(Ptr item, const Type& p) \ +{ \ + if (!item) return p; \ + if ( item->GetTopRender() == NULL) return p; \ + return item->GetTopRender()->ViewToScene(p); \ +} \ +inline Type SceneToView(Ptr item, const Type& p) \ +{ \ + if (!item) return p; \ + if ( item->GetTopRender() == NULL) return p; \ + return item->GetTopRender()->SceneToView(p); \ +} + +ZOOM_FUNCTIONS_DECLARE(Point); +ZOOM_FUNCTIONS_DECLARE(Size); +ZOOM_FUNCTIONS_DECLARE(Rect); +ZOOM_FUNCTIONS_DECLARE(Array); +ZOOM_FUNCTIONS_DECLARE(Vector); + +#endif diff --git a/bazaar/MapCommon/IMapRenderEvents.cpp b/bazaar/MapCommon/IMapRenderEvents.cpp new file mode 100644 index 000000000..08278d675 --- /dev/null +++ b/bazaar/MapCommon/IMapRenderEvents.cpp @@ -0,0 +1,133 @@ +#include "IMapRender.h" + +bool IMapRender::ProcessLeftDouble(Point p, dword keyflags) +{ + for (int i = 0; i < _items.GetCount(); ++i) + if (_items[i] && _items[i]->IsShown()) + { + if (_items[i]->ProcessLeftDouble(p, keyflags)) + return true; + } + + return false; +} + +bool IMapRender::ProcessLeftDown(Point p, dword keyflags) +{ + for (int i = 0; i < _items.GetCount(); ++i) + if (_items[i] && _items[i]->IsShown()) + { + if (_items[i]->ProcessLeftDown(p, keyflags)) + return true; + } + + return false; +} + +bool IMapRender::ProcessLeftDrag(Point p, dword keyflags) +{ + for (int i = 0; i < _items.GetCount(); ++i) + if (_items[i] && _items[i]->IsShown()) + { + if (_items[i]->ProcessLeftDrag(p, keyflags)) + return true; + } + + return false; +} + +bool IMapRender::ProcessLeftUp(Point p, dword keyflags) +{ + for (int i = 0; i < _items.GetCount(); ++i) + if (_items[i] && _items[i]->IsShown()) + { + if (_items[i]->ProcessLeftUp(p, keyflags)) + return true; + } + + return false; +} + +bool IMapRender::ProcessRightDouble(Point p, dword keyflags) +{ + for (int i = 0; i < _items.GetCount(); ++i) + if (_items[i] && _items[i]->IsShown()) + { + if (_items[i]->ProcessRightDouble(p, keyflags)) + return true; + } + + return false; +} + +bool IMapRender::ProcessRightDown(Point p, dword keyflags) +{ + for (int i = 0; i < _items.GetCount(); ++i) + if (_items[i] && _items[i]->IsShown()) + { + if (_items[i]->ProcessRightDown(p, keyflags)) + return true; + } + + return false; +} + +bool IMapRender::ProcessRightDrag(Point p, dword keyflags) +{ + for (int i = 0; i < _items.GetCount(); ++i) + if (_items[i] && _items[i]->IsShown()) + { + if (_items[i]->ProcessRightDrag(p, keyflags)) + return true; + } + + return false; +} + +bool IMapRender::ProcessRightUp(Point p, dword keyflags) +{ + for (int i = 0; i < _items.GetCount(); ++i) + if (_items[i] && _items[i]->IsShown()) + { + if (_items[i]->ProcessRightUp(p, keyflags)) + return true; + } + + return false; +} + +bool IMapRender::ProcessMouseMove(Point p, dword keyflags) +{ + for (int i = 0; i < _items.GetCount(); ++i) + if (_items[i] && _items[i]->IsShown()) + { + if (_items[i]->ProcessMouseMove(p, keyflags)) + return true; + } + + return false; +} + +bool IMapRender::ProcessMouseEnter() +{ + for (int i = 0; i < _items.GetCount(); ++i) + if (_items[i] && _items[i]->IsShown()) + { + if (_items[i]->ProcessMouseEnter()) + return true; + } + + return false; +} + +bool IMapRender::ProcessMouseLeave() +{ + for (int i = 0; i < _items.GetCount(); ++i) + if (_items[i] && _items[i]->IsShown()) + { + if (_items[i]->ProcessMouseLeave()) + return true; + } + + return false; +} diff --git a/bazaar/MapCommon/IMapRenderInfo.h b/bazaar/MapCommon/IMapRenderInfo.h new file mode 100644 index 000000000..87e581162 --- /dev/null +++ b/bazaar/MapCommon/IMapRenderInfo.h @@ -0,0 +1,27 @@ +#ifndef MAP_COMMON__I_MAP_RENDER_INFO_H +#define MAP_COMMON__I_MAP_RENDER_INFO_H + +#include +#include +using namespace Upp; + +class IMapRenderInfo +{ +public: + virtual ~IMapRenderInfo() {} + + virtual void RenderInfo(Painter* w) { RenderInfo((Draw*)w); } + virtual void RenderInfo(Draw* w) {} + + virtual Point GetRenderCenter() { return GetRenderRect().CenterPoint(); } + virtual Size GetRenderSize() { return GetRenderRect().GetSize(); } + virtual Rect GetRenderRect() = 0; + + virtual Point GetPageCenter() { return GetPageRect().CenterPoint(); } + virtual Point GetPageOffset() = 0; + virtual Size GetPageSize() { return GetPageRect().GetSize(); } + virtual Rect GetPageRect() = 0; + virtual Point GetPagePos() { return GetPageRect().TopLeft(); } +}; + +#endif diff --git a/bazaar/MapCommon/IMapRenderStates.cpp b/bazaar/MapCommon/IMapRenderStates.cpp new file mode 100644 index 000000000..4110d01ce --- /dev/null +++ b/bazaar/MapCommon/IMapRenderStates.cpp @@ -0,0 +1,30 @@ +#include "IMapRender.h" + +void IMapRender::StateOff(dword state) +{ + IMapItem::StateOff(state); + for (int i = 0; i < _items.GetCount(); ++i) + if (_items[i]) + _items[i]->StateOff(state); +} + +void IMapRender::StateOn (dword state) +{ + IMapItem::StateOn(state); + for (int i = 0; i < _items.GetCount(); ++i) + if (_items[i]) + _items[i]->StateOn(state); +} + +bool IMapRender::IsState (dword state) +{ + return IMapItem::IsState(state); +} + +void IMapRender::PerformState(dword state, const String& param) +{ + IMapItem::PerformState(state, param); + for (int i = 0; i < _items.GetCount(); ++i) + if (_items[i]) + _items[i]->PerformState(state, param); +} diff --git a/bazaar/MapCommon/MapCommon.h b/bazaar/MapCommon/MapCommon.h new file mode 100644 index 000000000..4ead10e93 --- /dev/null +++ b/bazaar/MapCommon/MapCommon.h @@ -0,0 +1,9 @@ +#ifndef MAP_COMMON__MAP_COMMON_H +#define MAP_COMMON__MAP_COMMON_H + +#include "IMapRender.h" + +#include "ButtonItem.h" +#include "PolygonItem.h" + +#endif diff --git a/bazaar/MapCommon/MapCommon.upp b/bazaar/MapCommon/MapCommon.upp new file mode 100644 index 000000000..4d23fe35e --- /dev/null +++ b/bazaar/MapCommon/MapCommon.upp @@ -0,0 +1,25 @@ +uses + CtrlLib, + Painter; + +file + MapCommon.h, + Item readonly separator, + IMapEvent.h, + IMapItem.h, + IMapItem.cpp, + IMapItemState.cpp, + Render readonly separator, + IMapRenderInfo.h, + IMapRender.h, + IMapRender.cpp, + IMapRenderStates.cpp, + IMapRenderEvents.cpp, + "Basic Entities" readonly separator, + PolygonItem.h, + PolygonItem.cpp, + PolygonItemEvents.cpp, + ButtonItem.h, + ButtonItem.cpp, + ButtonItemEvents.cpp; + diff --git a/bazaar/MapCommon/PolygonItem.cpp b/bazaar/MapCommon/PolygonItem.cpp new file mode 100644 index 000000000..4d94f8c2e --- /dev/null +++ b/bazaar/MapCommon/PolygonItem.cpp @@ -0,0 +1,126 @@ +#include "PolygonItem.h" +#include "IMapRender.h" + +bool IsPointInsidePolygon(const Array& p, Point s) +{ + int i, j; + bool parity = false; + for (i = 0, j = p.GetCount() - 1; i < p.GetCount(); j = i++) + { + if ( ( p[i].y < s.y && s.y <= p[j].y || p[j].y < s.y && s.y <= p[i].y ) + && (s.x > (p[j].x - p[i].x) * (s.y - p[i].y) / (p[j].y - p[i].y) + p[i].x)) + parity = !parity; + } + return parity; +} + +Rect RectOfFigure(const Array& p) +{ + if (!p.GetCount()) + return Null; + + Point s = Point(INT_MAX, INT_MAX); + Point e = Point(-1, -1); + + for (int i = 0; i < p.GetCount(); i++) + { + s.x = min(p[i].x, s.x); + s.y = min(p[i].y, s.y); + + e.x = max(p[i].x, e.x); + e.y = max(p[i].y, e.y); + } + + return Rect(s, e); +} + +Point CenterOfFigure(const Array& p) +{ + return RectOfFigure(p).CenterPoint(); +} + +Point TopLeftOfFigure(const Array& p) +{ + if (!p.GetCount()) + return Null; + + Point s = p[0]; + + for (int i = 1; i < p.GetCount(); i++) + { + if (s.x > p[i].x && s.y > p[i].y) + s = p[i]; + } + + return s; +} + +PolygonItem::PolygonItem(IMapRender* render) + : IMapItem(render), _display(new PolygonItemDisplay()), _stdDisplay(true) +{ +} + +Callback1 > PolygonItem::WhenClick; + +PolygonItem::~PolygonItem() +{ + if (_stdDisplay && _display) + delete _display; +} + +PolygonItem* PolygonItem::SetDisplay(PolygonItemDisplay* disp) +{ + if (_stdDisplay && _display) + delete _display; + _display = disp; + return this; +} + +Rect PolygonItem::GetRect() +{ + return RectOfFigure(GetVertices()); +} + +Point PolygonItem::GetCenter() +{ + return CenterOfFigure(GetVertices()); +} + +Point PolygonItem::GetTopLeft() +{ + return TopLeftOfFigure(GetVertices()); +} + +bool PolygonItem::Contains(const Point& p) +{ + return IsPointInsidePolygon(GetVertices(), p); +} + +void PolygonItem::Render(Draw* w) +{ + _display->Paint(w, this); +} + +void PolygonItemDisplay::Paint(Draw* w, PolygonItem* item) const +{ + if (!item->GetTopRender()) + return; + + Vector points; + for (int i = 0; i < item->GetVertices().GetCount(); ++i) + points << item->GetTopRender()->ViewToScene(item->GetVertices()[i]); + + if (item->IsFound()) + { + w->DrawPolygon(points, + item->IsSelected() + ? Yellow() + : LtRed(), 1, Black()); + } + + else if (item->IsSelected() && !item->IsFound()) + w->DrawPolygon(points, Yellow(), 1, Black()); + + else if (item->IsState(STATE_EDIT)) + w->DrawPolygon(points, Green(), 1, Black()); +} diff --git a/bazaar/MapCommon/PolygonItem.h b/bazaar/MapCommon/PolygonItem.h new file mode 100644 index 000000000..00017b68d --- /dev/null +++ b/bazaar/MapCommon/PolygonItem.h @@ -0,0 +1,45 @@ +#ifndef MAP_COMMON__POLYGON_ITEM_H +#define MAP_COMMON__POLYGON_ITEM_H + +#include "IMapRender.h" +#include + +class PolygonItemDisplay; + +class PolygonItem : public IMapItem, public Room +{ +public: + PolygonItem(IMapRender* render); + virtual ~PolygonItem(); + + virtual void Render(Draw* w); + + virtual bool ProcessLeftDown(Point p, dword keyflags); + virtual bool ProcessLeftUp(Point p, dword keyflags); + + virtual void StatePerformed (dword state, const String& param = String()); + virtual bool Contains(const Point& p); + virtual Point GetTopLeft(); + virtual Point GetCenter(); + virtual Rect GetRect(); + + virtual String GetItemType() { return "PolygonItem"; } + +public: + static Callback1 > WhenClick; + PolygonItem* SetDisplay(PolygonItemDisplay* disp); + +private: + Point _click; + bool _stdDisplay; + PolygonItemDisplay* _display; +}; + +class PolygonItemDisplay +{ +public: + virtual ~PolygonItemDisplay() {} + virtual void Paint(Draw* w, PolygonItem* item) const; +}; + +#endif diff --git a/bazaar/MapCommon/PolygonItemEvents.cpp b/bazaar/MapCommon/PolygonItemEvents.cpp new file mode 100644 index 000000000..e6659cff4 --- /dev/null +++ b/bazaar/MapCommon/PolygonItemEvents.cpp @@ -0,0 +1,43 @@ +#include "PolygonItem.h" +#include "IMapRender.h" + +void PolygonItem::StatePerformed(dword state, const String& param) +{ + if (state == PERFORM_SEARCH) + { + if (param.IsEmpty() || ToLower(GetName() + GetTags()).Find(ToLower(param)) < 0) + StateOff(STATE_FOUND); + else + StateOn (STATE_FOUND); + } +} + +bool PolygonItem::ProcessLeftDown(Point p, dword keyflags) +{ + bool sel = Contains(p); + + if (sel) + { + _click = GetTopRender()->ViewToScene(p); + StatesOff(STATE_SELECTED); + StateOn(STATE_SELECTED); + } + + return sel || IMapItem::ProcessLeftDown(p, keyflags); +} + +bool PolygonItem::ProcessLeftUp(Point p, dword keyflags) +{ + bool sel = Contains(p); + + p = GetTopRender()->ViewToScene(p); + + if (sel && !IsNull(_click)) + { + if (abs(_click.x - p.x) < 5 && abs(_click.y - p.y) < 5) + WhenClick(this); + } + + _click = Null; + return IMapItem::ProcessLeftUp(p, keyflags); +} diff --git a/bazaar/MapCommon/init b/bazaar/MapCommon/init new file mode 100644 index 000000000..dea36c091 --- /dev/null +++ b/bazaar/MapCommon/init @@ -0,0 +1,5 @@ +#ifndef _MapCommon_icpp_init_stub +#define _MapCommon_icpp_init_stub +#include "CtrlLib/init" +#include "Painter/init" +#endif diff --git a/bazaar/MapEditor/LevelEditor.cpp b/bazaar/MapEditor/LevelEditor.cpp new file mode 100644 index 000000000..4d7ab32e1 --- /dev/null +++ b/bazaar/MapEditor/LevelEditor.cpp @@ -0,0 +1,142 @@ +#include "LevelEditor.h" + +LevelEditor::LevelEditor(Map& map, Level& level, int pos) +{ + CtrlLayout(*this, "Редактор этажа"); + MaximizeBox().Sizeable(); + + _item = -1; + _pos = pos; + _map = ↦ + _level = &level; + + EditView.HideLevelsCtrl(); + EditView.HideNavButtons(); + + LayerList.WhenToolBar = THISBACK(CreateLayerToolBar); + LayerList.WhenChangeRow = THISBACK(UpdateItemList); + LayerList.AddColumn(t_("#")).Min(HorzLayoutZoom(40)).Max(VertLayoutZoom(40)) + .HeaderAlignCenter().AlignCenter(); + LayerList.SetToolBar(); + + LayerList.AddColumn(t_("Layer Name")) + .HeaderAlignCenter().AlignCenter(); + + ItemList.WhenToolBar = THISBACK(CreateItemToolBar); + ItemList.WhenChangeRow = THISBACK(OnItemSelect); + ItemList.WhenLeftDouble = THISBACK(OnItemProperties); + ItemList.AddColumn(t_("#")).Min(HorzLayoutZoom(40)).Max(VertLayoutZoom(40)) + .HeaderAlignCenter().AlignCenter(); + ItemList.SetToolBar(); + + ItemList.AddColumn(t_("Item Name")) + .HeaderAlignCenter().AlignCenter(); + + ItemTypeList.Add(t_("Rooms")); + ItemTypeList.SetIndex(0); + + LoadMap(); + UpdateLayerList(); +} + +void LevelEditor::UpdateLayerList() +{ + if (!_level) + return; + + int row = LayerList.GetCurrentRow(); + + LayerList.Clear(); + + for (int i = 0; i < _level->GetLayers().GetCount(); ++i) + { + LayerList.Add(i, _level->GetLayers()[i].GetName()); + } + + if (row >= 0 && row < LayerList.GetRowCount()) + LayerList.SetCursor(row); + + if (row < 0 && LayerList.GetRowCount()) + LayerList.SetCursor(0); + + MapLevel* level = EditView.GetCurrentLevel(); + if (!level) return; + else level->ClearEditPoints(); + + _item = -1; + UpdateItemList(); +} + +void LevelEditor::UpdateItemList() +{ + ItemList.Clear(); + + int row = LayerList.GetCurrentRow(); + if (row < 0) return; + + Layer& lay = _level->GetLayers()[row]; + + for (int i = 0; i < lay.GetRooms().GetCount(); ++i) + { + ItemList.Add(i, lay.GetRooms()[i].GetName()); + } + + if (ItemList.GetRowCount()) + ItemList.SetCursor(0); + + OnItemSelect(); + UpdateMap(ItemList.GetRowCount() > 0); +} + +void LevelEditor::LoadMap() +{ + Map map; + + for (int i = 0; i < _pos; ++i) + map.GetLevels().Add(Level()); + + map.GetLevels().Add(Level(*_level)); + map.SetName(_map->GetName()); + + EditView.LoadMap(map, true); + EditView.SetCurrentLevel(_pos); + EditView.GetCurrentLevel()->WhenChangePoint = THISBACK(OnChangePoint); + EditView.HighQuality(false); +} + +void LevelEditor::UpdateMap(bool editMode) +{ + EditView.UpdateLevel(*_level, _pos, editMode); +} + +int LevelEditor::Execute() +{ + int res = TopWindow::Execute(); + + int layer = LayerList.GetCurrentRow(); + if (layer < 0) return res; + + Layer& lay = _level->GetLayers()[layer]; + + int row = ItemList.GetCurrentRow(); + if (row < 0) return res; + + MapLevel* level = EditView.GetCurrentLevel(); + if (!level) return res; + + if (_item != -1) + { + if (_item >= 0 && _item < lay.GetRooms().GetCount()) + { + Room& room = lay.GetRooms()[_item]; + room.GetVertices().Clear(); + for (int i = 0; i < level->GetEditPoints().GetCount(); ++i) + { + room.GetVertices() << level->GetEditPoints()[i]; + } + } + _item = -1; + } + + return res; +} diff --git a/bazaar/MapEditor/LevelEditor.h b/bazaar/MapEditor/LevelEditor.h new file mode 100644 index 000000000..056ad013d --- /dev/null +++ b/bazaar/MapEditor/LevelEditor.h @@ -0,0 +1,44 @@ +#ifndef MAP_EDITOR__LEVEL_EDITOR_H +#define MAP_EDITOR__LEVEL_EDITOR_H + +#include "MapEditor.h" + +class LevelEditor : public WithLevelEditLayout +{ + typedef LevelEditor CLASSNAME; + +public: + LevelEditor(Map& map, Level& level, int pos); + + virtual int Execute(); + +protected: + void OnLayerAdd(); + void OnLayerEdit(); + void OnLayerRemove(); + void OnChangePoint(); + + void OnItemAdd(); + void OnItemEdit(); + void OnItemRemove(); + void OnItemSelect(); + void OnItemProperties(); + + void LoadMap(); + void UpdateMap(bool editMode); + void UpdateItemList(); + void UpdateLayerList(); + + void CreateItemToolBar(Bar& bar); + void CreateLayerToolBar(Bar& bar); + + void OpenItemProperties(); + +private: + int _item; + Level* _level; + Map* _map; + int _pos; +}; + +#endif diff --git a/bazaar/MapEditor/LevelEditorItem.cpp b/bazaar/MapEditor/LevelEditorItem.cpp new file mode 100644 index 000000000..3df60207a --- /dev/null +++ b/bazaar/MapEditor/LevelEditorItem.cpp @@ -0,0 +1,110 @@ +#include "LevelEditor.h" + +void LevelEditor::OnItemAdd() +{ + int layer = LayerList.GetCurrentRow(); + if (layer < 0) return; + + Layer& lay = _level->GetLayers()[layer]; + + Room room; + room.SetName(NFormat(t_("Room #%d"), lay.GetRooms().GetCount() + 1)); + + if (room.OpenProperties() != IDOK) + return; + + lay.GetRooms().Add(room); + + UpdateItemList(); +} + +void LevelEditor::OnItemEdit() +{ + int layer = LayerList.GetCurrentRow(); + if (layer < 0) return; + + Layer& lay = _level->GetLayers()[layer]; + + int row = ItemList.GetCurrentRow(); + if (row < 0) return; + + lay.GetRooms()[row].OpenProperties(); + + UpdateItemList(); +} + +void LevelEditor::OnItemRemove() +{ + int layer = LayerList.GetCurrentRow(); + if (layer < 0) return; + + Layer& lay = _level->GetLayers()[layer]; + + int row = ItemList.GetCurrentRow(); + if (row < 0) return; + + if (!PromptYesNo(t_("Remove the selected item from level?"))) + return; + + lay.GetRooms().Remove(row); + UpdateItemList(); +} + +void LevelEditor::OnItemSelect() +{ + int layer = LayerList.GetCurrentRow(); + if (layer < 0) return; + + Layer& lay = _level->GetLayers()[layer]; + + int row = ItemList.GetCurrentRow(); + if (row < 0) return; + + MapLevel* level = EditView.GetCurrentLevel(); + if (!level) return; + + if (_item != -1) + { + if (_item >= 0 && _item < lay.GetRooms().GetCount()) + { + Room& room = lay.GetRooms()[_item]; + room.GetVertices().Clear(); + for (int i = 0; i < level->GetEditPoints().GetCount(); ++i) + { + room.GetVertices() << level->GetEditPoints()[i]; + } + } + _item = -1; + } + + level->ClearEditPoints(); + + Room& room = lay.GetRooms()[row]; + for (int i = 0; i < room.GetVertices().GetCount(); ++i) + { + level->AddEditPoint(room.GetVertices()[i]); + } + + _item = row; + Refresh(); +} + +void LevelEditor::OnItemProperties() +{ + int layer = LayerList.GetCurrentRow(); + if (layer < 0) return; + + Layer& lay = _level->GetLayers()[layer]; + + int row = ItemList.GetCurrentRow(); + if (row < 0) return; + + lay.GetRooms()[row].OpenProperties(); + UpdateItemList(); +} + +void LevelEditor::OnChangePoint() +{ + OnItemSelect(); + UpdateMap(true); +} diff --git a/bazaar/MapEditor/LevelEditorLayer.cpp b/bazaar/MapEditor/LevelEditorLayer.cpp new file mode 100644 index 000000000..d5dcfebb9 --- /dev/null +++ b/bazaar/MapEditor/LevelEditorLayer.cpp @@ -0,0 +1,41 @@ +#include "LevelEditor.h" + +void LevelEditor::OnLayerAdd() +{ + int row = LayerList.GetRowCount(); + + Layer layer; + layer.SetName(NFormat(t_("Layer #%d"), _level->GetLayers().GetCount() + 1)); + + if (layer.OpenProperties() != IDOK) + return; + + _level->GetLayers().Add(layer); + + UpdateLayerList(); +} + +void LevelEditor::OnLayerEdit() +{ + int row = LayerList.GetCurrentRow(); + if (row < 0) return; + + _level->GetLayers()[row].OpenProperties(); + + UpdateLayerList(); +} + +void LevelEditor::OnLayerRemove() +{ + int row = LayerList.GetCurrentRow(); + if (row < 0) return; + + if (!PromptYesNo(t_("Remove the selected layer from level?"))) + return; + + if (!PromptYesNo(t_("No undo for this action. Are you sure?"))) + return; + + _level->GetLayers().Remove(row); + UpdateLayerList(); +} diff --git a/bazaar/MapEditor/LevelEditorTools.cpp b/bazaar/MapEditor/LevelEditorTools.cpp new file mode 100644 index 000000000..64b933e11 --- /dev/null +++ b/bazaar/MapEditor/LevelEditorTools.cpp @@ -0,0 +1,18 @@ +#include "LevelEditor.h" + +void LevelEditor::OpenItemProperties() +{ +} + +void LevelEditor::CreateItemToolBar(Bar& bar) +{ + bar.Add("Add", CtrlImg::Add(), THISBACK(OnItemAdd)); + bar.Add("Remove", CtrlImg::Remove(), THISBACK(OnItemRemove)); + bar.Add("Properties", CtrlImg::smallcheck(), THISBACK(OnItemProperties)); +} + +void LevelEditor::CreateLayerToolBar(Bar& bar) +{ + bar.Add("Add", CtrlImg::Add(), THISBACK(OnLayerAdd)); + bar.Add("Remove", CtrlImg::Remove(), THISBACK(OnLayerRemove)); +} diff --git a/bazaar/MapEditor/MapEditor.cpp b/bazaar/MapEditor/MapEditor.cpp new file mode 100644 index 000000000..04ad9c236 --- /dev/null +++ b/bazaar/MapEditor/MapEditor.cpp @@ -0,0 +1,76 @@ +#include "MapEditor.h" + +#define IMAGECLASS MapEditorImg +#define IMAGEFILE +#include + +MapEditor::MapEditor() +{ + CtrlLayout(*this, t_("Map Editor")); + RealizeDirectories(); + UpdateEditorCtrls(); + + WhenClose = THISBACK(OnClose); + PropsBtn <<= THISBACK(OnMapProperties); + + NewMapBtn <<= THISBACK(OnNewMap); + SaveMapBtn <<= THISBACK(OnSaveMap); + LoadMapBtn <<= THISBACK(OnLoadMap); + ViewMapBtn <<= THISBACK(OnViewMap); + CalcMapBtn <<= THISBACK(CalculateAllPrompt); + + AddLevelBtn <<= THISBACK(OnAddLevel); + EditLevelBtn <<= THISBACK(OnEditLevel); + ChangeLevelBtn <<= THISBACK(OnChangeLevel); + RemoveLevelBtn <<= THISBACK(OnRemoveLevel); + + LevelList.Moving(); + LevelList.AddColumn(t_("#")).Min(HorzLayoutZoom(40)).Max(VertLayoutZoom(40)) + .HeaderAlignCenter().AlignCenter(); + + LevelList.AddColumn(t_("Level Name")) + .HeaderAlignCenter().AlignCenter(); + + LevelList.WhenChangeRow = THISBACK(UpdateEditorCtrls); + LevelList.WhenLeftDouble = THISBACK(OnChangeLevel); + LevelList.WhenMoveRow = THISBACK(OnMoveLevel); +} + +void MapEditor::OnClose() +{ + if (!_map.GetName().IsEmpty() && _map.GetLevels().GetCount() > 0) + { + int r = PromptYesNoCancel(t_("Save current map before exit?")); + + if (r == 1) + OnSaveMap(); + + if (r == -1) + return; + } + + Break(); +} + +void MapEditor::UpdateEditorCtrls() +{ + bool flag = _map.GetLevels().GetCount() > 0 && LevelList.GetCurrentRow() >= 0 + && !_map.GetName().IsEmpty(); + + LevelList .Enable( _map.GetLevels().GetCount()); + SaveMapBtn .Enable( _map.GetLevels().GetCount()); + AddLevelBtn .Enable(!_map.GetName().IsEmpty()); + ChangeLevelBtn.Enable(flag); + RemoveLevelBtn.Enable(flag); + + EditLevelBtn .Enable(flag); + + CalcMapBtn.Enable(_map.GetLevels().GetCount() > 0 && !_map.GetName().IsEmpty()); + ViewMapBtn.Enable(_map.GetLevels().GetCount() > 0 && !_map.GetName().IsEmpty()); +} + +void MapEditor::RealizeDirectories() +{ + RealizeDirectory(AppendFileName( GetFileDirectory(GetExeFilePath()), "Mipmaps")); + RealizeDirectory(AppendFileName( GetFileDirectory(GetExeFilePath()), "Maps")); +} diff --git a/bazaar/MapEditor/MapEditor.h b/bazaar/MapEditor/MapEditor.h new file mode 100644 index 000000000..66fb764de --- /dev/null +++ b/bazaar/MapEditor/MapEditor.h @@ -0,0 +1,48 @@ +#ifndef MAP_EDITOR__MAP_EDITOR_H +#define MAP_EDITOR__MAP_EDITOR_H + +#include +using namespace Upp; + +#include + +#define LAYOUTFILE +#include + +#define IMAGECLASS MapEditorImg +#define IMAGEFILE +#include + +class MapEditor : public WithMapEditorLayout +{ +public: + typedef MapEditor CLASSNAME; + MapEditor(); + + void OnClose(); + void OnNewMap(); + void OnSaveMap(); + void OnLoadMap(); + void OnViewMap(); + void OnEditLevel(); + void OnMapProperties(); + + void OnAddLevel(); + void OnMoveLevel(int s, int e); + void OnChangeLevel(); + void OnRemoveLevel(); + + void UpdateLevelList(); + void UpdateEditorCtrls(); + +protected: + void RealizeDirectories(); + void CalculateAllPrompt(); + void OnLevelMapCalc(Level& level, int number); + void OnLevelMapList(VectorMapEx& mapList); + +private: + Map _map; +}; + +#endif diff --git a/bazaar/MapEditor/MapEditor.iml b/bazaar/MapEditor/MapEditor.iml new file mode 100644 index 000000000..fa5c9acec --- /dev/null +++ b/bazaar/MapEditor/MapEditor.iml @@ -0,0 +1,9 @@ +PREMULTIPLIED +IMAGE_ID(Reload) + +IMAGE_BEGIN_DATA +IMAGE_DATA(120,156,237,149,91,10,192,32,12,4,115,20,47,213,35,121,110,91,104,145,162,73,72,33,15,10,59,176,32,40,153,253) +IMAGE_DATA(81,169,81,35,0,192,47,24,79,74,220,227,184,115,173,187,116,134,73,150,127,238,191,227,216,65,243,179,110,231,14,146) +IMAGE_DATA(127,245,204,56,119,80,253,194,252,158,225,87,102,103,249,37,50,252,219,185,66,255,234,201,244,115,158,16,191,118,215,2) +IMAGE_DATA(253,91,7,195,59,227,237,23,59,8,243,35,252,68,246,127,38,202,255,133,74,55,0,0,152,56,1,68,111,251,9,0) +IMAGE_END_DATA(128, 1) diff --git a/bazaar/MapEditor/MapEditor.lay b/bazaar/MapEditor/MapEditor.lay new file mode 100644 index 000000000..d8f12a805 --- /dev/null +++ b/bazaar/MapEditor/MapEditor.lay @@ -0,0 +1,34 @@ +LAYOUT(MapEditorLayout, 240, 448) + ITEM(GridCtrl, LevelList, HSizePosZ(8, 8).VSizePosZ(184, 44)) + ITEM(Button, NewMapBtn, SetLabel(t_("New map...")).LeftPosZ(8, 108).TopPosZ(8, 28)) + ITEM(Button, SaveMapBtn, SetLabel(t_("Save map...")).RightPosZ(8, 108).TopPosZ(8, 28)) + ITEM(Button, CalcMapBtn, SetLabel(t_("Calculate...")).LeftPosZ(124, 108).BottomPosZ(376, 28)) + ITEM(Button, ViewMapBtn, SetLabel(t_("Preview...")).LeftPosZ(124, 108).BottomPosZ(340, 28)) + ITEM(Button, LoadMapBtn, SetLabel(t_("Load map...")).LeftPosZ(8, 108).TopPosZ(116, 28)) + ITEM(Button, PropsBtn, SetLabel(t_("Properties...")).RightPosZ(8, 108).TopPosZ(116, 28)) + ITEM(Button, AddLevelBtn, SetLabel(t_("+")).LeftPosZ(8, 28).BottomPosZ(8, 28)) + ITEM(Button, ChangeLevelBtn, SetLabel(t_("Properties")).LeftPosZ(44, 72).BottomPosZ(8, 28)) + ITEM(Button, EditLevelBtn, SetLabel(t_("Edit level...")).RightPosZ(44, 72).VSizePosZ(412, 8)) + ITEM(Button, RemoveLevelBtn, SetLabel(t_("-")).RightPosZ(8, 28).BottomPosZ(8, 28)) + ITEM(Label, dv___11, SetFrame(TopSeparatorFrame()).HSizePosZ(0, 0).TopPosZ(156, 13)) + ITEM(Label, dv___12, SetLabel(t_("Levels:")).HSizePosZ(8, 8).TopPosZ(160, 23)) +END_LAYOUT + +LAYOUT(MapLoadLayout, 264, 80) + ITEM(DropList, MapList, HSizePosZ(8, 8).TopPosZ(8, 19)) + ITEM(Button, ok, SetLabel(t_("OK")).RightPosZ(92, 76).BottomPosZ(8, 28)) + ITEM(Button, cancel, SetLabel(t_("Cancel")).RightPosZ(8, 76).BottomPosZ(8, 28)) +END_LAYOUT + +LAYOUT(PreviewLayout, 420, 332) + ITEM(MapView, View, HSizePosZ(0, 0).VSizePosZ(0, 0)) +END_LAYOUT + +LAYOUT(LevelEditLayout, 560, 452) + ITEM(MapView, EditView, SetFrame(InsetFrame()).HSizePosZ(164, 4).VSizePosZ(4, 4)) + ITEM(GridCtrl, ItemList, LeftPosZ(4, 156).VSizePosZ(160, 4)) + ITEM(GridCtrl, LayerList, LeftPosZ(4, 156).TopPosZ(4, 116)) + ITEM(Label, dv___3, SetLabel(t_("Elements:")).LeftPosZ(4, 64).TopPosZ(132, 24)) + ITEM(DropList, ItemTypeList, LeftPosZ(68, 92).TopPosZ(132, 24)) +END_LAYOUT + diff --git a/bazaar/MapEditor/MapEditor.t b/bazaar/MapEditor/MapEditor.t new file mode 100644 index 000000000..46e1e7923 --- /dev/null +++ b/bazaar/MapEditor/MapEditor.t @@ -0,0 +1,167 @@ +#ifdef _MSC_VER +#pragma setlocale("C") +#endif +// MapEditor.lay + +T_("New map...") +ruRU("\320\235\320\276\320\262\320\260\321\217 \320\272\320\260\321\200\321\202\320\260...") + +T_("Save map...") +ruRU("\320\241\320\276\321\205\321\200\320\260\320\275\320\270\321\202\321\214...") + +T_("Calculate...") +ruRU("\320\237\321\200\320\276\321\201\321\207\320\270\321\202\320\260\321\202\321\214...") + +T_("Preview...") +ruRU("\320\237\321\200\320\276\321\201\320\274\320\276\321\202\321\200...") + +T_("Load map...") +ruRU("\320\236\321\202\320\272\321\200\321\213\321\202\321\214...") + +T_("Properties...") +ruRU("\320\241\320\262\320\276\320\271\321\201\321\202\320\262\320\260...") + +T_("+") +ruRU("") + +T_("Properties") +ruRU("\320\241\320\262\320\276\320\271\321\201\321\202\320\262\320\260") + +T_("Edit level...") +ruRU("\320\230\320\267\320\274\320\265\320\275\320\270\321\202\321\214") + +T_("-") +ruRU("") + +T_("Levels:") +ruRU("\320\255\321\202\320\260\320\266\320\270:") + +T_("OK") +ruRU("OK") + +T_("Cancel") +ruRU("\320\236\321\202\320\274\320\265\320\275\320\260") + +T_("Elements:") +ruRU("\320\255\320\273\320\265\320\274\320\265\320\275\321\202\321\213:") + + +// MapEditor.cpp + +T_("Map Editor") +ruRU("\320\240\320\265\320\264\320\260\320\272\321\202\320\276\321\200 \320\272\320\260\321\200\321\202") + +T_("#") +ruRU("\342\204\226") + +T_("Level Name") +ruRU("\320\235\320\260\320\267\320\262\320\260\320\275\320\270\320\265 \321\215\321\202\320\260\320\266\320\260") + +T_("Save current map before exit?") +ruRU("\320\241\320\276\321\205\321\200\320\260\320\275\320\270\321\202\321\214 " + "\321\202\320\265\320\272\321\203\321\211\321\203\321\216 \320\272\320\260\321\200\321\202\321\203 " + "\320\277\320\265\321\200\320\265\320\264 \320\262\321\213\321\205\320\276\320\264\320\276\320\274?") + + +// MapEditorMap.cpp + +T_("Save current map before creating new map?") +ruRU("\320\241\320\276\321\205\321\200\320\260\320\275\320\270\321\202\321\214 " + "\321\202\320\265\320\272\321\203\321\211\321\203\321\216 \320\272\320\260\321\200\321\202\321\203 " + "\320\277\320\265\321\200\320\265\320\264 \321\201\320\276\320\267\320\264\320\260\320\275\320\270\320\265\320\274 " + "\320\275\320\276\320\262\320\276\320\271?") + +T_("Error while saving map to file!") +ruRU("\320\236\321\210\320\270\320\261\320\272\320\260 \320\277\321\200\320\270 " + "\321\201\320\276\321\205\321\200\320\260\320\275\320\265\320\275\320\270\320\270 " + "\320\272\320\260\321\200\321\202\321\213 \320\262 \321\204\320\260\320\271\320\273!") + +T_("Load Map...") +ruRU("\320\227\320\260\320\263\321\200\321\203\320\267\320\272\320\260 \320\272\320\260\321\200\321\202\321\213...") + +T_("No any file to load!") +ruRU("\320\235\320\265\321\202 \320\272\320\260\321\200\321\202 \320\264\320\273\321\217 " + "\320\267\320\260\320\263\321\200\321\203\320\267\320\272\320\270!") + +T_("File not found: %s") +ruRU("\320\244\320\260\320\271\320\273 \320\275\320\265 \320\275\320\260\320\271\320\264\320\265\320\275: " + "%s") + +T_("Error while loading map from file: %s") +ruRU("\320\236\321\210\320\270\320\261\320\272\320\260 \320\277\321\200\320\270 " + "\320\267\320\260\320\263\321\200\321\203\320\267\320\272\320\265 \320\272\320\260\321\200\321\202\321\213 " + "\320\270\320\267 \321\204\320\260\320\271\320\273\320\260: %s") + +T_("Map Preview") +ruRU("\320\237\321\200\320\276\321\201\320\274\320\276\321\202\321\200 \320\272\320\260\321\200\321\202\321\213") + +T_("Error while loading preview!") +ruRU("\320\236\321\210\320\270\320\261\320\272\320\260 \320\277\321\200\320\270 " + "\320\267\320\260\320\263\321\200\321\203\320\267\320\272\320\265 \320\272\320\260\321\200\321\202\321\213 " + "\320\264\320\273\321\217 \320\277\321\200\320\265\320\264\320\277\321\200\320\276\321\201\320\274\320\276\321\202\321\200\320\260!") + + +// MapEditorLevel.cpp + +T_("Level #%d") +ruRU("%d \321\215\321\202\320\260\320\266") + +T_("Error while loading editor!") +ruRU("\320\236\321\210\320\270\320\261\320\272\320\260 \320\277\321\200\320\270 " + "\320\267\320\260\320\263\321\200\321\203\320\267\320\272\320\265 \321\200\320\265\320\264\320\260\320\272\321\202\320\276\321\200\320\260 " + "\321\215\321\202\320\260\320\266\320\260!") + +T_("Remove the selected level from map?") +ruRU("\320\243\320\264\320\260\320\273\320\270\321\202\321\214 \320\262\321\213\320\261\321\200\320\260\320\275\320\275\321\213\320\271 " + "\321\215\321\202\320\260\320\266 \320\270\320\267 \320\272\320\260\321\200\321\202\321\213?") + +T_("No undo for this action. Are you sure?") +ruRU("\320\224\320\260\320\275\320\275\320\276\320\265 \320\264\320\265\320\271\321\201\321\202\320\262\320\270\320\265 " + "\320\275\320\265 \320\276\321\202\320\274\320\265\320\275\320\270\321\202\321\214. " + "\320\222\321\213 \321\203\320\262\320\265\321\200\320\265\320\275\321\213?") + +T_("Recalculate mipmaps for moved levels now?") +ruRU("\320\237\320\265\321\200\320\265\321\201\321\207\320\270\321\202\320\260\321\202\321\214 " + "mipmap-\320\270\320\267\320\276\320\261\321\200\320\260\320\266\320\265\320\275\320\270\321\217 " + "\320\264\320\273\321\217 \320\277\320\265\321\200\320\265\320\274\320\265\321\211\320\265\320\275\320\275\321\213\321\205 " + "\321\203\321\200\320\276\320\262\320\275\320\265\320\271?") + +T_("Please, select the image for level: %s") +ruRU("\320\222\321\213 \320\264\320\276\320\273\320\266\320\275\321\213 \320\262\321\213\320\261\321\200\320\260\321\202\321\214 " + "\320\270\320\267\320\276\320\261\321\200\320\260\320\266\320\265\320\275\320\270\320\265 " + "\320\264\320\273\321\217 \320\272\320\260\321\200\321\202\321\213: %s") + +T_("Image file not exist: %s") +ruRU("\320\244\320\260\320\271\320\273 \321\201 \320\270\320\267\320\276\320\261\321\200\320\260\320\266\320\265\320\275\320\270\320\265\320\274 " + "\320\275\320\265 \320\275\320\260\320\271\320\264\320\265\320\275: %s") + +T_("Error while loading image file: %s") +ruRU("\320\236\321\210\320\270\320\261\320\272\320\260 \320\277\321\200\320\270 " + "\320\267\320\260\320\263\321\200\321\203\320\267\320\272\320\265 \320\270\320\267\320\276\320\261\321\200\320\260\320\266\320\265\320\275\320\270\321\217 " + "\320\270\320\267 \321\204\320\260\320\271\320\273\320\260: %s") + +T_("Recalculate all mipmaps for levels?") +ruRU("\320\237\320\265\321\200\320\265\321\201\321\207\320\270\321\202\320\260\321\202\321\214 " + "mipmap-\320\270\320\267\320\276\320\261\321\200\320\260\320\266\320\265\320\275\320\270\321\217 " + "\320\264\320\273\321\217 \320\262\321\201\320\265\321\205 \321\203\321\200\320\276\320\262\320\275\320\265\320\271?") + + +// LevelEditor.cpp + +T_("Layer Name") +ruRU("\320\241\320\273\320\276\320\271") + +T_("Item Name") +ruRU("\320\235\320\260\320\267\320\262\320\260\320\275\320\270\320\265") + +T_("Rooms") +ruRU("\320\237\320\276\320\274\320\265\321\211\320\265\320\275\320\270\320\265") + + +// LevelEditorLayer.cpp + +T_("Layer #%d") +ruRU("\320\241\320\273\320\276\320\271 \342\204\226") + +T_("Remove the selected layer from level?") +ruRU("\320\243\320\264\320\260\320\273\320\270\321\202\321\214 \320\262\321\213\320\261\321\200\320\260\320\275\320\275\321\213\320\271 \321\201\320\273\320\276\320\271 \320\270\320\267 \321\215\321\202\320\260\320\266\320\260?") diff --git a/bazaar/MapEditor/MapEditor.upp b/bazaar/MapEditor/MapEditor.upp new file mode 100644 index 000000000..c6cd701ad --- /dev/null +++ b/bazaar/MapEditor/MapEditor.upp @@ -0,0 +1,24 @@ +uses + CtrlLib, + Map, + GridCtrl; + +file + MapEditorLang.icpp, + MapEditor.lay, + MapEditor.iml, + MapEditor.t, + MapEditor.h, + MapEditor.cpp, + MapEditorMap.cpp, + MapEditorLevel.cpp, + LevelEditor.h, + LevelEditor.cpp, + LevelEditorLayer.cpp, + LevelEditorItem.cpp, + LevelEditorTools.cpp, + main.cpp; + +mainconfig + "" = "GUI MT"; + diff --git a/bazaar/MapEditor/MapEditorLang.icpp b/bazaar/MapEditor/MapEditorLang.icpp new file mode 100644 index 000000000..48f466999 --- /dev/null +++ b/bazaar/MapEditor/MapEditorLang.icpp @@ -0,0 +1,4 @@ +#include "MapEditor.h" + +#define TFILE +#include diff --git a/bazaar/MapEditor/MapEditorLevel.cpp b/bazaar/MapEditor/MapEditorLevel.cpp new file mode 100644 index 000000000..d325c16e4 --- /dev/null +++ b/bazaar/MapEditor/MapEditorLevel.cpp @@ -0,0 +1,138 @@ +#include "MapEditor.h" +#include "LevelEditor.h" + +void MapEditor::OnAddLevel() +{ + int row = LevelList.GetRowCount(); + + Level level; + level.SetName(NFormat(t_("Level #%d"), _map.GetLevels().GetCount() + 1)); + + level.WhenMapList = THISBACK(OnLevelMapList); + level.WhenCalculate = THISBACK1(OnLevelMapCalc, row); + if (level.OpenProperties() != IDOK) + return; + + _map.GetLevels().Add(level); + + UpdateLevelList(); +} + +void MapEditor::OnEditLevel() +{ + int row = LevelList.GetCurrentRow(); + if (row < 0) return; + + LevelEditor edit(_map, _map.GetLevels()[row], row); + edit.Execute(); +} + +void MapEditor::OnChangeLevel() +{ + int row = LevelList.GetCurrentRow(); + if (row < 0) return; + + _map.GetLevels()[row].WhenCalculate = THISBACK1(OnLevelMapCalc, row); + _map.GetLevels()[row].WhenMapList = THISBACK(OnLevelMapList); + _map.GetLevels()[row].OpenProperties(); + + UpdateLevelList(); +} + +void MapEditor::OnRemoveLevel() +{ + int row = LevelList.GetCurrentRow(); + if (row < 0) return; + + if (!PromptYesNo(t_("Remove the selected level from map?"))) + return; + + if (!PromptYesNo(t_("No undo for this action. Are you sure?"))) + return; + + _map.GetLevels().Remove(row); + UpdateLevelList(); +} + +void MapEditor::OnMoveLevel(int s, int e) +{ + _map.GetLevels().Swap(s - 1, e - 1); + + if (PromptOKCancel(t_("Recalculate mipmaps for moved levels now?"))) + { + OnLevelMapCalc( _map.GetLevels()[s - 1], s - 1 ); + OnLevelMapCalc( _map.GetLevels()[e - 1], e - 1 ); + } + + SetTimeCallback(1, THISBACK(UpdateLevelList)); +} + +void MapEditor::OnLevelMapCalc(Level& level, int number) +{ + if (level.GetMapBG().IsEmpty()) + { + Exclamation(NFormat(t_("Please, select the image for level: %s"), level.GetName())); + return; + } + + String fp = AppendFileName( AppendFileName( GetFileDirectory(GetExeFilePath()), "Maps"), + level.GetMapBG()); + + if (!FileExists(fp)) + { + Exclamation(NFormat(t_("Image file not exist: %s"), fp)); + return; + } + + String name = level.GetName(); + double zx = level.GetZoomDX(); + Size pz = level.GetPageSize(); + Size sz = level.GetCellSize(); + + FileIn in(fp); + One r = StreamRaster::OpenAny(in); + if (!r) + { + Exclamation(NFormat(t_("Error while loading image file: %s"), fp)); + return; + } + + Image img = r->GetImage(); + Calculate(sz.cx, sz.cy, pz.cx, pz.cy, zx, + NFormat("%s-%d", _map.GetName(), number + 1), img); +} + +void MapEditor::OnLevelMapList(VectorMapEx& mapList) +{ + Vector files = GetDirectoryFiles( + AppendFileName( GetFileDirectory(GetExeFilePath()), "Maps")); + Sort(files); + for (int i = 0; i < files.GetCount(); ++i) + mapList.Add(files[i], files[i]); +} + +void MapEditor::CalculateAllPrompt() +{ + if (PromptYesNo(t_("Recalculate all mipmaps for levels?"))) + for (int i = 0; i < _map.GetLevels().GetCount(); ++i) + OnLevelMapCalc( _map.GetLevels()[i], i ); +} + +void MapEditor::UpdateLevelList() +{ + int row = LevelList.GetCurrentRow(); + + LevelList.Clear(); + for (int i = 0; i < _map.GetLevels().GetCount(); ++i) + { + LevelList.Add(i + 1, _map.GetLevels()[i].GetName()); + } + + if (row >= 0 && row < LevelList.GetRowCount()) + LevelList.SetCursor(row); + + if (row < 0 && LevelList.GetRowCount()) + LevelList.SetCursor(0); + + UpdateEditorCtrls(); +} diff --git a/bazaar/MapEditor/MapEditorMap.cpp b/bazaar/MapEditor/MapEditorMap.cpp new file mode 100644 index 000000000..8f7f7512f --- /dev/null +++ b/bazaar/MapEditor/MapEditorMap.cpp @@ -0,0 +1,95 @@ +#include "MapEditor.h" + +void MapEditor::OnNewMap() +{ + int r = PromptYesNoCancel(t_("Save current map before creating new map?")); + + if (r == IDYES) + OnSaveMap(); + + if (r == IDCANCEL) + return; + + _map.Clear(); + + UpdateLevelList(); + UpdateEditorCtrls(); +} + +void MapEditor::OnSaveMap() +{ + CalculateAllPrompt(); + + if (!StoreAsXMLFile(_map, _map.GetName(), + AppendFileName( + AppendFileName(GetFileDirectory(GetExeFilePath()), "Mipmaps"), + _map.GetName() + ".map" + ))) + { + Exclamation(t_("Error while saving map to file!")); + } + + UpdateEditorCtrls(); +} + +void MapEditor::OnLoadMap() +{ + WithMapLoadLayout dlg; + CtrlLayoutOKCancel(dlg, t_("Load Map...")); + + String dir = AppendFileName( GetFileDirectory(GetExeFilePath()), "Mipmaps"); + Vector files = GetDirectoryFiles(dir, "*.map"); + Sort(files); + + if (files.GetCount() <= 0) + { + Exclamation(t_("No any file to load!")); + return; + } + + for (int i = 0; i < files.GetCount(); ++i) + dlg.MapList.Add(files[i], files[i]); + dlg.MapList.SetIndex(0); + + if (dlg.Execute() != IDOK) + return; + + String fp = AppendFileName(dir, (~dlg.MapList).ToString()); + + if (!FileExists(fp)) + { + Exclamation(NFormat(t_("File not found: %s"), fp)); + return; + } + + if (!LoadFromXMLFile(_map, fp)) + { + Exclamation(NFormat(t_("Error while loading map from file: %s"), fp)); + return; + } + + UpdateLevelList(); + UpdateEditorCtrls(); +} + +void MapEditor::OnViewMap() +{ + WithPreviewLayout dlg; + CtrlLayout(dlg, t_("Map Preview")); + dlg.Sizeable().MaximizeBox(); + dlg.View.HighQuality(true); + + if (!dlg.View.LoadMap(_map)) + { + Exclamation(t_("Error while loading preview!")); + return; + } + + dlg.Execute(); +} + +void MapEditor::OnMapProperties() +{ + _map.OpenProperties(); + UpdateEditorCtrls(); +} diff --git a/bazaar/MapEditor/init b/bazaar/MapEditor/init new file mode 100644 index 000000000..6a5ab08cf --- /dev/null +++ b/bazaar/MapEditor/init @@ -0,0 +1,9 @@ +#ifndef _MapEditor_icpp_init_stub +#define _MapEditor_icpp_init_stub +#include "CtrlLib/init" +#include "Map/init" +#include "GridCtrl/init" +#define BLITZ_INDEX__ F7451C483F16EAEF2B514EBA83339BB5F +#include "MapEditorLang.icpp" +#undef BLITZ_INDEX__ +#endif diff --git a/bazaar/MapEditor/main.cpp b/bazaar/MapEditor/main.cpp new file mode 100644 index 000000000..c587bca14 --- /dev/null +++ b/bazaar/MapEditor/main.cpp @@ -0,0 +1,8 @@ +#include "MapEditor.h" + +GUI_APP_MAIN +{ + SetLanguage(LNGFromText("RU-RU")); + Ctrl::SetAppName(" "); + MapEditor().Run(); +} diff --git a/bazaar/MapRenderTest/MapRenderTest.upp b/bazaar/MapRenderTest/MapRenderTest.upp new file mode 100644 index 000000000..4ae437708 --- /dev/null +++ b/bazaar/MapRenderTest/MapRenderTest.upp @@ -0,0 +1,10 @@ +uses + CtrlLib, + Map; + +file + main.cpp; + +mainconfig + "" = "GUI MT"; + diff --git a/bazaar/MapRenderTest/init b/bazaar/MapRenderTest/init new file mode 100644 index 000000000..c60eebecd --- /dev/null +++ b/bazaar/MapRenderTest/init @@ -0,0 +1,5 @@ +#ifndef _MapRenderTest_icpp_init_stub +#define _MapRenderTest_icpp_init_stub +#include "CtrlLib/init" +#include "Map/init" +#endif diff --git a/bazaar/MapRenderTest/main.cpp b/bazaar/MapRenderTest/main.cpp new file mode 100644 index 000000000..6fc1a4c93 --- /dev/null +++ b/bazaar/MapRenderTest/main.cpp @@ -0,0 +1,43 @@ +#include + +class TestWindow : public TopWindow +{ + typedef TestWindow CLASSNAME; + MapView View; + +public: + TestWindow() + { + Sizeable().MinimizeBox().MaximizeBox(); + Add(View.SizePos()); + + View.LoadMap(AppendFileName(AppendFileName(GetFileDirectory(GetExeFilePath()), "Mipmaps"), + "marcos.map")); + View.HighQuality(false); + View.ShowSearch(); + + // here link to callback + PolygonItem::WhenClick = THISBACK(OnRoomClick); + } + + // your method or function to react on clicks + void OnRoomClick(Ptr room) + { + Point p = GetRect().TopLeft() + ViewToScene(~room, room->GetCenter()); + + TopWindow popup; + popup.NoCenter(); + popup.SetRect(Rect(p, Size(150, 50))); + + Label text; + popup.Add(text.SizePos()); + text = "Name: " + room->GetName(); + + popup.Execute(); + } +}; + +GUI_APP_MAIN +{ + TestWindow().Run(); +}