Gentoo Archives: gentoo-commits

From: "Michael Sterrett (mr_bones_)" <mr_bones_@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in games-puzzle/tong/files: tong-1.0-makefile.patch tong-1.0-fps.patch 1.0-makefile.patch
Date: Mon, 06 Apr 2009 21:57:55
Message-Id: E1Lqwp4-0001Fu-R7@stork.gentoo.org
1 mr_bones_ 09/04/06 21:57:42
2
3 Added: tong-1.0-makefile.patch tong-1.0-fps.patch
4 Removed: 1.0-makefile.patch
5 Log:
6 add fps limiting patch from Rudi Lippert (bug #196013)
7 (Portage version: 2.1.6.7/cvs/Linux i686)
8
9 Revision Changes Path
10 1.1 games-puzzle/tong/files/tong-1.0-makefile.patch
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/games-puzzle/tong/files/tong-1.0-makefile.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/games-puzzle/tong/files/tong-1.0-makefile.patch?rev=1.1&content-type=text/plain
14
15 Index: tong-1.0-makefile.patch
16 ===================================================================
17 --- Makefile.orig 2005-02-01 11:49:23.000000000 -0500
18 +++ Makefile 2005-02-01 11:51:07.000000000 -0500
19 @@ -1,11 +1,10 @@
20 #hello world
21 #my first attempt at making a makefile
22
23 -SDL_CFLAGS := $(shell sdl-config --cflags)
24 +CXXFLAGS += $(shell sdl-config --cflags)
25 SDL_LDFLAGS := $(shell sdl-config --libs)
26 MIXER_FLAGS := -lSDL_mixer -lpthread
27 IMG_FLAGS := -lSDL_image
28 -CC=g++ -O3 -Wall #-ggdb3
29 SOURCES = tetris.cpp pong.cpp text.cpp option.cpp media.cpp
30 #these sources need to be linked to the SDL libs so may have special flag settings
31 SDL_SOURCES = tong.cpp
32 @@ -16,13 +15,7 @@
33 #builds all, builds the target
34
35 all: $(OBJS)
36 - $(CC) $(SDL_LDFLAGS) $(MIXER_FLAGS) $(IMG_FLAGS) $(OBJS) -o $(TARGET)
37 -
38 -%.o: %.cpp
39 - $(CC) $(SDL_CFLAGS) -c -o $@ $<
40 -
41 -tong.o: $(SDL_SOURCES)
42 - $(CC) $(SDL_CFLAGS) -c -o $@ $<
43 + $(CXX) $(LDFLAGS) $(OBJS) $(SDL_LDFLAGS) $(MIXER_FLAGS) $(IMG_FLAGS) -o $(TARGET)
44
45 # clean out the mess
46 clean:
47
48
49
50 1.1 games-puzzle/tong/files/tong-1.0-fps.patch
51
52 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/games-puzzle/tong/files/tong-1.0-fps.patch?rev=1.1&view=markup
53 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/games-puzzle/tong/files/tong-1.0-fps.patch?rev=1.1&content-type=text/plain
54
55 Index: tong-1.0-fps.patch
56 ===================================================================
57 --- tong.cpp.ori 2007-10-15 19:27:54.000000000 +0200
58 +++ tong.cpp 2007-10-15 19:36:51.000000000 +0200
59 @@ -54,6 +54,8 @@
60 #define MENUMOUSE_THRESHOLD 40
61 #define DEMO_TIME 8000
62
63 +#define MIN_TIME 45
64 +
65 bool drop_piece(Tetrad*, Tetrad*, Bucket*, Uint32&, bool&, bool&, Option*,
66 int&);
67
68 @@ -1979,6 +1981,13 @@
69 SDL_Flip(screen);
70 lastlastupdate=lastupdate;
71 lastupdate=SDL_GetTicks();
72 +
73 + // limit to 1000/MIN_TIME fps
74 + if (lastupdate-lastlastupdate < MIN_TIME) {
75 + SDL_Delay(MIN_TIME - (lastupdate - lastlastupdate));
76 + }
77 + lastupdate = SDL_GetTicks();
78 +
79 } //main game loop
80
81 if(Mix_PlayingMusic()) {