summaryrefslogtreecommitdiff
path: root/games-puzzle/tong/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /games-puzzle/tong/files
reinit the tree, so we can have metadata
Diffstat (limited to 'games-puzzle/tong/files')
-rw-r--r--games-puzzle/tong/files/tong-1.2-datadir.patch41
-rw-r--r--games-puzzle/tong/files/tong-1.2-fps.patch25
-rw-r--r--games-puzzle/tong/files/tong-1.2-makefile.patch28
3 files changed, 94 insertions, 0 deletions
diff --git a/games-puzzle/tong/files/tong-1.2-datadir.patch b/games-puzzle/tong/files/tong-1.2-datadir.patch
new file mode 100644
index 000000000000..d0279ac3b874
--- /dev/null
+++ b/games-puzzle/tong/files/tong-1.2-datadir.patch
@@ -0,0 +1,41 @@
+--- tong.cpp.orig
++++ tong.cpp
+@@ -202,7 +202,6 @@
+ Tetrad *tetrad, *nexttetrad;
+ Paddle *paddle;
+ Ball *ball;
+- char datadir[256];
+ input_t input;
+ int volume = MIX_MAX_VOLUME;
+
+@@ -210,7 +209,6 @@
+ volume = 24;
+ #endif
+ memset(&input, 0, sizeof(input_t));
+- strcpy(datadir, GAME_DATA_DIR);
+ if(argc>1) {
+ if(!strcmp(argv[1], "-v") || !strcmp(argv[1], "--version")) {
+ printf("%s\n", GAME_ID);
+@@ -219,10 +217,6 @@
+ "warranty; not even for MERCHANTABILITY or"
+ " FITNESS FOR A PARTICULAR PURPOSE.\n");
+ return 0;
+- } else if(!strncmp(argv[1], "-p=", 3)) {
+- strcpy(datadir, argv[1]+(3*sizeof(char)));
+- } else if(!strncmp(argv[1], "--path=", 7)) {
+- strcpy(datadir, argv[1]+(7*sizeof(char)));
+ } else {
+ printf("Usage: %s [OPTION]\n", argv[0]);
+ printf("Play TONG, a Free Software game (Tetris meets Pong)\n");
+@@ -237,11 +231,6 @@
+ #ifdef WII
+ fatInitDefault();
+ #endif
+- if (chdir(datadir)) {
+- printf("Could not chdir to %s (attempting to use current dir)\n",
+- datadir);
+- }
+-
+ if(SDL_Init(SDL_INIT_AUDIO
+ |SDL_INIT_VIDEO
+ |SDL_INIT_TIMER
diff --git a/games-puzzle/tong/files/tong-1.2-fps.patch b/games-puzzle/tong/files/tong-1.2-fps.patch
new file mode 100644
index 000000000000..8ce66ebf1d31
--- /dev/null
+++ b/games-puzzle/tong/files/tong-1.2-fps.patch
@@ -0,0 +1,25 @@
+--- tong.cpp.orig
++++ tong.cpp
+@@ -64,6 +64,8 @@
+
+ #define DEMO_TIME 8000
+
++#define MIN_TIME 45
++
+ #define GP2X_BUTTON_UP 0
+ #define GP2X_BUTTON_UPLEFT 1
+ #define GP2X_BUTTON_LEFT 2
+@@ -1854,6 +1856,13 @@
+ SDL_Flip(screen);
+ lastlastupdate=lastupdate;
+ lastupdate=SDL_GetTicks();
++
++ // limit to 1000/MIN_TIME fps
++ if (lastupdate-lastlastupdate < MIN_TIME) {
++ SDL_Delay(MIN_TIME - (lastupdate - lastlastupdate));
++ }
++ lastupdate = SDL_GetTicks();
++
+ } //main game loop
+
+ Mix_FreeMusic(music);
diff --git a/games-puzzle/tong/files/tong-1.2-makefile.patch b/games-puzzle/tong/files/tong-1.2-makefile.patch
new file mode 100644
index 000000000000..68b4547d9427
--- /dev/null
+++ b/games-puzzle/tong/files/tong-1.2-makefile.patch
@@ -0,0 +1,28 @@
+--- Makefile.orig
++++ Makefile
+@@ -1,11 +1,10 @@
+ # TONG! makefile, tweak as you see fit
+
+-SDL_CFLAGS := $(shell sdl-config --cflags)
++CXXFLAGS += $(shell sdl-config --cflags)
+ SDL_LDFLAGS := $(shell sdl-config --libs)
+ MIXER_FLAGS := -lSDL_mixer -lpthread
+ IMG_FLAGS := -lSDL_image
+ GAME_DATA_DIR := .
+-CC = g++ -O3 -Wall #-ggdb3
+ SOURCES = tetris.cpp pong.cpp text.cpp option.cpp media.cpp
+ # these sources need to be linked to SDL libs, so may have special flag settings
+ SDL_SOURCES = tong.cpp
+@@ -29,11 +28,7 @@
+
+ # builds all, builds the target
+ all: $(OBJS)
+- $(CC) $(SDL_LDFLAGS) $(MIXER_FLAGS) $(IMG_FLAGS) $(OBJS) -o $(TARGET)
+-%.o: %.cpp
+- $(CC) $(SDL_CFLAGS) -c -o $@ $<
+-tong.o: $(SDL_SOURCES)
+- $(CC) -DGAME_DATA_DIR=\"$(GAME_DATA_DIR)\" $(SDL_CFLAGS) -c -o $@ $<
++ $(CXX) $(LDFLAGS) $(OBJS) $(SDL_LDFLAGS) $(MIXER_FLAGS) $(IMG_FLAGS) -o $(TARGET)
+
+ # clean out the mess
+ clean: