aboutsummaryrefslogtreecommitdiffstats
path: root/al
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-12-15 21:32:01 -0800
committerChris Robinson <[email protected]>2020-12-15 21:32:01 -0800
commit304ab8d8901efc9ecb38fb1d61b2902753896dfc (patch)
tree78f9e2150e5059c5dde06bf9ea05bca13bbd0c23 /al
parenta08f68f213a79544a78ee0459d8c9065c2c9894d (diff)
Avoid a generic event struct
Diffstat (limited to 'al')
-rw-r--r--al/event.cpp10
-rw-r--r--al/event.h7
2 files changed, 9 insertions, 8 deletions
diff --git a/al/event.cpp b/al/event.cpp
index 296c64e6..6014a4a1 100644
--- a/al/event.cpp
+++ b/al/event.cpp
@@ -89,10 +89,14 @@ static int EventThread(ALCcontext *context)
evt.u.bufcomp.count, static_cast<ALsizei>(msg.length()), msg.c_str(),
context->mEventParam);
}
- else if((enabledevts&evt.EnumType) == evt.EnumType)
- context->mEventCb(evt.u.user.type, evt.u.user.id, evt.u.user.param,
- static_cast<ALsizei>(strlen(evt.u.user.msg)), evt.u.user.msg,
+ else if(evt.EnumType == EventType_Disconnected)
+ {
+ if(!(enabledevts&EventType_Disconnected))
+ continue;
+ context->mEventCb(AL_EVENT_TYPE_DISCONNECTED_SOFT, 0, 0,
+ static_cast<ALsizei>(strlen(evt.u.disconnect.msg)), evt.u.disconnect.msg,
context->mEventParam);
+ }
} while(evt_data.len != 0);
}
return 0;
diff --git a/al/event.h b/al/event.h
index 71374618..a9f08091 100644
--- a/al/event.h
+++ b/al/event.h
@@ -35,11 +35,8 @@ struct AsyncEvent {
ALuint count;
} bufcomp;
struct {
- ALenum type;
- ALuint id;
- ALuint param;
- ALchar msg[232];
- } user;
+ ALchar msg[244];
+ } disconnect;
EffectState *mEffectState;
} u{};