Showing preview only (2,116K chars total). Download the full file or copy to clipboard to get everything.
Repository: mrlitong/Game-Engine-Development-Usage
Branch: master
Commit: 95697c4bfb50
Files: 394
Total size: 1.9 MB
Directory structure:
gitextract_cgk0ykbb/
├── .gitignore
├── LICENSE
├── README.md
├── Test/
│ ├── ActorBash.cpp
│ ├── ActorBash.h
│ ├── CameraBash.cpp
│ ├── CameraBash.h
│ ├── Common.cpp
│ ├── Common.h
│ ├── FPSRole.cpp
│ ├── FPSRole.h
│ ├── FPSRoleLocal.cpp
│ ├── FPSRoleLocal.h
│ ├── GameMain.cpp
│ ├── GameMain.h
│ ├── GameProcess.cpp
│ ├── GameProcess.h
│ ├── HMDWrapper.cpp
│ ├── HMDWrapper.h
│ ├── MathLib.h
│ ├── MoveDummy.cpp
│ ├── MoveDummy.h
│ ├── RayControl.cpp
│ ├── RayControl.h
│ ├── RoleBase.cpp
│ ├── RoleBase.h
│ ├── Test.vcxproj
│ ├── main.cpp
│ └── main.h
├── fpsgame/
│ ├── CommonConvert.cpp
│ ├── CommonConvert.h
│ ├── Decompose.cpp
│ ├── Decompose.h
│ ├── Dll.cpp
│ ├── Dll.h
│ ├── GeomReindex.cpp
│ ├── GeomReindex.h
│ ├── JSInterfaace_GameView.h
│ ├── JSInterface_GameView.cpp
│ ├── Math.cpp
│ ├── Math.h
│ ├── PMDConvert.cpp
│ ├── PMDConvert.h
│ ├── PSAConvert.cpp
│ ├── PSAConvert.h
│ ├── Resource.h
│ ├── SkillSystem.cpp
│ ├── SkillSystem.h
│ ├── Star2DControl.cpp
│ ├── Star2DControl.h
│ ├── StartControl.cpp
│ ├── StartControl.h
│ ├── StdSkeletons.cpp
│ ├── StdSkeletons.h
│ ├── XMLFix.cpp
│ ├── XMLFix.h
│ ├── fpsgame.cpp
│ ├── fpsgame.h
│ ├── fpsgame.vcxproj
│ ├── fpsgame.vcxproj.user
│ ├── graphics/
│ │ ├── Camera.cpp
│ │ ├── Camera.h
│ │ ├── CinemaManager.cpp
│ │ ├── CinemaManager.h
│ │ ├── CinimaPath.cpp
│ │ ├── CinimaPath.h
│ │ ├── ColladaManager.cpp
│ │ ├── ColladaManager.h
│ │ ├── Color.cpp
│ │ ├── Color.h
│ │ ├── Decal.cpp
│ │ ├── Decal.h
│ │ ├── Entity.h
│ │ ├── Font.cpp
│ │ ├── Font.h
│ │ ├── FontManager.cpp
│ │ ├── FontManager.h
│ │ ├── FontMetrics.cpp
│ │ ├── FontMetrics.h
│ │ ├── Frustum.cpp
│ │ ├── Frustum.h
│ │ ├── GameView.cpp
│ │ ├── GameView.h
│ │ ├── HFTracer.cpp
│ │ ├── HFTracer.h
│ │ ├── HeightMipmap.cpp
│ │ ├── HeightMipmap.h
│ │ ├── LOSTexture.cpp
│ │ ├── LOSTexture.h
│ │ ├── LightEnv.cpp
│ │ ├── LightEnv.h
│ │ ├── MapGenerator.cpp
│ │ ├── MapGenerator.h
│ │ ├── MapIO.h
│ │ ├── MapReader.cpp
│ │ ├── MapReader.h
│ │ ├── MapWriter.cpp
│ │ ├── MapWriter.h
│ │ ├── Material.cpp
│ │ ├── Material.h
│ │ ├── MaterialManager.cpp
│ │ ├── MaterialManager.h
│ │ ├── MeshManager.cpp
│ │ ├── MeshManager.h
│ │ ├── MiniPatch.cpp
│ │ ├── MiniPatch.h
│ │ ├── Model.cpp
│ │ ├── Model.h
│ │ ├── ModelAbstract.cpp
│ │ ├── ModelAbstract.h
│ │ ├── ModelDef.cpp
│ │ ├── ModelDef.h
│ │ ├── ObjectBase.cpp
│ │ ├── ObjectBase.h
│ │ ├── ObjectEntry.cpp
│ │ ├── ObjectEntry.h
│ │ ├── ObjectManager.cpp
│ │ ├── ObjectManager.h
│ │ ├── Overlay.cpp
│ │ ├── Overlay.h
│ │ ├── ParticleEmitter.cpp
│ │ ├── ParticleEmitter.h
│ │ ├── ParticleEmitterType.cpp
│ │ ├── ParticleEmitterType.h
│ │ ├── ParticleManager.cpp
│ │ ├── ParticleManager.h
│ │ ├── Patch.cpp
│ │ ├── Patch.h
│ │ ├── RenderableObject.h
│ │ ├── SColor.h
│ │ ├── ShaderDefines.cpp
│ │ ├── ShaderDefines.h
│ │ ├── ShaderManager.cpp
│ │ ├── ShaderManager.h
│ │ ├── ShaderProgram.cpp
│ │ ├── ShaderProgram.h
│ │ ├── ShaderProgramFFP.cpp
│ │ ├── ShaderProgramPtr.h
│ │ ├── ShaderTechnique.cpp
│ │ ├── ShaderTechnique.h
│ │ ├── SkeletonAnim.h
│ │ ├── SkeletonAnimDef.cpp
│ │ ├── SkeletonAnimDef.h
│ │ ├── SkeletonAnimManager.cpp
│ │ ├── SkeletonAnimManager.h
│ │ ├── Terrain.cpp
│ │ ├── Terrain.h
│ │ ├── TerrainProperties.cpp
│ │ ├── TerrainProperties.h
│ │ ├── TerrainTextureEntry.cpp
│ │ ├── TerrainTextureEntry.h
│ │ ├── TerrainTextureManager.cpp
│ │ ├── TerrainTextureManager.h
│ │ ├── TerritoryBoundary.cpp
│ │ ├── TerritoryBoundary.h
│ │ ├── TerritoryTexture.cpp
│ │ ├── TerritoryTexture.h
│ │ ├── TextRenderer.cpp
│ │ ├── TextRenderer.h
│ │ ├── Texture.h
│ │ ├── TextureConverter.cpp
│ │ ├── TextureConverter.h
│ │ ├── TextureManager.cpp
│ │ ├── TextureManager.h
│ │ ├── Unit.cpp
│ │ ├── Unit.h
│ │ ├── UnitAnimation.cpp
│ │ ├── UnitAnimation.h
│ │ ├── UnitManager.cpp
│ │ └── UnitManager.h
│ ├── gui/
│ │ ├── adts/
│ │ │ ├── bit_buf.h
│ │ │ ├── cache_adt.h
│ │ │ ├── dyn_hash_tbl.h
│ │ │ └── ring_buf.h
│ │ ├── allocators/
│ │ │ ├── aligned_allocator.h
│ │ │ ├── allocator_adapters.h
│ │ │ ├── allocator_checker.h
│ │ │ ├── allocator_policies.h
│ │ │ ├── arena.cpp
│ │ │ ├── arena.h
│ │ │ ├── dynarray.cpp
│ │ │ ├── dynarray.h
│ │ │ ├── freelist.cpp
│ │ │ ├── freelist.h
│ │ │ ├── headerless.cpp
│ │ │ ├── headerless.h
│ │ │ ├── overrun_protector.h
│ │ │ ├── page_aligned.cpp
│ │ │ ├── page_aligned.h
│ │ │ ├── pool.cpp
│ │ │ ├── pool.h
│ │ │ ├── shared_ptr.cpp
│ │ │ ├── shared_ptr.h
│ │ │ ├── tests/
│ │ │ │ ├── test_allocators.h
│ │ │ │ └── test_headerless.h
│ │ │ ├── unique_range.cpp
│ │ │ └── unique_range.h
│ │ ├── app_hooks.cpp
│ │ ├── app_hooks.h
│ │ ├── base32.cpp
│ │ ├── base32.h
│ │ ├── bits.cpp
│ │ ├── bits.h
│ │ ├── byte_order.cpp
│ │ ├── byte_order.h
│ │ ├── code_annotation.h
│ │ ├── code_generation.h
│ │ ├── config.h
│ │ ├── config2.h
│ │ ├── debug.cpp
│ │ ├── debug.h
│ │ ├── debug_stl.cpp
│ │ ├── debug_stl.h
│ │ ├── external_libraries/
│ │ │ ├── curl.h
│ │ │ ├── dbghelp.cpp
│ │ │ ├── dbghelp.h
│ │ │ ├── dbghelp_funcs.h
│ │ │ ├── enet.h
│ │ │ ├── glext_funcs.h
│ │ │ ├── icu.h
│ │ │ ├── libsdl.h
│ │ │ ├── libsdl_fwd.h
│ │ │ ├── openal.h
│ │ │ ├── opengl.h
│ │ │ ├── openmp.h
│ │ │ ├── png.h
│ │ │ ├── powrprof.h
│ │ │ ├── suppress_boost_warnings.h
│ │ │ ├── tinygettext.h
│ │ │ ├── vorbis.h
│ │ │ ├── wxwidgets.h
│ │ │ └── zlib.h
│ │ ├── file/
│ │ │ ├── archive/
│ │ │ │ ├── archive.cpp
│ │ │ │ ├── archive.h
│ │ │ │ ├── archive_zip.cpp
│ │ │ │ ├── archive_zip.h
│ │ │ │ ├── codec.cpp
│ │ │ │ ├── codec.h
│ │ │ │ ├── codec_zlib.cpp
│ │ │ │ ├── codec_zlib.h
│ │ │ │ ├── disabled_tests/
│ │ │ │ │ ├── test_codec_zlib.h
│ │ │ │ │ ├── test_compression.h
│ │ │ │ │ ├── test_fat_time.h
│ │ │ │ │ └── test_zip.h
│ │ │ │ ├── stream.cpp
│ │ │ │ └── stream.h
│ │ │ ├── common/
│ │ │ │ ├── file_loader.cpp
│ │ │ │ ├── file_loader.h
│ │ │ │ ├── file_stats.cpp
│ │ │ │ ├── file_stats.h
│ │ │ │ ├── real_directory.cpp
│ │ │ │ ├── real_directory.h
│ │ │ │ ├── tests/
│ │ │ │ │ └── test_trace.h
│ │ │ │ ├── trace.cpp
│ │ │ │ └── trace.h
│ │ │ ├── disabled_tests/
│ │ │ │ ├── test_file_cache.h
│ │ │ │ └── test_path.h
│ │ │ ├── file.cpp
│ │ │ ├── file.h
│ │ │ ├── file_system.cpp
│ │ │ ├── file_system.h
│ │ │ ├── io/
│ │ │ │ ├── io.cpp
│ │ │ │ ├── io.h
│ │ │ │ ├── write_buffer.cpp
│ │ │ │ └── write_buffer.h
│ │ │ └── vfs/
│ │ │ ├── file_cache.cpp
│ │ │ ├── file_cache.h
│ │ │ ├── tests/
│ │ │ │ └── test_vfs_tree.h
│ │ │ ├── vfs.cpp
│ │ │ ├── vfs.h
│ │ │ ├── vfs_lookup.cpp
│ │ │ ├── vfs_lookup.h
│ │ │ ├── vfs_path.cpp
│ │ │ ├── vfs_path.h
│ │ │ ├── vfs_populate.cpp
│ │ │ ├── vfs_populate.h
│ │ │ ├── vfs_tree.cpp
│ │ │ ├── vfs_tree.h
│ │ │ ├── vfs_util.cpp
│ │ │ └── vfs_util.h
│ │ ├── fnv_hash.cpp
│ │ ├── fnv_hash.h
│ │ ├── frequency_filter.cpp
│ │ ├── frequency_filter.h
│ │ ├── input.cpp
│ │ ├── input.h
│ │ ├── lib.cpp
│ │ ├── lib.h
│ │ ├── lib_api.h
│ │ ├── module_init.cpp
│ │ ├── module_init.h
│ │ ├── ogl.cpp
│ │ ├── ogl.h
│ │ ├── os_path.h
│ │ ├── path.cpp
│ │ ├── path.h
│ │ ├── posix/
│ │ │ ├── posix.cpp
│ │ │ └── posix.h
│ │ ├── rand.cpp
│ │ ├── rand.h
│ │ ├── regex.cpp
│ │ ├── regex.h
│ │ ├── res/
│ │ │ └── handle.h
│ │ ├── secure_crt.cpp
│ │ ├── secure_crt.h
│ │ ├── sysdep/
│ │ │ ├── os/
│ │ │ │ ├── unix/
│ │ │ │ │ ├── udbg.cpp
│ │ │ │ │ ├── udbg.h
│ │ │ │ │ ├── ufilesystem.cpp
│ │ │ │ │ ├── unix.cpp
│ │ │ │ │ ├── unix.h
│ │ │ │ │ ├── unix_executable_pathname.cpp
│ │ │ │ │ ├── unix_executable_pathname.h
│ │ │ │ │ ├── unuma.cpp
│ │ │ │ │ ├── unuma.h
│ │ │ │ │ ├── uvm.cpp
│ │ │ │ │ └── x/
│ │ │ │ │ └── x.cpp
│ │ │ │ └── win/
│ │ │ │ ├── aken/
│ │ │ │ │ ├── aken.c
│ │ │ │ │ ├── aken.h
│ │ │ │ │ ├── makefile
│ │ │ │ │ └── sources
│ │ │ │ ├── comctl6.manifest
│ │ │ │ ├── error_dialog.h
│ │ │ │ ├── error_dialog.rc
│ │ │ │ ├── icon.rc
│ │ │ │ ├── mahaf.cpp
│ │ │ │ ├── mahaf.h
│ │ │ │ ├── manifest.cpp
│ │ │ │ ├── manifest.rc
│ │ │ │ ├── tests/
│ │ │ │ │ ├── test_ia32.h
│ │ │ │ │ └── test_wdbg_sym.h
│ │ │ │ ├── wclipboard.cpp
│ │ │ │ ├── wcpu.cpp
│ │ │ │ ├── wcpu.h
│ │ │ │ ├── wcursor.cpp
│ │ │ │ ├── wdbg.cpp
│ │ │ │ ├── wdbg.h
│ │ │ │ ├── wdbg_heap.cpp
│ │ │ │ ├── wdbg_heap.h
│ │ │ │ ├── wdbg_sym.cpp
│ │ │ │ ├── wdbg_sym.h
│ │ │ │ ├── wdir_watch.cpp
│ │ │ │ ├── wdll_delay_load.cpp
│ │ │ │ ├── wdll_delay_load.h
│ │ │ │ ├── wdll_main.h
│ │ │ │ ├── wdll_ver.cpp
│ │ │ │ └── wdll_ver.h
│ │ │ ├── smbios.h
│ │ │ ├── snd.cpp
│ │ │ ├── snd.h
│ │ │ ├── stl.h
│ │ │ ├── sysdep.h
│ │ │ ├── tests/
│ │ │ │ ├── test_rtl.h
│ │ │ │ └── test_sysdep.h
│ │ │ └── vm.h
│ │ ├── tests/
│ │ │ ├── test_adts.h
│ │ │ ├── test_base32.h
│ │ │ ├── test_bits.h
│ │ │ ├── test_byte_order.h
│ │ │ ├── test_cache_adt.h
│ │ │ ├── test_fnv_hash.h
│ │ │ ├── test_lib.h
│ │ │ ├── test_path.h
│ │ │ ├── test_path_util.h
│ │ │ ├── test_rand.h
│ │ │ ├── test_regex.h
│ │ │ ├── test_secure_crt.h
│ │ │ └── test_wchar.h
│ │ ├── tex/
│ │ │ ├── tex.cpp
│ │ │ ├── tex.h
│ │ │ ├── tex_bmp.cpp
│ │ │ ├── tex_codec.cpp
│ │ │ ├── tex_codec.h
│ │ │ ├── tex_dds.cpp
│ │ │ ├── tex_internal.h
│ │ │ ├── tex_png.cpp
│ │ │ └── tex_tga.cpp
│ │ ├── timer.cpp
│ │ ├── timer.h
│ │ ├── types.h
│ │ ├── utf8.cpp
│ │ ├── utf8.h
│ │ └── wsecure_crt.cpp
│ ├── precompiled.cpp
│ ├── precompiled.h
│ ├── stdafx.cpp
│ ├── stdafx.h
│ ├── targetver.h
│ ├── test_Color.h
│ └── tests.py
├── fpsgame.rc
├── fpsgame.sln
├── fpsgame.vcxproj
└── sys/
├── SysControl.cpp
└── SysControl.h
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
*.filters
/Test.VC.VC.opendb
/Test.VC.db
*.sdf
*.vs
*.pdb
*.log
*.tlog
*.idb
x64/*
*.suo
*.ipch
# Prerequisites
*.d
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2016 Li Tong
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
fpsgame
====
A simple FPS fight game based on 0 A.D..which is also an open-source game engine and a free software. You can get more information on this [link](https://play0ad.com/).
================================================
FILE: Test/ActorBash.cpp
================================================
#include "Engine.h"
#include "Game.h"
#include "ObjectDummy.h"
#include "BodyRigid.h"
#include "BodyDummy.h"
#include "Physics.h"
#include "ShapeCapsule.h"
#include "ActorBase.h"
#include "Visualizer.h"
#include "sys/SysControl.h"
using namespace MathLib;
#ifdef MEMORY_INFO
#define new new(__FILE__, __LINE__)
#endif // MEMORY_INFO
/*
Test high performance.
*/
#define ACTOR_BASE_IFPS (1.0f / 120.0f)
#define ACTOR_BASE_CLAMP 15.0f
#define ACTOR_BASE_COLLISIONS 4
/*
*/
CActorBase::CActorBase()
{
m_vUp = vec3(0.0f, 0.0f, 1.0f);
m_pObject = new CObjectDummy();
m_pDummy = new CBodyDummy();
m_pShape = new CShapeCapsule(1.0f, 1.0f);
m_nFlush = 0;
m_vPosition = Vec3_zero;
m_vVelocity = Vec3_zero;
m_fPhiAngle = 0.0f; //倾斜角 二维平面坐标系中,直线向Y周延伸的方向与X轴正向之间的夹角
m_fThetaAngle = 0.0f; //方位角,正北方那条线与当前线条按照顺时针走过的角度
for (int i = 0; i < NUM_STATES; i++)
{
m_pStates[i] = 0;
m_pTimes[i] = 0.0f;
}
m_pDummy->SetEnabled(1);
m_pObject->SetBody(NULL);
m_pObject->SetBody(m_pDummy);
m_pShape->SetBody(NULL);
m_pShape->SetBody(m_pDummy);
m_pObject->SetWorldTransform(Get_Body_Transform());
m_pShape->SetRestitution(0.0f);
m_pShape->SetCollisionMask(2);
SetEnabled(1);
SetViewDirection(vec3(0.0f, 1.0f, 0.0f));
SetCollision(1);
SetCollisionRadius(0.3f);
SetCollisionHeight(1.0f);
SetMinVelocity(2.0f);
SetMaxVelocity(4.0f);
SetAcceleration(8.0f);
SetDamping(8.0f);
SetJumping(1.5f);
SetFriction(2.0f);
SetGround(0);
SetCeiling(0);
}
CActorBase::~CActorBase()
{
m_pDummy->SetObject(NULL);
delete m_pObject;
delete m_pDummy;
}
void CActorBase::SetEnabled(int enable)
{
m_nEnable = enable;
m_pDummy->SetEnabled(m_nEnable);
}
int CActorBase::IsEnabled() const
{
return m_nEnable;
}
void CActorBase::Update(float ifps)
{
if (!m_nEnable)
{
return;
}
// impulse
vec3 impulse = vec3_zero;
// ortho basis
vec3 tangent, binormal;
OrthoBasis(m_vUp, tangent, binormal);
// current basis
vec3 x = quat(m_vUp, -m_fPhiAngle) * binormal;
vec3 y = Normalize(Cross(m_vUp, x));
vec3 z = Normalize(Cross(x, y));
handle states
Update_States(1, ifps);
// old velocity
float x_velocity = Dot(x, m_vVelocity);
float y_velocity = Dot(y, m_vVelocity);
float z_velocity = Dot(z, m_vVelocity);
// movement
if (m_pStates[STATE_FORWARD]) impulse += x;
if (m_pStates[STATE_BACKWARD]) impulse -= x;
if (m_pStates[STATE_MOVE_LEFT]) impulse += y;
if (m_pStates[STATE_MOVE_RIGHT]) impulse -= y;
impulse.normalize();
//velocity
if (m_pStates[STATE_RUN])
impulse *= m_fMaxVelocity;
else
impulse *= m_fMinVelocity;
// jump
if (m_pStates[STATE_JUMP] == STATE_BEGIN)
{
impulse += z * CMathCore::Sqrt(2.0f * 9.8f * m_fJumping) / (m_fAcceleration * ifps);
}
// rotate velocity
if (GetGround())
{
m_vVelocity = x * x_velocity + y * y_velocity + z * z_velocity;
}
// time
float time = ifps * g_Engine.pPhysics->GetScale();
// target velocity
float target_velocity = Length(vec2(Dot(x, impulse), Dot(y, impulse)));
// penetration tolerance
float penetration = g_Engine.pPhysics->GetPenetrationTolerance();
float penetration_2 = penetration * 2.0f;
// frozen linear velocity
float frozen_velocity = g_Engine.pPhysics->GetFrozenLinearVelocity();
// friction
float friction = 0.0f;
if (target_velocity < EPSILON)
{
friction = m_fFriction;
}
//clear collision flags
if (GetCollision())
{
m_nGround = 0;
m_nCeiling = 0;
}
// movement
do
{
// adaptive time step
float ifps = Min(time, ACTOR_BASE_IFPS);
time -= ifps;
// save old velocity
float old_velocity = Length(vec2(Dot(x, m_vVelocity), Dot(y, m_vVelocity)));
// integrate velocity
m_vVelocity += impulse * (m_fAcceleration * ifps);
m_vVelocity += g_Engine.pPhysics->GetGravity() * ifps;
// damping
float current_velocity = Length(vec2(Dot(x, m_vVelocity), Dot(y, m_vVelocity)));
if (target_velocity < EPSILON || current_velocity > target_velocity)
{
m_vVelocity = (x * Dot(x, m_vVelocity) + y * Dot(y, m_vVelocity)) * CMathCore::Exp(-m_fDamping * ifps) + z * Dot(z, m_vVelocity);
}
// clamp maximum velocity
current_velocity = Length(vec2(Dot(x, m_vVelocity), Dot(y, m_vVelocity)));
if (current_velocity > old_velocity)
{
if (current_velocity > target_velocity)
{
m_vVelocity = (x * Dot(x, m_vVelocity) + y * Dot(y, m_vVelocity)) * target_velocity / current_velocity + z * Dot(z, m_vVelocity);
}
}
// frozen velocity
int is_frozen = 0;
if (current_velocity < frozen_velocity)
{
m_vVelocity = z * Dot(z, m_vVelocity);
is_frozen = 1;
}
// integrate position
//m_vPosition += Vec3(m_vVelocity * ifps);
// world collision
if (GetCollision())
{
// get collision
vec3 tangent, binormal;
const Vec3 *caps = m_pShape->GetCaps();
for (int i = 0; i < ACTOR_BASE_COLLISIONS; i++)
{
m_pDummy->SetTransform(Get_Body_Transform());
m_pShape->GetCollision(m_vecContacts, 0.0f);
if (m_vecContacts.Size() == 0) break;
float inum_contacts = 1.0f / CMathCore::Itof(m_vecContacts.Size());
for (int j = 0; j < m_vecContacts.Size(); j++)
{
const CShape::Contact &c = m_vecContacts[j];
vec3 normalCollision = c.normal;
if (is_frozen && c.depth < penetration_2)
{
m_vPosition += Vec3(z * (Max(c.depth - penetration, 0.0f) * inum_contacts * Dot(z, normalCollision)));
}
else
{
m_vPosition += Vec3(normalCollision * (Max(c.depth - penetration, 0.0f) * inum_contacts));
is_frozen = 0;
}
float normal_velocity = Dot(normalCollision, m_vVelocity);
if (normal_velocity < 0.0f)
{
m_vVelocity -= normalCollision * normal_velocity;
}
if (friction > EPSILON)
{
OrthoBasis(c.normal, tangent, binormal);
float tangent_velocity = Dot(tangent, m_vVelocity);
float binormal_velocity = Dot(binormal, m_vVelocity);
if (CMathCore::Abs(tangent_velocity) > EPSILON || CMathCore::Abs(binormal_velocity) > EPSILON) {
float friction_velocity = Clamp(Max(-normal_velocity, 0.0f) * friction * CMathCore::RSqrt(tangent_velocity * tangent_velocity + binormal_velocity * binormal_velocity), -1.0f, 1.0f);
m_vVelocity -= tangent * tangent_velocity * friction_velocity;
m_vVelocity -= binormal * binormal_velocity * friction_velocity;
}
}
if (Dot(c.normal, m_vUp) > 0.5f && Dot(vec3(c.point - caps[0]), m_vUp) < 0.0f) m_nGround = 1;
if (Dot(c.normal, m_vUp) < -0.5f && Dot(vec3(c.point - caps[1]), m_vUp) > 0.0f) m_nCeiling = 1;
}
}
m_vPosition += Vec3(m_vVelocity * ifps);
}
while (time > EPSILON);
// current position
m_pObject->SetWorldTransform(Get_Body_Transform());
m_WorldBoundBox.Set(m_BoundBox, Translate(m_vPosition));
m_WorldBoundSphere.Set(m_BoundSphere, Translate(m_vPosition));
}
}
/*
*/
void CActorBase::Update_Bounds()
{
float radius = m_pShape->GetRadius();
float hheight = m_pShape->GetHHeight();
m_BoundBox.Set(vec3(-radius, -radius, 0.0f), vec3(radius, radius, (radius + hheight) * 2.0f));
m_BoundSphere.Set(vec3(0.0f, 0.0f, radius + hheight), radius + hheight);
m_WorldBoundBox.Set(m_BoundBox, Translate(m_vPosition));
m_WorldBoundSphere.Set(m_BoundSphere, Translate(m_vPosition));
}
/*
*/
void CActorBase::SetIntersectionMask(int mask)
{
m_pShape->SetIntersectionMask(mask);
}
int CActorBase::GetIntersectionMask() const
{
return m_pShape->GetIntersectionMask();
}
/*
*/
void CActorBase::SetCollision(int c)
{
m_nCollision = c;
}
int CActorBase::GetCollision() const
{
return m_nCollision;
}
void CActorBase::SetCollisionMask(int mask)
{
m_pShape->SetCollisionMask(mask);
}
int CActorBase::GetCollisionMask() const
{
return m_pShape->GetCollisionMask();
}
void CActorBase::SetCollisionRadius(float radius)
{
if (!Compare(m_pShape->GetRadius(), radius))
{
m_pDummy->SetPreserveTransform(Mat4(Translate(m_vUp * (radius - m_pShape->GetRadius()))) * m_pDummy->GetTransform());
m_pShape->SetRadius(radius);
}
Update_Bounds();
}
float CActorBase::GetCollisionRadius() const
{
return m_pShape->GetRadius();
}
/*
*/
void CActorBase::SetCollisionHeight(float height)
{
if (!Compare(m_pShape->GetHeight(), height))
{
m_pDummy->SetPreserveTransform(Mat4(Translate(m_vUp * (height - m_pShape->GetHeight()) * 0.5f)) * m_pDummy->GetTransform());
m_pShape->SetHeight(height);
}
Update_Bounds();
}
float CActorBase::GetCollisionHeight() const
{
return m_pShape->GetHeight();
}
void CActorBase::SetMinVelocity(float velocity)
{
m_fMinVelocity = Max(velocity, 0.0f);
}
float CActorBase::GetMinVelocity() const
{
return m_fMinVelocity;
}
/*
*/
void CActorBase::SetMaxVelocity(float velocity)
{
m_fMaxVelocity = Max(velocity, 0.0f);
}
float CActorBase::GetMaxVelocity() const
{
return m_fMaxVelocity;
}
/*
*/
void CActorBase::SetAcceleration(float accel)
{
m_fAcceleration = Max(accel, 0.0f);
}
float CActorBase::GetAcceleration() const
{
return m_fAcceleration;
}
/*
*/
void CActorBase::SetDamping(float d)
{
m_fDamping = Max(d, 0.0f);
}
float CActorBase::GetDamping() const
{
return m_fDamping;
}
/*
*/
void CActorBase::SetJumping(float j)
{
m_fJumping = Max(j, 0.0f);
}
float CActorBase::GetJumping() const
{
return m_fJumping;
}
/*
*/
void CActorBase::SetViewDirection(const vec3 &d)
{
m_vDirection = Normalize(d);
// ortho basis
vec3 tangent, binormal;
OrthoBasis(m_vUp, tangent, binormal);
// decompose direction
m_fPhiAngle = CMathCore::ATan2(Dot(m_vDirection, tangent), Dot(m_vDirection, binormal)) * RAD2DEG;
m_fThetaAngle = CMathCore::ACos(Clamp(Dot(m_vDirection, m_vUp), -1.0f, 1.0f)) * RAD2DEG - 90.0f;
m_pObject->SetWorldTransform(Get_Body_Transform());
}
const vec3 &CActorBase::GetViewDirection() const
{
return m_vDirection;
}
/******************************************************************************\
*
* States
*
\******************************************************************************/
/*
*/
int CActorBase::GetState(int state) const
{
assert(state >= 0 && state < NUM_STATES && "CPlayerActor::GetState(): bad state number");
return m_pStates[state];
}
float CActorBase::GetStateTime(int state) const
{
assert(state >= 0 && state < NUM_STATES && "CPlayerActor::GetStateTime(): bad state number");
return m_pTimes[state];
}
/******************************************************************************\
*
* Contacts
*
\******************************************************************************/
/*
*/
int CActorBase::GetNumContacts() const
{
return m_vecContacts.Size();
}
const CShape::Contact &CActorBase::GetContact(int num) const
{
return m_vecContacts[num];
}
/*
*/
void CActorBase::SetGround(int g)
{
m_nGround = g;
}
int CActorBase::GetGround() const
{
return m_nGround;
}
/*
*/
void CActorBase::SetCeiling(int c)
{
m_nCeiling = c;
}
int CActorBase::GetCeiling() const
{
return m_nCeiling;
}
/*
*/
Mat4 CActorBase::Get_Body_Transform() const
{
Vec3 center = m_vPosition + Vec3(m_vUp * (m_pShape->GetHHeight() + m_pShape->GetRadius()));
return SetTo(center, center + Vec3(m_vDirection - m_vUp * Dot(m_vDirection, m_vUp)), m_vUp) * Mat4(RotateX(-90.0f) * RotateZ(90.0f));
}
/*
*/
int CActorBase::Update_State(int condition, int state, int begin, int end, float ifps)
{
// disabled to begin
if (condition && m_pStates[state] == STATE_DISABLED && begin)
{
m_pStates[state] = STATE_BEGIN;
m_pTimes[state] = 0.0f;
return STATE_BEGIN;
}
// enabled or begin to end
if (condition == 0 && (m_pStates[state] == STATE_ENABLED || m_pStates[state] == STATE_BEGIN) && end)
{
m_pStates[state] = STATE_END;
return STATE_END;
}
// begin to enabled
if ((condition && m_pStates[state] == STATE_BEGIN) || m_pStates[state] == STATE_ENABLED)
{
m_pStates[state] = STATE_ENABLED;
m_pTimes[state] += ifps;
return STATE_ENABLED;
}
// end to disabled
if (m_pStates[state] == STATE_END)
{
m_pStates[state] = STATE_DISABLED;
return STATE_DISABLED;
}
return STATE_DISABLED;
}
void CActorBase::Update_States(int enabled, float ifps)
{
// handle states
if (enabled)
{
if (g_pSysControl->GetState(CSysControl::STATE_FORWARD) && g_pSysControl->GetState(CSysControl::STATE_BACKWARD))
{
Update_State(0, STATE_FORWARD, 1, 1, ifps);
Update_State(0, STATE_BACKWARD, 1, 1, ifps);
}
else
{
Update_State(g_pSysControl->GetState(CSysControl::STATE_FORWARD), STATE_FORWARD, 1, 1, ifps);
Update_State(g_pSysControl->GetState(CSysControl::STATE_BACKWARD), STATE_BACKWARD, 1, 1, ifps);
}
if (g_pSysControl->GetState(CSysControl::STATE_MOVE_LEFT) && g_pSysControl->GetState(CSysControl::STATE_MOVE_RIGHT))
{
Update_State(0, STATE_MOVE_LEFT, 1, 1, ifps);
Update_State(0, STATE_MOVE_RIGHT, 1, 1, ifps);
}
else
{
Update_State(g_pSysControl->GetState(CSysControl::STATE_MOVE_LEFT), STATE_MOVE_LEFT, 1, 1, ifps);
Update_State(g_pSysControl->GetState(CSysControl::STATE_MOVE_RIGHT), STATE_MOVE_RIGHT, 1, 1, ifps);
}
Update_State(g_pSysControl->GetState(CSysControl::STATE_CROUCH), STATE_CROUCH, 1, 1, ifps);
Update_State(g_pSysControl->GetState(CSysControl::STATE_JUMP), STATE_JUMP, m_nGround, 1, ifps);
Update_State(g_pSysControl->GetState(CSysControl::STATE_RUN), STATE_RUN, 1, 1, ifps);
}
// disable states
else
{
Update_State(0, STATE_FORWARD, 1, 1, ifps);
Update_State(0, STATE_BACKWARD, 1, 1, ifps);
Update_State(0, STATE_MOVE_LEFT, 1, 1, ifps);
Update_State(0, STATE_MOVE_RIGHT, 1, 1, ifps);
Update_State(0, STATE_CROUCH, 1, 1, ifps);
Update_State(0, STATE_JUMP, m_nGround, m_nGround, ifps);
Update_State(0, STATE_RUN, 1, 1, ifps);
}
}
/******************************************************************************\
*
* Bounds
*
\******************************************************************************/
/*
*/
const CBoundBox &CActorBase::GetBoundBox() const
{
return m_BoundBox;
}
const CBoundSphere &CActorBase::GetBoundSphere() const
{
return m_BoundSphere;
}
const CWorldBoundBox & CActorBase::GetWorldBoundBox() const
{
return m_WorldBoundBox;
}
const CWorldBoundSphere & CActorBase::GetWorldBoundSphere() const
{
return m_WorldBoundSphere;
}
void CActorBase::RenderVisualizer()
{
m_pShape->RenderVisualizer(vec4(1.0f, 0.0f, 0.0f, 1.0f));
g_Engine.pVisualizer->RenderVector(m_pShape->GetCenter(), m_pShape->GetCenter() + m_vDirection, vec4(1.0f, 0.0f, 0.0f, 1.0f));
}
void CActorBase::SetFriction(float friction)
{
m_fFriction = friction;
}
float CActorBase::GetFriction() const
{
return m_fFriction;
}
void CActorBase::SetPosition(const MathLib::vec3& pos)
{
m_vPosition = pos;
}
const MathLib::vec3& CActorBase::GetPosition() const
{
return m_vPosition;
}
================================================
FILE: Test/ActorBash.h
================================================
#pragma once
#ifndef __ACTOR_BASE_H__
#define __ACTOR_BASE_H__
#include "Shape.h"
#include "Bounds.h"
#include "Player.h"
/*
*/
class CBRObject;
class CBodyDummy;
class CBodyRigid;
class CObjectDummy;
class CShapeCapsule;
/*
*ײײ뾶ײ߶ȵȣ
*/
class CActorBase
{
public:
CActorBase();
virtual ~CActorBase();
void SetEnabled(int enable);
int IsEnabled() const;
void Update(float ifps);
// intersection mask
void SetIntersectionMask(int mask);
int GetIntersectionMask() const;
// collision
void SetCollision(int collision);
int GetCollision() const;
// collision mask
void SetCollisionMask(int mask);
int GetCollisionMask() const;
// collision radius
void SetCollisionRadius(float radius);
float GetCollisionRadius() const;
// collision height
void SetCollisionHeight(float height);
float GetCollisionHeight() const;
// maximum friction Ħֵ
void SetFriction(float friction);
float GetFriction() const;
// minimum velocity Сٶ
void SetMinVelocity(float velocity);
float GetMinVelocity() const;
// maximum velocity ٶ
void SetMaxVelocity(float velocity);
float GetMaxVelocity() const;
// acceleration ٶ
void SetAcceleration(float acceleration);
float GetAcceleration() const;
// damping б
void SetDamping(float damping);
float GetDamping() const;
// jumping Ծ
void SetJumping(float jumping);
float GetJumping() const;
// view direction ߳
void SetViewDirection(const MathLib::vec3 &direction);
const MathLib::vec3 &GetViewDirection() const;
//position λ
void SetPosition( const MathLib::vec3 & pos );
const MathLib::vec3& GetPosition() const;
enum { //״̬
STATE_FORWARD = 0,
STATE_BACKWARD,
STATE_MOVE_LEFT,
STATE_MOVE_RIGHT,
STATE_CROUCH, //
STATE_JUMP,
STATE_RUN,
NUM_STATES,
};
// state status //״̬Ƿã״̬ʼ
enum {
STATE_DISABLED = 0,
STATE_ENABLED,
STATE_BEGIN,
STATE_END,
};
// current state
int GetState(int state) const;
float GetStateTime(int state) const;
// contacts
int GetNumContacts() const;
const CShape::Contact &GetContact(int num) const;
// ground flag //ƶ͵λñ־
void SetGround(int ground);
int GetGround() const;
// ceiling flag //ƶߵλñ־
void SetCeiling(int ceiling);
int GetCeiling() const;
// bounds Լ
virtual const CBoundBox &GetBoundBox() const;
virtual const CBoundSphere &GetBoundSphere() const;
//ͬ
virtual const CWorldBoundBox &GetWorldBoundBox() const;
virtual const CWorldBoundSphere &GetWorldBoundSphere() const;
virtual void RenderVisualizer();
private:
// update bounds //±߽
void Update_Bounds();
// player transformation
MathLib::Mat4 Get_Body_Transform() const;
// update states
int Update_State(int condition,int state,int begin,int end,float ifps);
void Update_States(int enabled,float ifps);
int m_nFrame; // frame number
MathLib::vec3 m_vUp; // up άе
MathLib::vec3 m_vVelocity; // velocity vector ǰٶ
CObjectDummy *m_pObject; // dummy object
CBodyDummy *m_pDummy; // dummy body
int m_nCollision; // collision flag
CShapeCapsule *m_pShape; // collision shape
float m_fFriction; // fraction when frozen
float m_fMinVelocity; // minimum velocity
float m_fMaxVelocity; // maximum velocity
float m_fAcceleration; // acceleration
float m_fDamping; // damping
float m_fJumping; // jumping
int m_nFlush; // flush flag
MathLib::Vec3 m_vPosition; // position
MathLib::vec3 m_vDirection; // direction
float m_fPhiAngle; // phi angle
float m_fThetaAngle; // theta angle
int m_pStates[NUM_STATES]; // state vector
float m_pTimes[NUM_STATES]; // time vector
int m_nGround; // ground flag
int m_nCeiling; // ceiling flag
CBoundBox m_BoundBox; // bounding box
CBoundSphere m_BoundSphere; // bounding sphere
CWorldBoundBox m_WorldBoundBox; // bounding box
CWorldBoundSphere m_WorldBoundSphere; // bounding sphere
CVector<CShape::Contact> m_vecContacts;
int m_nEnable;
};
#endif __PLAYER_ACTOR_H__
================================================
FILE: Test/CameraBash.cpp
================================================
#include "CameraBase.h"
#include "sys/SysControl.h"
#include "HMDWrapper.h"
#include "Engine.h"
#include "Game.h"
using namespace MathLib;
#ifdef MEMORY_INFO
#define new new(__FILE__, __LINE__)
#endif // MEMORY_INFO
#define CAMERA_BASE_CLAMP 89.9f
CCameraBase::CCameraBase(): CPlayer(PLAYER_SPECTATOR)
{
m_nFlush = 0;
m_vPosition = Vec3_zero;
m_fPhiAngle = 0.0f;
m_fThetaAngle = 0.0f;
m_pLastPlayer = NULL;
m_nEnabelMouse = 1;
SetRadius(1.0f);
SetMinThetaAngle(-90.0f);
SetMaxThetaAngle(90.0f);
SetTurning(90.0f);
SetViewDirection(vec3(0.0f,1.0f,0.0f));
SetEnabled(0);
SetHMDEnabled(1);
}
CCameraBase::~CCameraBase()
{
Leave();
}
void CCameraBase::SetEnabled(int nEnable)
{
if(nEnable)
{
m_pLastPlayer = g_Engine.pGame->GetPlayer();
CPlayer::SetEnabled(nEnable);
g_Engine.pGame->SetPlayer(this);
}
else
{
if (m_pLastPlayer)
{
g_Engine.pGame->SetPlayer(m_pLastPlayer);
CPlayer::SetEnabled(nEnable);
}
}
}
int CCameraBase::IsEnabled() const
{
return CPlayer::IsEnabled();
}
void CCameraBase::SetHMDEnabled(int nEnable)
{
m_nHMDEnable = nEnable;
}
int CCameraBase::IsHMDEnabled() const
{
return m_nHMDEnable;
}
void CCameraBase::SetRadius(float r)
{
m_fRadius = r;
}
float CCameraBase::GetRadius() const
{
return m_fRadius;
}
/******************************************************************************\
*
* Parameters
*
\******************************************************************************/
/*
*/
void CCameraBase::Update_Bounds()
{
m_BoundSphere.Set(vec3_zero,m_fRadius);
m_BoundBox.Set(m_BoundSphere);
Update_World_Position();
}
void CCameraBase::SetMinThetaAngle(float angle)
{
m_fMinThetaAngle = Clamp(angle,-CAMERA_BASE_CLAMP,CAMERA_BASE_CLAMP);
}
float CCameraBase::GetMinThetaAngle() const
{
return m_fMinThetaAngle;
}
/*
*/
void CCameraBase::SetMaxThetaAngle(float angle)
{
m_fMaxThetaAngle = Clamp(angle, -CAMERA_BASE_CLAMP, CAMERA_BASE_CLAMP);
}
float CCameraBase::GetMaxThetaAngle() const
{
return m_fMaxThetaAngle;
}
float CCameraBase::GetTurning() const
{
return m_fTurning;
}
void CCameraBase::SetPhiAngle(float angle)
{
angle = angle - m_fPhiAngle;
m_vDirection = quat(m_vUp, angle) * m_vDirection;
m_fPhiAngle += angle;
FlushTransform();
}
float CCameraBase::GetPhiAngle() const
{
return m_fPhiAngle;
}
void CCameraBase::SetThetaAngle(float angle)
{
angle = Clamp(angle, m_fMinThetaAngle, m_fMaxThetaAngle) - m_fThetaAngle;
m_vDirection = quat(Cross(m_vUp, m_vDirection), angle) * m_vDirection;
m_fThetaAngle += angle;
FlushTransform();
}
float CCameraBase::GetThetaAngle() const
{
return m_fThetaAngle;
}
/*
*
*/
void CCameraBase::SetViewDirection(const vec3 &d) //设置视角方位,参考三维坐标系
{
m_vDirection = Normalize(d);
// ortho basis
vec3 tangent, binormal;
OrthoBasis(m_vUp, tangent, binormal);
// decompose direction
m_fPhiAngle = CMathCore::ATan2(Dot(m_vDirection, tangent), Dot(m_vDirection, binormal)) * RAD2DEG;
m_fThetaAngle = CMathCore::ACos(Clamp(Dot(m_vDirection, m_vUp), -1.0f, 1.0f)) * RAD2DEG - 90.0f;
m_fThetaAngle = Clamp(m_fThetaAngle, m_fMinThetaAngle, m_fMaxThetaAngle);
FlushTransform();
}
const vec3 &CCameraBase::GetViewDirection() const
{
return m_vDirection;
}
void CCameraBase::UpdateControls(float ifps)
{
if (g_pHMD->GetUseHMD() && m_nHMDEnable)
{
Update_HMD(ifps);
}
else
{
Update_Controls(ifps);
}
}
/******************************************************************************\
*
* Flush
*
\******************************************************************************/
================================================
FILE: Test/CameraBash.h
================================================
#ifndef __CAMERA_BASE_H__
#define __CAMERA_BASE_H__
#include "Player.h"
class CPlayer;
/*
*ͷǶȣӾ뾶СǶȣת߷ȡ
*/
class CCameraBase : public CPlayer
{
public:
CCameraBase();
virtual ~CCameraBase();
void SetEnabled(int nEnable);
int IsEnabled() const;
void SetHMDEnabled(int nEnable);
int IsHMDEnabled() const;
void SetRadius(float r);
float GetRadius() const;
// minimum theta angle
void SetMinThetaAngle(float angle);
float GetMinThetaAngle() const;
// maximum theta angle
void SetMaxThetaAngle(float angle);
float GetMaxThetaAngle() const;
// turning
void SetTurning(float turning);
float GetTurning() const;
// phi angle
void SetPhiAngle(float angle);
float GetPhiAngle() const;
// theta angle
void SetThetaAngle(float angle);
float GetThetaAngle() const;
// view direction
void SetViewDirection(const MathLib::vec3 &direction);
const MathLib::vec3 &GetViewDirection() const;
// update
virtual void UpdateControls(float ifps);
// flush
virtual void FlushTransform();
// bounds
virtual const CBoundBox &GetBoundBox() const;
virtual const CBoundSphere &GetBoundSphere() const;
void SetFlush(int nFlush) { m_nFlush = nFlush; }
void SetMouseControls(int nEnable) { m_nEnabelMouse = nEnable; }
private:
void Update_Controls(float ifps);
void Update_HMD(float ifps);
// update bounds
void Update_Bounds();
// update transformation
virtual void Update_Transform();
float m_fRadius;
float m_fMinThetaAngle; // minimum theta angle
float m_fMaxThetaAngle; // maximum theta angle
float m_fAcceleration; // acceleration
float m_fTurning; // turning
int m_nFlush; // flush flag
MathLib::Vec3 m_vPosition; // position
MathLib::vec3 m_vDirection; // direction
float m_fPhiAngle; // phi angle
float m_fThetaAngle; // theta angle
CBoundBox m_BoundBox; // bounding box
CBoundSphere m_BoundSphere; // bounding sphere
CPlayer *m_pLastPlayer;
int m_nHMDEnable;
int m_nEnabelMouse;
}
#endif
================================================
FILE: Test/Common.cpp
================================================
#include "Common.h"
#include "Engine.h"
#include "Game.h"
#include "World.h"
CCommon::CCommon(void)
{
}
CCommon::~CCommon(void)
{
}
vec3 CCommon::GetTransformDirection(const mat4& matTransform, const vec3& vUP)
{
return MakeRotationFromYZ(matTransform.getColumn3(1), vUP) * vec3(0.0f, -1.0f, 0.0f);
}
int CCommon::GetIntersectionPosition(vec3& vRetPoint, const vec3& p0, const vec3& p1, int nMask /*= 2|4*/)
{
vec3 n;
int s;
g_Engine.pWorld->GetIntersection(p0, p1, nMask, vRetPoint, n, s);
return s >= 0;
}
int CCommon::GetIntersectionObject(CBRObject** vRetObject, const vec3& p0, const vec3& p1, int nMask /*= 2|4*/)
{
vec3 p, n;
int s;
*vRetObject = NULL;
*vRetObject = g_Engine.pWorld->GetIntersection(p0, p1, nMask, p, n, s);
return s >= 0;
}
float CCommon::CalcAxisScale(const mat4& modelview, float fov, vec4 objectPosW, float sizeInPixels, float viewHeight)
{
float worldHeight;
// World height on origin's z value
vec4 objPosV;
objPosV = modelview * objectPosW;
worldHeight = 2.0f * CMathCore::Abs(objPosV.z) * (float)CMathCore::Tan(fov / 2.0f * DEG2RAD);
return sizeInPixels * (worldHeight / viewHeight);
}
================================================
FILE: Test/Common.h
================================================
#pragma once
#include "MathLib.h"
using namespace MathLib;
class CBRObject;
class CCommon
{
public:
CCommon(void);
~CCommon(void);
static int GetIntersectionObject(CBRObject** vRetObject, const vec3& p0, const vec3& p1, int nMask = 2 | 4);
static float CalcAxisScale(float fov,vec4 objectPosW,float sizeInPixels,float viewHeight);
static vec3 GetTransformDirection(const mat4& matTransform,const vec3& vUP = vec3(0.0f,0.0f,1.0f));
static int GetIntersectionPosition(const mat4& modelview,vec3& vRetPoint,const vec3& p0,const vec3& p1,int nMask = 2|4);
};
================================================
FILE: Test/FPSRole.cpp
================================================
#include "FPSRole.h"
#include "Engine.h"
#include "Creature.h"
#include "AnimationBlend.h"
#include "WorldEffect.h"
#include "ObjectMeshSkinned.h"
#include "Game.h"
#include "ObjectParticles.h"
CFPSRole::CFPSRole(void)
{
m_nFire = 0;
m_fAniCoolingTime = 0;
m_fAniNowCoolingTime = 0;
m_fSudCoolingTime = 0;
m_fEmitCoolingTime = 0;
m_fEmitNowCoolingTime = 0;
m_fSudNowCoolingTime = 0;
m_strMuzzleBone = "wuqi02";
m_pArmsMesh = NULL;
m_pBulletParticle = NULL;
m_strBulletName = "data/effect/particle/zgfwq_sj_02.node";
m_strMuzzleEffect = "data/effect/particle/zgfwq_sj_01.node";
}
CFPSRole::~CFPSRole(void)
{
g_Engine.pGame->RemoveNode(m_pBulletParticle);
g_Engine.pGame->RemoveNode(m_pMuzzleEffect);
}
int CFPSRole::Init( int nRoleID,const char* strCharFile )
{
if(CRoleBase::Init(nRoleID,strCharFile))
{
m_pStand[0] = (CAnimationBlendRotate*)m_pCreature->GetAnimationBlend("stand_h");
m_pFire[0] = (CAnimationBlendRotate*)m_pCreature->GetAnimationBlend("fire_h");
m_pStand[1] = (CAnimationBlendRotate*)m_pCreature->GetAnimationBlend("stand_v");
m_pFire[1] = (CAnimationBlendRotate*)m_pCreature->GetAnimationBlend("fire_v");
m_pRun[0] = (CAnimationBlendDual*)m_pCreature->GetAnimationBlend("run_h");
m_pRun[1] = (CAnimationBlendDual*)m_pCreature->GetAnimationBlend("run_v");
m_fAniNowCoolingTime = 0.0f;
m_fAniCoolingTime = 1.0f / m_pFire[0]->GetTriggerSpeed();
m_fEmitNowCoolingTime = 0;
m_fSudNowCoolingTime = 0;
m_fSudCoolingTime = m_fAniCoolingTime * 4.0f; //ֵ
m_fEmitCoolingTime = m_fAniCoolingTime * 3.0f;//ֵ
m_pBulletParticle = (CObjectParticles*)g_Engine.pGame->LoadNode(m_strBulletName);
m_pBulletParticle->GetTracker(TRACKER_CUSTOM)->SetTrackValue(0,0.0f,vec4(1.0f,1.0f,1.0f,0.8f));
m_pBulletParticle->SetName(CUtilStr::Format("%d",m_nRoleID));
m_pMuzzleEffect = (CWorldEffect*)g_Engine.pGame->LoadNode(m_strMuzzleEffect);
m_pMuzzleEffect->Stop();
m_pMuzzleEffect->SetLoop(0);
m_pMuzzleEffect->SetLoopCount(1);
}
return 1;//always return 1;
}
void CFPSRole::OnKeyFrame( _ActionCallback_KeyFrame* pKeyInfo )
{
//I will finish this function later.
}
void CFPSRole::OnActionComplete( _ActionCallback_Complete* pActInfo )
{
return CRoleBase::OnActionComplete(pActInfo);
}
void CFPSRole::SetPaceAnimationF_B( int nF_B )
{
switch(nF_B)
{
case 0:
m_pRun[0]->CloseBlend();
break;
case 1:
m_pRun[0]->PlayAnimationA();
break;
case 2:
m_pRun[0]->PlayAnimationB();
break;
}
}
void CFPSRole::SetPaceAnimationL_R( int nF_B )
{
switch(nF_B)
{
case 0:
m_pRun[1]->CloseBlend();
break;
case 1:
m_pRun[1]->PlayAnimationA();
break;
case 2:
m_pRun[1]->PlayAnimationB();
break;
}
}
void CFPSRole::OnFire( float fCoolingTime )
{
}
void CFPSRole::UpdateMuzzleTransform()
{
m_pFire[0]->LockFrame(2.3f);
m_pFire[1]->LockFrame(2.3f);
m_pStand[0]->LockFrame(2.3f);
m_pStand[1]->LockFrame(2.3f);
m_pArmsMesh->UpdateLink_Bone();
m_pArmsMesh->SetTransform(m_pArmsMesh->GetTransform());
m_matMuzzleTransform = m_pArmsMesh->GetWorldBoneTransform(m_nMuzzleBone);
}
void CFPSRole::SetMuzzleSpinL_R( float vValue )
{
m_pStand[1]->SetRotateSpin(vValue);
m_pFire[1]->SetRotateSpin(vValue);
}
void CFPSRole::SetMuzzleSpinU_D( float vValue )
{
m_pStand[0]->SetRotateSpin(vValue);
m_pFire[0]->SetRotateSpin(vValue);
}
void CFPSRole::Update( float ifps )
{
UpdateMuzzleTransform();
m_pBulletParticle->SetWorldTransform(m_matMuzzleTransform);
m_pMuzzleEffect->SetWorldTransform(m_matMuzzleTransform*Scale(0.4f,1.0f,0.5f));
UpdateFire(ifps);
CRoleBase::Update(ifps);
}
void CFPSRole::SetPaceAnimationL_R( int nF_B )
{
switch(nF_B)
{
case 0:
{
m_pRun[1]->CloseBlend();
}break;
case 1:
{
m_pRun[1]->PlayAnimationA();
}break;
case 2:
{
m_pRun[1]->PlayAnimationB();
}break;
}
}
void CFPSRole::UpdateFire( float ifps )
{
m_fAniNowCoolingTime -= ifps;
m_fSudNowCoolingTime -= ifps;
m_fEmitNowCoolingTime -= ifps;
if(m_nFire)
{
//
if(m_fAniNowCoolingTime < EPSILON)
{
m_fAniNowCoolingTime = m_fAniCoolingTime;
m_pFire[0]->OnJumpFrame();
m_pFire[1]->OnJumpFrame();
}
//
if(m_fSudNowCoolingTime < EPSILON)
{
m_fSudNowCoolingTime = m_fSudCoolingTime;
m_pMuzzleEffect->Play();
}
//ӵ
if(m_fEmitNowCoolingTime < EPSILON)
{
m_fEmitNowCoolingTime = m_fEmitCoolingTime;
m_pBulletParticle->FireBullet();
OnFire(m_fEmitCoolingTime);
}
}
}
int CFPSRole::SetupArms( int nAssembly,int nBody )
{
int nRet = m_pCreature->SetupBody(nAssembly,nBody);
if(!nRet)
{
return 0;
}
CNode* pNode = GetAssemblyNode(nAssembly);
if(pNode->GetType() == CNode::OBJECT_MESH_SKINNED)
{
m_pArmsMesh = (CObjectMeshSkinned*)pNode;
m_nMuzzleBone = m_pArmsMesh->FindBone(m_strMuzzleBone);
}
return 1;
}
================================================
FILE: Test/FPSRole.h
================================================
#pragma once
#include "Rolebase.h"
#include "UtilStr.h"
class CAnimationBlendRotate;
class CAnimationBlendDual;
class CObjectParticles;
class CWorldEffect;
class CObjectMeshSkinned;
class CFPSRole :public CRoleBase
{
public:
CFPSRole(void);
virtual ~CFPSRole(void);
virtual int Init(int nRoleID, const char* strCharFile);
virtual void Update(float ifps);
void SetMuzzleSpinU_D(float vValue);
void SetMuzzleSpinL_R(float vValue);
void SetPaceAnimationF_B(int nF_B);
void SetPaceAnimationL_R(int nF_B);
void OpenFire() { m_nFire = 1; }
void CloseFire() { m_nFire = 0; }
int SetupArms(int nAssembly, int nBody);
protected:
virtual void OnKeyFrame(_ActionCallback_KeyFrame* pKeyInfo);
virtual void OnActionComplete(_ActionCallback_Complete* pActInfo);
protected:
CAnimationBlendRotate* m_pStand[2];
CAnimationBlendRotate* m_pFire[2];
CAnimationBlendDual* m_pRun[2];
int m_nFire;//开枪
float m_fAniCoolingTime;//后坐力动画冷却时间
float m_fAniNowCoolingTime;//后坐力动画已冷却时间
float m_fSudCoolingTime;//开枪声音冷却时间
float m_fSudNowCoolingTime;//开枪声音已冷却时间
float m_fEmitCoolingTime;//发射子弹冷却时间
float m_fEmitNowCoolingTime;//发射子弹已冷却时间
CUtilStr m_strMuzzleBone;
int m_nMuzzleBone;
CObjectMeshSkinned* m_pArmsMesh;
void UpdateFire(float ifps);
virtual void OnFire(float fCoolingTime);
void UpdateMuzzleTransform();
CUtilStr m_strBulletName;
CObjectParticles* m_pBulletParticle;
CUtilStr m_strMuzzleEffect;
CWorldEffect* m_pMuzzleEffect;
mat4 m_matMuzzleTransform;
};
================================================
FILE: Test/FPSRoleLocal.cpp
================================================
#include "FPSRoleLocal.h"
#include "Creature.h"
#include "Engine.h"
#include "Input.h"
#include "App.h"
#include "ObjectMeshSkinned.h"
#include "ActorBase.h"
#include "Visualizer.h"
#include "game.h"
#include "RayControl.h"
#include "Common.h"
#include "ControlsApp.h"
CFPSRoleLocal::CFPSRoleLocal(void)
{
m_nCharMode = 0;
m_nMuzzleBone = -1;
m_nUpdateMove = 0;
}
CFPSRoleLocal::~CFPSRoleLocal(void)
{
delete m_pActorBase;
}
int CFPSRoleLocal::Init( int nRoleID,const char* strCharFile )
{
CFPSRole::Init(nRoleID,strCharFile);
m_pCreature->SetupBody(1,1);
m_pCreature->SetHighShadow(1);
SetupArms(2,0);
m_pActorBase = new CActorBase();
m_pActorBase->SetEnabled(1);
//
//m_vCameraOffset = vec3(0.0f,0.0f,1.8f);
m_vCameraOffset = vec3(0.0f,0.0f,1.8f);
//m_vGunOffset = vec3(0.0,0.0,-0.0f);
m_vGunOffset = vec3(0.2,0.2,0.2f);
//m_vRotateOffset = vec3(-0.076326f, 0.018540f, -1.725809f); // gua dian weizhi);
m_vRotateOffset = vec3(-0.076326f, 0.018540f, -1.725809f); // gua dian weizhi);
return 1;
}
void CFPSRoleLocal::Update( float ifps )
{
if(m_pFire[0] && m_pFire[1])
{
//if(g_Engine.pApp->GetMouseButtonState(CApp::BUTTON_LEFT) || g_Engine.pApp->GetMouseButtonState(CApp::BUTTON_LDCLICK) )
if(g_Engine.pInput->IsLBDownPress()||g_Engine.pInput->IsLBDBDown())
{
OpenFire(); //굥
}
else
{
CloseFire();
}
}
CFPSRole::Update(ifps);
CRayControl::Instance().Update(m_matMuzzleTransform,vec3(0.0f,0.5f,-0.03f));
}
void CFPSRoleLocal::OnFire( float fCoolingTime )
{
CFPSRole::OnFire(fCoolingTime);
}
void CFPSRoleLocal::UpdateTransform( const MathLib::mat4 & matRotate )
{
mat4 m = Translate(m_pActorBase->GetPosition()+ m_vCameraOffset) * Translate(m_vGunOffset) * matRotate * Translate(m_vRotateOffset);
m_pCreature->GetMainObjectMesh()->SetWorldTransform(m);
}
void CFPSRoleLocal::SetActorPosition( const vec3& vPosition )
{
m_pActorBase->SetPosition(vPosition);
}
void CFPSRoleLocal::SetActorDirection( const vec3& vDirection )
{
m_pActorBase->SetViewDirection(vDirection);
}
MathLib::vec3 CFPSRoleLocal::GetActorPosition()
{
return m_pActorBase->GetPosition();
}
void CFPSRoleLocal::UpdateActor( float ifps )
{
m_pActorBase->Update(ifps);
}
================================================
FILE: Test/FPSRoleLocal.h
================================================
#pragma once
#include "FPSRole.h"
class CActorBase;
class CFPSRoleLocal : public CFPSRole
{
public:
CFPSRoleLocal(void);
virtual ~CFPSRoleLocal(void);
public:
virtual int Init(int nRoleID, const char* strCharFile);
virtual void Update(float ifps);
void UpdateTransform(const MathLib::mat4 & matRotate);
MathLib::vec3 GetActorPosition();
void SetActorPosition(const vec3& vPosition);
void SetActorDirection(const vec3& vDirection);
void UpdateActor(float ifps);
MathLib::vec3 GetCameraOffset() { return m_vCameraOffset; }
protected:
virtual void OnFire(float fCoolingTime);
int m_nCharMode;
CActorBase* m_pActorBase;
MathLib::vec3 m_vCameraOffset;
MathLib::vec3 m_vGunOffset;
MathLib::vec3 m_vRotateOffset;
};
================================================
FILE: Test/GameMain.cpp
================================================
#include "GameMain.h"
#include "GameProcess.h"
#include "sys/SysControl.h"
#include "Engine.h"
#include "Game.h"
CGameMain::CGameMain(void)
{
}
CGameMain::~CGameMain(void)
{
}
int CGameMain::Init()
{
g_pSysControl->Init();
m_pGameProcess = new CGameProcess();
return m_pGameProcess->Init();
}
int CGameMain::ShutDown()
{
g_pSysControl->Shutdown();
m_pGameProcess->ShutDown();
delete m_pGameProcess;
return 1;
}
int CGameMain::Update()
{
float ifps = g_Engine.pGame->GetIFps();
g_pSysControl->Update(ifps);
m_pGameProcess->Update();
return 1;
}
int CGameMain::Render()
{
m_pGameProcess->Render();
return 1;
}
================================================
FILE: Test/GameMain.h
================================================
#pragma once
class CGameProcess;
class CGameMain
{
public:
CGameMain(void);
virtual ~CGameMain(void);
public:
int Init();
int ShutDown();
int Update();
int Render();
CGameProcess* m_pGameProcess;
};
================================================
FILE: Test/GameProcess.cpp
================================================
#include "GameProcess.h"
#include "Object.h"
#include "Engine.h"
#include "World.h"
#include "App.h"
#include "ToolsCamera.h"
#include "ControlsApp.h"
#include "MathLib.h"
#include "Game.h"
#include "Editor.h"
#include "Input.h"
#include "BlueRayUtils.h"
#include "World.h"
#include "Action.h"
#include "FPSRoleLocal.h"
#include "StarControl.h"
#include "RayControl.h"
#include "CameraBase.h"
#include "ActorBase.h"
#include "sys/SysControl.h"
#include "FileSystem.h"
#include "RenderManager.h"
#include "Texture.h"
using namespace MathLib;
CGameProcess::CGameProcess(void)
{
}
CGameProcess::~CGameProcess(void)
{
}
int CGameProcess::Init()
{
g_Engine.pFileSystem->CacheFilesFormExt("char");
g_Engine.pFileSystem->CacheFilesFormExt("node");
g_Engine.pFileSystem->CacheFilesFormExt("smesh");
g_Engine.pFileSystem->CacheFilesFormExt("sanim");
g_Engine.pWorld->LoadWorld("data/scene/terrain/test/test.world");
//g_Engine.pWorld->LoadWorld("data/scene/terrain/cj/cj.world");
g_Engine.pControls->SetKeyPressFunc(KeyPress);
g_Engine.pControls->SetKeyReleaseFunc(KeyRelease);
m_pRole = new CFPSRoleLocal();
m_pRole->Init(10001, "data/role/hero/FpsRole/fps.char");
m_pRole->SetActorPosition(vec3(0, 0, 0)); //设置角色初始位置。以门处作为原点,三维坐标系vec3是向量
m_pSkillSystem = new CSkillSystem(this);
m_pCameraBase = new CCameraBase();
m_pCameraBase->SetEnabled(1);
g_pSysControl->SetMouseGrab(1);
m_pStarControl = new CStarControl();
m_pRayControl = new CRayControl();
return 1;
}
int CGameProcess::ShutDown() //关闭游戏进程
{
delete m_pRole;
delete m_pSkillSystem;
delete m_pCameraBase;
delete m_pStarControl;
delete m_pRayControl;
DelAllListen();
return 0;
}
int CGameProcess::Update()
{
float ifps = g_Engine.pGame->GetIFps();
if (g_Engine.pInput->IsKeyDown('1'))
{
CAction* pAction = m_pRole->OrceAction("attack02");
if (pAction)
{
pAction->SetupSkillThrow(vec3_zero, -1.0f, 2.0f);
m_pRole->StopMove();
}
}
else if (g_Engine.pInput->IsKeyDown('2'))
{
CAction* pAction = m_pRole->OrceAction("skill01");
if (pAction)
{
m_pRole->StopMove();
}
}
else if (g_Engine.pInput->IsKeyDown('3'))
{
CAction* pAction = m_pRole->OrceAction("skill02");
if (pAction)
{
m_pRole->StopMove();
CRoleBase* pTarget = NULL;
for (int i = 0; i < 20; i++)
{
float l = (m_vAIList[i]->GetPosition() - m_pRole->GetPosition()).length();
if (l > 5.0f && l < 15.0f)
{
pTarget = m_vAIList[i];
break;
}
}
if (pTarget)
{
CVector<int> vTarget;
vTarget.Append(pTarget->GetRoleID());
pAction->SetupSkillBulletTarget(vTarget);
m_pRole->SetDirection((pTarget->GetPosition() - m_pRole->GetPosition()).normalize(), 1);
}
}
}
else if (g_Engine.pInput->IsKeyDown('4'))//多发子弹
{
CAction* pAction = m_pRole->OrceAction("skill02");
if (pAction)
{
m_pRole->StopMove();
CVector<int> vTarget;
for (int i = 0; i < 20; i++)
{
float l = (m_vAIList[i]->GetPosition() - m_pRole->GetPosition()).length();
if (l > 5.0f && l < 20.0f)
{
vTarget.Append(m_vAIList[i]->GetRoleID());
}
}
if (!vTarget.Empty())
{
pAction->SetupSkillBulletTarget(vTarget);
}
}
}
else if (g_Engine.pInput->IsKeyDown('5'))
{
CAction* pAction = m_pRole->OrceAction("skill03");
if (pAction)
{
m_pRole->StopMove();
CVector<vec3> vPos;
pAction->SetupSkillTargetPoint(vPos);
}
}
else if (g_Engine.pInput->IsKeyDown('6'))
{
CAction* pAction = m_pRole->OrceAction("skill06");
if (pAction)
{
m_pRole->StopMove();
CVector<vec3> vPos;
for (int i = 0; i < 20; i++)
{
float l = (m_vAIList[i]->GetPosition() - m_pRole->GetPosition()).length();
if (l > 5.0f && l < 20.0f)
vPos.Append(m_vAIList[i]->GetPosition());
}
pAction->SetupSkillTargetPoint(vPos);
}
}
else if (g_Engine.pInput->IsKeyDown('7'))
{
CAction* pAction = m_pRole->OrceAction("skill05");
if (pAction)
{
m_pRole->StopMove();
CVector<int> vTarget;
for (int i = 0; i < 20; i++)
{
float l = (m_vAIList[i]->GetPosition() - m_pRole->GetPosition()).length();
if (l > 5.0f && l < 20.0f)
vTarget.Append(m_vAIList[i]->GetRoleID());
}
if (!vTarget.Empty())
{
pAction->SetupSkillBulletTarget(vTarget);
}
}
}
else if (g_Engine.pInput->IsKeyDown('8'))
{
CAction* pAction = m_pRole->OrceAction("skill07");
if (pAction)
{
m_pRole->StopMove();
CVector<vec3> vPos;
for (int i = 0; i < 20; i++)
{
float l = (m_vAIList[i]->GetPosition() - m_pRole->GetPosition()).length();
if (l > 5.0f && l < 20.0f)
vPos.Append(m_vAIList[i]->GetPosition());
}
pAction->SetupSkillBulletPosition(vPos);
}
}
else if (g_Engine.pInput->IsKeyDown('9'))
{
CAction* pAction = m_pRole->OrceAction("skill08");
if (pAction)
{
m_pRole->StopMove();
pAction->SetupSkillBulletDirection(1);
}
}
else if (g_Engine.pInput->IsKeyUp(CInput::KEY_ESC))
{
g_Engine.pApp->Exit();
}
if(g_Engine.pInput->IsLBDown())
{
vec3 p0,p1;
BlueRay::GetPlayerMouseDirection(p0,p1);
vec3 vRetPoint,vRetNormal;
int nS = -1;
g_Engine.pWorld->GetIntersection(p0,p1,CBRObject::MASK_SCENE,vRetPoint,vRetNormal,nS);
if(-1 != nS)
{
m_pRole->MoveToPath(vRetPoint);
}
}
for(int i = 0;i < 20;i++)
{
if(!m_vAIList[i]->IsMoveing())
{
vec3 vPos = vec3(g_Engine.pGame->GetRandomFloat(-20.0f,20.0f),g_Engine.pGame->GetRandomFloat(-20.0f,20.0f),1.1f);
m_vAIList[i]->MoveToPath(vPos);
}
m_vAIList[i]->Update(ifps);
}
if (g_Engine.pInput->IsLBDown()) //shubiaozuojian
{
g_pSysControl->SetMouseGrab(1);
m_pStarControl->Click();
}
if (g_Engine.pInput->IsKeyDown(CInput::KEY_ESC))
{
g_pSysControl->SetMouseGrab(0);
}
m_pCameraBase->SetMouseControls(g_pSysControl->GetMouseGrab());
m_pCameraBase->Update(ifps);
m_pRole->SetActorDirection(m_pCameraBase->GetViewDirection());
m_pRole->UpdateActor(ifps);
m_pCameraBase->SetPosition(m_pRole->GetActorPosition() + m_pRole->GetCameraOffset());
vec3 x = m_pCameraBase->GetModelview().getRow3(0);
vec3 y = m_pCameraBase->GetModelview().getRow3(1);
vec3 z = m_pCameraBase->GetModelview().getRow3(2);
mat4 r = mat4_identity;
r.setColumn3(0, -x); //
r.setColumn3(1, z); //
r.setColumn3(2, y); //
m_pRole->UpdateTransform(r);
m_pRole->Update(ifps);
m_pSkillSystem->Update(ifps);
m_pStarControl->Update(m_pCameraBase->GetPosition(), m_pCameraBase->GetDirection());
return 1;
}
int CGameProcess::Render()
{
////test
//m_pTestHero->Render();
//g_Engine.pVisualizer->RenderLine3D(vec3(0.0f,0.0f,1.0f), vec3(10.0f,0.0f,1.0f), vec4(1.0f,0.0f,0.0f,1.0f));
//g_Engine.pVisualizer->RenderLine3D(vec3(0.0f,0.0f,1.0f), vec3(0.0f,10.0f,1.0f), vec4(0.0f,1.0f,0.0f,1.0f));
//g_Engine.pVisualizer->RenderLine3D(vec3(0.0f,0.0f,1.0f), vec3(0.0f,0.0f,11.0f), vec4(0.0f,0.0f,1.0f,1.0f));
////~test
return 1;
}
int CGameProcess::KeyPress(unsigned int nKey)
{
if (nKey == 'w')
{
//g_Engine.pControls->SetState(CControls::STATE_RESTORE, 1);
g_Engine.pControls->SetState(CControls::STATE_FORWARD, 1);
}
else if (nKey == 's')
{
g_Engine.pControls->SetState(CControls::STATE_RESTORE, 1);
g_Engine.pControls->SetState(CControls::STATE_BACKWARD, 1);
}
else if (nKey == 'a')
{
g_Engine.pControls->SetState(CControls::STATE_RESTORE, 1);
g_Engine.pControls->SetState(CControls::STATE_MOVE_LEFT, 1);
}
else if (nKey == 'd')
{
g_Engine.pControls->SetState(CControls::STATE_RESTORE, 1);
g_Engine.pControls->SetState(CControls::STATE_MOVE_RIGHT, 1);
}
else if (nKey == 'q')
{
g_Engine.pControls->SetState(CControls::STATE_JUMP, 1);
}
else if (nKey == 'e')
{
g_Engine.pControls->SetState(CControls::STATE_CROUCH, 1);
}
else if (nKey == CApp::KEY_SHIFT)
{
g_Engine.pControls->SetState(CControls::STATE_RUN, 1);
}
return 1;
}
int CGameProcess::KeyRelease(unsigned int nKey)
{
if (nKey == 'w')
{
g_Engine.pControls->SetState(CControls::STATE_RESTORE, 0);
g_Engine.pControls->SetState(CControls::STATE_FORWARD, 0);
}
else if (nKey == 's')
{
g_Engine.pControls->SetState(CControls::STATE_RESTORE, 0);
g_Engine.pControls->SetState(CControls::STATE_BACKWARD, 0);
}
else if (nKey == 'a')
{
g_Engine.pControls->SetState(CControls::STATE_RESTORE, 0);
g_Engine.pControls->SetState(CControls::STATE_MOVE_LEFT, 0);
}
else if (nKey == 'd')
{
g_Engine.pControls->SetState(CControls::STATE_RESTORE, 0);
g_Engine.pControls->SetState(CControls::STATE_MOVE_RIGHT, 0);
}
else if (nKey == 'q')
{
g_Engine.pControls->SetState(CControls::STATE_JUMP, 0);
}
else if (nKey == 'e')
{
g_Engine.pControls->SetState(CControls::STATE_CROUCH, 0);
}
else if (nKey == CApp::KEY_SHIFT)
{
g_Engine.pControls->SetState(CControls::STATE_RUN, 0);
}
return 1;
}
CRoleBase* CGameProcess::GetRole(int nID)
{
for(int i = 0;i < 20;i++)
{
if(m_vAIList[i]->GetRoleID() == nID)
{
return m_vAIList[i];
}
}
return NULL;
}
CRoleBase* CGameProcess::GetRoleFormIndex(int nIndex)
{
return m_vAIList[nIndex];
return NULL;
}
================================================
FILE: Test/GameProcess.h
================================================
#pragma once
#include "MessageBase.h"
#include "SkillSystem.h"
#include "RoleBase.h"
#include "Vector.h"
class CFPSRoleLocal;
class CCameraBase;
class CActorBase;
class CStarControl;
class CRayControl;
class CGameProcess : public CMessageBase
{
public:
CGameProcess(void);
virtual ~CGameProcess(void);
int Init();
int ShutDown();
int Update();
int Render();
CRoleBase* GetRole(int nID);
CRoleBase* GetRoleFormIndex(int nIndex);
public:
static int KeyPress(unsigned int nKey);
static int KeyRelease(unsigned int nKey);
protected:
CFPSRoleLocal* m_pRole;
CSkillSystem* m_pSkillSystem;
CCameraBase* m_pCameraBase;
CStarControl* m_pStarControl;
CRayControl* m_pRayControl;
private:
};
================================================
FILE: Test/HMDWrapper.cpp
================================================
#include "HMDWrapper.h"
#include "interface\DeviceMgrInterface.h"
using namespace MathLib;
class CLocalHMDWrapper : public CHMDWrapper
{
public:
CLocalHMDWrapper();
virtual ~CLocalHMDWrapper();
virtual void Init();
virtual void Update();
virtual void Shutdown();
virtual void SetUseHMD(int u);
virtual int GetUseHMD() const;
virtual const MathLib::vec3 &GetLocalDirection() const;
virtual const MathLib::vec3 &GetLocalUp() const;
private:
int m_nUseHMD;
int m_nHaveHMD;
vec3 m_vLocalDirection;
vec3 m_vLocalUp;
};
CLocalHMDWrapper::CLocalHMDWrapper()
{
m_nUseHMD = 1;
m_nHaveHMD = 0;
m_vLocalDirection = forward_vector;
m_vLocalUp = up_vector;
}
CLocalHMDWrapper::~CLocalHMDWrapper()
{
}
void CLocalHMDWrapper::Init()
{
m_nHaveHMD = Interface::CDeviceInterface::GetInstance()->InitEnv();
}
void CLocalHMDWrapper::Update()
{
if (GetUseHMD())
{
Interface::SEulerAngles sData;
Interface::CDeviceInterface::GetInstance()->GetHMDSensorRotation(sData);
Interface::CDeviceInterface::GetInstance()->Run();
vec3 dir = forward_vector;
vec3 up = up_vector;
quat rotate(-sData.fPitch * RAD2DEG, sData.fRoll * RAD2DEG, sData.fYaw * RAD2DEG);
m_vLocalDirection = rotate * dir;
m_vLocalUp = rotate * up;
}
}
void CLocalHMDWrapper::Shutdown()
{
Interface::CDeviceInterface::GetInstance()->Destroy();
}
void CLocalHMDWrapper::SetUseHMD(int u)
{
m_nUseHMD = u;
}
int CLocalHMDWrapper::GetUseHMD() const
{
return m_nUseHMD && m_nHaveHMD;
}
const MathLib::vec3 & CLocalHMDWrapper::GetLocalDirection() const
{
return m_vLocalDirection;
}
const MathLib::vec3 & CLocalHMDWrapper::GetLocalUp() const
{
return m_vLocalUp;
}
CLocalHMDWrapper LocalHMDWrapper;
CHMDWrapper *g_pHMD = &LocalHMDWrapper;
================================================
FILE: Test/HMDWrapper.h
================================================
#ifndef __HMD_WRAPPER_H__
#define __HMD_WRAPPER_H__
#include "MathLib.h"
class CHMDWrapper
{
public:
CHMDWrapper() {}
virtual ~CHMDWrapper() {}
virtual void Init() = 0;
virtual void Update() = 0;
virtual void Shutdown() = 0;
virtual void SetUseHMD(int u) = 0;
virtual int GetUseHMD() const = 0;
virtual const MathLib::vec3 &GetLocalDirection() const = 0;
virtual const MathLib::vec3 &GetLocalUp() const = 0;
private:
};
extern CHMDWrapper *g_pHMD;
#endif
================================================
FILE: Test/MathLib.h
================================================
#pragma once
//MathLib.h
#ifndef _MATHLIB_
#define _MATHLIB_
//Make some change to check if new branch is created.
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
//------------------------------------------------------------
double integral(double(*f)(double), double a = 0, double b = 1, double tol = 1e-5, long n = 50);
//------------------------------------------------------------
double limit(double(*f)(double), double a = 0, double b = 1, double tol = 1e-5, long n = 1);
//------------------------------------------------------------
double diff(double(*f)(double), double a = 0, double b = 1, double tol = 1e-5, long n = 1);
//------------------------------------------------------------
#define PLOT_WIDTH 60
double plot(double x[], int n, char c = '*');
//------------------------------------------------------------
double fplot(double(*f)(double), double a = 0, double b = 1, int n = 25, char c = '*');
//------------------------------------------------------------
int subset(double *a, int i, int j);
void subsort(double *a, int i, int j);
//------------------------------------------------------------
void shellsort(double *a, int n);
//------------------------------------------------------------
void cmpsort(double *a, int n);
//------------------------------------------------------------
void rollsort(double *a, int n);
//------------------------------------------------------------
int sgn(double x);
int sign(double x);
//------------------------------------------------------------
#define FORMAT_STD 1
#define FORMAT_EXP 0
#define MATHLIB_PI 3.14159265
class complex
{
protected:
double real;
double imag;
double len;
double arg;
public:
complex(double r = 0, double i = 0, int format = FORMAT_STD);
void set(double r = 0, double i = 0, int format = FORMAT_STD);
void output(int format = FORMAT_STD);
void input(int format = FORMAT_STD);
friend void set(complex &c, double r = 0, double i = 0, int format = FORMAT_STD);
friend void output(complex &c, int format = FORMAT_STD);
friend void input(complex &c, int format = FORMAT_STD);
friend ostream & operator <<(ostream &out, complex &c);
friend istream & operator <<(istream &in, complex &c);
double getreal();
double getimag();
double getlen();
double getarg();
operator double() { return sgn(real)*len; }
complex operator ~();
complex operator !();
complex operator -();
complex operator +();
friend complex operator +(const complex &, const complex &);
friend complex operator -(const complex &, const complex &);
friend complex operator *(const complex &, const complex &);
friend complex operator /(const complex &, const complex &);
friend complex operator &(const complex &, const complex &);
friend complex operator |(const complex &, const complex &);
friend complex operator ^(const complex &, const double);
friend complex operator +=(complex &, const complex &);
friend complex operator -=(complex &, const complex &);
friend complex operator *=(complex &, const complex &);
friend complex operator /=(complex &, const complex &);
friend complex operator &=(complex &, const complex &);
friend complex operator |=(complex &, const complex &);
friend complex operator ^=(complex &, const double);
friend int operator ==(const complex &, const complex &);
friend int operator !=(const complex &, const complex &);
friend int operator <(const complex &, const complex &);
friend int operator <=(const complex &, const complex &);
friend int operator >(const complex &, const complex &);
friend int operator >=(const complex &, const complex &);
friend complex exp(const complex &);
friend complex log(const complex &);
friend complex sin(const complex &);
friend complex cos(const complex &);
friend double arg(const complex &);
friend double abs(const complex &);
}
#endif //_MATHLIB_
================================================
FILE: Test/MoveDummy.cpp
================================================
#include "MoveDummy.h"
#include "ObjectDummy.h"
#include "BodyDummy.h"
#include "ShapeCapsule.h"
#include "Utils.h"
#include "Engine.h"
#include "Physics.h"
#include "Game.h"
#include "World.h"
#define MOVE_DUMMY_IFPS (1.0f/100.0f)
#define MOVE_DUMMY_CLAMP 89.9f
#define MOVE_DUMMY_COLLISIONS 1
using namespace MathLib;
CMoveDummy::CMoveDummy() //캯
{
m_pObject = new CObjectDummy(); //һʵ
m_pDummy = new CBodyDummy();
m_pShape = new CShapeCapsule(0.5f, 1.0f);
SetCollisionMask(1);
Clear();
}
CMoveDummy::~CMoveDummy()
{
m_pDummy->SetObject(NULL);
SAFE_DELETE(m_pObject);
SAFE_DELETE(m_pDummy);
}
void CMoveDummy::SetCollision(int c)
{
m_nCollision = c;
}
int CMoveDummy::GetCollision() const
{
return m_nCollision;
}
void CMoveDummy::SetCollisionMask(int m)
{
m_pShape->SetCollisionMask(m);
}
int CMoveDummy::GetCollisionMask() const
{
return m_nCollisionMask;
}
void CMoveDummy::SetGround(int g)
{
m_nGround = g;
}
int CMoveDummy::GetGround() const
{
return m_nGround;
}
void CMoveDummy::SetCeiling(int c)
{
m_nCeiling = c;
}
int CMoveDummy::GetCeiling() const
{
return m_nCeiling;
}
void CMoveDummy::SetPosition(const MathLib::vec3& p)
{
m_vPosition = p;
}
const MathLib::vec3& CMoveDummy::GetPosition() const
{
return m_vPosition;
}
void CMoveDummy::SetCollisionRadius(float radius)
{
if (!Compare(m_pShape->GetRadius(), radius))
{
m_pDummy->SetPreserveTransform(Mat4(Translate(m_vUp * (radius - m_pShape->GetRadius()))) * m_pDummy->GetTransform());
m_pShape->SetRadius(radius);
}
Update_Bounds();
}
float CMoveDummy::GetCollisionRadius() const
{
return m_pShape->GetRadius();
}
void CMoveDummy::SetCollisionHeight(float height)
{
if (!Compare(m_pShape->GetHeight(), height))
{
m_pDummy->SetPreserveTransform(Mat4(Translate(m_vUp * (height - m_pShape->GetHeight()) * 0.5f)) * m_pDummy->GetTransform());
m_pShape->SetHeight(height);
}
Update_Bounds();
}
float CMoveDummy::GetCollisionHeight() const
{
return m_pShape->GetHeight();
}
void CMoveDummy::SetUp(const MathLib::vec3& u)
{
m_vUp = u;
}
const MathLib::vec3& CMoveDummy::GetUp() const
{
return m_vUp;
}
void CMoveDummy::SetEnabled(int e)
{
m_nEnabled = e;
}
float CMoveDummy::GetCollisionHeight() const
{
return m_pShape->GetHeight();
}
void CMoveDummy::SetUp(const MathLib::vec3& u)
{
m_vUp = u;
}
const MathLib::vec3& CMoveDummy::GetUp() const
{
return m_vUp;
}
void CMoveDummy::SetEnabled(int e)
{
m_nEnabled = e;
}
int CMoveDummy::GetEnabled() const
{
return m_nEnabled;
}
void CMoveDummy::SetVelocity(const MathLib::vec3& v)
{
m_vVelocity = v;
}
const MathLib::vec3& CMoveDummy::GetVelocity() const
{
return m_vVelocity;
}
void CMoveDummy::SetMaxVelocity(float v)
{
m_fMaxVelocity = v;
}
float CMoveDummy::GetMaxVelocity() const
{
return m_fMaxVelocity;
}
void CMoveDummy::SetAcceleration(float a)
{
m_fAcceleration = a;
}
float CMoveDummy::GetAcceleration() const
{
return m_fAcceleration;
}
float CMoveDummy::GetMaxThrough() const
{
return m_fMaxThrough;
}
void CMoveDummy::Clear()
{
SetVelocity(vec3_zero);
SetMaxVelocity(2.5f);
SetAcceleration(15.0f);
SetCollision(1);
SetCollisionMask(1);
SetGround(0);
SetCeiling(0);
SetPosition(vec3_zero);
SetUp(vec3(0.0f, 0.0f, 1.0f));
SetEnabled(1);
m_pDummy->SetEnabled(1);
m_pObject->SetBody(NULL);
m_pObject->SetBody(m_pDummy);
m_pShape->SetBody(NULL);
m_pShape->SetBody(m_pDummy);
m_pShape->SetExclusionMask(2);
m_pObject->SetWorldTransform(Get_Body_Transform());
SetCollisionRadius(0.5f);
SetCollisionHeight(1.0f);
SetMaxThrough(0.4f);
m_vecContacts.Clear();
}
int CMoveDummy::Update(float fIfps, const MathLib::vec3& vDirection)
{
return Update(fIfps, vDirection, m_vPosition);
}
int CMoveDummy::Update(float fIfps, const MathLib::vec3& vDirection, const MathLib::vec3& pos)
{
SetPosition(pos);
vec3 vOldPosition = m_vPosition;
float fVVelocity = Dot(m_vVelocity, m_vUp);
float fHVelocity = CMathCore::Sqrt(CMathCore::Abs(m_vVelocity.length2() - fVVelocity*fVVelocity));
m_vVelocity = m_vUp * fVVelocity + vDirection * fHVelocity;
// time
float time = fIfps;// * g_Engine.pPhysics->GetScale();
// penetration tolerance
float penetration = g_Engine.pPhysics->GetPenetrationTolerance();
float penetration_2 = penetration * 2.0f;
// clear collision flags
if (GetCollision())
{
m_nGround = 0;
m_nCeiling = 0;
}
// frozen linear velocity
float frozen_velocity = g_Engine.pPhysics->GetFrozenLinearVelocity();
// movement
do
{
// adaptive time step
float ifps = Min(time, MOVE_DUMMY_IFPS);
time -= ifps;
// integrate velocity
m_vVelocity += vDirection * (m_fAcceleration * ifps);
m_vVelocity += g_Engine.pPhysics->GetGravity() * ifps;
fVVelocity = Dot(m_vVelocity, m_vUp);
fHVelocity = CMathCore::Sqrt(m_vVelocity.length2() - fVVelocity*fVVelocity);
m_vVelocity = m_vUp * fVVelocity + vDirection * m_fMaxVelocity;
}
while (time > EPSILON);
if (GetCollision())
{
int nSurface = -1;
}
Vec3 vStart = m_vPosition + vDirection * GetCollisionRadius() + Vec3(m_vUp * (m_pShape->GetHHeight() + m_pShape->GetRadius()));
Vec3 vEnd = vOldPosition + Vec3(m_vUp * (m_pShape->GetHHeight() + m_pShape->GetRadius()));
CBRObject *p = g_Engine.pWorld->GetIntersection(vStart, vEnd, 2, nSurface);
if (p != NULL)
{
m_vPosition = vOldPosition;
}
// current position
m_pObject->SetWorldTransform(Get_Body_Transform());
for (int j = 0; j < m_vecContacts.Size(); j++)
{
const CShape::Contact &c = m_vecContacts[j];
if (Dot(vDirection, c.normal) < -0.9f)
{
return 0;
}
}
return 1;
}
void CMoveDummy::Update_Bounds()
{
float radius = m_pShape->GetRadius();
float hheight = m_pShape->GetHHeight();
m_BoundBox.Set(vec3(-radius, -radius, 0.0f), vec3(radius, radius, (radius + hheight) * 2.0f));
m_BoundSphere.Set(vec3(0.0f, 0.0f, radius + hheight), radius + hheight);
}
MathLib::Mat4 CMoveDummy::Get_Body_Transform() const
{
Vec3 center = m_vPosition + Vec3(m_vUp * (m_pShape->GetHHeight() + m_pShape->GetRadius()));
return Translate(center);
}
================================================
FILE: Test/MoveDummy.h
================================================
#pragma once
#ifndef __MOVE_DUMMY_H__
#define __MOVE_DUMMY_H__
#include "MathLib.h"
#include "Bounds.h"
#include "Vector.h"
#include "Shape.h"
class CObjectDummy;
class CBodyDummy;
class CShapeCapsule;
class CMoveDummy
{
public:
CMoveDummy();
~CMoveDummy();
void SetCollision(int c);
int GetCollision() const;
void SetCollisionMask(int m);
int GetCollisionMask() const;
void SetGround(int g);
int GetGround() const;
void SetCeiling(int c);
int GetCeiling() const;
void SetPosition(const MathLib::vec3& p);
const MathLib::vec3& GetPosition() const;
void SetCollisionRadius(float radius);
float GetCollisionRadius() const;
void SetCollisionHeight(float height);
float GetCollisionHeight() const;
void SetUp(const MathLib::vec3& u);
const MathLib::vec3& GetUp() const;
void SetEnabled(int e);
int GetEnabled() const;
void SetVelocity(const MathLib::vec3& v);
const MathLib::vec3& GetVelocity() const;
void SetMaxVelocity(float v);
float GetMaxVelocity() const;
void SetAcceleration(float a);
float GetAcceleration() const;
void SetMaxThrough(float d);
float GetMaxThrough() const;
void Clear();
int Update(float fIfps, const MathLib::vec3& vDirection);
int Update(float fIfps, const MathLib::vec3& vDirection, const MathLib::vec3& pos);
private:
void Update_Bounds();
MathLib::Mat4 Get_Body_Transform() const;
private:
int m_nCollision;
int m_nCollisionMask;
int m_nGround;
int m_nCeiling;
CObjectDummy* m_pObject; // dummy object
CBodyDummy* m_pDummy; // dummy body
CShapeCapsule* m_pShape; // collision shape
MathLib::vec3 m_vPosition;
MathLib::vec3 m_vUp;
int m_nEnabled;
MathLib::vec3 m_vVelocity;
float m_fMaxVelocity;
float m_fAcceleration;
float m_fMaxThrough;
CBoundBox m_BoundBox;
CBoundSphere m_BoundSphere;
CVector<CShape::Contact> m_vecContacts;
};
#endif
================================================
FILE: Test/RayControl.cpp
================================================
#include "RayControl.h"
#include "ObjectParticles.h"
#include "Engine.h"
#include "Game.h"
#include "Object.h"
#include "Player.h"
#include "Common.h"
#include "App.h"
CRayControl::CRayControl(void)
{
m_pStarNormal = NULL;
Init();
}
CRayControl::~CRayControl(void)
{
g_Engine.pGame->RemoveNode(m_pStarNormal);
}
int CRayControl::Init()
{
m_pStarNormal = (CObjectParticles*)g_Engine.pGame->LoadNode("data/StarControl/ray_line.node");
if (!m_pStarNormal)
return 0;
m_pStarNormal->GetTracker(TRACKER_CUSTOM)->SetTrackValue(0, 0, vec4(1.0f, 1.0f, 1.0f, 0.5f));
return 1;
}
void CRayControl::Update(const mat4& matTransform, const vec3 & vOffset)
{
m_pStarNormal->SetWorldTransform(matTransform*Translate(vOffset));
}
int CRayControl::isEnable()
{
return m_pStarNormal->IsEnabled();
}
void CRayControl::SetEnable(int nEnable)
{
m_pStarNormal->SetEnabled(nEnable);
}
void CRayControl::SetColor(const vec4& vColor)
{
m_pStarNormal->SetObjectColor(vColor);
}
================================================
FILE: Test/RayControl.h
================================================
#pragma once
#include "MathLib.h"
#include "Singleton.h"
class CObjectParticles;
using namespace MathLib;
class CRayControl : public CSingleton<CRayControl>
{
public:
CRayControl(void);
~CRayControl(void);
public:
int Init();
void Update(const mat4& matTransform, const vec3 & vOffset = vec3_zero);
int isEnable();
void SetEnable(int nEnable);
void SetColor(const vec4& vColor);
protected:
CObjectParticles* m_pStarNormal;
};
================================================
FILE: Test/RoleBase.cpp
================================================
#include "RoleBase.h"
#include "Creature.h"
#include "interface.h"
#include "Action.h"
#include "Utils.h"
#include "NavigationFinder.h"
#include "Engine.h"
#include "World.h"
#include "Object.h"
#include "Avatar.h"
CRoleBase::CRoleBase(void)
{
m_pCreature = NULL;
m_pActionComplete = NULL;
m_nOrceDirection = 0;
m_nMoveing = 0;
m_fMoveSpeed = 6.0f;
m_nMoveToType = 0;
m_nUpdateMove = 1;
}
CRoleBase::~CRoleBase(void)
{
SAFE_DELETE(m_pActionComplete);
SAFE_DELETE(m_pCreature);
SAFE_DELETE(m_pPathFind);
}
//ʼɫ
int CRoleBase::Init(int nRoleID, const char* strCharFile)
{
if (m_pCreature)return 1;
m_nMoveing = 1;
m_nRoleID = nRoleID;
m_pCreature = new CCreature();
m_pActionComplete = MakeInterface(this, &CRoleBase::OnActionMsg);
m_pCreature->SetActionComplete(m_pActionComplete);
m_pCreature->Load(strCharFile);
m_pCreature->SetupBody(1, 0);
m_pCreature->SetPosition(vec3_zero);
m_pCreature->SetDirection(vec3(0.0f, -1.0f, 0.0f));
m_pCreature->SetRoleID(nRoleID);
m_AngleYaw.SetDirection(vec3(0.0f, -1.0f, 0.0f));
m_pPathFind = new CNavigationFinder();
m_pPathFind->SetMode(CNavigationFinder::MODE_PATHFIND_STRAIGHT);
return 1;
}
void CRoleBase::Update(float ifps)
{
if (NULL == m_pCreature)return;
if (m_nUpdateMove)
{
m_AngleYaw.Update(ifps);
UpdateMove(ifps);
m_pCreature->SetDirection(m_AngleYaw.GetForwardDirection(), m_nOrceDirection);
}
m_pCreature->Update();
}
int CRoleBase::OnActionMsg(void* pVoid)
{
_ActionCallback* pInfo = (_ActionCallback*)pVoid;
switch (pInfo->nMsgID)
{
case 0:
{
OnKeyFrame((_ActionCallback_KeyFrame*)pVoid);
}break;
case 1:
{
OnActionComplete((_ActionCallback_Complete*)pVoid);
}break;
}
return 1;
}
//ؼ֡ص
void CRoleBase::OnKeyFrame(_ActionCallback_KeyFrame* pKeyInfo)
{
}//ɻص
void CRoleBase::OnActionComplete(_ActionCallback_Complete* pActInfo)
{
if (NULL == m_pCreature)return;
if (m_nMoveing)
{
m_pCreature->PlayAction("run");
}
else
{
m_pCreature->PlayAction("stand");
}
}
CAction* CRoleBase::PlayAction(const char* szName, int nLoop, float fCorrectingTime /*= 1.0f*/)
{
if (NULL == m_pCreature)return NULL;
if (1 == m_pCreature->PlayAction(szName, nLoop, fCorrectingTime))
{
return m_pCreature->GetNowAction();
}
return NULL;
}
CAction* CRoleBase::OrceAction(const char* szName, int nLoop, float fCorrectingTime /*= 1.0f*/)
{
if (NULL == m_pCreature)return NULL;
if (1 == m_pCreature->OrceAction(szName, nLoop, fCorrectingTime))
{
return m_pCreature->GetNowAction();
}
return NULL;
}
void CRoleBase::SetPosition(const vec3& vPosition, int nOrce /*= 0*/)
{
if (NULL == m_pCreature)return;
m_pCreature->SetPosition(vPosition, nOrce);
}
void CRoleBase::SetDirection(const vec3& vDirection, int nOrce /*= 0*/)
{
if (NULL == m_pCreature)return;
if (m_pCreature->GetNowAction()->GetLockMove() && !nOrce)return;
m_nOrceDirection = nOrce;
m_AngleYaw.SetDirection(vDirection);
}
void CRoleBase::SetDirectionTo(const vec3& vDirection, int nOrce /*= 0*/)
{
if (NULL == m_pCreature)return;
if (m_pCreature->GetNowAction()->GetLockMove() && !nOrce)return;
m_nOrceDirection = nOrce;
m_AngleYaw.SetDestDirection(vDirection);
}
int CRoleBase::MoveTo(const vec3& vPosition)
{
if (NULL == m_pCreature)return -1;
if (m_pCreature->GetNowAction()->GetLockMove())return -1;
m_vStartPathPosition = m_vNowPathPosition = m_pCreature->GetPosition();
m_nMoveing = 1;
m_nMoveToType = 0;
m_vDestPathPosition = vPosition;
m_pCreature->PlayAction("run", 1);
return 1;
}
int CRoleBase::MoveToPath(const vec3& vPosition)
{
if (NULL == m_pCreature)return -1;
if (m_pCreature->GetNowAction()->GetLockMove())return -1;
m_pPathFind->Create(m_pCreature->GetPosition(), vPosition, 0);
if (m_pPathFind->GetReached() || m_pPathFind->GetNumPoints() >= 2)
{
m_nMoveing = 1;
m_nMoveToType = 1;
m_nNowPathPoint = 0;
m_vNowPathPosition = m_pCreature->GetPosition();
m_pCreature->PlayAction("run", 1);
return 1;
}
return 0;
}
void CRoleBase::StopMove()
{
m_nMoveing = 0;
m_pCreature->PlayAction("stand", 1);
}
void CRoleBase::StopMove(const vec3& vPosition)
{
m_nMoveing = 0;
SetPosition(vPosition, 1);
m_pCreature->PlayAction("stand", 1);
}
void CRoleBase::UpdateMove(float ifps)
{
if (!m_nMoveing)return;
vec3 vDir = vec3(0.0f, 1.0f, 0.0f);
if (m_nMoveToType == 0)
{
vDir = (m_vDestPathPosition - m_vStartPathPosition).normalize();
m_vNowPathPosition += vDir * m_fMoveSpeed * ifps;
MathLib::vec3 d = (m_vDestPathPosition - m_vNowPathPosition);
d.z = 0.0f;
int bTest = MathLib::Dot(d.normalize(), vec3(vDir.x, vDir.y, 0.0f)) < 0.0f;
if (bTest || vDir.z >= 0.95f)
{
if (bTest && d.length() > 0.10f)
{
m_vNowPathPosition = m_vDestPathPosition;
}
StopMove();
}
}
}
================================================
FILE: Test/RoleBase.h
================================================
#pragma once
#include "MathLib.h"
#include "UtilStr.h"
class CCreature;
class CAction;
class CInterfaceBase;
class CNavigationFinder;
struct _ActionCallback_KeyFrame;
struct _ActionCallback_Complete;
class CNode;
class CRoleBase
{
public:
CRoleBase(void);
virtual ~CRoleBase(void);
virtual int Init(int nRoleID, const char* strCharFile);
virtual void Update(float ifps);
int GetRoleID() { return m_nRoleID; }
void SetRoleID(int nID) { m_nRoleID = nID; }
CAction* PlayAction(const char* szName, int nLoop = 0, float fCorrectingTime = 1.0f);
CAction* OrceAction(const char* szName, int nLoop = 0, float fCorrectingTime = 1.0f);
void SetPosition(const vec3& vPosition, int nOrce = 0);
void SetDirection(const vec3& vDirection, int nOrce = 0);
void SetDirectionTo(const vec3& vDirection, int nOrce = 0);
virtual int MoveTo(const vec3& vPosition);
virtual int MoveToPath(const vec3& vPosition);
virtual void StopMove();
virtual void StopMove(const vec3& vPosition);
int IsMoveing() { return m_nMoveing; }
vec3 GetDirection();
vec3 GetPosition();
float GetRoleRadius();
float GetRoleHeight();
protected:
void UpdateMove(float ifps);
vec3 TestRoleZ(vec3& vPosition);
CNode* GetAssemblyNode(const CUtilStr& strAssembly);
CNode* GetAssemblyNode(int nAssembly);
CCreature* m_pCreature;
int m_nRoleID;
int m_nOrceDirection;
CAngleYaw m_AngleYaw;
CNavigationFinder* m_pPathFind;
int m_nMoveing;
int m_nMoveToType;
float m_fMoveSpeed;
int m_nNowPathPoint;
vec3 m_vNowPathPosition;
vec3 m_vStartPathPosition;
vec3 m_vDestPathPosition;
int m_nUpdateMove;
protected:
CInterfaceBase* m_pActionComplete;
int OnActionMsg(void* pVoid);
virtual void OnKeyFrame(_ActionCallback_KeyFrame* pKeyInfo);
virtual void OnActionComplete(_ActionCallback_Complete* pActInfo);
};
================================================
FILE: Test/Test.vcxproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClInclude Include="ActorBash.h" />
<ClInclude Include="CameraBash.h" />
<ClInclude Include="Common.h" />
<ClInclude Include="FPSRole.h" />
<ClInclude Include="FPSRoleLocal.h" />
<ClInclude Include="GameMain.h" />
<ClInclude Include="GameProcess.h" />
<ClInclude Include="HMDWrapper.h" />
<ClInclude Include="main.h" />
<ClInclude Include="MathLib.h" />
<ClInclude Include="MoveDummy.h" />
<ClInclude Include="RayControl.h" />
<ClInclude Include="RoleBase.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="ActorBash.cpp" />
<ClCompile Include="CameraBash.cpp" />
<ClCompile Include="Common.cpp" />
<ClCompile Include="FPSRole.cpp" />
<ClCompile Include="FPSRoleLocal.cpp" />
<ClCompile Include="GameMain.cpp" />
<ClCompile Include="GameProcess.cpp" />
<ClCompile Include="HMDWrapper.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="MoveDummy.cpp" />
<ClCompile Include="RayControl.cpp" />
<ClCompile Include="RoleBase.cpp" />
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{C944C3E9-7AD8-4117-B664-DBE932214E45}</ProjectGuid>
<RootNamespace>Test</RootNamespace>
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
================================================
FILE: Test/main.cpp
================================================
#include "Engine.h"
#include "interface.h"
#include "GameMain.h"
#include "Console.h"
#include "direct.h"
#include "HMDWrapper.h"
#include "EngineConsole.h"
#include "FileSystem.h"
int main(int argc, char* argv[])
{
#ifdef USE_HMD
g_pHMD->Init();
int useHmd = g_pHMD->GetUseHMD();
if (useHmd)
{
//ͷ3d
render_stereo = 2;
//Զ崰ڷֱ ͷֱһֱ
video_mode = -1;
video_width = 2160;
video_height = 1200;
// ȫʽ 0 1ȫ
video_fullscreen = 0;
video_resizable = 0;
video_vsync = 0;
}
else
{
//ͷ
render_stereo = 0;
//Զ崰ڷֱ
video_mode = -1;
video_fullscreen = 0;
video_width = 1280;
video_height = 720;
video_resizable = 0;
video_vsync = 0;
}
#else
render_stereo = 0;
video_mode = -1;
video_fullscreen = 0;
video_width = 1280;
video_height = 720;
video_resizable = 0;
video_vsync = 0;
#endif
char pAppPath[260];
getcwd(pAppPath, 260);
strcat(pAppPath, "\\");
CGameMain t_Game;
CInterfaceBase *pInit = MakeInterface(&t_Game, &CGameMain::Init);
CInterfaceBase *pUpdate = MakeInterface(&t_Game, &CGameMain::Update);
CInterfaceBase *pShutdown = MakeInterface(&t_Game, &CGameMain::ShutDown);
CInterfaceBase *pRender = MakeInterface(&t_Game, &CGameMain::Render);
char *pArg[3] = { NULL, "-engine_config", "data/TestProject.cfg" };
g_Engine.pEngine = new CEngine(NULL, pAppPath, NULL, NULL, 3, pArg, NULL, "1123581321", pInit);
//1. 2.· 3. 4. 5. 6.һָָ,涨Ǹ 7. 8. 9.һָ
//CEngine(CApp *pApp, const char *pAppPath, void *pExternalWindow, const char *pHomePath, int argc, char **argv, const char *pProject, const char *pPassword, CInterfaceBase *pInitInterface);
g_Engine.pEngine->SetUpdateInterface(pUpdate);
g_Engine.pEngine->SetShutdownInterface(pShutdown);
g_Engine.pEngine->SetRenderInterface(pRender);
while (g_Engine.pEngine->IsDone() == 0) //isDone
{
#ifdef USE_HMD
g_pHMD->Update();
#endif
g_Engine.pEngine->DoUpdate();
g_Engine.pEngine->DoRender();
g_Engine.pEngine->DoSwap();
}
delete g_Engine.pEngine;
g_Engine.pEngine = NULL;
#ifdef USE_HMD
g_pHMD->Shutdown();
#endif
//return 1;
return 0;
}
================================================
FILE: Test/main.h
================================================
#pragma once
#include <cstdio>
int main(void)
{
return 0;
}
================================================
FILE: fpsgame/CommonConvert.cpp
================================================
#include "precompiled.h"
#include "CommonConvert.h"
#include "StdSkeletons.h"
#include <algorithm>
#include <cassert>
void require_(int line, bool value, const char* type, const char* message)
{
if (value) return;
char linestr[16];
sprintf(linestr, "%d", line);
throw ColladaException(std::string(type) + " (line " + linestr + "): " + message);
}
const FMVector3 FMVector3_XAxis(1.0f, 0.0f, 0.0f);
static float identity[] = { 1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1 };
FMMatrix44 FMMatrix44_Identity(identity);
/** Error handler for libxml2 */
void errorHandler(void* ctx, const char* msg, ...)
{
char buffer[1024];
va_list ap;
va_start(ap, msg);
vsnprintf(buffer, sizeof(buffer), msg, ap);
buffer[sizeof(buffer) - 1] = '\0';
va_end(ap);
*((std::string*)ctx) += buffer;
}
FColladaErrorHandler::FColladaErrorHandler(std::string& xmlErrors_)
: xmlErrors(xmlErrors_)
{
// Grab all the error output from libxml2, for useful error reporting
xmlSetGenericErrorFunc(&xmlErrors, &errorHandler);
FUError::AddErrorCallback(FUError::DEBUG_LEVEL, this, &FColladaErrorHandler::OnError);
FUError::AddErrorCallback(FUError::WARNING_LEVEL, this, &FColladaErrorHandler::OnError);
FUError::AddErrorCallback(FUError::ERROR_LEVEL, this, &FColladaErrorHandler::OnError);
}
CommonConvert::~CommonConvert()
{
}
FColladaErrorHandler::~FColladaErrorHandler()
{
xmlSetGenericErrorFunc(NULL, NULL);
FUError::RemoveErrorCallback(FUError::DEBUG_LEVEL, this, &FColladaErrorHandler::OnError);
FUError::RemoveErrorCallback(FUError::WARNING_LEVEL, this, &FColladaErrorHandler::OnError);
FUError::RemoveErrorCallback(FUError::ERROR_LEVEL, this, &FColladaErrorHandler::OnError);
}
void FColladaErrorHandler::OnError(FUError::Level errorLevel, uint32 errorCode, uint32 UNUSED(lineNumber))
{
// Ignore warnings about missing materials, since we ignore materials entirely anyway
if (errorCode == FUError::WARNING_INVALID_POLYGON_MAT_SYMBOL)
return;
const char* errorString = FUError::GetErrorString((FUError::Code) errorCode);
if (!errorString)
errorString = "Unknown error code";
if (errorLevel == FUError::DEBUG_LEVEL)
Log(LOG_INFO, "FCollada %d: %s", errorCode, errorString);
else if (errorLevel == FUError::WARNING_LEVEL)
Log(LOG_WARNING, "FCollada %d: %s", errorCode, errorString);
else
throw ColladaException(errorString);
}
//////////////////////////////////////////////////////////////////////////
void FColladaDocument::LoadFromText(const char *text)
{
document.reset(FCollada::NewTopDocument());
const char* newText = NULL;
size_t newTextSize = 0;
FixBrokenXML(text, &newText, &newTextSize);
// Log(LOG_INFO, "%s", newText);
bool status = FCollada::LoadDocumentFromMemory("unknown.dae", document.get(), (void*)newText, newTextSize);
if (newText != text)
xmlFree((void*)newText);
REQUIRE_SUCCESS(status);
}
void FColladaDocument::ReadExtras(xmlNode* UNUSED(colladaNode))
{
// TODO: This was needed to recognise and load XSI models.
// XSI support should be reintroduced some time, but this function
// may not be necessary since FCollada might now provide access to the
// 'extra' data via a proper API.
/*
if (! IsEquivalent(colladaNode->name, DAE_COLLADA_ELEMENT))
return;
extra.reset(new FCDExtra(document.get()));
xmlNodeList extraNodes;
FUXmlParser::FindChildrenByType(colladaNode, DAE_EXTRA_ELEMENT, extraNodes);
for (xmlNodeList::iterator it = extraNodes.begin(); it != extraNodes.end(); ++it)
{
xmlNode* extraNode = (*it);
extra->LoadFromXML(extraNode);
}
*/
}
//////////////////////////////////////////////////////////////////////////
CommonConvert::CommonConvert(const char* text, std::string& xmlErrors)
: m_Err(xmlErrors)
{
m_Doc.LoadFromText(text);
FCDSceneNode* root = m_Doc.GetDocument()->GetVisualSceneRoot();
REQUIRE(root != NULL, "has root object");
// Find the instance to convert
if (!FindSingleInstance(root, m_Instance, m_EntityTransform))
throw ColladaException("Couldn't find object to convert");
assert(m_Instance);
Log(LOG_INFO, "Converting '%s'", m_Instance->GetEntity()->GetName().c_str());
m_IsXSI = false;
FCDAsset* asset = m_Doc.GetDocument()->GetAsset();
if (asset && asset->GetContributorCount() >= 1)
{
std::string tool(asset->GetContributor(0)->GetAuthoringTool());
if (tool.find("XSI") != tool.npos)
m_IsXSI = true;
}
FMVector3 upAxis = m_Doc.GetDocument()->GetAsset()->GetUpAxis();
m_YUp = (upAxis.y != 0); // assume either Y_UP or Z_UP (TODO: does anyone ever do X_UP?)
}
// CommonConvert::~CommonConvert()
// {
// }
//////////////////////////////////////////////////////////////////////////
// HACK: The originals don't get exported properly from FCollada (3.02, DLL), so define
// them here instead of fixing it correctly.
const FMVector3 FMVector3_XAxis(1.0f, 0.0f, 0.0f);
static float identity[] = { 1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1 };
FMMatrix44 FMMatrix44_Identity(identity);
struct FoundInstance
{
FCDEntityInstance* instance;
FMMatrix44 transform;
};
static bool IsVisible_XSI(FCDSceneNode* node, bool& visible)
{
// Look for <extra><technique profile="XSI"><SI_Visibility><xsi_param sid="visibility">
FCDExtra* extra = node->GetExtra();
if (!extra) return false;
FCDEType* type = extra->GetDefaultType();
if (!type) return false;
FCDETechnique* technique = type->FindTechnique("XSI");
if (!technique) return false;
FCDENode* visibility1 = technique->FindChildNode("SI_Visibility");
if (!visibility1) return false;
FCDENode* visibility2 = visibility1->FindChildNode("xsi_param");
if (!visibility2) return false;
if (IsEquivalent(visibility2->GetContent(), "TRUE"))
visible = true;
else if (IsEquivalent(visibility2->GetContent(), "FALSE"))
visible = false;
return true;
}
static bool IsVisible(FCDSceneNode* node)
{
bool visible = false;
// Try the XSI visibility property
if (IsVisible_XSI(node, visible))
return visible;
// Else fall back to the FCollada-specific setting
visible = (node->GetVisibility() != 0.0);
return visible;
}
/**
* Recursively finds all entities under the current node. If onlyMarked is
* set, only matches entities where the user-defined property was set to
* "export" in the modelling program.
*
* @param node root of subtree to search
* @param instances output - appends matching entities
* @param transform transform matrix of current subtree
* @param onlyMarked only match entities with "export" property
*/
static void FindInstances(FCDSceneNode* node, std::vector<FoundInstance>& instances, const FMMatrix44& transform, bool onlyMarked)
{
for (size_t i = 0; i < node->GetChildrenCount(); ++i)
{
FCDSceneNode* child = node->GetChild(i);
FindInstances(child, instances, transform * node->ToMatrix(), onlyMarked);
}
for (size_t i = 0; i < node->GetInstanceCount(); ++i)
{
if (onlyMarked)
{
if (node->GetNote() != "export")
continue;
}
// Only accept instances of appropriate types, and not e.g. lights
FCDEntity::Type type = node->GetInstance(i)->GetEntityType();
if (!(type == FCDEntity::GEOMETRY || type == FCDEntity::CONTROLLER))
continue;
// Ignore invisible objects, because presumably nobody wanted to export them
if (!IsVisible(node))
continue;
FoundInstance f;
f.transform = transform * node->ToMatrix();
f.instance = node->GetInstance(i);
instances.push_back(f);
Log(LOG_INFO, "Found convertible object '%s'", node->GetName().c_str());
}
}
bool FindSingleInstance(FCDSceneNode* node, FCDEntityInstance*& instance, FMMatrix44& transform)
{
std::vector<FoundInstance> instances;
FindInstances(node, instances, FMMatrix44_Identity, true);
if (instances.size() > 1)
{
Log(LOG_ERROR, "Found too many export-marked objects");
return false;
}
if (instances.empty())
{
FindInstances(node, instances, FMMatrix44_Identity, false);
if (instances.size() > 1)
{
Log(LOG_ERROR, "Found too many possible objects to convert - try adding the 'export' property to disambiguate one");
return false;
}
if (instances.empty())
{
Log(LOG_ERROR, "Didn't find any objects in the scene");
return false;
}
}
assert(instances.size() == 1); // if we got this far
instance = instances[0].instance;
transform = instances[0].transform;
return true;
}
//////////////////////////////////////////////////////////////////////////
static bool ReverseSortWeight(const FCDJointWeightPair& a, const FCDJointWeightPair& b)
{
return (a.weight > b.weight);
}
void SkinReduceInfluences(FCDSkinController* skin, size_t maxInfluenceCount, float minimumWeight)
{
// Approximately equivalent to:
// skin->ReduceInfluences(maxInfluenceCount, minimumWeight);
// except this version merges multiple weights for the same joint
for (size_t i = 0; i < skin->GetInfluenceCount(); ++i)
{
FCDSkinControllerVertex& influence = *skin->GetVertexInfluence(i);
std::vector<FCDJointWeightPair> newWeights;
for (size_t i = 0; i < influence.GetPairCount(); ++i)
{
FCDJointWeightPair* weight = influence.GetPair(i);
for (size_t j = 0; j < newWeights.size(); ++j)
{
FCDJointWeightPair& newWeight = newWeights[j];
if (weight->jointIndex == newWeight.jointIndex)
{
newWeight.weight += weight->weight;
goto MERGED_WEIGHTS;
}
}
newWeights.push_back(*weight);
MERGED_WEIGHTS:;
}
// Put highest-weighted influences at the front of the list
std::sort(newWeights.begin(), newWeights.end(), ReverseSortWeight);
// Limit the maximum number of influences
if (newWeights.size() > maxInfluenceCount)
newWeights.resize(maxInfluenceCount);
// Enforce the minimum weight per influence
// (This is done here rather than in the earlier loop, because several
// small weights for the same bone might add up to a value above the
// threshold)
while (!newWeights.empty() && newWeights.back().weight < minimumWeight)
newWeights.pop_back();
// Renormalise, so sum(weights)=1
float totalWeight = 0;
for (std::vector<FCDJointWeightPair>::iterator itNW = newWeights.begin(); itNW != newWeights.end(); ++itNW)
totalWeight += itNW->weight;
for (std::vector<FCDJointWeightPair>::iterator itNW = newWeights.begin(); itNW != newWeights.end(); ++itNW)
itNW->weight /= totalWeight;
// Copy new weights into the skin
influence.SetPairCount(0);
for (std::vector<FCDJointWeightPair>::iterator itNW = newWeights.begin(); itNW != newWeights.end(); ++itNW)
influence.AddPair(itNW->jointIndex, itNW->weight);
}
skin->SetDirtyFlag();
}
void FixSkeletonRoots(FCDControllerInstance& UNUSED(controllerInstance))
{
// TODO: Need to reintroduce XSI support at some point
#if 0
// HACK: The XSI exporter doesn't do a <skeleton> and FCollada doesn't
// seem to know where else to look, so just guess that it's somewhere
// under Scene_Root
if (controllerInstance.GetSkeletonRoots().empty())
{
// HACK (evil): SetSkeletonRoot is declared but not defined, and there's
// no other proper way to modify the skeleton-roots list, so cheat horribly
FUUriList& uriList = const_cast<FUUriList&>(controllerInstance.GetSkeletonRoots());
uriList.push_back(FUUri("Scene_Root"));
controllerInstance.LinkImport();
}
#endif
}
const Skeleton& FindSkeleton(const FCDControllerInstance& controllerInstance)
{
// I can't see any proper way to determine the real root of the skeleton,
// so just choose an arbitrary bone and search upwards until we find a
// recognised ancestor (or until we fall off the top of the tree)
const Skeleton* skeleton = NULL;
const FCDSceneNode* joint = controllerInstance.GetJoint(0);
while (joint && (skeleton = Skeleton::FindSkeleton(joint->GetName().c_str())) == NULL)
{
joint = joint->GetParent();
}
REQUIRE(skeleton != NULL, "recognised skeleton structure");
return *skeleton;
}
void TransformBones(std::vector<BoneTransform>& bones, const FMMatrix44& scaleTransform, bool yUp)
{
for (size_t i = 0; i < bones.size(); ++i)
{
// Apply the desired transformation to the bone coordinates
FMVector3 trans(bones[i].translation, 0);
trans = scaleTransform.TransformCoordinate(trans);
bones[i].translation[0] = trans.x;
bones[i].translation[1] = trans.y;
bones[i].translation[2] = trans.z;
// DON'T apply the transformation to orientation, because I can't get
// that kind of thing to work in practice (interacting nicely between
// the models and animations), so this function assumes the transform
// just does scaling, so there's no need to rotate anything. (But I think
// this code would work for rotation, though not very efficiently.)
/*
FMMatrix44 m = FMQuaternion(bones[i].orientation[0], bones[i].orientation[1], bones[i].orientation[2], bones[i].orientation[3]).ToMatrix();
m *= scaleTransform;
HMatrix matrix;
memcpy(matrix, m.Transposed().m, sizeof(matrix));
AffineParts parts;
decomp_affine(matrix, &parts);
bones[i].orientation[0] = parts.q.x;
bones[i].orientation[1] = parts.q.y;
bones[i].orientation[2] = parts.q.z;
bones[i].orientation[3] = parts.q.w;
*/
if (yUp)
{
// TODO: this is all just guesses which seem to work for data
// exported from XSI, rather than having been properly thought
// through
bones[i].translation[2] = -bones[i].translation[2];
bones[i].orientation[2] = -bones[i].orientation[2];
bones[i].orientation[3] = -bones[i].orientation[3];
}
else
{
// Convert bone translations from xyz into xzy axes:
std::swap(bones[i].translation[1], bones[i].translation[2]);
// To convert the quaternions: imagine you're using the axis/angle
// representation, then swap the y,z basis vectors and change the
// direction of rotation by negating the angle ( => negating sin(angle)
// => negating x,y,z => changing (x,y,z,w) to (-x,-z,-y,w)
// but then (-x,-z,-y,w) == (x,z,y,-w) so do that instead)
std::swap(bones[i].orientation[1], bones[i].orientation[2]);
bones[i].orientation[3] = -bones[i].orientation[3];
}
}
}
================================================
FILE: fpsgame/CommonConvert.h
================================================
#pragma once
#ifndef INCLUDED_COMMONCONVERT
#define INCLUDED_COMMONCONVERT
#include <exception>
#include <string>
#include <memory>
#include <vector>
class Skeleton;
struct OutputCB
{
virtual ~OutputCB()
{
}
virtual void operator() (const char* data, unsigned int length) = 0;
};
class ColladaException : public std::exception
{
private:
std::string msg;
public:
ColladaException(const std::string& msg) :msg(msg)
{
}
~ColladaException()
throw()
{
}
};
/**
* Standard error handler - logs FCollada messages using Log(), and also
* maintains a list of XML parser errors.
*/
class FoclladaErrorHandler
{
private:
void OnError(FUError::Level errorLevel, uint32 errorCode, uint32 lineNumber);
std::string& xmlErrors;
void operator=(FColladaErrorHandler);
public:
FoclladaErrorHandler(std::string& xmlErrors);
~FoclladaErrorHandler();
};
/**
* Standard document loader. Based on FCDocument::LoadFromText, but allows
* access to \<extra\> nodes at the document level (i.e. directly in \<COLLADA\>).
*/
class FColladaDocument
{
public:
void LoadFromText(const char* text);
/** Returns the FCDocument that was loaded. */
FCDocument* GetDocument() const { return document.get(); }
/** Returns the \<extra\> data from the \<COLLADA\> element. */
FCDExtra* GetExtra() const { return extra.get(); }
private:
void ReadExtras(xmlNode* colladaNode);
std::unique_ptr<FCDocument> document;
std::unique_ptr<FCDExtra> extra;
};
#endif
================================================
FILE: fpsgame/Decompose.cpp
================================================
/* Copyright (C) 2015 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* 0 A.D. is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
*/
#include "precompiled.h"
#ifdef _MSC_VER
# pragma warning(disable: 4244 4305 4127 4701)
#endif
/**** Decompose.c ****/
/* Ken Shoemake, 1993 */
#include <math.h>
#include "Decompose.h"
/******* Matrix Preliminaries *******/
/** Fill out 3x3 matrix to 4x4 **/
#define mat_pad(A) (A[W][X]=A[X][W]=A[W][Y]=A[Y][W]=A[W][Z]=A[Z][W]=0,A[W][W]=1)
/** Copy nxn matrix A to C using "gets" for assignment **/
#define mat_copy(C,gets,A,n) {int i,j; for(i=0;i<n;i++) for(j=0;j<n;j++)\
C[i][j] gets (A[i][j]);}
/** Copy transpose of nxn matrix A to C using "gets" for assignment **/
#define mat_tpose(AT,gets,A,n) {int i,j; for(i=0;i<n;i++) for(j=0;j<n;j++)\
AT[i][j] gets (A[j][i]);}
/** Assign nxn matrix C the element-wise combination of A and B using "op" **/
#define mat_binop(C,gets,A,op,B,n) {int i,j; for(i=0;i<n;i++) for(j=0;j<n;j++)\
C[i][j] gets (A[i][j]) op (B[i][j]);}
/** Multiply the upper left 3x3 parts of A and B to get AB **/
void mat_mult(HMatrix A, HMatrix B, HMatrix AB)
{
int i, j;
for (i=0; i<3; i++) for (j=0; j<3; j++)
AB[i][j] = A[i][0]*B[0][j] + A[i][1]*B[1][j] + A[i][2]*B[2][j];
}
/** Return dot product of length 3 vectors va and vb **/
float vdot(float *va, float *vb)
{
return (va[0]*vb[0] + va[1]*vb[1] + va[2]*vb[2]);
}
/** Set v to cross product of length 3 vectors va and vb **/
void vcross(float *va, float *vb, float *v)
{
v[0] = va[1]*vb[2] - va[2]*vb[1];
v[1] = va[2]*vb[0] - va[0]*vb[2];
v[2] = va[0]*vb[1] - va[1]*vb[0];
}
/** Set MadjT to transpose of inverse of M times determinant of M **/
void adjoint_transpose(HMatrix M, HMatrix MadjT)
{
vcross(M[1], M[2], MadjT[0]);
vcross(M[2], M[0], MadjT[1]);
vcross(M[0], M[1], MadjT[2]);
}
/******* Quaternion Preliminaries *******/
/* Construct a (possibly non-unit) quaternion from real components. */
Quat Qt_(float x, float y, float z, float w)
{
Quat qq;
qq.x = x; qq.y = y; qq.z = z; qq.w = w;
return (qq);
}
/* Return conjugate of quaternion. */
Quat Qt_Conj(Quat q)
{
Quat qq;
qq.x = -q.x; qq.y = -q.y; qq.z = -q.z; qq.w = q.w;
return (qq);
}
/* Return quaternion product qL * qR. Note: order is important!
* To combine rotations, use the product Mul(qSecond, qFirst),
* which gives the effect of rotating by qFirst then qSecond. */
Quat Qt_Mul(Quat qL, Quat qR)
{
Quat qq;
qq.w = qL.w*qR.w - qL.x*qR.x - qL.y*qR.y - qL.z*qR.z;
qq.x = qL.w*qR.x + qL.x*qR.w + qL.y*qR.z - qL.z*qR.y;
qq.y = qL.w*qR.y + qL.y*qR.w + qL.z*qR.x - qL.x*qR.z;
qq.z = qL.w*qR.z + qL.z*qR.w + qL.x*qR.y - qL.y*qR.x;
return (qq);
}
/* Return product of quaternion q by scalar w. */
Quat Qt_Scale(Quat q, float w)
{
Quat qq;
qq.w = q.w*w; qq.x = q.x*w; qq.y = q.y*w; qq.z = q.z*w;
return (qq);
}
/* Construct a unit quaternion from rotation matrix. Assumes matrix is
* used to multiply column vector on the left: vnew = mat vold. Works
* correctly for right-handed coordinate system and right-handed rotations.
* Translation and perspective components ignored. */
Quat Qt_FromMatrix(HMatrix mat)
{
/* This algorithm avoids near-zero divides by looking for a large component
* - first w, then x, y, or z. When the trace is greater than zero,
* |w| is greater than 1/2, which is as small as a largest component can be.
* Otherwise, the largest diagonal entry corresponds to the largest of |x|,
* |y|, or |z|, one of which must be larger than |w|, and at least 1/2. */
Quat qu;
double tr, s;
tr = mat[X][X] + mat[Y][Y]+ mat[Z][Z];
if (tr >= 0.0) {
s = sqrt(tr + mat[W][W]);
qu.w = s*0.5;
s = 0.5 / s;
qu.x = (mat[Z][Y] - mat[Y][Z]) * s;
qu.y = (mat[X][Z] - mat[Z][X]) * s;
qu.z = (mat[Y][X] - mat[X][Y]) * s;
} else {
int h = X;
if (mat[Y][Y] > mat[X][X]) h = Y;
if (mat[Z][Z] > mat[h][h]) h = Z;
switch (h) {
#define caseMacro(i,j,k,I,J,K) \
case I:\
s = sqrt( (mat[I][I] - (mat[J][J]+mat[K][K])) + mat[W][W] );\
qu.i = s*0.5;\
s = 0.5 / s;\
qu.j = (mat[I][J] + mat[J][I]) * s;\
qu.k = (mat[K][I] + mat[I][K]) * s;\
qu.w = (mat[K][J] - mat[J][K]) * s;\
break
caseMacro(x,y,z,X,Y,Z);
caseMacro(y,z,x,Y,Z,X);
caseMacro(z,x,y,Z,X,Y);
}
}
if (mat[W][W] != 1.0) qu = Qt_Scale(qu, 1/sqrt(mat[W][W]));
return (qu);
}
/******* Decomp Auxiliaries *******/
static HMatrix mat_id = {{1,0,0,0},{0,1,0,0},{0,0,1,0},{0,0,0,1}};
/** Compute either the 1 or infinity norm of M, depending on tpose **/
float mat_norm(HMatrix M, int tpose)
{
int i;
float sum, max;
max = 0.0;
for (i=0; i<3; i++) {
if (tpose) sum = fabs(M[0][i])+fabs(M[1][i])+fabs(M[2][i]);
else sum = fabs(M[i][0])+fabs(M[i][1])+fabs(M[i][2]);
if (max<sum) max = sum;
}
return max;
}
float norm_inf(HMatrix M) {return mat_norm(M, 0);}
float norm_one(HMatrix M) {return mat_norm(M, 1);}
/** Return index of column of M containing maximum abs entry, or -1 if M=0 **/
int find_max_col(HMatrix M)
{
float abs, max;
int i, j, col;
max = 0.0; col = -1;
for (i=0; i<3; i++) for (j=0; j<3; j++) {
abs = M[i][j]; if (abs<0.0) abs = -abs;
if (abs>max) {max = abs; col = j;}
}
return col;
}
/** Setup u for Household reflection to zero all v components but first **/
void make_reflector(float *v, float *u)
{
float s = sqrt(vdot(v, v));
u[0] = v[0]; u[1] = v[1];
u[2] = v[2] + ((v[2]<0.0) ? -s : s);
s = sqrt(2.0/vdot(u, u));
u[0] = u[0]*s; u[1] = u[1]*s; u[2] = u[2]*s;
}
/** Apply Householder reflection represented by u to column vectors of M **/
void reflect_cols(HMatrix M, float *u)
{
int i, j;
for (i=0; i<3; i++) {
float s = u[0]*M[0][i] + u[1]*M[1][i] + u[2]*M[2][i];
for (j=0; j<3; j++) M[j][i] -= u[j]*s;
}
}
/** Apply Householder reflection represented by u to row vectors of M **/
void reflect_rows(HMatrix M, float *u)
{
int i, j;
for (i=0; i<3; i++) {
float s = vdot(u, M[i]);
for (j=0; j<3; j++) M[i][j] -= u[j]*s;
}
}
/** Find orthogonal factor Q of rank 1 (or less) M **/
void do_rank1(HMatrix M, HMatrix Q)
{
float v1[3], v2[3], s;
int col;
mat_copy(Q,=,mat_id,4);
/* If rank(M) is 1, we should find a non-zero column in M */
col = find_max_col(M);
if (col<0) return; /* Rank is 0 */
v1[0] = M[0][col]; v1[1] = M[1][col]; v1[2] = M[2][col];
make_reflector(v1, v1); reflect_cols(M, v1);
v2[0] = M[2][0]; v2[1] = M[2][1]; v2[2] = M[2][2];
make_reflector(v2, v2); reflect_rows(M, v2);
s = M[2][2];
if (s<0.0) Q[2][2] = -1.0;
reflect_cols(Q, v1); reflect_rows(Q, v2);
}
/** Find orthogonal factor Q of rank 2 (or less) M using adjoint transpose **/
void do_rank2(HMatrix M, HMatrix MadjT, HMatrix Q)
{
float v1[3], v2[3];
float w, x, y, z, c, s, d;
int col;
/* If rank(M) is 2, we should find a non-zero column in MadjT */
col = find_max_col(MadjT);
if (col<0) {do_rank1(M, Q); return;} /* Rank<2 */
v1[0] = MadjT[0][col]; v1[1] = MadjT[1][col]; v1[2] = MadjT[2][col];
make_reflector(v1, v1); reflect_cols(M, v1);
vcross(M[0], M[1], v2);
make_reflector(v2, v2); reflect_rows(M, v2);
w = M[0][0]; x = M[0][1]; y = M[1][0]; z = M[1][1];
if (w*z>x*y) {
c = z+w; s = y-x; d = sqrt(c*c+s*s); c = c/d; s = s/d;
Q[0][0] = Q[1][1] = c; Q[0][1] = -(Q[1][0] = s);
} else {
c = z-w; s = y+x; d = sqrt(c*c+s*s); c = c/d; s = s/d;
Q[0][0] = -(Q[1][1] = c); Q[0][1] = Q[1][0] = s;
}
Q[0][2] = Q[2][0] = Q[1][2] = Q[2][1] = 0.0; Q[2][2] = 1.0;
reflect_cols(Q, v1); reflect_rows(Q, v2);
}
/******* Polar Decomposition *******/
/* Polar Decomposition of 3x3 matrix in 4x4,
* M = QS. See Nicholas Higham and Robert S. Schreiber,
* Fast Polar Decomposition of An Arbitrary Matrix,
* Technical Report 88-942, October 1988,
* Department of Computer Science, Cornell University.
*/
float polar_decomp(HMatrix M, HMatrix Q, HMatrix S)
{
#define TOL 1.0e-6
HMatrix Mk, MadjTk, Ek;
float det, M_one, M_inf, MadjT_one, MadjT_inf, E_one, gamma, g1, g2;
int i, j;
mat_tpose(Mk,=,M,3);
M_one = norm_one(Mk); M_inf = norm_inf(Mk);
do {
adjoint_transpose(Mk, MadjTk);
det = vdot(Mk[0], MadjTk[0]);
if (det==0.0) {do_rank2(Mk, MadjTk, Mk); break;}
MadjT_one = norm_one(MadjTk); MadjT_inf = norm_inf(MadjTk);
gamma = sqrt(sqrt((MadjT_one*MadjT_inf)/(M_one*M_inf))/fabs(det));
g1 = gamma*0.5;
g2 = 0.5/(gamma*det);
mat_copy(Ek,=,Mk,3);
mat_binop(Mk,=,g1*Mk,+,g2*MadjTk,3);
mat_copy(Ek,-=,Mk,3);
E_one = norm_one(Ek);
M_one = norm_one(Mk); M_inf = norm_inf(Mk);
} while (E_one>(M_one*TOL));
mat_tpose(Q,=,Mk,3); mat_pad(Q);
mat_mult(Mk, M, S); mat_pad(S);
for (i=0; i<3; i++) for (j=i; j<3; j++)
S[i][j] = S[j][i] = 0.5*(S[i][j]+S[j][i]);
return (det);
}
/******* Spectral Decomposition *******/
/* Compute the spectral decomposition of symmetric positive semi-definite S.
* Returns rotation in U and scale factors in result, so that if K is a diagonal
* matrix of the scale factors, then S = U K (U transpose). Uses Jacobi method.
* See Gene H. Golub and Charles F. Van Loan. Matrix Computations. Hopkins 1983.
*/
HVect spect_decomp(HMatrix S, HMatrix U)
{
HVect kv;
double Diag[3],OffD[3]; /* OffD is off-diag (by omitted index) */
double g,h,fabsh,fabsOffDi,t,theta,c,s,tau,ta,OffDq,a,b;
static char nxt[] = {Y,Z,X};
int sweep, i, j;
mat_copy(U,=,mat_id,4);
Diag[X] = S[X][X]; Diag[Y] = S[Y][Y]; Diag[Z] = S[Z][Z];
OffD[X] = S[Y][Z]; OffD[Y] = S[Z][X]; OffD[Z] = S[X][Y];
for (sweep=20; sweep>0; sweep--) {
float sm = fabs(OffD[X])+fabs(OffD[Y])+fabs(OffD[Z]);
if (sm==0.0) break;
for (i=Z; i>=X; i--) {
int p = nxt[i]; int q = nxt[p];
fabsOffDi = fabs(OffD[i]);
g = 100.0*fabsOffDi;
if (fabsOffDi>0.0) {
h = Diag[q] - Diag[p];
fabsh = fabs(h);
if (fabsh+g==fabsh) {
t = OffD[i]/h;
} else {
theta = 0.5*h/OffD[i];
t = 1.0/(fabs(theta)+sqrt(theta*theta+1.0));
if (theta<0.0) t = -t;
}
c = 1.0/sqrt(t*t+1.0); s = t*c;
tau = s/(c+1.0);
ta = t*OffD[i]; OffD[i] = 0.0;
Diag[p] -= ta; Diag[q] += ta;
OffDq = OffD[q];
OffD[q] -= s*(OffD[p] + tau*OffD[q]);
OffD[p] += s*(OffDq - tau*OffD[p]);
for (j=Z; j>=X; j--) {
a = U[j][p]; b = U[j][q];
U[j][p] -= s*(b + tau*a);
U[j][q] += s*(a - tau*b);
}
}
}
}
kv.x = Diag[X]; kv.y = Diag[Y]; kv.z = Diag[Z]; kv.w = 1.0;
return (kv);
}
/******* Spectral Axis Adjustment *******/
/* Given a unit quaternion, q, and a scale vector, k, find a unit quaternion, p,
* which permutes the axes and turns freely in the plane of duplicate scale
* factors, such that q p has the largest possible w component, i.e. the
* smallest possible angle. Permutes k's components to go with q p instead of q.
* See Ken Shoemake and Tom Duff. Matrix Animation and Polar Decomposition.
* Proceedings of Graphics Interface 1992. Details on p. 262-263.
*/
Quat snuggle(Quat q, HVect *k)
{
#define SQRTHALF (0.7071067811865475244)
#define sgn(n,v) ((n)?-(v):(v))
#define swap(a,i,j) {a[3]=a[i]; a[i]=a[j]; a[j]=a[3];}
#define cycle(a,p) if (p) {a[3]=a[0]; a[0]=a[1]; a[1]=a[2]; a[2]=a[3];}\
else {a[3]=a[2]; a[2]=a[1]; a[1]=a[0]; a[0]=a[3];}
Quat p;
float ka[4];
int i, turn = -1;
ka[X] = k->x; ka[Y] = k->y; ka[Z] = k->z;
if (ka[X]==ka[Y]) {if (ka[X]==ka[Z]) turn = W; else turn = Z;}
else {if (ka[X]==ka[Z]) turn = Y; else if (ka[Y]==ka[Z]) turn = X;}
if (turn>=0) {
Quat qtoz, qp;
unsigned neg[3], win;
double mag[3], t;
static Quat qxtoz = {0,SQRTHALF,0,SQRTHALF};
static Quat qytoz = {SQRTHALF,0,0,SQRTHALF};
static Quat qppmm = { 0.5, 0.5,-0.5,-0.5};
static Quat qpppp = { 0.5, 0.5, 0.5, 0.5};
static Quat qmpmm = {-0.5, 0.5,-0.5,-0.5};
static Quat qpppm = { 0.5, 0.5, 0.5,-0.5};
static Quat q0001 = { 0.0, 0.0, 0.0, 1.0};
static Quat q1000 = { 1.0, 0.0, 0.0, 0.0};
switch (turn) {
default: return (Qt_Conj(q));
case X: q = Qt_Mul(q, qtoz = qxtoz); swap(ka,X,Z) break;
case Y: q = Qt_Mul(q, qtoz = qytoz); swap(ka,Y,Z) break;
case Z: qtoz = q0001; break;
}
q = Qt_Conj(q);
mag[0] = (double)q.z*q.z+(double)q.w*q.w-0.5;
mag[1] = (double)q.x*q.z-(double)q.y*q.w;
mag[2] = (double)q.y*q.z+(double)q.x*q.w;
for (i=0; i<3; i++) if ((neg[i] = (mag[i]<0.0)) != 0) mag[i] = -mag[i];
if (mag[0]>mag[1]) {if (mag[0]>mag[2]) win = 0; else win = 2;}
else {if (mag[1]>mag[2]) win = 1; else win = 2;}
switch (win) {
case 0: if (neg[0]) p = q1000; else p = q0001; break;
case 1: if (neg[1]) p = qppmm; else p = qpppp; cycle(ka,0) break;
case 2: if (neg[2]) p = qmpmm; else p = qpppm; cycle(ka,1) break;
}
qp = Qt_Mul(q, p);
t = sqrt(mag[win]+0.5);
p = Qt_Mul(p, Qt_(0.0,0.0,-qp.z/t,qp.w/t));
p = Qt_Mul(qtoz, Qt_Conj(p));
} else {
float qa[4], pa[4];
unsigned lo, hi, neg[4], par = 0;
double all, big, two;
qa[0] = q.x; qa[1] = q.y; qa[2] = q.z; qa[3] = q.w;
for (i=0; i<4; i++) {
pa[i] = 0.0;
if ((neg[i] = (qa[i]<0.0)) != 0) qa[i] = -qa[i];
par ^= neg[i];
}
/* Find two largest components, indices in hi and lo */
if (qa[0]>qa[1]) lo = 0; else lo = 1;
if (qa[2]>qa[3]) hi = 2; else hi = 3;
if (qa[lo]>qa[hi]) {
if (qa[lo^1]>qa[hi]) {hi = lo; lo ^= 1;}
else {hi ^= lo; lo ^= hi; hi ^= lo;}
} else {if (qa[hi^1]>qa[lo]) lo = hi^1;}
all = (qa[0]+qa[1]+qa[2]+qa[3])*0.5;
two = (qa[hi]+qa[lo])*SQRTHALF;
big = qa[hi];
if (all>two) {
if (all>big) {/*all*/
{int i; for (i=0; i<4; i++) pa[i] = sgn(neg[i], 0.5);}
cycle(ka,par)
} else {/*big*/ pa[hi] = sgn(neg[hi],1.0);}
} else {
if (two>big) {/*two*/
pa[hi] = sgn(neg[hi],SQRTHALF); pa[lo] = sgn(neg[lo], SQRTHALF);
if (lo>hi) {hi ^= lo; lo ^= hi; hi ^= lo;}
if (hi==W) {hi = "\001\002\000"[lo]; lo = 3-hi-lo;}
swap(ka,hi,lo)
} else {/*big*/ pa[hi] = sgn(neg[hi],1.0);}
}
p.x = -pa[0]; p.y = -pa[1]; p.z = -pa[2]; p.w = pa[3];
}
k->x = ka[X]; k->y = ka[Y]; k->z = ka[Z];
return (p);
}
/******* Decompose Affine Matrix *******/
/* Decompose 4x4 affine matrix A as TFRUK(U transpose), where t contains the
* translation components, q contains the rotation R, u contains U, k contains
* scale factors, and f contains the sign of the determinant.
* Assumes A transforms column vectors in right-handed coordinates.
* See Ken Shoemake and Tom Duff. Matrix Animation and Polar Decomposition.
* Proceedings of Graphics Interface 1992.
*/
void decomp_affine(HMatrix A, AffineParts *parts)
{
HMatrix Q, S, U;
Quat p;
float det;
parts->t = Qt_(A[X][W], A[Y][W], A[Z][W], 0);
det = polar_decomp(A, Q, S);
if (det<0.0) {
mat_copy(Q,=,-Q,3);
parts->f = -1;
} else parts->f = 1;
parts->q = Qt_FromMatrix(Q);
parts->k = spect_decomp(S, U);
parts->u = Qt_FromMatrix(U);
p = snuggle(parts->u, &parts->k);
parts->u = Qt_Mul(parts->u, p);
}
/******* Invert Affine Decomposition *******/
/* Compute inverse of affine decomposition.
*/
void invert_affine(AffineParts *parts, AffineParts *inverse)
{
Quat t, p;
inverse->f = parts->f;
inverse->q = Qt_Conj(parts->q);
inverse->u = Qt_Mul(parts->q, parts->u);
inverse->k.x = (parts->k.x==0.0) ? 0.0 : 1.0/parts->k.x;
inverse->k.y = (parts->k.y==0.0) ? 0.0 : 1.0/parts->k.y;
inverse->k.z = (parts->k.z==0.0) ? 0.0 : 1.0/parts->k.z;
inverse->k.w = parts->k.w;
t = Qt_(-parts->t.x, -parts->t.y, -parts->t.z, 0);
t = Qt_Mul(Qt_Conj(inverse->u), Qt_Mul(t, inverse->u));
t = Qt_(inverse->k.x*t.x, inverse->k.y*t.y, inverse->k.z*t.z, 0);
p = Qt_Mul(inverse->q, inverse->u);
t = Qt_Mul(p, Qt_Mul(t, Qt_Conj(p)));
inverse->t = (inverse->f>0.0) ? t : Qt_(-t.x, -t.y, -t.z, 0);
}
================================================
FILE: fpsgame/Decompose.h
================================================
/* Copyright (C) 2009 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* 0 A.D. is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
*/
/**** Decompose.h - Basic declarations ****/
#ifndef INCLUDED_DECOMPOSE
#define INCLUDED_DECOMPOSE
typedef struct {float x, y, z, w;} Quat; /* Quaternion */
enum QuatPart {X, Y, Z, W};
typedef Quat HVect; /* Homogeneous 3D vector */
typedef float HMatrix[4][4]; /* Right-handed, for column vectors */
typedef struct {
HVect t; /* Translation components */
Quat q; /* Essential rotation */
Quat u; /* Stretch rotation */
HVect k; /* Stretch factors */
float f; /* Sign of determinant */
} AffineParts;
float polar_decomp(HMatrix M, HMatrix Q, HMatrix S);
HVect spect_decomp(HMatrix S, HMatrix U);
Quat snuggle(Quat q, HVect *k);
void decomp_affine(HMatrix A, AffineParts *parts);
void invert_affine(AffineParts *parts, AffineParts *inverse);
#endif
================================================
FILE: fpsgame/Dll.cpp
================================================
/* Copyright (C) 2011 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* 0 A.D. is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
*/
#include "precompiled.h"
#include "CommonConvert.h"
#include "PMDConvert.h"
#include "PSAConvert.h"
#include "StdSkeletons.h"
#include <cstdarg>
#include <cassert>
void default_logger(void*, int severity, const char* message)
{
fprintf(stderr, "[%d] %s\n", severity, message);
}
static LogFn g_Logger = &default_logger;
static void* g_LoggerCBData = NULL;
EXPORT void set_logger(LogFn logger, void* cb_data)
{
if (logger)
{
g_Logger = logger;
g_LoggerCBData = cb_data;
}
else
{
g_Logger = &default_logger;
g_LoggerCBData = NULL;
}
}
EXPORT void poll_logger()
{
if (!g_Logger)
{
g_Logger = NULL;
g_LoggerCBData;
}
}
void Log(int severity, const char* msg, ...)
{
char buffer[1024];
va_list ap;
va_start(ap, msg);
vsnprintf(buffer, sizeof(buffer), msg, ap);
buffer[sizeof(buffer) - 1] = '\0';
va_end(ap);
g_Logger(g_LoggerCBData, severity, buffer);
}
struct BufferedOutputCallback : public OutputCB
{
static const unsigned int bufferSize = 4096;
char buffer[bufferSize];
unsigned int bufferUsed;
OutputFn fn;
void* cb_data;
BufferedOutputCallback(OutputFn fn, void* cb_data)
: fn(fn), cb_data(cb_data), bufferUsed(0)
{
}
~BufferedOutputCallback()
{
// flush the buffer if it's not empty
if (bufferUsed > 0)
fn(cb_data, buffer, bufferUsed);
}
virtual void operator() (const char* data, unsigned int length)
{
if (bufferUsed + length > bufferSize)
{
// will overflow buffer, so flush the buffer first
fn(cb_data, buffer, bufferUsed);
bufferUsed = 0;
if (length > bufferSize)
{
// new data won't fit in buffer, so send it out unbuffered
fn(cb_data, data, length);
return;
}
}
// append onto buffer
memcpy(buffer + bufferUsed, data, length);
bufferUsed += length;
assert(bufferUsed <= bufferSize);
}
};
int convert_dae_to_whatever(const char* dae, OutputFn writer, void* cb_data, void(*conv)(const char*, OutputCB&, std::string&))
{
Log(LOG_INFO, "Starting conversion");
FCollada::Initialize();
std::string xmlErrors;
BufferedOutputCallback cb(writer, cb_data);
try
{
conv(dae, cb, xmlErrors);
}
catch (const ColladaException& e)
{
if (!xmlErrors.empty())
Log(LOG_ERROR, "%s", xmlErrors.c_str());
Log(LOG_ERROR, "%s", e.what());
FCollada::Release();
return -2;
}
FCollada::Release();
if (!xmlErrors.empty())
{
Log(LOG_ERROR, "%s", xmlErrors.c_str());
return -1;
}
return 0;
}
EXPORT int convert_dae_to_pmd(const char* dae, OutputFn pmd_writer, void* cb_data)
{
return convert_dae_to_whatever(dae, pmd_writer, cb_data, ColladaToPMD);
}
EXPORT int convert_dae_to_psa(const char* dae, OutputFn psa_writer, void* cb_data)
{
return convert_dae_to_whatever(dae, psa_writer, cb_data, ColladaToPSA);
}
EXPORT int set_skeleton_definitions(const char* xml, int length)
{
std::string xmlErrors;
try
{
Skeleton::LoadSkeletonDataFromXml(xml, length, xmlErrors);
}
catch (const ColladaException& e)
{
if (!xmlErrors.empty())
Log(LOG_ERROR, "%s", xmlErrors.c_str());
Log(LOG_ERROR, "%s", e.what());
return -1;
}
return 0;
}
================================================
FILE: fpsgame/Dll.h
================================================
#pragma once
/* Copyright (C) 2015 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* 0 A.D. is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INCLUDED_COLLADA_DLL
#define INCLUDED_COLLADA_DLL
#ifdef _WIN32
# ifdef COLLADA_DLL
# define EXPORT extern "C" __declspec(dllexport)
# else
# define EXPORT extern "C" __declspec(dllimport)
# endif
#elif defined(__GNUC__)
# define EXPORT extern "C" __attribute__ ((visibility ("default")))
#else
# define EXPORT extern "C"
#endif
#define LOG_INFO 0
#define LOG_WARNING 1
#define LOG_ERROR 2
typedef void(*LogFn) (void* cb_data, int severity, const char* text);
typedef void(*OutputFn) (void* cb_data, const char* data, unsigned int length);
/* This version number should be bumped whenever incompatible changes
* are made, to invalidate old caches. */
#define COLLADA_CONVERTER_VERSION 3
EXPORT void set_logger(LogFn logger, void* cb_data);
EXPORT int set_skeleton_definitions(const char* xml, int length);
EXPORT int convert_dae_to_pmd(const char* dae, OutputFn pmd_writer, void* cb_data);
EXPORT int convert_dae_to_psa(const char* dae, OutputFn psa_writer, void* cb_data);
EXPORT void poll_logger(void* cb_data);
#endif /* INCLUDED_COLLADA_DLL */
#pragma once
================================================
FILE: fpsgame/GeomReindex.cpp
================================================
/* Copyright (C) 2009 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* 0 A.D. is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
*/
#include "precompiled.h"
#include "GeomReindex.h"
#include "FCollada.h"
#include "FCDocument/FCDEntity.h"
#include "FCDocument/FCDGeometryMesh.h"
#include "FCDocument/FCDGeometryPolygons.h"
#include "FCDocument/FCDGeometryPolygonsInput.h"
#include "FCDocument/FCDGeometrySource.h"
#include "FCDocument/FCDSkinController.h"
#include <cassert>
#include <vector>
#include <map>
#include <algorithm>
typedef std::pair<float, float> uv_pair_type;
struct VertexData
{
VertexData(const float* pos, const float* norm, const std::vector<uv_pair_type> &uvs,
const std::vector<FCDJointWeightPair>& weights)
: x(pos[0]), y(pos[1]), z(pos[2]),
nx(norm[0]), ny(norm[1]), nz(norm[2]),
uvs(uvs),
weights(weights)
{
}
float x, y, z;
float nx, ny, nz;
std::vector<uv_pair_type> uvs;
std::vector<FCDJointWeightPair> weights;
};
bool similar(float a, float b)
{
return (fabsf(a - b) < 0.000001f);
}
bool operator==(const FCDJointWeightPair& a, const FCDJointWeightPair& b)
{
return (a.jointIndex == b.jointIndex && similar(a.weight, b.weight));
}
bool operator<(const FCDJointWeightPair& a, const FCDJointWeightPair& b)
{
// Sort by decreasing weight, then by increasing joint ID
if (a.weight > b.weight)
return true;
else if (a.weight < b.weight)
return false;
else if (a.jointIndex < b.jointIndex)
return true;
else
return false;
}
bool operator==(const uv_pair_type& a, const uv_pair_type& b)
{
return similar(a.first, b.first) && similar(a.second, b.second);
}
bool operator==(const VertexData& a, const VertexData& b)
{
return (similar(a.x, b.x) && similar(a.y, b.y) && similar(a.z, b.z)
&& similar(a.nx, b.nx) && similar(a.ny, b.ny) && similar(a.nz, b.nz)
&& (a.uvs == b.uvs)
&& (a.weights == b.weights));
}
bool operator<(const VertexData& a, const VertexData& b)
{
#define CMP(f) if (a.f < b.f) return true; if (a.f > b.f) return false
CMP(x); CMP(y); CMP(z);
CMP(nx); CMP(ny); CMP(nz);
CMP(uvs);
CMP(weights);
#undef CMP
return false;
}
template <typename T>
struct InserterWithoutDuplicates
{
InserterWithoutDuplicates(std::vector<T>& vec) : vec(vec)
{
}
size_t add(const T& val)
{
typename std::map<T, size_t>::iterator it = btree.find(val);
if (it != btree.end())
return it->second;
size_t idx = vec.size();
vec.push_back(val);
btree.insert(std::make_pair(val, idx));
return idx;
}
std::vector<T>& vec;
std::map<T, size_t> btree; // for faster lookups (so we can build a duplicate-free list in O(n log n) instead of O(n^2))
private:
InserterWithoutDuplicates& operator=(const InserterWithoutDuplicates&);
};
void CanonicaliseWeights(std::vector<FCDJointWeightPair>& weights)
{
// Convert weight-lists into a standard format, so simple vector equality
// can be used to determine equivalence
std::sort(weights.begin(), weights.end());
}
void ReindexGeometry(FCDGeometryPolygons* polys, FCDSkinController* skin)
{
// Given geometry with:
// positions, normals, texcoords, bone blends
// each with their own data array and index array, change it to
// have a single optimised index array shared by all vertexes.
FCDGeometryPolygonsInput* inputPosition = polys->FindInput(FUDaeGeometryInput::POSITION);
FCDGeometryPolygonsInput* inputNormal = polys->FindInput(FUDaeGeometryInput::NORMAL);
FCDGeometryPolygonsInput* inputTexcoord = polys->FindInput(FUDaeGeometryInput::TEXCOORD);
size_t numVertices = polys->GetFaceVertexCount();
assert(inputPosition->GetIndexCount() == numVertices);
assert(inputNormal ->GetIndexCount() == numVertices);
assert(inputTexcoord->GetIndexCount() == numVertices);
const uint32* indicesPosition = inputPosition->GetIndices();
const uint32* indicesNormal = inputNormal->GetIndices();
const uint32* indicesTexcoord = inputTexcoord->GetIndices();
assert(indicesPosition);
assert(indicesNormal);
assert(indicesTexcoord); // TODO - should be optional, because textureless meshes aren't unreasonable
FCDGeometrySourceList texcoordSources;
polys->GetParent()->FindSourcesByType(FUDaeGeometryInput::TEXCOORD, texcoordSources);
FCDGeometrySource* sourcePosition = inputPosition->GetSource();
FCDGeometrySource* sourceNormal = inputNormal ->GetSource();
const float* dataPosition = sourcePosition->GetData();
const float* dataNormal = sourceNormal ->GetData();
if (skin)
{
#ifndef NDEBUG
size_t numVertexPositions = sourcePosition->GetDataCount() / sourcePosition->GetStride();
assert(skin->GetInfluenceCount() == numVertexPositions);
#endif
}
uint32 stridePosition = sourcePosition->GetStride();
uint32 strideNormal = sourceNormal ->GetStride();
std::vector<uint32> indicesCombined;
std::vector<VertexData> vertexes;
InserterWithoutDuplicates<VertexData> inserter(vertexes);
for (size_t i = 0; i < numVertices; ++i)
{
std::vector<FCDJointWeightPair> weights;
if (skin)
{
FCDSkinControllerVertex* influences = skin->GetVertexInfluence(indicesPosition[i]);
assert(influences != NULL);
for (size_t j = 0; j < influences->GetPairCount(); ++j)
{
FCDJointWeightPair* pair = influences->GetPair(j);
assert(pair != NULL);
weights.push_back(*pair);
}
CanonicaliseWeights(weights);
}
std::vector<uv_pair_type> uvs;
for (size_t set = 0; set < texcoordSources.size(); ++set)
{
const float* dataTexcoord = texcoordSources[set]->GetData();
uint32 strideTexcoord = texcoordSources[set]->GetStride();
uv_pair_type p;
p.first = dataTexcoord[indicesTexcoord[i]*strideTexcoord];
p.second = dataTexcoord[indicesTexcoord[i]*strideTexcoord + 1];
uvs.push_back(p);
}
VertexData vtx (
&dataPosition[indicesPosition[i]*stridePosition],
&dataNormal [indicesNormal [i]*strideNormal],
uvs,
weights
);
size_t idx = inserter.add(vtx);
indicesCombined.push_back((uint32)idx);
}
// TODO: rearrange indicesCombined (and rearrange vertexes to match) to use
// the vertex cache efficiently
// (<http://home.comcast.net/~tom_forsyth/papers/fast_vert_cache_opt.html> etc)
FloatList newDataPosition;
FloatList newDataNormal;
FloatList newDataTexcoord;
std::vector<std::vector<FCDJointWeightPair> > newWeightedMatches;
for (size_t i = 0; i < vertexes.size(); ++i)
{
newDataPosition.push_back(vertexes[i].x);
newDataPosition.push_back(vertexes[i].y);
newDataPosition.push_back(vertexes[i].z);
newDataNormal .push_back(vertexes[i].nx);
newDataNormal .push_back(vertexes[i].ny);
newDataNormal .push_back(vertexes[i].nz);
newWeightedMatches.push_back(vertexes[i].weights);
}
// (Slightly wasteful to duplicate this array so many times, but FCollada
// doesn't seem to support multiple inputs with the same source data)
inputPosition->SetIndices(&indicesCombined.front(), indicesCombined.size());
inputNormal ->SetIndices(&indicesCombined.front(), indicesCombined.size());
inputTexcoord->SetIndices(&indicesCombined.front(), indicesCombined.size());
for (size_t set = 0; set < texcoordSources.size(); ++set)
{
newDataTexcoord.clear();
for (size_t i = 0; i < vertexes.size(); ++i)
{
newDataTexcoord.push_back(vertexes[i].uvs[set].first);
newDataTexcoord.push_back(vertexes[i].uvs[set].second);
}
texcoordSources[set]->SetData(newDataTexcoord, 2);
}
sourcePosition->SetData(newDataPosition, 3);
sourceNormal ->SetData(newDataNormal, 3);
if (skin)
{
skin->SetInfluenceCount(newWeightedMatches.size());
for (size_t i = 0; i < newWeightedMatches.size(); ++i)
{
skin->GetVertexInfluence(i)->SetPairCount(0);
for (size_t j = 0; j < newWeightedMatches[i].size(); ++j)
skin->GetVertexInfluence(i)->AddPair(newWeightedMatches[i][j].jointIndex, newWeightedMatches[i][j].weight);
}
}
}
================================================
FILE: fpsgame/GeomReindex.h
================================================
/* Copyright (C) 2009 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* 0 A.D. is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INCLUDED_GEOMREINDEX
#define INCLUDED_GEOMREINDEX
class FCDGeometryPolygons;
class FCDSkinController;
void ReindexGeometry(FCDGeometryPolygons* polys, FCDSkinController* skin = 0);
#endif // INCLUDED_GEOMREINDEX
================================================
FILE: fpsgame/JSInterfaace_GameView.h
================================================
/* Copyright (C) 2013 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* 0 A.D. is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INCLUDED_JSINTERFACE_GAMEVIEW
#define INCLUDED_JSINTERFACE_GAMEVIEW
#include "ps/CStr.h"
#include "scriptinterface/ScriptInterface.h"
#define DECLARE_BOOLEAN_SCRIPT_SETTING(NAME) \
bool Get##NAME##Enabled(ScriptInterface::CxPrivate* pCxPrivate); \
void Set##NAME##Enabled(ScriptInterface::CxPrivate* pCxPrivate, bool Enabled);
namespace JSI_GameView
{
void RegisterScriptFunctions(ScriptInterface& ScriptInterface);
DECLARE_BOOLEAN_SCRIPT_SETTING(Culling);
DECLARE_BOOLEAN_SCRIPT_SETTING(LockCullCamera);
DECLARE_BOOLEAN_SCRIPT_SETTING(ConstrainCamera);
}
#undef DECLARE_BOOLEAN_SCRIPT_SETTING
#endif
================================================
FILE: fpsgame/JSInterface_GameView.cpp
================================================
/* Copyright (C) 2013 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* 0 A.D. is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
*/
#include "precompiled.h"
#include "JSInterface_GameView.h"
#include "graphics/GameView.h"
#include "ps/Game.h"
#include "ps/CLogger.h"
#include "ps/Profile.h"
#include "scriptinterface/ScriptInterface.h"
#define IMPLEMENT_BOOLEAN_SCRIPT_SETTING(NAME) \
bool JSI_GameView::Get##NAME##Enabled(ScriptInterface::CxPrivate* UNUSED(pCxPrivate)) \
{ \
if (!g_Game || !g_Game->GetView()) \
{ \
LOGERROR("Trying to get a setting from GameView when it's not initialized!"); \
return false; \
} \
return g_Game->GetView()->Get##NAME##Enabled(); \
} \
\
void JSI_GameView::Set##NAME##Enabled(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), bool Enabled) \
{ \
if (!g_Game || !g_Game->GetView()) \
{ \
LOGERROR("Trying to set a setting of GameView when it's not initialized!"); \
return; \
} \
g_Game->GetView()->Set##NAME##Enabled(Enabled); \
}
IMPLEMENT_BOOLEAN_SCRIPT_SETTING(Culling);
IMPLEMENT_BOOLEAN_SCRIPT_SETTING(LockCullCamera);
IMPLEMENT_BOOLEAN_SCRIPT_SETTING(ConstrainCamera);
#undef IMPLEMENT_BOOLEAN_SCRIPT_SETTING
#define REGISTER_BOOLEAN_SCRIPT_SETTING(NAME) \
scriptInterface.RegisterFunction<bool, &JSI_GameView::Get##NAME##Enabled>("GameView_Get" #NAME "Enabled"); \
scriptInterface.RegisterFunction<void, bool, &JSI_GameView::Set##NAME##Enabled>("GameView_Set" #NAME "Enabled");
void JSI_GameView::RegisterScriptFunctions(ScriptInterface& scriptInterface)
{
REGISTER_BOOLEAN_SCRIPT_SETTING(Culling);
REGISTER_BOOLEAN_SCRIPT_SETTING(LockCullCamera);
REGISTER_BOOLEAN_SCRIPT_SETTING(ConstrainCamera);
}
#undef REGISTER_BOOLEAN_SCRIPT_SETTING
================================================
FILE: fpsgame/Math.cpp
================================================
/* Copyright (C) 2009 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* 0 A.D. is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
*/
#include "precompiled.h"
#include "Maths.h"
#include "FCollada.h"
void DumpMatrix(const FMMatrix44& m)
{
Log(LOG_INFO, "\n[%f %f %f %f]\n[%f %f %f %f]\n[%f %f %f %f]\n[%f %f %f %f]",
m.m[0][0], m.m[0][1], m.m[0][2], m.m[0][3],
m.m[1][0], m.m[1][1], m.m[1][2], m.m[1][3],
m.m[2][0], m.m[2][1], m.m[2][2], m.m[2][3],
m.m[3][0], m.m[3][1], m.m[3][2], m.m[3][3]
);
}
FMMatrix44 DecomposeToScaleMatrix(const FMMatrix44& m)
{
FMVector3 scale, rotation, translation;
float inverted;
m.Decompose(scale, rotation, translation, inverted);
return FMMatrix44::ScaleMatrix(scale);
}
/*
FMMatrix44 operator+ (const FMMatrix44& a, const FMMatrix44& b)
{
FMMatrix44 r;
for (int x = 0; x < 4; ++x)
for (int y = 0; y < 4; ++y)
r[x][y] = a[x][y] + b[x][y];
return r;
}
FMMatrix44 operator/ (const FMMatrix44& a, const float b)
{
FMMatrix44 r;
for (int x = 0; x < 4; ++x)
for (int y = 0; y < 4; ++y)
r[x][y] = a[x][y] / b;
return r;
}
FMMatrix44 QuatToMatrix(float x, float y, float z, float w)
{
FMMatrix44 r;
r[0][0] = 1.0f - (y*y*2 + z*z*2);
r[1][0] = x*y*2 - w*z*2;
r[2][0] = x*z*2 + w*y*2;
r[3][0] = 0;
r[0][1] = x*y*2 + w*z*2;
r[1][1] = 1.0f - (x*x*2 + z*z*2);
r[2][1] = y*z*2 - w*x*2;
r[3][1] = 0;
r[0][2] = x*z*2 - w*y*2;
r[1][2] = y*z*2 + w*x*2;
r[2][2] = 1.0f - (x*x*2 + y*y*2);
r[3][2] = 0;
r[0][3] = 0;
r[1][3] = 0;
r[2][3] = 0;
r[3][3] = 1;
return r;
}
*/
================================================
FILE: fpsgame/Math.h
================================================
#pragma once
/* Copyright (C) 2009 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* 0 A.D. is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INCLUDED_MATHS
#define INCLUDED_MATHS
class FMMatrix44;
extern void DumpMatrix(const FMMatrix44& m);
extern FMMatrix44 DecomposeToScaleMatrix(const FMMatrix44& m);
// (None of these are used any more)
// extern FMMatrix44 operator+ (const FMMatrix44& a, const FMMatrix44& b);
// extern FMMatrix44 operator/ (const FMMatrix44& a, const float b);
// extern FMMatrix44 QuatToMatrix(float x, float y, float z, float w);
#endif // INCLUDED_MATHS
================================================
FILE: fpsgame/PMDConvert.cpp
================================================
/* Copyright (C) 2012 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* 0 A.D. is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
*/
#include "precompiled.h"
#include "PMDConvert.h"
#include "CommonConvert.h"
#include "FCollada.h"
#include "FCDocument/FCDAsset.h"
#include "FCDocument/FCDocument.h"
#include "FCDocument/FCDocumentTools.h"
#include "FCDocument/FCDController.h"
#include "FCDocument/FCDControllerInstance.h"
#include "FCDocument/FCDGeometry.h"
#include "FCDocument/FCDGeometryMesh.h"
#include "FCDocument/FCDGeometryPolygons.h"
#include "FCDocument/FCDGeometryPolygonsInput.h"
#include "FCDocument/FCDGeometryPolygonsTools.h"
#include "FCDocument/FCDGeometrySource.h"
#include "FCDocument/FCDSceneNode.h"
#include "FCDocument/FCDSkinController.h"
#include "StdSkeletons.h"
#include "Decompose.h"
#include "Maths.h"
#include "GeomReindex.h"
#include <cassert>
#include <vector>
#include <algorithm>
const size_t maxInfluences = 4;
struct VertexBlend
{
uint8 bones[maxInfluences];
float weights[maxInfluences];
};
VertexBlend defaultInfluences = { { 0xFF, 0xFF, 0xFF, 0xFF }, { 0, 0, 0, 0 } };
struct PropPoint
{
std::string name;
float translation[3];
float orientation[4];
uint8 bone;
};
// Based on FMVector3::Normalize, but that function uses a static member
// FMVector3::XAxis which causes irritating linker errors. Rather than trying
// to make that XAxis work in a cross-platform way, just reimplement Normalize:
static FMVector3 FMVector3_Normalize(const FMVector3& vec)
{
float l = vec.Length();
if (l > 0.0f)
return FMVector3(vec.x/l, vec.y/l, vec.z/l);
else
return FMVector3(1.0f, 0.0f, 0.0f);
}
static void AddStaticPropPoints(std::vector<PropPoint> &propPoints, const FMMatrix44& upAxisTransform, FCDSceneNode* node)
{
if (node->GetName().find("prop-") == 0 || node->GetName().find("prop_") == 0)
{
// Strip off the "prop-" from the name
std::string propPointName (node->GetName().substr(5));
Log(LOG_INFO, "Adding prop point %s", propPointName.c_str());
// CalculateWorldTransform applies transformations recursively for all parents of this node
// upAxisTransform transforms this node to right-handed Z_UP coordinates
FMMatrix44 transform = upAxisTransform * node->CalculateWorldTransform();
HMatrix matrix;
memcpy(matrix, transform.Transposed().m, sizeof(matrix));
AffineParts parts;
decomp_affine(matrix, &parts);
// Add prop point in game coordinates
PropPoint p = {
propPointName,
// Flip translation across the x-axis by swapping y and z
{ parts.t.x, parts.t.z, parts.t.y },
// To convert the quaternions: imagine you're using the axis/angle
// representation, then swap the y,z basis vectors and change the
// direction of rotation by negating the angle ( => negating sin(angle)
// => negating x,y,z => changing (x,y,z,w) to (-x,-z,-y,w)
// but then (-x,-z,-y,w) == (x,z,y,-w) so do that instead)
{ parts.q.x, parts.q.z, parts.q.y, -parts.q.w },
0xff
};
propPoints.push_back(p);
}
// Search children for prop points
for (size_t i = 0; i < node->GetChildrenCount(); ++i)
AddStaticPropPoints(propPoints, upAxisTransform, node->GetChild(i));
}
class PMDConvert
{
public:
/**
* Converts a COLLADA XML document into the PMD mesh format.
*
* @param input XML document to parse
* @param output callback for writing the PMD data; called lots of times
* with small strings
* @param xmlErrors output - errors reported by the XML parser
* @throws ColladaException on failure
*/
static void ColladaToPMD(const char* input, OutputCB& output, std::string& xmlErrors)
{
CommonConvert converter(input, xmlErrors);
if (converter.GetInstance().GetEntity()->GetType() == FCDEntity::GEOMETRY)
{
Log(LOG_INFO, "Found static geometry");
FCDGeometryPolygons* polys = GetPolysFromGeometry((FCDGeometry*)converter.GetInstance().GetEntity());
// Convert the geometry into a suitable form for the game
ReindexGeometry(polys);
std::vector<VertexBlend> boneWeights; // unused
std::vector<BoneTransform> boneTransforms; // unused
std::vector<PropPoint> propPoints;
// Get the raw vertex data
FCDGeometryPolygonsInput* inputPosition = polys->FindInput(FUDaeGeometryInput::POSITION);
FCDGeometryPolygonsInput* inputNormal = polys->FindInput(FUDaeGeometryInput::NORMAL);
const uint32* indicesCombined = inputPosition->GetIndices();
size_t indicesCombinedCount = inputPosition->GetIndexCount();
// (ReindexGeometry guarantees position/normal/texcoord have the same indexes)
FCDGeometrySource* sourcePosition = inputPosition->GetSource();
FCDGeometrySource* sourceNormal = inputNormal ->GetSource();
FCDGeometrySourceList texcoordSources;
polys->GetParent()->FindSourcesByType(FUDaeGeometryInput::TEXCOORD, texcoordSources);
float* dataPosition = sourcePosition->GetData();
float* dataNormal = sourceNormal ->GetData();
size_t vertexCount = sourcePosition->GetDataCount() / 3;
assert(sourcePosition->GetDataCount() == vertexCount*3);
assert(sourceNormal ->GetDataCount() == vertexCount*3);
std::vector<float*> dataTexcoords;
for (size_t i = 0; i < texcoordSources.size(); ++i)
{
dataTexcoords.push_back(texcoordSources[i]->GetData());
}
// Transform mesh coordinate system to game coordinates
// (doesn't modify prop points)
TransformStaticModel(dataPosition, dataNormal, vertexCount, converter.GetEntityTransform(), converter.IsYUp());
// Add static prop points
// which are empty child nodes of the main parent
// Default prop points are already given in game coordinates
AddDefaultPropPoints(propPoints);
// Calculate transform to convert from COLLADA-defined up_axis to Z-up because
// it's relatively straightforward to convert that to game coordinates
FMMatrix44 upAxisTransform = FMMatrix44_Identity;
if (converter.IsYUp())
{
// Prop points are rotated -90 degrees about the X-axis, reverse that rotation
// (do this once now because it's easier than messing with quaternions later)
upAxisTransform = FMMatrix44::XAxisRotationMatrix(1.57f);
}
AddStaticPropPoints(propPoints, upAxisTransform, converter.GetInstance().GetParent());
WritePMD(output, indicesCombined, indicesCombinedCount, dataPosition, dataNormal, dataTexcoords, vertexCount, boneWeights, boneTransforms, propPoints);
}
else if (converter.GetInstance().GetType() == FCDEntityInstance::CONTROLLER)
{
Log(LOG_INFO, "Found skinned geometry");
FCDControllerInstance& controllerInstance = static_cast<FCDControllerInstance&>(converter.GetInstance());
// (NB: GetType is deprecated and should be replaced with HasType,
// except that has irritating linker errors when using a DLL, so don't
// bother)
assert(converter.GetInstance().GetEntity()->GetType() == FCDEntity::CONTROLLER); // assume this is always true?
FCDController* controller = static_cast<FCDController*>(converter.GetInstance().GetEntity());
FCDSkinController* skin = controller->GetSkinController();
REQUIRE(skin != NULL, "is skin controller");
FixSkeletonRoots(controllerInstance);
// Data for joints is stored in two places - avoid overflows by limiting
// to the minimum of the two sizes, and warn if they're different (which
// happens in practice for slightly-broken meshes)
size_t jointCount = std::min(skin->GetJointCount(), controllerInstance.GetJointCount());
if (skin->GetJointCount() != controllerInstance.GetJointCount())
{
Log(LOG_WARNING, "Mismatched bone counts (skin has %d, skeleton has %d)",
skin->GetJointCount(), controllerInstance.GetJointCount());
for (size_t i = 0; i < skin->GetJointCount(); ++i)
Log(LOG_INFO, "Skin joint %d: %s", i, skin->GetJoint(i)->GetId().c_str());
for (size_t i = 0; i < controllerInstance.GetJointCount(); ++i)
Log(LOG_INFO, "Skeleton joint %d: %s", i, controllerInstance.GetJoint(i)->GetName().c_str());
}
// Get the skinned mesh for this entity
FCDGeometry* baseGeometry = controller->GetBaseGeometry();
REQUIRE(baseGeometry != NULL, "controller has base geometry");
FCDGeometryPolygons* polys = GetPolysFromGeometry(baseGeometry);
// Make sure it doesn't use more bones per vertex than the game can handle
SkinReduceInfluences(skin, maxInfluences, 0.001f);
// Convert the geometry into a suitable form for the game
ReindexGeometry(polys, skin);
const Skeleton& skeleton = FindSkeleton(controllerInstance);
// Convert the bone influences into VertexBlend structures for the PMD:
bool hasComplainedAboutNonexistentJoints = false; // because we want to emit a warning only once
std::vector<VertexBlend> boneWeights; // one per vertex
const FCDSkinControllerVertex* vertexInfluences = skin->GetVertexInfluences();
for (size_t i = 0; i < skin->GetInfluenceCount(); ++i)
{
VertexBlend influences = defaultInfluences;
assert(vertexInfluences[i].GetPairCount() <= maxInfluences);
// guaranteed by ReduceInfluences; necessary for avoiding
// out-of-bounds writes to the VertexBlend
if (vertexInfluences[i].GetPairCount() == 0)
{
// Blender exports some models with vertices that have no influences,
// which I've not found details about in the COLLADA spec, however,
// it seems to work OK to treat these vertices the same as if they
// were only influenced by the bind-shape matrix (see comment below),
// so we use the same special case here.
influences.bones[0] = (uint8)jointCount;
influences.weights[0] = 1.0f;
}
for (size_t j = 0; j < vertexInfluences[i].GetPairCount(); ++j)
{
if (vertexInfluences[i].GetPair(j)->jointIndex == -1)
{
// This is a special case we must handle, according to the COLLADA spec:
// "An index of -1 into the array of joints refers to the bind shape"
//
// which basically means when skinning the vertex it's relative to the
// bind-shape transform instead of an animated bone. Since our skinning
// is in world space, we will have already applied the bind-shape transform,
// so we don't have to worry about that, though we DO have to apply the
// world space transform of the model for the indicated vertex.
//
// To indicate this special case, we use a bone ID set to the total number
// of bones in the model, which will have a special "bone matrix" reserved
// that contains the world space transform of the model during skinning.
// (see http://trac.wildfiregames.com/ticket/1012)
influences.bones[j] = (uint8)jointCount;
influences.weights[j] = vertexInfluences[i].GetPair(j)->weight;
}
else
{
// Check for less than 254 joints because we store them in a u8,
// 0xFF is a reserved value (no influence), and we reserve one slot
// for the above special case.
uint32 jointIdx = vertexInfluences[i].GetPair(j)->jointIndex;
REQUIRE(jointIdx < 0xFE, "sensible number of joints (<254)");
// Find the joint on the skeleton, after checking it really exists
FCDSceneNode* joint = NULL;
if (jointIdx < controllerInstance.GetJointCount())
joint = controllerInstance.GetJoint(jointIdx);
// Complain on error
if (! joint)
{
if (! hasComplainedAboutNonexistentJoints)
{
Log(LOG_WARNING, "Vertexes influenced by nonexistent joint");
hasComplainedAboutNonexistentJoints = true;
}
continue;
}
// Store into the VertexBlend
int boneId = skeleton.GetBoneID(joint->GetName().c_str());
if (boneId < 0)
{
// The relevant joint does exist, but it's not a recognised
// bone in our chosen skeleton structure
Log(LOG_ERROR, "Vertex influenced by unrecognised bone '%s'", joint->GetName().c_str());
continue;
}
influences.bones[j] = (uint8)boneId;
influences.weights[j] = vertexInfluences[i].GetPair(j)->weight;
}
}
boneWeights.push_back(influences);
}
// Convert the bind pose into BoneTransform structures for the PMD:
BoneTransform boneDefault = { { 0, 0, 0 }, { 0, 0, 0, 1 } }; // identity transform
std::vector<BoneTransform> boneTransforms (skeleton.GetBoneCount(), boneDefault);
for (size_t i = 0; i < jointCount; ++i)
{
FCDSceneNode* joint = controllerInstance.GetJoint(i);
int boneId = skeleton.GetRealBoneID(joint->GetName().c_str());
if (boneId < 0)
{
// unrecognised joint - it's probably just a prop point
// or something, so ignore it
continue;
}
FMMatrix44 bindPose = skin->GetJoint(i)->GetBindPoseInverse().Inverted();
HMatrix matrix;
memcpy(matrix, bindPose.Transposed().m, sizeof(matrix));
// set matrix = bindPose^T, to match what decomp_affine wants
AffineParts parts;
decomp_affine(matrix, &parts);
BoneTransform b = {
{ parts.t.x, parts.t.y, parts.t.z },
{ parts.q.x, parts.q.y, parts.q.z, parts.q.w }
};
boneTransforms[boneId] = b;
}
// Construct the list of prop points.
// Currently takes all objects that are directly attached to a
// standard bone, and whose name begins with "prop-" or "prop_".
std::vector<PropPoint> propPoints;
AddDefaultPropPoints(propPoints);
for (size_t i = 0; i < jointCount; ++i)
{
FCDSceneNode* joint = controllerInstance.GetJoint(i);
int boneId = skeleton.GetBoneID(joint->GetName().c_str());
if (boneId < 0)
{
// unrecognised joint name - ignore, same as before
continue;
}
// Check all the objects attached to this bone
for (size_t j = 0; j < joint->GetChildrenCount(); ++j)
{
FCDSceneNode* child = joint->GetChild(j);
if (child->GetName().find("prop-") != 0 && child->GetName().find("prop_") != 0)
{
// doesn't begin with "prop-", so skip it
continue;
}
// Strip off the "prop-" from the name
std::string propPointName (child->GetName().substr(5));
Log(LOG_INFO, "Adding prop point %s", propPointName.c_str());
// Get translation and orientation of local transform
FMMatrix44 localTransform = child->ToMatrix();
HMatrix matrix;
memcpy(matrix, localTransform.Transposed().m, sizeof(matrix));
AffineParts parts;
decomp_affine(matrix, &parts);
// Add prop point to list
PropPoint p = {
propPointName,
{ parts.t.x, parts.t.y, parts.t.z },
{ parts.q.x, parts.q.y, parts.q.z, parts.q.w },
(uint8)boneId
};
propPoints.push_back(p);
}
}
// Get the raw vertex data
FCDGeometryPolygonsInput* inputPosition = polys->FindInput(FUDaeGeometryInput::POSITION);
FCDGeometryPolygonsInput* inputNormal = polys->FindInput(FUDaeGeometryInput::NORMAL);
const uint32* indicesCombined = inputPosition->GetIndices();
size_t indicesCombinedCount = inputPosition->GetIndexCount();
// (ReindexGeometry guarantees position/normal/texcoord have the same indexes)
FCDGeometrySource* sourcePosition = inputPosition->GetSource();
FCDGeometrySource* sourceNormal = inputNormal ->GetSource();
FCDGeometrySourceList texcoordSources;
polys->GetParent()->FindSourcesByType(FUDaeGeometryInput::TEXCOORD, texcoordSources);
float* dataPosition = sourcePosition->GetData();
float* dataNormal = sourceNormal ->GetData();
size_t vertexCount = sourcePosition->GetDataCount() / 3;
assert(sourcePosition->GetDataCount() == vertexCount*3);
assert(sourceNormal ->GetDataCount() == vertexCount*3);
std::vector<float*> dataTexcoords;
for (size_t i = 0; i < texcoordSources.size(); ++i)
{
dataTexcoords.push_back(texcoordSources[i]->GetData());
}
// Transform model coordinate system to game coordinates
TransformSkinnedModel(dataPosition, dataNormal, vertexCount, boneTransforms, propPoints,
converter.GetEntityTransform(), skin->GetBindShapeTransform(),
converter.IsYUp(), converter.IsXSI());
WritePMD(output, indicesCombined, indicesCombinedCount, dataPosition, dataNormal, dataTexcoords, vertexCount, boneWeights, boneTransforms, propPoints);
}
else
{
throw ColladaException("Unrecognised object type");
}
}
/**
* Adds the default "root" prop-point.
*/
static void AddDefaultPropPoints(std::vector<PropPoint>& propPoints)
{
PropPoint root;
root.name = "root";
root.translation[0] = root.translation[1] = root.translation[2] = 0.0f;
root.orientation[0] = root.orientation[1] = root.orientation[2] = 0.0f;
root.orientation[3] = 1.0f;
root.bone = 0xFF;
propPoints.push_back(root);
}
/**
* Writes the model data in the PMD format.
*/
static void WritePMD(OutputCB& output,
const uint32* indices, size_t indexCount,
const float* position, const float* normal,
const std::vector<float*>& texcoords,
size_t vertexCount,
const std::vector<VertexBlend>& boneWeights, const std::vector<BoneTransform>& boneTransforms,
const std::vector<PropPoint>& propPoints)
{
static const VertexBlend noBlend = { { 0xFF, 0xFF, 0xFF, 0xFF }, { 0, 0, 0, 0 } };
size_t faceCount = indexCount/3;
size_t boneCount = boneTransforms.size();
if (boneCount)
assert(boneWeights.size() == vertexCount);
size_t propPointsSize = 0; // can't calculate this statically, so loop over all the prop points
for (size_t i = 0; i < propPoints.size(); ++i)
{
propPointsSize += 4 + propPoints[i].name.length();
propPointsSize += 3*4 + 4*4 + 1;
}
output("PSMD", 4); // magic number
write(output, (uint32)4); // version number
write(output, (uint32)(
// for UVs, we add one uint32 (i.e. 4 bytes) per model that gives the number of
// texcoord sets in the model, plus 2 floats per new UV
// pair per vertex (i.e. 8 bytes * number of pairs * vertex count)
4 + 11*4*vertexCount + 4 + 8*texcoords.size()*vertexCount + // vertices
4 + 6*faceCount + // faces
4 + 7*4*boneCount + // bones
4 + propPointsSize // props
)); // data size
// Vertex data
write<uint32>(output, (uint32)vertexCount);
write<uint32>(output, (uint32)texcoords.size()); // UV pairs per vertex
for (size_t i = 0; i < vertexCount; ++i)
{
output((char*)&position[i*3], 12);
output((char*)&normal [i*3], 12);
for (size_t s = 0; s < texcoords.size(); ++s)
{
output((char*)&texcoords[s][i*2], 8);
}
if (boneCount)
write(output, boneWeights[i]);
else
write(output, noBlend);
}
// Face data
write(output, (uint32)faceCount);
for (size_t i = 0; i < indexCount; ++i)
{
write(output, (uint16)indices[i]);
}
// Bones data
write(output, (uint32)boneCount);
for (size_t i = 0; i < boneCount; ++i)
{
output((char*)&boneTransforms[i], 7*4);
}
// Prop points data
write(output, (uint32)propPoints.size());
for (size_t i = 0; i < propPoints.size(); ++i)
{
uint32 nameLen = (uint32)propPoints[i].name.length();
write(output, nameLen);
output(propPoints[i].name.c_str(), nameLen);
write(output, propPoints[i].translation);
write(output, propPoints[i].orientation);
write(output, propPoints[i].bone);
}
}
static FCDGeometryPolygons* GetPolysFromGeometry(FCDGeometry* geom)
{
REQUIRE(geom->IsMesh(), "geometry is mesh");
FCDGeometryMesh* mesh = geom->GetMesh();
if (! mesh->IsTriangles())
FCDGeometryPolygonsTools::Triangulate(mesh);
REQUIRE(mesh->IsTriangles(), "mesh is made of triangles");
REQUIRE(mesh->GetPolygonsCount() == 1, "mesh has single set of polygons");
FCDGeometryPolygons* polys = mesh->GetPolygons(0);
REQUIRE(polys->FindInput(FUDaeGeometryInput::POSITION) != NULL, "mesh has vertex positions");
REQUIRE(polys->FindInput(FUDaeGeometryInput::NORMAL) != NULL, "mesh has vertex normals");
REQUIRE(polys->FindInput(FUDaeGeometryInput::TEXCOORD) != NULL, "mesh has vertex tex coords");
return polys;
}
/**
* Applies world-space transform to vertex data and transforms Collada's right-handed
* Y-up / Z-up coordinates to the game's left-handed Y-up coordinate system
*
* TODO: Maybe we should use FCDocumentTools::StandardizeUpAxisAndLength in addition
* to this, so we'd only have one up-axis case to worry about, but it doesn't seem to
* correctly adjust the prop points in Y_UP models.
*/
static void TransformStaticModel(float* position, float* normal, size_t vertexCount,
const FMMatrix44& transform, bool yUp)
{
for (size_t i = 0; i < vertexCount; ++i)
{
FMVector3 pos (&position[i*3], 0);
FMVector3 norm (&normal[i*3], 0);
// Apply the scene-node transforms
pos = transform.TransformCoordinate(pos);
norm = FMVector3_Normalize(transform.TransformVector(norm));
// Convert from right-handed Y_UP or Z_UP to the game's coordinate system (left-handed Y-up)
if (yUp)
{
pos.z = -pos.z;
norm.z = -norm.z;
}
else
{
std::swap(pos.y, pos.z);
std::swap(norm.y, norm.z);
}
// Copy back to array
position[i*3] = pos.x;
position[i*3+1] = pos.y;
position[i*3+2] = pos.z;
normal[i*3] = norm.x;
normal[i*3+1] = norm.y;
normal[i*3+2] = norm.z;
}
}
/**
* Applies world-space transform to vertex data and transforms Collada's right-handed
* Y-up / Z-up coordinates to the game's left-handed Y-up coordinate system
*
* TODO: Maybe we should use FCDocumentTools::StandardizeUpAxisAndLength in addition
* to this, so we'd only have one up-axis case to worry about, but it doesn't seem to
* correctly adjust the prop points in Y_UP models.
*/
static void TransformSkinnedModel(float* position, float* normal, size_t vertexCount,
std::vector<BoneTransform>& bones, std::vector<PropPoint>& propPoints,
const FMMatrix44& transform, const FMMatrix44& bindTransform, bool yUp, bool isXSI)
{
FMMatrix44 scaledTransform; // for vertexes
FMMatrix44 scaleMatrix; // for bones
// HACK: see comment in PSAConvert::TransformVertices
if (isXSI)
{
scaleMatrix = DecomposeToScaleMatrix(transform);
scaledTransform = DecomposeToScaleMatrix(bindTransform) * transform;
}
else
{
scaleMatrix = FMMatrix44_Identity;
scaledTransform = bindTransform;
}
// Update the vertex positions and normals
for (size_t i = 0; i < vertexCount; ++i)
{
FMVector3 pos (&position[i*3], 0);
FMVector3 norm (&normal[i*3], 0);
// Apply the scene-node transforms
pos = scaledTransform.TransformCoordinate(pos);
norm = FMVector3_Normalize(scaledTransform.TransformVector(norm));
// Convert from right-handed Y_UP or Z_UP to the game's coordinate system (left-handed Y-up)
if (yUp)
{
pos.z = -pos.z;
norm.z = -norm.z;
}
else
{
std::swap(pos.y, pos.z);
std::swap(norm.y, norm.z);
}
// and copy back into the original array
position[i*3] = pos.x;
position[i*3+1] = pos.y;
position[i*3+2] = pos.z;
normal[i*3] = norm.x;
normal[i*3+1] = norm.y;
normal[i*3+2] = norm.z;
}
TransformBones(bones, scaleMatrix, yUp);
// And do the same for prop points
for (size_t i = 0; i < propPoints.size(); ++i)
{
if (yUp)
{
propPoints[i].translation[0] = -propPoints[i].translation[0];
propPoints[i].orientation[0] = -propPoints[i].orientation[0];
propPoints[i].orientation[3] = -propPoints[i].orientation[3];
}
else
{
// Flip translation across the x-axis by swapping y and z
std::swap(propPoints[i].translation[1], propPoints[i].translation[2]);
// To convert the quaternions: imagine you're using the axis/angle
// representation, then swap the y,z basis vectors and change the
// direction of rotation by negating the angle ( => negating sin(angle)
// => negating x,y,z => changing (x,y,z,w) to (-x,-z,-y,w)
// but then (-x,-z,-y,w) == (x,z,y,-w) so do that instead)
std::swap(propPoints[i].orientation[1], propPoints[i].orientation[2]);
propPoints[i].orientation[3] = -propPoints[i].orientation[3];
}
}
}
};
// The above stuff is just in a class since I don't like having to bother
// with forward declarations of functions - but provide the plain function
// interface here:
void ColladaToPMD(const char* input, OutputCB& output, std::string& xmlErrors)
{
PMDConvert::ColladaToPMD(input, output, xmlErrors);
}
================================================
FILE: fpsgame/PMDConvert.h
================================================
/* Copyright (C) 2009 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* 0 A.D. is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INCLUDED_PMDCONVERT
#define INCLUDED_PMDCONVERT
#include <string>
struct OutputCB;
void ColladaToPMD(const char* input, OutputCB& output, std::string& xmlErrors);
#endif // INCLUDED_PMDCONVERT
================================================
FILE: fpsgame/PSAConvert.cpp
================================================
/* Copyright (C) 2013 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* 0 A.D. is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
*/
#include "precompiled.h"
#include "PSAConvert.h"
#include "CommonConvert.h"
//#include "FCollada.h"
//#include "FCDocument/FCDocument.h"
//#include "FCDocument/FCDocumentTools.h"
//#include "FCDocument/FCDAnimated.h"
//#include "FCDocument/FCDAnimationCurve.h"
//#include "FCDocument/FCDAnimationKey.h"
//#include "FCDocument/FCDController.h"
//#include "FCDocument/FCDControllerInstance.h"
//#include "FCDocument/FCDExtra.h"
//#include "FCDocument/FCDGeometry.h"
//#include "FCDocument/FCDGeometryMesh.h"
//#include "FCDocument/FCDGeometryPolygons.h"
//#include "FCDocument/FCDGeometrySource.h"
//#include "FCDocument/FCDSceneNode.h"
#include "StdSkeletons.h"
#include "Decompose.h"
//#include "Maths.h"
#include "GeomReindex.h"
#include <cassert>
#include <vector>
#include <limits>
#include <iterator>
#include <algorithm>
class PSAConvert
{
public:
/**
* Converts a COLLADA XML document into the PSA animation format.
*
* @param input XML document to parse
* @param output callback for writing the PSA data; called lots of times
* with small strings
* @param xmlErrors output - errors reported by the XML parser
* @throws ColladaException on failure
*/
static void ColladaToPSA(const char* input, OutputCB& output, std::string& xmlErrors)
{
CommonConvert converter(input, xmlErrors);
if (converter.GetInstance().GetType() == FCDEntityInstance::CONTROLLER)
{
FCDControllerInstance& controllerInstance = static_cast<FCDControllerInstance&>(converter.GetInstance());
FixSkeletonRoots(controllerInstance);
assert(converter.GetInstance().GetEntity()->GetType() == FCDEntity::CONTROLLER); // assume this is always true?
FCDController* controller = static_cast<FCDController*>(converter.GetInstance().GetEntity());
FCDSkinController* skin = controller->GetSkinController();
REQUIRE(skin != NULL, "is skin controller");
const Skeleton& skeleton = FindSkeleton(controllerInstance);
float frameLength = 1.f / 30.f; // currently we always want to create PMDs at fixed 30fps
// Find the extents of the animation:
float timeStart = 0, timeEnd = 0;
GetAnimationRange(converter.GetDocument(), skeleton, controllerInstance, timeStart, timeEnd);
// To catch broken animations / skeletons.xml:
REQUIRE(timeEnd > timeStart, "animation end frame must come after start frame");
// Count frames; don't include the last keyframe
size_t frameCount = (size_t)((timeEnd - timeStart) / frameLength - 0.5f);
REQUIRE(frameCount > 0, "animation must have frames");
// (TODO: sort out the timing/looping problems)
size_t boneCount = skeleton.GetBoneCount();
std::vector<BoneTransform> boneTransforms;
for (size_t frame = 0; frame < frameCount; ++frame)
{
float time = timeStart + frameLength * frame;
BoneTransform boneDefault = { { 0, 0, 0 }, { 0, 0, 0, 1 } };
std::vector<BoneTransform> frameBoneTransforms (boneCount, boneDefault);
// Move the model into the new animated pose
// (We can't tell exactly which nodes should be animated, so
// just update the entire world recursively)
EvaluateAnimations(converter.GetRoot(), time);
// Convert the pose into the form require by the game
for (size_t i = 0; i < controllerInstance.GetJointCount(); ++i)
{
FCDSceneNode* joint = controllerInstance.GetJoint(i);
int boneId = skeleton.GetRealBoneID(joint->GetName().c_str());
if (boneId < 0)
continue; // not a recognised bone - ignore it, same as before
FMMatrix44 worldTransform = joint->CalculateWorldTransform();
HMatrix matrix;
memcpy(matrix, worldTransform.Transposed().m, sizeof(matrix));
AffineParts parts;
decomp_affine(matrix, &parts);
BoneTransform b = {
{ parts.t.x, parts.t.y, parts.t.z },
{ parts.q.x, parts.q.y, parts.q.z, parts.q.w }
};
frameBoneTransforms[boneId] = b;
}
// Push frameBoneTransforms onto the back of boneTransforms
copy(frameBoneTransforms.begin(), frameBoneTransforms.end(),
std::inserter(boneTransforms, boneTransforms.end()));
}
// Convert into game's coordinate space
TransformVertices(boneTransforms, skin->GetBindShapeTransform(), converter.IsYUp(), converter.IsXSI());
// Write out the file
WritePSA(output, frameCount, boneCount, boneTransforms);
}
else
{
throw ColladaException("Unrecognised object type");
}
}
/**
* Writes the animation data in the PSA format.
*/
static void WritePSA(OutputCB& output, size_t frameCount, size_t boneCount, const std::vector<BoneTransform>& boneTransforms)
{
output("PSSA", 4); // magic number
write(output, (uint32)1); // version number
write(output, (uint32)(
4 + 0 + // name
4 + // frameLength
4 + 4 + // numBones, numFrames
7*4*boneCount*frameCount // boneStates
)); // data size
// Name
write(output, (uint32)0);
// Frame length
write(output, 1000.f/30.f);
write(output, (uint32)boneCount);
write(output, (uint32)frameCount);
for (size_t i = 0; i < boneCount*frameCount; ++i)
{
output((char*)&boneTransforms[i], 7*4);
}
}
static void TransformVertices(std::vector<BoneTransform>& bones,
const FMMatrix44& transform, bool yUp, bool isXSI)
{
// HACK: we want to handle scaling in XSI because that makes it easy
// for artists to adjust the models to the right size. But this way
// doesn't work in Max, and I can't see how to make it do so, so this
// is only applied to models from XSI.
if (isXSI)
{
TransformBones(bones, DecomposeToScaleMatrix(transform), yUp);
}
else
{
TransformBones(bones, FMMatrix44_Identity, yUp);
}
}
static void GetAnimationRange(const FColladaDocument& doc, const Skeleton& skeleton,
const FCDControllerInstance& controllerInstance,
float& timeStart, float& timeEnd)
{
// FCollada tools export <extra> info in the scene to specify the start
// and end times.
// If that isn't available, we have to search for the earliest and latest
// keyframes on any of the bones.
if (doc.GetDocument()->HasStartTime() && doc.GetDocument()->HasEndTime())
{
timeStart = doc.GetDocument()->GetStartTime();
timeEnd = doc.GetDocument()->GetEndTime();
return;
}
// XSI exports relevant information in
// <extra><technique profile="XSI"><SI_Scene><xsi_param sid="start">
// (and 'end' and 'frameRate') so use those
if (GetAnimationRange_XSI(doc, timeStart, timeEnd))
return;
timeStart = std::numeric_limits<float>::max();
timeEnd = -std::numeric_limits<float>::max();
for (size_t i = 0; i < controllerInstance.GetJointCount(); ++i)
{
const FCDSceneNode* joint = controllerInstance.GetJoint(i);
REQUIRE(joint != NULL, "joint exists");
int boneId = skeleton.GetBoneID(joint->GetName().c_str());
if (boneId < 0)
{
// unrecognised joint - it's probably just a prop point
// or something, so ignore it
continue;
}
// Skip unanimated joints
if (joint->GetTransformCount() == 0)
continue;
for (size_t j = 0; j < joint->GetTransformCount(); ++j)
{
const FCDTransform* transform = joint->GetTransform(j);
if (! transform->IsAnimated())
continue;
// Iterate over all curves to find the earliest and latest keys
const FCDAnimated* anim = transform->GetAnimated();
const FCDAnimationCurveListList& curvesList = anim->GetCurves();
for (size_t j = 0; j < curvesList.size(); ++j)
{
const FCDAnimationCurveTrackList& curves = curvesList[j];
for (size_t k = 0; k < curves.size(); ++k)
{
const FCDAnimationCurve* curve = curves[k];
timeStart = std::min(timeStart, curve->GetKeys()[0]->input);
timeEnd = std::max(timeEnd, curve->GetKeys()[curve->GetKeyCount()-1]->input);
}
}
}
}
}
static bool GetAnimationRange_XSI(const FColladaDocument& doc, float& timeStart, float& timeEnd)
{
FCDExtra* extra = doc.GetExtra();
if (! extra) return false;
FCDEType* type = extra->GetDefaultType();
if (! type) return false;
FCDETechnique* technique = type->FindTechnique("XSI");
if (! technique) return false;
FCDENode* scene = technique->FindChildNode("SI_Scene");
if (! scene) return false;
float start = FLT_MAX, end = -FLT_MAX, framerate = 0.f;
FCDENodeList paramNodes;
scene->FindChildrenNodes("xsi_param", paramNodes);
for (FCDENodeList::iterator it = paramNodes.begin(); it != paramNodes.end(); ++it)
{
if ((*it)->ReadAttribute("sid") == "start")
start = FUStringConversion::ToFloat((*it)->GetContent());
else if ((*it)->ReadAttribute("sid") == "end")
end = FUStringConversion::ToFloat((*it)->GetContent());
else if ((*it)->ReadAttribute("sid") == "frameRate")
framerate = FUStringConversion::ToFloat((*it)->GetContent());
}
if (framerate != 0.f && start != FLT_MAX && end != -FLT_MAX)
{
timeStart = start / framerate;
timeEnd = end / framerate;
return true;
}
return false;
}
static void EvaluateAnimations(FCDSceneNode& node, float time)
{
for (size_t i = 0; i < node.GetTransformCount(); ++i)
{
FCDTransform* transform = node.GetTransform(i);
FCDAnimated* anim = transform->GetAnimated();
if (anim)
anim->Evaluate(time);
}
for (size_t i = 0; i < node.GetChildrenCount(); ++i)
EvaluateAnimations(*node.GetChild(i), time);
}
};
// The above stuff is just in a class since I don't like having to bother
// with forward declarations of functions - but provide the plain function
// interface here:
void ColladaToPSA(const char* input, OutputCB& output, std::string& xmlErrors)
{
PSAConvert::ColladaToPSA(input, output, xmlErrors);
}
================================================
FILE: fpsgame/PSAConvert.h
================================================
/* Copyright (C) 2009 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* 0 A.D. is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INCLUDED_PSACONVERT
#define INCLUDED_PSACONVERT
#include <string>
struct OutputCB;
void ColladaToPSA(const char* input, OutputCB& output, std::string& xmlErrors);
#endif // INCLUDED_PSACONVERT
================================================
FILE: fpsgame/Resource.h
================================================
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by fpsgame.rc
//
#define IDS_APP_TITLE 103
#define IDR_MAINFRAME 128
#define IDD_FPSGAME_DIALOG 102
#define IDD_ABOUTBOX 103
#define IDM_ABOUT 104
#define IDM_EXIT 105
#define IDI_FPSGAME 107
#define IDI_SMALL 108
#define IDC_FPSGAME 109
#define IDC_MYICON 2
#ifndef IDC_STATIC
#define IDC_STATIC -1
#endif
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 130
#define _APS_NEXT_RESOURCE_VALUE 129
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 110
#endif
#endif
================================================
FILE: fpsgame/SkillSystem.cpp
================================================
#include "SkillSystem.h"
#include "BulletSystem.h"
#include "interface.h"
#include "GameProcess.h"
#include "ObjectParticles.h"
CSkillSystem::CSkillSystem(CGameProcess* pGameProcess)
{
CBulletSystem::GetInstance()->SetCallback(MakeInterface(this, &CSkillSystem::OnSkillCallback));
m_pGameProcess = pGameProcess;
AddListen(BR_PARTICLE_HIT, MakeMessageFunc(this, &CSkillSystem::OnParticleHit));
}
CSkillSystem::~CSkillSystem(void)
{
CBulletSystem::ReleaseInstance();
}
int CSkillSystem::OnSkillCallback(void* pVoid)
{
_BulletCallback* pBase = (_BulletCallback*)pVoid;
switch (pBase->nMsgID)
{
case _BulletCallback::GetTargetPosition:
{
_Bullet_GetTargetPosition* pBullet = (_Bullet_GetTargetPosition*)pBase;
CRoleBase* pRole = m_pGameProcess->GetRole(pBullet->nTarget);//test
if (pRole)
{
pBullet->nRetState = 1;
pBullet->vRetPos = pRole->GetPosition() + vec3(0.0f, 0.0f, 1.2f);
pBullet->vRetDir = pRole->GetDirection();
}
else
{
pBullet->nRetState = 0;
}
}break;
case _BulletCallback::HitTarget:
{
_Bullet_HitTarget* pBullet = (_Bullet_HitTarget*)pBase;
}break;
case _BulletCallback::GetCollision:
{
_Bullet_GetCollision* pBullet = (_Bullet_GetCollision*)pBase;
//test
for (int i = 0; i < 20; i++)
{
CRoleBase* pRole = m_pGameProcess->GetRoleFormIndex(i);
if (pRole)
{
if ((pRole->GetPosition() - pBullet->vPos).length() < pBullet->fRadius + pRole->GetRoleRadius())
{
pBullet->nRetTarget = pRole->GetRoleID();
pBullet->vRetHitPoint = pRole->GetPosition() + vec3(0.0f, 0.0f, 1.2f);
}
}
}
}break;
case _BulletCallback::Blast:
{
_Bullet_Blast* pBullet = (_Bullet_Blast*)pBase;
}break;
}
return 1;
}
void CSkillSystem::Update(float ifps)
{
CBulletSystem::GetInstance()->Update();
}
void CSkillSystem::Reset()
{
CBulletSystem::GetInstance()->Reset();
}
int CSkillSystem::OnParticleHit(void* v1, void* v2, void* v3)
{
CObjectParticles* pPar = (CObjectParticles*)v1;
CBRObject* pHitObject = (CBRObject*)v2;
int nContact = *(int*)v3;
int nParID = atoi(pPar->GetName());
int nObjID = atoi(pHitObject->GetName());
return 1;
}
================================================
FILE: fpsgame/SkillSystem.h
================================================
#pragma once
#include "MessageBase.h"
class CInterfaceBase;
class CGameProcess;
class CSkillSystem : public CMessageBase //ϵͳ̳Ϣ
{
public:
CSkillSystem(CGameProcess* pGameProcess);
virtual ~CSkillSystem(void);
public:
void Update(float ifps);
void Reset();
protected:
int OnParticleHit(void* v1, void* v2, void* v3);
int OnSkillCallback(void* pVoid);
CGameProcess* m_pGameProcess;
};
================================================
FILE: fpsgame/Star2DControl.cpp
================================================
#include "Star2DControl.h"
#include "Engine.h"
using namespace MathLib;
CStar2DControl::CStar2DControl(void)
{
m_pNormalTex = NULL;
m_pClickTex = NULL;
m_nEnabled = 1;
m_nClickState = 0;
m_fClickScale = 1.0f;
m_vNormalColor = vec4_one;
m_vClickColor = vec4_one;
m_fNormalTexScale = 0.1f;
m_fClickTexScale = 0.1f;
Init();
}
CStar2DControl::~CStar2DControl(void)
{
g_Engine.pGui->ReleaseTexture(m_pNormalTex);
g_Engine.pGui->ReleaseTexture(m_pClickTex);
}
int CStar2DControl::Init()
{
return Load(NORMAL_NAME, CLICK_NAME);
}
void CStar2DControl::Update()
{
if (!IsEnable())
{
return;
}
m_fClickScale += m_nClickState * g_Engine.pGame->GetIFps() * 5.5f;
if (m_fClickScale <= 0.8f)
{
m_nClickState = 1;
}
else if (m_fClickScale >= 1.0f)
{
m_fClickScale = 1.0f;
m_nClickState = 0;
}
if (m_pNormalTex && m_pNormalTex->GetTexture())
{
CTexture *tex = m_pNormalTex->GetTexture();
float width = CMathCore::Itof(tex->GetWidth());
float height = CMathCore::Itof(tex->GetHeight());
if (m_fNormalTexScale != 0.0f)
{
float aspect = height / width;
width = g_Engine.pGui->GetWidth() * m_fNormalTexScale;
height = width * aspect;
}
float CenterX = g_Engine.pGui->GetWidth() / 2.0f;
float CenterY = g_Engine.pGui->GetHeight() / 2.0f;
float x0 = CenterX - width / 2.0f;
float y0 = CenterY - height / 2.0f;
float x1 = CenterX + width / 2.0f;
float y1 = CenterY + height / 2.0f;
g_Engine.pGui->RenderTexture(tex, vec4(x0, y0, x1, y1), m_vNormalColor);
}
if (m_pClickTex && m_pClickTex->GetTexture())
{
CTexture *tex = m_pClickTex->GetTexture();
float width = CMathCore::Itof(tex->GetWidth());
float height = CMathCore::Itof(tex->GetHeight());
if (m_fClickTexScale != 0.0f)
{
float aspect = height / width;
width = g_Engine.pGui->GetWidth() * m_fClickTexScale;
height = width * aspect;
}
width *= m_fClickScale;
height *= m_fClickScale;
float CenterX = g_Engine.pGui->GetWidth() / 2.0f;
float CenterY = g_Engine.pGui->GetHeight() / 2.0f;
float x0 = CenterX - width / 2.0f;
float y0 = CenterY - height / 2.0f;
float x1 = CenterX + width / 2.0f;
float y1 = CenterY + height / 2.0f;
g_Engine.pGui->RenderTexture(tex, vec4(x0, y0, x1, y1), m_vClickColor);
}
}
void CStar2DControl::Click()
{
if(m_nClickState != -1)
m_nClickState = -1;
}
int CStar2DControl::Load(const char* strNormal, const char* strClick)
{
if (m_strNormalName != strNormal)
{
m_strNormalName = strNormal;
g_Engine.pGui->ReleaseTexture(m_pNormalTex);
m_pNormalTex = g_Engine.pGui->CreateTexture(strNormal);
}
if (m_strClickName != strClick)
{
m_strClickName = strClick;
g_Engine.pGui->ReleaseTexture(m_pClickTex);
m_pClickTex = g_Engine.pGui->CreateTexture(strClick);
}
return 0;
}
int CStar2DControl::IsEnable()
{
return m_nEnabled;
}
void CStar2DControl::SetEnable(int nEnable)
{
m_nEnabled = nEnable;
}
void CStar2DControl::SetNormalColor(const vec4& vColor)
{
m_vNormalColor = vColor;
}
const MathLib::vec4& CStar2DControl::GetNormalColor() const
{
return m_vNormalColor;
}
void CStar2DControl::SetClickColor(const vec4& vColor)
{
m_vClickColor = vColor;
}
const MathLib::vec4& CStar2DControl::GetClickColor() const
{
return m_vClickColor;
}
void CStar2DControl::SetNormalScale(float fScale)
{
m_fNormalTexScale = fScale;
}
float CStar2DControl::GetNormalScale() const
{
return m_fNormalTexScale;
}
void CStar2DControl::SetClickScale(float fScale)
{
m_fClickTexScale = fScale;
}
float CStar2DControl::GetClickScale() const
{
return m_fClickTexScale;
}
================================================
FILE: fpsgame/Star2DControl.h
================================================
#pragma once
#include "MathLib.h"
#include "Singleton.h"
#include "UtilStr.h"
class CBRObject;
class CTextureImage;
class CStar2DControl : public CSingleton < CStar2DControl >
{
public:
CStar2DControl(void);
~CStar2DControl(void);
public:
int Init();
void Update();
void Click();
int Load(const char* strNormal, const char* strClick);
void SetEnable(int nEnable);
int IsEnable();
void SetNormalColor(const MathLib::vec4& vColor);
const MathLib::vec4& GetNormalColor() const;
void SetClickColor(const MathLib::vec4& vColor);
const MathLib::vec4& GetClickColor() const;
//Ļռ 01ֵ
void SetNormalScale(float fScale);
float GetNormalScale() const;
void SetClickScale(float fScale);
float GetClickScale() const;
protected:
CUtilStr m_strNormalName;
CUtilStr m_strClickName;
CTextureImage *m_pNormalTex;
CTextureImage *m_pClickTex;
int m_nEnabled;
int m_nClickState;
float m_fClickScale;
MathLib::vec4 m_vNormalColor;
MathLib::vec4 m_vClickColor;
float m_fNormalTexScale;
float m_fClickTexScale;
};
================================================
FILE: fpsgame/StartControl.cpp
================================================
#include "StarControl.h"
#include "ObjectParticles.h"
#include "Engine.h"
#include "Game.h"
#include "Object.h"
#include "Player.h"
#include "Common.h"
#include "App.h"
CStarControl::CStarControl(void)
{
m_pStarNormal = NULL;
m_pStarClick = NULL;
m_fViewDistance = 0.5f;
m_nClickState = 0;
m_fClickScale = 1.0f;
Init();
}
CStarControl::~CStarControl(void)
{
g_Engine.pGame->RemoveNode(m_pStarNormal);
g_Engine.pGame->RemoveNode(m_pStarClick);
}
int CStarControl::Init()
{
return Load("data/StarControl/Star_mesh.node", "data/StarControl/Star_click.node");
}
void CStarControl::Update(const vec3& vPos, const vec3& vDir)
{
m_fClickScale += m_nClickState * g_Engine.pGame->GetIFps() * 5.5f;
if (m_fClickScale <= 0.8f)
{
m_nClickState = 1;
}
else if (m_fClickScale >= 1.0f)
{
m_fClickScale = 1.0f;
m_nClickState = 0;
}
float fViewDistance = m_fViewDistance;
mat4 matStar = Translate(vPos + vDir * fViewDistance);
CPlayer* pPlayer = g_Engine.pGame->GetPlayer();
if (pPlayer)
{
vec3 x = pPlayer->GetModelview().getRow3(0);
vec3 y = pPlayer->GetModelview().getRow3(1);
vec3 z = pPlayer->GetModelview().getRow3(2);
matStar.setColumn3(0, x);
matStar.setColumn3(1, -z);
matStar.setColumn3(2, y);
}
vec4 pos = vec4(1.0f, 0.0f, 0.0f, 1.0f);
float s = CCommon::CalcAxisScale(g_Engine.pGame->GetPlayer()->GetModelview(), g_Engine.pGame->GetPlayer()->GetFov(),
vec4(matStar.getColumn3(3), 1.0f),
200.0f,
CMathCore::Itof(g_Engine.pApp->GetHeight()));
m_pStarNormal->SetWorldTransform(matStar * Scale(s, 1.0f, s));
m_pStarClick->SetWorldTransform(matStar * Scale(m_fClickScale, 1.0f, m_fClickScale) * Scale(s, 1.0f, s));
}
void CStarControl::Click()
{
m_nClickState = -1;
}
int CStarControl::Load(const char* strNormal, const char* strClick)
{
if (m_pStarClick && m_pStarNormal)
{
g_Engine.pGame->RemoveNode(m_pStarNormal);
g_Engine.pGame->RemoveNode(m_pStarClick);
}
m_pStarNormal = (CBRObject*)g_Engine.pGame->LoadNode(strNormal);
m_pStarClick = (CBRObject*)g_Engine.pGame->LoadNode(strClick);
if (m_pStarClick && m_pStarNormal)
{
return 1;
}
return 0;
}
int CStarControl::isEnable()
{
return m_pStarClick->IsEnabled();
}
void CStarControl::SetEnable(int nEnable)
{
m_pStarClick->SetEnabled(nEnable);
m_pStarNormal->SetEnabled(nEnable);
}
void CStarControl::SetColor(const vec4& vColor)
{
m_pStarNormal->SetObjectColor(vColor);
}
================================================
FILE: fpsgame/StartControl.h
================================================
#pragma once
#include "MathLib.h"
#include "Singleton.h"
class CBRObject;
using namespace MathLib;
class CStarControl : public CSingleton<CStarControl>
{
public:
CStarControl(void);
~CStarControl(void);
public:
int Init();
void Update(const vec3& vPos, const vec3& vDir);
void Click();
int Load(const char* strNormal, const char* strClick);
int isEnable();
void SetEnable(int nEnable);
void SetViewDistance(float fViewDistance) { m_fViewDistance = fViewDistance; }
void SetColor(const vec4& vColor); //ô4ά
protected:
CBRObject* m_pStarNormal;
CBRObject* m_pStarClick;
float m_fViewDistance;
int m_nClickState;
float m_fClickScale;
};
================================================
FILE: fpsgame/StdSkeletons.cpp
================================================
#include "precompiled.h"
#include "StdSkeletons.h"
#include "libxml/parser.h"
#include "libxml/xmlerror.h"
#include "CommonConvert.h"
#include "FUtils/FUXmlParser.h"
#include <map>
namespace
{
struct SkeletonMap : public std::map<std::string, const Skeleton*>
{
SkeletonMap()
{
}
~SkeletonMap()
{
for (iterator it = begin(); it != end(); ++it)
delete it->second;
}
};
SkeletonMap g_StandardSkeletons;
SkeletonMap g_MappedSkeletons;
struct Bone
{
std::string parent;
std::string name;
int targetId;
int realTargetId;
};
}
const Skeleton* Skeleton::FindSkeleton(const std::string& name)
{
return g_MappedSkeletons[name];
}
Skeleton::Skeleton() : m(new Skeleton_impl) { }
Skeleton::~Skeleton() { }
struct Skeleton_impl
{
std::string title;
std::vector<Bone> bones;
const Skeleton* target;
};
int Skeleton::GetBoneID(const std::string& name) const
{
for (size_t i = 0; i < m->bones.size(); ++i)
if (m->bones[i].name == name)
return m->bones[i].targetId;
return -1;
}
int Skeleton::GetRealBoneID(const std::string& name) const
{
for (size_t i = 0; i < m->bones.size(); ++i)
if (m->bones[i].name == name)
return m->bones[i].realTargetId;
return -1;
}
int Skeleton::GetBoneCount() const
{
return (int)m->target->m->bones.size();
}
namespace
{
bool AlreadyUsedTargetBone(const std::vector<Bone>& bones, int targetId)
{
for (size_t i = 0; i < bones.size(); ++i)
if (bones[i].targetId == targetId)
return true;
return false;
}
// Recursive helper function used by LoadSkeletonData
void LoadSkeletonBones(xmlNode* parent, std::vector<Bone>& bones, const Skeleton* targetSkeleton, const std::string& targetName)
{
xmlNodeList boneNodes;
FUXmlParser::FindChildrenByType(parent, "bone", boneNodes);
for (xmlNodeList::iterator boneNode = boneNodes.begin(); boneNode != boneNodes.end(); ++boneNode)
{
std::string name(FUXmlParser::ReadNodeProperty(*boneNode, "name"));
Bone b;
b.name = name;
std::string newTargetName = targetName;
if (targetSkeleton)
{
xmlNode* targetNode = FUXmlParser::FindChildByType(*boneNode, "target");
if (targetNode)
newTargetName = FUXmlParser::ReadNodeContentFull(targetNode);
// else fall back to the parent node's target
b.targetId = targetSkeleton->GetBoneID(newTargetName);
REQUIRE(b.targetId != -1, "skeleton bone target matches some standard_skeleton bone name");
if (AlreadyUsedTargetBone(bones, b.targetId))
b.realTargetId = -1;
else
b.realTargetId = b.targetId;
}
else
{
// No target - this is a standard skeleton
b.targetId = (int)bones.size();
b.realTargetId = b.targetId;
}
bones.push_back(b);
LoadSkeletonBones(*boneNode, bones, targetSkeleton, newTargetName);
}
}
void LoadSkeletonData(xmlNode* root)
{
xmlNodeList skeletonNodes;
FUXmlParser::FindChildrenByType(root, "standard_skeleton", skeletonNodes);
FUXmlParser::FindChildrenByType(root, "skeleton", skeletonNodes);
for (xmlNodeList::iterator skeletonNode = skeletonNodes.begin();
skeletonNode != skeletonNodes.end(); ++skeletonNode)
{
std::unique_ptr<Skeleton> skeleton(new Skeleton());
std::string title(FUXmlParser::ReadNodeProperty(*skeletonNode, "title"));
skeleton->m->title = title;
if (IsEquivalent((*skeletonNode)->name, "standard_skeleton"))
{
skeleton->m->target = NULL;
LoadSkeletonBones(*skeletonNode, skeleton->m->bones, NULL, "");
std::string id(FUXmlParser::ReadNodeProperty(*skeletonNode, "id"));
REQUIRE(!id.empty(), "standard_skeleton has id");
g_StandardSkeletons[id] = skeleton.release();
}
else
{
// Non-standard skeletons need to choose a standard skeleton
// as their target to be mapped onto
std::string target(FUXmlParser::ReadNodeProperty(*skeletonNode, "target"));
const Skeleton* targetSkeleton = g_StandardSkeletons[target];
REQUIRE(targetSkeleton != NULL, "skeleton target matches some standard_skeleton id");
skeleton->m->target = targetSkeleton;
LoadSkeletonBones(*skeletonNode, skeleton->m->bones, targetSkeleton, "");
// Currently the only supported identifier is a precise name match,
// so just look for that
xmlNode* identifier = FUXmlParser::FindChildByType(*skeletonNode, "identifier");
REQUIRE(identifier != NULL, "skeleton has <identifier>");
xmlNode* identRoot = FUXmlParser::FindChildByType(identifier, "root");
REQUIRE(identRoot != NULL, "skeleton identifier has <root>");
std::string identRootName(FUXmlParser::ReadNodeContentFull(identRoot));
g_MappedSkeletons[identRootName] = skeleton.release();
}
}
}
}
void errorHandler(void* ctx, const char* msg, ...);
void Skeleton::LoadSkeletonDataFromXml(const char* xmlData, size_t xmlLength, std::string& xmlErrors)
{
xmlDoc* doc = NULL;
try
{
xmlSetGenericErrorFunc(&xmlErrors, &errorHandler);
doc = xmlParseMemory(xmlData, (int)xmlLength);
if (doc)
{
xmlNode* root = xmlDocGetRootElement(doc);
LoadSkeletonData(root);
xmlFreeDoc(doc);
doc = NULL;
}
xmlSetGenericErrorFunc(NULL, NULL);
}
catch (const ColladaException&)
{
if (doc)
xmlFreeDoc(doc);
xmlSetGenericErrorFunc(NULL, NULL);
throw;
}
if (!xmlErrors.empty())
throw ColladaException("XML parsing failed");
}
================================================
FILE: fpsgame/StdSkeletons.h
================================================
#pragma once
#ifndef INCLUDED_STDSKELETONS
#define INCLUDED_STDSKELETONS
#include <string>
#include <memory>
struct Skeleton_impl;
class Sketeton
{
public:
/** Default constructor - don't use; use FindSkeleton instead. */
Skeleton();
~Skeleton();
/**
* Returns the number of bones in the standard-skeleton which this current
* skeleton is mapped onto.
*/
int GetBoneCount() const;
/**
* Tries to find a skeleton that matches the given root bone name.
* Returns NULL if there is no match.
*/
static const Skeleton* FindSkeleton(const std::string& rootBoneName);
int GetBoneID(const std::string& name) const;
int GetRealBoneID(const std::string& name) const;
static void LoadSkeletonDataFromXml(const char* xmlData, size_t xmlLength, std::string& xmlErrors);
std::unique_ptr<Skeleton_impl> m;
private:
Skeleton(Skeleton&);
};
#endif // INCLUDED_STDSKELETONS
================================================
FILE: fpsgame/XMLFix.cpp
================================================
/* Copyright (C) 2009 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* 0 A.D. is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
*/
#include "precompiled.h"
#include "XMLFix.h"
#include "CommonConvert.h"
#include "FUtils/FUXmlParser.h"
/*
Things that are fixed here:
----
3ds Max "file://" image URLs
Identifier: /COLLADA/asset/contributor/authoring_tool = "FBX COLLADA exporter"
Problem: /COLLADA/library_images/image/init_from = "file://" which crashes some versions of FCollada
Fix: Delete the whole library_images subtree, since we never use it anyway.
Then delete library_effects and library_materials too, to avoid broken references.
----
3ds Max broken material references
Identifier: /COLLADA/asset/contributor/authoring_tool = "FBX COLLADA exporter"
Problem: /COLLADA/library_visual_scenes/.../instance_material/@target sometimes
refers to non-existent material IDs.
Fix: Delete the whole bind_material subtree, since we never use it anyway.
----
*/
static xmlNode* findChildElement(xmlNode* node, const char* name)
{
for (xmlNode* child = node->children; child; child = child->next)
{
if (child->type == XML_ELEMENT_NODE && strcmp((const char*)child->name, name) == 0)
return child;
}
return NULL;
}
static bool applyFBXFixesNode(xmlNode* node)
{
bool changed = false;
for (xmlNode* child = node->children; child; child = child->next)
{
if (child->type == XML_ELEMENT_NODE)
{
if (strcmp((const char*)child->name, "node") == 0)
{
if (applyFBXFixesNode(child))
changed = true;
}
else if (strcmp((const char*)child->name, "instance_geometry") == 0)
{
xmlNode* bind_material = findChildElement(child, "bind_material");
if (! bind_material) continue;
Log(LOG_INFO, "Found a bind_material to delete");
xmlUnlinkNode(bind_material);
xmlFreeNode(bind_material);
changed = true;
}
}
}
return changed;
}
static bool applyFBXFixes(xmlNode* root)
{
Log(LOG_INFO, "Applying fixes for 3ds Max exporter");
bool changed = false;
xmlNode* library_images = findChildElement(root, "library_images");
if (library_images)
{
Log(LOG_INFO, "Found library_images to delete");
xmlUnlinkNode(library_images);
xmlFreeNode(library_images);
changed = true;
}
xmlNode* library_materials = findChildElement(root, "library_materials");
if (library_materials)
{
Log(LOG_INFO, "Found library_materials to delete");
xmlUnlinkNode(library_materials);
xmlFreeNode(library_materials);
changed = true;
}
xmlNode* library_effects = findChildElement(root, "library_effects");
if (library_effects)
{
Log(LOG_INFO, "Found library_effects to delete");
xmlUnlinkNode(library_effects);
xmlFreeNode(library_effects);
changed = true;
}
xmlNode* library_visual_scenes = findChildElement(root, "library_visual_scenes");
if (library_visual_scenes) // (Assume there's only one of these)
{
xmlNode* visual_scene = findChildElement(library_visual_scenes, "visual_scene");
if (visual_scene) // (Assume there's only one of these)
{
for (xmlNode* child = visual_scene->children; child; child = child->next)
{
if (child->type == XML_ELEMENT_NODE && strcmp((const char*)child->name, "node") == 0)
if (applyFBXFixesNode(child))
changed = true;
}
}
}
return changed;
}
static bool processDocument(xmlNode* root)
{
gitextract_cgk0ykbb/
├── .gitignore
├── LICENSE
├── README.md
├── Test/
│ ├── ActorBash.cpp
│ ├── ActorBash.h
│ ├── CameraBash.cpp
│ ├── CameraBash.h
│ ├── Common.cpp
│ ├── Common.h
│ ├── FPSRole.cpp
│ ├── FPSRole.h
│ ├── FPSRoleLocal.cpp
│ ├── FPSRoleLocal.h
│ ├── GameMain.cpp
│ ├── GameMain.h
│ ├── GameProcess.cpp
│ ├── GameProcess.h
│ ├── HMDWrapper.cpp
│ ├── HMDWrapper.h
│ ├── MathLib.h
│ ├── MoveDummy.cpp
│ ├── MoveDummy.h
│ ├── RayControl.cpp
│ ├── RayControl.h
│ ├── RoleBase.cpp
│ ├── RoleBase.h
│ ├── Test.vcxproj
│ ├── main.cpp
│ └── main.h
├── fpsgame/
│ ├── CommonConvert.cpp
│ ├── CommonConvert.h
│ ├── Decompose.cpp
│ ├── Decompose.h
│ ├── Dll.cpp
│ ├── Dll.h
│ ├── GeomReindex.cpp
│ ├── GeomReindex.h
│ ├── JSInterfaace_GameView.h
│ ├── JSInterface_GameView.cpp
│ ├── Math.cpp
│ ├── Math.h
│ ├── PMDConvert.cpp
│ ├── PMDConvert.h
│ ├── PSAConvert.cpp
│ ├── PSAConvert.h
│ ├── Resource.h
│ ├── SkillSystem.cpp
│ ├── SkillSystem.h
│ ├── Star2DControl.cpp
│ ├── Star2DControl.h
│ ├── StartControl.cpp
│ ├── StartControl.h
│ ├── StdSkeletons.cpp
│ ├── StdSkeletons.h
│ ├── XMLFix.cpp
│ ├── XMLFix.h
│ ├── fpsgame.cpp
│ ├── fpsgame.h
│ ├── fpsgame.vcxproj
│ ├── fpsgame.vcxproj.user
│ ├── graphics/
│ │ ├── Camera.cpp
│ │ ├── Camera.h
│ │ ├── CinemaManager.cpp
│ │ ├── CinemaManager.h
│ │ ├── CinimaPath.cpp
│ │ ├── CinimaPath.h
│ │ ├── ColladaManager.cpp
│ │ ├── ColladaManager.h
│ │ ├── Color.cpp
│ │ ├── Color.h
│ │ ├── Decal.cpp
│ │ ├── Decal.h
│ │ ├── Entity.h
│ │ ├── Font.cpp
│ │ ├── Font.h
│ │ ├── FontManager.cpp
│ │ ├── FontManager.h
│ │ ├── FontMetrics.cpp
│ │ ├── FontMetrics.h
│ │ ├── Frustum.cpp
│ │ ├── Frustum.h
│ │ ├── GameView.cpp
│ │ ├── GameView.h
│ │ ├── HFTracer.cpp
│ │ ├── HFTracer.h
│ │ ├── HeightMipmap.cpp
│ │ ├── HeightMipmap.h
│ │ ├── LOSTexture.cpp
│ │ ├── LOSTexture.h
│ │ ├── LightEnv.cpp
│ │ ├── LightEnv.h
│ │ ├── MapGenerator.cpp
│ │ ├── MapGenerator.h
│ │ ├── MapIO.h
│ │ ├── MapReader.cpp
│ │ ├── MapReader.h
│ │ ├── MapWriter.cpp
│ │ ├── MapWriter.h
│ │ ├── Material.cpp
│ │ ├── Material.h
│ │ ├── MaterialManager.cpp
│ │ ├── MaterialManager.h
│ │ ├── MeshManager.cpp
│ │ ├── MeshManager.h
│ │ ├── MiniPatch.cpp
│ │ ├── MiniPatch.h
│ │ ├── Model.cpp
│ │ ├── Model.h
│ │ ├── ModelAbstract.cpp
│ │ ├── ModelAbstract.h
│ │ ├── ModelDef.cpp
│ │ ├── ModelDef.h
│ │ ├── ObjectBase.cpp
│ │ ├── ObjectBase.h
│ │ ├── ObjectEntry.cpp
│ │ ├── ObjectEntry.h
│ │ ├── ObjectManager.cpp
│ │ ├── ObjectManager.h
│ │ ├── Overlay.cpp
│ │ ├── Overlay.h
│ │ ├── ParticleEmitter.cpp
│ │ ├── ParticleEmitter.h
│ │ ├── ParticleEmitterType.cpp
│ │ ├── ParticleEmitterType.h
│ │ ├── ParticleManager.cpp
│ │ ├── ParticleManager.h
│ │ ├── Patch.cpp
│ │ ├── Patch.h
│ │ ├── RenderableObject.h
│ │ ├── SColor.h
│ │ ├── ShaderDefines.cpp
│ │ ├── ShaderDefines.h
│ │ ├── ShaderManager.cpp
│ │ ├── ShaderManager.h
│ │ ├── ShaderProgram.cpp
│ │ ├── ShaderProgram.h
│ │ ├── ShaderProgramFFP.cpp
│ │ ├── ShaderProgramPtr.h
│ │ ├── ShaderTechnique.cpp
│ │ ├── ShaderTechnique.h
│ │ ├── SkeletonAnim.h
│ │ ├── SkeletonAnimDef.cpp
│ │ ├── SkeletonAnimDef.h
│ │ ├── SkeletonAnimManager.cpp
│ │ ├── SkeletonAnimManager.h
│ │ ├── Terrain.cpp
│ │ ├── Terrain.h
│ │ ├── TerrainProperties.cpp
│ │ ├── TerrainProperties.h
│ │ ├── TerrainTextureEntry.cpp
│ │ ├── TerrainTextureEntry.h
│ │ ├── TerrainTextureManager.cpp
│ │ ├── TerrainTextureManager.h
│ │ ├── TerritoryBoundary.cpp
│ │ ├── TerritoryBoundary.h
│ │ ├── TerritoryTexture.cpp
│ │ ├── TerritoryTexture.h
│ │ ├── TextRenderer.cpp
│ │ ├── TextRenderer.h
│ │ ├── Texture.h
│ │ ├── TextureConverter.cpp
│ │ ├── TextureConverter.h
│ │ ├── TextureManager.cpp
│ │ ├── TextureManager.h
│ │ ├── Unit.cpp
│ │ ├── Unit.h
│ │ ├── UnitAnimation.cpp
│ │ ├── UnitAnimation.h
│ │ ├── UnitManager.cpp
│ │ └── UnitManager.h
│ ├── gui/
│ │ ├── adts/
│ │ │ ├── bit_buf.h
│ │ │ ├── cache_adt.h
│ │ │ ├── dyn_hash_tbl.h
│ │ │ └── ring_buf.h
│ │ ├── allocators/
│ │ │ ├── aligned_allocator.h
│ │ │ ├── allocator_adapters.h
│ │ │ ├── allocator_checker.h
│ │ │ ├── allocator_policies.h
│ │ │ ├── arena.cpp
│ │ │ ├── arena.h
│ │ │ ├── dynarray.cpp
│ │ │ ├── dynarray.h
│ │ │ ├── freelist.cpp
│ │ │ ├── freelist.h
│ │ │ ├── headerless.cpp
│ │ │ ├── headerless.h
│ │ │ ├── overrun_protector.h
│ │ │ ├── page_aligned.cpp
│ │ │ ├── page_aligned.h
│ │ │ ├── pool.cpp
│ │ │ ├── pool.h
│ │ │ ├── shared_ptr.cpp
│ │ │ ├── shared_ptr.h
│ │ │ ├── tests/
│ │ │ │ ├── test_allocators.h
│ │ │ │ └── test_headerless.h
│ │ │ ├── unique_range.cpp
│ │ │ └── unique_range.h
│ │ ├── app_hooks.cpp
│ │ ├── app_hooks.h
│ │ ├── base32.cpp
│ │ ├── base32.h
│ │ ├── bits.cpp
│ │ ├── bits.h
│ │ ├── byte_order.cpp
│ │ ├── byte_order.h
│ │ ├── code_annotation.h
│ │ ├── code_generation.h
│ │ ├── config.h
│ │ ├── config2.h
│ │ ├── debug.cpp
│ │ ├── debug.h
│ │ ├── debug_stl.cpp
│ │ ├── debug_stl.h
│ │ ├── external_libraries/
│ │ │ ├── curl.h
│ │ │ ├── dbghelp.cpp
│ │ │ ├── dbghelp.h
│ │ │ ├── dbghelp_funcs.h
│ │ │ ├── enet.h
│ │ │ ├── glext_funcs.h
│ │ │ ├── icu.h
│ │ │ ├── libsdl.h
│ │ │ ├── libsdl_fwd.h
│ │ │ ├── openal.h
│ │ │ ├── opengl.h
│ │ │ ├── openmp.h
│ │ │ ├── png.h
│ │ │ ├── powrprof.h
│ │ │ ├── suppress_boost_warnings.h
│ │ │ ├── tinygettext.h
│ │ │ ├── vorbis.h
│ │ │ ├── wxwidgets.h
│ │ │ └── zlib.h
│ │ ├── file/
│ │ │ ├── archive/
│ │ │ │ ├── archive.cpp
│ │ │ │ ├── archive.h
│ │ │ │ ├── archive_zip.cpp
│ │ │ │ ├── archive_zip.h
│ │ │ │ ├── codec.cpp
│ │ │ │ ├── codec.h
│ │ │ │ ├── codec_zlib.cpp
│ │ │ │ ├── codec_zlib.h
│ │ │ │ ├── disabled_tests/
│ │ │ │ │ ├── test_codec_zlib.h
│ │ │ │ │ ├── test_compression.h
│ │ │ │ │ ├── test_fat_time.h
│ │ │ │ │ └── test_zip.h
│ │ │ │ ├── stream.cpp
│ │ │ │ └── stream.h
│ │ │ ├── common/
│ │ │ │ ├── file_loader.cpp
│ │ │ │ ├── file_loader.h
│ │ │ │ ├── file_stats.cpp
│ │ │ │ ├── file_stats.h
│ │ │ │ ├── real_directory.cpp
│ │ │ │ ├── real_directory.h
│ │ │ │ ├── tests/
│ │ │ │ │ └── test_trace.h
│ │ │ │ ├── trace.cpp
│ │ │ │ └── trace.h
│ │ │ ├── disabled_tests/
│ │ │ │ ├── test_file_cache.h
│ │ │ │ └── test_path.h
│ │ │ ├── file.cpp
│ │ │ ├── file.h
│ │ │ ├── file_system.cpp
│ │ │ ├── file_system.h
│ │ │ ├── io/
│ │ │ │ ├── io.cpp
│ │ │ │ ├── io.h
│ │ │ │ ├── write_buffer.cpp
│ │ │ │ └── write_buffer.h
│ │ │ └── vfs/
│ │ │ ├── file_cache.cpp
│ │ │ ├── file_cache.h
│ │ │ ├── tests/
│ │ │ │ └── test_vfs_tree.h
│ │ │ ├── vfs.cpp
│ │ │ ├── vfs.h
│ │ │ ├── vfs_lookup.cpp
│ │ │ ├── vfs_lookup.h
│ │ │ ├── vfs_path.cpp
│ │ │ ├── vfs_path.h
│ │ │ ├── vfs_populate.cpp
│ │ │ ├── vfs_populate.h
│ │ │ ├── vfs_tree.cpp
│ │ │ ├── vfs_tree.h
│ │ │ ├── vfs_util.cpp
│ │ │ └── vfs_util.h
│ │ ├── fnv_hash.cpp
│ │ ├── fnv_hash.h
│ │ ├── frequency_filter.cpp
│ │ ├── frequency_filter.h
│ │ ├── input.cpp
│ │ ├── input.h
│ │ ├── lib.cpp
│ │ ├── lib.h
│ │ ├── lib_api.h
│ │ ├── module_init.cpp
│ │ ├── module_init.h
│ │ ├── ogl.cpp
│ │ ├── ogl.h
│ │ ├── os_path.h
│ │ ├── path.cpp
│ │ ├── path.h
│ │ ├── posix/
│ │ │ ├── posix.cpp
│ │ │ └── posix.h
│ │ ├── rand.cpp
│ │ ├── rand.h
│ │ ├── regex.cpp
│ │ ├── regex.h
│ │ ├── res/
│ │ │ └── handle.h
│ │ ├── secure_crt.cpp
│ │ ├── secure_crt.h
│ │ ├── sysdep/
│ │ │ ├── os/
│ │ │ │ ├── unix/
│ │ │ │ │ ├── udbg.cpp
│ │ │ │ │ ├── udbg.h
│ │ │ │ │ ├── ufilesystem.cpp
│ │ │ │ │ ├── unix.cpp
│ │ │ │ │ ├── unix.h
│ │ │ │ │ ├── unix_executable_pathname.cpp
│ │ │ │ │ ├── unix_executable_pathname.h
│ │ │ │ │ ├── unuma.cpp
│ │ │ │ │ ├── unuma.h
│ │ │ │ │ ├── uvm.cpp
│ │ │ │ │ └── x/
│ │ │ │ │ └── x.cpp
│ │ │ │ └── win/
│ │ │ │ ├── aken/
│ │ │ │ │ ├── aken.c
│ │ │ │ │ ├── aken.h
│ │ │ │ │ ├── makefile
│ │ │ │ │ └── sources
│ │ │ │ ├── comctl6.manifest
│ │ │ │ ├── error_dialog.h
│ │ │ │ ├── error_dialog.rc
│ │ │ │ ├── icon.rc
│ │ │ │ ├── mahaf.cpp
│ │ │ │ ├── mahaf.h
│ │ │ │ ├── manifest.cpp
│ │ │ │ ├── manifest.rc
│ │ │ │ ├── tests/
│ │ │ │ │ ├── test_ia32.h
│ │ │ │ │ └── test_wdbg_sym.h
│ │ │ │ ├── wclipboard.cpp
│ │ │ │ ├── wcpu.cpp
│ │ │ │ ├── wcpu.h
│ │ │ │ ├── wcursor.cpp
│ │ │ │ ├── wdbg.cpp
│ │ │ │ ├── wdbg.h
│ │ │ │ ├── wdbg_heap.cpp
│ │ │ │ ├── wdbg_heap.h
│ │ │ │ ├── wdbg_sym.cpp
│ │ │ │ ├── wdbg_sym.h
│ │ │ │ ├── wdir_watch.cpp
│ │ │ │ ├── wdll_delay_load.cpp
│ │ │ │ ├── wdll_delay_load.h
│ │ │ │ ├── wdll_main.h
│ │ │ │ ├── wdll_ver.cpp
│ │ │ │ └── wdll_ver.h
│ │ │ ├── smbios.h
│ │ │ ├── snd.cpp
│ │ │ ├── snd.h
│ │ │ ├── stl.h
│ │ │ ├── sysdep.h
│ │ │ ├── tests/
│ │ │ │ ├── test_rtl.h
│ │ │ │ └── test_sysdep.h
│ │ │ └── vm.h
│ │ ├── tests/
│ │ │ ├── test_adts.h
│ │ │ ├── test_base32.h
│ │ │ ├── test_bits.h
│ │ │ ├── test_byte_order.h
│ │ │ ├── test_cache_adt.h
│ │ │ ├── test_fnv_hash.h
│ │ │ ├── test_lib.h
│ │ │ ├── test_path.h
│ │ │ ├── test_path_util.h
│ │ │ ├── test_rand.h
│ │ │ ├── test_regex.h
│ │ │ ├── test_secure_crt.h
│ │ │ └── test_wchar.h
│ │ ├── tex/
│ │ │ ├── tex.cpp
│ │ │ ├── tex.h
│ │ │ ├── tex_bmp.cpp
│ │ │ ├── tex_codec.cpp
│ │ │ ├── tex_codec.h
│ │ │ ├── tex_dds.cpp
│ │ │ ├── tex_internal.h
│ │ │ ├── tex_png.cpp
│ │ │ └── tex_tga.cpp
│ │ ├── timer.cpp
│ │ ├── timer.h
│ │ ├── types.h
│ │ ├── utf8.cpp
│ │ ├── utf8.h
│ │ └── wsecure_crt.cpp
│ ├── precompiled.cpp
│ ├── precompiled.h
│ ├── stdafx.cpp
│ ├── stdafx.h
│ ├── targetver.h
│ ├── test_Color.h
│ └── tests.py
├── fpsgame.rc
├── fpsgame.sln
├── fpsgame.vcxproj
└── sys/
├── SysControl.cpp
└── SysControl.h
SYMBOL INDEX (1757 symbols across 299 files)
FILE: Test/ActorBash.cpp
function vec3 (line 425) | const vec3 &CActorBase::GetViewDirection() const
function Mat4 (line 493) | Mat4 CActorBase::Get_Body_Transform() const
function CBoundBox (line 588) | const CBoundBox &CActorBase::GetBoundBox() const
function CBoundSphere (line 593) | const CBoundSphere &CActorBase::GetBoundSphere() const
function CWorldBoundBox (line 598) | const CWorldBoundBox & CActorBase::GetWorldBoundBox() const
function CWorldBoundSphere (line 603) | const CWorldBoundSphere & CActorBase::GetWorldBoundSphere() const
FILE: Test/ActorBash.h
function class (line 19) | class CActorBase
FILE: Test/CameraBash.cpp
function vec3 (line 176) | const vec3 &CCameraBase::GetViewDirection() const
FILE: Test/CameraBash.h
function class (line 10) | class CCameraBase : public CPlayer
FILE: Test/Common.cpp
function vec3 (line 15) | vec3 CCommon::GetTransformDirection(const mat4& matTransform, const vec3...
FILE: Test/Common.h
function class (line 6) | class CCommon
FILE: Test/FPSRole.h
function class (line 11) | class CFPSRole :public CRoleBase
FILE: Test/FPSRoleLocal.h
function class (line 6) | class CFPSRoleLocal : public CFPSRole
FILE: Test/GameMain.h
function class (line 3) | class CGameMain
FILE: Test/GameProcess.cpp
function CRoleBase (line 365) | CRoleBase* CGameProcess::GetRole(int nID)
function CRoleBase (line 377) | CRoleBase* CGameProcess::GetRoleFormIndex(int nIndex)
FILE: Test/GameProcess.h
function class (line 13) | class CGameProcess : public CMessageBase
FILE: Test/HMDWrapper.cpp
class CLocalHMDWrapper (line 6) | class CLocalHMDWrapper : public CHMDWrapper
FILE: Test/HMDWrapper.h
function virtual (line 13) | virtual ~CHMDWrapper() {}
FILE: Test/MathLib.h
function class (line 47) | class complex
FILE: Test/MoveDummy.h
function class (line 14) | class CMoveDummy
FILE: Test/RayControl.h
function class (line 9) | class CRayControl : public CSingleton<CRayControl>
FILE: Test/RoleBase.cpp
function CAction (line 106) | CAction* CRoleBase::PlayAction(const char* szName, int nLoop, float fCor...
function CAction (line 117) | CAction* CRoleBase::OrceAction(const char* szName, int nLoop, float fCor...
FILE: Test/RoleBase.h
type _ActionCallback_KeyFrame (line 10) | struct _ActionCallback_KeyFrame
type _ActionCallback_Complete (line 11) | struct _ActionCallback_Complete
function class (line 15) | class CRoleBase
FILE: Test/main.cpp
function main (line 13) | int main(int argc, char* argv[])
FILE: Test/main.h
function main (line 6) | int main(void)
FILE: fpsgame/CommonConvert.cpp
function require_ (line 11) | void require_(int line, bool value, const char* type, const char* message)
function errorHandler (line 24) | void errorHandler(void* ctx, const char* msg, ...)
type FoundInstance (line 164) | struct FoundInstance
function IsVisible_XSI (line 170) | static bool IsVisible_XSI(FCDSceneNode* node, bool& visible)
function IsVisible (line 196) | static bool IsVisible(FCDSceneNode* node)
function FindInstances (line 219) | static void FindInstances(FCDSceneNode* node, std::vector<FoundInstance>...
function FindSingleInstance (line 253) | bool FindSingleInstance(FCDSceneNode* node, FCDEntityInstance*& instance...
function ReverseSortWeight (line 286) | static bool ReverseSortWeight(const FCDJointWeightPair& a, const FCDJoin...
function SkinReduceInfluences (line 291) | void SkinReduceInfluences(FCDSkinController* skin, size_t maxInfluenceCo...
function FixSkeletonRoots (line 351) | void FixSkeletonRoots(FCDControllerInstance& UNUSED(controllerInstance))
function Skeleton (line 369) | const Skeleton& FindSkeleton(const FCDControllerInstance& controllerInst...
function TransformBones (line 385) | void TransformBones(std::vector<BoneTransform>& bones, const FMMatrix44&...
FILE: fpsgame/CommonConvert.h
type OutputCB (line 13) | struct OutputCB
function class (line 22) | class ColladaException : public std::exception
function class (line 41) | class FoclladaErrorHandler
function class (line 59) | class FColladaDocument
FILE: fpsgame/Decompose.cpp
function mat_mult (line 47) | void mat_mult(HMatrix A, HMatrix B, HMatrix AB)
function vdot (line 55) | float vdot(float *va, float *vb)
function vcross (line 61) | void vcross(float *va, float *vb, float *v)
function adjoint_transpose (line 69) | void adjoint_transpose(HMatrix M, HMatrix MadjT)
function Quat (line 79) | Quat Qt_(float x, float y, float z, float w)
function Quat (line 87) | Quat Qt_Conj(Quat q)
function Quat (line 97) | Quat Qt_Mul(Quat qL, Quat qR)
function Quat (line 108) | Quat Qt_Scale(Quat q, float w)
function Quat (line 119) | Quat Qt_FromMatrix(HMatrix mat)
function mat_norm (line 164) | float mat_norm(HMatrix M, int tpose)
function norm_inf (line 177) | float norm_inf(HMatrix M) {return mat_norm(M, 0);}
function norm_one (line 178) | float norm_one(HMatrix M) {return mat_norm(M, 1);}
function find_max_col (line 181) | int find_max_col(HMatrix M)
function make_reflector (line 194) | void make_reflector(float *v, float *u)
function reflect_cols (line 204) | void reflect_cols(HMatrix M, float *u)
function reflect_rows (line 213) | void reflect_rows(HMatrix M, float *u)
function do_rank1 (line 223) | void do_rank1(HMatrix M, HMatrix Q)
function do_rank2 (line 241) | void do_rank2(HMatrix M, HMatrix MadjT, HMatrix Q)
function polar_decomp (line 274) | float polar_decomp(HMatrix M, HMatrix Q, HMatrix S)
function HVect (line 326) | HVect spect_decomp(HMatrix S, HMatrix U)
function Quat (line 381) | Quat snuggle(Quat q, HVect *k)
function decomp_affine (line 486) | void decomp_affine(HMatrix A, AffineParts *parts)
function invert_affine (line 508) | void invert_affine(AffineParts *parts, AffineParts *inverse)
FILE: fpsgame/Decompose.h
type Quat (line 21) | typedef struct {float x, y, z, w;} Quat;
type QuatPart (line 22) | enum QuatPart {X, Y, Z, W}
type Quat (line 23) | typedef Quat HVect;
type AffineParts (line 25) | typedef struct {
FILE: fpsgame/Dll.cpp
function default_logger (line 28) | void default_logger(void*, int severity, const char* message)
function EXPORT (line 36) | EXPORT void set_logger(LogFn logger, void* cb_data)
function EXPORT (line 50) | EXPORT void poll_logger()
function Log (line 59) | void Log(int severity, const char* msg, ...)
type BufferedOutputCallback (line 71) | struct BufferedOutputCallback : public OutputCB
method BufferedOutputCallback (line 80) | BufferedOutputCallback(OutputFn fn, void* cb_data)
function convert_dae_to_whatever (line 115) | int convert_dae_to_whatever(const char* dae, OutputFn writer, void* cb_d...
function EXPORT (line 151) | EXPORT int convert_dae_to_pmd(const char* dae, OutputFn pmd_writer, void...
function EXPORT (line 156) | EXPORT int convert_dae_to_psa(const char* dae, OutputFn psa_writer, void...
function EXPORT (line 161) | EXPORT int set_skeleton_definitions(const char* xml, int length)
FILE: fpsgame/GeomReindex.cpp
type VertexData (line 37) | struct VertexData
method VertexData (line 39) | VertexData(const float* pos, const float* norm, const std::vector<uv_p...
function similar (line 54) | bool similar(float a, float b)
type InserterWithoutDuplicates (line 102) | struct InserterWithoutDuplicates
method InserterWithoutDuplicates (line 104) | InserterWithoutDuplicates(std::vector<T>& vec) : vec(vec)
method add (line 108) | size_t add(const T& val)
function CanonicaliseWeights (line 127) | void CanonicaliseWeights(std::vector<FCDJointWeightPair>& weights)
function ReindexGeometry (line 134) | void ReindexGeometry(FCDGeometryPolygons* polys, FCDSkinController* skin)
FILE: fpsgame/JSInterfaace_GameView.h
function namespace (line 29) | namespace JSI_GameView
FILE: fpsgame/Math.cpp
function DumpMatrix (line 25) | void DumpMatrix(const FMMatrix44& m)
function FMMatrix44 (line 35) | FMMatrix44 DecomposeToScaleMatrix(const FMMatrix44& m)
FILE: fpsgame/PMDConvert.cpp
type VertexBlend (line 48) | struct VertexBlend
type PropPoint (line 55) | struct PropPoint
function FMVector3 (line 66) | static FMVector3 FMVector3_Normalize(const FMVector3& vec)
function AddStaticPropPoints (line 75) | static void AddStaticPropPoints(std::vector<PropPoint> &propPoints, cons...
class PMDConvert (line 120) | class PMDConvert
method ColladaToPMD (line 132) | static void ColladaToPMD(const char* input, OutputCB& output, std::str...
method AddDefaultPropPoints (line 467) | static void AddDefaultPropPoints(std::vector<PropPoint>& propPoints)
method WritePMD (line 481) | static void WritePMD(OutputCB& output,
method FCDGeometryPolygons (line 561) | static FCDGeometryPolygons* GetPolysFromGeometry(FCDGeometry* geom)
method TransformStaticModel (line 586) | static void TransformStaticModel(float* position, float* normal, size_...
method TransformSkinnedModel (line 631) | static void TransformSkinnedModel(float* position, float* normal, size...
function ColladaToPMD (line 718) | void ColladaToPMD(const char* input, OutputCB& output, std::string& xmlE...
FILE: fpsgame/PMDConvert.h
type OutputCB (line 23) | struct OutputCB
FILE: fpsgame/PSAConvert.cpp
class PSAConvert (line 49) | class PSAConvert
method ColladaToPSA (line 61) | static void ColladaToPSA(const char* input, OutputCB& output, std::str...
method WritePSA (line 154) | static void WritePSA(OutputCB& output, size_t frameCount, size_t boneC...
method TransformVertices (line 180) | static void TransformVertices(std::vector<BoneTransform>& bones,
method GetAnimationRange (line 197) | static void GetAnimationRange(const FColladaDocument& doc, const Skele...
method GetAnimationRange_XSI (line 261) | static bool GetAnimationRange_XSI(const FColladaDocument& doc, float& ...
method EvaluateAnimations (line 299) | static void EvaluateAnimations(FCDSceneNode& node, float time)
function ColladaToPSA (line 320) | void ColladaToPSA(const char* input, OutputCB& output, std::string& xmlE...
FILE: fpsgame/PSAConvert.h
type OutputCB (line 23) | struct OutputCB
FILE: fpsgame/SkillSystem.h
function class (line 6) | class CSkillSystem : public CMessageBase //ϵͳ̳Ϣ
FILE: fpsgame/Star2DControl.h
function class (line 9) | class CStar2DControl : public CSingleton < CStar2DControl >
FILE: fpsgame/StartControl.h
function class (line 8) | class CStarControl : public CSingleton<CStarControl>
FILE: fpsgame/StdSkeletons.cpp
type SkeletonMap (line 17) | struct SkeletonMap : public std::map<std::string, const Skeleton*>
method SkeletonMap (line 19) | SkeletonMap()
type Bone (line 32) | struct Bone
function Skeleton (line 41) | const Skeleton* Skeleton::FindSkeleton(const std::string& name)
type Skeleton_impl (line 49) | struct Skeleton_impl
function AlreadyUsedTargetBone (line 79) | bool AlreadyUsedTargetBone(const std::vector<Bone>& bones, int targetId)
function LoadSkeletonBones (line 88) | void LoadSkeletonBones(xmlNode* parent, std::vector<Bone>& bones, const ...
function LoadSkeletonData (line 130) | void LoadSkeletonData(xmlNode* root)
FILE: fpsgame/StdSkeletons.h
type Skeleton_impl (line 8) | struct Skeleton_impl
function class (line 10) | class Sketeton
FILE: fpsgame/XMLFix.cpp
function xmlNode (line 56) | static xmlNode* findChildElement(xmlNode* node, const char* name)
function applyFBXFixesNode (line 66) | static bool applyFBXFixesNode(xmlNode* node)
function applyFBXFixes (line 93) | static bool applyFBXFixes(xmlNode* root)
function processDocument (line 144) | static bool processDocument(xmlNode* root)
function FixBrokenXML (line 164) | void FixBrokenXML(const char* text, const char** out, size_t* outSize)
FILE: fpsgame/graphics/Camera.cpp
function CVector3D (line 209) | CVector3D CCamera::GetWorldCoordinates(int px, int py, bool aboveWater) ...
function CVector3D (line 277) | CVector3D CCamera::GetWorldCoordinates(int px, int py, float h) const
function CVector3D (line 294) | CVector3D CCamera::GetFocus() const
FILE: fpsgame/graphics/Camera.h
type SViewPort (line 31) | struct SViewPort
function class (line 39) | class CCamera
FILE: fpsgame/graphics/CinemaManager.cpp
function InReaction (line 245) | InReaction cinema_manager_handler(const SDL_Event_* ev)
function InReaction (line 256) | InReaction CCinemaManager::HandleEvent(const SDL_Event_* ev)
function CinematicSimulationData (line 284) | CinematicSimulationData* CCinemaManager::GetCinematicSimulationData()
FILE: fpsgame/graphics/CinemaManager.h
type CinematicSimulationData (line 36) | struct CinematicSimulationData
FILE: fpsgame/graphics/CinimaPath.cpp
function CVector3D (line 185) | CVector3D CCinemaPath::GetNodePosition(const int index) const
function fixed (line 190) | fixed CCinemaPath::GetNodeDuration(const int index) const
function fixed (line 195) | fixed CCinemaPath::GetDuration() const
function CStrW (line 210) | CStrW CCinemaPath::GetName() const
function CCinemaData (line 314) | const CCinemaData* CCinemaPath::GetData() const
function fixed (line 364) | fixed CCinemaPath::GetTimescale() const
function TNSpline (line 369) | const TNSpline& CCinemaPath::GetTargetSpline() const
FILE: fpsgame/graphics/CinimaPath.h
function class (line 30) | class CCinemaData
FILE: fpsgame/graphics/ColladaManager.cpp
type Collada (line 33) | namespace Collada
function ColladaLog (line 40) | void ColladaLog(void* cb_data, int severity, const char* text)
function ColladaOutput (line 52) | void ColladaOutput(void* cb_data, const char* data, unsigned int length)
class CColladaManagerImpl (line 59) | class CColladaManagerImpl
method CColladaManagerImpl (line 69) | CColladaManagerImpl(const PIVFS& vfs)
method Status (line 83) | Status ReloadChangedFile(const VfsPath& path)
method Status (line 123) | static Status ReloadChangedFileCB(void* param, const VfsPath& path)
method Convert (line 128) | bool Convert(const VfsPath& daeFilename, const VfsPath& pmdFilename, C...
method TryLoadDLL (line 188) | bool TryLoadDLL()
method LoadSkeletonDefinitions (line 212) | bool LoadSkeletonDefinitions()
method PrepareCacheKey (line 259) | void PrepareCacheKey(MD5& hash, u32& version)
function VfsPath (line 327) | VfsPath CColladaManager::GetLoadablePath(const VfsPath& pathnameNoExtens...
FILE: fpsgame/graphics/ColladaManager.h
function class (line 27) | class CColladaManager
FILE: fpsgame/graphics/Color.h
type CVector3D (line 11) | typedef CVector3D RGBColor;
type CVector4D (line 12) | typedef CVector4D RGBAColor;
FILE: fpsgame/graphics/Decal.cpp
function CModelAbstract (line 25) | CModelAbstract* CModelDecal::Clone() const
FILE: fpsgame/graphics/Decal.h
type SDecal (line 32) | struct SDecal
function class (line 50) | class CModelDecal : public CModelAbstract
FILE: fpsgame/graphics/Entity.h
type Entity (line 24) | struct Entity
FILE: fpsgame/graphics/Font.h
type UnifontGlyphData (line 27) | struct UnifontGlyphData
function class (line 32) | class CFont
FILE: fpsgame/graphics/FontManager.h
function class (line 29) | class CFontManager
FILE: fpsgame/graphics/FontMetrics.h
function class (line 29) | class CFontMetrics
FILE: fpsgame/graphics/Frustum.h
function class (line 39) | class CFrustum
FILE: fpsgame/graphics/GameView.cpp
class CSmoothedValue (line 72) | class CSmoothedValue
method CSmoothedValue (line 75) | CSmoothedValue(float value, float smoothness, float minDelta)
method GetSmoothedValue (line 80) | float GetSmoothedValue()
method SetValueSmoothly (line 85) | void SetValueSmoothly(float value)
method AddSmoothly (line 90) | void AddSmoothly(float value)
method Add (line 95) | void Add(float value)
method GetValue (line 101) | float GetValue()
method SetValue (line 106) | void SetValue(float value)
method Update (line 112) | float Update(float time)
method ClampSmoothly (line 125) | void ClampSmoothly(float min, float max)
method Wrap (line 131) | void Wrap(float min, float max)
class CGameViewImpl (line 152) | class CGameViewImpl
method CGameViewImpl (line 156) | CGameViewImpl(CGame* game)
function SetupCameraMatrixSmooth (line 331) | static void SetupCameraMatrixSmooth(CGameViewImpl* m, CMatrix3D* orienta...
function SetupCameraMatrixSmoothRot (line 339) | static void SetupCameraMatrixSmoothRot(CGameViewImpl* m, CMatrix3D* orie...
function SetupCameraMatrixNonSmooth (line 347) | static void SetupCameraMatrixNonSmooth(CGameViewImpl* m, CMatrix3D* orie...
function CObjectManager (line 386) | CObjectManager& CGameView::GetObjectManager() const
function CCamera (line 391) | CCamera* CGameView::GetCamera()
function CCinemaManager (line 396) | CCinemaManager* CGameView::GetCinema()
function CLOSTexture (line 401) | CLOSTexture& CGameView::GetLOSTexture()
function CTerritoryTexture (line 406) | CTerritoryTexture& CGameView::GetTerritoryTexture()
function FocusHeight (line 556) | static void FocusHeight(CGameViewImpl* m, bool smooth)
function CVector3D (line 614) | CVector3D CGameView::GetSmoothPivot(CCamera& camera) const
function entity_id_t (line 1028) | entity_id_t CGameView::GetFollowedEntity()
function InReaction (line 1053) | InReaction game_view_handler(const SDL_Event_* ev)
function InReaction (line 1064) | InReaction CGameView::HandleEvent(const SDL_Event_* ev)
FILE: fpsgame/graphics/GameView.h
type SViewPort (line 31) | struct SViewPort
function class (line 37) | class CGameView : private Scene
FILE: fpsgame/graphics/HFTracer.cpp
function RayTriIntersect (line 58) | static bool RayTriIntersect(const CVector3D& v0, const CVector3D& v1, co...
function TestTile (line 236) | static bool TestTile(u16* heightmap, int stride, int i, int j, const CVe...
FILE: fpsgame/graphics/HFTracer.h
function class (line 31) | class CHFTracer
FILE: fpsgame/graphics/HeightMipmap.h
type SMipmap (line 29) | struct SMipmap
FILE: fpsgame/graphics/LOSTexture.cpp
function GLuint (line 125) | GLuint CLOSTexture::GetTextureSmooth()
function GLuint (line 221) | GLuint CLOSTexture::GetTexture()
function CMatrix3D (line 232) | const CMatrix3D& CLOSTexture::GetTextureMatrix()
function CMatrix3D (line 238) | const CMatrix3D* CLOSTexture::GetMinimapTextureMatrix()
FILE: fpsgame/graphics/LOSTexture.h
function class (line 32) | class CLOSTexture
FILE: fpsgame/graphics/LightEnv.h
function class (line 36) | class CLightEnv
FILE: fpsgame/graphics/MapGenerator.cpp
type AutoFree (line 86) | struct AutoFree {
method AutoFree (line 87) | AutoFree(ScriptInterface* p) : m_p(p) {}
function CParamNode (line 225) | CParamNode CMapGeneratorWorker::GetTemplate(ScriptInterface::CxPrivate* ...
FILE: fpsgame/graphics/MapGenerator.h
function class (line 38) | class CMapGenerator
function class (line 83) | class CMapGeneratorWorker
FILE: fpsgame/graphics/MapIO.h
function class (line 21) | class CMapIO
FILE: fpsgame/graphics/MapReader.cpp
function PSRETURN (line 356) | PSRETURN CMapSummaryReader::LoadMap(const VfsPath& pathname)
class CXMLReader (line 408) | class CXMLReader
method CXMLReader (line 412) | CXMLReader(const VfsPath& xml_filename, CMapReader& mapReader)
function XERO_ITER_EL (line 511) | XERO_ITER_EL(ents, ent)
function CStr (line 519) | CStr CXMLReader::ReadScriptSettings()
function XERO_ITER_ATTR (line 545) | XERO_ITER_ATTR(parent, attr)
function XERO_ITER_EL (line 627) | XERO_ITER_EL(parent, element)
function XERO_ITER_EL (line 809) | XERO_ITER_EL(parent, element)
function XERO_ITER_EL (line 865) | XERO_ITER_EL(parent, element)
function XERO_ITER_EL (line 988) | XERO_ITER_EL(entity, setting)
FILE: fpsgame/graphics/MapReader.h
function class (line 45) | class CMapReader : public CMapIO
function class (line 162) | class CMapSummaryReader
FILE: fpsgame/graphics/MapWriter.cpp
function u16 (line 85) | static u16 GetEntryIndex(const CTerrainTextureEntry* entry, const std::v...
FILE: fpsgame/graphics/MapWriter.h
type MapTrigger (line 37) | struct MapTrigger
type MapTriggerGroup (line 38) | struct MapTriggerGroup
function class (line 41) | class CMapWriter : public CMapIO
FILE: fpsgame/graphics/Material.h
function class (line 28) | class CMaterial
FILE: fpsgame/graphics/MaterialManager.cpp
function CMaterial (line 44) | CMaterial CMaterialManager::LoadMaterial(const VfsPath& pathname)
FILE: fpsgame/graphics/MaterialManager.h
function class (line 25) | class CMaterialManager
FILE: fpsgame/graphics/MeshManager.cpp
function CModelDefPtr (line 41) | CModelDefPtr CMeshManager::GetMesh(const VfsPath& pathname)
FILE: fpsgame/graphics/MeshManager.h
type std (line 27) | typedef std::shared_ptr<CModelDef> CModelDefPtr;
function class (line 31) | class CMeshManager
FILE: fpsgame/graphics/MiniPatch.h
function class (line 31) | class CMiniPatch
FILE: fpsgame/graphics/Model.cpp
function CBoundingBoxAligned (line 195) | const CBoundingBoxAligned CModel::GetWorldBoundsRec()
function CBoundingBoxAligned (line 203) | const CBoundingBoxAligned CModel::GetObjectSelectionBoundsRec()
function CSkeletonAnim (line 258) | CSkeletonAnim* CModel::BuildAnimation(const VfsPath& pathname, const CSt...
function CModelAbstract (line 572) | CModelAbstract* CModel::FindFirstAmmoProp()
function CModelAbstract (line 593) | CModelAbstract* CModel::Clone() const
FILE: fpsgame/graphics/Model.h
type SPropPoint (line 32) | struct SPropPoint
function class (line 48) | class CModel : public CModelAbstract
FILE: fpsgame/graphics/ModelAbstract.cpp
function CBoundingBoxOriented (line 24) | const CBoundingBoxOriented& CModelAbstract::GetSelectionBox()
FILE: fpsgame/graphics/ModelAbstract.h
function class (line 36) | class CModelAbstract : public CRenderableObject
FILE: fpsgame/graphics/ModelDef.cpp
function CVector3D (line 33) | CVector3D CModelDef::SkinPoint(const SModelVertex& vtx,
function CVector3D (line 46) | CVector3D CModelDef::SkinNormal(const SModelVertex& vtx,
function SPropPoint (line 251) | const SPropPoint* CModelDef::FindPropPoint(const char* name) const
function CModelDef (line 261) | CModelDef* CModelDef::Load(const VfsPath& filename, const VfsPath& name)
function CModelDefRPrivate (line 465) | CModelDefRPrivate* CModelDef::GetRenderData(const void* key) const
FILE: fpsgame/graphics/ModelDef.h
type SPropPoint (line 48) | struct SPropPoint
type SVertexBlend (line 85) | struct SVertexBlend
type SModelVertex (line 101) | struct SModelVertex
type SModelFace (line 116) | struct SModelFace
function class (line 125) | class CModelDefRPrivate
function class (line 136) | class CModelDef
FILE: fpsgame/graphics/ObjectBase.cpp
function XERO_ITER_ATTR (line 82) | XERO_ITER_ATTR(variant, attr)
function XERO_ITER_EL (line 105) | XERO_ITER_EL(variant, option)
function XERO_ITER_EL (line 247) | XERO_ITER_EL(root, child)
function XERO_ITER_EL (line 264) | XERO_ITER_EL(root, child)
FILE: fpsgame/graphics/ObjectBase.h
type Samp (line 74) | struct Samp
type Variant (line 93) | struct Variant
FILE: fpsgame/graphics/ObjectEntry.cpp
function CSkeletonAnim (line 256) | CSkeletonAnim* CObjectEntry::GetRandomAnimation(const CStr& animationNam...
FILE: fpsgame/graphics/ObjectEntry.h
type SPropPoint (line 26) | struct SPropPoint
function class (line 38) | class CObjectEntry
FILE: fpsgame/graphics/ObjectManager.cpp
function Status (line 44) | static Status ReloadChangedFileCB(void* param, const VfsPath& path)
function CObjectBase (line 66) | CObjectBase* CObjectManager::FindObjectBase(const CStrW& objectname)
function CObjectEntry (line 95) | CObjectEntry* CObjectManager::FindObject(const CStrW& objname)
function CObjectEntry (line 101) | CObjectEntry* CObjectManager::FindObjectVariation(const CStrW& objname, ...
function CObjectEntry (line 111) | CObjectEntry* CObjectManager::FindObjectVariation(CObjectBase* base, con...
function CTerrain (line 150) | CTerrain* CObjectManager::GetTerrain()
function Status (line 182) | Status CObjectManager::ReloadChangedFile(const VfsPath& path)
FILE: fpsgame/graphics/ObjectManager.h
function class (line 37) | class CObjectManager
FILE: fpsgame/graphics/Overlay.h
type SOverlayLine (line 35) | struct SOverlayLine
function PushCoords (line 61) | struct SOverlayTexturedLine
function PushCoords (line 125) | void PushCoords(const std::vector<CVector2D>& points)
type SOverlaySprite (line 136) | struct SOverlaySprite
type SOverlayQuad (line 149) | struct SOverlayQuad
type SOverlaySphere (line 157) | struct SOverlaySphere
FILE: fpsgame/graphics/ParticleEmitter.cpp
function CModelAbstract (line 262) | CModelAbstract* CModelParticleEmitter::Clone() const
FILE: fpsgame/graphics/ParticleEmitter.h
type SParticle (line 32) | struct SParticle
type shared_ptr (line 45) | typedef shared_ptr<CParticleEmitter> CParticleEmitterPtr;
function class (line 67) | class CParticleEmitter
function class (line 176) | class CModelParticleEmitter : public CModelAbstract
FILE: fpsgame/graphics/ParticleEmitterType.cpp
class IParticleVar (line 40) | class IParticleVar
method IParticleVar (line 43) | IParticleVar() : m_LastValue(0) { }
method Evaluate (line 47) | float Evaluate(CParticleEmitter& emitter)
method LastValue (line 59) | float LastValue() { return m_LastValue; }
class CParticleVarConstant (line 83) | class CParticleVarConstant : public IParticleVar
method CParticleVarConstant (line 86) | CParticleVarConstant(float val) :
method Compute (line 91) | virtual float Compute(CParticleEmitterType& UNUSED(type), CParticleEmi...
method Min (line 96) | virtual float Min(CParticleEmitterType& UNUSED(type))
method Max (line 101) | virtual float Max(CParticleEmitterType& UNUSED(type))
class CParticleVarUniform (line 113) | class CParticleVarUniform : public IParticleVar
method CParticleVarUniform (line 116) | CParticleVarUniform(float min, float max) :
method Compute (line 121) | virtual float Compute(CParticleEmitterType& type, CParticleEmitter& UN...
method Min (line 126) | virtual float Min(CParticleEmitterType& UNUSED(type))
method Max (line 131) | virtual float Max(CParticleEmitterType& UNUSED(type))
class CParticleVarCopy (line 145) | class CParticleVarCopy : public IParticleVar
method CParticleVarCopy (line 148) | CParticleVarCopy(int from) :
method Compute (line 153) | virtual float Compute(CParticleEmitterType& type, CParticleEmitter& UN...
method Min (line 158) | virtual float Min(CParticleEmitterType& type)
method Max (line 163) | virtual float Max(CParticleEmitterType& type)
class CParticleVarExpr (line 176) | class CParticleVarExpr : public IParticleVar
method CParticleVarExpr (line 179) | CParticleVarExpr(const CStr& from, float mul, float max) :
method Compute (line 184) | virtual float Compute(CParticleEmitterType& UNUSED(type), CParticleEmi...
method Min (line 189) | virtual float Min(CParticleEmitterType& UNUSED(type))
method Max (line 194) | virtual float Max(CParticleEmitterType& UNUSED(type))
class IParticleEffector (line 211) | class IParticleEffector
method IParticleEffector (line 214) | IParticleEffector() { }
class CParticleEffectorForce (line 228) | class CParticleEffectorForce : public IParticleEffector
method CParticleEffectorForce (line 231) | CParticleEffectorForce(float x, float y, float z) :
method Evaluate (line 236) | virtual void Evaluate(std::vector<SParticle>& particles, float dt)
method CVector3D (line 244) | virtual CVector3D Max()
function XERO_ITER_EL (line 395) | XERO_ITER_EL(Root, Child)
function CBoundingBoxAligned (line 600) | CBoundingBoxAligned CParticleEmitterType::CalculateBounds(CVector3D emit...
FILE: fpsgame/graphics/ParticleEmitterType.h
function class (line 43) | class CParticleEmitterType
type shared_ptr (line 115) | typedef shared_ptr<CParticleEmitterType> CParticleEmitterTypePtr;
FILE: fpsgame/graphics/ParticleManager.cpp
function Status (line 26) | static Status ReloadChangedFileCB(void* param, const VfsPath& path)
function CParticleEmitterTypePtr (line 42) | CParticleEmitterTypePtr CParticleManager::LoadEmitterType(const VfsPath&...
type EmitterHasNoParticles (line 68) | struct EmitterHasNoParticles
function Status (line 96) | Status CParticleManager::ReloadChangedFile(const VfsPath& path)
FILE: fpsgame/graphics/ParticleManager.h
function class (line 29) | class CParticleManager
FILE: fpsgame/graphics/Patch.h
type CPatchSideFlags (line 38) | enum CPatchSideFlags
function class (line 48) | class CPatch : public CRenderableObject
FILE: fpsgame/graphics/RenderableObject.h
function class (line 41) | class CRenderData
function class (line 54) | class CRenderableObject
FILE: fpsgame/graphics/SColor.h
type SColor3ub (line 4) | struct SColor3ub
type SColor4ub (line 11) | struct SColor4ub
FILE: fpsgame/graphics/ShaderDefines.cpp
function hash_value (line 28) | size_t hash_value(const CVector4D& v)
function hash_value (line 38) | size_t hash_value(const CShaderParams<CStrIntern>::SItems& items)
function hash_value (line 43) | size_t hash_value(const CShaderParams<CVector4D>::SItems& items)
type ItemNameCmp (line 59) | struct ItemNameCmp
type ItemNameGeq (line 72) | struct ItemNameGeq
function CVector4D (line 217) | CVector4D CShaderUniforms::GetVector(const char* name) const
class CShaderParams<CStrIntern> (line 280) | class CShaderParams<CStrIntern>
class CShaderParams<CVector4D> (line 281) | class CShaderParams<CVector4D>
FILE: fpsgame/graphics/ShaderDefines.h
function GetHash (line 67) | size_t GetHash() const;
type SItems (line 95) | struct SItems
function class (line 133) | class CShaderDefines : public CShaderParams<CStrIntern>
function class (line 154) | class CShaderUniforms : public CShaderParams<CVector4D>
type RENDER_QUERIES (line 175) | enum RENDER_QUERIES
function class (line 187) | class CShaderRenderQueries
type DEFINE_CONDITION_TYPES (line 200) | enum DEFINE_CONDITION_TYPES
function class (line 205) | class CShaderConditionalDefines
FILE: fpsgame/graphics/ShaderManager.cpp
function CShaderProgramPtr (line 60) | CShaderProgramPtr CShaderManager::LoadProgram(const char* name, const CS...
function GLenum (line 78) | static GLenum ParseAttribSemantics(const CStr& str)
function XERO_ITER_EL (line 173) | XERO_ITER_EL(Root, Child)
function GLenum (line 277) | static GLenum ParseComparisonFunc(const CStr& str)
function GLenum (line 299) | static GLenum ParseBlendFunc(const CStr& str)
function CShaderTechniquePtr (line 349) | CShaderTechniquePtr CShaderManager::LoadEffect(CStrIntern name)
function CShaderTechniquePtr (line 354) | CShaderTechniquePtr CShaderManager::LoadEffect(CStrIntern name, const CS...
function XERO_ITER_EL (line 441) | XERO_ITER_EL(Root, Technique)
function XERO_ITER_EL (line 516) | XERO_ITER_EL(Child, Element)
function Status (line 559) | Status CShaderManager::ReloadChangedFileCB(void* param, const VfsPath& p...
function Status (line 564) | Status CShaderManager::ReloadChangedFile(const VfsPath& path)
FILE: fpsgame/graphics/ShaderManager.h
function class (line 42) | class CShaderManager
FILE: fpsgame/graphics/ShaderProgram.cpp
class CShaderProgramARB (line 34) | class CShaderProgramARB : public CShaderProgram
method CShaderProgramARB (line 37) | CShaderProgramARB(const VfsPath& vertexFile, const VfsPath& fragmentFile,
method Compile (line 58) | bool Compile(GLuint target, const char* targetName, GLuint program, co...
method Reload (line 85) | virtual void Reload()
method Unload (line 115) | void Unload()
method Bind (line 120) | virtual void Bind()
method Unbind (line 130) | virtual void Unbind()
method GetUniformVertexIndex (line 142) | int GetUniformVertexIndex(CStrIntern id)
method frag_index_pair_t (line 150) | frag_index_pair_t GetUniformFragmentIndex(CStrIntern id)
method Binding (line 158) | virtual Binding GetTextureBinding(texture_id_t id)
method BindTexture (line 168) | virtual void BindTexture(texture_id_t id, Handle tex)
method BindTexture (line 181) | virtual void BindTexture(texture_id_t id, GLuint tex)
method BindTexture (line 192) | virtual void BindTexture(Binding id, Handle tex)
method Binding (line 199) | virtual Binding GetUniformBinding(uniform_id_t id)
method Uniform (line 204) | virtual void Uniform(Binding id, float v0, float v1, float v2, float v3)
method Uniform (line 213) | virtual void Uniform(Binding id, const CMatrix3D& v)
method Uniform (line 232) | virtual void Uniform(Binding id, size_t count, const CMatrix3D* v)
class CShaderProgramGLSL (line 259) | class CShaderProgramGLSL : public CShaderProgram
method CShaderProgramGLSL (line 262) | CShaderProgramGLSL(const VfsPath& vertexFile, const VfsPath& fragmentF...
method Compile (line 284) | bool Compile(GLhandleARB shader, const VfsPath& file, const CStr& code)
method Link (line 325) | bool Link()
method Reload (line 421) | virtual void Reload()
method Unload (line 471) | void Unload()
method Bind (line 482) | virtual void Bind()
method Unbind (line 490) | virtual void Unbind()
method Binding (line 500) | virtual Binding GetTextureBinding(texture_id_t id)
method BindTexture (line 509) | virtual void BindTexture(texture_id_t id, Handle tex)
method BindTexture (line 521) | virtual void BindTexture(texture_id_t id, GLuint tex)
method BindTexture (line 531) | virtual void BindTexture(Binding id, Handle tex)
method Binding (line 542) | virtual Binding GetUniformBinding(uniform_id_t id)
method Uniform (line 551) | virtual void Uniform(Binding id, float v0, float v1, float v2, float v3)
method Uniform (line 568) | virtual void Uniform(Binding id, const CMatrix3D& v)
method Uniform (line 579) | virtual void Uniform(Binding id, size_t count, const CMatrix3D* v)
method VertexPointer (line 593) | virtual void VertexPointer(GLint size, GLenum type, GLsizei stride, vo...
method NormalPointer (line 599) | virtual void NormalPointer(GLenum type, GLsizei stride, void* pointer)
method ColorPointer (line 605) | virtual void ColorPointer(GLint size, GLenum type, GLsizei stride, voi...
method TexCoordPointer (line 611) | virtual void TexCoordPointer(GLenum texture, GLint size, GLenum type, ...
method VertexAttribPointer (line 617) | virtual void VertexAttribPointer(attrib_id_t id, GLint size, GLenum ty...
method VertexAttribIPointer (line 626) | virtual void VertexAttribIPointer(attrib_id_t id, GLint size, GLenum t...
function CShaderProgram (line 661) | CShaderProgram* CShaderProgram::ConstructARB(const VfsPath& vertexFile, ...
function CShaderProgram (line 671) | CShaderProgram* CShaderProgram::ConstructARB(const VfsPath& vertexFile, ...
function CShaderProgram (line 680) | CShaderProgram* CShaderProgram::ConstructGLSL(const VfsPath& vertexFile,...
FILE: fpsgame/graphics/ShaderProgram.h
type CColor (line 29) | struct CColor
function class (line 65) | class CShaderProgram
function virtual (line 121) | virtual ~CShaderProgram() { }
FILE: fpsgame/graphics/ShaderProgramFFP.cpp
class CShaderProgramFFP (line 41) | class CShaderProgramFFP : public CShaderProgram
method CShaderProgramFFP (line 44) | CShaderProgramFFP(int streamflags) :
method Reload (line 53) | virtual void Reload()
method GetUniformIndex (line 58) | int GetUniformIndex(CStrIntern id)
method Binding (line 66) | virtual Binding GetTextureBinding(uniform_id_t id)
method BindTexture (line 75) | virtual void BindTexture(texture_id_t id, Handle tex)
method BindTexture (line 82) | virtual void BindTexture(texture_id_t id, GLuint tex)
method BindTexture (line 92) | virtual void BindTexture(Binding id, Handle tex)
method Binding (line 99) | virtual Binding GetUniformBinding(uniform_id_t id)
method Uniform (line 104) | virtual void Uniform(Binding UNUSED(id), float UNUSED(v0), float UNUSE...
method Uniform (line 108) | virtual void Uniform(Binding UNUSED(id), const CMatrix3D& UNUSED(v))
method Uniform (line 112) | virtual void Uniform(Binding UNUSED(id), size_t UNUSED(count), const C...
method SetUniformIndex (line 119) | void SetUniformIndex(const char* id, int value)
class CShaderProgramFFP_Dummy (line 132) | class CShaderProgramFFP_Dummy : public CShaderProgramFFP
method CShaderProgramFFP_Dummy (line 135) | CShaderProgramFFP_Dummy() :
method Bind (line 142) | virtual void Bind()
method Unbind (line 147) | virtual void Unbind()
class CShaderProgramFFP_OverlayLine (line 155) | class CShaderProgramFFP_OverlayLine : public CShaderProgramFFP
method CShaderProgramFFP_OverlayLine (line 168) | CShaderProgramFFP_OverlayLine(const CShaderDefines& defines) :
method IsIgnoreLos (line 187) | bool IsIgnoreLos()
method Uniform (line 192) | virtual void Uniform(Binding id, float v0, float v1, float v2, float v3)
method Uniform (line 214) | virtual void Uniform(Binding UNUSED(id), const CMatrix3D& UNUSED(v))
method Bind (line 219) | virtual void Bind()
method Unbind (line 307) | virtual void Unbind()
class CShaderProgramFFP_GuiText (line 327) | class CShaderProgramFFP_GuiText : public CShaderProgramFFP
method CShaderProgramFFP_GuiText (line 337) | CShaderProgramFFP_GuiText() :
method Uniform (line 347) | virtual void Uniform(Binding id, float v0, float v1, float v2, float v3)
method Uniform (line 353) | virtual void Uniform(Binding id, const CMatrix3D& v)
method Bind (line 359) | virtual void Bind()
method Unbind (line 374) | virtual void Unbind()
class CShaderProgramFFP_Gui_Base (line 390) | class CShaderProgramFFP_Gui_Base : public CShaderProgramFFP
method CShaderProgramFFP_Gui_Base (line 401) | CShaderProgramFFP_Gui_Base(int streamflags) :
method Uniform (line 411) | virtual void Uniform(Binding id, const CMatrix3D& v)
method Bind (line 417) | virtual void Bind()
method Unbind (line 428) | virtual void Unbind()
class CShaderProgramFFP_GuiMinimap (line 439) | class CShaderProgramFFP_GuiMinimap : public CShaderProgramFFP
method CShaderProgramFFP_GuiMinimap (line 452) | CShaderProgramFFP_GuiMinimap(const CShaderDefines& defines) :
method Uniform (line 472) | virtual void Uniform(Binding id, const CMatrix3D& v)
method Uniform (line 486) | virtual void Uniform(Binding id, float v0, float v1, float v2, float v3)
method Bind (line 494) | virtual void Bind()
method Unbind (line 545) | virtual void Unbind()
class CShaderProgramFFP_GuiBasic (line 572) | class CShaderProgramFFP_GuiBasic : public CShaderProgramFFP_Gui_Base
method CShaderProgramFFP_GuiBasic (line 575) | CShaderProgramFFP_GuiBasic() :
method Bind (line 580) | virtual void Bind()
method Unbind (line 589) | virtual void Unbind()
class CShaderProgramFFP_GuiAdd (line 598) | class CShaderProgramFFP_GuiAdd : public CShaderProgramFFP_Gui_Base
method CShaderProgramFFP_GuiAdd (line 603) | CShaderProgramFFP_GuiAdd() :
method Uniform (line 608) | virtual void Uniform(Binding id, float v0, float v1, float v2, float v3)
method Bind (line 614) | virtual void Bind()
method Unbind (line 637) | virtual void Unbind()
class CShaderProgramFFP_GuiGrayscale (line 648) | class CShaderProgramFFP_GuiGrayscale : public CShaderProgramFFP_Gui_Base
method CShaderProgramFFP_GuiGrayscale (line 651) | CShaderProgramFFP_GuiGrayscale() :
method Bind (line 656) | virtual void Bind()
method Unbind (line 757) | virtual void Unbind()
class CShaderProgramFFP_GuiSolid (line 771) | class CShaderProgramFFP_GuiSolid : public CShaderProgramFFP_Gui_Base
method CShaderProgramFFP_GuiSolid (line 776) | CShaderProgramFFP_GuiSolid() :
method Uniform (line 781) | virtual void Uniform(Binding id, float v0, float v1, float v2, float v3)
method Bind (line 787) | virtual void Bind()
class CShaderProgramFFP_Model_Base (line 801) | class CShaderProgramFFP_Model_Base : public CShaderProgramFFP
method CShaderProgramFFP_Model_Base (line 816) | CShaderProgramFFP_Model_Base(const CShaderDefines& defines, int stream...
method Uniform (line 835) | virtual void Uniform(Binding id, const CMatrix3D& v)
method Uniform (line 841) | virtual void Uniform(Binding id, float v0, float v1, float UNUSED(v2),...
method Bind (line 853) | virtual void Bind()
method Unbind (line 900) | virtual void Unbind()
class CShaderProgramFFP_Model (line 922) | class CShaderProgramFFP_Model : public CShaderProgramFFP_Model_Base
method CShaderProgramFFP_Model (line 925) | CShaderProgramFFP_Model(const CShaderDefines& defines)
method Bind (line 930) | virtual void Bind()
method Unbind (line 955) | virtual void Unbind()
class CShaderProgramFFP_ModelColor (line 970) | class CShaderProgramFFP_ModelColor : public CShaderProgramFFP_Model_Base
method CShaderProgramFFP_ModelColor (line 973) | CShaderProgramFFP_ModelColor(const CShaderDefines& defines)
method Uniform (line 978) | virtual void Uniform(Binding id, float v0, float v1, float v2, float v3)
method Bind (line 988) | virtual void Bind()
method Unbind (line 1057) | virtual void Unbind()
class CShaderProgramFFP_ModelSolid (line 1077) | class CShaderProgramFFP_ModelSolid : public CShaderProgramFFP_Model_Base
method CShaderProgramFFP_ModelSolid (line 1080) | CShaderProgramFFP_ModelSolid(const CShaderDefines& defines)
method Uniform (line 1085) | virtual void Uniform(Binding id, float v0, float v1, float v2, float v3)
method Bind (line 1094) | virtual void Bind()
class CShaderProgramFFP_ModelSolidTex (line 1116) | class CShaderProgramFFP_ModelSolidTex : public CShaderProgramFFP_Model_Base
method CShaderProgramFFP_ModelSolidTex (line 1119) | CShaderProgramFFP_ModelSolidTex(const CShaderDefines& defines)
method Bind (line 1124) | virtual void Bind()
function CShaderProgram (line 1136) | CShaderProgram* CShaderProgram::ConstructFFP(const std::string& id, cons...
function CShaderProgram (line 1172) | CShaderProgram* CShaderProgram::ConstructFFP(const std::string& UNUSED(i...
FILE: fpsgame/graphics/ShaderProgramPtr.h
type std (line 26) | typedef std::shared_ptr<CShaderProgram> CShaderProgramPtr;
FILE: fpsgame/graphics/ShaderTechnique.cpp
function CShaderProgramPtr (line 144) | const CShaderProgramPtr& CShaderTechnique::GetShader(int pass) const
FILE: fpsgame/graphics/ShaderTechnique.h
function class (line 28) | class CShaderPass
FILE: fpsgame/graphics/SkeletonAnim.h
function class (line 32) | class CSkeletonAnim
FILE: fpsgame/graphics/SkeletonAnimDef.cpp
function CSkeletonAnimDef (line 90) | CSkeletonAnimDef* CSkeletonAnimDef::Load(const VfsPath& filename)
FILE: fpsgame/graphics/SkeletonAnimDef.h
function class (line 31) | class CBoneState
function class (line 44) | class CSkeletonAnimDef
FILE: fpsgame/graphics/SkeletonAnimManager.cpp
function CSkeletonAnimDef (line 52) | CSkeletonAnimDef* CSkeletonAnimManager::GetAnimation(const VfsPath& path...
FILE: fpsgame/graphics/SkeletonAnimManager.h
function class (line 37) | class CSkeletonAnimManager
FILE: fpsgame/graphics/Terrain.cpp
function CStr8 (line 106) | CStr8 CTerrain::GetMovementClass(ssize_t i, ssize_t j) const
function CVector3D (line 236) | CVector3D CTerrain::CalcExactNormal(float x, float z) const
function CPatch (line 284) | CPatch* CTerrain::GetPatch(ssize_t i, ssize_t j) const
function CMiniPatch (line 299) | CMiniPatch* CTerrain::GetTile(ssize_t i, ssize_t j) const
function fixed (line 316) | fixed CTerrain::GetVertexGroundLevelFixed(ssize_t i, ssize_t j) const
function fixed (line 324) | fixed CTerrain::GetSlopeFixed(ssize_t i, ssize_t j) const
function fixed (line 343) | fixed CTerrain::GetExactSlopeFixed(fixed x, fixed z) const
function fixed (line 451) | fixed CTerrain::GetExactGroundLevelFixed(fixed x, fixed z) const
function CBoundingBoxAligned (line 698) | CBoundingBoxAligned CTerrain::GetVertexesBound(ssize_t i0, ssize_t j0, s...
FILE: fpsgame/graphics/Terrain.h
function class (line 51) | class CTerrain
FILE: fpsgame/graphics/TerrainProperties.cpp
function CTerrainPropertiesPtr (line 46) | CTerrainPropertiesPtr CTerrainProperties::FromXML(const CTerrainProperti...
function XERO_ITER_ATTR (line 105) | XERO_ITER_ATTR(node, attr)
function u32 (line 152) | u32 CTerrainProperties::GetBaseColor()
FILE: fpsgame/graphics/TerrainProperties.h
type shared_ptr (line 40) | typedef shared_ptr<CTerrainProperties> CTerrainPropertiesPtr;
function class (line 42) | class CTerrainProperties
FILE: fpsgame/graphics/TerrainTextureEntry.cpp
function XERO_ITER_EL (line 83) | XERO_ITER_EL(root, child)
FILE: fpsgame/graphics/TerrainTextureEntry.h
function class (line 38) | class CTerrainTextureEntry
function CTexturePtr (line 81) | const CTexturePtr& GetTexture() {
function CMaterial (line 85) | const CMaterial& GetMaterial() {
function u32 (line 94) | u32 GetBaseColor() {
FILE: fpsgame/graphics/TerrainTextureManager.cpp
function CTerrainTextureEntry (line 73) | CTerrainTextureEntry* CTerrainTextureManager::FindTexture(const CStr& ta...
function CTerrainTextureEntry (line 85) | CTerrainTextureEntry* CTerrainTextureManager::AddTexture(const CTerrainP...
type AddTextureCallbackData (line 101) | struct AddTextureCallbackData
function Status (line 107) | static Status AddTextureDirCallback(const VfsPath& pathname, const uintp...
function Status (line 119) | static Status AddTextureCallback(const VfsPath& pathname, const CFileInf...
function CTerrainGroup (line 135) | CTerrainGroup* CTerrainTextureManager::FindGroup(const CStr& name)
FILE: fpsgame/graphics/TerrainTextureManager.h
type shared_ptr (line 41) | typedef shared_ptr<CTerrainProperties> CTerrainPropertiesPtr;
function class (line 43) | class CTerrainGroup
type TerrainAlpha (line 74) | struct TerrainAlpha
function class (line 87) | class CTerrainTextureManager : public Singleton<CTerrainTextureManager>
FILE: fpsgame/graphics/TerritoryBoundary.h
type STerritoryBoundary (line 37) | struct STerritoryBoundary
function class (line 51) | class CTerritoryBoundaryCalculator
FILE: fpsgame/graphics/TerritoryTexture.cpp
function GLuint (line 70) | GLuint CTerritoryTexture::GetTexture()
function CMatrix3D (line 84) | const CMatrix3D* CTerritoryTexture::GetMinimapTextureMatrix()
FILE: fpsgame/graphics/TerritoryTexture.h
function class (line 29) | class CTerritoryTexture
FILE: fpsgame/graphics/TextRenderer.cpp
function CMatrix3D (line 53) | CMatrix3D CTextRenderer::GetTransform()
type t2f_v2i (line 203) | struct t2f_v2i
method t2f_v2i (line 205) | t2f_v2i() : u(0), v(0), x(0), y(0) { }
type SBatchCompare (line 210) | struct SBatchCompare
FILE: fpsgame/graphics/TextRenderer.h
function class (line 28) | class CTextRenderer
type SBatch (line 153) | struct SBatch
FILE: fpsgame/graphics/Texture.h
type std (line 23) | typedef std::shared_ptr<CTexture> CTexturePtr;
FILE: fpsgame/graphics/TextureConverter.cpp
type BufferOutputHandler (line 40) | struct BufferOutputHandler : public nvtt::OutputHandler
method beginImage (line 44) | virtual void beginImage(int UNUSED(size), int UNUSED(width), int UNUSE...
method writeData (line 48) | virtual bool writeData(const void* data, int size)
type CTextureConverter::ConversionRequest (line 60) | struct CTextureConverter::ConversionRequest
type CTextureConverter::ConversionResult (line 74) | struct CTextureConverter::ConversionResult
function XERO_ITER_EL (line 129) | XERO_ITER_EL(root, child)
FILE: fpsgame/graphics/TextureConverter.h
type EFormat (line 66) | enum EFormat
type EMipmap (line 76) | enum EMipmap
type ENormalMap (line 83) | enum ENormalMap
type EAlpha (line 90) | enum EAlpha
type EFilter (line 98) | enum EFilter
type Match (line 136) | struct Match
type SettingsFile (line 145) | struct SettingsFile
type ConversionRequest (line 211) | struct ConversionRequest
type ConversionResult (line 212) | struct ConversionResult
FILE: fpsgame/graphics/TextureManager.cpp
type TPhash (line 39) | struct TPhash
type TPequal_to (line 60) | struct TPequal_to
function hash_value (line 76) | std::size_t hash_value(const CTexturePtr& v)
function hash_value (line 81) | std::size_t hash_value(const CTextureProperties& v)
class CTextureManagerImpl (line 87) | class CTextureManagerImpl
method CTextureManagerImpl (line 91) | CTextureManagerImpl(PIVFS vfs, bool highQuality, bool disableGL) :
method CTexturePtr (line 150) | CTexturePtr GetErrorTexture()
method CTexturePtr (line 158) | CTexturePtr CreateTexture(const CTextureProperties& props)
method LoadTexture (line 180) | void LoadTexture(const CTexturePtr& texture, const VfsPath& path)
method PrepareCacheKey (line 247) | void PrepareCacheKey(const CTexturePtr& texture, MD5& hash, u32& version)
method TryLoadingCached (line 264) | bool TryLoadingCached(const CTexturePtr& texture)
method ConvertTexture (line 300) | void ConvertTexture(const CTexturePtr& texture)
method GenerateCachedTexture (line 319) | bool GenerateCachedTexture(const VfsPath& sourcePath, VfsPath& archive...
method MakeProgress (line 343) | bool MakeProgress()
method GetConverterSettings (line 426) | CTextureConverter::Settings GetConverterSettings(const CTexturePtr& te...
method Status (line 467) | static Status ReloadChangedFileCB(void* param, const VfsPath& path)
method Status (line 472) | Status ReloadChangedFile(const VfsPath& path)
method GetBytesUploaded (line 495) | size_t GetBytesUploaded() const
function Handle (line 548) | Handle CTexture::GetHandle()
function u32 (line 626) | u32 CTexture::GetBaseColor() const
function CTexturePtr (line 651) | CTexturePtr CTextureManager::CreateTexture(const CTextureProperties& props)
function CTexturePtr (line 656) | CTexturePtr CTextureManager::GetErrorTexture()
FILE: fpsgame/graphics/TextureManager.h
function class (line 71) | class CTextureManager
function class (line 127) | class CTextureProperties
function SetWrap (line 152) | void SetWrap(GLint wrap) { m_WrapS = wrap; m_WrapT = wrap; }
function SetWrap (line 158) | void SetWrap(GLint wrap_s, GLint wrap_t) { m_WrapS = wrap_s; m_WrapT = w...
function SetMaxAnisotropy (line 163) | void SetMaxAnisotropy(float aniso) { m_Aniso = aniso; }
function SetFormatOverride (line 169) | void SetFormatOverride(GLenum format) { m_Format = format; }
FILE: fpsgame/graphics/Unit.cpp
function CUnit (line 47) | CUnit* CUnit::Create(const CStrW& actorName, uint32_t seed, const std::s...
FILE: fpsgame/graphics/Unit.h
function class (line 36) | class CUnit
function CUnitAnimation (line 59) | CUnitAnimation* GetAnimation() { return m_Animation; }
FILE: fpsgame/graphics/UnitAnimation.cpp
function DesyncSpeed (line 35) | static float DesyncSpeed(float speed, float desync)
FILE: fpsgame/graphics/UnitAnimation.h
function class (line 35) | class CUnitAnimation
FILE: fpsgame/graphics/UnitManager.cpp
function CUnit (line 90) | CUnit* CUnitManager::CreateUnit(const CStrW& actorName, uint32_t seed, c...
FILE: fpsgame/graphics/UnitManager.h
function class (line 36) | class CUnitManager
FILE: fpsgame/gui/adts/bit_buf.h
function add (line 32) | struct BitBuf
function extract (line 55) | size_t extract(uintptr_t n)
FILE: fpsgame/gui/adts/cache_adt.h
function notify_decreased (line 144) | void notify_decreased(const Entry&) const {}
function notify_impending_increase_or_remove (line 145) | void notify_impending_increase_or_remove(const Entry&) const {}
function notify_increased_or_removed (line 146) | void notify_increased_or_removed(const Entry&) const {}
function const (line 147) | float operator()(const Entries& entries) const
function notify_added (line 163) | void notify_added(const Entry& entry)
function notify_decreased (line 171) | void notify_decreased(const Entry& entry)
function notify_impending_increase_or_remove (line 176) | void notify_impending_increase_or_remove(const Entry& entry)
function notify_increased_or_removed (line 182) | void notify_increased_or_removed(const Entry& UNUSED(entry))
function add (line 241) | void add(const Key& key, const Entry& entry)
function find (line 247) | bool find(const Key& key, const Entry** pentry) const
function remove (line 256) | void remove(const Key& key)
function on_access (line 266) | void on_access(Entry& entry)
function remove_least_valuable (line 278) | void remove_least_valuable(std::list<Entry>& entry_list)
function Entry (line 320) | static const Entry& entry_from_it(typename Map::const_iterator it) { ret...
type typename (line 322) | typedef typename Map::iterator MapIt;
type typename (line 323) | typedef typename Map::const_iterator MapCIt;
function MapIt (line 327) | MapIt add_(const Key& key, const Entry& entry)
function remove_ (line 340) | void remove_(MapIt it)
function charge (line 348) | void charge(Entry& entry, float delta)
function charge_all (line 359) | void charge_all(float delta)
function should_evict (line 371) | bool should_evict(const Entry& entry)
type typename (line 395) | typedef typename Landlord_Naive<Key, Entry>::Map Map;
type typename (line 396) | typedef typename Landlord_Naive<Key, Entry>::MapIt MapIt;
type typename (line 397) | typedef typename Landlord_Naive<Key, Entry>::MapCIt MapCIt;
function add (line 402) | void add(const Key& key, const Entry& entry)
function remove (line 412) | void remove(const Key& key)
function on_access (line 425) | void on_access(Entry& entry)
function remove_least_valuable (line 434) | void remove_least_valuable(std::list<Entry>& entry_list)
type CD_greater (line 457) | struct CD_greater
function commit_pending_delta (line 492) | void commit_pending_delta()
function class (line 516) | class Divider_Naive
function class (line 529) | class Divider_Recip
function add (line 552) | void add(const Key& key, const Entry& entry)
function find (line 557) | bool find(const Key& key, const Entry** pentry) const
function remove (line 566) | void remove(const Key& key)
function on_access (line 571) | void on_access(Entry& entry)
function remove_least_valuable (line 585) | void remove_least_valuable(std::list<Entry>& entry_list)
type KeyAndEntry (line 592) | struct KeyAndEntry
type std (line 604) | typedef std::list<KeyAndEntry> List;
type typename (line 605) | typedef typename List::iterator It;
type typename (line 606) | typedef typename List::const_iterator CIt;
function add (line 662) | void add(const Key& key, const Item& item, size_t size, size_t cost)
function remove (line 671) | void remove(const Key& key)
FILE: fpsgame/gui/adts/dyn_hash_tbl.h
function hash (line 47) | size_t hash(const char* key) const
function equal (line 51) | bool equal(const char* k1, const char* k2) const
function expand_tbl (line 90) | void expand_tbl()
function clear (line 132) | void clear()
function insert (line 145) | void insert(const Key key, const T t)
function T (line 158) | T find(Key key) const
function class (line 169) | class iterator
function iterator (line 224) | iterator begin() const
FILE: fpsgame/gui/adts/ring_buf.h
function clear (line 39) | void clear() { size_ = 0; head = 0; tail = n-1; }
function T (line 44) | const T& operator[](int ofs) const
function push_back (line 78) | void push_back(const T& item)
function pop_front (line 91) | void pop_front()
function class (line 102) | class iterator
function class (line 148) | class const_iterator
function iterator (line 194) | iterator begin()
function iterator (line 202) | iterator end()
FILE: fpsgame/gui/allocators/aligned_allocator.h
type T (line 60) | typedef T* pointer;
type T (line 61) | typedef const T* const_pointer;
type T (line 62) | typedef T& reference;
type T (line 63) | typedef const T& const_reference;
type std (line 64) | typedef std::size_t size_type;
type std (line 65) | typedef std::ptrdiff_t difference_type;
type AlignedAllocator (line 71) | typedef AlignedAllocator<U> other;
function pointer (line 74) | pointer address(reference value) const
function const_pointer (line 79) | const_pointer address(const_reference value) const
function NOTHROW_DEFINE (line 84) | NOTHROW_DEFINE AlignedAllocator()
function NOTHROW_DEFINE (line 88) | NOTHROW_DEFINE AlignedAllocator(const AlignedAllocator&)
function pointer (line 108) | pointer allocate(size_type numElements)
function deallocate (line 118) | void deallocate(pointer p, size_type UNUSED(num))
function construct (line 123) | void construct(pointer p, const T& value)
function destroy (line 128) | void destroy(pointer p)
FILE: fpsgame/gui/allocators/allocator_adapters.h
function deallocate (line 40) | struct Allocator_Heap
function deallocate (line 61) | void deallocate(void* p, size_t UNUSED(size))
function deallocate (line 75) | void deallocate(void* p, size_t size)
function deallocate (line 89) | void deallocate(void* p, size_t size)
type T (line 105) | typedef T* pointer;
type T (line 106) | typedef const T* const_pointer;
type T (line 107) | typedef T& reference;
type T (line 108) | typedef const T& const_reference;
type std (line 109) | typedef std::size_t size_type;
type std (line 110) | typedef std::ptrdiff_t difference_type;
type ProxyAllocator (line 115) | typedef ProxyAllocator<U, Allocator> other;
function pointer (line 142) | pointer address(reference r)
function const_pointer (line 147) | const_pointer address(const_reference s)
function size_type (line 152) | size_type max_size() const throw ()
function destroy (line 162) | void destroy(pointer ptr)
function pointer (line 168) | pointer allocate(size_type n)
function pointer (line 176) | pointer allocate(size_type n, const void* const)
function deallocate (line 181) | void deallocate(const pointer ptr, const size_type n)
FILE: fpsgame/gui/allocators/allocator_checker.h
function class (line 33) | class AllocatorChecker
FILE: fpsgame/gui/allocators/allocator_policies.h
function namespace (line 35) | namespace Allocators {
function Expand (line 239) | bool Expand(size_t requiredCapacity)
function Expand (line 299) | bool Expand(size_t UNUSED(requiredCapacity))
function StorageAppend (line 319) | inline uintptr_t StorageAppend(Storage& storage, size_t& end, size_t size)
function ForEachStorage (line 336) | void ForEachStorage()
FILE: fpsgame/gui/allocators/arena.cpp
type Allocators (line 30) | namespace Allocators {
type BasicArenaTest (line 33) | struct BasicArenaTest
function TestArena (line 70) | void TestArena()
FILE: fpsgame/gui/allocators/arena.h
function namespace (line 32) | namespace Allocators {
function class (line 93) | class DynamicArena
function AllocateNewChunk (line 134) | void AllocateNewChunk()
function deallocate (line 159) | void deallocate(void* UNUSED(p), size_t UNUSED(size))
FILE: fpsgame/gui/allocators/dynarray.cpp
function Status (line 34) | static Status validate_da(DynArray* da)
function Status (line 61) | Status da_alloc(DynArray* da, size_t max_size)
function Status (line 80) | Status da_free(DynArray* da)
function Status (line 93) | Status da_set_size(DynArray* da, size_t new_size)
function Status (line 130) | Status da_reserve(DynArray* da, size_t size)
function Status (line 139) | Status da_append(DynArray* da, const void* data, size_t size)
FILE: fpsgame/gui/allocators/dynarray.h
type DynArray (line 39) | struct DynArray
FILE: fpsgame/gui/allocators/freelist.h
function mem_freelist_AddToFront (line 42) | static inline void mem_freelist_AddToFront(void*& freelist, void* el)
FILE: fpsgame/gui/allocators/headerless.cpp
class FreedBlock (line 47) | class FreedBlock
method FreedBlock (line 53) | FreedBlock()
method Setup (line 57) | void Setup(uintptr_t id, size_t size)
method Reset (line 64) | void Reset()
method Size (line 73) | size_t Size() const
method IsFreedBlock (line 82) | bool IsFreedBlock(uintptr_t id) const
method Validate (line 94) | void Validate(uintptr_t id) const
function IsValidSize (line 125) | static bool IsValidSize(size_t size)
type AddressOrder (line 146) | struct AddressOrder
method ShouldInsertBefore (line 148) | static bool ShouldInsertBefore(FreedBlock* current, FreedBlock* succes...
class RangeList (line 155) | class RangeList
method RangeList (line 158) | RangeList()
method Reset (line 163) | void Reset()
method Insert (line 172) | void Insert(FreedBlock* freedBlock)
method FreedBlock (line 194) | FreedBlock* Find(size_t minSize)
method Remove (line 207) | void Remove(FreedBlock* freedBlock)
method Validate (line 218) | void Validate(uintptr_t id) const
method IsEmpty (line 244) | bool IsEmpty() const
method FreeBlocks (line 249) | size_t FreeBlocks() const
method FreeBytes (line 254) | size_t FreeBytes() const
class SegregatedRangeLists (line 271) | class SegregatedRangeLists
method SegregatedRangeLists (line 274) | SegregatedRangeLists()
method Reset (line 279) | void Reset()
method Insert (line 286) | void Insert(FreedBlock* freedBlock)
method FreedBlock (line 297) | FreedBlock* Find(size_t minSize)
method Remove (line 320) | void Remove(FreedBlock* freedBlock)
method Validate (line 330) | void Validate(uintptr_t id) const
method FreeBlocks (line 341) | size_t FreeBlocks() const
method FreeBytes (line 349) | size_t FreeBytes() const
method SizeClass (line 362) | static size_t SizeClass(size_t size)
method ValueOfLeastSignificantOneBit (line 367) | static uintptr_t ValueOfLeastSignificantOneBit(uintptr_t x)
class BoundaryTagManager (line 405) | class BoundaryTagManager
method BoundaryTagManager (line 408) | BoundaryTagManager()
method FreedBlock (line 413) | FreedBlock* WriteTags(u8* p, size_t size)
method RemoveTags (line 426) | void RemoveTags(FreedBlock* freedBlock)
method FreedBlock (line 440) | FreedBlock* PrecedingBlock(u8* p, u8* beginningOfPool) const
method FreedBlock (line 458) | FreedBlock* FollowingBlock(u8* p, size_t size, u8* endOfPool) const
method FreeBlocks (line 471) | size_t FreeBlocks() const
method FreeBytes (line 476) | size_t FreeBytes() const
method Validate (line 486) | void Validate(FreedBlock* freedBlock) const
method FreedBlock (line 499) | static FreedBlock* Footer(FreedBlock* freedBlock)
class Stats (line 514) | class Stats
method OnReset (line 517) | void OnReset()
method OnAllocate (line 527) | void OnAllocate(size_t size)
method OnDeallocate (line 538) | void OnDeallocate(size_t size)
method OnAddToFreelist (line 553) | void OnAddToFreelist(size_t size)
method OnRemoveFromFreelist (line 559) | void OnRemoveFromFreelist(size_t size)
method Validate (line 569) | void Validate() const
method FreeBlocks (line 580) | size_t FreeBlocks() const
method FreeBytes (line 585) | size_t FreeBytes() const
function AssertEqual (line 602) | static void AssertEqual(size_t x1, size_t x2, size_t x3)
class HeaderlessAllocator::Impl (line 607) | class HeaderlessAllocator::Impl
method Impl (line 610) | Impl(size_t poolSize)
method Reset (line 624) | void Reset()
method NOTHROW_DEFINE (line 633) | NOTHROW_DEFINE void* Allocate(size_t size)
method Deallocate (line 654) | void Deallocate(u8* p, size_t size)
method Validate (line 670) | void Validate() const
method AddToFreelist (line 682) | void AddToFreelist(u8* p, size_t size)
method RemoveFromFreelist (line 689) | void RemoveFromFreelist(FreedBlock* freedBlock)
method Coalesce (line 699) | void Coalesce(u8*& p, size_t& size)
function NOTHROW_DEFINE (line 760) | NOTHROW_DEFINE void* HeaderlessAllocator::Allocate(size_t size)
FILE: fpsgame/gui/allocators/headerless.h
function class (line 49) | class HeaderlessAllocator
FILE: fpsgame/gui/allocators/overrun_protector.h
function T (line 77) | T* get() const
FILE: fpsgame/gui/allocators/page_aligned.cpp
function Status (line 32) | static inline Status StatusFromMap(void* ret)
function Status (line 49) | Status mem_Reserve(size_t size, u8** pp)
function Status (line 57) | Status mem_Release(u8* p, size_t size)
function Status (line 65) | Status mem_Commit(u8* p, size_t size, int prot)
function Status (line 76) | Status mem_Decommit(u8* p, size_t size)
function Status (line 83) | Status mem_Protect(u8* p, size_t size, int prot)
function page_aligned_free (line 105) | void page_aligned_free(void* p, size_t size)
FILE: fpsgame/gui/allocators/pool.cpp
type Allocators (line 36) | namespace Allocators {
type BasicPoolTest (line 39) | struct BasicPoolTest
function TestPool (line 76) | void TestPool()
function Status (line 86) | Status pool_create(Pool* p, size_t max_size, size_t el_size)
function Status (line 98) | Status pool_destroy(Pool* p)
function pool_contains (line 108) | bool pool_contains(const Pool* p, void* el)
function pool_free (line 146) | void pool_free(Pool* p, void* el)
function pool_free_all (line 164) | void pool_free_all(Pool* p)
function pool_committed (line 174) | size_t pool_committed(Pool* p)
FILE: fpsgame/gui/allocators/pool.h
function namespace (line 33) | namespace Allocators {
type Pool (line 114) | struct Pool
FILE: fpsgame/gui/allocators/shared_ptr.cpp
class CheckedArrayDeleter (line 33) | class CheckedArrayDeleter
method CheckedArrayDeleter (line 36) | CheckedArrayDeleter(size_t size)
function Allocate (line 55) | shared_ptr<u8> Allocate(size_t size)
FILE: fpsgame/gui/allocators/shared_ptr.h
type DummyDeleter (line 29) | struct DummyDeleter
type ArrayDeleter (line 43) | struct ArrayDeleter
type AlignedDeleter (line 56) | struct AlignedDeleter
function Status (line 66) | inline Status AllocateAligned(shared_ptr<T>& p, size_t size, size_t alig...
FILE: fpsgame/gui/allocators/tests/test_allocators.h
function class (line 28) | class TestAllocators : public CxxTest::TestSuite
FILE: fpsgame/gui/allocators/tests/test_headerless.h
function class (line 30) | class TestHeaderless: public CxxTest::TestSuite
FILE: fpsgame/gui/allocators/unique_range.cpp
function FreeNone (line 31) | static void FreeNone(void* UNUSED(pointer), size_t UNUSED(size))
function FreeAligned (line 37) | static void FreeAligned(void* pointer, size_t UNUSED(size))
function RegisterUniqueRangeDeleter (line 50) | void RegisterUniqueRangeDeleter(UniqueRangeDeleter deleter, volatile Idx...
function NOTHROW_DEFINE (line 70) | NOTHROW_DEFINE void CallUniqueRangeDeleter(void* pointer, size_t size, I...
function UniqueRange (line 79) | UniqueRange AllocateAligned(size_t size, size_t alignment)
function UniqueRange (line 95) | UniqueRange AllocateVM(size_t size, vm::PageType pageType, int prot)
FILE: fpsgame/gui/allocators/unique_range.h
type IdxDeleter (line 43) | typedef intptr_t IdxDeleter;
function class (line 75) | class UniqueRange
function pointer (line 128) | pointer release() // relinquish ownership
function reset (line 135) | void reset()
function reset (line 141) | void reset(pointer p, size_t size, IdxDeleter deleter)
function swap (line 147) | void swap(UniqueRange& rhs)
function Clear (line 172) | void Clear()
function Pilfer (line 177) | void Pilfer(UniqueRange& victim)
function Delete (line 186) | void Delete()
function namespace (line 196) | namespace std {
FILE: fpsgame/gui/app_hooks.cpp
function def_override_gl_upload_caps (line 38) | static void def_override_gl_upload_caps()
function OsPath (line 43) | static const OsPath& def_get_log_dir()
function def_bundle_logs (line 52) | static void def_bundle_logs(FILE* UNUSED(f))
function wchar_t (line 57) | static const wchar_t* def_translate(const wchar_t* text)
function def_translate_free (line 63) | static void def_translate_free(const wchar_t* UNUSED(text))
function def_log (line 69) | static void def_log(const wchar_t* text)
function ErrorReactionInternal (line 82) | static ErrorReactionInternal def_display_error(const wchar_t* UNUSED(tex...
function app_hooks_update (line 115) | void app_hooks_update(AppHooks* new_ah)
function app_hook_was_redefined (line 130) | bool app_hook_was_redefined(size_t offset_in_struct)
function ah_override_gl_upload_caps (line 146) | void ah_override_gl_upload_caps()
function OsPath (line 152) | const OsPath& ah_get_log_dir()
function ah_bundle_logs (line 157) | void ah_bundle_logs(FILE* f)
function wchar_t (line 162) | const wchar_t* ah_translate(const wchar_t* text)
function ah_translate_free (line 167) | void ah_translate_free(const wchar_t* text)
function ah_log (line 172) | void ah_log(const wchar_t* text)
function ErrorReactionInternal (line 177) | ErrorReactionInternal ah_display_error(const wchar_t* text, size_t flags)
FILE: fpsgame/gui/app_hooks.h
type AppHooks (line 179) | struct AppHooks
FILE: fpsgame/gui/base32.cpp
function base32 (line 31) | void base32(const size_t in_len, const u8* in, u8* out)
FILE: fpsgame/gui/bits.cpp
function u32 (line 30) | static inline u32 get_float_bits(const float x)
function floor_log2 (line 37) | int floor_log2(const float x)
FILE: fpsgame/gui/bits.h
function T (line 40) | T Bit(size_t n)
function IsBitSet (line 54) | bool IsBitSet(T value, size_t index)
function T (line 72) | T bit_mask(size_t numBits)
function T (line 97) | T bits(T num, size_t lo_idx, size_t hi_idx)
function T (line 113) | T SetBitsTo(T num, size_t lo_idx, size_t hi_idx, size_t value)
function SparsePopulationCount (line 129) | size_t SparsePopulationCount(T mask)
function PopulationCount (line 148) | inline size_t PopulationCount(T x)
function is_pow2 (line 164) | bool is_pow2(T n)
function T (line 176) | T LeastSignificantBit(T x)
function T (line 183) | T ClearLeastSignificantBit(T x)
function ceil_log2 (line 197) | size_t ceil_log2(T x)
type CeilLog2 (line 218) | struct CeilLog2
type CeilLog2 (line 224) | struct CeilLog2
function T (line 244) | T round_up_to_pow2(T x)
function T (line 253) | T round_down_to_pow2(T x)
function T (line 265) | T round_up(T n, T multiple)
function T (line 274) | T round_down(T n, T multiple)
function T (line 288) | T MaxPowerOfTwoDivisor(T value)
FILE: fpsgame/gui/byte_order.cpp
function u16 (line 33) | u16 swap16(const u16 x)
function u32 (line 40) | u32 swap32(const u32 x)
function u64 (line 50) | u64 swap64(const u64 x)
function u16 (line 66) | u16 read_le16(const void* p)
function u32 (line 73) | u32 read_le32(const void* p)
function u64 (line 80) | u64 read_le64(const void* p)
function u16 (line 88) | u16 read_be16(const void* p)
function u32 (line 95) | u32 read_be32(const void* p)
function u64 (line 102) | u64 read_be64(const void* p)
function write_le16 (line 110) | void write_le16(void* p, u16 x)
function write_le32 (line 116) | void write_le32(void* p, u32 x)
function write_le64 (line 122) | void write_le64(void* p, u64 x)
function write_be16 (line 129) | void write_be16(void* p, u16 x)
function write_be32 (line 135) | void write_be32(void* p, u32 x)
function write_be64 (line 141) | void write_be64(void* p, u64 x)
function u64 (line 148) | u64 movzx_le64(const u8* p, size_t size_bytes)
function u64 (line 157) | u64 movzx_be64(const u8* p, size_t size_bytes)
function i64 (line 170) | static inline i64 SignExtend(u64 bits, size_t size_bytes)
function i64 (line 190) | i64 movsx_le64(const u8* p, size_t size_bytes)
function i64 (line 196) | i64 movsx_be64(const u8* p, size_t size_bytes)
FILE: fpsgame/gui/debug.cpp
function debug_filter_add (line 77) | void debug_filter_add(const char* tag)
function debug_filter_remove (line 96) | void debug_filter_remove(const char* tag)
function debug_filter_clear (line 114) | void debug_filter_clear()
function debug_filter_allows (line 119) | bool debug_filter_allows(const char* text)
function debug_printf (line 142) | void debug_printf(const char* fmt, ...)
function debug_puts_filtered (line 156) | void debug_puts_filtered(const char* text)
function Status (line 165) | Status debug_WriteCrashlog(const wchar_t* text)
function debug_FreeErrorMessage (line 214) | void debug_FreeErrorMessage(ErrorMessageMem* emm)
function PrintfWriter (line 225) | PrintfWriter(wchar_t* buf, size_t maxChars)
function if (line 236) | if(len < 0)
type SkipStatus (line 488) | enum SkipStatus
function debug_SkipErrors (line 496) | void debug_SkipErrors(Status err)
function debug_StopSkippingErrors (line 509) | size_t debug_StopSkippingErrors()
function ShouldSkipError (line 525) | static bool ShouldSkipError(Status err)
function ErrorReaction (line 539) | ErrorReaction debug_OnError(Status err, atomic_bool* suppress, const wch...
function ErrorReaction (line 555) | ErrorReaction debug_OnAssertionFailure(const wchar_t* expr, atomic_bool*...
FILE: fpsgame/gui/debug.h
type DebugDisplayErrorFlags (line 81) | enum DebugDisplayErrorFlags
type atomic_bool (line 117) | typedef volatile intptr_t atomic_bool;
type ErrorReaction (line 131) | enum ErrorReaction
type ErrorReactionInternal (line 154) | enum ErrorReactionInternal
function namespace (line 404) | namespace ERR
function namespace (line 420) | namespace INFO
type ErrorMessageMem (line 540) | struct ErrorMessageMem
FILE: fpsgame/gui/debug_stl.cpp
function wchar_t (line 80) | wchar_t* debug_stl_simplify_name(wchar_t* name)
type ContainerBase (line 213) | struct ContainerBase : public Container
method IsValid (line 215) | bool IsValid(size_t UNUSED(el_size)) const
method NumElements (line 220) | size_t NumElements(size_t UNUSED(el_size)) const
method u8 (line 225) | static const u8* DereferenceAndAdvance(typename Container::iterator& i...
type Any_deque (line 234) | struct Any_deque : public ContainerBase<std::deque<int> >
method IsValid (line 238) | bool IsValid(size_t el_size) const
method u8 (line 251) | static const u8* DereferenceAndAdvance(iterator& stl_it, size_t el_size)
method ElementsPerBucket (line 275) | static size_t ElementsPerBucket(size_t el_size)
method u8 (line 280) | const u8* GetNthElement(size_t i, size_t el_size) const
type Any_list (line 297) | struct Any_list : public ContainerBase<std::list<int> >
type Any_tree (line 305) | struct Any_tree : public std::_Tree<_Traits>
method Any_tree (line 307) | Any_tree() // (required because default ctor cannot be generated)
method IsValid (line 311) | bool IsValid(size_t UNUSED(el_size)) const
method NumElements (line 316) | size_t NumElements(size_t UNUSED(el_size)) const
method u8 (line 321) | static const u8* DereferenceAndAdvance(iterator& stl_it, size_t el_size)
method _Charref (line 365) | static _Charref _Isnil(_Nodeptr _Pnode, size_t el_size)
type Any_map (line 375) | struct Any_map : public Any_tree<std::_Tmap_traits<int, int, std::less<i...
type Any_multimap (line 380) | struct Any_multimap : public Any_map
type Any_set (line 385) | struct Any_set: public Any_tree<std::_Tset_traits<int, std::less<int>, s...
type Any_multiset (line 390) | struct Any_multiset: public Any_set
type Any_vector (line 397) | struct Any_vector: public ContainerBase<std::vector<int> >
method IsValid (line 399) | bool IsValid(size_t UNUSED(el_size)) const
method NumElements (line 412) | size_t NumElements(size_t el_size) const
method u8 (line 421) | static const u8* DereferenceAndAdvance(iterator& stl_it, size_t el_size)
type Any_basic_string (line 443) | struct Any_basic_string : public ContainerBase<std::string>
method IsValid (line 445) | bool IsValid(size_t el_size) const
type Any_queue (line 466) | struct Any_queue : public Any_deque
type Any_stack (line 473) | struct Any_stack : public Any_deque
function u8 (line 482) | const u8* stl_iterator(void* it_mem, size_t el_size)
function IsContainerValid (line 492) | static bool IsContainerValid(const T& t, size_t el_count)
function get_container_info (line 519) | bool get_container_info(const T& t, size_t size, size_t el_size,
function Status (line 549) | Status debug_stl_get_container_info(const wchar_t* type_name, const u8* ...
FILE: fpsgame/gui/debug_stl.h
function namespace (line 31) | namespace ERR
type u8 (line 58) | typedef const u8* (*DebugStlIterator)(void* internal, size_t el_size);
FILE: fpsgame/gui/external_libraries/curl.h
type SOCKET (line 36) | typedef uintptr_t SOCKET;
type sockaddr (line 38) | struct sockaddr
type fd_set (line 44) | struct fd_set
FILE: fpsgame/gui/external_libraries/dbghelp.cpp
function dbghelp_ImportFunctions (line 39) | void dbghelp_ImportFunctions()
FILE: fpsgame/gui/external_libraries/dbghelp.h
type BasicType (line 77) | enum BasicType
type DataKind (line 99) | enum DataKind
FILE: fpsgame/gui/external_libraries/enet.h
type SOCKET (line 36) | typedef uintptr_t SOCKET;
type fd_set (line 38) | struct fd_set
FILE: fpsgame/gui/external_libraries/glext_funcs.h
type GLuint (line 126) | typedef GLuint GLhandleARB;
FILE: fpsgame/gui/external_libraries/libsdl.h
type SDL_Event_ (line 51) | struct SDL_Event_
FILE: fpsgame/gui/external_libraries/libsdl_fwd.h
type SDL_Event_ (line 39) | struct SDL_Event_
FILE: fpsgame/gui/external_libraries/openal.h
type ALCchar (line 41) | typedef ALCchar* alcString;
type ALCubyte (line 43) | typedef ALCubyte* alcString;
FILE: fpsgame/gui/external_libraries/powrprof.h
type POWER_INFORMATION_LEVEL (line 48) | typedef enum {
type BATTERY_REPORTING_SCALE (line 77) | typedef struct {
type SYSTEM_POWER_STATE (line 82) | typedef enum _SYSTEM_POWER_STATE {
type SYSTEM_POWER_CAPABILITIES (line 93) | typedef struct {
type SYSTEM_POWER_INFORMATION (line 135) | typedef struct _SYSTEM_POWER_INFORMATION
type PROCESSOR_POWER_INFORMATION (line 150) | typedef struct _PROCESSOR_POWER_INFORMATION
FILE: fpsgame/gui/external_libraries/wxwidgets.h
type HINSTANCE__ (line 35) | struct HINSTANCE__
type HINSTANCE__ (line 39) | struct HINSTANCE__
FILE: fpsgame/gui/file/archive/archive.h
function namespace (line 38) | namespace ERR
function IFileLoader (line 44) | struct IArchiveFile : public IFileLoader
type shared_ptr (line 48) | typedef shared_ptr<IArchiveFile> PIArchiveFile;
type IArchiveReader (line 50) | struct IArchiveReader
type shared_ptr (line 62) | typedef shared_ptr<IArchiveReader> PIArchiveReader;
type IArchiveWriter (line 73) | struct IArchiveWriter
type shared_ptr (line 107) | typedef shared_ptr<IArchiveWriter> PIArchiveWriter;
FILE: fpsgame/gui/file/archive/archive_zip.cpp
function time_t (line 48) | static time_t time_t_from_FAT(u32 fat_timedate)
function u32 (line 71) | static u32 FAT_from_time_t(time_t time)
type ZipMethod (line 101) | enum ZipMethod
class LFH (line 109) | class LFH
method Init (line 112) | void Init(const CFileInfo& fileInfo, off_t csize, ZipMethod method, u3...
method Size (line 131) | size_t Size() const
class CDFH (line 157) | class CDFH
method Init (line 160) | void Init(const CFileInfo& fileInfo, off_t ofs, off_t csize, ZipMethod...
method Path (line 183) | Path Pathname() const
method off_t (line 190) | off_t HeaderOffset() const
method off_t (line 195) | off_t USize() const
method off_t (line 200) | off_t CSize() const
method ZipMethod (line 205) | ZipMethod Method() const
method u32 (line 210) | u32 Checksum() const
method time_t (line 215) | time_t MTime() const
method Size (line 221) | size_t Size() const
class ECDR (line 250) | class ECDR
method Init (line 253) | void Init(size_t cd_numEntries, off_t cd_ofs, size_t cd_size)
method Decompose (line 265) | void Decompose(size_t& cd_numEntries, off_t& cd_ofs, size_t& cd_size) ...
class ArchiveFile_Zip (line 292) | class ArchiveFile_Zip : public IArchiveFile
method ArchiveFile_Zip (line 295) | ArchiveFile_Zip(const PFile& file, off_t ofs, off_t csize, u32 checksu...
method Precedence (line 302) | virtual size_t Precedence() const
method wchar_t (line 307) | virtual wchar_t LocationCode() const
method OsPath (line 312) | virtual OsPath Path() const
method Status (line 317) | virtual Status Load(const OsPath& UNUSED(name), const shared_ptr<u8>& ...
type Flags (line 348) | enum Flags
type LFH_Copier (line 363) | struct LFH_Copier
method LFH_Copier (line 365) | LFH_Copier(u8* lfh_dst, size_t lfh_bytes_remaining)
method Status (line 377) | Status operator()(const u8* block, size_t size) const
method AdjustOffset (line 401) | void AdjustOffset() const
class ArchiveReader_Zip (line 431) | class ArchiveReader_Zip : public IArchiveReader
method ArchiveReader_Zip (line 434) | ArchiveReader_Zip(const OsPath& pathname)
method Status (line 444) | virtual Status ReadEntries(ArchiveEntryCallback cb, uintptr_t cbData)
method u8 (line 491) | static const u8* FindRecord(const u8* buf, size_t size, const u8* star...
method Status (line 514) | static Status ScanForEcdr(const PFile& file, off_t fileSize, u8* buf, ...
method Status (line 533) | static Status LocateCentralDirectory(const PFile& file, off_t fileSize...
function PIArchiveReader (line 569) | PIArchiveReader CreateArchiveReader_Zip(const OsPath& archivePathname)
class ArchiveWriter_Zip (line 586) | class ArchiveWriter_Zip : public IArchiveWriter
method ArchiveWriter_Zip (line 589) | ArchiveWriter_Zip(const OsPath& archivePathname, bool noDeflate)
method Status (line 613) | Status AddFile(const OsPath& pathname, const OsPath& pathnameInArchive)
method Status (line 624) | Status AddMemory(const u8* data, size_t size, time_t mtime, const OsPa...
method Status (line 631) | Status AddFileOrMemory(const CFileInfo& fileInfo, const OsPath& pathna...
method IsFileTypeIncompressible (line 715) | static bool IsFileTypeIncompressible(const OsPath& pathname)
function PIArchiveWriter (line 745) | PIArchiveWriter CreateArchiveWriter_Zip(const OsPath& archivePathname, b...
FILE: fpsgame/gui/file/archive/codec.h
type ICodec (line 34) | struct ICodec
type shared_ptr (line 92) | typedef shared_ptr<ICodec> PICodec;
FILE: fpsgame/gui/file/archive/codec_zlib.cpp
class Codec_ZLib (line 33) | class Codec_ZLib : public ICodec
method u32 (line 36) | u32 UpdateChecksum(u32 checksum, const u8* in, size_t inSize) const
method u32 (line 49) | u32 InitializeChecksum()
class Codec_ZLibNone (line 62) | class Codec_ZLibNone : public Codec_ZLib
method Codec_ZLibNone (line 65) | Codec_ZLibNone()
method MaxOutputSize (line 74) | virtual size_t MaxOutputSize(size_t inSize) const
method Status (line 79) | virtual Status Reset()
method Status (line 85) | virtual Status Process(const u8* in, size_t inSize, u8* out, size_t ou...
method Status (line 94) | virtual Status Finish(u32& checksum, size_t& outProduced)
class CodecZLibStream (line 108) | class CodecZLibStream : public Codec_ZLib
method CodecZLibStream (line 111) | CodecZLibStream()
method Status (line 117) | static Status LibError_from_zlib(int zlib_ret)
method WarnIfZLibError (line 136) | static void WarnIfZLibError(int zlib_ret)
method Status (line 143) | Status CallStreamFunc(ZLibFunc func, int flush, const u8* in, const si...
class Compressor_ZLib (line 179) | class Compressor_ZLib : public CodecZLibStream
method Compressor_ZLib (line 182) | Compressor_ZLib()
method MaxOutputSize (line 202) | virtual size_t MaxOutputSize(size_t inSize) const
method Status (line 207) | virtual Status Reset()
method Status (line 214) | virtual Status Process(const u8* in, size_t inSize, u8* out, size_t ou...
method Status (line 220) | virtual Status Finish(u32& checksum, size_t& outProduced)
class Decompressor_ZLib (line 240) | class Decompressor_ZLib : public CodecZLibStream
method Decompressor_ZLib (line 243) | Decompressor_ZLib()
method MaxOutputSize (line 256) | virtual size_t MaxOutputSize(size_t inSize) const
method Status (line 266) | virtual Status Reset()
method Status (line 273) | virtual Status Process(const u8* in, size_t inSize, u8* out, size_t ou...
method Status (line 280) | virtual Status Finish(u32& checksum, size_t& outProduced)
function PICodec (line 293) | PICodec CreateCodec_ZLibNone()
function PICodec (line 298) | PICodec CreateCompressor_ZLibDeflate()
function PICodec (line 303) | PICodec CreateDecompressor_ZLibDeflate()
FILE: fpsgame/gui/file/archive/disabled_tests/test_codec_zlib.h
function class (line 28) | class TestCodecZLib : public CxxTest::TestSuite
FILE: fpsgame/gui/file/archive/disabled_tests/test_compression.h
function class (line 28) | class TestCompression : public CxxTest::TestSuite
FILE: fpsgame/gui/file/archive/disabled_tests/test_fat_time.h
function class (line 29) | class TestFatTime: public CxxTest::TestSuite
FILE: fpsgame/gui/file/archive/disabled_tests/test_zip.h
function class (line 29) | class TestZip : public CxxTest::TestSuite
FILE: fpsgame/gui/file/archive/stream.cpp
function Status (line 116) | Status Stream::Feed(const u8* in, size_t inSize)
function Status (line 132) | Status Stream::Finish()
FILE: fpsgame/gui/file/archive/stream.h
function class (line 34) | class OutputBufferManager
function class (line 78) | class Stream
type StreamFeeder (line 115) | struct StreamFeeder
FILE: fpsgame/gui/file/common/file_loader.h
type IFileLoader (line 28) | struct IFileLoader
type shared_ptr (line 39) | typedef shared_ptr<IFileLoader> PIFileLoader;
FILE: fpsgame/gui/file/common/file_stats.cpp
function timer_start (line 74) | static void timer_start(double* start_time_storage = &start_time)
function timer_reset (line 81) | static double timer_reset(double* start_time_storage = &start_time)
function stats_vfs_file_add (line 94) | void stats_vfs_file_add(size_t file_size)
function stats_vfs_file_remove (line 100) | void stats_vfs_file_remove(size_t file_size)
function stats_vfs_init_start (line 107) | void stats_vfs_init_start()
function stats_vfs_init_finish (line 112) | void stats_vfs_init_finish()
function stats_unique_name (line 122) | void stats_unique_name(size_t name_len)
function stats_open (line 129) | void stats_open()
function stats_close (line 137) | void stats_close()
function stats_buf_alloc (line 148) | void stats_buf_alloc(size_t size, size_t alignedSize)
function stats_buf_free (line 158) | void stats_buf_free()
function stats_buf_ref (line 164) | void stats_buf_ref()
function stats_io_user_request (line 174) | void stats_io_user_request(size_t user_size)
function stats_cb_start (line 202) | void stats_cb_start()
function stats_cb_finish (line 207) | void stats_cb_finish()
function stats_cache (line 217) | void stats_cache(CacheRet cr, size_t size)
function stats_block_cache (line 237) | void stats_block_cache(CacheRet cr)
function stats_ab_connection (line 248) | void stats_ab_connection(bool already_exists)
function percent (line 258) | int percent(T num, T divisor)
function file_stats_dump (line 265) | void file_stats_dump()
FILE: fpsgame/gui/file/common/file_stats.h
type FileIOImplentation (line 35) | enum FileIOImplentation { FI_LOWIO, FI_AIO, FI_BCACHE, FI_MAX_IDX }
type CacheRet (line 36) | enum CacheRet { CR_HIT, CR_MISS }
function class (line 66) | class ScopedIoMonitor
function class (line 102) | class ScopedIoMonitor
FILE: fpsgame/gui/file/common/real_directory.cpp
function wchar_t (line 43) | wchar_t RealDirectory::LocationCode() const
function Status (line 49) | Status RealDirectory::Load(const OsPath& name, const shared_ptr<u8>& buf...
function Status (line 55) | Status RealDirectory::Store(const OsPath& name, const shared_ptr<u8>& fi...
function PRealDirectory (line 68) | PRealDirectory CreateRealSubdirectory(const PRealDirectory& realDirector...
FILE: fpsgame/gui/file/common/tests/test_trace.h
function class (line 27) | class TestTraceEntry : public CxxTest::TestSuite
FILE: fpsgame/gui/file/common/trace.cpp
class Trace_Dummy (line 100) | class Trace_Dummy : public ITrace
method Trace_Dummy (line 103) | Trace_Dummy(size_t UNUSED(maxSize))
method NotifyLoad (line 108) | virtual void NotifyLoad(const Path& UNUSED(pathname), size_t UNUSED(si...
method NotifyStore (line 112) | virtual void NotifyStore(const Path& UNUSED(pathname), size_t UNUSED(s...
method Status (line 116) | virtual Status Load(const OsPath& UNUSED(pathname))
method Status (line 121) | virtual Status Store(const OsPath& UNUSED(pathname)) const
method TraceEntry (line 126) | virtual const TraceEntry* Entries() const
method NumEntries (line 131) | virtual size_t NumEntries() const
class Trace (line 140) | class Trace : public ITrace
method Trace (line 143) | Trace(size_t maxSize)
method NotifyLoad (line 159) | virtual void NotifyLoad(const Path& pathname, size_t size)
method NotifyStore (line 164) | virtual void NotifyStore(const Path& pathname, size_t size)
method Status (line 169) | virtual Status Load(const OsPath& pathname)
method Status (line 190) | virtual Status Store(const OsPath& pathname) const
method TraceEntry (line 205) | virtual const TraceEntry* Entries() const
method NumEntries (line 210) | virtual size_t NumEntries() const
function PITrace (line 227) | PITrace CreateDummyTrace(size_t maxSize)
function PITrace (line 232) | PITrace CreateTrace(size_t maxSize)
FILE: fpsgame/gui/file/common/trace.h
function class (line 41) | class TraceEntry
type ITrace (line 92) | struct ITrace
type shared_ptr (line 123) | typedef shared_ptr<ITrace> PITrace;
FILE: fpsgame/gui/file/disabled_tests/test_file_cache.h
function class (line 28) | class TestFileCache : public CxxTest::TestSuite
FILE: fpsgame/gui/file/disabled_tests/test_path.h
function class (line 28) | class TestPath : public CxxTest::TestSuite
FILE: fpsgame/gui/file/file.cpp
function Status (line 39) | Status FileOpen(const OsPath& pathname, int oflag)
function FileClose (line 56) | void FileClose(int& fd)
FILE: fpsgame/gui/file/file.h
function namespace (line 33) | namespace ERR
function class (line 45) | class File
type shared_ptr (line 99) | typedef shared_ptr<File> PFile;
FILE: fpsgame/gui/file/file_system.cpp
function DirectoryExists (line 37) | bool DirectoryExists(const OsPath& path)
function FileExists (line 49) | bool FileExists(const OsPath& pathname)
function u64 (line 57) | u64 FileSize(const OsPath& pathname)
function Status (line 65) | Status GetFileInfo(const OsPath& pathname, CFileInfo* pPtrInfo)
type DirDeleter (line 78) | struct DirDeleter
function Status (line 87) | Status GetDirectoryEntries(const OsPath& path, CFileInfos* files, Direct...
function Status (line 133) | Status CreateDirectories(const OsPath& path, mode_t mode, bool breakpoint)
function Status (line 167) | Status DeleteDirectory(const OsPath& path)
FILE: fpsgame/gui/file/file_system.h
function class (line 41) | class CFileInfo
type std (line 76) | typedef std::vector<CFileInfo> CFileInfos;
type std (line 77) | typedef std::vector<OsPath> DirectoryNames;
FILE: fpsgame/gui/file/io/io.cpp
type io (line 33) | namespace io {
function Status (line 39) | Status Issue(aiocb& cb, size_t queueDepth)
function Status (line 67) | Status WaitUntilComplete(aiocb& cb, size_t queueDepth)
FILE: fpsgame/gui/file/io/io.h
function namespace (line 41) | namespace ERR
function namespace (line 46) | namespace io {
type Parameters (line 96) | struct Parameters
type DefaultCompletedHook (line 149) | struct DefaultCompletedHook
type DefaultIssueHook (line 165) | struct DefaultIssueHook
function class (line 183) | class ControlBlockRingBuffer
function Status (line 233) | inline Status Run(const Operation& op, const Parameters& p = Parameters(...
function Status (line 280) | inline Status Run(const Operation& op, const Parameters& p = Parameters(...
function Status (line 285) | static inline Status Run(const Operation& op, const Parameters& p = Para...
function Status (line 298) | inline Status Store(const OsPath& pathname, const void* data, size_t siz...
function Status (line 321) | inline Status Store(const OsPath& pathname, const void* data, size_t siz...
function Status (line 326) | static inline Status Store(const OsPath& pathname, const void* data, siz...
function Status (line 337) | inline Status Load(const OsPath& pathname, void* buf, size_t size, const...
function Status (line 349) | inline Status Load(const OsPath& pathname, void* buf, size_t size, const...
function Status (line 354) | static inline Status Load(const OsPath& pathname, void* buf, size_t size...
FILE: fpsgame/gui/file/io/write_buffer.cpp
function Status (line 101) | Status UnalignedWriter::Append(const u8* data, size_t size) const
function Status (line 140) | Status UnalignedWriter::WriteBlock() const
FILE: fpsgame/gui/file/io/write_buffer.h
function class (line 28) | class WriteBuffer
function class (line 57) | class UnalignedWriter
type shared_ptr (line 84) | typedef shared_ptr<UnalignedWriter> PUnalignedWriter;
FILE: fpsgame/gui/file/vfs/file_cache.cpp
class Allocator (line 70) | class Allocator
method Allocator (line 94) | Allocator(size_t maxSize)
method Allocate (line 99) | shared_ptr<u8> Allocate(size_t size, const PAllocator& pthis)
method Deallocate (line 115) | void Deallocate(u8* mem, size_t size)
class FileCacheDeleter (line 73) | class FileCacheDeleter
method FileCacheDeleter (line 76) | FileCacheDeleter(size_t size, const PAllocator& allocator)
class Allocator (line 91) | class Allocator
method Allocator (line 94) | Allocator(size_t maxSize)
method Allocate (line 99) | shared_ptr<u8> Allocate(size_t size, const PAllocator& pthis)
method Deallocate (line 115) | void Deallocate(u8* mem, size_t size)
class FileCache::Impl (line 157) | class FileCache::Impl
method Impl (line 160) | Impl(size_t maxSize)
method Reserve (line 165) | shared_ptr<u8> Reserve(size_t size)
method Add (line 194) | void Add(const VfsPath& pathname, const shared_ptr<u8>& data, size_t s...
method Retrieve (line 203) | bool Retrieve(const VfsPath& pathname, shared_ptr<u8>& data, size_t& s...
method Remove (line 212) | void Remove(const VfsPath& pathname)
FILE: fpsgame/gui/file/vfs/file_cache.h
function class (line 48) | class FileCache
FILE: fpsgame/gui/file/vfs/tests/test_vfs_tree.h
function class (line 28) | class MockLoader : public IFileLoader
function class (line 44) | class TestVfsTree : public CxxTest::TestSuite
FILE: fpsgame/gui/file/vfs/vfs.cpp
type ScopedLock (line 47) | struct ScopedLock
method ScopedLock (line 49) | ScopedLock() { pthread_mutex_lock(&vfs_mutex); }
class VFS (line 54) | class VFS : public IVFS
method VFS (line 57) | VFS(size_t cacheSize)
method Status (line 63) | virtual Status Mount(const VfsPath& mountPoint, const OsPath& path, si...
method Status (line 82) | virtual Status GetFileInfo(const VfsPath& pathname, CFileInfo* pfileIn...
method Status (line 94) | virtual Status GetFilePriority(const VfsPath& pathname, size_t* pprior...
method Status (line 103) | virtual Status GetDirectoryEntries(const VfsPath& path, CFileInfos* fi...
method Status (line 133) | virtual Status CreateFile(const VfsPath& pathname, const shared_ptr<u8...
method Status (line 159) | virtual Status ReplaceFile(const VfsPath& pathname, const shared_ptr<u...
method Status (line 188) | virtual Status LoadFile(const VfsPath& pathname, shared_ptr<u8>& fileC...
method TextRepresentation (line 226) | virtual std::wstring TextRepresentation() const
method Status (line 235) | virtual Status GetRealPath(const VfsPath& pathname, OsPath& realPathname)
method Status (line 244) | virtual Status GetDirectoryRealPath(const VfsPath& pathname, OsPath& r...
method Status (line 253) | virtual Status GetVirtualPath(const OsPath& realPathname, VfsPath& pat...
method Status (line 263) | virtual Status RemoveFile(const VfsPath& pathname)
method Status (line 275) | virtual Status RepopulateDirectory(const VfsPath& path)
method Clear (line 286) | virtual void Clear()
method Status (line 293) | Status FindRealPathR(const OsPath& realPath, const VfsDirectory& direc...
function PIVFS (line 323) | PIVFS CreateVfs(size_t cacheSize)
FILE: fpsgame/gui/file/vfs/vfs.h
function namespace (line 34) | namespace ERR
type VfsMountFlags (line 42) | enum VfsMountFlags
type IVFS (line 82) | struct IVFS
type shared_ptr (line 226) | typedef shared_ptr<IVFS> PIVFS;
FILE: fpsgame/gui/file/vfs/vfs_lookup.cpp
function Status (line 41) | static Status CreateDirectory(const OsPath& path)
function Status (line 75) | Status vfs_Lookup(const VfsPath& pathname, VfsDirectory* startDirectory,...
FILE: fpsgame/gui/file/vfs/vfs_lookup.h
type VfsLookupFlags (line 38) | enum VfsLookupFlags
FILE: fpsgame/gui/file/vfs/vfs_path.h
type Path (line 40) | typedef Path VfsPath;
type std (line 42) | typedef std::vector<VfsPath> VfsPaths;
FILE: fpsgame/gui/file/vfs/vfs_populate.cpp
type CompareFileInfoByName (line 36) | struct CompareFileInfoByName
class PopulateHelper (line 46) | class PopulateHelper
method PopulateHelper (line 50) | PopulateHelper(VfsDirectory* directory, const PRealDirectory& realDire...
method Status (line 55) | Status AddEntries() const
method AddFile (line 75) | void AddFile(const CFileInfo& fileInfo) const
method AddArchiveFile (line 89) | static void AddArchiveFile(const VfsPath& pathname, const CFileInfo& f...
method Status (line 111) | Status AddFiles(const CFileInfos& files) const
method AddSubdirectories (line 133) | void AddSubdirectories(const DirectoryNames& subdirectoryNames) const
function Status (line 153) | Status vfs_Populate(VfsDirectory* directory)
function Status (line 170) | Status vfs_Attach(VfsDirectory* directory, const PRealDirectory& realDir...
FILE: fpsgame/gui/file/vfs/vfs_tree.cpp
function ShouldReplaceWith (line 53) | static bool ShouldReplaceWith(const VfsFile& previousFile, const VfsFile...
function VfsFile (line 81) | VfsFile* VfsDirectory::AddFile(const VfsFile& file)
function VfsDirectory (line 103) | VfsDirectory* VfsDirectory::AddSubdirectory(const VfsPath& name)
function VfsFile (line 117) | VfsFile* VfsDirectory::GetFile(const VfsPath& name)
function VfsDirectory (line 126) | VfsDirectory* VfsDirectory::GetSubdirectory(const VfsPath& name)
function FileDescription (line 166) | std::wstring FileDescription(const VfsFile& file)
function FileDescriptions (line 178) | std::wstring FileDescriptions(const VfsDirectory& directory, size_t inde...
function DirectoryDescriptionR (line 198) | void DirectoryDescriptionR(std::wstring& descriptions, const VfsDirector...
FILE: fpsgame/gui/file/vfs/vfs_tree.h
function class (line 37) | class VfsFile
function class (line 78) | class VfsDirectory
FILE: fpsgame/gui/file/vfs/vfs_util.cpp
type vfs (line 39) | namespace vfs {
function Status (line 41) | Status GetPathnames(const PIVFS& fs, const VfsPath& path, const wchar_...
function Status (line 59) | Status ForEachFile(const PIVFS& fs, const VfsPath& startPath, FileCall...
function NextNumberedFilename (line 100) | void NextNumberedFilename(const PIVFS& fs, const VfsPath& pathnameForm...
FILE: fpsgame/gui/file/vfs/vfs_util.h
function namespace (line 33) | namespace vfs {
FILE: fpsgame/gui/fnv_hash.cpp
function u32 (line 33) | u32 fnv_hash(const void* buf, size_t len)
function u64 (line 69) | u64 fnv_hash64(const void* buf, size_t len)
function u32 (line 105) | u32 fnv_lc_hash(const char* str, size_t len)
FILE: fpsgame/gui/frequency_filter.cpp
class FrequencyEstimator (line 33) | class FrequencyEstimator
method FrequencyEstimator (line 37) | FrequencyEstimator(double resolution)
class IirFilter (line 74) | class IirFilter
method IirFilter (line 77) | IirFilter(double sensitivity, double initialValue)
method ComputeExponent (line 91) | static double ComputeExponent(int bias)
class Controller (line 111) | class Controller
method Controller (line 114) | Controller(double initialValue)
method ComputeBias (line 121) | int ComputeBias(double smoothedValue, double value)
method WasOnSameSide (line 154) | bool WasOnSameSide(double value) const
method Change (line 165) | static double Change(double from, double to)
method WasSpike (line 171) | bool WasSpike() const
class FrequencyFilter (line 190) | class FrequencyFilter : public IFrequencyFilter
method FrequencyFilter (line 194) | FrequencyFilter(double resolution, double expectedFrequency)
method Update (line 201) | virtual void Update(double time)
method SmoothedFrequency (line 228) | virtual double SmoothedFrequency() const
method StableFrequency (line 233) | virtual int StableFrequency() const
function PIFrequencyFilter (line 250) | PIFrequencyFilter CreateFrequencyFilter(double resolution, double expect...
FILE: fpsgame/gui/frequency_filter.h
type IFrequencyFilter (line 27) | struct IFrequencyFilter
type shared_ptr (line 40) | typedef shared_ptr<IFrequencyFilter> PIFrequencyFilter;
FILE: fpsgame/gui/input.cpp
function in_add_handler (line 41) | void in_add_handler(InHandler handler)
function in_reset_handlers (line 51) | void in_reset_handlers()
function in_dispatch_event (line 57) | void in_dispatch_event(const SDL_Event_* ev)
function in_push_priority_event (line 75) | void in_push_priority_event(const SDL_Event_* event)
function in_poll_event (line 80) | int in_poll_event(SDL_Event_* event)
FILE: fpsgame/gui/input.h
type InReaction (line 34) | enum InReaction
type InReaction (line 46) | typedef InReaction (*InHandler)(const SDL_Event_*);
FILE: fpsgame/gui/lib.cpp
function u32 (line 44) | u32 u64_hi(u64 x)
function u32 (line 49) | u32 u64_lo(u64 x)
function u16 (line 54) | u16 u32_hi(u32 x)
function u16 (line 59) | u16 u32_lo(u32 x)
function u64 (line 65) | u64 u64_from_u32(u32 hi, u32 lo)
function u32 (line 73) | u32 u32_from_u16(u16 hi, u16 lo)
function u8 (line 83) | u8 u8_from_double(double in)
function u16 (line 97) | u16 u16_from_double(double in)
FILE: fpsgame/gui/module_init.cpp
function Status (line 40) | Status ModuleInit(volatile ModuleInitState* initState, Status (*init)())
function Status (line 65) | Status ModuleShutdown(volatile ModuleInitState* initState, void (*shutdo...
FILE: fpsgame/gui/module_init.h
type ModuleInitState (line 35) | typedef intptr_t ModuleInitState;
FILE: fpsgame/gui/ogl.cpp
function isImplementedInCore (line 81) | static bool isImplementedInCore(const char* ext)
function ogl_HaveExtension (line 187) | bool ogl_HaveExtension(const char* ext)
function ogl_HaveVersion (line 219) | bool ogl_HaveVersion(const char* desired_version)
function enableDummyFunctions (line 296) | static void enableDummyFunctions()
function enableDummyFunctions (line 325) | static void enableDummyFunctions()
function importExtensionFunctions (line 345) | static void importExtensionFunctions()
function dump_gl_error (line 376) | static void dump_gl_error(GLenum err)
function ogl_WarnIfErrorLoc (line 396) | void ogl_WarnIfErrorLoc(const char *file, int line)
function ogl_SquelchError (line 427) | bool ogl_SquelchError(GLenum err_to_ignore)
function ogl_Init (line 470) | void ogl_Init()
FILE: fpsgame/gui/ogl.h
type GLint64 (line 120) | typedef int64_t GLint64;
type GLuint64 (line 121) | typedef uint64_t GLuint64;
FILE: fpsgame/gui/os_path.h
type Path (line 31) | typedef Path OsPath;
function Path (line 35) | static inline const Path::String& OsString(const OsPath& path)
function std (line 42) | static inline std::string OsString(const OsPath& path)
FILE: fpsgame/gui/path.cpp
function path_is_dir_sep (line 42) | static bool path_is_dir_sep(wchar_t c)
function path_is_subpath (line 51) | bool path_is_subpath(const wchar_t* s1, const wchar_t* s2)
function wchar_t (line 85) | const wchar_t* path_name_only(const wchar_t* path)
function Status (line 99) | Status Path::Validate(String::value_type c)
FILE: fpsgame/gui/path.h
function namespace (line 48) | namespace ERR
function class (line 77) | class Path
function operator (line 145) | bool operator<(const Path& rhs) const
function operator (line 150) | bool operator==(const Path& rhs) const
function operator (line 155) | bool operator!=(const Path& rhs) const
function Path (line 167) | Path Parent() const
function Path (line 230) | Path BeforeCommon(Path other) const
function DetectSeparator (line 255) | void DetectSeparator()
function namespace (line 297) | namespace boost {
FILE: fpsgame/gui/posix/posix.cpp
function wchar_t (line 28) | wchar_t* wcsdup(const wchar_t* str)
function wcscasecmp (line 40) | int wcscasecmp (const wchar_t* s1, const wchar_t* s2)
FILE: fpsgame/gui/rand.cpp
function xrand (line 40) | static size_t xrand()
function xrand (line 47) | static size_t xrand()
function rand (line 53) | size_t rand(size_t min_inclusive, size_t max_exclusive)
FILE: fpsgame/gui/regex.cpp
function match_wildcard (line 28) | int match_wildcard(const wchar_t* s, const wchar_t* w)
FILE: fpsgame/gui/res/handle.h
type i64 (line 41) | typedef i64 Handle;
FILE: fpsgame/gui/secure_crt.cpp
function tnlen (line 120) | size_t tnlen(const tchar* str, size_t max_len)
function tstring (line 137) | static tstring androidFormat(const tchar *fmt)
function tncpy_s (line 154) | int tncpy_s(tchar* dst, size_t max_dst_chars, const tchar* src, size_t m...
function tcpy_s (line 197) | int tcpy_s(tchar* dst, size_t max_dst_chars, const tchar* src)
function tncat_s (line 207) | int tncat_s(tchar* dst, size_t max_dst_chars, const tchar* src, size_t m...
function tcat_s (line 241) | int tcat_s(tchar* dst, size_t max_dst_chars, const tchar* src)
function tvsprintf_s (line 247) | int tvsprintf_s(tchar* dst, size_t max_dst_chars, const tchar* fmt, va_l...
function tsprintf_s (line 273) | int tsprintf_s(tchar* buf, size_t max_chars, const tchar* fmt, ...)
FILE: fpsgame/gui/secure_crt.h
function namespace (line 34) | namespace ERR
FILE: fpsgame/gui/sysdep/os/unix/udbg.cpp
function Status (line 42) | Status debug_CaptureContext(void* UNUSED(context))
function debug_break (line 48) | void debug_break()
function udbg_launch_debugger (line 62) | void udbg_launch_debugger()
function debug_puts (line 95) | void debug_puts(const char* text)
function debug_puts (line 102) | void debug_puts(const char* text)
function debug_IsPointerBogus (line 110) | int debug_IsPointerBogus(const void* UNUSED(p))
FILE: fpsgame/gui/sysdep/os/unix/ufilesystem.cpp
type WDIR (line 34) | struct WDIR
function init_libc (line 54) | void init_libc()
function init_libc (line 72) | void init_libc() { }
function WDIR (line 76) | WDIR* wopendir(const OsPath& path)
type wdirent (line 89) | struct wdirent
function wclosedir (line 98) | int wclosedir(WDIR* wd)
function wopen (line 106) | int wopen(const OsPath& pathname, int oflag)
function wopen (line 112) | int wopen(const OsPath& pathname, int oflag, mode_t mode)
function wclose (line 117) | int wclose(int fd)
function wtruncate (line 123) | int wtruncate(const OsPath& pathname, off_t length)
function wunlink (line 128) | int wunlink(const OsPath& pathname)
function wrmdir (line 133) | int wrmdir(const OsPath& path)
function wrename (line 138) | int wrename(const OsPath& pathnameOld, const OsPath& pathnameNew)
function OsPath (line 143) | OsPath wrealpath(const OsPath& pathname)
function wstat (line 152) | int wstat(const OsPath& pathname, struct stat* buf)
function wmkdir (line 157) | int wmkdir(const OsPath& path, mode_t mode)
FILE: fpsgame/gui/sysdep/os/unix/unix.cpp
function sys_IsDebuggerPresent (line 46) | bool sys_IsDebuggerPresent()
function sys_WideFromArgv (line 51) | std::wstring sys_WideFromArgv(const char* argv_i)
function sys_display_msg (line 60) | void sys_display_msg(const wchar_t* caption, const wchar_t* msg)
function ErrorReactionInternal (line 66) | static ErrorReactionInternal try_gui_display_error(const wchar_t* text, ...
function ErrorReactionInternal (line 76) | static ErrorReactionInternal try_gui_display_error(const wchar_t* text, ...
function ErrorReactionInternal (line 206) | ErrorReactionInternal sys_display_error(const wchar_t* text, size_t flags)
function Status (line 275) | Status sys_StatusDescription(int err, wchar_t* buf, size_t max_chars)
function sys_max_sector_size (line 290) | size_t sys_max_sector_size()
function sys_get_user_name (line 299) | std::wstring sys_get_user_name()
function Status (line 322) | Status sys_generate_random_bytes(u8* buf, size_t count)
function Status (line 342) | Status sys_get_proxy_config(const std::wstring& UNUSED(url), std::wstrin...
function Status (line 347) | Status sys_open_url(const std::string& url)
function FILE (line 377) | FILE* sys_OpenFile(const OsPath& pathname, const char* mode)
FILE: fpsgame/gui/sysdep/os/unix/unix_executable_pathname.cpp
function OsPath (line 33) | OsPath unix_ExecutablePathname()
FILE: fpsgame/gui/sysdep/os/unix/unuma.cpp
function numa_NumNodes (line 29) | size_t numa_NumNodes()
function numa_NodeFromProcessor (line 34) | size_t numa_NodeFromProcessor(size_t UNUSED(processor))
function numa_ProcessorMaskFromNode (line 39) | uintptr_t numa_ProcessorMaskFromNode(size_t node)
function numa_AvailableMemory (line 45) | size_t numa_AvailableMemory(size_t node)
function numa_Factor (line 51) | double numa_Factor()
function numa_IsMemoryInterleaved (line 56) | bool numa_IsMemoryInterleaved()
FILE: fpsgame/gui/sysdep/os/unix/uvm.cpp
type vm (line 38) | namespace vm {
function ReleaseAddressSpace (line 49) | void ReleaseAddressSpace(void* p, size_t size)
function Commit (line 59) | bool Commit(uintptr_t address, size_t size, PageType UNUSED(pageType),...
function Decommit (line 77) | bool Decommit(uintptr_t address, size_t size)
function Protect (line 86) | bool Protect(uintptr_t address, size_t size, int prot)
function Free (line 113) | void Free(void* p, size_t size)
function BeginOnDemandCommits (line 120) | void BeginOnDemandCommits()
function EndOnDemandCommits (line 125) | void EndOnDemandCommits()
function DumpStatistics (line 131) | void DumpStatistics()
FILE: fpsgame/gui/sysdep/os/unix/x/x.cpp
type gfx (line 61) | namespace gfx {
function Status (line 63) | Status GetVideoMode(int* xres, int* yres, int* bpp, int* freq)
function Status (line 95) | Status GetMonitorSize(int& width_mm, int& height_mm)
function get_wminfo (line 113) | static bool get_wminfo(SDL_SysWMinfo& wminfo)
function wchar_t (line 170) | wchar_t *sys_clipboard_get()
function Status (line 244) | Status sys_clipboard_free(wchar_t *clip_buf)
function clipboard_filter (line 257) | int clipboard_filter(void* UNUSED(userdata), SDL_Event* event)
function Status (line 314) | Status x11_clipboard_init()
function Status (line 351) | Status sys_clipboard_set(const wchar_t *str)
type sys_cursor_impl (line 380) | struct sys_cursor_impl
function XcursorPixel (line 386) | static XcursorPixel cursor_pixel_to_x11_format(const XcursorPixel& bgra_...
function Status (line 400) | Status sys_cursor_create(int w, int h, void* bgra_img, int hx, int hy, s...
function Status (line 428) | Status sys_cursor_create_empty(sys_cursor* cursor)
function Status (line 437) | Status sys_cursor_set(sys_cursor cursor)
function Status (line 469) | Status sys_cursor_free(sys_cursor cursor)
function Status (line 490) | Status sys_cursor_reset()
FILE: fpsgame/gui/sysdep/os/win/aken/aken.c
function IsMemoryUncacheable (line 85) | static int IsMemoryUncacheable(DWORD64 physicalAddress64)
function NTSTATUS (line 96) | static NTSTATUS AkenMapPhysicalMemory(const DWORD64 physicalAddress64, c...
function NTSTATUS (line 182) | static NTSTATUS AkenUnmapPhysicalMemory(const DWORD64 virtualAddress)
function NTSTATUS (line 205) | static NTSTATUS AkenIoctlReadPort(PVOID buf, const ULONG inSize, ULONG* ...
function NTSTATUS (line 241) | static NTSTATUS AkenIoctlWritePort(PVOID buf, const ULONG inSize, ULONG*...
function NTSTATUS (line 273) | static NTSTATUS AkenIoctlMap(PVOID buf, const ULONG inSize, ULONG* outSize)
function NTSTATUS (line 297) | static NTSTATUS AkenIoctlUnmap(PVOID buf, const ULONG inSize, ULONG* out...
function NTSTATUS (line 316) | static NTSTATUS AkenIoctlReadModelSpecificRegister(PVOID buf, const ULON...
function NTSTATUS (line 339) | static NTSTATUS AkenIoctlWriteModelSpecificRegister(PVOID buf, const ULO...
function NTSTATUS (line 356) | static NTSTATUS AkenIoctlReadPerformanceMonitoringCounter(PVOID buf, con...
function NTSTATUS (line 380) | static NTSTATUS AkenIoctlUnknown(PVOID buf, const ULONG inSize, ULONG* o...
type NTSTATUS (line 391) | typedef NTSTATUS (*AkenIoctl)(PVOID buf, ULONG inSize, ULONG* outSize);
function AkenIoctl (line 393) | static AkenIoctl AkenIoctlFromCode(ULONG ioctlCode)
function NTSTATUS (line 424) | static NTSTATUS AkenCreate(IN PDEVICE_OBJECT deviceObject, IN PIRP irp)
function NTSTATUS (line 435) | static NTSTATUS AkenClose(IN PDEVICE_OBJECT deviceObject, IN PIRP irp)
function NTSTATUS (line 447) | static NTSTATUS AkenDeviceControl(IN PDEVICE_OBJECT deviceObject, IN PIR...
function VOID (line 471) | static VOID AkenUnload(IN PDRIVER_OBJECT driverObject)
function NTSTATUS (line 489) | NTSTATUS DriverEntry(IN PDRIVER_OBJECT driverObject, IN PUNICODE_STRING ...
FILE: fpsgame/gui/sysdep/os/win/aken/aken.h
type AkenReadPortIn (line 53) | typedef struct AkenReadPortIn_
type AkenReadPortOut (line 60) | typedef struct AkenReadPortOut_
type AkenWritePortIn (line 66) | typedef struct AkenWritePortIn_
type AkenMapIn (line 74) | typedef struct AkenMapIn_
type AkenMapOut (line 83) | typedef struct AkenMapOut_
type AkenUnmapIn (line 89) | typedef struct AkenUnmapIn_
type AkenReadRegisterIn (line 95) | typedef struct AkenReadRegisterIn_
type AkenReadRegisterOut (line 101) | typedef struct AkenReadRegisterOut_
type AkenWriteRegisterIn (line 107) | typedef struct AkenWriteRegisterIn_
FILE: fpsgame/gui/sysdep/os/win/mahaf.cpp
function u32 (line 45) | static u32 ReadPort(u16 port, u8 numBytes)
function u8 (line 61) | u8 mahaf_ReadPort8(u16 port)
function u16 (line 68) | u16 mahaf_ReadPort16(u16 port)
function u32 (line 75) | u32 mahaf_ReadPort32(u16 port)
function WritePort (line 82) | static void WritePort(u16 port, u32 value, u8 numBytes)
function mahaf_WritePort8 (line 95) | void mahaf_WritePort8(u16 port, u8 value)
function mahaf_WritePort16 (line 100) | void mahaf_WritePort16(u16 port, u16 value)
function mahaf_WritePort32 (line 105) | void mahaf_WritePort32(u16 port, u32 value)
function mahaf_IsPhysicalMappingDangerous (line 111) | bool mahaf_IsPhysicalMappingDangerous()
function mahaf_UnmapPhysicalMemory (line 142) | void mahaf_UnmapPhysicalMemory(volatile void* virtualAddress)
function u64 (line 156) | static u64 ReadRegister(DWORD ioctl, u64 reg)
function u64 (line 171) | u64 mahaf_ReadModelSpecificRegister(u64 reg)
function u64 (line 176) | u64 mahaf_ReadPerformanceMonitoringCounter(u64 reg)
function mahaf_WriteModelSpecificRegister (line 181) | void mahaf_WriteModelSpecificRegister(u64 reg, u64 value)
function SC_HANDLE (line 199) | static SC_HANDLE OpenServiceControlManager(DWORD access)
function UninstallDriver (line 220) | static void UninstallDriver()
function StartDriver (line 253) | static void StartDriver(const OsPath& driverPathname)
function Is64BitOs (line 321) | static bool Is64BitOs()
function OsPath (line 330) | static OsPath DriverPathname()
function Status (line 348) | static Status Init()
function Shutdown (line 379) | static void Shutdown()
function Status (line 390) | Status mahaf_Init()
function mahaf_Shutdown (line 395) | void mahaf_Shutdown()
FILE: fpsgame/gui/sysdep/os/win/tests/test_ia32.h
function class (line 31) | class TestIA32: public CxxTest::TestSuite
FILE: fpsgame/gui/sysdep/os/win/tests/test_wdbg_sym.h
function Status (line 46) | static Status OnFrame(const _tagSTACKFRAME64* frame, uintptr_t UNUSED(cb...
function Func1 (line 59) | __declspec(noinline) static void Func1()
function Func2 (line 66) | __declspec(noinline) static void Func2()
function Func3 (line 71) | __declspec(noinline) static void Func3()
function class (line 77) | class TestWdbgSym : public CxxTest::TestSuite
FILE: fpsgame/gui/sysdep/os/win/wclipboard.cpp
function Status (line 31) | static Status SetClipboardText(const wchar_t* text, HGLOBAL& hMem)
function Status (line 54) | static Status GetClipboardText(wchar_t*& text)
function Status (line 85) | Status sys_clipboard_set(const wchar_t* text)
function wchar_t (line 105) | wchar_t* sys_clipboard_get()
function Status (line 119) | Status sys_clipboard_free(wchar_t* text)
FILE: fpsgame/gui/sysdep/os/win/wcpu.cpp
function os_cpu_ProcessorMask (line 38) | uintptr_t os_cpu_ProcessorMask()
function os_cpu_NumProcessors (line 56) | size_t os_cpu_NumProcessors()
function Status (line 77) | Status wcpu_ReadFrequencyFromRegistry(u32& freqMhz)
function os_cpu_PageSize (line 95) | size_t os_cpu_PageSize()
function os_cpu_LargePageSize (line 110) | size_t os_cpu_LargePageSize()
function GetMemoryStatus (line 135) | static void GetMemoryStatus(MEMORYSTATUSEX& mse)
function os_cpu_QueryMemorySize (line 145) | size_t os_cpu_QueryMemorySize()
function os_cpu_MemoryAvailable (line 161) | size_t os_cpu_MemoryAvailable()
function DWORD_PTR (line 172) | DWORD_PTR wcpu_AffinityFromProcessorMask(DWORD_PTR processAffinity, uint...
function wcpu_ProcessorMaskFromAffinity (line 191) | uintptr_t wcpu_ProcessorMaskFromAffinity(DWORD_PTR processAffinity, DWOR...
function VerifyRunningOnCorrectProcessors (line 213) | static void VerifyRunningOnCorrectProcessors(DWORD_PTR affinity)
function os_cpu_SetThreadAffinityMask (line 236) | uintptr_t os_cpu_SetThreadAffinityMask(uintptr_t processorMask)
function Status (line 257) | Status os_cpu_CallByEachCPU(OsCpuCallback cb, uintptr_t cbData)
FILE: fpsgame/gui/sysdep/os/win/wcursor.cpp
function sys_cursor (line 30) | static sys_cursor cursor_from_HICON(HICON hIcon)
function sys_cursor (line 35) | static sys_cursor cursor_from_HCURSOR(HCURSOR hCursor)
function HICON (line 40) | static HICON HICON_from_cursor(sys_cursor cursor)
function HCURSOR (line 45) | static HCURSOR HCURSOR_from_cursor(sys_cursor cursor)
function Status (line 51) | static Status sys_cursor_create_common(int w, int h, void* bgra_img, voi...
function Status (line 86) | Status sys_cursor_create(int w, int h, void* bgra_img, int hx, int hy, s...
function Status (line 99) | Status sys_cursor_create_empty(sys_cursor* cursor)
function Status (line 110) | Status sys_cursor_set(sys_cursor cursor)
function Status (line 123) | Status sys_cursor_free(sys_cursor cursor)
function Status (line 139) | Status sys_cursor_reset()
FILE: fpsgame/gui/sysdep/os/win/wdbg.cpp
function debug_IsPointerBogus (line 38) | int debug_IsPointerBogus(const void* p)
function debug_IsCodePointer (line 62) | bool debug_IsCodePointer(void* p)
function debug_IsStackPointer (line 77) | bool debug_IsStackPointer(void* p)
function debug_puts (line 95) | void debug_puts(const char* text)
function wdbg_printf (line 101) | void wdbg_printf(const wchar_t* fmt, ...)
function debug_SetThreadName (line 117) | void debug_SetThreadName(const char* name)
FILE: fpsgame/gui/sysdep/os/win/wdbg_heap.cpp
function wdbg_heap_Enable (line 41) | void wdbg_heap_Enable(bool enable)
function wdbg_heap_Validate (line 66) | void wdbg_heap_Validate()
type _CrtMemBlockHeader (line 120) | struct _CrtMemBlockHeader
type _CrtMemBlockHeader (line 122) | struct _CrtMemBlockHeader
type _CrtMemBlockHeader (line 123) | struct _CrtMemBlockHeader
method IsValid (line 137) | bool IsValid() const
function _CrtMemBlockHeader (line 172) | static _CrtMemBlockHeader* HeaderFromData(void* userData)
type _CrtMemBlockHeader (line 122) | struct _CrtMemBlockHeader
type _CrtMemBlockHeader (line 123) | struct _CrtMemBlockHeader
method IsValid (line 137) | bool IsValid() const
function _CrtMemBlockHeader (line 190) | static _CrtMemBlockHeader* GetHeapListHead(int operation, void* userData...
type _CrtMemBlockHeader (line 122) | struct _CrtMemBlockHeader
type _CrtMemBlockHeader (line 123) | struct _CrtMemBlockHeader
method IsValid (line 137) | bool IsValid() const
class ModuleExtents (line 246) | class ModuleExtents
method ModuleExtents (line 249) | ModuleExtents()
method ModuleExtents (line 254) | ModuleExtents(const wchar_t* dllName)
method Address (line 264) | uintptr_t Address() const
method Length (line 269) | uintptr_t Length() const
method Contains (line 274) | bool Contains(uintptr_t address) const
class ArraySet (line 290) | class ArraySet
method ArraySet (line 293) | ArraySet()
method Add (line 298) | void Add(T t)
method Find (line 308) | bool Find(T t) const
method RemoveDuplicates (line 313) | void RemoveDuplicates()
class CallerFilter (line 325) | class CallerFilter
method CallerFilter (line 328) | CallerFilter()
method Status (line 338) | Status NotifyOfCaller(uintptr_t pc)
method IsKnownCaller (line 353) | bool IsKnownCaller(uintptr_t pc) const
method AddRuntimeLibraryToIgnoreList (line 367) | void AddRuntimeLibraryToIgnoreList()
method CallHeapFunctions (line 387) | static void CallHeapFunctions()
function Quantize (line 428) | static uintptr_t Quantize(uintptr_t pc)
function Expand (line 438) | static uintptr_t Expand(uintptr_t pc)
function NumBitsForEncodedLength (line 447) | static size_t NumBitsForEncodedLength(size_t encodedLength)
function EncodedLength (line 459) | static size_t EncodedLength(uintptr_t quantizedOffset)
function FindCodeSegment (line 478) | static void FindCodeSegment()
class BitStream (line 488) | class BitStream
method BitStream (line 491) | BitStream(u8* storage, size_t storageSize)
method BitsLeft (line 497) | size_t BitsLeft() const
method Write (line 502) | void Write(const size_t numOutputBits, uintptr_t outputValue)
method Finish (line 532) | void Finish()
method Read (line 556) | uintptr_t Read(const size_t numInputBits)
function StashCallers (line 593) | static void StashCallers(_CrtMemBlockHeader* header, const uintptr_t* ca...
function RetrieveCallers (line 633) | static void RetrieveCallers(_CrtMemBlockHeader* header, uintptr_t* calle...
class CallStack (line 672) | class CallStack
method Gather (line 675) | void Gather()
method NumCallers (line 689) | size_t NumCallers() const
method Status (line 695) | Status OnFrame(const STACKFRAME64* frame)
method Status (line 718) | static Status OnFrame_Trampoline(const STACKFRAME64* frame, uintptr_t ...
class AllocationHook (line 734) | class AllocationHook
method AllocationHook (line 737) | AllocationHook()
method Hook (line 760) | static int __cdecl Hook(int operation, void* userData, size_t size, in...
function wdbg_heap_NumberOfAllocations (line 798) | intptr_t wdbg_heap_NumberOfAllocations()
class AllocationTracker (line 803) | class AllocationTracker : public AllocationHook
method AllocationTracker (line 806) | AllocationTracker()
method OnHeapOperation (line 811) | virtual void OnHeapOperation(int operation, void* userData, size_t siz...
function PrintCallStack (line 844) | static void PrintCallStack(const uintptr_t* callers, size_t numCallers)
function ReportHook (line 866) | static int __cdecl ReportHook(int reportType, wchar_t* message, int* out)
function wdbg_heap_NumberOfAllocations (line 930) | intptr_t wdbg_heap_NumberOfAllocations()
function Status (line 943) | static Status wdbg_heap_Init()
function Status (line 964) | static Status wdbg_heap_Shutdown()
FILE: fpsgame/gui/sysdep/os/win/wdbg_sym.cpp
function Status (line 48) | static Status wdbg_sym_Init()
function Status (line 65) | static Status InitDbghelp()
function sym_init (line 107) | static void sym_init()
function STACKFRAME64 (line 114) | static STACKFRAME64 PopulateStackFrame(CONTEXT& context)
function IMAGEHLP_STACK_FRAME (line 134) | static IMAGEHLP_STACK_FRAME PopulateImageStackFrame(const STACKFRAME64& sf)
type SYMBOL_INFO_PACKAGEW2 (line 156) | struct SYMBOL_INFO_PACKAGEW2 : public SYMBOL_INFO_PACKAGEW
method SYMBOL_INFO_PACKAGEW2 (line 158) | SYMBOL_INFO_PACKAGEW2()
type TI_FINDCHILDREN_PARAMS2 (line 169) | struct TI_FINDCHILDREN_PARAMS2
method TI_FINDCHILDREN_PARAMS2 (line 171) | TI_FINDCHILDREN_PARAMS2(DWORD numChildren)
function Status (line 187) | static Status ResolveSymbol_lk(void* ptr_of_interest, wchar_t* sym_name,...
function Status (line 249) | Status debug_ResolveSymbol(void* ptr_of_interest, wchar_t* sym_name, wch...
function Status (line 260) | Status debug_CaptureContext(void* pcontext)
function Status (line 284) | static Status CallStackWalk(STACKFRAME64& sf, CONTEXT& context)
function Status (line 311) | Status wdbg_sym_WalkStack(StackFrameCallback cb, uintptr_t cbData, CONTE...
type StoreAddress (line 344) | struct StoreAddress
method Status (line 346) | static Status Func(const STACKFRAME64* sf, uintptr_t cbData)
type DumpState (line 371) | struct DumpState
method DumpState (line 378) | DumpState(uintptr_t moduleBase, LPSTACKFRAME64 stackFrame)
function out_init (line 410) | static void out_init(wchar_t* buf, size_t max_chars)
function out (line 419) | static void out(const wchar_t* fmt, ...)
function out_erase (line 465) | static void out_erase(size_t num_chars)
function out_latch_pos (line 480) | static void out_latch_pos()
function Status (line 488) | static Status out_check_limit()
function is_string (line 513) | static bool is_string(const u8* p, size_t stride)
type CV_HREG_e (line 553) | enum CV_HREG_e
function dump_error (line 560) | static void dump_error(Status err)
function Status (line 593) | static Status dump_string(const u8* p, size_t el_size)
function seq_determine_formatting (line 627) | static void seq_determine_formatting(size_t el_size, size_t el_count, bo...
function Status (line 652) | static Status dump_sequence(DebugStlIterator el_iterator, void* internal...
function u8 (line 715) | static const u8* array_iterator(void* internal, size_t el_size)
function Status (line 724) | static Status dump_array(const u8* p, size_t el_count, DWORD el_type_id,...
function Status (line 732) | static Status CanHandleDataKind(DWORD dataKind)
function IsRelativeToFramePointer (line 764) | static bool IsRelativeToFramePointer(DWORD flags, DWORD reg)
function IsUnretrievable (line 775) | static bool IsUnretrievable(DWORD flags)
function Status (line 793) | static Status DetermineSymbolAddress(DWORD id, const SYMBOL_INFOW* sym, ...
function Status (line 829) | static Status dump_sym_array(DWORD type_id, const u8* p, DumpState& state)
function AppendCharacterIfPrintable (line 859) | static void AppendCharacterIfPrintable(u64 data)
function Status (line 870) | static Status dump_sym_base_type(DWORD type_id, const u8* p, DumpState& ...
function Status (line 1006) | static Status dump_sym_base_class(DWORD type_id, const u8* p, DumpState&...
function Status (line 1025) | static Status dump_sym_data(DWORD id, const u8* p, DumpState& state)
function Status (line 1049) | static Status dump_sym_enum(DWORD type_id, const u8* p, DumpState& state)
function Status (line 1107) | static Status dump_sym_function(DWORD UNUSED(type_id), const u8* UNUSED(...
function Status (line 1115) | static Status dump_sym_function_type(DWORD UNUSED(type_id), const u8* p,...
function ptr_reset_visited (line 1146) | static void ptr_reset_visited()
function ptr_already_visited (line 1151) | static bool ptr_already_visited(const u8* p)
function Status (line 1183) | static Status dump_sym_pointer(DWORD type_id, const u8* p, DumpState& st...
function Status (line 1226) | static Status dump_sym_typedef(DWORD type_id, const u8* p, DumpState& st...
function Status (line 1240) | static Status udt_get_child_type(const wchar_t* child_name, ULONG numChi...
function Status (line 1274) | static Status udt_dump_std(const wchar_t* type_name, const u8* p, size_t...
function udt_should_suppress (line 1342) | static bool udt_should_suppress(const wchar_t* type_name)
function Status (line 1391) | static Status udt_dump_suppressed(const wchar_t* type_name, const u8* UN...
function udt_fits_on_one_line (line 1411) | static bool udt_fits_on_one_line(const wchar_t* type_name, size_t child_...
function Status (line 1443) | static Status udt_dump_normal(const wchar_t* type_name, const u8* p, siz...
function Status (line 1521) | static Status dump_sym_udt(DWORD type_id, const u8* p, DumpState& state)
function Status (line 1567) | static Status dump_sym_vtable(DWORD UNUSED(type_id), const u8* UNUSED(p)...
function Status (line 1577) | static Status dump_sym_unknown(DWORD type_id, const u8* UNUSED(p), DumpS...
function DumpFunc (line 1594) | static DumpFunc DumpFuncFromTypeTag(DWORD typeTag)
function Status (line 1628) | static Status dump_sym(DWORD type_id, const u8* p, DumpState& state)
function ShouldSkipSymbol (line 1644) | static bool ShouldSkipSymbol(const wchar_t* name)
function BOOL (line 1655) | static BOOL CALLBACK dump_sym_cb(SYMBOL_INFOW* sym, ULONG UNUSED(size), ...
function Status (line 1676) | static Status dump_frame_cb(const STACKFRAME64* sf, uintptr_t UNUSED(use...
function Status (line 1730) | Status debug_DumpStack(wchar_t* buf, size_t maxChars, void* pcontext, co...
function wdbg_sym_WriteMinidump (line 1755) | void wdbg_sym_WriteMinidump(EXCEPTION_POINTERS* exception_pointers)
FILE: fpsgame/gui/sysdep/os/win/wdbg_sym.h
type _tagSTACKFRAME64 (line 32) | struct _tagSTACKFRAME64
type Status (line 43) | typedef Status (*StackFrameCallback)(const _tagSTACKFRAME64* frame, uint...
FILE: fpsgame/gui/sysdep/os/win/wdir_watch.cpp
class DirHandle (line 45) | class DirHandle
method DirHandle (line 48) | DirHandle(const OsPath& path)
class DirWatchRequest (line 81) | class DirWatchRequest
method DirWatchRequest (line 85) | DirWatchRequest(const OsPath& path)
method OsPath (line 129) | const OsPath& Path() const
method AttachTo (line 134) | void AttachTo(HANDLE& hIOCP) const
method Status (line 140) | Status Issue()
method RetrieveNotifications (line 159) | void RetrieveNotifications(DirWatchNotifications& notifications) const
method TypeFromAction (line 181) | static DirWatchNotification::EType TypeFromAction(const DWORD action)
class IntrusiveLink (line 243) | class IntrusiveLink
method IntrusiveLink (line 246) | IntrusiveLink()
method IntrusiveLink (line 251) | IntrusiveLink(IntrusiveLink* sentinel)
method IntrusiveLink (line 267) | IntrusiveLink* Next() const
type DirWatch (line 281) | struct DirWatch
method DirWatch (line 283) | DirWatch(IntrusiveLink* sentinel, const PDirWatchRequest& request)
class DirWatchManager (line 296) | class DirWatchManager
method DirWatchManager (line 299) | DirWatchManager()
method Status (line 309) | Status Add(const OsPath& path, PDirWatch& dirWatch)
method Status (line 333) | Status Poll(DirWatchNotifications& notifications)
function Status (line 358) | Status dir_watch_Add(const OsPath& path, PDirWatch& dirWatch)
function Status (line 364) | Status dir_watch_Poll(DirWatchNotifications& notifications)
function Status (line 373) | static Status wdir_watch_Init()
function Status (line 379) | static Status wdir_watch_Shutdown()
FILE: fpsgame/gui/sysdep/os/win/wdll_delay_load.cpp
type ImgDelayDescr (line 50) | struct ImgDelayDescr {
type DLAttr (line 64) | enum DLAttr { // Delay Load Attributes
type DelayLoadProc (line 88) | struct DelayLoadProc {
type DelayLoadInfo (line 97) | struct DelayLoadInfo {
function wdll_add_notify (line 117) | void wdll_add_notify(WdllLoadNotify* notify)
function FARPROC (line 123) | static FARPROC WINAPI notify_hook(unsigned dliNotify, PDelayLoadInfo pdli)
function IndexFromPImgThunkData (line 168) | inline unsigned
function X (line 178) | X PFromRva(RVA rva) {
type UnloadInfo (line 183) | struct UnloadInfo
type UnloadInfo (line 184) | struct UnloadInfo {
function CountOfImports (line 191) | inline unsigned
type ULI (line 204) | struct ULI : public UnloadInfo
method ULI (line 206) | ULI(PCImgDelayDescr pidd_)
method Unlink (line 217) | void Unlink()
method Link (line 227) | void Link()
type InternalImgDelayDescr (line 238) | struct InternalImgDelayDescr {
function PIMAGE_NT_HEADERS (line 253) | static inline PIMAGE_NT_HEADERS WINAPI
function OverlayIAT (line 258) | static inline void WINAPI
function DWORD (line 263) | static inline DWORD WINAPI
function FLoadedAtPreferredAddress (line 268) | static inline bool WINAPI
function FARPROC (line 274) | FARPROC WINAPI __delayLoadHelper2(PCImgDelayDescr pidd, FARPROC* ppfnIAT...
function UnloadAllDlls (line 447) | static void UnloadAllDlls()
function Status (line 472) | static Status wdll_Shutdown()
FILE: fpsgame/gui/sysdep/os/win/wdll_delay_load.h
type WdllLoadNotify (line 31) | struct WdllLoadNotify
FILE: fpsgame/gui/sysdep/os/win/wdll_main.h
function BOOL (line 29) | BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD UNUSED(reason), LPVOID UN...
FILE: fpsgame/gui/sysdep/os/win/wdll_ver.cpp
function Status (line 45) | static Status ReadVersionString(const OsPath& modulePathname, wchar_t* o...
function wdll_ver_Append (line 85) | void wdll_ver_Append(const OsPath& pathname, VersionList& list)
FILE: fpsgame/gui/sysdep/os/win/wdll_ver.h
type std (line 32) | typedef std::wstring VersionList;
FILE: fpsgame/gui/sysdep/smbios.h
type FieldFlags (line 124) | enum FieldFlags
function value (line 146) | Size(T value): value(value) {}
FILE: fpsgame/gui/sysdep/snd.cpp
function snd_detect (line 38) | void snd_detect()
FILE: fpsgame/gui/sysdep/tests/test_rtl.h
function class (line 27) | class Test_rtl : public CxxTest::TestSuite
FILE: fpsgame/gui/sysdep/tests/test_sysdep.h
function class (line 37) | class TestSysdep : public CxxTest::TestSuite
FILE: fpsgame/gui/sysdep/vm.h
function namespace (line 33) | namespace vm {
FILE: fpsgame/gui/tests/test_adts.h
function class (line 28) | class TestRingbuf : public CxxTest::TestSuite
FILE: fpsgame/gui/tests/test_base32.h
function class (line 27) | class TestBase32 : public CxxTest::TestSuite
FILE: fpsgame/gui/tests/test_bits.h
function class (line 30) | class TestBits : public CxxTest::TestSuite
FILE: fpsgame/gui/tests/test_byte_order.h
function class (line 27) | class TestByteOrder : public CxxTest::TestSuite
FILE: fpsgame/gui/tests/test_cache_adt.h
function class (line 28) | class TestCache: public CxxTest::TestSuite
function DISABLED_test_cache_policies (line 89) | void DISABLED_test_cache_policies()
FILE: fpsgame/gui/tests/test_fnv_hash.h
function class (line 27) | class TestFnvHash : public CxxTest::TestSuite
FILE: fpsgame/gui/tests/test_lib.h
function class (line 27) | class TestLib : public CxxTest::TestSuite
FILE: fpsgame/gui/tests/test_path.h
function class (line 28) | class TestPath : public CxxTest::TestSuite
FILE: fpsgame/gui/tests/test_path_util.h
function class (line 36) | class TestPathUtil : public CxxTest::TestSuite
FILE: fpsgame/gui/tests/test_rand.h
function class (line 27) | class TestRand : public CxxTest::TestSuite
FILE: fpsgame/gui/tests/test_regex.h
function class (line 27) | class TestRegex : public CxxTest::TestSuite
FILE: fpsgame/gui/tests/test_secure_crt.h
function class (line 36) | class SuppressErrors
function class (line 63) | class SuppressErrors
function class (line 73) | class TestString_s : public CxxTest::TestSuite
FILE: fpsgame/gui/tests/test_wchar.h
function class (line 28) | class Test_wchar : public CxxTest::TestSuite
FILE: fpsgame/gui/tex/tex.cpp
function Status (line 60) | Status Tex::validate() const
function Status (line 101) | Status tex_validate_plain_format(size_t bpp, size_t flags)
function tex_util_foreach_mipmap (line 132) | void tex_util_foreach_mipmap(size_t w, size_t h, size_t bpp, const u8* p...
type CreateLevelData (line 175) | struct CreateLevelData
function create_level (line 186) | static void create_level(size_t level, size_t level_w, size_t level_h, c...
function Status (line 253) | static Status add_mipmaps(Tex* t, size_t w, size_t h, size_t bpp, void* ...
function Status (line 287) | static Status plain_transform(Tex* t, size_t transforms)
function Status (line 467) | Status Tex::transform(size_t transforms)
function Status (line 494) | Status Tex::transform_to(size_t new_flags)
function tex_set_global_orientation (line 513) | void tex_set_global_orientation(int o)
function flip_to_global_orientation (line 520) | static void flip_to_global_orientation(Tex* t)
function tex_orientations_match (line 548) | bool tex_orientations_match(size_t src_flags, size_t dst_orientation)
function tex_is_known_extension (line 570) | bool tex_is_known_extension(const VfsPath& pathname)
function Status (line 593) | Status Tex::wrap(size_t w, size_t h, size_t bpp, size_t flags, const sha...
function u8 (line 629) | u8* Tex::get_data()
function u32 (line 641) | u32 Tex::get_average_color() const
function add_level_size (line 676) | static void add_level_size(size_t UNUSED(level), size_t UNUSED(level_w),...
function tex_hdr_size (line 705) | size_t tex_hdr_size(const VfsPath& filename)
function Status (line 719) | Status Tex::decode(const shared_ptr<u8>& Data, size_t DataSize)
function Status (line 752) | Status Tex::encode(const OsPath& extension, DynArray* da)
FILE: fpsgame/gui/tex/tex.h
function namespace (line 113) | namespace ERR
function namespace (line 125) | namespace WARN
function namespace (line 130) | namespace INFO
type TexFlags (line 140) | enum TexFlags
type Tex (line 209) | struct Tex
FILE: fpsgame/gui/tex/tex_bmp.cpp
type BmpHeader (line 34) | struct BmpHeader
function Status (line 63) | Status TexCodecBmp::transform(Tex* UNUSED(t), size_t UNUSED(transforms))...
function Status (line 98) | Status TexCodecBmp::decode(rpU8 data, size_t UNUSED(size), Tex* RESTRICT...
function Status (line 127) | Status TexCodecBmp::encode(Tex* RESTRICT t, DynArray* RESTRICT da) const
FILE: fpsgame/gui/tex/tex_codec.cpp
function Status (line 50) | Status tex_codec_for_filename(const OsPath& extension, const ITexCodec** c)
function Status (line 66) | Status tex_codec_for_header(const u8* file, size_t file_size, const ITex...
function Status (line 84) | Status tex_codec_transform(Tex* t, size_t transforms)
function tex_codec_alloc_rows (line 120) | std::vector<RowPtr> tex_codec_alloc_rows(const u8* data, size_t h, size_...
function Status (line 142) | Status tex_codec_write(Tex* t, size_t transforms, const void* hdr, size_...
FILE: fpsgame/gui/tex/tex_codec.h
function class (line 39) | class ITexCodec
function class (line 120) | class TexCodecPng:ITexCodec {
function class (line 134) | class TexCodecDds:ITexCodec {
function class (line 148) | class TexCodecTga:ITexCodec {
function class (line 162) | class TexCodecBmp:ITexCodec {
type u8 (line 229) | typedef const u8* RowPtr;
FILE: fpsgame/gui/tex/tex_dds.cpp
class S3tcBlock (line 50) | class S3tcBlock
method S3tcBlock (line 53) | S3tcBlock(size_t dxt, const u8* RESTRICT block)
method WritePixel (line 64) | void WritePixel(size_t pixel_idx, u8* RESTRICT out) const
type RGBA (line 100) | enum RGBA { R, G, B, A }
method mix_2_3 (line 102) | static inline void mix_2_3(size_t dst[4], size_t c0[4], size_t c1[4])
method mix_avg (line 107) | static inline void mix_avg(size_t dst[4], size_t c0[4], size_t c1[4])
method access_bit_tbl (line 113) | static inline size_t access_bit_tbl(T tbl, size_t idx, size_t bit_width)
method unpack_to_8 (line 123) | static inline size_t unpack_to_8(u16 c, size_t bits_below, size_t num_...
method PrecalculateAlpha (line 131) | void PrecalculateAlpha(size_t dxt, const u8* RESTRICT a_block)
method PrecalculateColor (line 170) | void PrecalculateColor(size_t dxt, const u8* RESTRICT c_block)
type S3tcDecompressInfo (line 221) | struct S3tcDecompressInfo
function s3tc_decompress_level (line 229) | static void s3tc_decompress_level(size_t UNUSED(level), size_t level_w, ...
function Status (line 274) | static Status s3tc_decompress(Tex* t)
type DDS_PIXELFORMAT (line 320) | struct DDS_PIXELFORMAT
type DDS_HEADER (line 347) | struct DDS_HEADER
function is_valid_dxt (line 370) | static bool is_valid_dxt(size_t dxt)
function Status (line 390) | static Status decode_pf(const DDS_PIXELFORMAT* pf, size_t& bpp, size_t& ...
function Status (line 495) | static Status decode_sd(const DDS_HEADER* sd, size_t& w, size_t& h, size...
function Status (line 607) | Status TexCodecDds::decode(rpU8 data, size_t UNUSED(size), Tex* RESTRICT...
function Status (line 615) | Status TexCodecDds::encode(Tex* RESTRICT UNUSED(t), DynArray* RESTRICT U...
function Status (line 625) | Status TexCodecDds::transform(Tex* t, size_t transforms) const
FILE: fpsgame/gui/tex/tex_png.cpp
class MemoryStream (line 52) | class MemoryStream
method MemoryStream (line 55) | MemoryStream(rpU8 data, size_t size)
method RemainingSize (line 60) | size_t RemainingSize() const
method CopyTo (line 66) | void CopyTo(rpU8 dst, size_t dstSize)
function io_read (line 80) | static void io_read(png_struct* png_ptr, rpU8 data, png_size_t size)
function io_write (line 94) | static void io_write(png_struct* png_ptr, u8* data, png_size_t length)
function io_flush (line 102) | static void io_flush(png_structp UNUSED(png_ptr))
function Status (line 110) | Status TexCodecPng::transform(Tex* UNUSED(t), size_t UNUSED(transforms))...
function Status (line 121) | static Status png_decode_impl(MemoryStream* stream, png_structp png_ptr,...
function Status (line 201) | static Status png_encode_impl(Tex* t, png_structp png_ptr, png_infop inf...
function user_warning_fn (line 260) | static void user_warning_fn(png_structp UNUSED(png_ptr), png_const_charp...
function Status (line 272) | Status TexCodecPng::decode(rpU8 data, size_t size, Tex* RESTRICT t) const
function Status (line 307) | Status TexCodecPng::encode(Tex* RESTRICT t, DynArray* RESTRICT da) const
FILE: fpsgame/gui/tex/tex_tga.cpp
type TgaImgType (line 35) | enum TgaImgType
type TgaImgDesc (line 41) | enum TgaImgDesc
function Status (line 70) | Status TexCodecTga::transform(Tex* UNUSED(t), size_t UNUSED(transforms))...
function Status (line 115) | Status TexCodecTga::decode(rpU8 data, size_t UNUSED(size), Tex* RESTRICT...
function Status (line 147) | Status TexCodecTga::encode(Tex* RESTRICT t, DynArray* RESTRICT da) const
FILE: fpsgame/gui/timer.cpp
type timespec (line 65) | struct timespec
type timeval (line 67) | struct timeval
function timer_LatchStartTime (line 74) | void timer_LatchStartTime()
function EnsureMonotonic (line 88) | static void EnsureMonotonic(double& newTime)
function timer_Time (line 98) | double timer_Time()
function Status (line 126) | static Status InitResolution()
function timer_Resolution (line 145) | double timer_Resolution()
function TimerClient (line 166) | TimerClient* timer_AddClient(TimerClient* tc, const wchar_t* description)
function timer_DisplayClientTotals (line 181) | void timer_DisplayClientTotals()
function StringForSeconds (line 204) | std::string StringForSeconds(double seconds)
function StringForCycles (line 220) | std::string StringForCycles(Cycles cycles)
FILE: fpsgame/gui/timer.h
type Cycles (line 57) | typedef intptr_t Cycles;
type i64 (line 59) | typedef i64 Cycles;
function class (line 74) | class ScopeTimer
function class (line 164) | class TimerUnit
function class (line 218) | class TimerUnit
type TimerClient (line 275) | struct TimerClient
type BillingPolicy_Default (line 316) | struct BillingPolicy_Default
type BillingPolicy_Atomic (line 331) | struct BillingPolicy_Atomic
FILE: fpsgame/gui/types.h
type i8 (line 32) | typedef int8_t i8;
type i16 (line 33) | typedef int16_t i16;
type i32 (line 34) | typedef int32_t i32;
type i64 (line 35) | typedef int64_t i64;
type u8 (line 37) | typedef uint8_t u8;
type u16 (line 38) | typedef uint16_t u16;
type u32 (line 39) | typedef uint32_t u32;
type u64 (line 40) | typedef uint64_t u64;
type uint (line 42) | typedef unsigned int uint;
FILE: fpsgame/gui/utf8.cpp
function UTF32 (line 76) | static UTF32 RaiseError(Status err, Status* perr)
function UTF32 (line 90) | static UTF32 ReplaceIfInvalid(UTF32 u, Status* err)
class UTF8Codec (line 105) | class UTF8Codec
method Encode (line 108) | static void Encode(UTF32 u, UTF8*& dstPos)
method UTF32 (line 128) | static UTF32 Decode(const UTF8*& srcPos, const UTF8* const srcEnd, Sta...
method Size (line 151) | static inline size_t Size(UTF32 u)
method SizeFromFirstByte (line 161) | static inline size_t SizeFromFirstByte(UTF8 firstByte)
method IsValid (line 175) | static bool IsValid(const UTF8* const src, size_t size, const UTF8* co...
function utf8_from_wstring (line 208) | std::string utf8_from_wstring(const std::wstring& src, Status* err)
function wstring_from_utf8 (line 225) | std::wstring wstring_from_utf8(const std::string& src, Status* err)
FILE: fpsgame/gui/utf8.h
function namespace (line 27) | namespace ERR
FILE: fpsgame/test_Color.h
function class (line 22) | class TestColor : public CxxTest::TestSuite
FILE: sys/SysControl.cpp
class CSysControlLocal (line 20) | class CSysControlLocal : public CSysControl
FILE: sys/SysControl.h
function class (line 4) | class CSysControl //
Condensed preview — 394 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,208K chars).
[
{
"path": ".gitignore",
"chars": 434,
"preview": "*.filters\r\n\r\n/Test.VC.VC.opendb\r\n\r\n/Test.VC.db\r\n\r\n*.sdf\r\n\r\n*.vs\r\n\r\n*.pdb\r\n\r\n*.log\r\n\r\n*.tlog\r\n\r\n*.idb\r\n\r\nx64/*\r\n\r\n*.suo\r\n"
},
{
"path": "LICENSE",
"chars": 1064,
"preview": "MIT License\n\nCopyright (c) 2016 Li Tong\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof"
},
{
"path": "README.md",
"chars": 187,
"preview": "fpsgame\r\n====\r\n\r\nA simple FPS fight game based on 0 A.D..which is also an open-source game engine and a free software. Y"
},
{
"path": "Test/ActorBash.cpp",
"chars": 14630,
"preview": "#include \"Engine.h\"\n#include \"Game.h\"\n#include \"ObjectDummy.h\"\n#include \"BodyRigid.h\"\n#include \"BodyDummy.h\"\n#include \"P"
},
{
"path": "Test/ActorBash.h",
"chars": 4791,
"preview": "#pragma once\r\n#ifndef __ACTOR_BASE_H__\r\n#define __ACTOR_BASE_H__\r\n\r\n#include \"Shape.h\"\r\n#include \"Bounds.h\"\r\n#include \"P"
},
{
"path": "Test/CameraBash.cpp",
"chars": 3663,
"preview": "#include \"CameraBase.h\"\n#include \"sys/SysControl.h\"\n#include \"HMDWrapper.h\"\n#include \"Engine.h\"\n#include \"Game.h\"\n\nusing"
},
{
"path": "Test/CameraBash.h",
"chars": 2090,
"preview": "#ifndef __CAMERA_BASE_H__\n#define __CAMERA_BASE_H__\n#include \"Player.h\"\n\nclass CPlayer;\n\n/*\n*ͷǶȣӾ뾶СǶȣת߷ȡ\n*/\nclass CCame"
},
{
"path": "Test/Common.cpp",
"chars": 1145,
"preview": "#include \"Common.h\"\n#include \"Engine.h\"\n#include \"Game.h\"\n#include \"World.h\"\n\nCCommon::CCommon(void)\n{\n}\n\n\nCCommon::~CCo"
},
{
"path": "Test/Common.h",
"chars": 567,
"preview": "#pragma once\n#include \"MathLib.h\"\nusing namespace MathLib;\nclass CBRObject;\n\nclass CCommon\n{\npublic:\n\tCCommon(void);\n\t~C"
},
{
"path": "Test/FPSRole.cpp",
"chars": 4778,
"preview": "#include \"FPSRole.h\"\n#include \"Engine.h\"\n#include \"Creature.h\"\n#include \"AnimationBlend.h\"\n#include \"WorldEffect.h\"\n#inc"
},
{
"path": "Test/FPSRole.h",
"chars": 1574,
"preview": "#pragma once\n#include \"Rolebase.h\"\n#include \"UtilStr.h\"\n\nclass CAnimationBlendRotate;\nclass CAnimationBlendDual;\nclass C"
},
{
"path": "Test/FPSRoleLocal.cpp",
"chars": 2212,
"preview": "#include \"FPSRoleLocal.h\"\n#include \"Creature.h\"\n#include \"Engine.h\"\n#include \"Input.h\"\n#include \"App.h\"\n#include \"Object"
},
{
"path": "Test/FPSRoleLocal.h",
"chars": 743,
"preview": "#pragma once\n#include \"FPSRole.h\"\n\nclass CActorBase;\n\nclass CFPSRoleLocal : public CFPSRole\n{\npublic:\n\tCFPSRoleLocal(voi"
},
{
"path": "Test/GameMain.cpp",
"chars": 627,
"preview": "#include \"GameMain.h\"\n#include \"GameProcess.h\"\n#include \"sys/SysControl.h\"\n#include \"Engine.h\"\n#include \"Game.h\"\n\nCGameM"
},
{
"path": "Test/GameMain.h",
"chars": 236,
"preview": "#pragma once\nclass CGameProcess;\nclass CGameMain\n{\npublic:\n\tCGameMain(void);\n\tvirtual ~CGameMain(void); \npublic:\n\tint "
},
{
"path": "Test/GameProcess.cpp",
"chars": 9006,
"preview": "#include \"GameProcess.h\"\n#include \"Object.h\"\n#include \"Engine.h\"\n#include \"World.h\"\n#include \"App.h\"\n#include \"ToolsCame"
},
{
"path": "Test/GameProcess.h",
"chars": 736,
"preview": "#pragma once\n#include \"MessageBase.h\"\n#include \"SkillSystem.h\"\n#include \"RoleBase.h\"\n#include \"Vector.h\"\n\n\nclass CFPSRol"
},
{
"path": "Test/HMDWrapper.cpp",
"chars": 1822,
"preview": "#include \"HMDWrapper.h\"\n#include \"interface\\DeviceMgrInterface.h\"\n\nusing namespace MathLib;\n\nclass CLocalHMDWrapper : pu"
},
{
"path": "Test/HMDWrapper.h",
"chars": 550,
"preview": "#ifndef __HMD_WRAPPER_H__\n#define __HMD_WRAPPER_H__\n\n#include \"MathLib.h\"\n\n\nclass CHMDWrapper\n{\n\npublic:\n\n\tCHMDWrapper()"
},
{
"path": "Test/MathLib.h",
"chars": 3869,
"preview": "#pragma once\n//MathLib.h\n\n#ifndef _MATHLIB_\n#define _MATHLIB_\n\n//Make some change to check if new branch is created.\n\n#i"
},
{
"path": "Test/MoveDummy.cpp",
"chars": 6049,
"preview": "#include \"MoveDummy.h\"\n#include \"ObjectDummy.h\"\n#include \"BodyDummy.h\"\n#include \"ShapeCapsule.h\"\n\n#include \"Utils.h\"\n#in"
},
{
"path": "Test/MoveDummy.h",
"chars": 2221,
"preview": "#pragma once\n#ifndef __MOVE_DUMMY_H__\n#define __MOVE_DUMMY_H__\n\n#include \"MathLib.h\"\n#include \"Bounds.h\"\n#include \"Vecto"
},
{
"path": "Test/RayControl.cpp",
"chars": 973,
"preview": "#include \"RayControl.h\"\n#include \"ObjectParticles.h\"\n#include \"Engine.h\"\n#include \"Game.h\"\n#include \"Object.h\"\n#include "
},
{
"path": "Test/RayControl.h",
"chars": 443,
"preview": "#pragma once\n#include \"MathLib.h\"\n#include \"Singleton.h\"\n\n\nclass CObjectParticles;\nusing namespace MathLib;\n\nclass CRayC"
},
{
"path": "Test/RoleBase.cpp",
"chars": 4747,
"preview": "#include \"RoleBase.h\"\n#include \"Creature.h\"\n#include \"interface.h\"\n#include \"Action.h\"\n#include \"Utils.h\"\n#include \"Navi"
},
{
"path": "Test/RoleBase.h",
"chars": 1855,
"preview": "#pragma once\n#include \"MathLib.h\"\n#include \"UtilStr.h\"\n\nclass CCreature;\nclass CAction;\nclass CInterfaceBase;\nclass CNav"
},
{
"path": "Test/Test.vcxproj",
"chars": 6787,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.micro"
},
{
"path": "Test/main.cpp",
"chars": 2094,
"preview": "#include \"Engine.h\"\n#include \"interface.h\"\n#include \"GameMain.h\"\n\n\n#include \"Console.h\"\n#include \"direct.h\"\n#include \"HM"
},
{
"path": "Test/main.h",
"chars": 63,
"preview": "#pragma once\n\n\n#include <cstdio>\n\nint main(void)\n{\n\treturn 0;\n}"
},
{
"path": "fpsgame/CommonConvert.cpp",
"chars": 13918,
"preview": "#include \"precompiled.h\"\n#include \"CommonConvert.h\"\n\n#include \"StdSkeletons.h\"\n\n#include <algorithm>\n\n\n#include <cassert"
},
{
"path": "fpsgame/CommonConvert.h",
"chars": 1458,
"preview": "#pragma once\n#ifndef INCLUDED_COMMONCONVERT\n#define INCLUDED_COMMONCONVERT\n\n#include <exception>\n#include <string>\n#incl"
},
{
"path": "fpsgame/Decompose.cpp",
"chars": 16465,
"preview": "/* Copyright (C) 2015 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/Decompose.h",
"chars": 1482,
"preview": "/* Copyright (C) 2009 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/Dll.cpp",
"chars": 3772,
"preview": "/* Copyright (C) 2011 Wildfire Games.\n* This file is part of 0 A.D.\n*\n* 0 A.D. is free software: you can redistribute it"
},
{
"path": "fpsgame/Dll.h",
"chars": 1778,
"preview": "#pragma once\n/* Copyright (C) 2015 Wildfire Games.\n* This file is part of 0 A.D.\n*\n* 0 A.D. is free software: you can re"
},
{
"path": "fpsgame/GeomReindex.cpp",
"chars": 8389,
"preview": "/* Copyright (C) 2009 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/GeomReindex.h",
"chars": 927,
"preview": "/* Copyright (C) 2009 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/JSInterfaace_GameView.h",
"chars": 1312,
"preview": "/* Copyright (C) 2013 Wildfire Games.\n* This file is part of 0 A.D.\n*\n* 0 A.D. is free software: you can redistribute it"
},
{
"path": "fpsgame/JSInterface_GameView.cpp",
"chars": 2272,
"preview": "/* Copyright (C) 2013 Wildfire Games.\n* This file is part of 0 A.D.\n*\n* 0 A.D. is free software: you can redistribute it"
},
{
"path": "fpsgame/Math.cpp",
"chars": 2065,
"preview": "/* Copyright (C) 2009 Wildfire Games.\n* This file is part of 0 A.D.\n*\n* 0 A.D. is free software: you can redistribute it"
},
{
"path": "fpsgame/Math.h",
"chars": 1155,
"preview": "#pragma once\r\n/* Copyright (C) 2009 Wildfire Games.\n* This file is part of 0 A.D.\n*\n* 0 A.D. is free software: you can r"
},
{
"path": "fpsgame/PMDConvert.cpp",
"chars": 24876,
"preview": "/* Copyright (C) 2012 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/PMDConvert.h",
"chars": 909,
"preview": "/* Copyright (C) 2009 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/PSAConvert.cpp",
"chars": 10334,
"preview": "/* Copyright (C) 2013 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/PSAConvert.h",
"chars": 909,
"preview": "/* Copyright (C) 2009 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/Resource.h",
"chars": 663,
"preview": "//{{NO_DEPENDENCIES}}\n// Microsoft Visual C++ generated include file.\n// Used by fpsgame.rc\n//\n\n#define IDS_APP_TITLE\t\t\t"
},
{
"path": "fpsgame/SkillSystem.cpp",
"chars": 2129,
"preview": "#include \"SkillSystem.h\"\n#include \"BulletSystem.h\"\n#include \"interface.h\"\n#include \"GameProcess.h\"\n#include \"ObjectParti"
},
{
"path": "fpsgame/SkillSystem.h",
"chars": 397,
"preview": "#pragma once\n#include \"MessageBase.h\"\n\nclass CInterfaceBase;\nclass CGameProcess;\nclass CSkillSystem : public CMessageBas"
},
{
"path": "fpsgame/Star2DControl.cpp",
"chars": 3561,
"preview": "#include \"Star2DControl.h\"\n#include \"Engine.h\"\n\nusing namespace MathLib;\n\nCStar2DControl::CStar2DControl(void)\n{\n\tm_pNor"
},
{
"path": "fpsgame/Star2DControl.h",
"chars": 1192,
"preview": "#pragma once\n#include \"MathLib.h\"\n#include \"Singleton.h\"\n#include \"UtilStr.h\"\n\nclass CBRObject;\nclass CTextureImage;\n\ncl"
},
{
"path": "fpsgame/StartControl.cpp",
"chars": 2395,
"preview": "#include \"StarControl.h\"\n#include \"ObjectParticles.h\"\n#include \"Engine.h\"\n#include \"Game.h\"\n#include \"Object.h\"\n#include"
},
{
"path": "fpsgame/StartControl.h",
"chars": 675,
"preview": "#pragma once\n#include \"MathLib.h\"\n#include \"Singleton.h\"\n\nclass CBRObject;\nusing namespace MathLib;\n\nclass CStarControl "
},
{
"path": "fpsgame/StdSkeletons.cpp",
"chars": 5318,
"preview": "#include \"precompiled.h\"\n#include \"StdSkeletons.h\"\n\n#include \"libxml/parser.h\"\n#include \"libxml/xmlerror.h\"\n\n\n\n#include "
},
{
"path": "fpsgame/StdSkeletons.h",
"chars": 886,
"preview": "#pragma once\n#ifndef INCLUDED_STDSKELETONS\n#define INCLUDED_STDSKELETONS\n\n#include <string>\n#include <memory>\n\nstruct Sk"
},
{
"path": "fpsgame/XMLFix.cpp",
"chars": 5244,
"preview": "/* Copyright (C) 2009 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/XMLFix.h",
"chars": 1108,
"preview": "/* Copyright (C) 2009 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/fpsgame.cpp",
"chars": 92,
"preview": "#include \"stdafx.h\"\n#include \"fpsgame.h\"\n#include <windows.h>\n\n#define MAX_LOADSTRING 100\n \n"
},
{
"path": "fpsgame/fpsgame.h",
"chars": 33,
"preview": "#pragma once\n\n#include \"stdafx.h\""
},
{
"path": "fpsgame/fpsgame.vcxproj",
"chars": 21871,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.micro"
},
{
"path": "fpsgame/fpsgame.vcxproj.user",
"chars": 163,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbu"
},
{
"path": "fpsgame/graphics/Camera.cpp",
"chars": 13100,
"preview": "/* Copyright (C) 2010 Wildfire Games.\n* This file is part of 0 A.D.\n*\n* 0 A.D. is free software: you can redistribute it"
},
{
"path": "fpsgame/graphics/Camera.h",
"chars": 4443,
"preview": "/* Copyright (C) 2013 Wildfire Games.\n* This file is part of 0 A.D.\n*\n* 0 A.D. is free software: you can redistribute it"
},
{
"path": "fpsgame/graphics/CinemaManager.cpp",
"chars": 7421,
"preview": "/* Copyright (C) 2016 Wildfire Games.\n* This file is part of 0 A.D.\n*\n* 0 A.D. is free software: you can redistribute it"
},
{
"path": "fpsgame/graphics/CinemaManager.h",
"chars": 3276,
"preview": "/* Copyright (C) 2015 Wildfire Games.\n* This file is part of 0 A.D.\n*\n* 0 A.D. is free software: you can redistribute it"
},
{
"path": "fpsgame/graphics/CinimaPath.cpp",
"chars": 9127,
"preview": "/* Copyright (C) 2016 Wildfire Games.\n* This file is part of 0 A.D.\n*\n* 0 A.D. is free software: you can redistribute it"
},
{
"path": "fpsgame/graphics/CinimaPath.h",
"chars": 3635,
"preview": "#pragma once\r\n/* Copyright (C) 2016 Wildfire Games.\n* This file is part of 0 A.D.\n*\n* 0 A.D. is free software: you can r"
},
{
"path": "fpsgame/graphics/ColladaManager.cpp",
"chars": 12632,
"preview": "/* Copyright (C) 2015 Wildfire Games.\n* This file is part of 0 A.D.\n*\n* 0 A.D. is free software: you can redistribute it"
},
{
"path": "fpsgame/graphics/ColladaManager.h",
"chars": 2117,
"preview": "/* Copyright (C) 2013 Wildfire Games.\n* This file is part of 0 A.D.\n*\n* 0 A.D. is free software: you can redistribute it"
},
{
"path": "fpsgame/graphics/Color.cpp",
"chars": 615,
"preview": "#ifndef INCLUDED_COLOR\n#define INCLUDED_COLOR\n\n// #include \"SColor.h\"\n#include \"maths/Vector3D.h\"\n#include \"maths/Vector"
},
{
"path": "fpsgame/graphics/Color.h",
"chars": 615,
"preview": "#ifndef INCLUDED_COLOR\n#define INCLUDED_COLOR\n\n=\n=#include \"SColor.h\"\n#include \"maths/Vector3D.h\"\n#include \"maths/Vector"
},
{
"path": "fpsgame/graphics/Decal.cpp",
"chars": 3879,
"preview": "/* Copyright (C) 2013 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/Decal.h",
"chars": 2378,
"preview": "/* Copyright (C) 2013 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/Entity.h",
"chars": 970,
"preview": "/* Copyright (C) 2015 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/Font.cpp",
"chars": 1824,
"preview": "/* Copyright (C) 2013 Wildfire Games.\n* This file is part of 0 A.D.\n*\n* 0 A.D. is free software: you can redistribute it"
},
{
"path": "fpsgame/graphics/Font.h",
"chars": 2527,
"preview": "/* Copyright (C) 2013 Wildfire Games.\n* This file is part of 0 A.D.\n*\n* 0 A.D. is free software: you can redistribute it"
},
{
"path": "fpsgame/graphics/FontManager.cpp",
"chars": 3980,
"preview": "/* Copyright (C) 2013 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/FontManager.h",
"chars": 1153,
"preview": "/* Copyright (C) 2013 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/FontMetrics.cpp",
"chars": 1628,
"preview": "/* Copyright (C) 2013 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/FontMetrics.h",
"chars": 1290,
"preview": "/* Copyright (C) 2013 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/Frustum.cpp",
"chars": 3986,
"preview": "/* Copyright (C) 2009 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/Frustum.h",
"chars": 2226,
"preview": "/* Copyright (C) 2009 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/GameView.cpp",
"chars": 32903,
"preview": "/* Copyright (C) 2015 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/GameView.h",
"chars": 3381,
"preview": "/* Copyright (C) 2010 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/HFTracer.cpp",
"chars": 11173,
"preview": "/* Copyright (C) 2014 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/HFTracer.h",
"chars": 2718,
"preview": "/* Copyright (C) 2014 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/HeightMipmap.cpp",
"chars": 7554,
"preview": "/* Copyright (C) 2012 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/HeightMipmap.h",
"chars": 2357,
"preview": "/* Copyright (C) 2012 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/LOSTexture.cpp",
"chars": 12145,
"preview": "/* Copyright (C) 2014 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/LOSTexture.h",
"chars": 2955,
"preview": "/* Copyright (C) 2014 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/LightEnv.cpp",
"chars": 1665,
"preview": "/* Copyright (C) 2012 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/LightEnv.h",
"chars": 4501,
"preview": "/* Copyright (C) 2012 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/MapGenerator.cpp",
"chars": 10456,
"preview": "/* Copyright (C) 2015 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/MapGenerator.h",
"chars": 4865,
"preview": "/* Copyright (C) 2015 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/MapIO.h",
"chars": 1282,
"preview": "/* Copyright (C) 2009 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/MapReader.cpp",
"chars": 46000,
"preview": "/* Copyright (C) 2016 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/MapReader.h",
"chars": 4835,
"preview": "/* Copyright (C) 2016 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/MapWriter.cpp",
"chars": 14030,
"preview": "/* Copyright (C) 2016 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/MapWriter.h",
"chars": 2298,
"preview": "/* Copyright (C) 2014 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/Material.cpp",
"chars": 2715,
"preview": "/* Copyright (C) 2012 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/Material.h",
"chars": 3654,
"preview": "/* Copyright (C) 2012 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/MaterialManager.cpp",
"chars": 5334,
"preview": "/* Copyright (C) 2015 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/MaterialManager.h",
"chars": 1061,
"preview": "/* Copyright (C) 2012 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/MeshManager.cpp",
"chars": 2062,
"preview": "/* Copyright (C) 2012 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/MeshManager.h",
"chars": 1270,
"preview": "/* Copyright (C) 2015 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/MiniPatch.cpp",
"chars": 951,
"preview": "/* Copyright (C) 2010 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/MiniPatch.h",
"chars": 1326,
"preview": "/* Copyright (C) 2010 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/Model.cpp",
"chars": 22468,
"preview": "/* Copyright (C) 2016 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/Model.h",
"chars": 10325,
"preview": "/* Copyright (C) 2016 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/ModelAbstract.cpp",
"chars": 2983,
"preview": "/* Copyright (C) 2011 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/ModelAbstract.h",
"chars": 6832,
"preview": "/* Copyright (C) 2011 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/ModelDef.cpp",
"chars": 16265,
"preview": "/* Copyright (C) 2015 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/ModelDef.h",
"chars": 8900,
"preview": "/* Copyright (C) 2011 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/ObjectBase.cpp",
"chars": 21626,
"preview": "/* Copyright (C) 2016 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/ObjectBase.h",
"chars": 5850,
"preview": "/* Copyright (C) 2016 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/ObjectEntry.cpp",
"chars": 9975,
"preview": "/* Copyright (C) 2016 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/ObjectEntry.h",
"chars": 3047,
"preview": "/* Copyright (C) 2016 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/ObjectManager.cpp",
"chars": 6687,
"preview": "/* Copyright (C) 2015 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/ObjectManager.h",
"chars": 2953,
"preview": "/* Copyright (C) 2009 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/Overlay.cpp",
"chars": 1176,
"preview": "/* Copyright (C) 2011 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/Overlay.h",
"chars": 5569,
"preview": "/* Copyright (C) 2015 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/ParticleEmitter.cpp",
"chars": 9015,
"preview": "/* Copyright (C) 2015 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/ParticleEmitter.h",
"chars": 5621,
"preview": "/* Copyright (C) 2011 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/ParticleEmitterType.cpp",
"chars": 19025,
"preview": "/* Copyright (C) 2015 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/ParticleEmitterType.h",
"chars": 3217,
"preview": "/* Copyright (C) 2011 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/ParticleManager.cpp",
"chars": 2771,
"preview": "/* Copyright (C) 2011 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/ParticleManager.h",
"chars": 1920,
"preview": "/* Copyright (C) 2011 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/Patch.cpp",
"chars": 2225,
"preview": "/* Copyright (C) 2010 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/Patch.h",
"chars": 1920,
"preview": "/* Copyright (C) 2009 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/RenderableObject.h",
"chars": 5650,
"preview": "/* Copyright (C) 2012 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/SColor.h",
"chars": 240,
"preview": "#ifndef INCLUDED_SCOLOR\n#define INCLUDED_SCOLOR\n\nstruct SColor3ub\n{\n\tu8 R;\n\tu8 G;\n\tu8 B;\n};\n\nstruct SColor4ub\n{\n\tu8 R;\n\t"
},
{
"path": "fpsgame/graphics/ShaderDefines.cpp",
"chars": 7368,
"preview": "/* Copyright (C) 2015 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/ShaderDefines.h",
"chars": 5481,
"preview": "/* Copyright (C) 2012 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/ShaderManager.cpp",
"chars": 16376,
"preview": "/* Copyright (C) 2015 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/ShaderManager.h",
"chars": 4259,
"preview": "/* Copyright (C) 2015 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/ShaderProgram.cpp",
"chars": 25601,
"preview": "/* Copyright (C) 2013 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/ShaderProgram.h",
"chars": 6959,
"preview": "/* Copyright (C) 2012 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/ShaderProgramFFP.cpp",
"chars": 33284,
"preview": "/* Copyright (C) 2014 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/ShaderProgramPtr.h",
"chars": 1012,
"preview": "/* Copyright (C) 2015 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/ShaderTechnique.cpp",
"chars": 3300,
"preview": "/* Copyright (C) 2012 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/ShaderTechnique.h",
"chars": 2766,
"preview": "/* Copyright (C) 2012 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/SkeletonAnim.h",
"chars": 1946,
"preview": "/* Copyright (C) 2016 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/SkeletonAnimDef.cpp",
"chars": 4339,
"preview": "/* Copyright (C) 2009 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/SkeletonAnimDef.h",
"chars": 3111,
"preview": "/* Copyright (C) 2009 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/SkeletonAnimManager.cpp",
"chars": 2801,
"preview": "/* Copyright (C) 2012 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/SkeletonAnimManager.h",
"chars": 1733,
"preview": "/* Copyright (C) 2009 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/Terrain.cpp",
"chars": 22191,
"preview": "/* Copyright (C) 2015 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/Terrain.h",
"chars": 6856,
"preview": "/* Copyright (C) 2011 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/TerrainProperties.cpp",
"chars": 4375,
"preview": "/* Copyright (C) 2015 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/TerrainProperties.h",
"chars": 3210,
"preview": "/* Copyright (C) 2015 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/TerrainTextureEntry.cpp",
"chars": 9886,
"preview": "/* Copyright (C) 2015 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/TerrainTextureEntry.h",
"chars": 3010,
"preview": "/* Copyright (C) 2012 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/TerrainTextureManager.cpp",
"chars": 4681,
"preview": "/* Copyright (C) 2016 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/TerrainTextureManager.h",
"chars": 3874,
"preview": "/* Copyright (C) 2015 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/TerritoryBoundary.cpp",
"chars": 8714,
"preview": "/* Copyright (C) 2012 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/TerritoryBoundary.h",
"chars": 2843,
"preview": "/* Copyright (C) 2012 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/TerritoryTexture.cpp",
"chars": 7860,
"preview": "/* Copyright (C) 2013 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/TerritoryTexture.h",
"chars": 2540,
"preview": "/* Copyright (C) 2011 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/TextRenderer.cpp",
"chars": 7800,
"preview": "/* Copyright (C) 2012 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/TextRenderer.h",
"chars": 4259,
"preview": "/* Copyright (C) 2012 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/Texture.h",
"chars": 873,
"preview": "/* Copyright (C) 2015 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/TextureConverter.cpp",
"chars": 16583,
"preview": "/* Copyright (C) 2015 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/TextureConverter.h",
"chars": 5701,
"preview": "/* Copyright (C) 2012 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/TextureManager.cpp",
"chars": 18188,
"preview": "/* Copyright (C) 2015 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/TextureManager.h",
"chars": 10007,
"preview": "/* Copyright (C) 2015 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/Unit.cpp",
"chars": 4927,
"preview": "/* Copyright (C) 2016 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/Unit.h",
"chars": 3451,
"preview": "/* Copyright (C) 2016 Wildfire Games.\n* This file is part of 0 A.D.\n*\n* 0 A.D. is free software: you can redistribute it"
},
{
"path": "fpsgame/graphics/UnitAnimation.cpp",
"chars": 7942,
"preview": "/* Copyright (C) 2016 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/UnitAnimation.h",
"chars": 4309,
"preview": "/* Copyright (C) 2016 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/UnitManager.cpp",
"chars": 2712,
"preview": "/* Copyright (C) 2012 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/graphics/UnitManager.h",
"chars": 1928,
"preview": "/* Copyright (C) 2012 Wildfire Games.\n * This file is part of 0 A.D.\n *\n * 0 A.D. is free software: you can redistribute"
},
{
"path": "fpsgame/gui/adts/bit_buf.h",
"chars": 1748,
"preview": "/* Copyright (c) 2011 Wildfire Games\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a co"
},
{
"path": "fpsgame/gui/adts/cache_adt.h",
"chars": 21628,
"preview": "/* Copyright (c) 2010 Wildfire Games\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a co"
},
{
"path": "fpsgame/gui/adts/dyn_hash_tbl.h",
"chars": 5189,
"preview": "/* Copyright (c) 2011 Wildfire Games\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a co"
},
{
"path": "fpsgame/gui/adts/ring_buf.h",
"chars": 5641,
"preview": "/* Copyright (c) 2011 Wildfire Games\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a co"
},
{
"path": "fpsgame/gui/allocators/aligned_allocator.h",
"chars": 4206,
"preview": "/* Copyright (c) 2010 Wildfire Games\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a co"
},
{
"path": "fpsgame/gui/allocators/allocator_adapters.h",
"chars": 4528,
"preview": "/* Copyright (c) 2011 Wildfire Games\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a co"
},
{
"path": "fpsgame/gui/allocators/allocator_checker.h",
"chars": 2226,
"preview": "/* Copyright (c) 2011 Wildfire Games\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a co"
},
{
"path": "fpsgame/gui/allocators/allocator_policies.h",
"chars": 9449,
"preview": "/* Copyright (c) 2011 Wildfire Games\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a co"
},
{
"path": "fpsgame/gui/allocators/arena.cpp",
"chars": 2422,
"preview": "/* Copyright (c) 2011 Wildfire Games\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a co"
},
{
"path": "fpsgame/gui/allocators/arena.h",
"chars": 3877,
"preview": "/* Copyright (c) 2013 Wildfire Games\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a co"
},
{
"path": "fpsgame/gui/allocators/dynarray.cpp",
"chars": 4099,
"preview": "/* Copyright (c) 2010 Wildfire Games\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a co"
},
{
"path": "fpsgame/gui/allocators/dynarray.h",
"chars": 3223,
"preview": "/* Copyright (c) 2010 Wildfire Games\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a co"
},
{
"path": "fpsgame/gui/allocators/freelist.cpp",
"chars": 1338,
"preview": "/* Copyright (c) 2010 Wildfire Games\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a co"
},
{
"path": "fpsgame/gui/allocators/freelist.h",
"chars": 2516,
"preview": "/* Copyright (c) 2011 Wildfire Games\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a co"
},
{
"path": "fpsgame/gui/allocators/headerless.cpp",
"chars": 18590,
"preview": "/* Copyright (c) 2010 Wildfire Games\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a co"
},
{
"path": "fpsgame/gui/allocators/headerless.h",
"chars": 3657,
"preview": "/* Copyright (c) 2010 Wildfire Games\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a co"
},
{
"path": "fpsgame/gui/allocators/overrun_protector.h",
"chars": 3072,
"preview": "/* Copyright (c) 2011 Wildfire Games\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a co"
},
{
"path": "fpsgame/gui/allocators/page_aligned.cpp",
"chars": 3247,
"preview": "/* Copyright (c) 2010 Wildfire Games\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a co"
},
{
"path": "fpsgame/gui/allocators/page_aligned.h",
"chars": 2562,
"preview": "/* Copyright (c) 2010 Wildfire Games\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a co"
},
{
"path": "fpsgame/gui/allocators/pool.cpp",
"chars": 4880,
"preview": "/* Copyright (c) 2011 Wildfire Games\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a co"
},
{
"path": "fpsgame/gui/allocators/pool.h",
"chars": 5942,
"preview": "/* Copyright (c) 2011 Wildfire Games\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a co"
},
{
"path": "fpsgame/gui/allocators/shared_ptr.cpp",
"chars": 1778,
"preview": "/* Copyright (c) 2010 Wildfire Games\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a co"
},
{
"path": "fpsgame/gui/allocators/shared_ptr.h",
"chars": 2051,
"preview": "/* Copyright (c) 2010 Wildfire Games\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a co"
},
{
"path": "fpsgame/gui/allocators/tests/test_allocators.h",
"chars": 1481,
"preview": "/* Copyright (c) 2010 Wildfire Games\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a co"
},
{
"path": "fpsgame/gui/allocators/tests/test_headerless.h",
"chars": 4537,
"preview": "/* Copyright (c) 2010 Wildfire Games\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a co"
},
{
"path": "fpsgame/gui/allocators/unique_range.cpp",
"chars": 3451,
"preview": "/* Copyright (c) 2015 Wildfire Games\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a co"
},
{
"path": "fpsgame/gui/allocators/unique_range.h",
"chars": 6208,
"preview": "/* Copyright (c) 2015 Wildfire Games\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a co"
},
{
"path": "fpsgame/gui/app_hooks.cpp",
"chars": 4940,
"preview": "/* Copyright (c) 2015 Wildfire Games\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a co"
},
{
"path": "fpsgame/gui/app_hooks.h",
"chars": 6789,
"preview": "/* Copyright (c) 2010 Wildfire Games\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a co"
},
{
"path": "fpsgame/gui/base32.cpp",
"chars": 1875,
"preview": "/* Copyright (c) 2010 Wildfire Games\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a co"
}
]
// ... and 194 more files (download for full content)
About this extraction
This page contains the full source code of the mrlitong/Game-Engine-Development-Usage GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 394 files (1.9 MB), approximately 529.7k tokens, and a symbol index with 1757 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.