- removed Accel2D variable and a little bit of locking cruft.

This commit is contained in:
Christoph Oelckers 2018-03-27 17:13:10 +02:00
parent cff5f0e3c7
commit 62f073ef60
21 changed files with 35 additions and 257 deletions

View file

@ -1211,11 +1211,8 @@ void DBaseStatusBar::BlendView (float blend[4])
V_AddBlend (BaseBlendR / 255.f, BaseBlendG / 255.f, BaseBlendB / 255.f, cnt, blend); V_AddBlend (BaseBlendR / 255.f, BaseBlendG / 255.f, BaseBlendB / 255.f, cnt, blend);
V_AddPlayerBlend(CPlayer, blend, 1.0f, 228); V_AddPlayerBlend(CPlayer, blend, 1.0f, 228);
if (screen->Accel2D || (CPlayer->camera != NULL && menuactive == MENU_Off && ConsoleState == c_up)) player_t *player = (CPlayer->camera != NULL && CPlayer->camera->player != NULL) ? CPlayer->camera->player : CPlayer;
{ V_AddBlend (player->BlendR, player->BlendG, player->BlendB, player->BlendA, blend);
player_t *player = (CPlayer->camera != NULL && CPlayer->camera->player != NULL) ? CPlayer->camera->player : CPlayer;
V_AddBlend (player->BlendR, player->BlendG, player->BlendB, player->BlendA, blend);
}
V_SetBlend ((int)(blend[0] * 255.0f), (int)(blend[1] * 255.0f), V_SetBlend ((int)(blend[0] * 255.0f), (int)(blend[1] * 255.0f),
(int)(blend[2] * 255.0f), (int)(blend[3] * 256.0f)); (int)(blend[2] * 255.0f), (int)(blend[3] * 256.0f));

View file

@ -100,7 +100,6 @@ OpenGLFrameBuffer::OpenGLFrameBuffer(void *hMonitor, int width, int height, int
gl_SetupMenu(); gl_SetupMenu();
gl_GenerateGlobalBrightmapFromColormap(); gl_GenerateGlobalBrightmapFromColormap();
DoSetGamma(); DoSetGamma();
Accel2D = true;
} }
OpenGLFrameBuffer::~OpenGLFrameBuffer() OpenGLFrameBuffer::~OpenGLFrameBuffer()

View file

@ -157,7 +157,6 @@ OpenGLSWFrameBuffer::OpenGLSWFrameBuffer(void *hMonitor, int width, int height,
In2D = 0; In2D = 0;
Palettes = nullptr; Palettes = nullptr;
Textures = nullptr; Textures = nullptr;
Accel2D = true;
GatheringWipeScreen = false; GatheringWipeScreen = false;
ScreenWipe = nullptr; ScreenWipe = nullptr;
InScene = false; InScene = false;
@ -1123,7 +1122,6 @@ bool OpenGLSWFrameBuffer::Lock(bool buffered)
return false; return false;
} }
assert(!In2D); assert(!In2D);
Accel2D = vid_hw2d;
#if 0 // temporarily disabled. Must be fixed later #if 0 // temporarily disabled. Must be fixed later
if (UseMappedMemBuffer) if (UseMappedMemBuffer)
@ -1209,17 +1207,6 @@ void OpenGLSWFrameBuffer::Update()
return; return;
} }
if (m_Lock != 1)
{
I_FatalError("Framebuffer must have exactly 1 lock to be updated");
if (m_Lock > 0)
{
UpdatePending = true;
--m_Lock;
}
return;
}
if (In2D == 0) if (In2D == 0)
{ {
DrawRateStuff(); DrawRateStuff();
@ -1258,7 +1245,6 @@ void OpenGLSWFrameBuffer::Update()
BlitCycles.Clock(); BlitCycles.Clock();
#endif #endif
m_Lock = 0;
Draw3DPart(In2D <= 1); Draw3DPart(In2D <= 1);
if (In2D == 0) if (In2D == 0)
{ {
@ -1316,10 +1302,6 @@ void OpenGLSWFrameBuffer::Flip()
bool OpenGLSWFrameBuffer::PaintToWindow() bool OpenGLSWFrameBuffer::PaintToWindow()
{ {
if (m_Lock != 0)
{
return false;
}
Draw3DPart(true); Draw3DPart(true);
return true; return true;
} }
@ -1446,30 +1428,22 @@ void OpenGLSWFrameBuffer::Draw3DPart(bool copy3d)
{ {
FBVERTEX verts[4]; FBVERTEX verts[4];
uint32_t color0, color1; uint32_t color0, color1;
if (Accel2D) auto map = swrenderer::CameraLight::Instance()->ShaderColormap();
if (map == nullptr)
{ {
auto map = swrenderer::CameraLight::Instance()->ShaderColormap(); color0 = 0;
if (map == nullptr) color1 = 0xFFFFFFF;
{
color0 = 0;
color1 = 0xFFFFFFF;
}
else
{
color0 = ColorValue(map->ColorizeStart[0] / 2, map->ColorizeStart[1] / 2, map->ColorizeStart[2] / 2, 0);
color1 = ColorValue(map->ColorizeEnd[0] / 2, map->ColorizeEnd[1] / 2, map->ColorizeEnd[2] / 2, 1);
if (IsBgra())
SetPixelShader(Shaders[SHADER_SpecialColormap].get());
else
SetPixelShader(Shaders[SHADER_SpecialColormapPal].get());
}
} }
else else
{ {
color0 = FlashColor0; color0 = ColorValue(map->ColorizeStart[0] / 2, map->ColorizeStart[1] / 2, map->ColorizeStart[2] / 2, 0);
color1 = FlashColor1; color1 = ColorValue(map->ColorizeEnd[0] / 2, map->ColorizeEnd[1] / 2, map->ColorizeEnd[2] / 2, 1);
if (IsBgra())
SetPixelShader(Shaders[SHADER_SpecialColormap].get());
else
SetPixelShader(Shaders[SHADER_SpecialColormapPal].get());
} }
CalcFullscreenCoords(verts, Accel2D, color0, color1); CalcFullscreenCoords(verts, true, color0, color1);
DrawTriangleFans(2, verts); DrawTriangleFans(2, verts);
} }
if (IsBgra()) if (IsBgra())
@ -1666,11 +1640,6 @@ void OpenGLSWFrameBuffer::GetScreenshotBuffer(const uint8_t *&buffer, int &pitch
/* /*
LockedRect lrect; LockedRect lrect;
if (!Accel2D)
{
Super::GetScreenshotBuffer(buffer, pitch, color_type, gamma);
return;
}
buffer = nullptr; buffer = nullptr;
if ((ScreenshotTexture = GetCurrentScreen()) != nullptr) if ((ScreenshotTexture = GetCurrentScreen()) != nullptr)
{ {
@ -1705,10 +1674,6 @@ void OpenGLSWFrameBuffer::GetScreenshotBuffer(const uint8_t *&buffer, int &pitch
void OpenGLSWFrameBuffer::ReleaseScreenshotBuffer() void OpenGLSWFrameBuffer::ReleaseScreenshotBuffer()
{ {
if (m_Lock > 0)
{
Super::ReleaseScreenshotBuffer();
}
ScreenshotTexture.reset(); ScreenshotTexture.reset();
} }
@ -2071,10 +2036,6 @@ bool OpenGLSWFrameBuffer::OpenGLPal::Update()
bool OpenGLSWFrameBuffer::Begin2D(bool copy3d) bool OpenGLSWFrameBuffer::Begin2D(bool copy3d)
{ {
Super::Begin2D(copy3d); Super::Begin2D(copy3d);
if (!Accel2D)
{
return false;
}
if (In2D) if (In2D)
{ {
return true; return true;
@ -2096,10 +2057,6 @@ bool OpenGLSWFrameBuffer::Begin2D(bool copy3d)
void OpenGLSWFrameBuffer::DrawBlendingRect() void OpenGLSWFrameBuffer::DrawBlendingRect()
{ {
if (!In2D || !Accel2D)
{
return;
}
Dim(FlashColor, FlashAmount / 256.f, viewwindowx, viewwindowy, viewwidth, viewheight); Dim(FlashColor, FlashAmount / 256.f, viewwindowx, viewwindowy, viewwidth, viewheight);
} }

View file

@ -122,11 +122,6 @@ private:
bool OpenGLSWFrameBuffer::WipeStartScreen(int type) bool OpenGLSWFrameBuffer::WipeStartScreen(int type)
{ {
if (!Accel2D)
{
return Super::WipeStartScreen(type);
}
switch (type) switch (type)
{ {
case wipe_Melt: case wipe_Melt:
@ -164,12 +159,6 @@ bool OpenGLSWFrameBuffer::WipeStartScreen(int type)
void OpenGLSWFrameBuffer::WipeEndScreen() void OpenGLSWFrameBuffer::WipeEndScreen()
{ {
if (!Accel2D)
{
Super::WipeEndScreen();
return;
}
// Don't do anything if there is no starting point. // Don't do anything if there is no starting point.
if (InitialWipeScreen == NULL) if (InitialWipeScreen == NULL)
{ {
@ -206,11 +195,6 @@ void OpenGLSWFrameBuffer::WipeEndScreen()
bool OpenGLSWFrameBuffer::WipeDo(int ticks) bool OpenGLSWFrameBuffer::WipeDo(int ticks)
{ {
if (!Accel2D)
{
return Super::WipeDo(ticks);
}
// Sanity checks. // Sanity checks.
if (InitialWipeScreen == NULL || FinalWipeScreen == NULL) if (InitialWipeScreen == NULL || FinalWipeScreen == NULL)
{ {
@ -250,11 +234,6 @@ void OpenGLSWFrameBuffer::WipeCleanup()
InitialWipeScreen.reset(); InitialWipeScreen.reset();
FinalWipeScreen.reset(); FinalWipeScreen.reset();
GatheringWipeScreen = false; GatheringWipeScreen = false;
if (!Accel2D)
{
Super::WipeCleanup();
return;
}
} }
//========================================================================== //==========================================================================

View file

@ -778,16 +778,6 @@ void M_Drawer (void)
AActor *camera = player->camera; AActor *camera = player->camera;
PalEntry fade = 0; PalEntry fade = 0;
if (!screen->Accel2D && camera != nullptr && (gamestate == GS_LEVEL || gamestate == GS_TITLELEVEL))
{
if (camera->player != nullptr)
{
player = camera->player;
}
fade = PalEntry (uint8_t(player->BlendA*255), uint8_t(player->BlendR*255), uint8_t(player->BlendG*255), uint8_t(player->BlendB*255));
}
if (CurrentMenu != nullptr && menuactive != MENU_Off) if (CurrentMenu != nullptr && menuactive != MENU_Off)
{ {
if (GLRenderer) if (GLRenderer)

View file

@ -70,15 +70,6 @@ void PolyRenderer::RenderView(player_t *player)
RenderActorView(player->mo, false); RenderActorView(player->mo, false);
#if 0
// Apply special colormap if the target cannot do it
CameraLight *cameraLight = CameraLight::Instance();
if (cameraLight->ShaderColormap() && RenderTarget->IsBgra() && !(r_shadercolormaps && screen->Accel2D))
{
Threads.MainThread()->DrawQueue->Push<ApplySpecialColormapRGBACommand>(cameraLight->ShaderColormap(), screen);
}
#endif
Threads.MainThread()->FlushDrawQueue(); Threads.MainThread()->FlushDrawQueue();
DrawerThreads::WaitForWorkers(); DrawerThreads::WaitForWorkers();
} }

View file

@ -418,7 +418,7 @@ void RenderPolyPlayerSprites::RenderSprite(PolyRenderThread *thread, DPSprite *p
// Check for hardware-assisted 2D. If it's available, and this sprite is not // Check for hardware-assisted 2D. If it's available, and this sprite is not
// fuzzy, don't draw it until after the switch to 2D mode. // fuzzy, don't draw it until after the switch to 2D mode.
if (!noaccel && renderTarget == screencanvas && (DFrameBuffer *)screen->Accel2D) if (!noaccel && renderTarget == screencanvas)
{ {
FRenderStyle style = vis.RenderStyle; FRenderStyle style = vis.RenderStyle;
style.CheckFuzz(); style.CheckFuzz();

View file

@ -791,7 +791,6 @@ CocoaVideo* CocoaVideo::GetInstance()
SDLGLFB::SDLGLFB(void*, const int width, const int height, int, int, const bool fullscreen, bool bgra) SDLGLFB::SDLGLFB(void*, const int width, const int height, int, int, const bool fullscreen, bool bgra)
: DFrameBuffer(width, height, bgra) : DFrameBuffer(width, height, bgra)
, m_Lock(0)
, UpdatePending(false) , UpdatePending(false)
{ {
CGGammaValue gammaTable[GAMMA_TABLE_SIZE]; CGGammaValue gammaTable[GAMMA_TABLE_SIZE];
@ -818,28 +817,6 @@ SDLGLFB::~SDLGLFB()
{ {
} }
bool SDLGLFB::Lock(bool buffered)
{
m_Lock++;
Buffer = MemBuffer;
return true;
}
void SDLGLFB::Unlock()
{
if (UpdatePending && 1 == m_Lock)
{
Update();
}
else if (--m_Lock <= 0)
{
m_Lock = 0;
}
}
bool SDLGLFB::IsFullscreen() bool SDLGLFB::IsFullscreen()
{ {
return CocoaVideo::IsFullscreen(); return CocoaVideo::IsFullscreen();
@ -858,6 +835,7 @@ void SDLGLFB::InitializeState()
{ {
} }
#if 0
bool SDLGLFB::CanUpdate() bool SDLGLFB::CanUpdate()
{ {
if (m_Lock != 1) if (m_Lock != 1)
@ -873,6 +851,7 @@ bool SDLGLFB::CanUpdate()
return true; return true;
} }
#endif
void SDLGLFB::SwapBuffers() void SDLGLFB::SwapBuffers()
{ {

View file

@ -55,9 +55,6 @@ public:
SDLGLFB(void *hMonitor, int width, int height, int, int, bool fullscreen, bool bgra); SDLGLFB(void *hMonitor, int width, int height, int, int, bool fullscreen, bool bgra);
~SDLGLFB(); ~SDLGLFB();
virtual bool Lock(bool buffered = true);
virtual void Unlock();
virtual bool IsFullscreen(); virtual bool IsFullscreen();
virtual void SetVSync(bool vsync); virtual void SetVSync(bool vsync);
@ -66,7 +63,6 @@ public:
virtual int GetTrueHeight() { return GetClientHeight(); } virtual int GetTrueHeight() { return GetClientHeight(); }
protected: protected:
int m_Lock;
bool UpdatePending; bool UpdatePending;
static const uint32_t GAMMA_CHANNEL_SIZE = 256; static const uint32_t GAMMA_CHANNEL_SIZE = 256;

View file

@ -374,7 +374,6 @@ SDLGLFB::SDLGLFB (void *, int width, int height, int, int, bool fullscreen, bool
int glveridx = 0; int glveridx = 0;
int i; int i;
m_Lock=0;
UpdatePending = false; UpdatePending = false;
const char *version = Args->CheckValue("-glversion"); const char *version = Args->CheckValue("-glversion");
@ -447,6 +446,7 @@ void SDLGLFB::InitializeState()
{ {
} }
#if 0
bool SDLGLFB::CanUpdate () bool SDLGLFB::CanUpdate ()
{ {
if (m_Lock != 1) if (m_Lock != 1)
@ -460,6 +460,7 @@ bool SDLGLFB::CanUpdate ()
} }
return true; return true;
} }
#endif
void SDLGLFB::SetGammaTable(uint16_t *tbl) void SDLGLFB::SetGammaTable(uint16_t *tbl)
{ {
@ -477,30 +478,6 @@ void SDLGLFB::ResetGammaTable()
} }
} }
bool SDLGLFB::Lock(bool buffered)
{
m_Lock++;
Buffer = MemBuffer;
return true;
}
bool SDLGLFB::Lock ()
{
return Lock(false);
}
void SDLGLFB::Unlock ()
{
if (UpdatePending && m_Lock == 1)
{
Update ();
}
else if (--m_Lock <= 0)
{
m_Lock = 0;
}
}
bool SDLGLFB::IsFullscreen () bool SDLGLFB::IsFullscreen ()
{ {
return (SDL_GetWindowFlags (Screen) & SDL_WINDOW_FULLSCREEN_DESKTOP) != 0; return (SDL_GetWindowFlags (Screen) & SDL_WINDOW_FULLSCREEN_DESKTOP) != 0;

View file

@ -91,7 +91,6 @@ protected:
void UpdateColors (); void UpdateColors ();
int m_Lock;
Uint16 m_origGamma[3][256]; Uint16 m_origGamma[3][256];
bool m_supportsGamma; bool m_supportsGamma;
}; };

View file

@ -69,17 +69,10 @@ namespace swrenderer
if (player->fixedcolormap >= 0 && player->fixedcolormap < (int)SpecialColormaps.Size()) if (player->fixedcolormap >= 0 && player->fixedcolormap < (int)SpecialColormaps.Size())
{ {
realfixedcolormap = &SpecialColormaps[player->fixedcolormap]; realfixedcolormap = &SpecialColormaps[player->fixedcolormap];
if (renderTarget == screen->GetCanvas() && (renderTarget->IsBgra() || ((DFrameBuffer *)screen->Accel2D && r_shadercolormaps))) // Render everything fullbright. The copy to video memory will
{ // apply the special colormap, so it won't be restricted to the
// Render everything fullbright. The copy to video memory will // palette.
// apply the special colormap, so it won't be restricted to the fixedcolormap = &realcolormaps;
// palette.
fixedcolormap = &realcolormaps;
}
else
{
fixedcolormap = &SpecialSWColormaps[player->fixedcolormap];
}
} }
else if (player->fixedlightlevel >= 0 && player->fixedlightlevel < NUMCOLORMAPS) else if (player->fixedlightlevel >= 0 && player->fixedlightlevel < NUMCOLORMAPS)
{ {

View file

@ -884,9 +884,8 @@ namespace swrenderer
void RenderOpaquePass::ClearClip() void RenderOpaquePass::ClearClip()
{ {
// clip ceiling to console bottom
fillshort(floorclip, viewwidth, viewheight); fillshort(floorclip, viewwidth, viewheight);
fillshort(ceilingclip, viewwidth, !screen->Accel2D && ConBottom > viewwindowy && !Thread->Viewport->RenderingToCanvas() ? (ConBottom - viewwindowy) : 0); fillshort(ceilingclip, viewwidth, 0);
} }
void RenderOpaquePass::AddSprites(sector_t *sec, int lightlevel, WaterFakeSide fakeside, bool foggy, FDynamicColormap *basecolormap) void RenderOpaquePass::AddSprites(sector_t *sec, int lightlevel, WaterFakeSide fakeside, bool foggy, FDynamicColormap *basecolormap)

View file

@ -117,16 +117,6 @@ namespace swrenderer
RenderActorView(player->mo); RenderActorView(player->mo);
// Apply special colormap if the target cannot do it
#if 0
if (CameraLight::Instance()->ShaderColormap() && viewport->RenderTarget->IsBgra() && !(r_shadercolormaps && screen->Accel2D))
{
auto queue = std::make_shared<DrawerCommandQueue>(MainThread()->FrameMemory.get());
queue->Push<ApplySpecialColormapRGBACommand>(CameraLight::Instance()->ShaderColormap(), screen);
DrawerThreads::Execute(queue);
}
#endif
DrawerWaitCycles.Clock(); DrawerWaitCycles.Clock();
DrawerThreads::WaitForWorkers(); DrawerThreads::WaitForWorkers();
DrawerWaitCycles.Unclock(); DrawerWaitCycles.Unclock();

View file

@ -420,7 +420,7 @@ namespace swrenderer
// Check for hardware-assisted 2D. If it's available, and this sprite is not // Check for hardware-assisted 2D. If it's available, and this sprite is not
// fuzzy, don't draw it until after the switch to 2D mode. // fuzzy, don't draw it until after the switch to 2D mode.
if (!noaccel && viewport->RenderTarget == screencanvas && (DFrameBuffer *)screen->Accel2D) if (!noaccel && viewport->RenderTarget == screencanvas)
{ {
FRenderStyle style = vis.RenderStyle; FRenderStyle style = vis.RenderStyle;
style.CheckFuzz(); style.CheckFuzz();

View file

@ -610,7 +610,6 @@ DFrameBuffer::DFrameBuffer (int width, int height, bool bgra)
Bgra = bgra; Bgra = bgra;
LastMS = LastSec = FrameCount = LastCount = LastTic = 0; LastMS = LastSec = FrameCount = LastCount = LastTic = 0;
Accel2D = false;
VideoWidth = width; VideoWidth = width;
VideoHeight = height; VideoHeight = height;

View file

@ -279,7 +279,6 @@ protected:
bool ParseDrawTextureTags(FTexture *img, double x, double y, uint32_t tag, T& tags, DrawParms *parms, bool fortext) const; bool ParseDrawTextureTags(FTexture *img, double x, double y, uint32_t tag, T& tags, DrawParms *parms, bool fortext) const;
void DrawTextCommon(FFont *font, int normalcolor, double x, double y, const char *string, DrawParms &parms); void DrawTextCommon(FFont *font, int normalcolor, double x, double y, const char *string, DrawParms &parms);
int LockCount = 0;
int Width = 0; int Width = 0;
int Height = 0; int Height = 0;
bool Bgra = 0; bool Bgra = 0;
@ -340,7 +339,6 @@ public:
// Set the rect defining the area affected by blending. // Set the rect defining the area affected by blending.
virtual void SetBlendingRect (int x1, int y1, int x2, int y2); virtual void SetBlendingRect (int x1, int y1, int x2, int y2);
bool Accel2D; // If true, 2D drawing can be accelerated.
virtual bool LegacyHardware() const { return false; } // only for reporting SM1.4 support to the stat collector virtual bool LegacyHardware() const { return false; } // only for reporting SM1.4 support to the stat collector
// Begin 2D drawing operations. This is like Update, but it doesn't end // Begin 2D drawing operations. This is like Update, but it doesn't end

View file

@ -241,7 +241,6 @@ D3DFB::D3DFB (UINT adapter, int width, int height, bool bgra, bool fullscreen)
In2D = 0; In2D = 0;
Palettes = NULL; Palettes = NULL;
Textures = NULL; Textures = NULL;
Accel2D = true;
GatheringWipeScreen = false; GatheringWipeScreen = false;
ScreenWipe = NULL; ScreenWipe = NULL;
InScene = false; InScene = false;
@ -939,17 +938,6 @@ void D3DFB::Update ()
return; return;
} }
if (LockCount != 1)
{
I_FatalError ("Framebuffer must have exactly 1 lock to be updated");
if (LockCount > 0)
{
UpdatePending = true;
--LockCount;
}
return;
}
if (In2D == 0) if (In2D == 0)
{ {
DrawRateStuff(); DrawRateStuff();
@ -998,7 +986,6 @@ void D3DFB::Update ()
BlitCycles.Reset(); BlitCycles.Reset();
BlitCycles.Clock(); BlitCycles.Clock();
LockCount = 0;
HRESULT hr = D3DDevice->TestCooperativeLevel(); HRESULT hr = D3DDevice->TestCooperativeLevel();
if (FAILED(hr) && (hr != D3DERR_DEVICENOTRESET || !Reset())) if (FAILED(hr) && (hr != D3DERR_DEVICENOTRESET || !Reset()))
{ {
@ -1126,10 +1113,6 @@ bool D3DFB::PaintToWindow ()
{ {
HRESULT hr; HRESULT hr;
if (LockCount != 0)
{
return false;
}
hr = D3DDevice->TestCooperativeLevel(); hr = D3DDevice->TestCooperativeLevel();
if (FAILED(hr)) if (FAILED(hr))
{ {
@ -1244,30 +1227,22 @@ void D3DFB::Draw3DPart(bool copy3d)
{ {
FBVERTEX verts[4]; FBVERTEX verts[4];
D3DCOLOR color0, color1; D3DCOLOR color0, color1;
if (Accel2D) auto map = swrenderer::CameraLight::Instance()->ShaderColormap();
if (map == NULL)
{ {
auto map = swrenderer::CameraLight::Instance()->ShaderColormap(); color0 = 0;
if (map == NULL) color1 = 0xFFFFFFF;
{
color0 = 0;
color1 = 0xFFFFFFF;
}
else
{
color0 = D3DCOLOR_COLORVALUE(map->ColorizeStart[0]/2, map->ColorizeStart[1]/2, map->ColorizeStart[2]/2, 0);
color1 = D3DCOLOR_COLORVALUE(map->ColorizeEnd[0]/2, map->ColorizeEnd[1]/2, map->ColorizeEnd[2]/2, 1);
if (IsBgra())
SetPixelShader(Shaders[SHADER_SpecialColormap]);
else
SetPixelShader(Shaders[SHADER_SpecialColormapPal]);
}
} }
else else
{ {
color0 = FlashColor0; color0 = D3DCOLOR_COLORVALUE(map->ColorizeStart[0]/2, map->ColorizeStart[1]/2, map->ColorizeStart[2]/2, 0);
color1 = FlashColor1; color1 = D3DCOLOR_COLORVALUE(map->ColorizeEnd[0]/2, map->ColorizeEnd[1]/2, map->ColorizeEnd[2]/2, 1);
if (IsBgra())
SetPixelShader(Shaders[SHADER_SpecialColormap]);
else
SetPixelShader(Shaders[SHADER_SpecialColormapPal]);
} }
CalcFullscreenCoords(verts, Accel2D, false, color0, color1); CalcFullscreenCoords(verts, true, false, color0, color1);
D3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, 2, verts, sizeof(FBVERTEX)); D3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, 2, verts, sizeof(FBVERTEX));
} }
if (IsBgra()) if (IsBgra())
@ -1457,11 +1432,6 @@ void D3DFB::GetScreenshotBuffer(const uint8_t *&buffer, int &pitch, ESSType &col
{ {
D3DLOCKED_RECT lrect; D3DLOCKED_RECT lrect;
if (!Accel2D)
{
Super::GetScreenshotBuffer(buffer, pitch, color_type, gamma);
return;
}
buffer = NULL; buffer = NULL;
if ((ScreenshotTexture = GetCurrentScreen()) != NULL) if ((ScreenshotTexture = GetCurrentScreen()) != NULL)
{ {
@ -1495,10 +1465,6 @@ void D3DFB::GetScreenshotBuffer(const uint8_t *&buffer, int &pitch, ESSType &col
void D3DFB::ReleaseScreenshotBuffer() void D3DFB::ReleaseScreenshotBuffer()
{ {
if (LockCount > 0)
{
Super::ReleaseScreenshotBuffer();
}
if (ScreenshotSurface != NULL) if (ScreenshotSurface != NULL)
{ {
ScreenshotSurface->UnlockRect(); ScreenshotSurface->UnlockRect();
@ -1806,10 +1772,6 @@ bool D3DPal::Update()
bool D3DFB::Begin2D(bool copy3d) bool D3DFB::Begin2D(bool copy3d)
{ {
Super::Begin2D(copy3d); Super::Begin2D(copy3d);
if (!Accel2D)
{
return false;
}
if (In2D) if (In2D)
{ {
return true; return true;
@ -1831,10 +1793,6 @@ bool D3DFB::Begin2D(bool copy3d)
void D3DFB::DrawBlendingRect() void D3DFB::DrawBlendingRect()
{ {
if (!In2D || !Accel2D)
{
return;
}
Dim(FlashColor, FlashAmount / 256.f, viewwindowx, viewwindowy, viewwidth, viewheight); Dim(FlashColor, FlashAmount / 256.f, viewwindowx, viewwindowy, viewwidth, viewheight);
} }

View file

@ -136,11 +136,6 @@ bool D3DFB::WipeStartScreen(int type)
IDirect3DSurface9 *tsurf; IDirect3DSurface9 *tsurf;
D3DSURFACE_DESC desc; D3DSURFACE_DESC desc;
if (!Accel2D)
{
return Super::WipeStartScreen(type);
}
switch (type) switch (type)
{ {
case wipe_Melt: case wipe_Melt:
@ -200,12 +195,6 @@ bool D3DFB::WipeStartScreen(int type)
void D3DFB::WipeEndScreen() void D3DFB::WipeEndScreen()
{ {
if (!Accel2D)
{
Super::WipeEndScreen();
return;
}
// Don't do anything if there is no starting point. // Don't do anything if there is no starting point.
if (InitialWipeScreen == NULL) if (InitialWipeScreen == NULL)
{ {
@ -254,11 +243,6 @@ void D3DFB::WipeEndScreen()
bool D3DFB::WipeDo(int ticks) bool D3DFB::WipeDo(int ticks)
{ {
if (!Accel2D)
{
return Super::WipeDo(ticks);
}
// Sanity checks. // Sanity checks.
if (InitialWipeScreen == NULL || FinalWipeScreen == NULL) if (InitialWipeScreen == NULL || FinalWipeScreen == NULL)
{ {
@ -321,11 +305,6 @@ void D3DFB::WipeCleanup()
SAFE_RELEASE( InitialWipeScreen ); SAFE_RELEASE( InitialWipeScreen );
SAFE_RELEASE( FinalWipeScreen ); SAFE_RELEASE( FinalWipeScreen );
GatheringWipeScreen = false; GatheringWipeScreen = false;
if (!Accel2D)
{
Super::WipeCleanup();
return;
}
} }
//========================================================================== //==========================================================================

View file

@ -993,7 +993,6 @@ Win32GLFrameBuffer::Win32GLFrameBuffer(void *hMonitor, int width, int height, in
m_RefreshHz = refreshHz; m_RefreshHz = refreshHz;
m_Fullscreen = fullscreen; m_Fullscreen = fullscreen;
m_Bgra = bgra; m_Bgra = bgra;
m_Lock=0;
RECT r; RECT r;
LONG style, exStyle; LONG style, exStyle;

View file

@ -70,7 +70,6 @@ protected:
bool m_supportsGamma; bool m_supportsGamma;
bool m_Fullscreen, m_Bgra; bool m_Fullscreen, m_Bgra;
int m_Width, m_Height, m_Bits, m_RefreshHz; int m_Width, m_Height, m_Bits, m_RefreshHz;
int m_Lock;
char m_displayDeviceNameBuffer[32/*CCHDEVICENAME*/]; // do not use windows.h constants here! char m_displayDeviceNameBuffer[32/*CCHDEVICENAME*/]; // do not use windows.h constants here!
char *m_displayDeviceName; char *m_displayDeviceName;
int SwapInterval; int SwapInterval;