diff --git a/CMakeLists.txt b/CMakeLists.txt index 8594201e..583523e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,6 @@ file(GLOB HEADERS "*.h" "Console/*.h" "McZapkie/*.h") set(SOURCES "Texture.cpp" -"TextureDDS.cpp" "Timer.cpp" "Track.cpp" "Traction.cpp" @@ -77,14 +76,12 @@ set(SOURCES "audiorenderer.cpp" "motiontelemetry.cpp" "utilities.cpp" -"light.cpp" "uitranscripts.cpp" "station.cpp" "application.cpp" "simulationtime.cpp" "sceneeditor.cpp" "screenshot.cpp" -"combustionengine.cpp" "driverkeyboardinput.cpp" "drivermode.cpp" "driveruilayer.cpp" diff --git a/PyInt.cpp b/PyInt.cpp index caa2868c..cee7c8d6 100644 --- a/PyInt.cpp +++ b/PyInt.cpp @@ -160,6 +160,18 @@ auto python_taskqueue::insert( task_request const &Task ) -> bool { // acquire a lock on the task queue and add a new task { std::lock_guard lock( m_tasks.mutex ); + + // if task for this target already exists, don't add another + for (render_task *task : m_tasks.data) + if (task->get_target() == Task.target) + { + PyEval_AcquireLock(); + Py_DECREF(Task.input); + PyEval_ReleaseLock(); + + return false; + } + m_tasks.data.emplace_back( new render_task( renderer, Task.input, Task.target ) ); } // potentially wake a worker to handle the new task diff --git a/PyInt.h b/PyInt.h index e47a9f62..2120d368 100644 --- a/PyInt.h +++ b/PyInt.h @@ -44,6 +44,7 @@ public: {} // methods void run(); + const texture_handle get_target() const { return m_target; } private: // members diff --git a/version.h b/version.h index dcd11012..e2583983 100644 --- a/version.h +++ b/version.h @@ -1 +1 @@ -#define VERSION_INFO "M7 12.10.2018, based on tmj-44b652c" +#define VERSION_INFO "M7 13.10.2018, based on tmj-68f82be4"