1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-25 01:57:47 +01:00

add DebugLog build config

This commit is contained in:
FunkyFr3sh 2020-10-13 10:15:42 +02:00
parent baaa87b18f
commit 25e561d953
9 changed files with 64 additions and 18 deletions

View File

@ -1,18 +1,21 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15 # Visual Studio Version 16
VisualStudioVersion = 15.0.27004.2006 VisualStudioVersion = 16.0.30503.244
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cnc-ddraw", "cnc-ddraw.vcxproj", "{96094551-5D52-4EBD-BE4C-5291A03507FC}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cnc-ddraw", "cnc-ddraw.vcxproj", "{96094551-5D52-4EBD-BE4C-5291A03507FC}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86 Debug|x86 = Debug|x86
DebugLog|x86 = DebugLog|x86
Release|x86 = Release|x86 Release|x86 = Release|x86
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{96094551-5D52-4EBD-BE4C-5291A03507FC}.Debug|x86.ActiveCfg = Debug|Win32 {96094551-5D52-4EBD-BE4C-5291A03507FC}.Debug|x86.ActiveCfg = Debug|Win32
{96094551-5D52-4EBD-BE4C-5291A03507FC}.Debug|x86.Build.0 = Debug|Win32 {96094551-5D52-4EBD-BE4C-5291A03507FC}.Debug|x86.Build.0 = Debug|Win32
{96094551-5D52-4EBD-BE4C-5291A03507FC}.DebugLog|x86.ActiveCfg = DebugLog|Win32
{96094551-5D52-4EBD-BE4C-5291A03507FC}.DebugLog|x86.Build.0 = DebugLog|Win32
{96094551-5D52-4EBD-BE4C-5291A03507FC}.Release|x86.ActiveCfg = Release|Win32 {96094551-5D52-4EBD-BE4C-5291A03507FC}.Release|x86.ActiveCfg = Release|Win32
{96094551-5D52-4EBD-BE4C-5291A03507FC}.Release|x86.Build.0 = Release|Win32 {96094551-5D52-4EBD-BE4C-5291A03507FC}.Release|x86.Build.0 = Release|Win32
EndGlobalSection EndGlobalSection

View File

@ -1,6 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations"> <ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="DebugLog|Win32">
<Configuration>DebugLog</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32"> <ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
<Platform>Win32</Platform> <Platform>Win32</Platform>
@ -101,6 +105,13 @@
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet> <CharacterSet>MultiByte</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugLog|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings"> <ImportGroup Label="ExtensionSettings">
</ImportGroup> </ImportGroup>
@ -112,6 +123,9 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugLog|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" /> <PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)bin\Debug\</OutDir> <OutDir>$(SolutionDir)bin\Debug\</OutDir>
@ -125,6 +139,12 @@
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
<TargetName>ddraw</TargetName> <TargetName>ddraw</TargetName>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugLog|Win32'">
<OutDir>$(SolutionDir)bin\Release\</OutDir>
<IntDir>$(SolutionDir)bin\Release\</IntDir>
<LinkIncremental>false</LinkIncremental>
<TargetName>ddraw</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile> <ClCompile>
<PrecompiledHeader> <PrecompiledHeader>
@ -168,6 +188,26 @@ if exist "$(LocalDebuggerCommand)" if exist "$(LocalDebuggerWorkingDirectory)"
<ModuleDefinitionFile>ddraw.def</ModuleDefinitionFile> <ModuleDefinitionFile>ddraw.def</ModuleDefinitionFile>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugLog|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_DEBUG;_DEBUG_X;WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalIncludeDirectories>inc;src\detours</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>winmm.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ModuleDefinitionFile>ddraw.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
</ImportGroup> </ImportGroup>

View File

@ -1,9 +1,9 @@
LIBRARY ddraw.dll LIBRARY ddraw.dll
EXPORTS EXPORTS
DirectDrawCreate @8 DirectDrawCreate @8
DirectDrawCreateClipper @9 DirectDrawCreateClipper @9
DirectDrawEnumerateA @11 DirectDrawEnumerateA @11
GameHandlesClose DATA GameHandlesClose DATA
NvOptimusEnablement DATA NvOptimusEnablement DATA
AmdPowerXpressRequestHighPerformance DATA AmdPowerXpressRequestHighPerformance DATA

View File

@ -24,7 +24,7 @@ extern DWORD g_dbg_frame_count;
//#define _DEBUG 1 //#define _DEBUG 1
//use OutputDebugStringA rather than printf //use OutputDebugStringA rather than printf
#define _DEBUG_S 1 //#define _DEBUG_S 1
//log everything (slow) //log everything (slow)
//#define _DEBUG_X 1 //#define _DEBUG_X 1

View File

@ -36,8 +36,8 @@ extern PFNGLVERTEX2FPROC glVertex2f;
BOOL oglu_load_dll(); BOOL oglu_load_dll();
void oglu_init(); void oglu_init();
BOOL oglu_ext_exists(char *ext, HDC hdc); BOOL oglu_ext_exists(char *ext, HDC hdc);
GLuint oglu_build_program(const GLchar *vertSource, const GLchar *fragSource); GLuint oglu_build_program(const GLchar *vert_source, const GLchar *frag_source);
GLuint oglu_build_program_from_file(const char *filePath); GLuint oglu_build_program_from_file(const char *file_path);
extern PFNGLVIEWPORTPROC glViewport; extern PFNGLVIEWPORTPROC glViewport;
extern PFNGLBINDTEXTUREPROC glBindTexture; extern PFNGLBINDTEXTUREPROC glBindTexture;

View File

@ -229,7 +229,7 @@ BOOL oglu_ext_exists(char *ext, HDC hdc)
return FALSE; return FALSE;
} }
GLuint oglu_build_program(const GLchar *vertSource, const GLchar *fragSource) GLuint oglu_build_program(const GLchar *vert_source, const GLchar *frag_source)
{ {
if (!glCreateShader || !glShaderSource || !glCompileShader || !glCreateProgram || if (!glCreateShader || !glShaderSource || !glCompileShader || !glCreateProgram ||
!glAttachShader || !glLinkProgram || !glUseProgram || !glDetachShader) !glAttachShader || !glLinkProgram || !glUseProgram || !glDetachShader)
@ -241,8 +241,8 @@ GLuint oglu_build_program(const GLchar *vertSource, const GLchar *fragSource)
if (!vert_shader || !frag_shader) if (!vert_shader || !frag_shader)
return 0; return 0;
glShaderSource(vert_shader, 1, &vertSource, NULL); glShaderSource(vert_shader, 1, &vert_source, NULL);
glShaderSource(frag_shader, 1, &fragSource, NULL); glShaderSource(frag_shader, 1, &frag_source, NULL);
GLint is_compiled = 0; GLint is_compiled = 0;
@ -305,11 +305,11 @@ GLuint oglu_build_program(const GLchar *vertSource, const GLchar *fragSource)
return program; return program;
} }
GLuint oglu_build_program_from_file(const char *filePath) GLuint oglu_build_program_from_file(const char *file_path)
{ {
GLuint program = 0; GLuint program = 0;
FILE *file = fopen(filePath, "rb"); FILE *file = fopen(file_path, "rb");
if (file) if (file)
{ {
fseek(file, 0, SEEK_END); fseek(file, 0, SEEK_END);

View File

@ -7,6 +7,7 @@
#include "render_d3d9.h" #include "render_d3d9.h"
#include "utils.h" #include "utils.h"
#include "wndproc.h" #include "wndproc.h"
#include "debug.h"
static BOOL d3d9_create_resouces(); static BOOL d3d9_create_resouces();
@ -313,7 +314,7 @@ DWORD WINAPI d3d9_render_main(void)
(g_ddraw->render.forcefps || WaitForSingleObject(g_ddraw->render.sem, 200) != WAIT_FAILED)) (g_ddraw->render.forcefps || WaitForSingleObject(g_ddraw->render.sem, 200) != WAIT_FAILED))
{ {
#if _DEBUG #if _DEBUG
DrawFrameInfoStart(); dbg_draw_frame_info_start();
#endif #endif
static int tex_index = 0, palIndex = 0; static int tex_index = 0, palIndex = 0;
@ -422,7 +423,7 @@ DWORD WINAPI d3d9_render_main(void)
} }
#if _DEBUG #if _DEBUG
DrawFrameInfoEnd(); dbg_draw_frame_info_end();
#endif #endif
if (g_ddraw->fps_limiter.tick_length > 0) if (g_ddraw->fps_limiter.tick_length > 0)

View File

@ -5,6 +5,7 @@
#include "opengl_utils.h" #include "opengl_utils.h"
#include "utils.h" #include "utils.h"
#include "wndproc.h" #include "wndproc.h"
#include "debug.h"
DWORD WINAPI gdi_render_main(void) DWORD WINAPI gdi_render_main(void)
@ -52,7 +53,7 @@ DWORD WINAPI gdi_render_main(void)
(g_ddraw->render.forcefps || WaitForSingleObject(g_ddraw->render.sem, 200) != WAIT_FAILED)) (g_ddraw->render.forcefps || WaitForSingleObject(g_ddraw->render.sem, 200) != WAIT_FAILED))
{ {
#if _DEBUG #if _DEBUG
DrawFrameInfoStart(); dbg_draw_frame_info_start();
#endif #endif
if (g_ddraw->fps_limiter.tick_length > 0) if (g_ddraw->fps_limiter.tick_length > 0)
@ -145,7 +146,7 @@ DWORD WINAPI gdi_render_main(void)
LeaveCriticalSection(&g_ddraw->cs); LeaveCriticalSection(&g_ddraw->cs);
#if _DEBUG #if _DEBUG
DrawFrameInfoEnd(); dbg_draw_frame_info_end();
#endif #endif
if (g_ddraw->fps_limiter.tick_length > 0) if (g_ddraw->fps_limiter.tick_length > 0)

View File

@ -7,6 +7,7 @@
#include "render_gdi.h" #include "render_gdi.h"
#include "render_ogl.h" #include "render_ogl.h"
#include "utils.h" #include "utils.h"
#include "debug.h"
static HGLRC ogl_create_context(HDC hdc); static HGLRC ogl_create_context(HDC hdc);
@ -545,7 +546,7 @@ static void ogl_render()
(g_ddraw->render.forcefps || WaitForSingleObject(g_ddraw->render.sem, 200) != WAIT_FAILED)) (g_ddraw->render.forcefps || WaitForSingleObject(g_ddraw->render.sem, 200) != WAIT_FAILED))
{ {
#if _DEBUG #if _DEBUG
DrawFrameInfoStart(); dbg_draw_frame_info_start();
#endif #endif
g_ogl.scale_w = (float)g_ddraw->width / g_ogl.surface_tex_width; g_ogl.scale_w = (float)g_ddraw->width / g_ogl.surface_tex_width;
@ -773,7 +774,7 @@ static void ogl_render()
SwapBuffers(g_ddraw->render.hdc); SwapBuffers(g_ddraw->render.hdc);
#if _DEBUG #if _DEBUG
DrawFrameInfoEnd(); dbg_draw_frame_info_end();
#endif #endif
if (g_ddraw->fps_limiter.tick_length > 0) if (g_ddraw->fps_limiter.tick_length > 0)