diff options
author | David Walter Seikel | 2013-01-13 18:54:10 +1000 |
---|---|---|
committer | David Walter Seikel | 2013-01-13 18:54:10 +1000 |
commit | 959831f4ef5a3e797f576c3de08cd65032c997ad (patch) | |
tree | e7351908be5995f0b325b2ebeaa02d5a34b82583 /libraries/irrlicht-1.8/examples/21.Quake3Explorer | |
parent | Add info about changes to Irrlicht. (diff) | |
download | SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.zip SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.gz SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.bz2 SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.xz |
Remove damned ancient DOS line endings from Irrlicht. Hopefully I did not go overboard.
Diffstat (limited to '')
12 files changed, 4344 insertions, 4344 deletions
diff --git a/libraries/irrlicht-1.8/examples/21.Quake3Explorer/Makefile b/libraries/irrlicht-1.8/examples/21.Quake3Explorer/Makefile index b2c6927..f714782 100644 --- a/libraries/irrlicht-1.8/examples/21.Quake3Explorer/Makefile +++ b/libraries/irrlicht-1.8/examples/21.Quake3Explorer/Makefile | |||
@@ -1,38 +1,38 @@ | |||
1 | # Makefile for Irrlicht Examples | 1 | # Makefile for Irrlicht Examples |
2 | # It's usually sufficient to change just the target name and source file list | 2 | # It's usually sufficient to change just the target name and source file list |
3 | # and be sure that CXX is set to a valid compiler | 3 | # and be sure that CXX is set to a valid compiler |
4 | Target = 21.Quake3Explorer | 4 | Target = 21.Quake3Explorer |
5 | Sources = main.cpp sound.cpp q3factory.cpp | 5 | Sources = main.cpp sound.cpp q3factory.cpp |
6 | 6 | ||
7 | # general compiler settings | 7 | # general compiler settings |
8 | CPPFLAGS = -I../../include -I/usr/X11R6/include | 8 | CPPFLAGS = -I../../include -I/usr/X11R6/include |
9 | #CXXFLAGS = -O3 -ffast-math | 9 | #CXXFLAGS = -O3 -ffast-math |
10 | CXXFLAGS = -g -Wall | 10 | CXXFLAGS = -g -Wall |
11 | 11 | ||
12 | #default target is Linux | 12 | #default target is Linux |
13 | all: all_linux | 13 | all: all_linux |
14 | 14 | ||
15 | ifeq ($(HOSTTYPE), x86_64) | 15 | ifeq ($(HOSTTYPE), x86_64) |
16 | LIBSELECT=64 | 16 | LIBSELECT=64 |
17 | endif | 17 | endif |
18 | 18 | ||
19 | # target specific settings | 19 | # target specific settings |
20 | all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor | 20 | all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor |
21 | all_linux clean_linux: SYSTEM=Linux | 21 | all_linux clean_linux: SYSTEM=Linux |
22 | all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm | 22 | all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm |
23 | all_win32 clean_win32: SYSTEM=Win32-gcc | 23 | all_win32 clean_win32: SYSTEM=Win32-gcc |
24 | all_win32 clean_win32: SUF=.exe | 24 | all_win32 clean_win32: SUF=.exe |
25 | # name of the binary - only valid for targets which set SYSTEM | 25 | # name of the binary - only valid for targets which set SYSTEM |
26 | DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) | 26 | DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) |
27 | 27 | ||
28 | all_linux all_win32: | 28 | all_linux all_win32: |
29 | $(warning Building...) | 29 | $(warning Building...) |
30 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) | 30 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) |
31 | 31 | ||
32 | clean: clean_linux clean_win32 | 32 | clean: clean_linux clean_win32 |
33 | $(warning Cleaning...) | 33 | $(warning Cleaning...) |
34 | 34 | ||
35 | clean_linux clean_win32: | 35 | clean_linux clean_win32: |
36 | @$(RM) $(DESTPATH) | 36 | @$(RM) $(DESTPATH) |
37 | 37 | ||
38 | .PHONY: all all_win32 clean clean_linux clean_win32 | 38 | .PHONY: all all_win32 clean clean_linux clean_win32 |
diff --git a/libraries/irrlicht-1.8/examples/21.Quake3Explorer/Quake3Explorer.dev b/libraries/irrlicht-1.8/examples/21.Quake3Explorer/Quake3Explorer.dev index 193c6bd..b943f81 100644 --- a/libraries/irrlicht-1.8/examples/21.Quake3Explorer/Quake3Explorer.dev +++ b/libraries/irrlicht-1.8/examples/21.Quake3Explorer/Quake3Explorer.dev | |||
@@ -1,99 +1,99 @@ | |||
1 | [Project] | 1 | [Project] |
2 | FileName=Quake3Explorer.dev | 2 | FileName=Quake3Explorer.dev |
3 | Name=Irrlicht Example 21 Quake3 Explorer | 3 | Name=Irrlicht Example 21 Quake3 Explorer |
4 | UnitCount=5 | 4 | UnitCount=5 |
5 | Type=1 | 5 | Type=1 |
6 | Ver=1 | 6 | Ver=1 |
7 | ObjFiles= | 7 | ObjFiles= |
8 | Includes=..\..\include | 8 | Includes=..\..\include |
9 | Libs= | 9 | Libs= |
10 | PrivateResource= | 10 | PrivateResource= |
11 | ResourceIncludes= | 11 | ResourceIncludes= |
12 | MakeIncludes= | 12 | MakeIncludes= |
13 | Compiler= | 13 | Compiler= |
14 | CppCompiler= | 14 | CppCompiler= |
15 | Linker=../../lib/Win32-gcc/libIrrlicht.a_@@_ | 15 | Linker=../../lib/Win32-gcc/libIrrlicht.a_@@_ |
16 | IsCpp=1 | 16 | IsCpp=1 |
17 | Icon= | 17 | Icon= |
18 | ExeOutput=../../bin/Win32-gcc | 18 | ExeOutput=../../bin/Win32-gcc |
19 | ObjectOutput=obj | 19 | ObjectOutput=obj |
20 | OverrideOutput=1 | 20 | OverrideOutput=1 |
21 | OverrideOutputName=21.Quake3Explorer.exe | 21 | OverrideOutputName=21.Quake3Explorer.exe |
22 | HostApplication= | 22 | HostApplication= |
23 | Folders= | 23 | Folders= |
24 | CommandLine= | 24 | CommandLine= |
25 | IncludeVersionInfo=0 | 25 | IncludeVersionInfo=0 |
26 | SupportXPThemes=0 | 26 | SupportXPThemes=0 |
27 | CompilerSet=0 | 27 | CompilerSet=0 |
28 | CompilerSettings=0000000000000000000000 | 28 | CompilerSettings=0000000000000000000000 |
29 | UseCustomMakefile=0 | 29 | UseCustomMakefile=0 |
30 | CustomMakefile= | 30 | CustomMakefile= |
31 | 31 | ||
32 | [Unit1] | 32 | [Unit1] |
33 | FileName=main.cpp | 33 | FileName=main.cpp |
34 | CompileCpp=1 | 34 | CompileCpp=1 |
35 | Folder=Projekt1 | 35 | Folder=Projekt1 |
36 | Compile=1 | 36 | Compile=1 |
37 | Link=1 | 37 | Link=1 |
38 | Priority=1000 | 38 | Priority=1000 |
39 | OverrideBuildCmd=0 | 39 | OverrideBuildCmd=0 |
40 | BuildCmd= | 40 | BuildCmd= |
41 | 41 | ||
42 | [VersionInfo] | 42 | [VersionInfo] |
43 | Major=0 | 43 | Major=0 |
44 | Minor=1 | 44 | Minor=1 |
45 | Release=1 | 45 | Release=1 |
46 | Build=1 | 46 | Build=1 |
47 | LanguageID=1033 | 47 | LanguageID=1033 |
48 | CharsetID=1252 | 48 | CharsetID=1252 |
49 | CompanyName= | 49 | CompanyName= |
50 | FileVersion= | 50 | FileVersion= |
51 | FileDescription=Irrlicht Engine example compiled using DevCpp and gcc | 51 | FileDescription=Irrlicht Engine example compiled using DevCpp and gcc |
52 | InternalName= | 52 | InternalName= |
53 | LegalCopyright= | 53 | LegalCopyright= |
54 | LegalTrademarks= | 54 | LegalTrademarks= |
55 | OriginalFilename= | 55 | OriginalFilename= |
56 | ProductName= | 56 | ProductName= |
57 | ProductVersion= | 57 | ProductVersion= |
58 | AutoIncBuildNr=0 | 58 | AutoIncBuildNr=0 |
59 | 59 | ||
60 | [Unit2] | 60 | [Unit2] |
61 | FileName=q3factory.cpp | 61 | FileName=q3factory.cpp |
62 | CompileCpp=1 | 62 | CompileCpp=1 |
63 | Folder=Irrlicht Example 21 Quake3 Explorer | 63 | Folder=Irrlicht Example 21 Quake3 Explorer |
64 | Compile=1 | 64 | Compile=1 |
65 | Link=1 | 65 | Link=1 |
66 | Priority=1000 | 66 | Priority=1000 |
67 | OverrideBuildCmd=0 | 67 | OverrideBuildCmd=0 |
68 | BuildCmd= | 68 | BuildCmd= |
69 | 69 | ||
70 | [Unit3] | 70 | [Unit3] |
71 | FileName=q3factory.h | 71 | FileName=q3factory.h |
72 | CompileCpp=1 | 72 | CompileCpp=1 |
73 | Folder=Irrlicht Example 21 Quake3 Explorer | 73 | Folder=Irrlicht Example 21 Quake3 Explorer |
74 | Compile=1 | 74 | Compile=1 |
75 | Link=1 | 75 | Link=1 |
76 | Priority=1000 | 76 | Priority=1000 |
77 | OverrideBuildCmd=0 | 77 | OverrideBuildCmd=0 |
78 | BuildCmd= | 78 | BuildCmd= |
79 | 79 | ||
80 | [Unit4] | 80 | [Unit4] |
81 | FileName=sound.cpp | 81 | FileName=sound.cpp |
82 | CompileCpp=1 | 82 | CompileCpp=1 |
83 | Folder=Irrlicht Example 21 Quake3 Explorer | 83 | Folder=Irrlicht Example 21 Quake3 Explorer |
84 | Compile=1 | 84 | Compile=1 |
85 | Link=1 | 85 | Link=1 |
86 | Priority=1000 | 86 | Priority=1000 |
87 | OverrideBuildCmd=0 | 87 | OverrideBuildCmd=0 |
88 | BuildCmd= | 88 | BuildCmd= |
89 | 89 | ||
90 | [Unit5] | 90 | [Unit5] |
91 | FileName=sound.h | 91 | FileName=sound.h |
92 | CompileCpp=1 | 92 | CompileCpp=1 |
93 | Folder=Irrlicht Example 21 Quake3 Explorer | 93 | Folder=Irrlicht Example 21 Quake3 Explorer |
94 | Compile=1 | 94 | Compile=1 |
95 | Link=1 | 95 | Link=1 |
96 | Priority=1000 | 96 | Priority=1000 |
97 | OverrideBuildCmd=0 | 97 | OverrideBuildCmd=0 |
98 | BuildCmd= | 98 | BuildCmd= |
99 | 99 | ||
diff --git a/libraries/irrlicht-1.8/examples/21.Quake3Explorer/Quake3Explorer.vcproj b/libraries/irrlicht-1.8/examples/21.Quake3Explorer/Quake3Explorer.vcproj index b869cc4..dcd4561 100644 --- a/libraries/irrlicht-1.8/examples/21.Quake3Explorer/Quake3Explorer.vcproj +++ b/libraries/irrlicht-1.8/examples/21.Quake3Explorer/Quake3Explorer.vcproj | |||
@@ -1,132 +1,132 @@ | |||
1 | <?xml version="1.0" encoding="Windows-1252"?> | 1 | <?xml version="1.0" encoding="Windows-1252"?> |
2 | <VisualStudioProject | 2 | <VisualStudioProject |
3 | ProjectType="Visual C++" | 3 | ProjectType="Visual C++" |
4 | Version="7.10" | 4 | Version="7.10" |
5 | Name="21.Quake3Explorer" | 5 | Name="21.Quake3Explorer" |
6 | ProjectGUID="{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}" | 6 | ProjectGUID="{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}" |
7 | Keyword="Win32Proj"> | 7 | Keyword="Win32Proj"> |
8 | <Platforms> | 8 | <Platforms> |
9 | <Platform | 9 | <Platform |
10 | Name="Win32"/> | 10 | Name="Win32"/> |
11 | </Platforms> | 11 | </Platforms> |
12 | <Configurations> | 12 | <Configurations> |
13 | <Configuration | 13 | <Configuration |
14 | Name="Debug|Win32" | 14 | Name="Debug|Win32" |
15 | OutputDirectory="Debug" | 15 | OutputDirectory="Debug" |
16 | IntermediateDirectory="Debug" | 16 | IntermediateDirectory="Debug" |
17 | ConfigurationType="1" | 17 | ConfigurationType="1" |
18 | CharacterSet="2"> | 18 | CharacterSet="2"> |
19 | <Tool | 19 | <Tool |
20 | Name="VCCLCompilerTool" | 20 | Name="VCCLCompilerTool" |
21 | Optimization="0" | 21 | Optimization="0" |
22 | AdditionalIncludeDirectories="..\..\include" | 22 | AdditionalIncludeDirectories="..\..\include" |
23 | PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS" | 23 | PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS" |
24 | MinimalRebuild="TRUE" | 24 | MinimalRebuild="TRUE" |
25 | BasicRuntimeChecks="3" | 25 | BasicRuntimeChecks="3" |
26 | RuntimeLibrary="5" | 26 | RuntimeLibrary="5" |
27 | UsePrecompiledHeader="0" | 27 | UsePrecompiledHeader="0" |
28 | WarningLevel="3" | 28 | WarningLevel="3" |
29 | Detect64BitPortabilityProblems="TRUE" | 29 | Detect64BitPortabilityProblems="TRUE" |
30 | DebugInformationFormat="4"/> | 30 | DebugInformationFormat="4"/> |
31 | <Tool | 31 | <Tool |
32 | Name="VCCustomBuildTool"/> | 32 | Name="VCCustomBuildTool"/> |
33 | <Tool | 33 | <Tool |
34 | Name="VCLinkerTool" | 34 | Name="VCLinkerTool" |
35 | OutputFile="..\..\bin\Win32-VisualStudio\21.Quake3MapExplorer.exe" | 35 | OutputFile="..\..\bin\Win32-VisualStudio\21.Quake3MapExplorer.exe" |
36 | LinkIncremental="1" | 36 | LinkIncremental="1" |
37 | AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio" | 37 | AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio" |
38 | GenerateDebugInformation="TRUE" | 38 | GenerateDebugInformation="TRUE" |
39 | ProgramDatabaseFile="$(OutDir)/Quake3MapShader.pdb" | 39 | ProgramDatabaseFile="$(OutDir)/Quake3MapShader.pdb" |
40 | SubSystem="1" | 40 | SubSystem="1" |
41 | TargetMachine="1"/> | 41 | TargetMachine="1"/> |
42 | <Tool | 42 | <Tool |
43 | Name="VCMIDLTool"/> | 43 | Name="VCMIDLTool"/> |
44 | <Tool | 44 | <Tool |
45 | Name="VCPostBuildEventTool"/> | 45 | Name="VCPostBuildEventTool"/> |
46 | <Tool | 46 | <Tool |
47 | Name="VCPreBuildEventTool"/> | 47 | Name="VCPreBuildEventTool"/> |
48 | <Tool | 48 | <Tool |
49 | Name="VCPreLinkEventTool"/> | 49 | Name="VCPreLinkEventTool"/> |
50 | <Tool | 50 | <Tool |
51 | Name="VCResourceCompilerTool"/> | 51 | Name="VCResourceCompilerTool"/> |
52 | <Tool | 52 | <Tool |
53 | Name="VCWebServiceProxyGeneratorTool"/> | 53 | Name="VCWebServiceProxyGeneratorTool"/> |
54 | <Tool | 54 | <Tool |
55 | Name="VCXMLDataGeneratorTool"/> | 55 | Name="VCXMLDataGeneratorTool"/> |
56 | <Tool | 56 | <Tool |
57 | Name="VCWebDeploymentTool"/> | 57 | Name="VCWebDeploymentTool"/> |
58 | <Tool | 58 | <Tool |
59 | Name="VCManagedWrapperGeneratorTool"/> | 59 | Name="VCManagedWrapperGeneratorTool"/> |
60 | <Tool | 60 | <Tool |
61 | Name="VCAuxiliaryManagedWrapperGeneratorTool"/> | 61 | Name="VCAuxiliaryManagedWrapperGeneratorTool"/> |
62 | </Configuration> | 62 | </Configuration> |
63 | <Configuration | 63 | <Configuration |
64 | Name="Release|Win32" | 64 | Name="Release|Win32" |
65 | OutputDirectory="Release" | 65 | OutputDirectory="Release" |
66 | IntermediateDirectory="Release" | 66 | IntermediateDirectory="Release" |
67 | ConfigurationType="1" | 67 | ConfigurationType="1" |
68 | CharacterSet="2" | 68 | CharacterSet="2" |
69 | WholeProgramOptimization="TRUE"> | 69 | WholeProgramOptimization="TRUE"> |
70 | <Tool | 70 | <Tool |
71 | Name="VCCLCompilerTool" | 71 | Name="VCCLCompilerTool" |
72 | AdditionalOptions="/QIfist /Oa" | 72 | AdditionalOptions="/QIfist /Oa" |
73 | Optimization="3" | 73 | Optimization="3" |
74 | GlobalOptimizations="TRUE" | 74 | GlobalOptimizations="TRUE" |
75 | InlineFunctionExpansion="2" | 75 | InlineFunctionExpansion="2" |
76 | EnableIntrinsicFunctions="TRUE" | 76 | EnableIntrinsicFunctions="TRUE" |
77 | FavorSizeOrSpeed="1" | 77 | FavorSizeOrSpeed="1" |
78 | OmitFramePointers="TRUE" | 78 | OmitFramePointers="TRUE" |
79 | AdditionalIncludeDirectories="..\..\include" | 79 | AdditionalIncludeDirectories="..\..\include" |
80 | PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" | 80 | PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" |
81 | RuntimeLibrary="4" | 81 | RuntimeLibrary="4" |
82 | BufferSecurityCheck="FALSE" | 82 | BufferSecurityCheck="FALSE" |
83 | UsePrecompiledHeader="0" | 83 | UsePrecompiledHeader="0" |
84 | WarningLevel="3" | 84 | WarningLevel="3" |
85 | Detect64BitPortabilityProblems="TRUE" | 85 | Detect64BitPortabilityProblems="TRUE" |
86 | DebugInformationFormat="0" | 86 | DebugInformationFormat="0" |
87 | CallingConvention="1"/> | 87 | CallingConvention="1"/> |
88 | <Tool | 88 | <Tool |
89 | Name="VCCustomBuildTool"/> | 89 | Name="VCCustomBuildTool"/> |
90 | <Tool | 90 | <Tool |
91 | Name="VCLinkerTool" | 91 | Name="VCLinkerTool" |
92 | OutputFile="..\..\bin\Win32-VisualStudio\21.Quake3MapExplorer.exe" | 92 | OutputFile="..\..\bin\Win32-VisualStudio\21.Quake3MapExplorer.exe" |
93 | LinkIncremental="1" | 93 | LinkIncremental="1" |
94 | SuppressStartupBanner="TRUE" | 94 | SuppressStartupBanner="TRUE" |
95 | AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio" | 95 | AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio" |
96 | GenerateDebugInformation="FALSE" | 96 | GenerateDebugInformation="FALSE" |
97 | SubSystem="1" | 97 | SubSystem="1" |
98 | OptimizeReferences="2" | 98 | OptimizeReferences="2" |
99 | EnableCOMDATFolding="2" | 99 | EnableCOMDATFolding="2" |
100 | TargetMachine="1"/> | 100 | TargetMachine="1"/> |
101 | <Tool | 101 | <Tool |
102 | Name="VCMIDLTool"/> | 102 | Name="VCMIDLTool"/> |
103 | <Tool | 103 | <Tool |
104 | Name="VCPostBuildEventTool"/> | 104 | Name="VCPostBuildEventTool"/> |
105 | <Tool | 105 | <Tool |
106 | Name="VCPreBuildEventTool"/> | 106 | Name="VCPreBuildEventTool"/> |
107 | <Tool | 107 | <Tool |
108 | Name="VCPreLinkEventTool"/> | 108 | Name="VCPreLinkEventTool"/> |
109 | <Tool | 109 | <Tool |
110 | Name="VCResourceCompilerTool"/> | 110 | Name="VCResourceCompilerTool"/> |
111 | <Tool | 111 | <Tool |
112 | Name="VCWebServiceProxyGeneratorTool"/> | 112 | Name="VCWebServiceProxyGeneratorTool"/> |
113 | <Tool | 113 | <Tool |
114 | Name="VCXMLDataGeneratorTool"/> | 114 | Name="VCXMLDataGeneratorTool"/> |
115 | <Tool | 115 | <Tool |
116 | Name="VCWebDeploymentTool"/> | 116 | Name="VCWebDeploymentTool"/> |
117 | <Tool | 117 | <Tool |
118 | Name="VCManagedWrapperGeneratorTool"/> | 118 | Name="VCManagedWrapperGeneratorTool"/> |
119 | <Tool | 119 | <Tool |
120 | Name="VCAuxiliaryManagedWrapperGeneratorTool"/> | 120 | Name="VCAuxiliaryManagedWrapperGeneratorTool"/> |
121 | </Configuration> | 121 | </Configuration> |
122 | </Configurations> | 122 | </Configurations> |
123 | <References> | 123 | <References> |
124 | </References> | 124 | </References> |
125 | <Files> | 125 | <Files> |
126 | <File | 126 | <File |
127 | RelativePath=".\main.cpp"> | 127 | RelativePath=".\main.cpp"> |
128 | </File> | 128 | </File> |
129 | </Files> | 129 | </Files> |
130 | <Globals> | 130 | <Globals> |
131 | </Globals> | 131 | </Globals> |
132 | </VisualStudioProject> | 132 | </VisualStudioProject> |
diff --git a/libraries/irrlicht-1.8/examples/21.Quake3Explorer/Quake3Explorer_vc10.vcxproj b/libraries/irrlicht-1.8/examples/21.Quake3Explorer/Quake3Explorer_vc10.vcxproj index 8ba3e72..1fe4cc8 100644 --- a/libraries/irrlicht-1.8/examples/21.Quake3Explorer/Quake3Explorer_vc10.vcxproj +++ b/libraries/irrlicht-1.8/examples/21.Quake3Explorer/Quake3Explorer_vc10.vcxproj | |||
@@ -1,196 +1,196 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | 2 | <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
3 | <ItemGroup Label="ProjectConfigurations"> | 3 | <ItemGroup Label="ProjectConfigurations"> |
4 | <ProjectConfiguration Include="Debug|Win32"> | 4 | <ProjectConfiguration Include="Debug|Win32"> |
5 | <Configuration>Debug</Configuration> | 5 | <Configuration>Debug</Configuration> |
6 | <Platform>Win32</Platform> | 6 | <Platform>Win32</Platform> |
7 | </ProjectConfiguration> | 7 | </ProjectConfiguration> |
8 | <ProjectConfiguration Include="Debug|x64"> | 8 | <ProjectConfiguration Include="Debug|x64"> |
9 | <Configuration>Debug</Configuration> | 9 | <Configuration>Debug</Configuration> |
10 | <Platform>x64</Platform> | 10 | <Platform>x64</Platform> |
11 | </ProjectConfiguration> | 11 | </ProjectConfiguration> |
12 | <ProjectConfiguration Include="Release|Win32"> | 12 | <ProjectConfiguration Include="Release|Win32"> |
13 | <Configuration>Release</Configuration> | 13 | <Configuration>Release</Configuration> |
14 | <Platform>Win32</Platform> | 14 | <Platform>Win32</Platform> |
15 | </ProjectConfiguration> | 15 | </ProjectConfiguration> |
16 | <ProjectConfiguration Include="Release|x64"> | 16 | <ProjectConfiguration Include="Release|x64"> |
17 | <Configuration>Release</Configuration> | 17 | <Configuration>Release</Configuration> |
18 | <Platform>x64</Platform> | 18 | <Platform>x64</Platform> |
19 | </ProjectConfiguration> | 19 | </ProjectConfiguration> |
20 | </ItemGroup> | 20 | </ItemGroup> |
21 | <PropertyGroup Label="Globals"> | 21 | <PropertyGroup Label="Globals"> |
22 | <ProjectName>21.Quake3Explorer</ProjectName> | 22 | <ProjectName>21.Quake3Explorer</ProjectName> |
23 | <ProjectGuid>{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}</ProjectGuid> | 23 | <ProjectGuid>{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}</ProjectGuid> |
24 | <RootNamespace>21.Quake3Explorer</RootNamespace> | 24 | <RootNamespace>21.Quake3Explorer</RootNamespace> |
25 | <Keyword>Win32Proj</Keyword> | 25 | <Keyword>Win32Proj</Keyword> |
26 | </PropertyGroup> | 26 | </PropertyGroup> |
27 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | 27 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> |
28 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> | 28 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> |
29 | <ConfigurationType>Application</ConfigurationType> | 29 | <ConfigurationType>Application</ConfigurationType> |
30 | <CharacterSet>MultiByte</CharacterSet> | 30 | <CharacterSet>MultiByte</CharacterSet> |
31 | </PropertyGroup> | 31 | </PropertyGroup> |
32 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> | 32 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> |
33 | <ConfigurationType>Application</ConfigurationType> | 33 | <ConfigurationType>Application</ConfigurationType> |
34 | <CharacterSet>MultiByte</CharacterSet> | 34 | <CharacterSet>MultiByte</CharacterSet> |
35 | </PropertyGroup> | 35 | </PropertyGroup> |
36 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> | 36 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> |
37 | <ConfigurationType>Application</ConfigurationType> | 37 | <ConfigurationType>Application</ConfigurationType> |
38 | <CharacterSet>MultiByte</CharacterSet> | 38 | <CharacterSet>MultiByte</CharacterSet> |
39 | </PropertyGroup> | 39 | </PropertyGroup> |
40 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> | 40 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> |
41 | <ConfigurationType>Application</ConfigurationType> | 41 | <ConfigurationType>Application</ConfigurationType> |
42 | <CharacterSet>MultiByte</CharacterSet> | 42 | <CharacterSet>MultiByte</CharacterSet> |
43 | </PropertyGroup> | 43 | </PropertyGroup> |
44 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | 44 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> |
45 | <ImportGroup Label="ExtensionSettings"> | 45 | <ImportGroup Label="ExtensionSettings"> |
46 | </ImportGroup> | 46 | </ImportGroup> |
47 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> | 47 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> |
48 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | 48 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
49 | <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" /> | 49 | <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" /> |
50 | </ImportGroup> | 50 | </ImportGroup> |
51 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> | 51 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> |
52 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | 52 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
53 | <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" /> | 53 | <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" /> |
54 | </ImportGroup> | 54 | </ImportGroup> |
55 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> | 55 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> |
56 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | 56 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
57 | <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" /> | 57 | <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" /> |
58 | </ImportGroup> | 58 | </ImportGroup> |
59 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> | 59 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> |
60 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | 60 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
61 | <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" /> | 61 | <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" /> |
62 | </ImportGroup> | 62 | </ImportGroup> |
63 | <PropertyGroup Label="UserMacros" /> | 63 | <PropertyGroup Label="UserMacros" /> |
64 | <PropertyGroup> | 64 | <PropertyGroup> |
65 | <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> | 65 | <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> |
66 | <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\bin\Win32-VisualStudio\</OutDir> | 66 | <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\bin\Win32-VisualStudio\</OutDir> |
67 | <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\bin\Win64-VisualStudio\</OutDir> | 67 | <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\bin\Win64-VisualStudio\</OutDir> |
68 | <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental> | 68 | <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental> |
69 | <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental> | 69 | <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental> |
70 | <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\bin\Win32-VisualStudio\</OutDir> | 70 | <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\bin\Win32-VisualStudio\</OutDir> |
71 | <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\bin\Win64-VisualStudio\</OutDir> | 71 | <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\bin\Win64-VisualStudio\</OutDir> |
72 | <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> | 72 | <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> |
73 | <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental> | 73 | <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental> |
74 | <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> | 74 | <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> |
75 | <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet> | 75 | <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet> |
76 | <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> | 76 | <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> |
77 | <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> | 77 | <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> |
78 | <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> | 78 | <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> |
79 | <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> | 79 | <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> |
80 | <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> | 80 | <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> |
81 | <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet> | 81 | <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet> |
82 | <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> | 82 | <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> |
83 | <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> | 83 | <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> |
84 | <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> | 84 | <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> |
85 | <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> | 85 | <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> |
86 | </PropertyGroup> | 86 | </PropertyGroup> |
87 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | 87 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
88 | <ClCompile> | 88 | <ClCompile> |
89 | <Optimization>Disabled</Optimization> | 89 | <Optimization>Disabled</Optimization> |
90 | <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> | 90 | <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
91 | <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> | 91 | <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
92 | <MinimalRebuild>true</MinimalRebuild> | 92 | <MinimalRebuild>true</MinimalRebuild> |
93 | <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | 93 | <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> |
94 | <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> | 94 | <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> |
95 | <PrecompiledHeader> | 95 | <PrecompiledHeader> |
96 | </PrecompiledHeader> | 96 | </PrecompiledHeader> |
97 | <WarningLevel>Level3</WarningLevel> | 97 | <WarningLevel>Level3</WarningLevel> |
98 | <DebugInformationFormat>EditAndContinue</DebugInformationFormat> | 98 | <DebugInformationFormat>EditAndContinue</DebugInformationFormat> |
99 | </ClCompile> | 99 | </ClCompile> |
100 | <Link> | 100 | <Link> |
101 | <OutputFile>..\..\bin\Win32-VisualStudio\21.Quake3Explorer.exe</OutputFile> | 101 | <OutputFile>..\..\bin\Win32-VisualStudio\21.Quake3Explorer.exe</OutputFile> |
102 | <AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> | 102 | <AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> |
103 | <GenerateDebugInformation>true</GenerateDebugInformation> | 103 | <GenerateDebugInformation>true</GenerateDebugInformation> |
104 | <ProgramDatabaseFile>$(OutDir)Quake3MapShader.pdb</ProgramDatabaseFile> | 104 | <ProgramDatabaseFile>$(OutDir)Quake3MapShader.pdb</ProgramDatabaseFile> |
105 | <SubSystem>Console</SubSystem> | 105 | <SubSystem>Console</SubSystem> |
106 | <DataExecutionPrevention> | 106 | <DataExecutionPrevention> |
107 | </DataExecutionPrevention> | 107 | </DataExecutionPrevention> |
108 | </Link> | 108 | </Link> |
109 | </ItemDefinitionGroup> | 109 | </ItemDefinitionGroup> |
110 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | 110 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> |
111 | <ClCompile> | 111 | <ClCompile> |
112 | <Optimization>Disabled</Optimization> | 112 | <Optimization>Disabled</Optimization> |
113 | <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> | 113 | <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
114 | <PreprocessorDefinitions>WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> | 114 | <PreprocessorDefinitions>WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
115 | <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | 115 | <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> |
116 | <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> | 116 | <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> |
117 | <PrecompiledHeader> | 117 | <PrecompiledHeader> |
118 | </PrecompiledHeader> | 118 | </PrecompiledHeader> |
119 | <WarningLevel>Level3</WarningLevel> | 119 | <WarningLevel>Level3</WarningLevel> |
120 | <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> | 120 | <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> |
121 | </ClCompile> | 121 | </ClCompile> |
122 | <Link> | 122 | <Link> |
123 | <OutputFile>..\..\bin\Win64-VisualStudio\21.Quake3Explorer.exe</OutputFile> | 123 | <OutputFile>..\..\bin\Win64-VisualStudio\21.Quake3Explorer.exe</OutputFile> |
124 | <AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> | 124 | <AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> |
125 | <GenerateDebugInformation>true</GenerateDebugInformation> | 125 | <GenerateDebugInformation>true</GenerateDebugInformation> |
126 | <ProgramDatabaseFile>$(OutDir)Quake3MapShader.pdb</ProgramDatabaseFile> | 126 | <ProgramDatabaseFile>$(OutDir)Quake3MapShader.pdb</ProgramDatabaseFile> |
127 | <SubSystem>Console</SubSystem> | 127 | <SubSystem>Console</SubSystem> |
128 | <DataExecutionPrevention> | 128 | <DataExecutionPrevention> |
129 | </DataExecutionPrevention> | 129 | </DataExecutionPrevention> |
130 | </Link> | 130 | </Link> |
131 | </ItemDefinitionGroup> | 131 | </ItemDefinitionGroup> |
132 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | 132 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
133 | <ClCompile> | 133 | <ClCompile> |
134 | <IntrinsicFunctions>true</IntrinsicFunctions> | 134 | <IntrinsicFunctions>true</IntrinsicFunctions> |
135 | <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> | 135 | <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> |
136 | <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> | 136 | <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
137 | <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> | 137 | <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
138 | <RuntimeLibrary>MultiThreaded</RuntimeLibrary> | 138 | <RuntimeLibrary>MultiThreaded</RuntimeLibrary> |
139 | <BufferSecurityCheck>false</BufferSecurityCheck> | 139 | <BufferSecurityCheck>false</BufferSecurityCheck> |
140 | <PrecompiledHeader> | 140 | <PrecompiledHeader> |
141 | </PrecompiledHeader> | 141 | </PrecompiledHeader> |
142 | <WarningLevel>Level3</WarningLevel> | 142 | <WarningLevel>Level3</WarningLevel> |
143 | <DebugInformationFormat> | 143 | <DebugInformationFormat> |
144 | </DebugInformationFormat> | 144 | </DebugInformationFormat> |
145 | <CallingConvention>FastCall</CallingConvention> | 145 | <CallingConvention>FastCall</CallingConvention> |
146 | </ClCompile> | 146 | </ClCompile> |
147 | <Link> | 147 | <Link> |
148 | <OutputFile>..\..\bin\Win32-VisualStudio\21.Quake3Explorer.exe</OutputFile> | 148 | <OutputFile>..\..\bin\Win32-VisualStudio\21.Quake3Explorer.exe</OutputFile> |
149 | <AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> | 149 | <AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> |
150 | <GenerateDebugInformation>false</GenerateDebugInformation> | 150 | <GenerateDebugInformation>false</GenerateDebugInformation> |
151 | <SubSystem>Console</SubSystem> | 151 | <SubSystem>Console</SubSystem> |
152 | <OptimizeReferences>true</OptimizeReferences> | 152 | <OptimizeReferences>true</OptimizeReferences> |
153 | <EnableCOMDATFolding>true</EnableCOMDATFolding> | 153 | <EnableCOMDATFolding>true</EnableCOMDATFolding> |
154 | <DataExecutionPrevention> | 154 | <DataExecutionPrevention> |
155 | </DataExecutionPrevention> | 155 | </DataExecutionPrevention> |
156 | </Link> | 156 | </Link> |
157 | </ItemDefinitionGroup> | 157 | </ItemDefinitionGroup> |
158 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | 158 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> |
159 | <ClCompile> | 159 | <ClCompile> |
160 | <IntrinsicFunctions>true</IntrinsicFunctions> | 160 | <IntrinsicFunctions>true</IntrinsicFunctions> |
161 | <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> | 161 | <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> |
162 | <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> | 162 | <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
163 | <PreprocessorDefinitions>WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> | 163 | <PreprocessorDefinitions>WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
164 | <RuntimeLibrary>MultiThreaded</RuntimeLibrary> | 164 | <RuntimeLibrary>MultiThreaded</RuntimeLibrary> |
165 | <BufferSecurityCheck>false</BufferSecurityCheck> | 165 | <BufferSecurityCheck>false</BufferSecurityCheck> |
166 | <PrecompiledHeader> | 166 | <PrecompiledHeader> |
167 | </PrecompiledHeader> | 167 | </PrecompiledHeader> |
168 | <WarningLevel>Level3</WarningLevel> | 168 | <WarningLevel>Level3</WarningLevel> |
169 | <DebugInformationFormat> | 169 | <DebugInformationFormat> |
170 | </DebugInformationFormat> | 170 | </DebugInformationFormat> |
171 | <CallingConvention>FastCall</CallingConvention> | 171 | <CallingConvention>FastCall</CallingConvention> |
172 | </ClCompile> | 172 | </ClCompile> |
173 | <Link> | 173 | <Link> |
174 | <OutputFile>..\..\bin\Win64-VisualStudio\21.Quake3Explorer.exe</OutputFile> | 174 | <OutputFile>..\..\bin\Win64-VisualStudio\21.Quake3Explorer.exe</OutputFile> |
175 | <AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> | 175 | <AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> |
176 | <GenerateDebugInformation>false</GenerateDebugInformation> | 176 | <GenerateDebugInformation>false</GenerateDebugInformation> |
177 | <SubSystem>Console</SubSystem> | 177 | <SubSystem>Console</SubSystem> |
178 | <OptimizeReferences>true</OptimizeReferences> | 178 | <OptimizeReferences>true</OptimizeReferences> |
179 | <EnableCOMDATFolding>true</EnableCOMDATFolding> | 179 | <EnableCOMDATFolding>true</EnableCOMDATFolding> |
180 | <DataExecutionPrevention> | 180 | <DataExecutionPrevention> |
181 | </DataExecutionPrevention> | 181 | </DataExecutionPrevention> |
182 | </Link> | 182 | </Link> |
183 | </ItemDefinitionGroup> | 183 | </ItemDefinitionGroup> |
184 | <ItemGroup> | 184 | <ItemGroup> |
185 | <ClCompile Include="main.cpp" /> | 185 | <ClCompile Include="main.cpp" /> |
186 | <ClCompile Include="q3factory.cpp" /> | 186 | <ClCompile Include="q3factory.cpp" /> |
187 | <ClCompile Include="sound.cpp" /> | 187 | <ClCompile Include="sound.cpp" /> |
188 | </ItemGroup> | 188 | </ItemGroup> |
189 | <ItemGroup> | 189 | <ItemGroup> |
190 | <ClInclude Include="q3factory.h" /> | 190 | <ClInclude Include="q3factory.h" /> |
191 | <ClInclude Include="sound.h" /> | 191 | <ClInclude Include="sound.h" /> |
192 | </ItemGroup> | 192 | </ItemGroup> |
193 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | 193 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> |
194 | <ImportGroup Label="ExtensionTargets"> | 194 | <ImportGroup Label="ExtensionTargets"> |
195 | </ImportGroup> | 195 | </ImportGroup> |
196 | </Project> \ No newline at end of file | 196 | </Project> \ No newline at end of file |
diff --git a/libraries/irrlicht-1.8/examples/21.Quake3Explorer/Quake3Explorer_vc11.vcxproj b/libraries/irrlicht-1.8/examples/21.Quake3Explorer/Quake3Explorer_vc11.vcxproj index d0c29b2..a5229f7 100644 --- a/libraries/irrlicht-1.8/examples/21.Quake3Explorer/Quake3Explorer_vc11.vcxproj +++ b/libraries/irrlicht-1.8/examples/21.Quake3Explorer/Quake3Explorer_vc11.vcxproj | |||
@@ -1,200 +1,200 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | 2 | <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
3 | <ItemGroup Label="ProjectConfigurations"> | 3 | <ItemGroup Label="ProjectConfigurations"> |
4 | <ProjectConfiguration Include="Debug|Win32"> | 4 | <ProjectConfiguration Include="Debug|Win32"> |
5 | <Configuration>Debug</Configuration> | 5 | <Configuration>Debug</Configuration> |
6 | <Platform>Win32</Platform> | 6 | <Platform>Win32</Platform> |
7 | </ProjectConfiguration> | 7 | </ProjectConfiguration> |
8 | <ProjectConfiguration Include="Debug|x64"> | 8 | <ProjectConfiguration Include="Debug|x64"> |
9 | <Configuration>Debug</Configuration> | 9 | <Configuration>Debug</Configuration> |
10 | <Platform>x64</Platform> | 10 | <Platform>x64</Platform> |
11 | </ProjectConfiguration> | 11 | </ProjectConfiguration> |
12 | <ProjectConfiguration Include="Release|Win32"> | 12 | <ProjectConfiguration Include="Release|Win32"> |
13 | <Configuration>Release</Configuration> | 13 | <Configuration>Release</Configuration> |
14 | <Platform>Win32</Platform> | 14 | <Platform>Win32</Platform> |
15 | </ProjectConfiguration> | 15 | </ProjectConfiguration> |
16 | <ProjectConfiguration Include="Release|x64"> | 16 | <ProjectConfiguration Include="Release|x64"> |
17 | <Configuration>Release</Configuration> | 17 | <Configuration>Release</Configuration> |
18 | <Platform>x64</Platform> | 18 | <Platform>x64</Platform> |
19 | </ProjectConfiguration> | 19 | </ProjectConfiguration> |
20 | </ItemGroup> | 20 | </ItemGroup> |
21 | <PropertyGroup Label="Globals"> | 21 | <PropertyGroup Label="Globals"> |
22 | <ProjectName>21.Quake3Explorer</ProjectName> | 22 | <ProjectName>21.Quake3Explorer</ProjectName> |
23 | <ProjectGuid>{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}</ProjectGuid> | 23 | <ProjectGuid>{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}</ProjectGuid> |
24 | <RootNamespace>21.Quake3Explorer</RootNamespace> | 24 | <RootNamespace>21.Quake3Explorer</RootNamespace> |
25 | <Keyword>Win32Proj</Keyword> | 25 | <Keyword>Win32Proj</Keyword> |
26 | </PropertyGroup> | 26 | </PropertyGroup> |
27 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | 27 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> |
28 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> | 28 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> |
29 | <ConfigurationType>Application</ConfigurationType> | 29 | <ConfigurationType>Application</ConfigurationType> |
30 | <CharacterSet>MultiByte</CharacterSet> | 30 | <CharacterSet>MultiByte</CharacterSet> |
31 | <PlatformToolset>v110</PlatformToolset> | 31 | <PlatformToolset>v110</PlatformToolset> |
32 | </PropertyGroup> | 32 | </PropertyGroup> |
33 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> | 33 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> |
34 | <ConfigurationType>Application</ConfigurationType> | 34 | <ConfigurationType>Application</ConfigurationType> |
35 | <CharacterSet>MultiByte</CharacterSet> | 35 | <CharacterSet>MultiByte</CharacterSet> |
36 | <PlatformToolset>v110</PlatformToolset> | 36 | <PlatformToolset>v110</PlatformToolset> |
37 | </PropertyGroup> | 37 | </PropertyGroup> |
38 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> | 38 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> |
39 | <ConfigurationType>Application</ConfigurationType> | 39 | <ConfigurationType>Application</ConfigurationType> |
40 | <CharacterSet>MultiByte</CharacterSet> | 40 | <CharacterSet>MultiByte</CharacterSet> |
41 | <PlatformToolset>v110</PlatformToolset> | 41 | <PlatformToolset>v110</PlatformToolset> |
42 | </PropertyGroup> | 42 | </PropertyGroup> |
43 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> | 43 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> |
44 | <ConfigurationType>Application</ConfigurationType> | 44 | <ConfigurationType>Application</ConfigurationType> |
45 | <CharacterSet>MultiByte</CharacterSet> | 45 | <CharacterSet>MultiByte</CharacterSet> |
46 | <PlatformToolset>v110</PlatformToolset> | 46 | <PlatformToolset>v110</PlatformToolset> |
47 | </PropertyGroup> | 47 | </PropertyGroup> |
48 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | 48 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> |
49 | <ImportGroup Label="ExtensionSettings"> | 49 | <ImportGroup Label="ExtensionSettings"> |
50 | </ImportGroup> | 50 | </ImportGroup> |
51 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> | 51 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> |
52 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | 52 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
53 | <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" /> | 53 | <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" /> |
54 | </ImportGroup> | 54 | </ImportGroup> |
55 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> | 55 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> |
56 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | 56 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
57 | <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" /> | 57 | <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" /> |
58 | </ImportGroup> | 58 | </ImportGroup> |
59 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> | 59 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> |
60 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | 60 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
61 | <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" /> | 61 | <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" /> |
62 | </ImportGroup> | 62 | </ImportGroup> |
63 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> | 63 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> |
64 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | 64 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
65 | <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" /> | 65 | <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" /> |
66 | </ImportGroup> | 66 | </ImportGroup> |
67 | <PropertyGroup Label="UserMacros" /> | 67 | <PropertyGroup Label="UserMacros" /> |
68 | <PropertyGroup> | 68 | <PropertyGroup> |
69 | <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> | 69 | <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> |
70 | <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\bin\Win32-VisualStudio\</OutDir> | 70 | <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\bin\Win32-VisualStudio\</OutDir> |
71 | <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\bin\Win64-VisualStudio\</OutDir> | 71 | <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\bin\Win64-VisualStudio\</OutDir> |
72 | <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental> | 72 | <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental> |
73 | <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental> | 73 | <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental> |
74 | <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\bin\Win32-VisualStudio\</OutDir> | 74 | <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\bin\Win32-VisualStudio\</OutDir> |
75 | <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\bin\Win64-VisualStudio\</OutDir> | 75 | <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\bin\Win64-VisualStudio\</OutDir> |
76 | <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> | 76 | <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> |
77 | <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental> | 77 | <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental> |
78 | <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> | 78 | <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> |
79 | <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet> | 79 | <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet> |
80 | <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> | 80 | <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> |
81 | <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> | 81 | <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> |
82 | <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> | 82 | <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> |
83 | <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> | 83 | <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> |
84 | <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> | 84 | <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet> |
85 | <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet> | 85 | <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet> |
86 | <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> | 86 | <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> |
87 | <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> | 87 | <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> |
88 | <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> | 88 | <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> |
89 | <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> | 89 | <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> |
90 | </PropertyGroup> | 90 | </PropertyGroup> |
91 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | 91 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
92 | <ClCompile> | 92 | <ClCompile> |
93 | <Optimization>Disabled</Optimization> | 93 | <Optimization>Disabled</Optimization> |
94 | <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> | 94 | <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
95 | <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> | 95 | <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
96 | <MinimalRebuild>true</MinimalRebuild> | 96 | <MinimalRebuild>true</MinimalRebuild> |
97 | <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | 97 | <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> |
98 | <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> | 98 | <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> |
99 | <PrecompiledHeader> | 99 | <PrecompiledHeader> |
100 | </PrecompiledHeader> | 100 | </PrecompiledHeader> |
101 | <WarningLevel>Level3</WarningLevel> | 101 | <WarningLevel>Level3</WarningLevel> |
102 | <DebugInformationFormat>EditAndContinue</DebugInformationFormat> | 102 | <DebugInformationFormat>EditAndContinue</DebugInformationFormat> |
103 | </ClCompile> | 103 | </ClCompile> |
104 | <Link> | 104 | <Link> |
105 | <OutputFile>..\..\bin\Win32-VisualStudio\21.Quake3Explorer.exe</OutputFile> | 105 | <OutputFile>..\..\bin\Win32-VisualStudio\21.Quake3Explorer.exe</OutputFile> |
106 | <AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> | 106 | <AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> |
107 | <GenerateDebugInformation>true</GenerateDebugInformation> | 107 | <GenerateDebugInformation>true</GenerateDebugInformation> |
108 | <ProgramDatabaseFile>$(OutDir)Quake3MapShader.pdb</ProgramDatabaseFile> | 108 | <ProgramDatabaseFile>$(OutDir)Quake3MapShader.pdb</ProgramDatabaseFile> |
109 | <SubSystem>Console</SubSystem> | 109 | <SubSystem>Console</SubSystem> |
110 | <DataExecutionPrevention> | 110 | <DataExecutionPrevention> |
111 | </DataExecutionPrevention> | 111 | </DataExecutionPrevention> |
112 | </Link> | 112 | </Link> |
113 | </ItemDefinitionGroup> | 113 | </ItemDefinitionGroup> |
114 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | 114 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> |
115 | <ClCompile> | 115 | <ClCompile> |
116 | <Optimization>Disabled</Optimization> | 116 | <Optimization>Disabled</Optimization> |
117 | <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> | 117 | <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
118 | <PreprocessorDefinitions>WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> | 118 | <PreprocessorDefinitions>WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
119 | <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | 119 | <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> |
120 | <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> | 120 | <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> |
121 | <PrecompiledHeader> | 121 | <PrecompiledHeader> |
122 | </PrecompiledHeader> | 122 | </PrecompiledHeader> |
123 | <WarningLevel>Level3</WarningLevel> | 123 | <WarningLevel>Level3</WarningLevel> |
124 | <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> | 124 | <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> |
125 | </ClCompile> | 125 | </ClCompile> |
126 | <Link> | 126 | <Link> |
127 | <OutputFile>..\..\bin\Win64-VisualStudio\21.Quake3Explorer.exe</OutputFile> | 127 | <OutputFile>..\..\bin\Win64-VisualStudio\21.Quake3Explorer.exe</OutputFile> |
128 | <AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> | 128 | <AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> |
129 | <GenerateDebugInformation>true</GenerateDebugInformation> | 129 | <GenerateDebugInformation>true</GenerateDebugInformation> |
130 | <ProgramDatabaseFile>$(OutDir)Quake3MapShader.pdb</ProgramDatabaseFile> | 130 | <ProgramDatabaseFile>$(OutDir)Quake3MapShader.pdb</ProgramDatabaseFile> |
131 | <SubSystem>Console</SubSystem> | 131 | <SubSystem>Console</SubSystem> |
132 | <DataExecutionPrevention> | 132 | <DataExecutionPrevention> |
133 | </DataExecutionPrevention> | 133 | </DataExecutionPrevention> |
134 | </Link> | 134 | </Link> |
135 | </ItemDefinitionGroup> | 135 | </ItemDefinitionGroup> |
136 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | 136 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
137 | <ClCompile> | 137 | <ClCompile> |
138 | <IntrinsicFunctions>true</IntrinsicFunctions> | 138 | <IntrinsicFunctions>true</IntrinsicFunctions> |
139 | <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> | 139 | <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> |
140 | <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> | 140 | <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
141 | <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> | 141 | <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
142 | <RuntimeLibrary>MultiThreaded</RuntimeLibrary> | 142 | <RuntimeLibrary>MultiThreaded</RuntimeLibrary> |
143 | <BufferSecurityCheck>false</BufferSecurityCheck> | 143 | <BufferSecurityCheck>false</BufferSecurityCheck> |
144 | <PrecompiledHeader> | 144 | <PrecompiledHeader> |
145 | </PrecompiledHeader> | 145 | </PrecompiledHeader> |
146 | <WarningLevel>Level3</WarningLevel> | 146 | <WarningLevel>Level3</WarningLevel> |
147 | <DebugInformationFormat> | 147 | <DebugInformationFormat> |
148 | </DebugInformationFormat> | 148 | </DebugInformationFormat> |
149 | <CallingConvention>FastCall</CallingConvention> | 149 | <CallingConvention>FastCall</CallingConvention> |
150 | </ClCompile> | 150 | </ClCompile> |
151 | <Link> | 151 | <Link> |
152 | <OutputFile>..\..\bin\Win32-VisualStudio\21.Quake3Explorer.exe</OutputFile> | 152 | <OutputFile>..\..\bin\Win32-VisualStudio\21.Quake3Explorer.exe</OutputFile> |
153 | <AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> | 153 | <AdditionalLibraryDirectories>..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> |
154 | <GenerateDebugInformation>false</GenerateDebugInformation> | 154 | <GenerateDebugInformation>false</GenerateDebugInformation> |
155 | <SubSystem>Console</SubSystem> | 155 | <SubSystem>Console</SubSystem> |
156 | <OptimizeReferences>true</OptimizeReferences> | 156 | <OptimizeReferences>true</OptimizeReferences> |
157 | <EnableCOMDATFolding>true</EnableCOMDATFolding> | 157 | <EnableCOMDATFolding>true</EnableCOMDATFolding> |
158 | <DataExecutionPrevention> | 158 | <DataExecutionPrevention> |
159 | </DataExecutionPrevention> | 159 | </DataExecutionPrevention> |
160 | </Link> | 160 | </Link> |
161 | </ItemDefinitionGroup> | 161 | </ItemDefinitionGroup> |
162 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | 162 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> |
163 | <ClCompile> | 163 | <ClCompile> |
164 | <IntrinsicFunctions>true</IntrinsicFunctions> | 164 | <IntrinsicFunctions>true</IntrinsicFunctions> |
165 | <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> | 165 | <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> |
166 | <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> | 166 | <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
167 | <PreprocessorDefinitions>WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> | 167 | <PreprocessorDefinitions>WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
168 | <RuntimeLibrary>MultiThreaded</RuntimeLibrary> | 168 | <RuntimeLibrary>MultiThreaded</RuntimeLibrary> |
169 | <BufferSecurityCheck>false</BufferSecurityCheck> | 169 | <BufferSecurityCheck>false</BufferSecurityCheck> |
170 | <PrecompiledHeader> | 170 | <PrecompiledHeader> |
171 | </PrecompiledHeader> | 171 | </PrecompiledHeader> |
172 | <WarningLevel>Level3</WarningLevel> | 172 | <WarningLevel>Level3</WarningLevel> |
173 | <DebugInformationFormat> | 173 | <DebugInformationFormat> |
174 | </DebugInformationFormat> | 174 | </DebugInformationFormat> |
175 | <CallingConvention>FastCall</CallingConvention> | 175 | <CallingConvention>FastCall</CallingConvention> |
176 | </ClCompile> | 176 | </ClCompile> |
177 | <Link> | 177 | <Link> |
178 | <OutputFile>..\..\bin\Win64-VisualStudio\21.Quake3Explorer.exe</OutputFile> | 178 | <OutputFile>..\..\bin\Win64-VisualStudio\21.Quake3Explorer.exe</OutputFile> |
179 | <AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> | 179 | <AdditionalLibraryDirectories>..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> |
180 | <GenerateDebugInformation>false</GenerateDebugInformation> | 180 | <GenerateDebugInformation>false</GenerateDebugInformation> |
181 | <SubSystem>Console</SubSystem> | 181 | <SubSystem>Console</SubSystem> |
182 | <OptimizeReferences>true</OptimizeReferences> | 182 | <OptimizeReferences>true</OptimizeReferences> |
183 | <EnableCOMDATFolding>true</EnableCOMDATFolding> | 183 | <EnableCOMDATFolding>true</EnableCOMDATFolding> |
184 | <DataExecutionPrevention> | 184 | <DataExecutionPrevention> |
185 | </DataExecutionPrevention> | 185 | </DataExecutionPrevention> |
186 | </Link> | 186 | </Link> |
187 | </ItemDefinitionGroup> | 187 | </ItemDefinitionGroup> |
188 | <ItemGroup> | 188 | <ItemGroup> |
189 | <ClCompile Include="main.cpp" /> | 189 | <ClCompile Include="main.cpp" /> |
190 | <ClCompile Include="q3factory.cpp" /> | 190 | <ClCompile Include="q3factory.cpp" /> |
191 | <ClCompile Include="sound.cpp" /> | 191 | <ClCompile Include="sound.cpp" /> |
192 | </ItemGroup> | 192 | </ItemGroup> |
193 | <ItemGroup> | 193 | <ItemGroup> |
194 | <ClInclude Include="q3factory.h" /> | 194 | <ClInclude Include="q3factory.h" /> |
195 | <ClInclude Include="sound.h" /> | 195 | <ClInclude Include="sound.h" /> |
196 | </ItemGroup> | 196 | </ItemGroup> |
197 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | 197 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> |
198 | <ImportGroup Label="ExtensionTargets"> | 198 | <ImportGroup Label="ExtensionTargets"> |
199 | </ImportGroup> | 199 | </ImportGroup> |
200 | </Project> \ No newline at end of file | 200 | </Project> \ No newline at end of file |
diff --git a/libraries/irrlicht-1.8/examples/21.Quake3Explorer/Quake3Explorer_vc8.vcproj b/libraries/irrlicht-1.8/examples/21.Quake3Explorer/Quake3Explorer_vc8.vcproj index 9045027..2b13531 100644 --- a/libraries/irrlicht-1.8/examples/21.Quake3Explorer/Quake3Explorer_vc8.vcproj +++ b/libraries/irrlicht-1.8/examples/21.Quake3Explorer/Quake3Explorer_vc8.vcproj | |||
@@ -1,210 +1,210 @@ | |||
1 | <?xml version="1.0" encoding="Windows-1252"?> | 1 | <?xml version="1.0" encoding="Windows-1252"?> |
2 | <VisualStudioProject | 2 | <VisualStudioProject |
3 | ProjectType="Visual C++" | 3 | ProjectType="Visual C++" |
4 | Version="8,00" | 4 | Version="8,00" |
5 | Name="21.Quake3Explorer_vc8" | 5 | Name="21.Quake3Explorer_vc8" |
6 | ProjectGUID="{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}" | 6 | ProjectGUID="{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}" |
7 | RootNamespace="21.Quake3Explorer_vc8" | 7 | RootNamespace="21.Quake3Explorer_vc8" |
8 | Keyword="Win32Proj" | 8 | Keyword="Win32Proj" |
9 | > | 9 | > |
10 | <Platforms> | 10 | <Platforms> |
11 | <Platform | 11 | <Platform |
12 | Name="Win32" | 12 | Name="Win32" |
13 | /> | 13 | /> |
14 | </Platforms> | 14 | </Platforms> |
15 | <ToolFiles> | 15 | <ToolFiles> |
16 | </ToolFiles> | 16 | </ToolFiles> |
17 | <Configurations> | 17 | <Configurations> |
18 | <Configuration | 18 | <Configuration |
19 | Name="Debug|Win32" | 19 | Name="Debug|Win32" |
20 | OutputDirectory="Debug" | 20 | OutputDirectory="Debug" |
21 | IntermediateDirectory="Debug" | 21 | IntermediateDirectory="Debug" |
22 | ConfigurationType="1" | 22 | ConfigurationType="1" |
23 | InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" | 23 | InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" |
24 | CharacterSet="2" | 24 | CharacterSet="2" |
25 | > | 25 | > |
26 | <Tool | 26 | <Tool |
27 | Name="VCPreBuildEventTool" | 27 | Name="VCPreBuildEventTool" |
28 | /> | 28 | /> |
29 | <Tool | 29 | <Tool |
30 | Name="VCCustomBuildTool" | 30 | Name="VCCustomBuildTool" |
31 | /> | 31 | /> |
32 | <Tool | 32 | <Tool |
33 | Name="VCXMLDataGeneratorTool" | 33 | Name="VCXMLDataGeneratorTool" |
34 | /> | 34 | /> |
35 | <Tool | 35 | <Tool |
36 | Name="VCWebServiceProxyGeneratorTool" | 36 | Name="VCWebServiceProxyGeneratorTool" |
37 | /> | 37 | /> |
38 | <Tool | 38 | <Tool |
39 | Name="VCMIDLTool" | 39 | Name="VCMIDLTool" |
40 | /> | 40 | /> |
41 | <Tool | 41 | <Tool |
42 | Name="VCCLCompilerTool" | 42 | Name="VCCLCompilerTool" |
43 | Optimization="0" | 43 | Optimization="0" |
44 | AdditionalIncludeDirectories="..\..\include" | 44 | AdditionalIncludeDirectories="..\..\include" |
45 | PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS" | 45 | PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS" |
46 | MinimalRebuild="true" | 46 | MinimalRebuild="true" |
47 | BasicRuntimeChecks="3" | 47 | BasicRuntimeChecks="3" |
48 | RuntimeLibrary="1" | 48 | RuntimeLibrary="1" |
49 | UsePrecompiledHeader="0" | 49 | UsePrecompiledHeader="0" |
50 | WarningLevel="3" | 50 | WarningLevel="3" |
51 | Detect64BitPortabilityProblems="true" | 51 | Detect64BitPortabilityProblems="true" |
52 | DebugInformationFormat="4" | 52 | DebugInformationFormat="4" |
53 | DisableSpecificWarnings="4996" | 53 | DisableSpecificWarnings="4996" |
54 | /> | 54 | /> |
55 | <Tool | 55 | <Tool |
56 | Name="VCManagedResourceCompilerTool" | 56 | Name="VCManagedResourceCompilerTool" |
57 | /> | 57 | /> |
58 | <Tool | 58 | <Tool |
59 | Name="VCResourceCompilerTool" | 59 | Name="VCResourceCompilerTool" |
60 | /> | 60 | /> |
61 | <Tool | 61 | <Tool |
62 | Name="VCPreLinkEventTool" | 62 | Name="VCPreLinkEventTool" |
63 | /> | 63 | /> |
64 | <Tool | 64 | <Tool |
65 | Name="VCLinkerTool" | 65 | Name="VCLinkerTool" |
66 | OutputFile="..\..\bin\Win32-VisualStudio\21.Quake3MapExplorer.exe" | 66 | OutputFile="..\..\bin\Win32-VisualStudio\21.Quake3MapExplorer.exe" |
67 | LinkIncremental="2" | 67 | LinkIncremental="2" |
68 | AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio" | 68 | AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio" |
69 | GenerateDebugInformation="true" | 69 | GenerateDebugInformation="true" |
70 | ProgramDatabaseFile="$(OutDir)/Quake3MapShader.pdb" | 70 | ProgramDatabaseFile="$(OutDir)/Quake3MapShader.pdb" |
71 | SubSystem="1" | 71 | SubSystem="1" |
72 | TargetMachine="1" | 72 | TargetMachine="1" |
73 | /> | 73 | /> |
74 | <Tool | 74 | <Tool |
75 | Name="VCALinkTool" | 75 | Name="VCALinkTool" |
76 | /> | 76 | /> |
77 | <Tool | 77 | <Tool |
78 | Name="VCManifestTool" | 78 | Name="VCManifestTool" |
79 | /> | 79 | /> |
80 | <Tool | 80 | <Tool |
81 | Name="VCXDCMakeTool" | 81 | Name="VCXDCMakeTool" |
82 | /> | 82 | /> |
83 | <Tool | 83 | <Tool |
84 | Name="VCBscMakeTool" | 84 | Name="VCBscMakeTool" |
85 | /> | 85 | /> |
86 | <Tool | 86 | <Tool |
87 | Name="VCFxCopTool" | 87 | Name="VCFxCopTool" |
88 | /> | 88 | /> |
89 | <Tool | 89 | <Tool |
90 | Name="VCAppVerifierTool" | 90 | Name="VCAppVerifierTool" |
91 | /> | 91 | /> |
92 | <Tool | 92 | <Tool |
93 | Name="VCWebDeploymentTool" | 93 | Name="VCWebDeploymentTool" |
94 | /> | 94 | /> |
95 | <Tool | 95 | <Tool |
96 | Name="VCPostBuildEventTool" | 96 | Name="VCPostBuildEventTool" |
97 | /> | 97 | /> |
98 | </Configuration> | 98 | </Configuration> |
99 | <Configuration | 99 | <Configuration |
100 | Name="Release|Win32" | 100 | Name="Release|Win32" |
101 | OutputDirectory="Release" | 101 | OutputDirectory="Release" |
102 | IntermediateDirectory="Release" | 102 | IntermediateDirectory="Release" |
103 | ConfigurationType="1" | 103 | ConfigurationType="1" |
104 | InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" | 104 | InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" |
105 | CharacterSet="2" | 105 | CharacterSet="2" |
106 | > | 106 | > |
107 | <Tool | 107 | <Tool |
108 | Name="VCPreBuildEventTool" | 108 | Name="VCPreBuildEventTool" |
109 | /> | 109 | /> |
110 | <Tool | 110 | <Tool |
111 | Name="VCCustomBuildTool" | 111 | Name="VCCustomBuildTool" |
112 | /> | 112 | /> |
113 | <Tool | 113 | <Tool |
114 | Name="VCXMLDataGeneratorTool" | 114 | Name="VCXMLDataGeneratorTool" |
115 | /> | 115 | /> |
116 | <Tool | 116 | <Tool |
117 | Name="VCWebServiceProxyGeneratorTool" | 117 | Name="VCWebServiceProxyGeneratorTool" |
118 | /> | 118 | /> |
119 | <Tool | 119 | <Tool |
120 | Name="VCMIDLTool" | 120 | Name="VCMIDLTool" |
121 | /> | 121 | /> |
122 | <Tool | 122 | <Tool |
123 | Name="VCCLCompilerTool" | 123 | Name="VCCLCompilerTool" |
124 | Optimization="2" | 124 | Optimization="2" |
125 | EnableIntrinsicFunctions="true" | 125 | EnableIntrinsicFunctions="true" |
126 | FavorSizeOrSpeed="1" | 126 | FavorSizeOrSpeed="1" |
127 | AdditionalIncludeDirectories="..\..\include" | 127 | AdditionalIncludeDirectories="..\..\include" |
128 | PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" | 128 | PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" |
129 | RuntimeLibrary="0" | 129 | RuntimeLibrary="0" |
130 | BufferSecurityCheck="false" | 130 | BufferSecurityCheck="false" |
131 | UsePrecompiledHeader="0" | 131 | UsePrecompiledHeader="0" |
132 | WarningLevel="3" | 132 | WarningLevel="3" |
133 | Detect64BitPortabilityProblems="true" | 133 | Detect64BitPortabilityProblems="true" |
134 | DebugInformationFormat="0" | 134 | DebugInformationFormat="0" |
135 | CallingConvention="1" | 135 | CallingConvention="1" |
136 | DisableSpecificWarnings="4996" | 136 | DisableSpecificWarnings="4996" |
137 | /> | 137 | /> |
138 | <Tool | 138 | <Tool |
139 | Name="VCManagedResourceCompilerTool" | 139 | Name="VCManagedResourceCompilerTool" |
140 | /> | 140 | /> |
141 | <Tool | 141 | <Tool |
142 | Name="VCResourceCompilerTool" | 142 | Name="VCResourceCompilerTool" |
143 | /> | 143 | /> |
144 | <Tool | 144 | <Tool |
145 | Name="VCPreLinkEventTool" | 145 | Name="VCPreLinkEventTool" |
146 | /> | 146 | /> |
147 | <Tool | 147 | <Tool |
148 | Name="VCLinkerTool" | 148 | Name="VCLinkerTool" |
149 | OutputFile="..\..\bin\Win32-VisualStudio\21.Quake3MapExplorer.exe" | 149 | OutputFile="..\..\bin\Win32-VisualStudio\21.Quake3MapExplorer.exe" |
150 | LinkIncremental="1" | 150 | LinkIncremental="1" |
151 | AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio" | 151 | AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio" |
152 | GenerateDebugInformation="false" | 152 | GenerateDebugInformation="false" |
153 | SubSystem="1" | 153 | SubSystem="1" |
154 | OptimizeReferences="2" | 154 | OptimizeReferences="2" |
155 | EnableCOMDATFolding="2" | 155 | EnableCOMDATFolding="2" |
156 | TargetMachine="1" | 156 | TargetMachine="1" |
157 | /> | 157 | /> |
158 | <Tool | 158 | <Tool |
159 | Name="VCALinkTool" | 159 | Name="VCALinkTool" |
160 | /> | 160 | /> |
161 | <Tool | 161 | <Tool |
162 | Name="VCManifestTool" | 162 | Name="VCManifestTool" |
163 | /> | 163 | /> |
164 | <Tool | 164 | <Tool |
165 | Name="VCXDCMakeTool" | 165 | Name="VCXDCMakeTool" |
166 | /> | 166 | /> |
167 | <Tool | 167 | <Tool |
168 | Name="VCBscMakeTool" | 168 | Name="VCBscMakeTool" |
169 | /> | 169 | /> |
170 | <Tool | 170 | <Tool |
171 | Name="VCFxCopTool" | 171 | Name="VCFxCopTool" |
172 | /> | 172 | /> |
173 | <Tool | 173 | <Tool |
174 | Name="VCAppVerifierTool" | 174 | Name="VCAppVerifierTool" |
175 | /> | 175 | /> |
176 | <Tool | 176 | <Tool |
177 | Name="VCWebDeploymentTool" | 177 | Name="VCWebDeploymentTool" |
178 | /> | 178 | /> |
179 | <Tool | 179 | <Tool |
180 | Name="VCPostBuildEventTool" | 180 | Name="VCPostBuildEventTool" |
181 | /> | 181 | /> |
182 | </Configuration> | 182 | </Configuration> |
183 | </Configurations> | 183 | </Configurations> |
184 | <References> | 184 | <References> |
185 | </References> | 185 | </References> |
186 | <Files> | 186 | <Files> |
187 | <File | 187 | <File |
188 | RelativePath=".\main.cpp" | 188 | RelativePath=".\main.cpp" |
189 | > | 189 | > |
190 | </File> | 190 | </File> |
191 | <File | 191 | <File |
192 | RelativePath=".\q3factory.cpp" | 192 | RelativePath=".\q3factory.cpp" |
193 | > | 193 | > |
194 | </File> | 194 | </File> |
195 | <File | 195 | <File |
196 | RelativePath=".\q3factory.h" | 196 | RelativePath=".\q3factory.h" |
197 | > | 197 | > |
198 | </File> | 198 | </File> |
199 | <File | 199 | <File |
200 | RelativePath=".\sound.cpp" | 200 | RelativePath=".\sound.cpp" |
201 | > | 201 | > |
202 | </File> | 202 | </File> |
203 | <File | 203 | <File |
204 | RelativePath=".\sound.h" | 204 | RelativePath=".\sound.h" |
205 | > | 205 | > |
206 | </File> | 206 | </File> |
207 | </Files> | 207 | </Files> |
208 | <Globals> | 208 | <Globals> |
209 | </Globals> | 209 | </Globals> |
210 | </VisualStudioProject> | 210 | </VisualStudioProject> |
diff --git a/libraries/irrlicht-1.8/examples/21.Quake3Explorer/Quake3Explorer_vc9.vcproj b/libraries/irrlicht-1.8/examples/21.Quake3Explorer/Quake3Explorer_vc9.vcproj index 36aee41..4975a6c 100644 --- a/libraries/irrlicht-1.8/examples/21.Quake3Explorer/Quake3Explorer_vc9.vcproj +++ b/libraries/irrlicht-1.8/examples/21.Quake3Explorer/Quake3Explorer_vc9.vcproj | |||
@@ -1,204 +1,204 @@ | |||
1 | <?xml version="1.0" encoding="Windows-1252"?> | 1 | <?xml version="1.0" encoding="Windows-1252"?> |
2 | <VisualStudioProject | 2 | <VisualStudioProject |
3 | ProjectType="Visual C++" | 3 | ProjectType="Visual C++" |
4 | Version="9,00" | 4 | Version="9,00" |
5 | Name="21.Quake3Explorer_vc9" | 5 | Name="21.Quake3Explorer_vc9" |
6 | ProjectGUID="{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}" | 6 | ProjectGUID="{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}" |
7 | RootNamespace="21.Quake3Explorer_vc9" | 7 | RootNamespace="21.Quake3Explorer_vc9" |
8 | Keyword="Win32Proj" | 8 | Keyword="Win32Proj" |
9 | TargetFrameworkVersion="131072" | 9 | TargetFrameworkVersion="131072" |
10 | > | 10 | > |
11 | <Platforms> | 11 | <Platforms> |
12 | <Platform | 12 | <Platform |
13 | Name="Win32" | 13 | Name="Win32" |
14 | /> | 14 | /> |
15 | </Platforms> | 15 | </Platforms> |
16 | <ToolFiles> | 16 | <ToolFiles> |
17 | </ToolFiles> | 17 | </ToolFiles> |
18 | <Configurations> | 18 | <Configurations> |
19 | <Configuration | 19 | <Configuration |
20 | Name="Debug|Win32" | 20 | Name="Debug|Win32" |
21 | OutputDirectory="Debug" | 21 | OutputDirectory="Debug" |
22 | IntermediateDirectory="Debug" | 22 | IntermediateDirectory="Debug" |
23 | ConfigurationType="1" | 23 | ConfigurationType="1" |
24 | InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" | 24 | InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" |
25 | CharacterSet="2" | 25 | CharacterSet="2" |
26 | > | 26 | > |
27 | <Tool | 27 | <Tool |
28 | Name="VCPreBuildEventTool" | 28 | Name="VCPreBuildEventTool" |
29 | /> | 29 | /> |
30 | <Tool | 30 | <Tool |
31 | Name="VCCustomBuildTool" | 31 | Name="VCCustomBuildTool" |
32 | /> | 32 | /> |
33 | <Tool | 33 | <Tool |
34 | Name="VCXMLDataGeneratorTool" | 34 | Name="VCXMLDataGeneratorTool" |
35 | /> | 35 | /> |
36 | <Tool | 36 | <Tool |
37 | Name="VCWebServiceProxyGeneratorTool" | 37 | Name="VCWebServiceProxyGeneratorTool" |
38 | /> | 38 | /> |
39 | <Tool | 39 | <Tool |
40 | Name="VCMIDLTool" | 40 | Name="VCMIDLTool" |
41 | /> | 41 | /> |
42 | <Tool | 42 | <Tool |
43 | Name="VCCLCompilerTool" | 43 | Name="VCCLCompilerTool" |
44 | Optimization="0" | 44 | Optimization="0" |
45 | AdditionalIncludeDirectories="..\..\include" | 45 | AdditionalIncludeDirectories="..\..\include" |
46 | PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS" | 46 | PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS" |
47 | MinimalRebuild="true" | 47 | MinimalRebuild="true" |
48 | BasicRuntimeChecks="3" | 48 | BasicRuntimeChecks="3" |
49 | RuntimeLibrary="1" | 49 | RuntimeLibrary="1" |
50 | UsePrecompiledHeader="0" | 50 | UsePrecompiledHeader="0" |
51 | WarningLevel="3" | 51 | WarningLevel="3" |
52 | DebugInformationFormat="4" | 52 | DebugInformationFormat="4" |
53 | /> | 53 | /> |
54 | <Tool | 54 | <Tool |
55 | Name="VCManagedResourceCompilerTool" | 55 | Name="VCManagedResourceCompilerTool" |
56 | /> | 56 | /> |
57 | <Tool | 57 | <Tool |
58 | Name="VCResourceCompilerTool" | 58 | Name="VCResourceCompilerTool" |
59 | /> | 59 | /> |
60 | <Tool | 60 | <Tool |
61 | Name="VCPreLinkEventTool" | 61 | Name="VCPreLinkEventTool" |
62 | /> | 62 | /> |
63 | <Tool | 63 | <Tool |
64 | Name="VCLinkerTool" | 64 | Name="VCLinkerTool" |
65 | OutputFile="..\..\bin\Win32-VisualStudio\21.Quake3MapExplorer.exe" | 65 | OutputFile="..\..\bin\Win32-VisualStudio\21.Quake3MapExplorer.exe" |
66 | LinkIncremental="2" | 66 | LinkIncremental="2" |
67 | AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio" | 67 | AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio" |
68 | GenerateDebugInformation="true" | 68 | GenerateDebugInformation="true" |
69 | ProgramDatabaseFile="$(OutDir)/Quake3MapShader.pdb" | 69 | ProgramDatabaseFile="$(OutDir)/Quake3MapShader.pdb" |
70 | SubSystem="1" | 70 | SubSystem="1" |
71 | RandomizedBaseAddress="1" | 71 | RandomizedBaseAddress="1" |
72 | DataExecutionPrevention="0" | 72 | DataExecutionPrevention="0" |
73 | TargetMachine="1" | 73 | TargetMachine="1" |
74 | /> | 74 | /> |
75 | <Tool | 75 | <Tool |
76 | Name="VCALinkTool" | 76 | Name="VCALinkTool" |
77 | /> | 77 | /> |
78 | <Tool | 78 | <Tool |
79 | Name="VCManifestTool" | 79 | Name="VCManifestTool" |
80 | /> | 80 | /> |
81 | <Tool | 81 | <Tool |
82 | Name="VCXDCMakeTool" | 82 | Name="VCXDCMakeTool" |
83 | /> | 83 | /> |
84 | <Tool | 84 | <Tool |
85 | Name="VCBscMakeTool" | 85 | Name="VCBscMakeTool" |
86 | /> | 86 | /> |
87 | <Tool | 87 | <Tool |
88 | Name="VCFxCopTool" | 88 | Name="VCFxCopTool" |
89 | /> | 89 | /> |
90 | <Tool | 90 | <Tool |
91 | Name="VCAppVerifierTool" | 91 | Name="VCAppVerifierTool" |
92 | /> | 92 | /> |
93 | <Tool | 93 | <Tool |
94 | Name="VCPostBuildEventTool" | 94 | Name="VCPostBuildEventTool" |
95 | /> | 95 | /> |
96 | </Configuration> | 96 | </Configuration> |
97 | <Configuration | 97 | <Configuration |
98 | Name="Release|Win32" | 98 | Name="Release|Win32" |
99 | OutputDirectory="Release" | 99 | OutputDirectory="Release" |
100 | IntermediateDirectory="Release" | 100 | IntermediateDirectory="Release" |
101 | ConfigurationType="1" | 101 | ConfigurationType="1" |
102 | InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" | 102 | InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" |
103 | CharacterSet="2" | 103 | CharacterSet="2" |
104 | > | 104 | > |
105 | <Tool | 105 | <Tool |
106 | Name="VCPreBuildEventTool" | 106 | Name="VCPreBuildEventTool" |
107 | /> | 107 | /> |
108 | <Tool | 108 | <Tool |
109 | Name="VCCustomBuildTool" | 109 | Name="VCCustomBuildTool" |
110 | /> | 110 | /> |
111 | <Tool | 111 | <Tool |
112 | Name="VCXMLDataGeneratorTool" | 112 | Name="VCXMLDataGeneratorTool" |
113 | /> | 113 | /> |
114 | <Tool | 114 | <Tool |
115 | Name="VCWebServiceProxyGeneratorTool" | 115 | Name="VCWebServiceProxyGeneratorTool" |
116 | /> | 116 | /> |
117 | <Tool | 117 | <Tool |
118 | Name="VCMIDLTool" | 118 | Name="VCMIDLTool" |
119 | /> | 119 | /> |
120 | <Tool | 120 | <Tool |
121 | Name="VCCLCompilerTool" | 121 | Name="VCCLCompilerTool" |
122 | EnableIntrinsicFunctions="true" | 122 | EnableIntrinsicFunctions="true" |
123 | FavorSizeOrSpeed="1" | 123 | FavorSizeOrSpeed="1" |
124 | AdditionalIncludeDirectories="..\..\include" | 124 | AdditionalIncludeDirectories="..\..\include" |
125 | PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" | 125 | PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" |
126 | RuntimeLibrary="0" | 126 | RuntimeLibrary="0" |
127 | BufferSecurityCheck="false" | 127 | BufferSecurityCheck="false" |
128 | UsePrecompiledHeader="0" | 128 | UsePrecompiledHeader="0" |
129 | WarningLevel="3" | 129 | WarningLevel="3" |
130 | DebugInformationFormat="0" | 130 | DebugInformationFormat="0" |
131 | CallingConvention="1" | 131 | CallingConvention="1" |
132 | /> | 132 | /> |
133 | <Tool | 133 | <Tool |
134 | Name="VCManagedResourceCompilerTool" | 134 | Name="VCManagedResourceCompilerTool" |
135 | /> | 135 | /> |
136 | <Tool | 136 | <Tool |
137 | Name="VCResourceCompilerTool" | 137 | Name="VCResourceCompilerTool" |
138 | /> | 138 | /> |
139 | <Tool | 139 | <Tool |
140 | Name="VCPreLinkEventTool" | 140 | Name="VCPreLinkEventTool" |
141 | /> | 141 | /> |
142 | <Tool | 142 | <Tool |
143 | Name="VCLinkerTool" | 143 | Name="VCLinkerTool" |
144 | OutputFile="..\..\bin\Win32-VisualStudio\21.Quake3MapExplorer.exe" | 144 | OutputFile="..\..\bin\Win32-VisualStudio\21.Quake3MapExplorer.exe" |
145 | LinkIncremental="1" | 145 | LinkIncremental="1" |
146 | AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio" | 146 | AdditionalLibraryDirectories="..\..\lib\Win32-visualstudio" |
147 | GenerateDebugInformation="false" | 147 | GenerateDebugInformation="false" |
148 | SubSystem="1" | 148 | SubSystem="1" |
149 | OptimizeReferences="2" | 149 | OptimizeReferences="2" |
150 | EnableCOMDATFolding="2" | 150 | EnableCOMDATFolding="2" |
151 | RandomizedBaseAddress="1" | 151 | RandomizedBaseAddress="1" |
152 | DataExecutionPrevention="0" | 152 | DataExecutionPrevention="0" |
153 | TargetMachine="1" | 153 | TargetMachine="1" |
154 | /> | 154 | /> |
155 | <Tool | 155 | <Tool |
156 | Name="VCALinkTool" | 156 | Name="VCALinkTool" |
157 | /> | 157 | /> |
158 | <Tool | 158 | <Tool |
159 | Name="VCManifestTool" | 159 | Name="VCManifestTool" |
160 | /> | 160 | /> |
161 | <Tool | 161 | <Tool |
162 | Name="VCXDCMakeTool" | 162 | Name="VCXDCMakeTool" |
163 | /> | 163 | /> |
164 | <Tool | 164 | <Tool |
165 | Name="VCBscMakeTool" | 165 | Name="VCBscMakeTool" |
166 | /> | 166 | /> |
167 | <Tool | 167 | <Tool |
168 | Name="VCFxCopTool" | 168 | Name="VCFxCopTool" |
169 | /> | 169 | /> |
170 | <Tool | 170 | <Tool |
171 | Name="VCAppVerifierTool" | 171 | Name="VCAppVerifierTool" |
172 | /> | 172 | /> |
173 | <Tool | 173 | <Tool |
174 | Name="VCPostBuildEventTool" | 174 | Name="VCPostBuildEventTool" |
175 | /> | 175 | /> |
176 | </Configuration> | 176 | </Configuration> |
177 | </Configurations> | 177 | </Configurations> |
178 | <References> | 178 | <References> |
179 | </References> | 179 | </References> |
180 | <Files> | 180 | <Files> |
181 | <File | 181 | <File |
182 | RelativePath=".\main.cpp" | 182 | RelativePath=".\main.cpp" |
183 | > | 183 | > |
184 | </File> | 184 | </File> |
185 | <File | 185 | <File |
186 | RelativePath=".\q3factory.cpp" | 186 | RelativePath=".\q3factory.cpp" |
187 | > | 187 | > |
188 | </File> | 188 | </File> |
189 | <File | 189 | <File |
190 | RelativePath=".\q3factory.h" | 190 | RelativePath=".\q3factory.h" |
191 | > | 191 | > |
192 | </File> | 192 | </File> |
193 | <File | 193 | <File |
194 | RelativePath=".\sound.cpp" | 194 | RelativePath=".\sound.cpp" |
195 | > | 195 | > |
196 | </File> | 196 | </File> |
197 | <File | 197 | <File |
198 | RelativePath=".\sound.h" | 198 | RelativePath=".\sound.h" |
199 | > | 199 | > |
200 | </File> | 200 | </File> |
201 | </Files> | 201 | </Files> |
202 | <Globals> | 202 | <Globals> |
203 | </Globals> | 203 | </Globals> |
204 | </VisualStudioProject> | 204 | </VisualStudioProject> |
diff --git a/libraries/irrlicht-1.8/examples/21.Quake3Explorer/main.cpp b/libraries/irrlicht-1.8/examples/21.Quake3Explorer/main.cpp index fdcdd03..4d41e1c 100644 --- a/libraries/irrlicht-1.8/examples/21.Quake3Explorer/main.cpp +++ b/libraries/irrlicht-1.8/examples/21.Quake3Explorer/main.cpp | |||
@@ -1,2178 +1,2178 @@ | |||
1 | /** Example 021 Quake3 Explorer | 1 | /** Example 021 Quake3 Explorer |
2 | 2 | ||
3 | This Tutorial shows how to load different Quake 3 maps. | 3 | This Tutorial shows how to load different Quake 3 maps. |
4 | 4 | ||
5 | Features: | 5 | Features: |
6 | - Load BSP Archives at Runtime from the menu | 6 | - Load BSP Archives at Runtime from the menu |
7 | - Load a Map from the menu. Showing with Screenshot | 7 | - Load a Map from the menu. Showing with Screenshot |
8 | - Set the VideoDriver at runtime from menu | 8 | - Set the VideoDriver at runtime from menu |
9 | - Adjust GammaLevel at runtime | 9 | - Adjust GammaLevel at runtime |
10 | - Create SceneNodes for the Shaders | 10 | - Create SceneNodes for the Shaders |
11 | - Load EntityList and create Entity SceneNodes | 11 | - Load EntityList and create Entity SceneNodes |
12 | - Create Players with Weapons and with Collision Response | 12 | - Create Players with Weapons and with Collision Response |
13 | - Play music | 13 | - Play music |
14 | 14 | ||
15 | You can download the Quake III Arena demo ( copyright id software ) | 15 | You can download the Quake III Arena demo ( copyright id software ) |
16 | at the following location: | 16 | at the following location: |
17 | ftp://ftp.idsoftware.com/idstuff/quake3/win32/q3ademo.exe | 17 | ftp://ftp.idsoftware.com/idstuff/quake3/win32/q3ademo.exe |
18 | 18 | ||
19 | Copyright 2006-2011 Burningwater, Thomas Alten | 19 | Copyright 2006-2011 Burningwater, Thomas Alten |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include "driverChoice.h" | 22 | #include "driverChoice.h" |
23 | #include <irrlicht.h> | 23 | #include <irrlicht.h> |
24 | #include "q3factory.h" | 24 | #include "q3factory.h" |
25 | #include "sound.h" | 25 | #include "sound.h" |
26 | 26 | ||
27 | /* | 27 | /* |
28 | Game Data is used to hold Data which is needed to drive the game | 28 | Game Data is used to hold Data which is needed to drive the game |
29 | */ | 29 | */ |
30 | struct GameData | 30 | struct GameData |
31 | { | 31 | { |
32 | GameData ( const path &startupDir) : | 32 | GameData ( const path &startupDir) : |
33 | retVal(0), StartupDir(startupDir), createExDevice(0), Device(0) | 33 | retVal(0), StartupDir(startupDir), createExDevice(0), Device(0) |
34 | { | 34 | { |
35 | setDefault (); | 35 | setDefault (); |
36 | } | 36 | } |
37 | 37 | ||
38 | void setDefault (); | 38 | void setDefault (); |
39 | s32 save ( const path &filename ); | 39 | s32 save ( const path &filename ); |
40 | s32 load ( const path &filename ); | 40 | s32 load ( const path &filename ); |
41 | 41 | ||
42 | s32 debugState; | 42 | s32 debugState; |
43 | s32 gravityState; | 43 | s32 gravityState; |
44 | s32 flyTroughState; | 44 | s32 flyTroughState; |
45 | s32 wireFrame; | 45 | s32 wireFrame; |
46 | s32 guiActive; | 46 | s32 guiActive; |
47 | s32 guiInputActive; | 47 | s32 guiInputActive; |
48 | f32 GammaValue; | 48 | f32 GammaValue; |
49 | s32 retVal; | 49 | s32 retVal; |
50 | s32 sound; | 50 | s32 sound; |
51 | 51 | ||
52 | path StartupDir; | 52 | path StartupDir; |
53 | stringw CurrentMapName; | 53 | stringw CurrentMapName; |
54 | array<path> CurrentArchiveList; | 54 | array<path> CurrentArchiveList; |
55 | 55 | ||
56 | vector3df PlayerPosition; | 56 | vector3df PlayerPosition; |
57 | vector3df PlayerRotation; | 57 | vector3df PlayerRotation; |
58 | 58 | ||
59 | tQ3EntityList Variable; | 59 | tQ3EntityList Variable; |
60 | 60 | ||
61 | Q3LevelLoadParameter loadParam; | 61 | Q3LevelLoadParameter loadParam; |
62 | SIrrlichtCreationParameters deviceParam; | 62 | SIrrlichtCreationParameters deviceParam; |
63 | funcptr_createDeviceEx createExDevice; | 63 | funcptr_createDeviceEx createExDevice; |
64 | IrrlichtDevice *Device; | 64 | IrrlichtDevice *Device; |
65 | }; | 65 | }; |
66 | 66 | ||
67 | /* | 67 | /* |
68 | set default settings | 68 | set default settings |
69 | */ | 69 | */ |
70 | void GameData::setDefault () | 70 | void GameData::setDefault () |
71 | { | 71 | { |
72 | debugState = EDS_OFF; | 72 | debugState = EDS_OFF; |
73 | gravityState = 1; | 73 | gravityState = 1; |
74 | flyTroughState = 0; | 74 | flyTroughState = 0; |
75 | wireFrame = 0; | 75 | wireFrame = 0; |
76 | guiActive = 1; | 76 | guiActive = 1; |
77 | guiInputActive = 0; | 77 | guiInputActive = 0; |
78 | GammaValue = 1.f; | 78 | GammaValue = 1.f; |
79 | 79 | ||
80 | // default deviceParam; | 80 | // default deviceParam; |
81 | #if defined ( _IRR_WINDOWS_ ) | 81 | #if defined ( _IRR_WINDOWS_ ) |
82 | deviceParam.DriverType = EDT_DIRECT3D9; | 82 | deviceParam.DriverType = EDT_DIRECT3D9; |
83 | #else | 83 | #else |
84 | deviceParam.DriverType = EDT_OPENGL; | 84 | deviceParam.DriverType = EDT_OPENGL; |
85 | #endif | 85 | #endif |
86 | deviceParam.WindowSize.Width = 800; | 86 | deviceParam.WindowSize.Width = 800; |
87 | deviceParam.WindowSize.Height = 600; | 87 | deviceParam.WindowSize.Height = 600; |
88 | deviceParam.Fullscreen = false; | 88 | deviceParam.Fullscreen = false; |
89 | deviceParam.Bits = 24; | 89 | deviceParam.Bits = 24; |
90 | deviceParam.ZBufferBits = 16; | 90 | deviceParam.ZBufferBits = 16; |
91 | deviceParam.Vsync = false; | 91 | deviceParam.Vsync = false; |
92 | deviceParam.AntiAlias = false; | 92 | deviceParam.AntiAlias = false; |
93 | 93 | ||
94 | // default Quake3 loadParam | 94 | // default Quake3 loadParam |
95 | loadParam.defaultLightMapMaterial = EMT_LIGHTMAP; | 95 | loadParam.defaultLightMapMaterial = EMT_LIGHTMAP; |
96 | loadParam.defaultModulate = EMFN_MODULATE_1X; | 96 | loadParam.defaultModulate = EMFN_MODULATE_1X; |
97 | loadParam.defaultFilter = EMF_ANISOTROPIC_FILTER; | 97 | loadParam.defaultFilter = EMF_ANISOTROPIC_FILTER; |
98 | loadParam.verbose = 2; | 98 | loadParam.verbose = 2; |
99 | loadParam.mergeShaderBuffer = 1; // merge meshbuffers with same material | 99 | loadParam.mergeShaderBuffer = 1; // merge meshbuffers with same material |
100 | loadParam.cleanUnResolvedMeshes = 1; // should unresolved meshes be cleaned. otherwise blue texture | 100 | loadParam.cleanUnResolvedMeshes = 1; // should unresolved meshes be cleaned. otherwise blue texture |
101 | loadParam.loadAllShaders = 1; // load all scripts in the script directory | 101 | loadParam.loadAllShaders = 1; // load all scripts in the script directory |
102 | loadParam.loadSkyShader = 0; // load sky Shader | 102 | loadParam.loadSkyShader = 0; // load sky Shader |
103 | loadParam.alpharef = 1; | 103 | loadParam.alpharef = 1; |
104 | 104 | ||
105 | sound = 0; | 105 | sound = 0; |
106 | 106 | ||
107 | CurrentMapName = ""; | 107 | CurrentMapName = ""; |
108 | CurrentArchiveList.clear (); | 108 | CurrentArchiveList.clear (); |
109 | 109 | ||
110 | // Explorer Media directory | 110 | // Explorer Media directory |
111 | CurrentArchiveList.push_back ( StartupDir + "../../media/" ); | 111 | CurrentArchiveList.push_back ( StartupDir + "../../media/" ); |
112 | 112 | ||
113 | // Add the original quake3 files before you load your custom map | 113 | // Add the original quake3 files before you load your custom map |
114 | // Most mods are using the original shaders, models&items&weapons | 114 | // Most mods are using the original shaders, models&items&weapons |
115 | CurrentArchiveList.push_back("/q/baseq3/"); | 115 | CurrentArchiveList.push_back("/q/baseq3/"); |
116 | 116 | ||
117 | CurrentArchiveList.push_back(StartupDir + "../../media/map-20kdm2.pk3"); | 117 | CurrentArchiveList.push_back(StartupDir + "../../media/map-20kdm2.pk3"); |
118 | } | 118 | } |
119 | 119 | ||
120 | /* | 120 | /* |
121 | Load the current game State from a typical quake3 cfg file | 121 | Load the current game State from a typical quake3 cfg file |
122 | */ | 122 | */ |
123 | s32 GameData::load ( const path &filename ) | 123 | s32 GameData::load ( const path &filename ) |
124 | { | 124 | { |
125 | if (!Device) | 125 | if (!Device) |
126 | return 0; | 126 | return 0; |
127 | 127 | ||
128 | // the quake3 mesh loader can also handle *.shader and *.cfg file | 128 | // the quake3 mesh loader can also handle *.shader and *.cfg file |
129 | IQ3LevelMesh* mesh = (IQ3LevelMesh*) Device->getSceneManager()->getMesh ( filename ); | 129 | IQ3LevelMesh* mesh = (IQ3LevelMesh*) Device->getSceneManager()->getMesh ( filename ); |
130 | if (!mesh) | 130 | if (!mesh) |
131 | return 0; | 131 | return 0; |
132 | 132 | ||
133 | tQ3EntityList &entityList = mesh->getEntityList (); | 133 | tQ3EntityList &entityList = mesh->getEntityList (); |
134 | 134 | ||
135 | stringc s; | 135 | stringc s; |
136 | u32 pos; | 136 | u32 pos; |
137 | 137 | ||
138 | for ( u32 e = 0; e != entityList.size (); ++e ) | 138 | for ( u32 e = 0; e != entityList.size (); ++e ) |
139 | { | 139 | { |
140 | //dumpShader ( s, &entityList[e], false ); | 140 | //dumpShader ( s, &entityList[e], false ); |
141 | //printf ( s.c_str () ); | 141 | //printf ( s.c_str () ); |
142 | 142 | ||
143 | for ( u32 g = 0; g != entityList[e].getGroupSize (); ++g ) | 143 | for ( u32 g = 0; g != entityList[e].getGroupSize (); ++g ) |
144 | { | 144 | { |
145 | const SVarGroup *group = entityList[e].getGroup ( g ); | 145 | const SVarGroup *group = entityList[e].getGroup ( g ); |
146 | 146 | ||
147 | for ( u32 index = 0; index < group->Variable.size (); ++index ) | 147 | for ( u32 index = 0; index < group->Variable.size (); ++index ) |
148 | { | 148 | { |
149 | const SVariable &v = group->Variable[index]; | 149 | const SVariable &v = group->Variable[index]; |
150 | pos = 0; | 150 | pos = 0; |
151 | if ( v.name == "playerposition" ) | 151 | if ( v.name == "playerposition" ) |
152 | { | 152 | { |
153 | PlayerPosition = getAsVector3df ( v.content, pos ); | 153 | PlayerPosition = getAsVector3df ( v.content, pos ); |
154 | } | 154 | } |
155 | else | 155 | else |
156 | if ( v.name == "playerrotation" ) | 156 | if ( v.name == "playerrotation" ) |
157 | { | 157 | { |
158 | PlayerRotation = getAsVector3df ( v.content, pos ); | 158 | PlayerRotation = getAsVector3df ( v.content, pos ); |
159 | } | 159 | } |
160 | } | 160 | } |
161 | } | 161 | } |
162 | } | 162 | } |
163 | 163 | ||
164 | return 1; | 164 | return 1; |
165 | } | 165 | } |
166 | 166 | ||
167 | /* | 167 | /* |
168 | Store the current game State in a quake3 configuration file | 168 | Store the current game State in a quake3 configuration file |
169 | */ | 169 | */ |
170 | s32 GameData::save ( const path &filename ) | 170 | s32 GameData::save ( const path &filename ) |
171 | { | 171 | { |
172 | return 0; | 172 | return 0; |
173 | if (!Device) | 173 | if (!Device) |
174 | return 0; | 174 | return 0; |
175 | 175 | ||
176 | c8 buf[128]; | 176 | c8 buf[128]; |
177 | u32 i; | 177 | u32 i; |
178 | 178 | ||
179 | // Store current Archive for restart | 179 | // Store current Archive for restart |
180 | CurrentArchiveList.clear(); | 180 | CurrentArchiveList.clear(); |
181 | IFileSystem *fs = Device->getFileSystem(); | 181 | IFileSystem *fs = Device->getFileSystem(); |
182 | for ( i = 0; i != fs->getFileArchiveCount(); ++i ) | 182 | for ( i = 0; i != fs->getFileArchiveCount(); ++i ) |
183 | { | 183 | { |
184 | CurrentArchiveList.push_back ( fs->getFileArchive(i)->getFileList()->getPath() ); | 184 | CurrentArchiveList.push_back ( fs->getFileArchive(i)->getFileList()->getPath() ); |
185 | } | 185 | } |
186 | 186 | ||
187 | // Store Player Position and Rotation | 187 | // Store Player Position and Rotation |
188 | ICameraSceneNode * camera = Device->getSceneManager()->getActiveCamera (); | 188 | ICameraSceneNode * camera = Device->getSceneManager()->getActiveCamera (); |
189 | if ( camera ) | 189 | if ( camera ) |
190 | { | 190 | { |
191 | PlayerPosition = camera->getPosition (); | 191 | PlayerPosition = camera->getPosition (); |
192 | PlayerRotation = camera->getRotation (); | 192 | PlayerRotation = camera->getRotation (); |
193 | } | 193 | } |
194 | 194 | ||
195 | IWriteFile *file = fs->createAndWriteFile ( filename ); | 195 | IWriteFile *file = fs->createAndWriteFile ( filename ); |
196 | if (!file) | 196 | if (!file) |
197 | return 0; | 197 | return 0; |
198 | 198 | ||
199 | snprintf ( buf, 128, "playerposition %.f %.f %.f\nplayerrotation %.f %.f %.f\n", | 199 | snprintf ( buf, 128, "playerposition %.f %.f %.f\nplayerrotation %.f %.f %.f\n", |
200 | PlayerPosition.X, PlayerPosition.Z, PlayerPosition.Y, | 200 | PlayerPosition.X, PlayerPosition.Z, PlayerPosition.Y, |
201 | PlayerRotation.X, PlayerRotation.Z, PlayerRotation.Y); | 201 | PlayerRotation.X, PlayerRotation.Z, PlayerRotation.Y); |
202 | file->write ( buf, (s32) strlen ( buf ) ); | 202 | file->write ( buf, (s32) strlen ( buf ) ); |
203 | for ( i = 0; i != fs->getFileArchiveCount(); ++i ) | 203 | for ( i = 0; i != fs->getFileArchiveCount(); ++i ) |
204 | { | 204 | { |
205 | snprintf ( buf, 128, "archive %s\n",stringc ( fs->getFileArchive(i)->getFileList()->getPath() ).c_str () ); | 205 | snprintf ( buf, 128, "archive %s\n",stringc ( fs->getFileArchive(i)->getFileList()->getPath() ).c_str () ); |
206 | file->write ( buf, (s32) strlen ( buf ) ); | 206 | file->write ( buf, (s32) strlen ( buf ) ); |
207 | } | 207 | } |
208 | 208 | ||
209 | file->drop (); | 209 | file->drop (); |
210 | return 1; | 210 | return 1; |
211 | } | 211 | } |
212 | 212 | ||
213 | /* | 213 | /* |
214 | Representing a player | 214 | Representing a player |
215 | */ | 215 | */ |
216 | struct Q3Player : public IAnimationEndCallBack | 216 | struct Q3Player : public IAnimationEndCallBack |
217 | { | 217 | { |
218 | Q3Player () | 218 | Q3Player () |
219 | : Device(0), MapParent(0), Mesh(0), WeaponNode(0), StartPositionCurrent(0) | 219 | : Device(0), MapParent(0), Mesh(0), WeaponNode(0), StartPositionCurrent(0) |
220 | { | 220 | { |
221 | animation[0] = 0; | 221 | animation[0] = 0; |
222 | memset(Anim, 0, sizeof(TimeFire)*4); | 222 | memset(Anim, 0, sizeof(TimeFire)*4); |
223 | } | 223 | } |
224 | 224 | ||
225 | virtual void OnAnimationEnd(IAnimatedMeshSceneNode* node); | 225 | virtual void OnAnimationEnd(IAnimatedMeshSceneNode* node); |
226 | 226 | ||
227 | void create ( IrrlichtDevice *device, | 227 | void create ( IrrlichtDevice *device, |
228 | IQ3LevelMesh* mesh, | 228 | IQ3LevelMesh* mesh, |
229 | ISceneNode *mapNode, | 229 | ISceneNode *mapNode, |
230 | IMetaTriangleSelector *meta | 230 | IMetaTriangleSelector *meta |
231 | ); | 231 | ); |
232 | void shutdown (); | 232 | void shutdown (); |
233 | void setAnim ( const c8 *name ); | 233 | void setAnim ( const c8 *name ); |
234 | void respawn (); | 234 | void respawn (); |
235 | void setpos ( const vector3df &pos, const vector3df& rotation ); | 235 | void setpos ( const vector3df &pos, const vector3df& rotation ); |
236 | 236 | ||
237 | ISceneNodeAnimatorCollisionResponse * cam() { return camCollisionResponse ( Device ); } | 237 | ISceneNodeAnimatorCollisionResponse * cam() { return camCollisionResponse ( Device ); } |
238 | 238 | ||
239 | IrrlichtDevice *Device; | 239 | IrrlichtDevice *Device; |
240 | ISceneNode* MapParent; | 240 | ISceneNode* MapParent; |
241 | IQ3LevelMesh* Mesh; | 241 | IQ3LevelMesh* Mesh; |
242 | IAnimatedMeshSceneNode* WeaponNode; | 242 | IAnimatedMeshSceneNode* WeaponNode; |
243 | s32 StartPositionCurrent; | 243 | s32 StartPositionCurrent; |
244 | TimeFire Anim[4]; | 244 | TimeFire Anim[4]; |
245 | c8 animation[64]; | 245 | c8 animation[64]; |
246 | c8 buf[64]; | 246 | c8 buf[64]; |
247 | }; | 247 | }; |
248 | 248 | ||
249 | 249 | ||
250 | /* End player | 250 | /* End player |
251 | */ | 251 | */ |
252 | void Q3Player::shutdown () | 252 | void Q3Player::shutdown () |
253 | { | 253 | { |
254 | setAnim ( 0 ); | 254 | setAnim ( 0 ); |
255 | 255 | ||
256 | dropElement (WeaponNode); | 256 | dropElement (WeaponNode); |
257 | 257 | ||
258 | if ( Device ) | 258 | if ( Device ) |
259 | { | 259 | { |
260 | ICameraSceneNode* camera = Device->getSceneManager()->getActiveCamera(); | 260 | ICameraSceneNode* camera = Device->getSceneManager()->getActiveCamera(); |
261 | dropElement ( camera ); | 261 | dropElement ( camera ); |
262 | Device = 0; | 262 | Device = 0; |
263 | } | 263 | } |
264 | 264 | ||
265 | MapParent = 0; | 265 | MapParent = 0; |
266 | Mesh = 0; | 266 | Mesh = 0; |
267 | } | 267 | } |
268 | 268 | ||
269 | 269 | ||
270 | /* create a new player | 270 | /* create a new player |
271 | */ | 271 | */ |
272 | void Q3Player::create ( IrrlichtDevice *device, IQ3LevelMesh* mesh, ISceneNode *mapNode, IMetaTriangleSelector *meta ) | 272 | void Q3Player::create ( IrrlichtDevice *device, IQ3LevelMesh* mesh, ISceneNode *mapNode, IMetaTriangleSelector *meta ) |
273 | { | 273 | { |
274 | setTimeFire ( Anim + 0, 200, FIRED ); | 274 | setTimeFire ( Anim + 0, 200, FIRED ); |
275 | setTimeFire ( Anim + 1, 5000 ); | 275 | setTimeFire ( Anim + 1, 5000 ); |
276 | 276 | ||
277 | if (!device) | 277 | if (!device) |
278 | return; | 278 | return; |
279 | // load FPS weapon to Camera | 279 | // load FPS weapon to Camera |
280 | Device = device; | 280 | Device = device; |
281 | Mesh = mesh; | 281 | Mesh = mesh; |
282 | MapParent = mapNode; | 282 | MapParent = mapNode; |
283 | 283 | ||
284 | ISceneManager *smgr = device->getSceneManager (); | 284 | ISceneManager *smgr = device->getSceneManager (); |
285 | IVideoDriver * driver = device->getVideoDriver(); | 285 | IVideoDriver * driver = device->getVideoDriver(); |
286 | 286 | ||
287 | ICameraSceneNode* camera = 0; | 287 | ICameraSceneNode* camera = 0; |
288 | 288 | ||
289 | SKeyMap keyMap[10]; | 289 | SKeyMap keyMap[10]; |
290 | keyMap[0].Action = EKA_MOVE_FORWARD; | 290 | keyMap[0].Action = EKA_MOVE_FORWARD; |
291 | keyMap[0].KeyCode = KEY_UP; | 291 | keyMap[0].KeyCode = KEY_UP; |
292 | keyMap[1].Action = EKA_MOVE_FORWARD; | 292 | keyMap[1].Action = EKA_MOVE_FORWARD; |
293 | keyMap[1].KeyCode = KEY_KEY_W; | 293 | keyMap[1].KeyCode = KEY_KEY_W; |
294 | 294 | ||
295 | keyMap[2].Action = EKA_MOVE_BACKWARD; | 295 | keyMap[2].Action = EKA_MOVE_BACKWARD; |
296 | keyMap[2].KeyCode = KEY_DOWN; | 296 | keyMap[2].KeyCode = KEY_DOWN; |
297 | keyMap[3].Action = EKA_MOVE_BACKWARD; | 297 | keyMap[3].Action = EKA_MOVE_BACKWARD; |
298 | keyMap[3].KeyCode = KEY_KEY_S; | 298 | keyMap[3].KeyCode = KEY_KEY_S; |
299 | 299 | ||
300 | keyMap[4].Action = EKA_STRAFE_LEFT; | 300 | keyMap[4].Action = EKA_STRAFE_LEFT; |
301 | keyMap[4].KeyCode = KEY_LEFT; | 301 | keyMap[4].KeyCode = KEY_LEFT; |
302 | keyMap[5].Action = EKA_STRAFE_LEFT; | 302 | keyMap[5].Action = EKA_STRAFE_LEFT; |
303 | keyMap[5].KeyCode = KEY_KEY_A; | 303 | keyMap[5].KeyCode = KEY_KEY_A; |
304 | 304 | ||
305 | keyMap[6].Action = EKA_STRAFE_RIGHT; | 305 | keyMap[6].Action = EKA_STRAFE_RIGHT; |
306 | keyMap[6].KeyCode = KEY_RIGHT; | 306 | keyMap[6].KeyCode = KEY_RIGHT; |
307 | keyMap[7].Action = EKA_STRAFE_RIGHT; | 307 | keyMap[7].Action = EKA_STRAFE_RIGHT; |
308 | keyMap[7].KeyCode = KEY_KEY_D; | 308 | keyMap[7].KeyCode = KEY_KEY_D; |
309 | 309 | ||
310 | keyMap[8].Action = EKA_JUMP_UP; | 310 | keyMap[8].Action = EKA_JUMP_UP; |
311 | keyMap[8].KeyCode = KEY_KEY_J; | 311 | keyMap[8].KeyCode = KEY_KEY_J; |
312 | 312 | ||
313 | keyMap[9].Action = EKA_CROUCH; | 313 | keyMap[9].Action = EKA_CROUCH; |
314 | keyMap[9].KeyCode = KEY_KEY_C; | 314 | keyMap[9].KeyCode = KEY_KEY_C; |
315 | 315 | ||
316 | camera = smgr->addCameraSceneNodeFPS(0, 100.0f, 0.6f, -1, keyMap, 10, false, 0.6f); | 316 | camera = smgr->addCameraSceneNodeFPS(0, 100.0f, 0.6f, -1, keyMap, 10, false, 0.6f); |
317 | camera->setName ( "First Person Camera" ); | 317 | camera->setName ( "First Person Camera" ); |
318 | //camera->setFOV ( 100.f * core::DEGTORAD ); | 318 | //camera->setFOV ( 100.f * core::DEGTORAD ); |
319 | camera->setFarValue( 20000.f ); | 319 | camera->setFarValue( 20000.f ); |
320 | 320 | ||
321 | IAnimatedMeshMD2* weaponMesh = (IAnimatedMeshMD2*) smgr->getMesh("gun.md2"); | 321 | IAnimatedMeshMD2* weaponMesh = (IAnimatedMeshMD2*) smgr->getMesh("gun.md2"); |
322 | if ( 0 == weaponMesh ) | 322 | if ( 0 == weaponMesh ) |
323 | return; | 323 | return; |
324 | 324 | ||
325 | if ( weaponMesh->getMeshType() == EAMT_MD2 ) | 325 | if ( weaponMesh->getMeshType() == EAMT_MD2 ) |
326 | { | 326 | { |
327 | s32 count = weaponMesh->getAnimationCount(); | 327 | s32 count = weaponMesh->getAnimationCount(); |
328 | for ( s32 i = 0; i != count; ++i ) | 328 | for ( s32 i = 0; i != count; ++i ) |
329 | { | 329 | { |
330 | snprintf ( buf, 64, "Animation: %s", weaponMesh->getAnimationName(i) ); | 330 | snprintf ( buf, 64, "Animation: %s", weaponMesh->getAnimationName(i) ); |
331 | device->getLogger()->log(buf, ELL_INFORMATION); | 331 | device->getLogger()->log(buf, ELL_INFORMATION); |
332 | } | 332 | } |
333 | } | 333 | } |
334 | 334 | ||
335 | WeaponNode = smgr->addAnimatedMeshSceneNode( | 335 | WeaponNode = smgr->addAnimatedMeshSceneNode( |
336 | weaponMesh, | 336 | weaponMesh, |
337 | smgr->getActiveCamera(), | 337 | smgr->getActiveCamera(), |
338 | 10, | 338 | 10, |
339 | vector3df( 0, 0, 0), | 339 | vector3df( 0, 0, 0), |
340 | vector3df(-90,-90,90) | 340 | vector3df(-90,-90,90) |
341 | ); | 341 | ); |
342 | WeaponNode->setMaterialFlag(EMF_LIGHTING, false); | 342 | WeaponNode->setMaterialFlag(EMF_LIGHTING, false); |
343 | WeaponNode->setMaterialTexture(0, driver->getTexture( "gun.jpg")); | 343 | WeaponNode->setMaterialTexture(0, driver->getTexture( "gun.jpg")); |
344 | WeaponNode->setLoopMode ( false ); | 344 | WeaponNode->setLoopMode ( false ); |
345 | WeaponNode->setName ( "tommi the gun man" ); | 345 | WeaponNode->setName ( "tommi the gun man" ); |
346 | 346 | ||
347 | //create a collision auto response animator | 347 | //create a collision auto response animator |
348 | ISceneNodeAnimator* anim = | 348 | ISceneNodeAnimator* anim = |
349 | smgr->createCollisionResponseAnimator( meta, camera, | 349 | smgr->createCollisionResponseAnimator( meta, camera, |
350 | vector3df(30,45,30), | 350 | vector3df(30,45,30), |
351 | getGravity ( "earth" ), | 351 | getGravity ( "earth" ), |
352 | vector3df(0,40,0), | 352 | vector3df(0,40,0), |
353 | 0.0005f | 353 | 0.0005f |
354 | ); | 354 | ); |
355 | 355 | ||
356 | camera->addAnimator( anim ); | 356 | camera->addAnimator( anim ); |
357 | anim->drop(); | 357 | anim->drop(); |
358 | 358 | ||
359 | if ( meta ) | 359 | if ( meta ) |
360 | { | 360 | { |
361 | meta->drop (); | 361 | meta->drop (); |
362 | } | 362 | } |
363 | 363 | ||
364 | respawn (); | 364 | respawn (); |
365 | setAnim ( "idle" ); | 365 | setAnim ( "idle" ); |
366 | } | 366 | } |
367 | 367 | ||
368 | 368 | ||
369 | /* | 369 | /* |
370 | so we need a good starting Position in the level. | 370 | so we need a good starting Position in the level. |
371 | we can ask the Quake3 Loader for all entities with class_name "info_player_deathmatch" | 371 | we can ask the Quake3 Loader for all entities with class_name "info_player_deathmatch" |
372 | */ | 372 | */ |
373 | void Q3Player::respawn () | 373 | void Q3Player::respawn () |
374 | { | 374 | { |
375 | if (!Device) | 375 | if (!Device) |
376 | return; | 376 | return; |
377 | ICameraSceneNode* camera = Device->getSceneManager()->getActiveCamera(); | 377 | ICameraSceneNode* camera = Device->getSceneManager()->getActiveCamera(); |
378 | 378 | ||
379 | Device->getLogger()->log( "respawn" ); | 379 | Device->getLogger()->log( "respawn" ); |
380 | 380 | ||
381 | if ( StartPositionCurrent >= Q3StartPosition ( | 381 | if ( StartPositionCurrent >= Q3StartPosition ( |
382 | Mesh, camera,StartPositionCurrent++, | 382 | Mesh, camera,StartPositionCurrent++, |
383 | cam ()->getEllipsoidTranslation() ) | 383 | cam ()->getEllipsoidTranslation() ) |
384 | ) | 384 | ) |
385 | { | 385 | { |
386 | StartPositionCurrent = 0; | 386 | StartPositionCurrent = 0; |
387 | } | 387 | } |
388 | } | 388 | } |
389 | 389 | ||
390 | /* | 390 | /* |
391 | set Player position from saved coordinates | 391 | set Player position from saved coordinates |
392 | */ | 392 | */ |
393 | void Q3Player::setpos ( const vector3df &pos, const vector3df &rotation ) | 393 | void Q3Player::setpos ( const vector3df &pos, const vector3df &rotation ) |
394 | { | 394 | { |
395 | if (!Device) | 395 | if (!Device) |
396 | return; | 396 | return; |
397 | Device->getLogger()->log( "setpos" ); | 397 | Device->getLogger()->log( "setpos" ); |
398 | 398 | ||
399 | ICameraSceneNode* camera = Device->getSceneManager()->getActiveCamera(); | 399 | ICameraSceneNode* camera = Device->getSceneManager()->getActiveCamera(); |
400 | if ( camera ) | 400 | if ( camera ) |
401 | { | 401 | { |
402 | camera->setPosition ( pos ); | 402 | camera->setPosition ( pos ); |
403 | camera->setRotation ( rotation ); | 403 | camera->setRotation ( rotation ); |
404 | //! New. FPSCamera and animators catches reset on animate 0 | 404 | //! New. FPSCamera and animators catches reset on animate 0 |
405 | camera->OnAnimate ( 0 ); | 405 | camera->OnAnimate ( 0 ); |
406 | } | 406 | } |
407 | } | 407 | } |
408 | 408 | ||
409 | /* set the Animation of the player and weapon | 409 | /* set the Animation of the player and weapon |
410 | */ | 410 | */ |
411 | void Q3Player::setAnim ( const c8 *name ) | 411 | void Q3Player::setAnim ( const c8 *name ) |
412 | { | 412 | { |
413 | if ( name ) | 413 | if ( name ) |
414 | { | 414 | { |
415 | snprintf ( animation, 64, "%s", name ); | 415 | snprintf ( animation, 64, "%s", name ); |
416 | if ( WeaponNode ) | 416 | if ( WeaponNode ) |
417 | { | 417 | { |
418 | WeaponNode->setAnimationEndCallback ( this ); | 418 | WeaponNode->setAnimationEndCallback ( this ); |
419 | WeaponNode->setMD2Animation ( animation ); | 419 | WeaponNode->setMD2Animation ( animation ); |
420 | } | 420 | } |
421 | } | 421 | } |
422 | else | 422 | else |
423 | { | 423 | { |
424 | animation[0] = 0; | 424 | animation[0] = 0; |
425 | if ( WeaponNode ) | 425 | if ( WeaponNode ) |
426 | { | 426 | { |
427 | WeaponNode->setAnimationEndCallback ( 0 ); | 427 | WeaponNode->setAnimationEndCallback ( 0 ); |
428 | } | 428 | } |
429 | } | 429 | } |
430 | } | 430 | } |
431 | 431 | ||
432 | 432 | ||
433 | // Callback | 433 | // Callback |
434 | void Q3Player::OnAnimationEnd(IAnimatedMeshSceneNode* node) | 434 | void Q3Player::OnAnimationEnd(IAnimatedMeshSceneNode* node) |
435 | { | 435 | { |
436 | setAnim ( 0 ); | 436 | setAnim ( 0 ); |
437 | } | 437 | } |
438 | 438 | ||
439 | 439 | ||
440 | 440 | ||
441 | /* GUI Elements | 441 | /* GUI Elements |
442 | */ | 442 | */ |
443 | struct GUI | 443 | struct GUI |
444 | { | 444 | { |
445 | GUI () | 445 | GUI () |
446 | { | 446 | { |
447 | memset ( this, 0, sizeof ( *this ) ); | 447 | memset ( this, 0, sizeof ( *this ) ); |
448 | } | 448 | } |
449 | 449 | ||
450 | void drop() | 450 | void drop() |
451 | { | 451 | { |
452 | dropElement ( Window ); | 452 | dropElement ( Window ); |
453 | dropElement ( Logo ); | 453 | dropElement ( Logo ); |
454 | } | 454 | } |
455 | 455 | ||
456 | IGUIComboBox* VideoDriver; | 456 | IGUIComboBox* VideoDriver; |
457 | IGUIComboBox* VideoMode; | 457 | IGUIComboBox* VideoMode; |
458 | IGUICheckBox* FullScreen; | 458 | IGUICheckBox* FullScreen; |
459 | IGUICheckBox* Bit32; | 459 | IGUICheckBox* Bit32; |
460 | IGUIScrollBar* MultiSample; | 460 | IGUIScrollBar* MultiSample; |
461 | IGUIButton* SetVideoMode; | 461 | IGUIButton* SetVideoMode; |
462 | 462 | ||
463 | IGUIScrollBar* Tesselation; | 463 | IGUIScrollBar* Tesselation; |
464 | IGUIScrollBar* Gamma; | 464 | IGUIScrollBar* Gamma; |
465 | IGUICheckBox* Collision; | 465 | IGUICheckBox* Collision; |
466 | IGUICheckBox* Visible_Map; | 466 | IGUICheckBox* Visible_Map; |
467 | IGUICheckBox* Visible_Shader; | 467 | IGUICheckBox* Visible_Shader; |
468 | IGUICheckBox* Visible_Fog; | 468 | IGUICheckBox* Visible_Fog; |
469 | IGUICheckBox* Visible_Unresolved; | 469 | IGUICheckBox* Visible_Unresolved; |
470 | IGUICheckBox* Visible_Skydome; | 470 | IGUICheckBox* Visible_Skydome; |
471 | IGUIButton* Respawn; | 471 | IGUIButton* Respawn; |
472 | 472 | ||
473 | IGUITable* ArchiveList; | 473 | IGUITable* ArchiveList; |
474 | IGUIButton* ArchiveAdd; | 474 | IGUIButton* ArchiveAdd; |
475 | IGUIButton* ArchiveRemove; | 475 | IGUIButton* ArchiveRemove; |
476 | IGUIFileOpenDialog* ArchiveFileOpen; | 476 | IGUIFileOpenDialog* ArchiveFileOpen; |
477 | IGUIButton* ArchiveUp; | 477 | IGUIButton* ArchiveUp; |
478 | IGUIButton* ArchiveDown; | 478 | IGUIButton* ArchiveDown; |
479 | 479 | ||
480 | IGUIListBox* MapList; | 480 | IGUIListBox* MapList; |
481 | IGUITreeView* SceneTree; | 481 | IGUITreeView* SceneTree; |
482 | IGUIStaticText* StatusLine; | 482 | IGUIStaticText* StatusLine; |
483 | IGUIImage* Logo; | 483 | IGUIImage* Logo; |
484 | IGUIWindow* Window; | 484 | IGUIWindow* Window; |
485 | }; | 485 | }; |
486 | 486 | ||
487 | 487 | ||
488 | /* | 488 | /* |
489 | CQuake3EventHandler controls the game | 489 | CQuake3EventHandler controls the game |
490 | */ | 490 | */ |
491 | class CQuake3EventHandler : public IEventReceiver | 491 | class CQuake3EventHandler : public IEventReceiver |
492 | { | 492 | { |
493 | public: | 493 | public: |
494 | 494 | ||
495 | CQuake3EventHandler( GameData *gameData ); | 495 | CQuake3EventHandler( GameData *gameData ); |
496 | virtual ~CQuake3EventHandler (); | 496 | virtual ~CQuake3EventHandler (); |
497 | 497 | ||
498 | void Animate(); | 498 | void Animate(); |
499 | void Render(); | 499 | void Render(); |
500 | 500 | ||
501 | void AddArchive ( const path& archiveName ); | 501 | void AddArchive ( const path& archiveName ); |
502 | void LoadMap ( const stringw& mapName, s32 collision ); | 502 | void LoadMap ( const stringw& mapName, s32 collision ); |
503 | void CreatePlayers(); | 503 | void CreatePlayers(); |
504 | void AddSky( u32 dome, const c8 *texture ); | 504 | void AddSky( u32 dome, const c8 *texture ); |
505 | Q3Player *GetPlayer ( u32 index ) { return &Player[index]; } | 505 | Q3Player *GetPlayer ( u32 index ) { return &Player[index]; } |
506 | 506 | ||
507 | void CreateGUI(); | 507 | void CreateGUI(); |
508 | void SetGUIActive( s32 command); | 508 | void SetGUIActive( s32 command); |
509 | 509 | ||
510 | bool OnEvent(const SEvent& eve); | 510 | bool OnEvent(const SEvent& eve); |
511 | 511 | ||
512 | 512 | ||
513 | private: | 513 | private: |
514 | 514 | ||
515 | GameData *Game; | 515 | GameData *Game; |
516 | 516 | ||
517 | IQ3LevelMesh* Mesh; | 517 | IQ3LevelMesh* Mesh; |
518 | ISceneNode* MapParent; | 518 | ISceneNode* MapParent; |
519 | ISceneNode* ShaderParent; | 519 | ISceneNode* ShaderParent; |
520 | ISceneNode* ItemParent; | 520 | ISceneNode* ItemParent; |
521 | ISceneNode* UnresolvedParent; | 521 | ISceneNode* UnresolvedParent; |
522 | ISceneNode* BulletParent; | 522 | ISceneNode* BulletParent; |
523 | ISceneNode* FogParent; | 523 | ISceneNode* FogParent; |
524 | ISceneNode * SkyNode; | 524 | ISceneNode * SkyNode; |
525 | IMetaTriangleSelector *Meta; | 525 | IMetaTriangleSelector *Meta; |
526 | 526 | ||
527 | c8 buf[256]; | 527 | c8 buf[256]; |
528 | 528 | ||
529 | Q3Player Player[2]; | 529 | Q3Player Player[2]; |
530 | 530 | ||
531 | struct SParticleImpact | 531 | struct SParticleImpact |
532 | { | 532 | { |
533 | u32 when; | 533 | u32 when; |
534 | vector3df pos; | 534 | vector3df pos; |
535 | vector3df outVector; | 535 | vector3df outVector; |
536 | }; | 536 | }; |
537 | array<SParticleImpact> Impacts; | 537 | array<SParticleImpact> Impacts; |
538 | void useItem( Q3Player * player); | 538 | void useItem( Q3Player * player); |
539 | void createParticleImpacts( u32 now ); | 539 | void createParticleImpacts( u32 now ); |
540 | 540 | ||
541 | void createTextures (); | 541 | void createTextures (); |
542 | void addSceneTreeItem( ISceneNode * parent, IGUITreeViewNode* nodeParent); | 542 | void addSceneTreeItem( ISceneNode * parent, IGUITreeViewNode* nodeParent); |
543 | 543 | ||
544 | GUI gui; | 544 | GUI gui; |
545 | void dropMap (); | 545 | void dropMap (); |
546 | }; | 546 | }; |
547 | 547 | ||
548 | /* Constructor | 548 | /* Constructor |
549 | */ | 549 | */ |
550 | CQuake3EventHandler::CQuake3EventHandler( GameData *game ) | 550 | CQuake3EventHandler::CQuake3EventHandler( GameData *game ) |
551 | : Game(game), Mesh(0), MapParent(0), ShaderParent(0), ItemParent(0), UnresolvedParent(0), | 551 | : Game(game), Mesh(0), MapParent(0), ShaderParent(0), ItemParent(0), UnresolvedParent(0), |
552 | BulletParent(0), FogParent(0), SkyNode(0), Meta(0) | 552 | BulletParent(0), FogParent(0), SkyNode(0), Meta(0) |
553 | { | 553 | { |
554 | buf[0]=0; | 554 | buf[0]=0; |
555 | // Also use 16 Bit Textures for 16 Bit RenderDevice | 555 | // Also use 16 Bit Textures for 16 Bit RenderDevice |
556 | if ( Game->deviceParam.Bits == 16 ) | 556 | if ( Game->deviceParam.Bits == 16 ) |
557 | { | 557 | { |
558 | game->Device->getVideoDriver()->setTextureCreationFlag(ETCF_ALWAYS_16_BIT, true); | 558 | game->Device->getVideoDriver()->setTextureCreationFlag(ETCF_ALWAYS_16_BIT, true); |
559 | } | 559 | } |
560 | 560 | ||
561 | // Quake3 Shader controls Z-Writing | 561 | // Quake3 Shader controls Z-Writing |
562 | game->Device->getSceneManager()->getParameters()->setAttribute(scene::ALLOW_ZWRITE_ON_TRANSPARENT, true); | 562 | game->Device->getSceneManager()->getParameters()->setAttribute(scene::ALLOW_ZWRITE_ON_TRANSPARENT, true); |
563 | 563 | ||
564 | // create internal textures | 564 | // create internal textures |
565 | createTextures (); | 565 | createTextures (); |
566 | 566 | ||
567 | sound_init ( game->Device ); | 567 | sound_init ( game->Device ); |
568 | 568 | ||
569 | Game->Device->setEventReceiver ( this ); | 569 | Game->Device->setEventReceiver ( this ); |
570 | } | 570 | } |
571 | 571 | ||
572 | 572 | ||
573 | // destructor | 573 | // destructor |
574 | CQuake3EventHandler::~CQuake3EventHandler () | 574 | CQuake3EventHandler::~CQuake3EventHandler () |
575 | { | 575 | { |
576 | Player[0].shutdown (); | 576 | Player[0].shutdown (); |
577 | sound_shutdown (); | 577 | sound_shutdown (); |
578 | 578 | ||
579 | Game->save( "explorer.cfg" ); | 579 | Game->save( "explorer.cfg" ); |
580 | 580 | ||
581 | Game->Device->drop(); | 581 | Game->Device->drop(); |
582 | } | 582 | } |
583 | 583 | ||
584 | 584 | ||
585 | // create runtime textures smog, fog | 585 | // create runtime textures smog, fog |
586 | void CQuake3EventHandler::createTextures() | 586 | void CQuake3EventHandler::createTextures() |
587 | { | 587 | { |
588 | IVideoDriver * driver = Game->Device->getVideoDriver(); | 588 | IVideoDriver * driver = Game->Device->getVideoDriver(); |
589 | 589 | ||
590 | dimension2du dim(64, 64); | 590 | dimension2du dim(64, 64); |
591 | 591 | ||
592 | video::IImage* image; | 592 | video::IImage* image; |
593 | u32 i; | 593 | u32 i; |
594 | u32 x; | 594 | u32 x; |
595 | u32 y; | 595 | u32 y; |
596 | u32 * data; | 596 | u32 * data; |
597 | for ( i = 0; i != 8; ++i ) | 597 | for ( i = 0; i != 8; ++i ) |
598 | { | 598 | { |
599 | image = driver->createImage ( video::ECF_A8R8G8B8, dim); | 599 | image = driver->createImage ( video::ECF_A8R8G8B8, dim); |
600 | data = (u32*) image->lock (); | 600 | data = (u32*) image->lock (); |
601 | for ( y = 0; y != dim.Height; ++y ) | 601 | for ( y = 0; y != dim.Height; ++y ) |
602 | { | 602 | { |
603 | for ( x = 0; x != dim.Width; ++x ) | 603 | for ( x = 0; x != dim.Width; ++x ) |
604 | { | 604 | { |
605 | data [x] = 0xFFFFFFFF; | 605 | data [x] = 0xFFFFFFFF; |
606 | } | 606 | } |
607 | data = (u32*) ( (u8*) data + image->getPitch() ); | 607 | data = (u32*) ( (u8*) data + image->getPitch() ); |
608 | } | 608 | } |
609 | image->unlock(); | 609 | image->unlock(); |
610 | snprintf ( buf, 64, "smoke_%02d", i ); | 610 | snprintf ( buf, 64, "smoke_%02d", i ); |
611 | driver->addTexture( buf, image ); | 611 | driver->addTexture( buf, image ); |
612 | image->drop (); | 612 | image->drop (); |
613 | } | 613 | } |
614 | 614 | ||
615 | // fog | 615 | // fog |
616 | for ( i = 0; i != 1; ++i ) | 616 | for ( i = 0; i != 1; ++i ) |
617 | { | 617 | { |
618 | image = driver->createImage ( video::ECF_A8R8G8B8, dim); | 618 | image = driver->createImage ( video::ECF_A8R8G8B8, dim); |
619 | data = (u32*) image->lock (); | 619 | data = (u32*) image->lock (); |
620 | for ( y = 0; y != dim.Height; ++y ) | 620 | for ( y = 0; y != dim.Height; ++y ) |
621 | { | 621 | { |
622 | for ( x = 0; x != dim.Width; ++x ) | 622 | for ( x = 0; x != dim.Width; ++x ) |
623 | { | 623 | { |
624 | data [x] = 0xFFFFFFFF; | 624 | data [x] = 0xFFFFFFFF; |
625 | } | 625 | } |
626 | data = (u32*) ( (u8*) data + image->getPitch() ); | 626 | data = (u32*) ( (u8*) data + image->getPitch() ); |
627 | } | 627 | } |
628 | image->unlock(); | 628 | image->unlock(); |
629 | snprintf ( buf, 64, "fog_%02d", i ); | 629 | snprintf ( buf, 64, "fog_%02d", i ); |
630 | driver->addTexture( buf, image ); | 630 | driver->addTexture( buf, image ); |
631 | image->drop (); | 631 | image->drop (); |
632 | } | 632 | } |
633 | } | 633 | } |
634 | 634 | ||
635 | 635 | ||
636 | /* | 636 | /* |
637 | create the GUI | 637 | create the GUI |
638 | */ | 638 | */ |
639 | void CQuake3EventHandler::CreateGUI() | 639 | void CQuake3EventHandler::CreateGUI() |
640 | { | 640 | { |
641 | 641 | ||
642 | IGUIEnvironment *env = Game->Device->getGUIEnvironment(); | 642 | IGUIEnvironment *env = Game->Device->getGUIEnvironment(); |
643 | IVideoDriver * driver = Game->Device->getVideoDriver(); | 643 | IVideoDriver * driver = Game->Device->getVideoDriver(); |
644 | 644 | ||
645 | gui.drop(); | 645 | gui.drop(); |
646 | 646 | ||
647 | // set skin font | 647 | // set skin font |
648 | IGUIFont* font = env->getFont("fontlucida.png"); | 648 | IGUIFont* font = env->getFont("fontlucida.png"); |
649 | if (font) | 649 | if (font) |
650 | env->getSkin()->setFont(font); | 650 | env->getSkin()->setFont(font); |
651 | env->getSkin()->setColor ( EGDC_BUTTON_TEXT, video::SColor(240,0xAA,0xAA,0xAA) ); | 651 | env->getSkin()->setColor ( EGDC_BUTTON_TEXT, video::SColor(240,0xAA,0xAA,0xAA) ); |
652 | env->getSkin()->setColor ( EGDC_3D_HIGH_LIGHT, video::SColor(240,0x22,0x22,0x22) ); | 652 | env->getSkin()->setColor ( EGDC_3D_HIGH_LIGHT, video::SColor(240,0x22,0x22,0x22) ); |
653 | env->getSkin()->setColor ( EGDC_3D_FACE, video::SColor(240,0x44,0x44,0x44) ); | 653 | env->getSkin()->setColor ( EGDC_3D_FACE, video::SColor(240,0x44,0x44,0x44) ); |
654 | env->getSkin()->setColor ( EGDC_EDITABLE, video::SColor(240,0x44,0x44,0x44) ); | 654 | env->getSkin()->setColor ( EGDC_EDITABLE, video::SColor(240,0x44,0x44,0x44) ); |
655 | env->getSkin()->setColor ( EGDC_FOCUSED_EDITABLE, video::SColor(240,0x54,0x54,0x54) ); | 655 | env->getSkin()->setColor ( EGDC_FOCUSED_EDITABLE, video::SColor(240,0x54,0x54,0x54) ); |
656 | env->getSkin()->setColor ( EGDC_WINDOW, video::SColor(240,0x66,0x66,0x66) ); | 656 | env->getSkin()->setColor ( EGDC_WINDOW, video::SColor(240,0x66,0x66,0x66) ); |
657 | 657 | ||
658 | // minimal gui size 800x600 | 658 | // minimal gui size 800x600 |
659 | dimension2d<u32> dim ( 800, 600 ); | 659 | dimension2d<u32> dim ( 800, 600 ); |
660 | dimension2d<u32> vdim ( Game->Device->getVideoDriver()->getScreenSize() ); | 660 | dimension2d<u32> vdim ( Game->Device->getVideoDriver()->getScreenSize() ); |
661 | 661 | ||
662 | if ( vdim.Height >= dim.Height && vdim.Width >= dim.Width ) | 662 | if ( vdim.Height >= dim.Height && vdim.Width >= dim.Width ) |
663 | { | 663 | { |
664 | //dim = vdim; | 664 | //dim = vdim; |
665 | } | 665 | } |
666 | else | 666 | else |
667 | { | 667 | { |
668 | } | 668 | } |
669 | 669 | ||
670 | gui.Window = env->addWindow ( rect<s32> ( 0, 0, dim.Width, dim.Height ), false, L"Quake3 Explorer" ); | 670 | gui.Window = env->addWindow ( rect<s32> ( 0, 0, dim.Width, dim.Height ), false, L"Quake3 Explorer" ); |
671 | gui.Window->setToolTipText ( L"Quake3Explorer. Loads and show various BSP File Format and Shaders." ); | 671 | gui.Window->setToolTipText ( L"Quake3Explorer. Loads and show various BSP File Format and Shaders." ); |
672 | gui.Window->getCloseButton()->setToolTipText ( L"Quit Quake3 Explorer" ); | 672 | gui.Window->getCloseButton()->setToolTipText ( L"Quit Quake3 Explorer" ); |
673 | 673 | ||
674 | // add a status line help text | 674 | // add a status line help text |
675 | gui.StatusLine = env->addStaticText( 0, rect<s32>( 5,dim.Height - 30,dim.Width - 5,dim.Height - 10), | 675 | gui.StatusLine = env->addStaticText( 0, rect<s32>( 5,dim.Height - 30,dim.Width - 5,dim.Height - 10), |
676 | false, false, gui.Window, -1, true | 676 | false, false, gui.Window, -1, true |
677 | ); | 677 | ); |
678 | 678 | ||
679 | 679 | ||
680 | env->addStaticText ( L"VideoDriver:", rect<s32>( dim.Width - 400, 24, dim.Width - 310, 40 ),false, false, gui.Window, -1, false ); | 680 | env->addStaticText ( L"VideoDriver:", rect<s32>( dim.Width - 400, 24, dim.Width - 310, 40 ),false, false, gui.Window, -1, false ); |
681 | gui.VideoDriver = env->addComboBox(rect<s32>( dim.Width - 300, 24, dim.Width - 10, 40 ),gui.Window); | 681 | gui.VideoDriver = env->addComboBox(rect<s32>( dim.Width - 300, 24, dim.Width - 10, 40 ),gui.Window); |
682 | gui.VideoDriver->addItem(L"Direct3D 9.0c", EDT_DIRECT3D9 ); | 682 | gui.VideoDriver->addItem(L"Direct3D 9.0c", EDT_DIRECT3D9 ); |
683 | gui.VideoDriver->addItem(L"Direct3D 8.1", EDT_DIRECT3D8 ); | 683 | gui.VideoDriver->addItem(L"Direct3D 8.1", EDT_DIRECT3D8 ); |
684 | gui.VideoDriver->addItem(L"OpenGL 1.5", EDT_OPENGL); | 684 | gui.VideoDriver->addItem(L"OpenGL 1.5", EDT_OPENGL); |
685 | gui.VideoDriver->addItem(L"Software Renderer", EDT_SOFTWARE); | 685 | gui.VideoDriver->addItem(L"Software Renderer", EDT_SOFTWARE); |
686 | gui.VideoDriver->addItem(L"Burning's Video (TM) Thomas Alten", EDT_BURNINGSVIDEO); | 686 | gui.VideoDriver->addItem(L"Burning's Video (TM) Thomas Alten", EDT_BURNINGSVIDEO); |
687 | gui.VideoDriver->setSelected ( gui.VideoDriver->getIndexForItemData ( Game->deviceParam.DriverType ) ); | 687 | gui.VideoDriver->setSelected ( gui.VideoDriver->getIndexForItemData ( Game->deviceParam.DriverType ) ); |
688 | gui.VideoDriver->setToolTipText ( L"Use a VideoDriver" ); | 688 | gui.VideoDriver->setToolTipText ( L"Use a VideoDriver" ); |
689 | 689 | ||
690 | env->addStaticText ( L"VideoMode:", rect<s32>( dim.Width - 400, 44, dim.Width - 310, 60 ),false, false, gui.Window, -1, false ); | 690 | env->addStaticText ( L"VideoMode:", rect<s32>( dim.Width - 400, 44, dim.Width - 310, 60 ),false, false, gui.Window, -1, false ); |
691 | gui.VideoMode = env->addComboBox(rect<s32>( dim.Width - 300, 44, dim.Width - 10, 60 ),gui.Window); | 691 | gui.VideoMode = env->addComboBox(rect<s32>( dim.Width - 300, 44, dim.Width - 10, 60 ),gui.Window); |
692 | gui.VideoMode->setToolTipText ( L"Supported Screenmodes" ); | 692 | gui.VideoMode->setToolTipText ( L"Supported Screenmodes" ); |
693 | IVideoModeList *modeList = Game->Device->getVideoModeList(); | 693 | IVideoModeList *modeList = Game->Device->getVideoModeList(); |
694 | if ( modeList ) | 694 | if ( modeList ) |
695 | { | 695 | { |
696 | s32 i; | 696 | s32 i; |
697 | for ( i = 0; i != modeList->getVideoModeCount (); ++i ) | 697 | for ( i = 0; i != modeList->getVideoModeCount (); ++i ) |
698 | { | 698 | { |
699 | u16 d = modeList->getVideoModeDepth ( i ); | 699 | u16 d = modeList->getVideoModeDepth ( i ); |
700 | if ( d < 16 ) | 700 | if ( d < 16 ) |
701 | continue; | 701 | continue; |
702 | 702 | ||
703 | u16 w = modeList->getVideoModeResolution ( i ).Width; | 703 | u16 w = modeList->getVideoModeResolution ( i ).Width; |
704 | u16 h = modeList->getVideoModeResolution ( i ).Height; | 704 | u16 h = modeList->getVideoModeResolution ( i ).Height; |
705 | u32 val = w << 16 | h; | 705 | u32 val = w << 16 | h; |
706 | 706 | ||
707 | if ( gui.VideoMode->getIndexForItemData ( val ) >= 0 ) | 707 | if ( gui.VideoMode->getIndexForItemData ( val ) >= 0 ) |
708 | continue; | 708 | continue; |
709 | 709 | ||
710 | f32 aspect = (f32) w / (f32) h; | 710 | f32 aspect = (f32) w / (f32) h; |
711 | const c8 *a = ""; | 711 | const c8 *a = ""; |
712 | if ( core::equals ( aspect, 1.3333333333f ) ) a = "4:3"; | 712 | if ( core::equals ( aspect, 1.3333333333f ) ) a = "4:3"; |
713 | else if ( core::equals ( aspect, 1.6666666f ) ) a = "15:9 widescreen"; | 713 | else if ( core::equals ( aspect, 1.6666666f ) ) a = "15:9 widescreen"; |
714 | else if ( core::equals ( aspect, 1.7777777f ) ) a = "16:9 widescreen"; | 714 | else if ( core::equals ( aspect, 1.7777777f ) ) a = "16:9 widescreen"; |
715 | else if ( core::equals ( aspect, 1.6f ) ) a = "16:10 widescreen"; | 715 | else if ( core::equals ( aspect, 1.6f ) ) a = "16:10 widescreen"; |
716 | else if ( core::equals ( aspect, 2.133333f ) ) a = "20:9 widescreen"; | 716 | else if ( core::equals ( aspect, 2.133333f ) ) a = "20:9 widescreen"; |
717 | 717 | ||
718 | snprintf ( buf, sizeof ( buf ), "%d x %d, %s",w, h, a ); | 718 | snprintf ( buf, sizeof ( buf ), "%d x %d, %s",w, h, a ); |
719 | gui.VideoMode->addItem ( stringw ( buf ).c_str(), val ); | 719 | gui.VideoMode->addItem ( stringw ( buf ).c_str(), val ); |
720 | } | 720 | } |
721 | } | 721 | } |
722 | gui.VideoMode->setSelected ( gui.VideoMode->getIndexForItemData ( | 722 | gui.VideoMode->setSelected ( gui.VideoMode->getIndexForItemData ( |
723 | Game->deviceParam.WindowSize.Width << 16 | | 723 | Game->deviceParam.WindowSize.Width << 16 | |
724 | Game->deviceParam.WindowSize.Height ) ); | 724 | Game->deviceParam.WindowSize.Height ) ); |
725 | 725 | ||
726 | gui.FullScreen = env->addCheckBox ( Game->deviceParam.Fullscreen, rect<s32>( dim.Width - 400, 64, dim.Width - 300, 80 ), gui.Window,-1, L"Fullscreen" ); | 726 | gui.FullScreen = env->addCheckBox ( Game->deviceParam.Fullscreen, rect<s32>( dim.Width - 400, 64, dim.Width - 300, 80 ), gui.Window,-1, L"Fullscreen" ); |
727 | gui.FullScreen->setToolTipText ( L"Set Fullscreen or Window Mode" ); | 727 | gui.FullScreen->setToolTipText ( L"Set Fullscreen or Window Mode" ); |
728 | 728 | ||
729 | gui.Bit32 = env->addCheckBox ( Game->deviceParam.Bits == 32, rect<s32>( dim.Width - 300, 64, dim.Width - 240, 80 ), gui.Window,-1, L"32Bit" ); | 729 | gui.Bit32 = env->addCheckBox ( Game->deviceParam.Bits == 32, rect<s32>( dim.Width - 300, 64, dim.Width - 240, 80 ), gui.Window,-1, L"32Bit" ); |
730 | gui.Bit32->setToolTipText ( L"Use 16 or 32 Bit" ); | 730 | gui.Bit32->setToolTipText ( L"Use 16 or 32 Bit" ); |
731 | 731 | ||
732 | env->addStaticText ( L"MultiSample:", rect<s32>( dim.Width - 235, 64, dim.Width - 150, 80 ),false, false, gui.Window, -1, false ); | 732 | env->addStaticText ( L"MultiSample:", rect<s32>( dim.Width - 235, 64, dim.Width - 150, 80 ),false, false, gui.Window, -1, false ); |
733 | gui.MultiSample = env->addScrollBar( true, rect<s32>( dim.Width - 150, 64, dim.Width - 70, 80 ), gui.Window,-1 ); | 733 | gui.MultiSample = env->addScrollBar( true, rect<s32>( dim.Width - 150, 64, dim.Width - 70, 80 ), gui.Window,-1 ); |
734 | gui.MultiSample->setMin ( 0 ); | 734 | gui.MultiSample->setMin ( 0 ); |
735 | gui.MultiSample->setMax ( 8 ); | 735 | gui.MultiSample->setMax ( 8 ); |
736 | gui.MultiSample->setSmallStep ( 1 ); | 736 | gui.MultiSample->setSmallStep ( 1 ); |
737 | gui.MultiSample->setLargeStep ( 1 ); | 737 | gui.MultiSample->setLargeStep ( 1 ); |
738 | gui.MultiSample->setPos ( Game->deviceParam.AntiAlias ); | 738 | gui.MultiSample->setPos ( Game->deviceParam.AntiAlias ); |
739 | gui.MultiSample->setToolTipText ( L"Set the MultiSample (disable, 1x, 2x, 4x, 8x )" ); | 739 | gui.MultiSample->setToolTipText ( L"Set the MultiSample (disable, 1x, 2x, 4x, 8x )" ); |
740 | 740 | ||
741 | gui.SetVideoMode = env->addButton (rect<s32>( dim.Width - 60, 64, dim.Width - 10, 80 ), gui.Window, -1,L"set" ); | 741 | gui.SetVideoMode = env->addButton (rect<s32>( dim.Width - 60, 64, dim.Width - 10, 80 ), gui.Window, -1,L"set" ); |
742 | gui.SetVideoMode->setToolTipText ( L"Set Video Mode with current values" ); | 742 | gui.SetVideoMode->setToolTipText ( L"Set Video Mode with current values" ); |
743 | 743 | ||
744 | env->addStaticText ( L"Gamma:", rect<s32>( dim.Width - 400, 104, dim.Width - 310, 120 ),false, false, gui.Window, -1, false ); | 744 | env->addStaticText ( L"Gamma:", rect<s32>( dim.Width - 400, 104, dim.Width - 310, 120 ),false, false, gui.Window, -1, false ); |
745 | gui.Gamma = env->addScrollBar( true, rect<s32>( dim.Width - 300, 104, dim.Width - 10, 120 ), gui.Window,-1 ); | 745 | gui.Gamma = env->addScrollBar( true, rect<s32>( dim.Width - 300, 104, dim.Width - 10, 120 ), gui.Window,-1 ); |
746 | gui.Gamma->setMin ( 50 ); | 746 | gui.Gamma->setMin ( 50 ); |
747 | gui.Gamma->setMax ( 350 ); | 747 | gui.Gamma->setMax ( 350 ); |
748 | gui.Gamma->setSmallStep ( 1 ); | 748 | gui.Gamma->setSmallStep ( 1 ); |
749 | gui.Gamma->setLargeStep ( 10 ); | 749 | gui.Gamma->setLargeStep ( 10 ); |
750 | gui.Gamma->setPos ( core::floor32 ( Game->GammaValue * 100.f ) ); | 750 | gui.Gamma->setPos ( core::floor32 ( Game->GammaValue * 100.f ) ); |
751 | gui.Gamma->setToolTipText ( L"Adjust Gamma Ramp ( 0.5 - 3.5)" ); | 751 | gui.Gamma->setToolTipText ( L"Adjust Gamma Ramp ( 0.5 - 3.5)" ); |
752 | Game->Device->setGammaRamp ( Game->GammaValue, Game->GammaValue, Game->GammaValue, 0.f, 0.f ); | 752 | Game->Device->setGammaRamp ( Game->GammaValue, Game->GammaValue, Game->GammaValue, 0.f, 0.f ); |
753 | 753 | ||
754 | 754 | ||
755 | env->addStaticText ( L"Tesselation:", rect<s32>( dim.Width - 400, 124, dim.Width - 310, 140 ),false, false, gui.Window, -1, false ); | 755 | env->addStaticText ( L"Tesselation:", rect<s32>( dim.Width - 400, 124, dim.Width - 310, 140 ),false, false, gui.Window, -1, false ); |
756 | gui.Tesselation = env->addScrollBar( true, rect<s32>( dim.Width - 300, 124, dim.Width - 10, 140 ), gui.Window,-1 ); | 756 | gui.Tesselation = env->addScrollBar( true, rect<s32>( dim.Width - 300, 124, dim.Width - 10, 140 ), gui.Window,-1 ); |
757 | gui.Tesselation->setMin ( 2 ); | 757 | gui.Tesselation->setMin ( 2 ); |
758 | gui.Tesselation->setMax ( 12 ); | 758 | gui.Tesselation->setMax ( 12 ); |
759 | gui.Tesselation->setSmallStep ( 1 ); | 759 | gui.Tesselation->setSmallStep ( 1 ); |
760 | gui.Tesselation->setLargeStep ( 1 ); | 760 | gui.Tesselation->setLargeStep ( 1 ); |
761 | gui.Tesselation->setPos ( Game->loadParam.patchTesselation ); | 761 | gui.Tesselation->setPos ( Game->loadParam.patchTesselation ); |
762 | gui.Tesselation->setToolTipText ( L"How smooth should curved surfaces be rendered" ); | 762 | gui.Tesselation->setToolTipText ( L"How smooth should curved surfaces be rendered" ); |
763 | 763 | ||
764 | gui.Collision = env->addCheckBox ( true, rect<s32>( dim.Width - 400, 150, dim.Width - 300, 166 ), gui.Window,-1, L"Collision" ); | 764 | gui.Collision = env->addCheckBox ( true, rect<s32>( dim.Width - 400, 150, dim.Width - 300, 166 ), gui.Window,-1, L"Collision" ); |
765 | gui.Collision->setToolTipText ( L"Set collision on or off ( flythrough ). \nPress F7 on your Keyboard" ); | 765 | gui.Collision->setToolTipText ( L"Set collision on or off ( flythrough ). \nPress F7 on your Keyboard" ); |
766 | gui.Visible_Map = env->addCheckBox ( true, rect<s32>( dim.Width - 300, 150, dim.Width - 240, 166 ), gui.Window,-1, L"Map" ); | 766 | gui.Visible_Map = env->addCheckBox ( true, rect<s32>( dim.Width - 300, 150, dim.Width - 240, 166 ), gui.Window,-1, L"Map" ); |
767 | gui.Visible_Map->setToolTipText ( L"Show or not show the static part the Level. \nPress F3 on your Keyboard" ); | 767 | gui.Visible_Map->setToolTipText ( L"Show or not show the static part the Level. \nPress F3 on your Keyboard" ); |
768 | gui.Visible_Shader = env->addCheckBox ( true, rect<s32>( dim.Width - 240, 150, dim.Width - 170, 166 ), gui.Window,-1, L"Shader" ); | 768 | gui.Visible_Shader = env->addCheckBox ( true, rect<s32>( dim.Width - 240, 150, dim.Width - 170, 166 ), gui.Window,-1, L"Shader" ); |
769 | gui.Visible_Shader->setToolTipText ( L"Show or not show the Shader Nodes. \nPress F4 on your Keyboard" ); | 769 | gui.Visible_Shader->setToolTipText ( L"Show or not show the Shader Nodes. \nPress F4 on your Keyboard" ); |
770 | gui.Visible_Fog = env->addCheckBox ( true, rect<s32>( dim.Width - 170, 150, dim.Width - 110, 166 ), gui.Window,-1, L"Fog" ); | 770 | gui.Visible_Fog = env->addCheckBox ( true, rect<s32>( dim.Width - 170, 150, dim.Width - 110, 166 ), gui.Window,-1, L"Fog" ); |
771 | gui.Visible_Fog->setToolTipText ( L"Show or not show the Fog Nodes. \nPress F5 on your Keyboard" ); | 771 | gui.Visible_Fog->setToolTipText ( L"Show or not show the Fog Nodes. \nPress F5 on your Keyboard" ); |
772 | gui.Visible_Unresolved = env->addCheckBox ( true, rect<s32>( dim.Width - 110, 150, dim.Width - 10, 166 ), gui.Window,-1, L"Unresolved" ); | 772 | gui.Visible_Unresolved = env->addCheckBox ( true, rect<s32>( dim.Width - 110, 150, dim.Width - 10, 166 ), gui.Window,-1, L"Unresolved" ); |
773 | gui.Visible_Unresolved->setToolTipText ( L"Show the or not show the Nodes the Engine can't handle. \nPress F6 on your Keyboard" ); | 773 | gui.Visible_Unresolved->setToolTipText ( L"Show the or not show the Nodes the Engine can't handle. \nPress F6 on your Keyboard" ); |
774 | gui.Visible_Skydome = env->addCheckBox ( true, rect<s32>( dim.Width - 110, 180, dim.Width - 10, 196 ), gui.Window,-1, L"Skydome" ); | 774 | gui.Visible_Skydome = env->addCheckBox ( true, rect<s32>( dim.Width - 110, 180, dim.Width - 10, 196 ), gui.Window,-1, L"Skydome" ); |
775 | gui.Visible_Skydome->setToolTipText ( L"Show the or not show the Skydome." ); | 775 | gui.Visible_Skydome->setToolTipText ( L"Show the or not show the Skydome." ); |
776 | 776 | ||
777 | //Respawn = env->addButton ( rect<s32>( dim.Width - 260, 90, dim.Width - 10, 106 ), 0,-1, L"Respawn" ); | 777 | //Respawn = env->addButton ( rect<s32>( dim.Width - 260, 90, dim.Width - 10, 106 ), 0,-1, L"Respawn" ); |
778 | 778 | ||
779 | env->addStaticText ( L"Archives:", rect<s32>( 5, dim.Height - 530, dim.Width - 600,dim.Height - 514 ),false, false, gui.Window, -1, false ); | 779 | env->addStaticText ( L"Archives:", rect<s32>( 5, dim.Height - 530, dim.Width - 600,dim.Height - 514 ),false, false, gui.Window, -1, false ); |
780 | 780 | ||
781 | gui.ArchiveAdd = env->addButton ( rect<s32>( dim.Width - 725, dim.Height - 530, dim.Width - 665, dim.Height - 514 ), gui.Window,-1, L"add" ); | 781 | gui.ArchiveAdd = env->addButton ( rect<s32>( dim.Width - 725, dim.Height - 530, dim.Width - 665, dim.Height - 514 ), gui.Window,-1, L"add" ); |
782 | gui.ArchiveAdd->setToolTipText ( L"Add an archive, usually packed zip-archives (*.pk3) to the Filesystem" ); | 782 | gui.ArchiveAdd->setToolTipText ( L"Add an archive, usually packed zip-archives (*.pk3) to the Filesystem" ); |
783 | gui.ArchiveRemove = env->addButton ( rect<s32>( dim.Width - 660, dim.Height - 530, dim.Width - 600, dim.Height - 514 ), gui.Window,-1, L"del" ); | 783 | gui.ArchiveRemove = env->addButton ( rect<s32>( dim.Width - 660, dim.Height - 530, dim.Width - 600, dim.Height - 514 ), gui.Window,-1, L"del" ); |
784 | gui.ArchiveRemove->setToolTipText ( L"Remove the selected archive from the FileSystem." ); | 784 | gui.ArchiveRemove->setToolTipText ( L"Remove the selected archive from the FileSystem." ); |
785 | gui.ArchiveUp = env->addButton ( rect<s32>( dim.Width - 575, dim.Height - 530, dim.Width - 515, dim.Height - 514 ), gui.Window,-1, L"up" ); | 785 | gui.ArchiveUp = env->addButton ( rect<s32>( dim.Width - 575, dim.Height - 530, dim.Width - 515, dim.Height - 514 ), gui.Window,-1, L"up" ); |
786 | gui.ArchiveUp->setToolTipText ( L"Arrange Archive Look-up Hirachy. Move the selected Archive up" ); | 786 | gui.ArchiveUp->setToolTipText ( L"Arrange Archive Look-up Hirachy. Move the selected Archive up" ); |
787 | gui.ArchiveDown = env->addButton ( rect<s32>( dim.Width - 510, dim.Height - 530, dim.Width - 440, dim.Height - 514 ), gui.Window,-1, L"down" ); | 787 | gui.ArchiveDown = env->addButton ( rect<s32>( dim.Width - 510, dim.Height - 530, dim.Width - 440, dim.Height - 514 ), gui.Window,-1, L"down" ); |
788 | gui.ArchiveDown->setToolTipText ( L"Arrange Archive Look-up Hirachy. Move the selected Archive down" ); | 788 | gui.ArchiveDown->setToolTipText ( L"Arrange Archive Look-up Hirachy. Move the selected Archive down" ); |
789 | 789 | ||
790 | 790 | ||
791 | gui.ArchiveList = env->addTable ( rect<s32>( 5,dim.Height - 510, dim.Width - 450,dim.Height - 410 ), gui.Window ); | 791 | gui.ArchiveList = env->addTable ( rect<s32>( 5,dim.Height - 510, dim.Width - 450,dim.Height - 410 ), gui.Window ); |
792 | gui.ArchiveList->addColumn ( L"Type", 0 ); | 792 | gui.ArchiveList->addColumn ( L"Type", 0 ); |
793 | gui.ArchiveList->addColumn ( L"Real File Path", 1 ); | 793 | gui.ArchiveList->addColumn ( L"Real File Path", 1 ); |
794 | gui.ArchiveList->setColumnWidth ( 0, 60 ); | 794 | gui.ArchiveList->setColumnWidth ( 0, 60 ); |
795 | gui.ArchiveList->setColumnWidth ( 1, 284 ); | 795 | gui.ArchiveList->setColumnWidth ( 1, 284 ); |
796 | gui.ArchiveList->setToolTipText ( L"Show the attached Archives" ); | 796 | gui.ArchiveList->setToolTipText ( L"Show the attached Archives" ); |
797 | 797 | ||
798 | 798 | ||
799 | env->addStaticText ( L"Maps:", rect<s32>( 5, dim.Height - 400, dim.Width - 450,dim.Height - 380 ),false, false, gui.Window, -1, false ); | 799 | env->addStaticText ( L"Maps:", rect<s32>( 5, dim.Height - 400, dim.Width - 450,dim.Height - 380 ),false, false, gui.Window, -1, false ); |
800 | gui.MapList = env->addListBox ( rect<s32>( 5,dim.Height - 380, dim.Width - 450,dim.Height - 40 ), gui.Window, -1, true ); | 800 | gui.MapList = env->addListBox ( rect<s32>( 5,dim.Height - 380, dim.Width - 450,dim.Height - 40 ), gui.Window, -1, true ); |
801 | gui.MapList->setToolTipText ( L"Show the current Maps in all Archives.\n Double-Click the Map to start the level" ); | 801 | gui.MapList->setToolTipText ( L"Show the current Maps in all Archives.\n Double-Click the Map to start the level" ); |
802 | 802 | ||
803 | 803 | ||
804 | // create a visible Scene Tree | 804 | // create a visible Scene Tree |
805 | env->addStaticText ( L"Scenegraph:", rect<s32>( dim.Width - 400, dim.Height - 400, dim.Width - 5,dim.Height - 380 ),false, false, gui.Window, -1, false ); | 805 | env->addStaticText ( L"Scenegraph:", rect<s32>( dim.Width - 400, dim.Height - 400, dim.Width - 5,dim.Height - 380 ),false, false, gui.Window, -1, false ); |
806 | gui.SceneTree = env->addTreeView( rect<s32>( dim.Width - 400, dim.Height - 380, dim.Width - 5, dim.Height - 40 ), | 806 | gui.SceneTree = env->addTreeView( rect<s32>( dim.Width - 400, dim.Height - 380, dim.Width - 5, dim.Height - 40 ), |
807 | gui.Window, -1, true, true, false ); | 807 | gui.Window, -1, true, true, false ); |
808 | gui.SceneTree->setToolTipText ( L"Show the current Scenegraph" ); | 808 | gui.SceneTree->setToolTipText ( L"Show the current Scenegraph" ); |
809 | gui.SceneTree->getRoot()->clearChildren(); | 809 | gui.SceneTree->getRoot()->clearChildren(); |
810 | addSceneTreeItem ( Game->Device->getSceneManager()->getRootSceneNode(), gui.SceneTree->getRoot() ); | 810 | addSceneTreeItem ( Game->Device->getSceneManager()->getRootSceneNode(), gui.SceneTree->getRoot() ); |
811 | 811 | ||
812 | 812 | ||
813 | IGUIImageList* imageList = env->createImageList( driver->getTexture ( "iconlist.png" ), | 813 | IGUIImageList* imageList = env->createImageList( driver->getTexture ( "iconlist.png" ), |
814 | dimension2di( 32, 32 ), true ); | 814 | dimension2di( 32, 32 ), true ); |
815 | 815 | ||
816 | if ( imageList ) | 816 | if ( imageList ) |
817 | { | 817 | { |
818 | gui.SceneTree->setImageList( imageList ); | 818 | gui.SceneTree->setImageList( imageList ); |
819 | imageList->drop (); | 819 | imageList->drop (); |
820 | } | 820 | } |
821 | 821 | ||
822 | 822 | ||
823 | // load the engine logo | 823 | // load the engine logo |
824 | gui.Logo = env->addImage( driver->getTexture("irrlichtlogo3.png"), position2d<s32>(5, 16 ), true, 0 ); | 824 | gui.Logo = env->addImage( driver->getTexture("irrlichtlogo3.png"), position2d<s32>(5, 16 ), true, 0 ); |
825 | gui.Logo->setToolTipText ( L"The great Irrlicht Engine" ); | 825 | gui.Logo->setToolTipText ( L"The great Irrlicht Engine" ); |
826 | 826 | ||
827 | AddArchive ( "" ); | 827 | AddArchive ( "" ); |
828 | } | 828 | } |
829 | 829 | ||
830 | 830 | ||
831 | /* | 831 | /* |
832 | Add an Archive to the FileSystems and updates the GUI | 832 | Add an Archive to the FileSystems and updates the GUI |
833 | */ | 833 | */ |
834 | void CQuake3EventHandler::AddArchive ( const path& archiveName ) | 834 | void CQuake3EventHandler::AddArchive ( const path& archiveName ) |
835 | { | 835 | { |
836 | IFileSystem *fs = Game->Device->getFileSystem(); | 836 | IFileSystem *fs = Game->Device->getFileSystem(); |
837 | u32 i; | 837 | u32 i; |
838 | 838 | ||
839 | if ( archiveName.size () ) | 839 | if ( archiveName.size () ) |
840 | { | 840 | { |
841 | bool exists = false; | 841 | bool exists = false; |
842 | for ( i = 0; i != fs->getFileArchiveCount(); ++i ) | 842 | for ( i = 0; i != fs->getFileArchiveCount(); ++i ) |
843 | { | 843 | { |
844 | if ( fs->getFileArchive(i)->getFileList()->getPath() == archiveName ) | 844 | if ( fs->getFileArchive(i)->getFileList()->getPath() == archiveName ) |
845 | { | 845 | { |
846 | exists = true; | 846 | exists = true; |
847 | break; | 847 | break; |
848 | } | 848 | } |
849 | } | 849 | } |
850 | 850 | ||
851 | if (!exists) | 851 | if (!exists) |
852 | { | 852 | { |
853 | fs->addFileArchive(archiveName, true, false); | 853 | fs->addFileArchive(archiveName, true, false); |
854 | } | 854 | } |
855 | } | 855 | } |
856 | 856 | ||
857 | // store the current archives in game data | 857 | // store the current archives in game data |
858 | // show the attached Archive in proper order | 858 | // show the attached Archive in proper order |
859 | if ( gui.ArchiveList ) | 859 | if ( gui.ArchiveList ) |
860 | { | 860 | { |
861 | gui.ArchiveList->clearRows(); | 861 | gui.ArchiveList->clearRows(); |
862 | 862 | ||
863 | for ( i = 0; i != fs->getFileArchiveCount(); ++i ) | 863 | for ( i = 0; i != fs->getFileArchiveCount(); ++i ) |
864 | { | 864 | { |
865 | IFileArchive * archive = fs->getFileArchive ( i ); | 865 | IFileArchive * archive = fs->getFileArchive ( i ); |
866 | 866 | ||
867 | u32 index = gui.ArchiveList->addRow(i); | 867 | u32 index = gui.ArchiveList->addRow(i); |
868 | 868 | ||
869 | core::stringw typeName; | 869 | core::stringw typeName; |
870 | switch(archive->getType()) | 870 | switch(archive->getType()) |
871 | { | 871 | { |
872 | case io::EFAT_ZIP: | 872 | case io::EFAT_ZIP: |
873 | typeName = "ZIP"; | 873 | typeName = "ZIP"; |
874 | break; | 874 | break; |
875 | case io::EFAT_GZIP: | 875 | case io::EFAT_GZIP: |
876 | typeName = "gzip"; | 876 | typeName = "gzip"; |
877 | break; | 877 | break; |
878 | case io::EFAT_FOLDER: | 878 | case io::EFAT_FOLDER: |
879 | typeName = "Mount"; | 879 | typeName = "Mount"; |
880 | break; | 880 | break; |
881 | case io::EFAT_PAK: | 881 | case io::EFAT_PAK: |
882 | typeName = "PAK"; | 882 | typeName = "PAK"; |
883 | break; | 883 | break; |
884 | case io::EFAT_TAR: | 884 | case io::EFAT_TAR: |
885 | typeName = "TAR"; | 885 | typeName = "TAR"; |
886 | break; | 886 | break; |
887 | default: | 887 | default: |
888 | typeName = "archive"; | 888 | typeName = "archive"; |
889 | } | 889 | } |
890 | 890 | ||
891 | gui.ArchiveList->setCellText ( index, 0, typeName ); | 891 | gui.ArchiveList->setCellText ( index, 0, typeName ); |
892 | gui.ArchiveList->setCellText ( index, 1, archive->getFileList()->getPath() ); | 892 | gui.ArchiveList->setCellText ( index, 1, archive->getFileList()->getPath() ); |
893 | } | 893 | } |
894 | } | 894 | } |
895 | 895 | ||
896 | 896 | ||
897 | // browse the archives for maps | 897 | // browse the archives for maps |
898 | if ( gui.MapList ) | 898 | if ( gui.MapList ) |
899 | { | 899 | { |
900 | gui.MapList->clear(); | 900 | gui.MapList->clear(); |
901 | 901 | ||
902 | IGUISpriteBank *bank = Game->Device->getGUIEnvironment()->getSpriteBank("sprite_q3map"); | 902 | IGUISpriteBank *bank = Game->Device->getGUIEnvironment()->getSpriteBank("sprite_q3map"); |
903 | if ( 0 == bank ) | 903 | if ( 0 == bank ) |
904 | bank = Game->Device->getGUIEnvironment()->addEmptySpriteBank("sprite_q3map"); | 904 | bank = Game->Device->getGUIEnvironment()->addEmptySpriteBank("sprite_q3map"); |
905 | 905 | ||
906 | SGUISprite sprite; | 906 | SGUISprite sprite; |
907 | SGUISpriteFrame frame; | 907 | SGUISpriteFrame frame; |
908 | core::rect<s32> r; | 908 | core::rect<s32> r; |
909 | 909 | ||
910 | bank->getSprites().clear(); | 910 | bank->getSprites().clear(); |
911 | bank->getPositions().clear (); | 911 | bank->getPositions().clear (); |
912 | gui.MapList->setSpriteBank ( bank ); | 912 | gui.MapList->setSpriteBank ( bank ); |
913 | 913 | ||
914 | u32 g = 0; | 914 | u32 g = 0; |
915 | core::stringw s; | 915 | core::stringw s; |
916 | 916 | ||
917 | // browse the attached file system | 917 | // browse the attached file system |
918 | fs->setFileListSystem ( FILESYSTEM_VIRTUAL ); | 918 | fs->setFileListSystem ( FILESYSTEM_VIRTUAL ); |
919 | fs->changeWorkingDirectoryTo ( "/maps/" ); | 919 | fs->changeWorkingDirectoryTo ( "/maps/" ); |
920 | IFileList *fileList = fs->createFileList (); | 920 | IFileList *fileList = fs->createFileList (); |
921 | fs->setFileListSystem ( FILESYSTEM_NATIVE ); | 921 | fs->setFileListSystem ( FILESYSTEM_NATIVE ); |
922 | 922 | ||
923 | for ( i=0; i< fileList->getFileCount(); ++i) | 923 | for ( i=0; i< fileList->getFileCount(); ++i) |
924 | { | 924 | { |
925 | s = fileList->getFullFileName(i); | 925 | s = fileList->getFullFileName(i); |
926 | if ( s.find ( ".bsp" ) >= 0 ) | 926 | if ( s.find ( ".bsp" ) >= 0 ) |
927 | { | 927 | { |
928 | // get level screenshot. reformat texture to 128x128 | 928 | // get level screenshot. reformat texture to 128x128 |
929 | path c ( s ); | 929 | path c ( s ); |
930 | deletePathFromFilename ( c ); | 930 | deletePathFromFilename ( c ); |
931 | cutFilenameExtension ( c, c ); | 931 | cutFilenameExtension ( c, c ); |
932 | c = path ( "levelshots/" ) + c; | 932 | c = path ( "levelshots/" ) + c; |
933 | 933 | ||
934 | dimension2du dim ( 128, 128 ); | 934 | dimension2du dim ( 128, 128 ); |
935 | IVideoDriver * driver = Game->Device->getVideoDriver(); | 935 | IVideoDriver * driver = Game->Device->getVideoDriver(); |
936 | IImage* image = 0; | 936 | IImage* image = 0; |
937 | ITexture *tex = 0; | 937 | ITexture *tex = 0; |
938 | path filename; | 938 | path filename; |
939 | 939 | ||
940 | filename = c + ".jpg"; | 940 | filename = c + ".jpg"; |
941 | if ( fs->existFile ( filename ) ) | 941 | if ( fs->existFile ( filename ) ) |
942 | image = driver->createImageFromFile( filename ); | 942 | image = driver->createImageFromFile( filename ); |
943 | if ( 0 == image ) | 943 | if ( 0 == image ) |
944 | { | 944 | { |
945 | filename = c + ".tga"; | 945 | filename = c + ".tga"; |
946 | if ( fs->existFile ( filename ) ) | 946 | if ( fs->existFile ( filename ) ) |
947 | image = driver->createImageFromFile( filename ); | 947 | image = driver->createImageFromFile( filename ); |
948 | } | 948 | } |
949 | 949 | ||
950 | if ( image ) | 950 | if ( image ) |
951 | { | 951 | { |
952 | IImage* filter = driver->createImage ( video::ECF_R8G8B8, dim ); | 952 | IImage* filter = driver->createImage ( video::ECF_R8G8B8, dim ); |
953 | image->copyToScalingBoxFilter ( filter, 0 ); | 953 | image->copyToScalingBoxFilter ( filter, 0 ); |
954 | image->drop (); | 954 | image->drop (); |
955 | image = filter; | 955 | image = filter; |
956 | } | 956 | } |
957 | 957 | ||
958 | if ( image ) | 958 | if ( image ) |
959 | { | 959 | { |
960 | tex = driver->addTexture ( filename, image ); | 960 | tex = driver->addTexture ( filename, image ); |
961 | image->drop (); | 961 | image->drop (); |
962 | } | 962 | } |
963 | 963 | ||
964 | 964 | ||
965 | bank->setTexture ( g, tex ); | 965 | bank->setTexture ( g, tex ); |
966 | 966 | ||
967 | r.LowerRightCorner.X = dim.Width; | 967 | r.LowerRightCorner.X = dim.Width; |
968 | r.LowerRightCorner.Y = dim.Height; | 968 | r.LowerRightCorner.Y = dim.Height; |
969 | gui.MapList->setItemHeight ( r.LowerRightCorner.Y + 4 ); | 969 | gui.MapList->setItemHeight ( r.LowerRightCorner.Y + 4 ); |
970 | frame.rectNumber = bank->getPositions().size(); | 970 | frame.rectNumber = bank->getPositions().size(); |
971 | frame.textureNumber = g; | 971 | frame.textureNumber = g; |
972 | 972 | ||
973 | bank->getPositions().push_back(r); | 973 | bank->getPositions().push_back(r); |
974 | 974 | ||
975 | sprite.Frames.set_used ( 0 ); | 975 | sprite.Frames.set_used ( 0 ); |
976 | sprite.Frames.push_back(frame); | 976 | sprite.Frames.push_back(frame); |
977 | sprite.frameTime = 0; | 977 | sprite.frameTime = 0; |
978 | bank->getSprites().push_back(sprite); | 978 | bank->getSprites().push_back(sprite); |
979 | 979 | ||
980 | gui.MapList->addItem ( s.c_str (), g ); | 980 | gui.MapList->addItem ( s.c_str (), g ); |
981 | g += 1; | 981 | g += 1; |
982 | } | 982 | } |
983 | } | 983 | } |
984 | fileList->drop (); | 984 | fileList->drop (); |
985 | 985 | ||
986 | gui.MapList->setSelected ( -1 ); | 986 | gui.MapList->setSelected ( -1 ); |
987 | IGUIScrollBar * bar = (IGUIScrollBar*)gui.MapList->getElementFromId( 0 ); | 987 | IGUIScrollBar * bar = (IGUIScrollBar*)gui.MapList->getElementFromId( 0 ); |
988 | if ( bar ) | 988 | if ( bar ) |
989 | bar->setPos ( 0 ); | 989 | bar->setPos ( 0 ); |
990 | 990 | ||
991 | } | 991 | } |
992 | 992 | ||
993 | } | 993 | } |
994 | 994 | ||
995 | /* | 995 | /* |
996 | clears the Map in Memory | 996 | clears the Map in Memory |
997 | */ | 997 | */ |
998 | void CQuake3EventHandler::dropMap () | 998 | void CQuake3EventHandler::dropMap () |
999 | { | 999 | { |
1000 | IVideoDriver * driver = Game->Device->getVideoDriver(); | 1000 | IVideoDriver * driver = Game->Device->getVideoDriver(); |
1001 | 1001 | ||
1002 | driver->removeAllHardwareBuffers (); | 1002 | driver->removeAllHardwareBuffers (); |
1003 | driver->removeAllTextures (); | 1003 | driver->removeAllTextures (); |
1004 | 1004 | ||
1005 | Player[0].shutdown (); | 1005 | Player[0].shutdown (); |
1006 | 1006 | ||
1007 | 1007 | ||
1008 | dropElement ( ItemParent ); | 1008 | dropElement ( ItemParent ); |
1009 | dropElement ( ShaderParent ); | 1009 | dropElement ( ShaderParent ); |
1010 | dropElement ( UnresolvedParent ); | 1010 | dropElement ( UnresolvedParent ); |
1011 | dropElement ( FogParent ); | 1011 | dropElement ( FogParent ); |
1012 | dropElement ( BulletParent ); | 1012 | dropElement ( BulletParent ); |
1013 | 1013 | ||
1014 | 1014 | ||
1015 | Impacts.clear(); | 1015 | Impacts.clear(); |
1016 | 1016 | ||
1017 | if ( Meta ) | 1017 | if ( Meta ) |
1018 | { | 1018 | { |
1019 | Meta = 0; | 1019 | Meta = 0; |
1020 | } | 1020 | } |
1021 | 1021 | ||
1022 | dropElement ( MapParent ); | 1022 | dropElement ( MapParent ); |
1023 | dropElement ( SkyNode ); | 1023 | dropElement ( SkyNode ); |
1024 | 1024 | ||
1025 | // clean out meshes, because textures are invalid | 1025 | // clean out meshes, because textures are invalid |
1026 | // TODO: better texture handling;-) | 1026 | // TODO: better texture handling;-) |
1027 | IMeshCache *cache = Game->Device->getSceneManager ()->getMeshCache(); | 1027 | IMeshCache *cache = Game->Device->getSceneManager ()->getMeshCache(); |
1028 | cache->clear (); | 1028 | cache->clear (); |
1029 | Mesh = 0; | 1029 | Mesh = 0; |
1030 | } | 1030 | } |
1031 | 1031 | ||
1032 | /* Load new map | 1032 | /* Load new map |
1033 | */ | 1033 | */ |
1034 | void CQuake3EventHandler::LoadMap ( const stringw &mapName, s32 collision ) | 1034 | void CQuake3EventHandler::LoadMap ( const stringw &mapName, s32 collision ) |
1035 | { | 1035 | { |
1036 | if ( 0 == mapName.size() ) | 1036 | if ( 0 == mapName.size() ) |
1037 | return; | 1037 | return; |
1038 | 1038 | ||
1039 | dropMap (); | 1039 | dropMap (); |
1040 | 1040 | ||
1041 | IFileSystem *fs = Game->Device->getFileSystem(); | 1041 | IFileSystem *fs = Game->Device->getFileSystem(); |
1042 | ISceneManager *smgr = Game->Device->getSceneManager (); | 1042 | ISceneManager *smgr = Game->Device->getSceneManager (); |
1043 | 1043 | ||
1044 | IReadFile* file = fs->createMemoryReadFile(&Game->loadParam, | 1044 | IReadFile* file = fs->createMemoryReadFile(&Game->loadParam, |
1045 | sizeof(Game->loadParam), L"levelparameter.cfg", false); | 1045 | sizeof(Game->loadParam), L"levelparameter.cfg", false); |
1046 | 1046 | ||
1047 | // load cfg file | 1047 | // load cfg file |
1048 | smgr->getMesh( file ); | 1048 | smgr->getMesh( file ); |
1049 | file->drop (); | 1049 | file->drop (); |
1050 | 1050 | ||
1051 | // load the actual map | 1051 | // load the actual map |
1052 | Mesh = (IQ3LevelMesh*) smgr->getMesh(mapName); | 1052 | Mesh = (IQ3LevelMesh*) smgr->getMesh(mapName); |
1053 | if ( 0 == Mesh ) | 1053 | if ( 0 == Mesh ) |
1054 | return; | 1054 | return; |
1055 | 1055 | ||
1056 | /* | 1056 | /* |
1057 | add the geometry mesh to the Scene ( polygon & patches ) | 1057 | add the geometry mesh to the Scene ( polygon & patches ) |
1058 | The Geometry mesh is optimised for faster drawing | 1058 | The Geometry mesh is optimised for faster drawing |
1059 | */ | 1059 | */ |
1060 | 1060 | ||
1061 | IMesh *geometry = Mesh->getMesh(E_Q3_MESH_GEOMETRY); | 1061 | IMesh *geometry = Mesh->getMesh(E_Q3_MESH_GEOMETRY); |
1062 | if ( 0 == geometry || geometry->getMeshBufferCount() == 0) | 1062 | if ( 0 == geometry || geometry->getMeshBufferCount() == 0) |
1063 | return; | 1063 | return; |
1064 | 1064 | ||
1065 | Game->CurrentMapName = mapName; | 1065 | Game->CurrentMapName = mapName; |
1066 | 1066 | ||
1067 | //create a collision list | 1067 | //create a collision list |
1068 | Meta = 0; | 1068 | Meta = 0; |
1069 | 1069 | ||
1070 | ITriangleSelector * selector = 0; | 1070 | ITriangleSelector * selector = 0; |
1071 | if (collision) | 1071 | if (collision) |
1072 | Meta = smgr->createMetaTriangleSelector(); | 1072 | Meta = smgr->createMetaTriangleSelector(); |
1073 | 1073 | ||
1074 | //IMeshBuffer *b0 = geometry->getMeshBuffer(0); | 1074 | //IMeshBuffer *b0 = geometry->getMeshBuffer(0); |
1075 | //s32 minimalNodes = b0 ? core::s32_max ( 2048, b0->getVertexCount() / 32 ) : 2048; | 1075 | //s32 minimalNodes = b0 ? core::s32_max ( 2048, b0->getVertexCount() / 32 ) : 2048; |
1076 | s32 minimalNodes = 2048; | 1076 | s32 minimalNodes = 2048; |
1077 | 1077 | ||
1078 | MapParent = smgr->addOctreeSceneNode(geometry, 0, -1, minimalNodes); | 1078 | MapParent = smgr->addOctreeSceneNode(geometry, 0, -1, minimalNodes); |
1079 | MapParent->setName ( mapName ); | 1079 | MapParent->setName ( mapName ); |
1080 | if ( Meta ) | 1080 | if ( Meta ) |
1081 | { | 1081 | { |
1082 | selector = smgr->createOctreeTriangleSelector( geometry,MapParent, minimalNodes); | 1082 | selector = smgr->createOctreeTriangleSelector( geometry,MapParent, minimalNodes); |
1083 | //selector = smgr->createTriangleSelector ( geometry, MapParent ); | 1083 | //selector = smgr->createTriangleSelector ( geometry, MapParent ); |
1084 | Meta->addTriangleSelector( selector); | 1084 | Meta->addTriangleSelector( selector); |
1085 | selector->drop (); | 1085 | selector->drop (); |
1086 | } | 1086 | } |
1087 | 1087 | ||
1088 | // logical parent for the items | 1088 | // logical parent for the items |
1089 | ItemParent = smgr->addEmptySceneNode(); | 1089 | ItemParent = smgr->addEmptySceneNode(); |
1090 | if ( ItemParent ) | 1090 | if ( ItemParent ) |
1091 | ItemParent->setName ( "Item Container" ); | 1091 | ItemParent->setName ( "Item Container" ); |
1092 | 1092 | ||
1093 | ShaderParent = smgr->addEmptySceneNode(); | 1093 | ShaderParent = smgr->addEmptySceneNode(); |
1094 | if ( ShaderParent ) | 1094 | if ( ShaderParent ) |
1095 | ShaderParent->setName ( "Shader Container" ); | 1095 | ShaderParent->setName ( "Shader Container" ); |
1096 | 1096 | ||
1097 | UnresolvedParent = smgr->addEmptySceneNode(); | 1097 | UnresolvedParent = smgr->addEmptySceneNode(); |
1098 | if ( UnresolvedParent ) | 1098 | if ( UnresolvedParent ) |
1099 | UnresolvedParent->setName ( "Unresolved Container" ); | 1099 | UnresolvedParent->setName ( "Unresolved Container" ); |
1100 | 1100 | ||
1101 | FogParent = smgr->addEmptySceneNode(); | 1101 | FogParent = smgr->addEmptySceneNode(); |
1102 | if ( FogParent ) | 1102 | if ( FogParent ) |
1103 | FogParent->setName ( "Fog Container" ); | 1103 | FogParent->setName ( "Fog Container" ); |
1104 | 1104 | ||
1105 | // logical parent for the bullets | 1105 | // logical parent for the bullets |
1106 | BulletParent = smgr->addEmptySceneNode(); | 1106 | BulletParent = smgr->addEmptySceneNode(); |
1107 | if ( BulletParent ) | 1107 | if ( BulletParent ) |
1108 | BulletParent->setName ( "Bullet Container" ); | 1108 | BulletParent->setName ( "Bullet Container" ); |
1109 | 1109 | ||
1110 | /* | 1110 | /* |
1111 | now construct SceneNodes for each Shader | 1111 | now construct SceneNodes for each Shader |
1112 | The Objects are stored in the quake mesh E_Q3_MESH_ITEMS | 1112 | The Objects are stored in the quake mesh E_Q3_MESH_ITEMS |
1113 | and the Shader ID is stored in the MaterialParameters | 1113 | and the Shader ID is stored in the MaterialParameters |
1114 | mostly dark looking skulls and moving lava.. or green flashing tubes? | 1114 | mostly dark looking skulls and moving lava.. or green flashing tubes? |
1115 | */ | 1115 | */ |
1116 | Q3ShaderFactory ( Game->loadParam, Game->Device, Mesh, E_Q3_MESH_ITEMS,ShaderParent, Meta, false ); | 1116 | Q3ShaderFactory ( Game->loadParam, Game->Device, Mesh, E_Q3_MESH_ITEMS,ShaderParent, Meta, false ); |
1117 | Q3ShaderFactory ( Game->loadParam, Game->Device, Mesh, E_Q3_MESH_FOG,FogParent, 0, false ); | 1117 | Q3ShaderFactory ( Game->loadParam, Game->Device, Mesh, E_Q3_MESH_FOG,FogParent, 0, false ); |
1118 | Q3ShaderFactory ( Game->loadParam, Game->Device, Mesh, E_Q3_MESH_UNRESOLVED,UnresolvedParent, Meta, true ); | 1118 | Q3ShaderFactory ( Game->loadParam, Game->Device, Mesh, E_Q3_MESH_UNRESOLVED,UnresolvedParent, Meta, true ); |
1119 | 1119 | ||
1120 | /* | 1120 | /* |
1121 | Now construct Models from Entity List | 1121 | Now construct Models from Entity List |
1122 | */ | 1122 | */ |
1123 | Q3ModelFactory ( Game->loadParam, Game->Device, Mesh, ItemParent, false ); | 1123 | Q3ModelFactory ( Game->loadParam, Game->Device, Mesh, ItemParent, false ); |
1124 | } | 1124 | } |
1125 | 1125 | ||
1126 | /* | 1126 | /* |
1127 | Adds a SceneNode with an icon to the Scene Tree | 1127 | Adds a SceneNode with an icon to the Scene Tree |
1128 | */ | 1128 | */ |
1129 | void CQuake3EventHandler::addSceneTreeItem( ISceneNode * parent, IGUITreeViewNode* nodeParent) | 1129 | void CQuake3EventHandler::addSceneTreeItem( ISceneNode * parent, IGUITreeViewNode* nodeParent) |
1130 | { | 1130 | { |
1131 | IGUITreeViewNode* node; | 1131 | IGUITreeViewNode* node; |
1132 | wchar_t msg[128]; | 1132 | wchar_t msg[128]; |
1133 | 1133 | ||
1134 | s32 imageIndex; | 1134 | s32 imageIndex; |
1135 | list<ISceneNode*>::ConstIterator it = parent->getChildren().begin(); | 1135 | list<ISceneNode*>::ConstIterator it = parent->getChildren().begin(); |
1136 | for (; it != parent->getChildren().end(); ++it) | 1136 | for (; it != parent->getChildren().end(); ++it) |
1137 | { | 1137 | { |
1138 | switch ( (*it)->getType () ) | 1138 | switch ( (*it)->getType () ) |
1139 | { | 1139 | { |
1140 | case ESNT_Q3SHADER_SCENE_NODE: imageIndex = 0; break; | 1140 | case ESNT_Q3SHADER_SCENE_NODE: imageIndex = 0; break; |
1141 | case ESNT_CAMERA: imageIndex = 1; break; | 1141 | case ESNT_CAMERA: imageIndex = 1; break; |
1142 | case ESNT_EMPTY: imageIndex = 2; break; | 1142 | case ESNT_EMPTY: imageIndex = 2; break; |
1143 | case ESNT_MESH: imageIndex = 3; break; | 1143 | case ESNT_MESH: imageIndex = 3; break; |
1144 | case ESNT_OCTREE: imageIndex = 3; break; | 1144 | case ESNT_OCTREE: imageIndex = 3; break; |
1145 | case ESNT_ANIMATED_MESH: imageIndex = 4; break; | 1145 | case ESNT_ANIMATED_MESH: imageIndex = 4; break; |
1146 | case ESNT_SKY_BOX: imageIndex = 5; break; | 1146 | case ESNT_SKY_BOX: imageIndex = 5; break; |
1147 | case ESNT_BILLBOARD: imageIndex = 6; break; | 1147 | case ESNT_BILLBOARD: imageIndex = 6; break; |
1148 | case ESNT_PARTICLE_SYSTEM: imageIndex = 7; break; | 1148 | case ESNT_PARTICLE_SYSTEM: imageIndex = 7; break; |
1149 | case ESNT_TEXT: imageIndex = 8; break; | 1149 | case ESNT_TEXT: imageIndex = 8; break; |
1150 | default:imageIndex = -1; break; | 1150 | default:imageIndex = -1; break; |
1151 | } | 1151 | } |
1152 | 1152 | ||
1153 | if ( imageIndex < 0 ) | 1153 | if ( imageIndex < 0 ) |
1154 | { | 1154 | { |
1155 | swprintf ( msg, 128, L"%hs,%hs", | 1155 | swprintf ( msg, 128, L"%hs,%hs", |
1156 | Game->Device->getSceneManager ()->getSceneNodeTypeName ( (*it)->getType () ), | 1156 | Game->Device->getSceneManager ()->getSceneNodeTypeName ( (*it)->getType () ), |
1157 | (*it)->getName() | 1157 | (*it)->getName() |
1158 | ); | 1158 | ); |
1159 | } | 1159 | } |
1160 | else | 1160 | else |
1161 | { | 1161 | { |
1162 | swprintf ( msg, 128, L"%hs",(*it)->getName() ); | 1162 | swprintf ( msg, 128, L"%hs",(*it)->getName() ); |
1163 | } | 1163 | } |
1164 | 1164 | ||
1165 | node = nodeParent->addChildBack( msg, 0, imageIndex ); | 1165 | node = nodeParent->addChildBack( msg, 0, imageIndex ); |
1166 | 1166 | ||
1167 | // Add all Animators | 1167 | // Add all Animators |
1168 | list<ISceneNodeAnimator*>::ConstIterator ait = (*it)->getAnimators().begin(); | 1168 | list<ISceneNodeAnimator*>::ConstIterator ait = (*it)->getAnimators().begin(); |
1169 | for (; ait != (*it)->getAnimators().end(); ++ait) | 1169 | for (; ait != (*it)->getAnimators().end(); ++ait) |
1170 | { | 1170 | { |
1171 | imageIndex = -1; | 1171 | imageIndex = -1; |
1172 | swprintf ( msg, 128, L"%hs", | 1172 | swprintf ( msg, 128, L"%hs", |
1173 | Game->Device->getSceneManager ()->getAnimatorTypeName ( (*ait)->getType () ) | 1173 | Game->Device->getSceneManager ()->getAnimatorTypeName ( (*ait)->getType () ) |
1174 | ); | 1174 | ); |
1175 | 1175 | ||
1176 | switch ( (*ait)->getType () ) | 1176 | switch ( (*ait)->getType () ) |
1177 | { | 1177 | { |
1178 | case ESNAT_FLY_CIRCLE: | 1178 | case ESNAT_FLY_CIRCLE: |
1179 | case ESNAT_FLY_STRAIGHT: | 1179 | case ESNAT_FLY_STRAIGHT: |
1180 | case ESNAT_FOLLOW_SPLINE: | 1180 | case ESNAT_FOLLOW_SPLINE: |
1181 | case ESNAT_ROTATION: | 1181 | case ESNAT_ROTATION: |
1182 | case ESNAT_TEXTURE: | 1182 | case ESNAT_TEXTURE: |
1183 | case ESNAT_DELETION: | 1183 | case ESNAT_DELETION: |
1184 | case ESNAT_COLLISION_RESPONSE: | 1184 | case ESNAT_COLLISION_RESPONSE: |
1185 | case ESNAT_CAMERA_FPS: | 1185 | case ESNAT_CAMERA_FPS: |
1186 | case ESNAT_CAMERA_MAYA: | 1186 | case ESNAT_CAMERA_MAYA: |
1187 | default: | 1187 | default: |
1188 | break; | 1188 | break; |
1189 | } | 1189 | } |
1190 | node->addChildBack( msg, 0, imageIndex ); | 1190 | node->addChildBack( msg, 0, imageIndex ); |
1191 | } | 1191 | } |
1192 | 1192 | ||
1193 | addSceneTreeItem ( *it, node ); | 1193 | addSceneTreeItem ( *it, node ); |
1194 | } | 1194 | } |
1195 | } | 1195 | } |
1196 | 1196 | ||
1197 | 1197 | ||
1198 | // Adds life! | 1198 | // Adds life! |
1199 | void CQuake3EventHandler::CreatePlayers() | 1199 | void CQuake3EventHandler::CreatePlayers() |
1200 | { | 1200 | { |
1201 | Player[0].create ( Game->Device, Mesh, MapParent, Meta ); | 1201 | Player[0].create ( Game->Device, Mesh, MapParent, Meta ); |
1202 | } | 1202 | } |
1203 | 1203 | ||
1204 | 1204 | ||
1205 | // Adds a skydome to the scene | 1205 | // Adds a skydome to the scene |
1206 | void CQuake3EventHandler::AddSky( u32 dome, const c8 *texture) | 1206 | void CQuake3EventHandler::AddSky( u32 dome, const c8 *texture) |
1207 | { | 1207 | { |
1208 | ISceneManager *smgr = Game->Device->getSceneManager (); | 1208 | ISceneManager *smgr = Game->Device->getSceneManager (); |
1209 | IVideoDriver * driver = Game->Device->getVideoDriver(); | 1209 | IVideoDriver * driver = Game->Device->getVideoDriver(); |
1210 | 1210 | ||
1211 | bool oldMipMapState = driver->getTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS); | 1211 | bool oldMipMapState = driver->getTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS); |
1212 | driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false); | 1212 | driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false); |
1213 | 1213 | ||
1214 | if ( 0 == dome ) | 1214 | if ( 0 == dome ) |
1215 | { | 1215 | { |
1216 | // irrlicht order | 1216 | // irrlicht order |
1217 | //static const c8*p[] = { "ft", "lf", "bk", "rt", "up", "dn" }; | 1217 | //static const c8*p[] = { "ft", "lf", "bk", "rt", "up", "dn" }; |
1218 | // quake3 order | 1218 | // quake3 order |
1219 | static const c8*p[] = { "ft", "rt", "bk", "lf", "up", "dn" }; | 1219 | static const c8*p[] = { "ft", "rt", "bk", "lf", "up", "dn" }; |
1220 | 1220 | ||
1221 | u32 i = 0; | 1221 | u32 i = 0; |
1222 | snprintf ( buf, 64, "%s_%s.jpg", texture, p[i] ); | 1222 | snprintf ( buf, 64, "%s_%s.jpg", texture, p[i] ); |
1223 | SkyNode = smgr->addSkyBoxSceneNode( driver->getTexture ( buf ), 0, 0, 0, 0, 0 ); | 1223 | SkyNode = smgr->addSkyBoxSceneNode( driver->getTexture ( buf ), 0, 0, 0, 0, 0 ); |
1224 | 1224 | ||
1225 | if (SkyNode) | 1225 | if (SkyNode) |
1226 | { | 1226 | { |
1227 | for ( i = 0; i < 6; ++i ) | 1227 | for ( i = 0; i < 6; ++i ) |
1228 | { | 1228 | { |
1229 | snprintf ( buf, 64, "%s_%s.jpg", texture, p[i] ); | 1229 | snprintf ( buf, 64, "%s_%s.jpg", texture, p[i] ); |
1230 | SkyNode->getMaterial(i).setTexture ( 0, driver->getTexture ( buf ) ); | 1230 | SkyNode->getMaterial(i).setTexture ( 0, driver->getTexture ( buf ) ); |
1231 | } | 1231 | } |
1232 | } | 1232 | } |
1233 | } | 1233 | } |
1234 | else | 1234 | else |
1235 | if ( 1 == dome ) | 1235 | if ( 1 == dome ) |
1236 | { | 1236 | { |
1237 | snprintf ( buf, 64, "%s.jpg", texture ); | 1237 | snprintf ( buf, 64, "%s.jpg", texture ); |
1238 | SkyNode = smgr->addSkyDomeSceneNode( | 1238 | SkyNode = smgr->addSkyDomeSceneNode( |
1239 | driver->getTexture( buf ), 32,32, | 1239 | driver->getTexture( buf ), 32,32, |
1240 | 1.f, 1.f, 1000.f, 0, 11); | 1240 | 1.f, 1.f, 1000.f, 0, 11); |
1241 | } | 1241 | } |
1242 | else | 1242 | else |
1243 | if ( 2 == dome ) | 1243 | if ( 2 == dome ) |
1244 | { | 1244 | { |
1245 | snprintf ( buf, 64, "%s.jpg", texture ); | 1245 | snprintf ( buf, 64, "%s.jpg", texture ); |
1246 | SkyNode = smgr->addSkyDomeSceneNode( | 1246 | SkyNode = smgr->addSkyDomeSceneNode( |
1247 | driver->getTexture( buf ), 16,8, | 1247 | driver->getTexture( buf ), 16,8, |
1248 | 0.95f, 2.f, 1000.f, 0, 11); | 1248 | 0.95f, 2.f, 1000.f, 0, 11); |
1249 | } | 1249 | } |
1250 | 1250 | ||
1251 | if (SkyNode) | 1251 | if (SkyNode) |
1252 | SkyNode->setName("Skydome"); | 1252 | SkyNode->setName("Skydome"); |
1253 | //SkyNode->getMaterial(0).ZBuffer = video::EMDF_DEPTH_LESS_EQUAL; | 1253 | //SkyNode->getMaterial(0).ZBuffer = video::EMDF_DEPTH_LESS_EQUAL; |
1254 | 1254 | ||
1255 | driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, oldMipMapState); | 1255 | driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, oldMipMapState); |
1256 | } | 1256 | } |
1257 | 1257 | ||
1258 | 1258 | ||
1259 | // enable GUI elements | 1259 | // enable GUI elements |
1260 | void CQuake3EventHandler::SetGUIActive( s32 command) | 1260 | void CQuake3EventHandler::SetGUIActive( s32 command) |
1261 | { | 1261 | { |
1262 | bool inputState = false; | 1262 | bool inputState = false; |
1263 | 1263 | ||
1264 | ICameraSceneNode * camera = Game->Device->getSceneManager()->getActiveCamera (); | 1264 | ICameraSceneNode * camera = Game->Device->getSceneManager()->getActiveCamera (); |
1265 | 1265 | ||
1266 | switch ( command ) | 1266 | switch ( command ) |
1267 | { | 1267 | { |
1268 | case 0: Game->guiActive = 0; inputState = !Game->guiActive; break; | 1268 | case 0: Game->guiActive = 0; inputState = !Game->guiActive; break; |
1269 | case 1: Game->guiActive = 1; inputState = !Game->guiActive;;break; | 1269 | case 1: Game->guiActive = 1; inputState = !Game->guiActive;;break; |
1270 | case 2: Game->guiActive ^= 1; inputState = !Game->guiActive;break; | 1270 | case 2: Game->guiActive ^= 1; inputState = !Game->guiActive;break; |
1271 | case 3: | 1271 | case 3: |
1272 | if ( camera ) | 1272 | if ( camera ) |
1273 | inputState = !camera->isInputReceiverEnabled(); | 1273 | inputState = !camera->isInputReceiverEnabled(); |
1274 | break; | 1274 | break; |
1275 | } | 1275 | } |
1276 | 1276 | ||
1277 | if ( camera ) | 1277 | if ( camera ) |
1278 | { | 1278 | { |
1279 | camera->setInputReceiverEnabled ( inputState ); | 1279 | camera->setInputReceiverEnabled ( inputState ); |
1280 | Game->Device->getCursorControl()->setVisible( !inputState ); | 1280 | Game->Device->getCursorControl()->setVisible( !inputState ); |
1281 | } | 1281 | } |
1282 | 1282 | ||
1283 | if ( gui.Window ) | 1283 | if ( gui.Window ) |
1284 | { | 1284 | { |
1285 | gui.Window->setVisible ( Game->guiActive != 0 ); | 1285 | gui.Window->setVisible ( Game->guiActive != 0 ); |
1286 | } | 1286 | } |
1287 | 1287 | ||
1288 | if ( Game->guiActive && | 1288 | if ( Game->guiActive && |
1289 | gui.SceneTree && Game->Device->getGUIEnvironment()->getFocus() != gui.SceneTree | 1289 | gui.SceneTree && Game->Device->getGUIEnvironment()->getFocus() != gui.SceneTree |
1290 | ) | 1290 | ) |
1291 | { | 1291 | { |
1292 | gui.SceneTree->getRoot()->clearChildren(); | 1292 | gui.SceneTree->getRoot()->clearChildren(); |
1293 | addSceneTreeItem ( Game->Device->getSceneManager()->getRootSceneNode(), gui.SceneTree->getRoot() ); | 1293 | addSceneTreeItem ( Game->Device->getSceneManager()->getRootSceneNode(), gui.SceneTree->getRoot() ); |
1294 | } | 1294 | } |
1295 | 1295 | ||
1296 | Game->Device->getGUIEnvironment()->setFocus ( Game->guiActive ? gui.Window: 0 ); | 1296 | Game->Device->getGUIEnvironment()->setFocus ( Game->guiActive ? gui.Window: 0 ); |
1297 | } | 1297 | } |
1298 | 1298 | ||
1299 | 1299 | ||
1300 | /* | 1300 | /* |
1301 | Handle game input | 1301 | Handle game input |
1302 | */ | 1302 | */ |
1303 | bool CQuake3EventHandler::OnEvent(const SEvent& eve) | 1303 | bool CQuake3EventHandler::OnEvent(const SEvent& eve) |
1304 | { | 1304 | { |
1305 | if ( eve.EventType == EET_LOG_TEXT_EVENT ) | 1305 | if ( eve.EventType == EET_LOG_TEXT_EVENT ) |
1306 | { | 1306 | { |
1307 | return false; | 1307 | return false; |
1308 | } | 1308 | } |
1309 | 1309 | ||
1310 | if ( Game->guiActive && eve.EventType == EET_GUI_EVENT ) | 1310 | if ( Game->guiActive && eve.EventType == EET_GUI_EVENT ) |
1311 | { | 1311 | { |
1312 | if ( eve.GUIEvent.Caller == gui.MapList && eve.GUIEvent.EventType == gui::EGET_LISTBOX_SELECTED_AGAIN ) | 1312 | if ( eve.GUIEvent.Caller == gui.MapList && eve.GUIEvent.EventType == gui::EGET_LISTBOX_SELECTED_AGAIN ) |
1313 | { | 1313 | { |
1314 | s32 selected = gui.MapList->getSelected(); | 1314 | s32 selected = gui.MapList->getSelected(); |
1315 | if ( selected >= 0 ) | 1315 | if ( selected >= 0 ) |
1316 | { | 1316 | { |
1317 | stringw loadMap = gui.MapList->getListItem ( selected ); | 1317 | stringw loadMap = gui.MapList->getListItem ( selected ); |
1318 | if ( 0 == MapParent || loadMap != Game->CurrentMapName ) | 1318 | if ( 0 == MapParent || loadMap != Game->CurrentMapName ) |
1319 | { | 1319 | { |
1320 | printf ( "Loading map %ls\n", loadMap.c_str() ); | 1320 | printf ( "Loading map %ls\n", loadMap.c_str() ); |
1321 | LoadMap ( loadMap , 1 ); | 1321 | LoadMap ( loadMap , 1 ); |
1322 | if ( 0 == Game->loadParam.loadSkyShader ) | 1322 | if ( 0 == Game->loadParam.loadSkyShader ) |
1323 | { | 1323 | { |
1324 | AddSky ( 1, "skydome2" ); | 1324 | AddSky ( 1, "skydome2" ); |
1325 | } | 1325 | } |
1326 | CreatePlayers (); | 1326 | CreatePlayers (); |
1327 | CreateGUI (); | 1327 | CreateGUI (); |
1328 | SetGUIActive ( 0 ); | 1328 | SetGUIActive ( 0 ); |
1329 | return true; | 1329 | return true; |
1330 | } | 1330 | } |
1331 | } | 1331 | } |
1332 | } | 1332 | } |
1333 | else | 1333 | else |
1334 | if ( eve.GUIEvent.Caller == gui.ArchiveRemove && eve.GUIEvent.EventType == gui::EGET_BUTTON_CLICKED ) | 1334 | if ( eve.GUIEvent.Caller == gui.ArchiveRemove && eve.GUIEvent.EventType == gui::EGET_BUTTON_CLICKED ) |
1335 | { | 1335 | { |
1336 | Game->Device->getFileSystem()->removeFileArchive( gui.ArchiveList->getSelected() ); | 1336 | Game->Device->getFileSystem()->removeFileArchive( gui.ArchiveList->getSelected() ); |
1337 | Game->CurrentMapName = ""; | 1337 | Game->CurrentMapName = ""; |
1338 | AddArchive ( "" ); | 1338 | AddArchive ( "" ); |
1339 | } | 1339 | } |
1340 | else | 1340 | else |
1341 | if ( eve.GUIEvent.Caller == gui.ArchiveAdd && eve.GUIEvent.EventType == gui::EGET_BUTTON_CLICKED ) | 1341 | if ( eve.GUIEvent.Caller == gui.ArchiveAdd && eve.GUIEvent.EventType == gui::EGET_BUTTON_CLICKED ) |
1342 | { | 1342 | { |
1343 | if ( 0 == gui.ArchiveFileOpen ) | 1343 | if ( 0 == gui.ArchiveFileOpen ) |
1344 | { | 1344 | { |
1345 | Game->Device->getFileSystem()->setFileListSystem ( FILESYSTEM_NATIVE ); | 1345 | Game->Device->getFileSystem()->setFileListSystem ( FILESYSTEM_NATIVE ); |
1346 | gui.ArchiveFileOpen = Game->Device->getGUIEnvironment()->addFileOpenDialog ( L"Add Game Archive" , false,gui.Window ); | 1346 | gui.ArchiveFileOpen = Game->Device->getGUIEnvironment()->addFileOpenDialog ( L"Add Game Archive" , false,gui.Window ); |
1347 | } | 1347 | } |
1348 | } | 1348 | } |
1349 | else | 1349 | else |
1350 | if ( eve.GUIEvent.Caller == gui.ArchiveFileOpen && eve.GUIEvent.EventType == gui::EGET_FILE_SELECTED ) | 1350 | if ( eve.GUIEvent.Caller == gui.ArchiveFileOpen && eve.GUIEvent.EventType == gui::EGET_FILE_SELECTED ) |
1351 | { | 1351 | { |
1352 | AddArchive ( gui.ArchiveFileOpen->getFileName() ); | 1352 | AddArchive ( gui.ArchiveFileOpen->getFileName() ); |
1353 | gui.ArchiveFileOpen = 0; | 1353 | gui.ArchiveFileOpen = 0; |
1354 | } | 1354 | } |
1355 | else | 1355 | else |
1356 | if ( eve.GUIEvent.Caller == gui.ArchiveFileOpen && eve.GUIEvent.EventType == gui::EGET_DIRECTORY_SELECTED ) | 1356 | if ( eve.GUIEvent.Caller == gui.ArchiveFileOpen && eve.GUIEvent.EventType == gui::EGET_DIRECTORY_SELECTED ) |
1357 | { | 1357 | { |
1358 | AddArchive ( gui.ArchiveFileOpen->getDirectoryName() ); | 1358 | AddArchive ( gui.ArchiveFileOpen->getDirectoryName() ); |
1359 | } | 1359 | } |
1360 | else | 1360 | else |
1361 | if ( eve.GUIEvent.Caller == gui.ArchiveFileOpen && eve.GUIEvent.EventType == gui::EGET_FILE_CHOOSE_DIALOG_CANCELLED ) | 1361 | if ( eve.GUIEvent.Caller == gui.ArchiveFileOpen && eve.GUIEvent.EventType == gui::EGET_FILE_CHOOSE_DIALOG_CANCELLED ) |
1362 | { | 1362 | { |
1363 | gui.ArchiveFileOpen = 0; | 1363 | gui.ArchiveFileOpen = 0; |
1364 | } | 1364 | } |
1365 | else | 1365 | else |
1366 | if ( ( eve.GUIEvent.Caller == gui.ArchiveUp || eve.GUIEvent.Caller == gui.ArchiveDown ) && | 1366 | if ( ( eve.GUIEvent.Caller == gui.ArchiveUp || eve.GUIEvent.Caller == gui.ArchiveDown ) && |
1367 | eve.GUIEvent.EventType == gui::EGET_BUTTON_CLICKED ) | 1367 | eve.GUIEvent.EventType == gui::EGET_BUTTON_CLICKED ) |
1368 | { | 1368 | { |
1369 | s32 rel = eve.GUIEvent.Caller == gui.ArchiveUp ? -1 : 1; | 1369 | s32 rel = eve.GUIEvent.Caller == gui.ArchiveUp ? -1 : 1; |
1370 | if ( Game->Device->getFileSystem()->moveFileArchive ( gui.ArchiveList->getSelected (), rel ) ) | 1370 | if ( Game->Device->getFileSystem()->moveFileArchive ( gui.ArchiveList->getSelected (), rel ) ) |
1371 | { | 1371 | { |
1372 | s32 newIndex = core::s32_clamp ( gui.ArchiveList->getSelected() + rel, 0, gui.ArchiveList->getRowCount() - 1 ); | 1372 | s32 newIndex = core::s32_clamp ( gui.ArchiveList->getSelected() + rel, 0, gui.ArchiveList->getRowCount() - 1 ); |
1373 | AddArchive ( "" ); | 1373 | AddArchive ( "" ); |
1374 | gui.ArchiveList->setSelected ( newIndex ); | 1374 | gui.ArchiveList->setSelected ( newIndex ); |
1375 | Game->CurrentMapName = ""; | 1375 | Game->CurrentMapName = ""; |
1376 | } | 1376 | } |
1377 | } | 1377 | } |
1378 | else | 1378 | else |
1379 | if ( eve.GUIEvent.Caller == gui.VideoDriver && eve.GUIEvent.EventType == gui::EGET_COMBO_BOX_CHANGED ) | 1379 | if ( eve.GUIEvent.Caller == gui.VideoDriver && eve.GUIEvent.EventType == gui::EGET_COMBO_BOX_CHANGED ) |
1380 | { | 1380 | { |
1381 | Game->deviceParam.DriverType = (E_DRIVER_TYPE) gui.VideoDriver->getItemData ( gui.VideoDriver->getSelected() ); | 1381 | Game->deviceParam.DriverType = (E_DRIVER_TYPE) gui.VideoDriver->getItemData ( gui.VideoDriver->getSelected() ); |
1382 | } | 1382 | } |
1383 | else | 1383 | else |
1384 | if ( eve.GUIEvent.Caller == gui.VideoMode && eve.GUIEvent.EventType == gui::EGET_COMBO_BOX_CHANGED ) | 1384 | if ( eve.GUIEvent.Caller == gui.VideoMode && eve.GUIEvent.EventType == gui::EGET_COMBO_BOX_CHANGED ) |
1385 | { | 1385 | { |
1386 | u32 val = gui.VideoMode->getItemData ( gui.VideoMode->getSelected() ); | 1386 | u32 val = gui.VideoMode->getItemData ( gui.VideoMode->getSelected() ); |
1387 | Game->deviceParam.WindowSize.Width = val >> 16; | 1387 | Game->deviceParam.WindowSize.Width = val >> 16; |
1388 | Game->deviceParam.WindowSize.Height = val & 0xFFFF; | 1388 | Game->deviceParam.WindowSize.Height = val & 0xFFFF; |
1389 | } | 1389 | } |
1390 | else | 1390 | else |
1391 | if ( eve.GUIEvent.Caller == gui.FullScreen && eve.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) | 1391 | if ( eve.GUIEvent.Caller == gui.FullScreen && eve.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) |
1392 | { | 1392 | { |
1393 | Game->deviceParam.Fullscreen = gui.FullScreen->isChecked(); | 1393 | Game->deviceParam.Fullscreen = gui.FullScreen->isChecked(); |
1394 | } | 1394 | } |
1395 | else | 1395 | else |
1396 | if ( eve.GUIEvent.Caller == gui.Bit32 && eve.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) | 1396 | if ( eve.GUIEvent.Caller == gui.Bit32 && eve.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) |
1397 | { | 1397 | { |
1398 | Game->deviceParam.Bits = gui.Bit32->isChecked() ? 32 : 16; | 1398 | Game->deviceParam.Bits = gui.Bit32->isChecked() ? 32 : 16; |
1399 | } | 1399 | } |
1400 | else | 1400 | else |
1401 | if ( eve.GUIEvent.Caller == gui.MultiSample && eve.GUIEvent.EventType == gui::EGET_SCROLL_BAR_CHANGED ) | 1401 | if ( eve.GUIEvent.Caller == gui.MultiSample && eve.GUIEvent.EventType == gui::EGET_SCROLL_BAR_CHANGED ) |
1402 | { | 1402 | { |
1403 | Game->deviceParam.AntiAlias = gui.MultiSample->getPos(); | 1403 | Game->deviceParam.AntiAlias = gui.MultiSample->getPos(); |
1404 | } | 1404 | } |
1405 | else | 1405 | else |
1406 | if ( eve.GUIEvent.Caller == gui.Tesselation && eve.GUIEvent.EventType == gui::EGET_SCROLL_BAR_CHANGED ) | 1406 | if ( eve.GUIEvent.Caller == gui.Tesselation && eve.GUIEvent.EventType == gui::EGET_SCROLL_BAR_CHANGED ) |
1407 | { | 1407 | { |
1408 | Game->loadParam.patchTesselation = gui.Tesselation->getPos (); | 1408 | Game->loadParam.patchTesselation = gui.Tesselation->getPos (); |
1409 | } | 1409 | } |
1410 | else | 1410 | else |
1411 | if ( eve.GUIEvent.Caller == gui.Gamma && eve.GUIEvent.EventType == gui::EGET_SCROLL_BAR_CHANGED ) | 1411 | if ( eve.GUIEvent.Caller == gui.Gamma && eve.GUIEvent.EventType == gui::EGET_SCROLL_BAR_CHANGED ) |
1412 | { | 1412 | { |
1413 | Game->GammaValue = gui.Gamma->getPos () * 0.01f; | 1413 | Game->GammaValue = gui.Gamma->getPos () * 0.01f; |
1414 | Game->Device->setGammaRamp ( Game->GammaValue, Game->GammaValue, Game->GammaValue, 0.f, 0.f ); | 1414 | Game->Device->setGammaRamp ( Game->GammaValue, Game->GammaValue, Game->GammaValue, 0.f, 0.f ); |
1415 | } | 1415 | } |
1416 | else | 1416 | else |
1417 | if ( eve.GUIEvent.Caller == gui.SetVideoMode && eve.GUIEvent.EventType == gui::EGET_BUTTON_CLICKED ) | 1417 | if ( eve.GUIEvent.Caller == gui.SetVideoMode && eve.GUIEvent.EventType == gui::EGET_BUTTON_CLICKED ) |
1418 | { | 1418 | { |
1419 | Game->retVal = 2; | 1419 | Game->retVal = 2; |
1420 | Game->Device->closeDevice(); | 1420 | Game->Device->closeDevice(); |
1421 | } | 1421 | } |
1422 | else | 1422 | else |
1423 | if ( eve.GUIEvent.Caller == gui.Window && eve.GUIEvent.EventType == gui::EGET_ELEMENT_CLOSED ) | 1423 | if ( eve.GUIEvent.Caller == gui.Window && eve.GUIEvent.EventType == gui::EGET_ELEMENT_CLOSED ) |
1424 | { | 1424 | { |
1425 | Game->Device->closeDevice(); | 1425 | Game->Device->closeDevice(); |
1426 | } | 1426 | } |
1427 | else | 1427 | else |
1428 | if ( eve.GUIEvent.Caller == gui.Collision && eve.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) | 1428 | if ( eve.GUIEvent.Caller == gui.Collision && eve.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) |
1429 | { | 1429 | { |
1430 | // set fly through active | 1430 | // set fly through active |
1431 | Game->flyTroughState ^= 1; | 1431 | Game->flyTroughState ^= 1; |
1432 | Player[0].cam()->setAnimateTarget ( Game->flyTroughState == 0 ); | 1432 | Player[0].cam()->setAnimateTarget ( Game->flyTroughState == 0 ); |
1433 | 1433 | ||
1434 | printf ( "collision %d\n", Game->flyTroughState == 0 ); | 1434 | printf ( "collision %d\n", Game->flyTroughState == 0 ); |
1435 | } | 1435 | } |
1436 | else | 1436 | else |
1437 | if ( eve.GUIEvent.Caller == gui.Visible_Map && eve.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) | 1437 | if ( eve.GUIEvent.Caller == gui.Visible_Map && eve.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) |
1438 | { | 1438 | { |
1439 | bool v = gui.Visible_Map->isChecked(); | 1439 | bool v = gui.Visible_Map->isChecked(); |
1440 | 1440 | ||
1441 | if ( MapParent ) | 1441 | if ( MapParent ) |
1442 | { | 1442 | { |
1443 | printf ( "static node set visible %d\n",v ); | 1443 | printf ( "static node set visible %d\n",v ); |
1444 | MapParent->setVisible ( v ); | 1444 | MapParent->setVisible ( v ); |
1445 | } | 1445 | } |
1446 | } | 1446 | } |
1447 | else | 1447 | else |
1448 | if ( eve.GUIEvent.Caller == gui.Visible_Shader && eve.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) | 1448 | if ( eve.GUIEvent.Caller == gui.Visible_Shader && eve.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) |
1449 | { | 1449 | { |
1450 | bool v = gui.Visible_Shader->isChecked(); | 1450 | bool v = gui.Visible_Shader->isChecked(); |
1451 | 1451 | ||
1452 | if ( ShaderParent ) | 1452 | if ( ShaderParent ) |
1453 | { | 1453 | { |
1454 | printf ( "shader node set visible %d\n",v ); | 1454 | printf ( "shader node set visible %d\n",v ); |
1455 | ShaderParent->setVisible ( v ); | 1455 | ShaderParent->setVisible ( v ); |
1456 | } | 1456 | } |
1457 | } | 1457 | } |
1458 | else | 1458 | else |
1459 | if ( eve.GUIEvent.Caller == gui.Visible_Skydome && eve.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) | 1459 | if ( eve.GUIEvent.Caller == gui.Visible_Skydome && eve.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) |
1460 | { | 1460 | { |
1461 | if ( SkyNode ) | 1461 | if ( SkyNode ) |
1462 | { | 1462 | { |
1463 | bool v = !SkyNode->isVisible(); | 1463 | bool v = !SkyNode->isVisible(); |
1464 | printf ( "skynode set visible %d\n",v ); | 1464 | printf ( "skynode set visible %d\n",v ); |
1465 | SkyNode->setVisible ( v ); | 1465 | SkyNode->setVisible ( v ); |
1466 | } | 1466 | } |
1467 | } | 1467 | } |
1468 | else | 1468 | else |
1469 | if ( eve.GUIEvent.Caller == gui.Respawn && eve.GUIEvent.EventType == gui::EGET_BUTTON_CLICKED ) | 1469 | if ( eve.GUIEvent.Caller == gui.Respawn && eve.GUIEvent.EventType == gui::EGET_BUTTON_CLICKED ) |
1470 | { | 1470 | { |
1471 | Player[0].respawn (); | 1471 | Player[0].respawn (); |
1472 | } | 1472 | } |
1473 | 1473 | ||
1474 | return false; | 1474 | return false; |
1475 | } | 1475 | } |
1476 | 1476 | ||
1477 | // fire | 1477 | // fire |
1478 | if ((eve.EventType == EET_KEY_INPUT_EVENT && eve.KeyInput.Key == KEY_SPACE && | 1478 | if ((eve.EventType == EET_KEY_INPUT_EVENT && eve.KeyInput.Key == KEY_SPACE && |
1479 | eve.KeyInput.PressedDown == false) || | 1479 | eve.KeyInput.PressedDown == false) || |
1480 | (eve.EventType == EET_MOUSE_INPUT_EVENT && eve.MouseInput.Event == EMIE_LMOUSE_LEFT_UP) | 1480 | (eve.EventType == EET_MOUSE_INPUT_EVENT && eve.MouseInput.Event == EMIE_LMOUSE_LEFT_UP) |
1481 | ) | 1481 | ) |
1482 | { | 1482 | { |
1483 | ICameraSceneNode * camera = Game->Device->getSceneManager()->getActiveCamera (); | 1483 | ICameraSceneNode * camera = Game->Device->getSceneManager()->getActiveCamera (); |
1484 | if ( camera && camera->isInputReceiverEnabled () ) | 1484 | if ( camera && camera->isInputReceiverEnabled () ) |
1485 | { | 1485 | { |
1486 | useItem( Player + 0 ); | 1486 | useItem( Player + 0 ); |
1487 | } | 1487 | } |
1488 | } | 1488 | } |
1489 | 1489 | ||
1490 | // gui active | 1490 | // gui active |
1491 | if ((eve.EventType == EET_KEY_INPUT_EVENT && eve.KeyInput.Key == KEY_F1 && | 1491 | if ((eve.EventType == EET_KEY_INPUT_EVENT && eve.KeyInput.Key == KEY_F1 && |
1492 | eve.KeyInput.PressedDown == false) || | 1492 | eve.KeyInput.PressedDown == false) || |
1493 | (eve.EventType == EET_MOUSE_INPUT_EVENT && eve.MouseInput.Event == EMIE_RMOUSE_LEFT_UP) | 1493 | (eve.EventType == EET_MOUSE_INPUT_EVENT && eve.MouseInput.Event == EMIE_RMOUSE_LEFT_UP) |
1494 | ) | 1494 | ) |
1495 | { | 1495 | { |
1496 | SetGUIActive ( 2 ); | 1496 | SetGUIActive ( 2 ); |
1497 | } | 1497 | } |
1498 | 1498 | ||
1499 | // check if user presses the key | 1499 | // check if user presses the key |
1500 | if ( eve.EventType == EET_KEY_INPUT_EVENT && eve.KeyInput.PressedDown == false) | 1500 | if ( eve.EventType == EET_KEY_INPUT_EVENT && eve.KeyInput.PressedDown == false) |
1501 | { | 1501 | { |
1502 | // Escape toggles camera Input | 1502 | // Escape toggles camera Input |
1503 | if ( eve.KeyInput.Key == irr::KEY_ESCAPE ) | 1503 | if ( eve.KeyInput.Key == irr::KEY_ESCAPE ) |
1504 | { | 1504 | { |
1505 | SetGUIActive ( 3 ); | 1505 | SetGUIActive ( 3 ); |
1506 | } | 1506 | } |
1507 | else | 1507 | else |
1508 | if (eve.KeyInput.Key == KEY_F11) | 1508 | if (eve.KeyInput.Key == KEY_F11) |
1509 | { | 1509 | { |
1510 | // screenshot are taken without gamma! | 1510 | // screenshot are taken without gamma! |
1511 | IImage* image = Game->Device->getVideoDriver()->createScreenShot(); | 1511 | IImage* image = Game->Device->getVideoDriver()->createScreenShot(); |
1512 | if (image) | 1512 | if (image) |
1513 | { | 1513 | { |
1514 | core::vector3df pos; | 1514 | core::vector3df pos; |
1515 | core::vector3df rot; | 1515 | core::vector3df rot; |
1516 | ICameraSceneNode * cam = Game->Device->getSceneManager()->getActiveCamera (); | 1516 | ICameraSceneNode * cam = Game->Device->getSceneManager()->getActiveCamera (); |
1517 | if ( cam ) | 1517 | if ( cam ) |
1518 | { | 1518 | { |
1519 | pos = cam->getPosition (); | 1519 | pos = cam->getPosition (); |
1520 | rot = cam->getRotation (); | 1520 | rot = cam->getRotation (); |
1521 | } | 1521 | } |
1522 | 1522 | ||
1523 | static const c8 *dName[] = { "null", "software", "burning", | 1523 | static const c8 *dName[] = { "null", "software", "burning", |
1524 | "d3d8", "d3d9", "opengl" }; | 1524 | "d3d8", "d3d9", "opengl" }; |
1525 | 1525 | ||
1526 | snprintf(buf, 256, "%s_%ls_%.0f_%.0f_%.0f_%.0f_%.0f_%.0f.jpg", | 1526 | snprintf(buf, 256, "%s_%ls_%.0f_%.0f_%.0f_%.0f_%.0f_%.0f.jpg", |
1527 | dName[Game->Device->getVideoDriver()->getDriverType()], | 1527 | dName[Game->Device->getVideoDriver()->getDriverType()], |
1528 | Game->CurrentMapName.c_str(), | 1528 | Game->CurrentMapName.c_str(), |
1529 | pos.X, pos.Y, pos.Z, | 1529 | pos.X, pos.Y, pos.Z, |
1530 | rot.X, rot.Y, rot.Z | 1530 | rot.X, rot.Y, rot.Z |
1531 | ); | 1531 | ); |
1532 | path filename ( buf ); | 1532 | path filename ( buf ); |
1533 | filename.replace ( '/', '_' ); | 1533 | filename.replace ( '/', '_' ); |
1534 | printf ( "screenshot : %s\n", filename.c_str() ); | 1534 | printf ( "screenshot : %s\n", filename.c_str() ); |
1535 | Game->Device->getVideoDriver()->writeImageToFile(image, filename, 100 ); | 1535 | Game->Device->getVideoDriver()->writeImageToFile(image, filename, 100 ); |
1536 | image->drop(); | 1536 | image->drop(); |
1537 | } | 1537 | } |
1538 | } | 1538 | } |
1539 | else | 1539 | else |
1540 | if (eve.KeyInput.Key == KEY_F9) | 1540 | if (eve.KeyInput.Key == KEY_F9) |
1541 | { | 1541 | { |
1542 | s32 value = EDS_OFF; | 1542 | s32 value = EDS_OFF; |
1543 | 1543 | ||
1544 | Game->debugState = ( Game->debugState + 1 ) & 3; | 1544 | Game->debugState = ( Game->debugState + 1 ) & 3; |
1545 | 1545 | ||
1546 | switch ( Game->debugState ) | 1546 | switch ( Game->debugState ) |
1547 | { | 1547 | { |
1548 | case 1: value = EDS_NORMALS | EDS_MESH_WIRE_OVERLAY | EDS_BBOX_ALL; break; | 1548 | case 1: value = EDS_NORMALS | EDS_MESH_WIRE_OVERLAY | EDS_BBOX_ALL; break; |
1549 | case 2: value = EDS_NORMALS | EDS_MESH_WIRE_OVERLAY | EDS_SKELETON; break; | 1549 | case 2: value = EDS_NORMALS | EDS_MESH_WIRE_OVERLAY | EDS_SKELETON; break; |
1550 | } | 1550 | } |
1551 | /* | 1551 | /* |
1552 | // set debug map data on/off | 1552 | // set debug map data on/off |
1553 | debugState = debugState == EDS_OFF ? | 1553 | debugState = debugState == EDS_OFF ? |
1554 | EDS_NORMALS | EDS_MESH_WIRE_OVERLAY | EDS_BBOX_ALL: | 1554 | EDS_NORMALS | EDS_MESH_WIRE_OVERLAY | EDS_BBOX_ALL: |
1555 | EDS_OFF; | 1555 | EDS_OFF; |
1556 | */ | 1556 | */ |
1557 | if ( ItemParent ) | 1557 | if ( ItemParent ) |
1558 | { | 1558 | { |
1559 | list<ISceneNode*>::ConstIterator it = ItemParent->getChildren().begin(); | 1559 | list<ISceneNode*>::ConstIterator it = ItemParent->getChildren().begin(); |
1560 | for (; it != ItemParent->getChildren().end(); ++it) | 1560 | for (; it != ItemParent->getChildren().end(); ++it) |
1561 | { | 1561 | { |
1562 | (*it)->setDebugDataVisible ( value ); | 1562 | (*it)->setDebugDataVisible ( value ); |
1563 | } | 1563 | } |
1564 | } | 1564 | } |
1565 | 1565 | ||
1566 | if ( ShaderParent ) | 1566 | if ( ShaderParent ) |
1567 | { | 1567 | { |
1568 | list<ISceneNode*>::ConstIterator it = ShaderParent->getChildren().begin(); | 1568 | list<ISceneNode*>::ConstIterator it = ShaderParent->getChildren().begin(); |
1569 | for (; it != ShaderParent->getChildren().end(); ++it) | 1569 | for (; it != ShaderParent->getChildren().end(); ++it) |
1570 | { | 1570 | { |
1571 | (*it)->setDebugDataVisible ( value ); | 1571 | (*it)->setDebugDataVisible ( value ); |
1572 | } | 1572 | } |
1573 | } | 1573 | } |
1574 | 1574 | ||
1575 | if ( UnresolvedParent ) | 1575 | if ( UnresolvedParent ) |
1576 | { | 1576 | { |
1577 | list<ISceneNode*>::ConstIterator it = UnresolvedParent->getChildren().begin(); | 1577 | list<ISceneNode*>::ConstIterator it = UnresolvedParent->getChildren().begin(); |
1578 | for (; it != UnresolvedParent->getChildren().end(); ++it) | 1578 | for (; it != UnresolvedParent->getChildren().end(); ++it) |
1579 | { | 1579 | { |
1580 | (*it)->setDebugDataVisible ( value ); | 1580 | (*it)->setDebugDataVisible ( value ); |
1581 | } | 1581 | } |
1582 | } | 1582 | } |
1583 | 1583 | ||
1584 | if ( FogParent ) | 1584 | if ( FogParent ) |
1585 | { | 1585 | { |
1586 | list<ISceneNode*>::ConstIterator it = FogParent->getChildren().begin(); | 1586 | list<ISceneNode*>::ConstIterator it = FogParent->getChildren().begin(); |
1587 | for (; it != FogParent->getChildren().end(); ++it) | 1587 | for (; it != FogParent->getChildren().end(); ++it) |
1588 | { | 1588 | { |
1589 | (*it)->setDebugDataVisible ( value ); | 1589 | (*it)->setDebugDataVisible ( value ); |
1590 | } | 1590 | } |
1591 | } | 1591 | } |
1592 | 1592 | ||
1593 | if ( SkyNode ) | 1593 | if ( SkyNode ) |
1594 | { | 1594 | { |
1595 | SkyNode->setDebugDataVisible ( value ); | 1595 | SkyNode->setDebugDataVisible ( value ); |
1596 | } | 1596 | } |
1597 | 1597 | ||
1598 | } | 1598 | } |
1599 | else | 1599 | else |
1600 | if (eve.KeyInput.Key == KEY_F8) | 1600 | if (eve.KeyInput.Key == KEY_F8) |
1601 | { | 1601 | { |
1602 | // set gravity on/off | 1602 | // set gravity on/off |
1603 | Game->gravityState ^= 1; | 1603 | Game->gravityState ^= 1; |
1604 | Player[0].cam()->setGravity ( getGravity ( Game->gravityState ? "earth" : "none" ) ); | 1604 | Player[0].cam()->setGravity ( getGravity ( Game->gravityState ? "earth" : "none" ) ); |
1605 | printf ( "gravity %s\n", Game->gravityState ? "earth" : "none" ); | 1605 | printf ( "gravity %s\n", Game->gravityState ? "earth" : "none" ); |
1606 | } | 1606 | } |
1607 | else | 1607 | else |
1608 | if (eve.KeyInput.Key == KEY_F7) | 1608 | if (eve.KeyInput.Key == KEY_F7) |
1609 | { | 1609 | { |
1610 | // set fly through active | 1610 | // set fly through active |
1611 | Game->flyTroughState ^= 1; | 1611 | Game->flyTroughState ^= 1; |
1612 | Player[0].cam()->setAnimateTarget ( Game->flyTroughState == 0 ); | 1612 | Player[0].cam()->setAnimateTarget ( Game->flyTroughState == 0 ); |
1613 | if ( gui.Collision ) | 1613 | if ( gui.Collision ) |
1614 | gui.Collision->setChecked ( Game->flyTroughState == 0 ); | 1614 | gui.Collision->setChecked ( Game->flyTroughState == 0 ); |
1615 | 1615 | ||
1616 | printf ( "collision %d\n", Game->flyTroughState == 0 ); | 1616 | printf ( "collision %d\n", Game->flyTroughState == 0 ); |
1617 | } | 1617 | } |
1618 | else | 1618 | else |
1619 | if (eve.KeyInput.Key == KEY_F2) | 1619 | if (eve.KeyInput.Key == KEY_F2) |
1620 | { | 1620 | { |
1621 | Player[0].respawn (); | 1621 | Player[0].respawn (); |
1622 | } | 1622 | } |
1623 | else | 1623 | else |
1624 | if (eve.KeyInput.Key == KEY_F3) | 1624 | if (eve.KeyInput.Key == KEY_F3) |
1625 | { | 1625 | { |
1626 | if ( MapParent ) | 1626 | if ( MapParent ) |
1627 | { | 1627 | { |
1628 | bool v = !MapParent->isVisible (); | 1628 | bool v = !MapParent->isVisible (); |
1629 | printf ( "static node set visible %d\n",v ); | 1629 | printf ( "static node set visible %d\n",v ); |
1630 | MapParent->setVisible ( v ); | 1630 | MapParent->setVisible ( v ); |
1631 | if ( gui.Visible_Map ) | 1631 | if ( gui.Visible_Map ) |
1632 | gui.Visible_Map->setChecked ( v ); | 1632 | gui.Visible_Map->setChecked ( v ); |
1633 | } | 1633 | } |
1634 | } | 1634 | } |
1635 | else | 1635 | else |
1636 | if (eve.KeyInput.Key == KEY_F4) | 1636 | if (eve.KeyInput.Key == KEY_F4) |
1637 | { | 1637 | { |
1638 | if ( ShaderParent ) | 1638 | if ( ShaderParent ) |
1639 | { | 1639 | { |
1640 | bool v = !ShaderParent->isVisible (); | 1640 | bool v = !ShaderParent->isVisible (); |
1641 | printf ( "shader node set visible %d\n",v ); | 1641 | printf ( "shader node set visible %d\n",v ); |
1642 | ShaderParent->setVisible ( v ); | 1642 | ShaderParent->setVisible ( v ); |
1643 | if ( gui.Visible_Shader ) | 1643 | if ( gui.Visible_Shader ) |
1644 | gui.Visible_Shader->setChecked ( v ); | 1644 | gui.Visible_Shader->setChecked ( v ); |
1645 | } | 1645 | } |
1646 | } | 1646 | } |
1647 | else | 1647 | else |
1648 | if (eve.KeyInput.Key == KEY_F5) | 1648 | if (eve.KeyInput.Key == KEY_F5) |
1649 | { | 1649 | { |
1650 | if ( FogParent ) | 1650 | if ( FogParent ) |
1651 | { | 1651 | { |
1652 | bool v = !FogParent->isVisible (); | 1652 | bool v = !FogParent->isVisible (); |
1653 | printf ( "fog node set visible %d\n",v ); | 1653 | printf ( "fog node set visible %d\n",v ); |
1654 | FogParent->setVisible ( v ); | 1654 | FogParent->setVisible ( v ); |
1655 | if ( gui.Visible_Fog ) | 1655 | if ( gui.Visible_Fog ) |
1656 | gui.Visible_Fog->setChecked ( v ); | 1656 | gui.Visible_Fog->setChecked ( v ); |
1657 | } | 1657 | } |
1658 | 1658 | ||
1659 | } | 1659 | } |
1660 | else | 1660 | else |
1661 | if (eve.KeyInput.Key == KEY_F6) | 1661 | if (eve.KeyInput.Key == KEY_F6) |
1662 | { | 1662 | { |
1663 | if ( UnresolvedParent ) | 1663 | if ( UnresolvedParent ) |
1664 | { | 1664 | { |
1665 | bool v = !UnresolvedParent->isVisible (); | 1665 | bool v = !UnresolvedParent->isVisible (); |
1666 | printf ( "unresolved node set visible %d\n",v ); | 1666 | printf ( "unresolved node set visible %d\n",v ); |
1667 | UnresolvedParent->setVisible ( v ); | 1667 | UnresolvedParent->setVisible ( v ); |
1668 | if ( gui.Visible_Unresolved ) | 1668 | if ( gui.Visible_Unresolved ) |
1669 | gui.Visible_Unresolved->setChecked ( v ); | 1669 | gui.Visible_Unresolved->setChecked ( v ); |
1670 | } | 1670 | } |
1671 | } | 1671 | } |
1672 | } | 1672 | } |
1673 | 1673 | ||
1674 | // check if user presses the key C ( for crouch) | 1674 | // check if user presses the key C ( for crouch) |
1675 | if ( eve.EventType == EET_KEY_INPUT_EVENT && eve.KeyInput.Key == KEY_KEY_C ) | 1675 | if ( eve.EventType == EET_KEY_INPUT_EVENT && eve.KeyInput.Key == KEY_KEY_C ) |
1676 | { | 1676 | { |
1677 | // crouch | 1677 | // crouch |
1678 | ISceneNodeAnimatorCollisionResponse *anim = Player[0].cam (); | 1678 | ISceneNodeAnimatorCollisionResponse *anim = Player[0].cam (); |
1679 | if ( anim && 0 == Game->flyTroughState ) | 1679 | if ( anim && 0 == Game->flyTroughState ) |
1680 | { | 1680 | { |
1681 | if ( false == eve.KeyInput.PressedDown ) | 1681 | if ( false == eve.KeyInput.PressedDown ) |
1682 | { | 1682 | { |
1683 | // stand up | 1683 | // stand up |
1684 | anim->setEllipsoidRadius ( vector3df(30,45,30) ); | 1684 | anim->setEllipsoidRadius ( vector3df(30,45,30) ); |
1685 | anim->setEllipsoidTranslation ( vector3df(0,40,0)); | 1685 | anim->setEllipsoidTranslation ( vector3df(0,40,0)); |
1686 | 1686 | ||
1687 | } | 1687 | } |
1688 | else | 1688 | else |
1689 | { | 1689 | { |
1690 | // on your knees | 1690 | // on your knees |
1691 | anim->setEllipsoidRadius ( vector3df(30,20,30) ); | 1691 | anim->setEllipsoidRadius ( vector3df(30,20,30) ); |
1692 | anim->setEllipsoidTranslation ( vector3df(0,20,0)); | 1692 | anim->setEllipsoidTranslation ( vector3df(0,20,0)); |
1693 | } | 1693 | } |
1694 | return true; | 1694 | return true; |
1695 | } | 1695 | } |
1696 | } | 1696 | } |
1697 | return false; | 1697 | return false; |
1698 | } | 1698 | } |
1699 | 1699 | ||
1700 | 1700 | ||
1701 | 1701 | ||
1702 | /* | 1702 | /* |
1703 | useItem | 1703 | useItem |
1704 | */ | 1704 | */ |
1705 | void CQuake3EventHandler::useItem( Q3Player * player) | 1705 | void CQuake3EventHandler::useItem( Q3Player * player) |
1706 | { | 1706 | { |
1707 | ISceneManager* smgr = Game->Device->getSceneManager(); | 1707 | ISceneManager* smgr = Game->Device->getSceneManager(); |
1708 | ICameraSceneNode* camera = smgr->getActiveCamera(); | 1708 | ICameraSceneNode* camera = smgr->getActiveCamera(); |
1709 | 1709 | ||
1710 | if (!camera) | 1710 | if (!camera) |
1711 | return; | 1711 | return; |
1712 | 1712 | ||
1713 | SParticleImpact imp; | 1713 | SParticleImpact imp; |
1714 | imp.when = 0; | 1714 | imp.when = 0; |
1715 | 1715 | ||
1716 | // get line of camera | 1716 | // get line of camera |
1717 | 1717 | ||
1718 | vector3df start = camera->getPosition(); | 1718 | vector3df start = camera->getPosition(); |
1719 | 1719 | ||
1720 | if ( player->WeaponNode ) | 1720 | if ( player->WeaponNode ) |
1721 | { | 1721 | { |
1722 | start.X += 0.f; | 1722 | start.X += 0.f; |
1723 | start.Y += 0.f; | 1723 | start.Y += 0.f; |
1724 | start.Z += 0.f; | 1724 | start.Z += 0.f; |
1725 | } | 1725 | } |
1726 | 1726 | ||
1727 | vector3df end = (camera->getTarget() - start); | 1727 | vector3df end = (camera->getTarget() - start); |
1728 | end.normalize(); | 1728 | end.normalize(); |
1729 | start += end*20.0f; | 1729 | start += end*20.0f; |
1730 | 1730 | ||
1731 | end = start + (end * camera->getFarValue()); | 1731 | end = start + (end * camera->getFarValue()); |
1732 | 1732 | ||
1733 | triangle3df triangle; | 1733 | triangle3df triangle; |
1734 | line3d<f32> line(start, end); | 1734 | line3d<f32> line(start, end); |
1735 | 1735 | ||
1736 | // get intersection point with map | 1736 | // get intersection point with map |
1737 | scene::ISceneNode* hitNode; | 1737 | scene::ISceneNode* hitNode; |
1738 | if (smgr->getSceneCollisionManager()->getCollisionPoint( | 1738 | if (smgr->getSceneCollisionManager()->getCollisionPoint( |
1739 | line, Meta, end, triangle,hitNode)) | 1739 | line, Meta, end, triangle,hitNode)) |
1740 | { | 1740 | { |
1741 | // collides with wall | 1741 | // collides with wall |
1742 | vector3df out = triangle.getNormal(); | 1742 | vector3df out = triangle.getNormal(); |
1743 | out.setLength(0.03f); | 1743 | out.setLength(0.03f); |
1744 | 1744 | ||
1745 | imp.when = 1; | 1745 | imp.when = 1; |
1746 | imp.outVector = out; | 1746 | imp.outVector = out; |
1747 | imp.pos = end; | 1747 | imp.pos = end; |
1748 | 1748 | ||
1749 | player->setAnim ( "pow" ); | 1749 | player->setAnim ( "pow" ); |
1750 | player->Anim[1].next += player->Anim[1].delta; | 1750 | player->Anim[1].next += player->Anim[1].delta; |
1751 | } | 1751 | } |
1752 | else | 1752 | else |
1753 | { | 1753 | { |
1754 | // doesnt collide with wall | 1754 | // doesnt collide with wall |
1755 | vector3df start = camera->getPosition(); | 1755 | vector3df start = camera->getPosition(); |
1756 | if ( player->WeaponNode ) | 1756 | if ( player->WeaponNode ) |
1757 | { | 1757 | { |
1758 | //start.X += 10.f; | 1758 | //start.X += 10.f; |
1759 | //start.Y += -5.f; | 1759 | //start.Y += -5.f; |
1760 | //start.Z += 1.f; | 1760 | //start.Z += 1.f; |
1761 | } | 1761 | } |
1762 | 1762 | ||
1763 | vector3df end = (camera->getTarget() - start); | 1763 | vector3df end = (camera->getTarget() - start); |
1764 | end.normalize(); | 1764 | end.normalize(); |
1765 | start += end*20.0f; | 1765 | start += end*20.0f; |
1766 | end = start + (end * camera->getFarValue()); | 1766 | end = start + (end * camera->getFarValue()); |
1767 | } | 1767 | } |
1768 | 1768 | ||
1769 | // create fire ball | 1769 | // create fire ball |
1770 | ISceneNode* node = 0; | 1770 | ISceneNode* node = 0; |
1771 | node = smgr->addBillboardSceneNode( BulletParent,dimension2d<f32>(10,10), start); | 1771 | node = smgr->addBillboardSceneNode( BulletParent,dimension2d<f32>(10,10), start); |
1772 | 1772 | ||
1773 | node->setMaterialFlag(EMF_LIGHTING, false); | 1773 | node->setMaterialFlag(EMF_LIGHTING, false); |
1774 | node->setMaterialTexture(0, Game->Device->getVideoDriver()->getTexture("fireball.bmp")); | 1774 | node->setMaterialTexture(0, Game->Device->getVideoDriver()->getTexture("fireball.bmp")); |
1775 | node->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false); | 1775 | node->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false); |
1776 | node->setMaterialType(EMT_TRANSPARENT_ADD_COLOR); | 1776 | node->setMaterialType(EMT_TRANSPARENT_ADD_COLOR); |
1777 | 1777 | ||
1778 | f32 length = (f32)(end - start).getLength(); | 1778 | f32 length = (f32)(end - start).getLength(); |
1779 | const f32 speed = 5.8f; | 1779 | const f32 speed = 5.8f; |
1780 | u32 time = (u32)(length / speed); | 1780 | u32 time = (u32)(length / speed); |
1781 | 1781 | ||
1782 | ISceneNodeAnimator* anim = 0; | 1782 | ISceneNodeAnimator* anim = 0; |
1783 | 1783 | ||
1784 | // set flight line | 1784 | // set flight line |
1785 | 1785 | ||
1786 | anim = smgr->createFlyStraightAnimator(start, end, time); | 1786 | anim = smgr->createFlyStraightAnimator(start, end, time); |
1787 | node->addAnimator(anim); | 1787 | node->addAnimator(anim); |
1788 | anim->drop(); | 1788 | anim->drop(); |
1789 | 1789 | ||
1790 | snprintf ( buf, 64, "bullet: %s on %.1f,%1.f,%1.f", | 1790 | snprintf ( buf, 64, "bullet: %s on %.1f,%1.f,%1.f", |
1791 | imp.when ? "hit" : "nohit", end.X, end.Y, end.Z ); | 1791 | imp.when ? "hit" : "nohit", end.X, end.Y, end.Z ); |
1792 | node->setName ( buf ); | 1792 | node->setName ( buf ); |
1793 | 1793 | ||
1794 | 1794 | ||
1795 | anim = smgr->createDeleteAnimator(time); | 1795 | anim = smgr->createDeleteAnimator(time); |
1796 | node->addAnimator(anim); | 1796 | node->addAnimator(anim); |
1797 | anim->drop(); | 1797 | anim->drop(); |
1798 | 1798 | ||
1799 | if (imp.when) | 1799 | if (imp.when) |
1800 | { | 1800 | { |
1801 | // create impact note | 1801 | // create impact note |
1802 | imp.when = Game->Device->getTimer()->getTime() + | 1802 | imp.when = Game->Device->getTimer()->getTime() + |
1803 | (time + (s32) ( ( 1.f + Noiser::get() ) * 250.f )); | 1803 | (time + (s32) ( ( 1.f + Noiser::get() ) * 250.f )); |
1804 | Impacts.push_back(imp); | 1804 | Impacts.push_back(imp); |
1805 | } | 1805 | } |
1806 | 1806 | ||
1807 | // play sound | 1807 | // play sound |
1808 | } | 1808 | } |
1809 | 1809 | ||
1810 | // rendered when bullets hit something | 1810 | // rendered when bullets hit something |
1811 | void CQuake3EventHandler::createParticleImpacts( u32 now ) | 1811 | void CQuake3EventHandler::createParticleImpacts( u32 now ) |
1812 | { | 1812 | { |
1813 | ISceneManager* sm = Game->Device->getSceneManager(); | 1813 | ISceneManager* sm = Game->Device->getSceneManager(); |
1814 | 1814 | ||
1815 | struct smokeLayer | 1815 | struct smokeLayer |
1816 | { | 1816 | { |
1817 | const c8 * texture; | 1817 | const c8 * texture; |
1818 | f32 scale; | 1818 | f32 scale; |
1819 | f32 minparticleSize; | 1819 | f32 minparticleSize; |
1820 | f32 maxparticleSize; | 1820 | f32 maxparticleSize; |
1821 | f32 boxSize; | 1821 | f32 boxSize; |
1822 | u32 minParticle; | 1822 | u32 minParticle; |
1823 | u32 maxParticle; | 1823 | u32 maxParticle; |
1824 | u32 fadeout; | 1824 | u32 fadeout; |
1825 | u32 lifetime; | 1825 | u32 lifetime; |
1826 | }; | 1826 | }; |
1827 | 1827 | ||
1828 | smokeLayer smoke[] = | 1828 | smokeLayer smoke[] = |
1829 | { | 1829 | { |
1830 | { "smoke2.jpg", 0.4f, 1.5f, 18.f, 20.f, 20, 50, 2000, 10000 }, | 1830 | { "smoke2.jpg", 0.4f, 1.5f, 18.f, 20.f, 20, 50, 2000, 10000 }, |
1831 | { "smoke3.jpg", 0.2f, 1.2f, 15.f, 20.f, 10, 30, 1000, 12000 } | 1831 | { "smoke3.jpg", 0.2f, 1.2f, 15.f, 20.f, 10, 30, 1000, 12000 } |
1832 | }; | 1832 | }; |
1833 | 1833 | ||
1834 | 1834 | ||
1835 | u32 i; | 1835 | u32 i; |
1836 | u32 g; | 1836 | u32 g; |
1837 | s32 factor = 1; | 1837 | s32 factor = 1; |
1838 | for ( g = 0; g != 2; ++g ) | 1838 | for ( g = 0; g != 2; ++g ) |
1839 | { | 1839 | { |
1840 | smoke[g].minParticle *= factor; | 1840 | smoke[g].minParticle *= factor; |
1841 | smoke[g].maxParticle *= factor; | 1841 | smoke[g].maxParticle *= factor; |
1842 | smoke[g].lifetime *= factor; | 1842 | smoke[g].lifetime *= factor; |
1843 | smoke[g].boxSize *= Noiser::get() * 0.5f; | 1843 | smoke[g].boxSize *= Noiser::get() * 0.5f; |
1844 | } | 1844 | } |
1845 | 1845 | ||
1846 | for ( i=0; i < Impacts.size(); ++i) | 1846 | for ( i=0; i < Impacts.size(); ++i) |
1847 | { | 1847 | { |
1848 | if (now < Impacts[i].when) | 1848 | if (now < Impacts[i].when) |
1849 | continue; | 1849 | continue; |
1850 | 1850 | ||
1851 | // create smoke particle system | 1851 | // create smoke particle system |
1852 | IParticleSystemSceneNode* pas = 0; | 1852 | IParticleSystemSceneNode* pas = 0; |
1853 | 1853 | ||
1854 | for ( g = 0; g != 2; ++g ) | 1854 | for ( g = 0; g != 2; ++g ) |
1855 | { | 1855 | { |
1856 | pas = sm->addParticleSystemSceneNode(false, BulletParent, -1, Impacts[i].pos); | 1856 | pas = sm->addParticleSystemSceneNode(false, BulletParent, -1, Impacts[i].pos); |
1857 | 1857 | ||
1858 | snprintf ( buf, 64, "bullet impact smoke at %.1f,%.1f,%1.f", | 1858 | snprintf ( buf, 64, "bullet impact smoke at %.1f,%.1f,%1.f", |
1859 | Impacts[i].pos.X,Impacts[i].pos.Y,Impacts[i].pos.Z); | 1859 | Impacts[i].pos.X,Impacts[i].pos.Y,Impacts[i].pos.Z); |
1860 | pas->setName ( buf ); | 1860 | pas->setName ( buf ); |
1861 | 1861 | ||
1862 | // create a flat smoke | 1862 | // create a flat smoke |
1863 | vector3df direction = Impacts[i].outVector; | 1863 | vector3df direction = Impacts[i].outVector; |
1864 | direction *= smoke[g].scale; | 1864 | direction *= smoke[g].scale; |
1865 | IParticleEmitter* em = pas->createBoxEmitter( | 1865 | IParticleEmitter* em = pas->createBoxEmitter( |
1866 | aabbox3d<f32>(-4.f,0.f,-4.f,20.f,smoke[g].minparticleSize,20.f), | 1866 | aabbox3d<f32>(-4.f,0.f,-4.f,20.f,smoke[g].minparticleSize,20.f), |
1867 | direction,smoke[g].minParticle, smoke[g].maxParticle, | 1867 | direction,smoke[g].minParticle, smoke[g].maxParticle, |
1868 | video::SColor(0,0,0,0),video::SColor(0,128,128,128), | 1868 | video::SColor(0,0,0,0),video::SColor(0,128,128,128), |
1869 | 250,4000, 60); | 1869 | 250,4000, 60); |
1870 | 1870 | ||
1871 | em->setMinStartSize (dimension2d<f32>( smoke[g].minparticleSize, smoke[g].minparticleSize)); | 1871 | em->setMinStartSize (dimension2d<f32>( smoke[g].minparticleSize, smoke[g].minparticleSize)); |
1872 | em->setMaxStartSize (dimension2d<f32>( smoke[g].maxparticleSize, smoke[g].maxparticleSize)); | 1872 | em->setMaxStartSize (dimension2d<f32>( smoke[g].maxparticleSize, smoke[g].maxparticleSize)); |
1873 | 1873 | ||
1874 | pas->setEmitter(em); | 1874 | pas->setEmitter(em); |
1875 | em->drop(); | 1875 | em->drop(); |
1876 | 1876 | ||
1877 | // particles get invisible | 1877 | // particles get invisible |
1878 | IParticleAffector* paf = pas->createFadeOutParticleAffector( | 1878 | IParticleAffector* paf = pas->createFadeOutParticleAffector( |
1879 | video::SColor ( 0, 0, 0, 0 ), smoke[g].fadeout); | 1879 | video::SColor ( 0, 0, 0, 0 ), smoke[g].fadeout); |
1880 | pas->addAffector(paf); | 1880 | pas->addAffector(paf); |
1881 | paf->drop(); | 1881 | paf->drop(); |
1882 | 1882 | ||
1883 | // particle system life time | 1883 | // particle system life time |
1884 | ISceneNodeAnimator* anim = sm->createDeleteAnimator( smoke[g].lifetime); | 1884 | ISceneNodeAnimator* anim = sm->createDeleteAnimator( smoke[g].lifetime); |
1885 | pas->addAnimator(anim); | 1885 | pas->addAnimator(anim); |
1886 | anim->drop(); | 1886 | anim->drop(); |
1887 | 1887 | ||
1888 | pas->setMaterialFlag(video::EMF_LIGHTING, false); | 1888 | pas->setMaterialFlag(video::EMF_LIGHTING, false); |
1889 | pas->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false); | 1889 | pas->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false); |
1890 | pas->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR ); | 1890 | pas->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR ); |
1891 | pas->setMaterialTexture(0, Game->Device->getVideoDriver()->getTexture( smoke[g].texture )); | 1891 | pas->setMaterialTexture(0, Game->Device->getVideoDriver()->getTexture( smoke[g].texture )); |
1892 | } | 1892 | } |
1893 | 1893 | ||
1894 | 1894 | ||
1895 | // play impact sound | 1895 | // play impact sound |
1896 | #ifdef USE_IRRKLANG | 1896 | #ifdef USE_IRRKLANG |
1897 | /* | 1897 | /* |
1898 | if (irrKlang) | 1898 | if (irrKlang) |
1899 | { | 1899 | { |
1900 | audio::ISound* sound = | 1900 | audio::ISound* sound = |
1901 | irrKlang->play3D(impactSound, Impacts[i].pos, false, false, true); | 1901 | irrKlang->play3D(impactSound, Impacts[i].pos, false, false, true); |
1902 | 1902 | ||
1903 | if (sound) | 1903 | if (sound) |
1904 | { | 1904 | { |
1905 | // adjust max value a bit to make to sound of an impact louder | 1905 | // adjust max value a bit to make to sound of an impact louder |
1906 | sound->setMinDistance(400); | 1906 | sound->setMinDistance(400); |
1907 | sound->drop(); | 1907 | sound->drop(); |
1908 | } | 1908 | } |
1909 | } | 1909 | } |
1910 | */ | 1910 | */ |
1911 | #endif | 1911 | #endif |
1912 | 1912 | ||
1913 | 1913 | ||
1914 | // delete entry | 1914 | // delete entry |
1915 | Impacts.erase(i); | 1915 | Impacts.erase(i); |
1916 | i--; | 1916 | i--; |
1917 | } | 1917 | } |
1918 | } | 1918 | } |
1919 | 1919 | ||
1920 | /* | 1920 | /* |
1921 | render | 1921 | render |
1922 | */ | 1922 | */ |
1923 | void CQuake3EventHandler::Render() | 1923 | void CQuake3EventHandler::Render() |
1924 | { | 1924 | { |
1925 | IVideoDriver * driver = Game->Device->getVideoDriver(); | 1925 | IVideoDriver * driver = Game->Device->getVideoDriver(); |
1926 | if ( 0 == driver ) | 1926 | if ( 0 == driver ) |
1927 | return; | 1927 | return; |
1928 | 1928 | ||
1929 | // TODO: This does not work, yet. | 1929 | // TODO: This does not work, yet. |
1930 | const bool anaglyph=false; | 1930 | const bool anaglyph=false; |
1931 | if (anaglyph) | 1931 | if (anaglyph) |
1932 | { | 1932 | { |
1933 | scene::ICameraSceneNode* cameraOld = Game->Device->getSceneManager()->getActiveCamera(); | 1933 | scene::ICameraSceneNode* cameraOld = Game->Device->getSceneManager()->getActiveCamera(); |
1934 | driver->beginScene(true, true, SColor(0,0,0,0)); | 1934 | driver->beginScene(true, true, SColor(0,0,0,0)); |
1935 | driver->getOverrideMaterial().Material.ColorMask = ECP_NONE; | 1935 | driver->getOverrideMaterial().Material.ColorMask = ECP_NONE; |
1936 | driver->getOverrideMaterial().EnableFlags = EMF_COLOR_MASK; | 1936 | driver->getOverrideMaterial().EnableFlags = EMF_COLOR_MASK; |
1937 | driver->getOverrideMaterial().EnablePasses = ESNRP_SKY_BOX + | 1937 | driver->getOverrideMaterial().EnablePasses = ESNRP_SKY_BOX + |
1938 | ESNRP_SOLID + | 1938 | ESNRP_SOLID + |
1939 | ESNRP_TRANSPARENT + | 1939 | ESNRP_TRANSPARENT + |
1940 | ESNRP_TRANSPARENT_EFFECT + | 1940 | ESNRP_TRANSPARENT_EFFECT + |
1941 | ESNRP_SHADOW; | 1941 | ESNRP_SHADOW; |
1942 | Game->Device->getSceneManager()->drawAll(); | 1942 | Game->Device->getSceneManager()->drawAll(); |
1943 | driver->clearZBuffer(); | 1943 | driver->clearZBuffer(); |
1944 | 1944 | ||
1945 | const vector3df oldPosition = cameraOld->getPosition(); | 1945 | const vector3df oldPosition = cameraOld->getPosition(); |
1946 | const vector3df oldTarget = cameraOld->getTarget(); | 1946 | const vector3df oldTarget = cameraOld->getTarget(); |
1947 | const matrix4 startMatrix = cameraOld->getAbsoluteTransformation(); | 1947 | const matrix4 startMatrix = cameraOld->getAbsoluteTransformation(); |
1948 | const vector3df focusPoint = (oldTarget - | 1948 | const vector3df focusPoint = (oldTarget - |
1949 | cameraOld->getAbsolutePosition()).setLength(10000) + | 1949 | cameraOld->getAbsolutePosition()).setLength(10000) + |
1950 | cameraOld->getAbsolutePosition() ; | 1950 | cameraOld->getAbsolutePosition() ; |
1951 | 1951 | ||
1952 | scene::ICameraSceneNode* camera = cameraOld;//Game->Device->getSceneManager()->addCameraSceneNode(); | 1952 | scene::ICameraSceneNode* camera = cameraOld;//Game->Device->getSceneManager()->addCameraSceneNode(); |
1953 | 1953 | ||
1954 | //Left eye... | 1954 | //Left eye... |
1955 | vector3df pos; | 1955 | vector3df pos; |
1956 | matrix4 move; | 1956 | matrix4 move; |
1957 | 1957 | ||
1958 | move.setTranslation( vector3df(-1.5f,0.0f,0.0f) ); | 1958 | move.setTranslation( vector3df(-1.5f,0.0f,0.0f) ); |
1959 | pos=(startMatrix*move).getTranslation(); | 1959 | pos=(startMatrix*move).getTranslation(); |
1960 | 1960 | ||
1961 | driver->getOverrideMaterial().Material.ColorMask = ECP_RED; | 1961 | driver->getOverrideMaterial().Material.ColorMask = ECP_RED; |
1962 | driver->getOverrideMaterial().EnableFlags = EMF_COLOR_MASK; | 1962 | driver->getOverrideMaterial().EnableFlags = EMF_COLOR_MASK; |
1963 | driver->getOverrideMaterial().EnablePasses = | 1963 | driver->getOverrideMaterial().EnablePasses = |
1964 | ESNRP_SKY_BOX|ESNRP_SOLID|ESNRP_TRANSPARENT| | 1964 | ESNRP_SKY_BOX|ESNRP_SOLID|ESNRP_TRANSPARENT| |
1965 | ESNRP_TRANSPARENT_EFFECT|ESNRP_SHADOW; | 1965 | ESNRP_TRANSPARENT_EFFECT|ESNRP_SHADOW; |
1966 | 1966 | ||
1967 | camera->setPosition(pos); | 1967 | camera->setPosition(pos); |
1968 | camera->setTarget(focusPoint); | 1968 | camera->setTarget(focusPoint); |
1969 | 1969 | ||
1970 | Game->Device->getSceneManager()->drawAll(); | 1970 | Game->Device->getSceneManager()->drawAll(); |
1971 | driver->clearZBuffer(); | 1971 | driver->clearZBuffer(); |
1972 | 1972 | ||
1973 | //Right eye... | 1973 | //Right eye... |
1974 | move.setTranslation( vector3df(1.5f,0.0f,0.0f) ); | 1974 | move.setTranslation( vector3df(1.5f,0.0f,0.0f) ); |
1975 | pos=(startMatrix*move).getTranslation(); | 1975 | pos=(startMatrix*move).getTranslation(); |
1976 | 1976 | ||
1977 | driver->getOverrideMaterial().Material.ColorMask = ECP_GREEN + ECP_BLUE; | 1977 | driver->getOverrideMaterial().Material.ColorMask = ECP_GREEN + ECP_BLUE; |
1978 | driver->getOverrideMaterial().EnableFlags = EMF_COLOR_MASK; | 1978 | driver->getOverrideMaterial().EnableFlags = EMF_COLOR_MASK; |
1979 | driver->getOverrideMaterial().EnablePasses = | 1979 | driver->getOverrideMaterial().EnablePasses = |
1980 | ESNRP_SKY_BOX|ESNRP_SOLID|ESNRP_TRANSPARENT| | 1980 | ESNRP_SKY_BOX|ESNRP_SOLID|ESNRP_TRANSPARENT| |
1981 | ESNRP_TRANSPARENT_EFFECT|ESNRP_SHADOW; | 1981 | ESNRP_TRANSPARENT_EFFECT|ESNRP_SHADOW; |
1982 | 1982 | ||
1983 | camera->setPosition(pos); | 1983 | camera->setPosition(pos); |
1984 | camera->setTarget(focusPoint); | 1984 | camera->setTarget(focusPoint); |
1985 | 1985 | ||
1986 | Game->Device->getSceneManager()->drawAll(); | 1986 | Game->Device->getSceneManager()->drawAll(); |
1987 | 1987 | ||
1988 | driver->getOverrideMaterial().Material.ColorMask=ECP_ALL; | 1988 | driver->getOverrideMaterial().Material.ColorMask=ECP_ALL; |
1989 | driver->getOverrideMaterial().EnableFlags=0; | 1989 | driver->getOverrideMaterial().EnableFlags=0; |
1990 | driver->getOverrideMaterial().EnablePasses=0; | 1990 | driver->getOverrideMaterial().EnablePasses=0; |
1991 | 1991 | ||
1992 | if (camera != cameraOld) | 1992 | if (camera != cameraOld) |
1993 | { | 1993 | { |
1994 | Game->Device->getSceneManager()->setActiveCamera(cameraOld); | 1994 | Game->Device->getSceneManager()->setActiveCamera(cameraOld); |
1995 | camera->remove(); | 1995 | camera->remove(); |
1996 | } | 1996 | } |
1997 | else | 1997 | else |
1998 | { | 1998 | { |
1999 | camera->setPosition(oldPosition); | 1999 | camera->setPosition(oldPosition); |
2000 | camera->setTarget(oldTarget); | 2000 | camera->setTarget(oldTarget); |
2001 | } | 2001 | } |
2002 | } | 2002 | } |
2003 | else | 2003 | else |
2004 | { | 2004 | { |
2005 | driver->beginScene(true, true, SColor(0,0,0,0)); | 2005 | driver->beginScene(true, true, SColor(0,0,0,0)); |
2006 | Game->Device->getSceneManager()->drawAll(); | 2006 | Game->Device->getSceneManager()->drawAll(); |
2007 | } | 2007 | } |
2008 | Game->Device->getGUIEnvironment()->drawAll(); | 2008 | Game->Device->getGUIEnvironment()->drawAll(); |
2009 | driver->endScene(); | 2009 | driver->endScene(); |
2010 | } | 2010 | } |
2011 | 2011 | ||
2012 | /* | 2012 | /* |
2013 | update the generic scene node | 2013 | update the generic scene node |
2014 | */ | 2014 | */ |
2015 | void CQuake3EventHandler::Animate() | 2015 | void CQuake3EventHandler::Animate() |
2016 | { | 2016 | { |
2017 | u32 now = Game->Device->getTimer()->getTime(); | 2017 | u32 now = Game->Device->getTimer()->getTime(); |
2018 | 2018 | ||
2019 | Q3Player * player = Player + 0; | 2019 | Q3Player * player = Player + 0; |
2020 | 2020 | ||
2021 | checkTimeFire ( player->Anim, 4, now ); | 2021 | checkTimeFire ( player->Anim, 4, now ); |
2022 | 2022 | ||
2023 | // Query Scene Manager attributes | 2023 | // Query Scene Manager attributes |
2024 | if ( player->Anim[0].flags & FIRED ) | 2024 | if ( player->Anim[0].flags & FIRED ) |
2025 | { | 2025 | { |
2026 | ISceneManager *smgr = Game->Device->getSceneManager (); | 2026 | ISceneManager *smgr = Game->Device->getSceneManager (); |
2027 | wchar_t msg[128]; | 2027 | wchar_t msg[128]; |
2028 | IVideoDriver * driver = Game->Device->getVideoDriver(); | 2028 | IVideoDriver * driver = Game->Device->getVideoDriver(); |
2029 | 2029 | ||
2030 | IAttributes * attr = smgr->getParameters(); | 2030 | IAttributes * attr = smgr->getParameters(); |
2031 | swprintf ( msg, 128, | 2031 | swprintf ( msg, 128, |
2032 | L"Q3 %s [%ls], FPS:%03d Tri:%.03fm Cull %d/%d nodes (%d,%d,%d)", | 2032 | L"Q3 %s [%ls], FPS:%03d Tri:%.03fm Cull %d/%d nodes (%d,%d,%d)", |
2033 | Game->CurrentMapName.c_str(), | 2033 | Game->CurrentMapName.c_str(), |
2034 | driver->getName(), | 2034 | driver->getName(), |
2035 | driver->getFPS (), | 2035 | driver->getFPS (), |
2036 | (f32) driver->getPrimitiveCountDrawn( 0 ) * ( 1.f / 1000000.f ), | 2036 | (f32) driver->getPrimitiveCountDrawn( 0 ) * ( 1.f / 1000000.f ), |
2037 | attr->getAttributeAsInt ( "culled" ), | 2037 | attr->getAttributeAsInt ( "culled" ), |
2038 | attr->getAttributeAsInt ( "calls" ), | 2038 | attr->getAttributeAsInt ( "calls" ), |
2039 | attr->getAttributeAsInt ( "drawn_solid" ), | 2039 | attr->getAttributeAsInt ( "drawn_solid" ), |
2040 | attr->getAttributeAsInt ( "drawn_transparent" ), | 2040 | attr->getAttributeAsInt ( "drawn_transparent" ), |
2041 | attr->getAttributeAsInt ( "drawn_transparent_effect" ) | 2041 | attr->getAttributeAsInt ( "drawn_transparent_effect" ) |
2042 | ); | 2042 | ); |
2043 | Game->Device->setWindowCaption( msg ); | 2043 | Game->Device->setWindowCaption( msg ); |
2044 | 2044 | ||
2045 | swprintf ( msg, 128, | 2045 | swprintf ( msg, 128, |
2046 | L"%03d fps, F1 GUI on/off, F2 respawn, F3-F6 toggle Nodes, F7 Collision on/off" | 2046 | L"%03d fps, F1 GUI on/off, F2 respawn, F3-F6 toggle Nodes, F7 Collision on/off" |
2047 | L", F8 Gravity on/off, Right Mouse Toggle GUI", | 2047 | L", F8 Gravity on/off, Right Mouse Toggle GUI", |
2048 | Game->Device->getVideoDriver()->getFPS () | 2048 | Game->Device->getVideoDriver()->getFPS () |
2049 | ); | 2049 | ); |
2050 | if ( gui.StatusLine ) | 2050 | if ( gui.StatusLine ) |
2051 | gui.StatusLine->setText ( msg ); | 2051 | gui.StatusLine->setText ( msg ); |
2052 | player->Anim[0].flags &= ~FIRED; | 2052 | player->Anim[0].flags &= ~FIRED; |
2053 | } | 2053 | } |
2054 | 2054 | ||
2055 | // idle.. | 2055 | // idle.. |
2056 | if ( player->Anim[1].flags & FIRED ) | 2056 | if ( player->Anim[1].flags & FIRED ) |
2057 | { | 2057 | { |
2058 | if ( strcmp ( player->animation, "idle" ) ) | 2058 | if ( strcmp ( player->animation, "idle" ) ) |
2059 | player->setAnim ( "idle" ); | 2059 | player->setAnim ( "idle" ); |
2060 | 2060 | ||
2061 | player->Anim[1].flags &= ~FIRED; | 2061 | player->Anim[1].flags &= ~FIRED; |
2062 | } | 2062 | } |
2063 | 2063 | ||
2064 | createParticleImpacts ( now ); | 2064 | createParticleImpacts ( now ); |
2065 | 2065 | ||
2066 | } | 2066 | } |
2067 | 2067 | ||
2068 | 2068 | ||
2069 | /* The main game states | 2069 | /* The main game states |
2070 | */ | 2070 | */ |
2071 | void runGame ( GameData *game ) | 2071 | void runGame ( GameData *game ) |
2072 | { | 2072 | { |
2073 | if ( game->retVal >= 3 ) | 2073 | if ( game->retVal >= 3 ) |
2074 | return; | 2074 | return; |
2075 | 2075 | ||
2076 | game->Device = (*game->createExDevice) ( game->deviceParam ); | 2076 | game->Device = (*game->createExDevice) ( game->deviceParam ); |
2077 | if ( 0 == game->Device) | 2077 | if ( 0 == game->Device) |
2078 | { | 2078 | { |
2079 | // could not create selected driver. | 2079 | // could not create selected driver. |
2080 | game->retVal = 0; | 2080 | game->retVal = 0; |
2081 | return; | 2081 | return; |
2082 | } | 2082 | } |
2083 | 2083 | ||
2084 | // create an event receiver based on current game data | 2084 | // create an event receiver based on current game data |
2085 | CQuake3EventHandler *eventHandler = new CQuake3EventHandler( game ); | 2085 | CQuake3EventHandler *eventHandler = new CQuake3EventHandler( game ); |
2086 | 2086 | ||
2087 | // load stored config | 2087 | // load stored config |
2088 | game->load ( "explorer.cfg" ); | 2088 | game->load ( "explorer.cfg" ); |
2089 | 2089 | ||
2090 | // add our media directory and archive to the file system | 2090 | // add our media directory and archive to the file system |
2091 | for ( u32 i = 0; i < game->CurrentArchiveList.size(); ++i ) | 2091 | for ( u32 i = 0; i < game->CurrentArchiveList.size(); ++i ) |
2092 | { | 2092 | { |
2093 | eventHandler->AddArchive ( game->CurrentArchiveList[i] ); | 2093 | eventHandler->AddArchive ( game->CurrentArchiveList[i] ); |
2094 | } | 2094 | } |
2095 | 2095 | ||
2096 | // Load a Map or startup to the GUI | 2096 | // Load a Map or startup to the GUI |
2097 | if ( game->CurrentMapName.size () ) | 2097 | if ( game->CurrentMapName.size () ) |
2098 | { | 2098 | { |
2099 | eventHandler->LoadMap ( game->CurrentMapName, 1 ); | 2099 | eventHandler->LoadMap ( game->CurrentMapName, 1 ); |
2100 | if ( 0 == game->loadParam.loadSkyShader ) | 2100 | if ( 0 == game->loadParam.loadSkyShader ) |
2101 | eventHandler->AddSky ( 1, "skydome2" ); | 2101 | eventHandler->AddSky ( 1, "skydome2" ); |
2102 | eventHandler->CreatePlayers (); | 2102 | eventHandler->CreatePlayers (); |
2103 | eventHandler->CreateGUI (); | 2103 | eventHandler->CreateGUI (); |
2104 | eventHandler->SetGUIActive ( 0 ); | 2104 | eventHandler->SetGUIActive ( 0 ); |
2105 | 2105 | ||
2106 | // set player to last position on restart | 2106 | // set player to last position on restart |
2107 | if ( game->retVal == 2 ) | 2107 | if ( game->retVal == 2 ) |
2108 | { | 2108 | { |
2109 | eventHandler->GetPlayer( 0 )->setpos ( game->PlayerPosition, game->PlayerRotation ); | 2109 | eventHandler->GetPlayer( 0 )->setpos ( game->PlayerPosition, game->PlayerRotation ); |
2110 | } | 2110 | } |
2111 | } | 2111 | } |
2112 | else | 2112 | else |
2113 | { | 2113 | { |
2114 | // start up empty | 2114 | // start up empty |
2115 | eventHandler->AddSky ( 1, "skydome2" ); | 2115 | eventHandler->AddSky ( 1, "skydome2" ); |
2116 | eventHandler->CreatePlayers (); | 2116 | eventHandler->CreatePlayers (); |
2117 | eventHandler->CreateGUI (); | 2117 | eventHandler->CreateGUI (); |
2118 | eventHandler->SetGUIActive ( 1 ); | 2118 | eventHandler->SetGUIActive ( 1 ); |
2119 | background_music ( "IrrlichtTheme.ogg" ); | 2119 | background_music ( "IrrlichtTheme.ogg" ); |
2120 | } | 2120 | } |
2121 | 2121 | ||
2122 | 2122 | ||
2123 | game->retVal = 3; | 2123 | game->retVal = 3; |
2124 | while( game->Device->run() ) | 2124 | while( game->Device->run() ) |
2125 | { | 2125 | { |
2126 | eventHandler->Animate (); | 2126 | eventHandler->Animate (); |
2127 | eventHandler->Render (); | 2127 | eventHandler->Render (); |
2128 | //if ( !game->Device->isWindowActive() ) | 2128 | //if ( !game->Device->isWindowActive() ) |
2129 | game->Device->yield(); | 2129 | game->Device->yield(); |
2130 | } | 2130 | } |
2131 | 2131 | ||
2132 | game->Device->setGammaRamp ( 1.f, 1.f, 1.f, 0.f, 0.f ); | 2132 | game->Device->setGammaRamp ( 1.f, 1.f, 1.f, 0.f, 0.f ); |
2133 | delete eventHandler; | 2133 | delete eventHandler; |
2134 | } | 2134 | } |
2135 | 2135 | ||
2136 | #if defined (_IRR_WINDOWS_) && 0 | 2136 | #if defined (_IRR_WINDOWS_) && 0 |
2137 | #pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup") | 2137 | #pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup") |
2138 | #endif | 2138 | #endif |
2139 | 2139 | ||
2140 | 2140 | ||
2141 | /* The main routine, doing all setup | 2141 | /* The main routine, doing all setup |
2142 | */ | 2142 | */ |
2143 | int IRRCALLCONV main(int argc, char* argv[]) | 2143 | int IRRCALLCONV main(int argc, char* argv[]) |
2144 | { | 2144 | { |
2145 | path prgname(argv[0]); | 2145 | path prgname(argv[0]); |
2146 | GameData game ( deletePathFromPath ( prgname, 1 ) ); | 2146 | GameData game ( deletePathFromPath ( prgname, 1 ) ); |
2147 | 2147 | ||
2148 | // dynamically load irrlicht | 2148 | // dynamically load irrlicht |
2149 | const c8 * dllName = argc > 1 ? argv[1] : "irrlicht.dll"; | 2149 | const c8 * dllName = argc > 1 ? argv[1] : "irrlicht.dll"; |
2150 | game.createExDevice = load_createDeviceEx ( dllName ); | 2150 | game.createExDevice = load_createDeviceEx ( dllName ); |
2151 | if ( 0 == game.createExDevice ) | 2151 | if ( 0 == game.createExDevice ) |
2152 | { | 2152 | { |
2153 | game.retVal = 3; | 2153 | game.retVal = 3; |
2154 | printf ( "Could not load %s.\n", dllName ); | 2154 | printf ( "Could not load %s.\n", dllName ); |
2155 | return game.retVal; // could not load dll | 2155 | return game.retVal; // could not load dll |
2156 | } | 2156 | } |
2157 | 2157 | ||
2158 | // start without asking for driver | 2158 | // start without asking for driver |
2159 | game.retVal = 1; | 2159 | game.retVal = 1; |
2160 | do | 2160 | do |
2161 | { | 2161 | { |
2162 | // if driver could not created, ask for another driver | 2162 | // if driver could not created, ask for another driver |
2163 | if ( game.retVal == 0 ) | 2163 | if ( game.retVal == 0 ) |
2164 | { | 2164 | { |
2165 | game.setDefault (); | 2165 | game.setDefault (); |
2166 | // ask user for driver | 2166 | // ask user for driver |
2167 | game.deviceParam.DriverType=driverChoiceConsole(); | 2167 | game.deviceParam.DriverType=driverChoiceConsole(); |
2168 | if (game.deviceParam.DriverType==video::EDT_COUNT) | 2168 | if (game.deviceParam.DriverType==video::EDT_COUNT) |
2169 | game.retVal = 3; | 2169 | game.retVal = 3; |
2170 | } | 2170 | } |
2171 | runGame ( &game ); | 2171 | runGame ( &game ); |
2172 | } while ( game.retVal < 3 ); | 2172 | } while ( game.retVal < 3 ); |
2173 | 2173 | ||
2174 | return game.retVal; | 2174 | return game.retVal; |
2175 | } | 2175 | } |
2176 | 2176 | ||
2177 | /* | 2177 | /* |
2178 | **/ | 2178 | **/ |
diff --git a/libraries/irrlicht-1.8/examples/21.Quake3Explorer/q3factory.cpp b/libraries/irrlicht-1.8/examples/21.Quake3Explorer/q3factory.cpp index d0f09b2..fc95a1d 100644 --- a/libraries/irrlicht-1.8/examples/21.Quake3Explorer/q3factory.cpp +++ b/libraries/irrlicht-1.8/examples/21.Quake3Explorer/q3factory.cpp | |||
@@ -1,824 +1,824 @@ | |||
1 | /*! | 1 | /*! |
2 | Model Factory. | 2 | Model Factory. |
3 | create the additional scenenodes for ( bullets, health... ) | 3 | create the additional scenenodes for ( bullets, health... ) |
4 | 4 | ||
5 | Defines the Entities for Quake3 | 5 | Defines the Entities for Quake3 |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #include <irrlicht.h> | 8 | #include <irrlicht.h> |
9 | #include "q3factory.h" | 9 | #include "q3factory.h" |
10 | #include "sound.h" | 10 | #include "sound.h" |
11 | 11 | ||
12 | using namespace irr; | 12 | using namespace irr; |
13 | using namespace scene; | 13 | using namespace scene; |
14 | using namespace gui; | 14 | using namespace gui; |
15 | using namespace video; | 15 | using namespace video; |
16 | using namespace core; | 16 | using namespace core; |
17 | using namespace quake3; | 17 | using namespace quake3; |
18 | 18 | ||
19 | //! This list is based on the original quake3. | 19 | //! This list is based on the original quake3. |
20 | static const SItemElement Quake3ItemElement [] = { | 20 | static const SItemElement Quake3ItemElement [] = { |
21 | { "item_health", | 21 | { "item_health", |
22 | {"models/powerups/health/medium_cross.md3", | 22 | {"models/powerups/health/medium_cross.md3", |
23 | "models/powerups/health/medium_sphere.md3"}, | 23 | "models/powerups/health/medium_sphere.md3"}, |
24 | "sound/items/n_health.wav", | 24 | "sound/items/n_health.wav", |
25 | "icons/iconh_yellow", | 25 | "icons/iconh_yellow", |
26 | "25 Health", | 26 | "25 Health", |
27 | 25, | 27 | 25, |
28 | HEALTH, | 28 | HEALTH, |
29 | SUB_NONE, | 29 | SUB_NONE, |
30 | SPECIAL_SFX_BOUNCE | SPECIAL_SFX_ROTATE_1 | 30 | SPECIAL_SFX_BOUNCE | SPECIAL_SFX_ROTATE_1 |
31 | }, | 31 | }, |
32 | { "item_health_large", | 32 | { "item_health_large", |
33 | "models/powerups/health/large_cross.md3", | 33 | "models/powerups/health/large_cross.md3", |
34 | "models/powerups/health/large_sphere.md3", | 34 | "models/powerups/health/large_sphere.md3", |
35 | "sound/items/l_health.wav", | 35 | "sound/items/l_health.wav", |
36 | "icons/iconh_red", | 36 | "icons/iconh_red", |
37 | "50 Health", | 37 | "50 Health", |
38 | 50, | 38 | 50, |
39 | HEALTH, | 39 | HEALTH, |
40 | SUB_NONE, | 40 | SUB_NONE, |
41 | SPECIAL_SFX_BOUNCE | SPECIAL_SFX_ROTATE_1 | 41 | SPECIAL_SFX_BOUNCE | SPECIAL_SFX_ROTATE_1 |
42 | }, | 42 | }, |
43 | { | 43 | { |
44 | "item_health_mega", | 44 | "item_health_mega", |
45 | "models/powerups/health/mega_cross.md3", | 45 | "models/powerups/health/mega_cross.md3", |
46 | "models/powerups/health/mega_sphere.md3", | 46 | "models/powerups/health/mega_sphere.md3", |
47 | "sound/items/m_health.wav", | 47 | "sound/items/m_health.wav", |
48 | "icons/iconh_mega", | 48 | "icons/iconh_mega", |
49 | "Mega Health", | 49 | "Mega Health", |
50 | 100, | 50 | 100, |
51 | HEALTH, | 51 | HEALTH, |
52 | SUB_NONE, | 52 | SUB_NONE, |
53 | SPECIAL_SFX_BOUNCE | SPECIAL_SFX_ROTATE_1 | 53 | SPECIAL_SFX_BOUNCE | SPECIAL_SFX_ROTATE_1 |
54 | }, | 54 | }, |
55 | { | 55 | { |
56 | "item_health_small", | 56 | "item_health_small", |
57 | "models/powerups/health/small_cross.md3", | 57 | "models/powerups/health/small_cross.md3", |
58 | "models/powerups/health/small_sphere.md3", | 58 | "models/powerups/health/small_sphere.md3", |
59 | "sound/items/s_health.wav", | 59 | "sound/items/s_health.wav", |
60 | "icons/iconh_green", | 60 | "icons/iconh_green", |
61 | "5 Health", | 61 | "5 Health", |
62 | 5, | 62 | 5, |
63 | HEALTH, | 63 | HEALTH, |
64 | SUB_NONE, | 64 | SUB_NONE, |
65 | SPECIAL_SFX_BOUNCE | SPECIAL_SFX_ROTATE_1 | 65 | SPECIAL_SFX_BOUNCE | SPECIAL_SFX_ROTATE_1 |
66 | }, | 66 | }, |
67 | { "ammo_bullets", | 67 | { "ammo_bullets", |
68 | "models/powerups/ammo/machinegunam.md3", | 68 | "models/powerups/ammo/machinegunam.md3", |
69 | "", | 69 | "", |
70 | "sound/misc/am_pkup.wav", | 70 | "sound/misc/am_pkup.wav", |
71 | "icons/icona_machinegun", | 71 | "icons/icona_machinegun", |
72 | "Bullets", | 72 | "Bullets", |
73 | 50, | 73 | 50, |
74 | AMMO, | 74 | AMMO, |
75 | MACHINEGUN, | 75 | MACHINEGUN, |
76 | SPECIAL_SFX_BOUNCE, | 76 | SPECIAL_SFX_BOUNCE, |
77 | }, | 77 | }, |
78 | { | 78 | { |
79 | "ammo_cells", | 79 | "ammo_cells", |
80 | "models/powerups/ammo/plasmaam.md3", | 80 | "models/powerups/ammo/plasmaam.md3", |
81 | "", | 81 | "", |
82 | "sound/misc/am_pkup.wav", | 82 | "sound/misc/am_pkup.wav", |
83 | "icons/icona_plasma", | 83 | "icons/icona_plasma", |
84 | "Cells", | 84 | "Cells", |
85 | 30, | 85 | 30, |
86 | AMMO, | 86 | AMMO, |
87 | PLASMAGUN, | 87 | PLASMAGUN, |
88 | SPECIAL_SFX_BOUNCE | 88 | SPECIAL_SFX_BOUNCE |
89 | }, | 89 | }, |
90 | { "ammo_rockets", | 90 | { "ammo_rockets", |
91 | "models/powerups/ammo/rocketam.md3", | 91 | "models/powerups/ammo/rocketam.md3", |
92 | "", | 92 | "", |
93 | "", | 93 | "", |
94 | "icons/icona_rocket", | 94 | "icons/icona_rocket", |
95 | "Rockets", | 95 | "Rockets", |
96 | 5, | 96 | 5, |
97 | AMMO, | 97 | AMMO, |
98 | ROCKET_LAUNCHER, | 98 | ROCKET_LAUNCHER, |
99 | SPECIAL_SFX_ROTATE | 99 | SPECIAL_SFX_ROTATE |
100 | }, | 100 | }, |
101 | { | 101 | { |
102 | "ammo_shells", | 102 | "ammo_shells", |
103 | "models/powerups/ammo/shotgunam.md3", | 103 | "models/powerups/ammo/shotgunam.md3", |
104 | "", | 104 | "", |
105 | "sound/misc/am_pkup.wav", | 105 | "sound/misc/am_pkup.wav", |
106 | "icons/icona_shotgun", | 106 | "icons/icona_shotgun", |
107 | "Shells", | 107 | "Shells", |
108 | 10, | 108 | 10, |
109 | AMMO, | 109 | AMMO, |
110 | SHOTGUN, | 110 | SHOTGUN, |
111 | SPECIAL_SFX_ROTATE | 111 | SPECIAL_SFX_ROTATE |
112 | }, | 112 | }, |
113 | { | 113 | { |
114 | "ammo_slugs", | 114 | "ammo_slugs", |
115 | "models/powerups/ammo/railgunam.md3", | 115 | "models/powerups/ammo/railgunam.md3", |
116 | "", | 116 | "", |
117 | "sound/misc/am_pkup.wav", | 117 | "sound/misc/am_pkup.wav", |
118 | "icons/icona_railgun", | 118 | "icons/icona_railgun", |
119 | "Slugs", | 119 | "Slugs", |
120 | 10, | 120 | 10, |
121 | AMMO, | 121 | AMMO, |
122 | RAILGUN, | 122 | RAILGUN, |
123 | SPECIAL_SFX_ROTATE | 123 | SPECIAL_SFX_ROTATE |
124 | }, | 124 | }, |
125 | { | 125 | { |
126 | "item_armor_body", | 126 | "item_armor_body", |
127 | "models/powerups/armor/armor_red.md3", | 127 | "models/powerups/armor/armor_red.md3", |
128 | "", | 128 | "", |
129 | "sound/misc/ar2_pkup.wav", | 129 | "sound/misc/ar2_pkup.wav", |
130 | "icons/iconr_red", | 130 | "icons/iconr_red", |
131 | "Heavy Armor", | 131 | "Heavy Armor", |
132 | 100, | 132 | 100, |
133 | ARMOR, | 133 | ARMOR, |
134 | SUB_NONE, | 134 | SUB_NONE, |
135 | SPECIAL_SFX_ROTATE | 135 | SPECIAL_SFX_ROTATE |
136 | }, | 136 | }, |
137 | { | 137 | { |
138 | "item_armor_combat", | 138 | "item_armor_combat", |
139 | "models/powerups/armor/armor_yel.md3", | 139 | "models/powerups/armor/armor_yel.md3", |
140 | "", | 140 | "", |
141 | "sound/misc/ar2_pkup.wav", | 141 | "sound/misc/ar2_pkup.wav", |
142 | "icons/iconr_yellow", | 142 | "icons/iconr_yellow", |
143 | "Armor", | 143 | "Armor", |
144 | 50, | 144 | 50, |
145 | ARMOR, | 145 | ARMOR, |
146 | SUB_NONE, | 146 | SUB_NONE, |
147 | SPECIAL_SFX_ROTATE | 147 | SPECIAL_SFX_ROTATE |
148 | }, | 148 | }, |
149 | { | 149 | { |
150 | "item_armor_shard", | 150 | "item_armor_shard", |
151 | "models/powerups/armor/shard.md3", | 151 | "models/powerups/armor/shard.md3", |
152 | "", | 152 | "", |
153 | "sound/misc/ar1_pkup.wav", | 153 | "sound/misc/ar1_pkup.wav", |
154 | "icons/iconr_shard", | 154 | "icons/iconr_shard", |
155 | "Armor Shared", | 155 | "Armor Shared", |
156 | 5, | 156 | 5, |
157 | ARMOR, | 157 | ARMOR, |
158 | SUB_NONE, | 158 | SUB_NONE, |
159 | SPECIAL_SFX_ROTATE | 159 | SPECIAL_SFX_ROTATE |
160 | }, | 160 | }, |
161 | { | 161 | { |
162 | "weapon_gauntlet", | 162 | "weapon_gauntlet", |
163 | "models/weapons2/gauntlet/gauntlet.md3", | 163 | "models/weapons2/gauntlet/gauntlet.md3", |
164 | "", | 164 | "", |
165 | "sound/misc/w_pkup.wav", | 165 | "sound/misc/w_pkup.wav", |
166 | "icons/iconw_gauntlet", | 166 | "icons/iconw_gauntlet", |
167 | "Gauntlet", | 167 | "Gauntlet", |
168 | 0, | 168 | 0, |
169 | WEAPON, | 169 | WEAPON, |
170 | GAUNTLET, | 170 | GAUNTLET, |
171 | SPECIAL_SFX_ROTATE | 171 | SPECIAL_SFX_ROTATE |
172 | }, | 172 | }, |
173 | { | 173 | { |
174 | "weapon_shotgun", | 174 | "weapon_shotgun", |
175 | "models/weapons2/shotgun/shotgun.md3", | 175 | "models/weapons2/shotgun/shotgun.md3", |
176 | "", | 176 | "", |
177 | "sound/misc/w_pkup.wav", | 177 | "sound/misc/w_pkup.wav", |
178 | "icons/iconw_shotgun", | 178 | "icons/iconw_shotgun", |
179 | "Shotgun", | 179 | "Shotgun", |
180 | 10, | 180 | 10, |
181 | WEAPON, | 181 | WEAPON, |
182 | SHOTGUN, | 182 | SHOTGUN, |
183 | SPECIAL_SFX_ROTATE | 183 | SPECIAL_SFX_ROTATE |
184 | }, | 184 | }, |
185 | { | 185 | { |
186 | "weapon_machinegun", | 186 | "weapon_machinegun", |
187 | "models/weapons2/machinegun/machinegun.md3", | 187 | "models/weapons2/machinegun/machinegun.md3", |
188 | "", | 188 | "", |
189 | "sound/misc/w_pkup.wav", | 189 | "sound/misc/w_pkup.wav", |
190 | "icons/iconw_machinegun", | 190 | "icons/iconw_machinegun", |
191 | "Machinegun", | 191 | "Machinegun", |
192 | 40, | 192 | 40, |
193 | WEAPON, | 193 | WEAPON, |
194 | MACHINEGUN, | 194 | MACHINEGUN, |
195 | SPECIAL_SFX_ROTATE | 195 | SPECIAL_SFX_ROTATE |
196 | }, | 196 | }, |
197 | { | 197 | { |
198 | "weapon_grenadelauncher", | 198 | "weapon_grenadelauncher", |
199 | "models/weapons2/grenadel/grenadel.md3", | 199 | "models/weapons2/grenadel/grenadel.md3", |
200 | "", | 200 | "", |
201 | "sound/misc/w_pkup.wav", | 201 | "sound/misc/w_pkup.wav", |
202 | "icons/iconw_grenade", | 202 | "icons/iconw_grenade", |
203 | "Grenade Launcher", | 203 | "Grenade Launcher", |
204 | 10, | 204 | 10, |
205 | WEAPON, | 205 | WEAPON, |
206 | GRENADE_LAUNCHER, | 206 | GRENADE_LAUNCHER, |
207 | SPECIAL_SFX_ROTATE | 207 | SPECIAL_SFX_ROTATE |
208 | }, | 208 | }, |
209 | { | 209 | { |
210 | "weapon_rocketlauncher", | 210 | "weapon_rocketlauncher", |
211 | "models/weapons2/rocketl/rocketl.md3", | 211 | "models/weapons2/rocketl/rocketl.md3", |
212 | "", | 212 | "", |
213 | "sound/misc/w_pkup.wav", | 213 | "sound/misc/w_pkup.wav", |
214 | "icons/iconw_rocket", | 214 | "icons/iconw_rocket", |
215 | "Rocket Launcher", | 215 | "Rocket Launcher", |
216 | 10, | 216 | 10, |
217 | WEAPON, | 217 | WEAPON, |
218 | ROCKET_LAUNCHER, | 218 | ROCKET_LAUNCHER, |
219 | SPECIAL_SFX_ROTATE | 219 | SPECIAL_SFX_ROTATE |
220 | }, | 220 | }, |
221 | { | 221 | { |
222 | "weapon_lightning", | 222 | "weapon_lightning", |
223 | "models/weapons2/lightning/lightning.md3", | 223 | "models/weapons2/lightning/lightning.md3", |
224 | "", | 224 | "", |
225 | "sound/misc/w_pkup.wav", | 225 | "sound/misc/w_pkup.wav", |
226 | "icons/iconw_lightning", | 226 | "icons/iconw_lightning", |
227 | "Lightning Gun", | 227 | "Lightning Gun", |
228 | 100, | 228 | 100, |
229 | WEAPON, | 229 | WEAPON, |
230 | LIGHTNING, | 230 | LIGHTNING, |
231 | SPECIAL_SFX_ROTATE | 231 | SPECIAL_SFX_ROTATE |
232 | }, | 232 | }, |
233 | { | 233 | { |
234 | "weapon_railgun", | 234 | "weapon_railgun", |
235 | "models/weapons2/railgun/railgun.md3", | 235 | "models/weapons2/railgun/railgun.md3", |
236 | "", | 236 | "", |
237 | "sound/misc/w_pkup.wav", | 237 | "sound/misc/w_pkup.wav", |
238 | "icons/iconw_railgun", | 238 | "icons/iconw_railgun", |
239 | "Railgun", | 239 | "Railgun", |
240 | 10, | 240 | 10, |
241 | WEAPON, | 241 | WEAPON, |
242 | RAILGUN, | 242 | RAILGUN, |
243 | SPECIAL_SFX_ROTATE | 243 | SPECIAL_SFX_ROTATE |
244 | }, | 244 | }, |
245 | { | 245 | { |
246 | "weapon_plasmagun", | 246 | "weapon_plasmagun", |
247 | "models/weapons2/plasma/plasma.md3", | 247 | "models/weapons2/plasma/plasma.md3", |
248 | "", | 248 | "", |
249 | "sound/misc/w_pkup.wav", | 249 | "sound/misc/w_pkup.wav", |
250 | "icons/iconw_plasma", | 250 | "icons/iconw_plasma", |
251 | "Plasma Gun", | 251 | "Plasma Gun", |
252 | 50, | 252 | 50, |
253 | WEAPON, | 253 | WEAPON, |
254 | PLASMAGUN, | 254 | PLASMAGUN, |
255 | SPECIAL_SFX_ROTATE | 255 | SPECIAL_SFX_ROTATE |
256 | }, | 256 | }, |
257 | { | 257 | { |
258 | "weapon_bfg", | 258 | "weapon_bfg", |
259 | "models/weapons2/bfg/bfg.md3", | 259 | "models/weapons2/bfg/bfg.md3", |
260 | "", | 260 | "", |
261 | "sound/misc/w_pkup.wav", | 261 | "sound/misc/w_pkup.wav", |
262 | "icons/iconw_bfg", | 262 | "icons/iconw_bfg", |
263 | "BFG10K", | 263 | "BFG10K", |
264 | 20, | 264 | 20, |
265 | WEAPON, | 265 | WEAPON, |
266 | BFG, | 266 | BFG, |
267 | SPECIAL_SFX_ROTATE | 267 | SPECIAL_SFX_ROTATE |
268 | }, | 268 | }, |
269 | { | 269 | { |
270 | "weapon_grapplinghook", | 270 | "weapon_grapplinghook", |
271 | "models/weapons2/grapple/grapple.md3", | 271 | "models/weapons2/grapple/grapple.md3", |
272 | "", | 272 | "", |
273 | "sound/misc/w_pkup.wav", | 273 | "sound/misc/w_pkup.wav", |
274 | "icons/iconw_grapple", | 274 | "icons/iconw_grapple", |
275 | "Grappling Hook", | 275 | "Grappling Hook", |
276 | 0, | 276 | 0, |
277 | WEAPON, | 277 | WEAPON, |
278 | GRAPPLING_HOOK, | 278 | GRAPPLING_HOOK, |
279 | SPECIAL_SFX_ROTATE | 279 | SPECIAL_SFX_ROTATE |
280 | }, | 280 | }, |
281 | { | 281 | { |
282 | 0 | 282 | 0 |
283 | } | 283 | } |
284 | 284 | ||
285 | }; | 285 | }; |
286 | 286 | ||
287 | 287 | ||
288 | /*! | 288 | /*! |
289 | */ | 289 | */ |
290 | const SItemElement * getItemElement ( const stringc& key ) | 290 | const SItemElement * getItemElement ( const stringc& key ) |
291 | { | 291 | { |
292 | const SItemElement *item = Quake3ItemElement; | 292 | const SItemElement *item = Quake3ItemElement; |
293 | 293 | ||
294 | while ( item->key ) | 294 | while ( item->key ) |
295 | { | 295 | { |
296 | if ( 0 == strcmp ( key.c_str(), item->key ) ) | 296 | if ( 0 == strcmp ( key.c_str(), item->key ) ) |
297 | return item; | 297 | return item; |
298 | item += 1; | 298 | item += 1; |
299 | } | 299 | } |
300 | return 0; | 300 | return 0; |
301 | } | 301 | } |
302 | 302 | ||
303 | /*! | 303 | /*! |
304 | Quake3 Model Factory. | 304 | Quake3 Model Factory. |
305 | Takes the mesh buffers and creates scenenodes for their associated shaders | 305 | Takes the mesh buffers and creates scenenodes for their associated shaders |
306 | */ | 306 | */ |
307 | void Q3ShaderFactory ( Q3LevelLoadParameter &loadParam, | 307 | void Q3ShaderFactory ( Q3LevelLoadParameter &loadParam, |
308 | IrrlichtDevice *device, | 308 | IrrlichtDevice *device, |
309 | IQ3LevelMesh* mesh, | 309 | IQ3LevelMesh* mesh, |
310 | eQ3MeshIndex meshIndex, | 310 | eQ3MeshIndex meshIndex, |
311 | ISceneNode *parent, | 311 | ISceneNode *parent, |
312 | IMetaTriangleSelector *meta, | 312 | IMetaTriangleSelector *meta, |
313 | bool showShaderName ) | 313 | bool showShaderName ) |
314 | { | 314 | { |
315 | if ( 0 == mesh || 0 == device ) | 315 | if ( 0 == mesh || 0 == device ) |
316 | return; | 316 | return; |
317 | 317 | ||
318 | IMeshSceneNode* node = 0; | 318 | IMeshSceneNode* node = 0; |
319 | ISceneManager* smgr = device->getSceneManager(); | 319 | ISceneManager* smgr = device->getSceneManager(); |
320 | ITriangleSelector * selector = 0; | 320 | ITriangleSelector * selector = 0; |
321 | 321 | ||
322 | // the additional mesh can be quite huge and is unoptimized | 322 | // the additional mesh can be quite huge and is unoptimized |
323 | // Save to cast to SMesh | 323 | // Save to cast to SMesh |
324 | SMesh * additional_mesh = (SMesh*) mesh->getMesh ( meshIndex ); | 324 | SMesh * additional_mesh = (SMesh*) mesh->getMesh ( meshIndex ); |
325 | if ( 0 == additional_mesh || additional_mesh->getMeshBufferCount() == 0) | 325 | if ( 0 == additional_mesh || additional_mesh->getMeshBufferCount() == 0) |
326 | return; | 326 | return; |
327 | 327 | ||
328 | char buf[128]; | 328 | char buf[128]; |
329 | if ( loadParam.verbose > 0 ) | 329 | if ( loadParam.verbose > 0 ) |
330 | { | 330 | { |
331 | loadParam.startTime = device->getTimer()->getRealTime(); | 331 | loadParam.startTime = device->getTimer()->getRealTime(); |
332 | if ( loadParam.verbose > 1 ) | 332 | if ( loadParam.verbose > 1 ) |
333 | { | 333 | { |
334 | snprintf(buf, 128, "q3shaderfactory start" ); | 334 | snprintf(buf, 128, "q3shaderfactory start" ); |
335 | device->getLogger()->log( buf, ELL_INFORMATION); | 335 | device->getLogger()->log( buf, ELL_INFORMATION); |
336 | } | 336 | } |
337 | } | 337 | } |
338 | 338 | ||
339 | IGUIFont *font = 0; | 339 | IGUIFont *font = 0; |
340 | if ( showShaderName ) | 340 | if ( showShaderName ) |
341 | font = device->getGUIEnvironment()->getFont("fontlucida.png"); | 341 | font = device->getGUIEnvironment()->getFont("fontlucida.png"); |
342 | 342 | ||
343 | IVideoDriver *driver = device->getVideoDriver(); | 343 | IVideoDriver *driver = device->getVideoDriver(); |
344 | 344 | ||
345 | // create helper textures | 345 | // create helper textures |
346 | if ( 1 ) | 346 | if ( 1 ) |
347 | { | 347 | { |
348 | tTexArray tex; | 348 | tTexArray tex; |
349 | u32 pos = 0; | 349 | u32 pos = 0; |
350 | getTextures ( tex, "$redimage $blueimage $whiteimage $checkerimage", pos, | 350 | getTextures ( tex, "$redimage $blueimage $whiteimage $checkerimage", pos, |
351 | device->getFileSystem(), driver ); | 351 | device->getFileSystem(), driver ); |
352 | } | 352 | } |
353 | 353 | ||
354 | s32 sceneNodeID = 0; | 354 | s32 sceneNodeID = 0; |
355 | for ( u32 i = 0; i!= additional_mesh->getMeshBufferCount (); ++i ) | 355 | for ( u32 i = 0; i!= additional_mesh->getMeshBufferCount (); ++i ) |
356 | { | 356 | { |
357 | IMeshBuffer *meshBuffer = additional_mesh->getMeshBuffer ( i ); | 357 | IMeshBuffer *meshBuffer = additional_mesh->getMeshBuffer ( i ); |
358 | const SMaterial &material = meshBuffer->getMaterial(); | 358 | const SMaterial &material = meshBuffer->getMaterial(); |
359 | 359 | ||
360 | //! The ShaderIndex is stored in the second material parameter | 360 | //! The ShaderIndex is stored in the second material parameter |
361 | s32 shaderIndex = (s32) material.MaterialTypeParam2; | 361 | s32 shaderIndex = (s32) material.MaterialTypeParam2; |
362 | 362 | ||
363 | // the meshbuffer can be rendered without additional support, or it has no shader | 363 | // the meshbuffer can be rendered without additional support, or it has no shader |
364 | IShader *shader = (IShader *) mesh->getShader ( shaderIndex ); | 364 | IShader *shader = (IShader *) mesh->getShader ( shaderIndex ); |
365 | 365 | ||
366 | // no shader, or mapped to existing material | 366 | // no shader, or mapped to existing material |
367 | if ( 0 == shader ) | 367 | if ( 0 == shader ) |
368 | { | 368 | { |
369 | 369 | ||
370 | #if 1 | 370 | #if 1 |
371 | // clone mesh | 371 | // clone mesh |
372 | SMesh * m = new SMesh (); | 372 | SMesh * m = new SMesh (); |
373 | m->addMeshBuffer ( meshBuffer ); | 373 | m->addMeshBuffer ( meshBuffer ); |
374 | SMaterial &mat = m->getMeshBuffer( 0 )->getMaterial(); | 374 | SMaterial &mat = m->getMeshBuffer( 0 )->getMaterial(); |
375 | if ( mat.getTexture( 0 ) == 0 ) | 375 | if ( mat.getTexture( 0 ) == 0 ) |
376 | mat.setTexture ( 0, driver->getTexture ( "$blueimage" ) ); | 376 | mat.setTexture ( 0, driver->getTexture ( "$blueimage" ) ); |
377 | if ( mat.getTexture( 1 ) == 0 ) | 377 | if ( mat.getTexture( 1 ) == 0 ) |
378 | mat.setTexture ( 1, driver->getTexture ( "$redimage" ) ); | 378 | mat.setTexture ( 1, driver->getTexture ( "$redimage" ) ); |
379 | 379 | ||
380 | IMesh * store = smgr->getMeshManipulator ()->createMeshWith2TCoords ( m ); | 380 | IMesh * store = smgr->getMeshManipulator ()->createMeshWith2TCoords ( m ); |
381 | m->drop(); | 381 | m->drop(); |
382 | 382 | ||
383 | node = smgr->addMeshSceneNode ( store, parent, sceneNodeID ); | 383 | node = smgr->addMeshSceneNode ( store, parent, sceneNodeID ); |
384 | node->setAutomaticCulling ( scene::EAC_OFF ); | 384 | node->setAutomaticCulling ( scene::EAC_OFF ); |
385 | store->drop (); | 385 | store->drop (); |
386 | sceneNodeID += 1; | 386 | sceneNodeID += 1; |
387 | #endif | 387 | #endif |
388 | } | 388 | } |
389 | else if ( 1 ) | 389 | else if ( 1 ) |
390 | { | 390 | { |
391 | /* | 391 | /* |
392 | stringc s; | 392 | stringc s; |
393 | dumpShader ( s, shader ); | 393 | dumpShader ( s, shader ); |
394 | printf ( s.c_str () ); | 394 | printf ( s.c_str () ); |
395 | */ | 395 | */ |
396 | // create sceneNode | 396 | // create sceneNode |
397 | node = smgr->addQuake3SceneNode ( meshBuffer, shader, parent, sceneNodeID ); | 397 | node = smgr->addQuake3SceneNode ( meshBuffer, shader, parent, sceneNodeID ); |
398 | node->setAutomaticCulling ( scene::EAC_FRUSTUM_BOX ); | 398 | node->setAutomaticCulling ( scene::EAC_FRUSTUM_BOX ); |
399 | sceneNodeID += 1; | 399 | sceneNodeID += 1; |
400 | } | 400 | } |
401 | 401 | ||
402 | // show Debug Shader Name | 402 | // show Debug Shader Name |
403 | if ( showShaderName && node ) | 403 | if ( showShaderName && node ) |
404 | { | 404 | { |
405 | swprintf ( (wchar_t*) buf, 64, L"%hs:%d", node->getName(),node->getID() ); | 405 | swprintf ( (wchar_t*) buf, 64, L"%hs:%d", node->getName(),node->getID() ); |
406 | smgr->addBillboardTextSceneNode( | 406 | smgr->addBillboardTextSceneNode( |
407 | font, | 407 | font, |
408 | (wchar_t*) buf, | 408 | (wchar_t*) buf, |
409 | node, | 409 | node, |
410 | dimension2d<f32>(80.0f, 8.0f), | 410 | dimension2d<f32>(80.0f, 8.0f), |
411 | vector3df(0, 10, 0), | 411 | vector3df(0, 10, 0), |
412 | sceneNodeID); | 412 | sceneNodeID); |
413 | sceneNodeID += 1; | 413 | sceneNodeID += 1; |
414 | } | 414 | } |
415 | 415 | ||
416 | // create Portal Rendertargets | 416 | // create Portal Rendertargets |
417 | if ( shader ) | 417 | if ( shader ) |
418 | { | 418 | { |
419 | const SVarGroup *group = shader->getGroup(1); | 419 | const SVarGroup *group = shader->getGroup(1); |
420 | if ( group->isDefined( "surfaceparm", "portal" ) ) | 420 | if ( group->isDefined( "surfaceparm", "portal" ) ) |
421 | { | 421 | { |
422 | } | 422 | } |
423 | 423 | ||
424 | } | 424 | } |
425 | 425 | ||
426 | 426 | ||
427 | // add collision | 427 | // add collision |
428 | // find out if shader is marked as nonsolid | 428 | // find out if shader is marked as nonsolid |
429 | u8 doCreate = meta !=0 ; | 429 | u8 doCreate = meta !=0 ; |
430 | 430 | ||
431 | if ( shader ) | 431 | if ( shader ) |
432 | { | 432 | { |
433 | const SVarGroup *group = shader->getGroup(1); | 433 | const SVarGroup *group = shader->getGroup(1); |
434 | if ( group->isDefined( "surfaceparm", "trans" ) | 434 | if ( group->isDefined( "surfaceparm", "trans" ) |
435 | // || group->isDefined( "surfaceparm", "sky" ) | 435 | // || group->isDefined( "surfaceparm", "sky" ) |
436 | // || group->isDefined( "surfaceparm", "nonsolid" ) | 436 | // || group->isDefined( "surfaceparm", "nonsolid" ) |
437 | ) | 437 | ) |
438 | { | 438 | { |
439 | if ( !group->isDefined( "surfaceparm", "metalsteps" ) ) | 439 | if ( !group->isDefined( "surfaceparm", "metalsteps" ) ) |
440 | { | 440 | { |
441 | doCreate = 0; | 441 | doCreate = 0; |
442 | } | 442 | } |
443 | } | 443 | } |
444 | } | 444 | } |
445 | 445 | ||
446 | if ( doCreate ) | 446 | if ( doCreate ) |
447 | { | 447 | { |
448 | IMesh *m = 0; | 448 | IMesh *m = 0; |
449 | 449 | ||
450 | //! controls if triangles are modified by the scenenode during runtime | 450 | //! controls if triangles are modified by the scenenode during runtime |
451 | bool takeOriginal = true; | 451 | bool takeOriginal = true; |
452 | 452 | ||
453 | if ( takeOriginal ) | 453 | if ( takeOriginal ) |
454 | { | 454 | { |
455 | m = new SMesh (); | 455 | m = new SMesh (); |
456 | ((SMesh*) m )->addMeshBuffer (meshBuffer); | 456 | ((SMesh*) m )->addMeshBuffer (meshBuffer); |
457 | } | 457 | } |
458 | else | 458 | else |
459 | { | 459 | { |
460 | m = node->getMesh(); | 460 | m = node->getMesh(); |
461 | } | 461 | } |
462 | 462 | ||
463 | //selector = smgr->createOctreeTriangleSelector ( m, 0, 128 ); | 463 | //selector = smgr->createOctreeTriangleSelector ( m, 0, 128 ); |
464 | selector = smgr->createTriangleSelector ( m, 0 ); | 464 | selector = smgr->createTriangleSelector ( m, 0 ); |
465 | meta->addTriangleSelector ( selector ); | 465 | meta->addTriangleSelector ( selector ); |
466 | selector->drop (); | 466 | selector->drop (); |
467 | 467 | ||
468 | if ( takeOriginal ) | 468 | if ( takeOriginal ) |
469 | { | 469 | { |
470 | delete m; | 470 | delete m; |
471 | } | 471 | } |
472 | } | 472 | } |
473 | 473 | ||
474 | } | 474 | } |
475 | 475 | ||
476 | #if 0 | 476 | #if 0 |
477 | if ( meta ) | 477 | if ( meta ) |
478 | { | 478 | { |
479 | selector = smgr->createOctreeTriangleSelector ( additional_mesh, 0 ); | 479 | selector = smgr->createOctreeTriangleSelector ( additional_mesh, 0 ); |
480 | meta->addTriangleSelector ( selector ); | 480 | meta->addTriangleSelector ( selector ); |
481 | selector->drop (); | 481 | selector->drop (); |
482 | } | 482 | } |
483 | #endif | 483 | #endif |
484 | 484 | ||
485 | if ( loadParam.verbose > 0 ) | 485 | if ( loadParam.verbose > 0 ) |
486 | { | 486 | { |
487 | loadParam.endTime = device->getTimer()->getRealTime (); | 487 | loadParam.endTime = device->getTimer()->getRealTime (); |
488 | snprintf(buf, 128, "q3shaderfactory needed %04d ms to create %d shader nodes", | 488 | snprintf(buf, 128, "q3shaderfactory needed %04d ms to create %d shader nodes", |
489 | loadParam.endTime - loadParam.startTime, | 489 | loadParam.endTime - loadParam.startTime, |
490 | sceneNodeID | 490 | sceneNodeID |
491 | ); | 491 | ); |
492 | device->getLogger()->log(buf, ELL_INFORMATION); | 492 | device->getLogger()->log(buf, ELL_INFORMATION); |
493 | } | 493 | } |
494 | 494 | ||
495 | } | 495 | } |
496 | 496 | ||
497 | 497 | ||
498 | /*! | 498 | /*! |
499 | create Items from Entity | 499 | create Items from Entity |
500 | */ | 500 | */ |
501 | void Q3ModelFactory ( Q3LevelLoadParameter &loadParam, | 501 | void Q3ModelFactory ( Q3LevelLoadParameter &loadParam, |
502 | IrrlichtDevice *device, | 502 | IrrlichtDevice *device, |
503 | IQ3LevelMesh* masterMesh, | 503 | IQ3LevelMesh* masterMesh, |
504 | ISceneNode *parent, | 504 | ISceneNode *parent, |
505 | bool showShaderName | 505 | bool showShaderName |
506 | ) | 506 | ) |
507 | { | 507 | { |
508 | if ( 0 == masterMesh ) | 508 | if ( 0 == masterMesh ) |
509 | return; | 509 | return; |
510 | 510 | ||
511 | tQ3EntityList &entity = masterMesh->getEntityList (); | 511 | tQ3EntityList &entity = masterMesh->getEntityList (); |
512 | ISceneManager* smgr = device->getSceneManager(); | 512 | ISceneManager* smgr = device->getSceneManager(); |
513 | 513 | ||
514 | 514 | ||
515 | char buf[128]; | 515 | char buf[128]; |
516 | const SVarGroup *group; | 516 | const SVarGroup *group; |
517 | IEntity search; | 517 | IEntity search; |
518 | s32 index; | 518 | s32 index; |
519 | s32 lastIndex; | 519 | s32 lastIndex; |
520 | 520 | ||
521 | /* | 521 | /* |
522 | stringc s; | 522 | stringc s; |
523 | FILE *f = 0; | 523 | FILE *f = 0; |
524 | f = fopen ( "entity.txt", "wb" ); | 524 | f = fopen ( "entity.txt", "wb" ); |
525 | for ( index = 0; (u32) index < entityList.size (); ++index ) | 525 | for ( index = 0; (u32) index < entityList.size (); ++index ) |
526 | { | 526 | { |
527 | const IEntity *entity = &entityList[ index ]; | 527 | const IEntity *entity = &entityList[ index ]; |
528 | s = entity->name; | 528 | s = entity->name; |
529 | dumpShader ( s, entity ); | 529 | dumpShader ( s, entity ); |
530 | fwrite ( s.c_str(), 1, s.size(), f ); | 530 | fwrite ( s.c_str(), 1, s.size(), f ); |
531 | } | 531 | } |
532 | fclose ( f ); | 532 | fclose ( f ); |
533 | */ | 533 | */ |
534 | IAnimatedMeshMD3* model; | 534 | IAnimatedMeshMD3* model; |
535 | SMD3Mesh * mesh; | 535 | SMD3Mesh * mesh; |
536 | const SMD3MeshBuffer *meshBuffer; | 536 | const SMD3MeshBuffer *meshBuffer; |
537 | IMeshSceneNode* node; | 537 | IMeshSceneNode* node; |
538 | ISceneNodeAnimator* anim; | 538 | ISceneNodeAnimator* anim; |
539 | const IShader *shader; | 539 | const IShader *shader; |
540 | u32 pos; | 540 | u32 pos; |
541 | vector3df p; | 541 | vector3df p; |
542 | u32 nodeCount = 0; | 542 | u32 nodeCount = 0; |
543 | tTexArray textureArray; | 543 | tTexArray textureArray; |
544 | 544 | ||
545 | IGUIFont *font = 0; | 545 | IGUIFont *font = 0; |
546 | if ( showShaderName ) | 546 | if ( showShaderName ) |
547 | font = device->getGUIEnvironment()->getFont("fontlucida.png"); | 547 | font = device->getGUIEnvironment()->getFont("fontlucida.png"); |
548 | 548 | ||
549 | const SItemElement *itemElement; | 549 | const SItemElement *itemElement; |
550 | 550 | ||
551 | // walk list | 551 | // walk list |
552 | for ( index = 0; (u32) index < entity.size(); ++index ) | 552 | for ( index = 0; (u32) index < entity.size(); ++index ) |
553 | { | 553 | { |
554 | itemElement = getItemElement ( entity[index].name ); | 554 | itemElement = getItemElement ( entity[index].name ); |
555 | if ( 0 == itemElement ) | 555 | if ( 0 == itemElement ) |
556 | continue; | 556 | continue; |
557 | 557 | ||
558 | pos = 0; | 558 | pos = 0; |
559 | p = getAsVector3df ( entity[index].getGroup(1)->get ( "origin" ), pos ); | 559 | p = getAsVector3df ( entity[index].getGroup(1)->get ( "origin" ), pos ); |
560 | 560 | ||
561 | nodeCount += 1; | 561 | nodeCount += 1; |
562 | for ( u32 g = 0; g < 2; ++g ) | 562 | for ( u32 g = 0; g < 2; ++g ) |
563 | { | 563 | { |
564 | if ( 0 == itemElement->model[g] || itemElement->model[g][0] == 0 ) | 564 | if ( 0 == itemElement->model[g] || itemElement->model[g][0] == 0 ) |
565 | continue; | 565 | continue; |
566 | model = (IAnimatedMeshMD3*) smgr->getMesh( itemElement->model[g] ); | 566 | model = (IAnimatedMeshMD3*) smgr->getMesh( itemElement->model[g] ); |
567 | if ( 0 == model ) | 567 | if ( 0 == model ) |
568 | continue; | 568 | continue; |
569 | 569 | ||
570 | mesh = model->getOriginalMesh(); | 570 | mesh = model->getOriginalMesh(); |
571 | for ( u32 j = 0; j != mesh->Buffer.size (); ++j ) | 571 | for ( u32 j = 0; j != mesh->Buffer.size (); ++j ) |
572 | { | 572 | { |
573 | meshBuffer = mesh->Buffer[j]; | 573 | meshBuffer = mesh->Buffer[j]; |
574 | if ( 0 == meshBuffer ) | 574 | if ( 0 == meshBuffer ) |
575 | continue; | 575 | continue; |
576 | 576 | ||
577 | shader = masterMesh->getShader ( meshBuffer->Shader.c_str(), false ); | 577 | shader = masterMesh->getShader ( meshBuffer->Shader.c_str(), false ); |
578 | IMeshBuffer *final = model->getMesh(0)->getMeshBuffer(j); | 578 | IMeshBuffer *final = model->getMesh(0)->getMeshBuffer(j); |
579 | if ( shader ) | 579 | if ( shader ) |
580 | { | 580 | { |
581 | //!TODO: Hack don't modify the vertexbuffer. make it better;-) | 581 | //!TODO: Hack don't modify the vertexbuffer. make it better;-) |
582 | final->getMaterial().ColorMask = 0; | 582 | final->getMaterial().ColorMask = 0; |
583 | node = smgr->addQuake3SceneNode ( final, shader, parent ); | 583 | node = smgr->addQuake3SceneNode ( final, shader, parent ); |
584 | final->getMaterial().ColorMask = 15; | 584 | final->getMaterial().ColorMask = 15; |
585 | } | 585 | } |
586 | else | 586 | else |
587 | { | 587 | { |
588 | // clone mesh | 588 | // clone mesh |
589 | SMesh * m = new SMesh (); | 589 | SMesh * m = new SMesh (); |
590 | m->addMeshBuffer ( final ); | 590 | m->addMeshBuffer ( final ); |
591 | node = smgr->addMeshSceneNode ( m, parent ); | 591 | node = smgr->addMeshSceneNode ( m, parent ); |
592 | m->drop(); | 592 | m->drop(); |
593 | } | 593 | } |
594 | 594 | ||
595 | if ( 0 == node ) | 595 | if ( 0 == node ) |
596 | { | 596 | { |
597 | snprintf ( buf, 128, "q3ModelFactory shader %s failed", meshBuffer->Shader.c_str() ); | 597 | snprintf ( buf, 128, "q3ModelFactory shader %s failed", meshBuffer->Shader.c_str() ); |
598 | device->getLogger()->log ( buf ); | 598 | device->getLogger()->log ( buf ); |
599 | continue; | 599 | continue; |
600 | } | 600 | } |
601 | 601 | ||
602 | // node was maybe centered by shaderscenenode | 602 | // node was maybe centered by shaderscenenode |
603 | node->setPosition ( p ); | 603 | node->setPosition ( p ); |
604 | node->setName ( meshBuffer->Shader ); | 604 | node->setName ( meshBuffer->Shader ); |
605 | node->setAutomaticCulling ( scene::EAC_BOX ); | 605 | node->setAutomaticCulling ( scene::EAC_BOX ); |
606 | 606 | ||
607 | // add special effects to node | 607 | // add special effects to node |
608 | if ( itemElement->special & SPECIAL_SFX_ROTATE || | 608 | if ( itemElement->special & SPECIAL_SFX_ROTATE || |
609 | (g == 0 && itemElement->special & SPECIAL_SFX_ROTATE_1) | 609 | (g == 0 && itemElement->special & SPECIAL_SFX_ROTATE_1) |
610 | ) | 610 | ) |
611 | { | 611 | { |
612 | anim = smgr->createRotationAnimator ( vector3df ( 0.f, | 612 | anim = smgr->createRotationAnimator ( vector3df ( 0.f, |
613 | 2.f, 0.f ) ); | 613 | 2.f, 0.f ) ); |
614 | node->addAnimator ( anim ); | 614 | node->addAnimator ( anim ); |
615 | anim->drop (); | 615 | anim->drop (); |
616 | } | 616 | } |
617 | 617 | ||
618 | if ( itemElement->special & SPECIAL_SFX_BOUNCE ) | 618 | if ( itemElement->special & SPECIAL_SFX_BOUNCE ) |
619 | { | 619 | { |
620 | //anim = smgr->createFlyStraightAnimator ( | 620 | //anim = smgr->createFlyStraightAnimator ( |
621 | // p, p + vector3df ( 0.f, 60.f, 0.f ), 1000, true, true ); | 621 | // p, p + vector3df ( 0.f, 60.f, 0.f ), 1000, true, true ); |
622 | anim = smgr->createFlyCircleAnimator ( | 622 | anim = smgr->createFlyCircleAnimator ( |
623 | p + vector3df( 0.f, 20.f, 0.f ), | 623 | p + vector3df( 0.f, 20.f, 0.f ), |
624 | 20.f, | 624 | 20.f, |
625 | 0.005f, | 625 | 0.005f, |
626 | vector3df ( 1.f, 0.f, 0.f ), | 626 | vector3df ( 1.f, 0.f, 0.f ), |
627 | core::fract ( nodeCount * 0.05f ), | 627 | core::fract ( nodeCount * 0.05f ), |
628 | 1.f | 628 | 1.f |
629 | ); | 629 | ); |
630 | node->addAnimator ( anim ); | 630 | node->addAnimator ( anim ); |
631 | anim->drop (); | 631 | anim->drop (); |
632 | } | 632 | } |
633 | } | 633 | } |
634 | } | 634 | } |
635 | // show name | 635 | // show name |
636 | if ( showShaderName ) | 636 | if ( showShaderName ) |
637 | { | 637 | { |
638 | swprintf ( (wchar_t*) buf, sizeof(buf) / 2, L"%hs", itemElement->key ); | 638 | swprintf ( (wchar_t*) buf, sizeof(buf) / 2, L"%hs", itemElement->key ); |
639 | smgr->addBillboardTextSceneNode( | 639 | smgr->addBillboardTextSceneNode( |
640 | font, | 640 | font, |
641 | (wchar_t*) buf, | 641 | (wchar_t*) buf, |
642 | parent, | 642 | parent, |
643 | dimension2d<f32>(80.0f, 8.0f), | 643 | dimension2d<f32>(80.0f, 8.0f), |
644 | p + vector3df(0, 30, 0), | 644 | p + vector3df(0, 30, 0), |
645 | 0); | 645 | 0); |
646 | } | 646 | } |
647 | } | 647 | } |
648 | 648 | ||
649 | // music | 649 | // music |
650 | search.name = "worldspawn"; | 650 | search.name = "worldspawn"; |
651 | index = entity.binary_search_multi ( search, lastIndex ); | 651 | index = entity.binary_search_multi ( search, lastIndex ); |
652 | 652 | ||
653 | if ( index >= 0 ) | 653 | if ( index >= 0 ) |
654 | { | 654 | { |
655 | group = entity[ index ].getGroup(1); | 655 | group = entity[ index ].getGroup(1); |
656 | background_music ( group->get ( "music" ).c_str () ); | 656 | background_music ( group->get ( "music" ).c_str () ); |
657 | } | 657 | } |
658 | 658 | ||
659 | // music | 659 | // music |
660 | search.name = "worldspawn"; | 660 | search.name = "worldspawn"; |
661 | index = entity.binary_search_multi ( search, lastIndex ); | 661 | index = entity.binary_search_multi ( search, lastIndex ); |
662 | 662 | ||
663 | if ( index >= 0 ) | 663 | if ( index >= 0 ) |
664 | { | 664 | { |
665 | group = entity[ index ].getGroup(1); | 665 | group = entity[ index ].getGroup(1); |
666 | background_music ( group->get ( "music" ).c_str () ); | 666 | background_music ( group->get ( "music" ).c_str () ); |
667 | } | 667 | } |
668 | 668 | ||
669 | //IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2"); | 669 | //IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2"); |
670 | //IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh ); | 670 | //IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh ); |
671 | 671 | ||
672 | } | 672 | } |
673 | 673 | ||
674 | /*! | 674 | /*! |
675 | so we need a good starting Position in the level. | 675 | so we need a good starting Position in the level. |
676 | we can ask the Quake3 Loader for all entities with class_name "info_player_deathmatch" | 676 | we can ask the Quake3 Loader for all entities with class_name "info_player_deathmatch" |
677 | */ | 677 | */ |
678 | s32 Q3StartPosition ( IQ3LevelMesh* mesh, | 678 | s32 Q3StartPosition ( IQ3LevelMesh* mesh, |
679 | ICameraSceneNode* camera, | 679 | ICameraSceneNode* camera, |
680 | s32 startposIndex, | 680 | s32 startposIndex, |
681 | const vector3df &translation | 681 | const vector3df &translation |
682 | ) | 682 | ) |
683 | { | 683 | { |
684 | if ( 0 == mesh ) | 684 | if ( 0 == mesh ) |
685 | return 0; | 685 | return 0; |
686 | 686 | ||
687 | tQ3EntityList &entityList = mesh->getEntityList (); | 687 | tQ3EntityList &entityList = mesh->getEntityList (); |
688 | 688 | ||
689 | IEntity search; | 689 | IEntity search; |
690 | search.name = "info_player_start"; // "info_player_deathmatch"; | 690 | search.name = "info_player_start"; // "info_player_deathmatch"; |
691 | 691 | ||
692 | // find all entities in the multi-list | 692 | // find all entities in the multi-list |
693 | s32 lastIndex; | 693 | s32 lastIndex; |
694 | s32 index = entityList.binary_search_multi ( search, lastIndex ); | 694 | s32 index = entityList.binary_search_multi ( search, lastIndex ); |
695 | 695 | ||
696 | if ( index < 0 ) | 696 | if ( index < 0 ) |
697 | { | 697 | { |
698 | search.name = "info_player_deathmatch"; | 698 | search.name = "info_player_deathmatch"; |
699 | index = entityList.binary_search_multi ( search, lastIndex ); | 699 | index = entityList.binary_search_multi ( search, lastIndex ); |
700 | } | 700 | } |
701 | 701 | ||
702 | if ( index < 0 ) | 702 | if ( index < 0 ) |
703 | return 0; | 703 | return 0; |
704 | 704 | ||
705 | index += core::clamp ( startposIndex, 0, lastIndex - index ); | 705 | index += core::clamp ( startposIndex, 0, lastIndex - index ); |
706 | 706 | ||
707 | u32 parsepos; | 707 | u32 parsepos; |
708 | 708 | ||
709 | const SVarGroup *group; | 709 | const SVarGroup *group; |
710 | group = entityList[ index ].getGroup(1); | 710 | group = entityList[ index ].getGroup(1); |
711 | 711 | ||
712 | parsepos = 0; | 712 | parsepos = 0; |
713 | vector3df pos = getAsVector3df ( group->get ( "origin" ), parsepos ); | 713 | vector3df pos = getAsVector3df ( group->get ( "origin" ), parsepos ); |
714 | pos += translation; | 714 | pos += translation; |
715 | 715 | ||
716 | parsepos = 0; | 716 | parsepos = 0; |
717 | f32 angle = getAsFloat ( group->get ( "angle"), parsepos ); | 717 | f32 angle = getAsFloat ( group->get ( "angle"), parsepos ); |
718 | 718 | ||
719 | vector3df target ( 0.f, 0.f, 1.f ); | 719 | vector3df target ( 0.f, 0.f, 1.f ); |
720 | target.rotateXZBy ( angle - 90.f, vector3df () ); | 720 | target.rotateXZBy ( angle - 90.f, vector3df () ); |
721 | 721 | ||
722 | if ( camera ) | 722 | if ( camera ) |
723 | { | 723 | { |
724 | camera->setPosition ( pos ); | 724 | camera->setPosition ( pos ); |
725 | camera->setTarget ( pos + target ); | 725 | camera->setTarget ( pos + target ); |
726 | //! New. FPSCamera and animators catches reset on animate 0 | 726 | //! New. FPSCamera and animators catches reset on animate 0 |
727 | camera->OnAnimate ( 0 ); | 727 | camera->OnAnimate ( 0 ); |
728 | } | 728 | } |
729 | return lastIndex - index + 1; | 729 | return lastIndex - index + 1; |
730 | } | 730 | } |
731 | 731 | ||
732 | 732 | ||
733 | /*! | 733 | /*! |
734 | gets a accumulated force on a given surface | 734 | gets a accumulated force on a given surface |
735 | */ | 735 | */ |
736 | vector3df getGravity ( const c8 * surface ) | 736 | vector3df getGravity ( const c8 * surface ) |
737 | { | 737 | { |
738 | if ( 0 == strcmp ( surface, "earth" ) ) return vector3df ( 0.f, -90.f, 0.f ); | 738 | if ( 0 == strcmp ( surface, "earth" ) ) return vector3df ( 0.f, -90.f, 0.f ); |
739 | if ( 0 == strcmp ( surface, "moon" ) ) return vector3df ( 0.f, -6.f / 100.f, 0.f ); | 739 | if ( 0 == strcmp ( surface, "moon" ) ) return vector3df ( 0.f, -6.f / 100.f, 0.f ); |
740 | if ( 0 == strcmp ( surface, "water" ) ) return vector3df ( 0.1f / 100.f, -2.f / 100.f, 0.f ); | 740 | if ( 0 == strcmp ( surface, "water" ) ) return vector3df ( 0.1f / 100.f, -2.f / 100.f, 0.f ); |
741 | if ( 0 == strcmp ( surface, "ice" ) ) return vector3df ( 0.2f / 100.f, -9.f / 100.f, 0.3f / 100.f ); | 741 | if ( 0 == strcmp ( surface, "ice" ) ) return vector3df ( 0.2f / 100.f, -9.f / 100.f, 0.3f / 100.f ); |
742 | 742 | ||
743 | return vector3df ( 0.f, 0.f, 0.f ); | 743 | return vector3df ( 0.f, 0.f, 0.f ); |
744 | } | 744 | } |
745 | 745 | ||
746 | 746 | ||
747 | 747 | ||
748 | /* | 748 | /* |
749 | Dynamically load the Irrlicht Library | 749 | Dynamically load the Irrlicht Library |
750 | */ | 750 | */ |
751 | 751 | ||
752 | #if defined(_IRR_WINDOWS_API_) | 752 | #if defined(_IRR_WINDOWS_API_) |
753 | #ifdef _MSC_VER | 753 | #ifdef _MSC_VER |
754 | #pragma comment(lib, "Irrlicht.lib") | 754 | #pragma comment(lib, "Irrlicht.lib") |
755 | #endif | 755 | #endif |
756 | 756 | ||
757 | #include <windows.h> | 757 | #include <windows.h> |
758 | 758 | ||
759 | funcptr_createDevice load_createDevice ( const c8 * filename) | 759 | funcptr_createDevice load_createDevice ( const c8 * filename) |
760 | { | 760 | { |
761 | return (funcptr_createDevice) GetProcAddress ( LoadLibrary ( filename ), "createDevice" ); | 761 | return (funcptr_createDevice) GetProcAddress ( LoadLibrary ( filename ), "createDevice" ); |
762 | } | 762 | } |
763 | 763 | ||
764 | funcptr_createDeviceEx load_createDeviceEx ( const c8 * filename) | 764 | funcptr_createDeviceEx load_createDeviceEx ( const c8 * filename) |
765 | { | 765 | { |
766 | return (funcptr_createDeviceEx) GetProcAddress ( LoadLibrary ( filename ), "createDeviceEx" ); | 766 | return (funcptr_createDeviceEx) GetProcAddress ( LoadLibrary ( filename ), "createDeviceEx" ); |
767 | } | 767 | } |
768 | 768 | ||
769 | #else | 769 | #else |
770 | 770 | ||
771 | // TODO: Dynamic Loading for other os | 771 | // TODO: Dynamic Loading for other os |
772 | funcptr_createDevice load_createDevice ( const c8 * filename) | 772 | funcptr_createDevice load_createDevice ( const c8 * filename) |
773 | { | 773 | { |
774 | return createDevice; | 774 | return createDevice; |
775 | } | 775 | } |
776 | 776 | ||
777 | funcptr_createDeviceEx load_createDeviceEx ( const c8 * filename) | 777 | funcptr_createDeviceEx load_createDeviceEx ( const c8 * filename) |
778 | { | 778 | { |
779 | return createDeviceEx; | 779 | return createDeviceEx; |
780 | } | 780 | } |
781 | 781 | ||
782 | #endif | 782 | #endif |
783 | 783 | ||
784 | /* | 784 | /* |
785 | get the current collision response camera animator | 785 | get the current collision response camera animator |
786 | */ | 786 | */ |
787 | ISceneNodeAnimatorCollisionResponse* camCollisionResponse( IrrlichtDevice * device ) | 787 | ISceneNodeAnimatorCollisionResponse* camCollisionResponse( IrrlichtDevice * device ) |
788 | { | 788 | { |
789 | ICameraSceneNode *camera = device->getSceneManager()->getActiveCamera(); | 789 | ICameraSceneNode *camera = device->getSceneManager()->getActiveCamera(); |
790 | ISceneNodeAnimatorCollisionResponse *a = 0; | 790 | ISceneNodeAnimatorCollisionResponse *a = 0; |
791 | 791 | ||
792 | list<ISceneNodeAnimator*>::ConstIterator it = camera->getAnimators().begin(); | 792 | list<ISceneNodeAnimator*>::ConstIterator it = camera->getAnimators().begin(); |
793 | for (; it != camera->getAnimators().end(); ++it) | 793 | for (; it != camera->getAnimators().end(); ++it) |
794 | { | 794 | { |
795 | a = (ISceneNodeAnimatorCollisionResponse*) (*it); | 795 | a = (ISceneNodeAnimatorCollisionResponse*) (*it); |
796 | if ( a->getType() == ESNAT_COLLISION_RESPONSE ) | 796 | if ( a->getType() == ESNAT_COLLISION_RESPONSE ) |
797 | return a; | 797 | return a; |
798 | } | 798 | } |
799 | 799 | ||
800 | return 0; | 800 | return 0; |
801 | } | 801 | } |
802 | 802 | ||
803 | 803 | ||
804 | //! internal Animation | 804 | //! internal Animation |
805 | void setTimeFire ( TimeFire *t, u32 delta, u32 flags ) | 805 | void setTimeFire ( TimeFire *t, u32 delta, u32 flags ) |
806 | { | 806 | { |
807 | t->flags = flags; | 807 | t->flags = flags; |
808 | t->next = 0; | 808 | t->next = 0; |
809 | t->delta = delta; | 809 | t->delta = delta; |
810 | } | 810 | } |
811 | 811 | ||
812 | 812 | ||
813 | void checkTimeFire ( TimeFire *t, u32 listSize, u32 now ) | 813 | void checkTimeFire ( TimeFire *t, u32 listSize, u32 now ) |
814 | { | 814 | { |
815 | u32 i; | 815 | u32 i; |
816 | for ( i = 0; i < listSize; ++i ) | 816 | for ( i = 0; i < listSize; ++i ) |
817 | { | 817 | { |
818 | if ( now < t[i].next ) | 818 | if ( now < t[i].next ) |
819 | continue; | 819 | continue; |
820 | 820 | ||
821 | t[i].next = core::max_ ( now + t[i].delta, t[i].next + t[i].delta ); | 821 | t[i].next = core::max_ ( now + t[i].delta, t[i].next + t[i].delta ); |
822 | t[i].flags |= FIRED; | 822 | t[i].flags |= FIRED; |
823 | } | 823 | } |
824 | } | 824 | } |
diff --git a/libraries/irrlicht-1.8/examples/21.Quake3Explorer/q3factory.h b/libraries/irrlicht-1.8/examples/21.Quake3Explorer/q3factory.h index d9606ed..d3c9561 100644 --- a/libraries/irrlicht-1.8/examples/21.Quake3Explorer/q3factory.h +++ b/libraries/irrlicht-1.8/examples/21.Quake3Explorer/q3factory.h | |||
@@ -1,149 +1,149 @@ | |||
1 | /*! | 1 | /*! |
2 | Model Factory. | 2 | Model Factory. |
3 | create the additional scenenodes for ( bullets, health... ) | 3 | create the additional scenenodes for ( bullets, health... ) |
4 | 4 | ||
5 | Defines the Entities for Quake3 | 5 | Defines the Entities for Quake3 |
6 | */ | 6 | */ |
7 | #ifndef __QUAKE3_FACTORY__H_INCLUDED__ | 7 | #ifndef __QUAKE3_FACTORY__H_INCLUDED__ |
8 | #define __QUAKE3_FACTORY__H_INCLUDED__ | 8 | #define __QUAKE3_FACTORY__H_INCLUDED__ |
9 | 9 | ||
10 | using namespace irr; | 10 | using namespace irr; |
11 | using namespace scene; | 11 | using namespace scene; |
12 | using namespace gui; | 12 | using namespace gui; |
13 | using namespace video; | 13 | using namespace video; |
14 | using namespace core; | 14 | using namespace core; |
15 | using namespace quake3; | 15 | using namespace quake3; |
16 | using namespace io; | 16 | using namespace io; |
17 | 17 | ||
18 | 18 | ||
19 | 19 | ||
20 | //! Defines to which group the entities belong | 20 | //! Defines to which group the entities belong |
21 | enum eItemGroup | 21 | enum eItemGroup |
22 | { | 22 | { |
23 | WEAPON, | 23 | WEAPON, |
24 | AMMO, | 24 | AMMO, |
25 | ARMOR, | 25 | ARMOR, |
26 | HEALTH, | 26 | HEALTH, |
27 | POWERUP | 27 | POWERUP |
28 | }; | 28 | }; |
29 | 29 | ||
30 | //! define a supgroup for the item. for e.q the Weapons | 30 | //! define a supgroup for the item. for e.q the Weapons |
31 | enum eItemSubGroup | 31 | enum eItemSubGroup |
32 | { | 32 | { |
33 | SUB_NONE = 0, | 33 | SUB_NONE = 0, |
34 | GAUNTLET, | 34 | GAUNTLET, |
35 | MACHINEGUN, | 35 | MACHINEGUN, |
36 | SHOTGUN, | 36 | SHOTGUN, |
37 | GRENADE_LAUNCHER, | 37 | GRENADE_LAUNCHER, |
38 | ROCKET_LAUNCHER, | 38 | ROCKET_LAUNCHER, |
39 | LIGHTNING, | 39 | LIGHTNING, |
40 | RAILGUN, | 40 | RAILGUN, |
41 | PLASMAGUN, | 41 | PLASMAGUN, |
42 | BFG, | 42 | BFG, |
43 | GRAPPLING_HOOK, | 43 | GRAPPLING_HOOK, |
44 | NAILGUN, | 44 | NAILGUN, |
45 | PROX_LAUNCHER, | 45 | PROX_LAUNCHER, |
46 | CHAINGUN, | 46 | CHAINGUN, |
47 | }; | 47 | }; |
48 | 48 | ||
49 | //! aplly a special effect to the shader | 49 | //! aplly a special effect to the shader |
50 | enum eItemSpecialEffect | 50 | enum eItemSpecialEffect |
51 | { | 51 | { |
52 | SPECIAL_SFX_NONE = 0, | 52 | SPECIAL_SFX_NONE = 0, |
53 | SPECIAL_SFX_ROTATE = 1, | 53 | SPECIAL_SFX_ROTATE = 1, |
54 | SPECIAL_SFX_BOUNCE = 2, | 54 | SPECIAL_SFX_BOUNCE = 2, |
55 | SPECIAL_SFX_ROTATE_1 = 4, | 55 | SPECIAL_SFX_ROTATE_1 = 4, |
56 | }; | 56 | }; |
57 | 57 | ||
58 | // a List for defining a model | 58 | // a List for defining a model |
59 | struct SItemElement | 59 | struct SItemElement |
60 | { | 60 | { |
61 | const c8 *key; | 61 | const c8 *key; |
62 | const c8 *model[2]; | 62 | const c8 *model[2]; |
63 | const c8 *sound; | 63 | const c8 *sound; |
64 | const c8 *icon; | 64 | const c8 *icon; |
65 | const c8 *pickup; | 65 | const c8 *pickup; |
66 | s32 value; | 66 | s32 value; |
67 | eItemGroup group; | 67 | eItemGroup group; |
68 | eItemSubGroup sub; | 68 | eItemSubGroup sub; |
69 | u32 special; | 69 | u32 special; |
70 | }; | 70 | }; |
71 | 71 | ||
72 | 72 | ||
73 | //! Get's an entity based on it's key | 73 | //! Get's an entity based on it's key |
74 | const SItemElement * getItemElement ( const stringc& key ); | 74 | const SItemElement * getItemElement ( const stringc& key ); |
75 | 75 | ||
76 | /*! | 76 | /*! |
77 | Quake3 Model Factory. | 77 | Quake3 Model Factory. |
78 | Takes the mesh buffers and creates scenenodes for their associated shaders | 78 | Takes the mesh buffers and creates scenenodes for their associated shaders |
79 | */ | 79 | */ |
80 | void Q3ShaderFactory ( Q3LevelLoadParameter &loadParam, | 80 | void Q3ShaderFactory ( Q3LevelLoadParameter &loadParam, |
81 | IrrlichtDevice *device, | 81 | IrrlichtDevice *device, |
82 | IQ3LevelMesh* mesh, | 82 | IQ3LevelMesh* mesh, |
83 | eQ3MeshIndex meshIndex, | 83 | eQ3MeshIndex meshIndex, |
84 | ISceneNode *parent, | 84 | ISceneNode *parent, |
85 | IMetaTriangleSelector *meta, | 85 | IMetaTriangleSelector *meta, |
86 | bool showShaderName | 86 | bool showShaderName |
87 | ); | 87 | ); |
88 | 88 | ||
89 | 89 | ||
90 | /*! | 90 | /*! |
91 | Creates Model based on the entity list | 91 | Creates Model based on the entity list |
92 | */ | 92 | */ |
93 | void Q3ModelFactory ( Q3LevelLoadParameter &loadParam, | 93 | void Q3ModelFactory ( Q3LevelLoadParameter &loadParam, |
94 | IrrlichtDevice *device, | 94 | IrrlichtDevice *device, |
95 | IQ3LevelMesh* masterMesh, | 95 | IQ3LevelMesh* masterMesh, |
96 | ISceneNode *parent, | 96 | ISceneNode *parent, |
97 | bool showShaderName | 97 | bool showShaderName |
98 | ); | 98 | ); |
99 | 99 | ||
100 | /*! | 100 | /*! |
101 | so we need a good starting Position in the level. | 101 | so we need a good starting Position in the level. |
102 | we can ask the Quake3 Loader for all entities with class_name "info_player_deathmatch" | 102 | we can ask the Quake3 Loader for all entities with class_name "info_player_deathmatch" |
103 | */ | 103 | */ |
104 | s32 Q3StartPosition ( IQ3LevelMesh* mesh, | 104 | s32 Q3StartPosition ( IQ3LevelMesh* mesh, |
105 | ICameraSceneNode* camera, | 105 | ICameraSceneNode* camera, |
106 | s32 startposIndex, | 106 | s32 startposIndex, |
107 | const vector3df &translation | 107 | const vector3df &translation |
108 | ); | 108 | ); |
109 | /*! | 109 | /*! |
110 | gets a accumulated force on a given surface | 110 | gets a accumulated force on a given surface |
111 | */ | 111 | */ |
112 | vector3df getGravity ( const c8 * surface ); | 112 | vector3df getGravity ( const c8 * surface ); |
113 | 113 | ||
114 | 114 | ||
115 | /* | 115 | /* |
116 | Dynamically load the Irrlicht Library | 116 | Dynamically load the Irrlicht Library |
117 | */ | 117 | */ |
118 | funcptr_createDevice load_createDevice ( const c8 * filename); | 118 | funcptr_createDevice load_createDevice ( const c8 * filename); |
119 | funcptr_createDeviceEx load_createDeviceEx ( const c8 * filename); | 119 | funcptr_createDeviceEx load_createDeviceEx ( const c8 * filename); |
120 | 120 | ||
121 | 121 | ||
122 | //! Macro for save Dropping an Element | 122 | //! Macro for save Dropping an Element |
123 | #define dropElement(x) if (x) { x->remove(); x = 0; } | 123 | #define dropElement(x) if (x) { x->remove(); x = 0; } |
124 | 124 | ||
125 | 125 | ||
126 | /* | 126 | /* |
127 | get the current collision respone camera animator | 127 | get the current collision respone camera animator |
128 | */ | 128 | */ |
129 | ISceneNodeAnimatorCollisionResponse* camCollisionResponse( IrrlichtDevice * device ); | 129 | ISceneNodeAnimatorCollisionResponse* camCollisionResponse( IrrlichtDevice * device ); |
130 | 130 | ||
131 | //! internal Animation | 131 | //! internal Animation |
132 | enum eTimeFireFlag | 132 | enum eTimeFireFlag |
133 | { | 133 | { |
134 | FIRED = 1, | 134 | FIRED = 1, |
135 | }; | 135 | }; |
136 | 136 | ||
137 | struct TimeFire | 137 | struct TimeFire |
138 | { | 138 | { |
139 | u32 flags; | 139 | u32 flags; |
140 | u32 next; | 140 | u32 next; |
141 | u32 delta; | 141 | u32 delta; |
142 | }; | 142 | }; |
143 | 143 | ||
144 | void setTimeFire ( TimeFire *t, u32 delta, u32 flags = 0 ); | 144 | void setTimeFire ( TimeFire *t, u32 delta, u32 flags = 0 ); |
145 | void checkTimeFire ( TimeFire *t, u32 listSize, u32 now ); | 145 | void checkTimeFire ( TimeFire *t, u32 listSize, u32 now ); |
146 | 146 | ||
147 | #endif // __QUAKE3_FACTORY__H_INCLUDED__ | 147 | #endif // __QUAKE3_FACTORY__H_INCLUDED__ |
148 | 148 | ||
149 | 149 | ||
diff --git a/libraries/irrlicht-1.8/examples/21.Quake3Explorer/sound.cpp b/libraries/irrlicht-1.8/examples/21.Quake3Explorer/sound.cpp index 75615c1..876c498 100644 --- a/libraries/irrlicht-1.8/examples/21.Quake3Explorer/sound.cpp +++ b/libraries/irrlicht-1.8/examples/21.Quake3Explorer/sound.cpp | |||
@@ -1,98 +1,98 @@ | |||
1 | /*! | 1 | /*! |
2 | Sound Factory. | 2 | Sound Factory. |
3 | provides a sound interface | 3 | provides a sound interface |
4 | 4 | ||
5 | */ | 5 | */ |
6 | 6 | ||
7 | #include "sound.h" | 7 | #include "sound.h" |
8 | 8 | ||
9 | 9 | ||
10 | //#define USE_IRRKLANG | 10 | //#define USE_IRRKLANG |
11 | 11 | ||
12 | #ifdef USE_IRRKLANG | 12 | #ifdef USE_IRRKLANG |
13 | 13 | ||
14 | #include <irrKlang.h> | 14 | #include <irrKlang.h> |
15 | #ifdef _IRR_WINDOWS_ | 15 | #ifdef _IRR_WINDOWS_ |
16 | #pragma comment (lib, "irrKlang.lib") | 16 | #pragma comment (lib, "irrKlang.lib") |
17 | #endif | 17 | #endif |
18 | 18 | ||
19 | using namespace irrklang; | 19 | using namespace irrklang; |
20 | 20 | ||
21 | struct soundfile: public IFileReader | 21 | struct soundfile: public IFileReader |
22 | { | 22 | { |
23 | soundfile ( io::IReadFile* f ): file (f ) {} | 23 | soundfile ( io::IReadFile* f ): file (f ) {} |
24 | virtual ~soundfile () { file->drop (); } | 24 | virtual ~soundfile () { file->drop (); } |
25 | 25 | ||
26 | virtual ik_s32 read(void* buffer, ik_u32 sizeToRead) { return file->read ( buffer, sizeToRead ); } | 26 | virtual ik_s32 read(void* buffer, ik_u32 sizeToRead) { return file->read ( buffer, sizeToRead ); } |
27 | virtual bool seek(ik_s32 finalPos, bool relativeMovement = false) { return file->seek ( finalPos, relativeMovement ); } | 27 | virtual bool seek(ik_s32 finalPos, bool relativeMovement = false) { return file->seek ( finalPos, relativeMovement ); } |
28 | virtual ik_s32 getSize(){ return file->getSize (); } | 28 | virtual ik_s32 getSize(){ return file->getSize (); } |
29 | virtual ik_s32 getPos() {return file->getPos (); } | 29 | virtual ik_s32 getPos() {return file->getPos (); } |
30 | virtual const ik_c8* getFileName() { return file->getFileName (); } | 30 | virtual const ik_c8* getFileName() { return file->getFileName (); } |
31 | io::IReadFile* file; | 31 | io::IReadFile* file; |
32 | }; | 32 | }; |
33 | 33 | ||
34 | struct klangFactory : public irrklang::IFileFactory | 34 | struct klangFactory : public irrklang::IFileFactory |
35 | { | 35 | { |
36 | klangFactory ( IrrlichtDevice *device ) { Device = device; } | 36 | klangFactory ( IrrlichtDevice *device ) { Device = device; } |
37 | 37 | ||
38 | virtual irrklang::IFileReader* createFileReader(const ik_c8* filename) | 38 | virtual irrklang::IFileReader* createFileReader(const ik_c8* filename) |
39 | { | 39 | { |
40 | io::IReadFile* file = Device->getFileSystem()->createAndOpenFile(filename); | 40 | io::IReadFile* file = Device->getFileSystem()->createAndOpenFile(filename); |
41 | if ( 0 == file ) | 41 | if ( 0 == file ) |
42 | return 0; | 42 | return 0; |
43 | 43 | ||
44 | return new soundfile ( file ); | 44 | return new soundfile ( file ); |
45 | } | 45 | } |
46 | 46 | ||
47 | IrrlichtDevice *Device; | 47 | IrrlichtDevice *Device; |
48 | }; | 48 | }; |
49 | 49 | ||
50 | ISoundEngine *engine = 0; | 50 | ISoundEngine *engine = 0; |
51 | ISound *backMusic = 0; | 51 | ISound *backMusic = 0; |
52 | 52 | ||
53 | void sound_init ( IrrlichtDevice *device ) | 53 | void sound_init ( IrrlichtDevice *device ) |
54 | { | 54 | { |
55 | engine = createIrrKlangDevice (); | 55 | engine = createIrrKlangDevice (); |
56 | if ( 0 == engine ) | 56 | if ( 0 == engine ) |
57 | return; | 57 | return; |
58 | 58 | ||
59 | klangFactory *f = new klangFactory ( device ); | 59 | klangFactory *f = new klangFactory ( device ); |
60 | engine->addFileFactory ( f ); | 60 | engine->addFileFactory ( f ); |
61 | } | 61 | } |
62 | 62 | ||
63 | void sound_shutdown () | 63 | void sound_shutdown () |
64 | { | 64 | { |
65 | if ( backMusic ) | 65 | if ( backMusic ) |
66 | backMusic->drop (); | 66 | backMusic->drop (); |
67 | 67 | ||
68 | if ( engine ) | 68 | if ( engine ) |
69 | engine->drop (); | 69 | engine->drop (); |
70 | } | 70 | } |
71 | 71 | ||
72 | void background_music ( const c8 * file ) | 72 | void background_music ( const c8 * file ) |
73 | { | 73 | { |
74 | if ( 0 == engine ) | 74 | if ( 0 == engine ) |
75 | return; | 75 | return; |
76 | 76 | ||
77 | if ( backMusic ) | 77 | if ( backMusic ) |
78 | { | 78 | { |
79 | backMusic->stop (); | 79 | backMusic->stop (); |
80 | backMusic->drop (); | 80 | backMusic->drop (); |
81 | } | 81 | } |
82 | 82 | ||
83 | backMusic = engine->play2D ( file, true, false, true ); | 83 | backMusic = engine->play2D ( file, true, false, true ); |
84 | 84 | ||
85 | if ( backMusic ) | 85 | if ( backMusic ) |
86 | { | 86 | { |
87 | backMusic->setVolume ( 0.5f ); | 87 | backMusic->setVolume ( 0.5f ); |
88 | } | 88 | } |
89 | } | 89 | } |
90 | 90 | ||
91 | #else | 91 | #else |
92 | 92 | ||
93 | void sound_init ( IrrlichtDevice *device ) {} | 93 | void sound_init ( IrrlichtDevice *device ) {} |
94 | void sound_shutdown () {} | 94 | void sound_shutdown () {} |
95 | void background_music ( const c8 * file ) {} | 95 | void background_music ( const c8 * file ) {} |
96 | 96 | ||
97 | #endif | 97 | #endif |
98 | 98 | ||
diff --git a/libraries/irrlicht-1.8/examples/21.Quake3Explorer/sound.h b/libraries/irrlicht-1.8/examples/21.Quake3Explorer/sound.h index 033e9bb..fab4555 100644 --- a/libraries/irrlicht-1.8/examples/21.Quake3Explorer/sound.h +++ b/libraries/irrlicht-1.8/examples/21.Quake3Explorer/sound.h | |||
@@ -1,18 +1,18 @@ | |||
1 | /*! | 1 | /*! |
2 | Sound Factory. | 2 | Sound Factory. |
3 | provides a sound interface | 3 | provides a sound interface |
4 | 4 | ||
5 | */ | 5 | */ |
6 | #ifndef __QUAKE3_SOUND__H_INCLUDED__ | 6 | #ifndef __QUAKE3_SOUND__H_INCLUDED__ |
7 | #define __QUAKE3_SOUND__H_INCLUDED__ | 7 | #define __QUAKE3_SOUND__H_INCLUDED__ |
8 | 8 | ||
9 | #include <irrlicht.h> | 9 | #include <irrlicht.h> |
10 | 10 | ||
11 | using namespace irr; | 11 | using namespace irr; |
12 | 12 | ||
13 | void sound_init ( IrrlichtDevice *device ); | 13 | void sound_init ( IrrlichtDevice *device ); |
14 | void sound_shutdown (); | 14 | void sound_shutdown (); |
15 | void background_music ( const c8 * file ); | 15 | void background_music ( const c8 * file ); |
16 | 16 | ||
17 | 17 | ||
18 | #endif // __QUAKE3_SOUND__H_INCLUDED__ | 18 | #endif // __QUAKE3_SOUND__H_INCLUDED__ |