mirror of
https://github.com/dhewm/dhewm3.git
synced 2025-03-21 02:01:03 +00:00
Fix idEventArg for x86_64
Pointers are passed through events; change the event value type to intptr_t to provide enough bits.
This commit is contained in:
parent
ab201cfc06
commit
d92d4ba8b6
2 changed files with 12 additions and 12 deletions
|
@ -57,16 +57,16 @@ struct idEventFunc {
|
|||
class idEventArg {
|
||||
public:
|
||||
int type;
|
||||
int value;
|
||||
intptr_t value;
|
||||
|
||||
idEventArg() { type = D_EVENT_INTEGER; value = 0; };
|
||||
idEventArg( int data ) { type = D_EVENT_INTEGER; value = data; };
|
||||
idEventArg( float data ) { type = D_EVENT_FLOAT; value = *reinterpret_cast<int *>( &data ); };
|
||||
idEventArg( idVec3 &data ) { type = D_EVENT_VECTOR; value = reinterpret_cast<int>( &data ); };
|
||||
idEventArg( const idStr &data ) { type = D_EVENT_STRING; value = reinterpret_cast<int>( data.c_str() ); };
|
||||
idEventArg( const char *data ) { type = D_EVENT_STRING; value = reinterpret_cast<int>( data ); };
|
||||
idEventArg( const class idEntity *data ) { type = D_EVENT_ENTITY; value = reinterpret_cast<int>( data ); };
|
||||
idEventArg( const struct trace_s *data ) { type = D_EVENT_TRACE; value = reinterpret_cast<int>( data ); };
|
||||
idEventArg( idVec3 &data ) { type = D_EVENT_VECTOR; value = reinterpret_cast<intptr_t>( &data ); };
|
||||
idEventArg( const idStr &data ) { type = D_EVENT_STRING; value = reinterpret_cast<intptr_t>( data.c_str() ); };
|
||||
idEventArg( const char *data ) { type = D_EVENT_STRING; value = reinterpret_cast<intptr_t>( data ); };
|
||||
idEventArg( const class idEntity *data ) { type = D_EVENT_ENTITY; value = reinterpret_cast<intptr_t>( data ); };
|
||||
idEventArg( const struct trace_s *data ) { type = D_EVENT_TRACE; value = reinterpret_cast<intptr_t>( data ); };
|
||||
};
|
||||
|
||||
class idAllocError : public idException {
|
||||
|
|
|
@ -57,16 +57,16 @@ struct idEventFunc {
|
|||
class idEventArg {
|
||||
public:
|
||||
int type;
|
||||
int value;
|
||||
intptr_t value;
|
||||
|
||||
idEventArg() { type = D_EVENT_INTEGER; value = 0; };
|
||||
idEventArg( int data ) { type = D_EVENT_INTEGER; value = data; };
|
||||
idEventArg( float data ) { type = D_EVENT_FLOAT; value = *reinterpret_cast<int *>( &data ); };
|
||||
idEventArg( idVec3 &data ) { type = D_EVENT_VECTOR; value = reinterpret_cast<int>( &data ); };
|
||||
idEventArg( const idStr &data ) { type = D_EVENT_STRING; value = reinterpret_cast<int>( data.c_str() ); };
|
||||
idEventArg( const char *data ) { type = D_EVENT_STRING; value = reinterpret_cast<int>( data ); };
|
||||
idEventArg( const class idEntity *data ) { type = D_EVENT_ENTITY; value = reinterpret_cast<int>( data ); };
|
||||
idEventArg( const struct trace_s *data ) { type = D_EVENT_TRACE; value = reinterpret_cast<int>( data ); };
|
||||
idEventArg( idVec3 &data ) { type = D_EVENT_VECTOR; value = reinterpret_cast<intptr_t>( &data ); };
|
||||
idEventArg( const idStr &data ) { type = D_EVENT_STRING; value = reinterpret_cast<intptr_t>( data.c_str() ); };
|
||||
idEventArg( const char *data ) { type = D_EVENT_STRING; value = reinterpret_cast<intptr_t>( data ); };
|
||||
idEventArg( const class idEntity *data ) { type = D_EVENT_ENTITY; value = reinterpret_cast<intptr_t>( data ); };
|
||||
idEventArg( const struct trace_s *data ) { type = D_EVENT_TRACE; value = reinterpret_cast<intptr_t>( data ); };
|
||||
};
|
||||
|
||||
class idAllocError : public idException {
|
||||
|
|
Loading…
Reference in a new issue