Skip to content

Commit

Permalink
Merge pull request #716 from ali1234/multiplayer_threadsafe_sdl
Browse files Browse the repository at this point in the history
SDL: Call multiplayer->update() from the user code thread
  • Loading branch information
Gadgetoid authored Oct 7, 2021
2 parents a8b4e3d + e8876fc commit e78a346
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion 32blit-sdl/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ void handle_event(SDL_Event &event) {

default:
if(event.type == System::loop_event) {
blit_multiplayer->update();
blit_renderer->update(blit_system);
blit_system->notify_redraw();
blit_renderer->present();
Expand Down
3 changes: 2 additions & 1 deletion 32blit-sdl/System.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,14 +269,15 @@ void System::loop()
blit::joystick.y = shadow_joystick[1];
SDL_UnlockMutex(m_input);
blit::tick(::now());
blit::render(::now());
blit_multiplayer->update();
}

Uint32 System::mode() {
return _mode;
}

void System::update_texture(SDL_Texture *texture) {
blit::render(::now());
if (_mode == blit::ScreenMode::lores) {
SDL_UpdateTexture(texture, nullptr, __fb_lores.data, 160 * 3);
}
Expand Down

0 comments on commit e78a346

Please sign in to comment.