1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
--- fmodsoundfx.cpp
+++ fmodsoundfx.cpp
@@ -22,7 +22,7 @@
for( index=0; index<kNumSounds; index++ )
{
- sound[index] = FSOUND_Sample_Load( FSOUND_UNMANAGED, QuickResourceName( "snd", index+128, ".wav" ), FSOUND_NORMAL | FSOUND_LOOP_OFF | FSOUND_2D, 0 );
+ sound[index] = FSOUND_Sample_Load( FSOUND_UNMANAGED, QuickResourceName( "snd", index+128, ".wav" ), FSOUND_NORMAL | FSOUND_LOOP_OFF | FSOUND_2D, 0, 0 );
if( sound[index] == NULL )
{
Error( "InitSound: files are missing" );
--- main.cpp
+++ main.cpp
@@ -232,6 +232,7 @@
#include <string.h>
#include <stdlib.h>
+#include <unistd.h>
#include "hiscore.h"
#include "control.h"
@@ -283,6 +284,7 @@
int main(int argc, char *argv[])
{
argc, argv;
+ chdir(getenv("HOME"));
Initialize( );
if( IsRegistered( ) ) exit(0);
@@ -592,7 +594,7 @@
strcpy( candyCrisisResources, ":CandyCrisisResources:" );
#endif
#ifdef linux
- strcpy( candyCrisisResources, "CandyCrisisResources/" );
+ strcpy( candyCrisisResources, "@GENTOO_DATADIR@" );
#endif
if( SDL_Init( SDL_INIT_VIDEO | SDL_INIT_AUDIO ) < 0 )
@@ -626,7 +628,6 @@
}
#else
SDL_WM_IconifyWindow();
- ShellExecute( NULL, "open", url, "", "c:\\", SW_SHOWNORMAL );
WaitForRegainFocus();
#endif
}
@@ -703,7 +704,7 @@
void InitRegistration()
{
- playerIsRegistered = ValidateCode( registeredName, registeredKey );
+ playerIsRegistered = true;
}
--- Makefile
+++ Makefile
@@ -1,9 +1,10 @@
+CXX ?= g++
+CXXFLAGS ?= -O3
+CXXFLAGS += $(shell sdl-config --cflags)
+LIBS := $(shell sdl-config --libs) -lSDL_image -lfmod
-OPTIMIZE := -O3
-CXXFLAGS := $(shell sdl-config --cflags) -DHAVE_MIKMOD $(OPTIMIZE)
-LIBS := $(shell sdl-config --libs) -lSDL_image -lmikmod
-TARGET := CandyCrisis
+TARGET := candycrisis
OBJECTS := \
blitter.o \
@@ -18,7 +19,9 @@
keyselect.o \
level.o \
main.o \
- midi.o \
+ fmodsoundfx.o \
+ fmodmusic.o \
+ RegAlgorithm.o \
moving.o \
MTypes.o \
next.o \
@@ -36,7 +39,7 @@
zap.o
$(TARGET): $(OBJECTS)
- $(CXX) -o $@ $^ $(LIBS)
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) -o $(TARGET) $(LIBS)
clean:
$(RM) $(OBJECTS)
--- prefs.cpp
+++ prefs.cpp
@@ -37,7 +37,7 @@
int fileSize, count, digitsLeft;
unsigned char info, *infoAt, *dataAt, *fileData;
- F = fopen( QuickResourceName( "Preferences", 0, ".txt" ), "r" );
+ F = fopen( ".candycrisis", "r" );
if( F != NULL )
{
@@ -128,7 +128,7 @@
short count, size;
unsigned char* dataAt;
- F = fopen( QuickResourceName( "Preferences", 0, ".txt" ), "w" );
+ F = fopen( ".candycrisis", "w" );
if( F != NULL )
{
|