qmlfrontend/engine_instance.cpp
changeset 14713 cc6ab1e3f7d5
parent 14373 4409344db447
child 14854 aed75d439027
--- a/qmlfrontend/engine_instance.cpp	Fri Mar 22 21:06:12 2019 +0100
+++ b/qmlfrontend/engine_instance.cpp	Fri Mar 22 21:29:10 2019 +0100
@@ -41,11 +41,13 @@
       reinterpret_cast<Engine::render_frame_t*>(hwlib.resolve("render_frame"));
   advance_simulation = reinterpret_cast<Engine::advance_simulation_t*>(
       hwlib.resolve("advance_simulation"));
+  move_camera =
+      reinterpret_cast<Engine::move_camera_t*>(hwlib.resolve("move_camera"));
 
   m_isValid = hedgewars_engine_protocol_version && start_engine &&
               generate_preview && dispose_preview && cleanup && send_ipc &&
               read_ipc && setup_current_gl_context && render_frame &&
-              advance_simulation;
+              advance_simulation && move_camera;
   emit isValidChanged(m_isValid);
 
   if (isValid()) {
@@ -53,6 +55,8 @@
              << hedgewars_engine_protocol_version();
 
     m_instance = start_engine();
+  } else {
+    qDebug("Engine library load failed");
   }
 }
 
@@ -71,6 +75,10 @@
   advance_simulation(m_instance, ticks);
 }
 
+void EngineInstance::moveCamera(const QPoint& delta) {
+  move_camera(m_instance, delta.x(), delta.y());
+}
+
 void EngineInstance::renderFrame() { render_frame(m_instance); }
 
 void EngineInstance::setOpenGLContext(QOpenGLContext* context) {