LOTS OF CHANGES. was hoping to get revision 5000 perfect, but really that's never going to happen. this has gone on for too long now.
vulkan, wasapi, quake injector features added. irc, avplug, cef plugins/drivers reworked/updated/added openal reverb, doppler effects added. 'dir' console command now attempts to view clicked files. lots of warning fixes, should now only be deprecation warnings for most targets (depending on compiler version anyway...). SendEntity finally reworked to use flags properly. effectinfo improved, other smc-targetted fixes. mapcluster stuff now has support for linux. .basebone+.baseframe now exist in ssqc. qcc: -Fqccx supports qccx syntax, including qccx hacks. don't expect these to work in fteqw nor dp though. qcc: rewrote function call handling to use refs rather than defs. this makes struct passing more efficient and makes the __out keyword usable with fields etc. qccgui: can cope a little better with non-unicode files. can now represent most quake chars. qcc: suppressed warnings from *extensions.qc git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5000 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
5920bf05fb
commit
27a59a0cbc
271 changed files with 101001 additions and 64352 deletions
|
@ -31,6 +31,7 @@ typedef struct cinematics_s
|
|||
qboolean cinematicpalette_active;
|
||||
qbyte cinematicpalette[768];
|
||||
|
||||
qofs_t filestart;
|
||||
vfsfile_t *cinematic_file;
|
||||
int cinematicframe;
|
||||
} cinematics_t;
|
||||
|
@ -285,7 +286,7 @@ static cblock_t Huff1Decompress (cinematics_t *cin, cblock_t in)
|
|||
SCR_ReadNextFrame
|
||||
==================
|
||||
*/
|
||||
qbyte *CIN_ReadNextFrame (cinematics_t *cin)
|
||||
static qbyte *CIN_ReadNextFrame (cinematics_t *cin)
|
||||
{
|
||||
int r;
|
||||
int command;
|
||||
|
@ -319,9 +320,10 @@ qbyte *CIN_ReadNextFrame (cinematics_t *cin)
|
|||
Host_Error ("Bad compressed frame size");
|
||||
VFS_READ (cin->cinematic_file, compressed, size);
|
||||
|
||||
// read sound
|
||||
start = cin->cinematicframe*cin->s_rate/14;
|
||||
end = (cin->cinematicframe+1)*cin->s_rate/14;
|
||||
// read sound. the number of samples per frame is not actually constant, despite a constant rate and fps...
|
||||
// life is shit like that.
|
||||
start = (cin->cinematicframe*cin->s_rate)/14;
|
||||
end = ((cin->cinematicframe+1)*cin->s_rate)/14;
|
||||
count = end - start;
|
||||
|
||||
VFS_READ (cin->cinematic_file, samples, count*cin->s_width*cin->s_channels);
|
||||
|
@ -345,6 +347,13 @@ qbyte *CIN_ReadNextFrame (cinematics_t *cin)
|
|||
return pic;
|
||||
}
|
||||
|
||||
void CIN_Rewind(cinematics_t *cin)
|
||||
{
|
||||
VFS_SEEK(cin->cinematic_file, cin->filestart);
|
||||
|
||||
cin->cinematicframe = 0;
|
||||
cin->cinematictime = -1000/14;
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
|
@ -355,21 +364,15 @@ SCR_RunCinematic
|
|||
2 = success but nothing changed
|
||||
==================
|
||||
*/
|
||||
int CIN_RunCinematic (cinematics_t *cin, qbyte **outdata, int *outwidth, int *outheight, qbyte **outpalette)
|
||||
int CIN_RunCinematic (cinematics_t *cin, float playbacktime, qbyte **outdata, int *outwidth, int *outheight, qbyte **outpalette)
|
||||
{
|
||||
int frame;
|
||||
|
||||
if (cin->cinematictime <= 0)
|
||||
{
|
||||
cin->cinematictime = realtime;
|
||||
cin->cinematicframe = -1;
|
||||
}
|
||||
if (cin->cinematictime-3 > playbacktime*1000)
|
||||
cin->cinematictime = playbacktime*1000;
|
||||
|
||||
if (cin->cinematictime-3 > realtime*1000)
|
||||
cin->cinematictime = realtime*1000;
|
||||
|
||||
frame = (realtime*1000 - cin->cinematictime)*14/1000;
|
||||
if (frame <= cin->cinematicframe)
|
||||
frame = (playbacktime*1000 - cin->cinematictime)*14/1000;
|
||||
if (cin->pic && frame <= cin->cinematicframe)
|
||||
{
|
||||
*outdata = cin->pic;
|
||||
*outwidth = cin->width;
|
||||
|
@ -380,10 +383,13 @@ int CIN_RunCinematic (cinematics_t *cin, qbyte **outdata, int *outwidth, int *ou
|
|||
if (frame > cin->cinematicframe+1)
|
||||
{
|
||||
Con_DPrintf ("Dropped frame: %i > %i\n", frame, cin->cinematicframe+1);
|
||||
cin->cinematictime = realtime*1000 - cin->cinematicframe*1000/14;
|
||||
cin->cinematictime = playbacktime*1000 - cin->cinematicframe*1000/14;
|
||||
}
|
||||
if (cin->pic)
|
||||
{
|
||||
Z_Free (cin->pic);
|
||||
cin->pic = NULL;
|
||||
}
|
||||
cin->pic = CIN_ReadNextFrame (cin);
|
||||
if (!cin->pic)
|
||||
{
|
||||
|
@ -397,48 +403,6 @@ int CIN_RunCinematic (cinematics_t *cin, qbyte **outdata, int *outwidth, int *ou
|
|||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
SCR_DrawCinematic
|
||||
|
||||
Returns true if a cinematic is active, meaning the view rendering
|
||||
should be skipped
|
||||
==================
|
||||
*/
|
||||
/*
|
||||
qboolean CIN_DrawCinematic (void)
|
||||
{
|
||||
if (cin->cinematictime <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (key_dest == key_menu)
|
||||
{ // blank screen and pause if menu is up
|
||||
// re.CinematicSetPalette(NULL);
|
||||
cin.cinematicpalette_active = false;
|
||||
// return true;
|
||||
}
|
||||
|
||||
if (!cin.cinematicpalette_active)
|
||||
{
|
||||
// re.CinematicSetPalette(cl.cinematicpalette);
|
||||
cin.cinematicpalette_active = true;
|
||||
}
|
||||
|
||||
if (!cin.pic)
|
||||
return true;
|
||||
|
||||
|
||||
Media_ShowFrame8bit(cin.pic, cin.width, cin.height, cin.cinematicpalette);
|
||||
|
||||
// re.DrawStretchRaw (0, 0, viddef.width, viddef.height,
|
||||
// cin.width, cin.height, cin.pic);
|
||||
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
==================
|
||||
SCR_PlayCinematic
|
||||
|
@ -483,9 +447,11 @@ cinematics_t *CIN_PlayCinematic (char *arg)
|
|||
|
||||
Huff1TableInit (cin);
|
||||
|
||||
cin->filestart = VFS_TELL(cin->cinematic_file);
|
||||
|
||||
cin->cinematicframe = 0;
|
||||
cin->pic = CIN_ReadNextFrame (cin);
|
||||
cin->cinematictime = realtime*1000;
|
||||
cin->cinematictime = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue