mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-13 07:47:45 +00:00
484e8bbfc2
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
127 lines
3.8 KiB
C
127 lines
3.8 KiB
C
/*
|
|
Copyright (C) 1996-1997 Id Software, Inc.
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU General Public License
|
|
as published by the Free Software Foundation; either version 2
|
|
of the License, or (at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
// vid.h -- video driver defs
|
|
|
|
#define VID_CBITS 6
|
|
#define VID_GRADES (1 << VID_CBITS)
|
|
|
|
// a pixel can be one, two, or four bytes
|
|
typedef qbyte pixel_t;
|
|
|
|
typedef enum
|
|
{
|
|
QR_NONE, //server-style operation (no rendering).
|
|
QR_HEADLESS, //no window/rendering at all (system tray only)
|
|
QR_OPENGL, //gl+gles+etc.
|
|
QR_DIRECT3D9, //
|
|
QR_DIRECT3D11, //
|
|
QR_SOFTWARE, //not worth using
|
|
QR_VULKAN, //
|
|
QR_DIRECT3D12, //no implementation
|
|
QR_METAL, //no implementation
|
|
QR_DIRECT3D8 //
|
|
} r_qrenderer_t;
|
|
|
|
typedef struct {
|
|
//you are not allowed to make anything not work if it's not based on these vars...
|
|
int width;
|
|
int height;
|
|
int fullscreen; //0 = windowed. 1 = fullscreen (mode changes). 2 = borderless+maximized
|
|
qboolean stereo;
|
|
qboolean srgb;
|
|
int bpp;
|
|
int rate;
|
|
int wait; //-1 = default, 0 = off, 1 = on, 2 = every other
|
|
int multisample; //for opengl antialiasing (which requires context stuff)
|
|
int triplebuffer;
|
|
char subrenderer[MAX_QPATH];
|
|
struct rendererinfo_s *renderer;
|
|
} rendererstate_t;
|
|
#ifndef SERVERONLY
|
|
extern rendererstate_t currentrendererstate;
|
|
#endif
|
|
|
|
typedef struct vrect_s
|
|
{
|
|
float x,y,width,height;
|
|
} vrect_t;
|
|
typedef struct
|
|
{
|
|
int x;
|
|
int y;
|
|
int width;
|
|
int height;
|
|
int maxheight; //vid.pixelheight or so
|
|
} pxrect_t;
|
|
|
|
typedef struct
|
|
{
|
|
qboolean activeapp;
|
|
qboolean isminimized; //can omit rendering as it won't be seen anyway.
|
|
int fullbright; // index of first fullbright color
|
|
int gammarampsize; //typically 256. but can be up to 1024 (yay 10-bit hardware that's crippled to only actually use 8)
|
|
|
|
unsigned fbvwidth; /*virtual 2d width of the current framebuffer image*/
|
|
unsigned fbvheight; /*virtual 2d height*/
|
|
unsigned fbpwidth; /*physical 2d width of the current framebuffer image*/
|
|
unsigned fbpheight; /*physical 2d height*/
|
|
struct image_s *framebuffer; /*the framebuffer fbo (set by democapture)*/
|
|
|
|
unsigned width; /*virtual 2d screen width*/
|
|
unsigned height; /*virtual 2d screen height*/
|
|
|
|
int numpages;
|
|
|
|
unsigned rotpixelwidth; /*width after rotation in pixels*/
|
|
unsigned rotpixelheight; /*pixel after rotation in pixels*/
|
|
unsigned pixelwidth; /*true height in pixels*/
|
|
unsigned pixelheight; /*true width in pixels*/
|
|
|
|
float dpi_x;
|
|
float dpi_y;
|
|
} viddef_t;
|
|
|
|
extern viddef_t vid; // global video state
|
|
|
|
extern unsigned int d_8to24rgbtable[256];
|
|
extern unsigned int d_8to24bgrtable[256];
|
|
|
|
#ifdef GLQUAKE
|
|
//called when gamma ramps need to be reapplied
|
|
qboolean GLVID_ApplyGammaRamps (unsigned int size, unsigned short *ramps);
|
|
|
|
qboolean GLVID_Init (rendererstate_t *info, unsigned char *palette);
|
|
// Called at startup to set up translation tables, takes 256 8 bit RGB values
|
|
// the palette data will go away after the call, so it must be copied off if
|
|
// the video driver will need it again
|
|
|
|
void GLVID_Shutdown (void);
|
|
// Called at shutdown
|
|
|
|
void GLVID_Crashed(void);
|
|
|
|
void GLVID_Update (vrect_t *rects);
|
|
// flushes the given rectangles from the view buffer to the screen
|
|
|
|
void GLVID_SwapBuffers(void);
|
|
enum uploadfmt;
|
|
char *GLVID_GetRGBInfo(int *bytestride, int *truewidth, int *trueheight, enum uploadfmt *fmt);
|
|
void GLVID_SetCaption(const char *caption);
|
|
#endif
|