2014-08-27 08:41:31 +00:00
//emscripten's download mechanism lacks usable progress indicators.
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
void emscriptenfte_async_wget_data2 ( const char * url , void * ctx , void ( * onload ) ( void * ctx , int buf ) , void ( * onerror ) ( void * ctx , int code ) , void ( * onprogress ) ( void * ctx , int prog , int total ) ) ;
2013-12-20 11:26:28 +00:00
2016-07-15 12:26:24 +00:00
//changes the page away from quake (oh noes!) or downloads something.
void emscriptenfte_window_location ( const char * url ) ;
2013-12-20 11:26:28 +00:00
//filesystem buffers are implemented in javascript so that we are not bound by power-of-two heap limitations quite so much.
//also, we can't use emscripten's stdio because it reserves 16m file handles or something.
2014-08-27 08:41:31 +00:00
//these buffers do not track file offsets nor file access permissions.
2013-12-20 11:26:28 +00:00
int emscriptenfte_buf_create ( void ) ;
2014-08-27 08:41:31 +00:00
int emscriptenfte_buf_open ( const char * name , int createifneeded ) ; //open
int emscriptenfte_buf_rename ( const char * oldname , const char * newname ) ; //rename files (if it was open, the handle now refers to the new file instead)
int emscriptenfte_buf_delete ( const char * fname ) ; //delete the named file. there may be problems if its currently open
void emscriptenfte_buf_release ( int handle ) ; //close
void emscriptenfte_buf_pushtolocalstore ( int handle ) ; //make a copy in the browser's local storage, if possible.
unsigned int emscriptenfte_buf_getsize ( int handle ) ; //get the size of the file buffer
int emscriptenfte_buf_read ( int handle , int offset , void * data , int len ) ; //read data
int emscriptenfte_buf_write ( int handle , int offset , const void * data , int len ) ; //write data. no access checks.
2021-10-22 22:27:58 +00:00
void emscritenfte_buf_enumerate ( void ( * Sys_EnumeratedFile ) ( void * ctx , size_t fsize ) , void * ctx , size_t namesize ) ;
2013-12-20 11:26:28 +00:00
2014-08-27 08:41:31 +00:00
//websocket is implemented in javascript because there is no usable C api (emscripten's javascript implementation is shite and has fatal errors).
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
int emscriptenfte_ws_connect ( const char * url , const char * wsprotocol ) ; //open a websocket connection to a specific host
void emscriptenfte_ws_close ( int sockid ) ; //close it again
2014-08-27 08:41:31 +00:00
int emscriptenfte_ws_cansend ( int sockid , int extra , int maxpending ) ; //returns false if we're blocking for some reason. avoids overflowing. everything is otherwise reliable.
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
int emscriptenfte_ws_send ( int sockid , const void * data , int len ) ; //send data to the peer. queues data. never dropped.
int emscriptenfte_ws_recv ( int sockid , void * data , int len ) ; //receive data from the peer.
int emscriptenfte_rtc_create ( int clientside , void * ctxp , int ctxi , void ( * cb ) ( void * ctxp , int ctxi , int type , const char * data ) ) ; //open a webrtc connection to a specific broker url
void emscriptenfte_rtc_offer ( int sock , const char * offer , const char * sdptype ) ; //sets the remote sdp.
void emscriptenfte_rtc_candidate ( int sock , const char * offer ) ; //adds a remote candidate.
2013-12-20 11:26:28 +00:00
//misc stuff for printf replacements
void emscriptenfte_alert ( const char * msg ) ;
void emscriptenfte_print ( const char * msg ) ;
2021-10-12 04:41:49 +00:00
void emscriptenfte_setupmainloop ( int ( * mainloop ) ( double timestamp ) ) ;
2021-10-22 22:27:58 +00:00
NORETURN void emscriptenfte_abortmainloop ( const char * caller , int fatal ) ;
2013-12-20 11:26:28 +00:00
2015-04-21 04:12:00 +00:00
//we're trying to avoid including libpng+libjpeg+libogg in javascript due to it being redundant bloat.
//to use such textures/sounds, we can just 'directly' load them via webgl
2021-10-05 05:05:06 +00:00
void emscriptenfte_gl_loadtexturefile ( int gltexid , int * width , int * height , void * data , int datasize , const char * fname , int premul , int genmips ) ;
2015-04-21 04:12:00 +00:00
void emscriptenfte_al_loadaudiofile ( int al_buf , void * data , int datasize ) ;
2013-12-20 11:26:28 +00:00
//avoid all of emscripten's sdl emulation.
//this resolves input etc issues.
unsigned long emscriptenfte_ticks_ms ( void ) ;
2021-10-12 04:41:49 +00:00
double emscriptenfte_uptime_ms ( void ) ;
2015-08-20 03:17:47 +00:00
void emscriptenfte_updatepointerlock ( int wantpointerlock , int hidecursor ) ;
2014-10-11 19:39:45 +00:00
void emscriptenfte_polljoyevents ( void ) ;
void emscriptenfte_settitle ( const char * text ) ;
2013-12-20 11:26:28 +00:00
int emscriptenfte_setupcanvas (
int width ,
int height ,
void ( * Resized ) ( int newwidth , int newheight ) ,
2016-08-25 00:12:14 +00:00
void ( * Mouse ) ( unsigned int devid , int abs , float x , float y , float z , float size ) ,
void ( * Button ) ( unsigned int devid , int down , int mbutton ) ,
int ( * Keyboard ) ( unsigned int devid , int down , int keycode , int unicode ) ,
2015-04-14 23:12:17 +00:00
void ( * LoadFile ) ( char * url , char * mime , int filehandle ) ,
2021-10-31 18:20:51 +00:00
void ( * CbufAdd ) ( const char * text ) ,
2017-05-18 10:24:09 +00:00
void ( * buttonevent ) ( unsigned int joydev , int button , int ispressed , int isstandard ) ,
void ( * axisevent ) ( unsigned int joydev , int axis , float value , int isstandard ) ,
2014-12-11 16:26:26 +00:00
int ( * ShouldSwitchToFullscreen ) ( void )
2013-12-20 11:26:28 +00:00
) ;
2016-12-19 13:31:05 +00:00
int emscriptenfte_getvrframedata ( void ) ;
int emscriptenfte_getvreyedata ( int eye , float * projectionmatrix , float * viewmatrix ) ;