rpms/worminator/FC-5 worminator-3.0R2.1-speed.patch, NONE, 1.1 worminator.spec, 1.2, 1.3

Hans de Goede (jwrdegoede) fedora-extras-commits at redhat.com
Mon Apr 24 21:49:01 UTC 2006


Author: jwrdegoede

Update of /cvs/extras/rpms/worminator/FC-5
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv23969

Modified Files:
	worminator.spec 
Added Files:
	worminator-3.0R2.1-speed.patch 
Log Message:
* Mon Apr 24 2006 Hans de Goede <j.w.r.degoede at hhs.nl> 3.0R2.1-3
- Limit the framerate to 80 instead of trying to reach 160 fps,
  hopefully this fixes bug 188337.


worminator-3.0R2.1-speed.patch:

--- NEW FILE worminator-3.0R2.1-speed.patch ---
--- worminator-3.0R2.1/demo.h.speed	2006-02-24 20:05:02.000000000 +0100
+++ worminator-3.0R2.1/demo.h	2006-04-24 23:10:05.000000000 +0200
@@ -74,8 +74,15 @@
 		speed_counter--;
 		if (keypressed()) time_to_quit = TRUE;
 		}
-	render_map();
-	if (keypressed()) time_to_quit = TRUE;
+	game_is_running = TRUE;
+	if (frames_to_draw) {
+		render_map();
+		frames_to_draw--;
+		}
+	while (speed_counter == 0) {
+		rest(1);
+		if (keypressed()) time_to_quit = TRUE;
+		}
 	} while(!time_to_quit);  // End core demo loop
 
 fclose(demofile);
--- worminator-3.0R2.1/Worminator.c.speed	2006-03-03 10:29:44.000000000 +0100
+++ worminator-3.0R2.1/Worminator.c	2006-04-24 23:25:29.000000000 +0200
@@ -269,6 +269,16 @@
 }
 END_OF_FUNCTION(increment_speed_counter);
 
+/***********************************\
+|** FRAMERATE THROTTLING FUNCTION **|
+\***********************************/
+void increment_frames_to_draw()
+{
+	if (frames_to_draw < 2)
+		frames_to_draw++;
+}
+END_OF_FUNCTION(increment_frames_to_draw);
+
 /*******************\
 |** MAIN FUNCTION **|
 \*******************/
@@ -333,7 +343,12 @@
 		if (player.timer > 0) player.timer--;
 		speed_counter--;
 		}
-	render_map();
+	game_is_running = TRUE;
+	if (frames_to_draw) {
+		render_map();
+		frames_to_draw--;
+		}
+	while (speed_counter == 0) rest(1);
 } while(time_to_quit == FALSE);  // End core game loop
 add_console_line("Core loop complete, beginning shutdown.");
 
@@ -1540,10 +1555,6 @@
 frame_counter++;
 if (frame_counter > 32768) frame_counter = 32768;
 
-// game_is_running can be changed from under us by update_animations, this
-// should be fixed but just to be sure put the check for it in the while.
-while (game_is_running && speed_counter == 0) rest(1);
-
 //set_palette_range(worminator_data_file[DEFAULT_WORMINATOR_PALLETE].dat, 0, 255, FALSE);
 }
 
@@ -3253,6 +3264,11 @@
 install_int_ex(increment_speed_counter, BPS_TO_TIMER(GAME_SPEED_NORMAL));
 change_game_speed(wormy_config.game_speed);
 
+// Set up the framerate throtteling timer
+LOCK_VARIABLE(frames_to_draw);
+LOCK_FUNCTION(increment_frames_to_draw);
+install_int_ex(increment_frames_to_draw, BPS_TO_TIMER(80));
+
 // Set up the soundz
 add_console_line("Initilizing sound");
 reset_sound();
--- worminator-3.0R2.1/globals.h.speed	2006-02-26 22:30:18.000000000 +0100
+++ worminator-3.0R2.1/globals.h	2006-04-24 23:10:05.000000000 +0200
@@ -255,9 +255,10 @@
 volatile int speed_counter = 0;
 volatile int idle_counter = 0;
 volatile int idle_speed_counter = 0;
+volatile int frames_to_draw = 0;
 
 // This is used to tell the game timer when to update and when not to
-char game_is_running = FALSE;
+volatile char game_is_running = FALSE;
 
 // This is used to indicate what level we are on
 char current_level = 1;
--- worminator-3.0R2.1/player.h.speed	2006-02-25 10:33:10.000000000 +0100
+++ worminator-3.0R2.1/player.h	2006-04-24 23:10:05.000000000 +0200
@@ -2188,7 +2188,11 @@
 		if (frame_loop >= 256) done = TRUE;
 		speed_counter--;
 		}
-	render_map();
+	if (frames_to_draw) {
+		render_map();
+		frames_to_draw--;
+		}
+	while (speed_counter == 0) rest(1);
 	} while (done != TRUE);
 
 // Fade out the display and clear out some junk


Index: worminator.spec
===================================================================
RCS file: /cvs/extras/rpms/worminator/FC-5/worminator.spec,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- worminator.spec	14 Mar 2006 12:33:31 -0000	1.2
+++ worminator.spec	24 Apr 2006 21:49:01 -0000	1.3
@@ -1,6 +1,6 @@
 Name:           worminator
 Version:        3.0R2.1
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        Sidescrolling platform and shoot'em up action-game
 Group:          Amusements/Games
 License:        GPL
@@ -8,6 +8,7 @@
 Source0:        http://download.sourceforge.net/worminator/worminator-%{version}.tar.gz
 Source1:        worminator.png
 Source2:        worminator.desktop
+Patch0:         worminator-3.0R2.1-speed.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires:  allegro-devel, desktop-file-utils
 Requires:       worminator-data >= 3.0R2.1-2
@@ -20,8 +21,10 @@
 
 %prep
 %setup -q
+%patch -p1 -z .speed
 %{__sed} -i 's/\r//' ReadMe.txt
 
+
 %build
 gcc $RPM_OPT_FLAGS -fsigned-char -Wno-deprecated-declarations \
   -Wno-char-subscripts -DDATADIR=\"%{_datadir}/%{name}/\" -o %{name} \
@@ -69,6 +72,10 @@
 
 
 %changelog
+* Mon Apr 24 2006 Hans de Goede <j.w.r.degoede at hhs.nl> 3.0R2.1-3
+- Limit the framerate to 80 instead of trying to reach 160 fps,
+  hopefully this fixes bug 188337.
+
 * Tue Mar 14 2006 Hans de Goede <j.w.r.degoede at hhs.nl> 3.0R2.1-2
 - move worminator data dir from /usr/share/games to just /usr/share to match
   the games-SIG guidelines. Sorry about the somewhat large download for




More information about the fedora-extras-commits mailing list