mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
Removed DECLARE_TYPEOF2; replaced with double-parenthesized macro calls. (GCC doesn't accept the other way in all cases.. I don't know whether MSW accepts this way.) Fixed a few resource names.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@209 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -9,8 +9,8 @@
|
||||
#include <data/action/symbol.hpp>
|
||||
#include <data/action/symbol_part.hpp>
|
||||
|
||||
DECLARE_TYPEOF_COLLECTION2(pair<SymbolPartP,SymbolPartCombine>);
|
||||
DECLARE_TYPEOF_COLLECTION2(pair<SymbolPartP,size_t >);
|
||||
DECLARE_TYPEOF_COLLECTION((pair<SymbolPartP,SymbolPartCombine>));
|
||||
DECLARE_TYPEOF_COLLECTION((pair<SymbolPartP,size_t >));
|
||||
DECLARE_TYPEOF_COLLECTION(SymbolPartP);
|
||||
DECLARE_TYPEOF_COLLECTION(ControlPointP);
|
||||
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
#include <util/reflect.hpp>
|
||||
|
||||
DECLARE_TYPEOF_COLLECTION(FieldP);
|
||||
DECLARE_TYPEOF_NO_REV2(IndexMap<FieldP,ValueP>);
|
||||
DECLARE_TYPEOF_NO_REV((IndexMap<FieldP,ValueP>));
|
||||
|
||||
// ----------------------------------------------------------------------------- : Card
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <util/io/package.hpp>
|
||||
|
||||
DECLARE_TYPEOF_COLLECTION(ChoiceField::ChoiceP);
|
||||
DECLARE_TYPEOF2(map<String,ScriptableImage>);
|
||||
DECLARE_TYPEOF((map<String,ScriptableImage>));
|
||||
|
||||
// ----------------------------------------------------------------------------- : ChoiceField
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ bool is_mse1_symbol(const Image& img) {
|
||||
int r = *d++;
|
||||
int g = *d++;
|
||||
int b = *d++;
|
||||
delta += abs(r - b) + abs(r - g) + abs(b - g);
|
||||
delta += fabs(r - b) + fabs(r - g) + fabs(b - g);
|
||||
}
|
||||
}
|
||||
if (delta > 5000) return false; // not black & white enough
|
||||
@@ -357,7 +357,7 @@ void straighten(SymbolPart& part) {
|
||||
Vector2D bb = next.delta_before.normalized();
|
||||
// if the area beneath the polygon formed by the handles is small
|
||||
// then it is a straight line
|
||||
double cpDot = abs(aa.cross(ab)) + abs(bb.cross(ab));
|
||||
double cpDot = fabs(aa.cross(ab)) + fabs(bb.cross(ab));
|
||||
if (cpDot < treshold) {
|
||||
cur.segment_after = next.segment_before = SEGMENT_LINE;
|
||||
cur.delta_after = next.delta_before = Vector2D();
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <util/tagged_string.hpp>
|
||||
|
||||
class KeywordTrie;
|
||||
DECLARE_TYPEOF2(map<Char, KeywordTrie*>);
|
||||
DECLARE_TYPEOF((map<Char, KeywordTrie*>));
|
||||
|
||||
// ----------------------------------------------------------------------------- : Reflection
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
#include <wx/sstream.h>
|
||||
|
||||
DECLARE_TYPEOF_COLLECTION(CardP);
|
||||
DECLARE_TYPEOF_NO_REV2(IndexMap<FieldP,ValueP>);
|
||||
DECLARE_TYPEOF_NO_REV((IndexMap<FieldP,ValueP>));
|
||||
|
||||
// ----------------------------------------------------------------------------- : Set
|
||||
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
DECLARE_TYPEOF_COLLECTION(CardP);
|
||||
DECLARE_TYPEOF_COLLECTION(FieldP);
|
||||
DECLARE_POINTER_TYPE(ChoiceValue);
|
||||
DECLARE_TYPEOF2(map<int,FieldP>);
|
||||
DECLARE_TYPEOF_NO_REV2(IndexMap<FieldP,StyleP>);
|
||||
DECLARE_TYPEOF((map<int,FieldP>));
|
||||
DECLARE_TYPEOF_NO_REV((IndexMap<FieldP,StyleP>));
|
||||
|
||||
// ----------------------------------------------------------------------------- : Events
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ DECLARE_TYPEOF_COLLECTION(GraphAxisP);
|
||||
DECLARE_TYPEOF_COLLECTION(GraphElementP);
|
||||
DECLARE_TYPEOF_COLLECTION(GraphGroup);
|
||||
DECLARE_TYPEOF_COLLECTION(int);
|
||||
DECLARE_TYPEOF2(map<String,UInt>);
|
||||
DECLARE_TYPEOF((map<String,UInt>));
|
||||
|
||||
// ----------------------------------------------------------------------------- : Events
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <data/stylesheet.hpp>
|
||||
|
||||
DECLARE_TYPEOF_COLLECTION(ValueViewerP);
|
||||
DECLARE_TYPEOF_NO_REV2(IndexMap<FieldP,StyleP>);
|
||||
DECLARE_TYPEOF_NO_REV((IndexMap<FieldP,StyleP>));
|
||||
|
||||
// ----------------------------------------------------------------------------- : NativeLookEditor
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
WelcomeWindow::WelcomeWindow()
|
||||
: Frame(nullptr, wxID_ANY, _TITLE_("magic set editor"), wxDefaultPosition, wxSize(480,340), wxDEFAULT_DIALOG_STYLE | wxTAB_TRAVERSAL | wxCLIP_CHILDREN )
|
||||
, logo (load_resource_image(_("about")))
|
||||
, logo2(load_resource_image(_("two")))
|
||||
, logo2(load_resource_image(_("two_beta")))
|
||||
{
|
||||
SetIcon(load_resource_icon(_("app")));
|
||||
|
||||
@@ -120,7 +120,7 @@ END_EVENT_TABLE ()
|
||||
// ----------------------------------------------------------------------------- : Hover button with label
|
||||
|
||||
HoverButtonExt::HoverButtonExt(Window* parent, int id, const wxImage& icon, const String& label, const String& sub_label)
|
||||
: HoverButton(parent, id, _("BTN"))
|
||||
: HoverButton(parent, id, _("btn"))
|
||||
, icon(icon)
|
||||
, label(label), sub_label(sub_label)
|
||||
, font_large(14, wxSWISS, wxNORMAL, wxNORMAL, false, _("Arial"))
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include <gui/util.hpp> // clearDC
|
||||
|
||||
DECLARE_TYPEOF_COLLECTION(ValueViewerP);
|
||||
DECLARE_TYPEOF_NO_REV2(IndexMap<FieldP,StyleP>);
|
||||
DECLARE_TYPEOF_NO_REV((IndexMap<FieldP,StyleP>));
|
||||
|
||||
// ----------------------------------------------------------------------------- : DataViewer
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ bool_no IMAGE "../common/bool_no.png"
|
||||
//help_page BITMAP "help_page.png"
|
||||
|
||||
about IMAGE "../common/about.png"
|
||||
two IMAGE "../common/two_beta.png"
|
||||
two_beta IMAGE "../common/two_beta.png"
|
||||
btn_normal IMAGE "../common/btn_normal.png"
|
||||
btn_hover IMAGE "../common/btn_hover.png"
|
||||
btn_focus IMAGE "../common/btn_focus.png"
|
||||
@@ -155,7 +155,7 @@ FILETYPE VFT_APP
|
||||
VALUE "License", "GNU General Public License 2 or later; This is free software, and you are welcome to redistribute it under certain conditions; See the help file for details"
|
||||
VALUE "FileDescription", "Magic Set Editor"
|
||||
VALUE "InternalName", "mse2/8"
|
||||
VALUE "LegalCopyright", "© 2001-2006 Twan van Laarhoven"
|
||||
VALUE "LegalCopyright", " 2001-2006 Twan van Laarhoven"
|
||||
VALUE "ProductName", "Magic Set Editor"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,8 +22,8 @@ DECLARE_TYPEOF(Contexts);
|
||||
DECLARE_TYPEOF_COLLECTION(CardP);
|
||||
DECLARE_TYPEOF_COLLECTION(FieldP);
|
||||
DECLARE_TYPEOF_COLLECTION(Dependency);
|
||||
DECLARE_TYPEOF_NO_REV2(IndexMap<FieldP,StyleP>);
|
||||
DECLARE_TYPEOF_NO_REV2(IndexMap<FieldP,ValueP>);
|
||||
DECLARE_TYPEOF_NO_REV((IndexMap<FieldP,StyleP>));
|
||||
DECLARE_TYPEOF_NO_REV((IndexMap<FieldP,ValueP>));
|
||||
|
||||
// initialize functions, from functions.cpp
|
||||
void init_script_functions(Context& ctx);
|
||||
|
||||
+1
-17
@@ -24,8 +24,6 @@
|
||||
#define DECLARE_TYPEOF_NO_REV(T)
|
||||
#define DECLARE_TYPEOF_CONST(T)
|
||||
#define DECLARE_TYPEOF_COLLECTION(T)
|
||||
#define DECLARE_TYPEOF2(A,B)
|
||||
#define DECLARE_TYPEOF_NO_REV2(A,B)
|
||||
|
||||
#define TYPEOF(Value) __typeof(Value)
|
||||
#define TYPEOF_IT(Value) __typeof(Value.begin())
|
||||
@@ -88,21 +86,7 @@
|
||||
|
||||
/// Declare typeof magic for a specific std::vector type
|
||||
#define DECLARE_TYPEOF_COLLECTION(T) DECLARE_TYPEOF(vector<T>); \
|
||||
DECLARE_TYPEOF_CONST(set<T>)
|
||||
|
||||
/// Declare typeof magic for a specific type, with two template arguments
|
||||
/** This is needed because the preprocessor sees MACRO(class<a,b>)
|
||||
* as a macro call with two arguments.
|
||||
*/
|
||||
#define DECLARE_TYPEOF2(A,B) \
|
||||
typedef A,B BOOST_PP_CAT(TypeOfTemp,__LINE__); \
|
||||
DECLARE_TYPEOF(BOOST_PP_CAT(TypeOfTemp,__LINE__))
|
||||
#define DECLARE_TYPEOF_NO_REV2(A,B) \
|
||||
typedef A,B BOOST_PP_CAT(TypeOfTemp,__LINE__); \
|
||||
DECLARE_TYPEOF_NO_REV(BOOST_PP_CAT(TypeOfTemp,__LINE__))
|
||||
#define DECLARE_TYPEOF_COLLECTION2(A,B) \
|
||||
typedef A,B BOOST_PP_CAT(TypeOfTemp,__LINE__); \
|
||||
DECLARE_TYPEOF_COLLECTION(BOOST_PP_CAT(TypeOfTemp,__LINE__))
|
||||
// DECLARE_TYPEOF_CONST(set<T>)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user