From cf1c0a715a0f2a024a46c71bfcadddf14675c8f1 Mon Sep 17 00:00:00 2001 From: Eukara Date: Sun, 26 Mar 2017 17:23:53 +0000 Subject: [PATCH] First steps towards an XDK build... git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5078 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/cl_main.c | 4 +- engine/client/net_master.c | 7 +- engine/client/sys_xdk.c | 25 ++ engine/client/view.c | 4 +- engine/client/winquake.h | 18 +- engine/common/bothdefs.h | 19 +- engine/common/fs.c | 4 +- engine/common/netinc.h | 7 + engine/common/plugin.c | 6 + engine/common/pr_bgcmd.c | 9 +- engine/gl/glquake.h | 5 +- engine/qclib/progsint.h | 5 +- engine/xdk/FTEQW_XDK.sln | 30 ++ engine/xdk/FTEQW_XDK.suo | Bin 0 -> 20480 bytes engine/xdk/FTEQW_XDK.vcproj | 670 ++++++++++++++++++++++++++++++++++++ 15 files changed, 793 insertions(+), 20 deletions(-) create mode 100644 engine/client/sys_xdk.c create mode 100644 engine/xdk/FTEQW_XDK.sln create mode 100644 engine/xdk/FTEQW_XDK.suo create mode 100644 engine/xdk/FTEQW_XDK.vcproj diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index 25da96512..a0198160a 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -3700,7 +3700,7 @@ void CL_FinishDownload_f (void) CL_ForceStopDownload(true); } -#if defined(_WIN32) && !defined(WINRT) +#if defined(_WIN32) && !defined(WINRT) && !defined(_XBOX) #include "winquake.h" /* ================= @@ -4149,7 +4149,7 @@ void CL_Init (void) // // Windows commands // -#if defined(_WIN32) && !defined(WINRT) +#if defined(_WIN32) && !defined(WINRT) && !defined(_XBOX) Cmd_AddCommand ("windows", CL_Windows_f); #endif diff --git a/engine/client/net_master.c b/engine/client/net_master.c index 205fa19e8..fac51301b 100644 --- a/engine/client/net_master.c +++ b/engine/client/net_master.c @@ -4,7 +4,6 @@ clientside master queries and server ping/polls */ #include "quakedef.h" - #include "cl_master.h" qboolean sb_enablequake2; @@ -565,7 +564,6 @@ void SV_Master_Shutdown (void) #ifdef _WIN32 #include "winquake.h" -#define USEIPX #else typedef int SOCKET; #endif @@ -576,6 +574,11 @@ typedef int SOCKET; #define USEIPX #endif +#if defined(_XBOX) + #undef TCPCONNECT + #undef IPPROTO_IPV6 + #undef USEIPX +#endif //the number of servers should be limited only by memory. diff --git a/engine/client/sys_xdk.c b/engine/client/sys_xdk.c new file mode 100644 index 000000000..d03d0ef65 --- /dev/null +++ b/engine/client/sys_xdk.c @@ -0,0 +1,25 @@ +#include +#include "quakedef.h" + +void main( int argc, char **argv) { + float time, lasttime; + quakeparms_t parms; + + memset(&parms, 0, sizeof(parms)); + + //fill in parms + COM_InitArgv(parms.argc, parms.argv); + TL_InitLanguages(parms.basedir); + Host_Init(&parms); + + //main loop + lasttime = Sys_DoubleTime(); + + while (1) + { + time = Sys_DoubleTime(); + Host_Frame(time - lasttime); + lasttime = time; + } + +} \ No newline at end of file diff --git a/engine/client/view.c b/engine/client/view.c index 3c43864a9..708097e7b 100644 --- a/engine/client/view.c +++ b/engine/client/view.c @@ -385,7 +385,7 @@ static void QDECL V_Gamma_Callback(struct cvar_s *var, char *oldvalue) V_UpdatePalette (true); } -#ifdef _WIN32 +#if defined(_WIN32) && !defined(_XBOX) void W32_BlowChunk(vec3_t pos, float radius) { vec3_t center; @@ -437,7 +437,7 @@ void V_ParseDamage (playerview_t *pv) pv->faceanimtime = cl.time + 0.2; // but sbar face into pain frame -#if defined(_WIN32) && !defined(MINIMAL) +#if defined(_WIN32) && !defined(MINIMAL) && !defined(_XBOX) if (itburnsitburnsmakeitstop.value > 0) W32_BlowChunk(from, (armor+blood) * itburnsitburnsmakeitstop.value); #endif diff --git a/engine/client/winquake.h b/engine/client/winquake.h index 3f70b2816..7259cb5fc 100644 --- a/engine/client/winquake.h +++ b/engine/client/winquake.h @@ -37,10 +37,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #endif #define WIN32_LEAN_AND_MEAN #define byte winbyte -#include -#include -#include -#include +#ifdef _XBOX + #include + #include +#else + #include + #include + #include + #include +#endif + #define _LPCWAVEFORMATEX_DEFINED @@ -78,13 +84,15 @@ LONG CDAudio_MessageHandler(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); //shell32 stuff that doesn't exist in win95 #define COBJMACROS + +#ifndef _XBOX #include #include extern LPITEMIDLIST (STDAPICALLTYPE *pSHBrowseForFolderW)(LPBROWSEINFOW lpbi); extern BOOL (STDAPICALLTYPE *pSHGetPathFromIDListW)(LPCITEMIDLIST pidl, LPWSTR pszPath); extern BOOL (STDAPICALLTYPE *pSHGetSpecialFolderPathW)(HWND hwnd, LPWSTR pszPath, int csidl, BOOL fCreate); extern BOOL (STDAPICALLTYPE *pShell_NotifyIconW)(DWORD dwMessage, PNOTIFYICONDATAW lpData); - +#endif //void VID_LockBuffer (void); //void VID_UnlockBuffer (void); diff --git a/engine/common/bothdefs.h b/engine/common/bothdefs.h index 8ec5b015b..c33e208ee 100644 --- a/engine/common/bothdefs.h +++ b/engine/common/bothdefs.h @@ -42,6 +42,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define NO_OGG #endif +#ifdef _XBOX + #define NO_PNG + #define NO_JPEG + #define NO_OGG + #define NO_ZLIB + #define NOMEDIA +#endif + #ifdef NACL #define NO_PNG #define NO_JPEG @@ -101,7 +109,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #if !defined(NO_DIRECTX) && !defined(NODIRECTX) && defined(_WIN32) #define AVAIL_DINPUT #define AVAIL_DSOUND - #define AVAIL_WASAPI + #undef AVAIL_WASAPI #endif #ifdef WINRT #define AVAIL_XAUDIO2 @@ -191,7 +199,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #undef AVAIL_XZDEC #if defined(_WIN32) && !defined(FTE_SDL) && !defined(MULTITHREAD) //always thread on win32 non-minimal builds +#ifndef _XBOX #define MULTITHREAD +#endif #endif #elif defined(MINIMAL) #define QUAKESTATS @@ -248,7 +258,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define PSKMODELS //PSK model format (ActorX stuff from UT, though not the format the game itself uses) #define HALFLIFEMODELS //halflife model support (experimental) #define INTERQUAKEMODELS - #define RAGDOLL + + #ifdef _XBOX + #define RAGDOLL + #endif #define HUFFNETWORK //huffman network compression #define DOOMWADS //doom wad/sprite support @@ -600,6 +613,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #elif defined(_WIN32) #if defined(WINRT) #define PLATFORM "WinRT" /*those poor poor souls. maybe just maybe I'll actually get the tools for a port, its just a shame that I won't be able to release said port*/ + #elif defined(_XBOX) + #define PLATFORM "Xbox" #else #define PLATFORM "Win" #endif diff --git a/engine/common/fs.c b/engine/common/fs.c index 0efb59ff2..cc06f2128 100644 --- a/engine/common/fs.c +++ b/engine/common/fs.c @@ -3753,7 +3753,7 @@ void FS_ReloadPackFiles_f(void) FS_BeginManifestUpdates(); } -#if defined(_WIN32) && !defined(FTE_SDL) && !defined(WINRT) +#if defined(_WIN32) && !defined(FTE_SDL) && !defined(WINRT) && !defined(_XBOX) #include "winquake.h" #ifdef MINGW #define byte BYTE //some versions of mingw headers are broken slightly. this lets it compile. @@ -5739,7 +5739,7 @@ void COM_InitFilesystem (void) //assume the home directory is the working directory. *com_homepath = '\0'; -#if defined(_WIN32) && !defined(FTE_SDL) && !defined(WINRT) +#if defined(_WIN32) && !defined(FTE_SDL) && !defined(WINRT) && !defined(_XBOX) { //win32 sucks. HRESULT (WINAPI *dSHGetFolderPathW) (HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, wchar_t *pszPath) = NULL; dllfunction_t funcs[] = diff --git a/engine/common/netinc.h b/engine/common/netinc.h index 7276bf850..c2f65f268 100644 --- a/engine/common/netinc.h +++ b/engine/common/netinc.h @@ -40,13 +40,20 @@ #define USEIPX #endif #define WIN32_LEAN_AND_MEAN +#ifdef _XBOX + #include + #include +#else #include #include +#endif // #include "winquake.h" +#ifndef _XBOX #ifdef USEIPX #include "wsipx.h" #endif #include +#endif #include #ifndef IPPROTO_IPV6 /*for msvc6*/ diff --git a/engine/common/plugin.c b/engine/common/plugin.c index 084e96f1b..2a8417de2 100644 --- a/engine/common/plugin.c +++ b/engine/common/plugin.c @@ -940,6 +940,12 @@ static int Plug_NewStreamHandle(plugstream_e type) return i; } +#if defined(_XBOX) + #undef TCPCONNECT + #undef IPPROTO_IPV6 + #undef USEIPX +#endif + #ifdef HAVE_PACKET //EBUILTIN(int, NET_TCPListen, (char *ip, int port, int maxcount)); //returns a new socket with listen enabled. diff --git a/engine/common/pr_bgcmd.c b/engine/common/pr_bgcmd.c index 8e68600c1..bb37600cd 100644 --- a/engine/common/pr_bgcmd.c +++ b/engine/common/pr_bgcmd.c @@ -112,13 +112,16 @@ static int debuggerstacky; #endif #if defined(_WIN32) && !defined(FTE_SDL) -#include +#ifndef _XBOX + #include +#endif + void INS_UpdateGrabs(int fullscreen, int activeapp); #endif int QCLibEditor(pubprogfuncs_t *prinst, const char *filename, int *line, int *statement, char *error, pbool fatal); void QCLoadBreakpoints(const char *vmname, const char *progsname) { //this asks the gui to reapply any active breakpoints and waits for them so that any spawn functions can be breakpointed properly. -#if defined(_WIN32) && !defined(FTE_SDL) +#if defined(_WIN32) && !defined(FTE_SDL) && !defined(_XBOX) extern int isPlugin; if (isPlugin >= 2) { @@ -304,7 +307,7 @@ qboolean QCExternalDebuggerCommand(char *text) int QDECL QCEditor (pubprogfuncs_t *prinst, const char *filename, int *line, int *statement, char *reason, pbool fatal) { -#if defined(_WIN32) && !defined(SERVERONLY) && !defined(FTE_SDL) +#if defined(_WIN32) && !defined(SERVERONLY) && !defined(FTE_SDL) && !defined(_XBOX) if (isPlugin >= 2) { if (wantquit) diff --git a/engine/gl/glquake.h b/engine/gl/glquake.h index 79c17a64e..7cab0fe02 100644 --- a/engine/gl/glquake.h +++ b/engine/gl/glquake.h @@ -32,7 +32,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef WIN32_BLOATED #define WIN32_LEAN_AND_MEAN #endif -#include + +#ifndef _XBOX + #include +#endif #if defined(WINAPI_FAMILY) && !defined(WINRT) #if WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP diff --git a/engine/qclib/progsint.h b/engine/qclib/progsint.h index 640f02673..f0b22f897 100644 --- a/engine/qclib/progsint.h +++ b/engine/qclib/progsint.h @@ -17,8 +17,11 @@ //#define AVAIL_ZLIB #endif #endif - +#ifndef _XBOX #include +#else + #include +#endif #else #include #include diff --git a/engine/xdk/FTEQW_XDK.sln b/engine/xdk/FTEQW_XDK.sln new file mode 100644 index 000000000..a14d24c0a --- /dev/null +++ b/engine/xdk/FTEQW_XDK.sln @@ -0,0 +1,30 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FTEQW_XDK", "FTEQW_XDK.vcproj", "{BF8776BA-CCAB-4B5F-AE88-784B2215C589}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Profile = Profile + Profile_FastCap = Profile_FastCap + Release = Release + Release_LTCG = Release_LTCG + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {BF8776BA-CCAB-4B5F-AE88-784B2215C589}.Debug.ActiveCfg = Debug|Xbox + {BF8776BA-CCAB-4B5F-AE88-784B2215C589}.Debug.Build.0 = Debug|Xbox + {BF8776BA-CCAB-4B5F-AE88-784B2215C589}.Profile.ActiveCfg = Profile|Xbox + {BF8776BA-CCAB-4B5F-AE88-784B2215C589}.Profile.Build.0 = Profile|Xbox + {BF8776BA-CCAB-4B5F-AE88-784B2215C589}.Profile_FastCap.ActiveCfg = Profile_FastCap|Xbox + {BF8776BA-CCAB-4B5F-AE88-784B2215C589}.Profile_FastCap.Build.0 = Profile_FastCap|Xbox + {BF8776BA-CCAB-4B5F-AE88-784B2215C589}.Release.ActiveCfg = Release|Xbox + {BF8776BA-CCAB-4B5F-AE88-784B2215C589}.Release.Build.0 = Release|Xbox + {BF8776BA-CCAB-4B5F-AE88-784B2215C589}.Release_LTCG.ActiveCfg = Release_LTCG|Xbox + {BF8776BA-CCAB-4B5F-AE88-784B2215C589}.Release_LTCG.Build.0 = Release_LTCG|Xbox + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/engine/xdk/FTEQW_XDK.suo b/engine/xdk/FTEQW_XDK.suo new file mode 100644 index 0000000000000000000000000000000000000000..b434171a2cac69cbb2a0015223eaa246eb8bb716 GIT binary patch literal 20480 zcmeI4TWlOx8OM*E#LfNErfHhC$>!Fip*FFd#JQ2iUfa14=VIpun1;2zah$Aoo!!li zq*C8n0S`Q)z5r4MNL7UZ3B*g0`o;qas(3`GMM6B52cQAkn%{rUjCW?eJD%9P8)AG$ z-_DsiXXbqKo$r2*{rmf?KK$X&)_r7(${{n)d_KO&H2Chrd-juM1NUOUMqm@L8Q21B1zrT62K@c!>eZn@ugP%anTsxy=A1QmpnUYQ2Cnfi zo6rqq9$)#BZ?~NL(Fb+&Xn$SIK{?Hc8FSSfWAw|^y3B3c5b<}7sjm|+>Yc(P;$sf) zs_$8oFgbJ0oG>Gt^X44CNpSM+=cah!7RHwhNN%EzFFHxSRE{x{W*}t-_`PlVoY8NB z%^J?a^Z+LT@0-t1?*;mRv%opvJa7T{ z8t@h1tH2=84}2YX6}SX^14sY^fZjL6S#z#>t;*WB?v4EUZr!n;U-`r9M}PgU*yy3k z-{P_o(=W0qD>{=mM+TFzcqX0CW>SvGt%zsuyDV^E(rH(aS8p*mEM* zH+UsE>Rc}C97&`y!?CWRk$fhr4l8>y10$(q>_T!N)}6_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9eP}3?V)Jx*KhiB0Hx-uqul~}ZF@MayJsb>{r21QowRu(K}w-IG~a_qEB|*l zUaYpfbOG{r_i=ZRrIgm!2bhk`SsbL*}myT3l1)(2}u>v## zbkT-zTFb|p9eh1i`mh?5F0!$)a9X#_8d{f2!dHjJVL6LQy5)KQ9K7MnTR8QGPUfI; z8zGCd z%6F=TpX!g^3QHV?#kXo$n*goXh12@g8rgH}r`oL{)BAJ2T5JWV{A>i~;<@m-n2mZp zXiIY}?OsC1TygY!bu>-U8c@KOn(V*KR$WtSQMK~iT}11-`~%kWio32kmwyQRcLNWz zqB)m;$g!cW7J0R~{DU?X)`r%#%|8VEkd5Jf$n4MUYir&mHt7wMs~)XdWFMgUrf`}+ Ha^LU2q)~Ju literal 0 HcmV?d00001 diff --git a/engine/xdk/FTEQW_XDK.vcproj b/engine/xdk/FTEQW_XDK.vcproj new file mode 100644 index 000000000..b7f5f3e7e --- /dev/null +++ b/engine/xdk/FTEQW_XDK.vcproj @@ -0,0 +1,670 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +