mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-26 22:01:50 +00:00
5aa11ddbb1
emenu: clean up hexen2's maplist options slightly. emenu: modelviewer should now be slightly more friendly (click+wasd to move around). particles: fix up randomised s coords. csqc: try to fix issue with applycustomskin not refcounting properly. client: [s_]precache and (new) mod_precache cvars can be set to 2 to precache the resources after load, for faster loading at the expense of some early stutter, without risking later mid-game stuttering. gltf: add support for morphweights in a cpu-fallback path. don't expect good performance on surfaces with morphtargets for now. gtlf: add some support for gltf1 files. far from perfect. shaders: gltf1 semantics handling shaders: const correctness iqmtool: fix up mdl skin export. iqmtool: integrate the engine's gltf2 loader. works with animated models, but unanimated ones suffer from basepose-different-from-bindpose issues. q3bsp: hopefully fixed bih traces. still disabled for now. qc: change default value of pr_gc_threaded to 1. qcext: add the '__deprecated' keyword to various symbols in fteextensions.qc, now that fteqcc supports it. ssqc: spit out a more readable error for WriteByte(MSG_CSQC,...) outside of SendEntity. ssqc: add registercommand builtin, for consistency with menuqc and csqc (though only one can register any single command). sv: report userinfo/serverinfo sizes (some clients still have arbitrary limits, plus its nice to see how abusive things are) sv: try to optimise sv_cullentities_trace a little. movechain: relink moved ents. csqc: add spriteframe builtin, for freecs to use instead of more ugly less reliable hacks. menuqc: fopen("tls://host:port", FILE_STREAM) should now open a tls stream. tcp:// should also work. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5703 fc73d0e0-1445-4013-8a0c-d673dee63da5
130 lines
4.7 KiB
C
130 lines
4.7 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 //liimted. available for win95 where d3d8.1+ does not. also only renderer supported on the original xbox, if that's ever relevant.
|
|
} 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;
|
|
int srgb; //<0 = gamma-only. 0 = no srgb at all, >0 full srgb, including textures and stuff
|
|
int bpp; //16, 24(aka 32), 30, and 48 are meaningful
|
|
int depthbits;
|
|
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]; //external driver
|
|
char devicename[MAX_QPATH]; //device name (usually monitor)
|
|
struct rendererinfo_s *renderer;
|
|
struct plugvrfuncs_s *vr; //the vr driver we're trying to use.
|
|
} 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;
|
|
|
|
//srgb colourspace displays smoother visual gradients, but its more of an illusion than anything else.
|
|
//
|
|
#define VID_SRGBAWARE (1u<<0) //we need to convert input srgb values to actual linear values (requires vid_reload to change...)
|
|
#define VID_SRGB_FB_LINEAR (1u<<1) //framebuffer is linear (either the presentation engine is linear, or the blend unit is faking it)
|
|
#define VID_SRGB_FB_FAKED (1u<<2) //renderer is faking it with a linear texture
|
|
#define VID_SRGB_CAPABLE (1u<<3) //we can toggle VID_SRGB_FB_LINEARISED on or off.
|
|
#define VID_FP16 (1u<<4) //use 16bit currentrender etc to avoid banding
|
|
#define VID_SRGB_FB (VID_SRGB_FB_LINEAR|VID_SRGB_FB_FAKED)
|
|
|
|
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 int flags; //VID_* flags
|
|
|
|
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;
|
|
|
|
conchar_t *ime_preview; //pending IME preview text that has been entered but isn't committed yet. set by video code.
|
|
size_t ime_previewlen;
|
|
size_t ime_caret;
|
|
float ime_position[2]; //where to display any ime popups (virtual coords)
|
|
qboolean ime_allow; //enable the ime (ie: at the console or messagemode)
|
|
|
|
qboolean forcecursor;
|
|
float forcecursorpos[2]; //in physical pixels
|
|
|
|
struct plugvrfuncs_s *vr; //how do deal with VR contexts.
|
|
} viddef_t;
|
|
|
|
extern viddef_t vid; // global video state
|
|
|
|
extern unsigned int d_8to24rgbtable[256];
|
|
extern unsigned int d_8to24srgbtable[256];
|
|
extern unsigned int d_8to24bgrtable[256];
|
|
extern unsigned int d_quaketo24srgbtable[256];
|