Skip to content

Commit dad84e1

Browse files
committed
More GUI Progress
Reordered project structure
1 parent f77ea21 commit dad84e1

25 files changed

+452
-67
lines changed

OpenJPOG/Source/GUI/AGUISystem.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ TBOOL AGUISystem::OnCreate()
1515
auto pRenderer = g_oTheApp.GetRootTask()->GetRenderInterface();
1616
m_pNullResource = (TNullResource *)pRenderer->CreateResource(&TGetClass(TNullResource), TNULL, TNULL);
1717
m_pGUIInterface->Create();
18+
m_pDisplayContext = new PGUITRDisplayContext();
19+
m_pDisplayContext->Create(g_oTheApp.GetRootTask()->GetRenderInterface(), m_pTextureFactory, m_pFontFactory);
1820
return TBOOL();
1921
}
2022

OpenJPOG/Source/GUI/AGUISystem.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "TKernel/TManagedPointer.h"
55
#include "TRender/TNullResource.h"
66
#include "TGui/TGUIInterface.h"
7+
#include "PGuiRenderer/PGUITRDisplayContext.h"
78

89
class AGUISystem : public Toshi::TTask
910
{
@@ -24,5 +25,8 @@ class AGUISystem : public Toshi::TTask
2425

2526
private:
2627
Toshi::TGUIInterface *m_pGUIInterface; // 0x24
28+
PGUITRDisplayContext *m_pDisplayContext; // 0xA4
29+
PGUITRTextureFactory *m_pTextureFactory; // 0xA8
30+
PGUITRFontFactory *m_pFontFactory; // 0xAC
2731
Toshi::TNullResource *m_pNullResource; // 0x140
2832
};

OpenJPOG/premake5.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ project ("OpenJPOG")
1010
"TRenderInterface",
1111
"TRenderD3DInterface",
1212
"TGuiInterface",
13+
"PGUIRenderer",
1314
"PPropertyParser",
1415
"d3d8.lib",
1516
"d3dx8.lib",
@@ -63,7 +64,9 @@ project ("OpenJPOG")
6364
"{COPY} \"%{wks.location}bin/" .. outputdir .. "/TRenderInterface/TRenderInterface.dll\" \"%{wks.location}bin/" .. outputdir .. "/%{prj.name}\"",
6465
"{COPY} \"%{wks.location}bin/" .. outputdir .. "/TRenderD3DInterface/TRenderD3DInterface.dll\" \"%{wks.location}bin/" .. outputdir .. "/%{prj.name}\"",
6566
"{COPY} \"%{wks.location}bin/" .. outputdir .. "/TGuiInterface/TGuiInterface.dll\" \"%{wks.location}bin/" .. outputdir .. "/%{prj.name}\"",
67+
"{COPY} \"%{wks.location}bin/" .. outputdir .. "/TSpriteShaderD3D/TSpriteShaderD3D.dll\" \"%{wks.location}bin/" .. outputdir .. "/%{prj.name}\"",
6668
"{COPY} \"%{wks.location}bin/" .. outputdir .. "/PPropertyParser/PPropertyParser.dll\" \"%{wks.location}bin/" .. outputdir .. "/%{prj.name}\"",
69+
"{COPY} \"%{wks.location}bin/" .. outputdir .. "/PGUIRenderer/PGUIRenderer.dll\" \"%{wks.location}bin/" .. outputdir .. "/%{prj.name}\"",
6770
"{COPY} \"%{wks.location}Toshi/vendor/fmod/lib/fmod.dll\" \"%{wks.location}bin/" .. outputdir .. "/%{prj.name}\"",
6871
"{COPY} \"%{wks.location}Toshi/vendor/bink/lib/binkw32.dll\" \"%{wks.location}bin/" .. outputdir .. "/%{prj.name}\"",
6972
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#pragma once
2+
#include "Defines.h"
3+
#include "TKernel/TObject.h"
4+
5+
TOSHI_NAMESPACE_BEGIN
6+
7+
class TGUIINTERFACE_EXPORTS TGUITextureFactory : public TObject
8+
{
9+
DECLARE_DYNAMIC(TGUITextureFactory)
10+
};
11+
12+
TOSHI_NAMESPACE_END

Toshi/Include/TGui/TGUIDeserialisable.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ class TGUIINTERFACE_EXPORTS TGUIDeserialisable : public TObject
1212

1313
public:
1414
static TGUIDeserialisable *TOSHI_API Create(TGUIInterface *a_pInterface, const PProperties *a_pProperties);
15+
16+
TBOOL ValidateProperty(const TPCString &a_rPropName, const PPropertyValue &a_rValue);
1517
};
1618

1719
TOSHI_NAMESPACE_END

Toshi/Include/TGui/TGUIDisplayContext.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class TGUIINTERFACE_EXPORTS TGUIDisplayContext : public TObject
1919
virtual void PushClip(int a_iMinX, int a_iMinY, int a_MaxX, int a_iMaxY);
2020
virtual void PopClip();
2121
virtual void PushRotation(float a_fRotation, int a_iX, int a_iY) = 0;
22-
virtual void PushRotation(float a_fRotation) = 0;
22+
virtual void PushRotation(float a_fRotation) ;
2323
virtual void PushScale(float a_fYaw, float a_fPitch) = 0;
2424
virtual void PopTransform() = 0;
2525
virtual void PushModulateColour(const TGUIColour &m_rColour) = 0;
@@ -36,7 +36,7 @@ class TGUIINTERFACE_EXPORTS TGUIDisplayContext : public TObject
3636
virtual void DrawLabel(const TGUIRectangle &a_rRectangle, const TGUIFont *m_pFont, const TGUIColour &m_rColour, const TLString &a_rLabel, const TGUIRectangle &a_rRectangle2) = 0;
3737
virtual void DrawLabel(const TGUIRectangle &a_rRectangle, const TGUIFont *m_pFont, const TGUIColour &m_rColour, const TLString &a_rLabel) = 0;
3838
virtual void DrawLabel(const TGUIRectangle &a_rRectangle, const TGUIFont *m_pFont, const TGUIColour &m_rColour, const TWString &a_rLabel, bool) = 0;
39-
virtual void DrawFormattedText(const TGUIFormattedText &a_rFormattedText, int a_iX, int a_iY, int a_iWidth, int a_iHeight) = 0;
39+
virtual void DrawFormattedText(const TGUIFormattedText &a_rFormattedText, int a_iX, int a_iY, int a_iWidth, int a_iHeight) ;
4040

4141
protected:
4242
virtual void Imp_DrawTextureSection(const TGUITextureSection *a_rTextureSection, const TGUIColour &m_rColour, int a_iX, int a_iY, int a_iWidth, int a_iHeight, TGUIAlignment a_eAlignW, TGUIAlignment a_eAlignH) = 0;

Toshi/Include/TGui/TGUITextureSection.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#pragma once
2-
#pragma once
32
#include "Defines.h"
43

54
TOSHI_NAMESPACE_BEGIN
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#pragma once
2+
#include <Toshi/Toshi.h>
3+
4+
#ifndef PGUIRENDERER_STATIC_LINKING
5+
6+
# ifdef PGUIRENDERER
7+
# define PGUIRENDERER_EXPORTS DLL_CLASS_EXPORT
8+
# else
9+
# define PGUIRENDERER_EXPORTS DLL_CLASS_IMPORT
10+
# endif
11+
12+
#else // !PGUIRENDERER_STATIC_LINKING
13+
14+
# define PGUIRENDERER_EXPORTS
15+
16+
#endif // PGUIRENDERER_STATIC_LINKING
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#include "Defines.h"
2+
#include "TKernel/TObject.h"
3+
#include "TKernel/TManagedPointer.h"
4+
#include "TGui/TGUIDisplayContext.h"
5+
#include "TRender/TRenderInterface.h"
6+
#include "PGUITRTextureFactory.h"
7+
#include "PGUITRFontFactory.h"
8+
9+
class PGUIRENDERER_EXPORTS PGUITRDisplayContext : Toshi::TGUIDisplayContext
10+
{
11+
public:
12+
void Create();
13+
void Create(Toshi::TManagedPtr<Toshi::TRenderInterface> a_MPRenderer);
14+
void Create(Toshi::TManagedPtr<Toshi::TRenderInterface> a_MPRenderer, PGUITRTextureFactory *a_pTextureFactory, PGUITRFontFactory *a_pFontFactory);
15+
16+
17+
public:
18+
virtual void PushRotation(float a_fRotation, int a_iX, int a_iY) ;
19+
virtual void PushScale(float a_fYaw, float a_fPitch) ;
20+
virtual void PopTransform() ;
21+
virtual void PushModulateColour(const Toshi::TGUIColour & m_rColour);
22+
virtual void PopModulateColour() ;
23+
virtual void PushAdditiveColour(const Toshi::TGUIColour &m_rColour) ;
24+
virtual void PopAdditiveColour() ;
25+
virtual void BeginScene() ;
26+
virtual void EndScene() ;
27+
virtual void BeginPostpone() ;
28+
virtual void EndPostpone() ;
29+
virtual void DrawPostpone() ;
30+
virtual void DrawLine(int a_iX1, int a_iY1, int a_iX2, int a_iY2, const Toshi::TGUIColour &m_rColour) ;
31+
virtual void DrawTexturePie(const Toshi::TGUITextureSection &a_rTextureSection, const Toshi::TGUIColour &m_rColour, int a_iX, int a_iY, float a_fStartAngle, float m_fEndAngle) ;
32+
virtual void DrawLabel(const Toshi::TGUIRectangle &a_rRectangle, const Toshi::TGUIFont *m_pFont, const Toshi::TGUIColour &m_rColour, const Toshi::TLString &a_rLabel, const Toshi::TGUIRectangle &a_rRectangle2);
33+
virtual void DrawLabel(const Toshi::TGUIRectangle &a_rRectangle, const Toshi::TGUIFont *m_pFont, const Toshi::TGUIColour &m_rColour, const Toshi::TLString &a_rLabel) ;
34+
virtual void DrawLabel(const Toshi::TGUIRectangle &a_rRectangle, const Toshi::TGUIFont *m_pFont, const Toshi::TGUIColour &m_rColour, const Toshi::TWString &a_rLabel, bool) ;
35+
36+
protected:
37+
virtual void Imp_DrawTextureSection(const Toshi::TGUITextureSection *a_rTextureSection, const Toshi::TGUIColour &m_rColour, int a_iX, int a_iY, int a_iWidth, int a_iHeight, Toshi::TGUIAlignment a_eAlignW, Toshi::TGUIAlignment a_eAlignH);
38+
virtual void Imp_DrawFilledRectangle(int a_iX, int a_iY, int a_iWidth, int a_iHeight, const Toshi::TGUIColour &m_rColour) ;
39+
virtual void Imp_DrawOutlineRectangle(int a_iX, int a_iY, int a_iWidth, int a_iHeight, const Toshi::TGUIColour &m_rColour) ;
40+
41+
public:
42+
Toshi::TRenderInterface *GetRenderInterface() const
43+
{
44+
return m_MPRenderer;
45+
}
46+
47+
private:
48+
Toshi::TManagedPtr<Toshi::TRenderInterface> m_MPRenderer; // 0x210
49+
PGUITRTextureFactory *m_pTextureFactory; // 0x214
50+
PGUITRFontFactory *m_pFontFactory; // 0x218
51+
};
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#pragma once
2+
#include "Defines.h"
3+
4+
class PGUIRENDERER_EXPORTS PGUITRFontFactory
5+
{
6+
};

0 commit comments

Comments
 (0)