mirror of https://github.com/AxioDL/metaforce.git
Windows build fixes and warning avoidance
This commit is contained in:
parent
3ceaa82035
commit
70b3404b7c
|
@ -24,7 +24,11 @@ set(BUILD_STATIC_LIBS ON CACHE BOOL "Force static libs on" FORCE)
|
||||||
|
|
||||||
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/sanitizers-cmake/cmake" "${CMAKE_SOURCE_DIR}/cotire/CMake" ${CMAKE_MODULE_PATH})
|
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/sanitizers-cmake/cmake" "${CMAKE_SOURCE_DIR}/cotire/CMake" ${CMAKE_MODULE_PATH})
|
||||||
find_package(Sanitizers)
|
find_package(Sanitizers)
|
||||||
include(cotire)
|
|
||||||
|
# Don't cotire when using clang-cl
|
||||||
|
if(NOT MSVC OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
|
||||||
|
include(cotire)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(URDE_VECTOR_ISA "sse2" CACHE STRING "Vector ISA to build for (sse2, sse3, sse41, avx, avx2)")
|
set(URDE_VECTOR_ISA "sse2" CACHE STRING "Vector ISA to build for (sse2, sse3, sse41, avx, avx2)")
|
||||||
|
|
||||||
|
@ -52,8 +56,8 @@ if(MSVC)
|
||||||
|
|
||||||
# Shaddup MSVC
|
# Shaddup MSVC
|
||||||
add_definitions(-DUNICODE=1 -D_UNICODE=1 -D__SSE__=1 -D_CRT_SECURE_NO_WARNINGS=1 -DD_SCL_SECURE_NO_WARNINGS=1
|
add_definitions(-DUNICODE=1 -D_UNICODE=1 -D__SSE__=1 -D_CRT_SECURE_NO_WARNINGS=1 -DD_SCL_SECURE_NO_WARNINGS=1
|
||||||
-D_SCL_SECURE_NO_DEPRECATE=1 /IGNORE:4221 /wd4018 /wd4800 /wd4005 /wd4311 /wd4267 /wd4244 /wd4200 /wd4305
|
-D_SCL_SECURE_NO_DEPRECATE=1 -D_CRT_NONSTDC_NO_WARNINGS=1 /IGNORE:4221 /wd4018 /wd4800 /wd4005 /wd4311
|
||||||
/wd4067 /wd4146 /wd4309 ${VS_DEFINES})
|
/wd4267 /wd4244 /wd4200 /wd4305 /wd4067 /wd4146 /wd4309 /wd4805 ${VS_DEFINES})
|
||||||
|
|
||||||
if(WINDOWS_STORE)
|
if(WINDOWS_STORE)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /AI\"$ENV{PROGRAMFILES\(X86\)}/Microsoft Visual Studio/2017/Community/Common7/IDE/VC/vcpackages\" /AI\"$ENV{PROGRAMFILES\(X86\)}/Windows Kits/10/UnionMetadata\"")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /AI\"$ENV{PROGRAMFILES\(X86\)}/Microsoft Visual Studio/2017/Community/Common7/IDE/VC/vcpackages\" /AI\"$ENV{PROGRAMFILES\(X86\)}/Windows Kits/10/UnionMetadata\"")
|
||||||
|
@ -62,15 +66,17 @@ if(MSVC)
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
|
||||||
|
|
||||||
# Link-time Code Generation for Release builds
|
# Link-time Code Generation for Release builds (excluding clang-cl)
|
||||||
set(CMAKE_C_FLAGS_RELEASE "/DNDEBUG /O2 /Oy /GL /Gy /MD")
|
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
|
set(CMAKE_C_FLAGS_RELEASE "/DNDEBUG /O2 /Oy /GL /Gy /MD")
|
||||||
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "/LTCG")
|
set(CMAKE_C_FLAGS_RELWITHDEBINFO "/DNDEBUG /Zi /O2 /Oy- /GL /Gy /MD")
|
||||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "/DNDEBUG /Zi /O2 /Oy- /GL /Gy /MD")
|
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "/LTCG")
|
||||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
set(CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO "/LTCG")
|
||||||
set(CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO "/LTCG")
|
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/RELEASE /LTCG /OPT:REF /OPT:ICF /INCREMENTAL:NO")
|
||||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/RELEASE /LTCG /OPT:REF /OPT:ICF /INCREMENTAL:NO")
|
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "/DEBUG /RELEASE /LTCG /OPT:REF /OPT:ICF /INCREMENTAL:NO /DEBUGTYPE:cv,fixup")
|
||||||
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "/DEBUG /RELEASE /LTCG /OPT:REF /OPT:ICF /INCREMENTAL:NO /DEBUGTYPE:cv,fixup")
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
|
||||||
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
||||||
|
endif()
|
||||||
|
|
||||||
else()
|
else()
|
||||||
if(${URDE_VECTOR_ISA} STREQUAL "avx2")
|
if(${URDE_VECTOR_ISA} STREQUAL "avx2")
|
||||||
|
|
|
@ -243,7 +243,7 @@ BitstreamReader::read(const atUint8* data,
|
||||||
}
|
}
|
||||||
case Channel::Type::KfHead:
|
case Channel::Type::KfHead:
|
||||||
{
|
{
|
||||||
bool aBit = dequantizeBit(data);
|
dequantizeBit(data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Channel::Type::RotationMP3:
|
case Channel::Type::RotationMP3:
|
||||||
|
|
|
@ -1651,6 +1651,7 @@ bool WriteHMDLCMDL(const hecl::ProjectPath& outPath, const hecl::ProjectPath& in
|
||||||
size_t endOff = 0;
|
size_t endOff = 0;
|
||||||
for (const hecl::blender::HMDLBuffers::Surface& surf : bufs.m_surfaces)
|
for (const hecl::blender::HMDLBuffers::Surface& surf : bufs.m_surfaces)
|
||||||
{
|
{
|
||||||
|
(void)surf;
|
||||||
head.secSizes.push_back(64);
|
head.secSizes.push_back(64);
|
||||||
paddingSizes.push_back(0);
|
paddingSizes.push_back(0);
|
||||||
endOff += 64;
|
endOff += 64;
|
||||||
|
@ -2172,6 +2173,7 @@ bool WriteHMDLMREASecs(std::vector<std::vector<uint8_t>>& secsOut, const hecl::P
|
||||||
size_t endOff = 0;
|
size_t endOff = 0;
|
||||||
for (const hecl::blender::HMDLBuffers::Surface& surf : bufs.m_surfaces)
|
for (const hecl::blender::HMDLBuffers::Surface& surf : bufs.m_surfaces)
|
||||||
{
|
{
|
||||||
|
(void)surf;
|
||||||
endOff += 96;
|
endOff += 96;
|
||||||
surfEndOffs.push_back(endOff);
|
surfEndOffs.push_back(endOff);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ struct IGlyph : BigDNAVYaml
|
||||||
float bottom() const { return m_glyphRect.bottom; }
|
float bottom() const { return m_glyphRect.bottom; }
|
||||||
GlyphRect rect() const { return m_glyphRect; }
|
GlyphRect rect() const { return m_glyphRect; }
|
||||||
|
|
||||||
virtual int layer() { return 0; }
|
virtual atInt32 layer() const { return 0; }
|
||||||
virtual atInt32 leftPadding() const=0;
|
virtual atInt32 leftPadding() const=0;
|
||||||
virtual atInt32 advance() const =0;
|
virtual atInt32 advance() const =0;
|
||||||
virtual atInt32 rightPadding() const=0;
|
virtual atInt32 rightPadding() const=0;
|
||||||
|
|
|
@ -102,7 +102,6 @@ static FittedOBB FitOBB(const ColMesh& mesh, const std::vector<int>& index)
|
||||||
// mean location
|
// mean location
|
||||||
for (int i : index)
|
for (int i : index)
|
||||||
{
|
{
|
||||||
const ColMesh::Triangle& T = mesh.trianges[i];
|
|
||||||
std::unordered_set<uint32_t> verts = GetTriangleVerts(mesh, i);
|
std::unordered_set<uint32_t> verts = GetTriangleVerts(mesh, i);
|
||||||
auto it = verts.begin();
|
auto it = verts.begin();
|
||||||
zeus::CVector3f p = mesh.verts[*it++].val;
|
zeus::CVector3f p = mesh.verts[*it++].val;
|
||||||
|
|
|
@ -186,6 +186,7 @@ public:
|
||||||
|
|
||||||
void enterPAKBridge(const BRIDGETYPE& pakBridge);
|
void enterPAKBridge(const BRIDGETYPE& pakBridge);
|
||||||
|
|
||||||
|
using PAKRouterBase::getWorking;
|
||||||
hecl::ProjectPath getWorking(const EntryType* entry,
|
hecl::ProjectPath getWorking(const EntryType* entry,
|
||||||
const ResExtractor<BRIDGETYPE>& extractor) const;
|
const ResExtractor<BRIDGETYPE>& extractor) const;
|
||||||
hecl::ProjectPath getWorking(const EntryType* entry) const;
|
hecl::ProjectPath getWorking(const EntryType* entry) const;
|
||||||
|
|
|
@ -1470,6 +1470,7 @@ void SpawnSystemKeyframeData<IDType>::_read(typename ReadYaml::StreamT& r)
|
||||||
spawns.reserve(spawnCount);
|
spawns.reserve(spawnCount);
|
||||||
for (const auto& child : r.getCurNode()->m_seqChildren)
|
for (const auto& child : r.getCurNode()->m_seqChildren)
|
||||||
{
|
{
|
||||||
|
(void)child;
|
||||||
if (auto rec = r.enterSubRecord(nullptr))
|
if (auto rec = r.enterSubRecord(nullptr))
|
||||||
{
|
{
|
||||||
spawns.emplace_back();
|
spawns.emplace_back();
|
||||||
|
@ -1480,6 +1481,7 @@ void SpawnSystemKeyframeData<IDType>::_read(typename ReadYaml::StreamT& r)
|
||||||
spawns.back().second.reserve(systemCount);
|
spawns.back().second.reserve(systemCount);
|
||||||
for (const auto& in : r.getCurNode()->m_seqChildren)
|
for (const auto& in : r.getCurNode()->m_seqChildren)
|
||||||
{
|
{
|
||||||
|
(void)in;
|
||||||
spawns.back().second.emplace_back();
|
spawns.back().second.emplace_back();
|
||||||
SpawnSystemKeyframeInfo& info = spawns.back().second.back();
|
SpawnSystemKeyframeInfo& info = spawns.back().second.back();
|
||||||
if (auto rec = r.enterSubRecord(nullptr))
|
if (auto rec = r.enterSubRecord(nullptr))
|
||||||
|
|
|
@ -235,6 +235,7 @@ static void DecodeI4(png_structp png, png_infop info,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
static void EncodeI4(const uint8_t* rgbaIn, uint8_t* texels, int width, int height)
|
static void EncodeI4(const uint8_t* rgbaIn, uint8_t* texels, int width, int height)
|
||||||
{
|
{
|
||||||
for (int y=height-1 ; y>=0 ; --y)
|
for (int y=height-1 ; y>=0 ; --y)
|
||||||
|
@ -244,6 +245,7 @@ static void EncodeI4(const uint8_t* rgbaIn, uint8_t* texels, int width, int heig
|
||||||
rgbaIn += width;
|
rgbaIn += width;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void DecodeI8(png_structp png, png_infop info,
|
static void DecodeI8(png_structp png, png_infop info,
|
||||||
const uint8_t* texels, int width, int height)
|
const uint8_t* texels, int width, int height)
|
||||||
|
@ -291,6 +293,7 @@ static void DecodeIA4(png_structp png, png_infop info,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
static void EncodeIA4(const uint8_t* rgbaIn, uint8_t* texels, int width, int height)
|
static void EncodeIA4(const uint8_t* rgbaIn, uint8_t* texels, int width, int height)
|
||||||
{
|
{
|
||||||
for (int y=height-1 ; y>=0 ; --y)
|
for (int y=height-1 ; y>=0 ; --y)
|
||||||
|
@ -304,6 +307,7 @@ static void EncodeIA4(const uint8_t* rgbaIn, uint8_t* texels, int width, int hei
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void DecodeIA8(png_structp png, png_infop info,
|
static void DecodeIA8(png_structp png, png_infop info,
|
||||||
const uint8_t* texels, int width, int height)
|
const uint8_t* texels, int width, int height)
|
||||||
|
@ -808,6 +812,7 @@ static void DecodeRGB565(png_structp png, png_infop info,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
static void EncodeRGB565(const uint8_t* rgbaIn, uint8_t* texels, int width, int height)
|
static void EncodeRGB565(const uint8_t* rgbaIn, uint8_t* texels, int width, int height)
|
||||||
{
|
{
|
||||||
for (int y=height-1 ; y>=0 ; --y)
|
for (int y=height-1 ; y>=0 ; --y)
|
||||||
|
@ -822,6 +827,7 @@ static void EncodeRGB565(const uint8_t* rgbaIn, uint8_t* texels, int width, int
|
||||||
rgbaIn += width * 3;
|
rgbaIn += width * 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void DecodeRGB5A3(png_structp png, png_infop info,
|
static void DecodeRGB5A3(png_structp png, png_infop info,
|
||||||
const uint8_t* texels, int width, int height)
|
const uint8_t* texels, int width, int height)
|
||||||
|
@ -855,6 +861,7 @@ static void DecodeRGB5A3(png_structp png, png_infop info,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
static void EncodeRGB5A3(const uint8_t* rgbaIn, uint8_t* texels, int width, int height)
|
static void EncodeRGB5A3(const uint8_t* rgbaIn, uint8_t* texels, int width, int height)
|
||||||
{
|
{
|
||||||
for (int y=height-1 ; y>=0 ; --y)
|
for (int y=height-1 ; y>=0 ; --y)
|
||||||
|
@ -881,6 +888,7 @@ static void EncodeRGB5A3(const uint8_t* rgbaIn, uint8_t* texels, int width, int
|
||||||
rgbaIn += width * 4;
|
rgbaIn += width * 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void DecodeRGBA8(png_structp png, png_infop info,
|
static void DecodeRGBA8(png_structp png, png_infop info,
|
||||||
const uint8_t* texels, int width, int height)
|
const uint8_t* texels, int width, int height)
|
||||||
|
|
|
@ -318,6 +318,7 @@ struct MaterialSet : BigDNA
|
||||||
int stageIdx = 0;
|
int stageIdx = 0;
|
||||||
for (const Material::TEVStage& stage : mat.tevStages)
|
for (const Material::TEVStage& stage : mat.tevStages)
|
||||||
{
|
{
|
||||||
|
(void)stage;
|
||||||
const Material::TEVStageTexInfo& texInfo = mat.tevStageTexInfo[stageIdx];
|
const Material::TEVStageTexInfo& texInfo = mat.tevStageTexInfo[stageIdx];
|
||||||
if (texInfo.texSlot == 0xff)
|
if (texInfo.texSlot == 0xff)
|
||||||
{
|
{
|
||||||
|
|
|
@ -60,10 +60,8 @@ static bool GetNoShare(std::string_view name)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
PAKBridge::PAKBridge(hecl::Database::Project& project,
|
PAKBridge::PAKBridge(const nod::Node& node, bool doExtract)
|
||||||
const nod::Node& node,
|
: m_node(node), m_pak(false, GetNoShare(node.getName())), m_doExtract(doExtract)
|
||||||
bool doExtract)
|
|
||||||
: m_project(project), m_node(node), m_pak(false, GetNoShare(node.getName())), m_doExtract(doExtract)
|
|
||||||
{
|
{
|
||||||
nod::AthenaPartReadStream rs(node.beginReadStream());
|
nod::AthenaPartReadStream rs(node.beginReadStream());
|
||||||
m_pak.read(rs);
|
m_pak.read(rs);
|
||||||
|
|
|
@ -13,7 +13,6 @@ extern logvisor::Module Log;
|
||||||
/* MP1-specific, one-shot PAK traversal/extraction class */
|
/* MP1-specific, one-shot PAK traversal/extraction class */
|
||||||
class PAKBridge
|
class PAKBridge
|
||||||
{
|
{
|
||||||
hecl::Database::Project& m_project;
|
|
||||||
const nod::Node& m_node;
|
const nod::Node& m_node;
|
||||||
PAK m_pak;
|
PAK m_pak;
|
||||||
public:
|
public:
|
||||||
|
@ -22,9 +21,7 @@ public:
|
||||||
std::unordered_map<UniqueID32, Level> m_levelDeps;
|
std::unordered_map<UniqueID32, Level> m_levelDeps;
|
||||||
hecl::SystemString m_levelString;
|
hecl::SystemString m_levelString;
|
||||||
|
|
||||||
PAKBridge(hecl::Database::Project& project,
|
PAKBridge(const nod::Node& node, bool doExtract=true);
|
||||||
const nod::Node& node,
|
|
||||||
bool doExtract=true);
|
|
||||||
void build();
|
void build();
|
||||||
static ResExtractor<PAKBridge> LookupExtractor(const PAK& pak, const PAK::Entry& entry);
|
static ResExtractor<PAKBridge> LookupExtractor(const PAK& pak, const PAK::Entry& entry);
|
||||||
std::string_view getName() const {return m_node.getName();}
|
std::string_view getName() const {return m_node.getName();}
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
#include "ScriptObjects/ScriptTypes.hpp"
|
#include "ScriptObjects/ScriptTypes.hpp"
|
||||||
#include "hecl/Blender/Connection.hpp"
|
#include "hecl/Blender/Connection.hpp"
|
||||||
|
|
||||||
|
#define DUMP_OCTREE 0
|
||||||
|
|
||||||
extern hecl::SystemString ExeDir;
|
extern hecl::SystemString ExeDir;
|
||||||
|
|
||||||
namespace DataSpec::DNAMP1
|
namespace DataSpec::DNAMP1
|
||||||
|
@ -76,6 +78,7 @@ UniqueID32 MREA::GetPATHId(PAKEntryReadStream& rs)
|
||||||
return {rs};
|
return {rs};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if DUMP_OCTREE
|
||||||
/* Collision octree dumper */
|
/* Collision octree dumper */
|
||||||
static void OutputOctreeNode(hecl::blender::PyOutStream& os, athena::io::MemoryReader& r,
|
static void OutputOctreeNode(hecl::blender::PyOutStream& os, athena::io::MemoryReader& r,
|
||||||
BspNodeType type, const zeus::CAABox& aabb)
|
BspNodeType type, const zeus::CAABox& aabb)
|
||||||
|
@ -201,6 +204,7 @@ static void OutputOctreeNode(hecl::blender::PyOutStream& os, athena::io::MemoryR
|
||||||
pos.x, pos.y, pos.z, extent.x, extent.y, extent.z);
|
pos.x, pos.y, pos.z, extent.x, extent.y, extent.z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
bool MREA::Extract(const SpecBase& dataSpec,
|
bool MREA::Extract(const SpecBase& dataSpec,
|
||||||
PAKEntryReadStream& rs,
|
PAKEntryReadStream& rs,
|
||||||
|
@ -517,7 +521,7 @@ bool MREA::Cook(const hecl::ProjectPath& outPath,
|
||||||
AROTBuilder arotBuilder;
|
AROTBuilder arotBuilder;
|
||||||
arotBuilder.build(secs, fullAabb, meshAabbs, meshes);
|
arotBuilder.build(secs, fullAabb, meshAabbs, meshes);
|
||||||
|
|
||||||
#if 0
|
#if DUMP_OCTREE
|
||||||
hecl::blender::Connection& conn = btok.getBlenderConnection();
|
hecl::blender::Connection& conn = btok.getBlenderConnection();
|
||||||
if (!conn.createBlend(inPath.getWithExtension(_S(".octree.blend"), true), hecl::blender::Connection::BlendType::Area))
|
if (!conn.createBlend(inPath.getWithExtension(_S(".octree.blend"), true), hecl::blender::Connection::BlendType::Area))
|
||||||
return false;
|
return false;
|
||||||
|
@ -588,7 +592,7 @@ bool MREA::Cook(const hecl::ProjectPath& outPath,
|
||||||
DeafBabe collision = {};
|
DeafBabe collision = {};
|
||||||
DeafBabeBuildFromBlender(collision, cMesh);
|
DeafBabeBuildFromBlender(collision, cMesh);
|
||||||
|
|
||||||
#if 0
|
#if DUMP_OCTREE
|
||||||
hecl::blender::Connection& conn = btok.getBlenderConnection();
|
hecl::blender::Connection& conn = btok.getBlenderConnection();
|
||||||
if (!conn.createBlend(inPath.getWithExtension(_S(".octree.blend"), true), hecl::blender::Connection::BlendType::Area))
|
if (!conn.createBlend(inPath.getWithExtension(_S(".octree.blend"), true), hecl::blender::Connection::BlendType::Area))
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -7,16 +7,6 @@ namespace DataSpec::DNAMP1
|
||||||
const std::vector<FourCC> skLanguages = {FOURCC('ENGL'), FOURCC('FREN'), FOURCC('GERM'), FOURCC('SPAN'),
|
const std::vector<FourCC> skLanguages = {FOURCC('ENGL'), FOURCC('FREN'), FOURCC('GERM'), FOURCC('SPAN'),
|
||||||
FOURCC('ITAL'), FOURCC('DUTC'), FOURCC('JAPN')};
|
FOURCC('ITAL'), FOURCC('DUTC'), FOURCC('JAPN')};
|
||||||
|
|
||||||
static float u16stof(char16_t* str)
|
|
||||||
{
|
|
||||||
char cstr[16];
|
|
||||||
int i;
|
|
||||||
for (i = 0; i < 15 && str[i] != u'\0'; ++i)
|
|
||||||
cstr[i] = str[i];
|
|
||||||
cstr[i] = '\0';
|
|
||||||
return strtof(cstr, nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
static uint32_t ParseTag(const char16_t* str)
|
static uint32_t ParseTag(const char16_t* str)
|
||||||
{
|
{
|
||||||
char parseStr[9];
|
char parseStr[9];
|
||||||
|
|
|
@ -32,10 +32,9 @@ static bool GetNoShare(std::string_view name)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
PAKBridge::PAKBridge(hecl::Database::Project& project,
|
PAKBridge::PAKBridge(const nod::Node& node,
|
||||||
const nod::Node& node,
|
|
||||||
bool doExtract)
|
bool doExtract)
|
||||||
: m_project(project), m_node(node), m_pak(true, GetNoShare(node.getName())), m_doExtract(doExtract)
|
: m_node(node), m_pak(true, GetNoShare(node.getName())), m_doExtract(doExtract)
|
||||||
{
|
{
|
||||||
nod::AthenaPartReadStream rs(node.beginReadStream());
|
nod::AthenaPartReadStream rs(node.beginReadStream());
|
||||||
m_pak.read(rs);
|
m_pak.read(rs);
|
||||||
|
|
|
@ -12,7 +12,6 @@ extern logvisor::Module Log;
|
||||||
/* MP2-specific, one-shot PAK traversal/extraction class */
|
/* MP2-specific, one-shot PAK traversal/extraction class */
|
||||||
class PAKBridge
|
class PAKBridge
|
||||||
{
|
{
|
||||||
hecl::Database::Project& m_project;
|
|
||||||
const nod::Node& m_node;
|
const nod::Node& m_node;
|
||||||
DNAMP1::PAK m_pak;
|
DNAMP1::PAK m_pak;
|
||||||
public:
|
public:
|
||||||
|
@ -21,9 +20,7 @@ public:
|
||||||
std::unordered_map<UniqueID32, Level> m_levelDeps;
|
std::unordered_map<UniqueID32, Level> m_levelDeps;
|
||||||
hecl::SystemString m_levelString;
|
hecl::SystemString m_levelString;
|
||||||
|
|
||||||
PAKBridge(hecl::Database::Project& project,
|
PAKBridge(const nod::Node& node, bool doExtract=true);
|
||||||
const nod::Node& node,
|
|
||||||
bool doExtract=true);
|
|
||||||
void build();
|
void build();
|
||||||
static ResExtractor<PAKBridge> LookupExtractor(const DNAMP1::PAK& pak, const DNAMP1::PAK::Entry& entry);
|
static ResExtractor<PAKBridge> LookupExtractor(const DNAMP1::PAK& pak, const DNAMP1::PAK::Entry& entry);
|
||||||
std::string_view getName() const {return m_node.getName();}
|
std::string_view getName() const {return m_node.getName();}
|
||||||
|
|
|
@ -208,7 +208,7 @@ bool MREA::Extract(const SpecBase& dataSpec,
|
||||||
drs.seek(egmcOffset, athena::Begin);
|
drs.seek(egmcOffset, athena::Begin);
|
||||||
UniqueID32 egmcId(drs);
|
UniqueID32 egmcId(drs);
|
||||||
DNACommon::EGMC egmc;
|
DNACommon::EGMC egmc;
|
||||||
bool hasEGMC = pakRouter.lookupAndReadDNA(egmcId, egmc);
|
pakRouter.lookupAndReadDNA(egmcId, egmc);
|
||||||
|
|
||||||
drs.seek(0, athena::Begin);
|
drs.seek(0, athena::Begin);
|
||||||
|
|
||||||
|
|
|
@ -516,8 +516,8 @@ void ANIM::ANIM1::Enumerate<BigDNA::Read>(athena::io::IStreamReader& reader)
|
||||||
initBlock.push_back(reader.readInt16Big());
|
initBlock.push_back(reader.readInt16Big());
|
||||||
|
|
||||||
atUint32 rawChannelCount = reader.readUint32Big();
|
atUint32 rawChannelCount = reader.readUint32Big();
|
||||||
atUint32 scratchSize1 = reader.readUint32Big();
|
reader.readUint32Big();
|
||||||
atUint32 scratchSize2 = reader.readUint32Big();
|
reader.readUint32Big();
|
||||||
|
|
||||||
std::vector<atUint8> chanBitCounts;
|
std::vector<atUint8> chanBitCounts;
|
||||||
chanBitCounts.reserve(rawChannelCount);
|
chanBitCounts.reserve(rawChannelCount);
|
||||||
|
|
|
@ -30,10 +30,9 @@ static bool GetNoShare(std::string_view name)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
PAKBridge::PAKBridge(hecl::Database::Project& project,
|
PAKBridge::PAKBridge(const nod::Node& node,
|
||||||
const nod::Node& node,
|
|
||||||
bool doExtract)
|
bool doExtract)
|
||||||
: m_project(project), m_node(node), m_pak(GetNoShare(node.getName())), m_doExtract(doExtract)
|
: m_node(node), m_pak(GetNoShare(node.getName())), m_doExtract(doExtract)
|
||||||
{
|
{
|
||||||
nod::AthenaPartReadStream rs(node.beginReadStream());
|
nod::AthenaPartReadStream rs(node.beginReadStream());
|
||||||
m_pak.read(rs);
|
m_pak.read(rs);
|
||||||
|
|
|
@ -12,7 +12,6 @@ extern logvisor::Module Log;
|
||||||
/* MP3-specific, one-shot PAK traversal/extraction class */
|
/* MP3-specific, one-shot PAK traversal/extraction class */
|
||||||
class PAKBridge
|
class PAKBridge
|
||||||
{
|
{
|
||||||
hecl::Database::Project& m_project;
|
|
||||||
const nod::Node& m_node;
|
const nod::Node& m_node;
|
||||||
PAK m_pak;
|
PAK m_pak;
|
||||||
public:
|
public:
|
||||||
|
@ -21,9 +20,7 @@ public:
|
||||||
std::unordered_map<UniqueID64, Level> m_levelDeps;
|
std::unordered_map<UniqueID64, Level> m_levelDeps;
|
||||||
hecl::SystemString m_levelString;
|
hecl::SystemString m_levelString;
|
||||||
|
|
||||||
PAKBridge(hecl::Database::Project& project,
|
PAKBridge(const nod::Node& node, bool doExtract=true);
|
||||||
const nod::Node& node,
|
|
||||||
bool doExtract=true);
|
|
||||||
void build();
|
void build();
|
||||||
static ResExtractor<PAKBridge> LookupExtractor(const PAK& pak, const PAK::Entry& entry);
|
static ResExtractor<PAKBridge> LookupExtractor(const PAK& pak, const PAK::Entry& entry);
|
||||||
std::string_view getName() const {return m_node.getName();}
|
std::string_view getName() const {return m_node.getName();}
|
||||||
|
|
|
@ -249,7 +249,7 @@ struct SpecMP1 : SpecBase
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_paks.emplace_back(m_project, child, good);
|
m_paks.emplace_back(child, good);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1313,7 +1313,7 @@ struct SpecMP1 : SpecBase
|
||||||
auto layerIt = area.depLayers.cbegin();
|
auto layerIt = area.depLayers.cbegin();
|
||||||
while (it != area.deps.cend())
|
while (it != area.deps.cend())
|
||||||
{
|
{
|
||||||
if (it - area.deps.cbegin() == *layerIt)
|
if (layerIt != area.depLayers.cend() && it - area.deps.cbegin() == *layerIt)
|
||||||
{
|
{
|
||||||
strippedDepLayers.push_back(atUint32(strippedDeps.size()));
|
strippedDepLayers.push_back(atUint32(strippedDeps.size()));
|
||||||
++layerIt;
|
++layerIt;
|
||||||
|
|
|
@ -100,7 +100,7 @@ struct SpecMP2 : SpecBase
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_paks.emplace_back(m_project, child, good);
|
m_paks.emplace_back(child, good);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -123,9 +123,9 @@ struct SpecMP3 : SpecBase
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fe)
|
if (fe)
|
||||||
m_fePaks.emplace_back(m_project, child, good);
|
m_fePaks.emplace_back(child, good);
|
||||||
else
|
else
|
||||||
m_paks.emplace_back(m_project, child, good);
|
m_paks.emplace_back(child, good);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -410,9 +410,8 @@ struct SpecMP3 : SpecBase
|
||||||
auto pakName = hecl::SystemString(sysName.sys_str());
|
auto pakName = hecl::SystemString(sysName.sys_str());
|
||||||
process.addLambdaTransaction([this, &progress, &pak, pakName, force](hecl::blender::Token& btok)
|
process.addLambdaTransaction([this, &progress, &pak, pakName, force](hecl::blender::Token& btok)
|
||||||
{
|
{
|
||||||
int threadIdx = hecl::ClientProcess::GetThreadWorkerIdx();
|
|
||||||
m_pakRouter.extractResources(pak, force, btok,
|
m_pakRouter.extractResources(pak, force, btok,
|
||||||
[&progress, &pakName, threadIdx](const hecl::SystemChar* substr, float factor)
|
[&progress, &pakName](const hecl::SystemChar* substr, float factor)
|
||||||
{
|
{
|
||||||
progress.print(pakName.c_str(), substr, factor);
|
progress.print(pakName.c_str(), substr, factor);
|
||||||
});
|
});
|
||||||
|
@ -467,9 +466,8 @@ struct SpecMP3 : SpecBase
|
||||||
hecl::SystemString pakName(sysName.sys_str());
|
hecl::SystemString pakName(sysName.sys_str());
|
||||||
process.addLambdaTransaction([this, &progress, &pak, pakName, force](hecl::blender::Token& btok)
|
process.addLambdaTransaction([this, &progress, &pak, pakName, force](hecl::blender::Token& btok)
|
||||||
{
|
{
|
||||||
int threadIdx = hecl::ClientProcess::GetThreadWorkerIdx();
|
|
||||||
m_fePakRouter.extractResources(pak, force, btok,
|
m_fePakRouter.extractResources(pak, force, btok,
|
||||||
[&progress, &pakName, threadIdx](const hecl::SystemChar* substr, float factor)
|
[&progress, &pakName](const hecl::SystemChar* substr, float factor)
|
||||||
{
|
{
|
||||||
progress.print(pakName.c_str(), substr, factor);
|
progress.print(pakName.c_str(), substr, factor);
|
||||||
});
|
});
|
||||||
|
|
|
@ -40,7 +40,7 @@ CToken ProjectResourcePool::GetObj(std::string_view name, const CVParamTransfer&
|
||||||
|
|
||||||
bool ProjectManager::m_registeredSpecs = false;
|
bool ProjectManager::m_registeredSpecs = false;
|
||||||
ProjectManager::ProjectManager(ViewManager &vm)
|
ProjectManager::ProjectManager(ViewManager &vm)
|
||||||
: m_vm(vm), m_clientProc(nullptr, 1),
|
: m_vm(vm), m_clientProc(nullptr),
|
||||||
m_factoryMP1(m_clientProc), m_objStore(m_factoryMP1, *this)
|
m_factoryMP1(m_clientProc), m_objStore(m_factoryMP1, *this)
|
||||||
{
|
{
|
||||||
if (!m_registeredSpecs)
|
if (!m_registeredSpecs)
|
||||||
|
|
|
@ -23,7 +23,7 @@ public:
|
||||||
private:
|
private:
|
||||||
hecl::ProjectPath m_path;
|
hecl::ProjectPath m_path;
|
||||||
Space::Class m_defaultClass = Space::Class::None;
|
Space::Class m_defaultClass = Space::Class::None;
|
||||||
EditorSpace* m_editingSpace = nullptr;
|
//EditorSpace* m_editingSpace = nullptr;
|
||||||
std::vector<ViewerSpace*> m_viewingSpaces;
|
std::vector<ViewerSpace*> m_viewingSpaces;
|
||||||
public:
|
public:
|
||||||
static Space::Class DeduceDefaultSpaceClass(const hecl::ProjectPath& path);
|
static Space::Class DeduceDefaultSpaceClass(const hecl::ProjectPath& path);
|
||||||
|
|
|
@ -24,7 +24,6 @@ specter::View* Space::buildSpaceView(specter::ViewResources& res)
|
||||||
specter::View* sview = buildContentView(res);
|
specter::View* sview = buildContentView(res);
|
||||||
m_spaceView->setContentView(sview);
|
m_spaceView->setContentView(sview);
|
||||||
specter::Toolbar& tb = *m_spaceView->toolbar();
|
specter::Toolbar& tb = *m_spaceView->toolbar();
|
||||||
const std::string* classStr = SpaceMenuNode::LookupClassString(m_class);
|
|
||||||
specter::Icon* classIcon = SpaceMenuNode::LookupClassIcon(m_class);
|
specter::Icon* classIcon = SpaceMenuNode::LookupClassIcon(m_class);
|
||||||
const zeus::CColor* classColor = SpaceMenuNode::LookupClassColor(m_class);
|
const zeus::CColor* classColor = SpaceMenuNode::LookupClassColor(m_class);
|
||||||
m_spaceSelectButton.reset(new specter::Button(res, tb, &m_spaceSelectBind, "", classIcon,
|
m_spaceSelectButton.reset(new specter::Button(res, tb, &m_spaceSelectBind, "", classIcon,
|
||||||
|
|
|
@ -49,9 +49,9 @@ public:
|
||||||
static Space* NewSpaceFromConfigStream(ViewManager& vm, Space* parent, ConfigReader& r);
|
static Space* NewSpaceFromConfigStream(ViewManager& vm, Space* parent, ConfigReader& r);
|
||||||
static RootSpace* NewRootSpaceFromConfigStream(ViewManager& vm, ConfigReader& r);
|
static RootSpace* NewRootSpaceFromConfigStream(ViewManager& vm, ConfigReader& r);
|
||||||
|
|
||||||
struct SpaceMenuNode : specter::IMenuNode
|
struct SpaceMenuNode final : specter::IMenuNode
|
||||||
{
|
{
|
||||||
struct SubNodeData : specter::IMenuNode
|
struct SubNodeData final : specter::IMenuNode
|
||||||
{
|
{
|
||||||
Class m_cls;
|
Class m_cls;
|
||||||
std::string m_key;
|
std::string m_key;
|
||||||
|
@ -66,7 +66,7 @@ public:
|
||||||
};
|
};
|
||||||
static std::vector<SubNodeData> s_subNodeDats;
|
static std::vector<SubNodeData> s_subNodeDats;
|
||||||
|
|
||||||
struct SubNode : specter::IMenuNode
|
struct SubNode final : specter::IMenuNode
|
||||||
{
|
{
|
||||||
Space& m_space;
|
Space& m_space;
|
||||||
const SubNodeData& m_data;
|
const SubNodeData& m_data;
|
||||||
|
@ -402,7 +402,7 @@ public:
|
||||||
AT_DECL_DNA_YAML
|
AT_DECL_DNA_YAML
|
||||||
AT_DECL_DNAV
|
AT_DECL_DNAV
|
||||||
} m_state;
|
} m_state;
|
||||||
Space::State& spaceState() {return m_state;}
|
const Space::State& spaceState() const {return m_state;}
|
||||||
|
|
||||||
bool usesToolbar() const {return true;}
|
bool usesToolbar() const {return true;}
|
||||||
void buildToolbarView(specter::ViewResources& res, specter::Toolbar& tb)
|
void buildToolbarView(specter::ViewResources& res, specter::Toolbar& tb)
|
||||||
|
|
|
@ -30,10 +30,10 @@ SplashScreen::SplashScreen(ViewManager& vm, specter::ViewResources& res)
|
||||||
m_textColor(res.themeData().uiText()),
|
m_textColor(res.themeData().uiText()),
|
||||||
m_textColorClear(m_textColor),
|
m_textColorClear(m_textColor),
|
||||||
m_newString(m_vm.translateOr("new_project", "New Project")),
|
m_newString(m_vm.translateOr("new_project", "New Project")),
|
||||||
m_newProjBind(*this),
|
|
||||||
m_openString(m_vm.translateOr("open_project", "Open Project")),
|
m_openString(m_vm.translateOr("open_project", "Open Project")),
|
||||||
m_openProjBind(*this),
|
|
||||||
m_extractString(m_vm.translateOr("extract_game", "Extract Game")),
|
m_extractString(m_vm.translateOr("extract_game", "Extract Game")),
|
||||||
|
m_newProjBind(*this),
|
||||||
|
m_openProjBind(*this),
|
||||||
m_extractProjBind(*this)
|
m_extractProjBind(*this)
|
||||||
{
|
{
|
||||||
if (GIT_COMMIT_DATE[0] != '\0' &&
|
if (GIT_COMMIT_DATE[0] != '\0' &&
|
||||||
|
|
|
@ -89,7 +89,7 @@ class SplashScreen : public specter::ModalWindow
|
||||||
std::string m_text;
|
std::string m_text;
|
||||||
const std::string* text() const {return &m_text;}
|
const std::string* text() const {return &m_text;}
|
||||||
|
|
||||||
struct OpenRecentMenuItem : specter::IMenuNode
|
struct OpenRecentMenuItem final : specter::IMenuNode
|
||||||
{
|
{
|
||||||
OpenRecentMenuRoot& m_parent;
|
OpenRecentMenuRoot& m_parent;
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ namespace urde
|
||||||
{
|
{
|
||||||
class SplashScreen;
|
class SplashScreen;
|
||||||
|
|
||||||
class ViewManager : public specter::IViewManager
|
class ViewManager final : public specter::IViewManager
|
||||||
{
|
{
|
||||||
friend class ProjectManager;
|
friend class ProjectManager;
|
||||||
friend class Space;
|
friend class Space;
|
||||||
|
|
|
@ -28,7 +28,7 @@ void InitializeBadging(specter::ViewResources& viewRes)
|
||||||
if (uncompress(texels.get(), &destSz, URDE_BADGE + pos, URDE_BADGE_SZ - pos) != Z_OK)
|
if (uncompress(texels.get(), &destSz, URDE_BADGE + pos, URDE_BADGE_SZ - pos) != Z_OK)
|
||||||
Log.report(logvisor::Fatal, "unable to decompress badge");
|
Log.report(logvisor::Fatal, "unable to decompress badge");
|
||||||
|
|
||||||
viewRes.m_factory->BooCommitTransaction([&](boo::IGraphicsDataFactory::Context& ctx)
|
viewRes.m_factory->commitTransaction([&](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
specter::IconAtlas<1, 1> atlas;
|
specter::IconAtlas<1, 1> atlas;
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ void InitializeBadging(specter::ViewResources& viewRes)
|
||||||
texels.get(), destSz));
|
texels.get(), destSz));
|
||||||
g_BadgeIcon = atlas.getIcon(0, 0);
|
g_BadgeIcon = atlas.getIcon(0, 0);
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DestroyBadging()
|
void DestroyBadging()
|
||||||
|
|
|
@ -28,14 +28,14 @@ void InitializeIcons(specter::ViewResources& viewRes)
|
||||||
if (uncompress(texels.get(), &destSz, URDE_ICONS + pos, URDE_ICONS_SZ - pos) != Z_OK)
|
if (uncompress(texels.get(), &destSz, URDE_ICONS + pos, URDE_ICONS_SZ - pos) != Z_OK)
|
||||||
Log.report(logvisor::Fatal, "unable to decompress icons");
|
Log.report(logvisor::Fatal, "unable to decompress icons");
|
||||||
|
|
||||||
viewRes.m_factory->BooCommitTransaction([&](boo::IGraphicsDataFactory::Context& ctx)
|
viewRes.m_factory->commitTransaction([&](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
g_IconAtlas.initializeAtlas(ctx.newStaticTexture(width, height, mips,
|
g_IconAtlas.initializeAtlas(ctx.newStaticTexture(width, height, mips,
|
||||||
boo::TextureFormat::RGBA8,
|
boo::TextureFormat::RGBA8,
|
||||||
boo::TextureClampMode::Repeat,
|
boo::TextureClampMode::Repeat,
|
||||||
texels.get(), destSz));
|
texels.get(), destSz));
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DestroyIcons()
|
void DestroyIcons()
|
||||||
|
|
|
@ -65,7 +65,7 @@ enum {
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
static void nesEmuFdsSetup(uint8_t *src, uint8_t *dst);
|
//static void nesEmuFdsSetup(uint8_t *src, uint8_t *dst);
|
||||||
|
|
||||||
static int emuFileType = FTYPE_UNK;
|
static int emuFileType = FTYPE_UNK;
|
||||||
static char emuFileName[1024];
|
static char emuFileName[1024];
|
||||||
|
@ -82,11 +82,11 @@ bool doOverscan = false;
|
||||||
bool nesPAL = false;
|
bool nesPAL = false;
|
||||||
bool nesEmuNSFPlayback = false;
|
bool nesEmuNSFPlayback = false;
|
||||||
|
|
||||||
static bool inPause = false;
|
//static bool inPause = false;
|
||||||
static bool inOverscanToggle = false;
|
//static bool inOverscanToggle = false;
|
||||||
static bool inResize = false;
|
//static bool inResize = false;
|
||||||
static bool inDiskSwitch = false;
|
//static bool inDiskSwitch = false;
|
||||||
static bool inReset = false;
|
//static bool inReset = false;
|
||||||
|
|
||||||
#if DEBUG_HZ
|
#if DEBUG_HZ
|
||||||
static int emuFrameStart = 0;
|
static int emuFrameStart = 0;
|
||||||
|
@ -107,7 +107,7 @@ static int emuMainTotalElapsed = 0;
|
||||||
|
|
||||||
static uint32_t linesToDraw = VISIBLE_LINES;
|
static uint32_t linesToDraw = VISIBLE_LINES;
|
||||||
static const uint32_t visibleImg = VISIBLE_DOTS*VISIBLE_LINES*4;
|
static const uint32_t visibleImg = VISIBLE_DOTS*VISIBLE_LINES*4;
|
||||||
static uint8_t scaleFactor = 2;
|
//static uint8_t scaleFactor = 2;
|
||||||
static bool emuSaveEnabled = false;
|
static bool emuSaveEnabled = false;
|
||||||
static bool emuFdsHasSideB = false;
|
static bool emuFdsHasSideB = false;
|
||||||
static uint32_t mainLoopRuns;
|
static uint32_t mainLoopRuns;
|
||||||
|
@ -252,7 +252,7 @@ void CNESEmulator::InitializeEmulator()
|
||||||
//mainLoopRuns *= ppuLinesTotal;
|
//mainLoopRuns *= ppuLinesTotal;
|
||||||
mainLoopPos = mainLoopRuns;
|
mainLoopPos = mainLoopRuns;
|
||||||
|
|
||||||
CGraphicsCommitResources([this](boo::IGraphicsDataFactory::Context& ctx)
|
CGraphics::CommitResources([this](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
// Nearest-neighbor FTW!
|
// Nearest-neighbor FTW!
|
||||||
m_texture = ctx.newDynamicTexture(VISIBLE_DOTS, linesToDraw,
|
m_texture = ctx.newDynamicTexture(VISIBLE_DOTS, linesToDraw,
|
||||||
|
@ -269,7 +269,7 @@ void CNESEmulator::InitializeEmulator()
|
||||||
m_uniBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(Uniform), 1);
|
m_uniBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(Uniform), 1);
|
||||||
m_shadBind = CNESShader::BuildShaderDataBinding(ctx, m_vbo, m_uniBuf, m_texture);
|
m_shadBind = CNESShader::BuildShaderDataBinding(ctx, m_vbo, m_uniBuf, m_texture);
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
|
|
||||||
//double useFreq = 223740;
|
//double useFreq = 223740;
|
||||||
double useFreq = apuGetFrequency();
|
double useFreq = apuGetFrequency();
|
||||||
|
@ -547,6 +547,7 @@ void CNESEmulator::NesEmuMainLoop(bool forceDraw)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
static void nesEmuFdsSetup(uint8_t *src, uint8_t *dst)
|
static void nesEmuFdsSetup(uint8_t *src, uint8_t *dst)
|
||||||
{
|
{
|
||||||
memcpy(dst, src, 0x38);
|
memcpy(dst, src, 0x38);
|
||||||
|
@ -567,6 +568,7 @@ static void nesEmuFdsSetup(uint8_t *src, uint8_t *dst)
|
||||||
} while(cROMPos < 0xFFDC && cDiskPos < 0xFFFF);
|
} while(cROMPos < 0xFFDC && cDiskPos < 0xFFFF);
|
||||||
printf("%04x -> %04x\n", cROMPos, cDiskPos);
|
printf("%04x -> %04x\n", cROMPos, cDiskPos);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void CNESEmulator::DecompressROM(u8* dataIn, u8* dataOut, u32 dataOutLen, u8 descrambleSeed,
|
void CNESEmulator::DecompressROM(u8* dataIn, u8* dataOut, u32 dataOutLen, u8 descrambleSeed,
|
||||||
u32 checkDataLen, u32 checksumMagic)
|
u32 checkDataLen, u32 checksumMagic)
|
||||||
|
|
|
@ -17,7 +17,7 @@ namespace MP1
|
||||||
|
|
||||||
#define NUM_AUDIO_BUFFERS 10
|
#define NUM_AUDIO_BUFFERS 10
|
||||||
|
|
||||||
class CNESEmulator : public boo::IAudioVoiceCallback
|
class CNESEmulator final : public boo::IAudioVoiceCallback
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum class EPasswordEntryState
|
enum class EPasswordEntryState
|
||||||
|
|
|
@ -179,7 +179,7 @@ boo::ObjToken<boo::IShaderDataBinding> CNESShader::BuildShaderDataBinding(boo::G
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
void CNESShader::Initialize(boo::ID3DDataFactory::Context& ctx)
|
void CNESShader::Initialize(boo::D3DDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
const boo::VertexElementDescriptor VtxVmt[] =
|
const boo::VertexElementDescriptor VtxVmt[] =
|
||||||
{
|
{
|
||||||
|
@ -193,7 +193,7 @@ void CNESShader::Initialize(boo::ID3DDataFactory::Context& ctx)
|
||||||
boo::ZTest::None, false, true, false, boo::CullMode::None);
|
boo::ZTest::None, false, true, false, boo::CullMode::None);
|
||||||
}
|
}
|
||||||
|
|
||||||
boo::ObjToken<boo::IShaderDataBinding> CNESShader::BuildShaderDataBinding(boo::ID3DDataFactory::Context& ctx,
|
boo::ObjToken<boo::IShaderDataBinding> CNESShader::BuildShaderDataBinding(boo::D3DDataFactory::Context& ctx,
|
||||||
boo::ObjToken<boo::IGraphicsBufferS> vbo,
|
boo::ObjToken<boo::IGraphicsBufferS> vbo,
|
||||||
boo::ObjToken<boo::IGraphicsBufferD> uniBuf,
|
boo::ObjToken<boo::IGraphicsBufferD> uniBuf,
|
||||||
boo::ObjToken<boo::ITextureD> tex)
|
boo::ObjToken<boo::ITextureD> tex)
|
||||||
|
@ -274,8 +274,7 @@ boo::ObjToken<boo::IShaderDataBinding> CNESShader::BuildShaderDataBinding(boo::I
|
||||||
#endif
|
#endif
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
case boo::IGraphicsDataFactory::Platform::D3D11:
|
case boo::IGraphicsDataFactory::Platform::D3D11:
|
||||||
case boo::IGraphicsDataFactory::Platform::D3D12:
|
return BuildShaderDataBinding(static_cast<boo::D3DDataFactory::Context&>(ctx), vbo, uniBuf, tex);
|
||||||
return BuildShaderDataBinding(static_cast<boo::ID3DDataFactory::Context&>(ctx), vbo, uniBuf, tex);
|
|
||||||
#endif
|
#endif
|
||||||
#if BOO_HAS_METAL
|
#if BOO_HAS_METAL
|
||||||
case boo::IGraphicsDataFactory::Platform::Metal:
|
case boo::IGraphicsDataFactory::Platform::Metal:
|
||||||
|
@ -295,7 +294,7 @@ void CNESShader::Initialize()
|
||||||
if (!CGraphics::g_BooFactory)
|
if (!CGraphics::g_BooFactory)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CGraphicsCommitResources(
|
CGraphics::CommitResources(
|
||||||
[&](boo::IGraphicsDataFactory::Context& ctx)
|
[&](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
switch (ctx.platform())
|
switch (ctx.platform())
|
||||||
|
@ -307,8 +306,7 @@ void CNESShader::Initialize()
|
||||||
#endif
|
#endif
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
case boo::IGraphicsDataFactory::Platform::D3D11:
|
case boo::IGraphicsDataFactory::Platform::D3D11:
|
||||||
case boo::IGraphicsDataFactory::Platform::D3D12:
|
Initialize(static_cast<boo::D3DDataFactory::Context&>(ctx));
|
||||||
Initialize(static_cast<boo::ID3DDataFactory::Context&>(ctx));
|
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if BOO_HAS_METAL
|
#if BOO_HAS_METAL
|
||||||
|
@ -324,7 +322,7 @@ void CNESShader::Initialize()
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CNESShader::Shutdown()
|
void CNESShader::Shutdown()
|
||||||
|
|
|
@ -20,8 +20,8 @@ public:
|
||||||
boo::ObjToken<boo::ITextureD> tex);
|
boo::ObjToken<boo::ITextureD> tex);
|
||||||
#endif
|
#endif
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
static void Initialize(boo::ID3DDataFactory::Context& ctx);
|
static void Initialize(boo::D3DDataFactory::Context& ctx);
|
||||||
static boo::ObjToken<boo::IShaderDataBinding> BuildShaderDataBinding(boo::ID3DDataFactory::Context& ctx,
|
static boo::ObjToken<boo::IShaderDataBinding> BuildShaderDataBinding(boo::D3DDataFactory::Context& ctx,
|
||||||
boo::ObjToken<boo::IGraphicsBufferS> vbo,
|
boo::ObjToken<boo::IGraphicsBufferS> vbo,
|
||||||
boo::ObjToken<boo::IGraphicsBufferD> uniBuf,
|
boo::ObjToken<boo::IGraphicsBufferD> uniBuf,
|
||||||
boo::ObjToken<boo::ITextureD> tex);
|
boo::ObjToken<boo::ITextureD> tex);
|
||||||
|
|
12
README.md
12
README.md
|
@ -55,18 +55,8 @@ Build / Debug / Run on Windows, macOS and Linux in a unified way.
|
||||||
|
|
||||||
#### Visual Studio
|
#### Visual Studio
|
||||||
|
|
||||||
Using *Git Shell* with [GitHub for Windows](https://desktop.github.com/)
|
|
||||||
|
|
||||||
Windows 7/8 users should run:
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=Debug ../urde
|
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=Debug ../urde
|
||||||
```
|
|
||||||
|
|
||||||
Windows 10 users should run:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_SYSTEM_VERSION=10.0 -DCMAKE_BUILD_TYPE=Debug ../urde
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Then open `urde.sln`
|
Then open `urde.sln`
|
||||||
|
|
|
@ -25,7 +25,6 @@ CFactoryFnReturn FAudioTranslationTableFactory(const SObjectTag& tag, CInputStre
|
||||||
obj->reserve(count);
|
obj->reserve(count);
|
||||||
for (u32 i=0 ; i<count ; ++i)
|
for (u32 i=0 ; i<count ; ++i)
|
||||||
obj->push_back(in.readUint16Big());
|
obj->push_back(in.readUint16Big());
|
||||||
CSimplePool* sp = vparms.GetOwnedObj<CSimplePool*>();
|
|
||||||
return TToken<std::vector<s16>>::GetIObjObjectFor(std::move(obj));
|
return TToken<std::vector<s16>>::GetIObjObjectFor(std::move(obj));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,11 +60,13 @@ public:
|
||||||
zeus::CVector3f xc_;
|
zeus::CVector3f xc_;
|
||||||
zeus::CVector3f x18_;
|
zeus::CVector3f x18_;
|
||||||
zeus::CVector3f x24_;
|
zeus::CVector3f x24_;
|
||||||
|
/*
|
||||||
float x30_ = 0.f;
|
float x30_ = 0.f;
|
||||||
float x34_ = 0.f;
|
float x34_ = 0.f;
|
||||||
float x38_ = 0.f;
|
float x38_ = 0.f;
|
||||||
u32 x3c_ = 0;
|
u32 x3c_ = 0;
|
||||||
bool x40_ = false;
|
bool x40_ = false;
|
||||||
|
*/
|
||||||
bool x44_listenerActive = false;
|
bool x44_listenerActive = false;
|
||||||
std::unordered_set<CSfxHandle> x48_handles;
|
std::unordered_set<CSfxHandle> x48_handles;
|
||||||
};
|
};
|
||||||
|
|
|
@ -19,7 +19,7 @@ class CStaticAudioPlayer
|
||||||
u32 x18_curSamp = 0;
|
u32 x18_curSamp = 0;
|
||||||
u32 x1c_loopStartSamp;
|
u32 x1c_loopStartSamp;
|
||||||
u32 x20_loopEndSamp;
|
u32 x20_loopEndSamp;
|
||||||
u32 x24_ = 0;
|
//u32 x24_ = 0;
|
||||||
//std::unique_ptr<u8[]> x28_dmaLeft;
|
//std::unique_ptr<u8[]> x28_dmaLeft;
|
||||||
//std::unique_ptr<u8[]> x30_dmaRight;
|
//std::unique_ptr<u8[]> x30_dmaRight;
|
||||||
std::vector<std::shared_ptr<IDvdRequest>> x38_dvdRequests;
|
std::vector<std::shared_ptr<IDvdRequest>> x38_dvdRequests;
|
||||||
|
|
|
@ -54,7 +54,7 @@ void CMapArea::PostConstruct()
|
||||||
m_surfaces.back().PostConstruct(x44_buf.get(), index);
|
m_surfaces.back().PostConstruct(x44_buf.get(), index);
|
||||||
}
|
}
|
||||||
|
|
||||||
CGraphicsCommitResources([this, &index](boo::IGraphicsDataFactory::Context& ctx)
|
CGraphics::CommitResources([this, &index](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
m_vbo = ctx.newStaticBuffer(boo::BufferUse::Vertex, m_verts.data(), 16, m_verts.size());
|
m_vbo = ctx.newStaticBuffer(boo::BufferUse::Vertex, m_verts.data(), 16, m_verts.size());
|
||||||
m_ibo = ctx.newStaticBuffer(boo::BufferUse::Index, index.data(), 4, index.size());
|
m_ibo = ctx.newStaticBuffer(boo::BufferUse::Index, index.data(), 4, index.size());
|
||||||
|
@ -98,7 +98,7 @@ void CMapArea::PostConstruct()
|
||||||
mapObj.m_doorSurface.emplace(ctx);
|
mapObj.m_doorSurface.emplace(ctx);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CMapArea::GetIsVisibleToAutoMapper(bool worldVis, bool areaVis) const
|
bool CMapArea::GetIsVisibleToAutoMapper(bool worldVis, bool areaVis) const
|
||||||
|
|
|
@ -22,7 +22,7 @@ public:
|
||||||
CAssetId x8_wldRes;
|
CAssetId x8_wldRes;
|
||||||
int xc_closestHex;
|
int xc_closestHex;
|
||||||
float x10_flashPulse;
|
float x10_flashPulse;
|
||||||
const CStateManager& x14_mgr;
|
//const CStateManager& x14_mgr;
|
||||||
const zeus::CTransform& x18_model;
|
const zeus::CTransform& x18_model;
|
||||||
const zeus::CTransform& x1c_view;
|
const zeus::CTransform& x1c_view;
|
||||||
public:
|
public:
|
||||||
|
@ -34,7 +34,7 @@ public:
|
||||||
x8_wldRes(wldRes),
|
x8_wldRes(wldRes),
|
||||||
xc_closestHex(closestHex),
|
xc_closestHex(closestHex),
|
||||||
x10_flashPulse(flashPulse),
|
x10_flashPulse(flashPulse),
|
||||||
x14_mgr(mgr),
|
//x14_mgr(mgr),
|
||||||
x18_model(model),
|
x18_model(model),
|
||||||
x1c_view(view)
|
x1c_view(view)
|
||||||
{}
|
{}
|
||||||
|
|
|
@ -294,12 +294,12 @@ void CMappableObject::ReadAutoMapperTweaks(const ITweakAutoMapper& tweaks)
|
||||||
doorVerts[6].assign(.2f * -center.z, center.y, 0.f);
|
doorVerts[6].assign(.2f * -center.z, center.y, 0.f);
|
||||||
doorVerts[7].assign(.2f * -center.z, center.y, 2.f * center.x);
|
doorVerts[7].assign(.2f * -center.z, center.y, 2.f * center.x);
|
||||||
|
|
||||||
CGraphicsCommitResources([](boo::IGraphicsDataFactory::Context& ctx)
|
CGraphics::CommitResources([](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
g_doorVbo = ctx.newStaticBuffer(boo::BufferUse::Vertex, skDoorVerts, 16, 8);
|
g_doorVbo = ctx.newStaticBuffer(boo::BufferUse::Vertex, skDoorVerts, 16, 8);
|
||||||
g_doorIbo = ctx.newStaticBuffer(boo::BufferUse::Index, DoorIndices, 4, 24);
|
g_doorIbo = ctx.newStaticBuffer(boo::BufferUse::Index, DoorIndices, 4, 24);
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMappableObject::Shutdown()
|
void CMappableObject::Shutdown()
|
||||||
|
|
|
@ -11,11 +11,6 @@
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
|
|
||||||
static const char* DecodeARAMFile(const char* name)
|
|
||||||
{
|
|
||||||
return (strncmp(name, "aram:", 5) == 0 ? name + 5 : name);
|
|
||||||
}
|
|
||||||
|
|
||||||
enum class ESeekOrigin
|
enum class ESeekOrigin
|
||||||
{
|
{
|
||||||
Begin = 0,
|
Begin = 0,
|
||||||
|
|
|
@ -54,7 +54,7 @@ CFactoryFnReturn CFactoryMgr::MakeObjectFromMemory(const SObjectTag& tag, std::u
|
||||||
{
|
{
|
||||||
std::unique_ptr<CInputStream> compRead =
|
std::unique_ptr<CInputStream> compRead =
|
||||||
std::make_unique<athena::io::MemoryReader>(localBuf.get(), size);
|
std::make_unique<athena::io::MemoryReader>(localBuf.get(), size);
|
||||||
u32 decompLen = compRead->readUint32Big();
|
compRead->readUint32Big();
|
||||||
CZipInputStream r(std::move(compRead));
|
CZipInputStream r(std::move(compRead));
|
||||||
return search->second(tag, r, paramXfer, selfRef);
|
return search->second(tag, r, paramXfer, selfRef);
|
||||||
}
|
}
|
||||||
|
|
|
@ -605,6 +605,7 @@ CHintOptions::CHintOptions(CBitStreamReader& stream)
|
||||||
u32 hintIdx = 0;
|
u32 hintIdx = 0;
|
||||||
for (const auto& hint : hints)
|
for (const auto& hint : hints)
|
||||||
{
|
{
|
||||||
|
(void)hint;
|
||||||
EHintState state = EHintState(stream.ReadEncoded(2));
|
EHintState state = EHintState(stream.ReadEncoded(2));
|
||||||
u32 timeBits = stream.ReadEncoded(32);
|
u32 timeBits = stream.ReadEncoded(32);
|
||||||
float time = reinterpret_cast<float&>(timeBits);
|
float time = reinterpret_cast<float&>(timeBits);
|
||||||
|
|
|
@ -160,7 +160,7 @@ CGameState::CGameState(CBitStreamReader& stream, u32 saveIdx)
|
||||||
|
|
||||||
for (u32 i = 0; i < 128; i++)
|
for (u32 i = 0; i < 128; i++)
|
||||||
x0_[i] = stream.ReadEncoded(8);
|
x0_[i] = stream.ReadEncoded(8);
|
||||||
u32 tsSeconds = stream.ReadEncoded(32);
|
//u32 tsSeconds = stream.ReadEncoded(32);
|
||||||
|
|
||||||
x228_24_hardMode = stream.ReadEncoded(1);
|
x228_24_hardMode = stream.ReadEncoded(1);
|
||||||
x228_25_initPowerupsAtFirstSpawn = stream.ReadEncoded(1);
|
x228_25_initPowerupsAtFirstSpawn = stream.ReadEncoded(1);
|
||||||
|
@ -173,7 +173,7 @@ CGameState::CGameState(CBitStreamReader& stream, u32 saveIdx)
|
||||||
xa0_playTime = conv.doub;
|
xa0_playTime = conv.doub;
|
||||||
|
|
||||||
x98_playerState = std::make_shared<CPlayerState>(stream);
|
x98_playerState = std::make_shared<CPlayerState>(stream);
|
||||||
float currentHealth = x98_playerState->GetHealthInfo().GetHP();
|
//float currentHealth = x98_playerState->GetHealthInfo().GetHP();
|
||||||
|
|
||||||
x17c_gameOptions = CGameOptions(stream);
|
x17c_gameOptions = CGameOptions(stream);
|
||||||
x1f8_hintOptions = CHintOptions(stream);
|
x1f8_hintOptions = CHintOptions(stream);
|
||||||
|
|
|
@ -33,11 +33,6 @@ public:
|
||||||
size_t GetNameHash() const { return m_nameHash; }
|
size_t GetNameHash() const { return m_nameHash; }
|
||||||
};
|
};
|
||||||
|
|
||||||
static bool operator==(std::shared_ptr<CIOWin> a, std::shared_ptr<CIOWin> b)
|
|
||||||
{
|
|
||||||
return a.get() == b.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // __URDE_CIOWIN_HPP__
|
#endif // __URDE_CIOWIN_HPP__
|
||||||
|
|
|
@ -83,7 +83,6 @@ add_library(RuntimeCommon
|
||||||
CResLoader.hpp CResLoader.cpp
|
CResLoader.hpp CResLoader.cpp
|
||||||
CDvdRequest.hpp
|
CDvdRequest.hpp
|
||||||
CDvdFile.hpp CDvdFile.cpp
|
CDvdFile.hpp CDvdFile.cpp
|
||||||
CVirtualDvdFile.hpp CVirtualDvdFile.cpp
|
|
||||||
IObjectStore.hpp
|
IObjectStore.hpp
|
||||||
CSimplePool.hpp CSimplePool.cpp
|
CSimplePool.hpp CSimplePool.cpp
|
||||||
CGameOptions.hpp CGameOptions.cpp
|
CGameOptions.hpp CGameOptions.cpp
|
||||||
|
@ -96,7 +95,7 @@ add_library(RuntimeCommon
|
||||||
GameObjectLists.hpp GameObjectLists.cpp
|
GameObjectLists.hpp GameObjectLists.cpp
|
||||||
CSortedLists.hpp CSortedLists.cpp
|
CSortedLists.hpp CSortedLists.cpp
|
||||||
CArchitectureMessage.hpp
|
CArchitectureMessage.hpp
|
||||||
CArchitectureQueue.hpp CArchitectureQueue.cpp
|
CArchitectureQueue.hpp
|
||||||
IObj.hpp
|
IObj.hpp
|
||||||
IVParamObj.hpp
|
IVParamObj.hpp
|
||||||
CTimeProvider.hpp CTimeProvider.cpp
|
CTimeProvider.hpp CTimeProvider.cpp
|
||||||
|
@ -109,7 +108,7 @@ add_library(RuntimeCommon
|
||||||
CMFGameBase.hpp
|
CMFGameBase.hpp
|
||||||
CInGameTweakManagerBase.hpp
|
CInGameTweakManagerBase.hpp
|
||||||
CPlayMovieBase.hpp
|
CPlayMovieBase.hpp
|
||||||
CGameDebug.hpp CGameDebug.cpp
|
CGameDebug.hpp
|
||||||
CGameHintInfo.hpp CGameHintInfo.cpp
|
CGameHintInfo.hpp CGameHintInfo.cpp
|
||||||
rstl.hpp
|
rstl.hpp
|
||||||
GameGlobalObjects.hpp GameGlobalObjects.cpp
|
GameGlobalObjects.hpp GameGlobalObjects.cpp
|
||||||
|
|
|
@ -64,6 +64,7 @@ public:
|
||||||
const_iterator cend() const { return const_iterator(*this, -1); }
|
const_iterator cend() const { return const_iterator(*this, -1); }
|
||||||
|
|
||||||
CObjectList(EGameObjectList listEnum);
|
CObjectList(EGameObjectList listEnum);
|
||||||
|
virtual ~CObjectList() = default;
|
||||||
|
|
||||||
void AddObject(CEntity& entity);
|
void AddObject(CEntity& entity);
|
||||||
void RemoveObject(TUniqueId uid);
|
void RemoveObject(TUniqueId uid);
|
||||||
|
|
|
@ -1208,7 +1208,7 @@ std::pair<std::multimap<TEditorId, TUniqueId>::const_iterator, std::multimap<TEd
|
||||||
CStateManager::GetIdListForScript(TEditorId id) const
|
CStateManager::GetIdListForScript(TEditorId id) const
|
||||||
{
|
{
|
||||||
auto ret = x890_scriptIdMap.equal_range(id);
|
auto ret = x890_scriptIdMap.equal_range(id);
|
||||||
if (ret.first->first != id)
|
if (ret.first != x890_scriptIdMap.cend() && ret.first->first != id)
|
||||||
ret.first = x890_scriptIdMap.cend();
|
ret.first = x890_scriptIdMap.cend();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,11 +149,11 @@ float CCameraShakeData::GetMaxFMComponent() const
|
||||||
CCameraShakeData CCameraShakeData::LoadCameraShakeData(CInputStream& in)
|
CCameraShakeData CCameraShakeData::LoadCameraShakeData(CInputStream& in)
|
||||||
{
|
{
|
||||||
float xMag = in.readFloatBig();
|
float xMag = in.readFloatBig();
|
||||||
float f2 = in.readFloatBig();
|
in.readFloatBig();
|
||||||
float yMag = in.readFloatBig();
|
float yMag = in.readFloatBig();
|
||||||
float f4 = in.readFloatBig();
|
in.readFloatBig();
|
||||||
float zMag = in.readFloatBig();
|
float zMag = in.readFloatBig();
|
||||||
float f6 = in.readFloatBig();
|
in.readFloatBig();
|
||||||
float duration = in.readFloatBig();
|
float duration = in.readFloatBig();
|
||||||
|
|
||||||
SCameraShakePoint xAM(0, 0.f, 0.f, duration, 2.f * xMag);
|
SCameraShakePoint xAM(0, 0.f, 0.f, duration, 2.f * xMag);
|
||||||
|
|
|
@ -10,8 +10,8 @@ namespace urde
|
||||||
|
|
||||||
void CABSAim::Start(CBodyController& bc, CStateManager& mgr)
|
void CABSAim::Start(CBodyController& bc, CStateManager& mgr)
|
||||||
{
|
{
|
||||||
const CBCAdditiveAimCmd* cmd =
|
//const CBCAdditiveAimCmd* cmd =
|
||||||
static_cast<const CBCAdditiveAimCmd*>(bc.GetCommandMgr().GetCmd(EBodyStateCmd::AdditiveAim));
|
// static_cast<const CBCAdditiveAimCmd*>(bc.GetCommandMgr().GetCmd(EBodyStateCmd::AdditiveAim));
|
||||||
const CPASAnimState* aimState = bc.GetPASDatabase().GetAnimState(22);
|
const CPASAnimState* aimState = bc.GetPASDatabase().GetAnimState(22);
|
||||||
|
|
||||||
// Left, Right, Up, Down
|
// Left, Right, Up, Down
|
||||||
|
|
|
@ -12,7 +12,7 @@ class CAnimPlaybackParms
|
||||||
s32 x4_animB = -1;
|
s32 x4_animB = -1;
|
||||||
float x8_blendWeight = 1.f;
|
float x8_blendWeight = 1.f;
|
||||||
bool xc_animating = true;
|
bool xc_animating = true;
|
||||||
s32 x10_ = 0;
|
//s32 x10_ = 0;
|
||||||
const zeus::CVector3f* x14_targetPos = nullptr;
|
const zeus::CVector3f* x14_targetPos = nullptr;
|
||||||
bool x18_useLocator = false;
|
bool x18_useLocator = false;
|
||||||
const zeus::CQuaternion* x1c_deltaOrient = nullptr;
|
const zeus::CQuaternion* x1c_deltaOrient = nullptr;
|
||||||
|
|
|
@ -68,6 +68,7 @@ public:
|
||||||
s32 VGetInt32POIState(const char* name) const;
|
s32 VGetInt32POIState(const char* name) const;
|
||||||
CParticleData::EParentedMode VGetParticlePOIState(const char* name) const;
|
CParticleData::EParentedMode VGetParticlePOIState(const char* name) const;
|
||||||
|
|
||||||
|
using IAnimReader::VGetOffset;
|
||||||
virtual zeus::CVector3f VGetOffset(const CSegId& seg, const CCharAnimTime& b) const=0;
|
virtual zeus::CVector3f VGetOffset(const CSegId& seg, const CCharAnimTime& b) const=0;
|
||||||
virtual bool VSupportsReverseView() const=0;
|
virtual bool VSupportsReverseView() const=0;
|
||||||
virtual SAdvancementResults VReverseView(const CCharAnimTime& time)=0;
|
virtual SAdvancementResults VReverseView(const CCharAnimTime& time)=0;
|
||||||
|
|
|
@ -7,7 +7,7 @@ namespace urde
|
||||||
{
|
{
|
||||||
class CAnimation;
|
class CAnimation;
|
||||||
|
|
||||||
class CAnimationDatabaseGame : public CAnimationDatabase
|
class CAnimationDatabaseGame final : public CAnimationDatabase
|
||||||
{
|
{
|
||||||
std::vector<std::shared_ptr<IMetaAnim>> x10_anims;
|
std::vector<std::shared_ptr<IMetaAnim>> x10_anims;
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -803,7 +803,7 @@ CMaterialList CGroundMovement::MoveObjectAnalytical(CStateManager& mgr, CPhysics
|
||||||
{
|
{
|
||||||
if (actor.x15c_force.canBeNormalized())
|
if (actor.x15c_force.canBeNormalized())
|
||||||
{
|
{
|
||||||
zeus::CVector3f prevForce = actor.x15c_force;
|
//zeus::CVector3f prevForce = actor.x15c_force;
|
||||||
actor.x15c_force = CGroundMovement::CollisionDamping(actor.x15c_force,
|
actor.x15c_force = CGroundMovement::CollisionDamping(actor.x15c_force,
|
||||||
actor.x15c_force.normalized(),
|
actor.x15c_force.normalized(),
|
||||||
collisionNorm, 0.f, 1.f);
|
collisionNorm, 0.f, 1.f);
|
||||||
|
|
|
@ -19,10 +19,10 @@ void CIkChain::Deactivate()
|
||||||
|
|
||||||
void CIkChain::Activate(const CAnimData& animData, const CSegId& segId, const zeus::CTransform& xf)
|
void CIkChain::Activate(const CAnimData& animData, const CSegId& segId, const zeus::CTransform& xf)
|
||||||
{
|
{
|
||||||
const CHierarchyPoseBuilder& posBuilder = animData.GetPoseBuilder();
|
//const CHierarchyPoseBuilder& posBuilder = animData.GetPoseBuilder();
|
||||||
x0_ = segId;
|
x0_ = segId;
|
||||||
|
|
||||||
const TLockedToken<CCharLayoutInfo>& info = posBuilder.CharLayoutInfo();
|
//const TLockedToken<CCharLayoutInfo>& info = posBuilder.CharLayoutInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CIkChain::Solve(zeus::CQuaternion& q1, zeus::CQuaternion& q2, const zeus::CVector3f& vec)
|
void CIkChain::Solve(zeus::CQuaternion& q1, zeus::CQuaternion& q2, const zeus::CVector3f& vec)
|
||||||
|
|
|
@ -18,7 +18,7 @@ set(CHARACTER_SOURCES
|
||||||
CCharLayoutInfo.hpp CCharLayoutInfo.cpp
|
CCharLayoutInfo.hpp CCharLayoutInfo.cpp
|
||||||
CLayoutDescription.hpp
|
CLayoutDescription.hpp
|
||||||
CSegIdList.hpp CSegIdList.cpp
|
CSegIdList.hpp CSegIdList.cpp
|
||||||
CSegId.hpp CSegId.cpp
|
CSegId.hpp
|
||||||
TSegIdMap.hpp
|
TSegIdMap.hpp
|
||||||
CIkChain.hpp CIkChain.cpp
|
CIkChain.hpp CIkChain.cpp
|
||||||
CSkinRules.hpp CSkinRules.cpp
|
CSkinRules.hpp CSkinRules.cpp
|
||||||
|
@ -30,7 +30,7 @@ set(CHARACTER_SOURCES
|
||||||
CPASAnimState.hpp CPASAnimState.cpp
|
CPASAnimState.hpp CPASAnimState.cpp
|
||||||
CPASParmInfo.hpp CPASParmInfo.cpp
|
CPASParmInfo.hpp CPASParmInfo.cpp
|
||||||
CPASAnimInfo.hpp CPASAnimInfo.cpp
|
CPASAnimInfo.hpp CPASAnimInfo.cpp
|
||||||
CPASAnimParm.hpp CPASAnimParm.cpp
|
CPASAnimParm.hpp
|
||||||
CPASAnimParmData.hpp CPASAnimParmData.cpp
|
CPASAnimParmData.hpp CPASAnimParmData.cpp
|
||||||
CEffectComponent.hpp CEffectComponent.cpp
|
CEffectComponent.hpp CEffectComponent.cpp
|
||||||
CAnimation.hpp CAnimation.cpp
|
CAnimation.hpp CAnimation.cpp
|
||||||
|
|
|
@ -22,7 +22,7 @@ std::shared_ptr<CAnimTreeNode>
|
||||||
CMetaAnimBlend::VGetAnimationTree(const CAnimSysContext& animSys,
|
CMetaAnimBlend::VGetAnimationTree(const CAnimSysContext& animSys,
|
||||||
const CMetaAnimTreeBuildOrders& orders) const
|
const CMetaAnimTreeBuildOrders& orders) const
|
||||||
{
|
{
|
||||||
CMetaAnimTreeBuildOrders buildOrders = CMetaAnimTreeBuildOrders::NoSpecialOrders();
|
//CMetaAnimTreeBuildOrders buildOrders = CMetaAnimTreeBuildOrders::NoSpecialOrders();
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,7 @@ CSequenceFundamentals CSequenceHelper::ComputeSequenceFundamentals()
|
||||||
auto simp = node->Simplified();
|
auto simp = node->Simplified();
|
||||||
if (simp)
|
if (simp)
|
||||||
node = CAnimTreeNode::Cast(std::move(*simp));
|
node = CAnimTreeNode::Cast(std::move(*simp));
|
||||||
CCharAnimTime prevRemTime = remTime;
|
//CCharAnimTime prevRemTime = remTime;
|
||||||
remTime = res.x0_remTime;
|
remTime = res.x0_remTime;
|
||||||
/* This was originally accumulating uninitialized register values (stack variable misuse?) */
|
/* This was originally accumulating uninitialized register values (stack variable misuse?) */
|
||||||
offset += res.x8_deltas.x0_posDelta;
|
offset += res.x8_deltas.x0_posDelta;
|
||||||
|
|
|
@ -8,7 +8,7 @@ namespace urde
|
||||||
class CTransition;
|
class CTransition;
|
||||||
class CHalfTransition;
|
class CHalfTransition;
|
||||||
|
|
||||||
class CTransitionDatabaseGame : public CTransitionDatabase
|
class CTransitionDatabaseGame final : public CTransitionDatabase
|
||||||
{
|
{
|
||||||
std::shared_ptr<IMetaTrans> x10_defaultTrans;
|
std::shared_ptr<IMetaTrans> x10_defaultTrans;
|
||||||
std::vector<std::pair<std::pair<u32, u32>, std::shared_ptr<IMetaTrans>>> x14_transitions;
|
std::vector<std::pair<std::pair<u32, u32>, std::shared_ptr<IMetaTrans>>> x14_transitions;
|
||||||
|
|
|
@ -27,6 +27,7 @@ class CPreAdvanceIndicator
|
||||||
bool x0_isTime;
|
bool x0_isTime;
|
||||||
CCharAnimTime x4_time;
|
CCharAnimTime x4_time;
|
||||||
const char* xc_string;
|
const char* xc_string;
|
||||||
|
/*
|
||||||
u32 x10_;
|
u32 x10_;
|
||||||
u32 x14_;
|
u32 x14_;
|
||||||
u32 x18_;
|
u32 x18_;
|
||||||
|
@ -39,6 +40,7 @@ class CPreAdvanceIndicator
|
||||||
u32 x34_;
|
u32 x34_;
|
||||||
u32 x38_;
|
u32 x38_;
|
||||||
u16 x3c_;
|
u16 x3c_;
|
||||||
|
*/
|
||||||
public:
|
public:
|
||||||
CPreAdvanceIndicator(const CCharAnimTime& time)
|
CPreAdvanceIndicator(const CCharAnimTime& time)
|
||||||
: x0_isTime(true), x4_time(time) {}
|
: x0_isTime(true), x4_time(time) {}
|
||||||
|
|
|
@ -102,7 +102,7 @@ const CDamageVulnerability* CCollisionActor::GetDamageVulnerability(const zeus::
|
||||||
|
|
||||||
void CCollisionActor::SetDamageVulnerability(const CDamageVulnerability& vuln) { x294_damageVuln = vuln; }
|
void CCollisionActor::SetDamageVulnerability(const CDamageVulnerability& vuln) { x294_damageVuln = vuln; }
|
||||||
|
|
||||||
zeus::CVector3f CCollisionActor::GetScanObjectIndicatorPosition(const CStateManager& mgr)
|
zeus::CVector3f CCollisionActor::GetScanObjectIndicatorPosition(const CStateManager& mgr) const
|
||||||
{
|
{
|
||||||
const CGameCamera* gameCamera = static_cast<const CGameCamera*>(mgr.GetCameraManager()->GetCurrentCamera(mgr));
|
const CGameCamera* gameCamera = static_cast<const CGameCamera*>(mgr.GetCameraManager()->GetCurrentCamera(mgr));
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ public:
|
||||||
const zeus::CVector3f& GetBoxSize() const { return x260_boxSize; }
|
const zeus::CVector3f& GetBoxSize() const { return x260_boxSize; }
|
||||||
TUniqueId GetOwnerId() const { return x25c_owner; }
|
TUniqueId GetOwnerId() const { return x25c_owner; }
|
||||||
TUniqueId GetLastTouchedObject() const { return x2fc_lastTouched; }
|
TUniqueId GetLastTouchedObject() const { return x2fc_lastTouched; }
|
||||||
zeus::CVector3f GetScanObjectIndicatorPosition(const CStateManager &);
|
zeus::CVector3f GetScanObjectIndicatorPosition(const CStateManager &) const;
|
||||||
void SetExtendedTouchBounds(const zeus::CVector3f& boundExt) { x304_extendedTouchBounds = boundExt; }
|
void SetExtendedTouchBounds(const zeus::CVector3f& boundExt) { x304_extendedTouchBounds = boundExt; }
|
||||||
float GetSphereRadius() const { return x288_sphereRadius; }
|
float GetSphereRadius() const { return x288_sphereRadius; }
|
||||||
};
|
};
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
#include "CInternalRayCastStructure.hpp"
|
|
|
@ -4,7 +4,7 @@ set(COLLISION_SOURCES
|
||||||
CGameCollision.hpp CGameCollision.cpp
|
CGameCollision.hpp CGameCollision.cpp
|
||||||
CCollisionResponseData.hpp CCollisionResponseData.cpp
|
CCollisionResponseData.hpp CCollisionResponseData.cpp
|
||||||
CCollisionInfo.hpp CCollisionInfo.cpp
|
CCollisionInfo.hpp CCollisionInfo.cpp
|
||||||
CCollisionInfoList.hpp CCollisionInfoList.cpp
|
CCollisionInfoList.hpp
|
||||||
CCollisionEdge.hpp CCollisionEdge.cpp
|
CCollisionEdge.hpp CCollisionEdge.cpp
|
||||||
CCollisionSurface.hpp CCollisionSurface.cpp
|
CCollisionSurface.hpp CCollisionSurface.cpp
|
||||||
InternalColliders.hpp InternalColliders.cpp
|
InternalColliders.hpp InternalColliders.cpp
|
||||||
|
@ -18,7 +18,7 @@ set(COLLISION_SOURCES
|
||||||
CCollisionPrimitive.hpp CCollisionPrimitive.cpp
|
CCollisionPrimitive.hpp CCollisionPrimitive.cpp
|
||||||
CMaterialList.hpp
|
CMaterialList.hpp
|
||||||
CMaterialFilter.hpp CMaterialFilter.cpp
|
CMaterialFilter.hpp CMaterialFilter.cpp
|
||||||
CInternalRayCastStructure.hpp CInternalRayCastStructure.cpp
|
CInternalRayCastStructure.hpp
|
||||||
CRayCastResult.hpp CRayCastResult.cpp
|
CRayCastResult.hpp CRayCastResult.cpp
|
||||||
CCollisionActor.hpp CCollisionActor.cpp
|
CCollisionActor.hpp CCollisionActor.cpp
|
||||||
CCollisionActorManager.hpp CCollisionActorManager.cpp
|
CCollisionActorManager.hpp CCollisionActorManager.cpp
|
||||||
|
|
|
@ -712,7 +712,7 @@ CBooRenderer::CBooRenderer(IObjectStore& store, IFactory& resFac)
|
||||||
|
|
||||||
m_staticEntropy = store.GetObj("RandomStaticEntropy");
|
m_staticEntropy = store.GetObj("RandomStaticEntropy");
|
||||||
|
|
||||||
CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
GenerateFogVolumeRampTex(ctx);
|
GenerateFogVolumeRampTex(ctx);
|
||||||
GenerateSphereRampTex(ctx);
|
GenerateSphereRampTex(ctx);
|
||||||
|
@ -720,7 +720,7 @@ CBooRenderer::CBooRenderer(IObjectStore& store, IFactory& resFac)
|
||||||
x14c_reflectionTex = ctx.newRenderTexture(256, 256, boo::TextureClampMode::Repeat, 1, 0);
|
x14c_reflectionTex = ctx.newRenderTexture(256, 256, boo::TextureClampMode::Repeat, 1, 0);
|
||||||
GenerateScanLinesVBO(ctx);
|
GenerateScanLinesVBO(ctx);
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
LoadThermoPalette();
|
LoadThermoPalette();
|
||||||
LoadBallFade();
|
LoadBallFade();
|
||||||
m_thermHotFilter.emplace();
|
m_thermHotFilter.emplace();
|
||||||
|
|
|
@ -168,7 +168,7 @@ static const zeus::CMatrix4f PlusOneZ(1.f, 0.f, 0.f, 0.f,
|
||||||
|
|
||||||
static const zeus::CMatrix4f VulkanCorrect(1.f, 0.f, 0.f, 0.f,
|
static const zeus::CMatrix4f VulkanCorrect(1.f, 0.f, 0.f, 0.f,
|
||||||
0.f, -1.f, 0.f, 0.f,
|
0.f, -1.f, 0.f, 0.f,
|
||||||
0.f, 0.f, 0.5f, 0.5f,
|
0.f, 0.f, 0.5f, 0.5f + FLT_EPSILON,
|
||||||
0.f, 0.f, 0.f, 1.f);
|
0.f, 0.f, 0.f, 1.f);
|
||||||
|
|
||||||
zeus::CMatrix4f CGraphics::CalculatePerspectiveMatrix(float fovy, float aspect,
|
zeus::CMatrix4f CGraphics::CalculatePerspectiveMatrix(float fovy, float aspect,
|
||||||
|
@ -210,7 +210,6 @@ zeus::CMatrix4f CGraphics::CalculatePerspectiveMatrix(float fovy, float aspect,
|
||||||
0.f, 0.f, -1.f, 0.f);
|
0.f, 0.f, -1.f, 0.f);
|
||||||
}
|
}
|
||||||
case boo::IGraphicsDataFactory::Platform::D3D11:
|
case boo::IGraphicsDataFactory::Platform::D3D11:
|
||||||
case boo::IGraphicsDataFactory::Platform::D3D12:
|
|
||||||
case boo::IGraphicsDataFactory::Platform::Metal:
|
case boo::IGraphicsDataFactory::Platform::Metal:
|
||||||
{
|
{
|
||||||
zeus::CMatrix4f mat2(2.f * st.x14_near / rml, 0.f, rpl / rml, 0.f,
|
zeus::CMatrix4f mat2(2.f * st.x14_near / rml, 0.f, rpl / rml, 0.f,
|
||||||
|
@ -260,7 +259,6 @@ zeus::CMatrix4f CGraphics::GetPerspectiveProjectionMatrix(bool forRenderer)
|
||||||
0.f, 0.f, -1.f, 0.f);
|
0.f, 0.f, -1.f, 0.f);
|
||||||
}
|
}
|
||||||
case boo::IGraphicsDataFactory::Platform::D3D11:
|
case boo::IGraphicsDataFactory::Platform::D3D11:
|
||||||
case boo::IGraphicsDataFactory::Platform::D3D12:
|
|
||||||
case boo::IGraphicsDataFactory::Platform::Metal:
|
case boo::IGraphicsDataFactory::Platform::Metal:
|
||||||
{
|
{
|
||||||
zeus::CMatrix4f mat2(2.f * g_Proj.x14_near / rml, 0.f, rpl / rml, 0.f,
|
zeus::CMatrix4f mat2(2.f * g_Proj.x14_near / rml, 0.f, rpl / rml, 0.f,
|
||||||
|
@ -307,7 +305,6 @@ zeus::CMatrix4f CGraphics::GetPerspectiveProjectionMatrix(bool forRenderer)
|
||||||
0.f, 0.f, 0.f, 1.f);
|
0.f, 0.f, 0.f, 1.f);
|
||||||
}
|
}
|
||||||
case boo::IGraphicsDataFactory::Platform::D3D11:
|
case boo::IGraphicsDataFactory::Platform::D3D11:
|
||||||
case boo::IGraphicsDataFactory::Platform::D3D12:
|
|
||||||
case boo::IGraphicsDataFactory::Platform::Metal:
|
case boo::IGraphicsDataFactory::Platform::Metal:
|
||||||
{
|
{
|
||||||
zeus::CMatrix4f mat2(2.f / rml, 0.f, 0.f, -rpl / rml,
|
zeus::CMatrix4f mat2(2.f / rml, 0.f, 0.f, -rpl / rml,
|
||||||
|
@ -427,8 +424,8 @@ SClipScreenRect CGraphics::ClipScreenRectFromVS(const zeus::CVector3f& p1,
|
||||||
if (maxX2 <= 0 /* ViewportX origin */)
|
if (maxX2 <= 0 /* ViewportX origin */)
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
int finalMinX = std::max(minX, 0 /* ViewportX origin */);
|
//int finalMinX = std::max(minX, 0 /* ViewportX origin */);
|
||||||
int finalMaxX = std::min(maxX, int(g_Viewport.x8_width));
|
//int finalMaxX = std::min(maxX, int(g_Viewport.x8_width));
|
||||||
|
|
||||||
|
|
||||||
if (minY2 >= g_Viewport.xc_height)
|
if (minY2 >= g_Viewport.xc_height)
|
||||||
|
@ -439,8 +436,8 @@ SClipScreenRect CGraphics::ClipScreenRectFromVS(const zeus::CVector3f& p1,
|
||||||
if (maxY2 <= 0 /* ViewportY origin */)
|
if (maxY2 <= 0 /* ViewportY origin */)
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
int finalMinY = std::max(minY, 0 /* ViewportY origin */);
|
//int finalMinY = std::max(minY, 0 /* ViewportY origin */);
|
||||||
int finalMaxY = std::min(maxY, int(g_Viewport.xc_height));
|
//int finalMaxY = std::min(maxY, int(g_Viewport.xc_height));
|
||||||
|
|
||||||
int width = maxX2 - minX2;
|
int width = maxX2 - minX2;
|
||||||
int height = maxY2 - minY2;
|
int height = maxY2 - minY2;
|
||||||
|
@ -453,7 +450,7 @@ SClipScreenRect CGraphics::ClipScreenRectFromVS(const zeus::CVector3f& p1,
|
||||||
zeus::CVector3f CGraphics::ProjectModelPointToViewportSpace(const zeus::CVector3f& point)
|
zeus::CVector3f CGraphics::ProjectModelPointToViewportSpace(const zeus::CVector3f& point)
|
||||||
{
|
{
|
||||||
zeus::CVector3f pt = g_GXModelView * point;
|
zeus::CVector3f pt = g_GXModelView * point;
|
||||||
return GetPerspectiveProjectionMatrix(false).multiplyOneOverW(pt);
|
return GetPerspectiveProjectionMatrix(true).multiplyOneOverW(pt);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGraphics::SetViewportResolution(const zeus::CVector2i& res)
|
void CGraphics::SetViewportResolution(const zeus::CVector2i& res)
|
||||||
|
|
|
@ -339,12 +339,6 @@ public:
|
||||||
g_BooFactory->commitTransaction(commitFunc __BooTraceArgsUse);
|
g_BooFactory->commitTransaction(commitFunc __BooTraceArgsUse);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NDEBUG
|
|
||||||
#define CGraphicsCommitResources(...) CGraphics::CommitResources(__VA_ARGS__, __FILE__, __LINE__)
|
|
||||||
#else
|
|
||||||
#define CGraphicsCommitResources(...) CGraphics::CommitResources(__VA_ARGS__)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void SetShaderDataBinding(const boo::ObjToken<boo::IShaderDataBinding>& binding)
|
static void SetShaderDataBinding(const boo::ObjToken<boo::IShaderDataBinding>& binding)
|
||||||
{
|
{
|
||||||
g_BooMainCommandQueue->setShaderDataBinding(binding);
|
g_BooMainCommandQueue->setShaderDataBinding(binding);
|
||||||
|
|
|
@ -32,7 +32,6 @@ public:
|
||||||
u16 w = in.readUint16Big();
|
u16 w = in.readUint16Big();
|
||||||
u16 h = in.readUint16Big();
|
u16 h = in.readUint16Big();
|
||||||
x8_entryCount = w * h;
|
x8_entryCount = w * h;
|
||||||
xc_entries[x8_entryCount];
|
|
||||||
|
|
||||||
/* GX Tlut init here */
|
/* GX Tlut init here */
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,11 +92,11 @@ CLineRenderer::CLineRenderer(EPrimitiveMode mode, u32 maxVerts,
|
||||||
|
|
||||||
m_uniformBuf = s_uniformPool.allocateBlock(CGraphics::g_BooFactory);
|
m_uniformBuf = s_uniformPool.allocateBlock(CGraphics::g_BooFactory);
|
||||||
|
|
||||||
CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
CLineRendererShaders::BuildShaderDataBinding(ctx, *this, texture, additive, zTest, zGEqual);
|
CLineRendererShaders::BuildShaderDataBinding(ctx, *this, texture, additive, zTest, zGEqual);
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
rstl::reserved_vector<CLineRenderer::SDrawVertTex, 1024> CLineRenderer::g_StaticLineVertsTex = {};
|
rstl::reserved_vector<CLineRenderer::SDrawVertTex, 1024> CLineRenderer::g_StaticLineVertsTex = {};
|
||||||
|
|
|
@ -84,8 +84,8 @@ set(GRAPHICS_SOURCES
|
||||||
IRenderer.hpp
|
IRenderer.hpp
|
||||||
IWeaponRenderer.hpp IWeaponRenderer.cpp
|
IWeaponRenderer.hpp IWeaponRenderer.cpp
|
||||||
CBooRenderer.hpp CBooRenderer.cpp
|
CBooRenderer.hpp CBooRenderer.cpp
|
||||||
CDrawable.hpp CDrawable.cpp
|
CDrawable.hpp
|
||||||
CDrawablePlaneObject.hpp CDrawablePlaneObject.cpp
|
CDrawablePlaneObject.hpp
|
||||||
CLineRenderer.hpp CLineRenderer.cpp
|
CLineRenderer.hpp CLineRenderer.cpp
|
||||||
CMetroidModelInstance.hpp
|
CMetroidModelInstance.hpp
|
||||||
CLight.hpp CLight.cpp
|
CLight.hpp CLight.cpp
|
||||||
|
@ -94,7 +94,7 @@ set(GRAPHICS_SOURCES
|
||||||
CSkinnedModel.hpp CSkinnedModel.cpp
|
CSkinnedModel.hpp CSkinnedModel.cpp
|
||||||
CVertexMorphEffect.hpp CVertexMorphEffect.cpp
|
CVertexMorphEffect.hpp CVertexMorphEffect.cpp
|
||||||
CMoviePlayer.hpp CMoviePlayer.cpp
|
CMoviePlayer.hpp CMoviePlayer.cpp
|
||||||
CGraphicsPalette.hpp CGraphicsPalette.cpp
|
CGraphicsPalette.hpp
|
||||||
CPVSVisSet.hpp CPVSVisSet.cpp
|
CPVSVisSet.hpp CPVSVisSet.cpp
|
||||||
CPVSVisOctree.hpp CPVSVisOctree.cpp
|
CPVSVisOctree.hpp CPVSVisOctree.cpp
|
||||||
CPVSAreaSet.hpp CPVSAreaSet.cpp
|
CPVSAreaSet.hpp CPVSAreaSet.cpp
|
||||||
|
|
|
@ -269,6 +269,7 @@ GeometryUniformLayout::GeometryUniformLayout(const CModel* model, const Material
|
||||||
/* Animated UV transform matrices */
|
/* Animated UV transform matrices */
|
||||||
for (const MaterialSet::Material& mat : matSet->materials)
|
for (const MaterialSet::Material& mat : matSet->materials)
|
||||||
{
|
{
|
||||||
|
(void)mat;
|
||||||
size_t thisSz = ROUND_UP_256(/*mat.uvAnims.size()*/ 8 * (sizeof(zeus::CMatrix4f) * 2));
|
size_t thisSz = ROUND_UP_256(/*mat.uvAnims.size()*/ 8 * (sizeof(zeus::CMatrix4f) * 2));
|
||||||
m_uvOffs.push_back(m_geomBufferSize);
|
m_uvOffs.push_back(m_geomBufferSize);
|
||||||
m_uvSizes.push_back(thisSz);
|
m_uvSizes.push_back(thisSz);
|
||||||
|
@ -286,7 +287,7 @@ CBooModel::ModelInstance* CBooModel::PushNewModelInstance(int sharedLayoutBuf)
|
||||||
m_instances.emplace_back();
|
m_instances.emplace_back();
|
||||||
ModelInstance& newInst = m_instances.back();
|
ModelInstance& newInst = m_instances.back();
|
||||||
|
|
||||||
CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
/* Build geometry uniform buffer if shared not available */
|
/* Build geometry uniform buffer if shared not available */
|
||||||
boo::ObjToken<boo::IGraphicsBufferD> geomUniformBuf;
|
boo::ObjToken<boo::IGraphicsBufferD> geomUniformBuf;
|
||||||
|
@ -460,7 +461,7 @@ CBooModel::ModelInstance* CBooModel::PushNewModelInstance(int sharedLayoutBuf)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
|
|
||||||
return &newInst;
|
return &newInst;
|
||||||
}
|
}
|
||||||
|
@ -870,6 +871,7 @@ void CBooModel::UVAnimationBuffer::Update(u8*& bufOut, const MaterialSet* matSet
|
||||||
-flags.mbShadowBox.min.z) * CGraphics::g_GXModelView).toMatrix4f();
|
-flags.mbShadowBox.min.z) * CGraphics::g_GXModelView).toMatrix4f();
|
||||||
for (const MaterialSet::Material& mat : matSet->materials)
|
for (const MaterialSet::Material& mat : matSet->materials)
|
||||||
{
|
{
|
||||||
|
(void)mat;
|
||||||
std::array<zeus::CMatrix4f, 2>* mtxs = reinterpret_cast<std::array<zeus::CMatrix4f, 2>*>(bufOut);
|
std::array<zeus::CMatrix4f, 2>* mtxs = reinterpret_cast<std::array<zeus::CMatrix4f, 2>*>(bufOut);
|
||||||
mtxs[0][0] = texMtx;
|
mtxs[0][0] = texMtx;
|
||||||
mtxs[0][1] = MBShadowPost0;
|
mtxs[0][1] = MBShadowPost0;
|
||||||
|
@ -1280,7 +1282,7 @@ CModel::CModel(std::unique_ptr<u8[]>&& in, u32 /* dataLen */, IObjectStore* stor
|
||||||
matSet.BuildShaders(m_hmdlMeta);
|
matSet.BuildShaders(m_hmdlMeta);
|
||||||
}
|
}
|
||||||
|
|
||||||
CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
/* Index buffer is always static */
|
/* Index buffer is always static */
|
||||||
if (m_hmdlMeta.indexCount)
|
if (m_hmdlMeta.indexCount)
|
||||||
|
@ -1306,7 +1308,7 @@ CModel::CModel(std::unique_ptr<u8[]>&& in, u32 /* dataLen */, IObjectStore* stor
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
|
|
||||||
u32 surfCount = hecl::SBig(*reinterpret_cast<const u32*>(surfInfo));
|
u32 surfCount = hecl::SBig(*reinterpret_cast<const u32*>(surfInfo));
|
||||||
x8_surfaces.reserve(surfCount);
|
x8_surfaces.reserve(surfCount);
|
||||||
|
|
|
@ -57,6 +57,7 @@ BOO_GLSL_BINDING_HEAD
|
||||||
" yuv.r+2.017*yuv.g, 1.0) * vtf.color;\n"
|
" yuv.r+2.017*yuv.g, 1.0) * vtf.color;\n"
|
||||||
"}\n";
|
"}\n";
|
||||||
|
|
||||||
|
#if _WIN32
|
||||||
static const char* VS_HLSL_YUV =
|
static const char* VS_HLSL_YUV =
|
||||||
"struct VertData\n"
|
"struct VertData\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
|
@ -101,7 +102,9 @@ static const char* FS_HLSL_YUV =
|
||||||
" yuv.r-0.39173*yuv.g-0.81290*yuv.b,\n"
|
" yuv.r-0.39173*yuv.g-0.81290*yuv.b,\n"
|
||||||
" yuv.r+2.017*yuv.g, 1.0) * vtf.color;\n"
|
" yuv.r+2.017*yuv.g, 1.0) * vtf.color;\n"
|
||||||
"}\n";
|
"}\n";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if BOO_HAS_METAL
|
||||||
static const char* VS_METAL_YUV =
|
static const char* VS_METAL_YUV =
|
||||||
"#include <metal_stdlib>\n"
|
"#include <metal_stdlib>\n"
|
||||||
"using namespace metal;\n"
|
"using namespace metal;\n"
|
||||||
|
@ -152,6 +155,7 @@ static const char* FS_METAL_YUV =
|
||||||
" yuv.r-0.39173*yuv.g-0.81290*yuv.b,\n"
|
" yuv.r-0.39173*yuv.g-0.81290*yuv.b,\n"
|
||||||
" yuv.r+2.017*yuv.g, 1.0) * vtf.color;\n"
|
" yuv.r+2.017*yuv.g, 1.0) * vtf.color;\n"
|
||||||
"}\n";
|
"}\n";
|
||||||
|
#endif
|
||||||
|
|
||||||
/* used in the original to look up fixed-point dividends on a
|
/* used in the original to look up fixed-point dividends on a
|
||||||
* MIDI-style volume scale (0-127) -> (n/0x8000) */
|
* MIDI-style volume scale (0-127) -> (n/0x8000) */
|
||||||
|
@ -198,7 +202,7 @@ static const char* TexNames[] = {"texY", "texU", "texV"};
|
||||||
|
|
||||||
void CMoviePlayer::Initialize()
|
void CMoviePlayer::Initialize()
|
||||||
{
|
{
|
||||||
CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
if (!ctx.bindingNeedsVertexFormat())
|
if (!ctx.bindingNeedsVertexFormat())
|
||||||
{
|
{
|
||||||
|
@ -222,8 +226,7 @@ void CMoviePlayer::Initialize()
|
||||||
#endif
|
#endif
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
case boo::IGraphicsDataFactory::Platform::D3D11:
|
case boo::IGraphicsDataFactory::Platform::D3D11:
|
||||||
case boo::IGraphicsDataFactory::Platform::D3D12:
|
YUVShaderPipeline = static_cast<boo::D3DDataFactory::Context&>(ctx).newShaderPipeline
|
||||||
YUVShaderPipeline = static_cast<boo::ID3DDataFactory::Context&>(ctx).newShaderPipeline
|
|
||||||
(VS_HLSL_YUV, FS_HLSL_YUV, nullptr, nullptr, nullptr, YUVVTXFmt,
|
(VS_HLSL_YUV, FS_HLSL_YUV, nullptr, nullptr, nullptr, YUVVTXFmt,
|
||||||
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
||||||
boo::Primitive::TriStrips, boo::ZTest::None, false, true, false, boo::CullMode::None);
|
boo::Primitive::TriStrips, boo::ZTest::None, false, true, false, boo::CullMode::None);
|
||||||
|
@ -248,7 +251,7 @@ void CMoviePlayer::Initialize()
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
|
|
||||||
TjHandle = tjInitDecompress();
|
TjHandle = tjInitDecompress();
|
||||||
}
|
}
|
||||||
|
@ -426,7 +429,7 @@ CMoviePlayer::CMoviePlayer(const char* path, float preLoadSeconds, bool loop, bo
|
||||||
xa0_bufferQueue.reserve(xf0_preLoadFrames);
|
xa0_bufferQueue.reserve(xf0_preLoadFrames);
|
||||||
|
|
||||||
/* All set for GPU resources */
|
/* All set for GPU resources */
|
||||||
CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
m_blockBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(m_viewVertBlock), 1);
|
m_blockBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(m_viewVertBlock), 1);
|
||||||
m_vertBuf = ctx.newDynamicBuffer(boo::BufferUse::Vertex, sizeof(specter::View::TexShaderVert), 4);
|
m_vertBuf = ctx.newDynamicBuffer(boo::BufferUse::Vertex, sizeof(specter::View::TexShaderVert), 4);
|
||||||
|
@ -489,7 +492,7 @@ CMoviePlayer::CMoviePlayer(const char* path, float preLoadSeconds, bool loop, bo
|
||||||
set.audioBuf.reset(new s16[x28_thpHead.maxAudioSamples * 2]);
|
set.audioBuf.reset(new s16[x28_thpHead.maxAudioSamples * 2]);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
|
|
||||||
/* Temporary planar YUV decode buffer, resulting planes copied to Boo */
|
/* Temporary planar YUV decode buffer, resulting planes copied to Boo */
|
||||||
m_yuvBuf.reset(new uint8_t[tjBufSizeYUV(x6c_videoInfo.width, x6c_videoInfo.height, TJ_420)]);
|
m_yuvBuf.reset(new uint8_t[tjBufSizeYUV(x6c_videoInfo.width, x6c_videoInfo.height, TJ_420)]);
|
||||||
|
|
|
@ -14,12 +14,12 @@ CRainSplashGenerator::CRainSplashGenerator(const zeus::CVector3f& scale, u32 max
|
||||||
x48_24 = false;
|
x48_24 = false;
|
||||||
x48_25_raining = true;
|
x48_25_raining = true;
|
||||||
x0_rainSplashes.reserve(maxSplashes);
|
x0_rainSplashes.reserve(maxSplashes);
|
||||||
CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
for (int i=0 ; i<maxSplashes ; ++i)
|
for (int i=0 ; i<maxSplashes ; ++i)
|
||||||
x0_rainSplashes.emplace_back(ctx);
|
x0_rainSplashes.emplace_back(ctx);
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CRainSplashGenerator::SSplashLine::Draw(float alpha, float dt, const zeus::CVector3f& pos) const
|
void CRainSplashGenerator::SSplashLine::Draw(float alpha, float dt, const zeus::CVector3f& pos) const
|
||||||
|
|
|
@ -112,12 +112,12 @@ void CTexture::BuildI4FromGCN(CInputStream& in)
|
||||||
h /= 2;
|
h /= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::RGBA8,
|
m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::RGBA8,
|
||||||
boo::TextureClampMode::Repeat, buf.get(), texelCount * 4).get();
|
boo::TextureClampMode::Repeat, buf.get(), texelCount * 4).get();
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTexture::BuildI8FromGCN(CInputStream& in)
|
void CTexture::BuildI8FromGCN(CInputStream& in)
|
||||||
|
@ -160,12 +160,12 @@ void CTexture::BuildI8FromGCN(CInputStream& in)
|
||||||
h /= 2;
|
h /= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::RGBA8,
|
m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::RGBA8,
|
||||||
boo::TextureClampMode::Repeat, buf.get(), texelCount * 4).get();
|
boo::TextureClampMode::Repeat, buf.get(), texelCount * 4).get();
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTexture::BuildIA4FromGCN(CInputStream& in)
|
void CTexture::BuildIA4FromGCN(CInputStream& in)
|
||||||
|
@ -209,12 +209,12 @@ void CTexture::BuildIA4FromGCN(CInputStream& in)
|
||||||
h /= 2;
|
h /= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::RGBA8,
|
m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::RGBA8,
|
||||||
boo::TextureClampMode::Repeat, buf.get(), texelCount * 4).get();
|
boo::TextureClampMode::Repeat, buf.get(), texelCount * 4).get();
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTexture::BuildIA8FromGCN(CInputStream& in)
|
void CTexture::BuildIA8FromGCN(CInputStream& in)
|
||||||
|
@ -258,12 +258,12 @@ void CTexture::BuildIA8FromGCN(CInputStream& in)
|
||||||
h /= 2;
|
h /= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::RGBA8,
|
m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::RGBA8,
|
||||||
boo::TextureClampMode::Repeat, buf.get(), texelCount * 4).get();
|
boo::TextureClampMode::Repeat, buf.get(), texelCount * 4).get();
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::vector<RGBA8> DecodePalette(int numEntries, CInputStream& in)
|
static std::vector<RGBA8> DecodePalette(int numEntries, CInputStream& in)
|
||||||
|
@ -366,12 +366,12 @@ void CTexture::BuildC4FromGCN(CInputStream& in)
|
||||||
h /= 2;
|
h /= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::RGBA8,
|
m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::RGBA8,
|
||||||
boo::TextureClampMode::Repeat, buf.get(), texelCount * 4).get();
|
boo::TextureClampMode::Repeat, buf.get(), texelCount * 4).get();
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTexture::BuildC8FromGCN(CInputStream& in)
|
void CTexture::BuildC8FromGCN(CInputStream& in)
|
||||||
|
@ -410,12 +410,12 @@ void CTexture::BuildC8FromGCN(CInputStream& in)
|
||||||
h /= 2;
|
h /= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::RGBA8,
|
m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::RGBA8,
|
||||||
boo::TextureClampMode::Repeat, buf.get(), texelCount * 4).get();
|
boo::TextureClampMode::Repeat, buf.get(), texelCount * 4).get();
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTexture::BuildC14X2FromGCN(CInputStream& in)
|
void CTexture::BuildC14X2FromGCN(CInputStream& in)
|
||||||
|
@ -462,12 +462,12 @@ void CTexture::BuildRGB565FromGCN(CInputStream& in)
|
||||||
h /= 2;
|
h /= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::RGBA8,
|
m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::RGBA8,
|
||||||
boo::TextureClampMode::Repeat, buf.get(), texelCount * 4).get();
|
boo::TextureClampMode::Repeat, buf.get(), texelCount * 4).get();
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTexture::BuildRGB5A3FromGCN(CInputStream& in)
|
void CTexture::BuildRGB5A3FromGCN(CInputStream& in)
|
||||||
|
@ -519,12 +519,12 @@ void CTexture::BuildRGB5A3FromGCN(CInputStream& in)
|
||||||
h /= 2;
|
h /= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::RGBA8,
|
m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::RGBA8,
|
||||||
boo::TextureClampMode::Repeat, buf.get(), texelCount * 4).get();
|
boo::TextureClampMode::Repeat, buf.get(), texelCount * 4).get();
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTexture::BuildRGBA8FromGCN(CInputStream& in)
|
void CTexture::BuildRGBA8FromGCN(CInputStream& in)
|
||||||
|
@ -576,12 +576,12 @@ void CTexture::BuildRGBA8FromGCN(CInputStream& in)
|
||||||
h /= 2;
|
h /= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::RGBA8,
|
m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::RGBA8,
|
||||||
boo::TextureClampMode::Repeat, buf.get(), texelCount * 4).get();
|
boo::TextureClampMode::Repeat, buf.get(), texelCount * 4).get();
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct DXT1Block
|
struct DXT1Block
|
||||||
|
@ -640,12 +640,12 @@ void CTexture::BuildDXT1FromGCN(CInputStream& in)
|
||||||
h /= 2;
|
h /= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::DXT1,
|
m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::DXT1,
|
||||||
boo::TextureClampMode::Repeat, buf.get(), blockCount * 8).get();
|
boo::TextureClampMode::Repeat, buf.get(), blockCount * 8).get();
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTexture::BuildRGBA8(const void* data, size_t length)
|
void CTexture::BuildRGBA8(const void* data, size_t length)
|
||||||
|
@ -656,12 +656,12 @@ void CTexture::BuildRGBA8(const void* data, size_t length)
|
||||||
Log.report(logvisor::Fatal, "insufficient TXTR length (%" PRISize "/%" PRISize ")",
|
Log.report(logvisor::Fatal, "insufficient TXTR length (%" PRISize "/%" PRISize ")",
|
||||||
length, expectedSize);
|
length, expectedSize);
|
||||||
|
|
||||||
CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::RGBA8,
|
m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::RGBA8,
|
||||||
boo::TextureClampMode::Repeat, data, expectedSize).get();
|
boo::TextureClampMode::Repeat, data, expectedSize).get();
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTexture::BuildC8(const void* data, size_t length)
|
void CTexture::BuildC8(const void* data, size_t length)
|
||||||
|
@ -671,7 +671,7 @@ void CTexture::BuildC8(const void* data, size_t length)
|
||||||
Log.report(logvisor::Fatal, "insufficient TXTR length (%" PRISize "/%" PRISize ")",
|
Log.report(logvisor::Fatal, "insufficient TXTR length (%" PRISize "/%" PRISize ")",
|
||||||
length, texelCount);
|
length, texelCount);
|
||||||
|
|
||||||
CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
uint32_t nentries = hecl::SBig(*reinterpret_cast<const uint32_t*>(data));
|
uint32_t nentries = hecl::SBig(*reinterpret_cast<const uint32_t*>(data));
|
||||||
const u8* paletteTexels = reinterpret_cast<const u8*>(data) + 4;
|
const u8* paletteTexels = reinterpret_cast<const u8*>(data) + 4;
|
||||||
|
@ -681,14 +681,14 @@ void CTexture::BuildC8(const void* data, size_t length)
|
||||||
m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::I8,
|
m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::I8,
|
||||||
boo::TextureClampMode::Repeat, texels, texelCount).get();
|
boo::TextureClampMode::Repeat, texels, texelCount).get();
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTexture::BuildC8Font(const void* data, EFontType ftype)
|
void CTexture::BuildC8Font(const void* data, EFontType ftype)
|
||||||
{
|
{
|
||||||
size_t texelCount = ComputeMippedTexelCount();
|
size_t texelCount = ComputeMippedTexelCount();
|
||||||
|
|
||||||
size_t layerCount;
|
size_t layerCount = 1;
|
||||||
switch (ftype)
|
switch (ftype)
|
||||||
{
|
{
|
||||||
case EFontType::OneLayer:
|
case EFontType::OneLayer:
|
||||||
|
@ -778,22 +778,22 @@ void CTexture::BuildC8Font(const void* data, EFontType ftype)
|
||||||
h /= 2;
|
h /= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
m_booTex = ctx.newStaticArrayTexture(x4_w, x6_h, layerCount, x8_mips, boo::TextureFormat::RGBA8,
|
m_booTex = ctx.newStaticArrayTexture(x4_w, x6_h, layerCount, x8_mips, boo::TextureFormat::RGBA8,
|
||||||
boo::TextureClampMode::Repeat, buf.get(), texelCount * layerCount * 4).get();
|
boo::TextureClampMode::Repeat, buf.get(), texelCount * layerCount * 4).get();
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTexture::BuildDXT1(const void* data, size_t length)
|
void CTexture::BuildDXT1(const void* data, size_t length)
|
||||||
{
|
{
|
||||||
CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::DXT1,
|
m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::DXT1,
|
||||||
boo::TextureClampMode::Repeat, data, length).get();
|
boo::TextureClampMode::Repeat, data, length).get();
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
CTexture::CTexture(ETexelFormat fmt, s16 w, s16 h, s32 mips)
|
CTexture::CTexture(ETexelFormat fmt, s16 w, s16 h, s32 mips)
|
||||||
|
|
|
@ -6,13 +6,13 @@ namespace urde
|
||||||
CAABoxShader::CAABoxShader(bool zOnly)
|
CAABoxShader::CAABoxShader(bool zOnly)
|
||||||
: m_zOnly(zOnly)
|
: m_zOnly(zOnly)
|
||||||
{
|
{
|
||||||
CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
m_vbo = ctx.newDynamicBuffer(boo::BufferUse::Vertex, sizeof(zeus::CVector3f), 34);
|
m_vbo = ctx.newDynamicBuffer(boo::BufferUse::Vertex, sizeof(zeus::CVector3f), 34);
|
||||||
m_uniBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(Uniform), 1);
|
m_uniBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(Uniform), 1);
|
||||||
m_dataBind = TShader<CAABoxShader>::BuildShaderDataBinding(ctx, *this);
|
m_dataBind = TShader<CAABoxShader>::BuildShaderDataBinding(ctx, *this);
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAABoxShader::setAABB(const zeus::CAABox& aabb)
|
void CAABoxShader::setAABB(const zeus::CAABox& aabb)
|
||||||
|
|
|
@ -54,7 +54,7 @@ struct CAABoxShaderD3DDataBindingFactory : TShader<CAABoxShader>::IDataBindingFa
|
||||||
BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||||
CAABoxShader& filter)
|
CAABoxShader& filter)
|
||||||
{
|
{
|
||||||
boo::ID3DDataFactory::Context& cctx = static_cast<boo::ID3DDataFactory::Context&>(ctx);
|
boo::D3DDataFactory::Context& cctx = static_cast<boo::D3DDataFactory::Context&>(ctx);
|
||||||
|
|
||||||
boo::ObjToken<boo::IGraphicsBuffer> bufs[] = {filter.m_uniBuf.get()};
|
boo::ObjToken<boo::IGraphicsBuffer> bufs[] = {filter.m_uniBuf.get()};
|
||||||
return cctx.newShaderDataBinding(filter.m_zOnly ? s_zOnlyPipeline : s_Pipeline, s_VtxFmt,
|
return cctx.newShaderDataBinding(filter.m_zOnly ? s_zOnlyPipeline : s_Pipeline, s_VtxFmt,
|
||||||
|
@ -63,7 +63,7 @@ struct CAABoxShaderD3DDataBindingFactory : TShader<CAABoxShader>::IDataBindingFa
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
TShader<CAABoxShader>::IDataBindingFactory* CAABoxShader::Initialize(boo::ID3DDataFactory::Context& ctx)
|
TShader<CAABoxShader>::IDataBindingFactory* CAABoxShader::Initialize(boo::D3DDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
const boo::VertexElementDescriptor VtxVmt[] =
|
const boo::VertexElementDescriptor VtxVmt[] =
|
||||||
{
|
{
|
||||||
|
@ -80,7 +80,7 @@ TShader<CAABoxShader>::IDataBindingFactory* CAABoxShader::Initialize(boo::ID3DDa
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void CAABoxShader::Shutdown<boo::ID3DDataFactory>()
|
void CAABoxShader::Shutdown<boo::D3DDataFactory>()
|
||||||
{
|
{
|
||||||
s_VtxFmt.reset();
|
s_VtxFmt.reset();
|
||||||
s_Pipeline.reset();
|
s_Pipeline.reset();
|
||||||
|
|
|
@ -5,13 +5,13 @@ namespace urde
|
||||||
|
|
||||||
CCameraBlurFilter::CCameraBlurFilter()
|
CCameraBlurFilter::CCameraBlurFilter()
|
||||||
{
|
{
|
||||||
CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
m_vbo = ctx.newDynamicBuffer(boo::BufferUse::Vertex, 32, 4);
|
m_vbo = ctx.newDynamicBuffer(boo::BufferUse::Vertex, 32, 4);
|
||||||
m_uniBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(Uniform), 1);
|
m_uniBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(Uniform), 1);
|
||||||
m_dataBind = TShader<CCameraBlurFilter>::BuildShaderDataBinding(ctx, *this);
|
m_dataBind = TShader<CCameraBlurFilter>::BuildShaderDataBinding(ctx, *this);
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCameraBlurFilter::draw(float amount, bool clearDepth)
|
void CCameraBlurFilter::draw(float amount, bool clearDepth)
|
||||||
|
|
|
@ -96,7 +96,7 @@ struct CCameraBlurFilterD3DDataBindingFactory : TShader<CCameraBlurFilter>::IDat
|
||||||
BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||||
CCameraBlurFilter& filter)
|
CCameraBlurFilter& filter)
|
||||||
{
|
{
|
||||||
boo::ID3DDataFactory::Context& cctx = static_cast<boo::ID3DDataFactory::Context&>(ctx);
|
boo::D3DDataFactory::Context& cctx = static_cast<boo::D3DDataFactory::Context&>(ctx);
|
||||||
|
|
||||||
boo::ObjToken<boo::IGraphicsBuffer> bufs[] = {filter.m_uniBuf.get()};
|
boo::ObjToken<boo::IGraphicsBuffer> bufs[] = {filter.m_uniBuf.get()};
|
||||||
boo::ObjToken<boo::ITexture> texs[] = {CGraphics::g_SpareTexture.get()};
|
boo::ObjToken<boo::ITexture> texs[] = {CGraphics::g_SpareTexture.get()};
|
||||||
|
@ -106,7 +106,7 @@ struct CCameraBlurFilterD3DDataBindingFactory : TShader<CCameraBlurFilter>::IDat
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
TShader<CCameraBlurFilter>::IDataBindingFactory* CCameraBlurFilter::Initialize(boo::ID3DDataFactory::Context& ctx)
|
TShader<CCameraBlurFilter>::IDataBindingFactory* CCameraBlurFilter::Initialize(boo::D3DDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
const boo::VertexElementDescriptor VtxVmt[] =
|
const boo::VertexElementDescriptor VtxVmt[] =
|
||||||
{
|
{
|
||||||
|
@ -122,7 +122,7 @@ TShader<CCameraBlurFilter>::IDataBindingFactory* CCameraBlurFilter::Initialize(b
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void CCameraBlurFilter::Shutdown<boo::ID3DDataFactory>()
|
void CCameraBlurFilter::Shutdown<boo::D3DDataFactory>()
|
||||||
{
|
{
|
||||||
s_VtxFmt.reset();
|
s_VtxFmt.reset();
|
||||||
s_Pipeline.reset();
|
s_Pipeline.reset();
|
||||||
|
|
|
@ -5,7 +5,7 @@ namespace urde
|
||||||
|
|
||||||
CColoredQuadFilter::CColoredQuadFilter(EFilterType type)
|
CColoredQuadFilter::CColoredQuadFilter(EFilterType type)
|
||||||
{
|
{
|
||||||
CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
struct Vert
|
struct Vert
|
||||||
{
|
{
|
||||||
|
@ -21,7 +21,7 @@ CColoredQuadFilter::CColoredQuadFilter(EFilterType type)
|
||||||
m_uniBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(Uniform), 1);
|
m_uniBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(Uniform), 1);
|
||||||
m_dataBind = TMultiBlendShader<CColoredQuadFilter>::BuildShaderDataBinding(ctx, type, *this);
|
m_dataBind = TMultiBlendShader<CColoredQuadFilter>::BuildShaderDataBinding(ctx, type, *this);
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CColoredQuadFilter::draw(const zeus::CColor& color, const zeus::CRectangle& rect)
|
void CColoredQuadFilter::draw(const zeus::CColor& color, const zeus::CRectangle& rect)
|
||||||
|
|
|
@ -69,7 +69,7 @@ struct CColoredQuadFilterD3DDataBindingFactory : TMultiBlendShader<CColoredQuadF
|
||||||
BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||||
EFilterType type, CColoredQuadFilter& filter)
|
EFilterType type, CColoredQuadFilter& filter)
|
||||||
{
|
{
|
||||||
boo::ID3DDataFactory::Context& cctx = static_cast<boo::ID3DDataFactory::Context&>(ctx);
|
boo::D3DDataFactory::Context& cctx = static_cast<boo::D3DDataFactory::Context&>(ctx);
|
||||||
|
|
||||||
boo::ObjToken<boo::IGraphicsBuffer> bufs[] = {filter.m_uniBuf.get()};
|
boo::ObjToken<boo::IGraphicsBuffer> bufs[] = {filter.m_uniBuf.get()};
|
||||||
return cctx.newShaderDataBinding(SelectPipeline(type), s_VtxFmt,
|
return cctx.newShaderDataBinding(SelectPipeline(type), s_VtxFmt,
|
||||||
|
@ -79,7 +79,7 @@ struct CColoredQuadFilterD3DDataBindingFactory : TMultiBlendShader<CColoredQuadF
|
||||||
};
|
};
|
||||||
|
|
||||||
TMultiBlendShader<CColoredQuadFilter>::IDataBindingFactory*
|
TMultiBlendShader<CColoredQuadFilter>::IDataBindingFactory*
|
||||||
CColoredQuadFilter::Initialize(boo::ID3DDataFactory::Context& ctx)
|
CColoredQuadFilter::Initialize(boo::D3DDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
const boo::VertexElementDescriptor VtxVmt[] =
|
const boo::VertexElementDescriptor VtxVmt[] =
|
||||||
{
|
{
|
||||||
|
@ -102,7 +102,7 @@ CColoredQuadFilter::Initialize(boo::ID3DDataFactory::Context& ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void CColoredQuadFilter::Shutdown<boo::ID3DDataFactory>()
|
void CColoredQuadFilter::Shutdown<boo::D3DDataFactory>()
|
||||||
{
|
{
|
||||||
s_VtxFmt.reset();
|
s_VtxFmt.reset();
|
||||||
s_AlphaPipeline.reset();
|
s_AlphaPipeline.reset();
|
||||||
|
|
|
@ -143,7 +143,7 @@ struct D3DDecalDataBindingFactory : TShader<CDecalShaders>::IDataBindingFactory
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
TShader<CDecalShaders>::IDataBindingFactory* CDecalShaders::Initialize(boo::ID3DDataFactory::Context& ctx)
|
TShader<CDecalShaders>::IDataBindingFactory* CDecalShaders::Initialize(boo::D3DDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
static const boo::VertexElementDescriptor TexFmtTex[] =
|
static const boo::VertexElementDescriptor TexFmtTex[] =
|
||||||
{
|
{
|
||||||
|
@ -199,7 +199,7 @@ TShader<CDecalShaders>::IDataBindingFactory* CDecalShaders::Initialize(boo::ID3D
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void CDecalShaders::Shutdown<boo::ID3DDataFactory>()
|
void CDecalShaders::Shutdown<boo::D3DDataFactory>()
|
||||||
{
|
{
|
||||||
m_vtxFormatTex.reset();
|
m_vtxFormatTex.reset();
|
||||||
m_vtxFormatNoTex.reset();
|
m_vtxFormatNoTex.reset();
|
||||||
|
|
|
@ -262,7 +262,7 @@ struct D3DElementDataBindingFactory : TShader<CElementGenShaders>::IDataBindingF
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
TShader<CElementGenShaders>::IDataBindingFactory* CElementGenShaders::Initialize(boo::ID3DDataFactory::Context& ctx)
|
TShader<CElementGenShaders>::IDataBindingFactory* CElementGenShaders::Initialize(boo::D3DDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
static const boo::VertexElementDescriptor TexFmtTex[] =
|
static const boo::VertexElementDescriptor TexFmtTex[] =
|
||||||
{
|
{
|
||||||
|
@ -436,7 +436,7 @@ TShader<CElementGenShaders>::IDataBindingFactory* CElementGenShaders::Initialize
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void CElementGenShaders::Shutdown<boo::ID3DDataFactory>()
|
void CElementGenShaders::Shutdown<boo::D3DDataFactory>()
|
||||||
{
|
{
|
||||||
m_vtxFormatTex.reset();
|
m_vtxFormatTex.reset();
|
||||||
m_vtxFormatIndTex.reset();
|
m_vtxFormatIndTex.reset();
|
||||||
|
|
|
@ -21,14 +21,14 @@ void CEnergyBarShader::draw(const zeus::CColor& color0, const std::vector<Vertex
|
||||||
{
|
{
|
||||||
m_maxVerts = totalVerts;
|
m_maxVerts = totalVerts;
|
||||||
m_tex = tex;
|
m_tex = tex;
|
||||||
CGraphicsCommitResources([this](boo::IGraphicsDataFactory::Context& ctx)
|
CGraphics::CommitResources([this](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
m_vbo = ctx.newDynamicBuffer(boo::BufferUse::Vertex, sizeof(Vertex), m_maxVerts);
|
m_vbo = ctx.newDynamicBuffer(boo::BufferUse::Vertex, sizeof(Vertex), m_maxVerts);
|
||||||
for (int i=0 ; i<3 ; ++i)
|
for (int i=0 ; i<3 ; ++i)
|
||||||
m_uniBuf[i] = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(Uniform), 1);
|
m_uniBuf[i] = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(Uniform), 1);
|
||||||
TShader<CEnergyBarShader>::BuildShaderDataBinding(ctx, *this);
|
TShader<CEnergyBarShader>::BuildShaderDataBinding(ctx, *this);
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t vertIter = 0;
|
size_t vertIter = 0;
|
||||||
|
|
|
@ -61,7 +61,7 @@ struct CEnergyBarShaderD3DDataBindingFactory : TShader<CEnergyBarShader>::IDataB
|
||||||
BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||||
CEnergyBarShader& filter)
|
CEnergyBarShader& filter)
|
||||||
{
|
{
|
||||||
boo::ID3DDataFactory::Context& cctx = static_cast<boo::ID3DDataFactory::Context&>(ctx);
|
boo::D3DDataFactory::Context& cctx = static_cast<boo::D3DDataFactory::Context&>(ctx);
|
||||||
|
|
||||||
boo::ObjToken<boo::IGraphicsBuffer> bufs[1];
|
boo::ObjToken<boo::IGraphicsBuffer> bufs[1];
|
||||||
boo::ObjToken<boo::ITexture> texs[] = {filter.m_tex->GetBooTexture()};
|
boo::ObjToken<boo::ITexture> texs[] = {filter.m_tex->GetBooTexture()};
|
||||||
|
@ -77,7 +77,7 @@ struct CEnergyBarShaderD3DDataBindingFactory : TShader<CEnergyBarShader>::IDataB
|
||||||
};
|
};
|
||||||
|
|
||||||
TShader<CEnergyBarShader>::IDataBindingFactory*
|
TShader<CEnergyBarShader>::IDataBindingFactory*
|
||||||
CEnergyBarShader::Initialize(boo::ID3DDataFactory::Context& ctx)
|
CEnergyBarShader::Initialize(boo::D3DDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
const boo::VertexElementDescriptor VtxVmt[] =
|
const boo::VertexElementDescriptor VtxVmt[] =
|
||||||
{
|
{
|
||||||
|
@ -93,7 +93,7 @@ CEnergyBarShader::Initialize(boo::ID3DDataFactory::Context& ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void CEnergyBarShader::Shutdown<boo::ID3DDataFactory>()
|
void CEnergyBarShader::Shutdown<boo::D3DDataFactory>()
|
||||||
{
|
{
|
||||||
s_VtxFmt.reset();
|
s_VtxFmt.reset();
|
||||||
s_Pipeline.reset();
|
s_Pipeline.reset();
|
||||||
|
|
|
@ -99,7 +99,7 @@ boo::ObjToken<boo::IShaderPipeline> CFluidPlaneShader::Cache::GetOrBuildShader(c
|
||||||
if (CGraphics::g_BooFactory == nullptr)
|
if (CGraphics::g_BooFactory == nullptr)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
CGraphicsCommitResources(
|
CGraphics::CommitResources(
|
||||||
[&](boo::IGraphicsDataFactory::Context& ctx)
|
[&](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
switch (ctx.platform())
|
switch (ctx.platform())
|
||||||
|
@ -111,8 +111,7 @@ boo::ObjToken<boo::IShaderPipeline> CFluidPlaneShader::Cache::GetOrBuildShader(c
|
||||||
#endif
|
#endif
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
case boo::IGraphicsDataFactory::Platform::D3D11:
|
case boo::IGraphicsDataFactory::Platform::D3D11:
|
||||||
case boo::IGraphicsDataFactory::Platform::D3D12:
|
slot = BuildShader(static_cast<boo::D3DDataFactory::Context&>(ctx), info);
|
||||||
slot = BuildShader(static_cast<boo::ID3DDataFactory::Context&>(ctx), info);
|
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if BOO_HAS_METAL
|
#if BOO_HAS_METAL
|
||||||
|
@ -128,7 +127,7 @@ boo::ObjToken<boo::IShaderPipeline> CFluidPlaneShader::Cache::GetOrBuildShader(c
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
|
|
||||||
return slot;
|
return slot;
|
||||||
}
|
}
|
||||||
|
@ -148,7 +147,7 @@ void CFluidPlaneShader::Cache::Clear()
|
||||||
|
|
||||||
void CFluidPlaneShader::PrepareBinding(const boo::ObjToken<boo::IShaderPipeline>& pipeline, u32 maxVertCount, bool door)
|
void CFluidPlaneShader::PrepareBinding(const boo::ObjToken<boo::IShaderPipeline>& pipeline, u32 maxVertCount, bool door)
|
||||||
{
|
{
|
||||||
CGraphicsCommitResources(
|
CGraphics::CommitResources(
|
||||||
[&](boo::IGraphicsDataFactory::Context& ctx)
|
[&](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
m_vbo = ctx.newDynamicBuffer(boo::BufferUse::Vertex, sizeof(Vertex), maxVertCount);
|
m_vbo = ctx.newDynamicBuffer(boo::BufferUse::Vertex, sizeof(Vertex), maxVertCount);
|
||||||
|
@ -163,8 +162,7 @@ void CFluidPlaneShader::PrepareBinding(const boo::ObjToken<boo::IShaderPipeline>
|
||||||
#endif
|
#endif
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
case boo::IGraphicsDataFactory::Platform::D3D11:
|
case boo::IGraphicsDataFactory::Platform::D3D11:
|
||||||
case boo::IGraphicsDataFactory::Platform::D3D12:
|
m_dataBind = BuildBinding(static_cast<boo::D3DDataFactory::Context&>(ctx), pipeline, door);
|
||||||
m_dataBind = BuildBinding(static_cast<boo::ID3DDataFactory::Context&>(ctx), pipeline, door);
|
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if BOO_HAS_METAL
|
#if BOO_HAS_METAL
|
||||||
|
@ -180,7 +178,7 @@ void CFluidPlaneShader::PrepareBinding(const boo::ObjToken<boo::IShaderPipeline>
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFluidPlaneShader::Shutdown()
|
void CFluidPlaneShader::Shutdown()
|
||||||
|
@ -195,8 +193,7 @@ void CFluidPlaneShader::Shutdown()
|
||||||
#endif
|
#endif
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
case boo::IGraphicsDataFactory::Platform::D3D11:
|
case boo::IGraphicsDataFactory::Platform::D3D11:
|
||||||
case boo::IGraphicsDataFactory::Platform::D3D12:
|
CFluidPlaneShader::_Shutdown<boo::D3DDataFactory>();
|
||||||
CFluidPlaneShader::_Shutdown<boo::ID3DDataFactory>();
|
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if BOO_HAS_METAL
|
#if BOO_HAS_METAL
|
||||||
|
|
|
@ -127,11 +127,11 @@ private:
|
||||||
const boo::ObjToken<boo::IShaderPipeline>& pipeline, bool door);
|
const boo::ObjToken<boo::IShaderPipeline>& pipeline, bool door);
|
||||||
#endif
|
#endif
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
static boo::ObjToken<boo::IShaderPipeline> BuildShader(boo::ID3DDataFactory::Context& ctx,
|
static boo::ObjToken<boo::IShaderPipeline> BuildShader(boo::D3DDataFactory::Context& ctx,
|
||||||
const SFluidPlaneShaderInfo& info);
|
const SFluidPlaneShaderInfo& info);
|
||||||
static boo::ObjToken<boo::IShaderPipeline> BuildShader(boo::ID3DDataFactory::Context& ctx,
|
static boo::ObjToken<boo::IShaderPipeline> BuildShader(boo::D3DDataFactory::Context& ctx,
|
||||||
const SFluidPlaneDoorShaderInfo& info);
|
const SFluidPlaneDoorShaderInfo& info);
|
||||||
boo::ObjToken<boo::IShaderDataBinding> BuildBinding(boo::ID3DDataFactory::Context& ctx,
|
boo::ObjToken<boo::IShaderDataBinding> BuildBinding(boo::D3DDataFactory::Context& ctx,
|
||||||
const boo::ObjToken<boo::IShaderPipeline>& pipeline, bool door);
|
const boo::ObjToken<boo::IShaderPipeline>& pipeline, bool door);
|
||||||
#endif
|
#endif
|
||||||
#if BOO_HAS_METAL
|
#if BOO_HAS_METAL
|
||||||
|
|
|
@ -166,7 +166,7 @@ static const char* FSDoor =
|
||||||
"}\n";
|
"}\n";
|
||||||
|
|
||||||
boo::ObjToken<boo::IShaderPipeline>
|
boo::ObjToken<boo::IShaderPipeline>
|
||||||
CFluidPlaneShader::BuildShader(boo::ID3DDataFactory::Context& ctx, const SFluidPlaneShaderInfo& info)
|
CFluidPlaneShader::BuildShader(boo::D3DDataFactory::Context& ctx, const SFluidPlaneShaderInfo& info)
|
||||||
{
|
{
|
||||||
if (!s_vtxFmt)
|
if (!s_vtxFmt)
|
||||||
{
|
{
|
||||||
|
@ -498,7 +498,7 @@ CFluidPlaneShader::BuildShader(boo::ID3DDataFactory::Context& ctx, const SFluidP
|
||||||
}
|
}
|
||||||
|
|
||||||
boo::ObjToken<boo::IShaderPipeline>
|
boo::ObjToken<boo::IShaderPipeline>
|
||||||
CFluidPlaneShader::BuildShader(boo::ID3DDataFactory::Context& ctx, const SFluidPlaneDoorShaderInfo& info)
|
CFluidPlaneShader::BuildShader(boo::D3DDataFactory::Context& ctx, const SFluidPlaneDoorShaderInfo& info)
|
||||||
{
|
{
|
||||||
if (!s_vtxFmt)
|
if (!s_vtxFmt)
|
||||||
{
|
{
|
||||||
|
@ -559,13 +559,13 @@ CFluidPlaneShader::BuildShader(boo::ID3DDataFactory::Context& ctx, const SFluidP
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void CFluidPlaneShader::_Shutdown<boo::ID3DDataFactory>()
|
void CFluidPlaneShader::_Shutdown<boo::D3DDataFactory>()
|
||||||
{
|
{
|
||||||
s_vtxFmt.reset();
|
s_vtxFmt.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
boo::ObjToken<boo::IShaderDataBinding>
|
boo::ObjToken<boo::IShaderDataBinding>
|
||||||
CFluidPlaneShader::BuildBinding(boo::ID3DDataFactory::Context& ctx,
|
CFluidPlaneShader::BuildBinding(boo::D3DDataFactory::Context& ctx,
|
||||||
const boo::ObjToken<boo::IShaderPipeline>& pipeline, bool door)
|
const boo::ObjToken<boo::IShaderPipeline>& pipeline, bool door)
|
||||||
{
|
{
|
||||||
boo::ObjToken<boo::IGraphicsBuffer> ubufs[] = { m_uniBuf.get(), m_uniBuf.get(), m_uniBuf.get() };
|
boo::ObjToken<boo::IGraphicsBuffer> ubufs[] = { m_uniBuf.get(), m_uniBuf.get(), m_uniBuf.get() };
|
||||||
|
|
|
@ -5,7 +5,7 @@ namespace urde
|
||||||
|
|
||||||
CFogVolumeFilter::CFogVolumeFilter()
|
CFogVolumeFilter::CFogVolumeFilter()
|
||||||
{
|
{
|
||||||
CGraphicsCommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
|
||||||
{
|
{
|
||||||
struct Vert
|
struct Vert
|
||||||
{
|
{
|
||||||
|
@ -22,7 +22,7 @@ CFogVolumeFilter::CFogVolumeFilter()
|
||||||
m_uniBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(zeus::CColor), 1);
|
m_uniBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(zeus::CColor), 1);
|
||||||
TShader<CFogVolumeFilter>::BuildShaderDataBinding(ctx, *this);
|
TShader<CFogVolumeFilter>::BuildShaderDataBinding(ctx, *this);
|
||||||
return true;
|
return true;
|
||||||
});
|
} BooTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFogVolumeFilter::draw2WayPass(const zeus::CColor& color)
|
void CFogVolumeFilter::draw2WayPass(const zeus::CColor& color)
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue