static int config_improve_smooth_planets = 1; /* set to 1 to rotate planets smoothly */
static int config_improve_stars_rotation = 1; /* set to 1 to improve star rendering */
static int config_improve_fix_sky_rotation = 0; /* set to 1 to fix sky rotation */
+static int config_improve_round_planets = 0; /* set to 1 to make planets exactly round */
#define CPU_SPEED 7093790.0;
print_info(" fixed by rotating all sky object by 180 degrees. The original (wrong)\n");
print_info(" rotation is default, because it preserves the game's spirit!\n");
print_info(" This option requires OpenGL rendering. (default = %d)\n", config_improve_fix_sky_rotation);
+ print_info(" --round-planets 1 | 0\n");
+ print_info(" The original game renders planets and explosion debris horizontally\n");
+ print_info(" stretched. This compensates the vertical stretch of NTSC vs PAL video.\n");
+ print_info(" The original (stretched) sphere makes the game authentic.\n");
+ print_info(" This option requires OpenGL rendering. (default = %d)\n", config_improve_round_planets);
print_info("Debug options:\n");
print_info(" -o --debug-opengl\n");
print_info(" Use split screen to display both Amiga and OpenGL rendering.\n");
goto missing_parameter;
config_improve_fix_sky_rotation = atoi(argv[i]);
} else
+ if (!strcmp(argv[i], "--round-planets")) {
+ i++;
+ if (argc == i)
+ goto missing_parameter;
+ config_improve_round_planets = atoi(argv[i]);
+ } else
if (!strcmp(argv[i], "-o") || !strcmp(argv[i], "--debug-opengl")) {
config_debug_opengl = 1;
} else
frame_render = 0;
/* start capturing for improved graphics */
if (render_improved)
- render_capture_start(config_fov, config_improve_extend_roads, config_improve_smooth_planets, config_improve_stars_rotation, config_improve_fix_sky_rotation, config_debug_transparent);
+ render_capture_start(config_fov, config_improve_extend_roads, config_improve_smooth_planets, config_improve_stars_rotation, config_improve_fix_sky_rotation, config_improve_round_planets, config_debug_transparent);
/* execute until the rendered image is ready (wait for VBL) */
cycle_count = 0;
#define MAX_MOVING_OBJECTS 16 /* maximum number of moving objects (used for interpolation) */
#define MAX_EXPLOSION 256 /* how many explosion particles can be stored in one object */
#define PLANET_VERTICES 128
-#define PLANET_ELIPSE 1.17
+#define PLANET_STRETCH 1.19 /* stretch horizontally (this compensates NTSC/PAL line ratio of 625/525)*/
#define EXPLOSION_VERTICES 16
-#define EXPLOSION_ELIPSE 1.17
+#define EXPLOSION_STRETCH 1.19 /* as above */
#define SIGHT_DIST 78.74 /* distanc of sights in inch */
#define FIX_OBJECT_SCALE 16
static int extend_roads; /* extend roads in its original width, rather than just using a single point */
static int improve_stars; /* stars are rendered spherical */
static int fix_sky_rotation; /* sky will rotate correctly by rotating planets/comet by 180 degrees */
+static double planet_aspect, explosion_aspect; /* aspect ratio */
static double fov;
static double debug_opacity;
static double frustum_slope_64, frustum_slope_fov;
}
/* rendering starts, initialize variables */
-void render_capture_start(double _fov, int _extend_roads, int _smooth_planets, int _improve_stars, int _fix_sky_rotation, int debug)
+void render_capture_start(double _fov, int _extend_roads, int _smooth_planets, int _improve_stars, int _fix_sky_rotation, int _round_planets, int debug)
{
#if defined(DEBUG_COLOR) || defined(DEBUG_VERTEX)
printf("start rendering a new frame...\n");
extend_roads = _extend_roads;
fix_sky_rotation = _fix_sky_rotation;
improve_stars = _improve_stars;
+ planet_aspect = (_round_planets) ? 1.0 : PLANET_STRETCH;
+ explosion_aspect = (_round_planets) ? 1.0 : EXPLOSION_STRETCH;
/* set some transpareny, if debugging is enabled */
debug_opacity = (debug) ? 0.5 : 1.0;
for (i = 0; i < PLANET_VERTICES; i++) {
_sin = size * sin(2.0 * M_PI * (double)i / PLANET_VERTICES);
_cos = size * cos(2.0 * M_PI * (double)i / PLANET_VERTICES);
- circle_x[i] = _sin * PLANET_ELIPSE;
+ circle_x[i] = _sin * planet_aspect;
circle_y[i] = _cos;
circle_z[i] = 0.0;
crescent_x[i] = circle_x[i] * crescent;
for (i = 0; i < PLANET_VERTICES; i++) {
_sin = size * sin(2.0 * M_PI * (double)i / PLANET_VERTICES);
_cos = size * cos(2.0 * M_PI * (double)i / PLANET_VERTICES);
- circle_x[i] = _sin * PLANET_ELIPSE;
+ circle_x[i] = _sin * planet_aspect;
circle_y[i] = _cos;
circle_z[i] = 0.0;
crescent_x[i] = circle_x[i] * crescent;
size = render_item->u.explosion.size[e] * (fabs(loc_z) / 256.0);
/* create and render cicle */
for (i = 0; i < EXPLOSION_VERTICES; i++) {
- x[i] = loc_x + size * sin(2 * M_PI * (double)i / EXPLOSION_VERTICES) * EXPLOSION_ELIPSE;
+ x[i] = loc_x + size * sin(2 * M_PI * (double)i / EXPLOSION_VERTICES) * explosion_aspect;
y[i] = loc_y + size * cos(2 * M_PI * (double)i / EXPLOSION_VERTICES);
z[i] = loc_z;
}
-void render_capture_start(double _fov, int _extend_roads, int _smooth_planets, int _improve_stars, int _fix_sky_rotation, int debug);
+void render_capture_start(double _fov, int _extend_roads, int _smooth_planets, int _improve_stars, int _fix_sky_rotation, int _round_planets, int debug);
void render_capture_stop(void);
void render_capture_event(int event);
int render_all_items(double inter, int vr);