Skip to content

Commit

Permalink
Added AOptions
Browse files Browse the repository at this point in the history
Some more progress with PProperties
  • Loading branch information
AdventureT committed Jul 14, 2024
1 parent 5d74c54 commit 5a41446
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 14 deletions.
5 changes: 5 additions & 0 deletions OpenJPOG/Source/AOptions.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "AOptions.h"

TPCCHAR AOptions::sm_szOptionsDir = TNULL;
TPCCHAR AOptions::sm_szOptionsName = "Options";

27 changes: 27 additions & 0 deletions OpenJPOG/Source/AOptions.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#pragma once
#include "Toshi/Defines.h"
#include "PPropertyParser/PProperties.h"

class AOptions
{
public:
enum Result
{

};

TINT GetAutoSaveState() const
{
return m_iAutoSaveState;
}

private:
static TPCCHAR sm_szOptionsName;
static TPCCHAR sm_szOptionsDir;
static const TINT sm_iSlot = -1;
static const TINT sm_iPort = -1;

TINT m_iAutoSaveState; // 0x1C
PProperty *m_pCurProps; // 0x24
};

3 changes: 3 additions & 0 deletions OpenJPOG/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ project ("OpenJPOG")
"TApplication",
"TRenderInterface",
"TRenderD3DInterface",
"PPropertyParser",
"d3d8.lib",
"d3dx8.lib",
"dxguid.lib",
Expand All @@ -32,6 +33,7 @@ project ("OpenJPOG")
includedirs
{
"%{wks.location}/Toshi/Include",
"%{wks.location}/Toshi/Plugins/Include",
"Source",
"%{IncludeDir.fmod}",
"%{IncludeDir.bink}"
Expand Down Expand Up @@ -60,6 +62,7 @@ project ("OpenJPOG")
"{COPY} \"%{wks.location}bin/" .. outputdir .. "/TApplication/TApplication.dll\" \"%{wks.location}bin/" .. outputdir .. "/%{prj.name}\"",
"{COPY} \"%{wks.location}bin/" .. outputdir .. "/TRenderInterface/TRenderInterface.dll\" \"%{wks.location}bin/" .. outputdir .. "/%{prj.name}\"",
"{COPY} \"%{wks.location}bin/" .. outputdir .. "/TRenderD3DInterface/TRenderD3DInterface.dll\" \"%{wks.location}bin/" .. outputdir .. "/%{prj.name}\"",
"{COPY} \"%{wks.location}bin/" .. outputdir .. "/PPropertyParser/PPropertyParser.dll\" \"%{wks.location}bin/" .. outputdir .. "/%{prj.name}\"",
"{COPY} \"%{wks.location}Toshi/vendor/fmod/lib/fmod.dll\" \"%{wks.location}bin/" .. outputdir .. "/%{prj.name}\"",
"{COPY} \"%{wks.location}Toshi/vendor/bink/lib/binkw32.dll\" \"%{wks.location}bin/" .. outputdir .. "/%{prj.name}\"",
}
Expand Down
51 changes: 38 additions & 13 deletions Toshi/Plugins/Include/PPropertyParser/PProperties.h
Original file line number Diff line number Diff line change
@@ -1,28 +1,53 @@
#pragma once
#include "Defines.h"
#include "TKernel/TObject.h"
#include "TFreeList.h"
#include "TQList.h"
#include "PPropertyValue.h"
#include "PPropertyName.h"
#include "TPCString.h"

class PPROPERTYPARSER_EXPORTS PProperty : public Toshi::TQList<PProperty>::TNode
class PPROPERTYPARSER_EXPORTS PProperties : Toshi::TObject
{
DECLARE_FREELIST(PProperty)
DECLARE_DYNAMIC(PProperties)

public:
class PPROPERTYPARSER_EXPORTS PProperty : public Toshi::TQList<PProperty>::TNode
{
DECLARE_FREELIST(PProperty)

void SetLine(TINT a_iLine) { m_iLine = a_iLine; }
public:

TINT GetLine() const { return m_iLine; }
const PPropertyName& GetName() const { return m_oName; }
const PPropertyValue& GetValue() const { return m_oValue; }
void SetLine(TINT a_iLine) { m_iLine = a_iLine; }

private:
// 0x0 m_pNext
// 0x4 m_pPrev
PPropertyName m_oName; // 0x8
PPropertyValue m_oValue; // 0x10
TINT m_iLine; // 0x18
Toshi::TPCString m_sComment; // 0x1C
TINT GetLine() const { return m_iLine; }
const PPropertyName &GetName() const { return m_oName; }
const PPropertyValue &GetValue() const { return m_oValue; }

private:
// 0x0 m_pNext
// 0x4 m_pPrev
PPropertyName m_oName; // 0x8
PPropertyValue m_oValue; // 0x10
TINT m_iLine; // 0x18
Toshi::TPCString m_sComment; // 0x1C
};

PProperties()
{
m_pParentProps = TNULL;
m_iPropCount = 0;
}

PProperties(PProperties *a_pParentProps)
{
m_pParentProps = a_pParentProps;
m_iPropCount = 0;
}

const PProperty *FindProperty(const Toshi::TPCString &a_szProperty, Toshi::TQList<PProperty>::Iterator &a_oProperties);

PProperties *m_pParentProps; // 0x8
Toshi::TQList<PProperty> m_oPropsQueue; // 0xC
TINT m_iPropCount; //0x14
};
5 changes: 5 additions & 0 deletions Toshi/Plugins/Include/PPropertyParser/PPropertyName.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

class PPROPERTYPARSER_EXPORTS PPropertyName
{
public:
const TPCString &GetName() const
{
return m_oName;
}
private:
Toshi::TPCString m_oName;
Toshi::TPCString m_oSubName;
Expand Down
12 changes: 11 additions & 1 deletion Toshi/Plugins/Source/PPropertyParser/PProperties.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
#include "PPropertyParser/PProperties.h"

IMPLEMENT_FREELIST(PProperty, 0, 8)
TOSHI_NAMESPACE_USING

IMPLEMENT_FREELIST(PProperties::PProperty, 0, 8)
IMPLEMENT_DYNCREATE(PProperties, TObject)

const PProperties::PProperty *PProperties::FindProperty(const Toshi::TPCString &a_szProperty, TQList<PProperty>::Iterator &a_oProperties)
{
for (auto it = a_oProperties; it != m_oPropsQueue.End(); it++) {
}
return nullptr;
}

0 comments on commit 5a41446

Please sign in to comment.