author | unC0Rr |
Tue, 17 Dec 2024 15:44:21 +0100 | |
branch | transitional_engine |
changeset 16078 | db18f1a30b0c |
parent 16045 | 4933920eba89 |
permissions | -rw-r--r-- |
14175
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 |
|
14292
1aac8a62be6f
Implement send_ipc and read_ipc in engine lib, send_ipc in frontend
unC0Rr
parents:
14175
diff
changeset
|
4 |
#include <stddef.h> |
14175
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 |
|
15921
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15919
diff
changeset
|
7 |
#include "../rust/lib-hedgewars-engine/target/lib-hedgewars-engine.hpp" |
15238 | 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 |
||
14175
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 |
|
15921
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15919
diff
changeset
|
24 |
using EngineInstance = hwengine::EngineInstance; |
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15919
diff
changeset
|
25 |
using PreviewInfo = hwengine::PreviewInfo; |
14175
8354b390f1a2
Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff
changeset
|
26 |
|
15921
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15919
diff
changeset
|
27 |
using hedgewars_engine_protocol_version_t = |
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15919
diff
changeset
|
28 |
decltype(hwengine::hedgewars_engine_protocol_version); |
14315
21be7838a127
Add advance_simulation() function to engine lib, some WIP on frontend
unc0rr
parents:
14292
diff
changeset
|
29 |
|
15921
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15919
diff
changeset
|
30 |
using start_engine_t = decltype(hwengine::start_engine); |
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15919
diff
changeset
|
31 |
using generate_preview_t = decltype(hwengine::generate_preview); |
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15919
diff
changeset
|
32 |
using dispose_preview_t = decltype(hwengine::dispose_preview); |
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15919
diff
changeset
|
33 |
using cleanup_t = decltype(hwengine::cleanup); |
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15919
diff
changeset
|
34 |
using send_ipc_t = decltype(hwengine::send_ipc); |
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15919
diff
changeset
|
35 |
using read_ipc_t = decltype(hwengine::read_ipc); |
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15919
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:
15919
diff
changeset
|
37 |
using render_frame_t = decltype(hwengine::render_frame); |
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15919
diff
changeset
|
38 |
using advance_simulation_t = decltype(hwengine::advance_simulation); |
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15919
diff
changeset
|
39 |
using move_camera_t = decltype(hwengine::move_camera); |
14875
aed75d439027
Implement external events approach to input user actions into engine.
unc0rr
parents:
14734
diff
changeset
|
40 |
|
15921
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15919
diff
changeset
|
41 |
using simple_event_t = decltype(hwengine::simple_event); |
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15919
diff
changeset
|
42 |
using long_event_t = decltype(hwengine::long_event); |
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15919
diff
changeset
|
43 |
using positioned_event_t = decltype(hwengine::positioned_event); |
14875
aed75d439027
Implement external events approach to input user actions into engine.
unc0rr
parents:
14734
diff
changeset
|
44 |
|
16045 | 45 |
} // extern "C" |
46 |
||
47 |
Q_NAMESPACE |
|
48 |
||
49 |
/* |
|
15921
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15919
diff
changeset
|
50 |
using SimpleEventType = hwengine::SimpleEventType; |
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15919
diff
changeset
|
51 |
using LongEventType = hwengine::LongEventType; |
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15919
diff
changeset
|
52 |
using LongEventState = hwengine::LongEventState; |
5b3beb90e1a6
Implement generation of c header from rust interface, adapt qmlfrontend
unC0Rr
parents:
15919
diff
changeset
|
53 |
using PositionedEventType = hwengine::PositionedEventType; |
16045 | 54 |
*/ |
14875
aed75d439027
Implement external events approach to input user actions into engine.
unc0rr
parents:
14734
diff
changeset
|
55 |
|
16045 | 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 |
}; |
|
15238 | 61 |
|
16045 | 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 |
}; |
|
15238 | 84 |
|
85 |
Q_ENUM_NS(SimpleEventType) |
|
86 |
Q_ENUM_NS(LongEventType) |
|
87 |
Q_ENUM_NS(LongEventState) |
|
88 |
Q_ENUM_NS(PositionedEventType) |
|
89 |
||
16045 | 90 |
}; // namespace Engine |
14175
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 |