mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-12-12 19:22:30 +00:00
chore: initial commit
This commit is contained in:
commit
70b00c5c38
965 changed files with 264882 additions and 0 deletions
16
src/world/CMakeLists.txt
Normal file
16
src/world/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
file(GLOB PRIVATE_SOURCES "*.cpp")
|
||||
|
||||
add_library(world STATIC
|
||||
${PRIVATE_SOURCES}
|
||||
)
|
||||
|
||||
target_include_directories(world
|
||||
PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/src
|
||||
)
|
||||
|
||||
target_link_libraries(world
|
||||
PRIVATE
|
||||
gx
|
||||
model
|
||||
)
|
||||
44
src/world/CWorld.cpp
Normal file
44
src/world/CWorld.cpp
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
#include "world/CWorld.hpp"
|
||||
#include "gx/Gx.hpp"
|
||||
#include "gx/Shader.hpp"
|
||||
#include "model/Model2.hpp"
|
||||
|
||||
uint32_t CWorld::s_enables;
|
||||
uint32_t CWorld::s_enables2;
|
||||
|
||||
void CWorld::Initialize() {
|
||||
CWorld::s_enables |=
|
||||
Enables::Enable_1
|
||||
| Enables::Enable_2
|
||||
| Enables::Enable_10
|
||||
| Enables::Enable_Culling
|
||||
| Enables::Enable_Shadow
|
||||
| Enables::Enable_100
|
||||
| Enables::Enable_200
|
||||
| Enables::Enable_800
|
||||
| Enables::Enable_4000
|
||||
| Enables::Enable_DetailDoodads
|
||||
| Enables::Enable_1000000
|
||||
| Enables::Enable_Particulates
|
||||
| Enables::Enable_LowDetail;
|
||||
|
||||
// TODO
|
||||
|
||||
if (GxCaps()->m_pixelShaderTarget > GxShPS_none) {
|
||||
CWorld::s_enables |= Enables::Enable_PixelShader;
|
||||
}
|
||||
|
||||
if (GxCaps()->m_vertexShaderTarget > GxShVS_none) {
|
||||
CWorld::s_enables2 |= Enables2::Enable_VertexShader;
|
||||
}
|
||||
|
||||
// TODO
|
||||
|
||||
uint32_t m2Flags = M2GetCacheFlags();
|
||||
CShaderEffect::InitShaderSystem(
|
||||
(m2Flags & 0x8) != 0,
|
||||
(CWorld::s_enables2 & Enables2::Enable_HwPcf) != 0
|
||||
);
|
||||
|
||||
// TODO
|
||||
}
|
||||
52
src/world/CWorld.hpp
Normal file
52
src/world/CWorld.hpp
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
#ifndef WORLD_C_WORLD_HPP
|
||||
#define WORLD_C_WORLD_HPP
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
class CWorld {
|
||||
public:
|
||||
enum Enables {
|
||||
Enable_1 = 0x1,
|
||||
Enable_2 = 0x2,
|
||||
Enable_Lod = 0x4,
|
||||
Enable_8 = 0x8,
|
||||
Enable_10 = 0x10,
|
||||
Enable_Culling = 0x20,
|
||||
Enable_Shadow = 0x40,
|
||||
Enable_80 = 0x80,
|
||||
Enable_100 = 0x100,
|
||||
Enable_200 = 0x200,
|
||||
Enable_400 = 0x400,
|
||||
Enable_800 = 0x800,
|
||||
Enable_1000 = 0x1000,
|
||||
Enable_4000 = 0x4000,
|
||||
Enable_8000 = 0x8000,
|
||||
Enable_10000 = 0x10000,
|
||||
Enable_20000 = 0x20000,
|
||||
Enable_40000 = 0x40000,
|
||||
Enable_80000 = 0x80000,
|
||||
Enable_DetailDoodads = 0x100000,
|
||||
Enable_200000 = 0x200000,
|
||||
Enable_400000 = 0x400000,
|
||||
Enable_800000 = 0x800000,
|
||||
Enable_1000000 = 0x1000000,
|
||||
Enable_Particulates = 0x2000000,
|
||||
Enable_LowDetail = 0x4000000,
|
||||
Enable_8000000 = 0x8000000,
|
||||
Enable_PixelShader = 0x10000000
|
||||
};
|
||||
|
||||
enum Enables2 {
|
||||
Enable_VertexShader = 0x1,
|
||||
Enable_HwPcf = 0x2
|
||||
};
|
||||
|
||||
// Static variables
|
||||
static uint32_t s_enables;
|
||||
static uint32_t s_enables2;
|
||||
|
||||
// Static functions
|
||||
static void Initialize(void);
|
||||
};
|
||||
|
||||
#endif
|
||||
6
src/world/World.hpp
Normal file
6
src/world/World.hpp
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#ifndef WORLD_WORLD_HPP
|
||||
#define WORLD_WORLD_HPP
|
||||
|
||||
#include "world/CWorld.hpp"
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue