Skip to content

Instantly share code, notes, and snippets.

@xycaleth
Created March 23, 2020 23:17
Show Gist options
  • Save xycaleth/1c105bc356ddd80dd1e98783dab25b3f to your computer and use it in GitHub Desktop.
Save xycaleth/1c105bc356ddd80dd1e98783dab25b3f to your computer and use it in GitHub Desktop.
SP intro sound stuttering fix
10:12 PM] Xycaleth: wtf >_> on mac SP intro works fine if I launch with the binary directly. if i use the .app then i get the stuttering
[10:45 PM] Ensiform: Logic
[10:48 PM] Xycaleth: where's the code to show the Jedi Academy logo at the start?
[10:48 PM] Xycaleth: i noticed sometimes it doesn't show in SP
[10:55 PM] Xycaleth: oh comes from the renderer
[11:03 PM] Xycaleth: oh yay i think i fixed it
[11:03 PM] Xycaleth: the stuttering
[11:04 PM] Xycaleth: i don't really understand why it works though
[11:05 PM] Xycaleth: Had to move a CL_StartHunkUsers from CL_Init to Com_Init to match MP
[11:10 PM] Xycaleth: https://gist.github.com/xycaleth/58dd14c4e2ee3da899832969d8c3e867
Gist
sound fix??
sound fix?? GitHub Gist: instantly share code, notes, and snippets.
[11:28 PM] Ensiform: Wtf
[11:30 PM] Xycaleth: Yeah I don’t understand :d might want to double check that the fix works first
[6:15 AM] Futuza: This fixes it? wat
[8:24 AM] Xycaleth: odd... more refined fix:
diff --git a/code/client/cl_main.cpp b/code/client/cl_main.cpp
index e8f3d3f2..3f40a338 100644
--- a/code/client/cl_main.cpp
+++ b/code/client/cl_main.cpp
@@ -1316,14 +1316,15 @@ void CL_Init( void ) {
CL_InitRef();
- CL_StartHunkUsers();
-
SCR_Init ();
Cbuf_Execute ();
Cvar_Set( "cl_running", "1" );
+ CL_StartHunkUsers();
+
+
Com_Printf( "----- Client Initialization Complete -----\n" );
}
[8:24 AM] Xycaleth: something about cl_running
[8:26 AM] Xycaleth: CL_StartHunkUsers doesn't do anything if cl_running is 0: https://github.com/JACoders/OpenJK/blob/master/codemp/client/cl_main.cpp#L2308-L2310
GitHub
JACoders/OpenJK
Community effort to maintain and improve Jedi Academy (SP & MP) + Jedi Outcast (SP only) released by Raven Software - JACoders/OpenJK
[8:26 AM] Xycaleth: uh, few lines down
[8:47 AM] Xycaleth: Sooo... probably if StartHunkUsers doesn’t initialise things (cause cl_running is 0) then there’s a chance the cinematic can start playing before the sound/renderer are initialised
[9:36 AM] eezstreet: how did the UI even get initialized then :stare:
[9:38 AM] Ensiform: Isn't it called multiple times elsewhere
[9:38 AM] Ensiform: In hopes that it gets init
[10:57 AM] Xycaleth: It does, but after the cinematic is started
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment