Merge pull request #2 from RetroView/windows

Windows refactors
This commit is contained in:
Jack Andersen 2015-08-30 20:34:02 -10:00
commit 7ec77347b5
40 changed files with 130 additions and 80 deletions

View File

@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0)
project(PathShagged) project(PathShagged)
if(MSVC) if(MSVC)
# Shaddup MSVC # Shaddup MSVC
add_definitions(-DUNICODE=1 -D_UNICODE=1 -D_CRT_SECURE_NO_WARNINGS=1 /wd4267 /wd4244) add_definitions(-DUNICODE=1 -D_UNICODE=1 -D_CRT_SECURE_NO_WARNINGS=1 -DD_SCL_SECURE_NO_WARNINGS=1 /wd4267 /wd4244 /wd4305)
else() else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-multichar -fno-exceptions") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-multichar -fno-exceptions")
endif() endif()

View File

@ -8,6 +8,7 @@ macro(make_dnalist outlist)
foreach(type ${ARGN}) foreach(type ${ARGN})
get_filename_component(dir ${type} DIRECTORY) get_filename_component(dir ${type} DIRECTORY)
if(dir) if(dir)
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${dir}")
set(dir "${dir}/") set(dir "${dir}/")
endif() endif()
get_filename_component(name ${type} NAME) get_filename_component(name ${type} NAME)

View File

@ -108,7 +108,7 @@ bool ReadANCSToBlender(HECL::BlenderConnection& conn,
if (cmdlE) if (cmdlE)
{ {
HECL::ProjectPath cmdlPath = pakRouter.getWorking(cmdlE); HECL::ProjectPath cmdlPath = pakRouter.getWorking(cmdlE);
os.linkBlend(cmdlPath.getAbsolutePath(), pakRouter.getBestEntryName(*cmdlE), true); os.linkBlend(cmdlPath.getAbsolutePathUTF8(), pakRouter.getBestEntryName(*cmdlE), true);
/* Attach CMDL to CINF */ /* Attach CMDL to CINF */
os << "if obj.name not in bpy.context.scene.objects:\n" os << "if obj.name not in bpy.context.scene.objects:\n"

View File

@ -1,3 +1,5 @@
#define _USE_MATH_DEFINES
#include <math.h>
#include "ANIM.hpp" #include "ANIM.hpp"
namespace Retro namespace Retro

View File

@ -1,7 +1,6 @@
#ifndef _DNACOMMON_ANIMBITSTREAM_HPP_ #ifndef _DNACOMMON_ANIMBITSTREAM_HPP_
#define _DNACOMMON_ANIMBITSTREAM_HPP_ #define _DNACOMMON_ANIMBITSTREAM_HPP_
#include <math.h>
#include "DNACommon.hpp" #include "DNACommon.hpp"
namespace Retro namespace Retro

View File

@ -204,7 +204,7 @@ public:
} }
operator bool() operator bool()
{ {
return *m_cur && ((m_cur - m_dl.get()) < m_dlSize); return *m_cur && ((m_cur - m_dl.get()) < intptr_t(m_dlSize));
} }
GX::Primitive readPrimitive() GX::Primitive readPrimitive()
{ {
@ -618,7 +618,7 @@ bool ReadCMDLToBlender(HECL::BlenderConnection& conn,
os.format("materials[%u].pass_index = %u\n", sHead.matIdx, surfIdx++); os.format("materials[%u].pass_index = %u\n", sHead.matIdx, surfIdx++);
if (matUVCount > createdUVLayers) if (matUVCount > createdUVLayers)
{ {
for (int l=createdUVLayers ; l<matUVCount ; ++l) for (unsigned l=createdUVLayers ; l<matUVCount ; ++l)
os.format("bm.loops.layers.uv.new('UV_%u')\n", l); os.format("bm.loops.layers.uv.new('UV_%u')\n", l);
createdUVLayers = matUVCount; createdUVLayers = matUVCount;
} }
@ -663,7 +663,7 @@ bool ReadCMDLToBlender(HECL::BlenderConnection& conn,
if (matUVCount) if (matUVCount)
{ {
os << "if last_face is not None:\n"; os << "if last_face is not None:\n";
for (int j=0 ; j<matUVCount ; ++j) for (unsigned j=0 ; j<matUVCount ; ++j)
os.format(" loop_from_facevert(last_face, %u)[last_mesh.loops.layers.uv[%u]].uv = uv_list[%u]\n" os.format(" loop_from_facevert(last_face, %u)[last_mesh.loops.layers.uv[%u]].uv = uv_list[%u]\n"
" loop_from_facevert(last_face, %u)[last_mesh.loops.layers.uv[%u]].uv = uv_list[%u]\n" " loop_from_facevert(last_face, %u)[last_mesh.loops.layers.uv[%u]].uv = uv_list[%u]\n"
" loop_from_facevert(last_face, %u)[last_mesh.loops.layers.uv[%u]].uv = uv_list[%u]\n", " loop_from_facevert(last_face, %u)[last_mesh.loops.layers.uv[%u]].uv = uv_list[%u]\n",
@ -685,7 +685,7 @@ bool ReadCMDLToBlender(HECL::BlenderConnection& conn,
if (matUVCount) if (matUVCount)
{ {
os << "if last_face is not None:\n"; os << "if last_face is not None:\n";
for (int j=0 ; j<matUVCount ; ++j) for (unsigned j=0 ; j<matUVCount ; ++j)
os.format(" loop_from_facevert(last_face, %u)[last_mesh.loops.layers.uv[%u]].uv = uv_list[%u]\n" os.format(" loop_from_facevert(last_face, %u)[last_mesh.loops.layers.uv[%u]].uv = uv_list[%u]\n"
" loop_from_facevert(last_face, %u)[last_mesh.loops.layers.uv[%u]].uv = uv_list[%u]\n" " loop_from_facevert(last_face, %u)[last_mesh.loops.layers.uv[%u]].uv = uv_list[%u]\n"
" loop_from_facevert(last_face, %u)[last_mesh.loops.layers.uv[%u]].uv = uv_list[%u]\n", " loop_from_facevert(last_face, %u)[last_mesh.loops.layers.uv[%u]].uv = uv_list[%u]\n",
@ -720,7 +720,7 @@ bool ReadCMDLToBlender(HECL::BlenderConnection& conn,
if (matUVCount) if (matUVCount)
{ {
os << "if last_face is not None:\n"; os << "if last_face is not None:\n";
for (int j=0 ; j<matUVCount ; ++j) for (unsigned j=0 ; j<matUVCount ; ++j)
os.format(" loop_from_facevert(last_face, %u)[last_mesh.loops.layers.uv[%u]].uv = uv_list[%u]\n" os.format(" loop_from_facevert(last_face, %u)[last_mesh.loops.layers.uv[%u]].uv = uv_list[%u]\n"
" loop_from_facevert(last_face, %u)[last_mesh.loops.layers.uv[%u]].uv = uv_list[%u]\n" " loop_from_facevert(last_face, %u)[last_mesh.loops.layers.uv[%u]].uv = uv_list[%u]\n"
" loop_from_facevert(last_face, %u)[last_mesh.loops.layers.uv[%u]].uv = uv_list[%u]\n", " loop_from_facevert(last_face, %u)[last_mesh.loops.layers.uv[%u]].uv = uv_list[%u]\n",
@ -756,7 +756,7 @@ bool ReadCMDLToBlender(HECL::BlenderConnection& conn,
if (matUVCount) if (matUVCount)
{ {
os << "if last_face is not None:\n"; os << "if last_face is not None:\n";
for (int j=0 ; j<matUVCount ; ++j) for (unsigned j=0 ; j<matUVCount ; ++j)
os.format(" loop_from_facevert(last_face, %u)[last_mesh.loops.layers.uv[%u]].uv = uv_list[%u]\n" os.format(" loop_from_facevert(last_face, %u)[last_mesh.loops.layers.uv[%u]].uv = uv_list[%u]\n"
" loop_from_facevert(last_face, %u)[last_mesh.loops.layers.uv[%u]].uv = uv_list[%u]\n" " loop_from_facevert(last_face, %u)[last_mesh.loops.layers.uv[%u]].uv = uv_list[%u]\n"
" loop_from_facevert(last_face, %u)[last_mesh.loops.layers.uv[%u]].uv = uv_list[%u]\n", " loop_from_facevert(last_face, %u)[last_mesh.loops.layers.uv[%u]].uv = uv_list[%u]\n",

View File

@ -87,7 +87,7 @@ public:
inline std::string toString() const inline std::string toString() const
{ {
char buf[17]; char buf[17];
snprintf(buf, 17, "%016lX", m_id); snprintf(buf, 17, "%016llX", m_id);
return std::string(buf); return std::string(buf);
} }
}; };
@ -143,7 +143,7 @@ public:
inline std::string toString() const inline std::string toString() const
{ {
char buf[33]; char buf[33];
snprintf(buf, 33, "%016lX%016lX", m_id[0], m_id[1]); snprintf(buf, 33, "%016llX%016llX", m_id[0], m_id[1]);
return std::string(buf); return std::string(buf);
} }
}; };
@ -173,10 +173,11 @@ struct CaseInsensitiveCompare
}; };
/* Word Bitmap reader/writer */ /* Word Bitmap reader/writer */
struct WordBitmap class WordBitmap
{ {
std::vector<atUint32> m_words; std::vector<atUint32> m_words;
size_t m_bitCount = 0; size_t m_bitCount = 0;
public:
void read(Athena::io::IStreamReader& reader, size_t bitCount) void read(Athena::io::IStreamReader& reader, size_t bitCount)
{ {
m_bitCount = bitCount; m_bitCount = bitCount;

View File

@ -93,7 +93,7 @@ struct ResExtractor
std::function<bool(const SpecBase&, PAKEntryReadStream&, const HECL::ProjectPath&)> func_a; std::function<bool(const SpecBase&, PAKEntryReadStream&, const HECL::ProjectPath&)> func_a;
std::function<bool(const SpecBase&, PAKEntryReadStream&, const HECL::ProjectPath&, PAKRouter<PAKBRIDGE>&, std::function<bool(const SpecBase&, PAKEntryReadStream&, const HECL::ProjectPath&, PAKRouter<PAKBRIDGE>&,
const typename PAKBRIDGE::PAKType::Entry&, bool)> func_b; const typename PAKBRIDGE::PAKType::Entry&, bool)> func_b;
const char* fileExts[4]; const HECL::SystemChar* fileExts[4];
unsigned weight; unsigned weight;
}; };
@ -200,7 +200,11 @@ public:
const HECL::ProjectPath& pakPath = m_bridgePaths[uniqueSearch->second.first].first; const HECL::ProjectPath& pakPath = m_bridgePaths[uniqueSearch->second.first].first;
pakPath.makeDir(); pakPath.makeDir();
HECL::ProjectPath uniquePath = entry->unique.uniquePath(pakPath); HECL::ProjectPath uniquePath = entry->unique.uniquePath(pakPath);
#if HECL_UCS2
HECL::SystemString entName = HECL::UTF8ToWide(m_pak->bestEntryName(*entry));
#else
HECL::SystemString entName = m_pak->bestEntryName(*entry); HECL::SystemString entName = m_pak->bestEntryName(*entry);
#endif
if (extractor.fileExts[0] && !extractor.fileExts[1]) if (extractor.fileExts[0] && !extractor.fileExts[1])
entName += extractor.fileExts[0]; entName += extractor.fileExts[0];
return HECL::ProjectPath(uniquePath, entName); return HECL::ProjectPath(uniquePath, entName);
@ -210,7 +214,11 @@ public:
{ {
const HECL::ProjectPath& pakPath = m_bridgePaths[m_curBridgeIdx].first; const HECL::ProjectPath& pakPath = m_bridgePaths[m_curBridgeIdx].first;
HECL::ProjectPath uniquePathPre = entry->unique.uniquePath(pakPath); HECL::ProjectPath uniquePathPre = entry->unique.uniquePath(pakPath);
#if HECL_UCS2
HECL::SystemString entBase = HECL::UTF8ToWide(m_pak->bestEntryName(*entry));
#else
HECL::SystemString entBase = m_pak->bestEntryName(*entry); HECL::SystemString entBase = m_pak->bestEntryName(*entry);
#endif
HECL::SystemString entName = entBase; HECL::SystemString entName = entBase;
if (extractor.fileExts[0] && !extractor.fileExts[1]) if (extractor.fileExts[0] && !extractor.fileExts[1])
entName += extractor.fileExts[0]; entName += extractor.fileExts[0];
@ -290,7 +298,7 @@ public:
HECL::ProjectPath aPath = getWorking(&a, BRIDGETYPE::LookupExtractor(a)); HECL::ProjectPath aPath = getWorking(&a, BRIDGETYPE::LookupExtractor(a));
HECL::SystemString ret; HECL::SystemString ret;
for (int i=0 ; i<aPath.levelCount() ; ++i) for (int i=0 ; i<aPath.levelCount() ; ++i)
ret += "../"; ret += _S("../");
HECL::ProjectPath bPath = getWorking(be, BRIDGETYPE::LookupExtractor(*be)); HECL::ProjectPath bPath = getWorking(be, BRIDGETYPE::LookupExtractor(*be));
ret += bPath.getRelativePath(); ret += bPath.getRelativePath();
return ret; return ret;

View File

@ -245,7 +245,7 @@ void ANIM::ANIM2::read(Athena::io::IStreamReader& reader)
{ {
ChannelDesc desc; ChannelDesc desc;
desc.read(reader); desc.read(reader);
bones.emplace_back(desc.id, desc.keyCount2); bones.emplace_back(desc.id, desc.keyCount2 != 0);
if (desc.keyCount1) if (desc.keyCount1)
{ {

View File

@ -304,7 +304,7 @@ struct MaterialSet : BigDNA
inline void readToBlender(HECL::BlenderConnection::PyOutStream& os, inline void readToBlender(HECL::BlenderConnection::PyOutStream& os,
const PAKRouter<PAKBridge>& pakRouter, const PAKRouter<PAKBridge>& pakRouter,
const typename PAKRouter<PAKBridge>::EntryType& entry, const PAKRouter<PAKBridge>::EntryType& entry,
unsigned setIdx, unsigned setIdx,
const SpecBase& dataspec) const SpecBase& dataspec)
{ {

View File

@ -104,7 +104,7 @@ UniqueResult PAKBridge::uniqueCheck(const PAK::Entry& entry)
static HECL::SystemString LayerName(const std::string& name) static HECL::SystemString LayerName(const std::string& name)
{ {
#if HECL_UCS2 #if HECL_UCS2
HECL::SystemString ret = HECL::UTF8ToWide(mlvl.layerNames[layerIdx++]); HECL::SystemString ret = HECL::UTF8ToWide(name);
#else #else
HECL::SystemString ret = name; HECL::SystemString ret = name;
#endif #endif
@ -177,15 +177,15 @@ ResExtractor<PAKBridge> PAKBridge::LookupExtractor(const PAK::Entry& entry)
switch (entry.type) switch (entry.type)
{ {
case SBIG('STRG'): case SBIG('STRG'):
return {STRG::Extract, nullptr, {".yaml"}}; return {STRG::Extract, nullptr, {_S(".yaml")}};
case SBIG('TXTR'): case SBIG('TXTR'):
return {TXTR::Extract, nullptr, {".png"}}; return {TXTR::Extract, nullptr, {_S(".png")}};
case SBIG('CMDL'): case SBIG('CMDL'):
return {nullptr, CMDL::Extract, {".blend"}, 2}; return {nullptr, CMDL::Extract, {_S(".blend")}, 2};
case SBIG('ANCS'): case SBIG('ANCS'):
return {nullptr, ANCS::Extract, {".yaml", ".blend"}, 1}; return {nullptr, ANCS::Extract, {_S(".yaml"), _S(".blend")}, 1};
case SBIG('MLVL'): case SBIG('MLVL'):
return {MLVL::Extract, nullptr, {".yaml"}}; return {MLVL::Extract, nullptr, {_S(".yaml")}};
} }
return {}; return {};
} }

View File

@ -379,7 +379,7 @@ void ANIM::ANIM2::read(Athena::io::IStreamReader& reader)
{ {
ChannelDesc desc; ChannelDesc desc;
desc.read(reader); desc.read(reader);
bones.emplace_back(desc.id, std::make_tuple(desc.keyCount1, desc.keyCount2, desc.keyCount3)); bones.emplace_back(desc.id, std::make_tuple(desc.keyCount1 != 0, desc.keyCount2 != 0, desc.keyCount3 != 0));
if (desc.keyCount1) if (desc.keyCount1)
{ {

View File

@ -65,7 +65,7 @@ struct MaterialSet : BigDNA
inline void readToBlender(HECL::BlenderConnection::PyOutStream& os, inline void readToBlender(HECL::BlenderConnection::PyOutStream& os,
const PAKRouter<PAKBridge>& pakRouter, const PAKRouter<PAKBridge>& pakRouter,
const typename PAKRouter<PAKBridge>::EntryType& entry, const PAKRouter<PAKBridge>::EntryType& entry,
unsigned setIdx, unsigned setIdx,
const SpecBase& dataspec) const SpecBase& dataspec)
{ {

View File

@ -103,7 +103,7 @@ UniqueResult PAKBridge::uniqueCheck(const DNAMP1::PAK::Entry& entry)
static HECL::SystemString LayerName(const std::string& name) static HECL::SystemString LayerName(const std::string& name)
{ {
#if HECL_UCS2 #if HECL_UCS2
HECL::SystemString ret = HECL::UTF8ToWide(mlvl.layerNames[layerIdx++]); HECL::SystemString ret = HECL::UTF8ToWide(name);
#else #else
HECL::SystemString ret = name; HECL::SystemString ret = name;
#endif #endif
@ -138,7 +138,6 @@ void PAKBridge::build()
} }
if (areaDeps.name.empty()) if (areaDeps.name.empty())
{ {
areaDeps.name = area.internalAreaName;
#if HECL_UCS2 #if HECL_UCS2
areaDeps.name = HECL::UTF8ToWide(area.internalAreaName); areaDeps.name = HECL::UTF8ToWide(area.internalAreaName);
#else #else
@ -185,13 +184,13 @@ ResExtractor<PAKBridge> PAKBridge::LookupExtractor(const DNAMP1::PAK::Entry& ent
switch (entry.type) switch (entry.type)
{ {
case SBIG('STRG'): case SBIG('STRG'):
return {STRG::Extract, nullptr, {".yaml"}}; return {STRG::Extract, nullptr, {_S(".yaml")}};
case SBIG('TXTR'): case SBIG('TXTR'):
return {TXTR::Extract, nullptr, {".png"}}; return {TXTR::Extract, nullptr, {_S(".png")}};
case SBIG('CMDL'): case SBIG('CMDL'):
return {nullptr, CMDL::Extract, {".blend"}, 2}; return {nullptr, CMDL::Extract, {_S(".blend")}, 2};
case SBIG('ANCS'): case SBIG('ANCS'):
return {nullptr, ANCS::Extract, {".yaml", ".blend"}, 1}; return {nullptr, ANCS::Extract, {_S(".yaml"), _S(".blend")}, 1};
} }
return {}; return {};
} }

View File

@ -190,7 +190,7 @@ struct MaterialSet : BigDNA
inline void readToBlender(HECL::BlenderConnection::PyOutStream& os, inline void readToBlender(HECL::BlenderConnection::PyOutStream& os,
const PAKRouter<PAKBridge>& pakRouter, const PAKRouter<PAKBridge>& pakRouter,
const typename PAKRouter<PAKBridge>::EntryType& entry, const PAKRouter<PAKBridge>::EntryType& entry,
unsigned setIdx, unsigned setIdx,
const SpecBase& dataspec) const SpecBase& dataspec)
{ {

View File

@ -58,11 +58,11 @@ ResExtractor<PAKBridge> PAKBridge::LookupExtractor(const PAK::Entry& entry)
switch (entry.type) switch (entry.type)
{ {
case SBIG('STRG'): case SBIG('STRG'):
return {STRG::Extract, nullptr, {".yaml"}}; return {STRG::Extract, nullptr, {_S(".yaml")}};
case SBIG('TXTR'): case SBIG('TXTR'):
return {TXTR::Extract, nullptr, {".png"}}; return {TXTR::Extract, nullptr, {_S(".png")}};
case SBIG('CMDL'): case SBIG('CMDL'):
return {nullptr, CMDL::Extract, {".blend"}, 1}; return {nullptr, CMDL::Extract, {_S(".blend")}, 1};
} }
return {}; return {};
} }

@ -1 +1 @@
Subproject commit 151b0e63338a8f8645f908e48fb7423795224690 Subproject commit 60be8cd2999b139c4fe29071b6e2b842b62850ff

View File

@ -10,8 +10,9 @@ class CAudioStateWin : public CIOWin
{ {
public: public:
CAudioStateWin() : CIOWin("CAudioStateWin") {} CAudioStateWin() : CIOWin("CAudioStateWin") {}
virtual CIOWin::EMessageReturn OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue) CIOWin::EMessageReturn OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue)
{ {
return MsgRetNormal;
} }
}; };

View File

@ -27,11 +27,11 @@ public:
void UpdateFilePos(int) {} void UpdateFilePos(int) {}
void CalcFileOffset(int, ESeekOrigin) {} void CalcFileOffset(int, ESeekOrigin) {}
static void internalCallback(s32, DVDFileInfo*) {} static void internalCallback(s32, DVDFileInfo*) {}
static bool FileExists(const char*) {} static bool FileExists(const char*) {return false;}
void CloseFile() {} void CloseFile() {}
CDvdRequest* AsyncSeekRead(void*, u32, ESeekOrigin, int) {} CDvdRequest* AsyncSeekRead(void*, u32, ESeekOrigin, int) {return nullptr;}
void SyncSeekRead(void*, u32, ESeekOrigin, int) {} void SyncSeekRead(void*, u32, ESeekOrigin, int) {}
CDvdRequest* AsyncRead(void*, u32) {} CDvdRequest* AsyncRead(void*, u32) {return nullptr;}
void SyncRead(void*, u32) {} void SyncRead(void*, u32) {}
void StallForARAMFile() {} void StallForARAMFile() {}
void StartARAMFileLoad() {} void StartARAMFileLoad() {}

View File

@ -5,21 +5,26 @@ namespace Retro
CGameAllocator::SGameMemInfo* CGameAllocator::FindFreeBlock(u32) CGameAllocator::SGameMemInfo* CGameAllocator::FindFreeBlock(u32)
{ {
return nullptr;
} }
CGameAllocator::SGameMemInfo* CGameAllocator::FindFreeBlockFromTopOfHeap(u32) CGameAllocator::SGameMemInfo* CGameAllocator::FindFreeBlockFromTopOfHeap(u32)
{ {
return nullptr;
} }
u32 CGameAllocator::FixupAllocPtrs(SGameMemInfo*, u32, u32, EHint, const CCallStack&) u32 CGameAllocator::FixupAllocPtrs(SGameMemInfo*, u32, u32, EHint, const CCallStack&)
{ {
return 0;
} }
void CGameAllocator::UpdateAllocDebugStats(u32, u32, u32) void CGameAllocator::UpdateAllocDebugStats(u32, u32, u32)
{ {
} }
bool CGameAllocator::FreeNormalAllocation(void*) bool CGameAllocator::FreeNormalAllocation(void*)
{ {
return false;
} }
u32 CGameAllocator::GetFreeBinEntryForSize(u32) u32 CGameAllocator::GetFreeBinEntryForSize(u32)
{ {
return 0;
} }
void CGameAllocator::AddFreeEntryToFreeList(SGameMemInfo*) void CGameAllocator::AddFreeEntryToFreeList(SGameMemInfo*)
{ {
@ -32,6 +37,7 @@ void CGameAllocator::DumpAllocations() const
} }
u32 CGameAllocator::GetLargestFreeChunk() const u32 CGameAllocator::GetLargestFreeChunk() const
{ {
return 0;
} }
CGameAllocator::SGameMemInfo* CGameAllocator::GetMemInfoFromBlockPtr(void* ptr) CGameAllocator::SGameMemInfo* CGameAllocator::GetMemInfoFromBlockPtr(void* ptr)
{ {
@ -40,12 +46,14 @@ CGameAllocator::SGameMemInfo* CGameAllocator::GetMemInfoFromBlockPtr(void* ptr)
bool CGameAllocator::Initialize() bool CGameAllocator::Initialize()
{ {
return false;
} }
void CGameAllocator::Shutdown() void CGameAllocator::Shutdown()
{ {
} }
void* CGameAllocator::Alloc(size_t, EHint, EScope, EType, const CCallStack&) void* CGameAllocator::Alloc(size_t, EHint, EScope, EType, const CCallStack&)
{ {
return nullptr;
} }
void CGameAllocator::Free(void*) void CGameAllocator::Free(void*)
{ {
@ -55,6 +63,7 @@ void CGameAllocator::ReleaseAll()
} }
void* CGameAllocator::AllocSecondary(size_t, EHint, EScope, EType, const CCallStack&) void* CGameAllocator::AllocSecondary(size_t, EHint, EScope, EType, const CCallStack&)
{ {
return nullptr;
} }
void CGameAllocator::FreeSecondary(void*) void CGameAllocator::FreeSecondary(void*)
{ {
@ -69,15 +78,18 @@ void CGameAllocator::SetOutOfMemoryCallback(const TOutOfMemoryCallback cb, void*
} }
int CGameAllocator::EnumAllocations(const TAllocationVisitCallback, void*, bool) const int CGameAllocator::EnumAllocations(const TAllocationVisitCallback, void*, bool) const
{ {
return 0;
} }
CGameAllocator::SAllocInfo CGameAllocator::GetAllocInfo(void*) const CGameAllocator::SAllocInfo CGameAllocator::GetAllocInfo(void*) const
{ {
return CGameAllocator::SAllocInfo();
} }
void CGameAllocator::OffsetFakeStatics(int) void CGameAllocator::OffsetFakeStatics(int)
{ {
} }
CGameAllocator::SMetrics CGameAllocator::GetMetrics() const CGameAllocator::SMetrics CGameAllocator::GetMetrics() const
{ {
return CGameAllocator::SMetrics();
} }
} }

View File

@ -1,17 +1,19 @@
#ifndef __RETRO_CGAMEOPTIONS_HPP__ #ifndef __RETRO_CGAMEOPTIONS_HPP__
#define __RETRO_CGAMEOPTIONS_HPP__ #define __RETRO_CGAMEOPTIONS_HPP__
#include "RetroTypes.hpp"
namespace Retro namespace Retro
{ {
class CGameOptions class CGameOptions
{ {
char a = 0; u8 a = 0;
char b = 0; u8 b = 0;
char c = 128; u8 c = 128;
char d = 128; u8 d = 128;
char e = 255; u8 e = 255;
char f = 255; u8 f = 255;
bool g = true; bool g = true;
}; };

View File

@ -1,4 +1,4 @@
include_directories(${BOO_INCLUDE_DIR}) include_directories(${BOO_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR})
add_subdirectory(Audio) add_subdirectory(Audio)
add_subdirectory(Character) add_subdirectory(Character)

View File

@ -35,15 +35,19 @@ void CMoviePlayer::Rewind()
bool CMoviePlayer::GetIsMovieFinishedPlaying() const bool CMoviePlayer::GetIsMovieFinishedPlaying() const
{ {
return false;
} }
bool CMoviePlayer::GetIsFullyCached() const bool CMoviePlayer::GetIsFullyCached() const
{ {
return false;
} }
float CMoviePlayer::GetPlayedSeconds() const float CMoviePlayer::GetPlayedSeconds() const
{ {
return 0.0;
} }
float CMoviePlayer::GetTotalSeconds() const float CMoviePlayer::GetTotalSeconds() const
{ {
return 0.0;
} }
void CMoviePlayer::SetPlayMode(EPlayMode mode) void CMoviePlayer::SetPlayMode(EPlayMode mode)
{ {

View File

@ -8,6 +8,7 @@ void CNODDvdRequest::WaitUntilComplete()
} }
bool CNODDvdRequest::IsComplete() bool CNODDvdRequest::IsComplete()
{ {
return false;
} }
void CNODDvdRequest::PostCancelRequest() void CNODDvdRequest::PostCancelRequest()
{ {

View File

@ -44,9 +44,9 @@ public:
return &p.second; return &p.second;
return nullptr; return nullptr;
} }
const SResInfo* GetResInfoForLoad(u32 id) {} const SResInfo* GetResInfoForLoad(u32 id) {return nullptr;}
const SResInfo* GetResInfo(u32 id) const {} const SResInfo* GetResInfo(u32 id) const {return nullptr;}
u32 GetFakeStaticSize() const {} u32 GetFakeStaticSize() const {return 0;}
void DataLoad() {} void DataLoad() {}
void InitialHeaderLoad() {} void InitialHeaderLoad() {}
void Warmup() {} void Warmup() {}

View File

@ -13,7 +13,7 @@ class CPlayMovieBase : public CIOWin
public: public:
CPlayMovieBase(const char* iowName, const char* path) CPlayMovieBase(const char* iowName, const char* path)
: CIOWin(iowName), x18_moviePlayer(path, 0.0, false) {} : CIOWin(iowName), x18_moviePlayer(path, 0.0, false) {}
EMessageReturn OnMessage(const CArchitectureMessage&, CArchitectureQueue&) {} EMessageReturn OnMessage(const CArchitectureMessage&, CArchitectureQueue&) {return MsgRetNormal;}
void Draw() const {} void Draw() const {}
}; };

View File

@ -1,10 +1,12 @@
#include "CResFactory.hpp" #include "CResFactory.hpp"
#include "IObj.hpp"
namespace Retro namespace Retro
{ {
std::unique_ptr<IObj> CResFactory::Build(const SObjectTag&, const CVParamTransfer&) std::unique_ptr<IObj> CResFactory::Build(const SObjectTag&, const CVParamTransfer&)
{ {
return std::unique_ptr<IObj>();
} }
void CResFactory::BuildAsync(const SObjectTag&, const CVParamTransfer&, IObj**) void CResFactory::BuildAsync(const SObjectTag&, const CVParamTransfer&, IObj**)
{ {

View File

@ -135,7 +135,7 @@ FourCC CResLoader::GetResourceTypeById(u32 id)
{ {
if (FindResource(id)) if (FindResource(id))
return x50_cachedResInfo->x0_type; return x50_cachedResInfo->x0_type;
return false; return FourCC();
} }
const SObjectTag* CResLoader::GetResourceIdByName(const char* name) const const SObjectTag* CResLoader::GetResourceIdByName(const char* name) const

View File

@ -9,7 +9,7 @@
namespace Retro namespace Retro
{ {
class SObjectTag; struct SObjectTag;
class CDvdRequest; class CDvdRequest;
class CResLoader class CResLoader

View File

@ -9,17 +9,19 @@ class IFactory;
class CSimplePool : public IObjectStore class CSimplePool : public IObjectStore
{ {
IFactory& m_factory;
public: public:
CSimplePool(IFactory&) CSimplePool(IFactory& factory)
: m_factory(factory)
{ {
} }
IObj& GetObj(const SObjectTag&, const CVParamTransfer&) {} IObj* GetObj(const SObjectTag&, const CVParamTransfer&) {return nullptr;}
IObj& GetObj(const SObjectTag&) {} IObj* GetObj(const SObjectTag&) {return nullptr;}
IObj& GetObj(char const*) {} IObj* GetObj(char const*) {return nullptr;}
IObj& GetObj(char const*, const CVParamTransfer&) {} IObj* GetObj(char const*, const CVParamTransfer&) {return nullptr;}
void HasObject(const SObjectTag&) const {} void HasObject(const SObjectTag&) const {}
void ObjectIsLive(const SObjectTag&) const {} void ObjectIsLive(const SObjectTag&) const {}
IFactory& GetFactory() const {} IFactory& GetFactory() const {return m_factory;}
void Flush() {} void Flush() {}
void ObjectUnreferenced(const SObjectTag&) {} void ObjectUnreferenced(const SObjectTag&) {}
}; };

View File

@ -2,17 +2,18 @@
#define __RETRO_CASSETFACTORY_HPP__ #define __RETRO_CASSETFACTORY_HPP__
#include "../IFactory.hpp" #include "../IFactory.hpp"
#include "../IObj.hpp"
namespace Retro namespace Retro
{ {
class CCharacterFactoryBuilder : public IFactory class CCharacterFactoryBuilder : public IFactory
{ {
public: public:
std::unique_ptr<IObj> Build(const SObjectTag&, const CVParamTransfer&) {} std::unique_ptr<IObj> Build(const SObjectTag&, const CVParamTransfer&) {return std::unique_ptr<IObj>();}
void BuildAsync(const SObjectTag&, const CVParamTransfer&, IObj**) {} void BuildAsync(const SObjectTag&, const CVParamTransfer&, IObj**) {}
void CancelBuild(const SObjectTag&) {} void CancelBuild(const SObjectTag&) {}
bool CanBuild(const SObjectTag&) {} bool CanBuild(const SObjectTag&) {return false;}
const SObjectTag* GetResourceIdByName(const char*) const {} const SObjectTag* GetResourceIdByName(const char*) const {return nullptr;}
}; };
} }

View File

@ -13,8 +13,8 @@ extern class CGameState* g_GameState;
extern class CInGameTweakManagerBase* g_TweakManager; extern class CInGameTweakManagerBase* g_TweakManager;
extern class CBooRenderer* g_Renderer; extern class CBooRenderer* g_Renderer;
extern class ITweakPlayer* g_tweakPlayer; extern struct ITweakPlayer* g_tweakPlayer;
extern class ITweakPlayerControl* g_tweakPlayerControl; extern struct ITweakPlayerControl* g_tweakPlayerControl;
} }

View File

@ -3,7 +3,7 @@
namespace Retro namespace Retro
{ {
class SObjectTag; struct SObjectTag;
class CVParamTransfer; class CVParamTransfer;
class IFactory; class IFactory;
class IObj; class IObj;
@ -11,10 +11,10 @@ class IObj;
class IObjectStore class IObjectStore
{ {
public: public:
virtual IObj& GetObj(const SObjectTag&, const CVParamTransfer&)=0; virtual IObj* GetObj(const SObjectTag&, const CVParamTransfer&)=0;
virtual IObj& GetObj(const SObjectTag&)=0; virtual IObj* GetObj(const SObjectTag&)=0;
virtual IObj& GetObj(char const*)=0; virtual IObj* GetObj(char const*)=0;
virtual IObj& GetObj(char const*, const CVParamTransfer&)=0; virtual IObj* GetObj(char const*, const CVParamTransfer&)=0;
virtual void HasObject(const SObjectTag&) const=0; virtual void HasObject(const SObjectTag&) const=0;
virtual void ObjectIsLive(const SObjectTag&) const=0; virtual void ObjectIsLive(const SObjectTag&) const=0;
virtual IFactory& GetFactory() const=0; virtual IFactory& GetFactory() const=0;

View File

@ -31,9 +31,9 @@ void CFrontEndUI::OnFileMenuAdvance(CGuiTableGroup* grp)
void CFrontEndUI::OnMainMenuAdvance(CGuiTableGroup* grp) void CFrontEndUI::OnMainMenuAdvance(CGuiTableGroup* grp)
{} {}
const char* CFrontEndUI::GetAttractMovieFileName(int idx) const char* CFrontEndUI::GetAttractMovieFileName(int idx)
{} {return nullptr;}
const char* CFrontEndUI::GetNextAttractMovieFileName(int idx) const char* CFrontEndUI::GetNextAttractMovieFileName(int idx)
{} {return nullptr;}
void CFrontEndUI::SetCurrentMovie(EMenuMovie movie) void CFrontEndUI::SetCurrentMovie(EMenuMovie movie)
{} {}
void CFrontEndUI::StopAttractMovie() void CFrontEndUI::StopAttractMovie()
@ -45,7 +45,7 @@ void CFrontEndUI::UpdateMenuHighlights(CGuiTableGroup* grp)
void CFrontEndUI::CompleteStateTransition() void CFrontEndUI::CompleteStateTransition()
{} {}
bool CFrontEndUI::CanBuild(const SObjectTag& tag) bool CFrontEndUI::CanBuild(const SObjectTag& tag)
{} {return false;}
void CFrontEndUI::StartStateTransition(EScreen screen) void CFrontEndUI::StartStateTransition(EScreen screen)
{} {}
void CFrontEndUI::HandleDebugMenuReturnValue(CGameDebug::EReturnValue val, CArchitectureQueue& queue) void CFrontEndUI::HandleDebugMenuReturnValue(CGameDebug::EReturnValue val, CArchitectureQueue& queue)
@ -57,7 +57,7 @@ void CFrontEndUI::UpdateMovies(float dt)
void CFrontEndUI::Update(float dt, CArchitectureQueue& queue) void CFrontEndUI::Update(float dt, CArchitectureQueue& queue)
{} {}
CIOWin::EMessageReturn CFrontEndUI::OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue) CIOWin::EMessageReturn CFrontEndUI::OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue)
{} {return MsgRetNormal;}
void CFrontEndUI::StartGame() void CFrontEndUI::StartGame()
{} {}
void CFrontEndUI::InitializeFrame() void CFrontEndUI::InitializeFrame()

View File

@ -8,7 +8,7 @@ namespace Retro
{ {
class CGuiSliderGroup; class CGuiSliderGroup;
class CGuiTableGroup; class CGuiTableGroup;
class SObjectTag; struct SObjectTag;
namespace MP1 namespace MP1
{ {

View File

@ -57,7 +57,7 @@ public:
void StreamNewGameState(CInputStream&); void StreamNewGameState(CInputStream&);
void CheckTweakManagerDebugOptions() {} void CheckTweakManagerDebugOptions() {}
void AddWorldPaks(); void AddWorldPaks();
int RsMain(int argc, const char* argv[]); int RsMain(int argc, const boo::SystemChar* argv[]);
bool CheckReset(); bool CheckReset();
bool CheckTerminate() {return false;} bool CheckTerminate() {return false;}
void DrawDebugMetrics(double, CStopwatch&) {} void DrawDebugMetrics(double, CStopwatch&) {}

View File

@ -16,5 +16,5 @@ target_link_libraries(mp1
DNAMP1 DNAMP1
DNACommon DNACommon
HECLDatabase HECLBlender HECLCommon AthenaCore NOD HECLDatabase HECLBlender HECLCommon AthenaCore NOD
LogVisor AthenaLibYaml Boo png squish blowfish z lzo2 pthread LogVisor AthenaLibYaml Boo png squish blowfish z lzo2
${BOO_SYS_LIBS}) ${BOO_SYS_LIBS})

View File

@ -1,3 +1,8 @@
#if _WIN32
#include <objbase.h>
#endif
#include <clocale>
#include <memory> #include <memory>
#include <boo/boo.hpp> #include <boo/boo.hpp>
#include "CBasics.hpp" #include "CBasics.hpp"
@ -139,7 +144,7 @@ void CMain::FillInAssetIDs()
void CMain::LoadAudio() void CMain::LoadAudio()
{ {
} }
int CMain::RsMain(int argc, const char* argv[]) int CMain::RsMain(int argc, const boo::SystemChar* argv[])
{ {
TOneStatic<CGameGlobalObjects> globalObjs; TOneStatic<CGameGlobalObjects> globalObjs;
InitializeSubsystems(); InitializeSubsystems();
@ -159,11 +164,21 @@ int CMain::RsMain(int argc, const char* argv[])
} }
} }
#ifdef _WIN32
int wmain(int argc, const wchar_t* argv[])
#else
int main(int argc, const char* argv[]) int main(int argc, const char* argv[])
#endif
{ {
#if _WIN32
CoInitializeEx(nullptr, COINIT_MULTITHREADED);
#else
std::setlocale(LC_ALL, "en-US.UTF-8");
#endif
Retro::TOneStatic<Retro::MP1::CMain> main; Retro::TOneStatic<Retro::MP1::CMain> main;
std::unique_ptr<boo::IApplication> app = std::unique_ptr<boo::IApplication> app =
boo::ApplicationBootstrap(boo::IApplication::PLAT_AUTO, *main, boo::ApplicationBootstrap(boo::IApplication::PLAT_AUTO, *main,
"mp1", "MP1", argc, argv); _S("mp1"), _S("MP1"), argc, argv);
return main->RsMain(argc, argv); return main->RsMain(argc, argv);
} }

2
hecl

@ -1 +1 @@
Subproject commit b80f351d65b15d9a0ffe28625d69f718be074257 Subproject commit 9666a8ec9ce14a5b248757d7c393d379f825f656

2
libBoo

@ -1 +1 @@
Subproject commit f9c4ed076157c78fd131f83c5d0f3bc4c95ae13a Subproject commit 49771b0e15fc9a7a7974dfc9b8c74fe4b25d66a5