/
noire-dev
/
SourceTech
Обзор
Документация
Войти
/
noire-dev
/
SourceTech
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
sourcetech
code/renderercommon/tr_types.h
168 строк
5 KB
Noire.dev
Big work
02 ноя 2025, 11:48
Не верифицирован
02 ноя 2025, 11:48
52cc21d
Код
Авторство
О чём код?
/* =========================================================================== Copyright (C) 1999-2005 Id Software, Inc. This file is part of Quake III Arena source code. Quake III Arena source code 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. Quake III Arena source code 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 Quake III Arena source code; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA =========================================================================== */ // #ifndef __TR_TYPES_H #define __TR_TYPES_H #define MAX_VIDEO_HANDLES 16 #define MAX_DLIGHTS 512 // can't be increased, because bit flags are used on surfaces // renderfx flags #define RF_THIRD_PERSON 1 // don't draw through eyes, only mirrors (player bodies, chat sprites) #define RF_FIRST_PERSON 2 // only draw through eyes (view weapon, damage blood blob) #define RF_DEPTHHACK 4 // for view weapon Z crunching #define RF_LIGHTING_ORIGIN 8 // use refEntity->lightingOrigin instead of refEntity->origin #define RF_WRAP_FRAMES 16 // mod the model frames by the maxframes to allow continuous animation without needing to know the frame count #define RF_CROSSHAIR 32 // refdef flags #define RDF_NOWORLDMODEL 1 // used for player configuration screen typedef struct { vec3_t xyz; float st[2]; color4ub_t modulate; } polyVert_t; typedef struct poly_s { qhandle_t hShader; int numVerts; polyVert_t *verts; } poly_t; typedef enum { RT_MODEL, RT_POLY, RT_SPRITE, RT_BEAM, RT_RAIL_CORE, RT_RAIL_RINGS, RT_LIGHTNING, RT_PORTALSURFACE, // doesn't draw anything, just info for portals RT_MAX_REF_ENTITY_TYPE } refEntityType_t; typedef struct { refEntityType_t reType; int renderfx; qhandle_t hModel; // opaque type outside refresh // most recent data vec3_t lightingOrigin; // so multi-part models can be lit identically (RF_LIGHTING_ORIGIN) vec3_t axis[3]; // rotation vectors qboolean nonNormalizedAxes; // axis are not normalized, i.e. they have scale float origin[3]; // also used as MODEL_BEAM's "from" int frame; // also used as MODEL_BEAM's diameter // previous data for frame interpolation float oldorigin[3]; // also used as MODEL_BEAM's "to" int oldframe; float backlerp; // 0.0 = current, 1.0 = old // texturing int skinNum; // inline skin index qhandle_t customSkin; // NULL for default skin qhandle_t customShader; // use one image for the entire thing // misc color4ub_t shader; float shaderTexCoord[2]; // texture coordinates used by tcMod entity modifiers // subtracted from refdef time to control effect start times floatint_t shaderTime; // -EC- set to union // extra sprite information float radius; float rotation; } refEntity_t; #define MAX_RENDER_STRINGS 8 #define MAX_RENDER_STRING_LENGTH 32 typedef struct { int x, y, width, height; float fov_x, fov_y; vec3_t vieworg; vec3_t viewaxis[3]; // transformation matrix // time in milliseconds for shader effects and other time dependent rendering issues int time; int rdflags; // RDF_NOWORLDMODEL, etc // 1 bits will prevent the associated area from rendering at all byte areamask[MAX_MAP_AREA_BYTES]; // text messages for deform text shaders char text[MAX_RENDER_STRINGS][MAX_RENDER_STRING_LENGTH]; } refdef_t; /* ** glconfig_t ** ** Contains variables specific to the OpenGL configuration ** being run right now. These are constant once the OpenGL ** subsystem is initialized. */ typedef enum { TC_NONE, TC_S3TC, // this is for the GL_S3_s3tc extension. TC_S3TC_ARB // this is for the GL_EXT_texture_compression_s3tc extension. } textureCompression_t; typedef struct { char renderer_string[MAX_STRING_CHARS]; char vendor_string[MAX_STRING_CHARS]; char version_string[MAX_STRING_CHARS]; char extensions_string[BIG_INFO_STRING]; int maxTextureSize; int numTextureUnits; int colorBits, depthBits, stencilBits; qboolean deviceSupportsGamma; textureCompression_t textureCompression; qboolean textureEnvAddAvailable; int vidWidth, vidHeight; float windowAspect; int displayFrequency; qboolean isFullscreen; } glconfig_t; #define myftol(x) ((int)(x)) #if defined(_WIN32) #define OPENGL_DRIVER_NAME "opengl32" #elif defined(MACOS_X) #define OPENGL_DRIVER_NAME "/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib" #else #define OPENGL_DRIVER_NAME "libGL.so.1" #endif #endif // __TR_TYPES_H