GBuffer video mem now blit directly to the backbuffer cpu array.

This commit is contained in:
Justin Marshall
2020-06-11 19:35:27 -07:00
parent f289eca079
commit 0a26a05572
4 changed files with 7 additions and 10 deletions
+2 -2
View File
@@ -502,7 +502,7 @@ BOOL GraphicBufferClass::Lock(void)
return(TRUE); return(TRUE);
} }
Offset = (unsigned long)rawCpuBuffer; // 32bit to 64bit issue here. Offset = (unsigned long)backbuffer_data_raw; // 32bit to 64bit issue here.
//Pitch = Width; //Pitch = Width;
LockCount++; // increment count so we can track if LockCount++; // increment count so we can track if
@@ -528,7 +528,7 @@ BOOL GraphicBufferClass::Lock(void)
BOOL GraphicBufferClass::Unlock(void) BOOL GraphicBufferClass::Unlock(void)
{ {
Video_Set_Data((unsigned char *)Get_Graphic_Buffer()->GetMemoryBuffer(), Width, Height); //Video_Set_Data((unsigned char *)Get_Graphic_Buffer()->GetMemoryBuffer(), Width, Height);
// //
// If there is no lock count or this is not a direct draw surface // If there is no lock count or this is not a direct draw surface
+4 -2
View File
@@ -137,6 +137,8 @@
#include <assert.h> #include <assert.h>
#include "iconcach.h" #include "iconcach.h"
extern unsigned char* backbuffer_data_raw;
#ifndef FUNCTION_H #ifndef FUNCTION_H
__forceinline void Nearest_Fill(unsigned char source, unsigned char* dest, int destX, int destY, int destWidth, int width, int height, bool trans) __forceinline void Nearest_Fill(unsigned char source, unsigned char* dest, int destX, int destY, int destWidth, int width, int height, bool trans)
@@ -414,13 +416,13 @@ class GraphicBufferClass : public GraphicViewPortClass, public BufferClass {
if (!rawCpuBuffer) if (!rawCpuBuffer)
return (unsigned char* )Buffer; return (unsigned char* )Buffer;
return rawCpuBuffer; return backbuffer_data_raw;
} }
// jmarshall // jmarshall
void* GetMemoryBuffer(void) { void* GetMemoryBuffer(void) {
if (!rawCpuBuffer) if (!rawCpuBuffer)
return Buffer; return Buffer;
return rawCpuBuffer; return backbuffer_data_raw;
} }
// jmarshall end // jmarshall end
-1
View File
@@ -50,7 +50,6 @@
/*=========================================================================*/ /*=========================================================================*/
void Process_DD_Result(HRESULT result, int display_ok_msg); void Process_DD_Result(HRESULT result, int display_ok_msg);
BOOL Set_Video_Mode(HWND hwnd, int w, int h, int bits_per_pixel); BOOL Set_Video_Mode(HWND hwnd, int w, int h, int bits_per_pixel);
void Video_Set_Data(unsigned char* buffer, int width, int height);
void Reset_Video_Mode(void); void Reset_Video_Mode(void);
unsigned Get_Free_Video_Memory(void); unsigned Get_Free_Video_Memory(void);
void Wait_Blit(void); void Wait_Blit(void);
+1 -5
View File
@@ -62,7 +62,7 @@
GLuint backbuffer_texture = -1; GLuint backbuffer_texture = -1;
byte* backbuffer_data; byte* backbuffer_data;
byte* backbuffer_data_raw; unsigned char* backbuffer_data_raw;
byte backbuffer_palette[768]; byte backbuffer_palette[768];
HWND MainWindow; HWND MainWindow;
SurfaceMonitorClass AllSurfaces; SurfaceMonitorClass AllSurfaces;
@@ -70,10 +70,6 @@ SDL_Window* game_window;
SDL_GLContext game_context; SDL_GLContext game_context;
int OverlappedVideoBlits = 0; int OverlappedVideoBlits = 0;
void Video_Set_Data(unsigned char* buffer, int width, int height) {
memcpy(backbuffer_data_raw, buffer, width * height);
}
void (*Misc_Focus_Loss_Function)(void) = nullptr; void (*Misc_Focus_Loss_Function)(void) = nullptr;
void (*Misc_Focus_Restore_Function)(void) = nullptr; void (*Misc_Focus_Restore_Function)(void) = nullptr;