mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 14:51:40 +00:00
- Made sdl/i_system.cpp:I_GetTimePolled() functionally equivalent to the
Win32 version. - Updated fmod_wrap.h and fmodsound.cpp for FMOD 4.20. - GCC warning removal. SVN r1286 (trunk)
This commit is contained in:
parent
fb1af415f5
commit
c1cefee2f4
8 changed files with 68 additions and 34 deletions
|
@ -1,3 +1,9 @@
|
|||
November 8, 2008
|
||||
- Made sdl/i_system.cpp:I_GetTimePolled() functionally equivalent to the
|
||||
Win32 version.
|
||||
- Updated fmod_wrap.h and fmodsound.cpp for FMOD 4.20.
|
||||
- GCC warning removal.
|
||||
|
||||
November 2, 2008 (Changes by Graf Zahl)
|
||||
- Fixed: The TEXTURES parser didn't report an error for invalid keywords.
|
||||
- Fixed: The DECORATE expression evaluator was too strict with missing jump labels.
|
||||
|
|
|
@ -87,7 +87,7 @@ DWORD LanguageIDs[4] =
|
|||
|
||||
int (*I_GetTime) (bool saveMS);
|
||||
int (*I_WaitForTic) (int);
|
||||
void (*I_FreezTime) (bool frozen);
|
||||
void (*I_FreezeTime) (bool frozen);
|
||||
|
||||
void I_Tactile (int on, int off, int total)
|
||||
{
|
||||
|
@ -117,6 +117,7 @@ unsigned int I_MSTime (void)
|
|||
|
||||
static DWORD TicStart;
|
||||
static DWORD TicNext;
|
||||
static DWORD BaseTime;
|
||||
static int TicFrozen;
|
||||
|
||||
//
|
||||
|
@ -131,13 +132,17 @@ int I_GetTimePolled (bool saveMS)
|
|||
}
|
||||
|
||||
DWORD tm = SDL_GetTicks ();
|
||||
if (BaseTime == 0)
|
||||
{
|
||||
BaseTime = tm;
|
||||
}
|
||||
|
||||
if (saveMS)
|
||||
{
|
||||
TicStart = tm;
|
||||
TicNext = Scale ((Scale (tm, TICRATE, 1000) + 1), 1000, TICRATE);
|
||||
}
|
||||
return Scale (tm, TICRATE, 1000);
|
||||
return Scale (tm - BaseTime, TICRATE, 1000);
|
||||
}
|
||||
|
||||
int I_WaitForTicPolled (int prevtic)
|
||||
|
@ -151,22 +156,22 @@ int I_WaitForTicPolled (int prevtic)
|
|||
return time;
|
||||
}
|
||||
|
||||
void I_FreezeTimePolled (bool frozen)
|
||||
{
|
||||
if (frozen)
|
||||
{
|
||||
assert(TicFrozen == 0);
|
||||
TicFrozen = I_GetTimePolled(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(TicFrozen != 0);
|
||||
int froze = TicFrozen;
|
||||
TicFrozen = 0;
|
||||
int now = I_GetTimePolled(false);
|
||||
basetime += (now - froze) * 1000 / TICRATE;
|
||||
}
|
||||
}
|
||||
void I_FreezeTimePolled (bool frozen)
|
||||
{
|
||||
if (frozen)
|
||||
{
|
||||
assert(TicFrozen == 0);
|
||||
TicFrozen = I_GetTimePolled(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(TicFrozen != 0);
|
||||
int froze = TicFrozen;
|
||||
TicFrozen = 0;
|
||||
int now = I_GetTimePolled(false);
|
||||
BaseTime += (now - froze) * 1000 / TICRATE;
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the fractional amount of a tic passed since the most recent tic
|
||||
fixed_t I_GetTimeFrac (uint32 *ms)
|
||||
|
|
|
@ -193,6 +193,8 @@ namespace FMOD
|
|||
// Userdata set/get.
|
||||
FMOD_RESULT setUserData (void *userdata) { return FMOD_System_SetUserData(this, userdata); }
|
||||
FMOD_RESULT getUserData (void **userdata) { return FMOD_System_GetUserData(this, userdata); }
|
||||
|
||||
FMOD_RESULT getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, unsigned int *memoryused_array) { return FMOD_System_GetMemoryInfo(this, memorybits, event_memorybits, memoryused, memoryused_array); }
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -256,6 +258,8 @@ namespace FMOD
|
|||
// Userdata set/get.
|
||||
FMOD_RESULT setUserData (void *userdata) { return FMOD_Sound_SetUserData(this, userdata); }
|
||||
FMOD_RESULT getUserData (void **userdata) { return FMOD_Sound_GetUserData(this, userdata); }
|
||||
|
||||
FMOD_RESULT getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, unsigned int *memoryused_array) { return FMOD_Sound_GetMemoryInfo(this, memorybits, event_memorybits, memoryused, memoryused_array); }
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -299,7 +303,9 @@ namespace FMOD
|
|||
|
||||
FMOD_RESULT setChannelGroup (ChannelGroup *channelgroup) { return FMOD_Channel_SetChannelGroup(this, (FMOD_CHANNELGROUP *)channelgroup); }
|
||||
FMOD_RESULT getChannelGroup (ChannelGroup **channelgroup) { return FMOD_Channel_GetChannelGroup(this, (FMOD_CHANNELGROUP **)channelgroup); }
|
||||
FMOD_RESULT setCallback (FMOD_CHANNEL_CALLBACKTYPE type, FMOD_CHANNEL_CALLBACK callback, int command) { return FMOD_Channel_SetCallback(this, type, callback, command); }
|
||||
FMOD_RESULT setCallback (FMOD_CHANNEL_CALLBACK callback) { return FMOD_Channel_SetCallback(this, callback); }
|
||||
FMOD_RESULT setLowPassGain (float gain) { return FMOD_Channel_SetLowPassGain(this, gain); }
|
||||
FMOD_RESULT getLowPassGain (float *gain) { return FMOD_Channel_GetLowPassGain(this, gain); }
|
||||
|
||||
// 3D functionality.
|
||||
FMOD_RESULT set3DAttributes (const FMOD_VECTOR *pos, const FMOD_VECTOR *vel) { return FMOD_Channel_Set3DAttributes(this, pos, vel); }
|
||||
|
@ -345,6 +351,8 @@ namespace FMOD
|
|||
// Userdata set/get.
|
||||
FMOD_RESULT setUserData (void *userdata) { return FMOD_Channel_SetUserData(this, userdata); }
|
||||
FMOD_RESULT getUserData (void **userdata) { return FMOD_Channel_GetUserData(this, userdata); }
|
||||
|
||||
FMOD_RESULT getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, unsigned int *memoryused_array) { return FMOD_Channel_GetMemoryInfo(this, memorybits, event_memorybits, memoryused, memoryused_array); }
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -402,6 +410,8 @@ namespace FMOD
|
|||
// Userdata set/get.
|
||||
FMOD_RESULT setUserData (void *userdata) { return FMOD_ChannelGroup_SetUserData(this, userdata); }
|
||||
FMOD_RESULT getUserData (void **userdata) { return FMOD_ChannelGroup_GetUserData(this, userdata); }
|
||||
|
||||
FMOD_RESULT getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, unsigned int *memoryused_array) { return FMOD_ChannelGroup_GetMemoryInfo(this, memorybits, event_memorybits, memoryused, memoryused_array); }
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -438,6 +448,8 @@ namespace FMOD
|
|||
// Userdata set/get.
|
||||
FMOD_RESULT setUserData (void *userdata) { return FMOD_SoundGroup_SetUserData(this, userdata); }
|
||||
FMOD_RESULT getUserData (void **userdata) { return FMOD_SoundGroup_GetUserData(this, userdata); }
|
||||
|
||||
FMOD_RESULT getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, unsigned int *memoryused_array) { return FMOD_SoundGroup_GetMemoryInfo(this, memorybits, event_memorybits, memoryused, memoryused_array); }
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -489,6 +501,8 @@ namespace FMOD
|
|||
// Userdata set/get.
|
||||
FMOD_RESULT setUserData (void *userdata) { return FMOD_DSP_SetUserData(this, userdata); }
|
||||
FMOD_RESULT getUserData (void **userdata) { return FMOD_DSP_GetUserData(this, userdata); }
|
||||
|
||||
FMOD_RESULT getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, unsigned int *memoryused_array) { return FMOD_DSP_GetMemoryInfo(this, memorybits, event_memorybits, memoryused, memoryused_array); }
|
||||
};
|
||||
|
||||
|
||||
|
@ -514,6 +528,8 @@ namespace FMOD
|
|||
// Userdata set/get.
|
||||
FMOD_RESULT setUserData (void *userdata) { return FMOD_DSPConnection_SetUserData(this, userdata); }
|
||||
FMOD_RESULT getUserData (void **userdata) { return FMOD_DSPConnection_GetUserData(this, userdata); }
|
||||
|
||||
FMOD_RESULT getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, unsigned int *memoryused_array) { return FMOD_DSPConnection_GetMemoryInfo(this, memorybits, event_memorybits, memoryused, memoryused_array); }
|
||||
};
|
||||
|
||||
|
||||
|
@ -555,6 +571,8 @@ namespace FMOD
|
|||
// Userdata set/get.
|
||||
FMOD_RESULT setUserData (void *userdata) { return FMOD_Geometry_SetUserData(this, userdata); }
|
||||
FMOD_RESULT getUserData (void **userdata) { return FMOD_Geometry_GetUserData(this, userdata); }
|
||||
|
||||
FMOD_RESULT getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, unsigned int *memoryused_array) { return FMOD_Geometry_GetMemoryInfo(this, memorybits, event_memorybits, memoryused, memoryused_array); }
|
||||
};
|
||||
|
||||
|
||||
|
@ -583,6 +601,8 @@ namespace FMOD
|
|||
// Userdata set/get.
|
||||
FMOD_RESULT setUserData (void *userdata) { return FMOD_Reverb_SetUserData(this, userdata); }
|
||||
FMOD_RESULT getUserData (void **userdata) { return FMOD_Reverb_GetUserData(this, userdata); }
|
||||
|
||||
FMOD_RESULT getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, unsigned int *memoryused_array) { return FMOD_Reverb_GetMemoryInfo(this, memorybits, event_memorybits, memoryused, memoryused_array); }
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -1603,7 +1603,7 @@ FISoundChannel *FMODSoundRenderer::CommonChannelSetup(FMOD::Channel *chan, FISou
|
|||
chan->getDelay(FMOD_DELAYTYPE_DSPCLOCK_START, &schan->StartTime.Hi, &schan->StartTime.Lo);
|
||||
}
|
||||
chan->setUserData(schan);
|
||||
chan->setCallback(FMOD_CHANNEL_CALLBACKTYPE_END, ChannelEndCallback, 0);
|
||||
chan->setCallback(ChannelCallback);
|
||||
GRolloff = NULL;
|
||||
return schan;
|
||||
}
|
||||
|
@ -2003,17 +2003,21 @@ unsigned int FMODSoundRenderer::GetSampleLength(SoundHandle sfx)
|
|||
|
||||
//==========================================================================
|
||||
//
|
||||
// FMODSoundRenderer :: ChannelEndCallback static
|
||||
// FMODSoundRenderer :: ChannelCallback static
|
||||
//
|
||||
// Called when the channel finishes playing.
|
||||
// Handles when a channel finishes playing. This is only called when
|
||||
// System::update is called and is therefore asynchronous with the actual
|
||||
// end of the channel.
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
FMOD_RESULT F_CALLBACK FMODSoundRenderer::ChannelEndCallback
|
||||
(FMOD_CHANNEL *channel, FMOD_CHANNEL_CALLBACKTYPE type,
|
||||
int cmd, unsigned int data1, unsigned int data2)
|
||||
FMOD_RESULT F_CALLBACK FMODSoundRenderer::ChannelCallback
|
||||
(FMOD_CHANNEL *channel, FMOD_CHANNEL_CALLBACKTYPE type, void *data1, void *data2)
|
||||
{
|
||||
assert(type == FMOD_CHANNEL_CALLBACKTYPE_END);
|
||||
if (type != FMOD_CHANNEL_CALLBACKTYPE_END)
|
||||
{
|
||||
return FMOD_OK;
|
||||
}
|
||||
FMOD::Channel *chan = (FMOD::Channel *)channel;
|
||||
FISoundChannel *schan;
|
||||
|
||||
|
|
|
@ -65,8 +65,7 @@ private:
|
|||
QWORD_UNION DSPClock;
|
||||
int OutputRate;
|
||||
|
||||
static FMOD_RESULT F_CALLBACK ChannelEndCallback
|
||||
(FMOD_CHANNEL *channel, FMOD_CHANNEL_CALLBACKTYPE type, int cmd, unsigned int data1, unsigned int data2);
|
||||
static FMOD_RESULT F_CALLBACK ChannelCallback(FMOD_CHANNEL *channel, FMOD_CHANNEL_CALLBACKTYPE type, void *data1, void *data2);
|
||||
static float F_CALLBACK RolloffCallback(FMOD_CHANNEL *channel, float distance);
|
||||
|
||||
void HandleChannelDelay(FMOD::Channel *chan, FISoundChannel *reuse_chan, bool abstime, float freq) const;
|
||||
|
|
|
@ -547,4 +547,4 @@ void InitThingdef()
|
|||
variables.ShrinkToFit();
|
||||
qsort(&variables[0], variables.Size(), sizeof(variables[0]), varcmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2666,7 +2666,7 @@ ExpVal FxMultiNameState::EvalExpression (AActor *self)
|
|||
{
|
||||
const char *dot="";
|
||||
Printf("Jump target '");
|
||||
for (int i=0;i<names.Size();i++)
|
||||
for (unsigned int i=0;i<names.Size();i++)
|
||||
{
|
||||
Printf("%s%s", dot, names[i].GetChars());
|
||||
dot = ".";
|
||||
|
@ -2695,7 +2695,7 @@ FStateExpressions StateParams;
|
|||
|
||||
FStateExpressions::~FStateExpressions()
|
||||
{
|
||||
for(unsigned i=0; i<Size(); i++)
|
||||
for(int i=0; i<Size(); i++)
|
||||
{
|
||||
if (expressions[i].expr != NULL && !expressions[i].cloned)
|
||||
{
|
||||
|
@ -2785,7 +2785,7 @@ int FStateExpressions::ResolveAll()
|
|||
|
||||
FCompileContext ctx;
|
||||
ctx.lax = true;
|
||||
for(unsigned i=0; i<Size(); i++)
|
||||
for(int i=0; i<Size(); i++)
|
||||
{
|
||||
if (expressions[i].cloned)
|
||||
{
|
||||
|
@ -2810,7 +2810,7 @@ int FStateExpressions::ResolveAll()
|
|||
}
|
||||
}
|
||||
|
||||
for(unsigned i=0; i<Size(); i++)
|
||||
for(int i=0; i<Size(); i++)
|
||||
{
|
||||
if (expressions[i].expr != NULL)
|
||||
{
|
||||
|
|
|
@ -93,4 +93,4 @@ struct FExpressionType
|
|||
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue