This commit is contained in:
romkazvo
2023-08-07 19:29:24 +08:00
commit 34d6c5d489
4832 changed files with 1389451 additions and 0 deletions

BIN
FARCRY/FarCry.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

135
FARCRY/FarCry.rc Normal file
View File

@@ -0,0 +1,135 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// Russian resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
#ifdef _WIN32
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
#pragma code_page(1251)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE
BEGIN
IDS_NOCD "<22><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1-<2D> CD-<2D><><EFBFBD><EFBFBD> <20><><EFBFBD> DVD-<2D><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>."
END
#endif // Russian resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "Crytek"
VALUE "FileDescription", "Far Cry"
VALUE "FileVersion", "1, 0, 0, 1"
VALUE "InternalName", "Far Cry"
VALUE "LegalCopyright", "Copyright (C) 2003 Crytek"
VALUE "OriginalFilename", "FarCry.exe"
VALUE "ProductName", " Far Cry"
VALUE "ProductVersion", "1, 0, 0, 1"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON ICON "FarCry.ico"
IDI_ICON1 ICON "FarCry1.ico"
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

408
FARCRY/FarCry.vcproj Normal file
View File

@@ -0,0 +1,408 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="FarCry"
ProjectGUID="{371D7BDF-BD06-4CF1-A697-CE7CC57C107D}"
SccProjectName="Perforce Project"
SccAuxPath=""
SccLocalPath="."
SccProvider="MSSCCI:Perforce SCM">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Profile|Win32"
OutputDirectory="D:\Games\FC\Bin32"
IntermediateDirectory="Profile"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="3"
GlobalOptimizations="TRUE"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="TRUE"
FavorSizeOrSpeed="2"
OmitFramePointers="TRUE"
EnableFiberSafeOptimizations="FALSE"
OptimizeForProcessor="2"
OptimizeForWindowsApplication="FALSE"
AdditionalIncludeDirectories=".\,..\CryCommon"
PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
StringPooling="TRUE"
RuntimeLibrary="2"
BufferSecurityCheck="FALSE"
EnableFunctionLevelLinking="FALSE"
EnableEnhancedInstructionSet="0"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Profile/FarCry.pch"
AssemblerListingLocation=".\Profile/"
ObjectFile=".\Profile/"
ProgramDataBaseFileName=".\Profile/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="3"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386 /fixed:no"
AdditionalDependencies="odbc32.lib odbccp32.lib"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
SubSystem="2"
BaseAddress="0x37000000"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName="C:\MasterCD/FarCry.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory="C:\MasterCD\Bin32"
IntermediateDirectory=".\Debug"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
OptimizeForProcessor="0"
AdditionalIncludeDirectories=".\,..\CryCommon"
PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
BufferSecurityCheck="TRUE"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="0"
PrecompiledHeaderThrough="stdafx.h"
PrecompiledHeaderFile=".\Debug/FarCry.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="odbc32.lib odbccp32.lib"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
SubSystem="2"
ImportLibrary="$(IntDir)/$(TargetName).lib"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Debug/FarCry.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="C:\MasterCD\Bin32"
IntermediateDirectory="Release"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="3"
GlobalOptimizations="TRUE"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="TRUE"
FavorSizeOrSpeed="2"
OmitFramePointers="TRUE"
EnableFiberSafeOptimizations="FALSE"
OptimizeForProcessor="2"
OptimizeForWindowsApplication="FALSE"
AdditionalIncludeDirectories=".\,..\CryCommon"
PreprocessorDefinitions="_RELEASE;WIN32,NDEBUG,_WINDOWS"
StringPooling="TRUE"
RuntimeLibrary="2"
BufferSecurityCheck="FALSE"
EnableFunctionLevelLinking="FALSE"
EnableEnhancedInstructionSet="0"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Release/FarCry.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="odbc32.lib odbccp32.lib"
OutputFile=".\Release/FarCry.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ProgramDatabaseFile=".\Release/FarCry.pdb"
SubSystem="2"
ImportLibrary="$(IntDir)/$(TargetName).lib"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Release/FarCry.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug64|Win32"
OutputDirectory="C:\MasterCD\Bin64"
IntermediateDirectory="Debug64"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=".\,..\CryCommon"
PreprocessorDefinitions="WIN64,WIN32,_DEBUG,_WINDOWS"
BasicRuntimeChecks="0"
RuntimeLibrary="1"
BufferSecurityCheck="FALSE"
EnableFunctionLevelLinking="FALSE"
UsePrecompiledHeader="0"
PrecompiledHeaderThrough="stdafx.h"
PrecompiledHeaderFile="$(IntDir)/$(ProjectName).pch"
AssemblerListingLocation="$(IntDir)/"
ObjectFile="$(IntDir)/"
ProgramDataBaseFileName="$(IntDir)/$(ProjectName).pdb"
WarningLevel="3"
SuppressStartupBanner="TRUE"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:AMD64"
OutputFile="$(OutDir)/$(ProjectName).exe"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
SubSystem="2"
LargeAddressAware="2"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Debug/FarCry.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release64|Win32"
OutputDirectory="C:\MasterCD\Bin64"
IntermediateDirectory="Release64"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2"
WholeProgramOptimization="TRUE">
<Tool
Name="VCCLCompilerTool"
Optimization="3"
GlobalOptimizations="TRUE"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="TRUE"
AdditionalIncludeDirectories=".\,..\CryCommon"
PreprocessorDefinitions="_RELEASE;NDEBUG;WIN64;WIN32;_AMD64_;_WINDOWS"
BasicRuntimeChecks="0"
RuntimeLibrary="2"
BufferSecurityCheck="FALSE"
EnableFunctionLevelLinking="FALSE"
UsePrecompiledHeader="0"
PrecompiledHeaderThrough="stdafx.h"
PrecompiledHeaderFile="$(IntDir)/$(ProjectName).pch"
AssemblerListingLocation="$(IntDir)/"
ObjectFile="$(IntDir)/"
ProgramDataBaseFileName="$(IntDir)/$(ProjectName).pdb"
WarningLevel="3"
SuppressStartupBanner="TRUE"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:AMD64"
AdditionalDependencies="odbc32.lib odbccp32.lib"
OutputFile="$(OutDir)/$(ProjectName).exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
SubSystem="2"
LargeAddressAware="2"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Debug/FarCry.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath="FarCry.rc">
</File>
<File
RelativePath=".\Main.cpp">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="resource.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
<File
RelativePath=".\FarCry.ico">
</File>
<File
RelativePath=".\FarCry1.ico">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,10 @@
""
{
"FILE_VERSION" = "9237"
"ENLISTMENT_CHOICE" = "NEVER"
"PROJECT_FILE_RELATIVE_PATH" = ""
"NUMBER_OF_EXCLUDED_FILES" = "0"
"ORIGINAL_PROJECT_FILE_PATH" = ""
"NUMBER_OF_NESTED_PROJECTS" = "0"
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROJECT"
}

BIN
FARCRY/FarCry1.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

181
FARCRY/FarCry_XBox.vcproj Normal file
View File

@@ -0,0 +1,181 @@
<?xml version="1.0" encoding = "windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.00"
Name="FarCry_XBox"
ProjectGUID="{371D7BDF-BD06-4CF1-A697-CE7CC57C107D}"
SccProjectName="&quot;$/Game01/FarCry&quot;, JYQAAAAA"
SccAuxPath=""
SccLocalPath="."
SccProvider="MSSCCI:Microsoft Visual SourceSafe">
<Platforms>
<Platform
Name="Xbox"/>
</Platforms>
<Configurations>
<Configuration
Name="Profile|Xbox"
OutputDirectory="Profile"
IntermediateDirectory="Profile"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="2"
AdditionalIncludeDirectories=".\,..\CryCommon"
PreprocessorDefinitions="NDEBUG,_XBOX;_LIB"
StringPooling="TRUE"
BufferSecurityCheck="FALSE"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Profile/FarCry.pch"
AssemblerListingLocation=".\Profile/"
ObjectFile=".\Profile/"
ProgramDataBaseFileName=".\Profile/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="3"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386 /fixed:no"
OutputFile="C:\MasterCD/FarCry.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
GenerateMapFile="TRUE"
MapFileName=".\Profile/FarCry.map"
SubSystem="2"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="XboxDeploymentTool"/>
<Tool
Name="XboxImageTool"/>
</Configuration>
<Configuration
Name="Debug|Xbox"
OutputDirectory="Debug_XBox"
IntermediateDirectory="Debug_XBox"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=".\,..\CryCommon"
PreprocessorDefinitions="_DEBUG,_XBOX;_LIB"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
BufferSecurityCheck="TRUE"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="0"
PrecompiledHeaderThrough="stdafx.h"
PrecompiledHeaderFile=".\Debug_XBox/FarCry.pch"
AssemblerListingLocation=".\Debug_XBox/"
ObjectFile=".\Debug_XBox/"
ProgramDataBaseFileName=".\Debug_XBox/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="xapilibd.lib d3d8d.lib d3dx8d.lib xgraphicsd.lib dsoundd.lib dmusicd.lib xnetd.lib xboxkrnl.lib ..\RenderDll\Common\Textures\Image\nvDxtlib.lib"
OutputFile="$(OutDir)/FarCry.exe"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
SubSystem="2"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="XboxDeploymentTool"
RemotePath="xe:\FarCry\FarCry.xbe"/>
<Tool
Name="XboxImageTool"
FileName="$(TargetDir)$(TargetName).xbe"
StackSize="0x10000"
IncludeDebugInfo="TRUE"/>
</Configuration>
<Configuration
Name="Release|Xbox"
OutputDirectory="Release_XBox"
IntermediateDirectory="Release_XBox"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="2"
AdditionalIncludeDirectories=".\,..\CryCommon"
PreprocessorDefinitions="_RELEASE;NDEBUG,_XBOX;_LIB"
StringPooling="TRUE"
RuntimeLibrary="4"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="0"
PrecompiledHeaderFile="$(IntDir)/FarCry.pch"
AssemblerListingLocation="$(IntDir)/"
ObjectFile="$(IntDir)/"
ProgramDataBaseFileName="$(IntDir)/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="LIBC.LIB xapilib.lib d3d8.lib d3dx8.lib xgraphics.lib dsound.lib dmusic.lib xnet.lib xboxkrnl.lib ..\RenderDll\Common\Textures\Image\nvDxtlib.lib"
OutputFile="$(IntDir)/FarCry.exe"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
IgnoreAllDefaultLibraries="FALSE"
IgnoreDefaultLibraryNames=""
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(IntDir)/FarCry.pdb"
SubSystem="2"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="XboxDeploymentTool"
RemotePath="xe:\FarCry\$(TargetName).xbe"/>
<Tool
Name="XboxImageTool"
StackSize="0x10000"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath=".\Main.cpp">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,10 @@
""
{
"FILE_VERSION" = "9237"
"ENLISTMENT_CHOICE" = "NEVER"
"PROJECT_FILE_RELATIVE_PATH" = ""
"NUMBER_OF_EXCLUDED_FILES" = "0"
"ORIGINAL_PROJECT_FILE_PATH" = "file:F:\\Crytek\\FARCRY\\FarCry_XBox.vcproj"
"NUMBER_OF_NESTED_PROJECTS" = "0"
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROJECT"
}

5
FARCRY/MSSCCPRJ.SCC Normal file
View File

@@ -0,0 +1,5 @@
SCC = This is a source code control file
[FarCry.vcproj]
SCC_Aux_Path = "P4SCC#perforce:1666##marcoc_code##PC018"
SCC_Project_Name = Perforce Project

900
FARCRY/Main.cpp Normal file
View File

@@ -0,0 +1,900 @@
//////////////////////////////////////////////////////////////////////
//
// Game Source Code
//
// File: Main.cpp
// Description: Game Entry point
//
// History:
// - August 27, 2001: Created by Alberto Demichelis
// - October 2, 2002: Modified by Timur Davidenko.
//
//////////////////////////////////////////////////////////////////////
#ifdef WIN32
#include <windows.h>
#include <process.h>
#endif
//#define FARCRY_CD_CHECK_RUSSIAN
#define FARCRY_CD_LABEL _T("FARCRY_1")
//////////////////////////////////////////////////////////////////////////
// Timur.
// This is FarCry.exe authentication function, this code is not for public release!!
//////////////////////////////////////////////////////////////////////////
void AuthCheckFunction( void *data )
{
// src and trg can be the same pointer (in place encryption)
// len must be in bytes and must be multiple of 8 byts (64bits).
// key is 128bit: int key[4] = {n1,n2,n3,n4};
// void encipher(unsigned int *const v,unsigned int *const w,const unsigned int *const k )
#define TEA_ENCODE( src,trg,len,key ) {\
register unsigned int *v = (src), *w = (trg), *k = (key), nlen = (len) >> 3; \
register unsigned int delta=0x9E3779B9,a=k[0],b=k[1],c=k[2],d=k[3]; \
while (nlen--) {\
register unsigned int y=v[0],z=v[1],n=32,sum=0; \
while(n-->0) { sum += delta; y += (z << 4)+a ^ z+sum ^ (z >> 5)+b; z += (y << 4)+c ^ y+sum ^ (y >> 5)+d; } \
w[0]=y; w[1]=z; v+=2,w+=2; }}
// src and trg can be the same pointer (in place decryption)
// len must be in bytes and must be multiple of 8 byts (64bits).
// key is 128bit: int key[4] = {n1,n2,n3,n4};
// void decipher(unsigned int *const v,unsigned int *const w,const unsigned int *const k)
#define TEA_DECODE( src,trg,len,key ) {\
register unsigned int *v = (src), *w = (trg), *k = (key), nlen = (len) >> 3; \
register unsigned int delta=0x9E3779B9,a=k[0],b=k[1],c=k[2],d=k[3]; \
while (nlen--) { \
register unsigned int y=v[0],z=v[1],sum=0xC6EF3720,n=32; \
while(n-->0) { z -= (y << 4)+c ^ y+sum ^ (y >> 5)+d; y -= (z << 4)+a ^ z+sum ^ (z >> 5)+b; sum -= delta; } \
w[0]=y; w[1]=z; v+=2,w+=2; }}
// Data assumed to be 32 bytes.
int key1[4] = {1873613783,235688123,812763783,1745863682};
TEA_DECODE( (unsigned int*)data,(unsigned int*)data,32,(unsigned int*)key1 );
int key2[4] = {1897178562,734896899,156436554,902793442};
TEA_ENCODE( (unsigned int*)data,(unsigned int*)data,32,(unsigned int*)key2 );
}
#define NOT_USE_CRY_MEMORY_MANAGER
#include <platform.h>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <string>
#include <algorithm>
/////////////////////////////////////////////////////////////////////////////
// CRY Stuff ////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
#include "Cry_Math.h"
#include <Cry_Camera.h>
#include <IRenderer.h>
#include <ILog.h>
#include <ISystem.h>
#include <IGame.h>
#include <IConsole.h>
#include <IInput.h>
#include <IStreamEngine.h>
#include "resource.h" // IDI_ICON
// _WAT_comments
//#ifdef USE_MEM_POOL
//_DECLARE_POOL("FarCry",1000*1024);
//#endif
//
static ISystem *g_pISystem=NULL;
static bool g_bSystemRelaunch = false;
static char szMasterCDFolder[_MAX_PATH];
#ifdef WIN32
static HMODULE g_hSystemHandle=NULL;
#define DLL_SYSTEM "CrySystem.dll"
#define DLL_GAME "CryGame.dll"
#endif
#ifndef PS2
#if !defined(PS2)
bool RunGame(HINSTANCE hInstance,const char *sCmdLine);
#else
bool RunGame(HINSTANCE hInstance);
#endif
#ifdef _XBOX
void main()
{
RunGame(NULL,"");
}
#ifndef _DEBUG
int _strcmpi( const char *string1, const char *string2 )
{
return _stricmp( string1, string2 );
}
int system( const char *command )
{
return 0;
}
char * getenv( const char *varname )
{
return 0;
}
#endif //_DEBUG
#endif // _XBOX
//FNC_CryFree _CryFree = NULL;
#ifndef _XBOX
void SetMasterCDFolder()
{
char szExeFileName[_MAX_PATH];
// Get the path of the executable
GetModuleFileName( GetModuleHandle(NULL), szExeFileName, sizeof(szExeFileName));
char path_buffer[_MAX_PATH];
char drive[_MAX_DRIVE];
char dir[_MAX_DIR];
char fname[_MAX_FNAME];
char ext[_MAX_EXT];
_splitpath( szExeFileName, drive, dir, fname, ext );
_makepath( path_buffer, drive,dir,NULL,NULL );
strcat( path_buffer,".." );
SetCurrentDirectory( path_buffer );
GetCurrentDirectory( sizeof(szMasterCDFolder),szMasterCDFolder );
}
#ifdef FARCRY_CD_CHECK_RUSSIAN
#include <winioctl.h>
#include <tchar.h>
typedef std::basic_string< TCHAR > tstring;
typedef std::vector< TCHAR > tvector;
void CheckFarCryCD( HINSTANCE hInstance )
{
bool bRet( false );
DWORD nBufferSize( GetLogicalDriveStrings( 0, 0 ) );
if( 0 < nBufferSize )
{
// get list of all available logical drives
tvector rawDriveLetters( nBufferSize + 1 );
GetLogicalDriveStrings( nBufferSize, &rawDriveLetters[ 0 ] );
// quickly scan all drives
tvector::size_type i( 0 );
while( true )
{
// check if current drive is cd/dvd drive
if( DRIVE_CDROM == GetDriveType( &rawDriveLetters[ i ] ) )
{
// get volume name
tvector cdVolumeName( MAX_VOLUME_ID_SIZE + 1 );
if( FALSE != GetVolumeInformation( &rawDriveLetters[ i ],
&cdVolumeName[ 0 ], (DWORD) cdVolumeName.size(), 0, 0, 0, 0, 0 ) )
{
// check volume name to verify it's Far Cry's game cd/dvd
tstring cdVolumeLabel( &cdVolumeName[ 0 ] );
if( cdVolumeLabel == FARCRY_CD_LABEL)
{
// found Far Cry's game cd/dvd, copy information and bail out
//szCDPath = &rawDriveLetters[ i ];
return;
}
}
}
// proceed to next drive
while( 0 != rawDriveLetters[ i ] )
{
++i;
}
++i; // skip null termination of current drive
// check if we're out of drive letters
if( 0 == rawDriveLetters[ i ] )
{
// double null termination found, bail out
break;
}
}
}
// Not CD/DVD with FARCRY_1 label found. Give to user warning message and bail out.
char str[1024];
LoadString( hInstance,IDS_NOCD,str,sizeof(str) );
MessageBox( NULL,str,_T("CD Check Error"),MB_OK|MB_ICONERROR );
exit(1);
}
#else
void CheckFarCryCD( HINSTANCE hInstance ) {};
#endif // FARCRY_CD_CHECK_RUSSIAN
///////////////////////////////////////////////
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
#ifdef _DEBUG
int tmpDbgFlag;
tmpDbgFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
tmpDbgFlag |= _CRTDBG_LEAK_CHECK_DF;
_CrtSetDbgFlag(tmpDbgFlag);
// Check heap every
//_CrtSetBreakAlloc(119065);
#endif
// [marco] If a previous instance is running, activate
// the old one and terminate the new one, depending
// on command line devmode status
HWND hwndPrev;
static char szWndClass[] = "CryENGINE";
bool bDevMode=false;
bool bRelaunching=false;
if (lpCmdLine)
{
if (strstr(lpCmdLine,"-DEVMODE"))
bDevMode=true;
if (strstr(lpCmdLine,"-RELAUNCHING"))
bRelaunching=true;
}
// in devmode we don't care, we allow to run multiple instances
// for mp debugging
if (!bDevMode)
{
hwndPrev = FindWindow (szWndClass, NULL);
// not in devmode and we found another window - see if the
// system is relaunching, in this case is fine 'cos the application
// will be closed immediately after
if (hwndPrev && !bRelaunching)
{
SetForegroundWindow (hwndPrev);
return (-1);
}
}
CheckFarCryCD(hInstance);
SetMasterCDFolder();
#if !defined(PS2)
RunGame(hInstance,lpCmdLine);
#else
RunGame(hInstance);
#endif
return 0;
}
LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
// Window procedure
RECT rect;
switch (msg)
{
case WM_MOVE:
{
// TODO
break;
}
case WM_DISPLAYCHANGE:
{
// TODO
break;
}
case WM_SIZE:
{
// Check to see if we are losing our window
if ((wParam == SIZE_MAXHIDE) || (wParam == SIZE_MINIMIZED))
{
// TODO
break;
}
GetClientRect(hWnd, &rect);
if (g_pISystem && !g_bSystemRelaunch)
g_pISystem->GetIRenderer()->ChangeViewport(0, 0, LOWORD(lParam), HIWORD(lParam));
break;
}
case WM_ACTIVATEAPP:
{
if (!wParam)
{
if (g_pISystem && g_pISystem->GetIInput())
{
g_pISystem->GetIInput()->ClearKeyState();
g_pISystem->GetIInput()->SetMouseExclusive(false);
g_pISystem->GetIInput()->SetKeyboardExclusive(false);
}
}
else
{
if (g_pISystem && g_pISystem->GetIInput())
{
g_pISystem->GetIInput()->ClearKeyState();
g_pISystem->GetIInput()->SetMouseExclusive(true);
g_pISystem->GetIInput()->SetKeyboardExclusive(true);
}
}
break;
}
case WM_MOUSEACTIVATE:
{
return MA_ACTIVATEANDEAT;
}
case WM_ACTIVATE:
{
if (wParam == WA_INACTIVE)
{
if (g_pISystem && g_pISystem->GetIInput())
{
g_pISystem->GetIInput()->ClearKeyState();
g_pISystem->GetIInput()->SetMouseExclusive(false);
g_pISystem->GetIInput()->SetKeyboardExclusive(false);
}
}
else if ((wParam == WA_ACTIVE) ||(wParam == WA_CLICKACTIVE))
{
if (g_pISystem && g_pISystem->GetIInput())
{
g_pISystem->GetIInput()->SetMouseExclusive(true);
g_pISystem->GetIInput()->SetKeyboardExclusive(true);
}
}
break;
}
case WM_ENTERSIZEMOVE:
case WM_ENTERMENULOOP:
{
return 0;
}
case WM_SETFOCUS:
{
if (g_pISystem && g_pISystem->GetIInput())
{
g_pISystem->GetIInput()->ClearKeyState();
g_pISystem->GetIInput()->SetMouseExclusive(true);
g_pISystem->GetIInput()->SetKeyboardExclusive(true);
}
break;
}
case WM_KILLFOCUS:
{
if (g_pISystem && g_pISystem->GetIInput())
{
g_pISystem->GetIInput()->ClearKeyState();
g_pISystem->GetIInput()->SetMouseExclusive(false);
g_pISystem->GetIInput()->SetKeyboardExclusive(false);
}
break;
}
case WM_DESTROY:
{
// TODO
break;
}
case WM_HOTKEY:
return 0;
break;
case WM_SYSKEYDOWN:
{
if (g_pISystem && g_pISystem->GetIInput())
g_pISystem->GetIInput()->FeedVirtualKey(wParam,lParam,true);
break;
}
case WM_SYSKEYUP:
{
if (g_pISystem && g_pISystem->GetIInput())
g_pISystem->GetIInput()->FeedVirtualKey(wParam,lParam,false);
break;
}
case WM_KEYDOWN:
if (g_pISystem && g_pISystem->GetIInput())
g_pISystem->GetIInput()->FeedVirtualKey(wParam,lParam,true);
break;
case WM_KEYUP:
if (g_pISystem && g_pISystem->GetIInput())
g_pISystem->GetIInput()->FeedVirtualKey(wParam,lParam,false);
break;
case WM_CHAR:
{
break;
}
case 0x020A: // WM_MOUSEWHEEL
g_pISystem->GetIInput()->GetIMouse()->SetMouseWheelRotation((short) HIWORD(wParam));
break;
case WM_QUIT:
{
/*m_pGame->Release();
m_pGame = NULL;
*/
/*
if (g_pISystem)
{
g_pISystem->Quit();
}
*/
break;
}
case WM_CLOSE:
{
if (g_pISystem)
{
g_pISystem->Quit();
}
break;
}
}
return (DefWindowProc(hWnd, msg, wParam, lParam));
}
bool RegisterWindow(HINSTANCE hInst)
{
// Register a window class
WNDCLASS wc;
wc.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = WndProc;
wc.cbClsExtra = 4;
wc.cbWndExtra = 4;
wc.hInstance = hInst;
wc.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ICON));
wc.hCursor = NULL;
wc.hbrBackground =(HBRUSH)GetStockObject(BLACK_BRUSH);
wc.lpszMenuName = NULL;
wc.lpszClassName = "CryENGINE";
if (!RegisterClass(&wc))
return false;
else
return true;
}
#endif
#else //PS2
bool RunGamePS2(IGame *hInstance)
{
SSystemInitParams sip;
sip.sLogFileName = "log.txt";
g_pISystem = CreateSystemInterface( sip );
if (!g_pISystem)
{
//Error( "CreateSystemInterface Failed" );
return false;
}
// Enable Log verbosity.
g_pISystem->GetILog()->EnableVerbosity(true);
/////////////////////////////////////////////////////////////////////
// INITIAL CONSOLE STATUS IS ACTIVE
/////////////////////////////////////////////////////////////////////
g_pISystem->GetIConsole()->ShowConsole(true);
//////////////////////////////////////////////////////////////////////////////////////////////////////////
SGameInitParams gip;
if (!g_pISystem->CreateGame( gip ))
{
//Error( "CreateGame Failed" );
return false;
}
IGame *pGame = g_pISystem->GetIGame();
pGame->Run(bRelaunch);
// Release System and Game.
g_pISystem->Release();
g_pISystem = NULL;
return true;
}
#endif //PS2
// returns the decimal string representation of the given int
string IntToString (int nNumber)
{
char szNumber[16];
// itoa (nNumber, szNumber, 10);
sprintf (szNumber, "%d", nNumber);
return szNumber;
}
// returns hexadecimal string representation of the given dword
string UIntToHexString(DWORD dwNumber)
{
char szNumber[24];
sprintf (szNumber, "0x%X", dwNumber);
return szNumber;
}
string TryFormatWinError(DWORD dwError)
{
#ifdef WIN32
LPVOID lpMsgBuf; // pointer to the buffer that will accept the formatted message
//DWORD dwLastError = OsGetLastError(); // the last user error for which the description should be formatted
DWORD dwFormattedMsgLen = FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, dwError, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL );
if (!dwFormattedMsgLen)
// error. return both the user error and the error received during formatting the user error
return string();
else
{// the lpMsgBuf contains allocated by the system call message that is to be returned.
// we'll copy it into sResult and free it and return sResult
string sResult = (LPCTSTR) lpMsgBuf;
LocalFree (lpMsgBuf);
while (!sResult.empty() && ((unsigned char)sResult[sResult.length()-1]) < 0x20)
sResult.resize(sResult.length()-1);
return sResult;
}
#else
return "Unknown error";
#endif
}
// returns the string representation (in natural language) of the last error retrieved by GetLastError()
string FormatWinError(DWORD dwError)
{
string sResult = TryFormatWinError(dwError);
if (sResult.empty())
// error. return both the user error and the error received during formatting the user error
sResult = "Error " + IntToString (GetLastError()) + " while formatting error message";
return sResult + "\n(" + (dwError & 0x80000000 ? UIntToHexString(dwError):IntToString(dwError)) + ")";
}
#define MAX_CMDLINE_LEN 256
#include <crtdbg.h>
///////////////////////////////////////////////
// Load the game DLL and run it
static void
InvokeExternalConfigTool()
{
#if defined(WIN32) || defined(WIN64)
try
{
// build tmp working directory
char tmpWorkingDir[ MAX_PATH ];
GetModuleFileName( 0, tmpWorkingDir, MAX_PATH );
strlwr( tmpWorkingDir );
// look for \bin as it should work for either \bin32 and \bin64
char* pBin( strstr( tmpWorkingDir, "\\bin" ) );
if( 0 != pBin )
{
// trunc tmp working directory path to X:\...\MasterCD
*pBin = 0;
// save current working directory
char curWorkingDir[ MAX_PATH ];
GetCurrentDirectory( MAX_PATH, curWorkingDir );
// set temporary working directory and launch external config tool
SetCurrentDirectory( tmpWorkingDir );
_spawnl( _P_WAIT, "Bin32\\FarCryConfigurator.exe", "Bin32\\FarCryConfigurator.exe", "/Caller=FarCry", 0 );
// restore current working directory
SetCurrentDirectory( curWorkingDir );
}
}
catch( ... )
{
}
#endif
}
//////////////////////////////////////////////////////////////////////////
//#define GERMAN_GORE_CHECK
#ifdef GERMAN_GORE_CHECK
#include "IEntitySystem.h"
#endif
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
bool RunGame(HINSTANCE hInstance,const char *sCmdLine)
{
InvokeExternalConfigTool();
HWND hWnd=NULL;
// initialize the system
bool bRelaunch=false;
char szLocalCmdLine[MAX_CMDLINE_LEN];
memset(szLocalCmdLine,0,MAX_CMDLINE_LEN);
if (sCmdLine)
strncpy(szLocalCmdLine,sCmdLine,MAX_CMDLINE_LEN);
do {
//_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_DELAY_FREE_MEM_DF | _CRTDBG_LEAK_CHECK_DF | _CRTDBG_CHECK_ALWAYS_DF);
SSystemInitParams sip;
sip.sLogFileName = "log.txt";
if (szLocalCmdLine[0])
{
int nLen=(int)strlen(szLocalCmdLine);
if (nLen>MAX_CMDLINE_LEN)
nLen=MAX_CMDLINE_LEN;
strncpy(sip.szSystemCmdLine,szLocalCmdLine,nLen);
}
#ifndef _XBOX
/////////////////////////////////////////////////////
/////////////////////////////////////////////////////
if (!hWnd && !RegisterWindow(hInstance))
{
if (!hWnd && RegisterWindow(hInstance))
{
MessageBox(0, "Cannot Register Window\n", "Error", MB_OK | MB_DEFAULT_DESKTOP_ONLY);
return false;
}
}
g_hSystemHandle = LoadLibrary(DLL_SYSTEM);
if (!g_hSystemHandle)
{
DWORD dwLastError = GetLastError();
MessageBox( NULL,("CrySystem.dll Loading Failed:\n" + TryFormatWinError(dwLastError)).c_str(),"FarCry Error",MB_OK|MB_ICONERROR );
return false;
}
PFNCREATESYSTEMINTERFACE pfnCreateSystemInterface =
(PFNCREATESYSTEMINTERFACE)::GetProcAddress( g_hSystemHandle,"CreateSystemInterface" );
// Initialize with instance and window handles.
sip.hInstance = hInstance;
sip.hWnd = hWnd;
sip.pSystem = g_pISystem;
sip.pCheckFunc = AuthCheckFunction;
// initialize the system
g_pISystem = pfnCreateSystemInterface( sip );
if (!g_pISystem)
{
MessageBox( NULL,"CreateSystemInterface Failed","FarCry Error",MB_OK|MB_ICONERROR );
return false;
}
#else
// initialize the system
g_pISystem = CreateSystemInterface( sip );
#endif
//////////////////////////////////////////////////////////////////////////
#ifdef GERMAN_GORE_CHECK
string sVar=string("g")+"_"+"g"+"o"+"r"+"e";
ICVar *pGore=g_pISystem->GetIConsole()->CreateVariable(sVar.c_str(),"1",VF_DUMPTODISK|VF_READONLY);
pGore->ForceSet("1");
#endif
//////////////////////////////////////////////////////////////////////////
// Enable Log verbosity.
g_pISystem->GetILog()->EnableVerbosity(true);
{
AutoSuspendTimeQuota suspender (g_pISystem->GetStreamEngine());
/////////////////////////////////////////////////////////////////////
// INITIAL CONSOLE STATUS IS INACTIVE
/////////////////////////////////////////////////////////////////////
g_pISystem->GetIConsole()->ShowConsole(false);
g_pISystem->GetIConsole()->SetScrollMax(600/2);
#ifdef WIN32
SGameInitParams ip;
ip.sGameDLL = DLL_GAME;
if (szLocalCmdLine[0])
strncpy(ip.szGameCmdLine,szLocalCmdLine,sizeof(ip.szGameCmdLine));
#ifdef GORE_CHECK
ICVar *pGore=g_pISystem->GetIConsole()->CreateVariable("g_gore","1",VF_DUMPTODISK|VF_READONLY);
pGore->ForceSet("1");
#endif
if (!g_pISystem->CreateGame( ip ))
{
MessageBox( NULL,"CreateGame Failed: CryGame.dll","FarCry Error",MB_OK|MB_ICONERROR );
return false;
}
#else
SGameInitParams ip;
if (!g_pISystem->CreateGame( ip ))
{
//Error( "CreateGame Failed" );
return false;
}
#endif
// g_pISystem->GetIConsole()->ExecuteString(sCmdLine);
}
g_bSystemRelaunch = false;
// set the controls to exclusive mode
g_pISystem->GetIInput()->ClearKeyState();
g_pISystem->GetIInput()->SetMouseExclusive(true);
g_pISystem->GetIInput()->SetKeyboardExclusive(true);
IGame *pGame = g_pISystem->GetIGame();
//////////////////////////////////////////////////////////////////////////
#ifdef GERMAN_GORE_CHECK
string sDLL=string("C")+"r"+"y"+"E"+"n"+"t"+"i"+"t"+"y"+"S"+"y"+"s"+"t"+"e"+"m"+"."+"d"+"l"+"l";
HMODULE tDLL= ::LoadLibrary(sDLL.c_str());
if (!tDLL)
{
return false;
g_pISystem->Release();
g_pISystem->Release();
g_pISystem++;
}
PFNCREATEMAINENTITYSYSTEM pfnCreateEntitySystem;
string sFunc=string("C")+"r"+"e"+"a"+"t"+"e"+"M"+"a"+"i"+"n"+"E"+"n"+"t"+"i"+"t"+"y"+"S"+"y"+"s"+"t"+"e"+"m";
pfnCreateEntitySystem = (PFNCREATEMAINENTITYSYSTEM) ::GetProcAddress( tDLL, sFunc.c_str());
if (!pfnCreateEntitySystem)
{
return false;
g_pISystem->Release();
g_pISystem->Release();
g_pISystem++;
}
::FreeLibrary(tDLL);
#endif
//////////////////////////////////////////////////////////////////////////
pGame->Run(bRelaunch);
// remove the previous cmdline in case we relaunch
memset(szLocalCmdLine,0,MAX_CMDLINE_LEN);
if (g_pISystem)
{
const char *szMod=NULL;
IGameMods *pMods=pGame->GetModsInterface();
if (pMods)
szMod=pMods->GetCurrentMod();
if (szMod!=NULL && (strlen(szMod)>0))
{
// the game is relaunching because the MOD changed -
// add it as system paramter for the next relaunch
//strncpy(szLocalCmdLine,szMod,MAX_CMDLINE_LEN);
sprintf(szLocalCmdLine,"-MOD:%s",szMod);
}
hWnd = (HWND)g_pISystem->GetIRenderer()->GetHWND();
g_pISystem->Relaunch(bRelaunch);
g_bSystemRelaunch = true;
if (!bRelaunch)
SAFE_RELEASE(g_pISystem);
}
#ifdef WIN32
/*
// Call to free all allocated memory.
if (g_bSystemRelaunch)
{
typedef void* (*PFN_CRYFREEMEMORYPOOLS)();
PFN_CRYFREEMEMORYPOOLS pfnCryFreeMemoryPools = (PFN_CRYFREEMEMORYPOOLS)::GetProcAddress( g_hSystemHandle,"CryFreeMemoryPools" );
if (pfnCryFreeMemoryPools)
pfnCryFreeMemoryPools();
}
*/
if (!bRelaunch)
::FreeLibrary(g_hSystemHandle);
g_hSystemHandle= NULL;
if (hWnd)
{
::DestroyWindow((HWND)hWnd);
hWnd = NULL;
}
#endif;
} while(false);
if (bRelaunch)
{
#ifdef WIN32
// Start a new FarCry process, before exiting this one.
// use the new command line when restarting
STARTUPINFO si;
PROCESS_INFORMATION pi;
memset( &pi,0,sizeof(pi) );
memset( &si,0,sizeof(si) );
si.cb = sizeof(si);
char szExe[_MAX_PATH];
GetModuleFileName( NULL,szExe,sizeof(szExe) );
// [marco] must alloc a new one 'cos could be modified
// by CreateProcess
char *szBuf=NULL;
if (szLocalCmdLine[0])
{
szBuf = new char[strlen(szLocalCmdLine) + strlen(szExe) + strlen("-RELAUNCHING") + 4];
sprintf(szBuf,"%s %s -RELAUNCHING",szExe,szLocalCmdLine);
}
else
{
szBuf = new char[strlen(szExe) + strlen("-RELAUNCHING") + 4];
sprintf(szBuf,"%s -RELAUNCHING",szExe);
}
CreateProcess(0,szBuf,NULL,NULL,FALSE,NULL,NULL,szMasterCDFolder,&si,&pi );
// Now terminate this process as fast as possible.
ExitProcess( 0 );
#endif WIN32
}
return true;
}

18
FARCRY/resource.h Normal file
View File

@@ -0,0 +1,18 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by FarCry.rc
//
#define IDI_ICON 101
#define IDI_ICON1 102
#define IDS_NOCD 103
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 104
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif