diff --git a/src/Enemies/Enemy.c b/src/Enemies/Enemy.c index ea6af4a5..85536e0c 100644 --- a/src/Enemies/Enemy.c +++ b/src/Enemies/Enemy.c @@ -28,7 +28,7 @@ static Boolean KillEnemy(ObjNode *theEnemy); /* VARIABLES */ /*********************/ -short gNumEnemyOfKind[NUM_ENEMY_KINDS]; +int32_t gNumEnemyOfKind[NUM_ENEMY_KINDS]; short gNumEnemies; diff --git a/src/Headers/camera.h b/src/Headers/camera.h index 29bef812..5d43ea73 100644 --- a/src/Headers/camera.h +++ b/src/Headers/camera.h @@ -3,7 +3,7 @@ // #define HITHER_DISTANCE 20.0f -#define YON_DISTANCE 2800.0f // how far the game will render objects in the view frustum +#define YON_DISTANCE 5000.0f // how far the game will render objects in the view frustum void InitCamera(void); void UpdateCamera(void); diff --git a/src/Headers/game.h b/src/Headers/game.h index 55b1daa9..0d4ccc73 100644 --- a/src/Headers/game.h +++ b/src/Headers/game.h @@ -199,7 +199,7 @@ extern short gMoney; extern short gNumBlueClovers; extern short gNumCollisions; extern short gNumEnemies; -extern short gNumEnemyOfKind[]; +extern int32_t gNumEnemyOfKind[]; extern short gNumGoldClovers; extern short gNumGreenClovers; extern short gNumLadyBugsThisArea; diff --git a/src/Headers/renderer.h b/src/Headers/renderer.h index e9bcb9cf..b1b8d94d 100644 --- a/src/Headers/renderer.h +++ b/src/Headers/renderer.h @@ -45,8 +45,8 @@ typedef struct RenderModifiers enum { - kDrawOrder_Terrain = -128, - kDrawOrder_Cyclorama, + kDrawOrder_Cyclorama = -128, // give it a lower value than the terrain to draw it first + kDrawOrder_Terrain = -127, kDrawOrder_Fences, kDrawOrder_Shadows, kDrawOrder_Default = 0, diff --git a/src/Headers/terrain.h b/src/Headers/terrain.h index c13ecd2d..da973ef2 100644 --- a/src/Headers/terrain.h +++ b/src/Headers/terrain.h @@ -65,7 +65,7 @@ enum #define TERRAIN_SUPERTILE_UNIT_SIZE (SUPERTILE_SIZE*TERRAIN_POLYGON_SIZE) // world unit size of a supertile -#define MAX_SUPERTILE_ACTIVE_RANGE 5 // max value of gSuperTileActiveRange +#define MAX_SUPERTILE_ACTIVE_RANGE 20 // max value of gSuperTileActiveRange // The largest map in the game (Night.ter) is 50x40 supertiles == 2000 supertiles. // Therefore, the maximum useful value for MAX_SUPERTILE_ACTIVE_RANGE is 23 (because (23*2)**2 == 2116 supertiles) diff --git a/src/Items/Items.c b/src/Items/Items.c index 5082db2c..b86cba89 100644 --- a/src/Items/Items.c +++ b/src/Items/Items.c @@ -94,10 +94,10 @@ void CreateCyclorama(void) // Notes on cyclorama status bits: // - HIDDEN because we'll draw it manually in DrawTerrain. - // - Don't set NOZWRITE, contrary to the original source code. The cyc does appear to clip - // through the terrain and fences on the OS 9 version, effectively reducing draw distance - // somewhat. See: faraway fences seen from the starting position in level 4. - gNewObjectDefinition.flags = STATUS_BIT_DONTCULL | STATUS_BIT_NULLSHADER | STATUS_BIT_NOFOG | STATUS_BIT_HIDDEN; + // - NOZWRITE was set in the original source code. + // The cyc should not clip through the terrain or fences. + // See: faraway fences seen from the starting position in level 4. + gNewObjectDefinition.flags = STATUS_BIT_DONTCULL | STATUS_BIT_NULLSHADER | STATUS_BIT_NOFOG | STATUS_BIT_NOZWRITE | STATUS_BIT_HIDDEN; gCyclorama = MakeNewDisplayGroupObject(&gNewObjectDefinition); gCyclorama->RenderModifiers.drawOrder = kDrawOrder_Cyclorama; diff --git a/src/Items/Liquids.c b/src/Items/Liquids.c index 2d297839..93f5b8ce 100644 --- a/src/Items/Liquids.c +++ b/src/Items/Liquids.c @@ -33,7 +33,7 @@ static void ApplyJitterToLiquidVertex(TQ3Point3D* p, int type); /* CONSTANTS */ /****************************/ -#define MAX_LIQUID_MESHES 32 +#define MAX_LIQUID_MESHES 255 #define MAX_LIQUID_SIZE 20 #define MAX_LIQUID_TRIANGLES (MAX_LIQUID_SIZE*MAX_LIQUID_SIZE*2) #define MAX_LIQUID_VERTS ((MAX_LIQUID_SIZE+1)*(MAX_LIQUID_SIZE+1)) diff --git a/src/System/Main.c b/src/System/Main.c index a31a52c9..64d2d7f1 100644 --- a/src/System/Main.c +++ b/src/System/Main.c @@ -113,12 +113,12 @@ static const bool gLevelHasCeiling[NUM_LEVEL_TYPES] = static const Byte gLevelSuperTileActiveRange[NUM_LEVEL_TYPES] = { - 5, // garden - 4, // boat - 5, // dragonfly - 4, // hive - 4, // night - 4 // anthill + 20, // garden + 16, // boat + 20, // dragonfly + 8, // hive + 16, // night + 8 // anthill }; static const float gLevelFogStart[NUM_LEVEL_TYPES] = @@ -144,11 +144,11 @@ static const float gLevelFogEnd[NUM_LEVEL_TYPES] = static const float gLevelAutoFadeStart[NUM_LEVEL_TYPES] = { - YON_DISTANCE+400, // garden + YON_DISTANCE+5500, // garden 0, // boat 0, // dragonfly 0, // hive - YON_DISTANCE-250, // night + YON_DISTANCE+4000, // night 0, // anthill }; @@ -197,8 +197,8 @@ static const TQ3ColorRGBA gLevelFogColor[NUM_LEVEL_TYPES] = // Source port addition: on rare occasions you get to see the void "above" the cyclorama. // To camouflage this, we make the clear color roughly match the color at the top of the cyc. // This is not necessarily the same color as the fog! -// NOTE: If there's no cyc in a level, this value is ignored and the fog color is used instead. -static const TQ3ColorRGBA gLevelClearColorWithCyc[NUM_LEVEL_TYPES] = +// NOTE: If there's no cyc in a level, this value is still used. +static const TQ3ColorRGBA gLevelClearColor[NUM_LEVEL_TYPES] = { { 0.352f, 0.380f, 1.000f, 1.000f }, // garden (DIFFERENT FROM FOG) { 0.900f, 0.900f, 0.850f, 1.000f }, // boat (same) @@ -466,15 +466,22 @@ QD3DSetupInputType viewDef; gBestCheckPoint = -1; // no checkpoint yet - if (gSuperTileActiveRange == 5) // set yon clipping value + switch (gLevelType) // set yon clipping value { - gCurrentYon = YON_DISTANCE + 1700; - gCycScale = 81; - } - else - { - gCurrentYon = YON_DISTANCE; - gCycScale = 50; + case LEVEL_TYPE_LAWN: // high visibility outdoor levels + case LEVEL_TYPE_FOREST: + gCurrentYon = YON_DISTANCE + 10000; + gCycScale = 300; // gCycScale = (0.02f * gCurrentYon) + break; + case LEVEL_TYPE_POND: // low visibility outdoor levels + case LEVEL_TYPE_NIGHT: + gCurrentYon = YON_DISTANCE + 5000; + gCycScale = 200; + break; + default: // indoor levels + gCurrentYon = YON_DISTANCE; + gCycScale = 100; + break; } @@ -552,11 +559,8 @@ QD3DSetupInputType viewDef; viewDef.lights.fogMode = kQ3FogModePlaneBasedLinear; // Source port note: plane-based linear fog accurately reproduces fog rendering on real Macs // Source port addition: camouflage seam in sky with custom clear color that roughly matches top of cyc - if (gUseCyclorama) - { - viewDef.lights.useCustomFogColor = true; // need this so fog color will be different from clear color - viewDef.view.clearColor = gLevelClearColorWithCyc[gLevelType]; - } + viewDef.lights.useCustomFogColor = true; // need this so fog color will be different from clear color + viewDef.view.clearColor = gLevelClearColor[gLevelType]; // if (gUseCyclorama && (gLevelType != LEVEL_TYPE_FOREST) && (gLevelType != LEVEL_TYPE_NIGHT)) // viewDef.view.dontClear = true;