Browse Source

Fixed compatibility issues with Scourge Done Slick:

- Implement Sys_DoubleTime with a clock function that keeps running and doesn't update only once per frame. Fixes infinite loop in Host_ShutdownServer.
- Readded missing "play" and "playvol" console commands.
- Ignore console messages that contain only whitespace.
console
Nico de Poel 5 years ago
parent
commit
75b9427296
  1. 3
      Assets/Scripts/Modules/SystemModule.cs
  2. 4
      Assets/Scripts/UniQuake.cs
  3. 11
      engine/Quake/snd_dma.c

3
Assets/Scripts/Modules/SystemModule.cs

@ -30,6 +30,9 @@ public partial class SystemModule
private void Print(string message)
{
if (string.IsNullOrWhiteSpace(message))
return;
uq.AddLog(message);
}

4
Assets/Scripts/UniQuake.cs

@ -22,7 +22,7 @@ public partial class UniQuake: MonoBehaviour
/// <summary>
/// Time since startup for this particular instance of Quake
/// </summary>
public double CurrentTime => Time.timeAsDouble - startTime;
public double CurrentTime => Time.realtimeSinceStartupAsDouble - startTime;
private Action<string> logHandler;
private StringBuilder logBuffer = new StringBuilder();
@ -74,7 +74,7 @@ public partial class UniQuake: MonoBehaviour
quakeParms.SetArguments(arguments.ToArray());
quakeParms.AllocateMemory(memorySize);
startTime = Time.timeAsDouble;
startTime = Time.realtimeSinceStartupAsDouble;
try
{

11
engine/Quake/snd_dma.c

@ -28,10 +28,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "snd_codec.h"
#include "bgmusic.h"
#ifndef USE_FMOD
static void S_Play (void);
static void S_PlayVol (void);
#ifndef USE_FMOD
static void S_SoundList (void);
static void S_Update_ (void);
void S_StopAllSounds (qboolean clear);
@ -197,9 +198,9 @@ void S_Init (void)
Con_Printf("\nSound Initialization\n");
#ifndef USE_FMOD
Cmd_AddCommand("play", S_Play);
Cmd_AddCommand("playvol", S_PlayVol);
#ifndef USE_FMOD
Cmd_AddCommand("stopsound", S_StopAllSoundsC);
Cmd_AddCommand("soundlist", S_SoundList);
Cmd_AddCommand("soundinfo", S_SoundInfo_f);
@ -977,6 +978,8 @@ void S_UnblockSound (void)
}
}
#endif // USE_FMOD
/*
===============================================================================
@ -1029,6 +1032,8 @@ static void S_PlayVol (void)
}
}
#ifndef USE_FMOD
static void S_SoundList (void)
{
int i;

Loading…
Cancel
Save