Appling the diff to renderergl2 mostly worked.
Had to change GLimp_HaveExtension to use GL_EXTENTIONS
directly because Elite Forces GL2 requires an extension that didn't fit in (the smaller than Q3)
glConfig.extensions_string.
Had to set ambientLight for RF_FULLBRIGHT, GL2 doesn't use ambientLightInt.
Made the RF_FORCE_ENT_ALPHA code change pStage->stateBits because the stateBits
are read a lot, whereas in GL1 it's done as an expression and passed to GL_State.
Copied from Spearmint.
There are a few issues; holodeck doors are missing and parts of light grid are black (???).
Fix CalcFog in generic_vp.glsl to fog fogged surfaces.
Now it's the same as CalcFog in fogpass_vp.glsl.
Fixes shaders that use adjustColorsForFog. Impact wallmarks, blood sprites, flame textures and so on.
External GLSL should probably only be used for development testing,
not released products. The GLSL files are tied to the code, and the
code changes some what often.
Fixes using OpenArena 0.8.8 which has incompatible GLSL files in a pk3.
In the renderers, dlightbits are never cleared from world surfaces.
The dlight image does not repeat, so if it draws on extra surfaces it's
not visible.
However if using a repeating image (tr.defaultImage instead of tr.dlightImage);
* In OpenGL1 image is only drawn on surfaces close to dlight origin.
* In OpenGL2 image is draw on surfaces clearly outside the dlight radius, including past non-dlighted surfaces.
It seems there was a similar issue with pshadowBits. So update surface
dlightBits even if 0, like already done for pshadowBits. This causes
only surfaces close to origin to be affected. (Though it is a little
farther than in OpenGL1.)
I have no idea why this isn't a problem in OpenGL1.
Zero length lightmap lump will have NULL tr.lightmaps.
OpenGL1 already has this check, because r_vertexLight 1
would crash Team Arena. OpenGL2 does not disable loading lightmaps
when r_vertexLight is 1 though, so it does not have that issue.
If spawn var key or value is "" it caused R_GetEntityToken (available to
cgame, used by opengl2) to stop parsing, whereas game VM would continue.
Changed it to match parsing used for game VM
(see G_GET_ENTITY_TOKEN in code/server/sv_game.c).
The map poq3dm5 has a "wait" key with value "".
When R_GetEntityToken returns qfalse it resets pointer for parsing, by
R_ParseSpawnVars not returning qfalse it could cause an infinite loop.
Also add newlines to printfs.