1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-25 21:38:59 +02:00

Moved object construction macros to more logical location

This commit is contained in:
Ivan Savenko 2024-08-09 14:57:40 +00:00
parent 00605b5129
commit 337431901f
2 changed files with 21 additions and 21 deletions

View File

@ -112,24 +112,3 @@ public:
};
extern CGuiHandler GH; //global gui handler
struct SObjectConstruction
{
CIntObject *myObj;
SObjectConstruction(CIntObject *obj);
~SObjectConstruction();
};
struct SSetCaptureState
{
bool previousCapture;
SSetCaptureState(bool allow, ui8 actions);
~SSetCaptureState();
};
#define OBJ_CONSTRUCTION SObjectConstruction obj__i(this)
#define OBJ_CONSTRUCTION_TARGETED(obj) SObjectConstruction obj__i(obj)
#define OBJECT_CONSTRUCTION_CAPTURING(actions) SSetCaptureState obj__i1(true, actions); SObjectConstruction obj__i(this)
#define OBJECT_CONSTRUCTION_CUSTOM_CAPTURING(actions) SSetCaptureState obj__i1(true, actions); SObjectConstruction obj__i(this)
#define OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE SSetCaptureState obj__i1(true, 255 - DISPOSE); SObjectConstruction obj__i(this)

View File

@ -211,3 +211,24 @@ class EmptyStatusBar : public IStatusBar
virtual void setEnteringMode(bool on){};
virtual void setEnteredText(const std::string & text){};
};
struct SObjectConstruction
{
CIntObject *myObj;
SObjectConstruction(CIntObject *obj);
~SObjectConstruction();
};
struct SSetCaptureState
{
bool previousCapture;
SSetCaptureState(bool allow, ui8 actions);
~SSetCaptureState();
};
#define OBJ_CONSTRUCTION SObjectConstruction obj__i(this)
#define OBJ_CONSTRUCTION_TARGETED(obj) SObjectConstruction obj__i(obj)
#define OBJECT_CONSTRUCTION_CAPTURING(actions) SSetCaptureState obj__i1(true, actions); SObjectConstruction obj__i(this)
#define OBJECT_CONSTRUCTION_CUSTOM_CAPTURING(actions) SSetCaptureState obj__i1(true, actions); SObjectConstruction obj__i(this)
#define OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE SSetCaptureState obj__i1(true, ALL_ACTIONS); SObjectConstruction obj__i(this)