mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 22:09:19 +02:00
build fixes, bump version, don't duplicate screen render requests
This commit is contained in:
@@ -11,7 +11,6 @@ file(GLOB HEADERS "*.h" "Console/*.h" "McZapkie/*.h")
|
|||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
"Texture.cpp"
|
"Texture.cpp"
|
||||||
"TextureDDS.cpp"
|
|
||||||
"Timer.cpp"
|
"Timer.cpp"
|
||||||
"Track.cpp"
|
"Track.cpp"
|
||||||
"Traction.cpp"
|
"Traction.cpp"
|
||||||
@@ -77,14 +76,12 @@ set(SOURCES
|
|||||||
"audiorenderer.cpp"
|
"audiorenderer.cpp"
|
||||||
"motiontelemetry.cpp"
|
"motiontelemetry.cpp"
|
||||||
"utilities.cpp"
|
"utilities.cpp"
|
||||||
"light.cpp"
|
|
||||||
"uitranscripts.cpp"
|
"uitranscripts.cpp"
|
||||||
"station.cpp"
|
"station.cpp"
|
||||||
"application.cpp"
|
"application.cpp"
|
||||||
"simulationtime.cpp"
|
"simulationtime.cpp"
|
||||||
"sceneeditor.cpp"
|
"sceneeditor.cpp"
|
||||||
"screenshot.cpp"
|
"screenshot.cpp"
|
||||||
"combustionengine.cpp"
|
|
||||||
"driverkeyboardinput.cpp"
|
"driverkeyboardinput.cpp"
|
||||||
"drivermode.cpp"
|
"drivermode.cpp"
|
||||||
"driveruilayer.cpp"
|
"driveruilayer.cpp"
|
||||||
|
|||||||
12
PyInt.cpp
12
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
|
// acquire a lock on the task queue and add a new task
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock( m_tasks.mutex );
|
std::lock_guard<std::mutex> 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 ) );
|
m_tasks.data.emplace_back( new render_task( renderer, Task.input, Task.target ) );
|
||||||
}
|
}
|
||||||
// potentially wake a worker to handle the new task
|
// potentially wake a worker to handle the new task
|
||||||
|
|||||||
1
PyInt.h
1
PyInt.h
@@ -44,6 +44,7 @@ public:
|
|||||||
{}
|
{}
|
||||||
// methods
|
// methods
|
||||||
void run();
|
void run();
|
||||||
|
const texture_handle get_target() const { return m_target; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// members
|
// members
|
||||||
|
|||||||
Reference in New Issue
Block a user