mirror of
https://github.com/jmarshall23/CnC_Remastered_Collection.git
synced 2026-08-12 08:00:55 +02:00
Scorescreen no longer crashes but page flips all over the place. Disable color clear each frame.
This commit is contained in:
@@ -413,6 +413,7 @@ void ScoreClass::Presentation(void)
|
||||
#endif
|
||||
BlackPalette.Set();
|
||||
|
||||
Show_OldFrameBuffer(false);
|
||||
|
||||
void const * country4 = MFCD::Retrieve("COUNTRY4.AUD");
|
||||
void const * sfx4 = MFCD::Retrieve("SFX4.AUD");
|
||||
@@ -866,6 +867,8 @@ Keyboard->Clear();
|
||||
#endif //FIXIT
|
||||
|
||||
#endif
|
||||
|
||||
Show_OldFrameBuffer(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1294,5 +1294,6 @@ inline long BufferClass::To_Page(int x, int y, int w, int h, GraphicViewPortClas
|
||||
return ( return_code );
|
||||
}
|
||||
|
||||
void Show_OldFrameBuffer(bool show);
|
||||
|
||||
#endif
|
||||
|
||||
+24
-17
@@ -80,6 +80,14 @@ void (*Misc_Focus_Restore_Function)(void) = nullptr;
|
||||
|
||||
void (*Imgui_Dialog_Function)(void) = nullptr;
|
||||
|
||||
bool show_oldframebuffer = true;
|
||||
void Show_OldFrameBuffer(bool show) {
|
||||
show_oldframebuffer = show;
|
||||
glClearColor(0, 0, 0, 1);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
memset(backbuffer_data, 0, ScreenWidth * ScreenHeight * 4);
|
||||
}
|
||||
|
||||
std::vector<Image_t *> loaded_images;
|
||||
|
||||
Image_t* Image_LoadImage(const char* name) {
|
||||
@@ -166,8 +174,8 @@ void Set_DD_Palette(void* palette, bool raShift)
|
||||
|
||||
void ImGui_NewFrame(void) {
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
glClearColor(0, 0, 0, 1);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
//glClearColor(0, 0, 0, 1);
|
||||
//glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
io.DisplaySize = ImVec2(ScreenWidth, ScreenHeight);
|
||||
ImGui_ImplOpenGL3_NewFrame();
|
||||
@@ -176,27 +184,26 @@ void ImGui_NewFrame(void) {
|
||||
ImGui_ImplSDL2_NewFrame(game_window);
|
||||
}
|
||||
|
||||
void Device_Present(void) {
|
||||
|
||||
|
||||
// Rasterize the palette.
|
||||
for (int i = 0; i < ScreenWidth * ScreenHeight; i++) {
|
||||
backbuffer_data[(i * 4) + 0] = backbuffer_palette[(backbuffer_data_raw[i] * 3) + 0];
|
||||
backbuffer_data[(i * 4) + 1] = backbuffer_palette[(backbuffer_data_raw[i] * 3) + 1];
|
||||
backbuffer_data[(i * 4) + 2] = backbuffer_palette[(backbuffer_data_raw[i] * 3) + 2];
|
||||
backbuffer_data[(i * 4) + 3] = 255;
|
||||
}
|
||||
glBindTexture(GL_TEXTURE_2D, backbuffer_texture);
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, ScreenWidth, ScreenHeight, GL_RGBA, GL_UNSIGNED_BYTE, backbuffer_data);
|
||||
|
||||
void Device_Present(void) {
|
||||
// Use imgui to render the screenbuffer.
|
||||
{
|
||||
if(show_oldframebuffer)
|
||||
{
|
||||
// Rasterize the palette.
|
||||
for (int i = 0; i < ScreenWidth * ScreenHeight; i++) {
|
||||
backbuffer_data[(i * 4) + 0] = backbuffer_palette[(backbuffer_data_raw[i] * 3) + 0];
|
||||
backbuffer_data[(i * 4) + 1] = backbuffer_palette[(backbuffer_data_raw[i] * 3) + 1];
|
||||
backbuffer_data[(i * 4) + 2] = backbuffer_palette[(backbuffer_data_raw[i] * 3) + 2];
|
||||
backbuffer_data[(i * 4) + 3] = 255;
|
||||
}
|
||||
glBindTexture(GL_TEXTURE_2D, backbuffer_texture);
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, ScreenWidth, ScreenHeight, GL_RGBA, GL_UNSIGNED_BYTE, backbuffer_data);
|
||||
|
||||
bool ScreenActive;
|
||||
ImGuiStyle& style = ImGui::GetStyle();
|
||||
style.FramePadding = ImVec2(0, 0);
|
||||
ImGui::SetNextWindowSize(ImVec2(ScreenWidth, ScreenHeight));
|
||||
ImGui::SetNextWindowPos(ImVec2(0, 0));
|
||||
ImGui::Begin("RenderWindow", &ScreenActive, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoScrollbar);
|
||||
ImGui::Begin("RenderWindow", &ScreenActive, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoMouseInputs);
|
||||
ImVec2 desktopSize(ScreenWidth, ScreenHeight);
|
||||
ImGui::Image((ImTextureID)backbuffer_texture, desktopSize);
|
||||
ImGui::End();
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.0 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 944 KiB |
Reference in New Issue
Block a user