Skip to content

Commit

Permalink
Engine: poll videoplayers for a single-threaded build
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-mogilko committed Feb 28, 2024
1 parent 09e6684 commit afe77f0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Engine/ac/timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "platform/base/agsplatformdriver.h"
#if defined(AGS_DISABLE_THREADS)
#include "media/audio/audio_core.h"
#include "media/video/video_core.h"
#endif
#if AGS_PLATFORM_OS_EMSCRIPTEN
#include "SDL.h"
Expand Down Expand Up @@ -71,6 +72,7 @@ void WaitForNextFrame()
// Do the last polls on this frame, if necessary
#if defined(AGS_DISABLE_THREADS)
audio_core_entry_poll();
video_core_entry_poll();
#endif

const auto now = AGS_Clock::now();
Expand Down
3 changes: 0 additions & 3 deletions Engine/media/video/video_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,6 @@ PlaybackState video_core_slot_get_play_state(int slot_handle, float *pos_ms)

void video_core_entry_poll()
{
// burn off any errors for new loop
dump_al_errors();

for (auto &entry : g_vcore.slots_) {
auto &slot = entry.second;

Expand Down
1 change: 0 additions & 1 deletion Engine/media/video/video_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ std::unique_ptr<AGS::Common::Bitmap> video_core_slot_acquire_vframe(int slot_han
void video_core_slot_release_vframe(int slot_handle, std::unique_ptr<AGS::Common::Bitmap> frame);

#if defined(AGS_DISABLE_THREADS)
// TODO this!!
// Polls the video core if we have no threads, polled in WaitForNextFrame() ?
void video_core_entry_poll();
#endif
Expand Down

0 comments on commit afe77f0

Please sign in to comment.