mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-03-23 11:22:05 +00:00
Den Code des Icculus OpenGL Renderer eingefügt
This commit is contained in:
parent
871936b72a
commit
d2435d0c2f
15 changed files with 10686 additions and 0 deletions
181
src/refresh/opengl/constants/anorms.h
Normal file
181
src/refresh/opengl/constants/anorms.h
Normal file
|
@ -0,0 +1,181 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 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.
|
||||
|
||||
*/
|
||||
{-0.525731, 0.000000, 0.850651},
|
||||
{-0.442863, 0.238856, 0.864188},
|
||||
{-0.295242, 0.000000, 0.955423},
|
||||
{-0.309017, 0.500000, 0.809017},
|
||||
{-0.162460, 0.262866, 0.951056},
|
||||
{0.000000, 0.000000, 1.000000},
|
||||
{0.000000, 0.850651, 0.525731},
|
||||
{-0.147621, 0.716567, 0.681718},
|
||||
{0.147621, 0.716567, 0.681718},
|
||||
{0.000000, 0.525731, 0.850651},
|
||||
{0.309017, 0.500000, 0.809017},
|
||||
{0.525731, 0.000000, 0.850651},
|
||||
{0.295242, 0.000000, 0.955423},
|
||||
{0.442863, 0.238856, 0.864188},
|
||||
{0.162460, 0.262866, 0.951056},
|
||||
{-0.681718, 0.147621, 0.716567},
|
||||
{-0.809017, 0.309017, 0.500000},
|
||||
{-0.587785, 0.425325, 0.688191},
|
||||
{-0.850651, 0.525731, 0.000000},
|
||||
{-0.864188, 0.442863, 0.238856},
|
||||
{-0.716567, 0.681718, 0.147621},
|
||||
{-0.688191, 0.587785, 0.425325},
|
||||
{-0.500000, 0.809017, 0.309017},
|
||||
{-0.238856, 0.864188, 0.442863},
|
||||
{-0.425325, 0.688191, 0.587785},
|
||||
{-0.716567, 0.681718, -0.147621},
|
||||
{-0.500000, 0.809017, -0.309017},
|
||||
{-0.525731, 0.850651, 0.000000},
|
||||
{0.000000, 0.850651, -0.525731},
|
||||
{-0.238856, 0.864188, -0.442863},
|
||||
{0.000000, 0.955423, -0.295242},
|
||||
{-0.262866, 0.951056, -0.162460},
|
||||
{0.000000, 1.000000, 0.000000},
|
||||
{0.000000, 0.955423, 0.295242},
|
||||
{-0.262866, 0.951056, 0.162460},
|
||||
{0.238856, 0.864188, 0.442863},
|
||||
{0.262866, 0.951056, 0.162460},
|
||||
{0.500000, 0.809017, 0.309017},
|
||||
{0.238856, 0.864188, -0.442863},
|
||||
{0.262866, 0.951056, -0.162460},
|
||||
{0.500000, 0.809017, -0.309017},
|
||||
{0.850651, 0.525731, 0.000000},
|
||||
{0.716567, 0.681718, 0.147621},
|
||||
{0.716567, 0.681718, -0.147621},
|
||||
{0.525731, 0.850651, 0.000000},
|
||||
{0.425325, 0.688191, 0.587785},
|
||||
{0.864188, 0.442863, 0.238856},
|
||||
{0.688191, 0.587785, 0.425325},
|
||||
{0.809017, 0.309017, 0.500000},
|
||||
{0.681718, 0.147621, 0.716567},
|
||||
{0.587785, 0.425325, 0.688191},
|
||||
{0.955423, 0.295242, 0.000000},
|
||||
{1.000000, 0.000000, 0.000000},
|
||||
{0.951056, 0.162460, 0.262866},
|
||||
{0.850651, -0.525731, 0.000000},
|
||||
{0.955423, -0.295242, 0.000000},
|
||||
{0.864188, -0.442863, 0.238856},
|
||||
{0.951056, -0.162460, 0.262866},
|
||||
{0.809017, -0.309017, 0.500000},
|
||||
{0.681718, -0.147621, 0.716567},
|
||||
{0.850651, 0.000000, 0.525731},
|
||||
{0.864188, 0.442863, -0.238856},
|
||||
{0.809017, 0.309017, -0.500000},
|
||||
{0.951056, 0.162460, -0.262866},
|
||||
{0.525731, 0.000000, -0.850651},
|
||||
{0.681718, 0.147621, -0.716567},
|
||||
{0.681718, -0.147621, -0.716567},
|
||||
{0.850651, 0.000000, -0.525731},
|
||||
{0.809017, -0.309017, -0.500000},
|
||||
{0.864188, -0.442863, -0.238856},
|
||||
{0.951056, -0.162460, -0.262866},
|
||||
{0.147621, 0.716567, -0.681718},
|
||||
{0.309017, 0.500000, -0.809017},
|
||||
{0.425325, 0.688191, -0.587785},
|
||||
{0.442863, 0.238856, -0.864188},
|
||||
{0.587785, 0.425325, -0.688191},
|
||||
{0.688191, 0.587785, -0.425325},
|
||||
{-0.147621, 0.716567, -0.681718},
|
||||
{-0.309017, 0.500000, -0.809017},
|
||||
{0.000000, 0.525731, -0.850651},
|
||||
{-0.525731, 0.000000, -0.850651},
|
||||
{-0.442863, 0.238856, -0.864188},
|
||||
{-0.295242, 0.000000, -0.955423},
|
||||
{-0.162460, 0.262866, -0.951056},
|
||||
{0.000000, 0.000000, -1.000000},
|
||||
{0.295242, 0.000000, -0.955423},
|
||||
{0.162460, 0.262866, -0.951056},
|
||||
{-0.442863, -0.238856, -0.864188},
|
||||
{-0.309017, -0.500000, -0.809017},
|
||||
{-0.162460, -0.262866, -0.951056},
|
||||
{0.000000, -0.850651, -0.525731},
|
||||
{-0.147621, -0.716567, -0.681718},
|
||||
{0.147621, -0.716567, -0.681718},
|
||||
{0.000000, -0.525731, -0.850651},
|
||||
{0.309017, -0.500000, -0.809017},
|
||||
{0.442863, -0.238856, -0.864188},
|
||||
{0.162460, -0.262866, -0.951056},
|
||||
{0.238856, -0.864188, -0.442863},
|
||||
{0.500000, -0.809017, -0.309017},
|
||||
{0.425325, -0.688191, -0.587785},
|
||||
{0.716567, -0.681718, -0.147621},
|
||||
{0.688191, -0.587785, -0.425325},
|
||||
{0.587785, -0.425325, -0.688191},
|
||||
{0.000000, -0.955423, -0.295242},
|
||||
{0.000000, -1.000000, 0.000000},
|
||||
{0.262866, -0.951056, -0.162460},
|
||||
{0.000000, -0.850651, 0.525731},
|
||||
{0.000000, -0.955423, 0.295242},
|
||||
{0.238856, -0.864188, 0.442863},
|
||||
{0.262866, -0.951056, 0.162460},
|
||||
{0.500000, -0.809017, 0.309017},
|
||||
{0.716567, -0.681718, 0.147621},
|
||||
{0.525731, -0.850651, 0.000000},
|
||||
{-0.238856, -0.864188, -0.442863},
|
||||
{-0.500000, -0.809017, -0.309017},
|
||||
{-0.262866, -0.951056, -0.162460},
|
||||
{-0.850651, -0.525731, 0.000000},
|
||||
{-0.716567, -0.681718, -0.147621},
|
||||
{-0.716567, -0.681718, 0.147621},
|
||||
{-0.525731, -0.850651, 0.000000},
|
||||
{-0.500000, -0.809017, 0.309017},
|
||||
{-0.238856, -0.864188, 0.442863},
|
||||
{-0.262866, -0.951056, 0.162460},
|
||||
{-0.864188, -0.442863, 0.238856},
|
||||
{-0.809017, -0.309017, 0.500000},
|
||||
{-0.688191, -0.587785, 0.425325},
|
||||
{-0.681718, -0.147621, 0.716567},
|
||||
{-0.442863, -0.238856, 0.864188},
|
||||
{-0.587785, -0.425325, 0.688191},
|
||||
{-0.309017, -0.500000, 0.809017},
|
||||
{-0.147621, -0.716567, 0.681718},
|
||||
{-0.425325, -0.688191, 0.587785},
|
||||
{-0.162460, -0.262866, 0.951056},
|
||||
{0.442863, -0.238856, 0.864188},
|
||||
{0.162460, -0.262866, 0.951056},
|
||||
{0.309017, -0.500000, 0.809017},
|
||||
{0.147621, -0.716567, 0.681718},
|
||||
{0.000000, -0.525731, 0.850651},
|
||||
{0.425325, -0.688191, 0.587785},
|
||||
{0.587785, -0.425325, 0.688191},
|
||||
{0.688191, -0.587785, 0.425325},
|
||||
{-0.955423, 0.295242, 0.000000},
|
||||
{-0.951056, 0.162460, 0.262866},
|
||||
{-1.000000, 0.000000, 0.000000},
|
||||
{-0.850651, 0.000000, 0.525731},
|
||||
{-0.955423, -0.295242, 0.000000},
|
||||
{-0.951056, -0.162460, 0.262866},
|
||||
{-0.864188, 0.442863, -0.238856},
|
||||
{-0.951056, 0.162460, -0.262866},
|
||||
{-0.809017, 0.309017, -0.500000},
|
||||
{-0.864188, -0.442863, -0.238856},
|
||||
{-0.951056, -0.162460, -0.262866},
|
||||
{-0.809017, -0.309017, -0.500000},
|
||||
{-0.681718, 0.147621, -0.716567},
|
||||
{-0.681718, -0.147621, -0.716567},
|
||||
{-0.850651, 0.000000, -0.525731},
|
||||
{-0.688191, 0.587785, -0.425325},
|
||||
{-0.587785, 0.425325, -0.688191},
|
||||
{-0.425325, 0.688191, -0.587785},
|
||||
{-0.425325, -0.688191, -0.587785},
|
||||
{-0.587785, -0.425325, -0.688191},
|
||||
{-0.688191, -0.587785, -0.425325},
|
37
src/refresh/opengl/constants/anormtab.h
Normal file
37
src/refresh/opengl/constants/anormtab.h
Normal file
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 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.
|
||||
|
||||
*/
|
||||
{
|
||||
{1.23,1.30,1.47,1.35,1.56,1.71,1.37,1.38,1.59,1.60,1.79,1.97,1.88,1.92,1.79,1.02,0.93,1.07,0.82,0.87,0.88,0.94,0.96,1.14,1.11,0.82,0.83,0.89,0.89,0.86,0.94,0.91,1.00,1.21,0.98,1.48,1.30,1.57,0.96,1.07,1.14,1.60,1.61,1.40,1.37,1.72,1.78,1.79,1.93,1.99,1.90,1.68,1.71,1.86,1.60,1.68,1.78,1.86,1.93,1.99,1.97,1.44,1.22,1.49,0.93,0.99,0.99,1.23,1.22,1.44,1.49,0.89,0.89,0.97,0.91,0.98,1.19,0.82,0.76,0.82,0.71,0.72,0.73,0.76,0.79,0.86,0.83,0.72,0.76,0.76,0.89,0.82,0.89,0.82,0.89,0.91,0.83,0.96,1.14,0.97,1.40,1.19,0.98,0.94,1.00,1.07,1.37,1.21,1.48,1.30,1.57,1.61,1.37,0.86,0.83,0.91,0.82,0.82,0.88,0.89,0.96,1.14,0.98,0.87,0.93,0.94,1.02,1.30,1.07,1.35,1.38,1.11,1.56,1.92,1.79,1.79,1.59,1.60,1.72,1.90,1.79,0.80,0.85,0.79,0.93,0.80,0.85,0.77,0.74,0.72,0.77,0.74,0.72,0.70,0.70,0.71,0.76,0.73,0.79,0.79,0.73,0.76,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.26,1.26,1.48,1.23,1.50,1.71,1.14,1.19,1.38,1.46,1.64,1.94,1.87,1.84,1.71,1.02,0.92,1.00,0.79,0.85,0.84,0.91,0.90,0.98,0.99,0.77,0.77,0.83,0.82,0.79,0.86,0.84,0.92,0.99,0.91,1.24,1.03,1.33,0.88,0.94,0.97,1.41,1.39,1.18,1.11,1.51,1.61,1.59,1.80,1.91,1.76,1.54,1.65,1.76,1.70,1.70,1.85,1.85,1.97,1.99,1.93,1.28,1.09,1.39,0.92,0.97,0.99,1.18,1.26,1.52,1.48,0.83,0.85,0.90,0.88,0.93,1.00,0.77,0.73,0.78,0.72,0.71,0.74,0.75,0.79,0.86,0.81,0.75,0.81,0.79,0.96,0.88,0.94,0.86,0.93,0.92,0.85,1.08,1.33,1.05,1.55,1.31,1.01,1.05,1.27,1.31,1.60,1.47,1.70,1.54,1.76,1.76,1.57,0.93,0.90,0.99,0.88,0.88,0.95,0.97,1.11,1.39,1.20,0.92,0.97,1.01,1.10,1.39,1.22,1.51,1.58,1.32,1.64,1.97,1.85,1.91,1.77,1.74,1.88,1.99,1.91,0.79,0.86,0.80,0.94,0.84,0.88,0.74,0.74,0.71,0.82,0.77,0.76,0.70,0.73,0.72,0.73,0.70,0.74,0.85,0.77,0.82,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.34,1.27,1.53,1.17,1.46,1.71,0.98,1.05,1.20,1.34,1.48,1.86,1.82,1.71,1.62,1.09,0.94,0.99,0.79,0.85,0.82,0.90,0.87,0.93,0.96,0.76,0.74,0.79,0.76,0.74,0.79,0.78,0.85,0.92,0.85,1.00,0.93,1.06,0.81,0.86,0.89,1.16,1.12,0.97,0.95,1.28,1.38,1.35,1.60,1.77,1.57,1.33,1.50,1.58,1.69,1.63,1.82,1.74,1.91,1.92,1.80,1.04,0.97,1.21,0.90,0.93,0.97,1.05,1.21,1.48,1.37,0.77,0.80,0.84,0.85,0.88,0.92,0.73,0.71,0.74,0.74,0.71,0.75,0.73,0.79,0.84,0.78,0.79,0.86,0.81,1.05,0.94,0.99,0.90,0.95,0.92,0.86,1.24,1.44,1.14,1.59,1.34,1.02,1.27,1.50,1.49,1.80,1.69,1.86,1.72,1.87,1.80,1.69,1.00,0.98,1.23,0.95,0.96,1.09,1.16,1.37,1.63,1.46,0.99,1.10,1.25,1.24,1.51,1.41,1.67,1.77,1.55,1.72,1.95,1.89,1.98,1.91,1.86,1.97,1.99,1.94,0.81,0.89,0.85,0.98,0.90,0.94,0.75,0.78,0.73,0.89,0.83,0.82,0.72,0.77,0.76,0.72,0.70,0.71,0.91,0.83,0.89,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.46,1.34,1.60,1.16,1.46,1.71,0.94,0.99,1.05,1.26,1.33,1.74,1.76,1.57,1.54,1.23,0.98,1.05,0.83,0.89,0.84,0.92,0.87,0.91,0.96,0.78,0.74,0.79,0.72,0.72,0.75,0.76,0.80,0.88,0.83,0.94,0.87,0.95,0.76,0.80,0.82,0.97,0.96,0.89,0.88,1.08,1.11,1.10,1.37,1.59,1.37,1.07,1.27,1.34,1.57,1.45,1.69,1.55,1.77,1.79,1.60,0.93,0.90,0.99,0.86,0.87,0.93,0.96,1.07,1.35,1.18,0.73,0.76,0.77,0.81,0.82,0.85,0.70,0.71,0.72,0.78,0.73,0.77,0.73,0.79,0.82,0.76,0.83,0.90,0.84,1.18,0.98,1.03,0.92,0.95,0.90,0.86,1.32,1.45,1.15,1.53,1.27,0.99,1.42,1.65,1.58,1.93,1.83,1.94,1.81,1.88,1.74,1.70,1.19,1.17,1.44,1.11,1.15,1.36,1.41,1.61,1.81,1.67,1.22,1.34,1.50,1.42,1.65,1.61,1.82,1.91,1.75,1.80,1.89,1.89,1.98,1.99,1.94,1.98,1.92,1.87,0.86,0.95,0.92,1.14,0.98,1.03,0.79,0.84,0.77,0.97,0.90,0.89,0.76,0.82,0.82,0.74,0.72,0.71,0.98,0.89,0.97,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.60,1.44,1.68,1.22,1.49,1.71,0.93,0.99,0.99,1.23,1.22,1.60,1.68,1.44,1.49,1.40,1.14,1.19,0.89,0.96,0.89,0.97,0.89,0.91,0.98,0.82,0.76,0.82,0.71,0.72,0.73,0.76,0.79,0.86,0.83,0.91,0.83,0.89,0.72,0.76,0.76,0.89,0.89,0.82,0.82,0.98,0.96,0.97,1.14,1.40,1.19,0.94,1.00,1.07,1.37,1.21,1.48,1.30,1.57,1.61,1.37,0.86,0.83,0.91,0.82,0.82,0.88,0.89,0.96,1.14,0.98,0.70,0.72,0.73,0.77,0.76,0.79,0.70,0.72,0.71,0.82,0.77,0.80,0.74,0.79,0.80,0.74,0.87,0.93,0.85,1.23,1.02,1.02,0.93,0.93,0.87,0.85,1.30,1.35,1.07,1.38,1.11,0.94,1.47,1.71,1.56,1.97,1.88,1.92,1.79,1.79,1.59,1.60,1.30,1.35,1.56,1.37,1.38,1.59,1.60,1.79,1.92,1.79,1.48,1.57,1.72,1.61,1.78,1.79,1.93,1.99,1.90,1.86,1.78,1.86,1.93,1.99,1.97,1.90,1.79,1.72,0.94,1.07,1.00,1.37,1.21,1.30,0.86,0.91,0.83,1.14,0.98,0.96,0.82,0.88,0.89,0.79,0.76,0.73,1.07,0.94,1.11,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.74,1.57,1.76,1.33,1.54,1.71,0.94,1.05,0.99,1.26,1.16,1.46,1.60,1.34,1.46,1.59,1.37,1.37,0.97,1.11,0.96,1.10,0.95,0.94,1.08,0.89,0.82,0.88,0.72,0.76,0.75,0.80,0.80,0.88,0.87,0.91,0.83,0.87,0.72,0.76,0.74,0.83,0.84,0.78,0.79,0.96,0.89,0.92,0.98,1.23,1.05,0.86,0.92,0.95,1.11,0.98,1.22,1.03,1.34,1.42,1.14,0.79,0.77,0.84,0.78,0.76,0.82,0.82,0.89,0.97,0.90,0.70,0.71,0.71,0.73,0.72,0.74,0.73,0.76,0.72,0.86,0.81,0.82,0.76,0.79,0.77,0.73,0.90,0.95,0.86,1.18,1.03,0.98,0.92,0.90,0.83,0.84,1.19,1.17,0.98,1.15,0.97,0.89,1.42,1.65,1.44,1.93,1.83,1.81,1.67,1.61,1.36,1.41,1.32,1.45,1.58,1.57,1.53,1.74,1.70,1.88,1.94,1.81,1.69,1.77,1.87,1.79,1.89,1.92,1.98,1.99,1.98,1.89,1.65,1.80,1.82,1.91,1.94,1.75,1.61,1.50,1.07,1.34,1.27,1.60,1.45,1.55,0.93,0.99,0.90,1.35,1.18,1.07,0.87,0.93,0.96,0.85,0.82,0.77,1.15,0.99,1.27,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.86,1.71,1.82,1.48,1.62,1.71,0.98,1.20,1.05,1.34,1.17,1.34,1.53,1.27,1.46,1.77,1.60,1.57,1.16,1.38,1.12,1.35,1.06,1.00,1.28,0.97,0.89,0.95,0.76,0.81,0.79,0.86,0.85,0.92,0.93,0.93,0.85,0.87,0.74,0.78,0.74,0.79,0.82,0.76,0.79,0.96,0.85,0.90,0.94,1.09,0.99,0.81,0.85,0.89,0.95,0.90,0.99,0.94,1.10,1.24,0.98,0.75,0.73,0.78,0.74,0.72,0.77,0.76,0.82,0.89,0.83,0.73,0.71,0.71,0.71,0.70,0.72,0.77,0.80,0.74,0.90,0.85,0.84,0.78,0.79,0.75,0.73,0.92,0.95,0.86,1.05,0.99,0.94,0.90,0.86,0.79,0.81,1.00,0.98,0.91,0.96,0.89,0.83,1.27,1.50,1.23,1.80,1.69,1.63,1.46,1.37,1.09,1.16,1.24,1.44,1.49,1.69,1.59,1.80,1.69,1.87,1.86,1.72,1.82,1.91,1.94,1.92,1.95,1.99,1.98,1.91,1.97,1.89,1.51,1.72,1.67,1.77,1.86,1.55,1.41,1.25,1.33,1.58,1.50,1.80,1.63,1.74,1.04,1.21,0.97,1.48,1.37,1.21,0.93,0.97,1.05,0.92,0.88,0.84,1.14,1.02,1.34,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.94,1.84,1.87,1.64,1.71,1.71,1.14,1.38,1.19,1.46,1.23,1.26,1.48,1.26,1.50,1.91,1.80,1.76,1.41,1.61,1.39,1.59,1.33,1.24,1.51,1.18,0.97,1.11,0.82,0.88,0.86,0.94,0.92,0.99,1.03,0.98,0.91,0.90,0.79,0.84,0.77,0.79,0.84,0.77,0.83,0.99,0.85,0.91,0.92,1.02,1.00,0.79,0.80,0.86,0.88,0.84,0.92,0.88,0.97,1.10,0.94,0.74,0.71,0.74,0.72,0.70,0.73,0.72,0.76,0.82,0.77,0.77,0.73,0.74,0.71,0.70,0.73,0.83,0.85,0.78,0.92,0.88,0.86,0.81,0.79,0.74,0.75,0.92,0.93,0.85,0.96,0.94,0.88,0.86,0.81,0.75,0.79,0.93,0.90,0.85,0.88,0.82,0.77,1.05,1.27,0.99,1.60,1.47,1.39,1.20,1.11,0.95,0.97,1.08,1.33,1.31,1.70,1.55,1.76,1.57,1.76,1.70,1.54,1.85,1.97,1.91,1.99,1.97,1.99,1.91,1.77,1.88,1.85,1.39,1.64,1.51,1.58,1.74,1.32,1.22,1.01,1.54,1.76,1.65,1.93,1.70,1.85,1.28,1.39,1.09,1.52,1.48,1.26,0.97,0.99,1.18,1.00,0.93,0.90,1.05,1.01,1.31,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.97,1.92,1.88,1.79,1.79,1.71,1.37,1.59,1.38,1.60,1.35,1.23,1.47,1.30,1.56,1.99,1.93,1.90,1.60,1.78,1.61,1.79,1.57,1.48,1.72,1.40,1.14,1.37,0.89,0.96,0.94,1.07,1.00,1.21,1.30,1.14,0.98,0.96,0.86,0.91,0.83,0.82,0.88,0.82,0.89,1.11,0.87,0.94,0.93,1.02,1.07,0.80,0.79,0.85,0.82,0.80,0.87,0.85,0.93,1.02,0.93,0.77,0.72,0.74,0.71,0.70,0.70,0.71,0.72,0.77,0.74,0.82,0.76,0.79,0.72,0.73,0.76,0.89,0.89,0.82,0.93,0.91,0.86,0.83,0.79,0.73,0.76,0.91,0.89,0.83,0.89,0.89,0.82,0.82,0.76,0.72,0.76,0.86,0.83,0.79,0.82,0.76,0.73,0.94,1.00,0.91,1.37,1.21,1.14,0.98,0.96,0.88,0.89,0.96,1.14,1.07,1.60,1.40,1.61,1.37,1.57,1.48,1.30,1.78,1.93,1.79,1.99,1.92,1.90,1.79,1.59,1.72,1.79,1.30,1.56,1.35,1.38,1.60,1.11,1.07,0.94,1.68,1.86,1.71,1.97,1.68,1.86,1.44,1.49,1.22,1.44,1.49,1.22,0.99,0.99,1.23,1.19,0.98,0.97,0.97,0.98,1.19,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.94,1.97,1.87,1.91,1.85,1.71,1.60,1.77,1.58,1.74,1.51,1.26,1.48,1.39,1.64,1.99,1.97,1.99,1.70,1.85,1.76,1.91,1.76,1.70,1.88,1.55,1.33,1.57,0.96,1.08,1.05,1.31,1.27,1.47,1.54,1.39,1.20,1.11,0.93,0.99,0.90,0.88,0.95,0.88,0.97,1.32,0.92,1.01,0.97,1.10,1.22,0.84,0.80,0.88,0.79,0.79,0.85,0.86,0.92,1.02,0.94,0.82,0.76,0.77,0.72,0.73,0.70,0.72,0.71,0.74,0.74,0.88,0.81,0.85,0.75,0.77,0.82,0.94,0.93,0.86,0.92,0.92,0.86,0.85,0.79,0.74,0.79,0.88,0.85,0.81,0.82,0.83,0.77,0.78,0.73,0.71,0.75,0.79,0.77,0.74,0.77,0.73,0.70,0.86,0.92,0.84,1.14,0.99,0.98,0.91,0.90,0.84,0.83,0.88,0.97,0.94,1.41,1.18,1.39,1.11,1.33,1.24,1.03,1.61,1.80,1.59,1.91,1.84,1.76,1.64,1.38,1.51,1.71,1.26,1.50,1.23,1.19,1.46,0.99,1.00,0.91,1.70,1.85,1.65,1.93,1.54,1.76,1.52,1.48,1.26,1.28,1.39,1.09,0.99,0.97,1.18,1.31,1.01,1.05,0.90,0.93,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.86,1.95,1.82,1.98,1.89,1.71,1.80,1.91,1.77,1.86,1.67,1.34,1.53,1.51,1.72,1.92,1.91,1.99,1.69,1.82,1.80,1.94,1.87,1.86,1.97,1.59,1.44,1.69,1.05,1.24,1.27,1.49,1.50,1.69,1.72,1.63,1.46,1.37,1.00,1.23,0.98,0.95,1.09,0.96,1.16,1.55,0.99,1.25,1.10,1.24,1.41,0.90,0.85,0.94,0.79,0.81,0.85,0.89,0.94,1.09,0.98,0.89,0.82,0.83,0.74,0.77,0.72,0.76,0.73,0.75,0.78,0.94,0.86,0.91,0.79,0.83,0.89,0.99,0.95,0.90,0.90,0.92,0.84,0.86,0.79,0.75,0.81,0.85,0.80,0.78,0.76,0.77,0.73,0.74,0.71,0.71,0.73,0.74,0.74,0.71,0.76,0.72,0.70,0.79,0.85,0.78,0.98,0.92,0.93,0.85,0.87,0.82,0.79,0.81,0.89,0.86,1.16,0.97,1.12,0.95,1.06,1.00,0.93,1.38,1.60,1.35,1.77,1.71,1.57,1.48,1.20,1.28,1.62,1.27,1.46,1.17,1.05,1.34,0.96,0.99,0.90,1.63,1.74,1.50,1.80,1.33,1.58,1.48,1.37,1.21,1.04,1.21,0.97,0.97,0.93,1.05,1.34,1.02,1.14,0.84,0.88,0.92,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.74,1.89,1.76,1.98,1.89,1.71,1.93,1.99,1.91,1.94,1.82,1.46,1.60,1.65,1.80,1.79,1.77,1.92,1.57,1.69,1.74,1.87,1.88,1.94,1.98,1.53,1.45,1.70,1.18,1.32,1.42,1.58,1.65,1.83,1.81,1.81,1.67,1.61,1.19,1.44,1.17,1.11,1.36,1.15,1.41,1.75,1.22,1.50,1.34,1.42,1.61,0.98,0.92,1.03,0.83,0.86,0.89,0.95,0.98,1.23,1.14,0.97,0.89,0.90,0.78,0.82,0.76,0.82,0.77,0.79,0.84,0.98,0.90,0.98,0.83,0.89,0.97,1.03,0.95,0.92,0.86,0.90,0.82,0.86,0.79,0.77,0.84,0.81,0.76,0.76,0.72,0.73,0.70,0.72,0.71,0.73,0.73,0.72,0.74,0.71,0.78,0.74,0.72,0.75,0.80,0.76,0.94,0.88,0.91,0.83,0.87,0.84,0.79,0.76,0.82,0.80,0.97,0.89,0.96,0.88,0.95,0.94,0.87,1.11,1.37,1.10,1.59,1.57,1.37,1.33,1.05,1.08,1.54,1.34,1.46,1.16,0.99,1.26,0.96,1.05,0.92,1.45,1.55,1.27,1.60,1.07,1.34,1.35,1.18,1.07,0.93,0.99,0.90,0.93,0.87,0.96,1.27,0.99,1.15,0.77,0.82,0.85,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.60,1.78,1.68,1.93,1.86,1.71,1.97,1.99,1.99,1.97,1.93,1.60,1.68,1.78,1.86,1.61,1.57,1.79,1.37,1.48,1.59,1.72,1.79,1.92,1.90,1.38,1.35,1.60,1.23,1.30,1.47,1.56,1.71,1.88,1.79,1.92,1.79,1.79,1.30,1.56,1.35,1.37,1.59,1.38,1.60,1.90,1.48,1.72,1.57,1.61,1.79,1.21,1.00,1.30,0.89,0.94,0.96,1.07,1.14,1.40,1.37,1.14,0.96,0.98,0.82,0.88,0.82,0.89,0.83,0.86,0.91,1.02,0.93,1.07,0.87,0.94,1.11,1.02,0.93,0.93,0.82,0.87,0.80,0.85,0.79,0.80,0.85,0.77,0.72,0.74,0.71,0.70,0.70,0.71,0.72,0.77,0.74,0.72,0.76,0.73,0.82,0.79,0.76,0.73,0.79,0.76,0.93,0.86,0.91,0.83,0.89,0.89,0.82,0.72,0.76,0.76,0.89,0.82,0.89,0.82,0.89,0.91,0.83,0.96,1.14,0.97,1.40,1.44,1.19,1.22,0.99,0.98,1.49,1.44,1.49,1.22,0.99,1.23,0.98,1.19,0.97,1.21,1.30,1.00,1.37,0.94,1.07,1.14,0.98,0.96,0.86,0.91,0.83,0.88,0.82,0.89,1.11,0.94,1.07,0.73,0.76,0.79,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.46,1.65,1.60,1.82,1.80,1.71,1.93,1.91,1.99,1.94,1.98,1.74,1.76,1.89,1.89,1.42,1.34,1.61,1.11,1.22,1.36,1.50,1.61,1.81,1.75,1.15,1.17,1.41,1.18,1.19,1.42,1.44,1.65,1.83,1.67,1.94,1.81,1.88,1.32,1.58,1.45,1.57,1.74,1.53,1.70,1.98,1.69,1.87,1.77,1.79,1.92,1.45,1.27,1.55,0.97,1.07,1.11,1.34,1.37,1.59,1.60,1.35,1.07,1.18,0.86,0.93,0.87,0.96,0.90,0.93,0.99,1.03,0.95,1.15,0.90,0.99,1.27,0.98,0.90,0.92,0.78,0.83,0.77,0.84,0.79,0.82,0.86,0.73,0.71,0.73,0.72,0.70,0.73,0.72,0.76,0.81,0.76,0.76,0.82,0.77,0.89,0.85,0.82,0.75,0.80,0.80,0.94,0.88,0.94,0.87,0.95,0.96,0.88,0.72,0.74,0.76,0.83,0.78,0.84,0.79,0.87,0.91,0.83,0.89,0.98,0.92,1.23,1.34,1.05,1.16,0.99,0.96,1.46,1.57,1.54,1.33,1.05,1.26,1.08,1.37,1.10,0.98,1.03,0.92,1.14,0.86,0.95,0.97,0.90,0.89,0.79,0.84,0.77,0.82,0.76,0.82,0.97,0.89,0.98,0.71,0.72,0.74,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.34,1.51,1.53,1.67,1.72,1.71,1.80,1.77,1.91,1.86,1.98,1.86,1.82,1.95,1.89,1.24,1.10,1.41,0.95,0.99,1.09,1.25,1.37,1.63,1.55,0.96,0.98,1.16,1.05,1.00,1.27,1.23,1.50,1.69,1.46,1.86,1.72,1.87,1.24,1.49,1.44,1.69,1.80,1.59,1.69,1.97,1.82,1.94,1.91,1.92,1.99,1.63,1.50,1.74,1.16,1.33,1.38,1.58,1.60,1.77,1.80,1.48,1.21,1.37,0.90,0.97,0.93,1.05,0.97,1.04,1.21,0.99,0.95,1.14,0.92,1.02,1.34,0.94,0.86,0.90,0.74,0.79,0.75,0.81,0.79,0.84,0.86,0.71,0.71,0.73,0.76,0.73,0.77,0.74,0.80,0.85,0.78,0.81,0.89,0.84,0.97,0.92,0.88,0.79,0.85,0.86,0.98,0.92,1.00,0.93,1.06,1.12,0.95,0.74,0.74,0.78,0.79,0.76,0.82,0.79,0.87,0.93,0.85,0.85,0.94,0.90,1.09,1.27,0.99,1.17,1.05,0.96,1.46,1.71,1.62,1.48,1.20,1.34,1.28,1.57,1.35,0.90,0.94,0.85,0.98,0.81,0.89,0.89,0.83,0.82,0.75,0.78,0.73,0.77,0.72,0.76,0.89,0.83,0.91,0.71,0.70,0.72,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.26,1.39,1.48,1.51,1.64,1.71,1.60,1.58,1.77,1.74,1.91,1.94,1.87,1.97,1.85,1.10,0.97,1.22,0.88,0.92,0.95,1.01,1.11,1.39,1.32,0.88,0.90,0.97,0.96,0.93,1.05,0.99,1.27,1.47,1.20,1.70,1.54,1.76,1.08,1.31,1.33,1.70,1.76,1.55,1.57,1.88,1.85,1.91,1.97,1.99,1.99,1.70,1.65,1.85,1.41,1.54,1.61,1.76,1.80,1.91,1.93,1.52,1.26,1.48,0.92,0.99,0.97,1.18,1.09,1.28,1.39,0.94,0.93,1.05,0.92,1.01,1.31,0.88,0.81,0.86,0.72,0.75,0.74,0.79,0.79,0.86,0.85,0.71,0.73,0.75,0.82,0.77,0.83,0.78,0.85,0.88,0.81,0.88,0.97,0.90,1.18,1.00,0.93,0.86,0.92,0.94,1.14,0.99,1.24,1.03,1.33,1.39,1.11,0.79,0.77,0.84,0.79,0.77,0.84,0.83,0.90,0.98,0.91,0.85,0.92,0.91,1.02,1.26,1.00,1.23,1.19,0.99,1.50,1.84,1.71,1.64,1.38,1.46,1.51,1.76,1.59,0.84,0.88,0.80,0.94,0.79,0.86,0.82,0.77,0.76,0.74,0.74,0.71,0.73,0.70,0.72,0.82,0.77,0.85,0.74,0.70,0.73,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00}
|
||||
}
|
51
src/refresh/opengl/constants/warpsin.h
Normal file
51
src/refresh/opengl/constants/warpsin.h
Normal file
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 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.
|
||||
|
||||
*/
|
||||
0, 0.19633, 0.392541, 0.588517, 0.784137, 0.979285, 1.17384, 1.3677,
|
||||
1.56072, 1.75281, 1.94384, 2.1337, 2.32228, 2.50945, 2.69512, 2.87916,
|
||||
3.06147, 3.24193, 3.42044, 3.59689, 3.77117, 3.94319, 4.11282, 4.27998,
|
||||
4.44456, 4.60647, 4.76559, 4.92185, 5.07515, 5.22538, 5.37247, 5.51632,
|
||||
5.65685, 5.79398, 5.92761, 6.05767, 6.18408, 6.30677, 6.42566, 6.54068,
|
||||
6.65176, 6.75883, 6.86183, 6.9607, 7.05537, 7.14579, 7.23191, 7.31368,
|
||||
7.39104, 7.46394, 7.53235, 7.59623, 7.65552, 7.71021, 7.76025, 7.80562,
|
||||
7.84628, 7.88222, 7.91341, 7.93984, 7.96148, 7.97832, 7.99036, 7.99759,
|
||||
8, 7.99759, 7.99036, 7.97832, 7.96148, 7.93984, 7.91341, 7.88222,
|
||||
7.84628, 7.80562, 7.76025, 7.71021, 7.65552, 7.59623, 7.53235, 7.46394,
|
||||
7.39104, 7.31368, 7.23191, 7.14579, 7.05537, 6.9607, 6.86183, 6.75883,
|
||||
6.65176, 6.54068, 6.42566, 6.30677, 6.18408, 6.05767, 5.92761, 5.79398,
|
||||
5.65685, 5.51632, 5.37247, 5.22538, 5.07515, 4.92185, 4.76559, 4.60647,
|
||||
4.44456, 4.27998, 4.11282, 3.94319, 3.77117, 3.59689, 3.42044, 3.24193,
|
||||
3.06147, 2.87916, 2.69512, 2.50945, 2.32228, 2.1337, 1.94384, 1.75281,
|
||||
1.56072, 1.3677, 1.17384, 0.979285, 0.784137, 0.588517, 0.392541, 0.19633,
|
||||
9.79717e-16, -0.19633, -0.392541, -0.588517, -0.784137, -0.979285, -1.17384, -1.3677,
|
||||
-1.56072, -1.75281, -1.94384, -2.1337, -2.32228, -2.50945, -2.69512, -2.87916,
|
||||
-3.06147, -3.24193, -3.42044, -3.59689, -3.77117, -3.94319, -4.11282, -4.27998,
|
||||
-4.44456, -4.60647, -4.76559, -4.92185, -5.07515, -5.22538, -5.37247, -5.51632,
|
||||
-5.65685, -5.79398, -5.92761, -6.05767, -6.18408, -6.30677, -6.42566, -6.54068,
|
||||
-6.65176, -6.75883, -6.86183, -6.9607, -7.05537, -7.14579, -7.23191, -7.31368,
|
||||
-7.39104, -7.46394, -7.53235, -7.59623, -7.65552, -7.71021, -7.76025, -7.80562,
|
||||
-7.84628, -7.88222, -7.91341, -7.93984, -7.96148, -7.97832, -7.99036, -7.99759,
|
||||
-8, -7.99759, -7.99036, -7.97832, -7.96148, -7.93984, -7.91341, -7.88222,
|
||||
-7.84628, -7.80562, -7.76025, -7.71021, -7.65552, -7.59623, -7.53235, -7.46394,
|
||||
-7.39104, -7.31368, -7.23191, -7.14579, -7.05537, -6.9607, -6.86183, -6.75883,
|
||||
-6.65176, -6.54068, -6.42566, -6.30677, -6.18408, -6.05767, -5.92761, -5.79398,
|
||||
-5.65685, -5.51632, -5.37247, -5.22538, -5.07515, -4.92185, -4.76559, -4.60647,
|
||||
-4.44456, -4.27998, -4.11282, -3.94319, -3.77117, -3.59689, -3.42044, -3.24193,
|
||||
-3.06147, -2.87916, -2.69512, -2.50945, -2.32228, -2.1337, -1.94384, -1.75281,
|
||||
-1.56072, -1.3677, -1.17384, -0.979285, -0.784137, -0.588517, -0.392541, -0.19633,
|
415
src/refresh/opengl/gl_draw.c
Normal file
415
src/refresh/opengl/gl_draw.c
Normal file
|
@ -0,0 +1,415 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 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.
|
||||
|
||||
*/
|
||||
|
||||
// draw.c
|
||||
|
||||
#include "gl_local.h"
|
||||
|
||||
image_t *draw_chars;
|
||||
|
||||
extern qboolean scrap_dirty;
|
||||
void Scrap_Upload (void);
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
Draw_InitLocal
|
||||
===============
|
||||
*/
|
||||
void Draw_InitLocal (void)
|
||||
{
|
||||
// load console characters (don't bilerp characters)
|
||||
draw_chars = GL_FindImage ("pics/conchars.pcx", it_pic);
|
||||
GL_Bind( draw_chars->texnum );
|
||||
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
Draw_Char
|
||||
|
||||
Draws one 8*8 graphics character with 0 being transparent.
|
||||
It can be clipped to the top of the screen to allow the console to be
|
||||
smoothly scrolled off.
|
||||
================
|
||||
*/
|
||||
void Draw_Char (int x, int y, int num)
|
||||
{
|
||||
int row, col;
|
||||
float frow, fcol, size;
|
||||
|
||||
num &= 255;
|
||||
|
||||
if ( (num&127) == 32 )
|
||||
return; // space
|
||||
|
||||
if (y <= -8)
|
||||
return; // totally off screen
|
||||
|
||||
row = num>>4;
|
||||
col = num&15;
|
||||
|
||||
frow = row*0.0625;
|
||||
fcol = col*0.0625;
|
||||
size = 0.0625;
|
||||
|
||||
GL_Bind (draw_chars->texnum);
|
||||
|
||||
qglBegin (GL_QUADS);
|
||||
qglTexCoord2f (fcol, frow);
|
||||
qglVertex2f (x, y);
|
||||
qglTexCoord2f (fcol + size, frow);
|
||||
qglVertex2f (x+8, y);
|
||||
qglTexCoord2f (fcol + size, frow + size);
|
||||
qglVertex2f (x+8, y+8);
|
||||
qglTexCoord2f (fcol, frow + size);
|
||||
qglVertex2f (x, y+8);
|
||||
qglEnd ();
|
||||
}
|
||||
|
||||
/*
|
||||
=============
|
||||
Draw_FindPic
|
||||
=============
|
||||
*/
|
||||
image_t *Draw_FindPic (char *name)
|
||||
{
|
||||
image_t *gl;
|
||||
char fullname[MAX_QPATH];
|
||||
|
||||
if (name[0] != '/' && name[0] != '\\')
|
||||
{
|
||||
Com_sprintf (fullname, sizeof(fullname), "pics/%s.pcx", name);
|
||||
gl = GL_FindImage (fullname, it_pic);
|
||||
}
|
||||
else
|
||||
gl = GL_FindImage (name+1, it_pic);
|
||||
|
||||
return gl;
|
||||
}
|
||||
|
||||
/*
|
||||
=============
|
||||
Draw_GetPicSize
|
||||
=============
|
||||
*/
|
||||
void Draw_GetPicSize (int *w, int *h, char *pic)
|
||||
{
|
||||
image_t *gl;
|
||||
|
||||
gl = Draw_FindPic (pic);
|
||||
if (!gl)
|
||||
{
|
||||
*w = *h = -1;
|
||||
return;
|
||||
}
|
||||
*w = gl->width;
|
||||
*h = gl->height;
|
||||
}
|
||||
|
||||
/*
|
||||
=============
|
||||
Draw_StretchPic
|
||||
=============
|
||||
*/
|
||||
void Draw_StretchPic (int x, int y, int w, int h, char *pic)
|
||||
{
|
||||
image_t *gl;
|
||||
|
||||
gl = Draw_FindPic (pic);
|
||||
if (!gl)
|
||||
{
|
||||
ri.Con_Printf (PRINT_ALL, "Can't find pic: %s\n", pic);
|
||||
return;
|
||||
}
|
||||
|
||||
if (scrap_dirty)
|
||||
Scrap_Upload ();
|
||||
|
||||
if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( gl_config.renderer & GL_RENDERER_RENDITION ) ) && !gl->has_alpha)
|
||||
qglDisable (GL_ALPHA_TEST);
|
||||
|
||||
GL_Bind (gl->texnum);
|
||||
qglBegin (GL_QUADS);
|
||||
qglTexCoord2f (gl->sl, gl->tl);
|
||||
qglVertex2f (x, y);
|
||||
qglTexCoord2f (gl->sh, gl->tl);
|
||||
qglVertex2f (x+w, y);
|
||||
qglTexCoord2f (gl->sh, gl->th);
|
||||
qglVertex2f (x+w, y+h);
|
||||
qglTexCoord2f (gl->sl, gl->th);
|
||||
qglVertex2f (x, y+h);
|
||||
qglEnd ();
|
||||
|
||||
if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( gl_config.renderer & GL_RENDERER_RENDITION ) ) && !gl->has_alpha)
|
||||
qglEnable (GL_ALPHA_TEST);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=============
|
||||
Draw_Pic
|
||||
=============
|
||||
*/
|
||||
void Draw_Pic (int x, int y, char *pic)
|
||||
{
|
||||
image_t *gl;
|
||||
|
||||
gl = Draw_FindPic (pic);
|
||||
if (!gl)
|
||||
{
|
||||
ri.Con_Printf (PRINT_ALL, "Can't find pic: %s\n", pic);
|
||||
return;
|
||||
}
|
||||
if (scrap_dirty)
|
||||
Scrap_Upload ();
|
||||
|
||||
if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( gl_config.renderer & GL_RENDERER_RENDITION ) ) && !gl->has_alpha)
|
||||
qglDisable (GL_ALPHA_TEST);
|
||||
|
||||
GL_Bind (gl->texnum);
|
||||
qglBegin (GL_QUADS);
|
||||
qglTexCoord2f (gl->sl, gl->tl);
|
||||
qglVertex2f (x, y);
|
||||
qglTexCoord2f (gl->sh, gl->tl);
|
||||
qglVertex2f (x+gl->width, y);
|
||||
qglTexCoord2f (gl->sh, gl->th);
|
||||
qglVertex2f (x+gl->width, y+gl->height);
|
||||
qglTexCoord2f (gl->sl, gl->th);
|
||||
qglVertex2f (x, y+gl->height);
|
||||
qglEnd ();
|
||||
|
||||
if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( gl_config.renderer & GL_RENDERER_RENDITION ) ) && !gl->has_alpha)
|
||||
qglEnable (GL_ALPHA_TEST);
|
||||
}
|
||||
|
||||
/*
|
||||
=============
|
||||
Draw_TileClear
|
||||
|
||||
This repeats a 64*64 tile graphic to fill the screen around a sized down
|
||||
refresh window.
|
||||
=============
|
||||
*/
|
||||
void Draw_TileClear (int x, int y, int w, int h, char *pic)
|
||||
{
|
||||
image_t *image;
|
||||
|
||||
image = Draw_FindPic (pic);
|
||||
if (!image)
|
||||
{
|
||||
ri.Con_Printf (PRINT_ALL, "Can't find pic: %s\n", pic);
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( gl_config.renderer & GL_RENDERER_RENDITION ) ) && !image->has_alpha)
|
||||
qglDisable (GL_ALPHA_TEST);
|
||||
|
||||
GL_Bind (image->texnum);
|
||||
qglBegin (GL_QUADS);
|
||||
qglTexCoord2f (x/64.0, y/64.0);
|
||||
qglVertex2f (x, y);
|
||||
qglTexCoord2f ( (x+w)/64.0, y/64.0);
|
||||
qglVertex2f (x+w, y);
|
||||
qglTexCoord2f ( (x+w)/64.0, (y+h)/64.0);
|
||||
qglVertex2f (x+w, y+h);
|
||||
qglTexCoord2f ( x/64.0, (y+h)/64.0 );
|
||||
qglVertex2f (x, y+h);
|
||||
qglEnd ();
|
||||
|
||||
if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( gl_config.renderer & GL_RENDERER_RENDITION ) ) && !image->has_alpha)
|
||||
qglEnable (GL_ALPHA_TEST);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=============
|
||||
Draw_Fill
|
||||
|
||||
Fills a box of pixels with a single color
|
||||
=============
|
||||
*/
|
||||
void Draw_Fill (int x, int y, int w, int h, int c)
|
||||
{
|
||||
union
|
||||
{
|
||||
unsigned c;
|
||||
byte v[4];
|
||||
} color;
|
||||
|
||||
if ( (unsigned)c > 255)
|
||||
ri.Sys_Error (ERR_FATAL, "Draw_Fill: bad color");
|
||||
|
||||
qglDisable (GL_TEXTURE_2D);
|
||||
|
||||
color.c = d_8to24table[c];
|
||||
qglColor3f (color.v[0]/255.0,
|
||||
color.v[1]/255.0,
|
||||
color.v[2]/255.0);
|
||||
|
||||
qglBegin (GL_QUADS);
|
||||
|
||||
qglVertex2f (x,y);
|
||||
qglVertex2f (x+w, y);
|
||||
qglVertex2f (x+w, y+h);
|
||||
qglVertex2f (x, y+h);
|
||||
|
||||
qglEnd ();
|
||||
qglColor3f (1,1,1);
|
||||
qglEnable (GL_TEXTURE_2D);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
|
||||
/*
|
||||
================
|
||||
Draw_FadeScreen
|
||||
|
||||
================
|
||||
*/
|
||||
void Draw_FadeScreen (void)
|
||||
{
|
||||
qglEnable (GL_BLEND);
|
||||
qglDisable (GL_TEXTURE_2D);
|
||||
qglColor4f (0, 0, 0, 0.8);
|
||||
qglBegin (GL_QUADS);
|
||||
|
||||
qglVertex2f (0,0);
|
||||
qglVertex2f (vid.width, 0);
|
||||
qglVertex2f (vid.width, vid.height);
|
||||
qglVertex2f (0, vid.height);
|
||||
|
||||
qglEnd ();
|
||||
qglColor4f (1,1,1,1);
|
||||
qglEnable (GL_TEXTURE_2D);
|
||||
qglDisable (GL_BLEND);
|
||||
}
|
||||
|
||||
|
||||
//====================================================================
|
||||
|
||||
|
||||
/*
|
||||
=============
|
||||
Draw_StretchRaw
|
||||
=============
|
||||
*/
|
||||
extern unsigned r_rawpalette[256];
|
||||
|
||||
void Draw_StretchRaw (int x, int y, int w, int h, int cols, int rows, byte *data)
|
||||
{
|
||||
unsigned image32[256*256];
|
||||
unsigned char image8[256*256];
|
||||
int i, j, trows;
|
||||
byte *source;
|
||||
int frac, fracstep;
|
||||
float hscale;
|
||||
int row;
|
||||
float t;
|
||||
|
||||
GL_Bind (0);
|
||||
|
||||
if (rows<=256)
|
||||
{
|
||||
hscale = 1;
|
||||
trows = rows;
|
||||
}
|
||||
else
|
||||
{
|
||||
hscale = rows/256.0;
|
||||
trows = 256;
|
||||
}
|
||||
t = rows*hscale / 256 - 1.0/512.0;
|
||||
|
||||
if ( !qglColorTableEXT )
|
||||
{
|
||||
unsigned *dest;
|
||||
|
||||
for (i=0 ; i<trows ; i++)
|
||||
{
|
||||
row = (int)(i*hscale);
|
||||
if (row > rows)
|
||||
break;
|
||||
source = data + cols*row;
|
||||
dest = &image32[i*256];
|
||||
fracstep = cols*0x10000/256;
|
||||
frac = fracstep >> 1;
|
||||
for (j=0 ; j<256 ; j++)
|
||||
{
|
||||
dest[j] = r_rawpalette[source[frac>>16]];
|
||||
frac += fracstep;
|
||||
}
|
||||
}
|
||||
|
||||
qglTexImage2D (GL_TEXTURE_2D, 0, gl_tex_solid_format, 256, 256, 0, GL_RGBA, GL_UNSIGNED_BYTE, image32);
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned char *dest;
|
||||
|
||||
for (i=0 ; i<trows ; i++)
|
||||
{
|
||||
row = (int)(i*hscale);
|
||||
if (row > rows)
|
||||
break;
|
||||
source = data + cols*row;
|
||||
dest = &image8[i*256];
|
||||
fracstep = cols*0x10000/256;
|
||||
frac = fracstep >> 1;
|
||||
for (j=0 ; j<256 ; j++)
|
||||
{
|
||||
dest[j] = source[frac>>16];
|
||||
frac += fracstep;
|
||||
}
|
||||
}
|
||||
|
||||
qglTexImage2D( GL_TEXTURE_2D,
|
||||
0,
|
||||
GL_COLOR_INDEX8_EXT,
|
||||
256, 256,
|
||||
0,
|
||||
GL_COLOR_INDEX,
|
||||
GL_UNSIGNED_BYTE,
|
||||
image8 );
|
||||
}
|
||||
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
|
||||
if ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( gl_config.renderer & GL_RENDERER_RENDITION ) )
|
||||
qglDisable (GL_ALPHA_TEST);
|
||||
|
||||
qglBegin (GL_QUADS);
|
||||
qglTexCoord2f (1.0/512.0, 1.0/512.0);
|
||||
qglVertex2f (x, y);
|
||||
qglTexCoord2f (511.0/512.0, 1.0/512.0);
|
||||
qglVertex2f (x+w, y);
|
||||
qglTexCoord2f (511.0/512.0, t);
|
||||
qglVertex2f (x+w, y+h);
|
||||
qglTexCoord2f (1.0/512.0, t);
|
||||
qglVertex2f (x, y+h);
|
||||
qglEnd ();
|
||||
|
||||
if ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( gl_config.renderer & GL_RENDERER_RENDITION ) )
|
||||
qglEnable (GL_ALPHA_TEST);
|
||||
}
|
||||
|
1623
src/refresh/opengl/gl_image.c
Normal file
1623
src/refresh/opengl/gl_image.c
Normal file
File diff suppressed because it is too large
Load diff
729
src/refresh/opengl/gl_light.c
Normal file
729
src/refresh/opengl/gl_light.c
Normal file
|
@ -0,0 +1,729 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 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.
|
||||
|
||||
*/
|
||||
// r_light.c
|
||||
|
||||
#include "gl_local.h"
|
||||
|
||||
int r_dlightframecount;
|
||||
|
||||
#define DLIGHT_CUTOFF 64
|
||||
|
||||
/*
|
||||
=============================================================================
|
||||
|
||||
DYNAMIC LIGHTS BLEND RENDERING
|
||||
|
||||
=============================================================================
|
||||
*/
|
||||
|
||||
void R_RenderDlight (dlight_t *light)
|
||||
{
|
||||
int i, j;
|
||||
float a;
|
||||
vec3_t v;
|
||||
float rad;
|
||||
|
||||
rad = light->intensity * 0.35;
|
||||
|
||||
VectorSubtract (light->origin, r_origin, v);
|
||||
#if 0
|
||||
// FIXME?
|
||||
if (VectorLength (v) < rad)
|
||||
{ // view is inside the dlight
|
||||
V_AddBlend (light->color[0], light->color[1], light->color[2], light->intensity * 0.0003, v_blend);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
qglBegin (GL_TRIANGLE_FAN);
|
||||
qglColor3f (light->color[0]*0.2, light->color[1]*0.2, light->color[2]*0.2);
|
||||
for (i=0 ; i<3 ; i++)
|
||||
v[i] = light->origin[i] - vpn[i]*rad;
|
||||
qglVertex3fv (v);
|
||||
qglColor3f (0,0,0);
|
||||
for (i=16 ; i>=0 ; i--)
|
||||
{
|
||||
a = i/16.0 * M_PI*2;
|
||||
for (j=0 ; j<3 ; j++)
|
||||
v[j] = light->origin[j] + vright[j]*cos(a)*rad
|
||||
+ vup[j]*sin(a)*rad;
|
||||
qglVertex3fv (v);
|
||||
}
|
||||
qglEnd ();
|
||||
}
|
||||
|
||||
/*
|
||||
=============
|
||||
R_RenderDlights
|
||||
=============
|
||||
*/
|
||||
void R_RenderDlights (void)
|
||||
{
|
||||
int i;
|
||||
dlight_t *l;
|
||||
|
||||
if (!gl_flashblend->value)
|
||||
return;
|
||||
|
||||
r_dlightframecount = r_framecount + 1; // because the count hasn't
|
||||
// advanced yet for this frame
|
||||
qglDepthMask (0);
|
||||
qglDisable (GL_TEXTURE_2D);
|
||||
qglShadeModel (GL_SMOOTH);
|
||||
qglEnable (GL_BLEND);
|
||||
qglBlendFunc (GL_ONE, GL_ONE);
|
||||
|
||||
l = r_newrefdef.dlights;
|
||||
for (i=0 ; i<r_newrefdef.num_dlights ; i++, l++)
|
||||
R_RenderDlight (l);
|
||||
|
||||
qglColor3f (1,1,1);
|
||||
qglDisable (GL_BLEND);
|
||||
qglEnable (GL_TEXTURE_2D);
|
||||
qglBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
qglDepthMask (1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=============================================================================
|
||||
|
||||
DYNAMIC LIGHTS
|
||||
|
||||
=============================================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
=============
|
||||
R_MarkLights
|
||||
=============
|
||||
*/
|
||||
void R_MarkLights (dlight_t *light, int bit, mnode_t *node)
|
||||
{
|
||||
cplane_t *splitplane;
|
||||
float dist;
|
||||
msurface_t *surf;
|
||||
int i;
|
||||
|
||||
if (node->contents != -1)
|
||||
return;
|
||||
|
||||
splitplane = node->plane;
|
||||
dist = DotProduct (light->origin, splitplane->normal) - splitplane->dist;
|
||||
|
||||
if (dist > light->intensity-DLIGHT_CUTOFF)
|
||||
{
|
||||
R_MarkLights (light, bit, node->children[0]);
|
||||
return;
|
||||
}
|
||||
if (dist < -light->intensity+DLIGHT_CUTOFF)
|
||||
{
|
||||
R_MarkLights (light, bit, node->children[1]);
|
||||
return;
|
||||
}
|
||||
|
||||
// mark the polygons
|
||||
surf = r_worldmodel->surfaces + node->firstsurface;
|
||||
for (i=0 ; i<node->numsurfaces ; i++, surf++)
|
||||
{
|
||||
if (surf->dlightframe != r_dlightframecount)
|
||||
{
|
||||
surf->dlightbits = 0;
|
||||
surf->dlightframe = r_dlightframecount;
|
||||
}
|
||||
surf->dlightbits |= bit;
|
||||
}
|
||||
|
||||
R_MarkLights (light, bit, node->children[0]);
|
||||
R_MarkLights (light, bit, node->children[1]);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=============
|
||||
R_PushDlights
|
||||
=============
|
||||
*/
|
||||
void R_PushDlights (void)
|
||||
{
|
||||
int i;
|
||||
dlight_t *l;
|
||||
|
||||
if (gl_flashblend->value)
|
||||
return;
|
||||
|
||||
r_dlightframecount = r_framecount + 1; // because the count hasn't
|
||||
// advanced yet for this frame
|
||||
l = r_newrefdef.dlights;
|
||||
for (i=0 ; i<r_newrefdef.num_dlights ; i++, l++)
|
||||
R_MarkLights ( l, 1<<i, r_worldmodel->nodes );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=============================================================================
|
||||
|
||||
LIGHT SAMPLING
|
||||
|
||||
=============================================================================
|
||||
*/
|
||||
|
||||
vec3_t pointcolor;
|
||||
cplane_t *lightplane; // used as shadow plane
|
||||
vec3_t lightspot;
|
||||
|
||||
int RecursiveLightPoint (mnode_t *node, vec3_t start, vec3_t end)
|
||||
{
|
||||
float front, back, frac;
|
||||
int side;
|
||||
cplane_t *plane;
|
||||
vec3_t mid;
|
||||
msurface_t *surf;
|
||||
int s, t, ds, dt;
|
||||
int i;
|
||||
mtexinfo_t *tex;
|
||||
byte *lightmap;
|
||||
int maps;
|
||||
int r;
|
||||
|
||||
if (node->contents != -1)
|
||||
return -1; // didn't hit anything
|
||||
|
||||
// calculate mid point
|
||||
|
||||
// FIXME: optimize for axial
|
||||
plane = node->plane;
|
||||
front = DotProduct (start, plane->normal) - plane->dist;
|
||||
back = DotProduct (end, plane->normal) - plane->dist;
|
||||
side = front < 0;
|
||||
|
||||
if ( (back < 0) == side)
|
||||
return RecursiveLightPoint (node->children[side], start, end);
|
||||
|
||||
frac = front / (front-back);
|
||||
mid[0] = start[0] + (end[0] - start[0])*frac;
|
||||
mid[1] = start[1] + (end[1] - start[1])*frac;
|
||||
mid[2] = start[2] + (end[2] - start[2])*frac;
|
||||
|
||||
// go down front side
|
||||
r = RecursiveLightPoint (node->children[side], start, mid);
|
||||
if (r >= 0)
|
||||
return r; // hit something
|
||||
|
||||
if ( (back < 0) == side )
|
||||
return -1; // didn't hit anuthing
|
||||
|
||||
// check for impact on this node
|
||||
VectorCopy (mid, lightspot);
|
||||
lightplane = plane;
|
||||
|
||||
surf = r_worldmodel->surfaces + node->firstsurface;
|
||||
for (i=0 ; i<node->numsurfaces ; i++, surf++)
|
||||
{
|
||||
if (surf->flags&(SURF_DRAWTURB|SURF_DRAWSKY))
|
||||
continue; // no lightmaps
|
||||
|
||||
tex = surf->texinfo;
|
||||
|
||||
s = DotProduct (mid, tex->vecs[0]) + tex->vecs[0][3];
|
||||
t = DotProduct (mid, tex->vecs[1]) + tex->vecs[1][3];;
|
||||
|
||||
if (s < surf->texturemins[0] ||
|
||||
t < surf->texturemins[1])
|
||||
continue;
|
||||
|
||||
ds = s - surf->texturemins[0];
|
||||
dt = t - surf->texturemins[1];
|
||||
|
||||
if ( ds > surf->extents[0] || dt > surf->extents[1] )
|
||||
continue;
|
||||
|
||||
if (!surf->samples)
|
||||
return 0;
|
||||
|
||||
ds >>= 4;
|
||||
dt >>= 4;
|
||||
|
||||
lightmap = surf->samples;
|
||||
VectorCopy (vec3_origin, pointcolor);
|
||||
if (lightmap)
|
||||
{
|
||||
vec3_t scale;
|
||||
|
||||
lightmap += 3*(dt * ((surf->extents[0]>>4)+1) + ds);
|
||||
|
||||
for (maps = 0 ; maps < MAXLIGHTMAPS && surf->styles[maps] != 255 ;
|
||||
maps++)
|
||||
{
|
||||
for (i=0 ; i<3 ; i++)
|
||||
scale[i] = gl_modulate->value*r_newrefdef.lightstyles[surf->styles[maps]].rgb[i];
|
||||
|
||||
pointcolor[0] += lightmap[0] * scale[0] * (1.0/255);
|
||||
pointcolor[1] += lightmap[1] * scale[1] * (1.0/255);
|
||||
pointcolor[2] += lightmap[2] * scale[2] * (1.0/255);
|
||||
lightmap += 3*((surf->extents[0]>>4)+1) *
|
||||
((surf->extents[1]>>4)+1);
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
// go down back side
|
||||
return RecursiveLightPoint (node->children[!side], mid, end);
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
R_LightPoint
|
||||
===============
|
||||
*/
|
||||
void R_LightPoint (vec3_t p, vec3_t color)
|
||||
{
|
||||
vec3_t end;
|
||||
float r;
|
||||
int lnum;
|
||||
dlight_t *dl;
|
||||
float light;
|
||||
vec3_t dist;
|
||||
float add;
|
||||
|
||||
if (!r_worldmodel->lightdata)
|
||||
{
|
||||
color[0] = color[1] = color[2] = 1.0;
|
||||
return;
|
||||
}
|
||||
|
||||
end[0] = p[0];
|
||||
end[1] = p[1];
|
||||
end[2] = p[2] - 2048;
|
||||
|
||||
r = RecursiveLightPoint (r_worldmodel->nodes, p, end);
|
||||
|
||||
if (r == -1)
|
||||
{
|
||||
VectorCopy (vec3_origin, color);
|
||||
}
|
||||
else
|
||||
{
|
||||
VectorCopy (pointcolor, color);
|
||||
}
|
||||
|
||||
//
|
||||
// add dynamic lights
|
||||
//
|
||||
light = 0;
|
||||
dl = r_newrefdef.dlights;
|
||||
for (lnum=0 ; lnum<r_newrefdef.num_dlights ; lnum++, dl++)
|
||||
{
|
||||
VectorSubtract (currententity->origin,
|
||||
dl->origin,
|
||||
dist);
|
||||
add = dl->intensity - VectorLength(dist);
|
||||
add *= (1.0/256);
|
||||
if (add > 0)
|
||||
{
|
||||
VectorMA (color, add, dl->color, color);
|
||||
}
|
||||
}
|
||||
|
||||
VectorScale (color, gl_modulate->value, color);
|
||||
}
|
||||
|
||||
|
||||
//===================================================================
|
||||
|
||||
static float s_blocklights[34*34*3];
|
||||
/*
|
||||
===============
|
||||
R_AddDynamicLights
|
||||
===============
|
||||
*/
|
||||
void R_AddDynamicLights (msurface_t *surf)
|
||||
{
|
||||
int lnum;
|
||||
int sd, td;
|
||||
float fdist, frad, fminlight;
|
||||
vec3_t impact, local;
|
||||
int s, t;
|
||||
int i;
|
||||
int smax, tmax;
|
||||
mtexinfo_t *tex;
|
||||
dlight_t *dl;
|
||||
float *pfBL;
|
||||
float fsacc, ftacc;
|
||||
|
||||
smax = (surf->extents[0]>>4)+1;
|
||||
tmax = (surf->extents[1]>>4)+1;
|
||||
tex = surf->texinfo;
|
||||
|
||||
for (lnum=0 ; lnum<r_newrefdef.num_dlights ; lnum++)
|
||||
{
|
||||
if ( !(surf->dlightbits & (1<<lnum) ) )
|
||||
continue; // not lit by this light
|
||||
|
||||
dl = &r_newrefdef.dlights[lnum];
|
||||
frad = dl->intensity;
|
||||
fdist = DotProduct (dl->origin, surf->plane->normal) -
|
||||
surf->plane->dist;
|
||||
frad -= fabs(fdist);
|
||||
// rad is now the highest intensity on the plane
|
||||
|
||||
fminlight = DLIGHT_CUTOFF; // FIXME: make configurable?
|
||||
if (frad < fminlight)
|
||||
continue;
|
||||
fminlight = frad - fminlight;
|
||||
|
||||
for (i=0 ; i<3 ; i++)
|
||||
{
|
||||
impact[i] = dl->origin[i] -
|
||||
surf->plane->normal[i]*fdist;
|
||||
}
|
||||
|
||||
local[0] = DotProduct (impact, tex->vecs[0]) + tex->vecs[0][3] - surf->texturemins[0];
|
||||
local[1] = DotProduct (impact, tex->vecs[1]) + tex->vecs[1][3] - surf->texturemins[1];
|
||||
|
||||
pfBL = s_blocklights;
|
||||
for (t = 0, ftacc = 0 ; t<tmax ; t++, ftacc += 16)
|
||||
{
|
||||
td = local[1] - ftacc;
|
||||
if ( td < 0 )
|
||||
td = -td;
|
||||
|
||||
for ( s=0, fsacc = 0 ; s<smax ; s++, fsacc += 16, pfBL += 3)
|
||||
{
|
||||
sd = Q_ftol( local[0] - fsacc );
|
||||
|
||||
if ( sd < 0 )
|
||||
sd = -sd;
|
||||
|
||||
if (sd > td)
|
||||
fdist = sd + (td>>1);
|
||||
else
|
||||
fdist = td + (sd>>1);
|
||||
|
||||
if ( fdist < fminlight )
|
||||
{
|
||||
pfBL[0] += ( frad - fdist ) * dl->color[0];
|
||||
pfBL[1] += ( frad - fdist ) * dl->color[1];
|
||||
pfBL[2] += ( frad - fdist ) * dl->color[2];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** R_SetCacheState
|
||||
*/
|
||||
void R_SetCacheState( msurface_t *surf )
|
||||
{
|
||||
int maps;
|
||||
|
||||
for (maps = 0 ; maps < MAXLIGHTMAPS && surf->styles[maps] != 255 ;
|
||||
maps++)
|
||||
{
|
||||
surf->cached_light[maps] = r_newrefdef.lightstyles[surf->styles[maps]].white;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
R_BuildLightMap
|
||||
|
||||
Combine and scale multiple lightmaps into the floating format in blocklights
|
||||
===============
|
||||
*/
|
||||
void R_BuildLightMap (msurface_t *surf, byte *dest, int stride)
|
||||
{
|
||||
int smax, tmax;
|
||||
int r, g, b, a, max;
|
||||
int i, j, size;
|
||||
byte *lightmap;
|
||||
float scale[4];
|
||||
int nummaps;
|
||||
float *bl;
|
||||
lightstyle_t *style;
|
||||
int monolightmap;
|
||||
|
||||
if ( surf->texinfo->flags & (SURF_SKY|SURF_TRANS33|SURF_TRANS66|SURF_WARP) )
|
||||
ri.Sys_Error (ERR_DROP, "R_BuildLightMap called for non-lit surface");
|
||||
|
||||
smax = (surf->extents[0]>>4)+1;
|
||||
tmax = (surf->extents[1]>>4)+1;
|
||||
size = smax*tmax;
|
||||
if (size > (sizeof(s_blocklights)>>4) )
|
||||
ri.Sys_Error (ERR_DROP, "Bad s_blocklights size");
|
||||
|
||||
// set to full bright if no light data
|
||||
if (!surf->samples)
|
||||
{
|
||||
int maps;
|
||||
|
||||
for (i=0 ; i<size*3 ; i++)
|
||||
s_blocklights[i] = 255;
|
||||
for (maps = 0 ; maps < MAXLIGHTMAPS && surf->styles[maps] != 255 ;
|
||||
maps++)
|
||||
{
|
||||
style = &r_newrefdef.lightstyles[surf->styles[maps]];
|
||||
}
|
||||
goto store;
|
||||
}
|
||||
|
||||
// count the # of maps
|
||||
for ( nummaps = 0 ; nummaps < MAXLIGHTMAPS && surf->styles[nummaps] != 255 ;
|
||||
nummaps++)
|
||||
;
|
||||
|
||||
lightmap = surf->samples;
|
||||
|
||||
// add all the lightmaps
|
||||
if ( nummaps == 1 )
|
||||
{
|
||||
int maps;
|
||||
|
||||
for (maps = 0 ; maps < MAXLIGHTMAPS && surf->styles[maps] != 255 ;
|
||||
maps++)
|
||||
{
|
||||
bl = s_blocklights;
|
||||
|
||||
for (i=0 ; i<3 ; i++)
|
||||
scale[i] = gl_modulate->value*r_newrefdef.lightstyles[surf->styles[maps]].rgb[i];
|
||||
|
||||
if ( scale[0] == 1.0F &&
|
||||
scale[1] == 1.0F &&
|
||||
scale[2] == 1.0F )
|
||||
{
|
||||
for (i=0 ; i<size ; i++, bl+=3)
|
||||
{
|
||||
bl[0] = lightmap[i*3+0];
|
||||
bl[1] = lightmap[i*3+1];
|
||||
bl[2] = lightmap[i*3+2];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i=0 ; i<size ; i++, bl+=3)
|
||||
{
|
||||
bl[0] = lightmap[i*3+0] * scale[0];
|
||||
bl[1] = lightmap[i*3+1] * scale[1];
|
||||
bl[2] = lightmap[i*3+2] * scale[2];
|
||||
}
|
||||
}
|
||||
lightmap += size*3; // skip to next lightmap
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int maps;
|
||||
|
||||
memset( s_blocklights, 0, sizeof( s_blocklights[0] ) * size * 3 );
|
||||
|
||||
for (maps = 0 ; maps < MAXLIGHTMAPS && surf->styles[maps] != 255 ;
|
||||
maps++)
|
||||
{
|
||||
bl = s_blocklights;
|
||||
|
||||
for (i=0 ; i<3 ; i++)
|
||||
scale[i] = gl_modulate->value*r_newrefdef.lightstyles[surf->styles[maps]].rgb[i];
|
||||
|
||||
if ( scale[0] == 1.0F &&
|
||||
scale[1] == 1.0F &&
|
||||
scale[2] == 1.0F )
|
||||
{
|
||||
for (i=0 ; i<size ; i++, bl+=3 )
|
||||
{
|
||||
bl[0] += lightmap[i*3+0];
|
||||
bl[1] += lightmap[i*3+1];
|
||||
bl[2] += lightmap[i*3+2];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i=0 ; i<size ; i++, bl+=3)
|
||||
{
|
||||
bl[0] += lightmap[i*3+0] * scale[0];
|
||||
bl[1] += lightmap[i*3+1] * scale[1];
|
||||
bl[2] += lightmap[i*3+2] * scale[2];
|
||||
}
|
||||
}
|
||||
lightmap += size*3; // skip to next lightmap
|
||||
}
|
||||
}
|
||||
|
||||
// add all the dynamic lights
|
||||
if (surf->dlightframe == r_framecount)
|
||||
R_AddDynamicLights (surf);
|
||||
|
||||
// put into texture format
|
||||
store:
|
||||
stride -= (smax<<2);
|
||||
bl = s_blocklights;
|
||||
|
||||
monolightmap = gl_monolightmap->string[0];
|
||||
|
||||
if ( monolightmap == '0' )
|
||||
{
|
||||
for (i=0 ; i<tmax ; i++, dest += stride)
|
||||
{
|
||||
for (j=0 ; j<smax ; j++)
|
||||
{
|
||||
|
||||
r = Q_ftol( bl[0] );
|
||||
g = Q_ftol( bl[1] );
|
||||
b = Q_ftol( bl[2] );
|
||||
|
||||
// catch negative lights
|
||||
if (r < 0)
|
||||
r = 0;
|
||||
if (g < 0)
|
||||
g = 0;
|
||||
if (b < 0)
|
||||
b = 0;
|
||||
|
||||
/*
|
||||
** determine the brightest of the three color components
|
||||
*/
|
||||
if (r > g)
|
||||
max = r;
|
||||
else
|
||||
max = g;
|
||||
if (b > max)
|
||||
max = b;
|
||||
|
||||
/*
|
||||
** alpha is ONLY used for the mono lightmap case. For this reason
|
||||
** we set it to the brightest of the color components so that
|
||||
** things don't get too dim.
|
||||
*/
|
||||
a = max;
|
||||
|
||||
/*
|
||||
** rescale all the color components if the intensity of the greatest
|
||||
** channel exceeds 1.0
|
||||
*/
|
||||
if (max > 255)
|
||||
{
|
||||
float t = 255.0F / max;
|
||||
|
||||
r = r*t;
|
||||
g = g*t;
|
||||
b = b*t;
|
||||
a = a*t;
|
||||
}
|
||||
|
||||
dest[0] = r;
|
||||
dest[1] = g;
|
||||
dest[2] = b;
|
||||
dest[3] = a;
|
||||
|
||||
bl += 3;
|
||||
dest += 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i=0 ; i<tmax ; i++, dest += stride)
|
||||
{
|
||||
for (j=0 ; j<smax ; j++)
|
||||
{
|
||||
|
||||
r = Q_ftol( bl[0] );
|
||||
g = Q_ftol( bl[1] );
|
||||
b = Q_ftol( bl[2] );
|
||||
|
||||
// catch negative lights
|
||||
if (r < 0)
|
||||
r = 0;
|
||||
if (g < 0)
|
||||
g = 0;
|
||||
if (b < 0)
|
||||
b = 0;
|
||||
|
||||
/*
|
||||
** determine the brightest of the three color components
|
||||
*/
|
||||
if (r > g)
|
||||
max = r;
|
||||
else
|
||||
max = g;
|
||||
if (b > max)
|
||||
max = b;
|
||||
|
||||
/*
|
||||
** alpha is ONLY used for the mono lightmap case. For this reason
|
||||
** we set it to the brightest of the color components so that
|
||||
** things don't get too dim.
|
||||
*/
|
||||
a = max;
|
||||
|
||||
/*
|
||||
** rescale all the color components if the intensity of the greatest
|
||||
** channel exceeds 1.0
|
||||
*/
|
||||
if (max > 255)
|
||||
{
|
||||
float t = 255.0F / max;
|
||||
|
||||
r = r*t;
|
||||
g = g*t;
|
||||
b = b*t;
|
||||
a = a*t;
|
||||
}
|
||||
|
||||
/*
|
||||
** So if we are doing alpha lightmaps we need to set the R, G, and B
|
||||
** components to 0 and we need to set alpha to 1-alpha.
|
||||
*/
|
||||
switch ( monolightmap )
|
||||
{
|
||||
case 'L':
|
||||
case 'I':
|
||||
r = a;
|
||||
g = b = 0;
|
||||
break;
|
||||
case 'C':
|
||||
// try faking colored lighting
|
||||
a = 255 - ((r+g+b)/3);
|
||||
r *= a/255.0;
|
||||
g *= a/255.0;
|
||||
b *= a/255.0;
|
||||
break;
|
||||
case 'A':
|
||||
default:
|
||||
r = g = b = 0;
|
||||
a = 255 - a;
|
||||
break;
|
||||
}
|
||||
|
||||
dest[0] = r;
|
||||
dest[1] = g;
|
||||
dest[2] = b;
|
||||
dest[3] = a;
|
||||
|
||||
bl += 3;
|
||||
dest += 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
470
src/refresh/opengl/gl_local.h
Normal file
470
src/refresh/opengl/gl_local.h
Normal file
|
@ -0,0 +1,470 @@
|
|||
#ifndef __GL_LOCAL__
|
||||
#define __GL_LOCAL__
|
||||
/*
|
||||
Copyright (C) 1997-2001 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.
|
||||
|
||||
*/
|
||||
|
||||
#ifdef _WIN32
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <GL/gl.h>
|
||||
#ifndef SOLARIS
|
||||
//#include <GL/glxext.h>
|
||||
#else
|
||||
#include <GL/glu.h>
|
||||
#ifndef GL_COLOR_INDEX8_EXT
|
||||
#define GL_COLOR_INDEX8_EXT GL_COLOR_INDEX
|
||||
#endif
|
||||
#endif
|
||||
#include <math.h>
|
||||
|
||||
#ifndef _WIN32
|
||||
char *strlwr (char *s);
|
||||
#endif
|
||||
|
||||
#include "../client/ref.h"
|
||||
|
||||
#include "qgl.h"
|
||||
|
||||
#define REF_VERSION "GL 0.01"
|
||||
|
||||
// up / down
|
||||
#define PITCH 0
|
||||
|
||||
// left / right
|
||||
#define YAW 1
|
||||
|
||||
// fall over
|
||||
#define ROLL 2
|
||||
|
||||
|
||||
#ifndef __VIDDEF_T
|
||||
#define __VIDDEF_T
|
||||
typedef struct
|
||||
{
|
||||
int width, height; // coordinates from main game
|
||||
} viddef_t;
|
||||
#endif
|
||||
|
||||
extern viddef_t vid;
|
||||
|
||||
|
||||
/*
|
||||
|
||||
skins will be outline flood filled and mip mapped
|
||||
pics and sprites with alpha will be outline flood filled
|
||||
pic won't be mip mapped
|
||||
|
||||
model skin
|
||||
sprite frame
|
||||
wall texture
|
||||
pic
|
||||
|
||||
*/
|
||||
|
||||
typedef enum
|
||||
{
|
||||
it_skin,
|
||||
it_sprite,
|
||||
it_wall,
|
||||
it_pic,
|
||||
it_sky
|
||||
} imagetype_t;
|
||||
|
||||
typedef struct image_s
|
||||
{
|
||||
char name[MAX_QPATH]; // game path, including extension
|
||||
imagetype_t type;
|
||||
int width, height; // source image
|
||||
int upload_width, upload_height; // after power of two and picmip
|
||||
int registration_sequence; // 0 = free
|
||||
struct msurface_s *texturechain; // for sort-by-texture world drawing
|
||||
int texnum; // gl texture binding
|
||||
float sl, tl, sh, th; // 0,0 - 1,1 unless part of the scrap
|
||||
qboolean scrap;
|
||||
qboolean has_alpha;
|
||||
|
||||
qboolean paletted;
|
||||
} image_t;
|
||||
|
||||
#define TEXNUM_LIGHTMAPS 1024
|
||||
#define TEXNUM_SCRAPS 1152
|
||||
#define TEXNUM_IMAGES 1153
|
||||
|
||||
#define MAX_GLTEXTURES 1024
|
||||
|
||||
//===================================================================
|
||||
|
||||
typedef enum
|
||||
{
|
||||
rserr_ok,
|
||||
|
||||
rserr_invalid_fullscreen,
|
||||
rserr_invalid_mode,
|
||||
|
||||
rserr_unknown
|
||||
} rserr_t;
|
||||
|
||||
#include "gl_model.h"
|
||||
|
||||
void GL_BeginRendering (int *x, int *y, int *width, int *height);
|
||||
void GL_EndRendering (void);
|
||||
|
||||
void GL_SetDefaultState( void );
|
||||
void GL_UpdateSwapInterval( void );
|
||||
|
||||
extern float gldepthmin, gldepthmax;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float x, y, z;
|
||||
float s, t;
|
||||
float r, g, b;
|
||||
} glvert_t;
|
||||
|
||||
|
||||
#define MAX_LBM_HEIGHT 480
|
||||
|
||||
#define BACKFACE_EPSILON 0.01
|
||||
|
||||
|
||||
//====================================================
|
||||
|
||||
extern image_t gltextures[MAX_GLTEXTURES];
|
||||
extern int numgltextures;
|
||||
|
||||
|
||||
extern image_t *r_notexture;
|
||||
extern image_t *r_particletexture;
|
||||
extern entity_t *currententity;
|
||||
extern model_t *currentmodel;
|
||||
extern int r_visframecount;
|
||||
extern int r_framecount;
|
||||
extern cplane_t frustum[4];
|
||||
extern int c_brush_polys, c_alias_polys;
|
||||
|
||||
|
||||
extern int gl_filter_min, gl_filter_max;
|
||||
|
||||
//
|
||||
// view origin
|
||||
//
|
||||
extern vec3_t vup;
|
||||
extern vec3_t vpn;
|
||||
extern vec3_t vright;
|
||||
extern vec3_t r_origin;
|
||||
|
||||
//
|
||||
// screen size info
|
||||
//
|
||||
extern refdef_t r_newrefdef;
|
||||
extern int r_viewcluster, r_viewcluster2, r_oldviewcluster, r_oldviewcluster2;
|
||||
|
||||
extern cvar_t *r_norefresh;
|
||||
extern cvar_t *r_lefthand;
|
||||
extern cvar_t *r_drawentities;
|
||||
extern cvar_t *r_drawworld;
|
||||
extern cvar_t *r_speeds;
|
||||
extern cvar_t *r_fullbright;
|
||||
extern cvar_t *r_novis;
|
||||
extern cvar_t *r_nocull;
|
||||
extern cvar_t *r_lerpmodels;
|
||||
|
||||
extern cvar_t *r_lightlevel; // FIXME: This is a HACK to get the client's light level
|
||||
|
||||
extern cvar_t *gl_vertex_arrays;
|
||||
|
||||
extern cvar_t *gl_ext_swapinterval;
|
||||
extern cvar_t *gl_ext_palettedtexture;
|
||||
extern cvar_t *gl_ext_multitexture;
|
||||
extern cvar_t *gl_ext_pointparameters;
|
||||
extern cvar_t *gl_ext_compiled_vertex_array;
|
||||
|
||||
extern cvar_t *gl_particle_min_size;
|
||||
extern cvar_t *gl_particle_max_size;
|
||||
extern cvar_t *gl_particle_size;
|
||||
extern cvar_t *gl_particle_att_a;
|
||||
extern cvar_t *gl_particle_att_b;
|
||||
extern cvar_t *gl_particle_att_c;
|
||||
|
||||
extern cvar_t *gl_nosubimage;
|
||||
extern cvar_t *gl_bitdepth;
|
||||
extern cvar_t *gl_mode;
|
||||
extern cvar_t *gl_log;
|
||||
extern cvar_t *gl_lightmap;
|
||||
extern cvar_t *gl_shadows;
|
||||
extern cvar_t *gl_stencilshadow;
|
||||
extern cvar_t *gl_dynamic;
|
||||
extern cvar_t *gl_monolightmap;
|
||||
extern cvar_t *gl_nobind;
|
||||
extern cvar_t *gl_round_down;
|
||||
extern cvar_t *gl_picmip;
|
||||
extern cvar_t *gl_skymip;
|
||||
extern cvar_t *gl_showtris;
|
||||
extern cvar_t *gl_finish;
|
||||
extern cvar_t *gl_ztrick;
|
||||
extern cvar_t *gl_clear;
|
||||
extern cvar_t *gl_cull;
|
||||
extern cvar_t *gl_poly;
|
||||
extern cvar_t *gl_texsort;
|
||||
extern cvar_t *gl_polyblend;
|
||||
extern cvar_t *gl_flashblend;
|
||||
extern cvar_t *gl_lightmaptype;
|
||||
extern cvar_t *gl_modulate;
|
||||
extern cvar_t *gl_playermip;
|
||||
extern cvar_t *gl_drawbuffer;
|
||||
extern cvar_t *gl_3dlabs_broken;
|
||||
extern cvar_t *gl_driver;
|
||||
extern cvar_t *gl_swapinterval;
|
||||
extern cvar_t *gl_texturemode;
|
||||
extern cvar_t *gl_texturealphamode;
|
||||
extern cvar_t *gl_texturesolidmode;
|
||||
extern cvar_t *gl_saturatelighting;
|
||||
extern cvar_t *gl_lockpvs;
|
||||
|
||||
extern cvar_t *vid_fullscreen;
|
||||
extern cvar_t *vid_gamma;
|
||||
|
||||
extern cvar_t *intensity;
|
||||
|
||||
extern int gl_lightmap_format;
|
||||
extern int gl_solid_format;
|
||||
extern int gl_alpha_format;
|
||||
extern int gl_tex_solid_format;
|
||||
extern int gl_tex_alpha_format;
|
||||
|
||||
extern int c_visible_lightmaps;
|
||||
extern int c_visible_textures;
|
||||
|
||||
extern float r_world_matrix[16];
|
||||
|
||||
void R_TranslatePlayerSkin (int playernum);
|
||||
void GL_Bind (int texnum);
|
||||
void GL_MBind( GLenum target, int texnum );
|
||||
void GL_TexEnv( GLenum value );
|
||||
void GL_EnableMultitexture( qboolean enable );
|
||||
void GL_SelectTexture( GLenum );
|
||||
|
||||
void R_LightPoint (vec3_t p, vec3_t color);
|
||||
void R_PushDlights (void);
|
||||
|
||||
//====================================================================
|
||||
|
||||
extern model_t *r_worldmodel;
|
||||
|
||||
extern unsigned d_8to24table[256];
|
||||
|
||||
extern int registration_sequence;
|
||||
|
||||
|
||||
void V_AddBlend (float r, float g, float b, float a, float *v_blend);
|
||||
|
||||
int R_Init( void *hinstance, void *hWnd );
|
||||
void R_Shutdown( void );
|
||||
|
||||
void R_RenderView (refdef_t *fd);
|
||||
void GL_ScreenShot_f (void);
|
||||
void R_DrawAliasModel (entity_t *e);
|
||||
void R_DrawBrushModel (entity_t *e);
|
||||
void R_DrawSpriteModel (entity_t *e);
|
||||
void R_DrawBeam( entity_t *e );
|
||||
void R_DrawWorld (void);
|
||||
void R_RenderDlights (void);
|
||||
void R_DrawAlphaSurfaces (void);
|
||||
void R_RenderBrushPoly (msurface_t *fa);
|
||||
void R_InitParticleTexture (void);
|
||||
void Draw_InitLocal (void);
|
||||
void GL_SubdivideSurface (msurface_t *fa);
|
||||
qboolean R_CullBox (vec3_t mins, vec3_t maxs);
|
||||
void R_RotateForEntity (entity_t *e);
|
||||
void R_MarkLeaves (void);
|
||||
|
||||
glpoly_t *WaterWarpPolyVerts (glpoly_t *p);
|
||||
void EmitWaterPolys (msurface_t *fa);
|
||||
void R_AddSkySurface (msurface_t *fa);
|
||||
void R_ClearSkyBox (void);
|
||||
void R_DrawSkyBox (void);
|
||||
void R_MarkLights (dlight_t *light, int bit, mnode_t *node);
|
||||
|
||||
#if 0
|
||||
short LittleShort (short l);
|
||||
short BigShort (short l);
|
||||
int LittleLong (int l);
|
||||
float LittleFloat (float f);
|
||||
|
||||
char *va(char *format, ...);
|
||||
// does a varargs printf into a temp buffer
|
||||
#endif
|
||||
|
||||
void COM_StripExtension (char *in, char *out);
|
||||
|
||||
void Draw_GetPicSize (int *w, int *h, char *name);
|
||||
void Draw_Pic (int x, int y, char *name);
|
||||
void Draw_StretchPic (int x, int y, int w, int h, char *name);
|
||||
void Draw_Char (int x, int y, int c);
|
||||
void Draw_TileClear (int x, int y, int w, int h, char *name);
|
||||
void Draw_Fill (int x, int y, int w, int h, int c);
|
||||
void Draw_FadeScreen (void);
|
||||
void Draw_StretchRaw (int x, int y, int w, int h, int cols, int rows, byte *data);
|
||||
|
||||
void R_BeginFrame( float camera_separation );
|
||||
void R_SwapBuffers( int );
|
||||
void R_SetPalette ( const unsigned char *palette);
|
||||
|
||||
int Draw_GetPalette (void);
|
||||
|
||||
void GL_ResampleTexture (unsigned *in, int inwidth, int inheight, unsigned *out, int outwidth, int outheight);
|
||||
|
||||
struct image_s *R_RegisterSkin (char *name);
|
||||
|
||||
void LoadPCX (char *filename, byte **pic, byte **palette, int *width, int *height);
|
||||
image_t *GL_LoadPic (char *name, byte *pic, int width, int height, imagetype_t type, int bits);
|
||||
image_t *GL_FindImage (char *name, imagetype_t type);
|
||||
void GL_TextureMode( char *string );
|
||||
void GL_ImageList_f (void);
|
||||
|
||||
void GL_SetTexturePalette( unsigned palette[256] );
|
||||
|
||||
void GL_InitImages (void);
|
||||
void GL_ShutdownImages (void);
|
||||
|
||||
void GL_FreeUnusedImages (void);
|
||||
|
||||
void GL_TextureAlphaMode( char *string );
|
||||
void GL_TextureSolidMode( char *string );
|
||||
|
||||
/*
|
||||
** GL extension emulation functions
|
||||
*/
|
||||
void GL_DrawParticles( int n, const particle_t particles[], const unsigned colortable[768] );
|
||||
|
||||
/*
|
||||
** GL config stuff
|
||||
*/
|
||||
#define GL_RENDERER_VOODOO 0x00000001
|
||||
#define GL_RENDERER_VOODOO2 0x00000002
|
||||
#define GL_RENDERER_VOODOO_RUSH 0x00000004
|
||||
#define GL_RENDERER_BANSHEE 0x00000008
|
||||
#define GL_RENDERER_3DFX 0x0000000F
|
||||
|
||||
#define GL_RENDERER_PCX1 0x00000010
|
||||
#define GL_RENDERER_PCX2 0x00000020
|
||||
#define GL_RENDERER_PMX 0x00000040
|
||||
#define GL_RENDERER_POWERVR 0x00000070
|
||||
|
||||
#define GL_RENDERER_PERMEDIA2 0x00000100
|
||||
#define GL_RENDERER_GLINT_MX 0x00000200
|
||||
#define GL_RENDERER_GLINT_TX 0x00000400
|
||||
#define GL_RENDERER_3DLABS_MISC 0x00000800
|
||||
#define GL_RENDERER_3DLABS 0x00000F00
|
||||
|
||||
#define GL_RENDERER_REALIZM 0x00001000
|
||||
#define GL_RENDERER_REALIZM2 0x00002000
|
||||
#define GL_RENDERER_INTERGRAPH 0x00003000
|
||||
|
||||
#define GL_RENDERER_3DPRO 0x00004000
|
||||
#define GL_RENDERER_REAL3D 0x00008000
|
||||
#define GL_RENDERER_RIVA128 0x00010000
|
||||
#define GL_RENDERER_DYPIC 0x00020000
|
||||
|
||||
#define GL_RENDERER_V1000 0x00040000
|
||||
#define GL_RENDERER_V2100 0x00080000
|
||||
#define GL_RENDERER_V2200 0x00100000
|
||||
#define GL_RENDERER_RENDITION 0x001C0000
|
||||
|
||||
#define GL_RENDERER_O2 0x00100000
|
||||
#define GL_RENDERER_IMPACT 0x00200000
|
||||
#define GL_RENDERER_RE 0x00400000
|
||||
#define GL_RENDERER_IR 0x00800000
|
||||
#define GL_RENDERER_SGI 0x00F00000
|
||||
|
||||
#define GL_RENDERER_MCD 0x01000000
|
||||
#define GL_RENDERER_OTHER 0x80000000
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int renderer;
|
||||
const char *renderer_string;
|
||||
const char *vendor_string;
|
||||
const char *version_string;
|
||||
const char *extensions_string;
|
||||
|
||||
qboolean allow_cds;
|
||||
} glconfig_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float inverse_intensity;
|
||||
qboolean fullscreen;
|
||||
|
||||
int prev_mode;
|
||||
|
||||
unsigned char *d_16to8table;
|
||||
|
||||
int lightmap_textures;
|
||||
|
||||
int currenttextures[2];
|
||||
int currenttmu;
|
||||
|
||||
float camera_separation;
|
||||
qboolean stereo_enabled;
|
||||
|
||||
qboolean hwgamma;
|
||||
|
||||
unsigned char originalRedGammaTable[256];
|
||||
unsigned char originalGreenGammaTable[256];
|
||||
unsigned char originalBlueGammaTable[256];
|
||||
} glstate_t;
|
||||
|
||||
extern glconfig_t gl_config;
|
||||
extern glstate_t gl_state;
|
||||
|
||||
/*
|
||||
====================================================================
|
||||
|
||||
IMPORTED FUNCTIONS
|
||||
|
||||
====================================================================
|
||||
*/
|
||||
|
||||
extern refimport_t ri;
|
||||
|
||||
|
||||
/*
|
||||
====================================================================
|
||||
|
||||
IMPLEMENTATION SPECIFIC FUNCTIONS
|
||||
|
||||
====================================================================
|
||||
*/
|
||||
|
||||
void GLimp_BeginFrame( float camera_separation );
|
||||
void GLimp_EndFrame( void );
|
||||
int GLimp_Init( void *hinstance, void *hWnd );
|
||||
void GLimp_Shutdown( void );
|
||||
int GLimp_SetMode( int *pwidth, int *pheight, int mode, qboolean fullscreen );
|
||||
void GLimp_AppActivate( qboolean active );
|
||||
void GLimp_EnableLogging( qboolean enable );
|
||||
void GLimp_LogNewFrame( void );
|
||||
|
||||
#endif
|
880
src/refresh/opengl/gl_mesh.c
Normal file
880
src/refresh/opengl/gl_mesh.c
Normal file
|
@ -0,0 +1,880 @@
|
|||
/* $Id: gl_mesh.c,v 1.3 2002/09/25 13:22:55 bburns Exp $
|
||||
*
|
||||
* triangle model functions
|
||||
*
|
||||
* Copyright (C) 1997-2001 Id Software, Inc.
|
||||
* Copyright (c) 2002 The Quakeforge Project.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "gl_local.h"
|
||||
|
||||
/*
|
||||
=============================================================
|
||||
|
||||
ALIAS MODELS
|
||||
|
||||
=============================================================
|
||||
*/
|
||||
|
||||
#define NUMVERTEXNORMALS 162
|
||||
|
||||
float r_avertexnormals[NUMVERTEXNORMALS][3] = {
|
||||
#include "anorms.h"
|
||||
};
|
||||
|
||||
typedef float vec4_t[4];
|
||||
|
||||
static vec4_t s_lerped[MAX_VERTS];
|
||||
//static vec3_t lerped[MAX_VERTS];
|
||||
|
||||
vec3_t shadevector;
|
||||
float shadelight[3];
|
||||
|
||||
// precalculated dot products for quantized angles
|
||||
#define SHADEDOT_QUANT 16
|
||||
float r_avertexnormal_dots[SHADEDOT_QUANT][256] =
|
||||
#include "anormtab.h"
|
||||
;
|
||||
|
||||
float *shadedots = r_avertexnormal_dots[0];
|
||||
|
||||
void GL_LerpVerts( int nverts, dtrivertx_t *v, dtrivertx_t *ov, dtrivertx_t *verts, float *lerp, float move[3], float frontv[3], float backv[3] )
|
||||
{
|
||||
int i;
|
||||
|
||||
//PMM -- added RF_SHELL_DOUBLE, RF_SHELL_HALF_DAM
|
||||
if ( currententity->flags & ( RF_SHELL_RED | RF_SHELL_GREEN | RF_SHELL_BLUE | RF_SHELL_DOUBLE | RF_SHELL_HALF_DAM) )
|
||||
{
|
||||
for (i=0 ; i < nverts; i++, v++, ov++, lerp+=4 )
|
||||
{
|
||||
float *normal = r_avertexnormals[verts[i].lightnormalindex];
|
||||
|
||||
lerp[0] = move[0] + ov->v[0]*backv[0] + v->v[0]*frontv[0] + normal[0] * POWERSUIT_SCALE;
|
||||
lerp[1] = move[1] + ov->v[1]*backv[1] + v->v[1]*frontv[1] + normal[1] * POWERSUIT_SCALE;
|
||||
lerp[2] = move[2] + ov->v[2]*backv[2] + v->v[2]*frontv[2] + normal[2] * POWERSUIT_SCALE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i=0 ; i < nverts; i++, v++, ov++, lerp+=4)
|
||||
{
|
||||
lerp[0] = move[0] + ov->v[0]*backv[0] + v->v[0]*frontv[0];
|
||||
lerp[1] = move[1] + ov->v[1]*backv[1] + v->v[1]*frontv[1];
|
||||
lerp[2] = move[2] + ov->v[2]*backv[2] + v->v[2]*frontv[2];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
=============
|
||||
GL_DrawAliasFrameLerp
|
||||
|
||||
interpolates between two frames and origins
|
||||
FIXME: batch lerp all vertexes
|
||||
=============
|
||||
*/
|
||||
void GL_DrawAliasFrameLerp (dmdl_t *paliashdr, float backlerp)
|
||||
{
|
||||
float l;
|
||||
daliasframe_t *frame, *oldframe;
|
||||
dtrivertx_t *v, *ov, *verts;
|
||||
int *order;
|
||||
int count;
|
||||
float frontlerp;
|
||||
float alpha;
|
||||
vec3_t move, delta, vectors[3];
|
||||
vec3_t frontv, backv;
|
||||
int i;
|
||||
int index_xyz;
|
||||
float *lerp;
|
||||
|
||||
frame = (daliasframe_t *)((byte *)paliashdr + paliashdr->ofs_frames
|
||||
+ currententity->frame * paliashdr->framesize);
|
||||
verts = v = frame->verts;
|
||||
|
||||
oldframe = (daliasframe_t *)((byte *)paliashdr + paliashdr->ofs_frames
|
||||
+ currententity->oldframe * paliashdr->framesize);
|
||||
ov = oldframe->verts;
|
||||
|
||||
order = (int *)((byte *)paliashdr + paliashdr->ofs_glcmds);
|
||||
|
||||
// glTranslatef (frame->translate[0], frame->translate[1], frame->translate[2]);
|
||||
// glScalef (frame->scale[0], frame->scale[1], frame->scale[2]);
|
||||
|
||||
if (currententity->flags & RF_TRANSLUCENT)
|
||||
alpha = currententity->alpha;
|
||||
else
|
||||
alpha = 1.0;
|
||||
|
||||
// PMM - added double shell
|
||||
if ( currententity->flags & ( RF_SHELL_RED | RF_SHELL_GREEN | RF_SHELL_BLUE | RF_SHELL_DOUBLE | RF_SHELL_HALF_DAM) )
|
||||
qglDisable( GL_TEXTURE_2D );
|
||||
|
||||
frontlerp = 1.0 - backlerp;
|
||||
|
||||
// move should be the delta back to the previous frame * backlerp
|
||||
VectorSubtract (currententity->oldorigin, currententity->origin, delta);
|
||||
AngleVectors (currententity->angles, vectors[0], vectors[1], vectors[2]);
|
||||
|
||||
move[0] = DotProduct (delta, vectors[0]); // forward
|
||||
move[1] = -DotProduct (delta, vectors[1]); // left
|
||||
move[2] = DotProduct (delta, vectors[2]); // up
|
||||
|
||||
VectorAdd (move, oldframe->translate, move);
|
||||
|
||||
for (i=0 ; i<3 ; i++)
|
||||
{
|
||||
move[i] = backlerp*move[i] + frontlerp*frame->translate[i];
|
||||
}
|
||||
|
||||
for (i=0 ; i<3 ; i++)
|
||||
{
|
||||
frontv[i] = frontlerp*frame->scale[i];
|
||||
backv[i] = backlerp*oldframe->scale[i];
|
||||
}
|
||||
|
||||
lerp = s_lerped[0];
|
||||
|
||||
GL_LerpVerts( paliashdr->num_xyz, v, ov, verts, lerp, move, frontv, backv );
|
||||
|
||||
if ( gl_vertex_arrays->value )
|
||||
{
|
||||
float colorArray[MAX_VERTS*4];
|
||||
|
||||
qglEnableClientState( GL_VERTEX_ARRAY );
|
||||
qglVertexPointer( 3, GL_FLOAT, 16, s_lerped ); // padded for SIMD
|
||||
|
||||
// if ( currententity->flags & ( RF_SHELL_RED | RF_SHELL_GREEN | RF_SHELL_BLUE ) )
|
||||
// PMM - added double damage shell
|
||||
if ( currententity->flags & ( RF_SHELL_RED | RF_SHELL_GREEN | RF_SHELL_BLUE | RF_SHELL_DOUBLE | RF_SHELL_HALF_DAM) )
|
||||
{
|
||||
qglColor4f( shadelight[0], shadelight[1], shadelight[2], alpha );
|
||||
}
|
||||
else
|
||||
{
|
||||
qglEnableClientState( GL_COLOR_ARRAY );
|
||||
qglColorPointer( 3, GL_FLOAT, 0, colorArray );
|
||||
|
||||
//
|
||||
// pre light everything
|
||||
//
|
||||
for ( i = 0; i < paliashdr->num_xyz; i++ )
|
||||
{
|
||||
float l = shadedots[verts[i].lightnormalindex];
|
||||
|
||||
colorArray[i*3+0] = l * shadelight[0];
|
||||
colorArray[i*3+1] = l * shadelight[1];
|
||||
colorArray[i*3+2] = l * shadelight[2];
|
||||
}
|
||||
}
|
||||
|
||||
if ( qglLockArraysEXT != 0 )
|
||||
qglLockArraysEXT( 0, paliashdr->num_xyz );
|
||||
|
||||
while (1)
|
||||
{
|
||||
// get the vertex count and primitive type
|
||||
count = *order++;
|
||||
if (!count)
|
||||
break; // done
|
||||
if (count < 0)
|
||||
{
|
||||
count = -count;
|
||||
qglBegin (GL_TRIANGLE_FAN);
|
||||
}
|
||||
else
|
||||
{
|
||||
qglBegin (GL_TRIANGLE_STRIP);
|
||||
}
|
||||
|
||||
// PMM - added double damage shell
|
||||
if ( currententity->flags & ( RF_SHELL_RED | RF_SHELL_GREEN | RF_SHELL_BLUE | RF_SHELL_DOUBLE | RF_SHELL_HALF_DAM) )
|
||||
{
|
||||
do
|
||||
{
|
||||
index_xyz = order[2];
|
||||
order += 3;
|
||||
|
||||
qglVertex3fv( s_lerped[index_xyz] );
|
||||
|
||||
} while (--count);
|
||||
}
|
||||
else
|
||||
{
|
||||
do
|
||||
{
|
||||
// texture coordinates come from the draw list
|
||||
qglTexCoord2f (((float *)order)[0], ((float *)order)[1]);
|
||||
index_xyz = order[2];
|
||||
|
||||
order += 3;
|
||||
|
||||
// normals and vertexes come from the frame list
|
||||
// l = shadedots[verts[index_xyz].lightnormalindex];
|
||||
|
||||
// qglColor4f (l* shadelight[0], l*shadelight[1], l*shadelight[2], alpha);
|
||||
qglArrayElement( index_xyz );
|
||||
|
||||
} while (--count);
|
||||
}
|
||||
qglEnd ();
|
||||
}
|
||||
|
||||
if ( qglUnlockArraysEXT != 0 )
|
||||
qglUnlockArraysEXT();
|
||||
}
|
||||
else
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
// get the vertex count and primitive type
|
||||
count = *order++;
|
||||
if (!count)
|
||||
break; // done
|
||||
if (count < 0)
|
||||
{
|
||||
count = -count;
|
||||
qglBegin (GL_TRIANGLE_FAN);
|
||||
}
|
||||
else
|
||||
{
|
||||
qglBegin (GL_TRIANGLE_STRIP);
|
||||
}
|
||||
|
||||
if ( currententity->flags & ( RF_SHELL_RED | RF_SHELL_GREEN | RF_SHELL_BLUE ) )
|
||||
{
|
||||
do
|
||||
{
|
||||
index_xyz = order[2];
|
||||
order += 3;
|
||||
|
||||
qglColor4f( shadelight[0], shadelight[1], shadelight[2], alpha);
|
||||
qglVertex3fv (s_lerped[index_xyz]);
|
||||
|
||||
} while (--count);
|
||||
}
|
||||
else
|
||||
{
|
||||
do
|
||||
{
|
||||
// texture coordinates come from the draw list
|
||||
qglTexCoord2f (((float *)order)[0], ((float *)order)[1]);
|
||||
index_xyz = order[2];
|
||||
order += 3;
|
||||
|
||||
// normals and vertexes come from the frame list
|
||||
l = shadedots[verts[index_xyz].lightnormalindex];
|
||||
|
||||
qglColor4f (l* shadelight[0], l*shadelight[1], l*shadelight[2], alpha);
|
||||
qglVertex3fv (s_lerped[index_xyz]);
|
||||
} while (--count);
|
||||
}
|
||||
|
||||
qglEnd ();
|
||||
}
|
||||
}
|
||||
|
||||
// if ( currententity->flags & ( RF_SHELL_RED | RF_SHELL_GREEN | RF_SHELL_BLUE ) )
|
||||
// PMM - added double damage shell
|
||||
if ( currententity->flags & ( RF_SHELL_RED | RF_SHELL_GREEN | RF_SHELL_BLUE | RF_SHELL_DOUBLE | RF_SHELL_HALF_DAM) )
|
||||
qglEnable( GL_TEXTURE_2D );
|
||||
}
|
||||
|
||||
|
||||
#if 1
|
||||
/*
|
||||
=============
|
||||
GL_DrawAliasShadow
|
||||
=============
|
||||
*/
|
||||
extern vec3_t lightspot;
|
||||
/* stencilbuffer shadows */
|
||||
extern qboolean have_stencil;
|
||||
|
||||
void GL_DrawAliasShadow (dmdl_t *paliashdr, int posenum)
|
||||
{
|
||||
dtrivertx_t *verts;
|
||||
int *order;
|
||||
vec3_t point;
|
||||
float height, lheight;
|
||||
int count;
|
||||
daliasframe_t *frame;
|
||||
|
||||
lheight = currententity->origin[2] - lightspot[2];
|
||||
|
||||
frame = (daliasframe_t *)((byte *)paliashdr + paliashdr->ofs_frames
|
||||
+ currententity->frame * paliashdr->framesize);
|
||||
verts = frame->verts;
|
||||
|
||||
height = 0;
|
||||
|
||||
order = (int *)((byte *)paliashdr + paliashdr->ofs_glcmds);
|
||||
|
||||
height = -lheight + 0.1f;
|
||||
|
||||
/* stencilbuffer shadows */
|
||||
if (have_stencil && gl_stencilshadow->value) {
|
||||
qglEnable(GL_STENCIL_TEST);
|
||||
qglStencilFunc(GL_EQUAL, 1, 2);
|
||||
qglStencilOp(GL_KEEP, GL_KEEP, GL_INCR);
|
||||
}
|
||||
|
||||
while (1)
|
||||
{
|
||||
// get the vertex count and primitive type
|
||||
count = *order++;
|
||||
if (!count)
|
||||
break; // done
|
||||
if (count < 0)
|
||||
{
|
||||
count = -count;
|
||||
qglBegin (GL_TRIANGLE_FAN);
|
||||
}
|
||||
else
|
||||
qglBegin (GL_TRIANGLE_STRIP);
|
||||
|
||||
do
|
||||
{
|
||||
// normals and vertexes come from the frame list
|
||||
/*
|
||||
point[0] = verts[order[2]].v[0] * frame->scale[0] + frame->translate[0];
|
||||
point[1] = verts[order[2]].v[1] * frame->scale[1] + frame->translate[1];
|
||||
point[2] = verts[order[2]].v[2] * frame->scale[2] + frame->translate[2];
|
||||
*/
|
||||
|
||||
memcpy( point, s_lerped[order[2]], sizeof( point ) );
|
||||
|
||||
point[0] -= shadevector[0]*(point[2]+lheight);
|
||||
point[1] -= shadevector[1]*(point[2]+lheight);
|
||||
point[2] = height;
|
||||
// height -= 0.001;
|
||||
qglVertex3fv (point);
|
||||
|
||||
order += 3;
|
||||
|
||||
// verts++;
|
||||
|
||||
} while (--count);
|
||||
|
||||
qglEnd ();
|
||||
}
|
||||
|
||||
/* stencilbuffer shadows */
|
||||
if (have_stencil && gl_stencilshadow->value)
|
||||
qglDisable(GL_STENCIL_TEST);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
** R_CullAliasModel
|
||||
*/
|
||||
static qboolean R_CullAliasModel( vec3_t bbox[8], entity_t *e )
|
||||
{
|
||||
int i;
|
||||
vec3_t mins, maxs;
|
||||
dmdl_t *paliashdr;
|
||||
vec3_t vectors[3];
|
||||
vec3_t thismins, oldmins, thismaxs, oldmaxs;
|
||||
daliasframe_t *pframe, *poldframe;
|
||||
vec3_t angles;
|
||||
|
||||
paliashdr = (dmdl_t *)currentmodel->extradata;
|
||||
|
||||
if ( ( e->frame >= paliashdr->num_frames ) || ( e->frame < 0 ) )
|
||||
{
|
||||
ri.Con_Printf (PRINT_ALL, "R_CullAliasModel %s: no such frame %d\n",
|
||||
currentmodel->name, e->frame);
|
||||
e->frame = 0;
|
||||
}
|
||||
if ( ( e->oldframe >= paliashdr->num_frames ) || ( e->oldframe < 0 ) )
|
||||
{
|
||||
ri.Con_Printf (PRINT_ALL, "R_CullAliasModel %s: no such oldframe %d\n",
|
||||
currentmodel->name, e->oldframe);
|
||||
e->oldframe = 0;
|
||||
}
|
||||
|
||||
pframe = ( daliasframe_t * ) ( ( byte * ) paliashdr +
|
||||
paliashdr->ofs_frames +
|
||||
e->frame * paliashdr->framesize);
|
||||
|
||||
poldframe = ( daliasframe_t * ) ( ( byte * ) paliashdr +
|
||||
paliashdr->ofs_frames +
|
||||
e->oldframe * paliashdr->framesize);
|
||||
|
||||
/*
|
||||
** compute axially aligned mins and maxs
|
||||
*/
|
||||
if ( pframe == poldframe )
|
||||
{
|
||||
for ( i = 0; i < 3; i++ )
|
||||
{
|
||||
mins[i] = pframe->translate[i];
|
||||
maxs[i] = mins[i] + pframe->scale[i]*255;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( i = 0; i < 3; i++ )
|
||||
{
|
||||
thismins[i] = pframe->translate[i];
|
||||
thismaxs[i] = thismins[i] + pframe->scale[i]*255;
|
||||
|
||||
oldmins[i] = poldframe->translate[i];
|
||||
oldmaxs[i] = oldmins[i] + poldframe->scale[i]*255;
|
||||
|
||||
if ( thismins[i] < oldmins[i] )
|
||||
mins[i] = thismins[i];
|
||||
else
|
||||
mins[i] = oldmins[i];
|
||||
|
||||
if ( thismaxs[i] > oldmaxs[i] )
|
||||
maxs[i] = thismaxs[i];
|
||||
else
|
||||
maxs[i] = oldmaxs[i];
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** compute a full bounding box
|
||||
*/
|
||||
for ( i = 0; i < 8; i++ )
|
||||
{
|
||||
vec3_t tmp;
|
||||
|
||||
if ( i & 1 )
|
||||
tmp[0] = mins[0];
|
||||
else
|
||||
tmp[0] = maxs[0];
|
||||
|
||||
if ( i & 2 )
|
||||
tmp[1] = mins[1];
|
||||
else
|
||||
tmp[1] = maxs[1];
|
||||
|
||||
if ( i & 4 )
|
||||
tmp[2] = mins[2];
|
||||
else
|
||||
tmp[2] = maxs[2];
|
||||
|
||||
VectorCopy( tmp, bbox[i] );
|
||||
}
|
||||
|
||||
/*
|
||||
** rotate the bounding box
|
||||
*/
|
||||
VectorCopy( e->angles, angles );
|
||||
angles[YAW] = -angles[YAW];
|
||||
AngleVectors( angles, vectors[0], vectors[1], vectors[2] );
|
||||
|
||||
for ( i = 0; i < 8; i++ )
|
||||
{
|
||||
vec3_t tmp;
|
||||
|
||||
VectorCopy( bbox[i], tmp );
|
||||
|
||||
bbox[i][0] = DotProduct( vectors[0], tmp );
|
||||
bbox[i][1] = -DotProduct( vectors[1], tmp );
|
||||
bbox[i][2] = DotProduct( vectors[2], tmp );
|
||||
|
||||
VectorAdd( e->origin, bbox[i], bbox[i] );
|
||||
}
|
||||
|
||||
{
|
||||
int p, f, aggregatemask = ~0;
|
||||
|
||||
for ( p = 0; p < 8; p++ )
|
||||
{
|
||||
int mask = 0;
|
||||
|
||||
for ( f = 0; f < 4; f++ )
|
||||
{
|
||||
float dp = DotProduct( frustum[f].normal, bbox[p] );
|
||||
|
||||
if ( ( dp - frustum[f].dist ) < 0 )
|
||||
{
|
||||
mask |= ( 1 << f );
|
||||
}
|
||||
}
|
||||
|
||||
aggregatemask &= mask;
|
||||
}
|
||||
|
||||
if ( aggregatemask )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
R_DrawAliasModel
|
||||
|
||||
=================
|
||||
*/
|
||||
void R_DrawAliasModel (entity_t *e)
|
||||
{
|
||||
int i;
|
||||
dmdl_t *paliashdr;
|
||||
float an;
|
||||
vec3_t bbox[8];
|
||||
image_t *skin;
|
||||
|
||||
if ( !( e->flags & RF_WEAPONMODEL ) )
|
||||
{
|
||||
if ( R_CullAliasModel( bbox, e ) )
|
||||
return;
|
||||
}
|
||||
|
||||
if ( e->flags & RF_WEAPONMODEL )
|
||||
{
|
||||
if ( r_lefthand->value == 2 )
|
||||
return;
|
||||
}
|
||||
|
||||
paliashdr = (dmdl_t *)currentmodel->extradata;
|
||||
|
||||
//
|
||||
// get lighting information
|
||||
//
|
||||
// PMM - rewrote, reordered to handle new shells & mixing
|
||||
// PMM - 3.20 code .. replaced with original way of doing it to keep mod authors happy
|
||||
//
|
||||
if ( currententity->flags & ( RF_SHELL_HALF_DAM | RF_SHELL_GREEN | RF_SHELL_RED | RF_SHELL_BLUE | RF_SHELL_DOUBLE ) )
|
||||
{
|
||||
VectorClear (shadelight);
|
||||
if (currententity->flags & RF_SHELL_HALF_DAM)
|
||||
{
|
||||
shadelight[0] = 0.56;
|
||||
shadelight[1] = 0.59;
|
||||
shadelight[2] = 0.45;
|
||||
}
|
||||
if ( currententity->flags & RF_SHELL_DOUBLE )
|
||||
{
|
||||
shadelight[0] = 0.9;
|
||||
shadelight[1] = 0.7;
|
||||
}
|
||||
if ( currententity->flags & RF_SHELL_RED )
|
||||
shadelight[0] = 1.0;
|
||||
if ( currententity->flags & RF_SHELL_GREEN )
|
||||
shadelight[1] = 1.0;
|
||||
if ( currententity->flags & RF_SHELL_BLUE )
|
||||
shadelight[2] = 1.0;
|
||||
}
|
||||
/*
|
||||
// PMM -special case for godmode
|
||||
if ( (currententity->flags & RF_SHELL_RED) &&
|
||||
(currententity->flags & RF_SHELL_BLUE) &&
|
||||
(currententity->flags & RF_SHELL_GREEN) )
|
||||
{
|
||||
for (i=0 ; i<3 ; i++)
|
||||
shadelight[i] = 1.0;
|
||||
}
|
||||
else if ( currententity->flags & ( RF_SHELL_RED | RF_SHELL_BLUE | RF_SHELL_DOUBLE ) )
|
||||
{
|
||||
VectorClear (shadelight);
|
||||
|
||||
if ( currententity->flags & RF_SHELL_RED )
|
||||
{
|
||||
shadelight[0] = 1.0;
|
||||
if (currententity->flags & (RF_SHELL_BLUE|RF_SHELL_DOUBLE) )
|
||||
shadelight[2] = 1.0;
|
||||
}
|
||||
else if ( currententity->flags & RF_SHELL_BLUE )
|
||||
{
|
||||
if ( currententity->flags & RF_SHELL_DOUBLE )
|
||||
{
|
||||
shadelight[1] = 1.0;
|
||||
shadelight[2] = 1.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
shadelight[2] = 1.0;
|
||||
}
|
||||
}
|
||||
else if ( currententity->flags & RF_SHELL_DOUBLE )
|
||||
{
|
||||
shadelight[0] = 0.9;
|
||||
shadelight[1] = 0.7;
|
||||
}
|
||||
}
|
||||
else if ( currententity->flags & ( RF_SHELL_HALF_DAM | RF_SHELL_GREEN ) )
|
||||
{
|
||||
VectorClear (shadelight);
|
||||
// PMM - new colors
|
||||
if ( currententity->flags & RF_SHELL_HALF_DAM )
|
||||
{
|
||||
shadelight[0] = 0.56;
|
||||
shadelight[1] = 0.59;
|
||||
shadelight[2] = 0.45;
|
||||
}
|
||||
if ( currententity->flags & RF_SHELL_GREEN )
|
||||
{
|
||||
shadelight[1] = 1.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
//PMM - ok, now flatten these down to range from 0 to 1.0.
|
||||
// max_shell_val = max(shadelight[0], max(shadelight[1], shadelight[2]));
|
||||
// if (max_shell_val > 0)
|
||||
// {
|
||||
// for (i=0; i<3; i++)
|
||||
// {
|
||||
// shadelight[i] = shadelight[i] / max_shell_val;
|
||||
// }
|
||||
// }
|
||||
// pmm
|
||||
*/
|
||||
else if ( currententity->flags & RF_FULLBRIGHT )
|
||||
{
|
||||
for (i=0 ; i<3 ; i++)
|
||||
shadelight[i] = 1.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
R_LightPoint (currententity->origin, shadelight);
|
||||
|
||||
// player lighting hack for communication back to server
|
||||
// big hack!
|
||||
if ( currententity->flags & RF_WEAPONMODEL )
|
||||
{
|
||||
// pick the greatest component, which should be the same
|
||||
// as the mono value returned by software
|
||||
if (shadelight[0] > shadelight[1])
|
||||
{
|
||||
if (shadelight[0] > shadelight[2])
|
||||
r_lightlevel->value = 150*shadelight[0];
|
||||
else
|
||||
r_lightlevel->value = 150*shadelight[2];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (shadelight[1] > shadelight[2])
|
||||
r_lightlevel->value = 150*shadelight[1];
|
||||
else
|
||||
r_lightlevel->value = 150*shadelight[2];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ( gl_monolightmap->string[0] != '0' )
|
||||
{
|
||||
float s = shadelight[0];
|
||||
|
||||
if ( s < shadelight[1] )
|
||||
s = shadelight[1];
|
||||
if ( s < shadelight[2] )
|
||||
s = shadelight[2];
|
||||
|
||||
shadelight[0] = s;
|
||||
shadelight[1] = s;
|
||||
shadelight[2] = s;
|
||||
}
|
||||
}
|
||||
|
||||
if ( currententity->flags & RF_MINLIGHT )
|
||||
{
|
||||
for (i=0 ; i<3 ; i++)
|
||||
if (shadelight[i] > 0.1)
|
||||
break;
|
||||
if (i == 3)
|
||||
{
|
||||
shadelight[0] = 0.1;
|
||||
shadelight[1] = 0.1;
|
||||
shadelight[2] = 0.1;
|
||||
}
|
||||
}
|
||||
|
||||
if ( currententity->flags & RF_GLOW )
|
||||
{ // bonus items will pulse with time
|
||||
float scale;
|
||||
float min;
|
||||
|
||||
scale = 0.1 * sin(r_newrefdef.time*7);
|
||||
for (i=0 ; i<3 ; i++)
|
||||
{
|
||||
min = shadelight[i] * 0.8;
|
||||
shadelight[i] += scale;
|
||||
if (shadelight[i] < min)
|
||||
shadelight[i] = min;
|
||||
}
|
||||
}
|
||||
|
||||
// =================
|
||||
// PGM ir goggles color override
|
||||
if ( r_newrefdef.rdflags & RDF_IRGOGGLES && currententity->flags & RF_IR_VISIBLE)
|
||||
{
|
||||
shadelight[0] = 1.0;
|
||||
shadelight[1] = 0.0;
|
||||
shadelight[2] = 0.0;
|
||||
}
|
||||
// PGM
|
||||
// =================
|
||||
|
||||
shadedots = r_avertexnormal_dots[((int)(currententity->angles[1] * (SHADEDOT_QUANT / 360.0))) & (SHADEDOT_QUANT - 1)];
|
||||
|
||||
an = currententity->angles[1]/180*M_PI;
|
||||
shadevector[0] = cos(-an);
|
||||
shadevector[1] = sin(-an);
|
||||
shadevector[2] = 1;
|
||||
VectorNormalize (shadevector);
|
||||
|
||||
//
|
||||
// locate the proper data
|
||||
//
|
||||
|
||||
c_alias_polys += paliashdr->num_tris;
|
||||
|
||||
//
|
||||
// draw all the triangles
|
||||
//
|
||||
if (currententity->flags & RF_DEPTHHACK) // hack the depth range to prevent view model from poking into walls
|
||||
qglDepthRange (gldepthmin, gldepthmin + 0.3*(gldepthmax-gldepthmin));
|
||||
|
||||
if ( ( currententity->flags & RF_WEAPONMODEL ) && ( r_lefthand->value == 1.0F ) )
|
||||
{
|
||||
extern void MYgluPerspective( GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar );
|
||||
|
||||
qglMatrixMode( GL_PROJECTION );
|
||||
qglPushMatrix();
|
||||
qglLoadIdentity();
|
||||
qglScalef( -1, 1, 1 );
|
||||
MYgluPerspective( r_newrefdef.fov_y, ( float ) r_newrefdef.width / r_newrefdef.height, 4, 4096);
|
||||
qglMatrixMode( GL_MODELVIEW );
|
||||
|
||||
qglCullFace( GL_BACK );
|
||||
}
|
||||
|
||||
qglPushMatrix ();
|
||||
e->angles[PITCH] = -e->angles[PITCH]; // sigh.
|
||||
R_RotateForEntity (e);
|
||||
e->angles[PITCH] = -e->angles[PITCH]; // sigh.
|
||||
|
||||
// select skin
|
||||
if (currententity->skin)
|
||||
skin = currententity->skin; // custom player skin
|
||||
else
|
||||
{
|
||||
if (currententity->skinnum >= MAX_MD2SKINS)
|
||||
skin = currentmodel->skins[0];
|
||||
else
|
||||
{
|
||||
skin = currentmodel->skins[currententity->skinnum];
|
||||
if (!skin)
|
||||
skin = currentmodel->skins[0];
|
||||
}
|
||||
}
|
||||
if (!skin)
|
||||
skin = r_notexture; // fallback...
|
||||
GL_Bind(skin->texnum);
|
||||
|
||||
// draw it
|
||||
|
||||
qglShadeModel (GL_SMOOTH);
|
||||
|
||||
GL_TexEnv( GL_MODULATE );
|
||||
if ( currententity->flags & RF_TRANSLUCENT )
|
||||
{
|
||||
qglEnable (GL_BLEND);
|
||||
}
|
||||
|
||||
|
||||
if ( (currententity->frame >= paliashdr->num_frames)
|
||||
|| (currententity->frame < 0) )
|
||||
{
|
||||
ri.Con_Printf (PRINT_ALL, "R_DrawAliasModel %s: no such frame %d\n",
|
||||
currentmodel->name, currententity->frame);
|
||||
currententity->frame = 0;
|
||||
currententity->oldframe = 0;
|
||||
}
|
||||
|
||||
if ( (currententity->oldframe >= paliashdr->num_frames)
|
||||
|| (currententity->oldframe < 0))
|
||||
{
|
||||
ri.Con_Printf (PRINT_ALL, "R_DrawAliasModel %s: no such oldframe %d\n",
|
||||
currentmodel->name, currententity->oldframe);
|
||||
currententity->frame = 0;
|
||||
currententity->oldframe = 0;
|
||||
}
|
||||
|
||||
if ( !r_lerpmodels->value )
|
||||
currententity->backlerp = 0;
|
||||
GL_DrawAliasFrameLerp (paliashdr, currententity->backlerp);
|
||||
|
||||
GL_TexEnv( GL_REPLACE );
|
||||
qglShadeModel (GL_FLAT);
|
||||
|
||||
qglPopMatrix ();
|
||||
|
||||
#if 0
|
||||
qglDisable( GL_CULL_FACE );
|
||||
qglPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
|
||||
qglDisable( GL_TEXTURE_2D );
|
||||
qglBegin( GL_TRIANGLE_STRIP );
|
||||
for ( i = 0; i < 8; i++ )
|
||||
{
|
||||
qglVertex3fv( bbox[i] );
|
||||
}
|
||||
qglEnd();
|
||||
qglEnable( GL_TEXTURE_2D );
|
||||
qglPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
|
||||
qglEnable( GL_CULL_FACE );
|
||||
#endif
|
||||
|
||||
if ( ( currententity->flags & RF_WEAPONMODEL ) && ( r_lefthand->value == 1.0F ) )
|
||||
{
|
||||
qglMatrixMode( GL_PROJECTION );
|
||||
qglPopMatrix();
|
||||
qglMatrixMode( GL_MODELVIEW );
|
||||
qglCullFace( GL_FRONT );
|
||||
}
|
||||
|
||||
if ( currententity->flags & RF_TRANSLUCENT )
|
||||
{
|
||||
qglDisable (GL_BLEND);
|
||||
}
|
||||
|
||||
if (currententity->flags & RF_DEPTHHACK)
|
||||
qglDepthRange (gldepthmin, gldepthmax);
|
||||
|
||||
//#if 1
|
||||
if (gl_shadows->value &&
|
||||
!(currententity->flags & (RF_TRANSLUCENT|RF_WEAPONMODEL|RF_NOSHADOW))) {
|
||||
qglPushMatrix ();
|
||||
|
||||
/* don't rotate shadows on ungodly axes */
|
||||
qglTranslatef(e->origin[0], e->origin[1], e->origin[2]);
|
||||
qglRotatef(e->angles[1], 0, 0, 1);
|
||||
|
||||
qglDisable (GL_TEXTURE_2D);
|
||||
qglEnable (GL_BLEND);
|
||||
qglColor4f (0,0,0,0.5);
|
||||
GL_DrawAliasShadow (paliashdr, currententity->frame );
|
||||
qglEnable (GL_TEXTURE_2D);
|
||||
qglDisable (GL_BLEND);
|
||||
qglPopMatrix ();
|
||||
}
|
||||
//#endif
|
||||
qglColor4f (1,1,1,1);
|
||||
}
|
||||
|
||||
|
1223
src/refresh/opengl/gl_model.c
Normal file
1223
src/refresh/opengl/gl_model.c
Normal file
File diff suppressed because it is too large
Load diff
261
src/refresh/opengl/gl_model.h
Normal file
261
src/refresh/opengl/gl_model.h
Normal file
|
@ -0,0 +1,261 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 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.
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
d*_t structures are on-disk representations
|
||||
m*_t structures are in-memory
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
BRUSH MODELS
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
|
||||
//
|
||||
// in memory representation
|
||||
//
|
||||
// !!! if this is changed, it must be changed in asm_draw.h too !!!
|
||||
typedef struct
|
||||
{
|
||||
vec3_t position;
|
||||
} mvertex_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
vec3_t mins, maxs;
|
||||
vec3_t origin; // for sounds or lights
|
||||
float radius;
|
||||
int headnode;
|
||||
int visleafs; // not including the solid leaf 0
|
||||
int firstface, numfaces;
|
||||
} mmodel_t;
|
||||
|
||||
|
||||
#define SIDE_FRONT 0
|
||||
#define SIDE_BACK 1
|
||||
#define SIDE_ON 2
|
||||
|
||||
|
||||
#define SURF_PLANEBACK 2
|
||||
#define SURF_DRAWSKY 4
|
||||
#define SURF_DRAWTURB 0x10
|
||||
#define SURF_DRAWBACKGROUND 0x40
|
||||
#define SURF_UNDERWATER 0x80
|
||||
|
||||
// !!! if this is changed, it must be changed in asm_draw.h too !!!
|
||||
typedef struct
|
||||
{
|
||||
unsigned short v[2];
|
||||
unsigned int cachededgeoffset;
|
||||
} medge_t;
|
||||
|
||||
typedef struct mtexinfo_s
|
||||
{
|
||||
float vecs[2][4];
|
||||
int flags;
|
||||
int numframes;
|
||||
struct mtexinfo_s *next; // animation chain
|
||||
image_t *image;
|
||||
} mtexinfo_t;
|
||||
|
||||
#define VERTEXSIZE 7
|
||||
|
||||
typedef struct glpoly_s
|
||||
{
|
||||
struct glpoly_s *next;
|
||||
struct glpoly_s *chain;
|
||||
int numverts;
|
||||
int flags; // for SURF_UNDERWATER (not needed anymore?)
|
||||
float verts[4][VERTEXSIZE]; // variable sized (xyz s1t1 s2t2)
|
||||
} glpoly_t;
|
||||
|
||||
typedef struct msurface_s
|
||||
{
|
||||
int visframe; // should be drawn when node is crossed
|
||||
|
||||
cplane_t *plane;
|
||||
int flags;
|
||||
|
||||
int firstedge; // look up in model->surfedges[], negative numbers
|
||||
int numedges; // are backwards edges
|
||||
|
||||
short texturemins[2];
|
||||
short extents[2];
|
||||
|
||||
int light_s, light_t; // gl lightmap coordinates
|
||||
int dlight_s, dlight_t; // gl lightmap coordinates for dynamic lightmaps
|
||||
|
||||
glpoly_t *polys; // multiple if warped
|
||||
struct msurface_s *texturechain;
|
||||
struct msurface_s *lightmapchain;
|
||||
|
||||
mtexinfo_t *texinfo;
|
||||
|
||||
// lighting info
|
||||
int dlightframe;
|
||||
int dlightbits;
|
||||
|
||||
int lightmaptexturenum;
|
||||
byte styles[MAXLIGHTMAPS];
|
||||
float cached_light[MAXLIGHTMAPS]; // values currently used in lightmap
|
||||
byte *samples; // [numstyles*surfsize]
|
||||
} msurface_t;
|
||||
|
||||
typedef struct mnode_s
|
||||
{
|
||||
// common with leaf
|
||||
int contents; // -1, to differentiate from leafs
|
||||
int visframe; // node needs to be traversed if current
|
||||
|
||||
float minmaxs[6]; // for bounding box culling
|
||||
|
||||
struct mnode_s *parent;
|
||||
|
||||
// node specific
|
||||
cplane_t *plane;
|
||||
struct mnode_s *children[2];
|
||||
|
||||
unsigned short firstsurface;
|
||||
unsigned short numsurfaces;
|
||||
} mnode_t;
|
||||
|
||||
|
||||
|
||||
typedef struct mleaf_s
|
||||
{
|
||||
// common with node
|
||||
int contents; // wil be a negative contents number
|
||||
int visframe; // node needs to be traversed if current
|
||||
|
||||
float minmaxs[6]; // for bounding box culling
|
||||
|
||||
struct mnode_s *parent;
|
||||
|
||||
// leaf specific
|
||||
int cluster;
|
||||
int area;
|
||||
|
||||
msurface_t **firstmarksurface;
|
||||
int nummarksurfaces;
|
||||
} mleaf_t;
|
||||
|
||||
|
||||
//===================================================================
|
||||
|
||||
//
|
||||
// Whole model
|
||||
//
|
||||
|
||||
typedef enum {mod_bad, mod_brush, mod_sprite, mod_alias } modtype_t;
|
||||
|
||||
typedef struct model_s
|
||||
{
|
||||
char name[MAX_QPATH];
|
||||
|
||||
int registration_sequence;
|
||||
|
||||
modtype_t type;
|
||||
int numframes;
|
||||
|
||||
int flags;
|
||||
|
||||
//
|
||||
// volume occupied by the model graphics
|
||||
//
|
||||
vec3_t mins, maxs;
|
||||
float radius;
|
||||
|
||||
//
|
||||
// solid volume for clipping
|
||||
//
|
||||
qboolean clipbox;
|
||||
vec3_t clipmins, clipmaxs;
|
||||
|
||||
//
|
||||
// brush model
|
||||
//
|
||||
int firstmodelsurface, nummodelsurfaces;
|
||||
int lightmap; // only for submodels
|
||||
|
||||
int numsubmodels;
|
||||
mmodel_t *submodels;
|
||||
|
||||
int numplanes;
|
||||
cplane_t *planes;
|
||||
|
||||
int numleafs; // number of visible leafs, not counting 0
|
||||
mleaf_t *leafs;
|
||||
|
||||
int numvertexes;
|
||||
mvertex_t *vertexes;
|
||||
|
||||
int numedges;
|
||||
medge_t *edges;
|
||||
|
||||
int numnodes;
|
||||
int firstnode;
|
||||
mnode_t *nodes;
|
||||
|
||||
int numtexinfo;
|
||||
mtexinfo_t *texinfo;
|
||||
|
||||
int numsurfaces;
|
||||
msurface_t *surfaces;
|
||||
|
||||
int numsurfedges;
|
||||
int *surfedges;
|
||||
|
||||
int nummarksurfaces;
|
||||
msurface_t **marksurfaces;
|
||||
|
||||
dvis_t *vis;
|
||||
|
||||
byte *lightdata;
|
||||
|
||||
// for alias models and skins
|
||||
image_t *skins[MAX_MD2SKINS];
|
||||
|
||||
int extradatasize;
|
||||
void *extradata;
|
||||
} model_t;
|
||||
|
||||
//============================================================================
|
||||
|
||||
void Mod_Init (void);
|
||||
void Mod_ClearAll (void);
|
||||
model_t *Mod_ForName (char *name, qboolean crash);
|
||||
mleaf_t *Mod_PointInLeaf (float *p, model_t *model);
|
||||
byte *Mod_ClusterPVS (int cluster, model_t *model);
|
||||
|
||||
void Mod_Modellist_f (void);
|
||||
|
||||
void *Hunk_Begin (int maxsize);
|
||||
void *Hunk_Alloc (int size);
|
||||
int Hunk_End (void);
|
||||
void Hunk_Free (void *base);
|
||||
|
||||
void Mod_FreeAll (void);
|
||||
void Mod_Free (model_t *mod);
|
1770
src/refresh/opengl/gl_rmain.c
Normal file
1770
src/refresh/opengl/gl_rmain.c
Normal file
File diff suppressed because it is too large
Load diff
246
src/refresh/opengl/gl_rmisc.c
Normal file
246
src/refresh/opengl/gl_rmisc.c
Normal file
|
@ -0,0 +1,246 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 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.
|
||||
|
||||
*/
|
||||
// r_misc.c
|
||||
|
||||
#include "gl_local.h"
|
||||
|
||||
/*
|
||||
==================
|
||||
R_InitParticleTexture
|
||||
==================
|
||||
*/
|
||||
byte dottexture[8][8] =
|
||||
{
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,1,1,0,0,0,0},
|
||||
{0,1,1,1,1,0,0,0},
|
||||
{0,1,1,1,1,0,0,0},
|
||||
{0,0,1,1,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
};
|
||||
|
||||
void R_InitParticleTexture (void)
|
||||
{
|
||||
int x,y;
|
||||
byte data[8][8][4];
|
||||
|
||||
//
|
||||
// particle texture
|
||||
//
|
||||
for (x=0 ; x<8 ; x++)
|
||||
{
|
||||
for (y=0 ; y<8 ; y++)
|
||||
{
|
||||
data[y][x][0] = 255;
|
||||
data[y][x][1] = 255;
|
||||
data[y][x][2] = 255;
|
||||
data[y][x][3] = dottexture[x][y]*255;
|
||||
}
|
||||
}
|
||||
r_particletexture = GL_LoadPic ("***particle***", (byte *)data, 8, 8, it_sprite, 32);
|
||||
|
||||
//
|
||||
// also use this for bad textures, but without alpha
|
||||
//
|
||||
for (x=0 ; x<8 ; x++)
|
||||
{
|
||||
for (y=0 ; y<8 ; y++)
|
||||
{
|
||||
data[y][x][0] = dottexture[x&3][y&3]*255;
|
||||
data[y][x][1] = 0; // dottexture[x&3][y&3]*255;
|
||||
data[y][x][2] = 0; //dottexture[x&3][y&3]*255;
|
||||
data[y][x][3] = 255;
|
||||
}
|
||||
}
|
||||
r_notexture = GL_LoadPic ("***r_notexture***", (byte *)data, 8, 8, it_wall, 32);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
SCREEN SHOTS
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
typedef struct _TargaHeader {
|
||||
unsigned char id_length, colormap_type, image_type;
|
||||
unsigned short colormap_index, colormap_length;
|
||||
unsigned char colormap_size;
|
||||
unsigned short x_origin, y_origin, width, height;
|
||||
unsigned char pixel_size, attributes;
|
||||
} TargaHeader;
|
||||
|
||||
|
||||
/*
|
||||
==================
|
||||
GL_ScreenShot_f
|
||||
==================
|
||||
*/
|
||||
void GL_ScreenShot_f (void)
|
||||
{
|
||||
byte *buffer;
|
||||
char picname[80];
|
||||
char checkname[MAX_OSPATH];
|
||||
int i, c, temp;
|
||||
FILE *f;
|
||||
|
||||
// create the scrnshots directory if it doesn't exist
|
||||
Com_sprintf (checkname, sizeof(checkname), "%s/scrnshot", ri.FS_Gamedir());
|
||||
Sys_Mkdir (checkname);
|
||||
|
||||
//
|
||||
// find a file name to save it to
|
||||
//
|
||||
strcpy(picname,"quake00.tga");
|
||||
|
||||
for (i=0 ; i<=99 ; i++)
|
||||
{
|
||||
picname[5] = i/10 + '0';
|
||||
picname[6] = i%10 + '0';
|
||||
Com_sprintf (checkname, sizeof(checkname), "%s/scrnshot/%s", ri.FS_Gamedir(), picname);
|
||||
f = fopen (checkname, "rb");
|
||||
if (!f)
|
||||
break; // file doesn't exist
|
||||
fclose (f);
|
||||
}
|
||||
if (i==100)
|
||||
{
|
||||
ri.Con_Printf (PRINT_ALL, "SCR_ScreenShot_f: Couldn't create a file\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
buffer = malloc(vid.width*vid.height*3 + 18);
|
||||
memset (buffer, 0, 18);
|
||||
buffer[2] = 2; // uncompressed type
|
||||
buffer[12] = vid.width&255;
|
||||
buffer[13] = vid.width>>8;
|
||||
buffer[14] = vid.height&255;
|
||||
buffer[15] = vid.height>>8;
|
||||
buffer[16] = 24; // pixel size
|
||||
|
||||
qglReadPixels (0, 0, vid.width, vid.height, GL_RGB, GL_UNSIGNED_BYTE, buffer+18 );
|
||||
|
||||
// swap rgb to bgr
|
||||
c = 18+vid.width*vid.height*3;
|
||||
for (i=18 ; i<c ; i+=3)
|
||||
{
|
||||
temp = buffer[i];
|
||||
buffer[i] = buffer[i+2];
|
||||
buffer[i+2] = temp;
|
||||
}
|
||||
|
||||
f = fopen (checkname, "wb");
|
||||
fwrite (buffer, 1, c, f);
|
||||
fclose (f);
|
||||
|
||||
free (buffer);
|
||||
ri.Con_Printf (PRINT_ALL, "Wrote %s\n", picname);
|
||||
}
|
||||
|
||||
/*
|
||||
** GL_Strings_f
|
||||
*/
|
||||
void GL_Strings_f( void )
|
||||
{
|
||||
ri.Con_Printf (PRINT_ALL, "GL_VENDOR: %s\n", gl_config.vendor_string );
|
||||
ri.Con_Printf (PRINT_ALL, "GL_RENDERER: %s\n", gl_config.renderer_string );
|
||||
ri.Con_Printf (PRINT_ALL, "GL_VERSION: %s\n", gl_config.version_string );
|
||||
ri.Con_Printf (PRINT_ALL, "GL_EXTENSIONS: %s\n", gl_config.extensions_string );
|
||||
}
|
||||
|
||||
/*
|
||||
** GL_SetDefaultState
|
||||
*/
|
||||
void GL_SetDefaultState( void )
|
||||
{
|
||||
qglClearColor (1,0, 0.5 , 0.5);
|
||||
qglCullFace(GL_FRONT);
|
||||
qglEnable(GL_TEXTURE_2D);
|
||||
|
||||
qglEnable(GL_ALPHA_TEST);
|
||||
qglAlphaFunc(GL_GREATER, 0.666);
|
||||
|
||||
qglDisable (GL_DEPTH_TEST);
|
||||
qglDisable (GL_CULL_FACE);
|
||||
qglDisable (GL_BLEND);
|
||||
|
||||
qglColor4f (1,1,1,1);
|
||||
|
||||
qglPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
|
||||
qglShadeModel (GL_FLAT);
|
||||
|
||||
GL_TextureMode( gl_texturemode->string );
|
||||
GL_TextureAlphaMode( gl_texturealphamode->string );
|
||||
GL_TextureSolidMode( gl_texturesolidmode->string );
|
||||
|
||||
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl_filter_min);
|
||||
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max);
|
||||
|
||||
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||
|
||||
qglBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
GL_TexEnv( GL_REPLACE );
|
||||
|
||||
if ( qglPointParameterfEXT )
|
||||
{
|
||||
float attenuations[3];
|
||||
|
||||
attenuations[0] = gl_particle_att_a->value;
|
||||
attenuations[1] = gl_particle_att_b->value;
|
||||
attenuations[2] = gl_particle_att_c->value;
|
||||
|
||||
qglEnable( GL_POINT_SMOOTH );
|
||||
qglPointParameterfEXT( GL_POINT_SIZE_MIN_EXT, gl_particle_min_size->value );
|
||||
qglPointParameterfEXT( GL_POINT_SIZE_MAX_EXT, gl_particle_max_size->value );
|
||||
qglPointParameterfvEXT( GL_DISTANCE_ATTENUATION_EXT, attenuations );
|
||||
}
|
||||
|
||||
if ( qglColorTableEXT && gl_ext_palettedtexture->value )
|
||||
{
|
||||
qglEnable( GL_SHARED_TEXTURE_PALETTE_EXT );
|
||||
|
||||
GL_SetTexturePalette( d_8to24table );
|
||||
}
|
||||
|
||||
GL_UpdateSwapInterval();
|
||||
}
|
||||
|
||||
void GL_UpdateSwapInterval( void )
|
||||
{
|
||||
if ( gl_swapinterval->modified )
|
||||
{
|
||||
gl_swapinterval->modified = false;
|
||||
|
||||
if ( !gl_state.stereo_enabled )
|
||||
{
|
||||
#ifdef _WIN32
|
||||
if ( qwglSwapIntervalEXT )
|
||||
qwglSwapIntervalEXT( gl_swapinterval->value );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
1670
src/refresh/opengl/gl_rsurf.c
Normal file
1670
src/refresh/opengl/gl_rsurf.c
Normal file
File diff suppressed because it is too large
Load diff
662
src/refresh/opengl/gl_warp.c
Normal file
662
src/refresh/opengl/gl_warp.c
Normal file
|
@ -0,0 +1,662 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 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.
|
||||
|
||||
*/
|
||||
// gl_warp.c -- sky and water polygons
|
||||
|
||||
#include "gl_local.h"
|
||||
|
||||
extern model_t *loadmodel;
|
||||
|
||||
char skyname[MAX_QPATH];
|
||||
float skyrotate;
|
||||
vec3_t skyaxis;
|
||||
image_t *sky_images[6];
|
||||
|
||||
msurface_t *warpface;
|
||||
|
||||
#define SUBDIVIDE_SIZE 64
|
||||
//#define SUBDIVIDE_SIZE 1024
|
||||
|
||||
void BoundPoly (int numverts, float *verts, vec3_t mins, vec3_t maxs)
|
||||
{
|
||||
int i, j;
|
||||
float *v;
|
||||
|
||||
mins[0] = mins[1] = mins[2] = 9999;
|
||||
maxs[0] = maxs[1] = maxs[2] = -9999;
|
||||
v = verts;
|
||||
for (i=0 ; i<numverts ; i++)
|
||||
for (j=0 ; j<3 ; j++, v++)
|
||||
{
|
||||
if (*v < mins[j])
|
||||
mins[j] = *v;
|
||||
if (*v > maxs[j])
|
||||
maxs[j] = *v;
|
||||
}
|
||||
}
|
||||
|
||||
void SubdividePolygon (int numverts, float *verts)
|
||||
{
|
||||
int i, j, k;
|
||||
vec3_t mins, maxs;
|
||||
float m;
|
||||
float *v;
|
||||
vec3_t front[64], back[64];
|
||||
int f, b;
|
||||
float dist[64];
|
||||
float frac;
|
||||
glpoly_t *poly;
|
||||
float s, t;
|
||||
vec3_t total;
|
||||
float total_s, total_t;
|
||||
|
||||
if (numverts > 60)
|
||||
ri.Sys_Error (ERR_DROP, "numverts = %i", numverts);
|
||||
|
||||
BoundPoly (numverts, verts, mins, maxs);
|
||||
|
||||
for (i=0 ; i<3 ; i++)
|
||||
{
|
||||
m = (mins[i] + maxs[i]) * 0.5;
|
||||
m = SUBDIVIDE_SIZE * floor (m/SUBDIVIDE_SIZE + 0.5);
|
||||
if (maxs[i] - m < 8)
|
||||
continue;
|
||||
if (m - mins[i] < 8)
|
||||
continue;
|
||||
|
||||
// cut it
|
||||
v = verts + i;
|
||||
for (j=0 ; j<numverts ; j++, v+= 3)
|
||||
dist[j] = *v - m;
|
||||
|
||||
// wrap cases
|
||||
dist[j] = dist[0];
|
||||
v-=i;
|
||||
VectorCopy (verts, v);
|
||||
|
||||
f = b = 0;
|
||||
v = verts;
|
||||
for (j=0 ; j<numverts ; j++, v+= 3)
|
||||
{
|
||||
if (dist[j] >= 0)
|
||||
{
|
||||
VectorCopy (v, front[f]);
|
||||
f++;
|
||||
}
|
||||
if (dist[j] <= 0)
|
||||
{
|
||||
VectorCopy (v, back[b]);
|
||||
b++;
|
||||
}
|
||||
if (dist[j] == 0 || dist[j+1] == 0)
|
||||
continue;
|
||||
if ( (dist[j] > 0) != (dist[j+1] > 0) )
|
||||
{
|
||||
// clip point
|
||||
frac = dist[j] / (dist[j] - dist[j+1]);
|
||||
for (k=0 ; k<3 ; k++)
|
||||
front[f][k] = back[b][k] = v[k] + frac*(v[3+k] - v[k]);
|
||||
f++;
|
||||
b++;
|
||||
}
|
||||
}
|
||||
|
||||
SubdividePolygon (f, front[0]);
|
||||
SubdividePolygon (b, back[0]);
|
||||
return;
|
||||
}
|
||||
|
||||
// add a point in the center to help keep warp valid
|
||||
poly = Hunk_Alloc (sizeof(glpoly_t) + ((numverts-4)+2) * VERTEXSIZE*sizeof(float));
|
||||
poly->next = warpface->polys;
|
||||
warpface->polys = poly;
|
||||
poly->numverts = numverts+2;
|
||||
VectorClear (total);
|
||||
total_s = 0;
|
||||
total_t = 0;
|
||||
for (i=0 ; i<numverts ; i++, verts+= 3)
|
||||
{
|
||||
VectorCopy (verts, poly->verts[i+1]);
|
||||
s = DotProduct (verts, warpface->texinfo->vecs[0]);
|
||||
t = DotProduct (verts, warpface->texinfo->vecs[1]);
|
||||
|
||||
total_s += s;
|
||||
total_t += t;
|
||||
VectorAdd (total, verts, total);
|
||||
|
||||
poly->verts[i+1][3] = s;
|
||||
poly->verts[i+1][4] = t;
|
||||
}
|
||||
|
||||
VectorScale (total, (1.0/numverts), poly->verts[0]);
|
||||
poly->verts[0][3] = total_s/numverts;
|
||||
poly->verts[0][4] = total_t/numverts;
|
||||
|
||||
// copy first vertex to last
|
||||
memcpy (poly->verts[i+1], poly->verts[1], sizeof(poly->verts[0]));
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
GL_SubdivideSurface
|
||||
|
||||
Breaks a polygon up along axial 64 unit
|
||||
boundaries so that turbulent and sky warps
|
||||
can be done reasonably.
|
||||
================
|
||||
*/
|
||||
void GL_SubdivideSurface (msurface_t *fa)
|
||||
{
|
||||
vec3_t verts[64];
|
||||
int numverts;
|
||||
int i;
|
||||
int lindex;
|
||||
float *vec;
|
||||
|
||||
warpface = fa;
|
||||
|
||||
//
|
||||
// convert edges back to a normal polygon
|
||||
//
|
||||
numverts = 0;
|
||||
for (i=0 ; i<fa->numedges ; i++)
|
||||
{
|
||||
lindex = loadmodel->surfedges[fa->firstedge + i];
|
||||
|
||||
if (lindex > 0)
|
||||
vec = loadmodel->vertexes[loadmodel->edges[lindex].v[0]].position;
|
||||
else
|
||||
vec = loadmodel->vertexes[loadmodel->edges[-lindex].v[1]].position;
|
||||
VectorCopy (vec, verts[numverts]);
|
||||
numverts++;
|
||||
}
|
||||
|
||||
SubdividePolygon (numverts, verts[0]);
|
||||
}
|
||||
|
||||
//=========================================================
|
||||
|
||||
|
||||
|
||||
// speed up sin calculations - Ed
|
||||
float r_turbsin[] =
|
||||
{
|
||||
#include "warpsin.h"
|
||||
};
|
||||
#define TURBSCALE (256.0 / (2 * M_PI))
|
||||
|
||||
/*
|
||||
=============
|
||||
EmitWaterPolys
|
||||
|
||||
Does a water warp on the pre-fragmented glpoly_t chain
|
||||
=============
|
||||
*/
|
||||
void EmitWaterPolys (msurface_t *fa)
|
||||
{
|
||||
glpoly_t *p, *bp;
|
||||
float *v;
|
||||
int i;
|
||||
float s, t, os, ot;
|
||||
float scroll;
|
||||
float rdt = r_newrefdef.time;
|
||||
|
||||
if (fa->texinfo->flags & SURF_FLOWING)
|
||||
scroll = -64 * ( (r_newrefdef.time*0.5) - (int)(r_newrefdef.time*0.5) );
|
||||
else
|
||||
scroll = 0;
|
||||
for (bp=fa->polys ; bp ; bp=bp->next)
|
||||
{
|
||||
p = bp;
|
||||
|
||||
qglBegin (GL_TRIANGLE_FAN);
|
||||
for (i=0,v=p->verts[0] ; i<p->numverts ; i++, v+=VERTEXSIZE)
|
||||
{
|
||||
os = v[3];
|
||||
ot = v[4];
|
||||
|
||||
#if !id386
|
||||
s = os + r_turbsin[(int)((ot*0.125+r_newrefdef.time) * TURBSCALE) & 255];
|
||||
#else
|
||||
s = os + r_turbsin[Q_ftol( ((ot*0.125+rdt) * TURBSCALE) ) & 255];
|
||||
#endif
|
||||
s += scroll;
|
||||
s *= (1.0/64);
|
||||
|
||||
#if !id386
|
||||
t = ot + r_turbsin[(int)((os*0.125+rdt) * TURBSCALE) & 255];
|
||||
#else
|
||||
t = ot + r_turbsin[Q_ftol( ((os*0.125+rdt) * TURBSCALE) ) & 255];
|
||||
#endif
|
||||
t *= (1.0/64);
|
||||
|
||||
qglTexCoord2f (s, t);
|
||||
qglVertex3fv (v);
|
||||
}
|
||||
qglEnd ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//===================================================================
|
||||
|
||||
|
||||
vec3_t skyclip[6] = {
|
||||
{1,1,0},
|
||||
{1,-1,0},
|
||||
{0,-1,1},
|
||||
{0,1,1},
|
||||
{1,0,1},
|
||||
{-1,0,1}
|
||||
};
|
||||
int c_sky;
|
||||
|
||||
// 1 = s, 2 = t, 3 = 2048
|
||||
int st_to_vec[6][3] =
|
||||
{
|
||||
{3,-1,2},
|
||||
{-3,1,2},
|
||||
|
||||
{1,3,2},
|
||||
{-1,-3,2},
|
||||
|
||||
{-2,-1,3}, // 0 degrees yaw, look straight up
|
||||
{2,-1,-3} // look straight down
|
||||
|
||||
// {-1,2,3},
|
||||
// {1,2,-3}
|
||||
};
|
||||
|
||||
// s = [0]/[2], t = [1]/[2]
|
||||
int vec_to_st[6][3] =
|
||||
{
|
||||
{-2,3,1},
|
||||
{2,3,-1},
|
||||
|
||||
{1,3,2},
|
||||
{-1,3,-2},
|
||||
|
||||
{-2,-1,3},
|
||||
{-2,1,-3}
|
||||
|
||||
// {-1,2,3},
|
||||
// {1,2,-3}
|
||||
};
|
||||
|
||||
float skymins[2][6], skymaxs[2][6];
|
||||
float sky_min, sky_max;
|
||||
|
||||
void DrawSkyPolygon (int nump, vec3_t vecs)
|
||||
{
|
||||
int i,j;
|
||||
vec3_t v, av;
|
||||
float s, t, dv;
|
||||
int axis;
|
||||
float *vp;
|
||||
|
||||
c_sky++;
|
||||
#if 0
|
||||
glBegin (GL_POLYGON);
|
||||
for (i=0 ; i<nump ; i++, vecs+=3)
|
||||
{
|
||||
VectorAdd(vecs, r_origin, v);
|
||||
qglVertex3fv (v);
|
||||
}
|
||||
glEnd();
|
||||
return;
|
||||
#endif
|
||||
// decide which face it maps to
|
||||
VectorCopy (vec3_origin, v);
|
||||
for (i=0, vp=vecs ; i<nump ; i++, vp+=3)
|
||||
{
|
||||
VectorAdd (vp, v, v);
|
||||
}
|
||||
av[0] = fabs(v[0]);
|
||||
av[1] = fabs(v[1]);
|
||||
av[2] = fabs(v[2]);
|
||||
if (av[0] > av[1] && av[0] > av[2])
|
||||
{
|
||||
if (v[0] < 0)
|
||||
axis = 1;
|
||||
else
|
||||
axis = 0;
|
||||
}
|
||||
else if (av[1] > av[2] && av[1] > av[0])
|
||||
{
|
||||
if (v[1] < 0)
|
||||
axis = 3;
|
||||
else
|
||||
axis = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (v[2] < 0)
|
||||
axis = 5;
|
||||
else
|
||||
axis = 4;
|
||||
}
|
||||
|
||||
// project new texture coords
|
||||
for (i=0 ; i<nump ; i++, vecs+=3)
|
||||
{
|
||||
j = vec_to_st[axis][2];
|
||||
if (j > 0)
|
||||
dv = vecs[j - 1];
|
||||
else
|
||||
dv = -vecs[-j - 1];
|
||||
if (dv < 0.001)
|
||||
continue; // don't divide by zero
|
||||
j = vec_to_st[axis][0];
|
||||
if (j < 0)
|
||||
s = -vecs[-j -1] / dv;
|
||||
else
|
||||
s = vecs[j-1] / dv;
|
||||
j = vec_to_st[axis][1];
|
||||
if (j < 0)
|
||||
t = -vecs[-j -1] / dv;
|
||||
else
|
||||
t = vecs[j-1] / dv;
|
||||
|
||||
if (s < skymins[0][axis])
|
||||
skymins[0][axis] = s;
|
||||
if (t < skymins[1][axis])
|
||||
skymins[1][axis] = t;
|
||||
if (s > skymaxs[0][axis])
|
||||
skymaxs[0][axis] = s;
|
||||
if (t > skymaxs[1][axis])
|
||||
skymaxs[1][axis] = t;
|
||||
}
|
||||
}
|
||||
|
||||
#define ON_EPSILON 0.1 // point on plane side epsilon
|
||||
#define MAX_CLIP_VERTS 64
|
||||
void ClipSkyPolygon (int nump, vec3_t vecs, int stage)
|
||||
{
|
||||
float *norm;
|
||||
float *v;
|
||||
qboolean front, back;
|
||||
float d, e;
|
||||
float dists[MAX_CLIP_VERTS];
|
||||
int sides[MAX_CLIP_VERTS];
|
||||
vec3_t newv[2][MAX_CLIP_VERTS];
|
||||
int newc[2];
|
||||
int i, j;
|
||||
|
||||
if (nump > MAX_CLIP_VERTS-2)
|
||||
ri.Sys_Error (ERR_DROP, "ClipSkyPolygon: MAX_CLIP_VERTS");
|
||||
if (stage == 6)
|
||||
{ // fully clipped, so draw it
|
||||
DrawSkyPolygon (nump, vecs);
|
||||
return;
|
||||
}
|
||||
|
||||
front = back = false;
|
||||
norm = skyclip[stage];
|
||||
for (i=0, v = vecs ; i<nump ; i++, v+=3)
|
||||
{
|
||||
d = DotProduct (v, norm);
|
||||
if (d > ON_EPSILON)
|
||||
{
|
||||
front = true;
|
||||
sides[i] = SIDE_FRONT;
|
||||
}
|
||||
else if (d < -ON_EPSILON)
|
||||
{
|
||||
back = true;
|
||||
sides[i] = SIDE_BACK;
|
||||
}
|
||||
else
|
||||
sides[i] = SIDE_ON;
|
||||
dists[i] = d;
|
||||
}
|
||||
|
||||
if (!front || !back)
|
||||
{ // not clipped
|
||||
ClipSkyPolygon (nump, vecs, stage+1);
|
||||
return;
|
||||
}
|
||||
|
||||
// clip it
|
||||
sides[i] = sides[0];
|
||||
dists[i] = dists[0];
|
||||
VectorCopy (vecs, (vecs+(i*3)) );
|
||||
newc[0] = newc[1] = 0;
|
||||
|
||||
for (i=0, v = vecs ; i<nump ; i++, v+=3)
|
||||
{
|
||||
switch (sides[i])
|
||||
{
|
||||
case SIDE_FRONT:
|
||||
VectorCopy (v, newv[0][newc[0]]);
|
||||
newc[0]++;
|
||||
break;
|
||||
case SIDE_BACK:
|
||||
VectorCopy (v, newv[1][newc[1]]);
|
||||
newc[1]++;
|
||||
break;
|
||||
case SIDE_ON:
|
||||
VectorCopy (v, newv[0][newc[0]]);
|
||||
newc[0]++;
|
||||
VectorCopy (v, newv[1][newc[1]]);
|
||||
newc[1]++;
|
||||
break;
|
||||
}
|
||||
|
||||
if (sides[i] == SIDE_ON || sides[i+1] == SIDE_ON || sides[i+1] == sides[i])
|
||||
continue;
|
||||
|
||||
d = dists[i] / (dists[i] - dists[i+1]);
|
||||
for (j=0 ; j<3 ; j++)
|
||||
{
|
||||
e = v[j] + d*(v[j+3] - v[j]);
|
||||
newv[0][newc[0]][j] = e;
|
||||
newv[1][newc[1]][j] = e;
|
||||
}
|
||||
newc[0]++;
|
||||
newc[1]++;
|
||||
}
|
||||
|
||||
// continue
|
||||
ClipSkyPolygon (newc[0], newv[0][0], stage+1);
|
||||
ClipSkyPolygon (newc[1], newv[1][0], stage+1);
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
R_AddSkySurface
|
||||
=================
|
||||
*/
|
||||
void R_AddSkySurface (msurface_t *fa)
|
||||
{
|
||||
int i;
|
||||
vec3_t verts[MAX_CLIP_VERTS];
|
||||
glpoly_t *p;
|
||||
|
||||
// calculate vertex values for sky box
|
||||
for (p=fa->polys ; p ; p=p->next)
|
||||
{
|
||||
for (i=0 ; i<p->numverts ; i++)
|
||||
{
|
||||
VectorSubtract (p->verts[i], r_origin, verts[i]);
|
||||
}
|
||||
ClipSkyPolygon (p->numverts, verts[0], 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
==============
|
||||
R_ClearSkyBox
|
||||
==============
|
||||
*/
|
||||
void R_ClearSkyBox (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i=0 ; i<6 ; i++)
|
||||
{
|
||||
skymins[0][i] = skymins[1][i] = 9999;
|
||||
skymaxs[0][i] = skymaxs[1][i] = -9999;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MakeSkyVec (float s, float t, int axis)
|
||||
{
|
||||
vec3_t v, b;
|
||||
int j, k;
|
||||
|
||||
b[0] = s*2300;
|
||||
b[1] = t*2300;
|
||||
b[2] = 2300;
|
||||
|
||||
for (j=0 ; j<3 ; j++)
|
||||
{
|
||||
k = st_to_vec[axis][j];
|
||||
if (k < 0)
|
||||
v[j] = -b[-k - 1];
|
||||
else
|
||||
v[j] = b[k - 1];
|
||||
}
|
||||
|
||||
// avoid bilerp seam
|
||||
s = (s+1)*0.5;
|
||||
t = (t+1)*0.5;
|
||||
|
||||
if (s < sky_min)
|
||||
s = sky_min;
|
||||
else if (s > sky_max)
|
||||
s = sky_max;
|
||||
if (t < sky_min)
|
||||
t = sky_min;
|
||||
else if (t > sky_max)
|
||||
t = sky_max;
|
||||
|
||||
t = 1.0 - t;
|
||||
qglTexCoord2f (s, t);
|
||||
qglVertex3fv (v);
|
||||
}
|
||||
|
||||
/*
|
||||
==============
|
||||
R_DrawSkyBox
|
||||
==============
|
||||
*/
|
||||
int skytexorder[6] = {0,2,1,3,4,5};
|
||||
void R_DrawSkyBox (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
#if 0
|
||||
qglEnable (GL_BLEND);
|
||||
GL_TexEnv( GL_MODULATE );
|
||||
qglColor4f (1,1,1,0.5);
|
||||
qglDisable (GL_DEPTH_TEST);
|
||||
#endif
|
||||
if (skyrotate)
|
||||
{ // check for no sky at all
|
||||
for (i=0 ; i<6 ; i++)
|
||||
if (skymins[0][i] < skymaxs[0][i]
|
||||
&& skymins[1][i] < skymaxs[1][i])
|
||||
break;
|
||||
if (i == 6)
|
||||
return; // nothing visible
|
||||
}
|
||||
|
||||
qglPushMatrix ();
|
||||
qglTranslatef (r_origin[0], r_origin[1], r_origin[2]);
|
||||
qglRotatef (r_newrefdef.time * skyrotate, skyaxis[0], skyaxis[1], skyaxis[2]);
|
||||
|
||||
for (i=0 ; i<6 ; i++)
|
||||
{
|
||||
if (skyrotate)
|
||||
{ // hack, forces full sky to draw when rotating
|
||||
skymins[0][i] = -1;
|
||||
skymins[1][i] = -1;
|
||||
skymaxs[0][i] = 1;
|
||||
skymaxs[1][i] = 1;
|
||||
}
|
||||
|
||||
if (skymins[0][i] >= skymaxs[0][i]
|
||||
|| skymins[1][i] >= skymaxs[1][i])
|
||||
continue;
|
||||
|
||||
GL_Bind (sky_images[skytexorder[i]]->texnum);
|
||||
|
||||
qglBegin (GL_QUADS);
|
||||
MakeSkyVec (skymins[0][i], skymins[1][i], i);
|
||||
MakeSkyVec (skymins[0][i], skymaxs[1][i], i);
|
||||
MakeSkyVec (skymaxs[0][i], skymaxs[1][i], i);
|
||||
MakeSkyVec (skymaxs[0][i], skymins[1][i], i);
|
||||
qglEnd ();
|
||||
}
|
||||
qglPopMatrix ();
|
||||
#if 0
|
||||
glDisable (GL_BLEND);
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||
glColor4f (1,1,1,0.5);
|
||||
glEnable (GL_DEPTH_TEST);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
============
|
||||
R_SetSky
|
||||
============
|
||||
*/
|
||||
// 3dstudio environment map names
|
||||
char *suf[6] = {"rt", "bk", "lf", "ft", "up", "dn"};
|
||||
void R_SetSky (char *name, float rotate, vec3_t axis)
|
||||
{
|
||||
int i;
|
||||
char pathname[MAX_QPATH];
|
||||
|
||||
strncpy (skyname, name, sizeof(skyname)-1);
|
||||
skyrotate = rotate;
|
||||
VectorCopy (axis, skyaxis);
|
||||
|
||||
for (i=0 ; i<6 ; i++)
|
||||
{
|
||||
// chop down rotating skies for less memory
|
||||
if (gl_skymip->value || skyrotate)
|
||||
gl_picmip->value++;
|
||||
|
||||
if ( qglColorTableEXT && gl_ext_palettedtexture->value )
|
||||
Com_sprintf (pathname, sizeof(pathname), "env/%s%s.pcx", skyname, suf[i]);
|
||||
else
|
||||
Com_sprintf (pathname, sizeof(pathname), "env/%s%s.tga", skyname, suf[i]);
|
||||
|
||||
sky_images[i] = GL_FindImage (pathname, it_sky);
|
||||
if (!sky_images[i])
|
||||
sky_images[i] = r_notexture;
|
||||
|
||||
if (gl_skymip->value || skyrotate)
|
||||
{ // take less memory
|
||||
gl_picmip->value--;
|
||||
sky_min = 1.0/256;
|
||||
sky_max = 255.0/256;
|
||||
}
|
||||
else
|
||||
{
|
||||
sky_min = 1.0/512;
|
||||
sky_max = 511.0/512;
|
||||
}
|
||||
}
|
||||
}
|
468
src/refresh/opengl/header/qgl.h
Normal file
468
src/refresh/opengl/header/qgl.h
Normal file
|
@ -0,0 +1,468 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 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.
|
||||
|
||||
*/
|
||||
/*
|
||||
** QGL.H
|
||||
*/
|
||||
|
||||
#ifndef __QGL_H__
|
||||
#define __QGL_H__
|
||||
|
||||
#ifdef _WIN32
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <GL/gl.h>
|
||||
#ifndef SOLARIS
|
||||
//#include <GL/glext.h>
|
||||
#endif
|
||||
|
||||
qboolean QGL_Init( const char *dllname );
|
||||
void QGL_Shutdown( void );
|
||||
|
||||
#ifndef APIENTRY
|
||||
# define APIENTRY
|
||||
#endif
|
||||
|
||||
extern void ( APIENTRY * qglAccum )(GLenum op, GLfloat value);
|
||||
extern void ( APIENTRY * qglAlphaFunc )(GLenum func, GLclampf ref);
|
||||
extern GLboolean ( APIENTRY * qglAreTexturesResident )(GLsizei n, const GLuint *textures, GLboolean *residences);
|
||||
extern void ( APIENTRY * qglArrayElement )(GLint i);
|
||||
extern void ( APIENTRY * qglBegin )(GLenum mode);
|
||||
extern void ( APIENTRY * qglBindTexture )(GLenum target, GLuint texture);
|
||||
extern void ( APIENTRY * qglBitmap )(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap);
|
||||
extern void ( APIENTRY * qglBlendFunc )(GLenum sfactor, GLenum dfactor);
|
||||
extern void ( APIENTRY * qglCallList )(GLuint list);
|
||||
extern void ( APIENTRY * qglCallLists )(GLsizei n, GLenum type, const GLvoid *lists);
|
||||
extern void ( APIENTRY * qglClear )(GLbitfield mask);
|
||||
extern void ( APIENTRY * qglClearAccum )(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
|
||||
extern void ( APIENTRY * qglClearColor )(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
|
||||
extern void ( APIENTRY * qglClearDepth )(GLclampd depth);
|
||||
extern void ( APIENTRY * qglClearIndex )(GLfloat c);
|
||||
extern void ( APIENTRY * qglClearStencil )(GLint s);
|
||||
extern void ( APIENTRY * qglClipPlane )(GLenum plane, const GLdouble *equation);
|
||||
extern void ( APIENTRY * qglColor3b )(GLbyte red, GLbyte green, GLbyte blue);
|
||||
extern void ( APIENTRY * qglColor3bv )(const GLbyte *v);
|
||||
extern void ( APIENTRY * qglColor3d )(GLdouble red, GLdouble green, GLdouble blue);
|
||||
extern void ( APIENTRY * qglColor3dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglColor3f )(GLfloat red, GLfloat green, GLfloat blue);
|
||||
extern void ( APIENTRY * qglColor3fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglColor3i )(GLint red, GLint green, GLint blue);
|
||||
extern void ( APIENTRY * qglColor3iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglColor3s )(GLshort red, GLshort green, GLshort blue);
|
||||
extern void ( APIENTRY * qglColor3sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglColor3ub )(GLubyte red, GLubyte green, GLubyte blue);
|
||||
extern void ( APIENTRY * qglColor3ubv )(const GLubyte *v);
|
||||
extern void ( APIENTRY * qglColor3ui )(GLuint red, GLuint green, GLuint blue);
|
||||
extern void ( APIENTRY * qglColor3uiv )(const GLuint *v);
|
||||
extern void ( APIENTRY * qglColor3us )(GLushort red, GLushort green, GLushort blue);
|
||||
extern void ( APIENTRY * qglColor3usv )(const GLushort *v);
|
||||
extern void ( APIENTRY * qglColor4b )(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha);
|
||||
extern void ( APIENTRY * qglColor4bv )(const GLbyte *v);
|
||||
extern void ( APIENTRY * qglColor4d )(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha);
|
||||
extern void ( APIENTRY * qglColor4dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglColor4f )(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
|
||||
extern void ( APIENTRY * qglColor4fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglColor4i )(GLint red, GLint green, GLint blue, GLint alpha);
|
||||
extern void ( APIENTRY * qglColor4iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglColor4s )(GLshort red, GLshort green, GLshort blue, GLshort alpha);
|
||||
extern void ( APIENTRY * qglColor4sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglColor4ub )(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
|
||||
extern void ( APIENTRY * qglColor4ubv )(const GLubyte *v);
|
||||
extern void ( APIENTRY * qglColor4ui )(GLuint red, GLuint green, GLuint blue, GLuint alpha);
|
||||
extern void ( APIENTRY * qglColor4uiv )(const GLuint *v);
|
||||
extern void ( APIENTRY * qglColor4us )(GLushort red, GLushort green, GLushort blue, GLushort alpha);
|
||||
extern void ( APIENTRY * qglColor4usv )(const GLushort *v);
|
||||
extern void ( APIENTRY * qglColorMask )(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
|
||||
extern void ( APIENTRY * qglColorMaterial )(GLenum face, GLenum mode);
|
||||
extern void ( APIENTRY * qglColorPointer )(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
extern void ( APIENTRY * qglCopyPixels )(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type);
|
||||
extern void ( APIENTRY * qglCopyTexImage1D )(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border);
|
||||
extern void ( APIENTRY * qglCopyTexImage2D )(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
|
||||
extern void ( APIENTRY * qglCopyTexSubImage1D )(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
|
||||
extern void ( APIENTRY * qglCopyTexSubImage2D )(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
extern void ( APIENTRY * qglCullFace )(GLenum mode);
|
||||
extern void ( APIENTRY * qglDeleteLists )(GLuint list, GLsizei range);
|
||||
extern void ( APIENTRY * qglDeleteTextures )(GLsizei n, const GLuint *textures);
|
||||
extern void ( APIENTRY * qglDepthFunc )(GLenum func);
|
||||
extern void ( APIENTRY * qglDepthMask )(GLboolean flag);
|
||||
extern void ( APIENTRY * qglDepthRange )(GLclampd zNear, GLclampd zFar);
|
||||
extern void ( APIENTRY * qglDisable )(GLenum cap);
|
||||
extern void ( APIENTRY * qglDisableClientState )(GLenum array);
|
||||
extern void ( APIENTRY * qglDrawArrays )(GLenum mode, GLint first, GLsizei count);
|
||||
extern void ( APIENTRY * qglDrawBuffer )(GLenum mode);
|
||||
extern void ( APIENTRY * qglDrawElements )(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
|
||||
extern void ( APIENTRY * qglDrawPixels )(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
extern void ( APIENTRY * qglEdgeFlag )(GLboolean flag);
|
||||
extern void ( APIENTRY * qglEdgeFlagPointer )(GLsizei stride, const GLvoid *pointer);
|
||||
extern void ( APIENTRY * qglEdgeFlagv )(const GLboolean *flag);
|
||||
extern void ( APIENTRY * qglEnable )(GLenum cap);
|
||||
extern void ( APIENTRY * qglEnableClientState )(GLenum array);
|
||||
extern void ( APIENTRY * qglEnd )(void);
|
||||
extern void ( APIENTRY * qglEndList )(void);
|
||||
extern void ( APIENTRY * qglEvalCoord1d )(GLdouble u);
|
||||
extern void ( APIENTRY * qglEvalCoord1dv )(const GLdouble *u);
|
||||
extern void ( APIENTRY * qglEvalCoord1f )(GLfloat u);
|
||||
extern void ( APIENTRY * qglEvalCoord1fv )(const GLfloat *u);
|
||||
extern void ( APIENTRY * qglEvalCoord2d )(GLdouble u, GLdouble v);
|
||||
extern void ( APIENTRY * qglEvalCoord2dv )(const GLdouble *u);
|
||||
extern void ( APIENTRY * qglEvalCoord2f )(GLfloat u, GLfloat v);
|
||||
extern void ( APIENTRY * qglEvalCoord2fv )(const GLfloat *u);
|
||||
extern void ( APIENTRY * qglEvalMesh1 )(GLenum mode, GLint i1, GLint i2);
|
||||
extern void ( APIENTRY * qglEvalMesh2 )(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2);
|
||||
extern void ( APIENTRY * qglEvalPoint1 )(GLint i);
|
||||
extern void ( APIENTRY * qglEvalPoint2 )(GLint i, GLint j);
|
||||
extern void ( APIENTRY * qglFeedbackBuffer )(GLsizei size, GLenum type, GLfloat *buffer);
|
||||
extern void ( APIENTRY * qglFinish )(void);
|
||||
extern void ( APIENTRY * qglFlush )(void);
|
||||
extern void ( APIENTRY * qglFogf )(GLenum pname, GLfloat param);
|
||||
extern void ( APIENTRY * qglFogfv )(GLenum pname, const GLfloat *params);
|
||||
extern void ( APIENTRY * qglFogi )(GLenum pname, GLint param);
|
||||
extern void ( APIENTRY * qglFogiv )(GLenum pname, const GLint *params);
|
||||
extern void ( APIENTRY * qglFrontFace )(GLenum mode);
|
||||
extern void ( APIENTRY * qglFrustum )(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
|
||||
extern GLuint ( APIENTRY * qglGenLists )(GLsizei range);
|
||||
extern void ( APIENTRY * qglGenTextures )(GLsizei n, GLuint *textures);
|
||||
extern void ( APIENTRY * qglGetBooleanv )(GLenum pname, GLboolean *params);
|
||||
extern void ( APIENTRY * qglGetClipPlane )(GLenum plane, GLdouble *equation);
|
||||
extern void ( APIENTRY * qglGetDoublev )(GLenum pname, GLdouble *params);
|
||||
extern GLenum ( APIENTRY * qglGetError )(void);
|
||||
extern void ( APIENTRY * qglGetFloatv )(GLenum pname, GLfloat *params);
|
||||
extern void ( APIENTRY * qglGetIntegerv )(GLenum pname, GLint *params);
|
||||
extern void ( APIENTRY * qglGetLightfv )(GLenum light, GLenum pname, GLfloat *params);
|
||||
extern void ( APIENTRY * qglGetLightiv )(GLenum light, GLenum pname, GLint *params);
|
||||
extern void ( APIENTRY * qglGetMapdv )(GLenum target, GLenum query, GLdouble *v);
|
||||
extern void ( APIENTRY * qglGetMapfv )(GLenum target, GLenum query, GLfloat *v);
|
||||
extern void ( APIENTRY * qglGetMapiv )(GLenum target, GLenum query, GLint *v);
|
||||
extern void ( APIENTRY * qglGetMaterialfv )(GLenum face, GLenum pname, GLfloat *params);
|
||||
extern void ( APIENTRY * qglGetMaterialiv )(GLenum face, GLenum pname, GLint *params);
|
||||
extern void ( APIENTRY * qglGetPixelMapfv )(GLenum map, GLfloat *values);
|
||||
extern void ( APIENTRY * qglGetPixelMapuiv )(GLenum map, GLuint *values);
|
||||
extern void ( APIENTRY * qglGetPixelMapusv )(GLenum map, GLushort *values);
|
||||
extern void ( APIENTRY * qglGetPointerv )(GLenum pname, GLvoid* *params);
|
||||
extern void ( APIENTRY * qglGetPolygonStipple )(GLubyte *mask);
|
||||
extern const GLubyte * ( APIENTRY * qglGetString )(GLenum name);
|
||||
extern void ( APIENTRY * qglGetTexEnvfv )(GLenum target, GLenum pname, GLfloat *params);
|
||||
extern void ( APIENTRY * qglGetTexEnviv )(GLenum target, GLenum pname, GLint *params);
|
||||
extern void ( APIENTRY * qglGetTexGendv )(GLenum coord, GLenum pname, GLdouble *params);
|
||||
extern void ( APIENTRY * qglGetTexGenfv )(GLenum coord, GLenum pname, GLfloat *params);
|
||||
extern void ( APIENTRY * qglGetTexGeniv )(GLenum coord, GLenum pname, GLint *params);
|
||||
extern void ( APIENTRY * qglGetTexImage )(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
|
||||
extern void ( APIENTRY * qglGetTexLevelParameterfv )(GLenum target, GLint level, GLenum pname, GLfloat *params);
|
||||
extern void ( APIENTRY * qglGetTexLevelParameteriv )(GLenum target, GLint level, GLenum pname, GLint *params);
|
||||
extern void ( APIENTRY * qglGetTexParameterfv )(GLenum target, GLenum pname, GLfloat *params);
|
||||
extern void ( APIENTRY * qglGetTexParameteriv )(GLenum target, GLenum pname, GLint *params);
|
||||
extern void ( APIENTRY * qglHint )(GLenum target, GLenum mode);
|
||||
extern void ( APIENTRY * qglIndexMask )(GLuint mask);
|
||||
extern void ( APIENTRY * qglIndexPointer )(GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
extern void ( APIENTRY * qglIndexd )(GLdouble c);
|
||||
extern void ( APIENTRY * qglIndexdv )(const GLdouble *c);
|
||||
extern void ( APIENTRY * qglIndexf )(GLfloat c);
|
||||
extern void ( APIENTRY * qglIndexfv )(const GLfloat *c);
|
||||
extern void ( APIENTRY * qglIndexi )(GLint c);
|
||||
extern void ( APIENTRY * qglIndexiv )(const GLint *c);
|
||||
extern void ( APIENTRY * qglIndexs )(GLshort c);
|
||||
extern void ( APIENTRY * qglIndexsv )(const GLshort *c);
|
||||
extern void ( APIENTRY * qglIndexub )(GLubyte c);
|
||||
extern void ( APIENTRY * qglIndexubv )(const GLubyte *c);
|
||||
extern void ( APIENTRY * qglInitNames )(void);
|
||||
extern void ( APIENTRY * qglInterleavedArrays )(GLenum format, GLsizei stride, const GLvoid *pointer);
|
||||
extern GLboolean ( APIENTRY * qglIsEnabled )(GLenum cap);
|
||||
extern GLboolean ( APIENTRY * qglIsList )(GLuint list);
|
||||
extern GLboolean ( APIENTRY * qglIsTexture )(GLuint texture);
|
||||
extern void ( APIENTRY * qglLightModelf )(GLenum pname, GLfloat param);
|
||||
extern void ( APIENTRY * qglLightModelfv )(GLenum pname, const GLfloat *params);
|
||||
extern void ( APIENTRY * qglLightModeli )(GLenum pname, GLint param);
|
||||
extern void ( APIENTRY * qglLightModeliv )(GLenum pname, const GLint *params);
|
||||
extern void ( APIENTRY * qglLightf )(GLenum light, GLenum pname, GLfloat param);
|
||||
extern void ( APIENTRY * qglLightfv )(GLenum light, GLenum pname, const GLfloat *params);
|
||||
extern void ( APIENTRY * qglLighti )(GLenum light, GLenum pname, GLint param);
|
||||
extern void ( APIENTRY * qglLightiv )(GLenum light, GLenum pname, const GLint *params);
|
||||
extern void ( APIENTRY * qglLineStipple )(GLint factor, GLushort pattern);
|
||||
extern void ( APIENTRY * qglLineWidth )(GLfloat width);
|
||||
extern void ( APIENTRY * qglListBase )(GLuint base);
|
||||
extern void ( APIENTRY * qglLoadIdentity )(void);
|
||||
extern void ( APIENTRY * qglLoadMatrixd )(const GLdouble *m);
|
||||
extern void ( APIENTRY * qglLoadMatrixf )(const GLfloat *m);
|
||||
extern void ( APIENTRY * qglLoadName )(GLuint name);
|
||||
extern void ( APIENTRY * qglLogicOp )(GLenum opcode);
|
||||
extern void ( APIENTRY * qglMap1d )(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);
|
||||
extern void ( APIENTRY * qglMap1f )(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);
|
||||
extern void ( APIENTRY * qglMap2d )(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
|
||||
extern void ( APIENTRY * qglMap2f )(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
|
||||
extern void ( APIENTRY * qglMapGrid1d )(GLint un, GLdouble u1, GLdouble u2);
|
||||
extern void ( APIENTRY * qglMapGrid1f )(GLint un, GLfloat u1, GLfloat u2);
|
||||
extern void ( APIENTRY * qglMapGrid2d )(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2);
|
||||
extern void ( APIENTRY * qglMapGrid2f )(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2);
|
||||
extern void ( APIENTRY * qglMaterialf )(GLenum face, GLenum pname, GLfloat param);
|
||||
extern void ( APIENTRY * qglMaterialfv )(GLenum face, GLenum pname, const GLfloat *params);
|
||||
extern void ( APIENTRY * qglMateriali )(GLenum face, GLenum pname, GLint param);
|
||||
extern void ( APIENTRY * qglMaterialiv )(GLenum face, GLenum pname, const GLint *params);
|
||||
extern void ( APIENTRY * qglMatrixMode )(GLenum mode);
|
||||
extern void ( APIENTRY * qglMultMatrixd )(const GLdouble *m);
|
||||
extern void ( APIENTRY * qglMultMatrixf )(const GLfloat *m);
|
||||
extern void ( APIENTRY * qglNewList )(GLuint list, GLenum mode);
|
||||
extern void ( APIENTRY * qglNormal3b )(GLbyte nx, GLbyte ny, GLbyte nz);
|
||||
extern void ( APIENTRY * qglNormal3bv )(const GLbyte *v);
|
||||
extern void ( APIENTRY * qglNormal3d )(GLdouble nx, GLdouble ny, GLdouble nz);
|
||||
extern void ( APIENTRY * qglNormal3dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglNormal3f )(GLfloat nx, GLfloat ny, GLfloat nz);
|
||||
extern void ( APIENTRY * qglNormal3fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglNormal3i )(GLint nx, GLint ny, GLint nz);
|
||||
extern void ( APIENTRY * qglNormal3iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglNormal3s )(GLshort nx, GLshort ny, GLshort nz);
|
||||
extern void ( APIENTRY * qglNormal3sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglNormalPointer )(GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
extern void ( APIENTRY * qglOrtho )(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
|
||||
extern void ( APIENTRY * qglPassThrough )(GLfloat token);
|
||||
extern void ( APIENTRY * qglPixelMapfv )(GLenum map, GLsizei mapsize, const GLfloat *values);
|
||||
extern void ( APIENTRY * qglPixelMapuiv )(GLenum map, GLsizei mapsize, const GLuint *values);
|
||||
extern void ( APIENTRY * qglPixelMapusv )(GLenum map, GLsizei mapsize, const GLushort *values);
|
||||
extern void ( APIENTRY * qglPixelStoref )(GLenum pname, GLfloat param);
|
||||
extern void ( APIENTRY * qglPixelStorei )(GLenum pname, GLint param);
|
||||
extern void ( APIENTRY * qglPixelTransferf )(GLenum pname, GLfloat param);
|
||||
extern void ( APIENTRY * qglPixelTransferi )(GLenum pname, GLint param);
|
||||
extern void ( APIENTRY * qglPixelZoom )(GLfloat xfactor, GLfloat yfactor);
|
||||
extern void ( APIENTRY * qglPointSize )(GLfloat size);
|
||||
extern void ( APIENTRY * qglPolygonMode )(GLenum face, GLenum mode);
|
||||
extern void ( APIENTRY * qglPolygonOffset )(GLfloat factor, GLfloat units);
|
||||
extern void ( APIENTRY * qglPolygonStipple )(const GLubyte *mask);
|
||||
extern void ( APIENTRY * qglPopAttrib )(void);
|
||||
extern void ( APIENTRY * qglPopClientAttrib )(void);
|
||||
extern void ( APIENTRY * qglPopMatrix )(void);
|
||||
extern void ( APIENTRY * qglPopName )(void);
|
||||
extern void ( APIENTRY * qglPrioritizeTextures )(GLsizei n, const GLuint *textures, const GLclampf *priorities);
|
||||
extern void ( APIENTRY * qglPushAttrib )(GLbitfield mask);
|
||||
extern void ( APIENTRY * qglPushClientAttrib )(GLbitfield mask);
|
||||
extern void ( APIENTRY * qglPushMatrix )(void);
|
||||
extern void ( APIENTRY * qglPushName )(GLuint name);
|
||||
extern void ( APIENTRY * qglRasterPos2d )(GLdouble x, GLdouble y);
|
||||
extern void ( APIENTRY * qglRasterPos2dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglRasterPos2f )(GLfloat x, GLfloat y);
|
||||
extern void ( APIENTRY * qglRasterPos2fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglRasterPos2i )(GLint x, GLint y);
|
||||
extern void ( APIENTRY * qglRasterPos2iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglRasterPos2s )(GLshort x, GLshort y);
|
||||
extern void ( APIENTRY * qglRasterPos2sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglRasterPos3d )(GLdouble x, GLdouble y, GLdouble z);
|
||||
extern void ( APIENTRY * qglRasterPos3dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglRasterPos3f )(GLfloat x, GLfloat y, GLfloat z);
|
||||
extern void ( APIENTRY * qglRasterPos3fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglRasterPos3i )(GLint x, GLint y, GLint z);
|
||||
extern void ( APIENTRY * qglRasterPos3iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglRasterPos3s )(GLshort x, GLshort y, GLshort z);
|
||||
extern void ( APIENTRY * qglRasterPos3sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglRasterPos4d )(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
|
||||
extern void ( APIENTRY * qglRasterPos4dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglRasterPos4f )(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
extern void ( APIENTRY * qglRasterPos4fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglRasterPos4i )(GLint x, GLint y, GLint z, GLint w);
|
||||
extern void ( APIENTRY * qglRasterPos4iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglRasterPos4s )(GLshort x, GLshort y, GLshort z, GLshort w);
|
||||
extern void ( APIENTRY * qglRasterPos4sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglReadBuffer )(GLenum mode);
|
||||
extern void ( APIENTRY * qglReadPixels )(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
|
||||
extern void ( APIENTRY * qglRectd )(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2);
|
||||
extern void ( APIENTRY * qglRectdv )(const GLdouble *v1, const GLdouble *v2);
|
||||
extern void ( APIENTRY * qglRectf )(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
|
||||
extern void ( APIENTRY * qglRectfv )(const GLfloat *v1, const GLfloat *v2);
|
||||
extern void ( APIENTRY * qglRecti )(GLint x1, GLint y1, GLint x2, GLint y2);
|
||||
extern void ( APIENTRY * qglRectiv )(const GLint *v1, const GLint *v2);
|
||||
extern void ( APIENTRY * qglRects )(GLshort x1, GLshort y1, GLshort x2, GLshort y2);
|
||||
extern void ( APIENTRY * qglRectsv )(const GLshort *v1, const GLshort *v2);
|
||||
extern GLint ( APIENTRY * qglRenderMode )(GLenum mode);
|
||||
extern void ( APIENTRY * qglRotated )(GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
|
||||
extern void ( APIENTRY * qglRotatef )(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
|
||||
extern void ( APIENTRY * qglScaled )(GLdouble x, GLdouble y, GLdouble z);
|
||||
extern void ( APIENTRY * qglScalef )(GLfloat x, GLfloat y, GLfloat z);
|
||||
extern void ( APIENTRY * qglScissor )(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
extern void ( APIENTRY * qglSelectBuffer )(GLsizei size, GLuint *buffer);
|
||||
extern void ( APIENTRY * qglShadeModel )(GLenum mode);
|
||||
extern void ( APIENTRY * qglStencilFunc )(GLenum func, GLint ref, GLuint mask);
|
||||
extern void ( APIENTRY * qglStencilMask )(GLuint mask);
|
||||
extern void ( APIENTRY * qglStencilOp )(GLenum fail, GLenum zfail, GLenum zpass);
|
||||
extern void ( APIENTRY * qglTexCoord1d )(GLdouble s);
|
||||
extern void ( APIENTRY * qglTexCoord1dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglTexCoord1f )(GLfloat s);
|
||||
extern void ( APIENTRY * qglTexCoord1fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglTexCoord1i )(GLint s);
|
||||
extern void ( APIENTRY * qglTexCoord1iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglTexCoord1s )(GLshort s);
|
||||
extern void ( APIENTRY * qglTexCoord1sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglTexCoord2d )(GLdouble s, GLdouble t);
|
||||
extern void ( APIENTRY * qglTexCoord2dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglTexCoord2f )(GLfloat s, GLfloat t);
|
||||
extern void ( APIENTRY * qglTexCoord2fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglTexCoord2i )(GLint s, GLint t);
|
||||
extern void ( APIENTRY * qglTexCoord2iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglTexCoord2s )(GLshort s, GLshort t);
|
||||
extern void ( APIENTRY * qglTexCoord2sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglTexCoord3d )(GLdouble s, GLdouble t, GLdouble r);
|
||||
extern void ( APIENTRY * qglTexCoord3dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglTexCoord3f )(GLfloat s, GLfloat t, GLfloat r);
|
||||
extern void ( APIENTRY * qglTexCoord3fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglTexCoord3i )(GLint s, GLint t, GLint r);
|
||||
extern void ( APIENTRY * qglTexCoord3iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglTexCoord3s )(GLshort s, GLshort t, GLshort r);
|
||||
extern void ( APIENTRY * qglTexCoord3sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglTexCoord4d )(GLdouble s, GLdouble t, GLdouble r, GLdouble q);
|
||||
extern void ( APIENTRY * qglTexCoord4dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglTexCoord4f )(GLfloat s, GLfloat t, GLfloat r, GLfloat q);
|
||||
extern void ( APIENTRY * qglTexCoord4fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglTexCoord4i )(GLint s, GLint t, GLint r, GLint q);
|
||||
extern void ( APIENTRY * qglTexCoord4iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglTexCoord4s )(GLshort s, GLshort t, GLshort r, GLshort q);
|
||||
extern void ( APIENTRY * qglTexCoord4sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglTexCoordPointer )(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
extern void ( APIENTRY * qglTexEnvf )(GLenum target, GLenum pname, GLfloat param);
|
||||
extern void ( APIENTRY * qglTexEnvfv )(GLenum target, GLenum pname, const GLfloat *params);
|
||||
extern void ( APIENTRY * qglTexEnvi )(GLenum target, GLenum pname, GLint param);
|
||||
extern void ( APIENTRY * qglTexEnviv )(GLenum target, GLenum pname, const GLint *params);
|
||||
extern void ( APIENTRY * qglTexGend )(GLenum coord, GLenum pname, GLdouble param);
|
||||
extern void ( APIENTRY * qglTexGendv )(GLenum coord, GLenum pname, const GLdouble *params);
|
||||
extern void ( APIENTRY * qglTexGenf )(GLenum coord, GLenum pname, GLfloat param);
|
||||
extern void ( APIENTRY * qglTexGenfv )(GLenum coord, GLenum pname, const GLfloat *params);
|
||||
extern void ( APIENTRY * qglTexGeni )(GLenum coord, GLenum pname, GLint param);
|
||||
extern void ( APIENTRY * qglTexGeniv )(GLenum coord, GLenum pname, const GLint *params);
|
||||
extern void ( APIENTRY * qglTexImage1D )(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
extern void ( APIENTRY * qglTexImage2D )(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
extern void ( APIENTRY * qglTexParameterf )(GLenum target, GLenum pname, GLfloat param);
|
||||
extern void ( APIENTRY * qglTexParameterfv )(GLenum target, GLenum pname, const GLfloat *params);
|
||||
extern void ( APIENTRY * qglTexParameteri )(GLenum target, GLenum pname, GLint param);
|
||||
extern void ( APIENTRY * qglTexParameteriv )(GLenum target, GLenum pname, const GLint *params);
|
||||
extern void ( APIENTRY * qglTexSubImage1D )(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
extern void ( APIENTRY * qglTexSubImage2D )(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
extern void ( APIENTRY * qglTranslated )(GLdouble x, GLdouble y, GLdouble z);
|
||||
extern void ( APIENTRY * qglTranslatef )(GLfloat x, GLfloat y, GLfloat z);
|
||||
extern void ( APIENTRY * qglVertex2d )(GLdouble x, GLdouble y);
|
||||
extern void ( APIENTRY * qglVertex2dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglVertex2f )(GLfloat x, GLfloat y);
|
||||
extern void ( APIENTRY * qglVertex2fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglVertex2i )(GLint x, GLint y);
|
||||
extern void ( APIENTRY * qglVertex2iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglVertex2s )(GLshort x, GLshort y);
|
||||
extern void ( APIENTRY * qglVertex2sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglVertex3d )(GLdouble x, GLdouble y, GLdouble z);
|
||||
extern void ( APIENTRY * qglVertex3dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglVertex3f )(GLfloat x, GLfloat y, GLfloat z);
|
||||
extern void ( APIENTRY * qglVertex3fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglVertex3i )(GLint x, GLint y, GLint z);
|
||||
extern void ( APIENTRY * qglVertex3iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglVertex3s )(GLshort x, GLshort y, GLshort z);
|
||||
extern void ( APIENTRY * qglVertex3sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglVertex4d )(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
|
||||
extern void ( APIENTRY * qglVertex4dv )(const GLdouble *v);
|
||||
extern void ( APIENTRY * qglVertex4f )(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
extern void ( APIENTRY * qglVertex4fv )(const GLfloat *v);
|
||||
extern void ( APIENTRY * qglVertex4i )(GLint x, GLint y, GLint z, GLint w);
|
||||
extern void ( APIENTRY * qglVertex4iv )(const GLint *v);
|
||||
extern void ( APIENTRY * qglVertex4s )(GLshort x, GLshort y, GLshort z, GLshort w);
|
||||
extern void ( APIENTRY * qglVertex4sv )(const GLshort *v);
|
||||
extern void ( APIENTRY * qglVertexPointer )(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
extern void ( APIENTRY * qglViewport )(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
|
||||
extern void ( APIENTRY * qglPointParameterfEXT)( GLenum param, GLfloat value );
|
||||
extern void ( APIENTRY * qglPointParameterfvEXT)( GLenum param, const GLfloat *value );
|
||||
extern void ( APIENTRY * qglColorTableEXT)( GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid * );
|
||||
|
||||
extern void ( APIENTRY * qglLockArraysEXT) (int , int);
|
||||
extern void ( APIENTRY * qglUnlockArraysEXT) (void);
|
||||
|
||||
extern void ( APIENTRY * qglMTexCoord2fSGIS)( GLenum, GLfloat, GLfloat );
|
||||
extern void ( APIENTRY * qglSelectTextureSGIS)( GLenum );
|
||||
|
||||
extern void ( APIENTRY * qglActiveTextureARB)( GLenum );
|
||||
extern void ( APIENTRY * qglClientActiveTextureARB)( GLenum );
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
extern int ( WINAPI * qwglChoosePixelFormat )(HDC, CONST PIXELFORMATDESCRIPTOR *);
|
||||
extern int ( WINAPI * qwglDescribePixelFormat) (HDC, int, UINT, LPPIXELFORMATDESCRIPTOR);
|
||||
extern int ( WINAPI * qwglGetPixelFormat)(HDC);
|
||||
extern BOOL ( WINAPI * qwglSetPixelFormat)(HDC, int, CONST PIXELFORMATDESCRIPTOR *);
|
||||
extern BOOL ( WINAPI * qwglSwapBuffers)(HDC);
|
||||
|
||||
extern BOOL ( WINAPI * qwglCopyContext)(HGLRC, HGLRC, UINT);
|
||||
extern HGLRC ( WINAPI * qwglCreateContext)(HDC);
|
||||
extern HGLRC ( WINAPI * qwglCreateLayerContext)(HDC, int);
|
||||
extern BOOL ( WINAPI * qwglDeleteContext)(HGLRC);
|
||||
extern HGLRC ( WINAPI * qwglGetCurrentContext)(VOID);
|
||||
extern HDC ( WINAPI * qwglGetCurrentDC)(VOID);
|
||||
extern PROC ( WINAPI * qwglGetProcAddress)(LPCSTR);
|
||||
extern BOOL ( WINAPI * qwglMakeCurrent)(HDC, HGLRC);
|
||||
extern BOOL ( WINAPI * qwglShareLists)(HGLRC, HGLRC);
|
||||
extern BOOL ( WINAPI * qwglUseFontBitmaps)(HDC, DWORD, DWORD, DWORD);
|
||||
|
||||
extern BOOL ( WINAPI * qwglUseFontOutlines)(HDC, DWORD, DWORD, DWORD, FLOAT,
|
||||
FLOAT, int, LPGLYPHMETRICSFLOAT);
|
||||
|
||||
extern BOOL ( WINAPI * qwglDescribeLayerPlane)(HDC, int, int, UINT,
|
||||
LPLAYERPLANEDESCRIPTOR);
|
||||
extern int ( WINAPI * qwglSetLayerPaletteEntries)(HDC, int, int, int,
|
||||
CONST COLORREF *);
|
||||
extern int ( WINAPI * qwglGetLayerPaletteEntries)(HDC, int, int, int,
|
||||
COLORREF *);
|
||||
extern BOOL ( WINAPI * qwglRealizeLayerPalette)(HDC, int, BOOL);
|
||||
extern BOOL ( WINAPI * qwglSwapLayerBuffers)(HDC, UINT);
|
||||
|
||||
extern BOOL ( WINAPI * qwglSwapIntervalEXT)( int interval );
|
||||
|
||||
extern BOOL ( WINAPI * qwglGetDeviceGammaRampEXT ) ( unsigned char *pRed, unsigned char *pGreen, unsigned char *pBlue );
|
||||
extern BOOL ( WINAPI * qwglSetDeviceGammaRampEXT ) ( const unsigned char *pRed, const unsigned char *pGreen, const unsigned char *pBlue );
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __linux__
|
||||
|
||||
// local function in dll
|
||||
extern void *qwglGetProcAddress(char *symbol);
|
||||
|
||||
extern void (*qgl3DfxSetPaletteEXT)(GLuint *);
|
||||
|
||||
// 3dfxSetPaletteEXT shunt
|
||||
void Fake_glColorTableEXT( GLenum target, GLenum internalformat,
|
||||
GLsizei width, GLenum format, GLenum type,
|
||||
const GLvoid *table );
|
||||
|
||||
#endif // linux
|
||||
|
||||
/* deprecated */
|
||||
#define GL_TEXTURE0_SGIS 0x835E
|
||||
#define GL_TEXTURE1_SGIS 0x835F
|
||||
|
||||
extern int QGL_TEXTURE0, QGL_TEXTURE1; /* ARB/SGIS texture defs */
|
||||
|
||||
#ifdef SOLARIS /* these are in glext.h, on platforms that have it */
|
||||
/*
|
||||
** extension constants
|
||||
*/
|
||||
#define GL_POINT_SIZE_MIN_EXT 0x8126
|
||||
#define GL_POINT_SIZE_MAX_EXT 0x8127
|
||||
#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128
|
||||
#define GL_DISTANCE_ATTENUATION_EXT 0x8129
|
||||
#endif
|
||||
|
||||
#ifdef __sgi
|
||||
#define GL_SHARED_TEXTURE_PALETTE_EXT GL_TEXTURE_COLOR_TABLE_SGI
|
||||
#else
|
||||
#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in a new issue