mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 21:57:57 +03:00
Add a fix to load the music from save
This commit implements code to get/set sample offset in an OpenAL channel and saves the music filename/offset into the file. This only works by using the experimental sound system, so it partially fixes #327
This commit is contained in:
parent
2198bdec21
commit
757b4849f8
9 changed files with 151 additions and 17 deletions
|
@ -1955,6 +1955,7 @@ qboolean SV_ArchiveServerFile( qboolean loading, qboolean autosave )
|
|||
time_t aclock;
|
||||
|
||||
Com_DPrintf( "SV_ArchiveServerFile(%s)\n", autosave ? "true" : "false" );
|
||||
memset(&save, 0, sizeof(save));
|
||||
name = Com_GetArchiveFileName( svs.gameName, "ssv" );
|
||||
|
||||
if( !loading )
|
||||
|
@ -1995,6 +1996,17 @@ qboolean SV_ArchiveServerFile( qboolean loading, qboolean autosave )
|
|||
strncpy( save.saveName, svs.gameName, sizeof( save.saveName ) );
|
||||
save.mapTime = svs.time - svs.startTime;
|
||||
|
||||
name = S_GetMusicFilename();
|
||||
if (name) {
|
||||
Q_strncpyz(save.tm_filename, name, sizeof(save.tm_filename));
|
||||
save.tm_offset = S_GetMusicOffset();
|
||||
save.tm_loopcount = S_GetMusicLoopCount();
|
||||
} else {
|
||||
save.tm_filename[0] = 0;
|
||||
save.tm_offset = 0;
|
||||
save.tm_loopcount = 0;
|
||||
}
|
||||
|
||||
FS_Write( &save, sizeof( savegamestruct_t ), f );
|
||||
S_Save( f );
|
||||
CM_WritePortalState( f );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue