Port r3921 till r3924:

- Move VISIBLE_XTILES from src/ to lib/ivis_common/, so we don't have to hardcore mapview sizes in piedraw.c...
- Make INTERFACE_DEPTH/MAX_Z int, since that's what they are used as.
- Remove unused defines
- Less fog and more shadows


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3926 4a71c877-e1ca-e34f-864e-861f7616d084
master
Dennis Schridde 2008-03-05 19:30:29 +00:00
parent d632cadb8a
commit a3284e7a7d
5 changed files with 16 additions and 21 deletions

View File

@ -52,13 +52,17 @@
#define FP12_MULTIPLIER (1 << FP12_SHIFT) #define FP12_MULTIPLIER (1 << FP12_SHIFT)
#define STRETCHED_Z_SHIFT 10 // stretchs z range for (1000 to 4000) to (8000 to 32000) #define STRETCHED_Z_SHIFT 10 // stretchs z range for (1000 to 4000) to (8000 to 32000)
#define MAX_Z (32000.0f) // raised to 32000 from 6000 when stretched #define MAX_Z (32000) // raised to 32000 from 6000 when stretched
#define MIN_STRETCHED_Z 256 #define MIN_STRETCHED_Z 256
#define LONG_WAY (1<<15) #define LONG_WAY (1<<15)
#define LONG_TEST (1<<14) #define LONG_TEST (1<<14)
#define INTERFACE_DEPTH (MAX_Z - 1.0f) #define INTERFACE_DEPTH (MAX_Z - 1)
#define BUTTON_DEPTH 2000 // will be stretched to 16000 #define BUTTON_DEPTH 2000 // will be stretched to 16000
// Amount of visible terrain tiles in x/y direction
#define VISIBLE_XTILES 64
#define VISIBLE_YTILES 64
#define OLD_TEXTURE_SIZE_FIX 256.0f #define OLD_TEXTURE_SIZE_FIX 256.0f
//Render style flags for all pie draw functions //Render style flags for all pie draw functions

View File

@ -36,11 +36,14 @@
#include "lib/ivis_common/pieclip.h" #include "lib/ivis_common/pieclip.h"
#include "piematrix.h" #include "piematrix.h"
#define SHADOW_END_DISTANCE (8000*8000) // Keep in sync with lighting.c:FOG_END
#define VERTICES_PER_TRIANGLE 3 #define VERTICES_PER_TRIANGLE 3
#define COLOUR_COMPONENTS 4 #define COLOUR_COMPONENTS 4
#define TEXCOORD_COMPONENTS 2 #define TEXCOORD_COMPONENTS 2
#define VERTEX_COMPONENTS 3 #define VERTEX_COMPONENTS 3
#define MAP_TRIANGLES (64 * 64 * 2) // two triangles per tile
#define MAP_TRIANGLES (VISIBLE_YTILES * VISIBLE_XTILES * 2) // two triangles per tile
#define MAP_VERTICES (VERTICES_PER_TRIANGLE * MAP_TRIANGLES) #define MAP_VERTICES (VERTICES_PER_TRIANGLE * MAP_TRIANGLES)
static GLubyte aColour[COLOUR_COMPONENTS * MAP_VERTICES]; static GLubyte aColour[COLOUR_COMPONENTS * MAP_VERTICES];
@ -59,7 +62,7 @@ BOOL check_extension(const char *extName)
char *end; char *end;
size_t extNameLen= strlen(extName); size_t extNameLen= strlen(extName);
end = p + strlen(p); end = p + strlen(p);
while (p < end) while (p < end)
{ {
int n = strcspn(p, " "); int n = strcspn(p, " ");
@ -734,7 +737,7 @@ void pie_Draw3DShape(iIMDShape *shape, int frame, int team, PIELIGHT colour, PIE
distance += scshapes[nb_scshapes].matrix[14] * scshapes[nb_scshapes].matrix[14]; distance += scshapes[nb_scshapes].matrix[14] * scshapes[nb_scshapes].matrix[14];
// if object is too far in the fog don't generate a shadow. // if object is too far in the fog don't generate a shadow.
if (distance < 6000*6000) if (distance < SHADOW_END_DISTANCE)
{ {
float invmat[9], pos_light0[4]; float invmat[9], pos_light0[4];

View File

@ -50,7 +50,7 @@ void pie_DrawViewingWindow(Vector3i *v, UDWORD x1, UDWORD y1, UDWORD x2, UDWORD
pieVrts[0].pos.x = v[1].x; pieVrts[0].pos.x = v[1].x;
pieVrts[0].pos.y = v[1].y; pieVrts[0].pos.y = v[1].y;
//cull triangles with off screen points //cull triangles with off screen points
pieVrts[0].pos.z = (int)INTERFACE_DEPTH; pieVrts[0].pos.z = INTERFACE_DEPTH;
pieVrts[0].u = 0; pieVrts[0].u = 0;
pieVrts[0].v = 0; pieVrts[0].v = 0;

View File

@ -31,8 +31,4 @@
#define RADBRX (RADTLX + RADWIDTH) -1 #define RADBRX (RADTLX + RADWIDTH) -1
#define RADBRY (RADTLY + RADHEIGHT) -1 #define RADBRY (RADTLY + RADHEIGHT) -1
//assigned to variable visibleXtiles, visibleYTiles 25/02/98 AB
#define VISIBLE_XTILES 64
#define VISIBLE_YTILES 64
#endif #endif

View File

@ -41,8 +41,8 @@
// These values determine the fog when fully zoomed in // These values determine the fog when fully zoomed in
// Determine these when fully zoomed in // Determine these when fully zoomed in
#define FOG_END 3500 #define FOG_DEPTH 1000
#define FOG_DEPTH 800 #define FOG_END 6500
// These values are multiplied by the camera distance // These values are multiplied by the camera distance
// to obtain the optimal settings when fully zoomed out // to obtain the optimal settings when fully zoomed out
@ -506,18 +506,10 @@ static void colourTile(SDWORD xIndex, SDWORD yIndex, LIGHT_COLOUR colouridx, UBY
/// "popping" tiles /// "popping" tiles
void UpdateFogDistance(float distance) void UpdateFogDistance(float distance)
{ {
pie_UpdateFogDistance(FOG_END-FOG_DEPTH+distance*FOG_BEGIN_SCALE, FOG_END+distance*FOG_END_SCALE); pie_UpdateFogDistance(FOG_END-FOG_DEPTH + distance*FOG_BEGIN_SCALE, FOG_END + distance*FOG_END_SCALE);
} }
//three fog modes, background fog, distance fog, ground mist
#define UMBRA_RADIUS 384
#define FOG_RADIUS 384 //256 too abrupt at edges
#define FOG_START 512
#define FOG_RATE 10
#define MIN_DROID_LIGHT_LEVEL 96 #define MIN_DROID_LIGHT_LEVEL 96
#define DROID_SEEK_LIGHT_SPEED 2 #define DROID_SEEK_LIGHT_SPEED 2