From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- games-puzzle/tong/files/tong-1.2-datadir.patch | 41 +++++++++++++++++++++++++ games-puzzle/tong/files/tong-1.2-fps.patch | 25 +++++++++++++++ games-puzzle/tong/files/tong-1.2-makefile.patch | 28 +++++++++++++++++ 3 files changed, 94 insertions(+) create mode 100644 games-puzzle/tong/files/tong-1.2-datadir.patch create mode 100644 games-puzzle/tong/files/tong-1.2-fps.patch create mode 100644 games-puzzle/tong/files/tong-1.2-makefile.patch (limited to 'games-puzzle/tong/files') 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: -- cgit v1.2.3