- fix compile

This commit is contained in:
Rachael Alexanderson 2017-03-06 22:50:20 -05:00
parent e92b471b40
commit 791ce767c9
4 changed files with 39 additions and 12 deletions

View file

@ -40,8 +40,6 @@
#include "p_local.h"
#include "p_blockmap.h"
#include "p_lnspec.h"
#include "r_bsp.h"
#include "r_segs.h"
#include "c_cvars.h"
#include "m_bbox.h"
#include "p_tags.h"

View file

@ -91,7 +91,7 @@
// TYPES -------------------------------------------------------------------
IMPLEMENT_CLASS(D3DFB)
IMPLEMENT_CLASS(D3DFB, false, false)
struct D3DFB::PackedTexture
{
@ -1094,6 +1094,7 @@ void D3DFB::Update ()
DrawRateStuff();
DrawPackedTextures(d3d_showpacks);
EndBatch(); // Make sure all batched primitives are drawn.
In2D = 0;
Flip();
}
In2D = 0;
@ -1222,6 +1223,24 @@ void D3DFB::Flip()
CurrRenderTexture ^= RenderTextureToggle;
TempRenderTexture = RenderTexture[CurrRenderTexture];
}
if (Windowed)
{
RECT box;
GetClientRect(Window, &box);
if (box.right > 0 && box.right > 0 && (Width != box.right || Height != box.bottom))
{
Resize(box.right, box.bottom);
TrueHeight = Height;
PixelDoubling = 0;
LBOffsetI = 0;
LBOffset = 0.0f;
Reset();
V_OutputResized(Width, Height);
}
}
}
//==========================================================================
@ -1723,7 +1742,6 @@ void D3DFB::NewRefreshRate ()
void D3DFB::Blank ()
{
// Only used by movie player, which isn't working with D3D9 yet.
}
void D3DFB::SetBlendingRect(int x1, int y1, int x2, int y2)
@ -3100,11 +3118,16 @@ void D3DFB::FlatFill(int left, int top, int right, int bottom, FTexture *src, bo
//
// Here, "simple" means that a simple triangle fan can draw it.
//
// Bottomclip is ignored by this implementation, since the hardware renderer
// will unconditionally draw the status bar border every frame on top of the
// polygons, so there's no need to waste time setting up a special scissor
// rectangle here and needlessly forcing separate batches.
//
//==========================================================================
void D3DFB::FillSimplePoly(FTexture *texture, FVector2 *points, int npoints,
double originx, double originy, double scalex, double scaley,
DAngle rotation, FDynamicColormap *colormap, int lightlevel)
DAngle rotation, FDynamicColormap *colormap, PalEntry flatcolor, int lightlevel, int bottomclip)
{
// Use an equation similar to player sprites to determine shade
double fadelevel = clamp((swrenderer::LightVisibility::LightLevelToShade(lightlevel, true)/65536. - 12) / NUMCOLORMAPS, 0.0, 1.0);
@ -3125,7 +3148,7 @@ void D3DFB::FillSimplePoly(FTexture *texture, FVector2 *points, int npoints,
}
if (In2D < 2)
{
Super::FillSimplePoly(texture, points, npoints, originx, originy, scalex, scaley, rotation, colormap, lightlevel);
Super::FillSimplePoly(texture, points, npoints, originx, originy, scalex, scaley, rotation, colormap, flatcolor, lightlevel, bottomclip);
return;
}
if (!InScene)

View file

@ -60,7 +60,7 @@
// TYPES -------------------------------------------------------------------
IMPLEMENT_CLASS(DDrawFB)
IMPLEMENT_CLASS(DDrawFB, false, false)
// EXTERNAL FUNCTION PROTOTYPES --------------------------------------------

View file

@ -336,7 +336,7 @@ bool Win32Video::GoFullscreen (bool yes)
HRESULT hr[2];
int count;
// FIXME: Do this right for D3D. (This function is only called by the movie player when using D3D.)
// FIXME: Do this right for D3D.
if (D3D != NULL)
{
return yes;
@ -372,7 +372,7 @@ bool Win32Video::GoFullscreen (bool yes)
return false;
}
// Flips to the GDI surface and clears it; used by the movie player
// Flips to the GDI surface and clears it
void Win32Video::BlankForGDI ()
{
static_cast<BaseWinFB *> (screen)->Blank ();
@ -389,6 +389,8 @@ void Win32Video::BlankForGDI ()
void Win32Video::DumpAdapters()
{
using OptWin32::GetMonitorInfoA;
if (D3D == NULL)
{
Printf("Multi-monitor support requires Direct3D.\n");
@ -417,9 +419,8 @@ void Win32Video::DumpAdapters()
MONITORINFOEX mi;
mi.cbSize = sizeof(mi);
TOptWin32Proc<BOOL(WINAPI*)(HMONITOR, LPMONITORINFO)> GetMonitorInfo("user32.dll", "GetMonitorInfoW");
assert(GetMonitorInfo != NULL); // Missing in NT4, but so is D3D
if (GetMonitorInfo.Call(hm, &mi))
assert(GetMonitorInfo); // Missing in NT4, but so is D3D
if (GetMonitorInfo(hm, &mi))
{
mysnprintf(moreinfo, countof(moreinfo), " [%ldx%ld @ (%ld,%ld)]%s",
mi.rcMonitor.right - mi.rcMonitor.left,
@ -640,6 +641,11 @@ DFrameBuffer *Win32Video::CreateFrameBuffer (int width, int height, bool bgra, b
PalEntry flashColor;
int flashAmount;
if (fullscreen)
{
I_ClosestResolution(&width, &height, D3D ? 32 : 8);
}
LOG4 ("CreateFB %d %d %d %p\n", width, height, fullscreen, old);
if (old != NULL)