Browse Source

Moved native Sys_ calls into their own separate compilation unit, and removed some auto-generated Windows garbage

console
Nico de Poel 5 years ago
parent
commit
40c8c13fb3
  1. 19
      engine/projects/uniquake/dllmain.cpp
  2. 5
      engine/projects/uniquake/framework.h
  3. 5
      engine/projects/uniquake/pch.cpp
  4. 13
      engine/projects/uniquake/pch.h
  5. 40
      engine/projects/uniquake/sys_uniquake.c
  6. 42
      engine/projects/uniquake/uniquake.c
  7. 5
      engine/projects/uniquake/uniquake.h
  8. 10
      engine/projects/uniquake/uniquake.vcxproj
  9. 15
      engine/projects/uniquake/uniquake.vcxproj.filters

19
engine/projects/uniquake/dllmain.cpp

@ -1,19 +0,0 @@
// dllmain.cpp : Defines the entry point for the DLL application.
#include "pch.h"
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}

5
engine/projects/uniquake/framework.h

@ -1,5 +0,0 @@
#pragma once
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files
#include <windows.h>

5
engine/projects/uniquake/pch.cpp

@ -1,5 +0,0 @@
// pch.cpp: source file corresponding to the pre-compiled header
#include "pch.h"
// When you are using pre-compiled headers, this source file is necessary for compilation to succeed.

13
engine/projects/uniquake/pch.h

@ -1,13 +0,0 @@
// pch.h: This is a precompiled header file.
// Files listed below are compiled only once, improving build performance for future builds.
// This also affects IntelliSense performance, including code completion and many code browsing features.
// However, files listed here are ALL re-compiled if any one of them is updated between builds.
// Do not add files here that you will be updating frequently as this negates the performance advantage.
#ifndef PCH_H
#define PCH_H
// add headers that you want to pre-compile here
#include "framework.h"
#endif //PCH_H

40
engine/projects/uniquake/sys_uniquake.c

@ -0,0 +1,40 @@
#include "uniquake.h"
#include "../../code/quakedef.h"
const unity_syscalls_t *unity_syscalls;
void Sys_Error(char *error, ...)
{
va_list argptr;
char text[1024];
va_start(argptr, error);
vsprintf(text, error, argptr);
va_end(argptr);
unity_syscalls->SysError(unity_syscalls->target, text);
}
void Sys_Printf(char *fmt, ...)
{
va_list argptr;
char text[1024];
va_start(argptr, fmt);
vsprintf(text, fmt, argptr);
va_end(argptr);
unity_syscalls->SysPrint(unity_syscalls->target, text);
}
void Sys_Quit(void)
{
Host_Shutdown();
unity_syscalls->SysQuit(unity_syscalls->target);
}
double Sys_FloatTime(void)
{
return unity_syscalls->SysFloatTime(unity_syscalls->target);
}

42
engine/projects/uniquake/uniquake.c

@ -1,49 +1,7 @@
// uniquake.cpp : Defines the exported functions for the DLL.
//
#include "pch.h"
#include "framework.h"
#include "uniquake.h"
#include "../../code/quakedef.h"
const unity_syscalls_t *unity_syscalls;
void Sys_Error(char *error, ...)
{
va_list argptr;
char text[1024];
va_start(argptr, error);
vsprintf(text, error, argptr);
va_end(argptr);
unity_syscalls->SysError(unity_syscalls->target, text);
}
void Sys_Printf(char *fmt, ...)
{
va_list argptr;
char text[1024];
va_start(argptr, fmt);
vsprintf(text, fmt, argptr);
va_end(argptr);
unity_syscalls->SysPrint(unity_syscalls->target, text);
}
void Sys_Quit(void)
{
Host_Shutdown();
unity_syscalls->SysQuit(unity_syscalls->target);
}
double Sys_FloatTime(void)
{
return unity_syscalls->SysFloatTime(unity_syscalls->target);
}
UNIQUAKE_API void UniQuake_Init(quakeparms_t *parms, const unity_syscalls_t *syscalls)
{
unity_syscalls = syscalls;

5
engine/projects/uniquake/uniquake.h

@ -1,3 +1,8 @@
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
#ifdef UNIQUAKE_EXPORTS
#define UNIQUAKE_API __declspec(dllexport)
#else

10
engine/projects/uniquake/uniquake.vcxproj

@ -248,8 +248,6 @@
<ClInclude Include="..\..\jpeg-6\jpegint.h" />
<ClInclude Include="..\..\jpeg-6\jpeglib.h" />
<ClInclude Include="..\..\jpeg-6\jversion.h" />
<ClInclude Include="framework.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="uniquake.h" />
</ItemGroup>
<ItemGroup>
@ -348,13 +346,7 @@
<ClCompile Include="..\..\jpeg-6\jmemmgr.c" />
<ClCompile Include="..\..\jpeg-6\jmemnobs.c" />
<ClCompile Include="..\..\jpeg-6\jutils.c" />
<ClCompile Include="dllmain.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="sys_uniquake.c" />
<ClCompile Include="uniquake.c" />
</ItemGroup>
<ItemGroup>

15
engine/projects/uniquake/uniquake.vcxproj.filters

@ -27,15 +27,9 @@
<None Include="cpp.hint" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="framework.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="uniquake.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="pch.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\code\anorm_dots.h">
<Filter>engine</Filter>
</ClInclude>
@ -245,12 +239,6 @@
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pch.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\code\cd_win.c">
<Filter>engine</Filter>
</ClCompile>
@ -539,6 +527,9 @@
<ClCompile Include="uniquake.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="sys_uniquake.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\code\winquake.rc">

Loading…
Cancel
Save