1 --- anagramarama/anagramarama.6
2 +++ anagramarama/anagramarama.6
4 +.\" Hey, EMACS: -*- nroff -*-
5 +.TH ANAGRAMARAMA 6 "January 4, 2005"
7 +anagramarama \- cute anagram game using SDL
14 +is a simple wordgame in which one tries to guess all the different
15 +permutations of a scrambled word which form another word within the
16 +time limit. Guess the original word and you move on to the next
23 +anagramarama was written by Colm Gallagher <colm@coralquest.com>
25 +This manual page was written by Ryan Stutsman <rstutsma@purdue.edu>,
26 +for the Debian project (but may be used by others).
27 --- anagramarama/makefile
28 +++ anagramarama/makefile
30 -LFLAGS=-Wall -funroll-loops -fomit-frame-pointer -pipe -O9
31 -CFLAGS=-Wall `sdl-config --cflags --libs` -funroll-loops -fomit-frame-pointer -pipe -O9 -lSDL_mixer
34 +CPPFLAGS=`sdl-config --cflags` -DDATA_DIR=\"$(DATA_DESTDIR)\" \
35 + -DIMAGES_DIR=\"$(IMAGES_DESTDIR)\" -DAUDIO_DIR=\"$(AUDIO_DESTDIR)\"
36 +LDLIBS=-lSDL_mixer `sdl-config --libs`
38 C_FILES=src/dlb.c src/linked.c src/sprite.c src/ag.c
39 OBJ_FILES=src/dlb.o src/linked.o src/sprite.o src/ag.o
46 - $(CC) $(CFLAGS) -o $(OUT_FILE) $(OBJ_FILES)
47 +DATA_DESTDIR=$(DESTDIR)/usr/share/anagramarama
48 +AUDIO_DESTDIR=$(DATA_DESTDIR)/audio
49 +IMAGES_DESTDIR=$(DATA_DESTDIR)/images
52 - $(CC) $(LFLAGS) -c -o $@ $^
53 +DATA_FILES=wordlist.txt
54 +AUDIO_FILES=badword.wav click-answer.wav clock-tick.wav found.wav shuffle.wav \
55 + clearword.wav click-shuffle.wav duplicate.wav foundbig.wav
56 +IMAGE_FILES=background.bmp numberBank.bmp letterBank.bmp smallLetterBank.bmp
58 -src/linked.o: src/linked.c
59 - $(CC) $(LFLAGS) -c -o $@ $^
61 -src/sprite.o: src/sprite.c
62 - $(CC) $(LFLAGS) -c -o $@ $^
63 +.PHONY: all clean install
68 - $(CC) $(LFLAGS) -c -o $@ $^
70 + $(CC) $(CFLAGS) $(CPPFLAGS) -o $(BIN) $(OBJ_FILES) $(LDLIBS)
74 + rm -f $(BIN) src/*.o
77 + mkdir -p $(DESTDIR)/usr/bin/
78 + install -m 755 anagramarama $(DESTDIR)/usr/bin
80 + mkdir -p $(DATA_DESTDIR)
81 + for i in $(DATA_FILES); do \
82 + install -m 644 $$i $(DATA_DESTDIR); \
85 + mkdir -p $(AUDIO_DESTDIR)
86 + for i in $(AUDIO_FILES); do \
87 + install -m 644 ./audio/$$i $(AUDIO_DESTDIR); \
90 + mkdir -p $(IMAGES_DESTDIR)
91 + for i in $(IMAGE_FILES); do \
92 + install -m 644 images/$$i $(IMAGES_DESTDIR); \
94 --- anagramarama/src/ag.c
95 +++ anagramarama/src/ag.c
97 ***********************************************************/
98 void bufferSounds(struct sound** soundCache){
100 - pushSound(&(*soundCache),"click-answer", "audio/click-answer.wav");
101 - pushSound(&(*soundCache),"click-shuffle", "audio/click-shuffle.wav");
102 - pushSound(&(*soundCache),"foundbig", "audio/foundbig.wav");
103 - pushSound(&(*soundCache),"found", "audio/found.wav");
104 - pushSound(&(*soundCache),"clear", "audio/clearword.wav");
105 - pushSound(&(*soundCache),"duplicate", "audio/duplicate.wav");
106 - pushSound(&(*soundCache),"badword", "audio/badword.wav");
107 - pushSound(&(*soundCache),"shuffle", "audio/shuffle.wav");
108 - pushSound(&(*soundCache),"clock-tick", "audio/clock-tick.wav");
109 + pushSound(&(*soundCache),"click-answer", AUDIO_DIR "/click-answer.wav");
110 + pushSound(&(*soundCache),"click-shuffle", AUDIO_DIR "/click-shuffle.wav");
111 + pushSound(&(*soundCache),"foundbig", AUDIO_DIR "/foundbig.wav");
112 + pushSound(&(*soundCache),"found", AUDIO_DIR "/found.wav");
113 + pushSound(&(*soundCache),"clear", AUDIO_DIR "/clearword.wav");
114 + pushSound(&(*soundCache),"duplicate", AUDIO_DIR "/duplicate.wav");
115 + pushSound(&(*soundCache),"badword", AUDIO_DIR "/badword.wav");
116 + pushSound(&(*soundCache),"shuffle", AUDIO_DIR "/shuffle.wav");
117 + pushSound(&(*soundCache),"clock-tick", AUDIO_DIR "audio/clock-tick.wav");
124 filelocation = rand()%10000;
125 - wordlist=fopen("wordlist.txt","r");
126 + wordlist=fopen(DATA_DIR "/wordlist.txt","r");
128 for (i=0;i<=filelocation;i++){
130 @@ -1485,7 +1485,7 @@
134 - ShowBMP("images/background.bmp",screen, 0,0);
135 + ShowBMP(IMAGES_DIR "/background.bmp",screen, 0,0);
137 destroyLetters(&(*letters));
139 @@ -1760,9 +1760,9 @@
140 createDLBTree(&dlbHead);
142 // cache in-game graphics
143 - letterBank = SDL_LoadBMP("images/letterBank.bmp");
144 - smallLetterBank = SDL_LoadBMP("images/smallLetterBank.bmp");
145 - numberBank = SDL_LoadBMP("images/numberBank.bmp");
146 + letterBank = SDL_LoadBMP(IMAGES_DIR "/letterBank.bmp");
147 + smallLetterBank = SDL_LoadBMP(IMAGES_DIR "/smallLetterBank.bmp");
148 + numberBank = SDL_LoadBMP(IMAGES_DIR "/numberBank.bmp");
150 rootWord = malloc(sizeof(char)*9);
151 newGame(&head, dlbHead, screen, &letters);
152 --- anagramarama/src/dlb.c
153 +++ anagramarama/src/dlb.c
155 //printf("createDLBTree\n");
157 // open wordlist file
158 - wordlist = fopen("wordlist.txt", "r");
159 + wordlist = fopen(DATA_DIR "/wordlist.txt", "r");
161 // get each word from the list
162 while (fscanf(wordlist, "%s", wordFromList) != EOF){