mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-12-15 12:22:30 +00:00
fix(whoa): update thunderbrew to use the refactored squall error/validation and bc allocation macros
This commit is contained in:
parent
1aeacd0d2e
commit
46843880ef
66 changed files with 459 additions and 457 deletions
|
|
@ -42,6 +42,7 @@ target_link_libraries(event
|
|||
client
|
||||
gx
|
||||
PUBLIC
|
||||
bc
|
||||
common
|
||||
storm
|
||||
tempest
|
||||
|
|
|
|||
|
|
@ -136,12 +136,11 @@ void EventRegister(EVENTID id, EVENTHANDLERFUNC handler) {
|
|||
}
|
||||
|
||||
void EventRegisterEx(EVENTID id, EVENTHANDLERFUNC handler, void* param, float priority) {
|
||||
STORM_ASSERT(id >= 0);
|
||||
STORM_VALIDATE(id >= 0, ERROR_INVALID_PARAMETER);
|
||||
STORM_ASSERT(id < EVENTIDS);
|
||||
STORM_VALIDATE(id < EVENTIDS, ERROR_INVALID_PARAMETER);
|
||||
STORM_ASSERT(handler);
|
||||
STORM_VALIDATE(handler, ERROR_INVALID_PARAMETER);
|
||||
STORM_VALIDATE_BEGIN;
|
||||
STORM_VALIDATE(id >= 0);
|
||||
STORM_VALIDATE(id < EVENTIDS);
|
||||
STORM_VALIDATE(handler);
|
||||
STORM_VALIDATE_END_VOID;
|
||||
|
||||
HEVENTCONTEXT hContext = PropGet(PROP_EVENTCONTEXT);
|
||||
|
||||
|
|
|
|||
|
|
@ -192,8 +192,9 @@ void PostSize(EvtContext* context, int32_t w, int32_t h) {
|
|||
}
|
||||
|
||||
void ProcessInput(const int32_t param[], OSINPUT id, int32_t* shutdown, EvtContext* context) {
|
||||
STORM_ASSERT(context);
|
||||
STORM_VALIDATE(context, ERROR_INVALID_PARAMETER);
|
||||
STORM_VALIDATE_BEGIN;
|
||||
STORM_VALIDATE(context);
|
||||
STORM_VALIDATE_END_VOID;
|
||||
|
||||
switch (id) {
|
||||
case OS_INPUT_CAPTURE_CHANGED:
|
||||
|
|
@ -361,8 +362,9 @@ void ConvertPosition(int32_t clientx, int32_t clienty, float* x, float* y) {
|
|||
}
|
||||
|
||||
void EventSetMouseMode(MOUSEMODE mode, uint32_t holdButton) {
|
||||
STORM_ASSERT(mode < MOUSE_MODES);
|
||||
STORM_VALIDATE(mode < MOUSE_MODES, ERROR_INVALID_PARAMETER);
|
||||
STORM_VALIDATE_BEGIN;
|
||||
STORM_VALIDATE(mode < MOUSE_MODES);
|
||||
STORM_VALIDATE_END_VOID;
|
||||
|
||||
auto contextId = *reinterpret_cast<uint32_t*>(PropGet(PROP_EVENTCONTEXT));
|
||||
int32_t findMask;
|
||||
|
|
@ -468,8 +470,9 @@ void IEvtInputInitialize() {
|
|||
}
|
||||
|
||||
int32_t IEvtInputProcess(EvtContext* context, int32_t* shutdown) {
|
||||
STORM_ASSERT(context);
|
||||
STORM_VALIDATE(context, ERROR_INVALID_PARAMETER, 0);
|
||||
STORM_VALIDATE_BEGIN;
|
||||
STORM_VALIDATE(context);
|
||||
STORM_VALIDATE_END;
|
||||
|
||||
int32_t v4 = 0;
|
||||
OSINPUT id;
|
||||
|
|
@ -484,8 +487,9 @@ int32_t IEvtInputProcess(EvtContext* context, int32_t* shutdown) {
|
|||
}
|
||||
|
||||
void IEvtInputSetMouseMode(EvtContext* context, MOUSEMODE mode, uint32_t holdButton) {
|
||||
STORM_ASSERT(context);
|
||||
STORM_VALIDATE(context, ERROR_INVALID_PARAMETER);
|
||||
STORM_VALIDATE_BEGIN;
|
||||
STORM_VALIDATE(context);
|
||||
STORM_VALIDATE_END;
|
||||
|
||||
if ((Input::s_buttonState & holdButton) == holdButton) {
|
||||
Input::s_mouseHoldButton = holdButton;
|
||||
|
|
|
|||
|
|
@ -145,7 +145,9 @@ void IEvtQueueRegister(EvtContext* context, EVENTID id, int32_t (*handler)(const
|
|||
}
|
||||
|
||||
int32_t IEvtQueueCheckSyncKeyState(EvtContext* context, KEY key) {
|
||||
STORM_VALIDATE(context, ERROR_INVALID_PARAMETER, 0);
|
||||
STORM_VALIDATE_BEGIN;
|
||||
STORM_VALIDATE(context);
|
||||
STORM_VALIDATE_END;
|
||||
|
||||
context->m_critsect.Enter();
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
#include <common/Call.hpp>
|
||||
#include <common/Prop.hpp>
|
||||
#include <common/Time.hpp>
|
||||
#include <storm/Memory.hpp>
|
||||
#include <bc/Memory.hpp>
|
||||
#include <storm/String.hpp>
|
||||
#include <storm/Thread.hpp>
|
||||
|
||||
|
|
@ -37,8 +37,7 @@ HEVENTCONTEXT IEvtSchedulerCreateContext(int32_t interactive, int32_t (*initiali
|
|||
callContext = OsCallInitializeContext(contextName);
|
||||
}
|
||||
|
||||
auto m = SMemAlloc(sizeof(EvtContext), __FILE__, __LINE__, 0x0);
|
||||
auto context = new (m) EvtContext(
|
||||
auto context = NEW(EvtContext,
|
||||
interactive != 0 ? 2 : 0,
|
||||
idleTime,
|
||||
interactive != 0 ? 1000 : 1,
|
||||
|
|
|
|||
|
|
@ -561,8 +561,9 @@ int32_t OsInputGet(OSINPUT* id, int32_t* param0, int32_t* param1, int32_t* param
|
|||
}
|
||||
|
||||
void OsInputSetMouseMode(OS_MOUSE_MODE mode) {
|
||||
STORM_ASSERT(mode < OS_MOUSE_MODES);
|
||||
STORM_VALIDATE(mode < OS_MOUSE_MODES, ERROR_INVALID_PARAMETER);
|
||||
STORM_VALIDATE_BEGIN;
|
||||
STORM_VALIDATE(mode < OS_MOUSE_MODES);
|
||||
STORM_VALIDATE_END_VOID;
|
||||
|
||||
if (Input::s_osMouseMode == mode) {
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue