-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.h
More file actions
146 lines (127 loc) · 4.8 KB
/
Copy pathMain.h
File metadata and controls
146 lines (127 loc) · 4.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
// Object identifier "CNVX"
/*
#pragma message ("************************ WARNING ****************************")
#pragma message ("***** Do not forget to change the IDENTIFIER in Main.h! *****")
#pragma message ("*************************************************************")
*/
#define IDENTIFIER MAKEID(C,N,V,X) // REQUIRED: you MUST replace the letters in the MAKEID macro by others
// and then remove the #pragma message above. If you do not do this, MMF2
// could confuse your object with another in the event editor.
// Includes
#include "ConvertX.hpp"
// ------------------------------
// DEFINITION OF CONDITIONS CODES
// ------------------------------
/*
#define CND_CONDITION 0
*/
#define CND_ISVALIDUNITS 0
#define CND_LAST 1
// ---------------------------
// DEFINITION OF ACTIONS CODES
// ---------------------------
//#define ACT_ACTION 0
#define ACT_LAST 0
// -------------------------------
// DEFINITION OF EXPRESSIONS CODES
// -------------------------------
/*
#define EXP_EXPRESSION 0
#define EXP_EXPRESSION2 1
#define EXP_EXPRESSION3 2
*/
// ... Smart Convert ...
#define EXP_SMARTCONVERT 0
// ... Time Conversion ...
#define EXP_CONVERTTIME 1
#define EXP_CONVERTYEARSTOSECONDS 2
#define EXP_CONVERTMONTHSTOSECONDS 3
#define EXP_CONVERTWEEKSTOSECONDS 4
#define EXP_CONVERTDAYSTOSECONDS 5
#define EXP_CONVERTHOURSTOSECONDS 6
#define EXP_CONVERTMINUTESTOSECONDS 7
#define EXP_CONVERTMILLISECONDSTOSECONDS 8
#define EXP_CONVERTMICROSECONDSTOSECONDS 9
#define EXP_CONVERTSECONDSTOYEARS 10
#define EXP_CONVERTSECONDSTOMONTHS 11
#define EXP_CONVERTSECONDSTOWEEKS 12
#define EXP_CONVERTSECONDSTODAYS 13
#define EXP_CONVERTSECONDSTOHOURS 14
#define EXP_CONVERTSECONDSTOMINUTES 15
#define EXP_CONVERTSECONDSTOMILLISECONDS 16
#define EXP_CONVERTSECONDSTOMICROSECONDS 17
#define EXP_TAGSECONDS 18
#define EXP_TAGYEARS 19
#define EXP_TAGMONTHS 20
#define EXP_TAGWEEKS 21
#define EXP_TAGDAYS 22
#define EXP_TAGHOURS 23
#define EXP_TAGMINUTES 24
#define EXP_TAGMILLISECONDS 25
#define EXP_TAGMICROSECONDS 26
// ... Convert Text ...
#define EXP_CONVERTTEXT 27
#define EXP_CONVERTSTRINGTOCODEPOINTS 28
#define EXP_CONVERTSTRINGTOBINARYSTRING 29
#define EXP_CONVERTSTRINGTOOCTALSTRING 30
#define EXP_CONVERTSTRINGTOHEXADECIMALSTRING 31
#define EXP_CONVERTCODEPOINTSTOSTRING 32
#define EXP_CONVERTBINARYSTRINGTOSTRING 33
#define EXP_CONVERTOCTALSTRINGTOSTRING 34
#define EXP_CONVERTHEXADECIMALSTRINGTOSTRING 35
#define EXP_TAGSTRING 36
#define EXP_TAGCODEPOINTS 37
#define EXP_TAGBINARYSTRING 38
#define EXP_TAGOCTALSTRING 39
#define EXP_TAGHEXADECIMALSTRING 40
#define EXP_LAST 41
// ---------------------
// OBJECT DATA STRUCTURE
// ---------------------
// Used at edit time and saved in the MFA/CCN/EXE files
typedef struct tagEDATA_V1
{
// Header - required
extHeader eHeader;
// Object's data
// short swidth;
// short sheight;
} EDITDATA;
typedef EDITDATA* LPEDATA;
// Object versions
#define KCX_CURRENT_VERSION 1
// --------------------------------
// RUNNING OBJECT DATA STRUCTURE
// --------------------------------
// Used at runtime. Initialize it in the CreateRunObject function.
// Free any allocated memory or object in the DestroyRunObject function.
//
// Note: if you store C++ objects in this structure and do not store
// them as pointers, you must call yourself their constructor in the
// CreateRunObject function and their destructor in the DestroyRunObject
// function. As the RUNDATA structure is a simple C structure and not a C++ object.
typedef struct tagRDATA
{
// Main header - required
headerObject rHo; // Header
// Optional headers - depend on the OEFLAGS value, see documentation and examples for more info
// rCom rc; // Common structure for movements & animations
// rMvt rm; // Movements
// rSpr rs; // Sprite (displayable objects)
rVal rv; // Alterable values
// Object's runtime data
ConvertX* convertX = nullptr; // Main object of the extension, which will do all the work.
// We store a pointer to it in the runtime data, and create it in CreateRunObject and destroy it in DestroyRunObject.
} RUNDATA;
typedef RUNDATA* LPRDATA;
// Size when editing the object under level editor
// -----------------------------------------------
#define MAX_EDITSIZE sizeof(EDITDATA)
// Default flags - see documentation for more info
// -------------
#define OEFLAGS (OEFLAG_VALUES|OEFLAG_RUNBEFOREFADEIN)
#define OEPREFS 0
// If to handle message, specify the priority of the handling procedure
// 0= low, 255= very high. You should use 100 as normal.
// --------------------------------------------------------------------
#define WINDOWPROC_PRIORITY 100