From 492feafd1d53133022e5d6ffda1ffeb2500c1091 Mon Sep 17 00:00:00 2001 From: Eukara Date: Tue, 28 Mar 2017 19:18:47 +0000 Subject: [PATCH] More XDK related guff git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5085 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/sys_xdk.c | 2 +- engine/d3d/vid_d3d8.c | 38 ++++++++++++++++++++++-------------- engine/xdk/FTEQW_XDK.suo | Bin 22528 -> 13312 bytes engine/xdk/FTEQW_XDK.vcproj | 4 +++- 4 files changed, 27 insertions(+), 17 deletions(-) diff --git a/engine/client/sys_xdk.c b/engine/client/sys_xdk.c index fb0e54438..68bc47248 100644 --- a/engine/client/sys_xdk.c +++ b/engine/client/sys_xdk.c @@ -71,7 +71,7 @@ void VARGS Sys_Printf (char *fmt, ...) char msg[MAXPRINTMSG]; va_start (argptr,fmt); - Q_snprintfz (msg,sizeof(msg)-1, fmt,argptr); + vsnprintf(msg,sizeof(msg)-1, fmt,argptr); msg[sizeof(msg)-1] = 0; //_vsnprintf sucks. va_end (argptr); diff --git a/engine/d3d/vid_d3d8.c b/engine/d3d/vid_d3d8.c index aaa42bea3..7fe9dd8a8 100644 --- a/engine/d3d/vid_d3d8.c +++ b/engine/d3d/vid_d3d8.c @@ -448,19 +448,11 @@ static void resetD3D8(void) return; } - /*clear the screen to black as soon as we start up, so there's no lingering framebuffer state*/ IDirect3DDevice8_BeginScene(pD3DDev8); IDirect3DDevice8_Clear(pD3DDev8, 0, NULL, D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0); IDirect3DDevice8_EndScene(pD3DDev8); IDirect3DDevice8_Present(pD3DDev8, NULL, NULL, NULL, NULL); - - - - - - - //IDirect3DDevice8_SetRenderState(pD3DDev8, D3DRENDERSTATE_DITHERENABLE, FALSE); //IDirect3DDevice8_SetRenderState(pD3DDev8, D3DRENDERSTATE_SPECULARENABLE, FALSE); //IDirect3DDevice8_SetRenderState(pD3DDev8, D3DRENDERSTATE_TEXTUREPERSPECTIVE, TRUE); @@ -584,7 +576,9 @@ static qboolean initD3D8Device(HWND hWnd, rendererstate_t *info, unsigned int de break; } -#ifndef _XBOX +#ifdef _XBOX + cflags = 0; +#else cflags = D3DCREATE_FPU_PRESERVE; #endif if ((caps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) && (caps.DevCaps & D3DDEVCAPS_PUREDEVICE)) @@ -662,8 +656,8 @@ static qboolean initD3D8Device(HWND hWnd, rendererstate_t *info, unsigned int de static void initD3D8(HWND hWnd, rendererstate_t *info) { #ifdef _XBOX - LPDIRECT3D8 pDirect3DCreate8 = NULL; - pDirect3DCreate8 = Direct3DCreate8( D3D_SDK_VERSION ); + pD3D = Direct3DCreate8( D3D_SDK_VERSION ); + initD3D8Device(NULL, info, 0, D3DDEVTYPE_HAL); #else int i; int numadaptors; @@ -721,15 +715,27 @@ static void initD3D8(HWND hWnd, rendererstate_t *info) static qboolean D3D8_VID_Init(rendererstate_t *info, unsigned char *palette) { #ifdef _XBOX + vid_initializing = true; + + initD3D8( NULL, info ); + + IDirect3DDevice8_Clear(pD3DDev8, 0, NULL, D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(255, 0, 255), 1.0f, 0); + IDirect3DDevice8_BeginScene(pD3DDev8); + IDirect3DDevice8_EndScene(pD3DDev8); + IDirect3DDevice8_Present(pD3DDev8, NULL, NULL, NULL, NULL); + + D3D8_Set2D(); + vid.pixelwidth = 640; vid.pixelheight = 480; - vid.width = 640; vid.height = 480; vid_initializing = false; IDirect3DDevice8_SetRenderState(pD3DDev8, D3DRS_LIGHTING, FALSE); + + return TRUE; #else DWORD width = info->width; DWORD height = info->height; @@ -838,7 +844,6 @@ static qboolean D3D8_VID_Init(rendererstate_t *info, unsigned char *palette) static void (D3D8_VID_DeInit) (void) { -#ifndef _XBOX Image_Shutdown(); /*final shutdown, kill the video stuff*/ @@ -847,7 +852,9 @@ static void (D3D8_VID_DeInit) (void) D3D8BE_Reset(true); /*try and knock it back into windowed mode to avoid d3d bugs*/ + #ifndef _XBOX d3dpp.Windowed = true; + #endif IDirect3DDevice8_Reset(pD3DDev8, &d3dpp); IDirect3DDevice8_Release(pD3DDev8); @@ -858,16 +865,17 @@ static void (D3D8_VID_DeInit) (void) IDirect3D8_Release(pD3D); pD3D = NULL; } + + #ifndef _XBOX if (mainwindow) { DestroyWindow(mainwindow); mainwindow = NULL; } - + #endif // Cvar_Unhook(&v_gamma); // Cvar_Unhook(&v_contrast); // Cvar_Unhook(&v_brightness); -#endif } qboolean D3D8_VID_ApplyGammaRamps (unsigned int gammarampsize, unsigned short *ramps) diff --git a/engine/xdk/FTEQW_XDK.suo b/engine/xdk/FTEQW_XDK.suo index d8991cdaaa5ada4992540deb6943df6225751341..e13ea66eda914e943e511a359105ff4145ed0f25 100644 GIT binary patch delta 755 zcmaLVO=uHA6bJB`?M|8|S(~Iux6z^j*U-k+7!6`D)x;E=UiulM)o2^5rhY`*S}7JJ zIe76PYMulSf}ny25vuE1Diu5x+X~`ItVb_`Ac|<~e`D~X^udpr+4pvKW_AkGyf8A| zBRSlRv3giu`4h`edhhb0oKr#@etvtn$g7Z>Y1F6Wk6etS@1cyTquHo#sl2rXZ2-1H z5VpZ~2*E*GFkQ$S)%_SHVLznc033n=F!G1drr`)2g+UmC3><@DI1VS^BxGR(PQht7 z17{%z=ioey!Wd(8Uut`5PDo}2V`G=JAZz-B<+V(4OOPgNuT zThK?@-|w1?!@j}jhqII7BFG!)VqIQr#>2E8c3qcg(dD8$4O-EYrbdsZ7d$h(=#T2r zbwnaO-ICO$02xoV6r24D2a7~JC)Gkus(#>B7q5yjuRv@izl$v^pV&%O7YbIb)s7S9 zv*lmusm~Cjto6mx3O!VWprqvydf4`p>?2>O+hPC@QVLaDR;yr$Zj5)1gd3z`c`>mDRmPOpbkboFR? z-6E`$@Hin_#g`X5?LU6{-Z#v%1KG52riOV)&oh^%5={s@pyQlrtjTZq2<_IO7(WiJ zKGrwaLt@~go`8ck!sE!b$}ocnQ`8-BV#UV|zVEz?IP+s5s`#{GHv|OK>;|Nt0h^k= zqZ8sXAb9q6v+kTXZo*7(sqIRGXQhC~vr;$}s6A<37gaZf>HToOcM+`3iWzik0<0{7 zn<;R|5oQY!j?*i_O6wjwI~D2Lu$!7lkb@lbbeo*q~xMSxniAlo8W1dNmD`d6=YSqtbbx7`Mj6r4h?2>M@HkNw&xc ztv9);F;*o9=&i`q|8X-6>SoYO(LsAh=kYuCQ5jSrF_o`UF3_kBR>V4YuHti`YYEM> zitv`iECQUB)&fU4%gsfxv8Q4wOV`9AQfG?OQd2t@B6D;;oH(@I&O|4rT}5&NNoSPa z-c>pi9X=Siqu_K}y_?BHUYT5UT2?8iT}7w+y5ZLQfMaa8w5L;4Fw_r^m9>xwmO6w{p1KGLAXaBMX;o!p(*1a5o;j zSsrEBTkJ>k0y=C3aTMD3ph1l?;M%`TomRpA{ms@IF(J%)N$P1o?k x{sL6v=(@7sA(Dt8mP@}EuY{}=pv|55+| diff --git a/engine/xdk/FTEQW_XDK.vcproj b/engine/xdk/FTEQW_XDK.vcproj index 6774dd141..2187c4c46 100644 --- a/engine/xdk/FTEQW_XDK.vcproj +++ b/engine/xdk/FTEQW_XDK.vcproj @@ -172,13 +172,15 @@ Optimization="3" OmitFramePointers="TRUE" OptimizeForProcessor="2" + AdditionalIncludeDirectories="..\qclib;..\server;..\gl;..\common;..\client" PreprocessorDefinitions="NDEBUG;_XBOX" StringPooling="TRUE" RuntimeLibrary="0" BufferSecurityCheck="TRUE" EnableFunctionLevelLinking="TRUE" EnableEnhancedInstructionSet="1" - UsePrecompiledHeader="3" + UsePrecompiledHeader="0" + PrecompiledHeaderThrough="" PrecompiledHeaderFile="$(OutDir)/$(ProjectName).pch" WarningLevel="3" Detect64BitPortabilityProblems="FALSE"