develop c3ddd69355b5 cached
497 files
2.7 MB
716.5k tokens
1276 symbols
1 requests
Download .txt
Showing preview only (2,863K chars total). Download the full file or copy to clipboard to get everything.
Repository: RegrowthStudios/SoACode-Public
Branch: develop
Commit: c3ddd69355b5
Files: 497
Total size: 2.7 MB

Directory structure:
gitextract__ur0a12_/

├── .gitattributes
├── .gitignore
├── .gitmodules
├── .mailmap
├── .travis.yml
├── CMakeLists.txt
├── LICENSE.txt
├── ModTest/
│   ├── ModTest.vcxproj
│   ├── ModTest.vcxproj.filters
│   └── main.cpp
├── ProjectConverter/
│   ├── App.Designer.cs
│   ├── App.config
│   ├── App.cs
│   ├── App.resx
│   ├── ProjectConverter.csproj
│   ├── ProjectConverter.sln
│   └── Properties/
│       └── AssemblyInfo.cs
├── README.md
├── SoA/
│   ├── AABBCollidableComponentUpdater.cpp
│   ├── AABBCollidableComponentUpdater.h
│   ├── ARProcessor.cpp
│   ├── ARProcessor.h
│   ├── AmbienceLibrary.cpp
│   ├── AmbienceLibrary.h
│   ├── AmbiencePlayer.cpp
│   ├── AmbiencePlayer.h
│   ├── AmbienceStream.cpp
│   ├── AmbienceStream.h
│   ├── Animation.h
│   ├── App.cpp
│   ├── App.h
│   ├── AtmosphereComponentRenderer.cpp
│   ├── AtmosphereComponentRenderer.h
│   ├── AxisRotationComponentUpdater.cpp
│   ├── AxisRotationComponentUpdater.h
│   ├── Biome.cpp
│   ├── Biome.h
│   ├── BlendState.h
│   ├── BlockData.cpp
│   ├── BlockData.h
│   ├── BlockLoader.cpp
│   ├── BlockLoader.h
│   ├── BlockPack.cpp
│   ├── BlockPack.h
│   ├── BlockTexture.cpp
│   ├── BlockTexture.h
│   ├── BlockTextureAtlas.h
│   ├── BlockTextureLoader.cpp
│   ├── BlockTextureLoader.h
│   ├── BlockTextureMethods.cpp
│   ├── BlockTextureMethods.h
│   ├── BlockTexturePack.cpp
│   ├── BlockTexturePack.h
│   ├── BloomRenderStage.cpp
│   ├── BloomRenderStage.h
│   ├── CAEngine.cpp
│   ├── CAEngine.h
│   ├── CMakeLists.txt
│   ├── Camera.cpp
│   ├── Camera.h
│   ├── CellularAutomataTask.cpp
│   ├── CellularAutomataTask.h
│   ├── Chunk.cpp
│   ├── Chunk.h
│   ├── ChunkAccessor.cpp
│   ├── ChunkAccessor.h
│   ├── ChunkAllocator.cpp
│   ├── ChunkAllocator.h
│   ├── ChunkGenerator.cpp
│   ├── ChunkGenerator.h
│   ├── ChunkGrid.cpp
│   ├── ChunkGrid.h
│   ├── ChunkGridRenderStage.cpp
│   ├── ChunkGridRenderStage.h
│   ├── ChunkHandle.h
│   ├── ChunkID.h
│   ├── ChunkIOManager.cpp
│   ├── ChunkIOManager.h
│   ├── ChunkMesh.cpp
│   ├── ChunkMesh.h
│   ├── ChunkMeshManager.cpp
│   ├── ChunkMeshManager.h
│   ├── ChunkMeshTask.cpp
│   ├── ChunkMeshTask.h
│   ├── ChunkMesher.cpp
│   ├── ChunkMesher.h
│   ├── ChunkQuery.cpp
│   ├── ChunkQuery.h
│   ├── ChunkRenderer.cpp
│   ├── ChunkRenderer.h
│   ├── ChunkSphereComponentUpdater.cpp
│   ├── ChunkSphereComponentUpdater.h
│   ├── ChunkUpdater.cpp
│   ├── ChunkUpdater.h
│   ├── ClientState.h
│   ├── CloseTerrainPatch.cpp
│   ├── CloudsComponentRenderer.cpp
│   ├── CloudsComponentRenderer.h
│   ├── Collision.cpp
│   ├── Collision.h
│   ├── CollisionComponentUpdater.cpp
│   ├── CollisionComponentUpdater.h
│   ├── ColorFilterRenderStage.cpp
│   ├── ColorFilterRenderStage.h
│   ├── ColoredFullQuadRenderer.cpp
│   ├── ColoredFullQuadRenderer.h
│   ├── CommonState.h
│   ├── Computer.cpp
│   ├── Computer.h
│   ├── ConsoleFuncs.h
│   ├── ConsoleMain.h
│   ├── ConsoleTests.cpp
│   ├── ConsoleTests.h
│   ├── Constants.h
│   ├── CutoutVoxelRenderStage.cpp
│   ├── CutoutVoxelRenderStage.h
│   ├── DLLAPI.h
│   ├── DLLLoader.h
│   ├── DebugRenderer.cpp
│   ├── DebugRenderer.h
│   ├── Density.cpp
│   ├── Density.h
│   ├── DevConsole.cpp
│   ├── DevConsole.h
│   ├── DevConsoleView.cpp
│   ├── DevConsoleView.h
│   ├── DevHudRenderStage.cpp
│   ├── DevHudRenderStage.h
│   ├── DevScreen.cpp
│   ├── DevScreen.h
│   ├── Doxyfile.in
│   ├── DualContouringMesher.cpp
│   ├── DualContouringMesher.h
│   ├── ECS Specs.txt
│   ├── ECSTemplates.cpp
│   ├── ECSTemplates.h
│   ├── Errors.cpp
│   ├── Errors.h
│   ├── ExposureCalcRenderStage.cpp
│   ├── ExposureCalcRenderStage.h
│   ├── FarTerrainComponentRenderer.cpp
│   ├── FarTerrainComponentRenderer.h
│   ├── FarTerrainComponentUpdater.cpp
│   ├── FarTerrainComponentUpdater.h
│   ├── FarTerrainPatch.cpp
│   ├── FarTerrainPatch.h
│   ├── Flora.cpp
│   ├── Flora.h
│   ├── FloraGenerator.cpp
│   ├── FloraGenerator.h
│   ├── FragFile.cpp
│   ├── FragFile.h
│   ├── FreeMoveComponentUpdater.cpp
│   ├── FreeMoveComponentUpdater.h
│   ├── Frustum.cpp
│   ├── Frustum.h
│   ├── FrustumComponentUpdater.cpp
│   ├── FrustumComponentUpdater.h
│   ├── GameManager.cpp
│   ├── GameManager.h
│   ├── GamePlayScreen.cpp
│   ├── GamePlayScreen.h
│   ├── GameRenderParams.cpp
│   ├── GameRenderParams.h
│   ├── GameSystem.cpp
│   ├── GameSystem.h
│   ├── GameSystemAssemblages.cpp
│   ├── GameSystemAssemblages.h
│   ├── GameSystemComponentBuilders.cpp
│   ├── GameSystemComponentBuilders.h
│   ├── GameSystemComponents.cpp
│   ├── GameSystemComponents.h
│   ├── GameSystemUpdater.cpp
│   ├── GameSystemUpdater.h
│   ├── GameplayLoadScreen.cpp
│   ├── GameplayLoadScreen.h
│   ├── GameplayRenderer.cpp
│   ├── GameplayRenderer.h
│   ├── GasGiantComponentRenderer.cpp
│   ├── GasGiantComponentRenderer.h
│   ├── GenerateTask.cpp
│   ├── GenerateTask.h
│   ├── GeometrySorter.cpp
│   ├── GeometrySorter.h
│   ├── HdrRenderStage.cpp
│   ├── HdrRenderStage.h
│   ├── HeadComponentUpdater.cpp
│   ├── HeadComponentUpdater.h
│   ├── IRenderStage.h
│   ├── ImageAssetLoader.cpp
│   ├── ImageAssetLoader.h
│   ├── IniParser.cpp
│   ├── IniParser.h
│   ├── InitScreen.cpp
│   ├── InitScreen.h
│   ├── InputMapper.cpp
│   ├── InputMapper.h
│   ├── Inputs.cpp
│   ├── Inputs.h
│   ├── Item.cpp
│   ├── Item.h
│   ├── LenseFlareRenderer.cpp
│   ├── LenseFlareRenderer.h
│   ├── LiquidData.h
│   ├── LiquidVoxelRenderStage.cpp
│   ├── LiquidVoxelRenderStage.h
│   ├── LoadBar.cpp
│   ├── LoadBar.h
│   ├── LoadContext.h
│   ├── LoadMonitor.cpp
│   ├── LoadMonitor.h
│   ├── LoadTaskBlockData.h
│   ├── LoadTaskGameManager.h
│   ├── LoadTaskStarSystem.h
│   ├── LoadTaskTextures.h
│   ├── MTRenderState.h
│   ├── MTRenderStateManager.cpp
│   ├── MTRenderStateManager.h
│   ├── MainMenuLoadScreen.cpp
│   ├── MainMenuLoadScreen.h
│   ├── MainMenuRenderer.cpp
│   ├── MainMenuRenderer.h
│   ├── MainMenuScreen.cpp
│   ├── MainMenuScreen.h
│   ├── MainMenuScriptedUI.cpp
│   ├── MainMenuScriptedUI.h
│   ├── MainMenuSystemViewer.cpp
│   ├── MainMenuSystemViewer.h
│   ├── MarchingCubesTable.h
│   ├── MaterialAtlas.h
│   ├── MaterialData.h
│   ├── MaterialStack.h
│   ├── MetaSection.cpp
│   ├── MetaSection.h
│   ├── ModInformation.h
│   ├── ModPathResolver.cpp
│   ├── ModPathResolver.h
│   ├── ModelMesher.cpp
│   ├── ModelMesher.h
│   ├── MusicPlayer.cpp
│   ├── MusicPlayer.h
│   ├── NightVisionRenderStage.cpp
│   ├── NightVisionRenderStage.h
│   ├── Noise.cpp
│   ├── Noise.h
│   ├── Octree.cpp
│   ├── Octree.h
│   ├── OpaqueVoxelRenderStage.cpp
│   ├── OpaqueVoxelRenderStage.h
│   ├── OptionsController.cpp
│   ├── OptionsController.h
│   ├── OrbitComponentRenderer.cpp
│   ├── OrbitComponentRenderer.h
│   ├── OrbitComponentUpdater.cpp
│   ├── OrbitComponentUpdater.h
│   ├── PDA.cpp
│   ├── PDA.h
│   ├── ParkourComponentUpdater.cpp
│   ├── ParkourComponentUpdater.h
│   ├── ParticleMesh.h
│   ├── PauseMenu.cpp
│   ├── PauseMenu.h
│   ├── PauseMenuRenderStage.cpp
│   ├── PauseMenuRenderStage.h
│   ├── PdaRenderStage.cpp
│   ├── PdaRenderStage.h
│   ├── PhysicsBlockRenderStage.cpp
│   ├── PhysicsBlockRenderStage.h
│   ├── PhysicsComponentUpdater.cpp
│   ├── PhysicsComponentUpdater.h
│   ├── Planet.cpp
│   ├── Planet.h
│   ├── PlanetGenData.cpp
│   ├── PlanetGenData.h
│   ├── PlanetGenLoader.cpp
│   ├── PlanetGenLoader.h
│   ├── PlanetGenerator.cpp
│   ├── PlanetGenerator.h
│   ├── PlanetHeightData.h
│   ├── PlanetRenderStage.cpp
│   ├── PlanetRenderStage.h
│   ├── PlanetRingsComponentRenderer.cpp
│   ├── PlanetRingsComponentRenderer.h
│   ├── Positional.h
│   ├── ProceduralChunkGenerator.cpp
│   ├── ProceduralChunkGenerator.h
│   ├── ProgramGenDelegate.h
│   ├── RegionFileManager.cpp
│   ├── RegionFileManager.h
│   ├── RenderUtils.h
│   ├── Resources/
│   │   └── resources.rc
│   ├── SOA.vcxproj
│   ├── SOA.vcxproj.filters
│   ├── SOA.vcxproj.yml
│   ├── ShaderAssetLoader.cpp
│   ├── ShaderAssetLoader.h
│   ├── ShaderLoader.cpp
│   ├── ShaderLoader.h
│   ├── SkyboxRenderStage.cpp
│   ├── SkyboxRenderStage.h
│   ├── SkyboxRenderer.cpp
│   ├── SkyboxRenderer.h
│   ├── SmartVoxelContainer.hpp
│   ├── SoAState.h
│   ├── SoaController.cpp
│   ├── SoaController.h
│   ├── SoaEngine.cpp
│   ├── SoaEngine.h
│   ├── SoaFileSystem.cpp
│   ├── SoaFileSystem.h
│   ├── SoaOptions.cpp
│   ├── SoaOptions.h
│   ├── SoaState.cpp
│   ├── SonarRenderStage.cpp
│   ├── SonarRenderStage.h
│   ├── SpaceSystem.cpp
│   ├── SpaceSystem.h
│   ├── SpaceSystemAssemblages.cpp
│   ├── SpaceSystemAssemblages.h
│   ├── SpaceSystemComponentBuilders.cpp
│   ├── SpaceSystemComponentBuilders.h
│   ├── SpaceSystemComponentTables.cpp
│   ├── SpaceSystemComponentTables.h
│   ├── SpaceSystemComponents.h
│   ├── SpaceSystemLoadStructs.cpp
│   ├── SpaceSystemLoadStructs.h
│   ├── SpaceSystemLoader.cpp
│   ├── SpaceSystemLoader.h
│   ├── SpaceSystemRenderStage.cpp
│   ├── SpaceSystemRenderStage.h
│   ├── SpaceSystemUpdater.cpp
│   ├── SpaceSystemUpdater.h
│   ├── SphericalHeightmapGenerator.cpp
│   ├── SphericalHeightmapGenerator.h
│   ├── SphericalTerrainComponentRenderer.cpp
│   ├── SphericalTerrainComponentRenderer.h
│   ├── SphericalTerrainComponentUpdater.cpp
│   ├── SphericalTerrainComponentUpdater.h
│   ├── SphericalVoxelComponentUpdater.cpp
│   ├── SphericalVoxelComponentUpdater.h
│   ├── SsaoRenderStage.cpp
│   ├── SsaoRenderStage.h
│   ├── StarComponentRenderer.cpp
│   ├── StarComponentRenderer.h
│   ├── Startup.cpp
│   ├── Startup.h
│   ├── SystemARRenderer.cpp
│   ├── SystemARRenderer.h
│   ├── SystemBodyLoader.cpp
│   ├── SystemBodyLoader.h
│   ├── TerrainGenTextures.cpp
│   ├── TerrainGenTextures.h
│   ├── TerrainPatch.cpp
│   ├── TerrainPatch.h
│   ├── TerrainPatchConstants.h
│   ├── TerrainPatchMesh.cpp
│   ├── TerrainPatchMesh.h
│   ├── TerrainPatchMeshManager.cpp
│   ├── TerrainPatchMeshManager.h
│   ├── TerrainPatchMeshTask.cpp
│   ├── TerrainPatchMeshTask.h
│   ├── TerrainPatchMesher.cpp
│   ├── TerrainPatchMesher.h
│   ├── TestBiomeScreen.cpp
│   ├── TestBiomeScreen.h
│   ├── TestBlockViewScreen.cpp
│   ├── TestBlockViewScreen.h
│   ├── TestConnectedTextureScreen.cpp
│   ├── TestConnectedTextureScreen.h
│   ├── TestConsoleScreen.cpp
│   ├── TestConsoleScreen.h
│   ├── TestDeferredScreen.cpp
│   ├── TestDeferredScreen.h
│   ├── TestDisplacementMappingScreen.cpp
│   ├── TestDisplacementMappingScreen.h
│   ├── TestGasGiantScreen.cpp
│   ├── TestGasGiantScreen.h
│   ├── TestMappingScreen.cpp
│   ├── TestMappingScreen.h
│   ├── TestNewBlockAPIScreen.cpp
│   ├── TestNewBlockAPIScreen.h
│   ├── TestNoiseScreen.cpp
│   ├── TestNoiseScreen.h
│   ├── TestPlanetGenScreen.cpp
│   ├── TestPlanetGenScreen.h
│   ├── TestScriptScreen.cpp
│   ├── TestScriptScreen.h
│   ├── TestStarScreen.cpp
│   ├── TestStarScreen.h
│   ├── TestUIScreen.cpp
│   ├── TestUIScreen.h
│   ├── TestVoxelModelScreen.cpp
│   ├── TestVoxelModelScreen.h
│   ├── Thread.h
│   ├── TransparentVoxelRenderStage.cpp
│   ├── TransparentVoxelRenderStage.h
│   ├── VRayHelper.cpp
│   ├── VRayHelper.h
│   ├── Vertex.h
│   ├── VirtualKeyKegDef.inl
│   ├── VoxPool.cpp
│   ├── VoxPool.h
│   ├── VoxelBits.h
│   ├── VoxelCoordinateSpaces.h
│   ├── VoxelEditor.cpp
│   ├── VoxelEditor.h
│   ├── VoxelLightEngine.cpp
│   ├── VoxelLightEngine.h
│   ├── VoxelMatrix.cpp
│   ├── VoxelMatrix.h
│   ├── VoxelMesh.h
│   ├── VoxelMesher.cpp
│   ├── VoxelMesher.h
│   ├── VoxelModel.cpp
│   ├── VoxelModel.h
│   ├── VoxelModelLoader.cpp
│   ├── VoxelModelLoader.h
│   ├── VoxelModelMesh.cpp
│   ├── VoxelModelMesh.h
│   ├── VoxelModelRenderer.cpp
│   ├── VoxelModelRenderer.h
│   ├── VoxelNavigation.inl
│   ├── VoxelNodeSetter.cpp
│   ├── VoxelNodeSetter.h
│   ├── VoxelNodeSetterTask.cpp
│   ├── VoxelNodeSetterTask.h
│   ├── VoxelRay.cpp
│   ├── VoxelRay.h
│   ├── VoxelSpaceConversions.cpp
│   ├── VoxelSpaceConversions.h
│   ├── VoxelSpaceUtils.cpp
│   ├── VoxelSpaceUtils.h
│   ├── VoxelUpdateBufferer.h
│   ├── VoxelUpdateOrder.inl
│   ├── VoxelUtils.h
│   ├── VoxelVertices.h
│   ├── WSO.cpp
│   ├── WSO.h
│   ├── WSOAtlas.cpp
│   ├── WSOAtlas.h
│   ├── WSOData.h
│   ├── WSOScanner.cpp
│   ├── WSOScanner.h
│   ├── WorldIO.cpp
│   ├── WorldIO.h
│   ├── WorldStructs.cpp
│   ├── WorldStructs.h
│   ├── ZipFile.cpp
│   ├── ZipFile.h
│   ├── app.config
│   ├── atomicops.h
│   ├── errorlog.txt
│   ├── main.cpp
│   ├── qef.cpp
│   ├── qef.h
│   ├── readerwriterqueue.h
│   ├── soaUtils.h
│   ├── stdafx.cpp
│   ├── stdafx.h
│   ├── svd.cpp
│   ├── svd.h
│   └── textureUtils.h
├── VorbCopy.bat
├── appveyor.yml
├── build.bat
├── build.sh
├── cmake/
│   └── hunter/
│       ├── HunterGate.cmake
│       ├── cache.cmake
│       └── passwords.cmake
├── jenkins.py
├── scripts/
│   ├── ShowPredefined.cpp
│   ├── append-boost-config-macros.cmake.in
│   ├── autotools-merge-lipo.cmake.in
│   ├── clear-all.cmake
│   ├── clear-all.sh
│   ├── copy-files.cmake
│   ├── create-predefined-list.py
│   ├── create-toolchain-info.cmake
│   ├── find_python.cmake
│   ├── link-all.cmake
│   ├── link-all.py
│   ├── pkgconfig-export-targets.cmake.in
│   ├── predefined.list
│   ├── try-copy-license.cmake
│   └── upload-cache-to-github.py
└── utils/
    └── git-hooks/
        ├── commit-msg
        ├── commit-msg_check-spelling
        ├── cpplint/
        │   ├── __init__.py
        │   └── cpplint.py
        ├── pep8.py
        ├── pre-commit
        ├── pre-commit_check-for-cpp-style
        ├── pre-commit_check-for-pdb
        ├── pre-commit_pep8
        ├── pre-commit_pretty-xml
        ├── pre-commit_strip-eol-spaces
        └── pre-commit_tabs-to-spaces

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitattributes
================================================
# -----------------------------------------------------------------------------
# After much research...
#  text should be auto, it's the only sane cross-platform option
#
#  See:  http://stackoverflow.com/a/10855862
#  See also: http://adaptivepatchwork.com/2012/03/01/mind-the-end-of-your-line/
#
#  To squelch extraneous messages on windows, run:
#     git --config core.autocrlf=true
#
#  To stay consistent on OS X and Linux, run:
#     git --config core.autocrlf=input
# -----------------------------------------------------------------------------
* text eol=auto

# SOA binary asset files:
*.png   binary
*.ogg   binary
*.ico   binary

# Visual Studio files:
*.pbxproj binary merge=union
*.vcxproj text merge=union
*.sln text merge=union

# Windows binary project files:
*.exe   binary
*.dll   binary
*.lib   binary
*.a     binary
*.hpp   binary

# Language aware diffs and force line endings if git did not know they are text:
*.h     text diff=cpp
*.hpp   text diff=cpp
*.inl   text diff=cpp
*.cpp   text diff=cpp
*.py    text diff=python
*.cs    text diff=csharp


================================================
FILE: .gitignore
================================================
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.sln.docstates

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
x64/
build/
_build/
_clang/
_ninja/
_debug/
bld/
[Bb]in/
[Oo]bj/
*.i

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

#NUNIT
*.VisualState.xml
TestResult.xml

# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c

*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc

# Chutzpah Test files
_Chutzpah*

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile

# Visual Studio profiler
*.psess
*.vsp
*.vspx

# TFS 2012 Local Workspace
$tf/

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# JustCode is a .NET coding addin-in
.JustCode

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
*.ncrunch*
_NCrunch_*
.*crunch*.local.xml

# MightyMoose
*.mm.*
AutoTest.Net/

# Web workbench (sass)
.sass-cache/

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml

# NuGet Packages Directory
packages/
## TODO: If the tool you use requires repositories.config uncomment the next line
#!packages/repositories.config

# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
# This line needs to be after the ignore of the build folder (and the packages folder if the line above has been uncommented)
!packages/build/

# Windows Azure Build Output
csx/
*.build.csdef

# Windows Store app package directory
AppPackages/

# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
*.mdf
*.ldf

# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings

# Microsoft Fakes
FakesAssemblies/

#OS junk files
[Tt]humbs.db
*.DS_Store
desktop.ini

# Python files
*.pyc

# A Folder To Put Personal Stuff
Mine/

#VS2015 openDB
*.opendb

.vscode/


================================================
FILE: .gitmodules
================================================
[submodule "game"]
	path = game
	url = https://github.com/RegrowthStudios/SoAGameData.git
[submodule "Vorb"]
	path = Vorb
	url = https://github.com/RegrowthStudios/Vorb.git


================================================
FILE: .mailmap
================================================
Benjamin Arnold <brb555@utk.edu> barnold1953 <brb555@utk.edu>
Brian Bruggeman <brian.m.bruggeman@gmail.com> <Brian.M.Bruggeman@gmail.com> Brian <brian.m.bruggeman@gmail.com>
Cristian Zaloj <czaloj@gmail.com> <cz68@cornell.edu> Cristian Zaloj <cz68@cornell.edu> czaloj <cz68@cornell.edu>
Frank McCoy <jaxfrank@comcast.net>
Jesse <jessenic@digiex.net> jessenic <jessenic@digiex.net>


================================================
FILE: .travis.yml
================================================
# OSX/Linux (https://github.com/travis-ci-tester/toolchain-table)

language:
  - cpp

# Container-based infrastructure (Linux)
# * https://docs.travis-ci.com/user/migrating-from-legacy/#How-can-I-use-container-based-infrastructure%3F
sudo:
  - false

# Install packages differs for container-based infrastructure
# * https://docs.travis-ci.com/user/migrating-from-legacy/#How-do-I-install-APT-sources-and-packages%3F
# List of available packages:
# * https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-trusty
# List of available sources:
# * https://github.com/travis-ci/apt-source-whitelist/blob/master/ubuntu.json
addons:
  apt:
    sources:
      - ubuntu-toolchain-r-test
    packages:
      - python3-pip
      - g++-7
      - g++-8

dist:
  - trusty

env:
  global:
  #soa
    - secure: "LIcgKhksDL/NoBH9YpAggZMbppx53DhzUP8AkHfIH6vZ9Gq2ZuRN8KFj7SeCQX7qBJmv+vtGrW0ZdXHNXYNgEgnuqOjwdX3Z5ccAmrsuq41Qh3Hki+K3wKPKzenJxL6bF/UxTRUQipoKEP6EQS/WRkZejP7SS/YQBgmAx3eLAqx7N6LJxBgvUmKgaGAfaODjAeix7faasPMlFDVqfWn6+kbOirUEwBNxGUXJrSi1OupMwlhrNmhEoFqfRSkDbcMi5914wE126c3vG3bKSNBzCN6hSlO++knidZVaWnxwZm8Oq1SXpzLmr3YmiiWxiK5bo+LpIow00C7Iq5k3IA+otJD4NdLShU7x8jzryeI+4VQlo2UVF01Ssq/xboVJoWdF+RT2PFaKB3eJiBiXWfN2BVMr75sWj+7qb1o0KwZZtpa+qFQxuVPLKQuZ/fW6AI/ybk7NoHM3K7csPioJERlhQQ9fOTasqEOiGYCKhdjrP3Zg2sHjSlITQ68Jb+q8O/ku4taRiWprQ82/wtzMI4Yo6CdcLvtXHoXgdIPSJp/5x1/HotdSIK9n4Si6vOYNW0jtRVIc5L8neVScHEDOdhejxw0s7jArA3MMnWB6o9TS2oDv4uzPhHd+wyr86oiUT/HQq8jXUMbKSc0asFVf276b9TRTxcW7WdjveoznorDuIYE=" 
  #krazer
#    - secure: "inNq/wQPDmZlK1IOwe2DPryyRZWZxg3qAJ6/KZ/zeg8/lQvkwPAzwcp9QM/zf2rzDvNBJ/ZOIwO0lcOpXlyAt6hhhSrD0T/T1HObu1F6Iv9cMy1i8fvu3RH27Kp5eIepHeGINo3uEIlyR3XZbA8Ir0jPBc2XFWkK6WyJm00wsKozlFH1PXboekClWcXL7TJWyP5FV96L9vYDa7uorFe1ct8jSkot3dTKpg4782mZNTLH+T2GgVSmkoyMzsnNwHmz11gHo+opm3LVC9sbIhjym+iwQ0CGQwdX7B6bu/v4yiHoMqBxG2d9zrB6YiG1Aa8x4KbBauc9I9NK7Xvk/e8lthCk0rcU+TXJJKciAJKVzjYkPCRsXOK/awb5YmbBsQpvWUXPztc84soCtFf6xEH6JMKJqrL76CKr30XXNJvum4MO0q8IaM7XH2+VjxxjrjU/g3WKhJZr3sXzYWqJvG7r8ZtmsohZPEUewckw5R4AXPNEjhLMIu+/M2CC86xbIWwdHrhQuM/03LDNIdqfzMINmQAewdEzJ/aF3SdVwoE94n4eeC68KjckcqRzvcPI0My3Wr1lq4ON61rQGgCNJWC2GDOYES5DK2bgoE2fJS4ULEL4R9CXnI47kFGAW6cH7StjZkWP+VqbkdEFSxuvq54mMYC7CdrTiMC2Zfm9PuAZtQY="


matrix:
  include:
    # Linux {

    - os: linux
      env: >
        TOOLCHAIN=clang-cxx17
        PROJECT_DIR=./

    - os: linux
      env: >
        TOOLCHAIN=gcc-7-cxx17
        PROJECT_DIR=./

    - os: linux
      env: >
        TOOLCHAIN=gcc-8-cxx17
        PROJECT_DIR=./

#can not compile glew
#    - os: linux
#      env: >
#        TOOLCHAIN=android-ndk-r17-api-21-arm64-v8a-neon-clang-libcxx14
#        PROJECT_DIR=./
#
#    - os: linux
#      env: >
#        TOOLCHAIN=analyze-cxx17
#        PROJECT_DIR=./
#
#    - os: linux
#      env: >
#        TOOLCHAIN=sanitize-address-cxx17
#        PROJECT_DIR=./
#
#    - os: linux
#      env: >
#        TOOLCHAIN=sanitize-leak-cxx17
#        PROJECT_DIR=./
#
#    - os: linux
#      env: >
#        TOOLCHAIN=sanitize-thread-cxx17
#        PROJECT_DIR=./

    # }

    # OSX {

#compile issues with templates
#    - os: osx
#      osx_image: xcode9.4
#      env: >
#        TOOLCHAIN=osx-10-13-make-cxx14
#        PROJECT_DIR=./
#
#    - os: osx
#      osx_image: xcode9.4
#      env: >
#        TOOLCHAIN=osx-10-13-cxx14
#        PROJECT_DIR=./
#
#lua not packaged correctly for mac/ios
#    - os: osx
#      osx_image: xcode9.4
#      env: >
#        TOOLCHAIN=ios-nocodesign-11-4-dep-9-3
#        PROJECT_DIR=./

    # }

install:
  # Info about OS
  - uname -a

  # Info about available disk space
  - df -h $HOME

  # Disable autoupdate
  # * https://github.com/Homebrew/brew/blob/7d31a70373edae4d8e78d91a4cbc05324bebc3ba/Library/Homebrew/manpages/brew.1.md.erb#L202
  - export HOMEBREW_NO_AUTO_UPDATE=1

  # Install Python 3
  - if [[ "`uname`" == "Darwin" ]]; then travis_retry brew upgrade python || echo "Ignoring failure..."; fi
  - if [[ "`uname`" == "Darwin" ]]; then travis_retry brew install python3; fi

  # Install Python package 'requests'
  # 'easy_install3' is not installed by 'brew install python3' on OS X 10.9 Maverick
  - if [[ "`uname`" == "Darwin" ]]; then pip3 install requests; fi
  - if [[ "`uname`" == "Darwin" ]]; then pip3 install gitpython; fi
  - if [[ "`uname`" == "Linux" ]]; then travis_retry pip3 install --user requests; fi
  - if [[ "`uname`" == "Linux" ]]; then travis_retry pip3 install --user gitpython; fi

  # Install latest Polly toolchains and scripts
  - wget https://github.com/ruslo/polly/archive/master.zip
  - unzip master.zip
  - POLLY_ROOT="`pwd`/polly-master"
  - export PATH="${POLLY_ROOT}/bin:${PATH}"

  # Install dependencies (CMake, Android NDK)
  - install-ci-dependencies.py --prune-archives

  # Tune locations
  - export PATH="`pwd`/_ci/cmake/bin:${PATH}"

  # Installed if toolchain is Android (otherwise directory doesn't exist)
  - export ANDROID_NDK_r10e="`pwd`/_ci/android-ndk-r10e"
  - export ANDROID_NDK_r11c="`pwd`/_ci/android-ndk-r11c"
  - export ANDROID_NDK_r15c="`pwd`/_ci/android-ndk-r15c"
  - export ANDROID_NDK_r16b="`pwd`/_ci/android-ndk-r16b"
  - export ANDROID_NDK_r17="`pwd`/_ci/android-ndk-r17"

script:
  - python3 ./jenkins.py

# https://docs.travis-ci.com/user/customizing-the-build/#Whitelisting-or-blacklisting-branches
branches:
  except:
    - /^pr\..*/
    - /^v[0-9]+\.[0-9]+\.[0-9]+$/

git:
  submodules: false

before_script:
  git submodule update --init Vorb 

================================================
FILE: CMakeLists.txt
================================================
cmake_minimum_required (VERSION 3.0)

set(HUNTER_STATUS_DEBUG ON)
#setup cache server and suppot upload
set(
    HUNTER_CACHE_SERVERS
    "https://github.com/huntercache/SoA"
    CACHE
    STRING
    "Default cache server"
)

string(COMPARE EQUAL "$ENV{TRAVIS}" "true" is_travis)
string(COMPARE EQUAL "$ENV{APPVEYOR}" "True" is_appveyor)
string(COMPARE EQUAL "$ENV{GITHUB_USER_PASSWORD}" "" password_is_empty)

if((is_travis OR is_appveyor) AND NOT password_is_empty)
  option(HUNTER_RUN_UPLOAD "Upload cache binaries" ON)
endif()

message(STATUS "Travis: ${is_travis}")
message(STATUS "Appveyor: ${is_appveyor}")
message(STATUS "Password empty: ${password_is_empty}")
message(STATUS "Hunter upload: ${HUNTER_RUN_UPLOAD}")


set(
    HUNTER_PASSWORDS_PATH
    "${CMAKE_CURRENT_LIST_DIR}/cmake/hunter/passwords.cmake"
    CACHE
    FILEPATH
    "Hunter passwords"
)

include(${CMAKE_CURRENT_LIST_DIR}/cmake/hunter/HunterGate.cmake)

HunterGate(
    URL "https://github.com/cpp-pm/hunter/archive/v0.23.222.tar.gz"
    SHA1 "0b88baaa2a9a35b8ce632c57ade66be8dd918afd"
)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)

project(SoA)

#if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
#  if(MSVC_VERSION GREATER 1900)
#    message(FATAL_ERROR "Only Visual Studio 2015 and below are currently supported.")
#  endif()
#endif()

add_subdirectory(Vorb)
add_subdirectory(SoA)





================================================
FILE: LICENSE.txt
================================================
Copyright (c) 2018 Regrowth Studios

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: ModTest/ModTest.vcxproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.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="Debug|x64">
      <Configuration>Debug</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|Win32">
      <Configuration>Release</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|x64">
      <Configuration>Release</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
  </ItemGroup>
  <PropertyGroup Label="Globals">
    <ProjectGuid>{C49943E6-5645-4D1C-A5F6-FE2D7C94D924}</ProjectGuid>
    <RootNamespace>ModTest</RootNamespace>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
    <ConfigurationType>DynamicLibrary</ConfigurationType>
    <UseDebugLibraries>true</UseDebugLibraries>
    <PlatformToolset>v140</PlatformToolset>
    <CharacterSet>MultiByte</CharacterSet>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
    <ConfigurationType>DynamicLibrary</ConfigurationType>
    <UseDebugLibraries>true</UseDebugLibraries>
    <PlatformToolset>v140</PlatformToolset>
    <CharacterSet>MultiByte</CharacterSet>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
    <ConfigurationType>DynamicLibrary</ConfigurationType>
    <UseDebugLibraries>false</UseDebugLibraries>
    <PlatformToolset>v140</PlatformToolset>
    <WholeProgramOptimization>true</WholeProgramOptimization>
    <CharacterSet>MultiByte</CharacterSet>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
    <ConfigurationType>DynamicLibrary</ConfigurationType>
    <UseDebugLibraries>false</UseDebugLibraries>
    <PlatformToolset>v140</PlatformToolset>
    <WholeProgramOptimization>true</WholeProgramOptimization>
    <CharacterSet>MultiByte</CharacterSet>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
  <ImportGroup Label="ExtensionSettings">
  </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 Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
    <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 Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  </ImportGroup>
  <PropertyGroup Label="UserMacros" />
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <OutDir>$(SolutionDir)bin\$(PlatformName)\$(Configuration)\SoA\</OutDir>
    <IntDir>$(SolutionDir)obj\$(PlatformName)\$(Configuration)\ModTest\</IntDir>
    <TargetName>mod</TargetName>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <OutDir>$(SolutionDir)bin\$(PlatformName)\$(Configuration)\SoA\</OutDir>
    <IntDir>$(SolutionDir)obj\$(PlatformName)\$(Configuration)\ModTest\</IntDir>
    <TargetName>mod</TargetName>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <OutDir>$(SolutionDir)bin\$(PlatformName)\$(Configuration)\SoA\</OutDir>
    <IntDir>$(SolutionDir)obj\$(PlatformName)\$(Configuration)\ModTest\</IntDir>
    <TargetName>mod</TargetName>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <OutDir>$(SolutionDir)bin\$(PlatformName)\$(Configuration)\SoA\</OutDir>
    <IntDir>$(SolutionDir)obj\$(PlatformName)\$(Configuration)\ModTest\</IntDir>
    <TargetName>mod</TargetName>
  </PropertyGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <ClCompile>
      <WarningLevel>Level3</WarningLevel>
      <Optimization>Disabled</Optimization>
      <SDLCheck>true</SDLCheck>
    </ClCompile>
    <Link>
      <GenerateDebugInformation>true</GenerateDebugInformation>
    </Link>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <ClCompile>
      <WarningLevel>Level3</WarningLevel>
      <Optimization>Disabled</Optimization>
      <SDLCheck>true</SDLCheck>
    </ClCompile>
    <Link>
      <GenerateDebugInformation>true</GenerateDebugInformation>
    </Link>
  </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>
      <GenerateDebugInformation>true</GenerateDebugInformation>
      <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>
      <GenerateDebugInformation>true</GenerateDebugInformation>
      <EnableCOMDATFolding>true</EnableCOMDATFolding>
      <OptimizeReferences>true</OptimizeReferences>
    </Link>
  </ItemDefinitionGroup>
  <ItemGroup>
    <ClCompile Include="main.cpp" />
  </ItemGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
  <ImportGroup Label="ExtensionTargets">
  </ImportGroup>
</Project>

================================================
FILE: ModTest/ModTest.vcxproj.filters
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup>
    <ClCompile Include="main.cpp" />
  </ItemGroup>
</Project>

================================================
FILE: ModTest/main.cpp
================================================
#include <cstdio>

#define _WINSOCKAPI_
#include <Windows.h>

BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) {
    // Perform actions based on the reason for calling.
    switch (fdwReason) {
    case DLL_PROCESS_ATTACH:
        // Initialize once for each new process.
        puts("Mod Attach");
        fprintf(stderr, "DLL");
        break;
    case DLL_THREAD_ATTACH:
        // Do thread-specific initialization.
        puts("Mod Thread Attach");
        break;
    case DLL_THREAD_DETACH:
        // Do thread-specific cleanup.
        puts("Mod Thread Detach");
        break;
    case DLL_PROCESS_DETACH:
        // Perform any necessary cleanup.
        puts("Mod Detach");
        break;
    }
    return TRUE;
}

extern "C" __declspec(dllexport) int getCode() {
    return 42;
}


================================================
FILE: ProjectConverter/App.Designer.cs
================================================
namespace ProjectConverter {
    partial class App {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing) {
            if(disposing && (components != null)) {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent() {
            this.comboBox1 = new System.Windows.Forms.ComboBox();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.groupBox2 = new System.Windows.Forms.GroupBox();
            this.checkBox1 = new System.Windows.Forms.CheckBox();
            this.log = new System.Windows.Forms.RichTextBox();
            this.tabControl1 = new System.Windows.Forms.TabControl();
            this.tabPage1 = new System.Windows.Forms.TabPage();
            this.tabPage2 = new System.Windows.Forms.TabPage();
            this.files = new System.Windows.Forms.ListBox();
            this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
            this.button1 = new System.Windows.Forms.Button();
            this.button2 = new System.Windows.Forms.Button();
            this.groupBox1.SuspendLayout();
            this.groupBox2.SuspendLayout();
            this.tabControl1.SuspendLayout();
            this.tabPage1.SuspendLayout();
            this.tabPage2.SuspendLayout();
            this.tableLayoutPanel1.SuspendLayout();
            this.SuspendLayout();
            // 
            // comboBox1
            // 
            this.comboBox1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.comboBox1.FormattingEnabled = true;
            this.comboBox1.Items.AddRange(new object[] {
            "None"});
            this.comboBox1.Location = new System.Drawing.Point(3, 16);
            this.comboBox1.Name = "comboBox1";
            this.comboBox1.Size = new System.Drawing.Size(385, 21);
            this.comboBox1.TabIndex = 0;
            this.comboBox1.Text = "None";
            this.comboBox1.DropDown += new System.EventHandler(this.comboBox1_DropDown);
            this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
            // 
            // groupBox1
            // 
            this.groupBox1.Controls.Add(this.comboBox1);
            this.groupBox1.Dock = System.Windows.Forms.DockStyle.Top;
            this.groupBox1.Location = new System.Drawing.Point(0, 0);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(391, 43);
            this.groupBox1.TabIndex = 1;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "VS Processes";
            // 
            // groupBox2
            // 
            this.groupBox2.Controls.Add(this.checkBox1);
            this.groupBox2.Dock = System.Windows.Forms.DockStyle.Bottom;
            this.groupBox2.Location = new System.Drawing.Point(0, 317);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new System.Drawing.Size(391, 51);
            this.groupBox2.TabIndex = 2;
            this.groupBox2.TabStop = false;
            this.groupBox2.Text = "Options";
            // 
            // checkBox1
            // 
            this.checkBox1.AutoSize = true;
            this.checkBox1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.checkBox1.Location = new System.Drawing.Point(3, 16);
            this.checkBox1.Name = "checkBox1";
            this.checkBox1.Size = new System.Drawing.Size(385, 32);
            this.checkBox1.TabIndex = 0;
            this.checkBox1.Text = "Close On Process Termination";
            this.checkBox1.UseVisualStyleBackColor = true;
            this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
            // 
            // log
            // 
            this.log.Dock = System.Windows.Forms.DockStyle.Fill;
            this.log.Location = new System.Drawing.Point(3, 3);
            this.log.Name = "log";
            this.log.Size = new System.Drawing.Size(377, 242);
            this.log.TabIndex = 3;
            this.log.Text = "";
            // 
            // tabControl1
            // 
            this.tabControl1.Controls.Add(this.tabPage1);
            this.tabControl1.Controls.Add(this.tabPage2);
            this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.tabControl1.Location = new System.Drawing.Point(0, 43);
            this.tabControl1.Name = "tabControl1";
            this.tabControl1.SelectedIndex = 0;
            this.tabControl1.Size = new System.Drawing.Size(391, 274);
            this.tabControl1.TabIndex = 4;
            // 
            // tabPage1
            // 
            this.tabPage1.Controls.Add(this.log);
            this.tabPage1.Location = new System.Drawing.Point(4, 22);
            this.tabPage1.Name = "tabPage1";
            this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
            this.tabPage1.Size = new System.Drawing.Size(383, 248);
            this.tabPage1.TabIndex = 0;
            this.tabPage1.Text = "Log";
            this.tabPage1.UseVisualStyleBackColor = true;
            // 
            // tabPage2
            // 
            this.tabPage2.Controls.Add(this.tableLayoutPanel1);
            this.tabPage2.Controls.Add(this.files);
            this.tabPage2.Location = new System.Drawing.Point(4, 22);
            this.tabPage2.Name = "tabPage2";
            this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
            this.tabPage2.Size = new System.Drawing.Size(383, 248);
            this.tabPage2.TabIndex = 1;
            this.tabPage2.Text = "Files";
            this.tabPage2.UseVisualStyleBackColor = true;
            // 
            // files
            // 
            this.files.Dock = System.Windows.Forms.DockStyle.Fill;
            this.files.FormattingEnabled = true;
            this.files.Location = new System.Drawing.Point(3, 3);
            this.files.Name = "files";
            this.files.Size = new System.Drawing.Size(377, 242);
            this.files.TabIndex = 0;
            // 
            // tableLayoutPanel1
            // 
            this.tableLayoutPanel1.ColumnCount = 2;
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
            this.tableLayoutPanel1.Controls.Add(this.button2, 1, 0);
            this.tableLayoutPanel1.Controls.Add(this.button1, 0, 0);
            this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Bottom;
            this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 192);
            this.tableLayoutPanel1.Name = "tableLayoutPanel1";
            this.tableLayoutPanel1.RowCount = 1;
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
            this.tableLayoutPanel1.Size = new System.Drawing.Size(377, 53);
            this.tableLayoutPanel1.TabIndex = 1;
            // 
            // button1
            // 
            this.button1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.button1.Location = new System.Drawing.Point(3, 3);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(182, 47);
            this.button1.TabIndex = 0;
            this.button1.Text = "Add";
            this.button1.UseVisualStyleBackColor = true;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            // 
            // button2
            // 
            this.button2.Dock = System.Windows.Forms.DockStyle.Fill;
            this.button2.Location = new System.Drawing.Point(191, 3);
            this.button2.Name = "button2";
            this.button2.Size = new System.Drawing.Size(183, 47);
            this.button2.TabIndex = 1;
            this.button2.Text = "Remove";
            this.button2.UseVisualStyleBackColor = true;
            this.button2.Click += new System.EventHandler(this.button2_Click);
            // 
            // App
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(391, 368);
            this.Controls.Add(this.tabControl1);
            this.Controls.Add(this.groupBox2);
            this.Controls.Add(this.groupBox1);
            this.Name = "App";
            this.Text = "VS File Changer";
            this.groupBox1.ResumeLayout(false);
            this.groupBox2.ResumeLayout(false);
            this.groupBox2.PerformLayout();
            this.tabControl1.ResumeLayout(false);
            this.tabPage1.ResumeLayout(false);
            this.tabPage2.ResumeLayout(false);
            this.tableLayoutPanel1.ResumeLayout(false);
            this.ResumeLayout(false);

        }
        #endregion

        private System.Windows.Forms.ComboBox comboBox1;
        private System.Windows.Forms.GroupBox groupBox1;
        private System.Windows.Forms.GroupBox groupBox2;
        private System.Windows.Forms.RichTextBox log;
        private System.Windows.Forms.CheckBox checkBox1;
        private System.Windows.Forms.TabControl tabControl1;
        private System.Windows.Forms.TabPage tabPage1;
        private System.Windows.Forms.TabPage tabPage2;
        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
        private System.Windows.Forms.ListBox files;
        private System.Windows.Forms.Button button2;
        private System.Windows.Forms.Button button1;

    }
}

================================================
FILE: ProjectConverter/App.config
================================================
<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/>
    </startup>
</configuration>


================================================
FILE: ProjectConverter/App.cs
================================================
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using System.Diagnostics;
using System.Threading;
using System.IO;

namespace ProjectConverter {
    public partial class App : Form {
        const int NO_PROCESS = 0;
        Process[] vsProcesses;
        Process vsProcess;
        Thread tProcessTermination, tProcessPoll;
        Dictionary<int, List<FileInfo>> trackedFiles;

        public App() {
            InitializeComponent();
            trackedFiles = new Dictionary<int, List<FileInfo>>();
            trackedFiles[NO_PROCESS] = new List<FileInfo>();
            log.AppendText("Please Select A List Of Files To Track\n");
            log.AppendText("Select A Process To Track, If Necessary\n");
        }

        void RebuildProcessList() {
            // Find Processes
            var processes = Process.GetProcesses();
            vsProcesses = processes.Where((p) => {
                return p.ProcessName.Equals("devenv");
            }).ToArray();

            // Add Processes
            comboBox1.Items.Clear();
            comboBox1.Items.Add("None");
            if(vsProcesses.Length > 0) {
                foreach(var p in vsProcesses) {
                    comboBox1.Items.Add(p.MainWindowTitle);
                }
            }
        }
        List<FileInfo> GetTrackMap() {
            List<FileInfo> l;
            int id = vsProcess == null ? NO_PROCESS : vsProcess.Id;
            if(!trackedFiles.TryGetValue(id, out l)) {
                l = new List<FileInfo>();
                trackedFiles[id] = l;
            }
            return l;
        }

        void VSProcessWaiter() {
            vsProcess.WaitForExit();
            if(checkBox1.Checked) {
                Process.GetCurrentProcess().Kill();
            }
            else {
                vsProcess = null;
                Invoke((MethodInvoker)delegate { 
                    RebuildProcessList();
                    comboBox1.SelectedIndex = 0;
                });
            }
        }
        void VSProcessPoller() {
            while(true) {
                var remoteFiles = GetTrackMap();
                if(remoteFiles.Count != 0) {
                    var files = new FileInfo[remoteFiles.Count];
                    remoteFiles.CopyTo(files);
                    foreach(var fi in remoteFiles) {
                        Convert(fi);
                    }
                }
                Thread.Sleep(2000);
            }
        }
        void CreateProcessThreads() {
            if(vsProcess == null) return;
            tProcessTermination = new Thread(VSProcessWaiter);
            tProcessTermination.Priority = ThreadPriority.BelowNormal;
            tProcessTermination.Start();
            tProcessPoll = new Thread(VSProcessPoller);
            tProcessPoll.Priority = ThreadPriority.BelowNormal;
            tProcessPoll.Start();
        }
        void TerminateProcessThreads() {
            if(tProcessTermination != null && tProcessTermination.ThreadState == System.Threading.ThreadState.Running) {
                tProcessTermination.Abort();
                tProcessTermination = null;
            }
            if(tProcessPoll != null && tProcessPoll.ThreadState == System.Threading.ThreadState.Running) {
                tProcessPoll.Abort();
                tProcessPoll = null;
            }
        }
        void Convert(FileInfo fi) {
            string data;
            try {
                using(var s = fi.OpenRead()) {
                    data = new StreamReader(s).ReadToEnd();
                }
                Regex rgx = new Regex(@"<(?<Outer>\w+) Include=(?<Name>[^>]+)>\s+<(?<Inner>\w+)>(?<Data>[^<]+)</\k<Inner>>\s+</\k<Outer>>");
                if(rgx.Match(data).Success) {
                    data = rgx.Replace(data,
                        @"<${Outer} Include=${Name}><${Inner}>${Data}</${Inner}></${Outer}>"
                        );
                    using(var s = fi.Create()) {
                        var w = new StreamWriter(s);
                        w.Write(data);
                        w.Flush();
                    }
                    Invoke((MethodInvoker)delegate {
                        log.AppendText("Modified: " + fi.FullName + "\n");
                    });
                }
            }
            catch(Exception e) {
                Invoke((MethodInvoker)delegate {
                    log.AppendText("Error: " + fi.FullName + "\n");
                    log.AppendText(e.Message + "\n");
                });
            }
            return;

        }

        // Process Selection
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) {
            TerminateProcessThreads();
            files.Items.Clear();
            files.Items.AddRange((from fi in GetTrackMap() select fi.FullName).ToArray());

            if(comboBox1.SelectedIndex == 0) {
                vsProcess = null;
            }
            else {
                vsProcess = vsProcesses[comboBox1.SelectedIndex - 1];
                CreateProcessThreads();
            }
        }
        // Process Refresh
        void comboBox1_DropDown(object sender, System.EventArgs e) {
            RebuildProcessList();
        }
        // Auto-Shutdown Detection
        private void checkBox1_CheckedChanged(object sender, EventArgs e) {
            if(checkBox1.Checked) {
                if(tProcessTermination == null && vsProcess != null) {
                    CreateProcessThreads();
                }
            }
            else {
                TerminateProcessThreads();
            }
        }
        // Add Tracked File
        private void button1_Click(object sender, EventArgs e) {
            var l = GetTrackMap();
            using(var fd = new OpenFileDialog()) {
                fd.ShowDialog();
                foreach(var f in fd.FileNames) {
                    FileInfo fi = new FileInfo(f);
                    if(!l.Contains(fi, new FileNameComparer())) {
                        l.Add(fi);
                    }
                }
            }
            files.Items.Clear();
            files.Items.AddRange((from fi in l select fi.FullName).ToArray());
        }
        // Removed Tracked File
        private void button2_Click(object sender, EventArgs e) {
            var l = GetTrackMap();
            foreach(var file in files.SelectedItems) {
                FileInfo fi = new FileInfo(file.ToString());
                l.RemoveAll((f) => { return f.FullName.Equals(fi.FullName); });
            }
            files.Items.Clear();
            files.Items.AddRange((from fi in l select fi.FullName).ToArray());
        }
        class FileNameComparer : IEqualityComparer<FileInfo> {
            public bool Equals(FileInfo x, FileInfo y) {
                return x.FullName.Equals(y.FullName);
            }
            public int GetHashCode(FileInfo obj) {
                return obj.FullName.GetHashCode();
            }
        }

        [STAThread]
        static void Main(string[] args) {
            using(App app = new App()) {
                app.ShowDialog();
            }
        }
    }
}


================================================
FILE: ProjectConverter/App.resx
================================================
<?xml version="1.0" encoding="utf-8"?>
<root>
  <!-- 
    Microsoft ResX Schema 
    
    Version 2.0
    
    The primary goals of this format is to allow a simple XML format 
    that is mostly human readable. The generation and parsing of the 
    various data types are done through the TypeConverter classes 
    associated with the data types.
    
    Example:
    
    ... ado.net/XML headers & schema ...
    <resheader name="resmimetype">text/microsoft-resx</resheader>
    <resheader name="version">2.0</resheader>
    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
        <value>[base64 mime encoded serialized .NET Framework object]</value>
    </data>
    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
        <comment>This is a comment</comment>
    </data>
                
    There are any number of "resheader" rows that contain simple 
    name/value pairs.
    
    Each data row contains a name, and value. The row also contains a 
    type or mimetype. Type corresponds to a .NET class that support 
    text/value conversion through the TypeConverter architecture. 
    Classes that don't support this are serialized and stored with the 
    mimetype set.
    
    The mimetype is used for serialized objects, and tells the 
    ResXResourceReader how to depersist the object. This is currently not 
    extensible. For a given mimetype the value must be set accordingly:
    
    Note - application/x-microsoft.net.object.binary.base64 is the format 
    that the ResXResourceWriter will generate, however the reader can 
    read any of the formats listed below.
    
    mimetype: application/x-microsoft.net.object.binary.base64
    value   : The object must be serialized with 
            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
            : and then encoded with base64 encoding.
    
    mimetype: application/x-microsoft.net.object.soap.base64
    value   : The object must be serialized with 
            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
            : and then encoded with base64 encoding.

    mimetype: application/x-microsoft.net.object.bytearray.base64
    value   : The object must be serialized into a byte array 
            : using a System.ComponentModel.TypeConverter
            : and then encoded with base64 encoding.
    -->
  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
    <xsd:element name="root" msdata:IsDataSet="true">
      <xsd:complexType>
        <xsd:choice maxOccurs="unbounded">
          <xsd:element name="metadata">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" />
              </xsd:sequence>
              <xsd:attribute name="name" use="required" type="xsd:string" />
              <xsd:attribute name="type" type="xsd:string" />
              <xsd:attribute name="mimetype" type="xsd:string" />
              <xsd:attribute ref="xml:space" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="assembly">
            <xsd:complexType>
              <xsd:attribute name="alias" type="xsd:string" />
              <xsd:attribute name="name" type="xsd:string" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="data">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
              <xsd:attribute ref="xml:space" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="resheader">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" use="required" />
            </xsd:complexType>
          </xsd:element>
        </xsd:choice>
      </xsd:complexType>
    </xsd:element>
  </xsd:schema>
  <resheader name="resmimetype">
    <value>text/microsoft-resx</value>
  </resheader>
  <resheader name="version">
    <value>2.0</value>
  </resheader>
  <resheader name="reader">
    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <resheader name="writer">
    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <metadata name="files.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>True</value>
  </metadata>
  <metadata name="files.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>True</value>
  </metadata>
</root>

================================================
FILE: ProjectConverter/ProjectConverter.csproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{75075CEE-B74F-4E21-8C88-D64ACD182237}</ProjectGuid>
    <OutputType>WinExe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>ProjectConverter</RootNamespace>
    <AssemblyName>ProjectConverter</AssemblyName>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <TargetFrameworkProfile>Client</TargetFrameworkProfile>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup>
    <StartupObject>ProjectConverter.App</StartupObject>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Windows.Forms" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="App.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="App.Designer.cs">
      <DependentUpon>App.cs</DependentUpon>
    </Compile>
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <None Include="App.config" />
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="App.resx">
      <DependentUpon>App.cs</DependentUpon>
    </EmbeddedResource>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>

================================================
FILE: ProjectConverter/ProjectConverter.sln
================================================

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectConverter", "ProjectConverter.csproj", "{75075CEE-B74F-4E21-8C88-D64ACD182237}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{75075CEE-B74F-4E21-8C88-D64ACD182237}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{75075CEE-B74F-4E21-8C88-D64ACD182237}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{75075CEE-B74F-4E21-8C88-D64ACD182237}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{75075CEE-B74F-4E21-8C88-D64ACD182237}.Release|Any CPU.Build.0 = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
EndGlobal


================================================
FILE: ProjectConverter/Properties/AssemblyInfo.cs
================================================
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following 
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ProjectConverter")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ProjectConverter")]
[assembly: AssemblyCopyright("Copyright ©  2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible 
// to COM components.  If you need to access a type in this assembly from 
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("e74470a1-41b5-431f-9d38-5ebd4d57c105")]

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version 
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Build and Revision Numbers 
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]


================================================
FILE: README.md
================================================

[![dicord](https://img.shields.io/discord/459062989094649866.svg?logo=discord "Discord")](https://discord.gg/QRex8GK)
![travis](https://img.shields.io/travis/RegrowthStudios/SoACode-Public/develop.svg?style=flat-square&label=Linux "Travis CI")
![appveyor](https://img.shields.io/appveyor/ci/SamThePsychoticLeprechaun/soacode-public/develop.svg?style=flat-square&label=Windows "AppVeyor CI")

# Seed of Andromeda
This repository contains the source code for Seed of Andromeda.

## Getting Started
This guide will walk you through setting up as a contributor to the
Seed of Andromeda project. There is a basic requirement of having several
packages installed prior to being able to develop. We support all three
major operating systems: Windows, Mac and Linux.

### Contributing
Before beginning your SoA journey, please take a moment to use the following resources
to get an idea of how to contribute, what you might be able to contribute to specifically,
and to meet some of the other contributors.
* [Wiki](https://github.com/RegrowthStudios/SoACode-Public/wiki)
* [Issues](https://github.com/RegrowthStudios/SoACode-Public/issues)
* [Discord](https://discord.gg/QRex8GK)

### Setting Up:
**IMPORTANT**: Before following any of the instructions linked below for the platforms we support,
please do take a second to fork the repository! If you are new to GitHub, you can 
do so by clicking the "fork" button on the top right of this page.

If you have cloned the repository before forking, no worries! We can fix it, by following [these instructions](#fixing-a-pre-fork-clone).

Now we're forked, follow the link to the section on setting up for your OS of choice:
* [Windows](#windows)
* [Mac](#mac)
* [Linux](#linux)

### Building:
Now you have a copy of the code, and perhaps have played with it a little, why not give it
a whirl?
* [Building](#building-1)


## Setting Up

### Windows

#### Prerequisites
*  Compiler: [Microsoft Visual Studio 2015 (only)](https://visualstudio.microsoft.com/)
*  Software Version Control:  [Git](http://git-scm.com/downloads)
*  (Optional) MSVS SVC Plugin:  [MSVS Git Plugin](http://msdn.microsoft.com/en-us/library/hh850437.aspx)
*  (Optional) TortoiseGit: [tortoisegit](https://tortoisegit.org/download)

### Mac

#### Prerequisites
* Compiler: [Xcode](https://developer.apple.com/xcode/)
* Software Version Control: [Git](http://git-scm.com/downloads)
    Optionally, with [Homebrew](http://brew.sh/):
    ```brew install git```
* Preferred editor: [Sublime Text](http://www.sublimetext.com/) and optional packages
    * [PackageControl](https://sublime.wbond.net/installation)
    * [CMake](https://sublime.wbond.net/packages/CMake) - CMake.tmLanguage
    * [GitGutter](https://sublime.wbond.net/packages/GitGutter) - A Sublime Text 2/3 plugin to see git diff in gutter
    * [SublimeCodeIntel](https://sublime.wbond.net/packages/SublimeCodeIntel) - Full-featured code intelligence and smart autocomplete engine
    * [SublimeLinter](https://sublime.wbond.net/packages/SublimeLinter) -- Interactive code linting framework for Sublime Text 3
    * [SublimeLinter-cpplint](https://sublime.wbond.net/packages/SublimeLinter-cpplint) -- This linter plugin for SublimeLinter provides an interface to cpplint.
    * [SublimeLinter-pep8](https://sublime.wbond.net/packages/SublimeLinter-pep8) - SublimeLinter plugin for python, using pep8.
    * [SublimeLinter-contrib-clang](https://sublime.wbond.net/packages/SublimeLinter-contrib-clang) - https://sublime.wbond.net/packages/SublimeLinter-contrib-clang

### Linux

#### Prerequisites
* Compiler: gcc or clang
    * Install per your preferred operating system package control...
    * Portage:
    ```bash
    sudo emerge -DuNqa gcc   # for gcc
    sudo emerge -DuNqa clang  # for clang
    ```
    * PacMan:
    ```bash
    sudo pacman -S gcc
    sudo pacman -S clang
    ```
    * Apt:
    ```bash
    sudo apt-get install gcc
    sudo apt-get install clang
    ```
    * Yum:
    ```bash
    sudo yum install gcc
    sudo yum install clang
    ```
* Software Version Control: [Git](http://git-scm.com/downloads)
    * Portage:
    ```bash
    sudo emerge -DuNqa git
    ```
    * PacMan:
    ```bash
    sudo pacman -S git
    ```
    * Apt:
    ```bash
    sudo apt-get install git
    ```
    * Yum:
    ```bash
    sudo yum install git
    ```

# Setup
1. Create a folder to hold the repositories and change to directory
    * Windows
    ```cmd
    Windows + R
    cmd
        
    cd c:\
    mkdir -p repos
    cd c:\repos
    ```
    * Linux
    ```bash
    mkdir ~/repos
    cd ~/repos
    ```
    * Mac
    ```bash
    cmd + space
    Terminal
        
    mkdir ~/repos
    cd ~/repos
    ```
2. Clone the Seed of Andromeda repositories
```cmd
git clone --recurse-submodules https://github.com/YOUR_GITHUB_NAME/SoACode-Public.git soa
```
3. Change to soa direcotory
    * Windows
    ```
    cd c:\repos\soa
    ```
    * Linux & Mac
    ```
    cd ~/repos/soa
    ```
4. (optional) Do this step only if you plan to fork your own Vorb or SoAGameData repos.
    * Fork both the [Vorb](https://github.com/RegrowthStudios/Vorb) and/or [GameData](https://github.com/RegrowthStudios/SoAGameData) repos in github.
    * Set origin of submodules to your forked repositories
    ```cmd
    # Assuming we're already inside the top-level directory of your SoACode-Public repository.
    cd Vorb
    git remote set-url origin https://github.com/YOUR_GITHUB_NAME/Vorb.git
    cd game
    git remote set-url origin https://github.com/YOUR_GITHUB_NAME/SoAGameData.git
    ```

# Building

1. Pull latest code (from inside .../repos/soa)
    ```bash
    git checkout develop    # or your current branch
    git pull --recurse-submodules
    ```
2. Run the build script (--help for options)
    * Windows:
    ```cmd
    build.bat    # or compile from within your Visual Studio environment
    ```
    * Linux:
    ```bash
    ./build.sh
    ```
3. Run the built executable
    * Windows:
    ```cmd
    build/SoA/launch-soa-{Release|Debug}.cmd    # or launch from within your Visual Studio environment
    ```
    * Linux:
    ```bash
    ./build/SoA/launch-soa.sh
    ```

# Fixing a Pre-Fork Clone

So, you've accidentally cloned the repository before forking it, eh? No problem. Just run the following git commands inside of the repository and everything will be as it should be!

Firstly, if you still haven't, fork the repositories you want to contribute to!

Now you have a fork we want to set `origin` of each of your local repositories (which is the default remote repository to push changes to) to your corresponding forked repositories:
```bash
# Assuming we're already inside the top-level directory of your SoACode-Public repository.
git remote set-url origin https://github.com/YOUR_GITHUB_NAME/SoACode-Public.git
cd Vorb
git remote set-url origin https://github.com/YOUR_GITHUB_NAME/Vorb.git
cd game
git remote set-url origin https://github.com/YOUR_GITHUB_NAME/SoAGameData.git
```
If you haven't forked, either Vorb or SoAGameData as you don't intend to contribute to that repository, then you don't need to do run the commands corresponding to that repository.

That's it! It's all fixed. :)


================================================
FILE: SoA/AABBCollidableComponentUpdater.cpp
================================================
#include "stdafx.h"
#include "AABBCollidableComponentUpdater.h"

#include "GameSystem.h"
#include "SpaceSystem.h"
#include "BlockPack.h"

#include "VoxelSpaceConversions.h"

void AABBCollidableComponentUpdater::update(GameSystem* gameSystem, SpaceSystem* spaceSystem) {
    for (auto& it : gameSystem->aabbCollidable) {
        collideWithVoxels(it.second, gameSystem, spaceSystem);
    }
}

void AABBCollidableComponentUpdater::collideWithVoxels(AabbCollidableComponent& cmp, GameSystem* gameSystem, SpaceSystem* spaceSystem) {
    // Clear old data
    cmp.voxelCollisions.clear();
    // Get needed components
    auto& physics = gameSystem->physics.get(cmp.physics);
    auto& position = gameSystem->voxelPosition.get(physics.voxelPosition);
    if (position.parentVoxel == 0) return;
    auto& sphericalVoxel = spaceSystem->sphericalVoxel.get(position.parentVoxel);
    f64v3 vpos = position.gridPosition.pos + f64v3(cmp.offset - cmp.box * 0.5f);
    i32v3 vp(glm::floor(vpos));
    
    i32v3 bounds(glm::ceil(f64v3(cmp.box) + glm::fract(vpos)));
    ChunkGrid& grid = sphericalVoxel.chunkGrids[position.gridPosition.face];
    const BlockPack* bp = sphericalVoxel.blockPack;

    std::map<ChunkID, std::vector<ui16>> boundedVoxels;

    // Get bounded voxels
    for (int yi = 0; yi < bounds.y; yi++) {
        for (int zi = 0; zi < bounds.z; zi++) {
            for (int xi = 0; xi < bounds.x; xi++) {
                i32v3 p = vp + i32v3(xi, yi, zi);
                i32v3 cpos = VoxelSpaceConversions::voxelToChunk(p);
                // TODO(Ben): Negative numbers?
                ChunkID chunkID(cpos);
                i32v3 cp = p - cpos * CHUNK_WIDTH;
                boundedVoxels[chunkID].push_back(cp.y * CHUNK_LAYER + cp.z * CHUNK_WIDTH + cp.x);
            }
        }
    }

    // Find Collidable voxels
    for (auto& it : boundedVoxels) {
        ChunkHandle chunk = grid.accessor.acquire(it.first);
        if (chunk->genLevel == GEN_DONE) {
            std::lock_guard<std::mutex> l(chunk->dataMutex);
            for (auto& i : it.second) {
                BlockID id = chunk->blocks.get(i);
                if (bp->operator[](id).collide) {
                    // TODO(Ben): Don't need to look up every time.
                    cmp.voxelCollisions[it.first].emplace_back(id, i);
                }
            }
        }
        chunk.release();
    }

    // Helper macro for below code
#define CHECK_CODE(dir) \
    /* Acquire new chunk if needed */ \
    if (id != currentID) { \
        /* Release current chunk */ \
        if (chunk.isAquired()) { \
            chunk->dataMutex.unlock(); \
            chunk.release(); \
        } \
        chunk = grid.accessor.acquire(id); \
        if (chunk->genLevel != GEN_DONE) { \
            chunk.release(); \
            currentID = ChunkID(0xffffffffffffffffu); \
        } else { \
            chunk->dataMutex.lock(); \
            currentID = id; \
            /* Check the voxel */ \
            if (chunk->genLevel == GEN_DONE && bp->operator[](chunk->blocks.get(index)).collide) { \
                cd.dir = true; \
            } \
        } \
    } else {\
        /* Check the voxel */ \
        if (chunk->genLevel == GEN_DONE && bp->operator[](chunk->blocks.get(index)).collide) { \
            cd.dir = true; \
        } \
    }

    // Set neighbor collide flags
    // TODO(Ben): More than top
    ChunkID currentID(0xffffffffffffffffu);
    ChunkHandle chunk;
    for (auto& it : cmp.voxelCollisions) {
        for (auto& cd : it.second) {
            { // Left
                ChunkID id = it.first;
                int index = (int)cd.index;
                if ((index & 0x1f) == 0) {
                    index += CHUNK_WIDTH_M1;
                    id.x--;
                } else {
                    index--;
                }
                CHECK_CODE(left);
            }
            { // Right
                ChunkID id = it.first;
                int index = (int)cd.index;
                if ((index & 0x1f) == CHUNK_WIDTH_M1) {
                    index -= CHUNK_WIDTH_M1;
                    id.x++;
                } else {
                    index++;
                }
                CHECK_CODE(right);
            }
            { // Bottom
                ChunkID id = it.first;
                int index = (int)cd.index;
                if (index < CHUNK_LAYER) {
                    index += (CHUNK_SIZE - CHUNK_LAYER);
                    id.y--;
                } else {
                    index -= CHUNK_LAYER;
                }
                CHECK_CODE(bottom);
            }
            { // Top
                ChunkID id = it.first;
                int index = (int)cd.index;
                if (index >= CHUNK_SIZE - CHUNK_LAYER) {
                    index -= (CHUNK_SIZE - CHUNK_LAYER);
                    id.y++;
                } else {
                    index += CHUNK_LAYER;
                }
                CHECK_CODE(top);
            }
            { // Back
                ChunkID id = it.first;
                int index = (int)cd.index;
                if ((index & 0x3ff) / CHUNK_WIDTH == 0) {
                    index += (CHUNK_LAYER - CHUNK_WIDTH);
                    id.z--;
                } else {
                    index -= CHUNK_WIDTH_M1;
                }
                CHECK_CODE(back);
            }
            { // Front
                ChunkID id = it.first;
                int index = (int)cd.index;
                if ((index & 0x3ff) / CHUNK_WIDTH == CHUNK_WIDTH_M1) {
                    index -= (CHUNK_LAYER - CHUNK_WIDTH);
                    id.z++;
                } else {
                    index += CHUNK_WIDTH_M1;
                }
                CHECK_CODE(front);
            }
        }
    }
    // Release chunk if needed
    if (chunk.isAquired()) {
        chunk->dataMutex.unlock();
        chunk.release();
    }
#undef CHECK_CODE
}


================================================
FILE: SoA/AABBCollidableComponentUpdater.h
================================================
//
// AABBCollidableComponentUpdater.h
// Seed of Andromeda
//
// Created by Benjamin Arnold on 30 Aug 2015
// Copyright 2014 Regrowth Studios
// MIT License
//
// Summary:
// Updater for AABB components.
//

#pragma once

#ifndef AABBCollidableComponentUpdater_h__
#define AABBCollidableComponentUpdater_h__

#include <Vorb/ecs/Entity.h>

class GameSystem;
class SpaceSystem;
struct AabbCollidableComponent;

class AABBCollidableComponentUpdater {
public:
    void update(GameSystem* gameSystem, SpaceSystem* spaceSystem);

private:
    void collideWithVoxels(AabbCollidableComponent& cmp, GameSystem* gameSystem, SpaceSystem* spaceSystem);
};

#endif // AABBCollidableComponentUpdater_h__


================================================
FILE: SoA/ARProcessor.cpp
================================================
#include "stdafx.h"
#include "ARProcessor.h"

================================================
FILE: SoA/ARProcessor.h
================================================
///
/// ARProcessor.h
/// Seed of Andromeda
///
/// Created by Cristian Zaloj on 9 Nov 2014
/// Copyright 2014 Regrowth Studios
/// MIT License
///
/// Summary:
/// Stores and keeps track of Augmented Reality information
///

#pragma once

#ifndef ARProcessor_h__
#define ARProcessor_h__

class ARProcessor {

};

#endif // ARProcessor_h__

================================================
FILE: SoA/AmbienceLibrary.cpp
================================================
#include "stdafx.h"
#include "AmbienceLibrary.h"

void AmbienceLibrary::addTrack(const nString& list, const nString& name, const vpath& file) {
    m_lists[list][name] = file;
}

const AmbienceList& AmbienceLibrary::getTracks(const nString& name) const {
    return m_lists.at(name);
}
AmbienceLibrary::Track AmbienceLibrary::getTrack(const nString& list, Random& rGen) const {
    const AmbienceList& tracks = getTracks(list);

    ui32 trackNum = (ui32)(rGen.genMT() * tracks.size()) % tracks.size();
    printf("Chose track %d out of %zd in %s\n", trackNum + 1, tracks.size(), list.c_str());
    AmbienceList::const_iterator iter = tracks.cbegin();
    while (trackNum != 0) {
        iter++;
        trackNum--;
    }

    return Track(iter->first, iter->second);
}


================================================
FILE: SoA/AmbienceLibrary.h
================================================
///
/// AmbienceLibrary.h
/// Seed of Andromeda
///
/// Created by Cristian Zaloj on 11 Jan 2015
/// Copyright 2014 Regrowth Studios
/// MIT License
///
/// Summary:
/// Library of all ambience tracks
///

#pragma once

#ifndef AmbienceLibrary_h__
#define AmbienceLibrary_h__

#include <Vorb/IO.h>
#include <Vorb/Random.h>

typedef std::unordered_map<nString, vpath> AmbienceList; ///< List of tracks (name, file) for an ambience type

/// Library of music tracks organized by ambience
class AmbienceLibrary {
public:
    typedef std::pair<nString, vpath> Track; ///< A named music file

    /// Add a track to the library
    /// @param list: Ambience type
    /// @param name: Name of the track
    /// @param file: File for the track
    void addTrack(const nString& list, const nString& name, const vpath& file);

    /// Obtain a list of tracks for a certain type of ambience
    /// @param name: Ambience type
    /// @return The list of tracks 
    const AmbienceList& getTracks(const nString& name) const;
    /// Obtain a random track in an ambient list
    /// @param list: Ambience type
    /// @param rGen: Random generator
    /// @return A random track that can be played
    Track getTrack(const nString& list, Random& rGen) const;
private:
    std::unordered_map<nString, AmbienceList> m_lists; ///< Lists of ambiences that may play
};

#endif // AmbienceLibrary_h__


================================================
FILE: SoA/AmbiencePlayer.cpp
================================================
#include "stdafx.h"
#include "AmbiencePlayer.h"

#include <Vorb/sound/SoundEngine.h>

#include "AmbienceLibrary.h"

#define AMBIENCE_PLAYER_DISPOSAL_RATE 2.0f

void AmbiencePlayer::init(vsound::Engine* engine, const AmbienceLibrary* library) {
    m_engine = engine;
    m_lib = library;
}

void AmbiencePlayer::dispose() {
    m_engine = nullptr;
    m_lib = nullptr;
}

void AmbiencePlayer::setToTrack(const nString& name, const f32& fadeTime) {
    // Set current ambience
    currentAmbience = name;

    if (!currentAmbience.empty()) {
        // Make one track come alive
        auto track = m_streams.find(currentAmbience);
        if (track != m_streams.end()) {
            // Reset track to be alive
            track->second.stream.setPeakTime(fadeTime);
        } else {
            // Add a new stream
            SoundStream stream;
            stream.stream.setPeakTime(fadeTime);
            m_streams[name] = stream;
        }
    }

    // Make all other tracks fade away
    for (auto& kvp : m_streams) {
        if (kvp.first != currentAmbience) {
            kvp.second.stream.setDeathTime(fadeTime);
        }
    }
}

void AmbiencePlayer::update(const f32& dt) {
    if (!m_engine || !m_lib) return;

    m_timerDisposal += dt;

    // Update volumes if necessary
    for (auto& kvp : m_streams) {
        SoundStream& stream = kvp.second;
        bool soundChanged = stream.stream.update(dt);

        if (stream.stream.isAlive()) {
            if (!stream.resource.isNull() && !stream.instance.isPlaying()) {
                // Delete a finished track
                m_engine->freeSound(stream.resource);
            }

            if (!stream.stream.isDying() && stream.resource.isNull()) {
                // Get a new track
                AmbienceLibrary::Track track = m_lib->getTrack(currentAmbience, m_rand);
                currentTrack = track.first;

                // Load and play the track
                stream.resource = m_engine->loadSound(track.second, false, true);
                stream.instance = m_engine->createInstance(stream.resource);
                stream.instance.setLooped(false);
                stream.instance.setVolume(stream.stream.getVolume() * m_volume);
                stream.instance.play();
            }

            // Update volume
            if (soundChanged) {
                stream.instance.setVolume(stream.stream.getVolume() * m_volume);
            }
        }
    }

    // Dispose of old streams
    if (m_timerDisposal > AMBIENCE_PLAYER_DISPOSAL_RATE) {
        m_timerDisposal = 0.0f;

        StreamMap updated;
        for (auto& kvp : m_streams) {
            if (kvp.second.stream.isAlive()) {
                updated[kvp.first] = kvp.second;
            } else {
                if (!kvp.second.resource.isNull()) {
                    m_engine->freeSound(kvp.second.resource);
                }
            }
        }
        m_streams.swap(updated);
    }
}

void AmbiencePlayer::setVolume(f32 volume) {
    m_volume = volume;
    // Update volumes if necessary
    for (auto& kvp : m_streams) {
        SoundStream& stream = kvp.second;

        if (stream.stream.isAlive()) {
            stream.instance.setVolume(stream.stream.getVolume() * m_volume);
        }
    }
}

================================================
FILE: SoA/AmbiencePlayer.h
================================================
///
/// AmbiencePlayer.h
/// Seed of Andromeda
///
/// Created by Cristian Zaloj on 11 Jan 2015
/// Copyright 2014 Regrowth Studios
/// MIT License
///
/// Summary:
/// Plays ambience tracks with cross-fading
///

#pragma once

#ifndef AmbiencePlayer_h__
#define AmbiencePlayer_h__

#include <Vorb/Random.h>
#include <Vorb/sound/SoundInstance.h>
#include <Vorb/sound/SoundResource.h>
#include <Vorb/VorbPreDecl.inl>

#include "AmbienceStream.h"

DECL_VSOUND(class Engine)
class AmbienceLibrary;

/// Mixes ambient music for a game
/// TODO: Make this thread-safe and put it on another thread with begin/end
class AmbiencePlayer {
public:
    /// Setup all player references
    /// @param engine: Sound engine that will be used by this player
    /// @param library: Reference to library of ambient songs
    void init(vsound::Engine* engine, const AmbienceLibrary* library);
    /// Destroy all streams held by the player
    void dispose();

    /// Play a new mix of ambient music
    /// @param name: Name of the ambience (that must be found in the library) or "" to stop all music
    /// @param fadeTime: Amount of time until this stream becomes dominant
    void setToTrack(const nString& name, UNIT_SPACE(SECONDS) const f32& fadeTime);

    /// Update streams, loading in music tracks as necessary
    /// @param dt: Elapsed time since the last update
    /// TODO: return volume-change bool to allow intelligent sleeping
    void update(UNIT_SPACE(SECONDS) const f32& dt);

    const f32& getVolume() const { return m_volume; }
    void setVolume(f32 volume);
private:
    /// A stream with a controller and sound information
    struct SoundStream {
    public:
        AmbienceStream stream; ///< Stream controller
        vsound::Resource resource; ///< Sound's resource data
        vsound::Instance instance; ///< Playing sound handle
    };

    typedef std::unordered_map<nString, SoundStream> StreamMap;

    UNIT_SPACE(SECONDS) f32 m_timerDisposal = 0.0f; ///< Time until dead streams are destroyed
    vsound::Engine* m_engine = nullptr; ///< Reference to the sound engine
    const AmbienceLibrary* m_lib = nullptr; ///< Reference to library of ambient sounds
    StreamMap m_streams; ///< Currently playing ambience streams
    Random m_rand; ///< Random number generator

    f32 m_volume = 1.0f;
    nString currentAmbience = ""; ///< Current ambience type
    nString currentTrack = ""; ///< Currently playing track in the ambience stream
};

#endif // AmbiencePlayer_h__


================================================
FILE: SoA/AmbienceStream.cpp
================================================
#include "stdafx.h"
#include "AmbienceStream.h"

const f32& AmbienceStream::getVolume() const {
    return m_ratio;
}

bool AmbienceStream::isAlive() const {
    return m_ratio > 0.0f || m_change > 0.0f;
}
bool AmbienceStream::isDying() const {
    return m_change < 0.0f;
}

void AmbienceStream::setDeathTime(const f32& seconds) {
    m_change = -m_ratio / seconds;
}
void AmbienceStream::setPeakTime(const f32& seconds) {
    m_change = (1.0f - m_ratio) / seconds;
}

bool AmbienceStream::update(const f32& dt) {
    if (m_change == 0.0f) return false;

    m_ratio += m_change * dt;
    if (m_change > 0.0f) {
        if (m_ratio >= 1.0f) {
            m_ratio = 1.0f;
            m_change = 0.0f;
        }
    } else {
        if (m_ratio <= 0.0f) {
            m_ratio = 0.0f;
            m_change = 0.0f;
        }
    }
    return true;
}


================================================
FILE: SoA/AmbienceStream.h
================================================
///
/// AmbienceStream.h
/// Seed of Andromeda
///
/// Created by Cristian Zaloj on 11 Jan 2015
/// Copyright 2014 Regrowth Studios
/// MIT License
///
/// Summary:
/// A stream of music created from a list of ambient music
///

#pragma once

#ifndef AmbienceStream_h__
#define AmbienceStream_h__

#include "Vorb/types.h"
/// Encapsulates a stream of ambient music
class AmbienceStream {
public:
    /// @return The relative volume of the stream [0,1]
    const f32& getVolume() const;
    /// @return True if this stream is in a playing state
    bool isAlive() const;
    /// @return True if this stream is fading away
    bool isDying() const;

    /// Set this stream to fade away to nothingness
    /// @param seconds: Time until this stream is dead
    void setDeathTime(UNIT_SPACE(SECONDS) const f32& seconds);
    /// Set this stream to come alive from its current state
    /// @param seconds: Time until this stream is fully audible
    void setPeakTime(UNIT_SPACE(SECONDS) const f32& seconds);

    /// Update a stream of music
    /// @param dt: Elapsed time
    /// @return True if the volume changed
    bool update(UNIT_SPACE(SECONDS) const f32& dt);
private:
    f32 m_ratio = 0.0f; ///< The current liveliness level of the stream [0,1]
    f32 m_change = 0.0f; ///< The rate of change of the ratio per second
};

#endif // AmbienceStream_h__


================================================
FILE: SoA/Animation.h
================================================
#pragma once

#ifndef Animation_h_
#define Animation_h_

#include <Vorb/graphics/Texture.h>

struct Animation {
    Animation() : fadeOutBegin(INT_MAX) {}
    int duration;
    int fadeOutBegin;
    int repetitions;
    int xFrames;
    int yFrames;
    int frames;
    vg::Texture texture;
};

#endif // Animation_h_

================================================
FILE: SoA/App.cpp
================================================
#include "stdafx.h"
#include "App.h"

#include <Vorb/ui/InputDispatcher.h>
#include <Vorb/ui/ScreenList.h>
#include <Vorb/graphics/SpriteBatch.h>
#include <Vorb/sound/SoundEngine.h>

#include "ChunkMeshManager.h"
#include "CommonState.h"
#include "DebugRenderer.h"
#include "DevScreen.h"
#include "GameManager.h"
#include "GameplayLoadScreen.h"
#include "GamePlayScreen.h"
#include "InitScreen.h"
#include "MainMenuLoadScreen.h"
#include "MainMenuScreen.h"
#include "SoaEngine.h"
#include "SoaOptions.h"
#include "SoAState.h"
#include "SpaceSystem.h"
#include "TestBiomeScreen.h"
#include "TestBlockViewScreen.h"
#include "TestConnectedTextureScreen.h"
#include "TestConsoleScreen.h"
#include "TestDeferredScreen.h"
#include "TestDisplacementMappingScreen.h"
#include "TestGasGiantScreen.h"
#include "TestMappingScreen.h"
#include "TestNewBlockAPIScreen.h"
#include "TestNoiseScreen.h"
#include "TestPlanetGenScreen.h"
#include "TestScriptScreen.h"
#include "TestStarScreen.h"
#include "TestUIScreen.h"
#include "TestVoxelModelScreen.h"

void App::addScreens() {
    scrInit = new InitScreen(this);  
    scrMainMenu = new MainMenuScreen(this, &state);
    scrLoad = new MainMenuLoadScreen(this, &state, scrMainMenu);
    scrGamePlay = new GameplayScreen(this, scrMainMenu);
    scrGameplayLoad = new GameplayLoadScreen(this, &state, scrMainMenu, scrGamePlay);

    m_screenList.addScreen(scrInit);
    m_screenList.addScreen(scrLoad);
    m_screenList.addScreen(scrMainMenu);
    m_screenList.addScreen(scrGameplayLoad);
    m_screenList.addScreen(scrGamePlay);

    // Add development screen
    scrDev = new DevScreen;
    scrDev->addScreen(VKEY_RETURN, scrInit, "Seed of Andromeda");
    m_screenList.addScreen(scrDev);

    // Add test screens
//    scrTests.push_back(new TestConsoleScreen);
//    m_screenList.addScreen(scrTests.back());
//    scrDev->addScreen(VKEY_C, scrTests.back(), "TestConsoleScreen");
    scrTests.push_back(new TestMappingScreen);
    m_screenList.addScreen(scrTests.back());
    scrDev->addScreen(VKEY_M, scrTests.back(), "TestMappingScreen");
    scrTests.push_back(new TestDeferredScreen);
    m_screenList.addScreen(scrTests.back());
    scrDev->addScreen(VKEY_D, scrTests.back(), "TestDeferredScreen");
    scrTests.push_back(new TestBlockView);
    m_screenList.addScreen(scrTests.back());
    scrDev->addScreen(VKEY_B, scrTests.back(), "TestBlockView");
    scrTests.push_back(new TestGasGiantScreen);
    m_screenList.addScreen(scrTests.back());
    scrDev->addScreen(VKEY_G, scrTests.back(), "TestGasGiantScreen");
    scrTests.push_back(new TestScriptScreen(this, &state));
    m_screenList.addScreen(scrTests.back());
    scrDev->addScreen(VKEY_W, scrTests.back(), "TestScriptScreen");
    scrTests.push_back(new TestStarScreen(this));
    m_screenList.addScreen(scrTests.back());
    scrDev->addScreen(VKEY_S, scrTests.back(), "TestStarScreen");
    scrTests.push_back(new TestVoxelModelScreen(this));
    m_screenList.addScreen(scrTests.back());
    scrDev->addScreen(VKEY_V, scrTests.back(), "TestVoxelModelScreen");
    scrTests.push_back(new TestDisplacementMappingScreen);
    m_screenList.addScreen(scrTests.back());
    scrDev->addScreen(VKEY_P, scrTests.back(), "TestDisplacementMappingScreen");
    scrTests.push_back(new TestNoiseScreen(this));
    m_screenList.addScreen(scrTests.back());
    scrDev->addScreen(VKEY_N, scrTests.back(), "TestNoiseScreen");
//    scrTests.push_back(new TestNewBlockAPIScreen);
//    m_screenList.addScreen(scrTests.back());
//    scrDev->addScreen(VKEY_A, scrTests.back(), "TestNewBlockAPIScreen");
    scrTests.push_back(new TestPlanetGenScreen);
    m_screenList.addScreen(scrTests.back());
    scrDev->addScreen(VKEY_O, scrTests.back(), "TestPlanetGenScreen");
    scrTests.push_back(new TestConnectedTextureScreen(this, &state));
    m_screenList.addScreen(scrTests.back());
    scrDev->addScreen(VKEY_T, scrTests.back(), "TestConnectedTextureScreen");
    scrTests.push_back(new TestBiomeScreen(this, &state));
    m_screenList.addScreen(scrTests.back());
    scrDev->addScreen(VKEY_Z, scrTests.back(), "TestBiomeScreen");
    scrTests.push_back(new TestUIScreen(this, &state));
    m_screenList.addScreen(scrTests.back());
    scrDev->addScreen(VKEY_U, scrTests.back(), "TestUIScreen");

    // Uncomment to start from dev screen for testing other screens
#define START_AT_DEV_SCREEN
#ifdef START_AT_DEV_SCREEN
    m_screenList.setScreen(scrDev->getIndex());
#else
    m_screenList.setScreen(scrInit->getIndex());
#endif
}

void App::onInit() {
    state.state = new SoaState;
    state.window = &m_window;
    state.soundEngine = new vsound::Engine;
    state.soundEngine->init();

    // Load the game options
    SoaEngine::initOptions(soaOptions);

    // Set the window options
    soaOptions.get(OPT_FULLSCREEN).value.b = m_window.isFullscreen();
    soaOptions.get(OPT_BORDERLESS).value.b = m_window.isBorderless();
    soaOptions.get(OPT_SCREEN_WIDTH).value.i = m_window.getWidth();
    soaOptions.get(OPT_SCREEN_HEIGHT).value.i = m_window.getHeight();
    soaOptions.get(OPT_VSYNC).value.i = (m_window.getSwapInterval() == vui::GameSwapInterval::V_SYNC);

    // Load the options from file
    SoaEngine::optionsController.loadOptions();

    vg::SamplerState::initPredefined();
}

void App::onExit() {
    // Delete cache if it exists

    vg::SpriteBatch::disposeProgram();
}

App::~App() {
    delete scrInit;
    delete scrLoad;
    delete scrMainMenu;
    delete scrGamePlay;
    delete scrDev;
}

================================================
FILE: SoA/App.h
================================================
#pragma once

#ifndef App_h_
#define App_h_

#include <Vorb/ui/MainGame.h>
#include "SoaOptions.h"
#include "CommonState.h"

class DevScreen;
class GameplayLoadScreen;
class GameplayScreen;
class InitScreen;
class MainMenuLoadScreen;
class MainMenuScreen;
class TexturePackLoader;

class App : public vui::MainGame {
public:
    virtual ~App();

    virtual void addScreens();
    virtual void onInit();
    virtual void onExit();

    // Accessible Pointers To Screens
    InitScreen* scrInit = nullptr;
    MainMenuLoadScreen* scrLoad = nullptr;
    MainMenuScreen* scrMainMenu = nullptr;
    GameplayLoadScreen* scrGameplayLoad = nullptr;
    GameplayScreen* scrGamePlay = nullptr;

    DevScreen* scrDev = nullptr;
    std::vector<vui::IGameScreen*> scrTests;

    CommonState state;
};

#endif // App_h_


================================================
FILE: SoA/AtmosphereComponentRenderer.cpp
================================================
#include "stdafx.h"
#include "AtmosphereComponentRenderer.h"

#include "SpaceSystem.h"
#include "RenderUtils.h"
#include "soaUtils.h"
#include "ShaderLoader.h"

#include <Vorb/MeshGenerators.h>
#include <Vorb/graphics/GpuMemory.h>
#include <Vorb/graphics/RasterizerState.h>
#include <Vorb/graphics/ShaderManager.h>
#include <Vorb/math/VorbMath.hpp>

#define ICOSPHERE_SUBDIVISIONS 5

AtmosphereComponentRenderer::~AtmosphereComponentRenderer() {
    dispose();
}

void AtmosphereComponentRenderer::initGL() {
    if (!m_program.isCreated()) {
        m_program = ShaderLoader::createProgramFromFile("Shaders/AtmosphereShading/Sky.vert",
                                                        "Shaders/AtmosphereShading/Sky.frag");
    }
    if (!m_icoVbo) buildMesh();
}

void AtmosphereComponentRenderer::draw(const AtmosphereComponent& aCmp,
                                       const f32m4& VP,
                                       const f32v3& relCamPos,
                                       const f32v3& lightDir,
                                       const f32 zCoef,
                                       const SpaceLightComponent* spComponent VORB_MAYBE_UNUSED) {
    m_program.use();

    // Set up matrix
    f32m4 WVP(1.0);
    setMatrixScale(WVP, f32v3(aCmp.radius, aCmp.radius * (1.0 - aCmp.oblateness), aCmp.radius));
    setMatrixTranslation(WVP, -relCamPos);
    WVP = VP * WVP;

    f32 camHeight = glm::length(relCamPos);
    f32 camHeight2 = camHeight * camHeight;

    // Upload uniforms
    glUniformMatrix4fv(m_program.getUniform("unWVP"), 1, GL_FALSE, &WVP[0][0]);
    glUniform3fv(m_program.getUniform("unCameraPos"), 1, &relCamPos[0]);
    glUniform3fv(m_program.getUniform("unLightDirWorld"), 1, &lightDir[0]);
    glUniform3fv(m_program.getUniform("unInvWavelength"), 1, &aCmp.invWavelength4[0]);
    glUniform1f(m_program.getUniform("unCameraHeight2"), camHeight2);
    glUniform1f(m_program.getUniform("unOuterRadius"), aCmp.radius);
    glUniform1f(m_program.getUniform("unOuterRadius2"), aCmp.radius * aCmp.radius);
    glUniform1f(m_program.getUniform("unInnerRadius"), aCmp.planetRadius);
    glUniform1f(m_program.getUniform("unKrESun"), aCmp.kr * aCmp.esun);
    glUniform1f(m_program.getUniform("unKmESun"), aCmp.km * aCmp.esun);
    glUniform1f(m_program.getUniform("unKr4PI"), (f32)(aCmp.kr * M_4_PI));
    glUniform1f(m_program.getUniform("unKm4PI"), (f32)(aCmp.km * M_4_PI));
    float scale = 1.0f / (aCmp.radius - aCmp.planetRadius);
    glUniform1f(m_program.getUniform("unScale"), scale);
    glUniform1f(m_program.getUniform("unScaleDepth"), aCmp.scaleDepth);
    glUniform1f(m_program.getUniform("unScaleOverScaleDepth"), scale / aCmp.scaleDepth);
    glUniform1i(m_program.getUniform("unNumSamples"), 3);
    glUniform1f(m_program.getUniform("unNumSamplesF"), 3.0f);
    glUniform1f(m_program.getUniform("unG"), aCmp.g);
    glUniform1f(m_program.getUniform("unG2"), aCmp.g * aCmp.g);
    // For logarithmic Z buffer
    glUniform1f(m_program.getUniform("unZCoef"), zCoef);

    // Bind VAO
    glBindVertexArray(m_vao);
   
    // Render
    glDepthMask(GL_FALSE);
    vg::RasterizerState::CULL_COUNTER_CLOCKWISE.set();
    glDrawElements(GL_TRIANGLES, m_numIndices, GL_UNSIGNED_INT, 0);
    glDepthMask(GL_TRUE);
    vg::RasterizerState::CULL_CLOCKWISE.set();

    glBindVertexArray(0);
    m_program.unuse(); 
}

void AtmosphereComponentRenderer::dispose() {
    if (m_program.isCreated()) m_program.dispose();
    if (m_icoVbo) vg::GpuMemory::freeBuffer(m_icoVbo);
    if (m_icoIbo) vg::GpuMemory::freeBuffer(m_icoIbo);
    if (m_vao) glDeleteVertexArrays(1, &m_vao);
}

void AtmosphereComponentRenderer::buildMesh() {
    std::vector<ui32> indices;
    std::vector<f32v3> positions;

    // TODO(Ben): Optimize with LOD for far viewing
    vmesh::generateIcosphereMesh(ICOSPHERE_SUBDIVISIONS, indices, positions);
    m_numIndices = indices.size();

    glGenVertexArrays(1, &m_vao);
    glBindVertexArray(m_vao);

    vg::GpuMemory::createBuffer(m_icoVbo);
    vg::GpuMemory::createBuffer(m_icoIbo);

    vg::GpuMemory::bindBuffer(m_icoVbo, vg::BufferTarget::ARRAY_BUFFER);
    vg::GpuMemory::uploadBufferData(m_icoVbo, vg::BufferTarget::ARRAY_BUFFER, positions.size() * sizeof(f32v3),
                                    positions.data(), vg::BufferUsageHint::STATIC_DRAW);

    vg::GpuMemory::bindBuffer(m_icoIbo, vg::BufferTarget::ELEMENT_ARRAY_BUFFER);
    vg::GpuMemory::uploadBufferData(m_icoIbo, vg::BufferTarget::ELEMENT_ARRAY_BUFFER, indices.size() * sizeof(ui32),
                                    indices.data(), vg::BufferUsageHint::STATIC_DRAW);

    glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0);
    m_program.enableVertexAttribArrays();

    glBindVertexArray(0);
}

================================================
FILE: SoA/AtmosphereComponentRenderer.h
================================================
///
/// AtmosphereComponentRenderer.h
/// Seed of Andromeda
///
/// Created by Benjamin Arnold on 8 Mar 2015
/// Copyright 2014 Regrowth Studios
/// MIT License
///
/// Summary:
/// Renders atmosphere components
///

#pragma once

#ifndef AtmosphereComponentRenderer_h__
#define AtmosphereComponentRenderer_h__

#include <Vorb/ecs/ECS.h>
#include <Vorb/ecs/ComponentTable.hpp>
#include <Vorb/VorbPreDecl.inl>
#include <Vorb/graphics/gtypes.h>
#include <Vorb/graphics/GLProgram.h>

struct AtmosphereComponent;
struct SpaceLightComponent;

class AtmosphereComponentRenderer {
public:
    ~AtmosphereComponentRenderer();

    void initGL();
    void draw(const AtmosphereComponent& aCmp,
              const f32m4& VP,
              const f32v3& relCamPos,
              const f32v3& lightDir,
              const f32 zCoef,
              const SpaceLightComponent* spComponent);
    void dispose();
private:
    void buildMesh();

    vg::GLProgram m_program;
    VGBuffer m_icoVbo = 0;
    VGIndexBuffer m_icoIbo = 0;
    VGVertexArray m_vao = 0;
    int m_numIndices = 0;
};

#endif // AtmosphereComponentRenderer_h__



================================================
FILE: SoA/AxisRotationComponentUpdater.cpp
================================================
#include "stdafx.h"
#include "AxisRotationComponentUpdater.h"

#include "SpaceSystem.h"
#include "Constants.h"

void AxisRotationComponentUpdater::update(SpaceSystem* spaceSystem, f64 time) {
    for (auto& it : spaceSystem->axisRotation) {
        auto& cmp = it.second;
        // Calculate rotation
        if (cmp.period) {
            cmp.currentRotation = (time / cmp.period) * 2.0 * M_PI;
        }

        // Calculate the axis rotation quat
        f64v3 eulerAngles(0, -cmp.currentRotation, 0);
        f64q rotationQuat = f64q(eulerAngles);

        // Calculate total orientation
        cmp.currentOrientation = cmp.axisOrientation * rotationQuat;
        cmp.invCurrentOrientation = glm::inverse(cmp.currentOrientation);
    }
}


================================================
FILE: SoA/AxisRotationComponentUpdater.h
================================================
///
/// AxisRotationComponentUpdater.h
/// Seed of Andromeda
///
/// Created by Benjamin Arnold on 8 Jan 2015
/// Copyright 2014 Regrowth Studios
/// MIT License
///
/// Summary:
/// Updates AxisRotationComponents
///

#pragma once

#ifndef AxisRotationComponentUpdater_h__
#define AxisRotationComponentUpdater_h__

#include "Vorb/types.h"

class SpaceSystem;

class AxisRotationComponentUpdater {
public:
    /// Updates the components
    /// @param spaceSystem: The ECS space system
    /// @param time: Time in seconds
    void update(SpaceSystem* spaceSystem, f64 time);
};

#endif // AxisRotationComponentUpdater_h__

================================================
FILE: SoA/Biome.cpp
================================================
#include "stdafx.h"
#include "Biome.h"

KEG_TYPE_DEF_SAME_NAME(BiomeFloraKegProperties, kt) {
    using namespace keg;
    KEG_TYPE_INIT_ADD_MEMBER(kt, BiomeFloraKegProperties, id, STRING);
    kt.addValue("chance", Value::custom(offsetof(BiomeFloraKegProperties, chance), "NoiseBase", false));
}

KEG_TYPE_DEF_SAME_NAME(BiomeTreeKegProperties, kt) {
    using namespace keg;
    KEG_TYPE_INIT_ADD_MEMBER(kt, BiomeTreeKegProperties, id, STRING);
    kt.addValue("chance", Value::custom(offsetof(BiomeTreeKegProperties, chance), "NoiseBase", false));
}


================================================
FILE: SoA/Biome.h
================================================
///
/// Biome.h
/// Seed of Andromeda
///
/// Created by Benjamin Arnold on 30 Nov 2014
/// Copyright 2014 Regrowth Studios
/// MIT License
///
/// Summary:
/// Provides the biome implementation.
///
#pragma once

#ifndef Biome_h__
#define Biome_h__

#include "Noise.h"
#include "Flora.h"

struct PlanetGenData;

// TODO(Ben): Also support L-system trees.
struct BiomeTree {
    NoiseBase chance;
    NTreeType* data = nullptr;
    FloraID id = FLORA_ID_NONE;
};

struct BiomeFloraKegProperties {
    NoiseBase chance;
    nString id;
};
KEG_TYPE_DECL(BiomeFloraKegProperties);

struct BiomeTreeKegProperties {
    NoiseBase chance;
    nString id;
};
KEG_TYPE_DECL(BiomeTreeKegProperties);

// Unique flora instance
struct BiomeFlora {
    NoiseBase chance;
    FloraType* data = nullptr;
    FloraID id = FLORA_ID_NONE;
};

struct BlockLayer {
    ui32 start;
    ui32 width;
    ui16 block = 0;
    ui16 surfaceTransform = 0; ///< This block is used on surface
};

#define BIOME_MAP_WIDTH 256

typedef nString BiomeID;
struct Biome;

struct BiomeInfluence {
    BiomeInfluence() {};
    BiomeInfluence(const Biome* b, f32 weight) : b(b), weight(weight) {}
    const Biome* b;
    f32 weight;

    bool operator<(const BiomeInfluence& rhs) const {
        // Ignore weight on purpose. Only one BiomeInfluence per set or map!
        return b < rhs.b;
    }
};

// TODO(Ben): Make the memory one contiguous block
typedef std::vector<std::vector<BiomeInfluence>> BiomeInfluenceMap;

// TODO(Ben): Optimize the cache
struct Biome {
    Biome():id("default"), displayName("Default"), mapColor(255, 255, 255), genData(nullptr){}

    BiomeID id;
    nString displayName;
    ColorRGB8 mapColor; ///< For debugging and lookups
    std::vector<BlockLayer> blockLayers; ///< Overrides base layers
    std::vector<Biome*> children;
    std::vector<BiomeFlora> flora;
    std::vector<BiomeTree> trees;
    NoiseBase childNoise; ///< For sub biome determination
    NoiseBase terrainNoise; ///< Modifies terrain directly
    // Only applies to base biomes
    f64v2 heightRange;
    f64v2 heightScale;
    f64v2 noiseRange;
    f64v2 noiseScale;
    const PlanetGenData* genData;
};

static const Biome DEFAULT_BIOME;

#endif // Biome_h__


================================================
FILE: SoA/BlendState.h
================================================
#pragma once

enum BlendEquationMode {
    BLEND_EQUATION_MODE_FUNC_ADD = GL_FUNC_ADD,
    BLEND_EQUATION_MODE_FUNC_REVERSE_SUBTRACT = GL_FUNC_REVERSE_SUBTRACT,
    BLEND_EQUATION_MODE_FUNC_SUBTRACT = GL_FUNC_SUBTRACT,
    BLEND_EQUATION_MODE_MAX = GL_MAX,
    BLEND_EQUATION_MODE_MIN = GL_MIN
};
enum BlendingFactorSrc {
    BLENDING_FACTOR_SRC_CONSTANT_ALPHA = GL_CONSTANT_ALPHA,
    BLENDING_FACTOR_SRC_CONSTANT_COLOR = GL_CONSTANT_COLOR,
    BLENDING_FACTOR_SRC_DST_ALPHA = GL_DST_ALPHA,
    BLENDING_FACTOR_SRC_DST_COLOR = GL_DST_COLOR,
    BLENDING_FACTOR_SRC_ONE = GL_ONE,
    BLENDING_FACTOR_SRC_ONE_MINUS_CONSTANT_ALPHA = GL_ONE_MINUS_CONSTANT_ALPHA,
    BLENDING_FACTOR_SRC_ONE_MINUS_CONSTANT_COLOR = GL_ONE_MINUS_CONSTANT_COLOR,
    BLENDING_FACTOR_SRC_ONE_MINUS_DST_ALPHA = GL_ONE_MINUS_DST_ALPHA,
    BLENDING_FACTOR_SRC_ONE_MINUS_DST_COLOR = GL_ONE_MINUS_DST_COLOR,
    BLENDING_FACTOR_SRC_ONE_MINUS_SRC_1_ALPHA = GL_ONE_MINUS_SRC1_ALPHA,
    BLENDING_FACTOR_SRC_ONE_MINUS_SRC_1_COLOR = GL_ONE_MINUS_SRC1_COLOR,
    BLENDING_FACTOR_SRC_ONE_MINUS_SRC_ALPHA = GL_ONE_MINUS_SRC_ALPHA,
    BLENDING_FACTOR_SRC_ONE_MINUS_SRC_COLOR = GL_ONE_MINUS_SRC_COLOR,
    BLENDING_FACTOR_SRC_SRC_1_ALPHA = GL_SRC1_ALPHA,
    BLENDING_FACTOR_SRC_SRC_1_COLOR = GL_SRC1_COLOR,
    BLENDING_FACTOR_SRC_SRC_ALPHA = GL_SRC_ALPHA,
    BLENDING_FACTOR_SRC_SRC_ALPHA_SATURATE = GL_SRC_ALPHA_SATURATE,
    BLENDING_FACTOR_SRC_SRC_COLOR = GL_SRC_COLOR,
    BLENDING_FACTOR_SRC_ZERO = GL_ZERO
};
enum BlendingFactorDest {
    BLENDING_FACTOR_DEST_CONSTANT_ALPHA = GL_CONSTANT_ALPHA,
    BLENDING_FACTOR_DEST_CONSTANT_COLOR = GL_CONSTANT_COLOR,
    BLENDING_FACTOR_DEST_DST_ALPHA = GL_DST_ALPHA,
    BLENDING_FACTOR_DEST_DST_COLOR = GL_DST_COLOR,
    BLENDING_FACTOR_DEST_ONE = GL_ONE,
    BLENDING_FACTOR_DEST_ONE_MINUS_CONSTANT_ALPHA = GL_ONE_MINUS_CONSTANT_ALPHA,
    BLENDING_FACTOR_DEST_ONE_MINUS_CONSTANT_COLOR = GL_ONE_MINUS_CONSTANT_COLOR,
    BLENDING_FACTOR_DEST_ONE_MINUS_DST_ALPHA = GL_ONE_MINUS_DST_ALPHA,
    BLENDING_FACTOR_DEST_ONE_MINUS_DST_COLOR = GL_ONE_MINUS_DST_COLOR,
    BLENDING_FACTOR_DEST_ONE_MINUS_SRC_1_ALPHA = GL_ONE_MINUS_SRC1_ALPHA,
    BLENDING_FACTOR_DEST_ONE_MINUS_SRC_1_COLOR = GL_ONE_MINUS_SRC1_COLOR,
    BLENDING_FACTOR_DEST_ONE_MINUS_SRC_ALPHA = GL_ONE_MINUS_SRC_ALPHA,
    BLENDING_FACTOR_DEST_ONE_MINUS_SRC_COLOR = GL_ONE_MINUS_SRC_COLOR,
    BLENDING_FACTOR_DEST_SRC_1_ALPHA = GL_SRC1_ALPHA,
    BLENDING_FACTOR_DEST_SRC_1_COLOR = GL_SRC1_COLOR,
    BLENDING_FACTOR_DEST_SRC_ALPHA = GL_SRC_ALPHA,
    BLENDING_FACTOR_DEST_SRC_ALPHA_SATURATE = GL_SRC_ALPHA_SATURATE,
    BLENDING_FACTOR_DEST_SRC_COLOR = GL_SRC_COLOR,
    BLENDING_FACTOR_DEST_ZERO = GL_ZERO
};

class BlendFunction {
public:
    BlendFunction(BlendEquationMode bem, BlendingFactorSrc bfs, BlendingFactorDest bfd);

    BlendEquationMode blendMode;
    BlendingFactorSrc blendFactorSrc;
    BlendingFactorDest blendFactorDest;
};


class BlendState {
public:
    BlendState(BlendFunction funcRGB, BlendFunction funcAlpha);

    void set() const;

    BlendFunction blendFuncRGB;
    BlendFunction blendFuncAlpha;
};

================================================
FILE: SoA/BlockData.cpp
================================================
#include "stdafx.h"
#include "BlockData.h"

#include "BlockPack.h"
#include "Errors.h"
#include "GameManager.h"
#include "SoaOptions.h"
#include "ZipFile.h"

KEG_ENUM_DEF(BlockOcclusion, BlockOcclusion, e) {
    e.addValue("none", BlockOcclusion::NONE);
    e.addValue("self", BlockOcclusion::SELF);
    // TODO(Ben): Temporary
    e.addValue("selfOnly", BlockOcclusion::SELF);
    e.addValue("all", BlockOcclusion::ALL);
}

KEG_TYPE_DEF_SAME_NAME(Block, kt) {
    kt.addValue("ID", keg::Value::basic(offsetof(Block, temp), keg::BasicType::I32));
    kt.addValue("name", keg::Value::basic(offsetof(Block, name), keg::BasicType::STRING));
    kt.addValue("burnTransformID", keg::Value::basic(offsetof(Block, burnTransformID), keg::BasicType::STRING));
    kt.addValue("waveEffect", keg::Value::basic(offsetof(Block, waveEffect), keg::BasicType::I16));
    kt.addValue("lightColor", keg::Value::basic(offsetof(Block, lightColor), keg::BasicType::UI8_V3));
    kt.addValue("caPhysics", keg::Value::basic(offsetof(Block, caFilePath), keg::BasicType::STRING));
    kt.addValue("waterMeshLevel", keg::Value::basic(offsetof(Block, waterMeshLevel), keg::BasicType::I16));
    kt.addValue("floatingAction", keg::Value::basic(offsetof(Block, floatingAction), keg::BasicType::I16));
    kt.addValue("occlusion", keg::Value::custom(offsetof(Block, occlude), "BlockOcclusion", true));
    kt.addValue("spawnID", keg::Value::basic(offsetof(Block, spawnerID), keg::BasicType::STRING));
    kt.addValue("sinkID", keg::Value::basic(offsetof(Block, sinkID), keg::BasicType::STRING));
    kt.addValue("explosionRays", keg::Value::basic(offsetof(Block, explosionRays), keg::BasicType::UI16));
    kt.addValue("meshType", keg::Value::custom(offsetof(Block, meshType), "MeshType", true));
    kt.addValue("moveMod", keg::Value::basic(offsetof(Block, moveMod), keg::BasicType::F32));
    kt.addValue("explosionResistance", keg::Value::basic(offsetof(Block, explosionResistance), keg::BasicType::F32));
    kt.addValue("explosionPower", keg::Value::basic(offsetof(Block, explosivePower), keg::BasicType::F32));
    kt.addValue("flammability", keg::Value::basic(offsetof(Block, flammability), keg::BasicType::F32));
    kt.addValue("explosionPowerLoss", keg::Value::basic(offsetof(Block, explosionPowerLoss), keg::BasicType::F32));
    kt.addValue("lightColorFilter", keg::Value::basic(offsetof(Block, colorFilter), keg::BasicType::F32_V3));
    kt.addValue("emitter", keg::Value::basic(offsetof(Block, emitterName), keg::BasicType::STRING));
    kt.addValue("movesPowder", keg::Value::basic(offsetof(Block, powderMove), keg::BasicType::BOOL));
    kt.addValue("collide", keg::Value::basic(offsetof(Block, collide), keg::BasicType::BOOL));
    kt.addValue("waterBreak", keg::Value::basic(offsetof(Block, waterBreak), keg::BasicType::BOOL));
    kt.addValue("scatterSunRays", keg::Value::basic(offsetof(Block, blockLight), keg::BasicType::BOOL));
    kt.addValue("useable", keg::Value::basic(offsetof(Block, useable), keg::BasicType::BOOL));
    kt.addValue("allowsLight", keg::Value::basic(offsetof(Block, allowLight), keg::BasicType::BOOL));
    kt.addValue("crushable", keg::Value::basic(offsetof(Block, isCrushable), keg::BasicType::BOOL));
    kt.addValue("supportive", keg::Value::basic(offsetof(Block, isSupportive), keg::BasicType::BOOL));
}

// TODO(Ben): LOL
Block::Block() : lightColor(0, 0, 0),
emitterName(""), 
emitterOnBreakName(""), 
emitterRandomName(""),
emitter(nullptr),
emitterOnBreak(nullptr),
emitterRandom(nullptr) {
    allowLight = false;
    ID = 0;
    name = particleTexName = "";
    memset(textures, 0, sizeof(textures));
    particleTex = 0;
    collide = true;
    occlude = BlockOcclusion::ALL;
    meshType = MeshType::BLOCK;
    waveEffect = 0;
    explosionResistance = 1.0;
    active = 0;
    useable = 1;
    blockLight = true;
    waterMeshLevel = 0;
    waterBreak = false;
    isCrushable = false;
    floatingAction = 1;
    flammability = 0.0f;
    isSupportive = true;
    explosivePower = 0.0;
    explosionPowerLoss = 0.0;
    explosionRays = 0;
    powderMove = true;
    moveMod = 1.0f;
    spawnerID = "";
    sinkID = "";
    colorFilter = f32v3(1.0f);
}


================================================
FILE: SoA/BlockData.h
================================================
#pragma once
#include "stdafx.h"

#include <SDL2/SDL.h>
#include <Vorb/io/Keg.h>
#include <Vorb/graphics/ImageIO.h>
#include <Vorb/voxel/VoxCommon.h>

#include "CAEngine.h"
#include "ChunkMesh.h"
#include "BlockTexture.h"
#include "Constants.h"
#include "Item.h"

#define GETFLAGS(a) ((a) >> 12)
#define GETFLAG1(a) (((a) & 0x8000) >> 15)
#define GETFLAG2(a) (((a) & 0x4000) >> 14)
#define GETFLAG3(a) (((a) & 0x2000) >> 13)
#define GETFLAG4(a) (((a) & 0x1000) >> 12)
#define GETBLOCKID(a) (((a) & 0x0FFF))
#define SETFLAGS(a, b) ((a) = ((a) | ((b) << 12)))

enum class BlockOcclusion {
    NONE,
    ALL,
    SELF,
    SELF_ONLY
};
KEG_ENUM_DECL(BlockOcclusion);

class BlockTextureFaces {
public:
    union {
        ui32 array[6]; /// Access 6-sided block textures as an array
        class {
        public:
            ui32 nx;  /// Negative x-axis texture
            ui32 px;  /// Positive x-axis texture
            ui32 ny;  /// Negative y-axis texture
            ui32 py;  /// Positive y-axis texture
            ui32 nz;  /// Negative z-axis texture
            ui32 pz;  /// Positive z-axis texture
        }; /// Textures named in cardinal convention
    };
    
    ui32& operator[] (const i32& i) {
        return array[i];
    }
    const ui32& operator[] (const i32& i) const {
        return array[i];
    }
};

typedef nString BlockIdentifier; ///< Unique identifier key for blocks

typedef ui16 BlockID;

class Block
{
public:
    Block();

    void SetAvgTexColors();

    i32 temp;

    BlockIdentifier sID;
    nString name;
    BlockID ID;
    nString burnTransformID;
    i16 waveEffect;
    ui16 lightColorPacked; /// 5 bit RGB light color packed into a ui16
    i16 waterMeshLevel;
    i16 floatingAction;
    nString spawnerID;
    nString sinkID;
    ui16 explosionRays;
    ui16 floraHeight = 0;
    ui16 liquidStartID = 0;
    ui16 liquidLevels = 0;

    BlockOcclusion occlude;

    MeshType meshType;

    GLfloat moveMod;
    GLfloat explosionResistance;
    GLfloat explosivePower;
    GLfloat flammability;
    GLfloat explosionPowerLoss;
    f32v3 colorFilter;

    int caIndex = -1;
    CAAlgorithm caAlg = CAAlgorithm::NONE;
    nString caFilePath = "";

    ColorRGB8 lightColor;
    ui8 particleTex;
    bool powderMove;
    bool collide;
    bool waterBreak;
    bool blockLight;
    bool useable;
    bool allowLight;
    bool isCrushable;
    bool isSupportive;
    bool active;

    union {
        struct {
            BlockTexture* textureLeft;
            BlockTexture* textureRight;
            BlockTexture* textureBottom;
            BlockTexture* textureTop;
            BlockTexture* textureBack;
            BlockTexture* textureFront;
        };
        BlockTexture* textures[6];
    };

    // TODO(Ben): NOPE
    //                      ... but why?
    nString particleTexName;
    nString emitterName, emitterOnBreakName, emitterRandomName;
    class ParticleEmitter *emitter, *emitterOnBreak, *emitterRandom;

    std::vector <ColorRGB8> altColors;
};
KEG_TYPE_DECL(Block);



================================================
FILE: SoA/BlockLoader.cpp
================================================
#include "stdafx.h"
#include "BlockLoader.h"

#include <Vorb/io/IOManager.h>
#include <Vorb/io/Keg.h>

#include "BlockPack.h"
#include "Chunk.h"
#include "Errors.h"
#include "GameManager.h"
#include "VoxelBits.h"

#define BLOCK_MAPPING_PATH "BlockMapping.ini"
#define BLOCK_DATA_PATH "BlockData.yml"
#define BINARY_CACHE_PATH "BlockCache.bin"

bool BlockLoader::loadBlocks(const vio::IOManager& iom, BlockPack* pack) {
    // Load existing mapping if there is one
    tryLoadMapping(iom, BLOCK_MAPPING_PATH, pack);

    // Check for binary cache
    vio::Path binPath;
    bool useCache = false;
    if (iom.resolvePath(BINARY_CACHE_PATH, binPath)) {
        vio::Path dataPath;
        if (!iom.resolvePath(BLOCK_DATA_PATH, dataPath)) return false;
        if (binPath.getLastModTime() >= dataPath.getLastModTime()) {
            useCache = true;
        }
    }
   
    // Clear CA physics cache
    CaPhysicsType::clearTypes();

    GameBlockPostProcess bpp(&iom, &CaPhysicsType::typesCache);
    pack->onBlockAddition += bpp.del;
    if (useCache) {
        if (!BlockLoader::loadBinary(iom, BINARY_CACHE_PATH, pack)) {
            printf("Failed to load binary cache %s\n", BINARY_CACHE_PATH);
            if (!BlockLoader::load(iom, BLOCK_DATA_PATH, pack)) {
                pack->onBlockAddition -= bpp.del;
                return false;
            }
        }
    } else {
        if (!BlockLoader::load(iom, BLOCK_DATA_PATH, pack)) {
            pack->onBlockAddition -= bpp.del;
            return false;
        }
    }
    pack->onBlockAddition -= bpp.del;

    saveMapping(iom, BLOCK_MAPPING_PATH, pack);
    if (!useCache) {
   //     saveBinary(iom, BINARY_CACHE_PATH, pack);
    }

    return true;
}

// Conditional keg write
#define COND_WRITE_KEG(key, var) if (b.var != d.var) { writer.push(keg::WriterParam::KEY) << nString(key); writer.push(keg::WriterParam::VALUE) << b.var; } 

bool BlockLoader::saveBlocks(const nString& filePath, BlockPack* pack) {
    // Open the portal to Hell
    std::ofstream file(filePath);
    if (file.fail()) return false;

    BlockPack& blocks = *pack;

    std::map<nString, const Block*> sortMap;
    const std::vector<Block>& blockList = blocks.getBlockList();
    for (size_t i = 0; i < blockList.size(); i++) {
        const Block& b = blockList[i];
        if (b.active) {
            sortMap[b.sID] = &b;
        }
    }
    // Default block
    Block d;
    // Emit data
    keg::YAMLWriter writer;
    writer.push(keg::WriterParam::BEGIN_MAP);
    for (auto& it : sortMap) {
        const Block& b = *it.second;

        // Write the block name first
        writer.push(keg::WriterParam::KEY) << b.sID;
        // Write the block data now
        writer.push(keg::WriterParam::VALUE);
        writer.push(keg::WriterParam::BEGIN_MAP);

        COND_WRITE_KEG("allowsLight", allowLight);
        COND_WRITE_KEG("collide", collide);
        COND_WRITE_KEG("crushable", isCrushable);
        COND_WRITE_KEG("explosionPower", explosivePower);
        COND_WRITE_KEG("explosionPowerLoss", explosionPowerLoss);
        COND_WRITE_KEG("explosionRays", explosionRays);
        COND_WRITE_KEG("explosionResistance", explosionResistance);
        COND_WRITE_KEG("flammability", flammability);
        COND_WRITE_KEG("floatingAction", floatingAction);
        if (b.colorFilter != d.colorFilter) { writer.push(keg::WriterParam::KEY) << nString("lightColorFilter"); writer.push(keg::WriterParam::VALUE) << keg::kegf32v3(b.colorFilter); }
        if (b.meshType != d.meshType) {
            writer.push(keg::WriterParam::KEY) << nString("meshType");
            switch (b.meshType) {
                case MeshType::NONE:
                    writer.push(keg::WriterParam::VALUE) << nString("none");
                    break;
                case MeshType::BLOCK:
                    writer.push(keg::WriterParam::VALUE) << nString("cube");
                    break;
                case MeshType::LEAVES:
                    writer.push(keg::WriterParam::VALUE) << nString("leaves");
                    break;
                case MeshType::TRIANGLE:
                    writer.push(keg::WriterParam::VALUE) << nString("triangle");
                    break;
                case MeshType::CROSSFLORA:
                    writer.push(keg::WriterParam::VALUE) << nString("cross");
                    break;
                case MeshType::LIQUID:
                    writer.push(keg::WriterParam::VALUE) << nString("liquid");
                    break;
                case MeshType::FLAT:
                    writer.push(keg::WriterParam::VALUE) << nString("flat");
                    break;
            }
        }
        COND_WRITE_KEG("moveMod", moveMod);
        COND_WRITE_KEG("name", name);
        switch (b.occlude) {
            case BlockOcclusion::NONE:
                writer.push(keg::WriterParam::KEY) << nString("occlusion");
                writer.push(keg::WriterParam::VALUE) << nString("none");
                break;
            case BlockOcclusion::ALL:
                writer.push(keg::WriterParam::KEY) << nString("occlusion");
                writer.push(keg::WriterParam::VALUE) << nString("all");
                break;
            case BlockOcclusion::SELF:
                writer.push(keg::WriterParam::KEY) << nString("occlusion");
                writer.push(keg::WriterParam::VALUE) << nString("self");
                break;
            case BlockOcclusion::SELF_ONLY:
                writer.push(keg::WriterParam::KEY) << nString("occlusion");
                writer.push(keg::WriterParam::VALUE) << nString("selfOnly");
                break;
        }
        COND_WRITE_KEG("sinkID", sinkID);
        COND_WRITE_KEG("spawnerID", spawnerID);
        COND_WRITE_KEG("supportive", isSupportive);
        COND_WRITE_KEG("waterBreak", waterBreak);

        //keg::write((ui8*)b, writer, keg::getGlobalEnvironment(), &KEG_GLOBAL_TYPE(Block));
        writer.push(keg::WriterParam::END_MAP);
        
    }
    writer.push(keg::WriterParam::END_MAP);

    file << writer.c_str();
    file.flush();
    file.close();
    return true;
}

bool BlockLoader::load(const vio::IOManager& iom, const cString filePath, BlockPack* pack) {
    // Read file
    nString data;
    iom.readFileToString(filePath, data);
    if (data.empty()) return false;

    // Convert to YAML
    keg::ReadContext context;
    context.env = keg::getGlobalEnvironment();
    context.reader.init(data.c_str());
    keg::Node node = context.reader.getFirst();
    if (keg::getType(node) != keg::NodeType::MAP) {
        context.reader.dispose();
        return false;
    }

    // Load all block nodes
    std::vector<Block> loadedBlocks;
    auto f = makeFunctor([&] (Sender, const nString& key, keg::Node value) {
        // Add a block
        loadedBlocks.emplace_back();
        Block& b = loadedBlocks.back();

        // Set sID to key
        b.sID = key;
        
        // Load data
        keg::parse((ui8*)&b, value, context, &KEG_GLOBAL_TYPE(Block));
    });
    context.reader.forAllInMap(node, &f);
    context.reader.dispose();

    // Add blocks to pack
    for (auto& b : loadedBlocks) {
        pack->append(b);
    }

    return true;
}


GameBlockPostProcess::GameBlockPostProcess(const vio::IOManager* iom, CaPhysicsTypeDict* caCache) :
    m_iom(iom),
    m_caCache(caCache) {
    del = makeDelegate(this, &GameBlockPostProcess::invoke);
}

void GameBlockPostProcess::invoke(Sender s, ui16 id) {
    Block& block = ((BlockPack*)s)->operator[](id);
    block.active = true;

    // Pack light color
    block.lightColorPacked =
        ((ui16)block.lightColor.r << LAMP_RED_SHIFT) |
        ((ui16)block.lightColor.g << LAMP_GREEN_SHIFT) |
        (ui16)block.lightColor.b;

    // Ca Physics
    if (block.caFilePath.length()) {
        // Check if this physics type was already loaded
        auto it = m_caCache->find(block.caFilePath);
        if (it == m_caCache->end()) {
            // TODO(Ben): Why new?
            // TODO(Ben): This isn't getting stored...
            CaPhysicsType* newType = new CaPhysicsType();
            // Load in the data
            if (newType->loadFromYml(block.caFilePath, m_iom)) {
                block.caIndex = newType->getCaIndex();
                block.caAlg = newType->getCaAlg();
            } else {
                delete newType;
            }
        } else {
            block.caIndex = it->second->getCaIndex();
            block.caAlg = it->second->getCaAlg();
        }
    }
}

bool BlockLoader::saveMapping(const vio::IOManager& iom, const cString filePath, BlockPack* pack) {    
    vio::FileStream fs = iom.openFile(filePath, vio::FileOpenFlags::WRITE_ONLY_CREATE);
    if (!fs.isOpened()) pError("Failed to open block mapping file for save");

    for (auto& b : pack->getBlockMap()) {
        fs.write("%s: %d\n", b.first.c_str(), b.second);
    }
    return true;
}

bool BlockLoader::tryLoadMapping(const vio::IOManager& iom, const cString filePath, BlockPack* pack) {
    vio::Path path;
    if (!iom.resolvePath(filePath, path)) return false;

    std::ifstream file(path.getCString());
    if (file.fail()) return false;

    // TODO(Ben): Handle comments
    nString token;
    BlockID id;
    while (std::getline(file, token, ':')) {
        // Read the id
        file >> id;
        pack->reserveID(token, id);
        // Get the newline
        char nl;
        file.get(nl);
    }
    return true;
}

bool BlockLoader::saveBinary(const vio::IOManager& iom, const cString filePath, BlockPack* pack) {
    vio::FileStream fs = iom.openFile(filePath, vio::FileOpenFlags::WRITE_ONLY_CREATE | vio::FileOpenFlags::BINARY);
    if (!fs.isOpened()) return false;

    ui32 size = pack->getBlockMap().size();
    ui32 blockSize = sizeof(Block);
    // Write sizes
    fs.write(1, sizeof(ui32), &size);
    fs.write(1, sizeof(ui32), &blockSize);

    // TODO(Ben): This isn't complete.
    const std::vector<Block>& blockList = pack->getBlockList();
    for (auto& b : pack->getBlockMap()) {
        const Block& block = blockList[b.second];
        fs.write("%s", block.name.c_str()); fs.write(1, 1, "\0");
        fs.write(1, sizeof(bool), &block.powderMove);
        fs.write(1, sizeof(bool), &block.collide);
        fs.write(1, sizeof(bool), &block.waterBreak);
        fs.write(1, sizeof(bool), &block.blockLight);
        fs.write(1, sizeof(bool), &block.useable);
        fs.write(1, sizeof(bool), &block.allowLight);
        fs.write(1, sizeof(bool), &block.isCrushable);
        fs.write(1, sizeof(bool), &block.isSupportive);
    }
    return true;
}

void readStr(vio::FileStream& fs, char* buf) {
    int i = 0;
    do {
        fs.read(1, sizeof(char), buf + i);
    } while (buf[i++] != 0);
}

bool BlockLoader::loadBinary(const vio::IOManager& iom, const cString filePath, BlockPack* pack) {
    vio::FileStream fs = iom.openFile(filePath, vio::FileOpenFlags::READ_ONLY_EXISTING | vio::FileOpenFlags::BINARY);
    if (!fs.isOpened()) return false;

    ui32 size;
    ui32 blockSize;
    // Read sizes
    fs.read(1, sizeof(ui32), &size);
    fs.read(1, sizeof(ui32), &blockSize);
    // Make sure block size didn't change. DEBUG MODE CHANGES THE SIZE!!!
    //if (blockSize != sizeof(Block)) return false;

    char buf[512];

    // TODO(Ben): This isn't complete.
    for (ui32 i = 0; i < size; i++) {
        Block b;
        readStr(fs, buf);
        b.name = buf;
        fs.read(1, sizeof(bool), &b.powderMove);
        fs.read(1, sizeof(bool), &b.collide);
        fs.read(1, sizeof(bool), &b.waterBreak);
        fs.read(1, sizeof(bool), &b.blockLight);
        fs.read(1, sizeof(bool), &b.useable);
        fs.read(1, sizeof(bool), &b.allowLight);
        fs.read(1, sizeof(bool), &b.isCrushable);
        fs.read(1, sizeof(bool), &b.isSupportive);
        pack->append(b);
    }
    return true;
}

================================================
FILE: SoA/BlockLoader.h
================================================
#pragma once

#include <Vorb/Event.hpp>
#include <Vorb/VorbPreDecl.inl>

#include "BlockData.h"
#include "CAEngine.h"

DECL_VIO(class IOManager)

class BlockPack;
class TexturePackLoader;

class GameBlockPostProcess {
public:
    GameBlockPostProcess(const vio::IOManager* iom, CaPhysicsTypeDict* caCache);

    void invoke(Sender s, ui16 id);

    Delegate<void, Sender, ui16> del;
private:
    const vio::IOManager* m_iom; ///< IO workspace
    CaPhysicsTypeDict* m_caCache; ///< CA type cache
};

class BlockLoader
{
public:
    /// Loads blocks from a .yml file
    /// @return true on success, false on failure
    static bool loadBlocks(const vio::IOManager& iom, BlockPack* pack);

    /// Loads blocks from a .yml file
    /// @param iom: IO workspace
    /// @param filePath: The .yml file path
    /// @param pack: Depository for all loaded blocks
    /// @return true on success, false on failure
    static bool load(const vio::IOManager& iom, const cString filePath, BlockPack* pack);

    /// Saves blocks to a .yml file
    /// @param filePath: The .yml file path
    /// @param pack: Source of block data
    /// @return true on success, false on failure
    static bool saveBlocks(const nString& filePath, BlockPack* pack);
private:
    /// Sets up the water blocks. This is temporary
    /// @param blocks: Output list for blocks
    static void SetWaterBlocks(std::vector<Block>& blocks);

    /// Saves the block mapping scheme
    static bool saveMapping(const vio::IOManager& iom, const cString filePath, BlockPack* pack);

    /// Tries to load an existing block mapping scheme
    static bool tryLoadMapping(const vio::IOManager& iom, const cString filePath, BlockPack* pack);

    /// Caches blocks in binary
    static bool saveBinary(const vio::IOManager& iom, const cString filePath, BlockPack* pack);

    /// Tries to load an existing block mapping scheme
    static bool loadBinary(const vio::IOManager& iom, const cString filePath, BlockPack* pack);
};



================================================
FILE: SoA/BlockPack.cpp
================================================
#include "stdafx.h"
#include "BlockPack.h"

BlockPack::BlockPack() :
    onBlockAddition(this) {
    
    { // Create "None" block
        Block b;
        b.sID = "none";
        b.name = "None";
        b.allowLight = true;
        b.collide = false;
        b.floatingAction = 0;
        b.meshType = MeshType::NONE;
        b.occlude = BlockOcclusion::NONE;
        b.isSupportive = false;
        b.blockLight = false;
        b.useable = true;
        append(b);
    }
    { // Create "Unknown" block
        Block b;
        b.sID = "Unknown";
        b.name = "Unknown";
        append(b);
    }
}

BlockID BlockPack::append(Block& block) {
    const Block* curBlock;
    BlockID rv;
    if ((curBlock = hasBlock(block.sID))) {
        rv = curBlock->ID;
        block.ID = rv;
        // Overwrite block
        *const_cast<Block*>(curBlock) = block;
    } else {
        rv = m_blockList.size();
        block.ID = rv;
        // Add a new block
        m_blockList.push_back(block);
        // Set the correct index
        m_blockMap[block.sID] = rv;
    }
    onBlockAddition(block.ID);
    return rv;
}

void BlockPack::reserveID(const BlockIdentifier& sid, const BlockID& id) {
    if (id >= m_blockList.size()) m_blockList.resize(id + 1);
    m_blockMap[sid] = id;
    m_blockList[id].ID = id;
}


================================================
FILE: SoA/BlockPack.h
================================================
///
/// BlockPack.h
/// Seed of Andromeda
///
/// Created by Cristian Zaloj on 23 Dec 2014
/// Copyright 2014 Regrowth Studios
/// MIT License
///
/// Summary:
/// Container for block data
///

#pragma once

#ifndef BlockPack_h__
#define BlockPack_h__

#include <Vorb/Event.hpp>
#include <Vorb/graphics/Texture.h>

#include "BlockData.h"

/// A container for blocks
class BlockPack {
public:
    /// Constructor which adds default none and unknown blocks
    BlockPack();

    /// Add a block to the pack, and overwrite a block of the same BlockIdentifier
    /// Will invalidate existing Block* pointers. Store BlockIDs instead.
    BlockID append(Block& block);

    void reserveID(const BlockIdentifier& sid, const BlockID& id);

    /// Note that the returned pointer becomes invalidated after an append call
    /// @return nullptr if block doesn't exist
    const Block* hasBlock(const BlockID& id) const {
        if (id >= m_blockList.size()) {
            return nullptr;
        } else {
            return &m_blockList[id];
        }
    }
    const Block* hasBlock(const BlockIdentifier& sid) const {
        auto v = m_blockMap.find(sid);
        if (v == m_blockMap.end()) {
            return nullptr;
        } else {
            return &m_blockList[v->second];
        }
    }

    /// @return Number of blocks in this pack
    size_t size() const {
        return m_blockList.size();
    }

    /************************************************************************/
    /* Block accessors                                                      */
    /************************************************************************/
    Block& operator[](const size_t& index) {
        return m_blockList[index];
    }
    const Block& operator[](const size_t& index) const {
        return m_blockList[index];
    }
    Block& operator[](const BlockIdentifier& sid) {
        return m_blockList[m_blockMap.at(sid)];
    }
    const Block& operator[](const BlockIdentifier& sid) const {
        return m_blockList[m_blockMap.at(sid)];
    }
    const ui16& getBlockIndex(const BlockIdentifier& sid) const {
        return m_blockMap.at(sid);
    }

    const std::unordered_map<BlockIdentifier, ui16>& getBlockMap() const { return m_blockMap; }
    const std::vector<Block>& getBlockList() const { return m_blockList; }

    Event<ui16> onBlockAddition; ///< Signaled when a block is loaded
private:
    std::unordered_map<BlockIdentifier, ui16> m_blockMap; ///< Blocks indices organized by identifiers
    std::vector<Block> m_blockList; ///< Block data list
};

#endif // BlockPack_h__


================================================
FILE: SoA/BlockTexture.cpp
================================================
#include "stdafx.h"
#include "BlockTexture.h"

#include "BlockTexturePack.h"

KEG_ENUM_DEF(ConnectedTextureReducedMethod, ConnectedTextureReducedMethod, e) {
    e.addValue("none", ConnectedTextureReducedMethod::NONE);
    e.addValue("top", ConnectedTextureReducedMethod::TOP);
    e.addValue("bottom", ConnectedTextureReducedMethod::BOTTOM);
}
KEG_ENUM_DEF(BlendType, BlendType, e) {
    e.addValue("add", BlendType::ADD);
    e.addValue("multiply", BlendType::MULTIPLY);
    e.addValue("replace", BlendType::ALPHA);
    e.addValue("subtract", BlendType::SUBTRACT);
}

KEG_ENUM_DEF(ConnectedTextureMethods, ConnectedTextureMethods, e) {
    e.addValue("none", ConnectedTextureMethods::NONE);
    e.addValue("connect", ConnectedTextureMethods::CONNECTED);
    e.addValue("random", ConnectedTextureMethods::RANDOM);
    e.addValue("repeat", ConnectedTextureMethods::REPEAT);
    e.addValue("grass", ConnectedTextureMethods::GRASS);
    e.addValue("horizontal", ConnectedTextureMethods::HORIZONTAL);
    e.addValue("vertical", ConnectedTextureMethods::VERTICAL);
    e.addValue("flora", ConnectedTextureMethods::FLORA);
}
KEG_ENUM_DEF(ConnectedTextureSymmetry, ConnectedTextureSymmetry, e) {
    e.addValue("none", ConnectedTextureSymmetry::NONE);
    e.addValue("opposite", ConnectedTextureSymmetry::OPPOSITE);
    e.addValue("all", ConnectedTextureSymmetry::ALL);
}

KEG_TYPE_DEF_SAME_NAME(BlockTexture, kt) {
    kt.addValue("base", keg::Value::custom(offsetOf(BlockTexture, layers.base), "BlockTextureLayer"));
    kt.addValue("overlay", keg::Value::custom(offsetOf(BlockTexture, layers.overlay), "BlockTextureLayer"));
    kt.addValue("blendMode", keg::Value::custom(offsetOf(BlockTexture, blendMode), "BlendType", true));
}

/// "less than" operator for inserting into sets in TexturePackLoader
bool BlockTextureLayer::operator<(const BlockTextureLayer& b) const {

    // Helper macro for checking if !=
#define LCHECK(a) if (a < b.a) { return true; } else if (a > b.a) { return false; }
    LCHECK(path);
    LCHECK(method);
    LCHECK(size.x);
    LCHECK(size.y);
    LCHECK(symmetry);
    LCHECK(color.r);
    LCHECK(color.g);
    LCHECK(color.b);
    LCHECK(reducedMethod);
    LCHECK(weights.size());
    LCHECK(totalWeight);
    LCHECK(numTiles);
    LCHECK(innerSeams);
    LCHECK(transparency);
    return false;
}

void BlockTextureLayer::getFinalColor(OUT color3& resColor, ui8 temperature, ui8 rainfall, ui32 altColor VORB_UNUSED) const {
    // TODO(Ben): Alternate colors
    if (colorMap) {
        // TODO(Ben): Store as floats to prevent cast overhead?
        const color3& mapColor = colorMap->pixels[rainfall][temperature];
        //Average the map color with the base color
        resColor.r = (ui8)(((f32)color.r * (f32)mapColor.r) / 255.0f);
        resColor.g = (ui8)(((f32)color.g * (f32)mapColor.g) / 255.0f);
        resColor.b = (ui8)(((f32)color.b * (f32)mapColor.b) / 255.0f);
    } /*else if (altColor > altColors.size()) { //alt colors, for leaves and such
        baseColor = altColors[flags - 1];
    } */else {
        resColor = color;
    }
}

================================================
FILE: SoA/BlockTexture.h
================================================
///
/// BlockTexture.h
/// Seed of Andromeda
///
/// Created by Benjamin Arnold on 16 Jun 2015
/// Copyright 2014 Regrowth Studios
/// MIT License
///
/// Summary:
/// Texture information for blocks
///

#pragma once

#ifndef BlockTexture_h__
#define BlockTexture_h__

#include <Vorb/io/Keg.h>

#include "BlockTextureMethods.h"

#define BASE_TYPE_INDEX 0
#define NORM_TYPE_INDEX 1
#define DISP_TYPE_INDEX 2

struct BlockColorMap;

enum class ConnectedTextureMethods {
    NONE,
    CONNECTED,
    HORIZONTAL,
    VERTICAL,
    GRASS,
    REPEAT,
    RANDOM,
    FLORA
};
KEG_ENUM_DECL(ConnectedTextureMethods);

enum class ConnectedTextureSymmetry {
    NONE,
    OPPOSITE,
    ALL
};
KEG_ENUM_DECL(ConnectedTextureSymmetry);

enum class ConnectedTextureReducedMethod {
    NONE,
    TOP,
    BOTTOM
};
KEG_ENUM_DECL(ConnectedTextureReducedMethod);

enum class BlendType {
    ALPHA,
    ADD,
    SUBTRACT,
    MULTIPLY
};
KEG_ENUM_DECL(BlendType);

class BlockTextureLayer {
public:
    BlockTextureLayer() : method(ConnectedTextureMethods::NONE), size(1), symmetry(ConnectedTextureSymmetry::NONE),
    reducedMethod(ConnectedTextureReducedMethod::NONE), colorMap(nullptr), averageColor(255, 255, 255), color(255, 255, 255),
    floraHeight(0), totalWeight(0), numTiles(1), indices{0, 0, 0},  innerSeams(false), transparency(false), path(""), normalPath(""),
    dispPath(""), colorMapPath(""), blockTextureFunc(BlockTextureMethods::getDefaultTextureIndex)
        {}

    static ui32 getFloraRows(ui32 floraMaxHeight) {
        return (floraMaxHeight * floraMaxHeight + floraMaxHeight) / 2;
    }

    // Sets the texture func based on the method
    // needs to have the method
    void initBlockTextureFunc() {
        switch (method) {
            case ConnectedTextureMethods::CONNECTED:
                blockTextureFunc = BlockTextureMethods::getConnectedTextureIndex;
                break;
            case ConnectedTextureMethods::RANDOM:
                blockTextureFunc = BlockTextureMethods::getRandomTextureIndex;
                break;
            case ConnectedTextureMethods::GRASS:
                blockTextureFunc = BlockTextureMethods::getGrassTextureIndex;
                break;
            case ConnectedTextureMethods::HORIZONTAL:
                blockTextureFunc = BlockTextureMethods::getHorizontalTextureIndex;
                break;
            case ConnectedTextureMethods::VERTICAL:
                blockTextureFunc = BlockTextureMethods::getVerticalTextureIndex;
                break;
            case ConnectedTextureMethods::FLORA:
                blockTextureFunc = BlockTextureMethods::getFloraTextureIndex;
                break;
            default:
                break;
        }
    }

    // TODO(Ben): should it be ref color?
    inline void getBlockTextureMethodData(BlockTextureMethodParams& params, OUT color3& color, OUT BlockTextureMethodData& data) const {
        data.index = this->index.layer;
        getTextureMethodData(params, BASE_TYPE_INDEX, color, data);
    }
    inline void getNormalTextureMethodData(BlockTextureMethodParams& params, OUT color3& color, OUT BlockTextureMethodData& data) const {
        data.index = this->index.normal;
        return getTextureMethodData(params, NORM_TYPE_INDEX, color, data);
    }
    inline void getDispTextureMethodData(BlockTextureMethodParams& params, OUT color3& color, OUT  BlockTextureMethodData& data) const {
        data.index = this->index.disp;
        return getTextureMethodData(params, DISP_TYPE_INDEX, color, data);
    }
    inline void getTextureMethodData(BlockTextureMethodParams& params, ui32 typeIndex, OUT color3& color, BlockTextureMethodData& data) const {
        params.set(this, typeIndex, color);
        blockTextureFunc(params, data);
    }

    void getFinalColor(OUT color3& color, ui8 temperature, ui8 rainfall, ui32 altColor) const;

    ConnectedTextureMethods method;
    ui8v2 size;
    ConnectedTextureSymmetry symmetry;
    ConnectedTextureReducedMethod reducedMethod;
    BlockColorMap* colorMap;
    color3 averageColor; // Average texture color combined with color (for terrain)
    color3 color;
    ui32 floraHeight;
    Array<i32> weights;
    ui32 totalWeight;
    ui32 numTiles;
    union {
        struct {
            BlockTextureIndex layer;
            BlockTextureIndex normal;
            BlockTextureIndex disp;
        } index;
        BlockTextureIndex indices[3];
    };
    bool innerSeams;
    bool transparency;
    nString path;
    nString normalPath;
    nString dispPath;
    nString colorMapPath;
    BlockTextureFunc blockTextureFunc;

    /// "less than" operator for inserting into sets in TexturePackLoader
    // TODO(Ben): Are these operators needed?
    bool operator<(const BlockTextureLayer& b) const;
    bool operator==(const BlockTextureLayer& b) const {
        return method == b.method && size == b.size && symmetry == b.symmetry &&
            reducedMethod == b.reducedMethod && colorMap == b.colorMap &&
            color == b.color && 
            averageColor == b.averageColor && floraHeight == b.floraHeight &&
            totalWeight == b.totalWeight && numTiles == b.numTiles && index.layer == b.index.layer &&
            innerSeams == b.innerSeams && transparency == b.transparency && path == b.path;
    }
};

struct BlockTexture {
    BlockTexture(): layers(), blendMode(BlendType::ALPHA)
    {
    }
    //provide deconstructor because of union
    ~BlockTexture()
    {
        layers.base.BlockTextureLayer::~BlockTextureLayer();
        layers.overlay.BlockTextureLayer::~BlockTextureLayer();
    }
    
    struct {
        BlockTextureLayer base;
        BlockTextureLayer overlay;
    } layers;
    BlendType blendMode;
};
KEG_TYPE_DECL(BlockTexture);

#endif // BlockTexture_h__


================================================
FILE: SoA/BlockTextureAtlas.h
================================================
#pragma once

// Number Of Tiles Per Side Of The Block Texture Atlas
const i32 BLOCK_TEXTURE_ATLAS_TILES_PER_SIDE = 16;
const i32 BLOCK_TEXTURE_ATLAS_TILES_PER_PAGE = BLOCK_TEXTURE_ATLAS_TILES_PER_SIDE * BLOCK_TEXTURE_ATLAS_TILES_PER_SIDE;

class BlockTextureIndex {
public:
    BlockTextureIndex(ui16 blockID, i32 tileWidth, i32 tileHeight);
    BlockTextureIndex() : BlockTextureIndex(0, 0, 0) {}

    void setIndex(const i32& x, const i32& y) {
        atlasUVRect[0] = (ui8)((x << 4) | y);
    }
    void setPage(const i32& page) {
        atlasUVRect[1] = (ui8)page;
    }
    void setSize(const i32& x, const i32& y) {
        atlasUVRect[2] = (ui8)((x << 4) | y);
    }

    // The Location And Size In The Atlas
    ui8 atlasUVRect[3];

    // Texturing Method
    ui8 textureMethod;
};

class BlockAtlasPage;

class BlockTextureAtlas {
public:
    BlockTextureAtlas(i32 tileResolution);

    void addTextures(std::vector<BlockTextureIndex>& textures);
private:
    i32v3 _atlasDimensions;
    i32 _resolution;

    std::vector<BlockAtlasPage*> _atlasPages;
    std::vector<BlockTextureIndex*> _sortedOrderTiles;
};

================================================
FILE: SoA/BlockTextureLoader.cpp
================================================
#include "stdafx.h"
#include "BlockTextureLoader.h"
#include "ModPathResolver.h"
#include "BlockTexturePack.h"
#include "BlockData.h"
#include "Errors.h"

#include <Vorb/graphics/ImageIO.h>

// Used for error checking
#define CONNECTED_WIDTH 12
#define CONNECTED_HEIGHT 4
#define GRASS_WIDTH 3
#define GRASS_HEIGHT 3
#define HORIZONTAL_WIDTH 4
#define HORIZONTAL_HEIGHT 1

void BlockTextureLoader::init(ModPathResolver* texturePathResolver, BlockTexturePack* texturePack) {
    m_texturePathResolver = texturePathResolver;
    m_texturePack = texturePack;
}

void BlockTextureLoader::loadTextureData() {
    if (!loadLayerProperties()) pError("Failed to load LayerProperties.yml");
    if (!loadTextureProperties()) pError("Failed to load Textures.yml");
    if (!loadBlockTextureMapping()) pError("Failed to load BlockTextureMapping.yml");
}

void BlockTextureLoader::loadBlockTextures(Block& block) {
    // Check for block mapping
    auto it = m_blockMappings.find(block.sID);
    if (it == m_blockMappings.end()) {
        printf("Warning: Could not load texture mapping for block %s\n", block.sID.c_str());
        for (int i = 0; i < 6; i++) {
            block.textures[i] = m_texturePack->getDefaultTexture();
        }
        return;
    }

    // Load the textures for each face
    BlockTextureNames& names = it->second;
    for (int i = 0; i < 6; i++) {
        BlockTexture* texture = m_texturePack->findTexture(names.names[i]);
        if (texture) {
            loadLayer(texture->layers.base);
            if (texture->layers.overlay.path.size()) {
                loadLayer(texture->layers.overlay);
            }
            block.textures[i] = texture;
        } else {
            block.textures[i] = m_texturePack->getDefaultTexture();
            return;
        }
    }
   
    // TODO(Ben): NOPE
    /* BlockTexture particleTexture;
     GameManager::texturePackLoader->getBlockTexture(particleTexName, particleTexture);
     particleTex = particleTexture.base.index;*/

    // Calculate flora height
    // TODO(Ben): This is dubious
    if (block.textures[0]->layers.base.method == ConnectedTextureMethods::FLORA) {
        // Just a bit of algebra to solve for n with the equation y = (n^2 + n) / 2
        // which becomes n = (sqrt(8 * y + 1) - 1) / 2
        int y = block.textures[0]->layers.base.size.y;
        block.floraHeight = (ui16)(sqrt(8 * y + 1) - 1) / 2;
    }
}

bool BlockTextureLoader::loadLayerProperties() {
    vio::Path path;
    if (!m_texturePathResolver->resolvePath("LayerProperties.yml", path)) return false;

    // Read file
    nString data;
    m_iom.readFileToString(path, data);
    if (data.empty()) return false;

    // Convert to YAML
    keg::ReadContext context;
    context.env = keg::getGlobalEnvironment();
    context.reader.init(data.c_str());
    keg::Node node = context.reader.getFirst();
    if (keg::getType(node) != keg::NodeType::MAP) {
        context.reader.dispose();
        return false;
    }

    // Layer handle for lf
    BlockTextureLayer* lp;
    // Custom values for parsing
    keg::Value colorVal = keg::Value::basic(0, keg::BasicType::UI8_V3);
    keg::Value methodVal = keg::Value::custom(0, "ConnectedTextureMethods", true);
 
    // Custom layer parse
    auto lf = makeFunctor([&, this](Sender, const nString& key, keg::Node value) {
        if (key == "path") {
            lp->path = keg::convert<nString>(value);
        } else if (key == "normalMap") {
            lp->normalPath = keg::convert<nString>(value);
        } else if (key == "dispMap") {
            lp->dispPath = keg::convert<nString>(value);
        } else if (key == "color") {
            switch (keg::getType(value)) {
                case keg::NodeType::VALUE:
                    lp->colorMapPath = keg::convert<nString>(value);
                    lp->colorMap = this->getTexturePack()->getColorMap(lp->colorMapPath);
                    break;
                case keg::NodeType::SEQUENCE:
                    keg::evalData((ui8*)&lp->color, &colorVal, value, context);
                    break;
                default:
                    break;
            }
        } else if (key == "altColors") {
            // TODO(Ben): Implement
        } else if (key == "method") {
            keg::evalData((ui8*)&lp->method, &methodVal, value, context);
        } else if (key == "coupling") {
            // TODO(Ben): Implement
        }
    });
    // Load all layers
    auto f = makeFunctor([&](Sender, const nString& key, keg::Node value) {
        BlockTextureLayer layer;
        lp = &layer;

        // Manual parse
        context.reader.forAllInMap(value, &lf);

        // Cache the layer
        m_layers[key] = layer;
    });
    context.reader.forAllInMap(node, &f);
    context.reader.dispose();

    return true;
}

// For parsing a block texture
#define TEXTURE_PARSE_CODE \
if (key == "base") { \
    if (keg::getType(value) == keg::NodeType::MAP) { \
    } else { \
        nString base = keg::convert<nString>(value); \
       auto& it = m_layers.find(base); \
       if (it != m_layers.end()) { \
            texture->base = it->second; \
       } \
    } \
} else if (key == "overlay") { \
    if (keg::getType(value) == keg::NodeType::MAP) { \
    } else { \
      nString overlay = keg::convert<nString>(value); \
      auto& it = m_layers.find(overlay); \
        if (it != m_layers.end()) { \
            texture->overlay = it->second; \
        } \
    } \
} else if (key == "blendMode") { \
    nString v = keg::convert<nString>(value); \
    if (v == "add") { \
        texture->blendMode = BlendType::ADD; \
    } else if (v == "multiply") { \
    texture->blendMode = BlendType::MULTIPLY; \
    } else if (v == "subtract") { \
    texture->blendMode = BlendType::SUBTRACT; \
    } \
} \

bool BlockTextureLoader::loadTextureProperties() {
    vio::Path path;
    if (!m_texturePathResolver->resolvePath("Textures.yml", path)) return false;

    // Read file
    nString data;
    m_iom.readFileToString(path, data);
    if (data.empty()) return false;

    // Convert to YAML
    keg::ReadContext context;
    context.env = keg::getGlobalEnvironment();
    context.reader.init(data.c_str());
    keg::Node node = context.reader.getFirst();
    if (keg::getType(node) != keg::NodeType::MAP) {
        context.reader.dispose();
        return false;
    }

    BlockTexture* texture;
    auto valf = makeFunctor([&](Sender, const nString& key, keg::Node value) {
//        TEXTURE_PARSE_CODE;
        if(key=="base")
        {
            if(keg::getType(value)==keg::NodeType::MAP)
            {
            }
            else
            {
                nString base=keg::convert<nString>(value);
                auto it=m_layers.find(base);
                if(it!=m_layers.end())
                {
                    texture->layers.base = it->second;
                }
            }
        }
        else if(key=="overlay")
        {
            if(keg::getType(value)==keg::NodeType::MAP)
            {
            }
            else
            {
                nString overlay=keg::convert<nString>(value);
                auto it=m_layers.find(overlay);
                if(it!=m_layers.end())
                {

                    texture->layers.overlay = it->second;
                }
            }
        }
        else if(key=="blendMode")
        {
            nString v=keg::convert<nString>(value);
            if(v=="add")
            {
                texture->blendMode=BlendType::ADD;
            }
            else if(v=="multiply")
            {
                texture->blendMode=BlendType::MULTIPLY;
            }
            else if(v=="subtract")
            {
                texture->blendMode=BlendType::SUBTRACT;
            }
        }
    });

    // Load all layers
    auto f = makeFunctor([&](Sender, const nString& key, keg::Node value) {
        texture = m_texturePack->getNextFreeTexture(key);
        context.reader.forAllInMap(value, &valf);
    });
    context.reader.forAllInMap(node, &f);
    context.reader.dispose();

    return true;
}

bool BlockTextureLoader::loadBlockTextureMapping() {

    vio::Path path;
    if (!m_texturePathResolver->resolvePath("BlockTextureMapping.yml", path)) return false;

    // Read file
    nString data;
    const nString* blockName;
    BlockTexture* texture;
    m_iom.readFileToString(path, data);
    if (data.empty()) return false;

    // Convert to YAML
    keg::ReadContext context;
    context.env = keg::getGlobalEnvironment();
    context.reader.init(data.c_str());
    keg::Node node = context.reader.getFirst();
    if (keg::getType(node) != keg::NodeType::MAP) {
        context.reader.dispose();
        return false;
    }

    // For parsing textures
    auto texParseFunctor = makeFunctor([&](Sender, const nString& key, keg::Node value) {
        if (key == "base") {
            if (keg::getType(value) == keg::NodeType::MAP) {

            } else {

                nString base = keg::convert<nString>(value);
                auto it = m_layers.find(base);
                if (it != m_layers.end()) {
                    texture->layers.base = it->second;
                }
            }
        } else if (key == "overlay") {
            if (keg::getType(value) == keg::NodeType::MAP) {

            } else {
                nString overlay = keg::convert<nString>(value);
                auto it = m_layers.find(overlay);
                if (it != m_layers.end()) {

                    texture->layers.overlay = it->second;
                }
            }
        } else if (key == "blendMode") {
            nString v = keg::convert<nString>(value);
            if (v == "add") {
                texture->blendMode = BlendType::ADD;
            } else if (v == "multiply") {
                texture->blendMode = BlendType::MULTIPLY;
            } else if (v == "subtract") {
                texture->blendMode = BlendType::SUBTRACT;
            }
        }
    });

    nString *texNames;

    auto valParseFunctor = makeFunctor([&](Sender, const nString& key, keg::Node value) {
        nString name;
        // Conditional parsing, map vs value
        if (keg::getType(value) == keg::NodeType::MAP) {
            name = *blockName + std::to_string(m_generatedTextureCounter++);
            texture = m_texturePack->getNextFreeTexture(name);
            context.reader.forAllInMap(value, &texParseFunctor);
        } else {
            name = keg::convert<nString>(value);
        }

        if (key == "texture") {
            texNames[0] = name;
        } else if (key == "textureOpX") {
            texNames[1] = name;
        } else if (key == "textureOpY") {
            texNames[2] = name;
        } else if (key == "textureOpZ") {
            texNames[3] = name;
        } else if (key == "textureTop") {
            texNames[4] = name;
        } else if (key == "textureBottom") {
            texNames[5] = name;
        } else if (key == "textureFront") {
            texNames[6] = name;
        } else if (key == "textureBack") {
            texNames[7] = name;
        } else if (key == "textureLeft") {
            texNames[8] = name;
        } else if (key == "textureRight") {
            texNames[9] = name;
        }
    });

    // Load all layers
    auto f = makeFunctor([&](Sender, const nString& key, keg::Node value) {
        BlockTextureNames tNames = {};
        // So we can prioritize.
        nString textureNames[10];
        texNames = textureNames;

        blockName = &key;
        context.reader.forAllInMap(value, &valParseFunctor);

        // Set textures based on names
        if (texNames[0].size()) {
            for (int i = 0; i < 6; i++) {
                tNames.names[i] = texNames[0];
            }
        }
        if (texNames[1].size()) {
            tNames.names[(int)vvox::Cardinal::X_NEG] = texNames[1];
            tNames.names[(int)vvox::Cardinal::X_POS] = texNames[1];
        }
        if (texNames[2].size()) {
            tNames.names[(int)vvox::Cardinal::Y_NEG] = texNames[2];
            tNames.names[(int)vvox::Cardinal::Y_POS] = texNames[2];
        }
        if (texNames[3].size()) {
            tNames.names[(int)vvox::Cardinal::Z_NEG] = texNames[3];
            tNames.names[(int)vvox::Cardinal::Z_POS] = texNames[3];
        }
        if (texNames[4].size()) {
            tNames.names[(int)vvox::Cardinal::Y_POS] = texNames[4];
        }
        if (texNames[5].size()) {
            tNames.names[(int)vvox::Cardinal::Y_NEG] = texNames[5];
        }
        if (texNames[6].size()) {
            tNames.names[(int)vvox::Cardinal::Z_POS] = texNames[6];
        }
        if (texNames[7].size()) {
            tNames.names[(int)vvox::Cardinal::Z_NEG] = texNames[7];
        }
        if (texNames[8].size()) {
            tNames.names[(int)vvox::Cardinal::X_NEG] = texNames[8];
        }
        if (texNames[9].size()) {
            tNames.names[(int)vvox::Cardinal::X_POS] = texNames[9];
        }

        // Set mappings
        m_blockMappings[key] = tNames;
    });
    context.reader.forAllInMap(node, &f);
    context.reader.dispose();

    return true;
}

bool BlockTextureLoader::loadLayer(BlockTextureLayer& layer) {
    AtlasTextureDescription desc = m_texturePack->findLayer(layer.path);
    // Check if its already been loaded
    if (desc.size.x != 0) {
        // Already loaded so just use the desc
        // TODO(Ben): Worry about different methods using same file?
        layer.size = desc.size;
        layer.index.layer = desc.index;
    } else {
        vio::Path path;
        if (!m_texturePathResolver->resolvePath(layer.path, path)) return false;
        { // Get pixels for the base texture
            vg::ScopedBitmapResource rs(vg::ImageIO().load(path, vg::ImageIOFormat::RGBA_UI8));
            // Do post processing on the layer
            if (!postProcessLayer(rs, layer)) return false;
        
            layer.index.layer = m_texturePack->addLayer(layer, layer.path, (color4*)rs.bytesUI8v4);
        }
        // Normal map
        if (layer.normalPath.size() && m_texturePathResolver->resolvePath(layer.normalPath, path)) {
            vg::ScopedBitmapResource rs(vg::ImageIO().load(path, vg::ImageIOFormat::RGBA_UI8));
            // Do post processing on the layer
            if (rs.data) {
                layer.index.normal = m_texturePack->addLayer(layer, layer.normalPath, (color4*)rs.bytesUI8v4);
            }
        }
        // disp map
        if (layer.dispPath.size() && m_texturePathResolver->resolvePath(layer.dispPath, path)) {
            vg::ScopedBitmapResource rs(vg::ImageIO().load(path, vg::ImageIOFormat::RGBA_UI8));
            // Do post processing on the layer
            if (rs.data) {
                layer.index.disp = m_texturePack->addLayer(layer, layer.dispPath, (color4*)rs.bytesUI8v4);
            }
        }
    }
    return true;
}

bool BlockTextureLoader::postProcessLayer(vg::ScopedBitmapResource& bitmap, BlockTextureLayer& layer) {

    // ui32 floraRows;
    const ui32& resolution = m_texturePack->getResolution();

    // TODO(Ben): Floraheight

    // Helper for checking dimensions
#define DIM_CHECK(w, cw, h, ch, method) \
    if (bitmap.width != resolution * cw) { \
        pError("Texture " + layer.path + " is " #method " but width is not " + std::to_string(cw)); \
        return false; \
            } \
    if (bitmap.height != resolution * ch) {  \
        pError("Texture " + layer.path + " is " #method " but height is not " + std::to_string(ch)); \
        return false; \
            }

    // Pixels must exist
    if (!bitmap.data) return false;

    // Check that the texture is sized in units of resolution
    if (bitmap.width % resolution) {
        pError("Texture " + layer.path + " width must be a multiple of " + std::to_string(resolution));
        return false;
    }
    if (bitmap.height % resolution) {
        pError("Texture " + layer.path + " height must be a multiple of " + std::to_string(resolution));
        return false;
    }

    // Check for errors and postprocessing based on method
    switch (layer.method) {
        // Need to set up numTiles and totalWeight for RANDOM method
        case ConnectedTextureMethods::CONNECTED:
            layer.size = ui8v2(1);
            DIM_CHECK(width, CONNECTED_WIDTH, bitmap.height, CONNECTED_HEIGHT, CONNECTED);
            break;
        case ConnectedTextureMethods::RANDOM:
            layer.numTiles = bitmap.width / bitmap.height;
            layer.size = ui32v2(1);
            if (layer.weights.size() == 0) {
                layer.totalWeight = layer.numTiles;
            } else { // Need to check if there is the right number of weights
                if (layer.weights.size() * resolution != bitmap.width) {
                    pError("Texture " + layer.path + " weights length must match number of columns or be empty. weights.length() = " +
                           std::to_string(layer.weights.size()) + " but there are " + std::to_string(bitmap.width / resolution) + " columns.");
                    return false;
                }
            }
            break;
        case ConnectedTextureMethods::GRASS:
            layer.size = ui8v2(1);
            DIM_CHECK(width, GRASS_WIDTH, bitmap.height, GRASS_HEIGHT, GRASS);
            break;
        case ConnectedTextureMethods::HORIZONTAL:
            layer.size.x = (ui8)(bitmap.width / resolution);
            layer.size.y = (ui8)(bitmap.height / resolution);
            DIM_CHECK(width, HORIZONTAL_WIDTH, bitmap.height, HORIZONTAL_HEIGHT, HORIZONTAL);
            break;
        case ConnectedTextureMethods::VERTICAL:
            layer.size.x = (ui8)(bitmap.width / resolution);
            layer.size.y = (ui8)(bitmap.height / resolution);
            DIM_CHECK(width, HORIZONTAL_HEIGHT, bitmap.height, HORIZONTAL_WIDTH, VERTICAL);
            break;
        case ConnectedTextureMethods::REPEAT:
            layer.size.x = (ui8)(bitmap.width / resolution);
            layer.size.y = (ui8)(bitmap.height / resolution);
            DIM_CHECK(width, layer.size.x, bitmap.height, layer.size.y, REPEAT);
            break;
        //case ConnectedTextureMethods::FLORA:
        //    floraRows = BlockTextureLayer::getFloraRows(layer.floraHeight);
        //    if (bitmap.height != resolution * floraRows) {
        //        pError("Texture " + layer.path + " texture height must be equal to (maxFloraHeight^2 + maxFloraHeight) / 2 * resolution = " +
        //               std::to_string(bitmap.height) + " but it is " + std::to_string(resolution * floraRows));
        //        return false;
        //    }
        //    // If no weights, they are all equal
        //    if (layer.weights.size() == 0) {
        //        layer.totalWeight = bitmap.width / resolution;
        //    } else { // Need to check if there is the right number of weights
        //        if (layer.weights.size() * resolution != bitmap.width) {
        //            pError("Texture " + layer.path + " weights length must match number of columns or be empty. weights.length() = " +
        //                   std::to_string(layer.weights.size()) + " but there are " + std::to_string(bitmap.width / resolution) + " columns.");
        //            return false;
        //        }
        //    }
        //    // Tile dimensions and count
        //    layer.size.x = bitmap.width / resolution;
        //    layer.size.y = floraRows;
        //    layer.numTiles = layer.size.x * layer.size.y;
        //    break;
        case ConnectedTextureMethods::NONE:
            DIM_CHECK(bitmap.width, 1, bitmap.height, 1, NONE);
            break;
        default:
            break;
    }

    layer.initBlockTextureFunc();
    return true;
}

================================================
FILE: SoA/BlockTextureLoader.h
================================================
///
/// BlockTextureLoader.h
/// Seed of Andromeda
///
/// Created by Benjamin Arnold on 16 Jun 2015
/// Copyright 2014 Regrowth Studios
/// MIT License
///
/// Summary:
/// Loads block textures
///

#pragma once

#ifndef BlockTextureLoader_h__
#define BlockTextureLoader_h__

#include <Vorb/io/IOManager.h>
#include <Vorb/VorbPreDecl.inl>

#include "BlockData.h"

DECL_VG(class ScopedBitmapResource)

class Block;
class BlockTexturePack;
class ModPathResolver;
class BlockTextureLayer;
struct BlockTexture;

struct BlockTextureNames {
    nString names[6];
};

class BlockTextureLoader {
public:
    void init(ModPathResolver* texturePathResolver, BlockTexturePack* texturePack);

    void loadTextureData();

    void loadBlockTextures(Block& block);

    void dispose();

    BlockTexturePack* getTexturePack() const { return m_texturePack; }
private:
    bool loadLayerProperties();
    bool loadTextureProperties();
    bool loadBlockTextureMapping();
    bool loadLayer(BlockTextureLayer& layer);
    bool postProcessLayer(vg::ScopedBitmapResource& bitmap, BlockTextureLayer& layer);

    std::map<nString, BlockTextureLayer> m_layers;
    std::map<BlockIdentifier, BlockTextureNames> m_blockMappings;

    ModPathResolver* m_texturePathResolver = nullptr;
    BlockTexturePack* m_texturePack = nullptr;
    vio::IOManager m_iom;
    int m_generatedTextureCounter = 0;
};

#endif // BlockTextureLoader_h__


================================================
FILE: SoA/BlockTextureMethods.cpp
================================================
#include "stdafx.h"
#include "BlockTextureMethods.h"

#include <Vorb/graphics/ConnectedTextures.h>
#include <Vorb/utils.h>
#include <Vorb/Random.h>

#include "BlockPack.h"
#include "Chunk.h"
#include "ChunkMesh.h"
#include "ChunkMesher.h"
#include "VoxelBits.h"
#include "soaUtils.h"

#define GETBLOCK(a) (((*blocks)[((a) & 0x0FFF)]))
// We are assuming layerIndex can be trusted to be 0 or 1 here, add asserts?
#define TEXTURE_INDEX (params.layerIndex == 0 ? \
    block->textures[params.faceIndex]->layers.base.indices[params.typeIndex] : \
    block->textures[params.faceIndex]->layers.overlay.indices[params.typeIndex])

inline ui32 getPositionSeed(const i32v3& pos) {
    i32 val = ((pos.x & 0x7ff) | ((pos.y & 0x3ff) << 11) | ((pos.z & 0x7ff) << 21));
    // Treat i32 bits as ui32 so we don't just truncate with a cast
    return *(ui32*)&val;
}

void BlockTextureMethods::getDefaultTextureIndex(BlockTextureMethodParams& params, BlockTextureMethodData& result) {
    result.size = params.blockTexInfo->size;
} 

//Gets a random offset for use by random textures
void BlockTextureMethods::getRandomTextureIndex(BlockTextureMethodParams& params, BlockTextureMethodData& result) {
    //TODO: MurmurHash3
    const ChunkMesher* cm = params.chunkMesher;
    const BlockTextureLayer* blockTexInfo = params.blockTexInfo;
    i32v3 pos(cm->chunkVoxelPos.pos.x + cm->bx, cm->chunkVoxelPos.pos.y + cm->by, cm->chunkVoxelPos.pos.z + cm->bz);

    // TODO(Ben): Faster RNG?
    f32 r = params.blockTexInfo->totalWeight * ((f32)rand() / RAND_MAX);
    f32 totalWeight = 0;

    result.size = params.blockTexInfo->size;
    // TODO(Ben): Binary search?
    if (blockTexInfo->weights.size()) {
        for (ui32 i = 0; i < blockTexInfo->numTiles; i++) {
            totalWeight += blockTexInfo->weights[i];
            if (r <= totalWeight) {
                result.index += i;
                return;
            }
        }
    } else {
        for (ui32 i = 0; i < blockTexInfo->numTiles; i++) {
            totalWeight += 1.0f;
            if (r <= totalWeight) {
                result.index += i;
                return;
            }
        }
    }
}

void BlockTextureMethods::getFloraTextureIndex(BlockTextureMethodParams& params, BlockTextureMethodData& result) {
    //TODO: MurmurHash3
    const ChunkMesher* cm = params.chunkMesher;
    // i32 seed = 0; // getPositionSeed(cm->x + cm->position.x, cm->y + cm->position.y, cm->z + cm->position.z);

    f32 r = (f32)((/*PseudoRand(seed) +*/ 1.0) * 0.5 * params.blockTexInfo->totalWeight);
    f32 totalWeight = 0;

    const BlockTextureLayer* blockTexInfo = params.blockTexInfo;
    const ui16* tertiaryData = cm->tertiaryData;

    const int& blockIndex = cm->blockIndex;

    int column=0;

    // TODO(Ben): Binary search?
    if (blockTexInfo->weights.size()) {
        for (ui32 i = 0; i < blockTexInfo->size.x; i++) {
            totalWeight += blockTexInfo->weights[i];
            if (r <= totalWeight) {
                column = i;
                break;
            }
        }
    } else {
        for (ui32 i = 0; i < blockTexInfo->size.x; i++) {
            totalWeight += 1.0f;
            if (r <= totalWeight) {
                column = i;
                break;
            }
        }
    }

    result.index += column;

    // Get the height of the current voxel
    int height = MIN(VoxelBits::getFloraHeight(tertiaryData[blockIndex]), cm->block->floraHeight);
    int yPos = height - VoxelBits::getFloraPosition(tertiaryData[blockIndex]);

    // Move the result to the flora of the correct height
    result.index += blockTexInfo->size.x * (height * height + height) / 2;
    // Offset by the ypos
    result.index += blockTexInfo->size.x * yPos;
    result.size = params.blockTexInfo->size;
}

//Gets a connected texture offset by looking at the surrounding blocks
void BlockTextureMethods::getConnectedTextureIndex(BlockTextureMethodParams& params, BlockTextureMethodData& result) {
    const BlockPack* blocks = params.chunkMesher->blocks;
    int connectedOffset = 0;
    const int& blockIndex = params.chunkMesher->blockIndex;
    const int& upDir = params.upDir;
    const int& rightDir = params.rightDir;
    const int& frontDir = params.frontDir;
    const ui16* blockIDData = params.chunkMesher->blockData;
    BlockTextureIndex tex = result.index;

    // Top Left
    const Block *block = &GETBLOCK(blockIDData[blockIndex + upDir - rightDir]);

    if (TEXTURE_INDEX != tex) {
        connectedOffset |= 0x80;
    }

    // Top
    block = &GETBLOCK(blockIDData[blockIndex + upDir]);
    if (TEXTURE_INDEX != tex) {
        connectedOffset |= 0xE0;
    }

    // Top Right
    block = &GETBLOCK(blockIDData[blockIndex + upDir + rightDir]);
    if (TEXTURE_INDEX != tex) {
        connectedOffset |= 0x20;
    }

    // Right
    block = &GETBLOCK(blockIDData[blockIndex + rightDir]);
    if (TEXTURE_INDEX != tex) {
        connectedOffset |= 0x38;
    }

    // Bottom Right
    block = &GETBLOCK(blockIDData[blockIndex - upDir + rightDir]);
    if (TEXTURE_INDEX != tex) {
        connectedOffset |= 0x8;
    }

    // Bottom
    block = &GETBLOCK(blockIDData[blockIndex - upDir]);
    if (TEXTURE_INDEX != tex) {
        connectedOffset |= 0xE;
    }

    // Bottom Left
    block = &GETBLOCK(blockIDData[blockIndex - upDir - rightDir]);
    if (TEXTURE_INDEX != tex) {
        connectedOffset |= 0x2;
    }

    // Left
    block = &GETBLOCK(blockIDData[blockIndex - rightDir]);
    if (TEXTURE_INDEX != tex) {
        connectedOffset |= 0x83;
    }

    if (params.blockTexInfo->innerSeams) {
        // Top Front Left
        block = &GETBLOCK(blockIDData[blockIndex + upDir - rightDir + frontDir]);
        if (block->occlude != BlockOcclusion::NONE) {
            connectedOffset |= 0x80;
        }

        // Top Front Right
        block = &GETBLOCK(blockIDData[blockIndex + upDir + rightDir + frontDir]);
        if (block->occlude != BlockOcclusion::NONE) {
            connectedOffset |= 0x20;
        }

        // Bottom front Right
        block = &GETBLOCK(blockIDData[blockIndex - upDir + rightDir + frontDir]);
        if (block->occlude != BlockOcclusion::NONE) {
            connectedOffset |= 0x8;
        }

        //Bottom front
        block = &GETBLOCK(blockIDData[blockIndex - upDir + frontDir]);
        if (block->occlude != BlockOcclusion::NONE) {
            connectedOffset |= 0xE;
        }

        // Bottom front Left
        block = &GETBLOCK(blockIDData[blockIndex - upDir - rightDir + frontDir]);
        if (block->occlude != BlockOcclusion::NONE) {
            connectedOffset |= 0x2;
        }

        //Left front
        block = &GETBLOCK(blockIDData[blockIndex - rightDir + frontDir]);
        if (block->occlude != BlockOcclusion::NONE) {
            connectedOffset |= 0x83;
        }

        //Top front
        block = &GETBLOCK(blockIDData[blockIndex + upDir + frontDir]);
        if (block->occlude != BlockOcclusion::NONE) {
            connectedOffset |= 0xE0;
        }

        //Right front
        block = &GETBLOCK(blockIDData[blockIndex + rightDir + frontDir]);
        if (block->occlude != BlockOcclusion::NONE) {
            connectedOffset |= 0x38;
        }
    }
    result.size = params.blockTexInfo->size;
    result.index += vg::ConnectedTextureHelper::getOffsetFull(connectedOffset);
}

//Gets a grass side texture offset by looking at the surrounding blocks
void BlockTextureMethods::getGrassTextureIndex(BlockTextureMethodParams& params, BlockTextureMethodData& result) {
    const BlockPack* blocks = params.chunkMesher->blocks;
    int connectedOffset = 0;
    const int& blockIndex = params.chunkMesher->blockIndex;
    const int& upDir = params.upDir;
    const int& rightDir = params.rightDir;
    const int& frontDir = params.frontDir;
    const ui16* blockIDData = params.chunkMesher->blockData;
   
    const ChunkMesher* cm = params.chunkMesher;

    BlockTextureIndex tex = result.index;

    // Bottom Front
    int index = blockIndex - upDir + frontDir;
    int id = blockIDData[index];
    const Block* block = &GETBLOCK(id);

    if (/*cm->levelOfDetail > 1 || */ TEXTURE_INDEX == tex) {
        block = &GETBLOCK(blockIDData[blockIndex]);
        result.index = block->textureTop->layers.base.index.layer;
        block->textureTop->layers.base.blockTextureFunc(params, result);
        block->textureTop->layers.base.getFinalColor(*params.color, cm->heightData->temperature, cm->heightData->humidity, 0);
        result.size = block->textureTop->layers.base.size;
        return;
    }

    // Left
    block = &GETBLOCK(blockIDData[blockIndex - rightDir]);
    if (TEXTURE_INDEX == tex || block->occlude == BlockOcclusion::NONE) {
        connectedOffset |= 0x8;

        // REDUNDANT
        if (TEXTURE_INDEX == tex) {
            // bottom front Left
            block = &GETBLOCK(blockIDData[blockIndex - upDir - rightDir + frontDir]);
            if (TEXTURE_INDEX == tex) {
                connectedOffset |= 0xC;
            }
        }
    }

    // Front left
    block = &GETBLOCK(blockIDData[blockIndex - rightDir + frontDir]);
    if (TEXTURE_INDEX == tex) {
        connectedOffset |= 0x8;
    }

    // Bottom left
    block = &GETBLOCK(blockIDData[blockIndex - upDir - rightDir]);
    if (TEXTURE_INDEX == tex) {
        connectedOffset |= 0xC;
    }

    // bottom right
    block = &GETBLOCK(blockIDData[blockIndex - upDir + rightDir]);
    if (TEXTURE_INDEX == tex) {
        connectedOffset |= 0x3;
    }

    // Right
    block = &GETBLOCK(blockIDData[blockIndex + rightDir]);
    if (TEXTURE_INDEX == tex || block->occlude == BlockOcclusion::NONE) {
        connectedOffset |= 0x1;

        if (TEXTURE_INDEX == tex) {
            // bottom front Right
            block = &GETBLOCK(blockIDData[blockIndex - upDir + rightDir + frontDir]);
            if (TEXTURE_INDEX == tex) {
                connectedOffset |= 0x3;
            }
        }
    }

    // Front right
    block = &GETBLOCK(blockIDData[blockIndex + rightDir + frontDir]);
    if (TEXTURE_INDEX == tex) {
        connectedOffset |= 0x1;
    }
    result.size = params.blockTexInfo->size;
    result.index += vg::ConnectedTextureHelper::getOffsetSmall(connectedOffset);
}

void BlockTextureMethods::getVerticalTextureIndex(BlockTextureMethodParams& params, BlockTextureMethodData& result) {
    const BlockPack* blocks = params.chunkMesher->blocks;
    static int verticalOffsets[4] = { 0, 1, 3, 2 };

    int connectedOffset;
    const int& blockIndex = params.chunkMesher->blockIndex;
    const int& upDir = params.upDir;
    const ui16* blockIDData = params.chunkMesher->blockData;
    const ConnectedTextureReducedMethod& rm = params.blockTexInfo->reducedMethod;

    BlockTextureIndex tex = result.index;

    if (rm == ConnectedTextureReducedMethod::NONE) {
        connectedOffset = 0;
    } else if (rm == ConnectedTextureReducedMethod::TOP) {
        connectedOffset = 1;
    } else { //BOTTOM
        connectedOffset = 2;
    }

    //top bit
    const Block *block = &GETBLOCK(blockIDData[blockIndex + upDir]);

    if (TEXTURE_INDEX == tex) {
        connectedOffset |= 2;
    }
    //bottom bit
    block = &GETBLOCK(blockIDData[blockIndex - upDir]);
    if (TEXTURE_INDEX == tex) {
        connectedOffset |= 1;
    }
    result.size = params.blockTexInfo->size;
    result.index += verticalOffsets[connectedOffset];
}

void BlockTextureMethods::getHorizontalTextureIndex(BlockTextureMethodParams& params, BlockTextureMethodData& result) {
    static int horizontalOffsets[4] = { 0, 1, 3, 2 };
    const BlockPack* blocks = params.chunkMesher->blocks;

    int connectedOffset = 0;
    const int& blockIndex = params.chunkMesher->blockIndex;
    const int& rightDir = params.rightDir;
    const int& frontDir = params.frontDir;
    const ui16* blockIDData = params.chunkMesher->blockData;
    BlockTextureIndex tex = result.index;

    //right bit
    const Block *block = &GETBLOCK(blockIDData[blockIndex + rightDir]);

    if (TEXTURE_INDEX == tex) {
        connectedOffset |= 1;
    }
    //left bit
    block = &GETBLOCK(blockIDData[blockIndex - rightDir]);
    if (TEXTURE_INDEX == tex) {
        connectedOffset |= 2;
    }

    if (params.blockTexInfo->innerSeams) {
        //front right bit
        block = &GETBLOCK(blockIDData[blockIndex + rightDir + frontDir]);
        if (TEXTURE_INDEX == tex) {
            connectedOffset &= 2;
        }
        //front left bit
        block = &GETBLOCK(blockIDData[blockIndex - rightDir + frontDir]);
        if (TEXTURE_INDEX == tex) {
            connectedOffset &= 1;
        }
    }
    result.size = params.blockTexInfo->size;
    result.index += horizontalOffsets[connectedOffset];
}


================================================
FILE: SoA/BlockTextureMethods.h
================================================
///
/// BlockTextureMethods.h
/// Seed of Andromeda
///
/// Created by Benjamin Arnold on 7 Nov 2014
/// Copyright 2014 Regrowth Studios
/// MIT License
///
/// This file provides the texturing methods functions for block textures,
/// such as connected textures and random textures.
///

#pragma once

#ifndef BlockTextureMethods_h__
#define BlockTextureMethods_h__

#include <functional>
#include <Vorb/types.h>

class ChunkMesher;
class BlockTextureLayer;
class BlockPack;

typedef ui32 BlockTextureIndex;

class BlockTextureMethodParams {
public:

    void init(ChunkMesher* cm, i32 RightDir, i32 UpDir, i32 FrontDir, ui32 face, ui32 layerIndex) {
        chunkMesher = cm;
        rightDir = RightDir;
        upDir = UpDir;
        frontDir = FrontDir;
        faceIndex = face;
        this->layerIndex = layerIndex;
    }

    void set(const BlockTextureLayer* blockTextureLayer, ui32 typeIndex, ColorRGB8& Color) {
        blockTexInfo = blockTextureLayer;
        this->typeIndex = typeIndex;
        color = &Color;
    }

    const ChunkMesher* chunkMesher = nullptr;
    const BlockTextureLayer* blockTexInfo = nullptr;
    i32 rightDir;
    i32 upDir;
    i32 frontDir;
    ui32 faceIndex;
    ui32 layerIndex;
    ui32 typeIndex;
    ColorRGB8* color = nullptr;
};

struct BlockTextureMethodData {
    BlockTextureIndex index;
    ui8v2 size;
};

typedef std::function <void(BlockTextureMethodParams& params, BlockTextureMethodData& result)> BlockTextureFunc;

namespace BlockTextureMethods {
    void getDefaultTextureIndex(BlockTextureMethodParams& params, BlockTextureMethodData& result);
    void getRandomTextureIndex(BlockTextureMethodParams& params, BlockTextureMethodData& result);
    void getFloraTextureIndex(BlockTextureMethodParams& params, BlockTextureMethodData& result);
    void getConnectedTextureIndex(BlockTextureMethodParams& params, BlockTextureMethodData& result);
    void getGrassTextureIndex(BlockTextureMethodParams& params, BlockTextureMethodData& result);
    void getVerticalTextureIndex(BlockTextureMethodParams& params, BlockTextureMethodData& result);
    void getHorizontalTextureIndex(BlockTextureMethodParams& params, BlockTextureMethodData& result);
}

#endif // BlockTextureMethods_h__


================================================
FILE: SoA/BlockTexturePack.cpp
================================================
#include "stdafx.h"
#include "BlockTexturePack.h"

#include "BlockPack.h" // TEMPORARY
#include "BlockTexture.h"
#include "SpaceSystemComponents.h"
#include "SpaceSystemAssemblages.h"

#include <SDL2/SDL.h>

#include "Errors.h"

#define CONNECTED_TILES 47
#define GRASS_TILES 9
#define HORIZONTAL_TILES 4
#define VERTICAL_TILES 4

BlockTexturePack::~BlockTexturePack() {
    dispose();
}

void BlockTexturePack::init(ui32 resolution, ui32 maxTextures) {
    m_resolution = resolution;
    m_pageWidthPixels = m_resolution * m_stitcher.getTilesPerRow();
    m_maxTextures = maxTextures;
    m_textures = new BlockTexture[maxTextures];
    m_nextFree = 0;
    // Calculate max mipmap level
    m_mipLevels = 0;
    ui32 width = m_pageWidthPixels;
    while (width > m_stitcher.getTilesPerRow()) {
        width >>= 1;
        m_mipLevels++;
    }

    // Set up first page for default textures
    flagDirtyPage(0);

    // Allocate biome and liquid maps and init to white
    BlockColorMap& bmap = m_colorMaps["biome"];
    memset(bmap.pixels, 255, sizeof(bmap.pixels));
    BlockColorMap& lmap = m_colorMaps["liquid"];
    memset(lmap.pixels, 255, sizeof(lmap.pixels));

    SpaceSystemAssemblages::onAddSphericalVoxelComponent += makeDelegate(this, &BlockTexturePack::onAddSphericalVoxelComponent);
}

// TODO(Ben): Lock?
BlockTextureIndex BlockTexturePack::addLayer(const BlockTextureLayer& layer, const nString& path, color4* pixels) {
    BlockTextureIndex rv = 0;
    // Map the texture
    int firstPageIndex;
    int lastPageIndex;
    switch (layer.method) {
        case ConnectedTextureMethods::CONNECTED:
            rv = m_stitcher.mapContiguous(CONNECTED_TILES);
            lastPageIndex = (rv + CONNECTED_TILES) / m_stitcher.getTilesPerPage();
            break;
        case ConnectedTextureMethods::RANDOM:
            rv = m_stitcher.mapContiguous(layer.numTiles);
            lastPageIndex = (rv + layer.numTiles) / m_stitcher.getTilesPerPage();
            break;
        case ConnectedTextureMethods::REPEAT:
            rv = m_stitcher.mapBox(layer.size.x, layer.size.y);
            lastPageIndex = (rv + (layer.size.y - 1) * m_stitcher.getTilesPerRow() + (layer.size.x - 1)) / m_stitcher.getTilesPerPage();
            break;
        case ConnectedTextureMethods::GRASS:
            rv = m_stitcher.mapContiguous(GRASS_TILES);
            lastPageIndex = (rv + GRASS_TILES) / m_stitcher.getTilesPerPage();
            break;
        case ConnectedTextureMethods::HORIZONTAL:
            rv = m_stitcher.mapContiguous(HORIZONTAL_TILES);
            lastPageIndex = (rv + HORIZONTAL_TILES) / m_stitcher.getTilesPerPage();
            break;
        case ConnectedTextureMethods::VERTICAL:
            rv = m_stitcher.mapContiguous(VERTICAL_TILES);
            lastPageIndex = (rv + VERTICAL_TILES) / m_stitcher.getTilesPerPage();
            break;
        case ConnectedTextureMethods::FLORA:
            rv = m_stitcher.mapContiguous(layer.numTiles);
            lastPageIndex = (rv + layer.numTiles) / m_stitcher.getTilesPerPage();
            break;
        default:
            rv = m_stitcher.mapSingle();
            lastPageIndex = (rv + 1) / m_stitcher.getTilesPerPage();
            break;
    }
    firstPageIndex = rv / m_stitcher.getTilesPerPage();
    flagDirtyPage(firstPageIndex);
    if (lastPageIndex != firstPageIndex) flagDirtyPage(lastPageIndex);

    // Copy data
    switch (layer.method) {
        case ConnectedTextureMethods::CONNECTED:
            writeToAtlasContiguous(rv, pixels, 12, 4, CONNECTED_TILES);
            break;
        case ConnectedTextureMethods::RANDOM:
            writeToAtlasContiguous(rv, pixels, layer.numTiles, 1, layer.numTiles);
            break;
        case ConnectedTextureMethods::REPEAT:
            writeToAtlas(rv, pixels, m_resolution * layer.size.x, m_resolution * layer.size.y, 1);
            break;
        case ConnectedTextureMethods::GRASS:
            writeToAtlasContiguous(rv, pixels, 3, 3, GRASS_TILES);
            break;
        case ConnectedTextureMethods::HORIZONTAL:
            writeToAtlasContiguous(rv, pixels, HORIZONTAL_TILES, 1, HORIZONTAL_TILES);
            break;
        case ConnectedTextureMethods::VERTICAL:
            writeToAtlasContiguous(rv, pixels, 1, VERTICAL_TILES, VERTICAL_TILES);
            break;
        case ConnectedTextureMethods::FLORA:
            writeToAtlasContiguous(rv, pixels, layer.size.x, layer.size.y, layer.numTiles);
            break;
        default:
            writeToAtlas(rv, pixels, m_resolution, m_resolution, 1);
            break;
    }

    // Cache the texture description
    AtlasTextureDescription tex;
    tex.index = rv;
    tex.size = layer.size;
    tex.temp = layer;
    m_descLookup[path] = tex;
    return rv;
}

AtlasTextureDescription BlockTexturePack::findLayer(const nString& filePath) {
    auto it = m_descLookup.find(filePath);
    if (it != m_descLookup.end()) {
        return it->second;
    }
    return {};
}

BlockTexture* BlockTexturePack::findTexture(const nString& filePath) {
    auto it = m_textureLookup.find(filePath);
    if (it != m_textureLookup.end()) {
        return &m_textures[it->second];
    }
    return nullptr;
}
// Returns a pointer to the next free block texture and increments internal counter.
// Will crash if called more than m_maxTextures times.
BlockTexture* BlockTexturePack::getNextFreeTexture(const nString& filePath) {
    if (m_nextFree >= m_maxTextures) pError("m_nextFree >= m_maxTextures in BlockTexturePack::getNextFreeTexture");
    m_textureLookup[filePath] = m_nextFree;
    return &m_textures[m_nextFree++];
}

BlockColorMap* BlockTexturePack::getColorMap(const nString& path) {
    auto it = m_colorMaps.find(path);
    if (it != m_colorMaps.end()) return &it->second;
    return nullptr;
}

BlockColorMap* BlockTexturePack::setColorMap(const nString& name, const vg::BitmapResource* rs) {
    // Error check
    if (rs->width != BLOCK_COLOR_MAP_WIDTH || rs->height != BLOCK_COLOR_MAP_WIDTH) {
        fprintf(stderr, "Warning: Color map %s is not %d x %d\n", name.c_str(), BLOCK_COLOR_MAP_WIDTH, BLOCK_COLOR_MAP_WIDTH);
        fflush(stderr);
    }
    return setColorMap(name, rs->bytesUI8v3);
}

BlockColorMap* BlockTexturePack::setColorMap(const nString& name, const ui8v3* pixels) {
    // Allocate the color map
    BlockColorMap* colorMap = &m_colorMaps[name];
    // Set its pixels
    for (int y = 0; y < BLOCK_COLOR_MAP_WIDTH; y++) {
        for (int x = 0; x < BLOCK_COLOR_MAP_WIDTH; x++) {
            colorMap->pixels[y][x].r = pixels[y * BLOCK_COLOR_MAP_WIDTH + x].r;
            colorMap->pixels[y][x].g = pixels[y * BLOCK_COLOR_MAP_WIDTH + x].g;
            colorMap->pixels[y][x].b = pixels[y * BLOCK_COLOR_MAP_WIDTH + x].b;
        }
    }
    return colorMap;
}

void BlockTexturePack::update() {
    bool needsMipmapGen = false;
    if (m_needsRealloc) {
        allocatePages();
        m_needsRealloc = false;
        needsMipmapGen = true;
        // Upload all pages
        glBindTexture(GL_TEXTURE_2D_ARRAY, m_atlasTexture);
        for (size_t i = 0; i < m_pages.size(); i++) {
            uploadPage(i);
        }
        std::vector<int>().swap(m_dirtyPages);
    } else if (m_dirtyPages.size()) {
        needsMipmapGen = true;
        // Upload dirty pages
        glBindTexture(GL_TEXTURE_2D_ARRAY, m_atlasTexture);
        for (auto& i : m_dirtyPages) {
            uploadPage(i);
        }
        std::vector<int>().swap(m_dirtyPages);
    }

    if (needsMipmapGen) {
        glGenerateMipmap(GL_TEXTURE_2D_ARRAY);
        glBindTexture(GL_TEXTURE_2D_ARRAY, 0);
    }
}

void BlockTexturePack::writeDebugAtlases() {
    int width = m_resolution * m_stitcher.getTilesPerRow();
    int height = width;

    int pixelsPerPage = width * height * 4;
    ui8 *pixels = new ui8[width * height * 4 * m_pages.size()];

    glBindTexture(GL_TEXTURE_2D_ARRAY, m_atlasTexture);
    glGetTexImage(GL_TEXTURE_2D_ARRAY, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
    for (size_t i = 0; i < m_pages.size(); i++) {
        SDL_Surface *surface = SDL_CreateRGBSurfaceFrom(pixels + i * pixelsPerPage, width, height, m_resolution, 4 * width, 0xFF, 0xFF00, 0xFF0000, 0x0);
        SDL_SaveBMP(surface, ("atlas" + std::to_string(i) + ".bmp").c_str());
    }
    glBindTexture(GL_TEXTURE_2D_ARRAY, 0);

    delete[] pixels;
}

void BlockTexturePack::dispose() {
    if (m_atlasTexture) glDeleteTextures(1, &m_atlasTexture);
    m_atlasTexture = 0;
    for (auto& p : m_pages) {
        delete[] p.pixels;
    }
    std::vector<AtlasPage>().swap(m_pages);
    m_stitcher.dispose();
    std::map<nString, ui32>().swap(m_textureLookup);
    m_nextFree = 0;
    delete[] m_textures;
    m_textures = nullptr;

    SpaceSystemAssemblages::onAddSphericalVoxelComponent -= makeDelegate(this, &BlockTexturePack::onAddSphericalVoxelComponent);
}

nString getName(nString name) {
    if (name.empty()) return "";
    vio::Path p(name);
    name = p.getLeaf();
    while (name.back() != '.') name.pop_back();
    name.pop_back();
    return name;
}

void BlockTexturePack::flagDirtyPage(ui32 pageIndex) {
    // If we need to allocate new pages, do so
    if (pageIndex >= m_pages.size()) {
        size_t i = m_pages.size();
        m_pages.resize(pageIndex + 1);
        for (; i < m_pages.size(); i++) {
            m_pages[i].pixels = new color4[m_pageWidthPixels * m_pageWidthPixels];
            memset(m_pages[i].pixels, 0, m_pageWidthPixels * m_pageWidthPixels * sizeof(color4));
        }
        m_needsRealloc = true;    
    }
    m_pages[pageIndex].dirty = true;
}

void BlockTexturePack::allocatePages() {
    // Set up the storage
    if (!m_atlasTexture) glGenTextures(1, &m_atlasTexture);
    glBindTexture(GL_TEXTURE_2D_ARRAY, m_atlasTexture);

    // Set up all the mipmap storage
    ui32 width = m_pageWidthPixels;
    for (ui32 i = 0; i < m_mipLevels; i++) {
        glTexImage3D(GL_TEXTURE_2D_ARRAY, i, GL_RGBA8, width, width, m_pages.size(), 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
        width >>= 1;
        if (width < 1) width = 1;
    }

    // Set up tex parameters
    glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAX_LEVEL, (int)m_mipLevels);
    glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAX_LOD, (int)m_mipLevels);
    glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_S, GL_REPEAT);
    glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_T, GL_REPEAT);
    
    glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
    glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_LINEAR);
   
    // Anisotropic filtering
    float anisotropy;
    glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &anisotropy);
    glActiveTexture(GL_TEXTURE0);
    // Smooth texture params
//    glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
 //   glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
 //   glTexParameterf(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAX_ANISOTROPY_EXT, anisotropy);

    // Unbind
    glBindTexture(GL_TEXTURE_2D_ARRAY, 0);

    // Check if we had any errors
    checkGlError("BlockTexturePack::allocatePages");
}

void BlockTexturePack::uploadPage(ui32 pageIndex) {
    glTexSubImage3D(GL_TEXTURE_2D_ARRAY, 0, 0, 0, pageIndex, m_pageWidthPixels, m_pageWidthPixels, 1, GL_RGBA, GL_UNSIGNED_BYTE, m_pages[pageIndex].pixels);
}

void BlockTexturePack::writeToAtlas(BlockTextureIndex texIndex, color4* pixels, ui32 pixelWidth, ui32 pixelHeight, ui32 tileWidth) {

    // Get the location in the array
    ui32 i = texIndex % m_stitcher.getTilesPerPage();
    ui32 dx = i % m_stitcher.getTilesPerRow();
    ui32 dy = i / m_stitcher.getTilesPerRow();
    ui32 pageIndex = texIndex / m_stitcher.getTilesPerPage();

    // Temp variables to reduce multiplications
    ui32 destOffset;
    ui32 pixelsOffset;
    ui32 yDestOffset;
    ui32 yPixelsOffset;
    ui32 pixelsPerRow = pixelWidth * tileWidth;

    // Start of destination
    color4* dest = m_pages[pageIndex].pixels + dx * m_resolution + dy * m_resolution * m_pageWidthPixels;
    float alpha;

    // Copy the block of pixels
    for (ui32 y = 0; y < pixelHeight; y++) {
        // Calculate Y offsets
        yDestOffset = y * m_pageWidthPixels;
        yPixelsOffset = y * pixelsPerRow;
        // Need to do alpha blending for every pixel against a black background
        for (ui32 x = 0; x < pixelWidth; x++) {
            // Calculate offsets
            destOffset = yDestOffset + x;
            pixelsOffset = yPixelsOffset + x;
            // Convert 0-255 to 0-1 for alpha mult
            alpha = (float)pixels[pixelsOffset].a / 255.0f;

            // Set the colors. Add  + 0.01f to make sure there isn't any rounding error when we truncate
            dest[destOffset].r = (ui8)((float)pixels[pixelsOffset].r * alpha + 0.01f); // R
            dest[destOffset].g = (ui8)((float)pixels[pixelsOffset].g * alpha + 0.01f); // G
            dest[destOffset].b = (ui8)((float)pixels[pixelsOffset].b * alpha + 0.01f); // B
            dest[destOffset].a = pixels[pixelsOffset].a; // A 
        }
    }
}

void BlockTexturePack::writeToAtlasContiguous(BlockTextureIndex texIndex, color4* pixels, ui32 width, ui32 height, ui32 numTiles) {
    ui32 pixelsPerTileRow = m_resolution * m_resolution * width;

    ui32 n = 0;
    for (ui32 y = 0; y < height; y++) {
        for (ui32 x = 0; x < width && n < numTiles; x++, n++) {
            // Get pointer to source data
            color4* src = pixels + y * pixelsPerTileRow + x * m_resolution;

            writeToAtlas(texIndex++, src, m_resolution, m_resolution, width);
        }
    }
}

void BlockTexturePack::onAddSphericalVoxelComponent(Sender s VORB_MAYBE_UNUSED, SphericalVoxelComponent& cmp, vecs::EntityID e VORB_MAYBE_UNUSED) {
    // Set color maps
    // TODO(Ben): This assumes a single SVC!
    if (cmp.planetGenData->terrainColorPixels.data) {
        BlockColorMap* m = setColorMap("biome", &cmp.planetGenData->terrainColorPixels);
        // Set all layers
        for (ui32 i = 0; i < m_nextFree; i++) {
            if (m_textures[i].layers.base.colorMapPath == "biome") {
                m_textures[i].layers.base.colorMap = m;
            }
            if (m_textures[i].layers.overlay.colorMapPath == "biome") {
                m_textures[i].layers.overlay.colorMap = m;
            }
        }
    }
    if (cmp.planetGenData->liquidColorMap.id) {
        BlockColorMap* m = setColorMap("liquid", &cmp.planetGenData->liquidColorPixels);
        // Set all layers
        for (ui32 i = 0; i < m_nextFree; i++) {
                if (m_textures[i].layers.base.colorMapPath == "liquid") {
                    m_textures[i].layers.base.colorMap = m;
                }
                if (m_textures[i].layers.overlay.colorMapPath == "liquid") {
                    m_textures[i].layers.overlay.colorMap = m;
                }
        }
    }
}

================================================
FILE: SoA/BlockTexturePack.h
================================================
///
/// BlockTexturePack.h
/// Seed of Andromeda
///
/// Created by Benjamin Arnold on 16 Jun 2015
/// Copyright 2014 Regrowth Studios
/// MIT License
///
/// Summary:
/// A texture pack for blocks
///

#pragma once

#ifndef BlockTexturePack_h__
#define BlockTexturePack_h__

#include "BlockTexture.h"

#include <map>
#include <Vorb/graphics/gtypes.h>
#include <Vorb/voxel/VoxelTextureStitcher.h>
#include <Vorb/VorbPreDecl.inl>
#include <Vorb/ecs/Entity.h>

struct SphericalVoxelComponent;

DECL_VG(class BitmapResource; class Texture);

struct AtlasTextureDescription {
    BlockTextureLayer temp;
    BlockTextureIndex index;
    ui32v2 size;
};

#define BLOCK_COLOR_MAP_WIDTH 256

struct BlockColorMap {
    color3 pixels[BLOCK_COLOR_MAP_WIDTH][BLOCK_COLOR_MAP_WIDTH];
};

class BlockTexturePack {
public:
    BlockTexturePack():
    m_atlasTexture(0),
    m_resolution(0),
    m_pageWidthPixels(0),
    m_mipLevels(0),
    m_needsRealloc(false),
    m_textures(nullptr),
    m_nextFree(0),
    m_maxTextures(0)
    {}

    ~BlockTexturePack();

    void init(ui32 resolution, ui32 maxTextures);
    // Maps the texture layer to the atlas and updates the index in layer.
    // Does not check if texture already exists
    BlockTextureIndex addLayer(const BlockTextureLayer& layer, const nString& path, color4* pixels);
    // Tries to find the texture index. Returns empty description on fail.
    AtlasTextureDescription findLayer(const nString& filePath);

    BlockTexture* findTexture(const nString& filePath);
    // Returns a pointer to the next free block texture and increments internal counter.
    // Will crash if called more than m_maxTextures times.
    BlockTexture* getNextFreeTexture(const nString& filePath);

    BlockTexture* getDefaultTexture() { return &m_defaultTexture; }

    // Gets existing color map or loads from file
    BlockColorMap* getColorMap(const nString& path);

    BlockColorMap* setColorMap(const nString& name, const vg::BitmapResource* rs);
    BlockColorMap* setColorMap(const nString& name, const ui8v3* pixels);

    // Call on GL thread. Will upload any textures that aren't yet uploaded.
    void update();

    void writeDebugAtlases();

    void dispose();

    const VGTexture& getAtlasTexture() const { return m_atlasTexture; }
    const ui32& getResolution() const { return m_resolution; }
private:
    VORB_NON_COPYABLE(BlockTexturePack);

    void flagDirtyPage(ui32 pageIndex);

    void allocatePages();

    void uploadPage(ui32 pageIndex);

    void writeToAtlas(BlockTextureIndex texIndex, color4* pixels, ui32 pixelWidth, ui32 pixelHeight, ui32 tileWidth);

    void writeToAtlasContiguous(BlockTextureIndex texIndex, color4* pixels, ui32 width, ui32 height, ui32 numTiles);

    /************************************************************************/
    /* Event Handlers                                                       */
    /************************************************************************/
    void onAddSphericalVoxelComponent(Sender s, SphericalVoxelComponent& cmp, vecs::EntityID e);

    struct AtlasPage {
        AtlasPage():pixels(nullptr), dirty(true){}
        color4* pixels;
        bool dirty;
    };

    vvox::VoxelTextureStitcher m_stitcher;

    VGTexture m_atlasTexture;
    std::vector<AtlasPage> m_pages; ///< Cached pixel data
    std::vector<int> m_dirtyPages; ///< List of dirty pages TODO(Ben): Maybe bad for multithreading
    std::unordered_map<nString, AtlasTextureDescription> m_descLookup;
    ui32 m_resolution;
    ui32 m_pageWidthPixels;
    ui32 m_mipLevels;
    bool m_needsRealloc;

    // For cache friendly caching of textures
    std::map<nString, ui32> m_textureLookup;
    std::map<nString, BlockColorMap> m_colorMaps;
    BlockTexture* m_textures; ///< Storage of all block textures
    BlockTexture m_defaultTexture;
    ui32 m_nextFree;
    ui32 m_maxTextures; ///< Maximum possible number of unique textures with this mod config
};

#endif // BlockTexturePack_h__

================================================
FILE: SoA/BloomRenderStage.cpp
================================================
#include "stdafx.h"

#include "BloomRenderStage.h"

#include <sstream>
#include <Vorb/graphics/GLRenderTarget.h>
#include <Vorb/graphics/GLProgram.h>
#include "ShaderLoader.h"
#include "LoadContext.h"
#include "Errors.h"
#include "Vorb/ui/GameWindow.h"

#define TASK_WORK  4                     // (arbitrary) weight of task
#define TOTAL_TASK 4                    // number of tasks
#define TOTAL_WORK TOTAL_TASK * TASK_WORK

#define BLOOM_TEXTURE_SLOT_COLOR  0      // texture slot to bind color texture which luma info will be extracted
#define BLOOM_TEXTURE_SLOT_LUMA   0       // texture slot to bind luma texture
#define BLOOM_TEXTURE_SLOT_BLUR   1       // texture slot to bind blur texture

float BloomRenderStage::gauss(int i, float sigma2) {
    return 1.0 / std::sqrt(2 * 3.14159265 * sigma2) * std::exp(-(i*i) / (2 * sigma2));
}

void BloomRenderStage::init(vui::GameWindow* window, StaticLoadContext& context) {

    IRenderStage::init(window, context);
    context.addAnticipatedWork(TOTAL_WORK, TOTAL_TASK);

    // initialize FBOs
    m_fbo1.setSize(m_window->getWidth(), m_window->getHeight());
    m_fbo2.setSize(m_window->getWidth(), m_window->getHeight());
    m_fbo1.init(vorb::graphics::TextureInternalFormat::RGBA32F, 0, vorb::graphics::TextureFormat::RGBA, vorb::graphics::TexturePixelType::FLOAT);
    m_fbo2.init(vorb::graphics::TextureInternalFormat::RGBA32F, 0, vorb::graphics::TextureFormat::RGBA, vorb::graphics::TexturePixelType::FLOAT);

}

void BloomRenderStage::setParams(ui32 gaussianN /* = 20 */, float gaussianVariance /* = 36.0f */, float lumaThreshold /* = 0.75f */) {
    if (gaussianN > 50)
        // if a bigger radius than 50 is desired, change the size of weights array in this file and the blur shaders
        throw "Gaussian Radius for BloomRenderStage::setParams has to be less than 50.";
    m_gaussianN = gaussianN;
    m_gaussianVariance = gaussianVariance;
    m_lumaThreshold = lumaThreshold;
}

void BloomRenderStage::load(StaticLoadContext& context) {

    // luma
    context.addTask([&](Sender, void*) {
        m_programLuma = ShaderLoader::createProgramFromFile("Shaders/PostProcessing/PassThrough.vert", "Shaders/PostProcessing/BloomLuma.frag");
        m_programLuma.use();
        glUniform1i(m_programLuma.getUniform("unTexColor"), BLOOM_TEXTURE_SLOT_COLOR);
        glUniform1f(m_programLuma.getUniform("unLumaThresh"), m_lumaThreshold);
        m_programLuma.unuse();

        context.addWorkCompleted(TOTAL_TASK);
    }, false);

    // gaussian first pass
    context.addTask([&](Sender, void*) {
        m_programGaussianFirst = ShaderLoader::createProgramFromFile("Shaders/PostProcessing/PassThrough.vert", "Shaders/PostProcessing/BloomGaussianFirst.frag");
        m_programGaussianFirst.use();
        glUniform1i(m_programGaussianFirst.getUniform("unTexLuma"), BLOOM_TEXTURE_SLOT_LUMA);
        glUniform1i(m_programGaussianFirst.getUniform("unHeight"), m_window->getHeight());
        glUniform1i(m_programGaussianFirst.getUniform("unGaussianN"), m_gaussianN);
        m_programGaussianFirst.unuse();
        context.addWorkCompleted(TOTAL_TASK);
    }, true);

    // gaussian second pass
    context.addTask([&](Sender, void*) {
        m_programGaussianSecond = ShaderLoader::createProgramFromFile("Shaders/PostProcessing/PassThrough.vert", "Shaders/PostProcessing/BloomGaussianSecond.frag");
        m_programGaussianSecond.use();
        glUniform1i(m_programGaussianSecond.getUniform("unTexColor"), BLOOM_TEXTURE_SLOT_COLOR);
        glUniform1i(m_programGaussianSecond.getUniform("unTexBlur"), BLOOM_TEXTURE_SLOT_BLUR);
        glUniform1i(m_programGaussianSecond.getUniform("unWidth"), m_window->getWidth());
        glUniform1i(m_programGaussianSecond.getUniform("unGaussianN"), m_gaussianN);
        m_programGaussianSecond.unuse();
        context.addWorkCompleted(TOTAL_TASK);
    }, true);

    // calculate gaussian weights

    context.addTask([&](Sender, void*) {
        float weights[50], sum;
        weights[0] = gauss(0, m_gaussianVariance);
        sum = weights[0];
        for (ui32 i = 1; i < m_gaussianN; i++) {
            weights[i] = gauss(i, m_gaussianVariance);
            sum += 2 * weights[i];
        }
        for (ui32 i = 0; i < m_gaussianN; i++) {
            weights[i] = weights[i] / sum;
        }
        m_programGaussianFirst.use();
        glUniform1fv(m_programGaussianFirst.getUniform("unWeight[0]"), m_gaussianN, weights);
        m_programGaussianFirst.unuse();
        m_programGaussianSecond.use();
        glUniform1fv(m_programGaussianSecond.getUniform("unWeight[0]"), m_gaussianN, weights);
        m_programGaussianSecond.unuse();

        context.addWorkCompleted(TOTAL_TASK);
    }, false);
}

void BloomRenderStage::hook(vg::FullQuadVBO* quad) {
    m_quad = quad;
}

void BloomRenderStage::dispose(StaticLoadContext& context VORB_MAYBE_UNUSED) {
    m_programLuma.dispose();
    m_programGaussianFirst.dispose();
    m_programGaussianSecond.dispose();
}

void BloomRenderStage::render(const Camera* camera VORB_MAYBE_UNUSED) {
    // get initial bound FBO and bound color texture to use it on final pass
    GLint initial_fbo, initial_texture;
    glGetIntegerv(GL_FRAMEBUFFER_BINDING, &initial_fbo);
    glGetIntegerv(GL_TEXTURE_BINDING_2D, &initial_texture);

    // color texture should be bound on GL_TEXTURE0 slot

    // luma pass rendering on temporary FBO 1
    m_fbo1.use();
    glActiveTexture(GL_TEXTURE0 + BLOOM_TEXTURE_SLOT_COLOR);
    glBindTexture(GL_TEXTURE_2D, initial_texture);
    render(BLOOM_RENDER_STAGE_LUMA);
    m_fbo1.unuse(m_window->getWidth(), m_window->getHeight());

    // first gaussian blur pass rendering on temporary FBO 2
    m_fbo2.use();
    glActiveTexture(GL_TEXTURE0 + BLOOM_TEXTURE_SLOT_LUMA);
    m_fbo1.bindTexture();
    render(BLOOM_RENDER_STAGE_GAUSSIAN_FIRST);
    m_fbo2.unuse(m_window->getWidth(), m_window->getHeight());

    // second gaussian blur pass rendering on initially FBO
    glActiveTexture(GL_TEXTURE0 + BLOOM_TEXTURE_SLOT_COLOR);
    glBindTexture(GL_TEXTURE_2D, initial_texture);
    glActiveTexture(GL_TEXTURE0 + BLOOM_TEXTURE_SLOT_BLUR);
    m_fbo2.bindTexture();
    glBindFramebuffer(GL_FRAMEBUFFER, initial_fbo);
    render(BLOOM_RENDER_STAGE_GAUSSIAN_SECOND);
}

void BloomRenderStage::render(BloomRenderStagePass stage) {
    switch (stage) {
        // luma
    case BLOOM_RENDER_STAGE_LUMA:
        m_programLuma.use();
        m_programLuma.enableVertexAttribArrays();

        glDisable(GL_DEPTH_TEST);
        m_quad->draw();
        glEnable(GL_DEPTH_TEST);

        m_programLuma.disableVertexAttribArrays();
        m_programLuma.unuse();
        break;

        // first gaussian pass
    case BLOOM_RENDER_STAGE_GAUSSIAN_FIRST:
        m_programGaussianFirst.use();
        m_programGaussianFirst.enableVertexAttribArrays();

        glDisable(GL_DEPTH_TEST);
        m_quad->draw();
        glEnable(GL_DEPTH_TEST);

        m_programGaussianFirst.disableVertexAttribArrays();
        m_programGaussianFirst.unuse();
        break;

        // second gaussian pass
    case BLOOM_RENDER_STAGE_GAUSSIAN_SECOND:
        m_programGaussianSecond.use();
        m_programGaussianSecond.enableVertexAttribArrays();

        glDisable(GL_DEPTH_TEST);
        m_quad->draw();
        glEnable(GL_DEPTH_TEST);

        m_programGaussianSecond.disableVertexAttribArrays();
        m_programGaussianSecond.unuse();
        break;
    }

}



================================================
FILE: SoA/BloomRenderStage.h
================================================
/// 
///  BloomRenderStage.h
///  Seed of Andromeda
///
///  Created by Isaque Dutra on 2 June 2015
///  Copyright 2015 Regrowth Studios
///  MIT License
///  
///  This file implements a bloom render stage for
///  MainMenuRenderer.
///

#pragma once

#ifndef BloomRenderStage_h__
#define BloomRenderStage_h__

#include <Vorb/graphics/GLRenderTarget.h>
#include <Vorb/graphics/FullQuadVBO.h>
#include <Vorb/graphics/GLProgram.h>
#include "ShaderLoader.h"
#include "LoadContext.h"

#include "IRenderStage.h"


typedef enum {
    BLOOM_RENDER_STAGE_LUMA,
    BLOOM_RENDER_STAGE_GAUSSIAN_FIRST,
    BLOOM_RENDER_STAGE_GAUSSIAN_SECOND
} BloomRenderStagePass;

class BloomRenderStage : public IRenderStage {
public:

    void init(vui::GameWindow* window, StaticLoadContext& context) override;

    void setParams(ui32 gaussianN = 20, float gaussianVariance = 36.0f, float lumaThreshold = 0.75f);

    void load(StaticLoadContext& context) override;

    void hook(vg::FullQuadVBO* quad);

    void dispose(StaticLoadContext& context) override;

    /// Draws the render stage
    void render(const Camera* camera = nullptr) override;

private:
    float gauss(int i, float sigma2);
    void render(BloomRenderStagePass stage);

    vg::GLProgram m_programLuma, m_programGaussianFirst, m_programGaussianSecond;
    vg::FullQuadVBO* m_quad;    ///< For use in processing through data
    vg::GLRenderTarget m_fbo1, m_fbo2;
    ui32 m_gaussianN;           ///< Threshold for filtering image luma for bloom bluring
    float m_gaussianVariance;  ///< Radius number for gaussian blur. Must be less than 50.
    float m_lumaThreshold;     ///< Gaussian variance for blur pass
};

#endif // BloomRenderStage_h__

================================================
FILE: SoA/CAEngine.cpp
=====
Download .txt
gitextract__ur0a12_/

├── .gitattributes
├── .gitignore
├── .gitmodules
├── .mailmap
├── .travis.yml
├── CMakeLists.txt
├── LICENSE.txt
├── ModTest/
│   ├── ModTest.vcxproj
│   ├── ModTest.vcxproj.filters
│   └── main.cpp
├── ProjectConverter/
│   ├── App.Designer.cs
│   ├── App.config
│   ├── App.cs
│   ├── App.resx
│   ├── ProjectConverter.csproj
│   ├── ProjectConverter.sln
│   └── Properties/
│       └── AssemblyInfo.cs
├── README.md
├── SoA/
│   ├── AABBCollidableComponentUpdater.cpp
│   ├── AABBCollidableComponentUpdater.h
│   ├── ARProcessor.cpp
│   ├── ARProcessor.h
│   ├── AmbienceLibrary.cpp
│   ├── AmbienceLibrary.h
│   ├── AmbiencePlayer.cpp
│   ├── AmbiencePlayer.h
│   ├── AmbienceStream.cpp
│   ├── AmbienceStream.h
│   ├── Animation.h
│   ├── App.cpp
│   ├── App.h
│   ├── AtmosphereComponentRenderer.cpp
│   ├── AtmosphereComponentRenderer.h
│   ├── AxisRotationComponentUpdater.cpp
│   ├── AxisRotationComponentUpdater.h
│   ├── Biome.cpp
│   ├── Biome.h
│   ├── BlendState.h
│   ├── BlockData.cpp
│   ├── BlockData.h
│   ├── BlockLoader.cpp
│   ├── BlockLoader.h
│   ├── BlockPack.cpp
│   ├── BlockPack.h
│   ├── BlockTexture.cpp
│   ├── BlockTexture.h
│   ├── BlockTextureAtlas.h
│   ├── BlockTextureLoader.cpp
│   ├── BlockTextureLoader.h
│   ├── BlockTextureMethods.cpp
│   ├── BlockTextureMethods.h
│   ├── BlockTexturePack.cpp
│   ├── BlockTexturePack.h
│   ├── BloomRenderStage.cpp
│   ├── BloomRenderStage.h
│   ├── CAEngine.cpp
│   ├── CAEngine.h
│   ├── CMakeLists.txt
│   ├── Camera.cpp
│   ├── Camera.h
│   ├── CellularAutomataTask.cpp
│   ├── CellularAutomataTask.h
│   ├── Chunk.cpp
│   ├── Chunk.h
│   ├── ChunkAccessor.cpp
│   ├── ChunkAccessor.h
│   ├── ChunkAllocator.cpp
│   ├── ChunkAllocator.h
│   ├── ChunkGenerator.cpp
│   ├── ChunkGenerator.h
│   ├── ChunkGrid.cpp
│   ├── ChunkGrid.h
│   ├── ChunkGridRenderStage.cpp
│   ├── ChunkGridRenderStage.h
│   ├── ChunkHandle.h
│   ├── ChunkID.h
│   ├── ChunkIOManager.cpp
│   ├── ChunkIOManager.h
│   ├── ChunkMesh.cpp
│   ├── ChunkMesh.h
│   ├── ChunkMeshManager.cpp
│   ├── ChunkMeshManager.h
│   ├── ChunkMeshTask.cpp
│   ├── ChunkMeshTask.h
│   ├── ChunkMesher.cpp
│   ├── ChunkMesher.h
│   ├── ChunkQuery.cpp
│   ├── ChunkQuery.h
│   ├── ChunkRenderer.cpp
│   ├── ChunkRenderer.h
│   ├── ChunkSphereComponentUpdater.cpp
│   ├── ChunkSphereComponentUpdater.h
│   ├── ChunkUpdater.cpp
│   ├── ChunkUpdater.h
│   ├── ClientState.h
│   ├── CloseTerrainPatch.cpp
│   ├── CloudsComponentRenderer.cpp
│   ├── CloudsComponentRenderer.h
│   ├── Collision.cpp
│   ├── Collision.h
│   ├── CollisionComponentUpdater.cpp
│   ├── CollisionComponentUpdater.h
│   ├── ColorFilterRenderStage.cpp
│   ├── ColorFilterRenderStage.h
│   ├── ColoredFullQuadRenderer.cpp
│   ├── ColoredFullQuadRenderer.h
│   ├── CommonState.h
│   ├── Computer.cpp
│   ├── Computer.h
│   ├── ConsoleFuncs.h
│   ├── ConsoleMain.h
│   ├── ConsoleTests.cpp
│   ├── ConsoleTests.h
│   ├── Constants.h
│   ├── CutoutVoxelRenderStage.cpp
│   ├── CutoutVoxelRenderStage.h
│   ├── DLLAPI.h
│   ├── DLLLoader.h
│   ├── DebugRenderer.cpp
│   ├── DebugRenderer.h
│   ├── Density.cpp
│   ├── Density.h
│   ├── DevConsole.cpp
│   ├── DevConsole.h
│   ├── DevConsoleView.cpp
│   ├── DevConsoleView.h
│   ├── DevHudRenderStage.cpp
│   ├── DevHudRenderStage.h
│   ├── DevScreen.cpp
│   ├── DevScreen.h
│   ├── Doxyfile.in
│   ├── DualContouringMesher.cpp
│   ├── DualContouringMesher.h
│   ├── ECS Specs.txt
│   ├── ECSTemplates.cpp
│   ├── ECSTemplates.h
│   ├── Errors.cpp
│   ├── Errors.h
│   ├── ExposureCalcRenderStage.cpp
│   ├── ExposureCalcRenderStage.h
│   ├── FarTerrainComponentRenderer.cpp
│   ├── FarTerrainComponentRenderer.h
│   ├── FarTerrainComponentUpdater.cpp
│   ├── FarTerrainComponentUpdater.h
│   ├── FarTerrainPatch.cpp
│   ├── FarTerrainPatch.h
│   ├── Flora.cpp
│   ├── Flora.h
│   ├── FloraGenerator.cpp
│   ├── FloraGenerator.h
│   ├── FragFile.cpp
│   ├── FragFile.h
│   ├── FreeMoveComponentUpdater.cpp
│   ├── FreeMoveComponentUpdater.h
│   ├── Frustum.cpp
│   ├── Frustum.h
│   ├── FrustumComponentUpdater.cpp
│   ├── FrustumComponentUpdater.h
│   ├── GameManager.cpp
│   ├── GameManager.h
│   ├── GamePlayScreen.cpp
│   ├── GamePlayScreen.h
│   ├── GameRenderParams.cpp
│   ├── GameRenderParams.h
│   ├── GameSystem.cpp
│   ├── GameSystem.h
│   ├── GameSystemAssemblages.cpp
│   ├── GameSystemAssemblages.h
│   ├── GameSystemComponentBuilders.cpp
│   ├── GameSystemComponentBuilders.h
│   ├── GameSystemComponents.cpp
│   ├── GameSystemComponents.h
│   ├── GameSystemUpdater.cpp
│   ├── GameSystemUpdater.h
│   ├── GameplayLoadScreen.cpp
│   ├── GameplayLoadScreen.h
│   ├── GameplayRenderer.cpp
│   ├── GameplayRenderer.h
│   ├── GasGiantComponentRenderer.cpp
│   ├── GasGiantComponentRenderer.h
│   ├── GenerateTask.cpp
│   ├── GenerateTask.h
│   ├── GeometrySorter.cpp
│   ├── GeometrySorter.h
│   ├── HdrRenderStage.cpp
│   ├── HdrRenderStage.h
│   ├── HeadComponentUpdater.cpp
│   ├── HeadComponentUpdater.h
│   ├── IRenderStage.h
│   ├── ImageAssetLoader.cpp
│   ├── ImageAssetLoader.h
│   ├── IniParser.cpp
│   ├── IniParser.h
│   ├── InitScreen.cpp
│   ├── InitScreen.h
│   ├── InputMapper.cpp
│   ├── InputMapper.h
│   ├── Inputs.cpp
│   ├── Inputs.h
│   ├── Item.cpp
│   ├── Item.h
│   ├── LenseFlareRenderer.cpp
│   ├── LenseFlareRenderer.h
│   ├── LiquidData.h
│   ├── LiquidVoxelRenderStage.cpp
│   ├── LiquidVoxelRenderStage.h
│   ├── LoadBar.cpp
│   ├── LoadBar.h
│   ├── LoadContext.h
│   ├── LoadMonitor.cpp
│   ├── LoadMonitor.h
│   ├── LoadTaskBlockData.h
│   ├── LoadTaskGameManager.h
│   ├── LoadTaskStarSystem.h
│   ├── LoadTaskTextures.h
│   ├── MTRenderState.h
│   ├── MTRenderStateManager.cpp
│   ├── MTRenderStateManager.h
│   ├── MainMenuLoadScreen.cpp
│   ├── MainMenuLoadScreen.h
│   ├── MainMenuRenderer.cpp
│   ├── MainMenuRenderer.h
│   ├── MainMenuScreen.cpp
│   ├── MainMenuScreen.h
│   ├── MainMenuScriptedUI.cpp
│   ├── MainMenuScriptedUI.h
│   ├── MainMenuSystemViewer.cpp
│   ├── MainMenuSystemViewer.h
│   ├── MarchingCubesTable.h
│   ├── MaterialAtlas.h
│   ├── MaterialData.h
│   ├── MaterialStack.h
│   ├── MetaSection.cpp
│   ├── MetaSection.h
│   ├── ModInformation.h
│   ├── ModPathResolver.cpp
│   ├── ModPathResolver.h
│   ├── ModelMesher.cpp
│   ├── ModelMesher.h
│   ├── MusicPlayer.cpp
│   ├── MusicPlayer.h
│   ├── NightVisionRenderStage.cpp
│   ├── NightVisionRenderStage.h
│   ├── Noise.cpp
│   ├── Noise.h
│   ├── Octree.cpp
│   ├── Octree.h
│   ├── OpaqueVoxelRenderStage.cpp
│   ├── OpaqueVoxelRenderStage.h
│   ├── OptionsController.cpp
│   ├── OptionsController.h
│   ├── OrbitComponentRenderer.cpp
│   ├── OrbitComponentRenderer.h
│   ├── OrbitComponentUpdater.cpp
│   ├── OrbitComponentUpdater.h
│   ├── PDA.cpp
│   ├── PDA.h
│   ├── ParkourComponentUpdater.cpp
│   ├── ParkourComponentUpdater.h
│   ├── ParticleMesh.h
│   ├── PauseMenu.cpp
│   ├── PauseMenu.h
│   ├── PauseMenuRenderStage.cpp
│   ├── PauseMenuRenderStage.h
│   ├── PdaRenderStage.cpp
│   ├── PdaRenderStage.h
│   ├── PhysicsBlockRenderStage.cpp
│   ├── PhysicsBlockRenderStage.h
│   ├── PhysicsComponentUpdater.cpp
│   ├── PhysicsComponentUpdater.h
│   ├── Planet.cpp
│   ├── Planet.h
│   ├── PlanetGenData.cpp
│   ├── PlanetGenData.h
│   ├── PlanetGenLoader.cpp
│   ├── PlanetGenLoader.h
│   ├── PlanetGenerator.cpp
│   ├── PlanetGenerator.h
│   ├── PlanetHeightData.h
│   ├── PlanetRenderStage.cpp
│   ├── PlanetRenderStage.h
│   ├── PlanetRingsComponentRenderer.cpp
│   ├── PlanetRingsComponentRenderer.h
│   ├── Positional.h
│   ├── ProceduralChunkGenerator.cpp
│   ├── ProceduralChunkGenerator.h
│   ├── ProgramGenDelegate.h
│   ├── RegionFileManager.cpp
│   ├── RegionFileManager.h
│   ├── RenderUtils.h
│   ├── Resources/
│   │   └── resources.rc
│   ├── SOA.vcxproj
│   ├── SOA.vcxproj.filters
│   ├── SOA.vcxproj.yml
│   ├── ShaderAssetLoader.cpp
│   ├── ShaderAssetLoader.h
│   ├── ShaderLoader.cpp
│   ├── ShaderLoader.h
│   ├── SkyboxRenderStage.cpp
│   ├── SkyboxRenderStage.h
│   ├── SkyboxRenderer.cpp
│   ├── SkyboxRenderer.h
│   ├── SmartVoxelContainer.hpp
│   ├── SoAState.h
│   ├── SoaController.cpp
│   ├── SoaController.h
│   ├── SoaEngine.cpp
│   ├── SoaEngine.h
│   ├── SoaFileSystem.cpp
│   ├── SoaFileSystem.h
│   ├── SoaOptions.cpp
│   ├── SoaOptions.h
│   ├── SoaState.cpp
│   ├── SonarRenderStage.cpp
│   ├── SonarRenderStage.h
│   ├── SpaceSystem.cpp
│   ├── SpaceSystem.h
│   ├── SpaceSystemAssemblages.cpp
│   ├── SpaceSystemAssemblages.h
│   ├── SpaceSystemComponentBuilders.cpp
│   ├── SpaceSystemComponentBuilders.h
│   ├── SpaceSystemComponentTables.cpp
│   ├── SpaceSystemComponentTables.h
│   ├── SpaceSystemComponents.h
│   ├── SpaceSystemLoadStructs.cpp
│   ├── SpaceSystemLoadStructs.h
│   ├── SpaceSystemLoader.cpp
│   ├── SpaceSystemLoader.h
│   ├── SpaceSystemRenderStage.cpp
│   ├── SpaceSystemRenderStage.h
│   ├── SpaceSystemUpdater.cpp
│   ├── SpaceSystemUpdater.h
│   ├── SphericalHeightmapGenerator.cpp
│   ├── SphericalHeightmapGenerator.h
│   ├── SphericalTerrainComponentRenderer.cpp
│   ├── SphericalTerrainComponentRenderer.h
│   ├── SphericalTerrainComponentUpdater.cpp
│   ├── SphericalTerrainComponentUpdater.h
│   ├── SphericalVoxelComponentUpdater.cpp
│   ├── SphericalVoxelComponentUpdater.h
│   ├── SsaoRenderStage.cpp
│   ├── SsaoRenderStage.h
│   ├── StarComponentRenderer.cpp
│   ├── StarComponentRenderer.h
│   ├── Startup.cpp
│   ├── Startup.h
│   ├── SystemARRenderer.cpp
│   ├── SystemARRenderer.h
│   ├── SystemBodyLoader.cpp
│   ├── SystemBodyLoader.h
│   ├── TerrainGenTextures.cpp
│   ├── TerrainGenTextures.h
│   ├── TerrainPatch.cpp
│   ├── TerrainPatch.h
│   ├── TerrainPatchConstants.h
│   ├── TerrainPatchMesh.cpp
│   ├── TerrainPatchMesh.h
│   ├── TerrainPatchMeshManager.cpp
│   ├── TerrainPatchMeshManager.h
│   ├── TerrainPatchMeshTask.cpp
│   ├── TerrainPatchMeshTask.h
│   ├── TerrainPatchMesher.cpp
│   ├── TerrainPatchMesher.h
│   ├── TestBiomeScreen.cpp
│   ├── TestBiomeScreen.h
│   ├── TestBlockViewScreen.cpp
│   ├── TestBlockViewScreen.h
│   ├── TestConnectedTextureScreen.cpp
│   ├── TestConnectedTextureScreen.h
│   ├── TestConsoleScreen.cpp
│   ├── TestConsoleScreen.h
│   ├── TestDeferredScreen.cpp
│   ├── TestDeferredScreen.h
│   ├── TestDisplacementMappingScreen.cpp
│   ├── TestDisplacementMappingScreen.h
│   ├── TestGasGiantScreen.cpp
│   ├── TestGasGiantScreen.h
│   ├── TestMappingScreen.cpp
│   ├── TestMappingScreen.h
│   ├── TestNewBlockAPIScreen.cpp
│   ├── TestNewBlockAPIScreen.h
│   ├── TestNoiseScreen.cpp
│   ├── TestNoiseScreen.h
│   ├── TestPlanetGenScreen.cpp
│   ├── TestPlanetGenScreen.h
│   ├── TestScriptScreen.cpp
│   ├── TestScriptScreen.h
│   ├── TestStarScreen.cpp
│   ├── TestStarScreen.h
│   ├── TestUIScreen.cpp
│   ├── TestUIScreen.h
│   ├── TestVoxelModelScreen.cpp
│   ├── TestVoxelModelScreen.h
│   ├── Thread.h
│   ├── TransparentVoxelRenderStage.cpp
│   ├── TransparentVoxelRenderStage.h
│   ├── VRayHelper.cpp
│   ├── VRayHelper.h
│   ├── Vertex.h
│   ├── VirtualKeyKegDef.inl
│   ├── VoxPool.cpp
│   ├── VoxPool.h
│   ├── VoxelBits.h
│   ├── VoxelCoordinateSpaces.h
│   ├── VoxelEditor.cpp
│   ├── VoxelEditor.h
│   ├── VoxelLightEngine.cpp
│   ├── VoxelLightEngine.h
│   ├── VoxelMatrix.cpp
│   ├── VoxelMatrix.h
│   ├── VoxelMesh.h
│   ├── VoxelMesher.cpp
│   ├── VoxelMesher.h
│   ├── VoxelModel.cpp
│   ├── VoxelModel.h
│   ├── VoxelModelLoader.cpp
│   ├── VoxelModelLoader.h
│   ├── VoxelModelMesh.cpp
│   ├── VoxelModelMesh.h
│   ├── VoxelModelRenderer.cpp
│   ├── VoxelModelRenderer.h
│   ├── VoxelNavigation.inl
│   ├── VoxelNodeSetter.cpp
│   ├── VoxelNodeSetter.h
│   ├── VoxelNodeSetterTask.cpp
│   ├── VoxelNodeSetterTask.h
│   ├── VoxelRay.cpp
│   ├── VoxelRay.h
│   ├── VoxelSpaceConversions.cpp
│   ├── VoxelSpaceConversions.h
│   ├── VoxelSpaceUtils.cpp
│   ├── VoxelSpaceUtils.h
│   ├── VoxelUpdateBufferer.h
│   ├── VoxelUpdateOrder.inl
│   ├── VoxelUtils.h
│   ├── VoxelVertices.h
│   ├── WSO.cpp
│   ├── WSO.h
│   ├── WSOAtlas.cpp
│   ├── WSOAtlas.h
│   ├── WSOData.h
│   ├── WSOScanner.cpp
│   ├── WSOScanner.h
│   ├── WorldIO.cpp
│   ├── WorldIO.h
│   ├── WorldStructs.cpp
│   ├── WorldStructs.h
│   ├── ZipFile.cpp
│   ├── ZipFile.h
│   ├── app.config
│   ├── atomicops.h
│   ├── errorlog.txt
│   ├── main.cpp
│   ├── qef.cpp
│   ├── qef.h
│   ├── readerwriterqueue.h
│   ├── soaUtils.h
│   ├── stdafx.cpp
│   ├── stdafx.h
│   ├── svd.cpp
│   ├── svd.h
│   └── textureUtils.h
├── VorbCopy.bat
├── appveyor.yml
├── build.bat
├── build.sh
├── cmake/
│   └── hunter/
│       ├── HunterGate.cmake
│       ├── cache.cmake
│       └── passwords.cmake
├── jenkins.py
├── scripts/
│   ├── ShowPredefined.cpp
│   ├── append-boost-config-macros.cmake.in
│   ├── autotools-merge-lipo.cmake.in
│   ├── clear-all.cmake
│   ├── clear-all.sh
│   ├── copy-files.cmake
│   ├── create-predefined-list.py
│   ├── create-toolchain-info.cmake
│   ├── find_python.cmake
│   ├── link-all.cmake
│   ├── link-all.py
│   ├── pkgconfig-export-targets.cmake.in
│   ├── predefined.list
│   ├── try-copy-license.cmake
│   └── upload-cache-to-github.py
└── utils/
    └── git-hooks/
        ├── commit-msg
        ├── commit-msg_check-spelling
        ├── cpplint/
        │   ├── __init__.py
        │   └── cpplint.py
        ├── pep8.py
        ├── pre-commit
        ├── pre-commit_check-for-cpp-style
        ├── pre-commit_check-for-pdb
        ├── pre-commit_pep8
        ├── pre-commit_pretty-xml
        ├── pre-commit_strip-eol-spaces
        └── pre-commit_tabs-to-spaces
Download .txt
SYMBOL INDEX (1276 symbols across 336 files)

FILE: ModTest/main.cpp
  function BOOL (line 6) | BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserv...
  function getCode (line 30) | __declspec(dllexport) int getCode() {

FILE: ProjectConverter/App.Designer.cs
  class App (line 2) | partial class App {
    method Dispose (line 12) | protected override void Dispose(bool disposing) {
    method InitializeComponent (line 25) | private void InitializeComponent() {

FILE: ProjectConverter/App.cs
  class App (line 15) | public partial class App : Form {
    method App (line 22) | public App() {
    method RebuildProcessList (line 30) | void RebuildProcessList() {
    method GetTrackMap (line 46) | List<FileInfo> GetTrackMap() {
    method VSProcessWaiter (line 56) | void VSProcessWaiter() {
    method VSProcessPoller (line 69) | void VSProcessPoller() {
    method CreateProcessThreads (line 82) | void CreateProcessThreads() {
    method TerminateProcessThreads (line 91) | void TerminateProcessThreads() {
    method Convert (line 101) | void Convert(FileInfo fi) {
    method comboBox1_SelectedIndexChanged (line 133) | private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) {
    method comboBox1_DropDown (line 147) | void comboBox1_DropDown(object sender, System.EventArgs e) {
    method checkBox1_CheckedChanged (line 151) | private void checkBox1_CheckedChanged(object sender, EventArgs e) {
    method button1_Click (line 162) | private void button1_Click(object sender, EventArgs e) {
    method button2_Click (line 177) | private void button2_Click(object sender, EventArgs e) {
    class FileNameComparer (line 186) | class FileNameComparer : IEqualityComparer<FileInfo> {
      method Equals (line 187) | public bool Equals(FileInfo x, FileInfo y) {
      method GetHashCode (line 190) | public int GetHashCode(FileInfo obj) {
    method Main (line 195) | [STAThread]

FILE: SoA/AABBCollidableComponentUpdater.h
  type AabbCollidableComponent (line 22) | struct AabbCollidableComponent
  function class (line 24) | class AABBCollidableComponentUpdater {

FILE: SoA/ARProcessor.h
  function class (line 18) | class ARProcessor {

FILE: SoA/AmbienceLibrary.cpp
  function AmbienceList (line 8) | const AmbienceList& AmbienceLibrary::getTracks(const nString& name) const {

FILE: SoA/AmbienceLibrary.h
  type std (line 21) | typedef std::unordered_map<nString, vpath> AmbienceList;
  function class (line 24) | class AmbienceLibrary {

FILE: SoA/AmbiencePlayer.h
  function class (line 30) | class AmbiencePlayer {

FILE: SoA/AmbienceStream.cpp
  function f32 (line 4) | const f32& AmbienceStream::getVolume() const {

FILE: SoA/AmbienceStream.h
  function class (line 20) | class AmbienceStream {

FILE: SoA/Animation.h
  type Animation (line 8) | struct Animation {

FILE: SoA/AtmosphereComponentRenderer.h
  type AtmosphereComponent (line 24) | struct AtmosphereComponent
  type SpaceLightComponent (line 25) | struct SpaceLightComponent
  function class (line 27) | class AtmosphereComponentRenderer {

FILE: SoA/AxisRotationComponentUpdater.h
  function class (line 22) | class AxisRotationComponentUpdater {

FILE: SoA/Biome.cpp
  function KEG_TYPE_DEF_SAME_NAME (line 4) | KEG_TYPE_DEF_SAME_NAME(BiomeFloraKegProperties, kt) {
  function KEG_TYPE_DEF_SAME_NAME (line 10) | KEG_TYPE_DEF_SAME_NAME(BiomeTreeKegProperties, kt) {

FILE: SoA/Biome.h
  type PlanetGenData (line 20) | struct PlanetGenData
  type BiomeTree (line 23) | struct BiomeTree {
  type BiomeFloraKegProperties (line 29) | struct BiomeFloraKegProperties {
  type BiomeTreeKegProperties (line 35) | struct BiomeTreeKegProperties {
  type BiomeFlora (line 42) | struct BiomeFlora {
  type BlockLayer (line 48) | struct BlockLayer {
  type nString (line 57) | typedef nString BiomeID;
  type Biome (line 58) | struct Biome
  type BiomeInfluence (line 60) | struct BiomeInfluence {
  type std (line 73) | typedef std::vector<std::vector<BiomeInfluence>> BiomeInfluenceMap;
  function genData (line 77) | genData(nullptr){}

FILE: SoA/BlendState.h
  type BlendEquationMode (line 3) | enum BlendEquationMode {
  type BlendingFactorSrc (line 10) | enum BlendingFactorSrc {
  type BlendingFactorDest (line 31) | enum BlendingFactorDest {
  function class (line 53) | class BlendFunction {
  function class (line 63) | class BlendState {

FILE: SoA/BlockData.cpp
  function KEG_ENUM_DEF (line 10) | KEG_ENUM_DEF(BlockOcclusion, BlockOcclusion, e) {
  function KEG_TYPE_DEF_SAME_NAME (line 18) | KEG_TYPE_DEF_SAME_NAME(Block, kt) {

FILE: SoA/BlockData.h
  function BlockOcclusion (line 23) | enum class BlockOcclusion {
  function ui32 (line 49) | const ui32& operator[] (const i32& i) const {
  type nString (line 54) | typedef nString BlockIdentifier;
  type ui16 (line 56) | typedef ui16 BlockID;
  function class (line 58) | class Block

FILE: SoA/BlockLoader.cpp
  function readStr (line 303) | void readStr(vio::FileStream& fs, char* buf) {

FILE: SoA/BlockLoader.h
  function class (line 14) | class GameBlockPostProcess {
  function class (line 26) | class BlockLoader

FILE: SoA/BlockPack.cpp
  function BlockID (line 29) | BlockID BlockPack::append(Block& block) {

FILE: SoA/BlockPack.h
  function class (line 24) | class BlockPack {

FILE: SoA/BlockTexture.cpp
  function KEG_ENUM_DEF (line 6) | KEG_ENUM_DEF(ConnectedTextureReducedMethod, ConnectedTextureReducedMetho...
  function KEG_ENUM_DEF (line 11) | KEG_ENUM_DEF(BlendType, BlendType, e) {
  function KEG_ENUM_DEF (line 18) | KEG_ENUM_DEF(ConnectedTextureMethods, ConnectedTextureMethods, e) {
  function KEG_ENUM_DEF (line 28) | KEG_ENUM_DEF(ConnectedTextureSymmetry, ConnectedTextureSymmetry, e) {
  function KEG_TYPE_DEF_SAME_NAME (line 34) | KEG_TYPE_DEF_SAME_NAME(BlockTexture, kt) {

FILE: SoA/BlockTexture.h
  type BlockColorMap (line 26) | struct BlockColorMap
  type class (line 28) | enum class
  type class (line 40) | enum class
  function ConnectedTextureReducedMethod (line 47) | enum class ConnectedTextureReducedMethod {

FILE: SoA/BlockTextureAtlas.h
  function class (line 7) | class BlockTextureIndex {
  function class (line 31) | class BlockTextureAtlas {

FILE: SoA/BlockTextureLoader.h
  type BlockTexture (line 29) | struct BlockTexture
  type BlockTextureNames (line 31) | struct BlockTextureNames {
  function class (line 35) | class BlockTextureLoader {

FILE: SoA/BlockTextureMethods.cpp
  function ui32 (line 21) | inline ui32 getPositionSeed(const i32v3& pos) {

FILE: SoA/BlockTextureMethods.h
  type ui32 (line 25) | typedef ui32 BlockTextureIndex;
  function class (line 27) | class BlockTextureMethodParams {
  function set (line 39) | void set(const BlockTextureLayer* blockTextureLayer, ui32 typeIndex, Col...
  type BlockTextureMethodData (line 56) | struct BlockTextureMethodData {
  type std (line 61) | typedef std::function <void(BlockTextureMethodParams& params, BlockTextu...
  function namespace (line 63) | namespace BlockTextureMethods {

FILE: SoA/BlockTexturePack.cpp
  function BlockTextureIndex (line 49) | BlockTextureIndex BlockTexturePack::addLayer(const BlockTextureLayer& la...
  function AtlasTextureDescription (line 129) | AtlasTextureDescription BlockTexturePack::findLayer(const nString& fileP...
  function BlockTexture (line 137) | BlockTexture* BlockTexturePack::findTexture(const nString& filePath) {
  function BlockTexture (line 146) | BlockTexture* BlockTexturePack::getNextFreeTexture(const nString& filePa...
  function BlockColorMap (line 152) | BlockColorMap* BlockTexturePack::getColorMap(const nString& path) {
  function BlockColorMap (line 158) | BlockColorMap* BlockTexturePack::setColorMap(const nString& name, const ...
  function BlockColorMap (line 167) | BlockColorMap* BlockTexturePack::setColorMap(const nString& name, const ...
  function nString (line 243) | nString getName(nString name) {

FILE: SoA/BlockTexturePack.h
  type SphericalVoxelComponent (line 26) | struct SphericalVoxelComponent
  type AtlasTextureDescription (line 30) | struct AtlasTextureDescription {
  type BlockColorMap (line 38) | struct BlockColorMap {
  function class (line 42) | class BlockTexturePack {

FILE: SoA/BloomRenderStage.h
  type BloomRenderStagePass (line 27) | typedef enum {
  function class (line 33) | class BloomRenderStage : public IRenderStage {

FILE: SoA/CAEngine.cpp
  function KEG_ENUM_DEF (line 17) | KEG_ENUM_DEF(CAAlgorithm, CAAlgorithm, kt) {
  function KEG_TYPE_DEF_SAME_NAME (line 23) | KEG_TYPE_DEF_SAME_NAME(CaPhysicsData, kt) {
  function _chunk (line 67) | _chunk(nullptr)

FILE: SoA/CAEngine.h
  function class (line 20) | class CaPhysicsData {
  type std (line 28) | typedef std::map<nString, CaPhysicsType*> CaPhysicsTypeDict;
  type std (line 29) | typedef std::vector<CaPhysicsType*> CaPhysicsTypeList;
  function class (line 31) | class CaPhysicsType {
  function class (line 67) | class CAEngine {

FILE: SoA/Camera.cpp
  function f32v3 (line 111) | f32v3 Camera::worldToScreenPoint(const f32v3& worldPoint) const {
  function f32v3 (line 122) | f32v3 Camera::worldToScreenPointLogZ(const f32v3& worldPoint, f32 zFar) ...
  function f32v3 (line 133) | f32v3 Camera::worldToScreenPoint(const f64v3& worldPoint) const {
  function f32v3 (line 144) | f32v3 Camera::worldToScreenPointLogZ(const f64v3& worldPoint, f64 zFar) ...
  function f32v3 (line 155) | f32v3 Camera::getPickRay(const f32v2& ndcScreenPos) const {

FILE: SoA/Camera.h
  function class (line 4) | class Camera
  function class (line 86) | class CinematicCamera : public Camera

FILE: SoA/CellularAutomataTask.h
  type class (line 31) | enum class
  function class (line 37) | class CellularAutomataTask : public vcore::IThreadPoolTask<WorkerData> {

FILE: SoA/Chunk.h
  type Chunk (line 34) | typedef Chunk* ChunkPtr;
  type ui16 (line 37) | typedef ui16 BlockIndex;
  function class (line 39) | class ChunkGridData {
  function class (line 57) | class Chunk {

FILE: SoA/ChunkAccessor.cpp
  function ChunkHandle (line 19) | ChunkHandle& ChunkHandle::operator= (const ChunkHandle& other) {
  function ChunkHandle (line 30) | ChunkHandle ChunkHandle::acquire() {
  function ChunkHandle (line 53) | ChunkHandle ChunkAccessor::acquire(ChunkID id) {
  function ChunkHandle (line 72) | ChunkHandle ChunkAccessor::acquire(ChunkHandle& chunk) {
  function ChunkHandle (line 127) | ChunkHandle ChunkAccessor::acquire(ChunkID id) {
  function ChunkHandle (line 136) | ChunkHandle ChunkAccessor::acquire(ChunkHandle& chunk) {
  function ChunkHandle (line 164) | ChunkHandle ChunkAccessor::safeAdd(ChunkID id, bool& wasOld) {

FILE: SoA/ChunkAccessor.h
  function class (line 23) | class ChunkAccessor {

FILE: SoA/ChunkAllocator.cpp
  function Chunk (line 22) | Chunk* PagedChunkAllocator::alloc() {

FILE: SoA/ChunkAllocator.h
  function class (line 25) | class PagedChunkAllocator {

FILE: SoA/ChunkGenerator.h
  type ChunkGenQueryData (line 31) | struct ChunkGenQueryData {
  function class (line 40) | class ChunkGenerator {

FILE: SoA/ChunkGrid.cpp
  function ChunkQuery (line 35) | ChunkQuery* ChunkGrid::submitQuery(const i32v3& chunkPos, ChunkGenLevel ...
  function ChunkGridData (line 65) | ChunkGridData* ChunkGrid::getChunkGridData(const i32v2& gridPos) {

FILE: SoA/ChunkGrid.h
  function class (line 33) | class ChunkGrid {

FILE: SoA/ChunkGridRenderStage.h
  type ChunkGridVertex (line 28) | struct ChunkGridVertex {
  function class (line 35) | class ChunkGridRenderStage : public IRenderStage {

FILE: SoA/ChunkHandle.h
  function class (line 22) | class ChunkHandle {

FILE: SoA/ChunkID.h
  type ChunkID (line 21) | struct ChunkID {

FILE: SoA/ChunkIOManager.h
  function class (line 12) | class ChunkIOManager{

FILE: SoA/ChunkMesh.cpp
  function KEG_ENUM_DEF (line 8) | KEG_ENUM_DEF(MeshType, MeshType, e) {

FILE: SoA/ChunkMesh.h
  function MeshType (line 8) | enum class MeshType {
  function class (line 85) | class ChunkMeshData
  function class (line 110) | class ChunkMesh

FILE: SoA/ChunkMeshManager.cpp
  function ChunkMesh (line 65) | ChunkMesh* ChunkMeshManager::createMesh(ChunkHandle& h) {
  function ChunkMeshTask (line 90) | ChunkMeshTask* ChunkMeshManager::createMeshTask(ChunkHandle& chunk) {

FILE: SoA/ChunkMeshManager.h
  type ChunkMeshUpdateMessage (line 25) | struct ChunkMeshUpdateMessage {
  function class (line 30) | class ChunkMeshManager {

FILE: SoA/ChunkMeshTask.h
  type class (line 32) | enum class
  type MeshNeighborHandles (line 34) | enum MeshNeighborHandles {
  function class (line 47) | class ChunkMeshTask : public vcore::IThreadPoolTask<WorkerData> {

FILE: SoA/ChunkMesher.cpp
  function CALLER_DELETE (line 546) | CALLER_DELETE ChunkMeshData* ChunkMesher::createChunkMeshData(MeshTaskTy...
  function mapBufferData (line 662) | inline bool mapBufferData(GLuint& vboID, GLsizeiptr size, void* src, GLe...

FILE: SoA/ChunkMesher.h
  type BlockTexture (line 11) | struct BlockTexture
  type PlanetHeightData (line 12) | struct PlanetHeightData
  type FloraQuadData (line 13) | struct FloraQuadData
  function class (line 29) | class ChunkMesher {

FILE: SoA/ChunkQuery.h
  type ChunkGenLevel (line 23) | enum ChunkGenLevel { GEN_NONE = 0, GEN_TERRAIN, GEN_FLORA, GEN_SCRIPT, G...
  function class (line 27) | class ChunkQuery {

FILE: SoA/ChunkRenderer.h
  function class (line 15) | class ChunkRenderer {

FILE: SoA/ChunkSphereComponentUpdater.cpp
  function ChunkHandle (line 200) | ChunkHandle ChunkSphereComponentUpdater::submitAndConnect(ChunkSphereCom...

FILE: SoA/ChunkSphereComponentUpdater.h
  function class (line 25) | class ChunkSphereComponentUpdater {

FILE: SoA/ChunkUpdater.h
  type class (line 13) | enum class
  function class (line 15) | class ChunkUpdater {

FILE: SoA/ClientState.h
  type ClientState (line 29) | struct ClientState {

FILE: SoA/CloseTerrainPatch.cpp
  function BilinearInterpolation (line 14) | inline double BilinearInterpolation(int &a, int &b, int &c, int &d, int ...

FILE: SoA/CloudsComponentRenderer.h
  type AtmosphereComponent (line 9) | struct AtmosphereComponent
  type AxisRotationComponent (line 10) | struct AxisRotationComponent
  type CloudsComponent (line 11) | struct CloudsComponent
  type SpaceLightComponent (line 12) | struct SpaceLightComponent
  function class (line 14) | class CloudsComponentRenderer

FILE: SoA/CollisionComponentUpdater.h
  function class (line 20) | class CollisionComponentUpdater {

FILE: SoA/ColorFilterRenderStage.h
  function class (line 22) | class ColorFilterRenderStage : public IRenderStage {

FILE: SoA/ColoredFullQuadRenderer.h
  function class (line 23) | class ColoredFullQuadRenderer {

FILE: SoA/CommonState.h
  type SoaState (line 26) | struct SoaState
  function DECL_VUI (line 27) | DECL_VSOUND(class Engine)

FILE: SoA/Computer.h
  function class (line 18) | class Computer {

FILE: SoA/ConsoleFuncs.h
  function loadDLL (line 35) | int loadDLL(const cString name) {
  function initState (line 54) | void initState(SoaState* s, const cString spaceSystemDir) {
  function stopGame (line 70) | void stopGame(std::thread* t) {
  function setStartingPlanet (line 91) | void setStartingPlanet(SoaState* s, vecs::EntityID eID) {

FILE: SoA/ConsoleMain.h
  type ConsolePrinter (line 38) | struct ConsolePrinter {
  function out (line 52) | void out(Sender, const cString msg) {
  function err (line 56) | void err(Sender, const cString msg) {

FILE: SoA/ConsoleTests.cpp
  type ChunkAccessSpeedData (line 10) | struct ChunkAccessSpeedData {
  function ChunkAccessSpeedData (line 24) | ChunkAccessSpeedData* createCASData(size_t numThreads, size_t requestCou...
  function runCAS (line 78) | void runCAS(ChunkAccessSpeedData* data) {
  function freeCAS (line 83) | void freeCAS(ChunkAccessSpeedData* data) {
  function runCHS (line 93) | void runCHS() {

FILE: SoA/ConsoleTests.h
  type ChunkAccessSpeedData (line 23) | struct ChunkAccessSpeedData

FILE: SoA/CutoutVoxelRenderStage.h
  function class (line 29) | class CutoutVoxelRenderStage : public IRenderStage {

FILE: SoA/DLLAPI.h
  function namespace (line 9) | namespace DLLAPI {

FILE: SoA/DebugRenderer.cpp
  class Vec3KeyFuncs (line 46) | class Vec3KeyFuncs {
  function f32v3 (line 209) | inline f32v3 findMidpoint(const f32v3& vertex1, const f32v3& vertex2) {

FILE: SoA/DebugRenderer.h
  type SimpleMeshVertex (line 45) | struct SimpleMeshVertex {
  type SimpleMesh (line 50) | struct SimpleMesh {
  type Icosphere (line 55) | struct Icosphere {
  type Cube (line 63) | struct Cube {
  type Line (line 70) | struct Line {
  type DebugRenderContext (line 77) | struct DebugRenderContext {
  function class (line 83) | class DebugRenderer {

FILE: SoA/Density.cpp
  function Sphere (line 9) | float Sphere(const f32v3& worldPosition, const f32v3& origin, float radi...
  function Cuboid (line 15) | float Cuboid(const f32v3& worldPosition, const f32v3& origin, const f32v...
  function FractalNoise (line 26) | float FractalNoise(
  function Density_Func (line 51) | float Density_Func(const f32v3& worldPosition) {

FILE: SoA/DevConsole.cpp
  function nString (line 91) | const nString& DevConsole::getHistory(const i32& index) {
  function nString (line 95) | nString DevConsole::getFirstToken(nString input) {

FILE: SoA/DevConsole.h
  type vorb (line 5) | typedef vorb::ring_buffer<nString> CommandRing;
  function class (line 8) | class DevConsole {

FILE: SoA/DevConsoleView.h
  type vorb (line 14) | typedef vorb::ring_buffer<nString> StringRing;
  function class (line 19) | class DevConsoleView {

FILE: SoA/DevHudRenderStage.h
  function DevUiModes (line 42) | enum class DevUiModes {

FILE: SoA/DevScreen.cpp
  function i32 (line 16) | i32 DevScreen::getNextScreen() const {
  function i32 (line 20) | i32 DevScreen::getPreviousScreen() const {

FILE: SoA/DualContouringMesher.h
  function class (line 25) | class DualContouringMesher {

FILE: SoA/ECSTemplates.h
  function class (line 20) | class ECSComponentBuilder {
  function class (line 34) | class ECSTemplate {
  function class (line 46) | class ECSTemplateLibrary {

FILE: SoA/Errors.cpp
  function showMessage (line 11) | void showMessage(const nString& message VORB_MAYBE_UNUSED)
  function showYesNoBox (line 26) | int showYesNoBox(const nString& message VORB_MAYBE_UNUSED)
  function showYesNoCancelBox (line 44) | int showYesNoCancelBox(const nString& message VORB_MAYBE_UNUSED)
  function nString (line 62) | nString getFullPath(const char *initialDir)
  function pError (line 76) | void pError(const char *message)
  function pError (line 90) | void pError(const nString& message)
  function checkGlError (line 105) | bool checkGlError(const nString& errorLocation) {

FILE: SoA/ExposureCalcRenderStage.h
  function class (line 29) | class ExposureCalcRenderStage : public IRenderStage {

FILE: SoA/FarTerrainComponentRenderer.h
  type AtmosphereComponent (line 22) | struct AtmosphereComponent
  type AxisRotationComponent (line 23) | struct AxisRotationComponent
  type FarTerrainComponent (line 24) | struct FarTerrainComponent
  type NamePositionComponent (line 25) | struct NamePositionComponent
  type SpaceLightComponent (line 26) | struct SpaceLightComponent
  type SphericalTerrainComponent (line 27) | struct SphericalTerrainComponent
  function class (line 29) | class FarTerrainComponentRenderer {

FILE: SoA/FarTerrainComponentUpdater.h
  type FarTerrainComponent (line 19) | struct FarTerrainComponent
  function class (line 30) | class FarTerrainComponentUpdater {

FILE: SoA/FarTerrainPatch.h
  function class (line 21) | class FarTerrainPatch : public TerrainPatch {

FILE: SoA/Flora.cpp
  function KEG_ENUM_DEF (line 4) | KEG_ENUM_DEF(FloraInterpType, FloraInterpType, e) {
  function KEG_ENUM_DEF (line 15) | KEG_ENUM_DEF(TreeLeafType, TreeLeafType, e) {
  function KEG_ENUM_DEF (line 22) | KEG_ENUM_DEF(FloraDir, FloraDir, e) {

FILE: SoA/Flora.h
  type ui16 (line 23) | typedef ui16 FloraID;
  type class (line 27) | enum class
  type class (line 35) | enum class
  type TreeTypeFruitProperties (line 43) | struct TreeTypeFruitProperties {
  type TreeFruitProperties (line 47) | struct TreeFruitProperties {
  type TreeTypeLeafProperties (line 52) | struct TreeTypeLeafProperties {
  type TreeLeafProperties (line 82) | struct TreeLeafProperties {
  type TreeTypeBranchProperties (line 113) | struct TreeTypeBranchProperties {
  type TreeBranchProperties (line 126) | struct TreeBranchProperties {
  type TreeTypeTrunkProperties (line 140) | struct TreeTypeTrunkProperties {
  type TreeTrunkProperties (line 154) | struct TreeTrunkProperties {
  type TreeTypeBranchVolumeProperties (line 169) | struct TreeTypeBranchVolumeProperties {
  type BranchVolumeProperties (line 175) | struct BranchVolumeProperties {
  type NTreeType (line 183) | struct NTreeType {
  type TreeData (line 197) | struct TreeData {
  type class (line 209) | enum class
  type FloraType (line 214) | struct FloraType {
  type FloraData (line 224) | struct FloraData {

FILE: SoA/FloraGenerator.cpp
  function offsetPositive (line 19) | inline void offsetPositive(int& x, int x1, ui32& chunkOffset, int offset) {
  function offsetNegative (line 24) | inline void offsetNegative(int& x, int x1, ui32& chunkOffset, int offset) {
  function offsetNegative (line 32) | inline void offsetNegative(int& x, int& y, int x1, int y1, ui32& chunkOf...
  function offsetNegative (line 43) | inline void offsetNegative(int& x, int& y, int& z, ui32& chunkOffset, in...
  function addChunkOffset (line 57) | inline void addChunkOffset(i32v2& pos, ui32& chunkOffset) {
  function addChunkOffset (line 63) | inline void addChunkOffset(i32v3& pos, ui32& chunkOffset) {
  function offsetAxis (line 72) | inline void offsetAxis(int& x, int x1, ui32& chunkOffset, int offset) {
  function offsetByPos (line 85) | inline void offsetByPos(int& x, int& y, int& z, ui32& chunkOffset, const...
  function offsetByPos (line 114) | inline void offsetByPos(int& x, int& y, int& z, ui32& chunkOffset, const...
  function smoothInterpFactor (line 151) | inline void smoothInterpFactor(f32& l, const FloraInterpType& type) {
  function lerpFruitProperties (line 202) | inline void lerpFruitProperties(TreeFruitProperties& rvProps, const Tree...
  function lerpLeafProperties (line 211) | inline void lerpLeafProperties(TreeLeafProperties& rvProps, const TreeLe...
  function lerpBranchProperties (line 270) | inline void lerpBranchProperties(TreeBranchProperties& rvProps, const Tr...
  function lerpTrunkProperties (line 294) | inline void lerpTrunkProperties(TreeTrunkProperties& rvProps, const Tree...
  type DirLookup (line 320) | struct DirLookup {
  function setFruitProps (line 543) | inline void setFruitProps(TreeFruitProperties& fruitProps, const TreeTyp...
  function setLeafProps (line 548) | inline void setLeafProps(TreeLeafProperties& leafProps, const TreeTypeLe...
  function setBranchProps (line 580) | inline void setBranchProps(TreeBranchProperties& branchProps, const Tree...
  function f32 (line 879) | inline f32 fastFloorf(f32 x) {
  function f32 (line 882) | inline f32 fastCeilf(f32 x) {

FILE: SoA/FloraGenerator.h
  type PlanetGenData (line 25) | struct PlanetGenData
  type FloraNode (line 28) | struct FloraNode {
  type SCRayNode (line 40) | struct SCRayNode {
  type SCTreeNode (line 50) | struct SCTreeNode {
  type NodeField (line 57) | struct NodeField {
  type LeavesToPlace (line 66) | struct LeavesToPlace {
  type BranchToGenerate (line 75) | struct BranchToGenerate {
  function class (line 87) | class FloraGenerator {

FILE: SoA/FragFile.cpp
  class FragBlockHeader (line 5) | class FragBlockHeader {
  class FragHeader (line 15) | class FragHeader {
  function i32 (line 53) | i32 FragFile::getDataPathSize() const {

FILE: SoA/FragFile.h
  function class (line 9) | class FragFile {

FILE: SoA/FreeMoveComponentUpdater.h
  type FreeMoveInputComponent (line 20) | struct FreeMoveInputComponent
  function class (line 22) | class FreeMoveComponentUpdater {

FILE: SoA/Frustum.h
  function class (line 20) | class Frustum {

FILE: SoA/FrustumComponentUpdater.h
  function class (line 22) | class FrustumComponentUpdater {

FILE: SoA/GameManager.cpp
  function isSolidBlock (line 87) | bool isSolidBlock(const i32& blockID VORB_UNUSED) {

FILE: SoA/GameManager.h
  function class (line 17) | class GameManager

FILE: SoA/GamePlayScreen.cpp
  function i32 (line 59) | i32 GameplayScreen::getNextScreen() const {
  function i32 (line 63) | i32 GameplayScreen::getPreviousScreen() const {
  type sched_param (line 80) | struct sched_param
  function i32 (line 276) | i32 GameplayScreen::getWindowWidth() const {
  function i32 (line 280) | i32 GameplayScreen::getWindowHeight() const {
  type sched_param (line 512) | struct sched_param

FILE: SoA/GamePlayScreen.h
  type SoaState (line 37) | struct SoaState
  type DevUiModes (line 54) | enum DevUiModes {
  function class (line 62) | class GameplayScreen : public vui::IAppScreen<App> {

FILE: SoA/GameRenderParams.h
  function class (line 15) | class GameRenderParams {

FILE: SoA/GameSystem.h
  function class (line 35) | class GameSystem : public vecs::ECS {

FILE: SoA/GameSystemAssemblages.h
  function namespace (line 25) | namespace GameSystemAssemblages {

FILE: SoA/GameSystemComponentBuilders.h
  function class (line 12) | class AABBCollidableComponentBuilder: public ECSComponentBuilder {
  function class (line 21) | class ParkourInputComponentBuilder: public ECSComponentBuilder {
  function class (line 29) | class AttributeComponentBuilder : public ECSComponentBuilder {
  function class (line 47) | class SpacePositionComponentBuilder: public ECSComponentBuilder {
  function class (line 55) | class VoxelPositionComponentBuilder: public ECSComponentBuilder {
  function class (line 63) | class PhysicsComponentBuilder: public ECSComponentBuilder {
  function class (line 72) | class FrustumComponentBuilder: public ECSComponentBuilder {
  function class (line 80) | class HeadComponentBuilder: public ECSComponentBuilder {
  function class (line 89) | class InventoryComponentBuilder : public ECSComponentBuilder {

FILE: SoA/GameSystemComponents.cpp
  function KEG_TYPE_DEF (line 4) | KEG_TYPE_DEF(AabbCollidableComponent, AabbCollidableComponent, kt) {
  function KEG_TYPE_DEF (line 10) | KEG_TYPE_DEF(AttributeComponent, AttributeComponent, kt) {
  function KEG_TYPE_DEF (line 28) | KEG_TYPE_DEF(SpacePositionComponent, SpacePositionComponent, kt) {
  function KEG_TYPE_DEF (line 34) | KEG_TYPE_DEF(VoxelPositionComponent, VoxelPositionComponent, kt) {
  function KEG_TYPE_DEF (line 42) | KEG_TYPE_DEF(PhysicsComponent, PhysicsComponent, kt) {
  function KEG_TYPE_DEF (line 48) | KEG_TYPE_DEF(FrustumComponent, FrustumComponent, kt) {
  function KEG_TYPE_DEF (line 56) | KEG_TYPE_DEF(HeadComponent, HeadComponent, kt) {

FILE: SoA/GameSystemComponents.h
  type BlockCollisionData (line 32) | struct BlockCollisionData {
  type AabbCollidableComponent (line 49) | struct AabbCollidableComponent {
  type vecs (line 56) | typedef vecs::ComponentTable<AabbCollidableComponent> AABBCollidableComp...
  type AttributeComponent (line 59) | struct AttributeComponent {
  type vecs (line 68) | typedef vecs::ComponentTable<AttributeComponent> AttributeComponentTable;
  type ParkourInputComponent (line 71) | struct ParkourInputComponent {
  type vecs (line 91) | typedef vecs::ComponentTable<ParkourInputComponent> ParkourInputComponen...
  type FreeMoveInputComponent (line 93) | struct FreeMoveInputComponent {
  type vecs (line 112) | typedef vecs::ComponentTable<FreeMoveInputComponent> FreeMoveInputCompon...
  type SpacePositionComponent (line 115) | struct SpacePositionComponent {
  type vecs (line 122) | typedef vecs::ComponentTable<SpacePositionComponent> SpacePositionCompon...
  type f64v3 (line 125) | typedef f64v3 VoxelPosition;
  type VoxelPositionComponent (line 127) | struct VoxelPositionComponent {
  type vecs (line 133) | typedef vecs::ComponentTable<VoxelPositionComponent> VoxelPositionCompon...
  type ChunkSphereComponent (line 136) | struct ChunkSphereComponent {
  function class (line 155) | class ChunkSphereComponentTable : public vecs::ComponentTable<ChunkSpher...
  type PhysicsComponent (line 165) | struct PhysicsComponent {
  type vecs (line 171) | typedef vecs::ComponentTable<PhysicsComponent> PhysicsComponentTable;
  type FrustumComponent (line 174) | struct FrustumComponent {
  type vecs (line 180) | typedef vecs::ComponentTable<FrustumComponent> FrustumComponentTable;
  type HeadComponent (line 183) | struct HeadComponent {
  type vecs (line 191) | typedef vecs::ComponentTable<HeadComponent> HeadComponentTable;
  type InventoryComponent (line 194) | struct InventoryComponent {
  type vecs (line 197) | typedef vecs::ComponentTable<InventoryComponent> InventoryComponentTable;

FILE: SoA/GameSystemUpdater.h
  type SoaState (line 31) | struct SoaState
  type VoxelPositionComponent (line 33) | struct VoxelPositionComponent
  type SoaState (line 34) | struct SoaState
  function class (line 37) | class GameSystemUpdater {

FILE: SoA/GameplayLoadScreen.cpp
  function i32 (line 21) | i32 GameplayLoadScreen::getNextScreen() const {
  function i32 (line 25) | i32 GameplayLoadScreen::getPreviousScreen() const {

FILE: SoA/GameplayLoadScreen.h
  type CommonState (line 29) | struct CommonState
  function class (line 34) | class GameplayLoadScreen : public vui::IAppScreen < App > {

FILE: SoA/GameplayRenderer.h
  type MTRenderState (line 68) | struct MTRenderState
  type CommonState (line 69) | struct CommonState
  type SoaState (line 70) | struct SoaState
  function class (line 72) | class GameplayRenderer {

FILE: SoA/GasGiantComponentRenderer.h
  type GasGiantComponent (line 24) | struct GasGiantComponent
  type SpaceLightComponent (line 25) | struct SpaceLightComponent
  type AtmosphereComponent (line 26) | struct AtmosphereComponent
  type GasGiantVertex (line 28) | struct GasGiantVertex {
  function class (line 33) | class GasGiantComponentRenderer {

FILE: SoA/GenerateTask.cpp
  type ChunkFloraArrays (line 46) | struct ChunkFloraArrays {

FILE: SoA/GenerateTask.h
  type PlanetHeightData (line 25) | struct PlanetHeightData
  function class (line 31) | class GenerateTask : public vcore::IThreadPoolTask<WorkerData> {

FILE: SoA/GeometrySorter.cpp
  function i32 (line 11) | i32 convertData(Distanceclass* data) {
  function comparator (line 15) | bool comparator(const Distanceclass& i, const Distanceclass& j) {

FILE: SoA/GeometrySorter.h
  function class (line 8) | class Distanceclass {
  function class (line 14) | class GeometrySorter {

FILE: SoA/HdrRenderStage.h
  function class (line 26) | class HdrRenderStage : public IRenderStage {

FILE: SoA/HeadComponentUpdater.h
  function class (line 21) | class HeadComponentUpdater {

FILE: SoA/IRenderStage.h
  type SoaState (line 23) | struct SoaState
  function IRenderStage (line 24) | DECL_VUI(class GameWindow)
  function virtual (line 67) | virtual void setActive(bool isVisible) { m_isActive = isVisible; }
  function virtual (line 70) | virtual void toggleActive() { m_isActive = !m_isActive; }

FILE: SoA/ImageAssetLoader.h
  function class (line 19) | class ImageAsset : public vcore::Asset {
  function ImageAsset (line 25) | struct vcore::AssetBuilder<ImageAsset> {

FILE: SoA/IniParser.cpp
  type PTYPE (line 30) | enum PTYPE {
  function GetFileSize (line 50) | long GetFileSize(const char* filename) {
  function ExtractHex (line 97) | unsigned long int ExtractHex(char* s) {
  function ExtractOctal (line 169) | unsigned long int ExtractOctal(char* s) {
  function ExtractNumber (line 222) | unsigned long int ExtractNumber(char* s) {
  function PTYPE (line 279) | PTYPE ExtractType(char*& s) {
  function ByteBlit (line 333) | int ByteBlit(const char* file, void* dst, int maxSize) {
  type MYSTR (line 394) | struct MYSTR {
  function test_main (line 402) | int test_main(int argc, char** argv) {

FILE: SoA/InitScreen.cpp
  function i32 (line 19) | i32 InitScreen::getNextScreen() const {
  function i32 (line 22) | i32 InitScreen::getPreviousScreen() const {

FILE: SoA/InitScreen.h
  function class (line 8) | class InitScreen : public vui::IAppScreen<App> {

FILE: SoA/InputMapper.cpp
  type InputKegArray (line 12) | struct InputKegArray {
  function KEG_TYPE_DEF (line 17) | KEG_TYPE_DEF(InputKegArray, InputKegArray, kt) {
  function VirtualKey (line 142) | VirtualKey InputMapper::getKey(const InputID id) {

FILE: SoA/InputMapper.h
  function class (line 26) | class InputMapper {

FILE: SoA/Inputs.cpp
  function initInputs (line 65) | void initInputs(InputMapper* inputManager) {

FILE: SoA/Item.cpp
  function ItemID (line 10) | ItemID ItemPack::append(ItemData item) {

FILE: SoA/Item.h
  function ItemType (line 6) | enum class ItemType {
  type ItemStack (line 90) | struct ItemStack {

FILE: SoA/LenseFlareRenderer.cpp
  type FlareVertex (line 15) | struct FlareVertex {
  type FlareSprite (line 21) | struct FlareSprite {
  function KEG_TYPE_DEF_SAME_NAME (line 27) | KEG_TYPE_DEF_SAME_NAME(FlareSprite, kt) {
  type FlareKegProperties (line 34) | struct FlareKegProperties {
  function KEG_TYPE_DEF_SAME_NAME (line 39) | KEG_TYPE_DEF_SAME_NAME(FlareKegProperties, kt) {

FILE: SoA/LenseFlareRenderer.h
  type FlareKegProperties (line 23) | struct FlareKegProperties
  function class (line 25) | class LenseFlareRenderer {

FILE: SoA/LiquidData.h
  function class (line 4) | class LiquidData {

FILE: SoA/LiquidVoxelRenderStage.h
  function class (line 26) | class LiquidVoxelRenderStage : public IRenderStage {

FILE: SoA/LoadBar.h
  function class (line 8) | class LoadBarCommonProperties {
  function class (line 23) | class LoadBar {

FILE: SoA/LoadContext.h
  function class (line 24) | class LoadContext {
  function addAnticipatedWork (line 34) | void addAnticipatedWork(ui32 work) {
  function addWorkCompleted (line 37) | void addWorkCompleted(ui32 work) {
  function class (line 61) | class StaticLoadContext : public LoadContext {
  function class (line 126) | class DynamicLoadContext : public LoadContext {
  function processRequests (line 134) | size_t processRequests(size_t maxRequests) {
  function blockUntilFinished (line 156) | void blockUntilFinished() {
  function clearTasks (line 161) | void clearTasks() {

FILE: SoA/LoadMonitor.h
  function class (line 10) | class ILoadTask {
  function _f (line 42) | _f(f) {
  function load (line 46) | void load() {
  function class (line 60) | class LoadMonitor {

FILE: SoA/LoadTaskBlockData.h
  function class (line 14) | class LoadTaskBlockData : public ILoadTask {

FILE: SoA/LoadTaskGameManager.h
  function class (line 9) | class LoadTaskGameManager : public ILoadTask {

FILE: SoA/LoadTaskStarSystem.h
  function class (line 8) | class LoadTaskStarSystem : public ILoadTask {

FILE: SoA/LoadTaskTextures.h
  function class (line 8) | class LoadTaskTextures : public ILoadTask {

FILE: SoA/MTRenderState.h
  type DebugChunkData (line 26) | struct DebugChunkData {
  type MTRenderState (line 33) | struct MTRenderState {

FILE: SoA/MTRenderStateManager.cpp
  function incrementMod3 (line 5) | void incrementMod3(OUT int& i) {
  function MTRenderState (line 9) | MTRenderState* MTRenderStateManager::getRenderStateForUpdate() {
  function MTRenderState (line 25) | const MTRenderState* MTRenderStateManager::getRenderStateForRender() {

FILE: SoA/MTRenderStateManager.h
  function class (line 22) | class MTRenderStateManager {

FILE: SoA/MainMenuLoadScreen.cpp
  function i32 (line 34) | i32 MainMenuLoadScreen::getNextScreen() const {
  function i32 (line 37) | i32 MainMenuLoadScreen::getPreviousScreen() const {

FILE: SoA/MainMenuLoadScreen.h
  type CommonState (line 16) | struct CommonState
  function class (line 22) | class MainMenuLoadScreen : public vui::IAppScreen<App> {

FILE: SoA/MainMenuRenderer.h
  type CommonState (line 38) | struct CommonState
  type SoaState (line 39) | struct SoaState
  type WindowResizeEvent (line 40) | struct WindowResizeEvent
  function class (line 42) | class MainMenuRenderer {

FILE: SoA/MainMenuScreen.cpp
  function i32 (line 44) | i32 MainMenuScreen::getNextScreen() const {
  function i32 (line 48) | i32 MainMenuScreen::getPreviousScreen() const {

FILE: SoA/MainMenuScreen.h
  type CommonState (line 37) | struct CommonState
  type SoaState (line 38) | struct SoaState
  type WindowResizeEvent (line 41) | struct WindowResizeEvent
  function class (line 45) | class MainMenuScreen : public vui::IAppScreen<App> {

FILE: SoA/MainMenuScriptedUI.cpp
  function VirtualKey (line 85) | VirtualKey MainMenuScriptedUI::getKey(InputMapper::InputID id) {
  function VirtualKey (line 89) | VirtualKey MainMenuScriptedUI::getDefaultKey(InputMapper::InputID id) {
  function nString (line 93) | nString MainMenuScriptedUI::getKeyString(InputMapper::InputID id) {
  function nString (line 97) | nString MainMenuScriptedUI::getDefaultKeyString(InputMapper::InputID id) {
  function nString (line 101) | nString MainMenuScriptedUI::getName(InputMapper::InputID id) {
  function nString (line 128) | nString MainMenuScriptedUI::getBodyName(vecs::EntityID entity) {
  function nString (line 133) | nString MainMenuScriptedUI::getBodyParentName(vecs::EntityID entity) {
  function nString (line 141) | nString MainMenuScriptedUI::getBodyTypeName(vecs::EntityID entity) {
  function f32 (line 168) | f32 MainMenuScriptedUI::getBodyMass(vecs::EntityID entity) {
  function f32 (line 173) | f32 MainMenuScriptedUI::getBodyDiameter(vecs::EntityID entity) {
  function f32 (line 178) | f32 MainMenuScriptedUI::getBodyRotPeriod(vecs::EntityID entity) {
  function f32 (line 183) | f32 MainMenuScriptedUI::getBodyOrbPeriod(vecs::EntityID entity) {
  function f32 (line 188) | f32 MainMenuScriptedUI::getBodyAxialTilt(vecs::EntityID entity) {
  function f32 (line 193) | f32 MainMenuScriptedUI::getBodyEccentricity(vecs::EntityID entity) {
  function f32 (line 198) | f32 MainMenuScriptedUI::getBodyInclination(vecs::EntityID entity) {
  function f32 (line 203) | f32 MainMenuScriptedUI::getBodySemiMajor(vecs::EntityID entity) {
  function f32 (line 208) | f32 MainMenuScriptedUI::getGravityAccel(vecs::EntityID entity) {
  function f32 (line 215) | f32 MainMenuScriptedUI::getVolume(vecs::EntityID entity) {
  function f32 (line 223) | f32 MainMenuScriptedUI::getAverageDensity(vecs::EntityID entity) {

FILE: SoA/MainMenuScriptedUI.h
  function class (line 25) | class MainMenuScriptedUI : public vui::ScriptedUI<vscript::lua::Environm...

FILE: SoA/MainMenuSystemViewer.cpp
  function f64v3 (line 148) | f64v3 MainMenuSystemViewer::getTargetPosition() {
  function f64 (line 152) | f64 MainMenuSystemViewer::getTargetRadius() {
  function nString (line 156) | nString MainMenuSystemViewer::getTargetName() {

FILE: SoA/MainMenuSystemViewer.h
  function class (line 30) | class MainMenuSystemViewer {

FILE: SoA/MaterialAtlas.h
  function class (line 3) | class TextureAtlas {

FILE: SoA/MaterialData.h
  function class (line 3) | class TextureData {

FILE: SoA/MaterialStack.h
  function class (line 3) | class TextureStack {

FILE: SoA/MetaSection.h
  type ui32 (line 20) | typedef ui32 MetaID;
  type MetaFieldInformation (line 25) | struct MetaFieldInformation {
  function class (line 36) | class MetaSection {

FILE: SoA/ModInformation.h
  type ModInformation (line 24) | struct ModInformation {

FILE: SoA/ModPathResolver.h
  function class (line 21) | class ModPathResolver {

FILE: SoA/ModelMesher.cpp
  function VoxelModelMesh (line 58) | VoxelModelMesh ModelMesher::createMesh(const VoxelModel* model) {
  function VoxelModelMesh (line 94) | VoxelModelMesh ModelMesher::createMarchingCubesMesh(const VoxelModel* mo...
  function VoxelModelMesh (line 150) | VoxelModelMesh ModelMesher::createDualContouringMesh(const VoxelModel* m...
  function f32 (line 187) | f32 ModelMesher::getMarchingPotential(const VoxelMatrix& matrix, int x, ...
  function color3 (line 257) | color3 ModelMesher::getColor(const f32v3& pos, const VoxelMatrix& matrix) {
  function color3 (line 370) | color3 ModelMesher::getColor2(const i32v3& pos, const VoxelMatrix& matri...
  function f32v3 (line 450) | f32v3 linearInterp(const f32v4& p1, const f32v4& p2, float value) {

FILE: SoA/ModelMesher.h
  function class (line 12) | class ModelMesher {

FILE: SoA/MusicPlayer.cpp
  function strEndsWith (line 40) | inline bool strEndsWith(const nString& value, const nString& ending) {

FILE: SoA/MusicPlayer.h
  function MusicPlayer (line 23) | DECL_VSOUND(class Engine)

FILE: SoA/NightVisionRenderStage.cpp
  function KEG_TYPE_DEF_SAME_NAME (line 15) | KEG_TYPE_DEF_SAME_NAME(NightVisionRenderParams, kt) {
  function NightVisionRenderParams (line 25) | NightVisionRenderParams NightVisionRenderParams::createDefault() {

FILE: SoA/NightVisionRenderStage.h
  function class (line 36) | class NightVisionRenderParams {
  function class (line 50) | class NightVisionRenderStage : public IRenderStage {

FILE: SoA/Noise.cpp
  function KEG_TYPE_DEF_SAME_NAME (line 6) | KEG_TYPE_DEF_SAME_NAME(NoiseBase, kt) {
  function KEG_ENUM_DEF (line 11) | KEG_ENUM_DEF(TerrainStage, TerrainStage, kt) {
  function KEG_ENUM_DEF (line 26) | KEG_ENUM_DEF(TerrainOp, TerrainOp, kt) {
  function KEG_TYPE_DEF_SAME_NAME (line 33) | KEG_TYPE_DEF_SAME_NAME(TerrainFuncProperties, kt) {
  function f64v3 (line 60) | inline f64v3 permute(const f64v3& x) {
  function f64v2 (line 66) | f64v2 Noise::cellular(const f64v3& P) {
  function fastfloor (line 233) | inline int fastfloor(const f64 x) { return x > 0 ? (int)x : (int)x - 1; }
  function f64 (line 235) | inline f64 dot(const f64* g, const f64 x, const f64 y) { return g[0] * x...
  function f64 (line 236) | inline f64 dot(const f64* g, const f64 x, const f64 y, const f64 z) { re...
  function f64 (line 237) | inline f64 dot(const f64* g, const f64 x, const f64 y, const f64 z, cons...
  function f64 (line 239) | f64 Noise::fractal(const int octaves, const f64 persistence, const f64 f...
  function f64 (line 259) | f64 Noise::fractal(const int octaves, const f64 persistence, const f64 f...
  function f64 (line 279) | f64 Noise::fractal(const int octaves, const f64 persistence, const f64 f...
  function f64 (line 301) | f64 Noise::raw(const f64 x, const f64 y) {
  function f64 (line 370) | f64 Noise::raw(const f64 x, const f64 y, const f64 z) {
  function f64 (line 462) | f64 Noise::raw(const f64 x, const f64 y, const f64 z, const f64 w) {

FILE: SoA/Noise.h
  type class (line 20) | enum class
  type class (line 36) | enum class
  type TerrainFuncProperties (line 44) | struct TerrainFuncProperties {
  type NoiseBase (line 57) | struct NoiseBase {
  function namespace (line 63) | namespace Noise {

FILE: SoA/Octree.cpp
  function OctreeNode (line 95) | OctreeNode* SimplifyOctree(OctreeNode* node, float threshold) {
  function GenerateVertexIndices (line 193) | void GenerateVertexIndices(OctreeNode* node, std::vector<VoxelModelVerte...
  function ContourProcessEdge (line 218) | void ContourProcessEdge(OctreeNode* node[4], int dir, std::vector<ui32>&...
  function ContourEdgeProc (line 269) | void ContourEdgeProc(OctreeNode* node[4], int dir, std::vector<ui32>& in...
  function ContourFaceProc (line 305) | void ContourFaceProc(OctreeNode* node[2], int dir, std::vector<ui32>& in...
  function ContourCellProc (line 363) | void ContourCellProc(OctreeNode* node, std::vector<ui32>& indexBuffer) {
  function f32v3 (line 404) | f32v3 ApproximateZeroCrossingPosition(const f32v3& p0, const f32v3& p1) {
  function f32v3 (line 427) | f32v3 CalculateSurfaceNormal(const f32v3& p) {
  function OctreeNode (line 438) | OctreeNode* ConstructLeaf(OctreeNode* leaf) {
  function OctreeNode (line 514) | OctreeNode* ConstructOctreeNodes(OctreeNode* node) {
  function OctreeNode (line 546) | OctreeNode* BuildOctree(const i32v3& min, const int size, const float th...
  function GenerateMeshFromOctree (line 560) | void GenerateMeshFromOctree(OctreeNode* node, std::vector<VoxelModelVert...
  function DestroyOctree (line 574) | void DestroyOctree(OctreeNode* node) {

FILE: SoA/Octree.h
  type OctreeNodeType (line 26) | enum OctreeNodeType {

FILE: SoA/OpaqueVoxelRenderStage.h
  function class (line 27) | class OpaqueVoxelRenderStage : public IRenderStage

FILE: SoA/OptionsController.cpp
  function f32 (line 114) | f32 OptionsController::getFloat(nString optionName) {

FILE: SoA/OptionsController.h
  function class (line 22) | class OptionsController {

FILE: SoA/OrbitComponentRenderer.h
  type OrbitComponent (line 22) | struct OrbitComponent
  type NamePositionComponent (line 23) | struct NamePositionComponent
  function OrbitComponentRenderer (line 25) | DECL_VG(class GLProgram)

FILE: SoA/OrbitComponentUpdater.cpp
  function f64 (line 70) | f64 OrbitComponentUpdater::calculateTrueAnomaly(f64 meanAnomaly, f64 e) {

FILE: SoA/OrbitComponentUpdater.h
  type NamePositionComponent (line 21) | struct NamePositionComponent
  type OrbitComponent (line 22) | struct OrbitComponent
  type SphericalGravityComponent (line 23) | struct SphericalGravityComponent
  function class (line 25) | class OrbitComponentUpdater {

FILE: SoA/PDA.h
  type class (line 25) | enum class
  function draw (line 49) | void draw() const;

FILE: SoA/ParkourComponentUpdater.h
  type SoaState (line 22) | struct SoaState
  function class (line 24) | class ParkourComponentUpdater {

FILE: SoA/ParticleMesh.h
  function class (line 6) | class ParticleMesh {
  function class (line 16) | class ParticleMeshMessage {

FILE: SoA/PauseMenu.h
  function class (line 24) | class PauseMenu {

FILE: SoA/PauseMenuRenderStage.h
  function class (line 22) | class PauseMenuRenderStage : public IRenderStage {

FILE: SoA/PdaRenderStage.h
  function class (line 21) | class PdaRenderStage : public IRenderStage {

FILE: SoA/PhysicsBlockRenderStage.h
  function class (line 25) | class PhysicsBlockRenderStage : public IRenderStage {

FILE: SoA/PhysicsComponentUpdater.cpp
  function f64v3 (line 34) | f64v3 PhysicsComponentUpdater::calculateGravityAcceleration(f64v3 relati...

FILE: SoA/PhysicsComponentUpdater.h
  type PhysicsComponent (line 20) | struct PhysicsComponent
  type VoxelPositionComponent (line 21) | struct VoxelPositionComponent
  function class (line 26) | class PhysicsComponentUpdater {

FILE: SoA/Planet.cpp
  function RecursiveFlagLOD (line 680) | void RecursiveFlagLOD(TerrainPatch *lod){

FILE: SoA/Planet.h
  type TreeType (line 22) | struct TreeType
  type PlantType (line 23) | struct PlantType
  type AtmosphereProperties (line 29) | struct AtmosphereProperties {
  function class (line 39) | class Atmosphere {
  function class (line 66) | class Planet {

FILE: SoA/PlanetGenData.cpp
  function KEG_TYPE_DEF_SAME_NAME (line 4) | KEG_TYPE_DEF_SAME_NAME(BlockLayerKegProperties, kt) {
  function KEG_TYPE_DEF_SAME_NAME (line 11) | KEG_TYPE_DEF_SAME_NAME(LiquidColorKegProperties, kt) {
  function KEG_TYPE_DEF_SAME_NAME (line 19) | KEG_TYPE_DEF_SAME_NAME(TerrainColorKegProperties, kt) {

FILE: SoA/PlanetGenData.h
  type LiquidColorKegProperties (line 29) | struct LiquidColorKegProperties {

FILE: SoA/PlanetGenLoader.cpp
  type BiomeKegProperties (line 23) | struct BiomeKegProperties {
  function KEG_TYPE_DEF_SAME_NAME (line 39) | KEG_TYPE_DEF_SAME_NAME(BiomeKegProperties, kt) {
  function CALLER_DELETE (line 61) | CALLER_DELETE PlanetGenData* PlanetGenLoader::loadPlanetGenData(const nS...
  function CALLER_DELETE (line 147) | CALLER_DELETE PlanetGenData* PlanetGenLoader::getRandomGenData(f32 radiu...
  function AtmosphereProperties (line 185) | AtmosphereProperties PlanetGenLoader::getRandomAtmosphere() {
  function ui32 (line 196) | ui32 recursiveCountBiomes(const BiomeKegProperties& props) {
  function blurBiomeMap (line 215) | void blurBiomeMap(const std::vector<BiomeInfluence>& bMap, OUT std::vect...
  function blurBaseBiomeMap (line 261) | void blurBaseBiomeMap(const Biome* baseBiomeLookup[BIOME_MAP_WIDTH][BIOM...
  function recursiveInitBiomes (line 306) | void recursiveInitBiomes(Biome& biome,

FILE: SoA/PlanetGenLoader.h
  type NoiseBase (line 31) | struct NoiseBase
  type PlanetGenData (line 32) | struct PlanetGenData
  type BiomeKegProperties (line 33) | struct BiomeKegProperties
  type ui32 (line 36) | typedef ui32 BiomeColorCode;
  function class (line 38) | class PlanetGenLoader {

FILE: SoA/PlanetGenerator.cpp
  function CALLER_DELETE (line 20) | CALLER_DELETE PlanetGenData* PlanetGenerator::generateRandomPlanet(Space...
  function CALLER_DELETE (line 36) | CALLER_DELETE PlanetGenData* PlanetGenerator::generatePlanet(vcore::RPCM...
  function CALLER_DELETE (line 97) | CALLER_DELETE PlanetGenData* PlanetGenerator::generateAsteroid(vcore::RP...
  function CALLER_DELETE (line 102) | CALLER_DELETE PlanetGenData* PlanetGenerator::generateComet(vcore::RPCMa...
  function VGTexture (line 107) | VGTexture PlanetGenerator::getRandomColorMap(vcore::RPCManager* glrpc, b...

FILE: SoA/PlanetGenerator.h
  type PlanetGenData (line 31) | struct PlanetGenData
  function class (line 33) | class PlanetGenerator {

FILE: SoA/PlanetHeightData.h
  type Biome (line 18) | struct Biome
  type PlanetHeightData (line 20) | struct PlanetHeightData {

FILE: SoA/PlanetRenderStage.h
  function class (line 22) | class PlanetRenderStage : public vg::IRenderStage

FILE: SoA/PlanetRingsComponentRenderer.h
  type SpaceLightComponent (line 26) | struct SpaceLightComponent
  type PlanetRingsComponent (line 27) | struct PlanetRingsComponent
  type RenderableRing (line 30) | struct RenderableRing {
  function class (line 35) | class PlanetRingsComponentRenderer {

FILE: SoA/Positional.h
  type i32 (line 24) | typedef i32 VoxelPositionType;
  type glm (line 25) | typedef glm::tvec3<VoxelPositionType> VoxelVectorType;
  function VoxelPositionType (line 27) | inline VoxelPositionType wrapInBounds(VoxelPositionType v) {
  function ry (line 41) | struct VoxelIterablePosition {
  function VoxelIterablePositionRaw (line 109) | VoxelIterablePositionRaw operator+ (VoxelPositionType v) {
  function class (line 118) | class VoxelIterablePositionRawX : public VoxelIterablePositionRaw<&Voxel...
  function class (line 119) | class VoxelIterablePositionRawY : public VoxelIterablePositionRaw<&Voxel...
  function class (line 120) | class VoxelIterablePositionRawZ : public VoxelIterablePositionRaw<&Voxel...
  function wrap (line 129) | void wrap() {
  function VoxelIterablePositionWrap (line 137) | VoxelIterablePositionWrap operator+ (VoxelPositionType v) {
  function VoxelIterablePositionClamp (line 168) | VoxelIterablePositionClamp operator+ (VoxelPositionType v) {
  type VoxelPosition (line 184) | struct VoxelPosition {

FILE: SoA/ProceduralChunkGenerator.cpp
  function ui32 (line 169) | ui32 ProceduralChunkGenerator::getBlockLayerIndex(ui32 depth) const {
  function ui16 (line 197) | ui16 ProceduralChunkGenerator::getBlockID(Chunk* chunk, int blockIndex, ...

FILE: SoA/ProceduralChunkGenerator.h
  type PlanetGenData (line 18) | struct PlanetGenData
  type PlanetHeightData (line 19) | struct PlanetHeightData
  type BlockLayer (line 20) | struct BlockLayer
  function class (line 25) | class ProceduralChunkGenerator {

FILE: SoA/ProgramGenDelegate.h
  function class (line 23) | class ProgramGenDelegate {
  function init (line 39) | void init(const cString name, const cString vs, const cString fs) {
  function initFromFile (line 47) | void initFromFile(const cString name, const cString vertPath, const cStr...

FILE: SoA/RegionFileManager.cpp
  function i32 (line 27) | inline i32 fileTruncate(i32 fd, i64 size)
  function i32 (line 38) | inline i32 sectorsFromBytes(ui32 bytes) {
  function checkZlibError (line 44) | bool checkZlibError(nString message, int zerror) {
  type stat (line 107) | struct stat
  function nString (line 870) | nString RegionFileManager::getRegionString(Chunk *ch)

FILE: SoA/RegionFileManager.h
  function class (line 32) | class ChunkHeader {
  function class (line 39) | class RegionFileHeader {
  function class (line 44) | class RegionFile {
  function class (line 54) | class SaveVersion {
  function class (line 62) | class RegionFileManager {

FILE: SoA/RenderUtils.h
  function setMatrixTranslation (line 21) | inline void setMatrixTranslation(f32m4& matrix, const f64v3 &position, c...
  function setMatrixTranslation (line 28) | inline void setMatrixTranslation(f32m4& matrix, const f32v3 &position, c...
  function setMatrixTranslation (line 35) | inline void setMatrixTranslation(f32m4& matrix, const f32v3 &position, c...
  function setMatrixTranslation (line 42) | inline void setMatrixTranslation(f32m4& matrix, const f32 x, const f32 y...
  function setMatrixTranslation (line 49) | inline void setMatrixTranslation(f32m4& matrix, const double x, const do...
  function setMatrixTranslation (line 56) | inline void setMatrixTranslation(f32m4& matrix, const f32v3& trans) {
  function setMatrixTranslation (line 63) | inline void setMatrixTranslation(f32m4& matrix, const f64v3& trans) {
  function setMatrixScale (line 70) | inline void setMatrixScale(f32m4& matrix, const f32v3 &scale) {
  function setMatrixScale (line 77) | inline void setMatrixScale(f32m4& matrix, const f32 scaleX, const f32 sc...

FILE: SoA/ShaderAssetLoader.cpp
  function KEG_TYPE_DEF (line 13) | KEG_TYPE_DEF(Anon_AttributeBinding, AttributeBinding, kt) {
  type ShaderAssetInformation (line 19) | struct ShaderAssetInformation {
  function KEG_TYPE_DEF (line 28) | KEG_TYPE_DEF(Anon_ShaderAssetInformation, ShaderAssetInformation, kt) {
  function initProgram (line 37) | void initProgram(Sender, void* ptr) {
  function finishProgram (line 41) | void finishProgram(Sender, void* ptr) {
  function compileShader (line 49) | void compileShader(Sender, void* ptr) {
  function bindAttributes (line 72) | void bindAttributes(Sender, void* ptr) {
  function bindFragments (line 80) | void bindFragments(Sender, void* ptr) {

FILE: SoA/ShaderAssetLoader.h
  function class (line 21) | class ShaderAsset : public vcore::Asset {
  function ShaderAsset (line 27) | struct vcore::AssetBuilder<ShaderAsset> {

FILE: SoA/ShaderLoader.cpp
  function printShaderError (line 8) | void printShaderError(Sender s VORB_MAYBE_UNUSED, const nString& n) {
  function printLinkError (line 12) | void printLinkError(Sender s VORB_MAYBE_UNUSED, const nString& n) {
  function printFileIOError (line 16) | void printFileIOError(Sender s VORB_MAYBE_UNUSED, const nString& n) {
  function CALLER_DELETE (line 22) | CALLER_DELETE vg::GLProgram ShaderLoader::createProgramFromFile(const vi...
  function CALLER_DELETE (line 45) | CALLER_DELETE vg::GLProgram ShaderLoader::createProgram(const cString di...

FILE: SoA/ShaderLoader.h
  function class (line 25) | class ShaderLoader {

FILE: SoA/SkyboxRenderStage.h
  function class (line 25) | class SkyboxRenderStage : public IRenderStage

FILE: SoA/SkyboxRenderer.h
  function class (line 19) | class SkyboxVertex {
  function class (line 27) | class SkyboxRenderer

FILE: SoA/SmartVoxelContainer.hpp
  type vorb (line 29) | namespace vorb {
    type voxel (line 30) | namespace voxel {
      class SmartVoxelContainer (line 35) | class SmartVoxelContainer
        method SmartVoxelContainer (line 79) | SmartVoxelContainer() {
        method SmartVoxelContainer (line 86) | SmartVoxelContainer(vcore::FixedSizeArrayRecycler<SIZE, T>* arrayR...
        method setArrayRecycler (line 94) | void setArrayRecycler(vcore::FixedSizeArrayRecycler<SIZE, T>* arra...
        method T (line 101) | const T& operator[] (size_t index) const {
        method init (line 106) | inline void init(VoxelStorageState state) {
        method initFromSortedArray (line 117) | inline void initFromSortedArray(VoxelStorageState state,
        method initFromSortedArray (line 135) | inline void initFromSortedArray(VoxelStorageState state,
        method changeState (line 154) | inline void changeState(VoxelStorageState newState, std::mutex& da...
        method update (line 167) | inline void update(std::mutex& dataLock) {
        method clear (line 190) | inline void clear() {
        method uncompressIntoBuffer (line 205) | inline void uncompressIntoBuffer(T* buffer) { _dataTree.uncompress...
        method VoxelStorageState (line 208) | const VoxelStorageState& getState() const {
        method T (line 211) | T* getDataArray() {
        method T (line 214) | const T* getDataArray() const {
        method T (line 227) | inline const T& get(size_t index) const {
        method set (line 233) | inline void set(size_t index, T value) {
        method T (line 241) | static const T& getInterval(const SmartVoxelContainer* container, ...
        method T (line 244) | static const T& getFlat(const SmartVoxelContainer* container, size...
        method setInterval (line 247) | static void setInterval(SmartVoxelContainer* container, size_t ind...
        method setFlat (line 250) | static void setFlat(SmartVoxelContainer* container, size_t index, ...
        method uncompress (line 257) | inline void uncompress(std::mutex& dataLock) {
        method compress (line 267) | inline void compress(std::mutex& dataLock) {
      class SmartHandle (line 38) | class SmartHandle {
        method SmartHandle (line 46) | SmartHandle(SmartHandle&& o) :
        method SmartHandle (line 51) | SmartHandle(const SmartHandle& o) = delete;
        method SmartHandle (line 52) | SmartHandle& operator= (SmartHandle&& o) = delete;
        method SmartHandle (line 54) | SmartHandle(SmartVoxelContainer<T, SIZE>& container, size_t index) :
      function clearContainerCompressionsCounter (line 65) | inline void clearContainerCompressionsCounter() {
      type VoxelStorageState (line 69) | enum class VoxelStorageState {
      class SmartVoxelContainer (line 75) | class SmartVoxelContainer {
        method SmartVoxelContainer (line 79) | SmartVoxelContainer() {
        method SmartVoxelContainer (line 86) | SmartVoxelContainer(vcore::FixedSizeArrayRecycler<SIZE, T>* arrayR...
        method setArrayRecycler (line 94) | void setArrayRecycler(vcore::FixedSizeArrayRecycler<SIZE, T>* arra...
        method T (line 101) | const T& operator[] (size_t index) const {
        method init (line 106) | inline void init(VoxelStorageState state) {
        method initFromSortedArray (line 117) | inline void initFromSortedArray(VoxelStorageState state,
        method initFromSortedArray (line 135) | inline void initFromSortedArray(VoxelStorageState state,
        method changeState (line 154) | inline void changeState(VoxelStorageState newState, std::mutex& da...
        method update (line 167) | inline void update(std::mutex& dataLock) {
        method clear (line 190) | inline void clear() {
        method uncompressIntoBuffer (line 205) | inline void uncompressIntoBuffer(T* buffer) { _dataTree.uncompress...
        method VoxelStorageState (line 208) | const VoxelStorageState& getState() const {
        method T (line 211) | T* getDataArray() {
        method T (line 214) | const T* getDataArray() const {
        method T (line 227) | inline const T& get(size_t index) const {
        method set (line 233) | inline void set(size_t index, T value) {
        method T (line 241) | static const T& getInterval(const SmartVoxelContainer* container, ...
        method T (line 244) | static const T& getFlat(const SmartVoxelContainer* container, size...
        method setInterval (line 247) | static void setInterval(SmartVoxelContainer* container, size_t ind...
        method setFlat (line 250) | static void setFlat(SmartVoxelContainer* container, size_t index, ...
        method uncompress (line 257) | inline void uncompress(std::mutex& dataLock) {
        method compress (line 267) | inline void compress(std::mutex& dataLock) {

FILE: SoA/SoAState.h
  type SoaState (line 36) | struct SoaState {

FILE: SoA/SoaController.cpp
  function initCreativeInventory (line 18) | void initCreativeInventory(vecs::EntityID eid, SoaState* state) {
  function f64v3 (line 75) | f64v3 SoaController::getEntityEyeVoxelPosition(SoaState* state, vecs::En...
  function f64v3 (line 81) | f64v3 SoaController::getEntityViewVoxelDirection(SoaState* state, vecs::...

FILE: SoA/SoaController.h
  type SoaState (line 19) | struct SoaState
  function class (line 23) | class SoaController {

FILE: SoA/SoaEngine.cpp
  function setTreeFruitProperties (line 147) | inline void setTreeFruitProperties(TreeTypeFruitProperties& fp, const Fr...
  function setTreeLeafProperties (line 155) | void setTreeLeafProperties(TreeTypeLeafProperties& lp, const LeafKegProp...
  function setTreeBranchProperties (line 194) | void setTreeBranchProperties(TreeTypeBranchProperties& bp, const BranchK...

FILE: SoA/SoaEngine.h
  type SoaState (line 26) | struct SoaState
  type ClientState (line 27) | struct ClientState
  type PlanetGenData (line 28) | struct PlanetGenData
  function class (line 33) | class SoaEngine {

FILE: SoA/SoaFileSystem.h
  function class (line 20) | class SoaFileSystem {

FILE: SoA/SoaOptions.cpp
  function SoaOption (line 57) | SoaOption* SoaOptions::find(const nString& name) {
  function SoaOption (line 63) | SoaOption& SoaOptions::get(int id) {
  function SoaOption (line 67) | SoaOption& SoaOptions::get(const nString& name) {
  function SoaStringOption (line 71) | SoaStringOption& SoaOptions::getStringOption(const nString& name) {

FILE: SoA/SoaOptions.h
  type SoaOptionFlags (line 4) | struct SoaOptionFlags {
  function OptionValueType (line 11) | enum class OptionValueType {

FILE: SoA/SonarRenderStage.h
  function class (line 26) | class SonarRenderStage : public IRenderStage

FILE: SoA/SpaceSystem.h
  type SoaState (line 46) | struct SoaState
  type GasGiantProperties (line 49) | struct GasGiantProperties
  type PlanetProperties (line 50) | struct PlanetProperties
  type StarProperties (line 51) | struct StarProperties
  type SystemBody (line 52) | struct SystemBody
  type SystemOrbitProperties (line 53) | struct SystemOrbitProperties

FILE: SoA/SpaceSystemAssemblages.h
  type PlanetGenData (line 27) | struct PlanetGenData
  type GasGiantProperties (line 28) | struct GasGiantProperties
  type PlanetProperties (line 29) | struct PlanetProperties
  type SoaState (line 30) | struct SoaState
  type SphericalTerrainComponent (line 31) | struct SphericalTerrainComponent
  type SphericalVoxelComponent (line 32) | struct SphericalVoxelComponent
  type StarProperties (line 33) | struct StarProperties
  type SystemBody (line 34) | struct SystemBody
  type SystemOrbitProperties (line 35) | struct SystemOrbitProperties
  type class (line 43) | enum class
  function namespace (line 45) | namespace SpaceSystemAssemblages {

FILE: SoA/SpaceSystemComponentTables.h
  function class (line 21) | class SphericalVoxelComponentTable : public vecs::ComponentTable<Spheric...
  function class (line 26) | class SphericalTerrainComponentTable : public vecs::ComponentTable < Sph...
  function class (line 31) | class FarTerrainComponentTable : public vecs::ComponentTable < FarTerrai...
  function class (line 36) | class OrbitComponentTable : public vecs::ComponentTable < OrbitComponent...

FILE: SoA/SpaceSystemComponents.h
  type PlanetGenData (line 46) | struct PlanetGenData
  type TerrainPatchData (line 47) | struct TerrainPatchData
  type AtmosphereComponent (line 61) | struct AtmosphereComponent {
  type vecs (line 75) | typedef vecs::ComponentTable<AtmosphereComponent> AtmosphereComponentTable;
  type CloudsComponent (line 78) | struct CloudsComponent {
  type vecs (line 86) | typedef vecs::ComponentTable<CloudsComponent> CloudsComponentTable;
  type AxisRotationComponent (line 90) | struct AxisRotationComponent {
  type vecs (line 98) | typedef vecs::ComponentTable<AxisRotationComponent> AxisRotationComponen...
  type NamePositionComponent (line 101) | struct NamePositionComponent {
  type vecs (line 105) | typedef vecs::ComponentTable<NamePositionComponent> NamePositionComponen...
  type SpaceLightComponent (line 108) | struct SpaceLightComponent {
  type vecs (line 113) | typedef vecs::ComponentTable<SpaceLightComponent> SpaceLightComponentTable;
  type OrbitComponent (line 116) | struct OrbitComponent {
  type PlanetRing (line 145) | struct PlanetRing {
  type PlanetRingsComponent (line 152) | struct PlanetRingsComponent {
  type vecs (line 156) | typedef vecs::ComponentTable<PlanetRingsComponent> PlanetRingsComponentT...
  type SphericalGravityComponent (line 159) | struct SphericalGravityComponent {
  type vecs (line 164) | typedef vecs::ComponentTable<SphericalGravityComponent> SphericalGravity...
  type SphericalVoxelComponent (line 167) | struct SphericalVoxelComponent {
  type SphericalTerrainComponent (line 195) | struct SphericalTerrainComponent {
  type GasGiantComponent (line 221) | struct GasGiantComponent {
  type vecs (line 229) | typedef vecs::ComponentTable<GasGiantComponent> GasGiantComponentTable;
  type StarComponent (line 232) | struct StarComponent {
  type vecs (line 241) | typedef vecs::ComponentTable<StarComponent> StarComponentTable;
  type FarTerrainComponent (line 244) | struct FarTerrainComponent {

FILE: SoA/SpaceSystemLoadStructs.cpp
  function KEG_ENUM_DEF (line 4) | KEG_ENUM_DEF(SpaceBodyType, SpaceBodyType, kt) {
  function KEG_ENUM_DEF (line 10) | KEG_ENUM_DEF(SpaceObjectType, SpaceObjectType, kt) {
  function spaceObjectTypeName (line 21) | std::string spaceObjectTypeName(const SpaceObjectType &type)
  function KEG_ENUM_DEF (line 39) | KEG_ENUM_DEF(TrojanType, TrojanType, kt) {
  function KEG_TYPE_DEF_SAME_NAME (line 44) | KEG_TYPE_DEF_SAME_NAME(SystemOrbitProperties, kt) {
  function KEG_TYPE_DEF_SAME_NAME (line 64) | KEG_TYPE_DEF_SAME_NAME(AtmosphereProperties, kt) {
  function KEG_TYPE_DEF_SAME_NAME (line 72) | KEG_TYPE_DEF_SAME_NAME(PlanetRingProperties, kt) {
  function KEG_TYPE_DEF_SAME_NAME (line 80) | KEG_TYPE_DEF_SAME_NAME(CloudsProperties, kt) {
  function KEG_TYPE_DEF_SAME_NAME (line 86) | KEG_TYPE_DEF_SAME_NAME(PlanetProperties, kt) {
  function KEG_TYPE_DEF_SAME_NAME (line 99) | KEG_TYPE_DEF_SAME_NAME(StarProperties, kt) {
  function KEG_TYPE_DEF_SAME_NAME (line 110) | KEG_TYPE_DEF_SAME_NAME(GasGiantProperties, kt) {

FILE: SoA/SpaceSystemLoadStructs.h
  type PlanetGenData (line 18) | struct PlanetGenData
  type class (line 26) | enum class
  type class (line 34) | enum class
  type class (line 49) | enum class
  type AtmosphereProperties (line 56) | struct AtmosphereProperties {
  type PlanetRingProperties (line 65) | struct PlanetRingProperties {
  type CloudsProperties (line 74) | struct CloudsProperties {
  type SystemOrbitProperties (line 81) | struct SystemOrbitProperties {
  type SystemBody (line 102) | struct SystemBody {
  type PlanetProperties (line 115) | struct PlanetProperties {
  type StarProperties (line 130) | struct StarProperties {
  type GasGiantProperties (line 142) | struct GasGiantProperties {

FILE: SoA/SpaceSystemLoader.cpp
  type PathColorKegProps (line 47) | struct PathColorKegProps {
  function KEG_TYPE_DEF_SAME_NAME (line 51) | KEG_TYPE_DEF_SAME_NAME(PathColorKegProps, kt) {
  function recursiveInclinationCalc (line 239) | void recursiveInclinationCalc(OrbitComponentTable& ct, SystemBody* body,...

FILE: SoA/SpaceSystemLoader.h
  type GasGiantProperties (line 23) | struct GasGiantProperties
  type SystemBody (line 24) | struct SystemBody
  type SystemOrbitProperties (line 25) | struct SystemOrbitProperties
  function DECL_VCORE (line 29) | DECL_VIO(class IOManager)

FILE: SoA/SpaceSystemRenderStage.cpp
  function SpaceLightComponent (line 335) | SpaceLightComponent* SpaceSystemRenderStage::getBrightestLight(NamePosit...
  function f64v3 (line 350) | const f64v3* SpaceSystemRenderStage::getBodyPosition(NamePositionCompone...

FILE: SoA/SpaceSystemRenderStage.h
  type SoaState (line 38) | struct SoaState
  type MTRenderState (line 42) | struct MTRenderState
  function class (line 44) | class SpaceSystemRenderStage : public IRenderStage {

FILE: SoA/SpaceSystemUpdater.h
  type SoaState (line 26) | struct SoaState
  function class (line 28) | class SpaceSystemUpdater {

FILE: SoA/SphericalHeightmapGenerator.cpp
  function FloraID (line 42) | FloraID SphericalHeightmapGenerator::getTreeID(const Biome* biome, const...
  function FloraID (line 75) | FloraID SphericalHeightmapGenerator::getFloraID(const Biome* biome, cons...
  function getBaseBiomes (line 107) | void getBaseBiomes(const std::vector<BiomeInfluence> baseBiomeInfluenceM...
  function f64 (line 301) | f64 SphericalHeightmapGenerator::getBaseHeightValue(const f64v3& pos) co...
  function f64 (line 307) | f64 SphericalHeightmapGenerator::getTemperatureValue(const f64v3& pos, c...
  function f64 (line 313) | f64 SphericalHeightmapGenerator::getHumidityValue(const f64v3& pos, cons...
  function f64 (line 320) | f64 SphericalHeightmapGenerator::calculateTemperature(f64 range, f64 ang...
  function f64 (line 331) | f64 SphericalHeightmapGenerator::calculateHumidity(f64 range, f64 angle,...
  function f64 (line 338) | f64 SphericalHeightmapGenerator::computeAngleFromNormal(const f64v3& nor...
  function f64 (line 349) | f64 doOperation(const TerrainOp& op, f64 a, f64 b) {

FILE: SoA/SphericalHeightmapGenerator.h
  type NoiseBase (line 26) | struct NoiseBase
  type PlanetHeightData (line 27) | struct PlanetHeightData
  type Delegate (line 30) | typedef Delegate<void, PlanetHeightData&, f64v3, PlanetGenData> heightma...
  function class (line 32) | class SphericalHeightmapGenerator {

FILE: SoA/SphericalTerrainComponentRenderer.h
  type AtmosphereComponent (line 22) | struct AtmosphereComponent
  type AxisRotationComponent (line 23) | struct AxisRotationComponent
  type NamePositionComponent (line 24) | struct NamePositionComponent
  type SpaceLightComponent (line 25) | struct SpaceLightComponent
  type SphericalTerrainComponent (line 26) | struct SphericalTerrainComponent
  function class (line 28) | class SphericalTerrainComponentRenderer {

FILE: SoA/SphericalTerrainComponentUpdater.h
  type SoaState (line 19) | struct SoaState
  type SphericalTerrainComponent (line 20) | struct SphericalTerrainComponent
  function class (line 34) | class SphericalTerrainComponentUpdater {

FILE: SoA/SphericalVoxelComponentUpdater.h
  type SoaState (line 29) | struct SoaState
  type AxisRotationComponent (line 31) | struct AxisRotationComponent
  type NamePositionComponent (line 32) | struct NamePositionComponent
  type SphericalVoxelComponent (line 33) | struct SphericalVoxelComponent
  type VoxelPosition3D (line 34) | struct VoxelPosition3D
  function class (line 38) | class SphericalVoxelComponentUpdater {

FILE: SoA/SsaoRenderStage.h
  function class (line 17) | class SSAORenderStage : public IRenderStage

FILE: SoA/StarComponentRenderer.cpp
  function f32v3 (line 155) | f32v3 hdrs(f32v3 v) {
  function f64 (line 477) | f64 StarComponentRenderer::calculateGlowSize(const StarComponent& sCmp, ...
  function f32v3 (line 488) | f32v3 StarComponentRenderer::calculateStarColor(const StarComponent& sCm...
  function f32v3 (line 515) | f32v3 StarComponentRenderer::getColor(int index) {
  function f32v3 (line 520) | f32v3 StarComponentRenderer::getTempColorShift(const StarComponent& sCmp) {

FILE: SoA/StarComponentRenderer.h
  type StarComponent (line 27) | struct StarComponent
  function class (line 29) | class StarComponentRenderer {

FILE: SoA/Startup.cpp
  function printHelp (line 5) | void printHelp() {
  function Startup (line 19) | Startup startup(int argc, cString* argv) {

FILE: SoA/Startup.h
  function Startup (line 22) | enum class Startup {

FILE: SoA/SystemARRenderer.h
  function class (line 29) | class SpriteFont)

FILE: SoA/SystemBodyLoader.h
  type SoaState (line 22) | struct SoaState
  function class (line 25) | class SystemBodyLoader {

FILE: SoA/TerrainGenTextures.h
  function class (line 23) | class TerrainGenTextures {

FILE: SoA/TerrainPatch.cpp
  function f64v3 (line 199) | f64v3 TerrainPatch::calculateClosestPointAndDist(const f64v3& cameraPos) {

FILE: SoA/TerrainPatch.h
  type TerrainPatchData (line 30) | struct TerrainPatchData { // TODO(Ben): probably dont need this
  function class (line 54) | class TerrainPatch {

FILE: SoA/TerrainPatchMesh.cpp
  function f32v3 (line 94) | f32v3 TerrainPatchMesh::getClosestPoint(const f32v3& camPos) const {
  function f64v3 (line 97) | f64v3 TerrainPatchMesh::getClosestPoint(const f64v3& camPos) const {

FILE: SoA/TerrainPatchMesh.h
  function class (line 29) | class TerrainVertex {
  function class (line 40) | class WaterVertex {
  function class (line 49) | class TerrainPatchMesh {

FILE: SoA/TerrainPatchMeshManager.cpp
  function meshComparator (line 191) | bool meshComparator(TerrainPatchMesh* m1, TerrainPatchMesh* m2) {

FILE: SoA/TerrainPatchMeshManager.h
  type AtmosphereComponent (line 24) | struct AtmosphereComponent
  type PlanetGenData (line 25) | struct PlanetGenData
  type TerrainPatchData (line 26) | struct TerrainPatchData
  function class (line 29) | class GLProgram)

FILE: SoA/TerrainPatchMeshTask.h
  type TerrainPatchData (line 24) | struct TerrainPatchData
  function class (line 33) | class TerrainPatchMeshTask : public vcore::IThreadPoolTask < WorkerData > {

FILE: SoA/TerrainPatchMesher.h
  type PlanetGenData (line 22) | struct PlanetGenData
  function class (line 25) | class TerrainPatchMesher {

FILE: SoA/TestBiomeScreen.cpp
  function i32 (line 35) | i32 TestBiomeScreen::getNextScreen() const {
  function i32 (line 39) | i32 TestBiomeScreen::getPreviousScreen() const {

FILE: SoA/TestBiomeScreen.h
  function class (line 26) | class TestBiomeScreen : public vui::IAppScreen < App > {

FILE: SoA/TestBlockViewScreen.cpp
  type VertexPosColor (line 56) | struct VertexPosColor {
  class APICullSimple (line 103) | class APICullSimple {
    method APICullSimple (line 105) | APICullSimple(const ui16* data) :
    method occludes (line 110) | vvox::meshalg::VoxelFaces occludes(const ui16& v1, const ui16& v2, con...
    method result (line 116) | void result(const vvox::meshalg::VoxelQuad& quad) {
  function i32 (line 167) | i32 TestBlockView::getNextScreen() const {
  function i32 (line 170) | i32 TestBlockView::getPreviousScreen() const {

FILE: SoA/TestBlockViewScreen.h
  function class (line 24) | class TestBlockView : public vui::IGameScreen {

FILE: SoA/TestConnectedTextureScreen.cpp
  function i32 (line 21) | i32 TestConnectedTextureScreen::getNextScreen() const {
  function i32 (line 25) | i32 TestConnectedTextureScreen::getPreviousScreen() const {
  function Chunk (line 336) | Chunk* TestConnectedTextureScreen::addChunk(const nString& name) {

FILE: SoA/TestConnectedTextureScreen.h
  function class (line 35) | class TestConnectedTextureScreen : public vui::IAppScreen<App> {

FILE: SoA/TestConsoleScreen.cpp
  function i32 (line 6) | i32 TestConsoleScreen::getNextScreen() const {
  function i32 (line 9) | i32 TestConsoleScreen::getPreviousScreen() const {

FILE: SoA/TestConsoleScreen.h
  function class (line 24) | class TestConsoleScreen : public vui::IGameScreen {

FILE: SoA/TestDeferredScreen.cpp
  type DefVertex (line 21) | struct DefVertex {
  function i32 (line 32) | i32 TestDeferredScreen::getNextScreen() const {
  function i32 (line 35) | i32 TestDeferredScreen::getPreviousScreen() const {

FILE: SoA/TestDeferredScreen.h
  function class (line 27) | class TestDeferredScreen : public vui::IGameScreen {

FILE: SoA/TestDisplacementMappingScreen.cpp
  function i32 (line 82) | i32 TestDisplacementMappingScreen::getNextScreen() const
  function i32 (line 87) | i32 TestDisplacementMappingScreen::getPreviousScreen() const

FILE: SoA/TestDisplacementMappingScreen.h
  function class (line 11) | class TestDisplacementMappingScreen : public vui::IGameScreen

FILE: SoA/TestGasGiantScreen.cpp
  function i32 (line 14) | i32 TestGasGiantScreen::getNextScreen() const {
  function i32 (line 18) | i32 TestGasGiantScreen::getPreviousScreen() const {

FILE: SoA/TestGasGiantScreen.h
  function class (line 23) | class TestGasGiantScreen : public vui::IGameScreen {

FILE: SoA/TestMappingScreen.cpp
  function i32 (line 33) | i32 TestMappingScreen::getNextScreen() const {
  function i32 (line 36) | i32 TestMappingScreen::getPreviousScreen() const {

FILE: SoA/TestMappingScreen.h
  function class (line 22) | class TestMappingScreen : public vui::IGameScreen {

FILE: SoA/TestNewBlockAPIScreen.cpp
  function i32 (line 6) | i32 TestNewBlockAPIScreen::getNextScreen() const {
  function i32 (line 9) | i32 TestNewBlockAPIScreen::getPreviousScreen() const {

FILE: SoA/TestNewBlockAPIScreen.h
  function class (line 20) | class TestNewBlockAPIScreen : public vui::IGameScreen {

FILE: SoA/TestNoiseScreen.cpp
  function i32 (line 26) | i32 TestNoiseScreen::getNextScreen() const
  function i32 (line 31) | i32 TestNoiseScreen::getPreviousScreen() const

FILE: SoA/TestNoiseScreen.h
  type TEST_NOISE_TYPES (line 14) | enum TEST_NOISE_TYPES { SIMPLEX = 0, CELLULAR }
  function class (line 16) | class TestNoiseScreen : public vui::IAppScreen <App>

FILE: SoA/TestPlanetGenScreen.cpp
  function i32 (line 18) | i32 TestPlanetGenScreen::getNextScreen() const {
  function i32 (line 22) | i32 TestPlanetGenScreen::getPreviousScreen() const {

FILE: SoA/TestPlanetGenScreen.h
  function class (line 36) | class TestPlanetGenScreen : public vui::IGameScreen {

FILE: SoA/TestScriptScreen.cpp
  function i32 (line 18) | i32 TestScriptScreen::getNextScreen() const {
  function i32 (line 22) | i32 TestScriptScreen::getPreviousScreen() const {

FILE: SoA/TestScriptScreen.h
  function class (line 16) | class TestScriptScreen : public vui::IAppScreen<App> {

FILE: SoA/TestStarScreen.cpp
  function i32 (line 27) | i32 TestStarScreen::getNextScreen() const {
  function i32 (line 31) | i32 TestStarScreen::getPreviousScreen() const {

FILE: SoA/TestStarScreen.h
  type SoaState (line 32) | struct SoaState
  function class (line 35) | class TestStarScreen : public vui::IAppScreen<App> {

FILE: SoA/TestUIScreen.cpp
  function i32 (line 16) | i32 TestUIScreen::getNextScreen() const {
  function i32 (line 20) | i32 TestUIScreen::getPreviousScreen() const {

FILE: SoA/TestUIScreen.h
  function class (line 17) | class TestUIScreen : public vui::IAppScreen<App> {

FILE: SoA/TestVoxelModelScreen.cpp
  function i32 (line 22) | i32 TestVoxelModelScreen::getNextScreen() const {
  function i32 (line 25) | i32 TestVoxelModelScreen::getPreviousScreen() const {

FILE: SoA/TestVoxelModelScreen.h
  type class (line 34) | enum class
  type MeshDebugInfo (line 36) | struct MeshDebugInfo {

FILE: SoA/Thread.h
  function Thread (line 17) | Thread(nullptr) {}
  function start (line 19) | void start(const T& arg) {
  function setFunction (line 23) | void setFunction(i32(*func)(T)) {
  type i32 (line 43) | typedef i32(*ThreadVoidFunction)();
  function class (line 45) | class ThreadVoid {
  function ThreadVoid (line 56) | ThreadVoid(nullptr) {}
  function start (line 58) | void start() {
  function setFunction (line 61) | void setFunction(ThreadVoidFunction func) {

FILE: SoA/TransparentVoxelRenderStage.h
  function class (line 28) | class TransparentVoxelRenderStage : public IRenderStage {

FILE: SoA/VRayHelper.cpp
  function solidVoxelPredBlock (line 9) | bool solidVoxelPredBlock(const Block& block) {
  function VoxelRayQuery (line 13) | const VoxelRayQuery VRayHelper::getQuery(const f64v3& pos, const f32v3& ...
  function VoxelRayFullQuery (line 89) | const VoxelRayFullQuery VRayHelper::getFullQuery(const f64v3& pos, const...

FILE: SoA/VRayHelper.h
  function class (line 13) | class VoxelRayQuery {
  function class (line 26) | class VoxelRayFullQuery {
  function class (line 36) | class VRayHelper {

FILE: SoA/Vertex.h
  function class (line 20) | class ColorVertex {
  type AtlasTexturePosition (line 31) | struct AtlasTexturePosition {
  function union (line 49) | struct BlockVertex {
  function class (line 90) | class LiquidVertex {
  function class (line 102) | class PhysicsBlockVertex {

FILE: SoA/VoxPool.h
  function class (line 21) | class WorkerData {
  type vcore (line 34) | typedef vcore::ThreadPool<WorkerData> VoxPool;

FILE: SoA/VoxelBits.h
  function namespace (line 29) | namespace VoxelBits {

FILE: SoA/VoxelCoordinateSpaces.h
  type WorldCubeFace (line 20) | enum WorldCubeFace {
  type ChunkPosition2D (line 26) | struct ChunkPosition2D {
  function i32v2 (line 29) | const i32v2&() const { return pos; }
  type ChunkPosition3D (line 38) | struct ChunkPosition3D {
  type VoxelPosition2D (line 52) | struct VoxelPosition2D {
  function f64v2 (line 55) | const f64v2&() const { return pos; }
  type VoxelPosition3D (line 64) | struct VoxelPosition3D {

FILE: SoA/VoxelEditor.h
  type ItemStack (line 11) | struct ItemStack
  function class (line 13) | class EditorNode {
  function EDITOR_TOOLS (line 17) | enum class EDITOR_TOOLS { AABOX, LINE };

FILE: SoA/VoxelLightEngine.cpp
  function ui16 (line 381) | inline ui16 getMaxLampColors(const ui16 redA VORB_UNUSED, const ui16 gre...
  function getLampColors (line 389) | inline void getLampColors(const ui16 l VORB_UNUSED, ui16 &r VORB_UNUSED,...

FILE: SoA/VoxelLightEngine.h
  function class (line 14) | class SunlightRemovalNode
  function class (line 22) | class SunlightUpdateNode
  function class (line 30) | class LampLightRemovalNode
  function class (line 38) | class LampLightUpdateNode
  function class (line 48) | class VoxelLightEngine {

FILE: SoA/VoxelMatrix.cpp
  function ColorRGBA8 (line 6) | const ColorRGBA8& VoxelMatrix::getColor(const int index) const {
  function ColorRGBA8 (line 10) | const ColorRGBA8& VoxelMatrix::getColor(const i32v3& position) const {
  function ColorRGBA8 (line 14) | const ColorRGBA8& VoxelMatrix::getColor(const i32 x, const i32 y, const ...
  function ColorRGBA8 (line 18) | const ColorRGBA8& VoxelMatrix::getColorAndCheckBounds(const i32v3& posit...
  function ColorRGBA8 (line 25) | const ColorRGBA8& VoxelMatrix::getColorAndCheckBounds(const i32 x, const...

FILE: SoA/VoxelMatrix.h
  function class (line 7) | class VoxelMatrix {

FILE: SoA/VoxelMesh.h
  type VoxelFaceDirectionMesh (line 21) | struct VoxelFaceDirectionMesh {
  type VoxelMesh (line 32) | struct VoxelMesh {

FILE: SoA/VoxelMesher.cpp
  function ui8 (line 750) | ui8 VoxelMesher::getBlendMode(const BlendType& blendType) {

FILE: SoA/VoxelMesher.h
  function class (line 20) | class VoxelMesher

FILE: SoA/VoxelModel.h
  function class (line 15) | class VoxelModel {

FILE: SoA/VoxelModelLoader.h
  function class (line 28) | class VoxelModelLoader {

FILE: SoA/VoxelModelMesh.h
  function class (line 8) | class VoxelModelVertex {
  function class (line 21) | class VoxelModelMesh {

FILE: SoA/VoxelModelRenderer.h
  function class (line 10) | class VoxelModelRenderer {

FILE: SoA/VoxelNodeSetter.h
  type VoxelNodeSetterWaitingChunk (line 25) | struct VoxelNodeSetterWaitingChunk {
  type VoxelNodeSetterLookupData (line 30) | struct VoxelNodeSetterLookupData {
  function class (line 37) | class VoxelNodeSetter {

FILE: SoA/VoxelNodeSetterTask.h
  type VoxelToPlace (line 23) | struct VoxelToPlace {
  function class (line 30) | class VoxelNodeSetterTask : public vcore::IThreadPoolTask<WorkerData> {

FILE: SoA/VoxelRay.cpp
  function f64 (line 8) | inline f64 fastFloorf(f64 x) {
  function f64 (line 11) | inline f64 fastCeilf(f64 x) {
  function i32v3 (line 23) | i32v3 VoxelRay::getNextVoxelPosition() {

FILE: SoA/VoxelRay.h
  function class (line 6) | class VoxelRay {

FILE: SoA/VoxelSpaceConversions.cpp
  function f32v3 (line 5) | f32v3 VoxelSpaceConversions::getCoordinateMults(const ChunkPosition2D& f...
  function f32v3 (line 12) | f32v3 VoxelSpaceConversions::getCoordinateMults(const ChunkPosition3D& f...
  function i32v3 (line 20) | i32v3 VoxelSpaceConversions::getCoordinateMapping(const ChunkPosition2D&...
  function i32v3 (line 23) | i32v3 VoxelSpaceConversions::getCoordinateMapping(const ChunkPosition3D&...
  function ChunkPosition2D (line 27) | ChunkPosition2D VoxelSpaceConversions::voxelToChunk(const VoxelPosition2...
  function ChunkPosition3D (line 34) | ChunkPosition3D VoxelSpaceConversions::voxelToChunk(const VoxelPosition3...
  function i32v3 (line 43) | i32v3 VoxelSpaceConversions::voxelToChunk(const i32v3& voxelPosition) {
  function i32v3 (line 51) | i32v3 VoxelSpaceConversions::voxelToChunk(const f64v3& voxelPosition) {
  function VoxelPosition2D (line 59) | VoxelPosition2D VoxelSpaceConversions::chunkToVoxel(const ChunkPosition2...
  function VoxelPosition3D (line 66) | VoxelPosition3D VoxelSpaceConversions::chunkToVoxel(const ChunkPosition3...
  function f64v3 (line 75) | f64v3 VoxelSpaceConversions::voxelToWorld(const VoxelPosition2D& facePos...
  function f64v3 (line 78) | f64v3 VoxelSpaceConversions::voxelToWorld(const VoxelPosition3D& facePos...
  function f64v3 (line 82) | f64v3 VoxelSpaceConversions::chunkToWorld(const ChunkPosition2D& facePos...
  function f64v3 (line 85) | f64v3 VoxelSpaceConversions::chunkToWorld(const ChunkPosition3D& facePos...
  function f64v3 (line 89) | f64v3 VoxelSpaceConversions::voxelToWorldNormalized(const VoxelPosition2...
  function f64v3 (line 100) | f64v3 VoxelSpaceConversions::voxelToWorldNormalized(const VoxelPosition3...
  function f64v3 (line 112) | f64v3 VoxelSpaceConversions::chunkToWorldNormalized(const ChunkPosition2...
  function f64v3 (line 115) | f64v3 VoxelSpaceConversions::chunkToWorldNormalized(const ChunkPosition3...
  function VoxelPosition3D (line 119) | VoxelPosition3D computeGridPosition(const f32v3& hitpoint, f32 radius) {
  function VoxelPosition3D (line 167) | VoxelPosition3D VoxelSpaceConversions::worldToVoxel(const f64v3& worldPo...

FILE: SoA/VoxelSpaceConversions.h
  function namespace (line 23) | namespace VoxelSpaceConversions {

FILE: SoA/VoxelSpaceUtils.cpp
  function f64q (line 36) | f64q VoxelSpaceUtils::calculateVoxelToSpaceQuat(const VoxelPosition2D& g...
  function f64q (line 62) | f64q VoxelSpaceUtils::calculateVoxelToSpaceQuat(const VoxelPosition3D& g...

FILE: SoA/VoxelSpaceUtils.h
  function namespace (line 20) | namespace VoxelSpaceUtils {

FILE: SoA/VoxelUpdateBufferer.h
  type VoxelUpdateBuffer (line 23) | struct VoxelUpdateBuffer {
  function class (line 34) | class VoxelUpdateBufferer {

FILE: SoA/VoxelVertices.h
  type VertexVoxelChunkSolid (line 18) | struct VertexVoxelChunkSolid {

FILE: SoA/WSO.h
  function class (line 6) | class WSO {

FILE: SoA/WSOAtlas.cpp
  class WSOFileHeader (line 9) | class WSOFileHeader {
  class WSOIndexInformation (line 17) | class WSOIndexInformation {

FILE: SoA/WSOAtlas.h
  function class (line 10) | class WSOAtlas {

FILE: SoA/WSOData.h
  function class (line 8) | class WSOData {

FILE: SoA/WSOScanner.cpp
  function checkForWSO (line 18) | bool checkForWSO(const i16* query, const WSOData* data, i32v3& offset) {
  function i16 (line 91) | const i16* WSOScanner::getQuery(const i32v3& position VORB_UNUSED, Chunk...

FILE: SoA/WSOScanner.h
  function class (line 10) | class WSOScanner {

FILE: SoA/WorldIO.cpp
  function ThreadError (line 24) | void ThreadError(string msg){
  function string (line 731) | string WorldIO::getRegionString(Chunk *ch)
  type stat (line 749) | struct stat
  function i32 (line 878) | i32 WorldIO::truncate(i64 size)
  function GLuint (line 891) | GLuint WorldIO::getLocOffset(Chunk *ch)
  function LocationBuffer (line 920) | LocationBuffer *WorldIO::newLocationBuffer()

FILE: SoA/WorldIO.h
  type LocationBuffer (line 15) | struct LocationBuffer {
  function class (line 21) | class WorldIO {

FILE: SoA/WorldStructs.cpp
  class Item (line 12) | class Item

FILE: SoA/WorldStructs.h
  type PlanetGenData (line 18) | struct PlanetGenData
  function class (line 20) | class FixedSizeBillboardVertex{
  function class (line 27) | class Marker{
  type MineralData (line 45) | struct MineralData
  function class (line 63) | class BillboardVertex
  function class (line 77) | class PhysicsBlockPosLight
  function class (line 89) | class TreeVertex
  function PseudoRand (line 99) | inline double PseudoRand(int x, int z)
  function PseudoRand (line 108) | inline double PseudoRand(int n)

FILE: SoA/ZipFile.cpp
  function ui8 (line 27) | ui8* ZipFile::readFile(nString fileName, size_t& fileSize) {

FILE: SoA/ZipFile.h
  function class (line 6) | class ZipFile {

FILE: SoA/atomicops.h
  function namespace (line 78) | namespace moodycamel {
  function namespace (line 117) | namespace moodycamel {
  function namespace (line 186) | namespace moodycamel {
  function namespace (line 232) | namespace moodycamel {

FILE: SoA/main.cpp
  function main (line 18) | int main(int argc, char **argv) {

FILE: SoA/qef.cpp
  type svd (line 30) | namespace svd {
    function QefData (line 50) | QefData& QefData::operator=(const QefData& rhs) {
    function normalize (line 132) | static void normalize(float &nx, float &ny, float &nz) {
    function QefData (line 170) | QefData QefSolver::getData() {

FILE: SoA/qef.h
  function namespace (line 34) | namespace svd {

FILE: SoA/readerwriterqueue.h
  function namespace (line 50) | namespace moodycamel {

FILE: SoA/soaUtils.h
  function f32v3 (line 61) | inline f32v3 getClosestPointOnAABB(const f32v3& pos, const f32v3& aabbPos,
  function f64v3 (line 70) | inline f64v3 getClosestPointOnAABB(const f64v3& pos, const f64v3& aabbPos,
  function f32 (line 93) | inline f32 selfDot(const f32v3& v) {
  function f32 (line 96) | inline f32 selfDot(const f32v4& v) {
  function f64 (line 99) | inline f64 selfDot(const f64v3& v) {
  function f64 (line 102) | inline f64 selfDot(const f64v4& v) {
  function i32 (line 105) | inline i32 selfDot(const i32v3& v) {
  function i32 (line 108) | inline i32 selfDot(const i32v4& v) {
  function ui32 (line 111) | inline ui32 selfDot(const ui32v3& v) {
  function ui32 (line 114) | inline ui32 selfDot(const ui32v4& v) {
  function dumpFramebufferImage (line 118) | inline bool dumpFramebufferImage(const nString& rootDir, const ui32v4& v...
  function f64 (line 142) | inline f64 pseudoRand(int x, int z) {
  function ui32 (line 150) | inline ui32 fastRand(ui32 seed) {
  function class (line 157) | class FastRandGenerator {
  function f64 (line 227) | inline f64 fastAtan2(f64 y, f64 x) {
  function f32 (line 277) | inline f32 computeZCoef(f32 zFar) {
  function f32 (line 282) | inline f32 computeDistance2FromChunk(const f64v3& chunkPos, const f64v3&...

FILE: SoA/svd.cpp
  type svd (line 31) | namespace svd {
    function calcSymmetricGivensCoefficients (line 275) | static void calcSymmetricGivensCoefficients(const float a_pp,
    function rotate01 (line 317) | static void rotate01(SMat3 &vtav, Mat3 &v) {
    function rotate02 (line 327) | static void rotate02(SMat3 &vtav, Mat3 &v) {
    function rotate12 (line 337) | static void rotate12(SMat3 &vtav, Mat3 &v) {
    function calcError (line 370) | static float calcError(const SMat3 &origA, const Vec3 &x,
    function pinv (line 380) | static float pinv(const float x, const float tol) {

FILE: SoA/svd.h
  function namespace (line 33) | namespace svd {

FILE: SoA/textureUtils.h
  function initSinglePixelTexture (line 31) | inline void initSinglePixelTexture(VGTexture& texture, color4 pixel) {

FILE: jenkins.py
  function clear_except_download (line 18) | def clear_except_download(hunter_root):
  function run (line 34) | def run():

FILE: scripts/ShowPredefined.cpp
  function main (line 3300) | int main() {

FILE: scripts/link-all.py
  function job (line 25) | def job(job_index):
  function run_link (line 42) | def run_link():

FILE: scripts/upload-cache-to-github.py
  class Error (line 24) | class Error(Exception):
  function sleep_time (line 27) | def sleep_time(attempt):
  function retry (line 42) | def retry(func_in):
  class Github (line 66) | class Github:
    method __init__ (line 67) | def __init__(self, username, password, repo_owner, repo):
    method simple_request (line 76) | def simple_request(self):
    method get_release_by_tag (line 89) | def get_release_by_tag(self, tagname):
    method find_asset_id_by_name (line 147) | def find_asset_id_by_name(self, release_id, name):
    method delete_asset_by_id (line 181) | def delete_asset_by_id(self, asset_id, asset_name):
    method delete_asset_if_exists (line 197) | def delete_asset_if_exists(self, release_id, asset_name):
    method upload_bzip_once (line 204) | def upload_bzip_once(self, url, local_path):
    method upload_bzip (line 212) | def upload_bzip(self, url, local_path, release_id, asset_name):
    method upload_raw_file (line 221) | def upload_raw_file(self, local_path):
  class CacheEntry (line 236) | class CacheEntry:
    method __init__ (line 237) | def __init__(self, cache_done_path, cache_dir):
    method entry_from_server (line 247) | def entry_from_server(self):
    method upload_raw (line 250) | def upload_raw(self, github):
    method touch_from_server (line 262) | def touch_from_server(self):
  class Cache (line 265) | class Cache:
    method __init__ (line 266) | def __init__(self, cache_dir):
    method create_entries (line 273) | def create_entries(self, cache_dir):
    method remove_entries_from_server (line 283) | def remove_entries_from_server(self):
    method upload_raw (line 290) | def upload_raw(self, github):
    method make_commit_message (line 294) | def make_commit_message(self):
    method try_to_push (line 351) | def try_to_push(self, main_remote, main_remote_url_pull, github):
    method upload_meta (line 401) | def upload_meta(self, github, cache_dir):
    method touch_from_server (line 506) | def touch_from_server(self):

FILE: utils/git-hooks/cpplint/cpplint.py
  function u (line 304) | def u(x):
  function u (line 312) | def u(x):
  function ParseNolintSuppressions (line 319) | def ParseNolintSuppressions(filename, raw_line, linenum, error):
  function ResetNolintSuppressions (line 348) | def ResetNolintSuppressions():
  function IsErrorSuppressedByNolint (line 353) | def IsErrorSuppressedByNolint(category, linenum):
  function Match (line 368) | def Match(pattern, s):
  function Search (line 378) | def Search(pattern, s):
  class _IncludeState (line 385) | class _IncludeState(dict):
    method __init__ (line 419) | def __init__(self):
    method CanonicalizeAlphabeticalOrder (line 426) | def CanonicalizeAlphabeticalOrder(self, header_path):
    method IsInAlphabeticalOrder (line 441) | def IsInAlphabeticalOrder(self, header_path):
    method CheckNextIncludeOrder (line 456) | def CheckNextIncludeOrder(self, header_type):
  class _CppLintState (line 510) | class _CppLintState(object):
    method __init__ (line 513) | def __init__(self):
    method SetOutputFormat (line 526) | def SetOutputFormat(self, output_format):
    method SetVerboseLevel (line 530) | def SetVerboseLevel(self, level):
    method SetCountingStyle (line 536) | def SetCountingStyle(self, counting_style):
    method SetFilters (line 540) | def SetFilters(self, filters):
    method ResetErrorCounts (line 565) | def ResetErrorCounts(self):
    method IncrementErrorCount (line 570) | def IncrementErrorCount(self, category):
    method PrintErrorCounts (line 580) | def PrintErrorCounts(self):
  function _OutputFormat (line 591) | def _OutputFormat():
  function _SetOutputFormat (line 596) | def _SetOutputFormat(output_format):
  function _VerboseLevel (line 601) | def _VerboseLevel():
  function _SetVerboseLevel (line 606) | def _SetVerboseLevel(level):
  function _SetCountingStyle (line 611) | def _SetCountingStyle(level):
  function _Filters (line 616) | def _Filters():
  function _SetFilters (line 621) | def _SetFilters(filters):
  class _FunctionState (line 634) | class _FunctionState(object):
    method __init__ (line 640) | def __init__(self):
    method Begin (line 645) | def Begin(self, function_name):
    method Count (line 655) | def Count(self):
    method Check (line 660) | def Check(self, error, filename, linenum):
    method End (line 685) | def End(self):
  class _IncludeError (line 690) | class _IncludeError(Exception):
  class FileInfo (line 695) | class FileInfo:
    method __init__ (line 702) | def __init__(self, filename):
    method FullName (line 705) | def FullName(self):
    method RepositoryName (line 709) | def RepositoryName(self):
    method Split (line 754) | def Split(self):
    method BaseName (line 768) | def BaseName(self):
    method Extension (line 772) | def Extension(self):
    method NoExtension (line 776) | def NoExtension(self):
    method IsSource (line 780) | def IsSource(self):
  function _ShouldPrintError (line 785) | def _ShouldPrintError(category, confidence, linenum):
  function Error (line 812) | def Error(filename, linenum, category, confidence, message):
  function IsCppString (line 866) | def IsCppString(line):
  function FindNextMultiLineCommentStart (line 883) | def FindNextMultiLineCommentStart(lines, lineix):
  function FindNextMultiLineCommentEnd (line 894) | def FindNextMultiLineCommentEnd(lines, lineix):
  function RemoveMultiLineCommentsFromRange (line 903) | def RemoveMultiLineCommentsFromRange(lines, begin, end):
  function RemoveMultiLineComments (line 911) | def RemoveMultiLineComments(filename, lines, error):
  function CleanseComments (line 927) | def CleanseComments(line):
  class CleansedLines (line 943) | class CleansedLines(object):
    method __init__ (line 952) | def __init__(self, lines):
    method NumLines (line 962) | def NumLines(self):
    method _CollapseStrings (line 967) | def _CollapseStrings(elided):
  function CloseExpression (line 988) | def CloseExpression(clean_lines, linenum, pos):
  function CheckForCopyright (line 1027) | def CheckForCopyright(filename, lines, error):
  function GetHeaderGuardCPPVariable (line 1041) | def GetHeaderGuardCPPVariable(filename):
  function CheckForHeaderGuard (line 1061) | def CheckForHeaderGuard(filename, lines, error):
  function CheckForUnicodeReplacementCharacters (line 1136) | def CheckForUnicodeReplacementCharacters(filename, lines, error):
  function CheckForNewlineAtEOF (line 1155) | def CheckForNewlineAtEOF(filename, lines, error):
  function CheckForMultilineCommentsAndStrings (line 1173) | def CheckForMultilineCommentsAndStrings(filename, clean_lines, linenum, ...
  function CheckPosixThreading (line 1228) | def CheckPosixThreading(filename, clean_lines, linenum, error):
  function CheckInvalidIncrement (line 1261) | def CheckInvalidIncrement(filename, clean_lines, linenum, error):
  class _ClassInfo (line 1283) | class _ClassInfo(object):
    method __init__ (line 1286) | def __init__(self, name, clean_lines, linenum):
  class _ClassState (line 1310) | class _ClassState(object):
    method __init__ (line 1319) | def __init__(self):
    method CheckFinished (line 1322) | def CheckFinished(self, filename, error):
  function CheckForNonStandardConstructs (line 1339) | def CheckForNonStandardConstructs(filename, clean_lines, linenum,
  function CheckSpacingForFunctionCall (line 1509) | def CheckSpacingForFunctionCall(filename, line, linenum, error):
  function IsBlankLine (line 1575) | def IsBlankLine(line):
  function CheckForFunctionLengths (line 1590) | def CheckForFunctionLengths(filename, clean_lines, linenum,
  function CheckComment (line 1663) | def CheckComment(comment, filename, linenum, error):
  function CheckSpacing (line 1693) | def CheckSpacing(filename, clean_lines, linenum, error):
  function CheckSectionSpacing (line 1939) | def CheckSectionSpacing(filename, clean_lines, class_info, linenum, error):
  function GetPreviousNonBlankLine (line 1991) | def GetPreviousNonBlankLine(clean_lines, linenum):
  function CheckBraces (line 2014) | def CheckBraces(filename, clean_lines, linenum, error):
  function ReplaceableCheck (line 2088) | def ReplaceableCheck(operator, macro, line):
  function CheckCheck (line 2123) | def CheckCheck(filename, clean_lines, linenum, error):
  function GetLineWidth (line 2156) | def GetLineWidth(line):
  function CheckStyle (line 2178) | def CheckStyle(filename, clean_lines, linenum, file_extension, class_state,
  function _DropCommonSuffixes (line 2294) | def _DropCommonSuffixes(filename):
  function _IsTestFilename (line 2321) | def _IsTestFilename(filename):
  function _ClassifyInclude (line 2338) | def _ClassifyInclude(fileinfo, include, is_system):
  function CheckIncludeLine (line 2399) | def CheckIncludeLine(filename, clean_lines, linenum, include_state, error):
  function _GetTextInside (line 2468) | def _GetTextInside(text, start_pattern):
  function CheckLanguage (line 2524) | def CheckLanguage(filename, clean_lines, linenum, file_extension, includ...
  function CheckCStyleCast (line 2817) | def CheckCStyleCast(filename, linenum, line, raw_line, cast_type, pattern,
  function FilesBelongToSameModule (line 2938) | def FilesBelongToSameModule(filename_cc, filename_h):
  function UpdateIncludeState (line 2993) | def UpdateIncludeState(filename, include_state, io=codecs):
  function CheckForIncludeWhatYouUse (line 3022) | def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error,
  function CheckMakePairUsesDeduction (line 3118) | def CheckMakePairUsesDeduction(filename, clean_lines, linenum, error):
  function ProcessLine (line 3140) | def ProcessLine(filename, file_extension,
  function ProcessFileData (line 3176) | def ProcessFileData(filename, file_extension, lines, error,
  function ProcessFile (line 3221) | def ProcessFile(filename, vlevel, extra_check_functions=[]):
  function PrintUsage (line 3289) | def PrintUsage(message):
  function PrintCategories (line 3303) | def PrintCategories():
  function ParseArguments (line 3312) | def ParseArguments(args):
  function main (line 3364) | def main():

FILE: utils/git-hooks/pep8.py
  function tabs_or_spaces (line 119) | def tabs_or_spaces(physical_line, indent_char):
  function tabs_obsolete (line 139) | def tabs_obsolete(physical_line):
  function trailing_whitespace (line 152) | def trailing_whitespace(physical_line):
  function trailing_blank_lines (line 182) | def trailing_blank_lines(physical_line, lines, line_number):
  function missing_newline (line 193) | def missing_newline(physical_line):
  function maximum_line_length (line 203) | def maximum_line_length(physical_line, max_line_length):
  function blank_lines (line 235) | def blank_lines(logical_line, blank_lines, indent_level, line_number,
  function extraneous_whitespace (line 273) | def extraneous_whitespace(logical_line):
  function whitespace_around_keywords (line 306) | def whitespace_around_keywords(logical_line):
  function missing_whitespace (line 330) | def missing_whitespace(logical_line):
  function indentation (line 357) | def indentation(logical_line, previous_logical, indent_char,
  function continued_indentation (line 384) | def continued_indentation(logical_line, tokens, indent_level, hang_closing,
  function whitespace_before_parameters (line 555) | def whitespace_before_parameters(logical_line, tokens):
  function whitespace_around_operator (line 589) | def whitespace_around_operator(logical_line):
  function missing_whitespace_around_operator (line 616) | def missing_whitespace_around_operator(logical_line, tokens):
  function whitespace_around_comma (line 713) | def whitespace_around_comma(logical_line):
  function whitespace_around_named_parameter_equals (line 735) | def whitespace_around_named_parameter_equals(logical_line, tokens):
  function whitespace_before_inline_comment (line 771) | def whitespace_before_inline_comment(logical_line, tokens):
  function imports_on_separate_lines (line 800) | def imports_on_separate_lines(logical_line):
  function compound_statements (line 820) | def compound_statements(logical_line):
  function explicit_line_join (line 866) | def explicit_line_join(logical_line, tokens):
  function comparison_to_singleton (line 901) | def comparison_to_singleton(logical_line, noqa):
  function comparison_type (line 931) | def comparison_type(logical_line):
  function python_3000_has_key (line 954) | def python_3000_has_key(logical_line):
  function python_3000_raise_comma (line 967) | def python_3000_raise_comma(logical_line):
  function python_3000_not_equal (line 985) | def python_3000_not_equal(logical_line):
  function python_3000_backticks (line 999) | def python_3000_backticks(logical_line):
  function readlines (line 1019) | def readlines(filename):
  function readlines (line 1029) | def readlines(filename):
  function stdin_get_value (line 1044) | def stdin_get_value():
  function expand_indent (line 1050) | def expand_indent(line):
  function mute_string (line 1079) | def mute_string(text):
  function parse_udiff (line 1100) | def parse_udiff(diff, patterns=None, parent='.'):
  function filename_match (line 1125) | def filename_match(filename, patterns, default=True):
  function register_check (line 1143) | def register_check(check, codes=None):
  function init_checks_registry (line 1163) | def init_checks_registry():
  class Checker (line 1174) | class Checker(object):
    method __init__ (line 1179) | def __init__(self, filename=None, lines=None,
    method report_invalid_syntax (line 1218) | def report_invalid_syntax(self):
    method readline (line 1231) | def readline(self):
    method readline_check_physical (line 1240) | def readline_check_physical(self):
    method run_check (line 1250) | def run_check(self, check, argument_names):
    method check_physical (line 1259) | def check_physical(self, line):
    method build_tokens_line (line 1272) | def build_tokens_line(self):
    method check_logical (line 1312) | def check_logical(self):
    method check_ast (line 1339) | def check_ast(self):
    method generate_tokens (line 1350) | def generate_tokens(self):
    method check_all (line 1360) | def check_all(self, expected=None, line_offset=0):
  class BaseReport (line 1411) | class BaseReport(object):
    method __init__ (line 1415) | def __init__(self, options):
    method start (line 1424) | def start(self):
    method stop (line 1428) | def stop(self):
    method init_file (line 1432) | def init_file(self, filename, lines, expected, line_offset):
    method increment_logical_line (line 1442) | def increment_logical_line(self):
    method error (line 1446) | def error(self, line_number, offset, text, check):
    method get_file_results (line 1465) | def get_file_results(self):
    method get_count (line 1469) | def get_count(self, prefix=''):
    method get_statistics (line 1474) | def get_statistics(self, prefix=''):
    method print_statistics (line 1486) | def print_statistics(self, prefix=''):
    method print_benchmark (line 1491) | def print_benchmark(self):
  class FileReport (line 1501) | class FileReport(BaseReport):
  class StandardReport (line 1506) | class StandardReport(BaseReport):
    method __init__ (line 1509) | def __init__(self, options):
    method init_file (line 1517) | def init_file(self, filename, lines, expected, line_offset):
    method error (line 1523) | def error(self, line_number, offset, text, check):
    method get_file_results (line 1532) | def get_file_results(self):
  class DiffReport (line 1553) | class DiffReport(StandardReport):
    method __init__ (line 1556) | def __init__(self, options):
    method error (line 1560) | def error(self, line_number, offset, text, check):
  class StyleGuide (line 1566) | class StyleGuide(object):
    method __init__ (line 1569) | def __init__(self, *args, **kwargs):
    method init_report (line 1606) | def init_report(self, reporter=None):
    method check_files (line 1611) | def check_files(self, paths=None):
    method input_file (line 1629) | def input_file(self, filename, lines=None, expected=None, line_offset=0):
    method input_dir (line 1637) | def input_dir(self, dirname):
    method excluded (line 1659) | def excluded(self, filename, parent=None):
    method ignore_code (line 1672) | def ignore_code(self, code):
    method get_checks (line 1683) | def get_checks(self, argument_name):
  function get_parser (line 1696) | def get_parser(prog='pep8', version=__version__):
  function read_config (line 1756) | def read_config(options, args, arglist, parser):
  function process_options (line 1807) | def process_options(arglist=None, parse_argv=False, config_file=None,
  function _main (line 1854) | def _main():
Condensed preview — 497 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,897K chars).
[
  {
    "path": ".gitattributes",
    "chars": 1074,
    "preview": "# -----------------------------------------------------------------------------\n# After much research...\n#  text should "
  },
  {
    "path": ".gitignore",
    "chars": 2724,
    "preview": "## Ignore Visual Studio temporary files, build results, and\n## files generated by popular Visual Studio add-ons.\n\n# User"
  },
  {
    "path": ".gitmodules",
    "chars": 173,
    "preview": "[submodule \"game\"]\n\tpath = game\n\turl = https://github.com/RegrowthStudios/SoAGameData.git\n[submodule \"Vorb\"]\n\tpath = Vor"
  },
  {
    "path": ".mailmap",
    "chars": 381,
    "preview": "Benjamin Arnold <brb555@utk.edu> barnold1953 <brb555@utk.edu>\nBrian Bruggeman <brian.m.bruggeman@gmail.com> <Brian.M.Bru"
  },
  {
    "path": ".travis.yml",
    "chars": 5429,
    "preview": "# OSX/Linux (https://github.com/travis-ci-tester/toolchain-table)\n\nlanguage:\n  - cpp\n\n# Container-based infrastructure ("
  },
  {
    "path": "CMakeLists.txt",
    "chars": 1389,
    "preview": "cmake_minimum_required (VERSION 3.0)\n\nset(HUNTER_STATUS_DEBUG ON)\n#setup cache server and suppot upload\nset(\n    HUNTER_"
  },
  {
    "path": "LICENSE.txt",
    "chars": 1059,
    "preview": "Copyright (c) 2018 Regrowth Studios\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof thi"
  },
  {
    "path": "ModTest/ModTest.vcxproj",
    "chars": 6906,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.micros"
  },
  {
    "path": "ModTest/ModTest.vcxproj.filters",
    "chars": 205,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
  },
  {
    "path": "ModTest/main.cpp",
    "chars": 821,
    "preview": "#include <cstdio>\n\n#define _WINSOCKAPI_\n#include <Windows.h>\n\nBOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, L"
  },
  {
    "path": "ProjectConverter/App.Designer.cs",
    "chars": 10472,
    "preview": "namespace ProjectConverter {\n    partial class App {\n        /// <summary>\n        /// Required designer variable.\n    "
  },
  {
    "path": "ProjectConverter/App.config",
    "chars": 193,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n    <startup> \n        <supportedRuntime version=\"v4.0\" sku=\".NET"
  },
  {
    "path": "ProjectConverter/App.cs",
    "chars": 7307,
    "preview": "using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Data;\nusing System.Drawing;\nu"
  },
  {
    "path": "ProjectConverter/App.resx",
    "chars": 6036,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The prim"
  },
  {
    "path": "ProjectConverter/ProjectConverter.csproj",
    "chars": 3040,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.micros"
  },
  {
    "path": "ProjectConverter/ProjectConverter.sln",
    "chars": 976,
    "preview": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 2013\nVisualStudioVersion = 12.0.21005.1\nMi"
  },
  {
    "path": "ProjectConverter/Properties/AssemblyInfo.cs",
    "chars": 1405,
    "preview": "using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Infor"
  },
  {
    "path": "README.md",
    "chars": 7190,
    "preview": "\n[![dicord](https://img.shields.io/discord/459062989094649866.svg?logo=discord \"Discord\")](https://discord.gg/QRex8GK)\n!"
  },
  {
    "path": "SoA/AABBCollidableComponentUpdater.cpp",
    "chars": 5922,
    "preview": "#include \"stdafx.h\"\n#include \"AABBCollidableComponentUpdater.h\"\n\n#include \"GameSystem.h\"\n#include \"SpaceSystem.h\"\n#inclu"
  },
  {
    "path": "SoA/AABBCollidableComponentUpdater.h",
    "chars": 691,
    "preview": "//\n// AABBCollidableComponentUpdater.h\n// Seed of Andromeda\n//\n// Created by Benjamin Arnold on 30 Aug 2015\n// Copyright"
  },
  {
    "path": "SoA/ARProcessor.cpp",
    "chars": 44,
    "preview": "#include \"stdafx.h\"\n#include \"ARProcessor.h\""
  },
  {
    "path": "SoA/ARProcessor.h",
    "chars": 339,
    "preview": "///\n/// ARProcessor.h\n/// Seed of Andromeda\n///\n/// Created by Cristian Zaloj on 9 Nov 2014\n/// Copyright 2014 Regrowth "
  },
  {
    "path": "SoA/AmbienceLibrary.cpp",
    "chars": 770,
    "preview": "#include \"stdafx.h\"\n#include \"AmbienceLibrary.h\"\n\nvoid AmbienceLibrary::addTrack(const nString& list, const nString& nam"
  },
  {
    "path": "SoA/AmbienceLibrary.h",
    "chars": 1383,
    "preview": "///\n/// AmbienceLibrary.h\n/// Seed of Andromeda\n///\n/// Created by Cristian Zaloj on 11 Jan 2015\n/// Copyright 2014 Regr"
  },
  {
    "path": "SoA/AmbiencePlayer.cpp",
    "chars": 3265,
    "preview": "#include \"stdafx.h\"\n#include \"AmbiencePlayer.h\"\n\n#include <Vorb/sound/SoundEngine.h>\n\n#include \"AmbienceLibrary.h\"\n\n#def"
  },
  {
    "path": "SoA/AmbiencePlayer.h",
    "chars": 2496,
    "preview": "///\n/// AmbiencePlayer.h\n/// Seed of Andromeda\n///\n/// Created by Cristian Zaloj on 11 Jan 2015\n/// Copyright 2014 Regro"
  },
  {
    "path": "SoA/AmbienceStream.cpp",
    "chars": 847,
    "preview": "#include \"stdafx.h\"\n#include \"AmbienceStream.h\"\n\nconst f32& AmbienceStream::getVolume() const {\n    return m_ratio;\n}\n\nb"
  },
  {
    "path": "SoA/AmbienceStream.h",
    "chars": 1359,
    "preview": "///\n/// AmbienceStream.h\n/// Seed of Andromeda\n///\n/// Created by Cristian Zaloj on 11 Jan 2015\n/// Copyright 2014 Regro"
  },
  {
    "path": "SoA/Animation.h",
    "chars": 317,
    "preview": "#pragma once\n\n#ifndef Animation_h_\n#define Animation_h_\n\n#include <Vorb/graphics/Texture.h>\n\nstruct Animation {\n    Anim"
  },
  {
    "path": "SoA/App.cpp",
    "chars": 5503,
    "preview": "#include \"stdafx.h\"\n#include \"App.h\"\n\n#include <Vorb/ui/InputDispatcher.h>\n#include <Vorb/ui/ScreenList.h>\n#include <Vor"
  },
  {
    "path": "SoA/App.h",
    "chars": 809,
    "preview": "#pragma once\n\n#ifndef App_h_\n#define App_h_\n\n#include <Vorb/ui/MainGame.h>\n#include \"SoaOptions.h\"\n#include \"CommonState"
  },
  {
    "path": "SoA/AtmosphereComponentRenderer.cpp",
    "chars": 4753,
    "preview": "#include \"stdafx.h\"\n#include \"AtmosphereComponentRenderer.h\"\n\n#include \"SpaceSystem.h\"\n#include \"RenderUtils.h\"\n#include"
  },
  {
    "path": "SoA/AtmosphereComponentRenderer.h",
    "chars": 1119,
    "preview": "///\n/// AtmosphereComponentRenderer.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 8 Mar 2015\n/// Copyrig"
  },
  {
    "path": "SoA/AxisRotationComponentUpdater.cpp",
    "chars": 744,
    "preview": "#include \"stdafx.h\"\n#include \"AxisRotationComponentUpdater.h\"\n\n#include \"SpaceSystem.h\"\n#include \"Constants.h\"\n\nvoid Axi"
  },
  {
    "path": "SoA/AxisRotationComponentUpdater.h",
    "chars": 622,
    "preview": "///\n/// AxisRotationComponentUpdater.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 8 Jan 2015\n/// Copyri"
  },
  {
    "path": "SoA/Biome.cpp",
    "chars": 552,
    "preview": "#include \"stdafx.h\"\n#include \"Biome.h\"\n\nKEG_TYPE_DEF_SAME_NAME(BiomeFloraKegProperties, kt) {\n    using namespace keg;\n "
  },
  {
    "path": "SoA/Biome.h",
    "chars": 2230,
    "preview": "///\n/// Biome.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 30 Nov 2014\n/// Copyright 2014 Regrowth Stud"
  },
  {
    "path": "SoA/BlendState.h",
    "chars": 3107,
    "preview": "#pragma once\n\nenum BlendEquationMode {\n    BLEND_EQUATION_MODE_FUNC_ADD = GL_FUNC_ADD,\n    BLEND_EQUATION_MODE_FUNC_REVE"
  },
  {
    "path": "SoA/BlockData.cpp",
    "chars": 4181,
    "preview": "#include \"stdafx.h\"\n#include \"BlockData.h\"\n\n#include \"BlockPack.h\"\n#include \"Errors.h\"\n#include \"GameManager.h\"\n#include"
  },
  {
    "path": "SoA/BlockData.h",
    "chars": 3037,
    "preview": "#pragma once\n#include \"stdafx.h\"\n\n#include <SDL2/SDL.h>\n#include <Vorb/io/Keg.h>\n#include <Vorb/graphics/ImageIO.h>\n#inc"
  },
  {
    "path": "SoA/BlockLoader.cpp",
    "chars": 11867,
    "preview": "#include \"stdafx.h\"\n#include \"BlockLoader.h\"\n\n#include <Vorb/io/IOManager.h>\n#include <Vorb/io/Keg.h>\n\n#include \"BlockPa"
  },
  {
    "path": "SoA/BlockLoader.h",
    "chars": 1986,
    "preview": "#pragma once\n\n#include <Vorb/Event.hpp>\n#include <Vorb/VorbPreDecl.inl>\n\n#include \"BlockData.h\"\n#include \"CAEngine.h\"\n\nD"
  },
  {
    "path": "SoA/BlockPack.cpp",
    "chars": 1312,
    "preview": "#include \"stdafx.h\"\n#include \"BlockPack.h\"\n\nBlockPack::BlockPack() :\n    onBlockAddition(this) {\n    \n    { // Create \"N"
  },
  {
    "path": "SoA/BlockPack.h",
    "chars": 2601,
    "preview": "///\n/// BlockPack.h\n/// Seed of Andromeda\n///\n/// Created by Cristian Zaloj on 23 Dec 2014\n/// Copyright 2014 Regrowth S"
  },
  {
    "path": "SoA/BlockTexture.cpp",
    "chars": 3085,
    "preview": "#include \"stdafx.h\"\n#include \"BlockTexture.h\"\n\n#include \"BlockTexturePack.h\"\n\nKEG_ENUM_DEF(ConnectedTextureReducedMethod"
  },
  {
    "path": "SoA/BlockTexture.h",
    "chars": 5781,
    "preview": "///\n/// BlockTexture.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 16 Jun 2015\n/// Copyright 2014 Regrow"
  },
  {
    "path": "SoA/BlockTextureAtlas.h",
    "chars": 1123,
    "preview": "#pragma once\n\n// Number Of Tiles Per Side Of The Block Texture Atlas\nconst i32 BLOCK_TEXTURE_ATLAS_TILES_PER_SIDE = 16;\n"
  },
  {
    "path": "SoA/BlockTextureLoader.cpp",
    "chars": 19769,
    "preview": "#include \"stdafx.h\"\n#include \"BlockTextureLoader.h\"\n#include \"ModPathResolver.h\"\n#include \"BlockTexturePack.h\"\n#include "
  },
  {
    "path": "SoA/BlockTextureLoader.h",
    "chars": 1412,
    "preview": "///\n/// BlockTextureLoader.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 16 Jun 2015\n/// Copyright 2014 "
  },
  {
    "path": "SoA/BlockTextureMethods.cpp",
    "chars": 12725,
    "preview": "#include \"stdafx.h\"\n#include \"BlockTextureMethods.h\"\n\n#include <Vorb/graphics/ConnectedTextures.h>\n#include <Vorb/utils."
  },
  {
    "path": "SoA/BlockTextureMethods.h",
    "chars": 2239,
    "preview": "///\n/// BlockTextureMethods.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 7 Nov 2014\n/// Copyright 2014 "
  },
  {
    "path": "SoA/BlockTexturePack.cpp",
    "chars": 14936,
    "preview": "#include \"stdafx.h\"\n#include \"BlockTexturePack.h\"\n\n#include \"BlockPack.h\" // TEMPORARY\n#include \"BlockTexture.h\"\n#includ"
  },
  {
    "path": "SoA/BlockTexturePack.h",
    "chars": 3994,
    "preview": "///\n/// BlockTexturePack.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 16 Jun 2015\n/// Copyright 2014 Re"
  },
  {
    "path": "SoA/BloomRenderStage.cpp",
    "chars": 7446,
    "preview": "#include \"stdafx.h\"\n\n#include \"BloomRenderStage.h\"\n\n#include <sstream>\n#include <Vorb/graphics/GLRenderTarget.h>\n#includ"
  },
  {
    "path": "SoA/BloomRenderStage.h",
    "chars": 1701,
    "preview": "/// \n///  BloomRenderStage.h\n///  Seed of Andromeda\n///\n///  Created by Isaque Dutra on 2 June 2015\n///  Copyright 2015 "
  },
  {
    "path": "SoA/CAEngine.cpp",
    "chars": 27019,
    "preview": "#include \"stdafx.h\"\n#include \"CAEngine.h\"\n\n#include <Vorb/io/IOManager.h>\n\n#include \"BlockPack.h\"\n#include \"Chunk.h\"\n#in"
  },
  {
    "path": "SoA/CAEngine.h",
    "chars": 2633,
    "preview": "#pragma once\n#include <Vorb/io/Keg.h>\n#include <Vorb/VorbPreDecl.inl>\n\n#include \"CellularAutomataTask.h\"\n#include \"Const"
  },
  {
    "path": "SoA/CMakeLists.txt",
    "chars": 15400,
    "preview": "cmake_minimum_required(VERSION 3.1 FATAL_ERROR)\n\ncmake_policy(SET CMP0054 NEW)\n\nif (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINA"
  },
  {
    "path": "SoA/Camera.cpp",
    "chars": 6910,
    "preview": "#include \"stdafx.h\"\n#include \"Camera.h\"\n\n#include <SDL2/SDL.h>\n#include <Vorb/utils.h>\n\n#include \"SoaOptions.h\"\n\n#includ"
  },
  {
    "path": "SoA/Camera.h",
    "chars": 5147,
    "preview": "#pragma once\n#include \"Frustum.h\"\n\nclass Camera\n{\npublic:\n    Camera();\n    void init(float aspectRatio);\n    void offse"
  },
  {
    "path": "SoA/CellularAutomataTask.cpp",
    "chars": 1780,
    "preview": "#include \"stdafx.h\"\n#include \"CellularAutomataTask.h\"\n\n#include \"CAEngine.h\"\n#include \"Chunk.h\"\n#include \"ChunkMeshManag"
  },
  {
    "path": "SoA/CellularAutomataTask.h",
    "chars": 1634,
    "preview": "///\n/// CellularAutomataTask.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 24 Nov 2014\n/// Copyright 201"
  },
  {
    "path": "SoA/Chunk.cpp",
    "chars": 1113,
    "preview": "#include \"stdafx.h\"\n#include \"Chunk.h\"\n\n#include \"VoxelSpaceConversions.h\"\n\nEvent<ChunkHandle&> Chunk::DataChange;\n\nvoid"
  },
  {
    "path": "SoA/Chunk.h",
    "chars": 4892,
    "preview": "//\n// NChunk.h\n// Seed of Andromeda\n//\n// Created by Cristian Zaloj on 25 May 2015\n// Copyright 2014 Regrowth Studios\n//"
  },
  {
    "path": "SoA/ChunkAccessor.cpp",
    "chars": 6100,
    "preview": "#include \"stdafx.h\"\n#include \"ChunkAccessor.h\"\n\n#include \"ChunkAllocator.h\"\n\nconst ui32 HANDLE_STATE_ALIVE = 2;\n#ifdef F"
  },
  {
    "path": "SoA/ChunkAccessor.h",
    "chars": 1068,
    "preview": "//\n// ChunkAccessor.h\n// Seed of Andromeda\n//\n// Created by Benjamin Arnold on 30 Jul 2015\n// Copyright 2014 Regrowth St"
  },
  {
    "path": "SoA/ChunkAllocator.cpp",
    "chars": 1880,
    "preview": "#include \"stdafx.h\"\n#include \"ChunkAllocator.h\"\n#include \"Chunk.h\"\n\n#define MAX_VOXEL_ARRAYS_TO_CACHE 200\n#define NUM_SH"
  },
  {
    "path": "SoA/ChunkAllocator.h",
    "chars": 1244,
    "preview": "//\n// ChunkAllocator.h\n// Seed of Andromeda\n//\n// Created by Benjamin Arnold on 9 Jun 2015\n// Copyright 2014 Regrowth St"
  },
  {
    "path": "SoA/ChunkGenerator.cpp",
    "chars": 4711,
    "preview": "#include \"stdafx.h\"\n#include \"ChunkGenerator.h\"\n\n#include \"ChunkAllocator.h\"\n#include \"Chunk.h\"\n#include \"ChunkHandle.h\""
  },
  {
    "path": "SoA/ChunkGenerator.h",
    "chars": 1591,
    "preview": "///\n/// ChunkGenerator.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 10 Jun 2015\n/// Copyright 2014 Regr"
  },
  {
    "path": "SoA/ChunkGrid.cpp",
    "chars": 4755,
    "preview": "#include \"stdafx.h\"\n#include \"ChunkGrid.h\"\n#include \"Chunk.h\"\n#include \"ChunkAllocator.h\"\n#include \"soaUtils.h\"\n\n#includ"
  },
  {
    "path": "SoA/ChunkGrid.h",
    "chars": 2979,
    "preview": "///\n/// ChunkGrid.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 26 Feb 2015\n/// Copyright 2014 Regrowth "
  },
  {
    "path": "SoA/ChunkGridRenderStage.cpp",
    "chars": 6274,
    "preview": "#include \"stdafx.h\"\n#include \"ChunkGridRenderStage.h\"\n\n#include <Vorb/graphics/GLProgram.h>\n\n#include \"Camera.h\"\n#includ"
  },
  {
    "path": "SoA/ChunkGridRenderStage.h",
    "chars": 1389,
    "preview": "///\n/// ChunkGridRenderStage.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 14 Nov 2014\n/// Copyright 201"
  },
  {
    "path": "SoA/ChunkHandle.h",
    "chars": 1769,
    "preview": "//\n// ChunkHandle.h\n// Seed of Andromeda\n//\n// Created by Benjamin Arnold on 30 Jul 2015\n// Copyright 2014 Regrowth Stud"
  },
  {
    "path": "SoA/ChunkID.h",
    "chars": 921,
    "preview": "//\n// ChunkID.h\n// Seed of Andromeda\n//\n// Created by Benjamin Arnold on 3 Aug 2015\n// Copyright 2014 Regrowth Studios\n/"
  },
  {
    "path": "SoA/ChunkIOManager.cpp",
    "chars": 4475,
    "preview": "#include \"stdafx.h\"\n\n#include \"ChunkIOManager.h\"\n\n#ifdef VORB_OS_WINDOWS\n#include <direct.h> //for mkdir windows\n#includ"
  },
  {
    "path": "SoA/ChunkIOManager.h",
    "chars": 1118,
    "preview": "#pragma once\n#include <condition_variable>\n#include <mutex>\n#include <queue>\n#include <thread>\n\n#include \"RegionFileMana"
  },
  {
    "path": "SoA/ChunkMesh.cpp",
    "chars": 1112,
    "preview": "#include \"stdafx.h\"\n#include \"ChunkMesh.h\"\n\n#include \"BlockData.h\"\n#include \"Chunk.h\"\n#include \"ChunkMeshTask.h\"\n\nKEG_EN"
  },
  {
    "path": "SoA/ChunkMesh.h",
    "chars": 3380,
    "preview": "#pragma once\n#include \"Vertex.h\"\n#include \"BlockTextureMethods.h\"\n#include \"ChunkHandle.h\"\n#include <Vorb/io/Keg.h>\n#inc"
  },
  {
    "path": "SoA/ChunkMeshManager.cpp",
    "chars": 10128,
    "preview": "#include \"stdafx.h\"\n#include \"ChunkMeshManager.h\"\n\n#include \"ChunkMesh.h\"\n#include \"ChunkMeshTask.h\"\n#include \"ChunkMesh"
  },
  {
    "path": "SoA/ChunkMeshManager.h",
    "chars": 3004,
    "preview": "///\n/// ChunkMeshManager.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 26 Feb 2015\n/// Copyright 2014 Re"
  },
  {
    "path": "SoA/ChunkMeshTask.cpp",
    "chars": 1811,
    "preview": "#include \"stdafx.h\"\n#include \"ChunkMeshTask.h\"\n\n#include <Vorb/ThreadPool.h>\n\n#include \"BlockData.h\"\n#include \"BlockPack"
  },
  {
    "path": "SoA/ChunkMeshTask.h",
    "chars": 1537,
    "preview": "///\n/// RenderTask.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 11 Nov 2014\n/// Copyright 2014 Regrowth"
  },
  {
    "path": "SoA/ChunkMesher.cpp",
    "chars": 69876,
    "preview": "#include \"stdafx.h\"\n#include \"ChunkMesher.h\"\n\n#include <random>\n\n\n#include \"Biome.h\"\n#include \"BlockData.h\"\n\n#include <V"
  },
  {
    "path": "SoA/ChunkMesher.h",
    "chars": 4429,
    "preview": "#pragma once\n#include \"Vertex.h\"\n#include \"BlockData.h\"\n#include \"Chunk.h\"\n#include \"ChunkMesh.h\"\n#include \"ChunkMeshTas"
  },
  {
    "path": "SoA/ChunkQuery.cpp",
    "chars": 129,
    "preview": "#include \"stdafx.h\"\n#include \"ChunkQuery.h\"\n\n#include \"ChunkGrid.h\"\n\nvoid ChunkQuery::release() {\n    grid->releaseQuery"
  },
  {
    "path": "SoA/ChunkQuery.h",
    "chars": 1200,
    "preview": "//\n// ChunkQuery.h\n// Seed of Andromeda\n//\n// Created by Benjamin Arnold on 1 Aug 2015\n// Copyright 2014 Regrowth Studio"
  },
  {
    "path": "SoA/ChunkRenderer.cpp",
    "chars": 13153,
    "preview": "#include \"stdafx.h\"\n#include \"ChunkRenderer.h\"\n\n#include \"Camera.h\"\n#include \"Chunk.h\"\n#include \"ChunkMeshManager.h\"\n#in"
  },
  {
    "path": "SoA/ChunkRenderer.h",
    "chars": 1769,
    "preview": "#pragma once\n\n#ifndef ChunkRenderer_h__\n#define ChunkRenderer_h__\n\n#include <Vorb/graphics/GLProgram.h>\n\n#include \"Chunk"
  },
  {
    "path": "SoA/ChunkSphereComponentUpdater.cpp",
    "chars": 11276,
    "preview": "#include \"stdafx.h\"\n#include \"ChunkSphereComponentUpdater.h\"\n\n#include \"ChunkAccessor.h\"\n#include \"ChunkID.h\"\n#include \""
  },
  {
    "path": "SoA/ChunkSphereComponentUpdater.h",
    "chars": 1039,
    "preview": "//\n// ChunkSphereAcquirer.h\n// Seed of Andromeda\n//\n// Created by Benjamin Arnold on 8 Aug 2015\n// Copyright 2014 Regrow"
  },
  {
    "path": "SoA/ChunkUpdater.cpp",
    "chars": 43793,
    "preview": "#include \"stdafx.h\"\n#include \"ChunkUpdater.h\"\n\n#include \"BlockPack.h\"\n#include \"CAEngine.h\"\n#include \"Errors.h\"\n#include"
  },
  {
    "path": "SoA/ChunkUpdater.h",
    "chars": 3178,
    "preview": "#pragma once\n#include \"Constants.h\"\n\n// TODO(Ben): Temporary\n#include \"BlockData.h\"\n#include \"Chunk.h\"\n\n#include \"VoxelU"
  },
  {
    "path": "SoA/ClientState.h",
    "chars": 1205,
    "preview": "//\n// ClientState.h\n// Seed of Andromeda\n//\n// Created by Benjamin Arnold on 11 Aug 2015\n// Copyright 2014 Regrowth Stud"
  },
  {
    "path": "SoA/CloseTerrainPatch.cpp",
    "chars": 14379,
    "preview": "#include \"stdafx.h\"\n#include \"TerrainPatch.h\"\n\n#include <Vorb/utils.h>\n\n#include \"BlockData.h\"\n#include \"Chunk.h\"\n#inclu"
  },
  {
    "path": "SoA/CloudsComponentRenderer.cpp",
    "chars": 5865,
    "preview": "#include \"stdafx.h\"\n#include \"CloudsComponentRenderer.h\"\n\n#include \"SpaceSystem.h\"\n#include \"RenderUtils.h\"\n#include \"so"
  },
  {
    "path": "SoA/CloudsComponentRenderer.h",
    "chars": 923,
    "preview": "#pragma once\n\n#include <Vorb/ecs/ECS.h>\n#include <Vorb/ecs/ComponentTable.hpp>\n#include <Vorb/VorbPreDecl.inl>\n#include "
  },
  {
    "path": "SoA/Collision.cpp",
    "chars": 18995,
    "preview": "#include \"stdafx.h\"\n#include \"Collision.h\"\n\n#include <Vorb/utils.h>\n\n#include \"Chunk.h\"\n#include \"BlockPack.h\"\n\nvoid blo"
  },
  {
    "path": "SoA/Collision.h",
    "chars": 1008,
    "preview": "#pragma once\n#include \"Vorb/types.h\"\n\nclass Player;\nclass Chunk;\n\nconst i32 PLAYER_COLLISION_STEPS = 20;\n\n//bool RaySphe"
  },
  {
    "path": "SoA/CollisionComponentUpdater.cpp",
    "chars": 252,
    "preview": "#include \"stdafx.h\"\n#include \"CollisionComponentUpdater.h\"\n\n#include \"GameSystem.h\"\n\nvoid CollisionComponentUpdater::upd"
  },
  {
    "path": "SoA/CollisionComponentUpdater.h",
    "chars": 525,
    "preview": "///\n/// CollisionComponentUpdater.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 11 Jan 2015\n/// Copyrigh"
  },
  {
    "path": "SoA/ColorFilterRenderStage.cpp",
    "chars": 811,
    "preview": "#include \"stdafx.h\"\n#include \"ColorFilterRenderStage.h\"\n\n#include \"ShaderLoader.h\"\n\nnamespace {\n    const cString VERT_S"
  },
  {
    "path": "SoA/ColorFilterRenderStage.h",
    "chars": 800,
    "preview": "///\n/// ColorFilterRenderStage.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 25 Apr 2015\n/// Copyright 2"
  },
  {
    "path": "SoA/ColoredFullQuadRenderer.cpp",
    "chars": 1122,
    "preview": "#include \"stdafx.h\"\n#include \"ColoredFullQuadRenderer.h\"\n\n#include <Vorb/graphics/GLProgram.h>\n\nconst cString COL_VERT_S"
  },
  {
    "path": "SoA/ColoredFullQuadRenderer.h",
    "chars": 624,
    "preview": "///\n/// ColoredFullQuadRenderer.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 22 Mar 2015\n/// Copyright "
  },
  {
    "path": "SoA/CommonState.h",
    "chars": 985,
    "preview": "///\n/// CommonState.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 4 Jun 2015\n/// Copyright 2014 Regrowth"
  },
  {
    "path": "SoA/Computer.cpp",
    "chars": 119,
    "preview": "#include \"stdafx.h\"\n#include \"Computer.h\"\n\nComputer::Computer() {\n    // Empty\n}\nComputer::~Computer() {\n    // Empty\n}"
  },
  {
    "path": "SoA/Computer.h",
    "chars": 371,
    "preview": "// \n//  Computer.h\n//  Seed Of Andromeda\n//\n//  Created by Ben Arnold on 26 Oct 2014\n//  Copyright 2014 Regrowth Studios"
  },
  {
    "path": "SoA/ConsoleFuncs.h",
    "chars": 3980,
    "preview": "//\n// ConsoleFuncs.h\n// Seed of Andromeda\n//\n// Created by Cristian Zaloj on 30 Jun 2015\n// Copyright 2014 Regrowth Stud"
  },
  {
    "path": "SoA/ConsoleMain.h",
    "chars": 2969,
    "preview": "//\n// ConsoleMain.h\n// Seed of Andromeda\n//\n// Created by Cristian Zaloj on 29 Jun 2015\n// Copyright 2014 Regrowth Studi"
  },
  {
    "path": "SoA/ConsoleTests.cpp",
    "chars": 3113,
    "preview": "#include \"stdafx.h\"\n#include \"ConsoleTests.h\"\n\n#include \"ChunkAllocator.h\"\n#include \"ChunkAccessor.h\"\n\n#include <random>"
  },
  {
    "path": "SoA/ConsoleTests.h",
    "chars": 717,
    "preview": "//\n// ConsoleTests.h\n// Seed of Andromeda\n//\n// Created by Cristian Zaloj on 1 Aug 2015\n// Copyright 2014 Regrowth Studi"
  },
  {
    "path": "SoA/Constants.h",
    "chars": 1444,
    "preview": "///\n/// Constants.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 17 Feb 2015\n/// Copyright 2014 Regrowth "
  },
  {
    "path": "SoA/CutoutVoxelRenderStage.cpp",
    "chars": 1839,
    "preview": "#include \"stdafx.h\"\n#include \"CutoutVoxelRenderStage.h\"\n\n#include <Vorb/graphics/GLProgram.h>\n#include \"Camera.h\"\n#inclu"
  },
  {
    "path": "SoA/CutoutVoxelRenderStage.h",
    "chars": 1019,
    "preview": "/// \n///  CutoutVoxelRenderStage.h\n///  Seed of Andromeda\n///\n///  Created by Benjamin Arnold on 1 Nov 2014\n///  Copyrig"
  },
  {
    "path": "SoA/DLLAPI.h",
    "chars": 619,
    "preview": "//\n// DLLAPI.h\n//\n\n#pragma once\n\n#ifndef DLLAPI_h__\n\nnamespace DLLAPI {\n    struct Information {\n        const cString n"
  },
  {
    "path": "SoA/DLLLoader.h",
    "chars": 243,
    "preview": "//\n// DLLLoader.h\n// Seed of Andromeda\n//\n// Created by Cristian Zaloj on 4 Jul 2015\n// Copyright 2014 Regrowth Studios\n"
  },
  {
    "path": "SoA/DebugRenderer.cpp",
    "chars": 7777,
    "preview": "#include \"stdafx.h\"\n#include \"DebugRenderer.h\"\n\n#include <algorithm>\n#include <functional>\n\n#include <Vorb/MeshGenerator"
  },
  {
    "path": "SoA/DebugRenderer.h",
    "chars": 2894,
    "preview": "#pragma once\n#include <chrono>\n\n#include <Vorb/VorbPreDecl.inl>\n#include <Vorb/graphics/GLProgram.h>\n\nconst static float"
  },
  {
    "path": "SoA/Density.cpp",
    "chars": 2155,
    "preview": "#include \"stdafx.h\"\n#include \"Density.h\"\n#include \"VoxelMatrix.h\"\n\nconst VoxelMatrix* gMatrix;\n\n// ---------------------"
  },
  {
    "path": "SoA/Density.h",
    "chars": 242,
    "preview": "#ifndef\t\tHAS_DENSITY_H_BEEN_INCLUDED\n#define\t\tHAS_DENSITY_H_BEEN_INCLUDED\n\n#include \"Vorb/types.h\"\n\nclass VoxelMatrix;\n\n"
  },
  {
    "path": "SoA/DevConsole.cpp",
    "chars": 4215,
    "preview": "#include \"stdafx.h\"\n#include \"DevConsole.h\"\n\nDevConsole DevConsole::m_instance;\n\nvoid DevConsole::init(int maxHistory) {"
  },
  {
    "path": "SoA/DevConsole.h",
    "chars": 1844,
    "preview": "#pragma once\n#include <Vorb/RingBuffer.hpp>\n#include <Vorb/ui/InputDispatcher.h>\n\ntypedef vorb::ring_buffer<nString> Com"
  },
  {
    "path": "SoA/DevConsoleView.cpp",
    "chars": 4261,
    "preview": "#include \"stdafx.h\"\n#include \"DevConsoleView.h\"\n#include \"textureUtils.h\"\n\n#include <algorithm>\n#include <iterator>\n\n#in"
  },
  {
    "path": "SoA/DevConsoleView.h",
    "chars": 2219,
    "preview": "#pragma once\n\n#include <SDL2/SDL.h>\n#include <Vorb/RingBuffer.hpp>\n#include <Vorb/VorbPreDecl.inl>\n#include <Vorb/colors"
  },
  {
    "path": "SoA/DevHudRenderStage.cpp",
    "chars": 6498,
    "preview": "#include \"stdafx.h\"\n#include \"DevHudRenderStage.h\"\n\n#include <Vorb/colors.h>\n#include <Vorb/graphics/SpriteBatch.h>\n#inc"
  },
  {
    "path": "SoA/DevHudRenderStage.h",
    "chars": 1667,
    "preview": "/// \n///  DevHudRenderStage.h\n///  Seed of Andromeda\n///\n///  Created by Benjamin Arnold on 2 Nov 2014\n///  Copyright 20"
  },
  {
    "path": "SoA/DevScreen.cpp",
    "chars": 2977,
    "preview": "#include \"stdafx.h\"\n#include \"DevScreen.h\"\n\n#include <Vorb/ui/InputDispatcher.h>\n#include <Vorb/graphics/SpriteBatch.h>\n"
  },
  {
    "path": "SoA/DevScreen.h",
    "chars": 1961,
    "preview": "///\n/// DevScreen.h\n/// Seed of Andromeda\n///\n/// Created by Cristian Zaloj on 14 Dec 2014\n/// Copyright 2014 Regrowth S"
  },
  {
    "path": "SoA/Doxyfile.in",
    "chars": 484,
    "preview": "PROJECT_NAME           = \"@CMAKE_PROJECT_NAME@\"\nPROJECT_NUMBER         = @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@"
  },
  {
    "path": "SoA/DualContouringMesher.cpp",
    "chars": 886,
    "preview": "#include \"stdafx.h\"\n#include \"DualContouringMesher.h\"\n#include \"VoxelMatrix.h\"\n#include \"Density.h\"\n\n#include <Vorb/Timi"
  },
  {
    "path": "SoA/DualContouringMesher.h",
    "chars": 663,
    "preview": "///\n/// DualContouringMesher.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 15 Jun 2015\n/// Copyright 201"
  },
  {
    "path": "SoA/ECS Specs.txt",
    "chars": 996,
    "preview": "Usage:\n - Systems Are All Loaded Into Main Table\n - Systems Are Initialized In Three Passes\n    * Calls init(i32 pass)\n "
  },
  {
    "path": "SoA/ECSTemplates.cpp",
    "chars": 1952,
    "preview": "#include \"stdafx.h\"\n#include \"ECSTemplates.h\"\n\n#include <Vorb/io/IOManager.h>\n#include <Vorb/io/Keg.h>\n\nvecs::EntityID E"
  },
  {
    "path": "SoA/ECSTemplates.h",
    "chars": 1777,
    "preview": "//\n// ECSTemplates.h\n//\n// Created by Cristian Zaloj on 16 Mar 2015\n//\n\n#pragma once\n\n#ifndef ECSTemplates_h__\n#define E"
  },
  {
    "path": "SoA/Errors.cpp",
    "chars": 3926,
    "preview": "#include \"stdafx.h\"\n#include \"Errors.h\"\n\n#include <SDL2/SDL.h>\n\n#ifndef VORB_OS_WINDOWS\n#include <limits.h>\n#include <st"
  },
  {
    "path": "SoA/Errors.h",
    "chars": 404,
    "preview": "#pragma once\n\n#include \"Vorb/types.h\"\n\n//yes 1, no 0\nextern i32 showYesNoBox(const nString& message);\nextern i32 showYes"
  },
  {
    "path": "SoA/ExposureCalcRenderStage.cpp",
    "chars": 4271,
    "preview": "#include \"stdafx.h\"\n#include \"ExposureCalcRenderStage.h\"\n\n#include \"ShaderLoader.h\"\n\n#include <Vorb/graphics/GLProgram.h"
  },
  {
    "path": "SoA/ExposureCalcRenderStage.h",
    "chars": 2264,
    "preview": "///\n/// ExposureCalcRenderStage.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 30 Apr 2015\n/// Copyright "
  },
  {
    "path": "SoA/FarTerrainComponentRenderer.cpp",
    "chars": 3378,
    "preview": "#include \"stdafx.h\"\n#include \"FarTerrainComponentRenderer.h\"\n\n#include \"Camera.h\"\n#include \"PlanetGenData.h\"\n#include \"S"
  },
  {
    "path": "SoA/FarTerrainComponentRenderer.h",
    "chars": 1169,
    "preview": "///\n/// FarTerrainComponentRenderer.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 22 Feb 2015\n/// Copyri"
  },
  {
    "path": "SoA/FarTerrainComponentUpdater.cpp",
    "chars": 6829,
    "preview": "#include \"stdafx.h\"\n#include \"FarTerrainComponentUpdater.h\"\n\n#include \"FarTerrainPatch.h\"\n#include \"SpaceSystem.h\"\n#incl"
  },
  {
    "path": "SoA/FarTerrainComponentUpdater.h",
    "chars": 1105,
    "preview": "///\n/// FarTerrainComponentUpdater.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 12 Feb 2015\n/// Copyrig"
  },
  {
    "path": "SoA/FarTerrainPatch.cpp",
    "chars": 3483,
    "preview": "#include \"stdafx.h\"\n#include \"FarTerrainPatch.h\"\n\n#include <Vorb/graphics/GpuMemory.h>\n#include <Vorb/TextureRecycler.hp"
  },
  {
    "path": "SoA/FarTerrainPatch.h",
    "chars": 1298,
    "preview": "///\n/// FarTerrainPatch.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 11 Feb 2015\n/// Copyright 2014 Reg"
  },
  {
    "path": "SoA/Flora.cpp",
    "chars": 880,
    "preview": "#include \"stdafx.h\"\n#include \"Flora.h\"\n\nKEG_ENUM_DEF(FloraInterpType, FloraInterpType, e) {\n    e.addValue(\"linear\", Flo"
  },
  {
    "path": "SoA/Flora.h",
    "chars": 5326,
    "preview": "///\n/// Flora.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 15 Jul 2015\n/// Copyright 2014 Regrowth Stud"
  },
  {
    "path": "SoA/FloraGenerator.cpp",
    "chars": 56940,
    "preview": "#include \"stdafx.h\"\n#include \"FloraGenerator.h\"\n\n#define X_1 0x100000\n#define Y_1 0x400\n#define Z_1 0x1\n\n#define OUTER_S"
  },
  {
    "path": "SoA/FloraGenerator.h",
    "chars": 5612,
    "preview": "///\n/// NFloraGenerator.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 15 Jul 2015\n/// Copyright 2014 Reg"
  },
  {
    "path": "SoA/FragFile.cpp",
    "chars": 5585,
    "preview": "#include \"stdafx.h\"\n#include \"FragFile.h\"\n\n// Fragmentation Seeking Information\nclass FragBlockHeader {\npublic:\n    // P"
  },
  {
    "path": "SoA/FragFile.h",
    "chars": 1393,
    "preview": "#pragma once\n\n#include \"Vorb/types.h\"\n\n// Header For Each Data Path That Allows Fragmented Functionality\nclass FragHeade"
  },
  {
    "path": "SoA/FreeMoveComponentUpdater.cpp",
    "chars": 3889,
    "preview": "#include \"stdafx.h\"\n#include \"FreeMoveComponentUpdater.h\"\n\n#include \"SpaceSystem.h\"\n#include \"GameSystem.h\"\n#include \"Co"
  },
  {
    "path": "SoA/FreeMoveComponentUpdater.h",
    "chars": 639,
    "preview": "///\n/// FreeMoveComponentUpdater.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 11 Jan 2015\n/// Copyright"
  },
  {
    "path": "SoA/Frustum.cpp",
    "chars": 3987,
    "preview": "#include \"stdafx.h\"\n#include \"Frustum.h\"\n\n#include \"Constants.h\"\n\nvoid Frustum::Plane::setNormalAndPoint(const f32v3 &no"
  },
  {
    "path": "SoA/Frustum.h",
    "chars": 2037,
    "preview": "///\n/// Frustum.h\n/// Vorb Engine\n///\n/// Created by Benjamin Arnold on 24 Nov 2014\n/// Copyright 2014 Regrowth Studios\n"
  },
  {
    "path": "SoA/FrustumComponentUpdater.cpp",
    "chars": 1022,
    "preview": "#include \"stdafx.h\"\n#include \"FrustumComponentUpdater.h\"\n\n#include \"GameSystem.h\"\n\nvoid FrustumComponentUpdater::update("
  },
  {
    "path": "SoA/FrustumComponentUpdater.h",
    "chars": 545,
    "preview": "///\n/// FrustumComponentUpdater.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 25 Jan 2015\n/// Copyright "
  },
  {
    "path": "SoA/GameManager.cpp",
    "chars": 5175,
    "preview": "#include \"stdafx.h\"\n#include \"GameManager.h\"\n\n#ifdef VORB_OS_WINDOWS\n#include <direct.h> //for mkdir windows\n#endif//VOR"
  },
  {
    "path": "SoA/GameManager.h",
    "chars": 1017,
    "preview": "#pragma once\n#include <deque>\n\n#include <Vorb/graphics/TextureCache.h>\n#include <Vorb/Vorb.h>\n\n#include \"WorldStructs.h\""
  },
  {
    "path": "SoA/GamePlayScreen.cpp",
    "chars": 31365,
    "preview": "#include \"stdafx.h\"\n#include \"GamePlayScreen.h\"\n\n#include <Vorb/colors.h>\n#include <Vorb/Event.hpp>\n#include <Vorb/graph"
  },
  {
    "path": "SoA/GamePlayScreen.h",
    "chars": 3965,
    "preview": "// \n//  GamePlayScreen.h\n//  Seed Of Andromeda\n//\n//  Created by Ben Arnold on 17 Oct 2014\n//  Copyright 2014 Regrowth S"
  },
  {
    "path": "SoA/GameRenderParams.cpp",
    "chars": 3028,
    "preview": "#include \"stdafx.h\"\n#include \"GameRenderParams.h\"\n\n#include <Vorb/utils.h>\n\n#include \"Camera.h\"\n#include \"GameManager.h\""
  },
  {
    "path": "SoA/GameRenderParams.h",
    "chars": 1159,
    "preview": "#pragma once\n\n#ifndef GameRenderParams_h__\n#define GameRenderParams_h__\n\n#include <Vorb/VorbPreDecl.inl>\n#include \"Voxel"
  },
  {
    "path": "SoA/GameSystem.cpp",
    "chars": 1043,
    "preview": "#include \"stdafx.h\"\n#include \"GameSystem.h\"\n\nGameSystem::GameSystem() : vecs::ECS() {\n    //Add all component tables\n   "
  },
  {
    "path": "SoA/GameSystem.h",
    "chars": 1632,
    "preview": "///\n/// GameSystem.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 10 Jan 2015\n/// Copyright 2014 Regrowth"
  },
  {
    "path": "SoA/GameSystemAssemblages.cpp",
    "chars": 6506,
    "preview": "#include \"stdafx.h\"\n#include \"GameSystemAssemblages.h\"\n\n#include <Vorb/ecs/ECS.h>\n\n#include \"ChunkHandle.h\"\n#include \"Ch"
  },
  {
    "path": "SoA/GameSystemAssemblages.h",
    "chars": 3894,
    "preview": "///\n/// GameSystemAssemblages.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 11 Jan 2015\n/// Copyright 20"
  },
  {
    "path": "SoA/GameSystemComponentBuilders.cpp",
    "chars": 5461,
    "preview": "#include \"stdafx.h\"\n#include \"GameSystemComponentBuilders.h\"\n\n#include <Vorb/io/Keg.h>\n#include \"GameSystemComponents.h\""
  },
  {
    "path": "SoA/GameSystemComponentBuilders.h",
    "chars": 3134,
    "preview": "#pragma once\n\n#ifndef GameSystemComponentBuilders_h__\n#define GameSystemComponentBuilders_h__\n\n#include <Vorb/ecs/ECS.h>"
  },
  {
    "path": "SoA/GameSystemComponents.cpp",
    "chars": 3276,
    "preview": "#include \"stdafx.h\"\n#include \"GameSystemComponents.h\"\n\nKEG_TYPE_DEF(AabbCollidableComponent, AabbCollidableComponent, kt"
  },
  {
    "path": "SoA/GameSystemComponents.h",
    "chars": 6399,
    "preview": "///\n/// GameSystemComponents.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 11 Jan 2015\n/// Copyright 201"
  },
  {
    "path": "SoA/GameSystemUpdater.cpp",
    "chars": 1151,
    "preview": "#include \"stdafx.h\"\n#include \"GameSystemUpdater.h\"\n\n#include \"FreeMoveComponentUpdater.h\"\n#include \"GameSystem.h\"\n#inclu"
  },
  {
    "path": "SoA/GameSystemUpdater.h",
    "chars": 1953,
    "preview": "///\n/// GameSystemUpdater.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 11 Jan 2015\n/// Copyright 2014 R"
  },
  {
    "path": "SoA/GameplayLoadScreen.cpp",
    "chars": 3290,
    "preview": "#include \"stdafx.h\"\n#include \"GameplayLoadScreen.h\"\n\n#include \"App.h\"\n#include \"CommonState.h\"\n#include \"GamePlayScreen."
  },
  {
    "path": "SoA/GameplayLoadScreen.h",
    "chars": 1694,
    "preview": "///\n/// GameplayLoadScreen.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 6 Jun 2015\n/// Copyright 2014 R"
  },
  {
    "path": "SoA/GameplayRenderer.cpp",
    "chars": 15582,
    "preview": "#include \"stdafx.h\"\n#include \"GameplayRenderer.h\"\n\n#include <Vorb/graphics/GLStates.h>\n#include <Vorb/ui/GameWindow.h>\n#"
  },
  {
    "path": "SoA/GameplayRenderer.h",
    "chars": 5019,
    "preview": "/// \n///  GameplayRenderer.h\n///  Seed of Andromeda\n///\n///  Created by Benjamin Arnold on 1 Nov 2014\n///  Copyright 201"
  },
  {
    "path": "SoA/GasGiantComponentRenderer.cpp",
    "chars": 7098,
    "preview": "#include \"stdafx.h\"\n#include \"GasGiantComponentRenderer.h\"\n\n#include \"ShaderLoader.h\"\n#include \"SpaceSystemComponents.h\""
  },
  {
    "path": "SoA/GasGiantComponentRenderer.h",
    "chars": 1517,
    "preview": "///\n/// GasGiantComponentRenderer.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 3 Apr 2015\n/// Copyright"
  },
  {
    "path": "SoA/GenerateTask.cpp",
    "chars": 3624,
    "preview": "#include \"stdafx.h\"\n#include \"GenerateTask.h\"\n\n#include \"Chunk.h\"\n#include \"ChunkGenerator.h\"\n#include \"ChunkGrid.h\"\n#in"
  },
  {
    "path": "SoA/GenerateTask.h",
    "chars": 1207,
    "preview": "///\n/// GenerateTask.h\n/// Seed of Andromeda\n///\n/// Created by Benjamin Arnold on 11 Nov 2014\n/// Copyright 2014 Regrow"
  },
  {
    "path": "SoA/GeometrySorter.cpp",
    "chars": 1549,
    "preview": "#include \"stdafx.h\"\n#include \"GeometrySorter.h\"\n\n#include \"soaUtils.h\"\n#include <Vorb/utils.h>\n\n#include \"ChunkRenderer."
  },
  {
    "path": "SoA/GeometrySorter.h",
    "chars": 321,
    "preview": "#pragma once\n\n#include <vector>\n#include \"Vorb/types.h\"\n\nclass ChunkMesh;\n\nclass Distanceclass {\npublic:\n    i32 quadInd"
  },
  {
    "path": "SoA/HdrRenderStage.cpp",
    "chars": 2879,
    "preview": "#include \"stdafx.h\"\n#include \"HdrRenderStage.h\"\n\n#include <Vorb/graphics/ShaderManager.h>\n#include \"Camera.h\"\n#include \""
  },
  {
    "path": "SoA/HdrRenderStage.h",
    "chars": 1255,
    "preview": "/// \n///  HdrRenderStage.h\n///  Seed of Andromeda\n///\n///  Created by Benjamin Arnold on 1 Nov 2014\n///  Copyright 2014 "
  },
  {
    "path": "SoA/HeadComponentUpdater.cpp",
    "chars": 1125,
    "preview": "#include \"stdafx.h\"\n#include \"HeadComponentUpdater.h\"\n#include \"Constants.h\"\n\n#include \"GameSystem.h\"\n#include \"soaUtils"
  },
  {
    "path": "SoA/HeadComponentUpdater.h",
    "chars": 560,
    "preview": "//\n// HeadComponentUpdater.h\n// Seed of Andromeda\n//\n// Created by Benjamin Arnold on 15 Aug 2015\n// Copyright 2014 Regr"
  },
  {
    "path": "SoA/IRenderStage.h",
    "chars": 2472,
    "preview": "/// \n///  IRenderStage.h\n///  Seed of Andromeda\n///\n///  Created by Ben Arnold on 28 Oct 2014\n///  Copyright 2014 Regrow"
  },
  {
    "path": "SoA/ImageAssetLoader.cpp",
    "chars": 1044,
    "preview": "#include \"stdafx.h\"\n#include \"ImageAssetLoader.h\"\n\n#include <Vorb/graphics/GLStates.h>\n\nvoid vcore::AssetBuilder<ImageAs"
  },
  {
    "path": "SoA/ImageAssetLoader.h",
    "chars": 682,
    "preview": "///\n/// ImageAssetLoader.h\n///\n/// Created by Cristian Zaloj on 13 Feb 2015\n///\n/// Summary:\n/// Loads image assets.\n///"
  },
  {
    "path": "SoA/IniParser.cpp",
    "chars": 9672,
    "preview": "#include <stdlib.h>\n#include <stdio.h>\n#include <sys/stat.h>\n#include <memory>\n\n//stupid Windows SDK mucking up the name"
  },
  {
    "path": "SoA/IniParser.h",
    "chars": 220,
    "preview": "#pragma once\n#include \"Vorb/types.h\"\n\n// Parses A File Into A Block Of Data\n/*\n * Format:\n * type MiscCharacters{data}\n "
  },
  {
    "path": "SoA/InitScreen.cpp",
    "chars": 3716,
    "preview": "#include \"stdafx.h\"\n#include \"InitScreen.h\"\n\n#include <Vorb/colors.h>\n#include <Vorb/graphics/GraphicsDevice.h>\n#include"
  },
  {
    "path": "SoA/InitScreen.h",
    "chars": 872,
    "preview": "#pragma once\n#include <Vorb/ui/IGameScreen.h>\n#include <Vorb/VorbPreDecl.inl>\n\nclass App;\nDECL_VG(class SpriteBatch;  cl"
  },
  {
    "path": "SoA/InputMapper.cpp",
    "chars": 7179,
    "preview": "#include \"stdafx.h\"\n#include \"InputMapper.h\"\n\n#include <Vorb/io/Keg.h>\n#include <Vorb/io/IOManager.h>\n\n#include \"GameMan"
  },
  {
    "path": "SoA/InputMapper.h",
    "chars": 4767,
    "preview": "/// \n///  InputMapper.h\n///  Seed of Andromeda\n///\n///  Created by Frank McCoy\n///  Refactored by Ben Arnold on Mar 25 2"
  },
  {
    "path": "SoA/Inputs.cpp",
    "chars": 5518,
    "preview": "#include \"stdafx.h\"\n#include \"Inputs.h\"\n\n#include <SDL2/SDL_mouse.h>\n\n#include \"GameManager.h\"\n\n// Input Commands Sorted"
  },
  {
    "path": "SoA/Inputs.h",
    "chars": 2715,
    "preview": "///\n/// Inputs.h\n/// Seed of Andromeda\n///\n/// Created by Cristian Zaloj on 29 Dec 2014\n/// Copyright 2014 Regrowth Stud"
  },
  {
    "path": "SoA/Item.cpp",
    "chars": 831,
    "preview": "#include \"stdafx.h\"\n#include \"Item.h\"\n\nItemPack::ItemPack() :\n    onItemDataAddition(this) {\n    // Add default item\n   "
  }
]

// ... and 297 more files (download for full content)

About this extraction

This page contains the full source code of the RegrowthStudios/SoACode-Public GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 497 files (2.7 MB), approximately 716.5k tokens, and a symbol index with 1276 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.

Copied to clipboard!