author | unC0Rr |
Wed, 28 Aug 2024 13:41:51 +0200 | |
changeset 16020 | 9be943326d9c |
parent 16016 | 4933920eba89 |
permissions | -rw-r--r-- |
14154
8354b390f1a2
Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff
changeset
|
1 |
#ifndef ENGINE_H |
8354b390f1a2
Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff
changeset
|
2 |
#define ENGINE_H |
8354b390f1a2
Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff
changeset
|
3 |
|
14271
1aac8a62be6f
Implement send_ipc and read_ipc in engine lib, send_ipc in frontend
unC0Rr
parents:
14154
diff
changeset
|
4 |
#include <stddef.h> |
14154
8354b390f1a2
Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff
changeset
|
5 |
#include <stdint.h> |
8354b390f1a2
Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff
changeset
|
6 |
|
15893
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15891
diff
changeset
|
7 |
#include "../rust/lib-hedgewars-engine/target/lib-hedgewars-engine.hpp" |
15217 | 8 |
|
9 |
#ifndef Q_NAMESPACE |
|
10 |
#define Q_NAMESPACE |
|
11 |
#endif |
|
12 |
||
13 |
#ifndef Q_ENUM_NS |
|
14 |
#define Q_ENUM_NS(x) |
|
15 |
#endif |
|
16 |
||
17 |
#ifndef Q_DECLARE_METATYPE |
|
18 |
#define Q_DECLARE_METATYPE(x) |
|
19 |
#endif |
|
20 |
||
14154
8354b390f1a2
Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff
changeset
|
21 |
namespace Engine { |
8354b390f1a2
Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff
changeset
|
22 |
extern "C" { |
8354b390f1a2
Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff
changeset
|
23 |
|
15893
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15891
diff
changeset
|
24 |
using EngineInstance = hwengine::EngineInstance; |
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15891
diff
changeset
|
25 |
using PreviewInfo = hwengine::PreviewInfo; |
14154
8354b390f1a2
Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff
changeset
|
26 |
|
15893
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15891
diff
changeset
|
27 |
using hedgewars_engine_protocol_version_t = |
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15891
diff
changeset
|
28 |
decltype(hwengine::hedgewars_engine_protocol_version); |
14294
21be7838a127
Add advance_simulation() function to engine lib, some WIP on frontend
unc0rr
parents:
14271
diff
changeset
|
29 |
|
15893
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15891
diff
changeset
|
30 |
using start_engine_t = decltype(hwengine::start_engine); |
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15891
diff
changeset
|
31 |
using generate_preview_t = decltype(hwengine::generate_preview); |
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15891
diff
changeset
|
32 |
using dispose_preview_t = decltype(hwengine::dispose_preview); |
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15891
diff
changeset
|
33 |
using cleanup_t = decltype(hwengine::cleanup); |
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15891
diff
changeset
|
34 |
using send_ipc_t = decltype(hwengine::send_ipc); |
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15891
diff
changeset
|
35 |
using read_ipc_t = decltype(hwengine::read_ipc); |
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15891
diff
changeset
|
36 |
using setup_current_gl_context_t = decltype(hwengine::setup_current_gl_context); |
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15891
diff
changeset
|
37 |
using render_frame_t = decltype(hwengine::render_frame); |
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15891
diff
changeset
|
38 |
using advance_simulation_t = decltype(hwengine::advance_simulation); |
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15891
diff
changeset
|
39 |
using move_camera_t = decltype(hwengine::move_camera); |
14854
aed75d439027
Implement external events approach to input user actions into engine.
unc0rr
parents:
14713
diff
changeset
|
40 |
|
15893
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15891
diff
changeset
|
41 |
using simple_event_t = decltype(hwengine::simple_event); |
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15891
diff
changeset
|
42 |
using long_event_t = decltype(hwengine::long_event); |
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15891
diff
changeset
|
43 |
using positioned_event_t = decltype(hwengine::positioned_event); |
14854
aed75d439027
Implement external events approach to input user actions into engine.
unc0rr
parents:
14713
diff
changeset
|
44 |
|
16016 | 45 |
} // extern "C" |
46 |
||
47 |
Q_NAMESPACE |
|
48 |
||
49 |
/* |
|
15893
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15891
diff
changeset
|
50 |
using SimpleEventType = hwengine::SimpleEventType; |
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15891
diff
changeset
|
51 |
using LongEventType = hwengine::LongEventType; |
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15891
diff
changeset
|
52 |
using LongEventState = hwengine::LongEventState; |
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15891
diff
changeset
|
53 |
using PositionedEventType = hwengine::PositionedEventType; |
16016 | 54 |
*/ |
14854
aed75d439027
Implement external events approach to input user actions into engine.
unc0rr
parents:
14713
diff
changeset
|
55 |
|
16016 | 56 |
// NOTE: have to copy these to be able to register then in Qt meta object system |
57 |
enum class LongEventState { |
|
58 |
Set, |
|
59 |
Unset, |
|
60 |
}; |
|
15217 | 61 |
|
16016 | 62 |
enum class LongEventType { |
63 |
ArrowUp, |
|
64 |
ArrowDown, |
|
65 |
ArrowLeft, |
|
66 |
ArrowRight, |
|
67 |
Precision, |
|
68 |
Attack, |
|
69 |
}; |
|
70 |
||
71 |
enum class PositionedEventType { |
|
72 |
CursorMove, |
|
73 |
CursorClick, |
|
74 |
}; |
|
75 |
||
76 |
enum class SimpleEventType { |
|
77 |
SwitchHedgehog, |
|
78 |
Timer, |
|
79 |
LongJump, |
|
80 |
HighJump, |
|
81 |
Accept, |
|
82 |
Deny, |
|
83 |
}; |
|
15217 | 84 |
|
85 |
Q_ENUM_NS(SimpleEventType) |
|
86 |
Q_ENUM_NS(LongEventType) |
|
87 |
Q_ENUM_NS(LongEventState) |
|
88 |
Q_ENUM_NS(PositionedEventType) |
|
89 |
||
16016 | 90 |
}; // namespace Engine |
14154
8354b390f1a2
Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff
changeset
|
91 |
|
8354b390f1a2
Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff
changeset
|
92 |
#endif // ENGINE_H |