Fix issue with bad frames changing the frame type of previous frames
Some checks failed
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linux32 flags:32 name:Linux GCC 32 os:ubuntu-latest]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linux64 flags:64 name:Linux GCC x64 os:ubuntu-latest]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linuxarm32 flags:arm32 name:Linux GCC ARM 32 os:ubuntu-latest]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linuxarm64 flags:arm64 name:Linux GCC ARM 64 os:ubuntu-latest]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:macos name:macOS Apple Silicon os:macos-14]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:win32 flags:-A Win32 -DCMAKE_PARALLEL_MSVC=TRUE name:Windows VS2022 Win32 os:windows-2022]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:win64 flags:-A x64 -DCMAKE_PARALLEL_MSVC=TRUE name:Windows VS2022 x64 os:windows-2022]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:winarm64 flags:-A ARM64 -DCMAKE_PARALLEL_MSVC=TRUE name:Windows VS2022 ARM os:windows-2022]) (push) Has been cancelled
CD / Create Pi Mono Setup (push) Has been cancelled
CD / Publishing (push) Has been cancelled

This commit is contained in:
Lorenzooone
2026-02-08 21:43:23 +01:00
parent 4bfc14dc1c
commit c570f68e6d
4 changed files with 25 additions and 20 deletions

View File

@@ -284,7 +284,7 @@ void WindowScreen::after_thread_join() {
}
}
void WindowScreen::draw(double frame_time, VideoOutputData* out_buf, InputVideoDataType video_data_type) {
void WindowScreen::draw(double frame_time, VideoOutputData* out_buf, InputVideoDataType video_data_type, bool update_rendered_buffer) {
FPSArrayInsertElement(&this->in_fps, frame_time);
if(!this->done_display)
return;
@@ -323,13 +323,17 @@ void WindowScreen::draw(double frame_time, VideoOutputData* out_buf, InputVideoD
FPSArrayInsertElement(&this->draw_fps, diff.count());
this->last_draw_time = curr_time;
WindowScreen::reset_operations(future_operations);
if(out_buf != NULL)
memcpy(this->saved_buf, out_buf, sizeof(VideoOutputData));
else {
memset(this->saved_buf, 0, sizeof(VideoOutputData));
this->was_last_frame_null = true;
if(update_rendered_buffer) {
if(out_buf != NULL) {
memcpy(this->saved_buf, out_buf, sizeof(VideoOutputData));
this->was_last_frame_null = false;
}
else {
memset(this->saved_buf, 0, sizeof(VideoOutputData));
this->was_last_frame_null = true;
}
this->curr_video_data_type = video_data_type;
}
this->curr_video_data_type = video_data_type;
loaded_info = m_info;
m_info.initial_pos_x = DEFAULT_NO_POS_WINDOW_VALUE;
m_info.initial_pos_y = DEFAULT_NO_POS_WINDOW_VALUE;
@@ -892,10 +896,8 @@ int WindowScreen::_choose_base_input_shader(bool is_top) {
}
int WindowScreen::_choose_shader(PossibleShaderTypes shader_type, bool is_top) {
if(this->was_last_frame_null) {
this->was_last_frame_null = false;
if(this->was_last_frame_null)
return NO_EFFECT_FRAGMENT_SHADER;
}
switch(shader_type) {
case BASE_FINAL_OUTPUT_SHADER_TYPE:
return NO_EFFECT_FRAGMENT_SHADER;