From 5ebab8df836da4bb76fd44028e14644ea2c15250 Mon Sep 17 00:00:00 2001 From: terminx Date: Sun, 26 Nov 2006 21:15:20 +0000 Subject: [PATCH] git-svn-id: https://svn.eduke32.com/eduke32@361 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/build/src/mdsprite.c | 4 ++-- polymer/build/src/polymost.c | 14 ++++++++------ polymer/eduke32/source/config.c | 2 -- polymer/eduke32/source/game.c | 2 ++ 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/polymer/build/src/mdsprite.c b/polymer/build/src/mdsprite.c index 5b36c1111..7968225eb 100644 --- a/polymer/build/src/mdsprite.c +++ b/polymer/build/src/mdsprite.c @@ -1386,7 +1386,7 @@ static int md3draw (md3model *m, spritetype *tspr) bglEnable(GL_TEXTURE_2D); - pc[0] = pc[1] = pc[2] = ((float)(numpalookups-min(max((globalshade * 1.300)+m->shadeoff,0),numpalookups)))/((float)numpalookups); + pc[0] = pc[1] = pc[2] = ((float)(numpalookups-min(max((globalshade * SHADESCALE)+m->shadeoff,0),numpalookups)))/((float)numpalookups); pc[0] *= (float)hictinting[globalpal].r / 255.0; pc[1] *= (float)hictinting[globalpal].g / 255.0; pc[2] *= (float)hictinting[globalpal].b / 255.0; @@ -2391,7 +2391,7 @@ if (grhalfxdown10x < 0) { mat[0] = -mat[0]; mat[4] = -mat[4]; mat[8] = -mat[8]; bglEnable(GL_TEXTURE_2D); - pc[0] = pc[1] = pc[2] = ((float)(numpalookups-min(max((globalshade * 1.300)+m->shadeoff,0),numpalookups)))/((float)numpalookups); + pc[0] = pc[1] = pc[2] = ((float)(numpalookups-min(max((globalshade * SHADESCALE)+m->shadeoff,0),numpalookups)))/((float)numpalookups); pc[0] *= (float)hictinting[globalpal].r / 255.0; pc[1] *= (float)hictinting[globalpal].g / 255.0; pc[2] *= (float)hictinting[globalpal].b / 255.0; diff --git a/polymer/build/src/polymost.c b/polymer/build/src/polymost.c index 80a02e629..e87a71f86 100644 --- a/polymer/build/src/polymost.c +++ b/polymer/build/src/polymost.c @@ -81,7 +81,7 @@ static double dxb1[MAXWALLSB], dxb2[MAXWALLSB]; #define USEZBUFFER 1 //1:use zbuffer (slow, nice sprite rendering), 0:no zbuffer (fast, bad sprite rendering) #define LINTERPSIZ 4 //log2 of interpolation size. 4:pretty fast&acceptable quality, 0:best quality/slow! #define DEPTHDEBUG 0 //1:render distance instead of texture, for debugging only!, 0:default -#define FOGSCALE 0.0000600 +#define FOGSCALE 0.0000640 #define PI 3.14159265358979323 static double gyxscale, gxyaspect, gviewxrange, ghalfx, grhalfxdown10, grhalfxdown10x, ghoriz; @@ -133,12 +133,14 @@ long fullbrightloadingpass = 0; long fullbrightdrawingpass = 0; long shadeforfullbrightpass; +#define SHADESCALE 1.250 + float fogcalc (signed char shade, char vis) { float result; - - if (vis < 240) result = (float)(vis+16+(shade<0?shade/2.f:shade)); - else result = (float)((vis-240+(shade<0?shade/2.f:shade))/(klabs(vis-256))); +// if(vis < 16) vis = 16; + if (vis < 240) result = (float)(vis+16+(shade<0?(-(shade)*(shade))/8.f:((shade)*(shade))/8.f)); + else result = (float)((vis-240+(shade<0?(-(shade)*(shade))/8.f:((shade)*(shade))/8.f))/(klabs(vis-256))); if (result < 0.000) return (0); return (gvisibility * result); @@ -1485,7 +1487,7 @@ void drawpoly (double *dpx, double *dpy, long n, long method) { float pc[4]; - f = ((float)(numpalookups-min(max(globalshade*1.300,0),numpalookups)))/((float)numpalookups); + f = ((float)(numpalookups-min(max(globalshade * SHADESCALE,0),numpalookups)))/((float)numpalookups); pc[0] = pc[1] = pc[2] = f; switch (method&3) { @@ -4587,7 +4589,7 @@ void polymost_fillpolygon (long npoints) pth = gltexcache(globalpicnum,globalpal,0); bglBindTexture(GL_TEXTURE_2D, pth ? pth->glpic : 0); - f = ((float)(numpalookups-min(max(globalshade*1.300,0),numpalookups)))/((float)numpalookups); + f = ((float)(numpalookups-min(max(globalshade * SHADESCALE,0),numpalookups)))/((float)numpalookups); switch ((globalorientation>>7)&3) { case 0: case 1: diff --git a/polymer/eduke32/source/config.c b/polymer/eduke32/source/config.c index 330f1ce04..34e3f0f98 100644 --- a/polymer/eduke32/source/config.c +++ b/polymer/eduke32/source/config.c @@ -631,8 +631,6 @@ int32 CONFIG_ReadSetup(void) if (SafeFileExists(setupfilename) && scripthandle < 0) // JBF 20031211 scripthandle = SCRIPT_Load(setupfilename); - initprintf("Using config file %s.\n",setupfilename); - if (scripthandle < 0) return -1; if (scripthandle >= 0) diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 243bae107..9dfb828f1 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -9603,6 +9603,8 @@ void app_main(int argc,char **argv) exit(1); } + initprintf("Using config file %s.\n",setupfilename); + ScanGroups(); { // try and identify the 'defaultduke3dgrp' in the set of GRPs. // if it is found, set up the environment accordingly for the game it represents.