Skip to content

Commit

Permalink
Merge pull request HarbourMasters#19 from Kenix3/rebrand_part_2
Browse files Browse the repository at this point in the history
Removes references to OTR in variables and comments.
  • Loading branch information
Kenix3 committed Jan 11, 2022
2 parents 9d55b99 + 5c4e04d commit 970f251
Show file tree
Hide file tree
Showing 23 changed files with 76 additions and 77 deletions.
10 changes: 5 additions & 5 deletions otrlib/Archive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ namespace Ship {

std::shared_ptr<Archive> Archive::CreateArchive(std::string archivePath)
{
Archive* otrArchive = new Archive();
otrArchive->MainPath = archivePath;
Archive* archive = new Archive();
archive->MainPath = archivePath;

TCHAR* t_filename = new TCHAR[archivePath.size() + 1];
t_filename[archivePath.size()] = 0;
std::copy(archivePath.begin(), archivePath.end(), t_filename);

bool success = SFileCreateArchive(t_filename, MPQ_CREATE_LISTFILE | MPQ_CREATE_ATTRIBUTES | MPQ_CREATE_ARCHIVE_V2, 65536 * 4, &otrArchive->mainMPQ);
bool success = SFileCreateArchive(t_filename, MPQ_CREATE_LISTFILE | MPQ_CREATE_ATTRIBUTES | MPQ_CREATE_ARCHIVE_V2, 65536 * 4, &archive->mainMPQ);
int error = GetLastError();

if (success)
{
otrArchive->mpqHandles[archivePath] = otrArchive->mainMPQ;
return std::make_shared<Archive>(*otrArchive);
archive->mpqHandles[archivePath] = archive->mainMPQ;
return std::make_shared<Archive>(*archive);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion otrlib/Array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace Ship
case ScalarType::ZSCALAR_U16:
data.u16 = reader->ReadUInt16();
break;
// OTRTODO: IMPLEMENT OTHER TYPES!
// LUSTODO: IMPLEMENT OTHER TYPES!
}

arr->scalars.push_back(data);
Expand Down
1 change: 0 additions & 1 deletion otrlib/Controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

namespace Ship {
class Controller {
friend class OTRWindow;

public:
Controller(int32_t dwControllerNumber);
Expand Down
2 changes: 1 addition & 1 deletion otrlib/DisplayList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace Ship
uint8_t opcode = data >> 24;

// These are 128-bit commands, so read an extra 64 bits...
if (opcode == G_SETTIMG_OTR || opcode == G_DL_OTR || opcode == G_VTX_OTR || opcode == G_MARKER)
if (opcode == G_SETTIMG_LUS || opcode == G_DL_LUS || opcode == G_VTX_LUS || opcode == G_MARKER)
dl->instructions.push_back(reader->ReadUInt64());

if (opcode == G_ENDDL)
Expand Down
4 changes: 2 additions & 2 deletions otrlib/Factories/ArrayFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ namespace Ship
{
case Version::Deckard:
{
ArrayV0 otrArr = ArrayV0();
otrArr.ParseFileBinary(reader, arr);
ArrayV0 arrayObj = ArrayV0();
arrayObj.ParseFileBinary(reader, arr);
}
break;
default:
Expand Down
4 changes: 2 additions & 2 deletions otrlib/Factories/CollisionHeaderFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ namespace Ship
{
case Version::Deckard:
{
CollisionHeaderV0 otrCol = CollisionHeaderV0();
otrCol.ParseFileBinary(reader, colHeader);
CollisionHeaderV0 col = CollisionHeaderV0();
col.ParseFileBinary(reader, colHeader);
}
break;
default:
Expand Down
4 changes: 2 additions & 2 deletions otrlib/Factories/CutsceneFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ namespace Ship
{
case Version::Deckard:
{
CutsceneV0 otrCS = CutsceneV0();
otrCS.ParseFileBinary(reader, cs);
CutsceneV0 cutscene = CutsceneV0();
cutscene.ParseFileBinary(reader, cs);
}
break;
default:
Expand Down
4 changes: 2 additions & 2 deletions otrlib/Factories/DisplayListFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ namespace Ship
{
case Version::Deckard:
{
DisplayListV0 otrDL = DisplayListV0();
otrDL.ParseFileBinary(reader, dl);
DisplayListV0 DL = DisplayListV0();
DL.ParseFileBinary(reader, dl);
}
break;
default:
Expand Down
4 changes: 2 additions & 2 deletions otrlib/Factories/MaterialFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ namespace Ship
{
case Version::Deckard:
{
MaterialV0 otrMat = MaterialV0();
otrMat.ParseFileBinary(reader, mat);
MaterialV0 Material = MaterialV0();
Material.ParseFileBinary(reader, mat);
}
break;
default:
Expand Down
4 changes: 2 additions & 2 deletions otrlib/Factories/PathFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ namespace Ship
{
case Version::Deckard:
{
PathV0 otrPath;
otrPath.ParseFileBinary(reader, path);
PathV0 Path;
Path.ParseFileBinary(reader, path);
}
break;
default:
Expand Down
4 changes: 2 additions & 2 deletions otrlib/Factories/PlayerAnimationFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ namespace Ship
{
case Version::Deckard:
{
PlayerAnimationV0 otrAnim = PlayerAnimationV0();
otrAnim.ParseFileBinary(reader, anim);
PlayerAnimationV0 Anim = PlayerAnimationV0();
Anim.ParseFileBinary(reader, anim);
}
break;
default:
Expand Down
22 changes: 11 additions & 11 deletions otrlib/Factories/ResourceLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,37 +24,37 @@ namespace Ship

switch (resourceType)
{
case ResourceType::OTRMaterial:
case ResourceType::Material:
result = MaterialFactory::ReadMaterial(reader);
break;
case ResourceType::OTRRoom:
case ResourceType::Room:
result = SceneFactory::ReadScene(reader);
break;
case ResourceType::OTRCollisionHeader:
case ResourceType::CollisionHeader:
result = CollisionHeaderFactory::ReadCollisionHeader(reader);
break;
case ResourceType::OTRDisplayList:
case ResourceType::DisplayList:
result = DisplayListFactory::ReadDisplayList(reader);
break;
case ResourceType::OTRPlayerAnimation:
case ResourceType::PlayerAnimation:
result = PlayerAnimationFactory::ReadPlayerAnimation(reader);
break;
case ResourceType::OTRSkeleton:
case ResourceType::Skeleton:
result = SkeletonFactory::ReadSkeleton(reader);
break;
case ResourceType::OTRSkeletonLimb:
case ResourceType::SkeletonLimb:
result = SkeletonLimbFactory::ReadSkeletonLimb(reader);
break;
case ResourceType::OTRVtx:
case ResourceType::Vertex:
result = VertexFactory::ReadVtx(reader);
break;
case ResourceType::OTRAnimation:
case ResourceType::Animation:
result = AnimationFactory::ReadAnimation(reader);
break;
case ResourceType::OTRCutscene:
case ResourceType::Cutscene:
result = CutsceneFactory::ReadCutscene(reader);
break;
case ResourceType::OTRArray:
case ResourceType::Array:
result = ArrayFactory::ReadArray(reader);
break;
default:
Expand Down
4 changes: 2 additions & 2 deletions otrlib/Factories/SceneFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ namespace Ship
{
case Version::Deckard:
{
SceneV0 otrScene = SceneV0();
otrScene.ParseFileBinary(reader, scene);
SceneV0 Scene = SceneV0();
Scene.ParseFileBinary(reader, scene);
}
break;
default:
Expand Down
4 changes: 2 additions & 2 deletions otrlib/Factories/SkeletonFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ namespace Ship
{
case Version::Deckard:
{
SkeletonV0 otrSkel = SkeletonV0();
otrSkel.ParseFileBinary(reader, skel);
SkeletonV0 Skel = SkeletonV0();
Skel.ParseFileBinary(reader, skel);
}
break;
default:
Expand Down
4 changes: 2 additions & 2 deletions otrlib/Factories/SkeletonLimbFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ namespace Ship
{
case Version::Deckard:
{
SkeletonLimbV0 otrLimb = SkeletonLimbV0();
otrLimb.ParseFileBinary(reader, limb);
SkeletonLimbV0 Limb = SkeletonLimbV0();
Limb.ParseFileBinary(reader, limb);
}
break;
default:
Expand Down
4 changes: 2 additions & 2 deletions otrlib/Factories/VtxFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ namespace Ship
{
case 0:
{
VertexV0 otrVtx = VertexV0();
otrVtx.ParseFileBinary(reader, vtx);
VertexV0 Vtx = VertexV0();
Vtx.ParseFileBinary(reader, vtx);
}
break;
default:
Expand Down
2 changes: 1 addition & 1 deletion otrlib/GlobalCtx2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ namespace Ship {
void GlobalCtx2::InitWindow() {
ResMan = std::make_shared<ResourceMgr>(GlobalCtx2::GetInstance(), MainPath, PatchesPath);
Win = std::make_shared<Window>(GlobalCtx2::GetInstance());
Config = std::make_shared<ConfigFile>(GlobalCtx2::GetInstance(), "otr.ini");
Config = std::make_shared<ConfigFile>(GlobalCtx2::GetInstance(), "shipofharkinian.ini");
}

void GlobalCtx2::InitLogging() {
Expand Down
6 changes: 3 additions & 3 deletions otrlib/Lib/Fast3D/U64/PR/ultra64/gbi.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@
#define G_TEXRECT 0xe4 /* -28 */

// CUSTOM OTR COMMANDS
#define G_SETTIMG_OTR 0x20
#define G_DL_OTR 0x31
#define G_VTX_OTR 0x32
#define G_SETTIMG_LUS 0x20
#define G_DL_LUS 0x31
#define G_VTX_LUS 0x32
#define G_MARKER 0x33

/*
Expand Down
34 changes: 17 additions & 17 deletions otrlib/Resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ namespace Ship
{
enum class ResourceType
{
OTRArchive = 0x4F415243, // OARC
OTRModel = 0x4F4D444C, // OMDL
OTRTexture = 0x4F544558, // OTEX
OTRMaterial = 0x4F4D4154, // OMAT
OTRAnimation = 0x4F414E4D, // OANM
OTRPlayerAnimation = 0x4F50414D, // OPAM
OTRDisplayList = 0x4F444C54, // ODLT
OTRRoom = 0x4F524F4D, // OROM
OTRCollisionHeader = 0x4F434F4C, // OCOL
OTRSkeleton = 0x4F534B4C, // OSKL
OTRSkeletonLimb = 0x4F534C42, // OSLB
OTRMatrix = 0x4F4D5458, // OMTX
OTRPath = 0x4F505448, // OPTH
OTRVtx = 0x4F565458, // OVTX
OTRCutscene = 0x4F435654, // OCUT
OTRArray = 0x4F415252, // OARR
Archive = 0x4F415243, // OARC
Model = 0x4F4D444C, // OMDL
Texture = 0x4F544558, // OTEX
Material = 0x4F4D4154, // OMAT
Animation = 0x4F414E4D, // OANM
PlayerAnimation = 0x4F50414D, // OPAM
DisplayList = 0x4F444C54, // ODLT
Room = 0x4F524F4D, // OROM
CollisionHeader = 0x4F434F4C, // OCOL
Skeleton = 0x4F534B4C, // OSKL
SkeletonLimb = 0x4F534C42, // OSLB
Matrix = 0x4F4D5458, // OMTX
Path = 0x4F505448, // OPTH
Vertex = 0x4F565458, // OVTX
Cutscene = 0x4F435654, // OCUT
Array = 0x4F415252, // OARR
};

enum class DataType
Expand Down Expand Up @@ -99,7 +99,7 @@ namespace Ship
public:
Endianess endianess; // 0x00 - Endianess of the file
uint32_t resourceType; // 0x01 - 4 byte MAGIC
Version version; // 0x05 - Based on OTR release numbers
Version version; // 0x05 - Based on Ship release numbers
uint64_t id; // 0x09 - Unique Resource ID

virtual void ParseFileBinary(BinaryReader* reader, Resource* res);
Expand Down
4 changes: 2 additions & 2 deletions otrlib/ResourceMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ namespace Ship

private:
std::weak_ptr<GlobalCtx2> Context;
std::map<std::string, std::shared_ptr<File>> fileCache;
std::map<std::string, std::shared_ptr<Resource>> otrCache;
std::map<std::string, std::shared_ptr<File>> FileCache;
std::map<std::string, std::shared_ptr<Resource>> Cache;
std::map<std::string, std::shared_ptr<std::unordered_set<uintptr_t>>> gameResourceAddresses;
std::shared_ptr<Archive> archive;
};
Expand Down
4 changes: 2 additions & 2 deletions otrlib/Scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ namespace Ship
reader->ReadByte(); // camSize
reader->ReadInt32(); // segOffset

// OTRTODO: FINISH!
// LUSTODO: FINISH!
}

MeshData::MeshData()
Expand All @@ -154,7 +154,7 @@ namespace Ship
{
MeshData mesh;

// OTRTODO: FINISH THIS!
// LUSTODO: FINISH THIS!
if (meshHeaderType == 0)
{
int polyType = reader->ReadByte();
Expand Down
4 changes: 2 additions & 2 deletions otrlib/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ namespace Ship {
return bIsProcessed;
}

extern "C" void OTRToggleConsole();
extern "C" void ToggleConsole();

bool Window::KeyUp(int32_t dwScancode) {
std::shared_ptr<ConfigFile> pConf = GlobalCtx2::GetInstance()->GetConfig();
Expand All @@ -170,7 +170,7 @@ namespace Ship {

if (dwScancode == Ship::stoi(Conf["KEYBOARD SHORTCUTS"]["KEY_CONSOLE"]))
{
OTRToggleConsole();
ToggleConsole();
}

bool bIsProcessed = false;
Expand Down
Loading

0 comments on commit 970f251

Please sign in to comment.