Browse Source

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

pull/2/head
Alibek Omarov 3 years ago
parent
commit
3f7773f83b
  1. 916
      engine/client/s_vox.c
  2. 13
      engine/client/vox.h
  3. 3
      engine/common/host.c
  4. 1
      engine/common/tests.h

916
engine/client/s_vox.c

File diff suppressed because it is too large Load Diff

13
engine/client/vox.h

@ -16,9 +16,9 @@ GNU General Public License for more details. @@ -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 @@ -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 );

3
engine/common/host.c

@ -826,6 +826,9 @@ static void Host_RunTests( int stage ) @@ -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();
}

1
engine/common/tests.h

@ -36,6 +36,7 @@ void Test_RunCommon( void ); @@ -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

Loading…
Cancel
Save