Skip to content

Commit

Permalink
!BROKEN!
Browse files Browse the repository at this point in the history
  • Loading branch information
AdventureT committed Dec 17, 2023
1 parent cea6ef0 commit 6ee36ca
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 0 deletions.
11 changes: 11 additions & 0 deletions OpenJPOG/Source/ARootTask.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
#include "ARootTask.h"

class AApplication;
extern AApplication g_oTheApp;

TOSHI_NAMESPACE_USING

IMPLEMENT_DYNCREATE(ARootTask, TTask);

void ARootTask::AllocateInputSystem()
{
TScheduler* pScheduler = g_oTheApp.GetKernel()->GetScheduler();
ADummyTask* pInputTask = g_oTheApp.GetInputRootTask();
m_pInputTask = pScheduler->CreateTask(TGetClass(ADummyTask), pInputTask);
m_pVibrationTask = (AVibrationManager*)pScheduler->CreateTask(TGetClass(AVibrationManager), pInputTask);

}
6 changes: 6 additions & 0 deletions OpenJPOG/Source/ARootTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "TKernel/TTask.h"
#include "TKernel/TCString.h"
#include "AVibrationManager.h"

class ARootTask : public Toshi::TTask
{
Expand All @@ -15,6 +16,11 @@ class ARootTask : public Toshi::TTask
m_szName = a_szName;
}

private:
void AllocateInputSystem();

private:
Toshi::TCString m_szName;
TTask* m_pInputTask; // 0x38
AVibrationManager* m_pVibrationTask; // 0xE8
};
5 changes: 5 additions & 0 deletions OpenJPOG/Source/AVibrationManager.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "AVibrationManager.h"

TOSHI_NAMESPACE_USING

IMPLEMENT_DYNCREATE(AVibrationManager, TTask);
15 changes: 15 additions & 0 deletions OpenJPOG/Source/AVibrationManager.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#pragma once
#include "TKernel/TTask.h"
#include "TKernel/TCString.h"

class AVibrationManager : public Toshi::TTask
{
DECLARE_DYNAMIC(AVibrationManager);
public:
AVibrationManager() = default;
virtual ~AVibrationManager() = default;

private:

private:
};
13 changes: 13 additions & 0 deletions OpenJPOG/Source/main.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
#include "TApplication/TApplication.h"
#include "TKernel/TMemory.h"
#include "ADummyTask.h"

class AApplication : public Toshi::TApplication
{
virtual TBOOL OnCreate(TINT argc, TPCHAR* const argv) override
{

m_pInputTask = (ADummyTask*)GetKernel()->GetScheduler()->CreateTask(TGetClass(ADummyTask), m_pInputTask);
m_pInputTask->Create();
m_pInputTask->Activate(TTRUE);
m_pInputTask->SetName((TPCHAR)"InputTask");

return TApplication::OnCreate(argc, argv);
}
public:
ADummyTask* GetInputRootTask() const { return m_pInputTask; }

private:
// TApplication 0x0 -> 0x1C
ADummyTask* m_pInputTask; // 0x1C
};

static AApplication g_oTheApp;
Expand Down
1 change: 1 addition & 0 deletions Toshi/Include/TKernel/TKernelInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class TOSHI_EXPORT TKernelInterface : public TObject
void DumpInfo();

THPTimer* GetSystemTimer() { return &m_oSysTimer; }
TScheduler* GetScheduler() const { return (TScheduler*)&m_pScheduler; }
private:
THPTimer m_oSysTimer; // 0x8
TManagedPointer<TScheduler> m_pScheduler; // 0x30
Expand Down
2 changes: 2 additions & 0 deletions Toshi/Include/TKernel/TTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class TOSHI_EXPORT TTask : public TObject, public TNodeTree<TTask>::TNode
virtual void OnActivate();
virtual void OnDeactivate();

void Activate(TBOOL a_bActivate);

TBOOL IsCreated() const { return HASFLAG(m_iState & State_Created); }
TBOOL IsActive() const { return HASFLAG(m_iState & State_Active); }
TBOOL IsDying() const { return HASFLAG(m_iState & State_Dying); }
Expand Down
4 changes: 4 additions & 0 deletions Toshi/Source/TKernel/TTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,7 @@ void TTask::OnActivate()
void TTask::OnDeactivate()
{
}

void TTask::Activate(TBOOL a_bActivate)
{
}

0 comments on commit 6ee36ca

Please sign in to comment.