Skip to content

Commit

Permalink
Fix Startup Blackscreen Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Gamepiaynmo committed Jul 11, 2021
1 parent 263717e commit a03ff7e
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 10 deletions.
2 changes: 1 addition & 1 deletion BuildVer.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#define BML_MAJOR_VER 0
#define BML_MINOR_VER 3
#define BML_BUILD_VER 37
#define BML_BUILD_VER 40
2 changes: 2 additions & 0 deletions IBML.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,6 @@ class BML_EXPORT IBML : public IMessageReceiver {

virtual float GetSRScore() = 0;
virtual int GetHSScore() = 0;

virtual void SkipRenderForNextTick() = 0;
};
13 changes: 10 additions & 3 deletions ModLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,13 @@ CKERROR Player::Process() {

// Render Tick
CKERROR Player::Render(CK_RENDER_FLAGS flags) {
CKERROR result = ModLoader::m_instance->GetCKContext()->GetPlayerRenderContext()->Render(flags);
ModLoader::m_instance->Render(flags, result);
return result;
if (!ModLoader::m_instance->IsSkipRender()) {
CKERROR result = ModLoader::m_instance->GetCKContext()->GetPlayerRenderContext()->Render(flags);
ModLoader::m_instance->Render(flags, result);
return result;
}

return CK_OK;
}

CKERROR ModLoader::Step(CKDWORD result) {
Expand Down Expand Up @@ -361,13 +365,16 @@ void ModLoader::RegisterModBBs(XObjectDeclarationArray* reg) {
}

void ModLoader::Process(CKERROR result) {
m_skipRender = false;
for (auto iter = m_timers.begin(); iter != m_timers.end(); ) {
if (!iter->Process(m_timeManager->GetMainTickCount(), m_timeManager->GetAbsoluteTime()))
iter = m_timers.erase(iter);
else iter++;
}

BroadcastCallback(&IMod::OnProcess, &IMod::OnProcess);
if (m_inputManager->IsKeyDown(CKKEY_F))
SkipRenderForNextTick();

m_inputManager->Process();
}
Expand Down
4 changes: 4 additions & 0 deletions ModLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ class ModLoader : public IBML {
virtual float GetSRScore() override;
virtual int GetHSScore() override;

virtual void SkipRenderForNextTick() override { m_skipRender = true; }
bool IsSkipRender() { return m_skipRender; }

private:
bool m_inited = false;
bool m_exiting = false;
Expand Down Expand Up @@ -229,6 +232,7 @@ class ModLoader : public IBML {
ICommand* FindCommand(const std::string& name);

bool m_ingame = false, m_paused = false;
bool m_skipRender = false;

std::map<void*, std::vector<IMod*>> m_callback_map;
void FillCallbackMap(IMod* mod);
Expand Down
6 changes: 3 additions & 3 deletions virtools/CKDataArray.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "CKDataArray.h"

NAKED void CKDataArray::InsertColumn(int cdest, CK_ARRAYTYPE type, char* name, CKGUID paramguid) {
NAKED void CKDataArray::InsertColumn(int cdest, CK_ARRAYTYPE type, CKSTRING name, CKGUID paramguid) {
JUMP(0x2402696F);
}

Expand All @@ -12,7 +12,7 @@ NAKED void CKDataArray::RemoveColumn(int c) {
JUMP(0x24026C3D);
}

NAKED void CKDataArray::SetColumnName(int c, char* name) {
NAKED void CKDataArray::SetColumnName(int c, CKSTRING name) {
JUMP(0x24026D82);
}

Expand Down Expand Up @@ -56,7 +56,7 @@ NAKED CKObject* CKDataArray::GetElementObject(int i, int c) {
JUMP(0x240273EE);
}

NAKED CKBOOL CKDataArray::SetElementValue(int i, int c, void* value, int size) {
NAKED CKBOOL CKDataArray::SetElementValue(int i, int c, const void* value, int size) {
JUMP(0x24027410);
}

Expand Down
6 changes: 3 additions & 3 deletions virtools/CKDataArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ typedef XSArray<CKDWORD> CKDataRow;

class BML_EXPORT CKDataArray : public CKBeObject {
public:
void InsertColumn(int cdest, CK_ARRAYTYPE type, char* name, CKGUID paramguid = CKGUID(0, 0));
void InsertColumn(int cdest, CK_ARRAYTYPE type, CKSTRING name, CKGUID paramguid = CKGUID(0, 0));
void MoveColumn(int csrc, int cdest);
void RemoveColumn(int c);
void SetColumnName(int c, char* name);
void SetColumnName(int c, CKSTRING name);
char* GetColumnName(int c);
void SetColumnType(int c, CK_ARRAYTYPE type, CKGUID paramguid = CKGUID(0, 0));
CK_ARRAYTYPE GetColumnType(int c);
Expand All @@ -24,7 +24,7 @@ class BML_EXPORT CKDataArray : public CKBeObject {
CKBOOL GetElementValue(int i, int c, void* value);
CKObject* GetElementObject(int i, int c);

CKBOOL SetElementValue(int i, int c, void* value, int size = 0);
CKBOOL SetElementValue(int i, int c, const void* value, int size = 0);
CKBOOL SetElementValueFromParameter(int i, int c, CKParameter* pout);
CKBOOL SetElementObject(int i, int c, CKObject* object);

Expand Down

0 comments on commit a03ff7e

Please sign in to comment.