engine: client: rewrite VOX subsystem, fix spaces being taken into sentences, add tests for parser, remove dead code

This commit is contained in:
Alibek Omarov 2022-02-22 09:34:28 +03:00
parent 18933e7981
commit 3f7773f83b
4 changed files with 513 additions and 598 deletions

File diff suppressed because it is too large Load Diff

View File

@ -16,9 +16,9 @@ GNU General Public License for more details.
#ifndef VOX_H
#define VOX_H
#define CVOXWORDMAX 64
#define CVOXZEROSCANMAX 255 // scan up to this many samples for next zero crossing
#define MAX_SENTENCES 4096
#define CVOXWORDMAX 64
#define CVOXFILESENTENCEMAX 4096
#define SENTENCE_INDEX -99999 // unique sentence index
typedef struct voxword_s
@ -34,13 +34,6 @@ typedef struct voxword_s
sfx_t *sfx; // name and cache pointer
} voxword_t;
typedef struct
{
char *pName;
float length;
} sentence_t;
struct channel_s;
void VOX_LoadWord( struct channel_s *pchan );
void VOX_FreeWord( struct channel_s *pchan );

View File

@ -826,6 +826,9 @@ static void Host_RunTests( int stage )
break;
case 1: // after FS load
Test_RunImagelib();
#if !XASH_DEDICATED
Test_RunVOX();
#endif
Msg( "Done! %d passed, %d failed\n", tests_stats.passed, tests_stats.failed );
Sys_Quit();
}

View File

@ -36,6 +36,7 @@ void Test_RunCommon( void );
void Test_RunCmd( void );
void Test_RunCvar( void );
void Test_RunCon( void );
void Test_RunVOX( void );
#endif