diff options
author | taw27 <taw27@84d2e878-0bd5-11dd-ad15-13eda11d74c5> | 2008-05-14 19:33:17 +0000 |
---|---|---|
committer | taw27 <taw27@84d2e878-0bd5-11dd-ad15-13eda11d74c5> | 2008-05-14 19:33:17 +0000 |
commit | b69ef8b8c82a9abbfcc52e0275f1ec58274a5d7f (patch) | |
tree | be1b4283fb5e00bbf7f1d15498bab4a22aadbeb0 /src | |
parent | e90b381ac677f73d84b1d521046285c226450034 (diff) |
Reduce target frame rate
Set projection transformation correctly
git-svn-id: svn://cook.msm.cam.ac.uk:745/thrust3d/thrust3d@14 84d2e878-0bd5-11dd-ad15-13eda11d74c5
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 6 | ||||
-rw-r--r-- | src/render.c | 2 |
2 files changed, 4 insertions, 4 deletions
@@ -156,12 +156,12 @@ int main(int argc, char *argv[]) { game->cur_room_x, game->cur_room_y, game->cur_room_z, game->num_rooms, game->render->fps); fflush(stdout); - /* Attempt to hold output FPS close to 100 */ - if ( (!game->frame_delay_fiddled) && (game->render->fps < 90) ) { + /* Attempt to hold output FPS close to some target value */ + if ( (!game->frame_delay_fiddled) && (game->render->fps < 30) ) { game->frame_delay -= game->frame_delay/20; game->frame_delay_fiddled = 1; } - if ( (!game->frame_delay_fiddled) && (game->render->fps > 110) ) { + if ( (!game->frame_delay_fiddled) && (game->render->fps > 50) ) { game->frame_delay += game->frame_delay/20; game->frame_delay_fiddled = 1; } diff --git a/src/render.c b/src/render.c index b0c7234..a74f80e 100644 --- a/src/render.c +++ b/src/render.c @@ -91,7 +91,7 @@ RenderContext *render_setup(width, height) { glMatrixMode(GL_PROJECTION); glLoadIdentity(); - gluPerspective(50.0, 640.0/480.0, 0.1, 100.0); /* Depth buffer 10cm to 100m */ + gluPerspective(50.0, width/height, 0.1, 100.0); /* Depth buffer 10cm to 100m */ glEnable(GL_COLOR_MATERIAL); glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE); |