diff --git a/include/view.h b/include/view.h new file mode 100644 index 000000000..0987afcab --- /dev/null +++ b/include/view.h @@ -0,0 +1,59 @@ +/* + view.h + + (description) + + 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: + + Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307, USA + + $Id$ +*/ +// view.h + +#ifndef __view_h_ +#define __view_h_ + +#include "QF/mathlib.h" +#include "QF/cvar.h" + +extern cvar_t *brightness; +extern cvar_t *contrast; + +#define INFO_CSHIFT_BONUS (1 << 0) +#define INFO_CSHIFT_CONTENTS (1 << 1) +#define INFO_CSHIFT_DAMAGE (1 << 2) +#define INFO_CSHIFT_POWERUP (1 << 3) + +void V_Init (void); +void V_Init_Cvars (void); +void V_RenderView (void); +float V_CalcRoll (vec3_t angles, vec3_t velocity); +void V_UpdatePalette (void); +void V_StartPitchDrift (void); +void V_StopPitchDrift (void); + +void V_RenderView (void); +void V_UpdatePalette (void); +void V_Register (void); +void V_ParseDamage (void); +void V_SetContentsColor (int contents); +void V_CalcBlend (void); + +#endif // __view_h_ diff --git a/libs/video/targets/.gitignore b/libs/video/targets/.gitignore index 9a250aeca..f4a8d5fec 100644 --- a/libs/video/targets/.gitignore +++ b/libs/video/targets/.gitignore @@ -1,3 +1,7 @@ +*.la +*.lo +.deps +.libs .vimrc -Makefile.in Makefile +Makefile.in diff --git a/nq/source/Makefile.am b/nq/source/Makefile.am index e04cc4af1..a16a4ef46 100644 --- a/nq/source/Makefile.am +++ b/nq/source/Makefile.am @@ -38,7 +38,7 @@ bin_PROGRAMS = @NQ_TARGETS@ EXTRA_PROGRAMS= nq-3dfx nq-fbdev nq-glx nq-mgl nq-sdl \ nq-sgl nq-svga nq-wgl nq-x11 nq-server -noinst_LIBRARIES= libqfsys.a libqfnet.a +noinst_LIBRARIES= libqfnet.a #if ASM_ARCH math_ASM= cl_math.S diff --git a/qw/source/vid_sdl.c b/qw/source/vid_sdl.c index ba49f3fd7..64364aac9 100644 --- a/qw/source/vid_sdl.c +++ b/qw/source/vid_sdl.c @@ -58,6 +58,8 @@ HWND mainwindow; // static float oldin_grab = 0; cvar_t *vid_fullscreen; +cvar_t *vid_system_gamma; +qboolean vid_gamma_avail; extern viddef_t vid; // global video state unsigned short d_8to16table[256]; @@ -197,6 +199,8 @@ VID_Init_Cvars () vid_fullscreen = Cvar_Get ("vid_fullscreen", "0", CVAR_ROM, NULL, "Toggles fullscreen game mode"); + vid_system_gamma = Cvar_Get ("vid_system_gamma", "1", CVAR_ARCHIVE, NULL, + "Use system gamma control if available"); } void @@ -289,3 +293,9 @@ VID_SetCaption (char *text) SDL_WM_SetCaption (va ("%s %s", PROGRAM, VERSION), NULL); } } + +qboolean +VID_SetGamma (double gamma) +{ + return false; //FIXME +} diff --git a/qw/source/vid_sgl.c b/qw/source/vid_sgl.c index 93195860b..692cecb62 100644 --- a/qw/source/vid_sgl.c +++ b/qw/source/vid_sgl.c @@ -64,6 +64,8 @@ HWND mainwindow; static qboolean vid_initialized = false; cvar_t *vid_fullscreen; +cvar_t *vid_system_gamma; +qboolean vid_gamma_avail; int VID_options_items = 1; int modestate; @@ -230,6 +232,8 @@ VID_Init_Cvars () { vid_fullscreen = Cvar_Get ("vid_fullscreen", "0", CVAR_ROM, NULL, "Toggles fullscreen mode"); + vid_system_gamma = Cvar_Get ("vid_system_gamma", "1", CVAR_ARCHIVE, NULL, + "Use system gamma control if available"); } void @@ -244,3 +248,20 @@ VID_SetCaption (char *text) SDL_WM_SetCaption (va ("%s %s", PROGRAM, VERSION), NULL); } } + +qboolean +VID_SetGamma (double gamma) +{ + return false; //FIXME +} + +void +VID_UpdateGamma (cvar_t *vid_gamma) +{ + if (vid_gamma->flags & CVAR_ROM) // System gamma unavailable + return; + + Cvar_SetValue (vid_gamma, bound (0.1, vid_gamma->value, 9.9)); + + VID_SetGamma (vid_gamma->value); +} diff --git a/qw/source/vid_svgalib.c b/qw/source/vid_svgalib.c index f0ed310e6..e49626668 100644 --- a/qw/source/vid_svgalib.c +++ b/qw/source/vid_svgalib.c @@ -58,6 +58,8 @@ void VGA_UpdatePlanarScreen (void *srcbuffer); +cvar_t *vid_system_gamma; +qboolean vid_gamma_avail; unsigned short d_8to16table[256]; @@ -615,6 +617,8 @@ VID_Init_Cvars () "Redraw entire screen each frame instead of just dirty areas"); vid_waitforrefresh = Cvar_Get ("vid_waitforrefresh", "0", CVAR_ARCHIVE, NULL, "Wait for vertical retrace before drawing next frame"); + vid_system_gamma = Cvar_Get ("vid_system_gamma", "1", CVAR_ARCHIVE, NULL, + "Use system gamma control if available"); } @@ -761,3 +765,9 @@ void VID_SetCaption (char *text) { } + +qboolean +VID_SetGamma (double gamma) +{ + return false; //FIXME +}