10 #ifndef LUA_BACKEND_HPP
11 #define LUA_BACKEND_HPP
13 #include <message_bus.hpp>
38 std::string hash_file(
const std::string &path);
40 static std::string hash_string(
const std::string &
string);
49 int8_t
run_file(
const std::string &file);
60 extern "C" int setFullscreenLua(lua_State *L);
61 extern "C" int getFullscreenStatusLua(lua_State *L);
62 extern "C" int setDarknessLua(lua_State *L);
63 extern "C" int hashStringLua(lua_State *L);
64 extern "C" int setGravityLua(lua_State *L);
65 extern "C" int getGravityLua(lua_State *L);
66 extern "C" int pausePhysicsLua(lua_State *L);
67 extern "C" int unpausePhysicsLua(lua_State *L);
68 extern "C" int setLevelFloorLua(lua_State *L);
69 extern "C" int setBackgroundLua(lua_State *L);
70 extern "C" int setBackgroundColorLua(lua_State *L);
71 extern "C" int setOverlayLua(lua_State *L);
72 extern "C" int delayLua(lua_State *L);
73 extern "C" int startLevelLua(lua_State *L);
74 extern "C" int reloadLevelLua(lua_State *L);
75 extern "C" int useLua(lua_State *L);
76 extern "C" int load_levelLua(lua_State *L);
77 extern "C" int unload_levelLua(lua_State *L);
78 extern "C" int loadAssetLua(lua_State *L);
79 extern "C" int unloadAssetLua(lua_State *L);
80 extern "C" int endGameLua(lua_State *L);
81 extern "C" int setLevelSizeLua(lua_State *L);
82 extern "C" int centerCameraLua(lua_State *L);
83 extern "C" int showMouseCursorLua(lua_State *L);
84 extern "C" int hideMouseCursorLua(lua_State *L);
85 extern "C" int setBrightnessLua(lua_State *L);
86 extern "C" int setVsyncLua(lua_State *L);
87 extern "C" int getVsyncStateLua(lua_State *L);
88 extern "C" int getSoundsVolumeLua(lua_State *L);
89 extern "C" int getMusicVolumeLua(lua_State *L);
90 extern "C" int pauseMusicLua(lua_State *L);
91 extern "C" int playMusicLua(lua_State *L);
92 extern "C" int playSoundLua(lua_State *L);
93 extern "C" int stopMusicLua(lua_State *L);
94 extern "C" int stopAllSoundsLua(lua_State *L);
95 extern "C" int setAudioEnabledLua(lua_State *L);
96 extern "C" int isAudioEnabledLua(lua_State *L);
97 extern "C" int keyPressedLua(lua_State *L);
98 extern "C" int keyHeldLua(lua_State *L);
99 extern "C" int keyReleasedLua(lua_State *L);
100 extern "C" int getMouseXLua(lua_State *L);
101 extern "C" int getMouseYLua(lua_State *L);
102 extern "C" int leftTriggerLua(lua_State *L);
103 extern "C" int rightTriggerLua(lua_State *L);
104 extern "C" int rightStickHorizontalLua(lua_State *L);
105 extern "C" int leftStickHorizontalLua(lua_State *L);
106 extern "C" int rightStickVerticalLua(lua_State *L);
107 extern "C" int leftStickVerticalLua(lua_State *L);
108 extern "C" int controllerRumbleLua(lua_State *L);
109 extern "C" int setLeftStickVerticalThresholdLua(lua_State *L);
110 extern "C" int setLeftStickHorizontalThresholdLua(lua_State *L);
111 extern "C" int setRightStickVerticalThresholdLua(lua_State *L);
112 extern "C" int setRightStickHorizontalThresholdLua(lua_State *L);
113 extern "C" int setRightTriggerThresholdLua(lua_State *L);
114 extern "C" int setLeftTriggerThresholdLua(lua_State *L);
115 extern "C" int setMusicVolumeLua(lua_State *L);
116 extern "C" int setSoundsVolumeLua(lua_State *L);
117 extern "C" int setInternalResolutionLua(lua_State *L);
118 extern "C" int setWindowResolutionLua(lua_State *L);
119 extern "C" int getWindowResolutionLua(lua_State *L);
120 extern "C" int getInternalResolutionLua(lua_State *L);
121 extern "C" int saveGameLua(lua_State *);
125 extern "C" int createTextObjectLua(lua_State *L);
126 extern "C" int setTextObjectColorLua(lua_State *L);
127 extern "C" int setTextObjectTextLua(lua_State *L);
128 extern "C" int setTextObjectFontLua(lua_State *L);
129 extern "C" int setTextObjectXLua(lua_State *L);
130 extern "C" int setTextObjectYLua(lua_State *L);
131 extern "C" int setTextObjectVisibleLua(lua_State *L);
134 extern "C" int createLightLua(lua_State *L);
135 extern "C" int setLightOriginXLua(lua_State *L);
136 extern "C" int getLightOriginXLua(lua_State *L);
137 extern "C" int setLightOriginYLua(lua_State *L);
138 extern "C" int getLightOriginYLua(lua_State *L);
139 extern "C" int getLightRadiusLua(lua_State *L);
140 extern "C" int setLightRadiusLua(lua_State *L);
141 extern "C" int getLightIntensityLua(lua_State *L);
142 extern "C" int setLightIntensityLua(lua_State *L);
143 extern "C" int getLightBrightnessLua(lua_State *L);
144 extern "C" int setLightBrightnessLua(lua_State *L);
145 extern "C" int enableLightingLua(lua_State *L);
146 extern "C" int setLightStaticLua(lua_State *L);
147 extern "C" int isLightStaticLua(lua_State *L);
152 extern "C" int createEntityLua(lua_State *L);
153 extern "C" int setEntityActiveLua(lua_State *L);
154 extern "C" int setEntityXLua(lua_State *L);
155 extern "C" int setEntityYLua(lua_State *L);
156 extern "C" int getEntityXLua(lua_State *L);
157 extern "C" int getEntityYLua(lua_State *L);
158 extern "C" int setEntityStaticLua(lua_State *L);
159 extern "C" int setEntityVelocityXLua(lua_State *L);
160 extern "C" int setEntityVelocityYLua(lua_State *L);
161 extern "C" int getEntityVelocityXLua(lua_State *L);
162 extern "C" int getEntityVelocityYLua(lua_State *L);
165 extern "C" int setEntityTextureLua(lua_State *L);
166 extern "C" int setEntityVisibleLua(lua_State *L);
167 extern "C" int getEntityTexWLua(lua_State *L);
168 extern "C" int getEntityTexHLua(lua_State *L);
169 extern "C" int setEntityTexWLua(lua_State *L);
170 extern "C" int setEntityTexHLua(lua_State *L);
171 extern "C" int setEntityTextureScaleLua(lua_State *L);
174 extern "C" int setEntityCollisionBoxLua(lua_State *L);
175 extern "C" int entityCollidesLua(lua_State *L);
176 extern "C" int setEntityAffectedByPhysicsLua(lua_State *L);
177 extern "C" int getEntityColXLua(lua_State *L);
178 extern "C" int getEntityColYLua(lua_State *L);
179 extern "C" int getEntityColXOffsetLua(lua_State *L);
180 extern "C" int getEntityColYOffsetLua(lua_State *L);
183 extern "C" int setEntityAnimationLua(lua_State *L);
184 extern "C" int setEntitySpriteNumLua(lua_State *L);
185 extern "C" int setEntityAnimationNumLua(lua_State *L);
188 extern "C" int mouseOverTextureLua(lua_State *L);
189 extern "C" int mouseOverLua(lua_State *L);
191 extern "C" int showCollisionsLua(lua_State *L);
192 extern "C" int logLua(lua_State *L);
193 extern "C" int showFpsLua(lua_State *L);
194 extern "C" int showMetricsLua(lua_State *L);
195 extern "C" int consoleClearLua(lua_State *);
This class is responsible for managing all levels and the lua backend, it is the heart of the engine.
Tests fixture for the lua_backend.
This class handles all interaction with lua.
void set_global(const std::string &arg)
int initialize(message_bus *msg_bus, game_manager *game_mngr)
int8_t load_file(const std::string &)
void run_global(const std::string &arg)
int8_t run_file(const std::string &file)
int8_t run_script(const std::string &script)
The central messaging system of the engine. All subsystem make extensive use of it.