]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Merge branch 'master' into Mario/wrath-darkplaces_extra
authorCloudwalk <cloudwalk009@gmail.com>
Wed, 23 Dec 2020 18:36:11 +0000 (13:36 -0500)
committerCloudwalk <cloudwalk009@gmail.com>
Wed, 23 Dec 2020 18:36:11 +0000 (13:36 -0500)
1  2 
com_game.c
common.h
gl_rmain.c
prvm_cmds.c
shader_glsl.h

diff --cc com_game.c
index 84354d34acdfecd813ac5d4f63d23334aa7295e7,8216bafe50f8a9ea64d6332dcd44d4ecfaa92cd2..2f902aeef5355fd236036b1adb091ca9e10c9b38
@@@ -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 599defa0b52a06561d3966ef389651bcd3c43ff9,834baeee69dcf2b0b4f95cbac6386cc7a8b46b0c..02587e89ec0ec0ecf008dd633b3f8157403d628f
+++ 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 gl_rmain.c
Simple merge
diff --cc prvm_cmds.c
index 6db3b6d756bbbe5452858a0d927b1a1dc3161eea,c83598b6479280bccfe204c90a7030a76c81e30b..81d52a3ad676366de5213154fb4640aa6d2377b1
@@@ -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 ed74055a1daf19a9c2f97c800d45f47408c3a89b,5a4b224a2e88b31b1363444828ed5c824cb78317..4c7ddd3ae368983b0f0a16d0a4a22b1ff79fad58
  "}\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",