Compare commits

...

2 Commits

3 changed files with 28 additions and 23 deletions

View File

@ -2,10 +2,13 @@ BUILD_TYPE ?= debug
ifeq ($(BUILD_TYPE),debug)
OPT = -g -Og
CFLAGS += -D_DEBUG
LDFLAGS += -mconsole
LDOPT =
else
OPT = -O2
LDOPT = -flto
LDFLAGS += -mwindows
endif
PREFIX = i686-w64-mingw32-
@ -18,8 +21,8 @@ CFLAGS += -march=core2
CFLAGS += -Wall -Werror -Wfatal-errors
CFLAGS += -Wno-unused-but-set-variable
CFLAGS += -Wno-unknown-pragmas
CFLAGS += -municode
CFLAGS += -I./include
CFLAGS += -municode
LDFLAGS += -municode
LIBS += -ld3d10
@ -62,3 +65,14 @@ OBJS = \
$(BUILD_TYPE)/d3d10.exe: $(OBJS)
@mkdir -p $(@D)
$(CXX) $(LDFLAGS) $(LDOPT) -o $@ $(OBJS) $(LIBS)
.SUFFIXES:
.INTERMEDIATE:
.SECONDARY:
.PHONY: all clean
%: RCS/%,v
%: RCS/%
%: %,v
%: s.%
%: SCCS/s.%

View File

@ -60,13 +60,8 @@ ID3D10EffectShaderResourceVariable * g_pDiffuseAVariableBloom = NULL;
ID3D10EffectVectorVariable * g_pInvScreenSizeVariableBloom = NULL;
ID3D10EffectVectorVariable * g_pDirVariableBloom = NULL;
ID3D10EffectScalarVariable * g_pExposureVariableBloom = NULL;
#ifdef _DEBUG
int g_bloomPasses = 0;
float g_exposure = 3.7f;
#else
int g_bloomPasses = 4;
float g_exposure = 3.4f;
#endif
typedef XMFLOAT2 BloomVertex;
@ -908,11 +903,7 @@ HRESULT InitDirect3DDevice()
D3D10_RASTERIZER_DESC RSDesc;
RSDesc.FillMode = D3D10_FILL_SOLID;
#ifdef _DEBUG
RSDesc.CullMode = D3D10_CULL_BACK;
#else
RSDesc.CullMode = D3D10_CULL_NONE;
#endif
RSDesc.FrontCounterClockwise = FALSE;
RSDesc.DepthBias = 0;
RSDesc.SlopeScaledDepthBias = 0.0f;
@ -1584,16 +1575,11 @@ void RenderVolumeMesh()
void Render()
{
static float t = 0.0f;
#ifdef _DEBUG
t += XM_PI * 0.0125f * 0.5f;
#else
static DWORD dwTimeStart = 0;
DWORD dwTimeCur = GetTickCount();
if (dwTimeStart == 0)
dwTimeStart = dwTimeCur;
t = (dwTimeCur - dwTimeStart) / 1000.0f;
#endif
float t = (dwTimeCur - dwTimeStart) / 1000.0f;
Update(t);

View File

@ -8,7 +8,7 @@ void print(LPCSTR fmt, ...)
va_list args;
va_start(args, fmt);
char buf[512];
STRSAFE_LPSTR end;
STRSAFE_LPSTR end = NULL;
StringCbVPrintfExA(buf,
(sizeof (buf)),
@ -19,11 +19,11 @@ void print(LPCSTR fmt, ...)
args);
va_end(args);
#ifdef _DEBUG
OutputDebugStringA(buf);
//OutputDebugStringA(buf);
size_t length = end - &buf[0];
HANDLE hOutput = GetStdHandle(STD_OUTPUT_HANDLE);
WriteConsoleA(hOutput, buf, (DWORD)length, NULL, NULL);
#endif
//size_t length = end - &buf[0];
//HANDLE hOutput = GetStdHandle(STD_OUTPUT_HANDLE);
//WriteConsoleA(hOutput, buf, (DWORD)length, NULL, NULL);
}
void printW(LPCWSTR fmt, ...)
@ -31,15 +31,20 @@ void printW(LPCWSTR fmt, ...)
va_list args;
va_start(args, fmt);
WCHAR buf[512];
STRSAFE_LPWSTR end = NULL;
StringCbVPrintfExW(buf,
(sizeof (buf)),
NULL,
&end,
NULL,
STRSAFE_NULL_ON_FAILURE,
fmt,
args);
va_end(args);
#ifdef _DEBUG
OutputDebugStringW(buf);
//OutputDebugStringW(buf);
size_t length = end - &buf[0];
HANDLE hOutput = GetStdHandle(STD_OUTPUT_HANDLE);
WriteConsoleW(hOutput, buf, (DWORD)length, NULL, NULL);
#endif
}