Commit d1e156eb authored by coppro's avatar coppro

Removed DECLARE_TYPEOF2; replaced with double-parenthesized macro calls. (GCC...

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.
parent ee21883c
rm Makefile.am;
echo "
#+----------------------------------------------------------------------------+
#| Description: Magic Set Editor - Program to make Magic (tm) cards |
#| Copyright: (C) 2001 - 2007 Twan van Laarhoven |
#| License: GNU General Public License 2 or later (see file COPYING) |
#+----------------------------------------------------------------------------+
# This flag allows us to use subdirectories:
AUTOMAKE_OPTIONS = subdir-objects
bin_PROGRAMS = magicseteditor
AM_CXXFLAGS = @WX_CXXFLAGS@ -DUNICODE -I . -Wall
AM_LDFLAGS = @WX_LIBS@
magicseteditor_SOURCES =
# The script used to generate is MakeAM. " | cat > Makefile.am;
find . -name *.cpp | sed "s/\./magicseteditor_SOURCES += ./" | cat >> Makefile.am;
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
#include <data/action/symbol.hpp> #include <data/action/symbol.hpp>
#include <data/action/symbol_part.hpp> #include <data/action/symbol_part.hpp>
DECLARE_TYPEOF_COLLECTION2(pair<SymbolPartP,SymbolPartCombine>); DECLARE_TYPEOF_COLLECTION((pair<SymbolPartP,SymbolPartCombine>));
DECLARE_TYPEOF_COLLECTION2(pair<SymbolPartP,size_t >); DECLARE_TYPEOF_COLLECTION((pair<SymbolPartP,size_t >));
DECLARE_TYPEOF_COLLECTION(SymbolPartP); DECLARE_TYPEOF_COLLECTION(SymbolPartP);
DECLARE_TYPEOF_COLLECTION(ControlPointP); DECLARE_TYPEOF_COLLECTION(ControlPointP);
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <util/reflect.hpp> #include <util/reflect.hpp>
DECLARE_TYPEOF_COLLECTION(FieldP); DECLARE_TYPEOF_COLLECTION(FieldP);
DECLARE_TYPEOF_NO_REV2(IndexMap<FieldP,ValueP>); DECLARE_TYPEOF_NO_REV((IndexMap<FieldP,ValueP>));
// ----------------------------------------------------------------------------- : Card // ----------------------------------------------------------------------------- : Card
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <util/io/package.hpp> #include <util/io/package.hpp>
DECLARE_TYPEOF_COLLECTION(ChoiceField::ChoiceP); DECLARE_TYPEOF_COLLECTION(ChoiceField::ChoiceP);
DECLARE_TYPEOF2(map<String,ScriptableImage>); DECLARE_TYPEOF((map<String,ScriptableImage>));
// ----------------------------------------------------------------------------- : ChoiceField // ----------------------------------------------------------------------------- : ChoiceField
......
...@@ -99,7 +99,7 @@ bool is_mse1_symbol(const Image& img) { ...@@ -99,7 +99,7 @@ bool is_mse1_symbol(const Image& img) {
int r = *d++; int r = *d++;
int g = *d++; int g = *d++;
int b = *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 if (delta > 5000) return false; // not black & white enough
...@@ -357,7 +357,7 @@ void straighten(SymbolPart& part) { ...@@ -357,7 +357,7 @@ void straighten(SymbolPart& part) {
Vector2D bb = next.delta_before.normalized(); Vector2D bb = next.delta_before.normalized();
// if the area beneath the polygon formed by the handles is small // if the area beneath the polygon formed by the handles is small
// then it is a straight line // 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) { if (cpDot < treshold) {
cur.segment_after = next.segment_before = SEGMENT_LINE; cur.segment_after = next.segment_before = SEGMENT_LINE;
cur.delta_after = next.delta_before = Vector2D(); cur.delta_after = next.delta_before = Vector2D();
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <util/tagged_string.hpp> #include <util/tagged_string.hpp>
class KeywordTrie; class KeywordTrie;
DECLARE_TYPEOF2(map<Char, KeywordTrie*>); DECLARE_TYPEOF((map<Char, KeywordTrie*>));
// ----------------------------------------------------------------------------- : Reflection // ----------------------------------------------------------------------------- : Reflection
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <wx/sstream.h> #include <wx/sstream.h>
DECLARE_TYPEOF_COLLECTION(CardP); DECLARE_TYPEOF_COLLECTION(CardP);
DECLARE_TYPEOF_NO_REV2(IndexMap<FieldP,ValueP>); DECLARE_TYPEOF_NO_REV((IndexMap<FieldP,ValueP>));
// ----------------------------------------------------------------------------- : Set // ----------------------------------------------------------------------------- : Set
......
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
DECLARE_TYPEOF_COLLECTION(CardP); DECLARE_TYPEOF_COLLECTION(CardP);
DECLARE_TYPEOF_COLLECTION(FieldP); DECLARE_TYPEOF_COLLECTION(FieldP);
DECLARE_POINTER_TYPE(ChoiceValue); DECLARE_POINTER_TYPE(ChoiceValue);
DECLARE_TYPEOF2(map<int,FieldP>); DECLARE_TYPEOF((map<int,FieldP>));
DECLARE_TYPEOF_NO_REV2(IndexMap<FieldP,StyleP>); DECLARE_TYPEOF_NO_REV((IndexMap<FieldP,StyleP>));
// ----------------------------------------------------------------------------- : Events // ----------------------------------------------------------------------------- : Events
......
...@@ -15,7 +15,7 @@ DECLARE_TYPEOF_COLLECTION(GraphAxisP); ...@@ -15,7 +15,7 @@ DECLARE_TYPEOF_COLLECTION(GraphAxisP);
DECLARE_TYPEOF_COLLECTION(GraphElementP); DECLARE_TYPEOF_COLLECTION(GraphElementP);
DECLARE_TYPEOF_COLLECTION(GraphGroup); DECLARE_TYPEOF_COLLECTION(GraphGroup);
DECLARE_TYPEOF_COLLECTION(int); DECLARE_TYPEOF_COLLECTION(int);
DECLARE_TYPEOF2(map<String,UInt>); DECLARE_TYPEOF((map<String,UInt>));
// ----------------------------------------------------------------------------- : Events // ----------------------------------------------------------------------------- : Events
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include <data/stylesheet.hpp> #include <data/stylesheet.hpp>
DECLARE_TYPEOF_COLLECTION(ValueViewerP); DECLARE_TYPEOF_COLLECTION(ValueViewerP);
DECLARE_TYPEOF_NO_REV2(IndexMap<FieldP,StyleP>); DECLARE_TYPEOF_NO_REV((IndexMap<FieldP,StyleP>));
// ----------------------------------------------------------------------------- : NativeLookEditor // ----------------------------------------------------------------------------- : NativeLookEditor
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
WelcomeWindow::WelcomeWindow() WelcomeWindow::WelcomeWindow()
: Frame(nullptr, wxID_ANY, _TITLE_("magic set editor"), wxDefaultPosition, wxSize(480,340), wxDEFAULT_DIALOG_STYLE | wxTAB_TRAVERSAL | wxCLIP_CHILDREN ) : Frame(nullptr, wxID_ANY, _TITLE_("magic set editor"), wxDefaultPosition, wxSize(480,340), wxDEFAULT_DIALOG_STYLE | wxTAB_TRAVERSAL | wxCLIP_CHILDREN )
, logo (load_resource_image(_("about"))) , logo (load_resource_image(_("about")))
, logo2(load_resource_image(_("two"))) , logo2(load_resource_image(_("two_beta")))
{ {
SetIcon(load_resource_icon(_("app"))); SetIcon(load_resource_icon(_("app")));
...@@ -120,7 +120,7 @@ END_EVENT_TABLE () ...@@ -120,7 +120,7 @@ END_EVENT_TABLE ()
// ----------------------------------------------------------------------------- : Hover button with label // ----------------------------------------------------------------------------- : Hover button with label
HoverButtonExt::HoverButtonExt(Window* parent, int id, const wxImage& icon, const String& label, const String& sub_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) , icon(icon)
, label(label), sub_label(sub_label) , label(label), sub_label(sub_label)
, font_large(14, wxSWISS, wxNORMAL, wxNORMAL, false, _("Arial")) , font_large(14, wxSWISS, wxNORMAL, wxNORMAL, false, _("Arial"))
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <gui/util.hpp> // clearDC #include <gui/util.hpp> // clearDC
DECLARE_TYPEOF_COLLECTION(ValueViewerP); DECLARE_TYPEOF_COLLECTION(ValueViewerP);
DECLARE_TYPEOF_NO_REV2(IndexMap<FieldP,StyleP>); DECLARE_TYPEOF_NO_REV((IndexMap<FieldP,StyleP>));
// ----------------------------------------------------------------------------- : DataViewer // ----------------------------------------------------------------------------- : DataViewer
......
...@@ -110,7 +110,7 @@ bool_no IMAGE "../common/bool_no.png" ...@@ -110,7 +110,7 @@ bool_no IMAGE "../common/bool_no.png"
//help_page BITMAP "help_page.png" //help_page BITMAP "help_page.png"
about IMAGE "../common/about.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_normal IMAGE "../common/btn_normal.png"
btn_hover IMAGE "../common/btn_hover.png" btn_hover IMAGE "../common/btn_hover.png"
btn_focus IMAGE "../common/btn_focus.png" btn_focus IMAGE "../common/btn_focus.png"
...@@ -155,7 +155,7 @@ FILETYPE VFT_APP ...@@ -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 "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 "FileDescription", "Magic Set Editor"
VALUE "InternalName", "mse2/8" VALUE "InternalName", "mse2/8"
VALUE "LegalCopyright", " 2001-2006 Twan van Laarhoven" VALUE "LegalCopyright", " 2001-2006 Twan van Laarhoven"
VALUE "ProductName", "Magic Set Editor" VALUE "ProductName", "Magic Set Editor"
} }
} }
......
...@@ -22,8 +22,8 @@ DECLARE_TYPEOF(Contexts); ...@@ -22,8 +22,8 @@ DECLARE_TYPEOF(Contexts);
DECLARE_TYPEOF_COLLECTION(CardP); DECLARE_TYPEOF_COLLECTION(CardP);
DECLARE_TYPEOF_COLLECTION(FieldP); DECLARE_TYPEOF_COLLECTION(FieldP);
DECLARE_TYPEOF_COLLECTION(Dependency); DECLARE_TYPEOF_COLLECTION(Dependency);
DECLARE_TYPEOF_NO_REV2(IndexMap<FieldP,StyleP>); DECLARE_TYPEOF_NO_REV((IndexMap<FieldP,StyleP>));
DECLARE_TYPEOF_NO_REV2(IndexMap<FieldP,ValueP>); DECLARE_TYPEOF_NO_REV((IndexMap<FieldP,ValueP>));
// initialize functions, from functions.cpp // initialize functions, from functions.cpp
void init_script_functions(Context& ctx); void init_script_functions(Context& ctx);
......
...@@ -24,8 +24,6 @@ ...@@ -24,8 +24,6 @@
#define DECLARE_TYPEOF_NO_REV(T) #define DECLARE_TYPEOF_NO_REV(T)
#define DECLARE_TYPEOF_CONST(T) #define DECLARE_TYPEOF_CONST(T)
#define DECLARE_TYPEOF_COLLECTION(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(Value) __typeof(Value)
#define TYPEOF_IT(Value) __typeof(Value.begin()) #define TYPEOF_IT(Value) __typeof(Value.begin())
...@@ -88,21 +86,7 @@ ...@@ -88,21 +86,7 @@
/// Declare typeof magic for a specific std::vector type /// Declare typeof magic for a specific std::vector type
#define DECLARE_TYPEOF_COLLECTION(T) DECLARE_TYPEOF(vector<T>); \ #define DECLARE_TYPEOF_COLLECTION(T) DECLARE_TYPEOF(vector<T>); \
DECLARE_TYPEOF_CONST(set<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__))
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment