From: Cloudwalk Date: Wed, 23 Dec 2020 18:36:11 +0000 (-0500) Subject: Merge branch 'master' into Mario/wrath-darkplaces_extra X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b3298e54fff3668ace36b990634c342d65f69ffd;p=xonotic%2Fdarkplaces.git Merge branch 'master' into Mario/wrath-darkplaces_extra --- b3298e54fff3668ace36b990634c342d65f69ffd diff --cc com_game.c index 84354d34,8216bafe..2f902aee --- a/com_game.c +++ b/com_game.c @@@ -87,7 -87,7 +87,8 @@@ static const gamemode_info_t gamemode_i { GAME_MOONHELM, GAME_MOONHELM, "moonhelm", "-moonhelm", "MoonHelm", "MoonHelm", "data", NULL, "mh", "moonhelm" }, // COMMANDLINEOPTION: Game: -moonhelm runs the game MoonHelm { GAME_VORETOURNAMENT, GAME_VORETOURNAMENT, "voretournament", "-voretournament", "Vore Tournament", "Vore_Tournament", "data", NULL, "voretournament", "voretournament" }, // COMMANDLINEOPTION: Game: -voretournament runs the multiplayer game Vore Tournament { GAME_DOOMBRINGER, GAME_DOOMBRINGER, "doombringer", "-doombringer", "DOOMBRINGER", "DOOMBRINGER", "dbdata", NULL, "doombringer", "doombringer" }, // COMMANDLINEOPTION: Game: -doombringer runs the game DOOMBRINGER +{ GAME_WRATH, GAME_WRATH, "wrath", "-wrath", "WRATH", "WRATH", "kp1", NULL, "wrath", "WRATH" }, // COMMANDLINEOPTION: Game: -wrath runs WRATH + { GAME_BATTLEMETAL, GAME_NORMAL, "battlemetal", "-battlemetal", "battlemetal", "battlemetal", "metaldata", NULL, "battlemetal", "battlemetal" }, // COMMANDLINEOPTION: Game: -battlemetal runs the game battleMETAL }; static void COM_SetGameType(int index); diff --cc common.h index 599defa0,834baeee..02587e89 --- a/common.h +++ b/common.h @@@ -298,7 -298,7 +298,8 @@@ typedef enum gamemode_ GAME_MOONHELM, GAME_VORETOURNAMENT, GAME_DOOMBRINGER, // added by Cloudwalk for kristus + GAME_WRATH, + GAME_BATTLEMETAL, // added by Cloudwalk for Subject9x GAME_COUNT } gamemode_t; diff --cc prvm_cmds.c index 6db3b6d7,c83598b6..81d52a3a --- a/prvm_cmds.c +++ b/prvm_cmds.c @@@ -6539,12 -6299,9 +6539,12 @@@ void VM_getsurfacenearpoint(prvm_prog_ applytransform_inverted(prog, point, ed, p); best = -1; bestdist = 1000000000; - for (surfacenum = 0;surfacenum < model->nummodelsurfaces;surfacenum++) + for (surfacenum = model->submodelsurfaces_start;surfacenum < model->submodelsurfaces_end;surfacenum++) { - surface = model->data_surfaces + surfacenum + model->firstmodelsurface; + surface = model->data_surfaces + surfacenum; + // [EXT_WRATH] skip surfaces that match the surfparm skip mask + if (skipmask && (!surface->texture || (surface->texture->surfaceflags & skipmask))) + continue; // first see if the nearest point on the surface's box is closer than the previous match clipped[0] = bound(surface->mins[0], p[0], surface->maxs[0]) - p[0]; clipped[1] = bound(surface->mins[1], p[1], surface->maxs[1]) - p[1]; diff --cc shader_glsl.h index ed74055a,5a4b224a..4c7ddd3a --- a/shader_glsl.h +++ b/shader_glsl.h @@@ -299,37 -298,9 +299,38 @@@ "}\n", "#endif\n", "\n", +"#ifdef USEPOSTPROCESSING\n", +"// https://github.com/mattdesl/glsl-lut\n", +"vec4 sampleLUT(sampler2D lookupTable, vec3 textureColor) {\n", +" mediump float blueColor = textureColor.b * 63.0;\n", +"\n", +" mediump vec2 quad1;\n", +" quad1.y = floor(floor(blueColor) / 8.0);\n", +" quad1.x = floor(blueColor) - (quad1.y * 8.0);\n", +"\n", +" mediump vec2 quad2;\n", +" quad2.y = floor(ceil(blueColor) / 8.0);\n", +" quad2.x = ceil(blueColor) - (quad2.y * 8.0);\n", +"\n", +" highp vec2 texPos1;\n", +" texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * textureColor.r);\n", +" texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * textureColor.g);\n", +"\n", +" highp vec2 texPos2;\n", +" texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * textureColor.r);\n", +" texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * textureColor.g);\n", +"\n", +" lowp vec4 newColor1 = texture2D(lookupTable, texPos1);\n", +" lowp vec4 newColor2 = texture2D(lookupTable, texPos2);\n", +"\n", +" lowp vec4 newColor = mix(newColor1, newColor2, fract(blueColor));\n", +" return newColor;\n", +"}\n", +"#endif\n", +"\n", "void main(void)\n", "{\n", + "#ifdef USECOLORFRINGE\n", " float fringe = ColorFringe;//.0033f;\n", " float amount = distance(TexCoord1, vec2(.5f,.5f));\n", " vec2 offset = vec2(amount*fringe,amount*fringe);\n",