[SCM] game about viruses invading your computer branch, upstream, updated. upstream/1.03-1+dfsg1
Ansgar Burchardt
ansgar at 43-1.org
Sat Dec 3 13:03:04 UTC 2011
The following commit has been merged in the upstream branch:
commit 4e384a0e859858cab4dbbaca007af28123350025
Author: Ansgar Burchardt <ansgar at 43-1.org>
Date: Sat Apr 17 15:26:22 2010 +0900
Imported Upstream version 1.03-1+dfsg1
diff --git a/doc/README b/doc/README
index 07b40df..626ba9d 100644
--- a/doc/README
+++ b/doc/README
@@ -1,6 +1,6 @@
Virus Killer
-Version 0.1
+Version 0.9
LICENSE
@@ -14,13 +14,21 @@ INSTALLATION
make install command to move all the data and binaries to the correct locations. The default install
path for binaries and data is /usr/games and /usr/share/games/parallelrealities respectively.
+RUNNING
+
+ You can run Virus Killer by typing viruskiller from a terminal prompt or by using the menu items added
+ to Gnome and KDE desktops (this will all depend on how your system is set up). The game will automagically
+ search your user home directory for files.
+
+ For other OSes you may need to edit the config.txt file to tell the game where to find the initial search
+ directory. The game will only recurse down one directory level, so pick a good one!
PLAYING
- Please see manual.html for game instructions. This is installed to /usr/share/doc/viruskiller-0.1 by
+ Please see manual.html for game instructions. This is installed to /usr/share/doc/viruskiller-0.9 by
default.
-
-
+
+
FEEDBACK
If you have any trouble getting this game to build or run please drop me a line with a description of
diff --git a/doc/battery.png b/doc/battery.png
old mode 100755
new mode 100644
diff --git a/doc/bomb.png b/doc/bomb.png
old mode 100755
new mode 100644
diff --git a/doc/clock.png b/doc/clock.png
old mode 100755
new mode 100644
diff --git a/gfx/common/alienDevice.png b/gfx/common/alienDevice.png
old mode 100755
new mode 100644
diff --git a/gfx/dirs/blueDir.png b/gfx/dirs/blueDir.png
old mode 100755
new mode 100644
diff --git a/gfx/dirs/cdDir.png b/gfx/dirs/cdDir.png
old mode 100755
new mode 100644
diff --git a/gfx/dirs/greenDir.png b/gfx/dirs/greenDir.png
old mode 100755
new mode 100644
diff --git a/gfx/dirs/greyDir.png b/gfx/dirs/greyDir.png
old mode 100755
new mode 100644
diff --git a/gfx/dirs/htmlDir.png b/gfx/dirs/htmlDir.png
old mode 100755
new mode 100644
diff --git a/gfx/dirs/musicDir.png b/gfx/dirs/musicDir.png
old mode 100755
new mode 100644
diff --git a/gfx/dirs/penguinDir.png b/gfx/dirs/penguinDir.png
old mode 100755
new mode 100644
diff --git a/gfx/dirs/redDir.png b/gfx/dirs/redDir.png
old mode 100755
new mode 100644
diff --git a/gfx/dirs/soundDir.png b/gfx/dirs/soundDir.png
old mode 100755
new mode 100644
diff --git a/gfx/dirs/videoDir.png b/gfx/dirs/videoDir.png
old mode 100755
new mode 100644
diff --git a/gfx/dirs/violetDir.png b/gfx/dirs/violetDir.png
old mode 100755
new mode 100644
diff --git a/gfx/dirs/yellowDir.png b/gfx/dirs/yellowDir.png
old mode 100755
new mode 100644
diff --git a/gfx/fileTypes/binary.png b/gfx/fileTypes/binary.png
old mode 100755
new mode 100644
diff --git a/gfx/fileTypes/cdtrack.png b/gfx/fileTypes/cdtrack.png
old mode 100755
new mode 100644
diff --git a/gfx/fileTypes/html.png b/gfx/fileTypes/html.png
old mode 100755
new mode 100644
diff --git a/gfx/fileTypes/image.png b/gfx/fileTypes/image.png
old mode 100755
new mode 100644
diff --git a/gfx/fileTypes/message.png b/gfx/fileTypes/message.png
old mode 100755
new mode 100644
diff --git a/gfx/fileTypes/pdf.png b/gfx/fileTypes/pdf.png
old mode 100755
new mode 100644
diff --git a/gfx/fileTypes/quicktime.png b/gfx/fileTypes/quicktime.png
old mode 100755
new mode 100644
diff --git a/gfx/fileTypes/rpm.png b/gfx/fileTypes/rpm.png
old mode 100755
new mode 100644
diff --git a/gfx/fileTypes/soffice.png b/gfx/fileTypes/soffice.png
old mode 100755
new mode 100644
diff --git a/gfx/fileTypes/sound.png b/gfx/fileTypes/sound.png
old mode 100755
new mode 100644
diff --git a/gfx/fileTypes/source_c.png b/gfx/fileTypes/source_c.png
old mode 100755
new mode 100644
diff --git a/gfx/fileTypes/source_cpp.png b/gfx/fileTypes/source_cpp.png
old mode 100755
new mode 100644
diff --git a/gfx/fileTypes/source_f.png b/gfx/fileTypes/source_f.png
old mode 100755
new mode 100644
diff --git a/gfx/fileTypes/source_h.png b/gfx/fileTypes/source_h.png
old mode 100755
new mode 100644
diff --git a/gfx/fileTypes/source_java.png b/gfx/fileTypes/source_java.png
old mode 100755
new mode 100644
diff --git a/gfx/fileTypes/source_o.png b/gfx/fileTypes/source_o.png
old mode 100755
new mode 100644
diff --git a/gfx/fileTypes/tgz.png b/gfx/fileTypes/tgz.png
old mode 100755
new mode 100644
diff --git a/gfx/fileTypes/txt.png b/gfx/fileTypes/txt.png
old mode 100755
new mode 100644
diff --git a/gfx/fileTypes/video.png b/gfx/fileTypes/video.png
old mode 100755
new mode 100644
diff --git a/gfx/fileTypes/wordprocessing.png b/gfx/fileTypes/wordprocessing.png
old mode 100755
new mode 100644
diff --git a/gfx/main/alienDevice.png b/gfx/main/alienDevice.png
old mode 100755
new mode 100644
diff --git a/gfx/main/award_star_silver_3.png b/gfx/main/award_star_silver_3.png
new file mode 100644
index 0000000..d5ab1f9
Binary files /dev/null and b/gfx/main/award_star_silver_3.png differ
diff --git a/gfx/main/medal_bronze_1.png b/gfx/main/medal_bronze_1.png
new file mode 100644
index 0000000..8c2cdf5
Binary files /dev/null and b/gfx/main/medal_bronze_1.png differ
diff --git a/gfx/main/prlogo.gif b/gfx/main/prlogo.gif
old mode 100755
new mode 100644
diff --git a/gfx/main/ruby.png b/gfx/main/ruby.png
new file mode 100644
index 0000000..34f0342
Binary files /dev/null and b/gfx/main/ruby.png differ
diff --git a/gfx/main/shield.png b/gfx/main/shield.png
new file mode 100644
index 0000000..de6e2d9
Binary files /dev/null and b/gfx/main/shield.png differ
diff --git a/gfx/sprites/battery.png b/gfx/sprites/battery.png
old mode 100755
new mode 100644
diff --git a/gfx/sprites/bomb.png b/gfx/sprites/bomb.png
old mode 100755
new mode 100644
diff --git a/gfx/sprites/clock.png b/gfx/sprites/clock.png
old mode 100755
new mode 100644
diff --git a/icons/viruskiller.desktop b/icons/viruskiller.desktop
index b7390eb..0156098 100644
--- a/icons/viruskiller.desktop
+++ b/icons/viruskiller.desktop
@@ -4,6 +4,6 @@ Categories=Application;Game;ArcadeGame;
X-Desktop-File-Install-Version=1.0
Name=Virus Killer
Icon=viruskiller.png
-Exec=viruskiller
+Exec=/usr/games/viruskiller
Terminal=0
Type=Application
diff --git a/icons/viruskiller.ico b/icons/viruskiller.ico
new file mode 100644
index 0000000..2eec0cf
Binary files /dev/null and b/icons/viruskiller.ico differ
diff --git a/makefile b/makefile
old mode 100755
new mode 100644
index ce88cc1..72bb011
--- a/makefile
+++ b/makefile
@@ -3,23 +3,26 @@ PAKNAME = viruskiller.pak
DOCS = doc/*
ICONS = icons/
-VERSION = 1.0
+VERSION = 1.02
RELEASE = 1
USEPAK = 1
PREFIX=$(DESTDIR)/usr
BINDIR = $(PREFIX)/games/
-DATADIR = $(PREFIX)/share/games/parallelrealities/
-DOCDIR = $(PREFIX)/share/doc/$(PROG)-$(VERSION)-$(RELEASE)/
-ICONDIR = $(PREFIX)/share/icons/
-KDE = $(PREFIX)/share/applnk/Games/Arcade/
-GNOME = $(PREFIX)/share/gnome/apps/Games/
+DATADIR = $(PREFIX)/share/games/$(PROG)/
+DOCDIR = $(PREFIX)/share/doc/$(PROG)/
+ICONDIR = $(PREFIX)/share/icons/hicolor/
+DESKTOPDIR = $(PREFIX)/share/applications/
+MEDAL_SERVER_HOST = www.parallelrealities.co.uk
+#MEDAL_SERVER_HOST = localhost
+MEDAL_SERVER_PORT = 80
SAFEDIR = /tmp/
CFLAGS += `sdl-config --cflags` -DVERSION=$(VERSION) -DRELEASE=$(RELEASE) -DUSEPAK=$(USEPAK)
CFLAGS += -DPAKNAME=\"$(PAKNAME)\" -DPAKLOCATION=\"$(DATADIR)\" -DSAFEDIR=\"$(SAFEDIR)\" -DUNIX -DGAMEPLAYMANUAL=\"$(DOCDIR)manual.html\" -Wall
-LIBS = `sdl-config --libs` -lSDL_mixer -lSDL_image -lSDL_ttf
+CFLAGS += -DMEDAL_SERVER_HOST=\"$(MEDAL_SERVER_HOST)\" -DMEDAL_SERVER_PORT=$(MEDAL_SERVER_PORT)
+LIBS = `sdl-config --libs` -lSDL_mixer -lSDL_image -lSDL_ttf -lSDL_net
OBJS += CAudio.o
OBJS += CBase.o
@@ -31,7 +34,7 @@ OBJS += CGameData.o CGameObject.o CGraphics.o
OBJS += CHighScore.o
OBJS += CItem.o
OBJS += CList.o
-OBJS += CMath.o
+OBJS += CMath.o CMedalServer.o
OBJS += CPak.o CParticle.o
OBJS += CSprite.o
OBJS += CVirus.o
@@ -75,21 +78,30 @@ buildpak:
install:
./pak data gfx music sound $(PAKNAME)
+
mkdir -p $(BINDIR)
mkdir -p $(DATADIR)
mkdir -p $(DOCDIR)
- mkdir -p $(ICONDIR)
- mkdir -p $(ICONDIR)mini
- mkdir -p $(ICONDIR)large
- mkdir -p $(KDE)
- mkdir -p $(GNOME)
+ mkdir -p $(ICONDIR)16x16/apps
+ mkdir -p $(ICONDIR)32x32/apps
+ mkdir -p $(ICONDIR)64x64/apps
+ mkdir -p $(DESKTOPDIR)
- strip $(PROG)
install -o root -g games -m 755 $(PROG) $(BINDIR)$(PROG)
install -o root -g games -m 644 $(PAKNAME) $(DATADIR)$(PAKNAME)
- cp $(DOCS) $(DOCDIR)
- cp $(ICONS)$(PROG).png $(ICONDIR)
- cp $(ICONS)$(PROG)-mini.png $(ICONDIR)mini/$(PROG).png
- cp $(ICONS)$(PROG)-large.png $(ICONDIR)large/$(PROG).png
- cp $(ICONS)$(PROG).desktop $(KDE)
- cp $(ICONS)$(PROG).desktop $(GNOME)
+ install -o root -g games -m 644 $(DOCS) $(DOCDIR)
+ cp $(ICONS)$(PROG).png $(ICONDIR)32x32/apps/
+ cp $(ICONS)$(PROG)-mini.png $(ICONDIR)16x16/apps/$(PROG).png
+ cp $(ICONS)$(PROG)-large.png $(ICONDIR)64x64/apps/$(PROG).png
+ cp $(ICONS)$(PROG).desktop $(DESKTOPDIR)
+
+uninstall:
+ $(RM) $(BINDIR)$(PROG)
+ $(RM) $(DATADIR)$(PAKNAME)
+ $(RM) -r $(DOCDIR)
+ $(RM) $(ICONDIR)$(ICONS)$(PROG).png
+ $(RM) $(ICONDIR)16x16/apps/$(PROG).png
+ $(RM) $(ICONDIR)32x32/apps/$(PROG).png
+ $(RM) $(ICONDIR)64x64/apps/$(PROG).png
+ $(RM) $(DESKTOPDIR)$(PROG).desktop
+
\ No newline at end of file
diff --git a/makefile.windows b/makefile.windows
new file mode 100644
index 0000000..c269d4b
--- /dev/null
+++ b/makefile.windows
@@ -0,0 +1,81 @@
+PROG = viruskiller.exe
+PAKNAME = viruskiller.pak
+DOCS = doc/*
+ICONS = icons/
+
+VERSION = 1.02
+RELEASE = 1
+USEPAK = 1
+
+PREFIX=$(DESTDIR)/usr
+BINDIR = $(PREFIX)/games/
+DATADIR = $(PREFIX)/share/games/parallelrealities/
+DOCDIR = $(PREFIX)/share/doc/$(PROG)/
+ICONDIR = $(PREFIX)/share/icons/
+KDE = $(PREFIX)/share/applnk/Games/Arcade/
+GNOME = $(PREFIX)/share/gnome/apps/Games/
+MEDAL_SERVER_HOST = www.parallelrealities.co.uk
+MEDAL_SERVER_PORT = 80
+
+CXX=i586-mingw32msvc-g++
+SDLC=/home/steve/Windows/bin/sdl-config
+
+SAFEDIR = "c:/windows/system32"
+
+CXXFLAGS += `$(SDLC) --cflags` -DVERSION=$(VERSION) -DRELEASE=$(RELEASE) -DUSEPAK=$(USEPAK)
+CXXFLAGS += -DPAKNAME=\"$(PAKNAME)\" -DPAKLOCATION=\"\" -DGAMEPLAYMANUAL=\"doc/index.html\" -Wall
+CXXFLAGS += -DLOCALEDIR=\"\" $(CFLAGS) -DMEDAL_SERVER_HOST=\"$(MEDAL_SERVER_HOST)\" -DMEDAL_SERVER_PORT=$(MEDAL_SERVER_PORT) -pg -Werror
+CXXFLAGS += -DWINDOWS=1
+LIBS = `$(SDLC) --libs` -lintl -lz -lSDL_mixer -lSDL_image -lSDL_ttf -lSDL_net -pg -lSDLmain
+
+OBJS += CAudio.o
+OBJS += CBase.o
+OBJS += CCollision.o
+OBJS += CData.o CDirectory.o
+OBJS += CEngine.o
+OBJS += CFile.o CFileData.o
+OBJS += CGameData.o CGameObject.o CGraphics.o
+OBJS += CHighScore.o
+OBJS += CItem.o
+OBJS += CList.o
+OBJS += CMath.o CMedalServer.o
+OBJS += CPak.o CParticle.o
+OBJS += CSprite.o
+OBJS += CVirus.o
+OBJS += CWidget.o
+
+OBJS += filesAndDirectories.o
+OBJS += game.o
+OBJS += init.o items.o
+OBJS += highscores.o
+OBJS += main.o
+OBJS += particles.o
+OBJS += resources.o
+OBJS += title.o
+OBJS += viruses.o
+OBJS += widgets.o
+
+PAKOBJS = CFileData.o pak.o
+
+# top-level rule to create the program.
+all: $(PROG)
+
+# compiling other source files.
+%.o: src/%.cpp src/%.h src/defs.h src/defines.h src/headers.h
+ $(CXX) $(CXXFLAGS) -c $<
+
+# linking the program.
+$(PROG): $(OBJS)
+ $(CXX) $(OBJS) $(LIBS) -o $(PROG)
+
+pak: $(PAKOBJS)
+ $(CXX) $(PAKOBJS) $(LIBS) -o pak.exe
+
+# cleaning everything that can be automatically recreated with "make".
+clean:
+ $(RM) $(OBJS)
+
+buildpak:
+ ./pak data gfx music sound $(PAKNAME)
+
+
\ No newline at end of file
diff --git a/src/CAudio.cpp b/src/CAudio.cpp
index 6adc59b..04cbb74 100644
--- a/src/CAudio.cpp
+++ b/src/CAudio.cpp
@@ -54,7 +54,7 @@ void Audio::registerEngine(Engine *engine)
this->engine = engine;
}
-bool Audio::loadSound(int i, char *filename)
+bool Audio::loadSound(int i, const char *filename)
{
if (!engine->useAudio)
return true;
@@ -87,7 +87,7 @@ bool Audio::loadSound(int i, char *filename)
return true;
}
-bool Audio::loadMusic(char *filename)
+bool Audio::loadMusic(const char *filename)
{
char tempPath[PATH_MAX];
diff --git a/src/CAudio.h b/src/CAudio.h
index 556a1d2..dc47403 100644
--- a/src/CAudio.h
+++ b/src/CAudio.h
@@ -40,8 +40,8 @@ class Audio {
void setSoundVolume(int soundVolume);
void setMusicVolume(int musicVolume);
void registerEngine(Engine *engine);
- bool loadSound(int i, char *filename);
- bool loadMusic(char *filename);
+ bool loadSound(int i, const char *filename);
+ bool loadMusic(const char *filename);
void playSound(int snd, int channel);
void playSound(int snd, int channel, int loops);
void playMusic();
diff --git a/src/CData.cpp b/src/CData.cpp
index 5b492bb..1fa7e75 100644
--- a/src/CData.cpp
+++ b/src/CData.cpp
@@ -32,7 +32,7 @@ Data::~Data()
destroy();
}
-void Data::set(char *key, char *value, bool complete)
+void Data::set(const char *key, const char *value, bool complete)
{
if ((strlen(key) > 50) || (strlen(value) > 50))
{
diff --git a/src/CData.h b/src/CData.h
index 2886b0a..0b00a55 100644
--- a/src/CData.h
+++ b/src/CData.h
@@ -28,7 +28,7 @@ class Data : public GameObject{
Data();
virtual ~Data();
- void set(char *key, char *value, bool complete);
+ void set(const char *key, const char *value, bool complete);
void destroy();
};
diff --git a/src/CEngine.cpp b/src/CEngine.cpp
index 20214ec..b02305a 100644
--- a/src/CEngine.cpp
+++ b/src/CEngine.cpp
@@ -24,7 +24,7 @@ Engine::Engine()
{
for (int i = 0 ; i < 350 ; i++)
keyState[i] = 0;
-
+
strcpy(lastInput, "");
// Mouse stuff
@@ -33,11 +33,7 @@ Engine::Engine()
strcpy(lastKeyPressed, "");
- #if USEPAK
- fullScreen = 1;
- #else
- fullScreen = 0;
- #endif
+ fullScreen = 0;
useAudio = 2;
@@ -52,11 +48,11 @@ Engine::Engine()
// Timer
time1 = time2 = 0;
timeDifference = 0;
-
+
pak.setPakFile(PAKFULLPATH);
-
+
defineList.clear();
-
+
allowQuit = false;
}
@@ -252,7 +248,7 @@ void Engine::clearInput()
mouseWheelUp = mouseWheelDown = 0;
}
-void Engine::setUserHome(char *path)
+void Engine::setUserHome(const char *path)
{
strcpy(userHomeDirectory, path);
debug(("User Home = %s\n", path));
@@ -264,7 +260,7 @@ it is found, the data is read into a character buffer.
In the case of music, the data music be written to a temporary directory
since SDL currently provides no means to load music directly from memory
*/
-bool Engine::unpack(char *filename, int fileType)
+bool Engine::unpack(const char *filename, int fileType)
{
if (fileType == PAK_DATA)
{
@@ -309,7 +305,7 @@ bool Engine::unpack(char *filename, int fileType)
if ((fileType == PAK_MUSIC) || (fileType == PAK_FONT))
{
char tempPath[PATH_MAX];
-
+
FILE *fp = NULL;
if (fileType == PAK_MUSIC)
@@ -338,14 +334,14 @@ bool Engine::unpack(char *filename, int fileType)
return true;
}
-bool Engine::loadData(char *filename)
+bool Engine::loadData(const char *filename)
{
if (dataBuffer != NULL)
{
delete[] dataBuffer;
dataBuffer = NULL;
}
-
+
#if USEPAK
return unpack(filename, PAK_DATA);
#endif
@@ -388,12 +384,12 @@ void Engine::freeLocaleInfo()
localeList.clear();
}
-bool Engine::getLocaleInformation(char *section)
+bool Engine::getLocaleInformation(const char *section)
{
return true;
}
-char *Engine::translate(char *key)
+const char *Engine::translate(const char *key)
{
if (strcmp(language, "en") == 0)
return key;
@@ -445,7 +441,7 @@ void Engine::addWidget(Widget *widget)
widgetList.add(widget);
}
-bool Engine::loadWidgets(char *filename)
+bool Engine::loadWidgets(const char *filename)
{
deleteWidgets();
@@ -506,7 +502,7 @@ bool Engine::loadWidgets(char *filename)
return true;
}
-Widget *Engine::getWidgetByName(char *name)
+Widget *Engine::getWidgetByName(const char *name)
{
Widget *widget = (Widget*)widgetList.getHead();
@@ -523,7 +519,7 @@ Widget *Engine::getWidgetByName(char *name)
return NULL;
}
-void Engine::showWidgetGroup(char *groupName, bool show)
+void Engine::showWidgetGroup(const char *groupName, bool show)
{
bool found = false;
@@ -545,7 +541,7 @@ void Engine::showWidgetGroup(char *groupName, bool show)
debug(("Group '%s' does not exist\n", groupName));
}
-void Engine::enableWidgetGroup(char *groupName, bool show)
+void Engine::enableWidgetGroup(const char *groupName, bool show)
{
bool found = false;
@@ -567,7 +563,7 @@ void Engine::enableWidgetGroup(char *groupName, bool show)
debug(("Group '%s' does not exist\n", groupName));
}
-void Engine::showWidget(char *name, bool show)
+void Engine::showWidget(const char *name, bool show)
{
Widget *widget = getWidgetByName(name);
if (widget != NULL)
@@ -577,7 +573,7 @@ void Engine::showWidget(char *name, bool show)
}
}
-void Engine::enableWidget(char *name, bool enable)
+void Engine::enableWidget(const char *name, bool enable)
{
Widget *widget = getWidgetByName(name);
if (widget != NULL)
@@ -587,21 +583,21 @@ void Engine::enableWidget(char *name, bool enable)
}
}
-void Engine::setWidgetVariable(char *name, int *variable)
+void Engine::setWidgetVariable(const char *name, int *variable)
{
Widget *widget = getWidgetByName(name);
if (widget != NULL)
widget->setValue(variable);
}
-void Engine::setWidgetVariable(char *name, char *variable)
+void Engine::setWidgetVariable(const char *name, const char *variable)
{
//Widget *widget = getWidgetByName(name);
//if (widget != NULL)
//widget->setValue(variable);
}
-bool Engine::widgetChanged(char *name)
+bool Engine::widgetChanged(const char *name)
{
Widget *widget = getWidgetByName(name);
if (widget != NULL)
@@ -681,7 +677,7 @@ void Engine::highlightWidget(int dir)
highlightedWidget->redraw();
}
-void Engine::highlightWidget(char *name)
+void Engine::highlightWidget(const char *name)
{
highlightedWidget = getWidgetByName(name);
}
@@ -689,7 +685,7 @@ void Engine::highlightWidget(char *name)
int Engine::processWidgets()
{
int update = 0;
-
+
if (highlightedWidget->changed)
return 3;
@@ -761,13 +757,13 @@ int Engine::processWidgets()
highlightedWidget->changed = true;
}
}
-
+
update = 2;
flushInput();
clearInput();
}
-
+
if (keyState[SDLK_TAB])
{
if (highlightedWidget->type == WG_INPUT)
@@ -811,7 +807,7 @@ bool Engine::loadDefines()
defineList.add(data);
}
}
-
+
return true;
}
@@ -822,7 +818,7 @@ traverse the list and return 1 when it encounters ACTIVE. This has two advantage
the code, I don't have to change all the data entries too. You probably already
thought of that though... :)
*/
-int Engine::getValueOfDefine(char *word)
+int Engine::getValueOfDefine(const char *word)
{
int rtn = 0;
@@ -844,7 +840,7 @@ int Engine::getValueOfDefine(char *word)
exit(1);
}
-char *Engine::getProperty(char *word)
+char *Engine::getProperty(const char *word)
{
Data *data = (Data*)defineList.getHead();
@@ -856,13 +852,13 @@ char *Engine::getProperty(char *word)
return data->value;
}
- debug(("getProperty() : %s is not defined!\n", word));
-
+ //debug(("getProperty() : %s is not defined!\n", word));
+
return NULL;
}
#if !UNIX
-char *strtok_r(char *in, char *delim, char **nextPos)
+char *strtok_r(char *in, const char *delim, char **nextPos)
{
char* rtnBuf;
char* testChar;
@@ -924,7 +920,7 @@ the function above, delimited with plus signs. So ENT_FLIES+ENT_AIMS. It then wo
flags (in a bit of a half arsed manner because of my lazy (2 << 25) declarations, adds all
the values together and then returns them... phew! Makes data files human readable though :)
*/
-int Engine::getValueOfFlagTokens(char *realLine)
+int Engine::getValueOfFlagTokens(const char *realLine)
{
if (strcmp(realLine, "0") == 0)
return 0;
@@ -972,7 +968,7 @@ int Engine::getValueOfFlagTokens(char *realLine)
break;
}
}
-
+
if (!found)
{
printf("getValueOfFlagTokens() : Illegal Token %s\n", word);
diff --git a/src/CEngine.h b/src/CEngine.h
index bdc1128..c9f3aee 100644
--- a/src/CEngine.h
+++ b/src/CEngine.h
@@ -80,40 +80,40 @@ class Engine {
void addKeyEvent();
void flushInput();
void clearInput();
- void setUserHome(char *path);
- bool unpack(char *filename, int fileType);
- bool loadData(char *filename);
+ void setUserHome(const char *path);
+ bool unpack(const char *filename, int fileType);
+ bool loadData(const char *filename);
void reportFontFailure();
- void setLocale(char *language);
- void setLocaleTranslationPath(char *path);
+ void setLocale(const char *language);
+ void setLocaleTranslationPath(const char *path);
void freeLocaleInfo();
- bool getLocaleInformation(char *section);
- char *translate(char *key);
+ bool getLocaleInformation(const char *section);
+ const char *translate(const char *key);
void setPlayerPosition(int x, int y, int limitLeft, int limitRight, int limitUp, int limitDown);
int getFrameLoop();
void doFrameLoop();
void doTimeDifference();
float getTimeDifference();
void resetTimeDifference();
- void setInfoMessage(char *message, int priority, int type);
+ void setInfoMessage(const char *message, int priority, int type);
void deleteWidgets();
void addWidget(Widget *widget);
- bool loadWidgets(char *filename);
- Widget *getWidgetByName(char *name);
- void showWidgetGroup(char *groupName, bool show);
- void enableWidgetGroup(char *groupName, bool show);
- void showWidget(char *name, bool show);
- void enableWidget(char *name, bool enable);
- void setWidgetVariable(char *name, int *variable);
- void setWidgetVariable(char *name, char *variable);
- bool widgetChanged(char *name);
+ bool loadWidgets(const char *filename);
+ Widget *getWidgetByName(const char *name);
+ void showWidgetGroup(const char *groupName, bool show);
+ void enableWidgetGroup(const char *groupName, bool show);
+ void showWidget(const char *name, bool show);
+ void enableWidget(const char *name, bool enable);
+ void setWidgetVariable(const char *name, int *variable);
+ void setWidgetVariable(const char *name, const char *variable);
+ bool widgetChanged(const char *name);
void highlightNextInputWidget();
void highlightWidget(int dir);
- void highlightWidget(char *name);
+ void highlightWidget(const char *name);
int processWidgets();
bool loadDefines();
- int getValueOfDefine(char *word);
- char *getProperty(char *word);
- int getValueOfFlagTokens(char *line);
+ int getValueOfDefine(const char *word);
+ char *getProperty(const char *word);
+ int getValueOfFlagTokens(const char *line);
};
diff --git a/src/CGameData.cpp b/src/CGameData.cpp
index 5066d37..73ef13f 100644
--- a/src/CGameData.cpp
+++ b/src/CGameData.cpp
@@ -30,6 +30,10 @@ GameData::GameData()
strcpy(directorySearchPath, "/home");
+ #if !UNIX
+ strcpy(directorySearchPath, getenv("PROGRAMFILES"));
+ #endif
+
maxDirectories = 0;
maxFiles = 0;
score = 0;
@@ -73,7 +77,7 @@ void GameData::clear()
score = 0;
activeViruses = 0;
level = 1;
-
+
virusesKilled = 0;
roundVirusesKilled = 0;
@@ -85,22 +89,22 @@ void GameData::clear()
biggestChain = 0;
roundBiggestChain = 0;
-
+
lastVirusKilled = 0;
-
+
kernelPower = 300;
-
+
threadStopTimer = 0;
threadStops = 0;
for (int x = 0 ; x < 5 ; x++)
for (int y = 0 ; y < 5 ; y++)
map[x][y] = 0;
-
+
virusList.clear();
particleList.clear();
itemList.clear();
-
+
Directory *dir = (Directory*)directoryList.getHead();
while (dir->next != NULL)
@@ -125,7 +129,7 @@ void GameData::resetForNextRound()
base[i].place();
kernelPower = 300;
-
+
itemList.clear();
}
@@ -137,7 +141,7 @@ void GameData::destroy()
itemList.clear();
}
-Directory *GameData::addDirectory(char *name)
+Directory *GameData::addDirectory(const char *name)
{
char string[1024];
char *realName, *previousName;
@@ -237,7 +241,7 @@ void GameData::buildActiveDirList(int amount)
{
int sanity = 0;
int i = 0;
-
+
Directory *dir = (Directory*)directoryList.getHead();
while (true)
@@ -252,9 +256,9 @@ void GameData::buildActiveDirList(int amount)
if (i == amount)
break;
}
-
+
sanity++;
-
+
if (sanity == 10000)
{
printf("Made 10,000 unsuccessful attempts to grab %d inactives directories!!\n", amount);
diff --git a/src/CGameData.h b/src/CGameData.h
index 2646656..dfd9de7 100644
--- a/src/CGameData.h
+++ b/src/CGameData.h
@@ -81,7 +81,7 @@ class GameData {
void resetForNextRound();
void destroy();
- Directory *addDirectory(char *name);
+ Directory *addDirectory(const char *name);
void addVirus(Virus *virus);
void addParticle(Particle *particle);
void addItem(Item *item);
diff --git a/src/CGraphics.cpp b/src/CGraphics.cpp
index 83ae246..8bfde6c 100644
--- a/src/CGraphics.cpp
+++ b/src/CGraphics.cpp
@@ -66,6 +66,20 @@ void Graphics::destroy()
for (int i = 0 ; i < 100 ; i++)
if (tile[i] != NULL)
SDL_FreeSurface(tile[i]);
+
+ if (medalMessage != NULL)
+ {
+ SDL_FreeSurface(medalMessage);
+ }
+
+ for (int i = 0 ; i < 4 ; i++)
+ {
+ if (medal[i] != NULL)
+ {
+ SDL_FreeSurface(medal[i]);
+ medal[i] = NULL;
+ }
+ }
}
void Graphics::mapColors()
@@ -108,8 +122,26 @@ void Graphics::setTransparent(SDL_Surface *sprite)
SDL_SetColorKey(sprite, (SDL_SRCCOLORKEY|SDL_RLEACCEL), SDL_MapRGB(sprite->format, 0, 0, 0));
}
+bool Graphics::canShowMedalMessage()
+{
+ return (medalMessageTimer <= 0);
+}
+
void Graphics::updateScreen()
{
+ if (medalMessageTimer > 0)
+ {
+ medalMessageTimer -= engine->getTimeDifference();
+ drawRect(screen->w - (medalMessage->w + 5 + 18), 5, medalMessage->w + 16, 20, grey, screen);
+ drawRect(screen->w - (medalMessage->w + 5 + 17), 6, medalMessage->w + 14, 18, black, screen);
+ blit(medalMessage, screen->w - (medalMessage->w + 5), 7, screen, false);
+
+ if (medalType >= 0)
+ {
+ blit(medal[medalType], screen->w - (medalMessage->w + 5 + 16), 7, screen, false);
+ }
+ }
+
SDL_Flip(screen);
animateSprites();
SDL_Delay((int)engine->getTimeDifference());
@@ -248,7 +280,7 @@ void Graphics::HSVtoRGB(float *r, float *g, float *b, float h, float s, float v)
}
}
-SDL_Surface *Graphics::loadImage(char *filename)
+SDL_Surface *Graphics::loadImage(const char *filename)
{
SDL_Surface *image, *newImage;
@@ -280,7 +312,7 @@ SDL_Surface *Graphics::loadImage(char *filename)
return newImage;
}
-SDL_Surface *Graphics::loadImage(char *filename, int hue, int sat, int value)
+SDL_Surface *Graphics::loadImage(const char *filename, int hue, int sat, int value)
{
SDL_Surface *image, *newImage;
@@ -350,7 +382,7 @@ SDL_Surface *Graphics::loadImage(char *filename, int hue, int sat, int value)
return newImage;
}
-SDL_Surface *Graphics::quickSprite(char *name, SDL_Surface *image)
+SDL_Surface *Graphics::quickSprite(const char *name, SDL_Surface *image)
{
Sprite *sprite = addSprite(name);
sprite->setFrame(0, image, 60);
@@ -383,7 +415,7 @@ If a user has a resolution other than approximately 72dpi then
they will get a small or larger font and this won't work. This might look
weird since we'll load and delete multiple fonts, but it works...
*/
-void Graphics::loadFont(int i, char *filename, int pixelSize)
+void Graphics::loadFont(int i, const char *filename, int pixelSize)
{
int minx, maxx, miny, maxy, advance;
@@ -456,7 +488,7 @@ void Graphics::loadFont(int i, char *filename, int pixelSize)
debug(("Got a match for font size %d - Nearest = %d\n", pixelSize, maxx));
}
-Sprite *Graphics::addSprite(char *name)
+Sprite *Graphics::addSprite(const char *name)
{
Sprite *sprite = new Sprite;
strcpy(sprite->name, name);
@@ -467,7 +499,7 @@ Sprite *Graphics::addSprite(char *name)
return sprite;
}
-Sprite *Graphics::getSprite(char *name, bool required)
+Sprite *Graphics::getSprite(const char *name, bool required)
{
Sprite *sprite = spriteHead;
@@ -497,7 +529,7 @@ void Graphics::animateSprites()
}
}
-void Graphics::loadBackground(char *filename)
+void Graphics::loadBackground(const char *filename)
{
if (background != NULL)
{
@@ -633,6 +665,50 @@ void Graphics::blit(SDL_Surface *image, int x, int y, SDL_Surface *dest, bool ce
showErrorAndExit("graphics::blit() - %s", SDL_GetError());
}
+void Graphics::showMedalMessage(int type, const char *in)
+{
+ if (medalMessage != NULL)
+ {
+ SDL_FreeSurface(medalMessage);
+ }
+
+ setFontSize(0);
+
+ switch (type)
+ {
+ // Bronze
+ case 1:
+ setFontColor(0xA6, 0x7D, 0x3D, 0x00, 0x00, 0x00);
+ break;
+
+ // Silver
+ case 2:
+ setFontColor(0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00);
+ break;
+
+ // Gold
+ case 3:
+ setFontColor(0xFF, 0xCC, 0x33, 0x00, 0x00, 0x00);
+ break;
+
+ // Ruby
+ case 4:
+ setFontColor(0xFF, 0x11, 0x55, 0x00, 0x00, 0x00);
+ break;
+ }
+
+ medalType = type - 1; // for indexing on the image
+ if (type != -1)
+ {
+ medalMessage = getString(true, " Medal Earned - %s ", in);
+ }
+ else
+ {
+ medalMessage = getString(true, " %s ", in);
+ }
+ medalMessageTimer = (5 * 60);
+}
+
void Graphics::drawBackground()
{
if (background != NULL)
@@ -687,7 +763,7 @@ void Graphics::setFontSize(int size)
Math::limitInt(&fontSize, 0, 4);
}
-SDL_Surface *Graphics::getString(bool transparent, char *in, ...)
+SDL_Surface *Graphics::getString(bool transparent, const char *in, ...)
{
va_list argp;
va_start(argp, in);
@@ -708,7 +784,7 @@ SDL_Surface *Graphics::getString(bool transparent, char *in, ...)
return text;
}
-void Graphics::drawString(int x, int y, int alignment, SDL_Surface *dest, char *in, ...)
+void Graphics::drawString(int x, int y, int alignment, SDL_Surface *dest, const char *in, ...)
{
va_list argp;
va_start(argp, in);
@@ -784,7 +860,7 @@ SDL_Surface *Graphics::alphaRect(int width, int height, Uint8 red, Uint8 green,
SDL_FillRect(surface, NULL, SDL_MapRGB(surface->format, red, green, blue));
- SDL_SetAlpha(surface, SDL_SRCALPHA|SDL_RLEACCEL, 128);
+ SDL_SetAlpha(surface, SDL_SRCALPHA|SDL_RLEACCEL, 130);
return surface;
}
@@ -818,7 +894,7 @@ void Graphics::unlock(SDL_Surface *surface)
}
}
-void Graphics::showErrorAndExit(char *error, char *param)
+void Graphics::showErrorAndExit(const char *error, const char *param)
{
clearScreen(black);
diff --git a/src/CGraphics.h b/src/CGraphics.h
index dfb5885..cea237e 100644
--- a/src/CGraphics.h
+++ b/src/CGraphics.h
@@ -39,6 +39,10 @@ class Graphics {
char screenshot[100];
char textstring[256];
+
+ SDL_Surface *medalMessage;
+ float medalMessageTimer;
+ int medalType;
public:
@@ -46,6 +50,8 @@ class Graphics {
SDL_Surface *screen, *background, *infoBar;
SDL_Surface *tile[100];
+
+ SDL_Surface *medal[4];
int red, yellow, skyBlue, blue, cyan, white, lightGrey, grey, darkGrey, black;
int lightestGreen, lightGreen, green, darkGreen, darkestGreen;
@@ -57,35 +63,37 @@ class Graphics {
Sprite *getSpriteHead();
void setTransparent(SDL_Surface *sprite);
void updateScreen();
+ bool canShowMedalMessage();
void delay(int time);
void clearScreen(int color);
void RGBtoHSV(float r, float g, float b, float *h, float *s, float *v);
void HSVtoRGB(float *r, float *g, float *b, float h, float s, float v);
- SDL_Surface *loadImage(char *filename);
- SDL_Surface *loadImage(char *filename, int hue, int sat, int value);
- SDL_Surface *quickSprite(char *name, SDL_Surface *image);
+ SDL_Surface *loadImage(const char *filename);
+ SDL_Surface *loadImage(const char *filename, int hue, int sat, int value);
+ SDL_Surface *quickSprite(const char *name, SDL_Surface *image);
void fade(int amount);
void fadeToBlack();
- void loadMapTiles(char *baseDir);
- void loadFont(int i, char *filename, int pointSize);
- Sprite *addSprite(char *name);
- Sprite *getSprite(char *name, bool required);
+ void loadMapTiles(const char *baseDir);
+ void loadFont(int i, const char *filename, int pointSize);
+ Sprite *addSprite(const char *name);
+ Sprite *getSprite(const char *name, bool required);
void animateSprites();
- void loadBackground(char *filename);
+ void loadBackground(const char *filename);
void putPixel(int x, int y, Uint32 pixel, SDL_Surface *dest);
Uint32 getPixel(SDL_Surface *surface, int x, int y);
void drawLine(float startX, float startY, float endX, float endY, int color, SDL_Surface *dest);
void blit(SDL_Surface *image, int x, int y, SDL_Surface *dest, bool centered);
+ void showMedalMessage(int type, const char *in);
void drawBackground();
void drawBackground(SDL_Rect *r);
void drawRect(int x, int y, int w, int h, int color, SDL_Surface *dest);
void drawRect(int x, int y, int w, int h, int color, int borderColor, SDL_Surface *dest);
void setFontColor(int red, int green, int blue, int red2, int green2, int blue2);
void setFontSize(int size);
- SDL_Surface *getString(bool transparent, char *in, ...);
- void drawString(int x, int y, int alignment, SDL_Surface *dest, char *in, ...);
+ SDL_Surface *getString(bool transparent, const char *in, ...);
+ void drawString(int x, int y, int alignment, SDL_Surface *dest, const char *in, ...);
void clearChatString();
- void createChatString(char *in);
+ void createChatString(const char *in);
void drawChatString();
void drawWidgetRect(int x, int y, int w, int h);
SDL_Surface *createSurface(int width, int height);
@@ -95,7 +103,7 @@ class Graphics {
void unlock(SDL_Surface *surface);
void resetLoading();
void showLoading(int amount, int max);
- void showErrorAndExit(char *error, char *param);
+ void showErrorAndExit(const char *error, const char *param);
const void registerEngine(Engine *engine)
{
diff --git a/src/CHighScore.cpp b/src/CHighScore.cpp
index 803eac4..196ef4c 100644
--- a/src/CHighScore.cpp
+++ b/src/CHighScore.cpp
@@ -28,7 +28,7 @@ HighScore::HighScore()
level = 0;
}
-void HighScore::set(char *name, int score, int kills, int level)
+void HighScore::set(const char *name, int score, int kills, int level)
{
strcpy(this->name, name);
this->score = score;
diff --git a/src/CHighScore.h b/src/CHighScore.h
index a120ce6..7b8aa7a 100644
--- a/src/CHighScore.h
+++ b/src/CHighScore.h
@@ -28,6 +28,6 @@ class HighScore {
unsigned int level;
HighScore();
- void set(char *name, int score, int kills, int level);
+ void set(const char *name, int score, int kills, int level);
};
diff --git a/src/CMath.cpp b/src/CMath.cpp
index a42c7cb..7650340 100644
--- a/src/CMath.cpp
+++ b/src/CMath.cpp
@@ -104,7 +104,7 @@ int Math::rrand(int min, int max)
return r;
}
-bool Math::boolFromWord(char *word)
+bool Math::boolFromWord(const char *word)
{
if (strcmp(word, "TRUE") == 0)
return true;
diff --git a/src/CMath.h b/src/CMath.h
index faac280..9916ab9 100644
--- a/src/CMath.h
+++ b/src/CMath.h
@@ -40,7 +40,7 @@ class Math {
static int rrand(int min, int max);
- static bool boolFromWord(char *word);
+ static bool boolFromWord(const char *word);
static void addBit(unsigned int *currentBits, int newBits);
static void removeBit(unsigned int *currentBits, int oldBits);
diff --git a/src/CMedalServer.cpp b/src/CMedalServer.cpp
new file mode 100644
index 0000000..27a795e
--- /dev/null
+++ b/src/CMedalServer.cpp
@@ -0,0 +1,169 @@
+/*
+Copyright (C) 2010 Parallel Realities
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
+#include "headers.h"
+#include "SDL/SDL_mutex.h"
+
+MedalServer::MedalServer()
+{
+ lock = SDL_CreateMutex();
+
+ connected = false;
+ gotRuby = false;
+
+ strcpy(message, "");
+ strcpy(rubyMessage, "");
+}
+
+MedalServer::~MedalServer()
+{
+ if (connected)
+ {
+ close();
+ }
+}
+
+bool MedalServer::connect(const char *privateKey)
+{
+ if (SDLNet_ResolveHost(&ip, MEDAL_SERVER_HOST, MEDAL_SERVER_PORT) == -1)
+ {
+ printf("ERROR: SDLNet_ResolveHost: %s\n", SDLNet_GetError());
+ return false;
+ }
+
+ debug(("Connected %s to %s:%d\n", privateKey, MEDAL_SERVER_HOST, MEDAL_SERVER_PORT));
+
+ strcpy(this->privateKey, privateKey);
+ connected = true;
+
+ return true;
+}
+
+#if !UNIX
+extern char *strtok_r(char *s1, const char *s2, char **lasts);
+#endif
+
+int MedalServer::postMedal(const char *str)
+{
+ if (!connected)
+ {
+ return 0;
+ }
+
+ char *store;
+
+ char medal[128];
+ strcpy(medal, str);
+
+ for (unsigned int i = 0 ; i < strlen(medal) ; i++)
+ {
+ if (medal[i] == ' ' || medal[i] == '#' || medal[i] == ',')
+ {
+ medal[i] = '_';
+ }
+ }
+
+ debug(("Attempting to post medal '%s'\n", medal));
+
+ TCPsocket socket = SDLNet_TCP_Open(&ip);
+
+ if (!socket)
+ {
+ printf("ERROR: SDLNet_TCP_Open: %s\n", SDLNet_GetError());
+ return 0;
+ }
+
+ char *in = new char[1024];
+ char out[1024];
+
+ sprintf(out, "GET /addMedal/%s/%s HTTP/1.1\nHost: %s\nUser-Agent:VK%.2f-%d\n\n", privateKey, medal, MEDAL_SERVER_HOST, VERSION, RELEASE);
+
+ //printf("%s\n", out);
+
+ int len = strlen(out) + 1;
+
+ if (SDLNet_TCP_Send(socket, (void*)out, len) < len)
+ {
+ printf("SDLNet_TCP_Send: %s\n", SDLNet_GetError());
+ printf("Disconnected\n");
+ SDLNet_TCP_Close(socket);
+ close();
+ return 0;
+ }
+
+ SDLNet_TCP_Recv(socket, in, 512);
+
+ //printf("%s\n", in);
+
+ int response = 0;
+ char *token = strtok_r(in, "\n", &store);
+
+ while (token != NULL)
+ {
+ if (strstr(token, "MEDAL_RESPONSE"))
+ {
+ sscanf(token, "%*s %d %[^\n\r]", &response, message);
+
+ if (response == 4)
+ {
+ strcpy(rubyMessage, message);
+ gotRuby = true;
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ token = strtok_r(NULL, "\n", &store);
+ }
+
+ debug(("MedalServer Response: %d '%s'\n", response, message))
+
+ delete in;
+
+ SDLNet_TCP_Close(socket);
+
+ return response;
+}
+
+const char *MedalServer::getMessage()
+{
+ return message;
+}
+
+bool MedalServer::hasRuby()
+{
+ return gotRuby;
+}
+
+const char *MedalServer::getRubyMessage()
+{
+ gotRuby = false;
+
+ return rubyMessage;
+}
+
+void MedalServer::close()
+{
+ connected = false;
+
+ SDL_DestroyMutex(lock);
+}
diff --git a/src/CPak.h b/src/CMedalServer.h
similarity index 62%
copy from src/CPak.h
copy to src/CMedalServer.h
index 7723786..d859da0 100644
--- a/src/CPak.h
+++ b/src/CMedalServer.h
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2004 Parallel Realities
+Copyright (C) 2010 Parallel Realities
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -18,30 +18,34 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-class Pak {
+class MedalServer {
private:
-
- Uint32 numberOfFiles;
- Uint32 listPos;
- Bytef *input;
- FileData *fd;
- FileData *currentFile;
-
- char pakFilename[1024];
-
- char filename[60];
+ char privateKey[20];
+ char message[128];
+ char rubyMessage[128];
+
+ bool connected;
+ bool gotRuby;
+
+ IPaddress ip;
- void showPakErrorAndExit();
-
public:
-
- Pak();
- ~Pak();
- void setPakFile(char *pakFilename);
- bool unpack(char *filename, unsigned char **buffer);
- bool fileExists(char *filename);
- unsigned int getUncompressedSize();
+
+ MedalServer();
+ ~MedalServer();
+
+ SDL_mutex *lock;
+
+ bool connect(const char *privateKey);
+
+ int postMedal(const char *medal);
+ bool hasRuby();
+
+ const char *getMessage();
+ const char *getRubyMessage();
+
+ void close();
};
diff --git a/src/CPak.cpp b/src/CPak.cpp
index c088759..e196610 100644
--- a/src/CPak.cpp
+++ b/src/CPak.cpp
@@ -48,17 +48,17 @@ Pak::~Pak()
void Pak::showPakErrorAndExit()
{
- printf("\nFatal Error: The Blob Wars PAK file was either not found or was not accessable.\n");
+ printf("\nFatal Error: The Virus Killer PAK file was either not found or was not accessable.\n");
printf("(If you compiled from source did you forget to run make install?)\n");
printf("The path to the file was expected to be,\n\n");
printf(PAKFULLPATH"\n\n");
printf("Please try running the game again. If problems persist either reinstall the game or check,\n\n");
- printf("http://www.parallelrealities.co.uk/blobWars.php\n\n");
+ printf("http://www.parallelrealities.co.uk/projects/virusKiller.php\n\n");
printf("for updates.\n\n");
exit(1);
}
-void Pak::setPakFile(char *pakFilename)
+void Pak::setPakFile(const char *pakFilename)
{
#if USEPAK
strcpy(this->pakFilename, pakFilename);
@@ -103,7 +103,7 @@ void Pak::setPakFile(char *pakFilename)
#endif
}
-bool Pak::unpack(char *filename, unsigned char **buffer)
+bool Pak::unpack(const char *filename, unsigned char **buffer)
{
debug(("Pak : Unpacking %s...\n", filename));
@@ -160,7 +160,7 @@ bool Pak::unpack(char *filename, unsigned char **buffer)
return true;
}
-bool Pak::fileExists(char *filename)
+bool Pak::fileExists(const char *filename)
{
unsigned int hashcode = 0;
unsigned int length = strlen(filename);
diff --git a/src/CPak.h b/src/CPak.h
index 7723786..7c8c547 100644
--- a/src/CPak.h
+++ b/src/CPak.h
@@ -39,9 +39,9 @@ class Pak {
Pak();
~Pak();
- void setPakFile(char *pakFilename);
- bool unpack(char *filename, unsigned char **buffer);
- bool fileExists(char *filename);
+ void setPakFile(const char *pakFilename);
+ bool unpack(const char *filename, unsigned char **buffer);
+ bool fileExists(const char *filename);
unsigned int getUncompressedSize();
};
diff --git a/src/CVirus.cpp b/src/CVirus.cpp
index 869528b..80eb225 100644
--- a/src/CVirus.cpp
+++ b/src/CVirus.cpp
@@ -75,6 +75,12 @@ void Virus::moveErratic()
targetY = Math::rrand(50, 550);
}
+ if ((x < 0) || (x > 800) || (y < 0) || (y > 600))
+ {
+ targetX = 400;
+ targetY = 300;
+ }
+
Math::calculateSlope(x, y, targetX, targetY, &dx, &dy);
dx /= speed;
diff --git a/src/CWidget.cpp b/src/CWidget.cpp
index ef984f5..f27fedd 100644
--- a/src/CWidget.cpp
+++ b/src/CWidget.cpp
@@ -41,7 +41,7 @@ Widget::~Widget()
redraw();
}
-void Widget::setProperties(char *name, char *groupName, char *label, char *options, int x, int y, int min, int max)
+void Widget::setProperties(const char *name, const char *groupName, const char *label, const char *options, int x, int y, int min, int max)
{
if ((strlen(name) > 50) || (strlen(groupName) > 50) || (strlen(label) > 50) || (strlen(options) > 100))
{
diff --git a/src/CWidget.h b/src/CWidget.h
index 7983e9d..58ab5b2 100644
--- a/src/CWidget.h
+++ b/src/CWidget.h
@@ -41,7 +41,7 @@ class Widget : public GameObject {
Widget();
virtual ~Widget();
- void setProperties(char *name, char *groupName, char *label, char *options, int x, int y, int min, int max);
+ void setProperties(const char *name, const char *groupName, const char *label, const char *options, int x, int y, int min, int max);
void setValue(int *value);
void redraw();
void destroy();
diff --git a/data/defines.h b/src/defines.h
similarity index 100%
copy from data/defines.h
copy to src/defines.h
diff --git a/src/defs.h b/src/defs.h
index 1a012c2..12edb87 100644
--- a/src/defs.h
+++ b/src/defs.h
@@ -30,12 +30,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* ############# system defaults ##### */
#define SCREENWIDTH 800
-#define SCREENHEIGHT 600
+#define SCREENHEIGHT 600
#define SCREENDEPTH 16
/* ########### maximums ############ */
-#define MAX_SOUNDS 25
+#define MAX_SOUNDS 26
/* ########### game sections ######## */
@@ -100,7 +100,8 @@ enum {
SND_POWERUP,
SND_CLOCK,
SND_EXPLOSION,
- SND_GAMEOVER
+ SND_GAMEOVER,
+ SND_ITEM
};
@@ -160,6 +161,12 @@ const char gameModes[][20] = {
#ifndef SAFEDIR
#define SAFEDIR "/tmp/"
#endif
+#ifndef MEDAL_SERVER_HOST
+ #define MEDAL_SERVER_HOST "localhost"
+#endif
+#ifndef MEDAL_SERVER_PORT
+ #define MEDAL_SERVER_PORT 80
+#endif
enum {
diff --git a/src/filesAndDirectories.cpp b/src/filesAndDirectories.cpp
index 2e8dc48..e9c5ea0 100644
--- a/src/filesAndDirectories.cpp
+++ b/src/filesAndDirectories.cpp
@@ -44,7 +44,7 @@ void setFileImage(File *file)
file->sprite = graphics.getSprite(spriteName, true);
}
-void informDirSetup(char *name)
+void informDirSetup(const char *name)
{
graphics.clearScreen(graphics.black);
graphics.setFontColor(0xff, 0xff, 0xff, 0x00, 0x00, 0x00);
@@ -54,10 +54,9 @@ void informDirSetup(char *name)
graphics.drawString(400, 280, TXT_CENTERED, graphics.screen, name);
graphics.updateScreen();
-
}
-void buildFileList(char *dirName, int depth)
+void buildFileList(const char *dirName, int depth)
{
Sprite *dirSprite[6];
@@ -211,7 +210,7 @@ void doDirectories()
for (int i = 0 ; i < 10 ; i++)
addDirectoryDeathParticles(dir->x + Math::rrand(-25, 25), dir->y + Math::rrand(-25, 25));
dir->active = false;
- gameData.score -= 5000;
+ addScore(-5000);
gameData.dirsLost++;
gameData.roundDirsLost++;
audio.playSound(SND_DIRDESTROYED1 + rand() % 6, 1);
diff --git a/src/filesAndDirectories.h b/src/filesAndDirectories.h
index 302d03b..7e27be9 100644
--- a/src/filesAndDirectories.h
+++ b/src/filesAndDirectories.h
@@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "headers.h"
extern void addDirectoryDeathParticles(int x, int y);
+extern void addScore(int amount);
extern Audio audio;
extern Engine engine;
diff --git a/src/game.cpp b/src/game.cpp
index 7f1ec7a..9c4138a 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -20,6 +20,86 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "game.h"
+int medalWorker(void *data)
+{
+ char *tname = (char*)data;
+
+ SDL_mutexP(medalServer.lock);
+
+ int type = medalServer.postMedal(tname);
+
+ while (!graphics.canShowMedalMessage())
+ {
+ SDL_Delay(100);
+ }
+
+ SDL_Delay(100);
+
+ if (type >= 1 && type <= 3)
+ {
+ audio.playSound(SND_ITEM, 0);
+ graphics.showMedalMessage(type, medalServer.getMessage());
+
+ if (medalServer.hasRuby())
+ {
+ while (!graphics.canShowMedalMessage())
+ {
+ SDL_Delay(100);
+ }
+
+ SDL_Delay(100);
+
+ audio.playSound(SND_ITEM, 0);
+ graphics.showMedalMessage(4, medalServer.getRubyMessage());
+ }
+ }
+
+ SDL_mutexV(medalServer.lock);
+
+ delete tname;
+
+ return type;
+}
+
+void presentPlayerMedal(const char *tname)
+{
+ // Copy the input, so that threading
+ // doesn't trip us up!
+ char *data = new char[128];
+ strcpy(data, tname);
+
+ SDL_Thread *thread = SDL_CreateThread(medalWorker, (void*)data);
+
+ if (thread == NULL)
+ {
+ printf("Unable to create thread: %s\n", SDL_GetError());
+ printf("Calling medal server directly\n");
+ medalWorker((void*)data);
+ return;
+ }
+}
+
+void addScore(int amount)
+{
+ if (gameData.skill > MODE_EASY && gameData.skill < MODE_NIGHTMARE)
+ {
+ if (gameData.score < 1000000 && gameData.score + amount >= 1000000)
+ {
+ presentPlayerMedal("VK_Score1000000");
+ }
+ else if (gameData.score < 500000 && gameData.score + amount >= 500000)
+ {
+ presentPlayerMedal("VK_Score500000");
+ }
+ else if (gameData.score < 250000 && gameData.score + amount >= 250000)
+ {
+ presentPlayerMedal("VK_Score250000");
+ }
+ }
+
+ gameData.score += amount;
+}
+
int showInGameOptions()
{
float brightness;
@@ -319,6 +399,23 @@ void doRoundClear()
bonus *= (gameData.activeDirs * 10);
unsigned int then = SDL_GetTicks() + 2000;
+
+ if (gameData.level + 1 == 5)
+ {
+ presentPlayerMedal("VK_Round5");
+ }
+ else if (gameData.level + 1 == 10)
+ {
+ presentPlayerMedal("VK_Round10");
+ }
+ else if (gameData.level + 1 == 15)
+ {
+ presentPlayerMedal("VK_Round15");
+ }
+ else if (gameData.level + 1 == 20)
+ {
+ presentPlayerMedal("VK_Round20");
+ }
while (true)
{
@@ -392,7 +489,7 @@ void doRoundClear()
engine.resetTimeDifference();
- gameData.score += bonus;
+ addScore(bonus);
}
int doGame()
@@ -596,8 +693,7 @@ int doGame()
lastTime = (int)time;
- if ((gameData.level % 5) == 0)
- minViruses += 2;
+ minViruses += 2;
time = lastTime = now;
lastTime += (roundTime * 100);
@@ -732,6 +828,11 @@ int doGame()
engine.resetTimeDifference();
}
}
+
+ if (gameData.score <= -100000)
+ {
+ presentPlayerMedal("VK_NegativeScore");
+ }
GameOver();
@@ -747,12 +848,15 @@ int doGame()
else
{
gameData.nightmareCount -= gameData.level;
+ Math::limitInt(&gameData.nightmareCount, 0, 100);
}
debug(("Nightmare Count is now %d\n", gameData.nightmareCount));
if (gameData.nightmareCount == 50)
{
+ presentPlayerMedal("VK_NightmareMode");
+
graphics.clearScreen(graphics.black);
graphics.delay(500);
graphics.setFontSize(4);
@@ -763,6 +867,8 @@ int doGame()
}
else if (gameData.nightmareCount == 0)
{
+ presentPlayerMedal("VK_UltimateNightmareMode");
+
graphics.clearScreen(graphics.black);
graphics.delay(500);
graphics.setFontSize(4);
diff --git a/src/game.h b/src/game.h
index f0d0a4b..a2e9ce8 100644
--- a/src/game.h
+++ b/src/game.h
@@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "headers.h"
+#include "SDL/SDL_thread.h"
extern void addViruses(int amount);
@@ -43,3 +44,4 @@ extern Audio audio;
extern Engine engine;
extern GameData gameData;
extern Graphics graphics;
+extern MedalServer medalServer;
diff --git a/src/headers.h b/src/headers.h
index 967cd92..457b81c 100644
--- a/src/headers.h
+++ b/src/headers.h
@@ -24,10 +24,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <math.h>
#include <zlib.h>
-#include <SDL/SDL.h>
-#include <SDL/SDL_image.h>
-#include <SDL/SDL_mixer.h>
-#include <SDL/SDL_ttf.h>
+#include "SDL/SDL.h"
+#include "SDL/SDL_image.h"
+#include "SDL/SDL_mixer.h"
+#include "SDL/SDL_ttf.h"
+#include "SDL/SDL_net.h"
#include "defs.h"
#include "CGameObject.h"
@@ -58,3 +59,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "CVirus.h"
#include "CItem.h"
#include "CGameData.h"
+
+#include "CMedalServer.h"
+
diff --git a/src/highscores.cpp b/src/highscores.cpp
index d6f7fc8..9dbc47d 100644
--- a/src/highscores.cpp
+++ b/src/highscores.cpp
@@ -25,7 +25,10 @@ int getHighScorePosition(unsigned int score)
for (int i = 0 ; i < 10 ; i++)
{
if (score > gameData.highScore[gameData.skill][i].score)
+ {
+ presentPlayerMedal("VK_Highscore");
return i;
+ }
}
return -1;
diff --git a/src/highscores.h b/src/highscores.h
index 9d764f2..c03c681 100644
--- a/src/highscores.h
+++ b/src/highscores.h
@@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
extern void doTitleViruses();
extern void addTitleViruses();
+extern void presentPlayerMedal(const char *tname);
extern Audio audio;
extern Engine engine;
diff --git a/src/init.cpp b/src/init.cpp
index 1d16082..c8d2c50 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -122,6 +122,42 @@ void setupUserHomeDirectory()
}
#endif
+//
+// see if we can load the private keyState
+//
+void initMedalService()
+{
+ SDL_FillRect(graphics.screen, NULL, graphics.black);
+ graphics.drawString(400, 520, true, graphics.screen, "Contacting Medal Server - %s:%d", MEDAL_SERVER_HOST, MEDAL_SERVER_PORT);
+ graphics.updateScreen();
+
+ char keyPath[PATH_MAX];
+ char privateKey[20];
+
+ sprintf(keyPath, "%smedalKey", engine.userHomeDirectory);
+
+ debug(("Loading private key from %s\n", keyPath));
+
+ FILE *fp = fopen(keyPath, "rb");
+
+ if (!fp)
+ {
+ graphics.showMedalMessage(-1, "Medal Key not found - Online functions disabled");
+ return;
+ }
+
+ fscanf(fp, "%s", privateKey);
+
+ fclose(fp);
+
+ if (!medalServer.connect(privateKey))
+ {
+ graphics.drawString(400, 520, true, graphics.screen, "Server Connection Failed");
+ graphics.updateScreen();
+ SDL_Delay(2500);
+ }
+}
+
bool loadConfig()
{
char configPath[PATH_MAX];
@@ -267,6 +303,11 @@ void initSystem()
graphics.loadFont(3, "data/vera.ttf", 13);
graphics.loadFont(4, "data/vera.ttf", 15);
+ graphics.medal[0] = graphics.loadImage("gfx/main/medal_bronze_1.png");
+ graphics.medal[1] = graphics.loadImage("gfx/main/award_star_silver_3.png");
+ graphics.medal[2] = graphics.loadImage("gfx/main/shield.png");
+ graphics.medal[3] = graphics.loadImage("gfx/main/ruby.png");
+
debug(("Font sizes all loaded!!\n"));
SDL_WM_SetIcon(graphics.loadImage("gfx/main/alienDevice.png"), NULL);
@@ -274,6 +315,15 @@ void initSystem()
if (displayLicense)
showLicense();
+
+ if (SDLNet_Init() < 0)
+ {
+ printf("SDLNet_Init: %s\n", SDLNet_GetError());
+ }
+ else
+ {
+ initMedalService();
+ }
engine.allowQuit = true;
engine.flushInput();
@@ -316,6 +366,9 @@ void cleanup()
debug(("Freeing Graphics...\n"));
graphics.destroy();
+
+ debug(("Closing NET...\n"));
+ SDLNet_Quit();
debug(("Closing SDL Sub System...\n"));
SDL_Quit();
diff --git a/src/init.h b/src/init.h
index 89e7d4f..91ed706 100644
--- a/src/init.h
+++ b/src/init.h
@@ -31,3 +31,4 @@ extern Audio audio;
extern Engine engine;
extern Graphics graphics;
extern GameData gameData;
+extern MedalServer medalServer;
diff --git a/src/main.cpp b/src/main.cpp
index d752ce3..0bacd78 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -24,9 +24,9 @@ void showHelp()
{
printf("\n");
printf("Virus Killer (Version %.1f, Release %d)\n", VERSION, RELEASE);
- printf("Copyright (C) 2004 Parallel Realities\n");
+ printf("Copyright (C) 2004, 2010 Parallel Realities\n");
printf("Licensed under the GPL\n\n");
-
+
printf("The Virus Killer gameplay manual can be found in,\n");
printf("\t%s\n\n", GAMEPLAYMANUAL);
@@ -45,7 +45,7 @@ void showVersion()
{
printf("\n");
printf("Virus Killer (Version %.1f, Release %d)\n", VERSION, RELEASE);
- printf("Copyright (C) 2004 Parallel Realities\n");
+ printf("Copyright (C) 2004, 2010 Parallel Realities\n");
printf("Licensed under the GPL\n\n");
exit(0);
}
@@ -72,10 +72,6 @@ int main(int argc, char *argv[])
{
strcpy(gameData.directorySearchPath, SAFEDIR);
}
-
- #if WINDOWS
- strcpy(gameData.directorySearchPath, getenv("PROGRAMFILES"));
- #endif
loadResources();
@@ -85,7 +81,7 @@ int main(int argc, char *argv[])
engine.defineList.clear();
int requiredSection = SECTION_TITLE;
-
+
while (true)
{
switch (requiredSection)
diff --git a/src/main.h b/src/main.h
index eccffe1..3885601 100644
--- a/src/main.h
+++ b/src/main.h
@@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "headers.h"
extern void loadResources();
-extern void buildFileList(char *dirName, int depth);
+extern void buildFileList(const char *dirName, int depth);
extern void initSystem();
extern void cleanup();
@@ -29,7 +29,10 @@ extern int doTitle();
extern int doGame();
extern int addHighScore();
+extern void presentPlayerMedal(const char *tname);
+
Audio audio;
Engine engine;
GameData gameData;
Graphics graphics;
+MedalServer medalServer;
diff --git a/src/pak.cpp b/src/pak.cpp
old mode 100755
new mode 100644
index 43d4556..36d5a19
--- a/src/pak.cpp
+++ b/src/pak.cpp
@@ -41,7 +41,7 @@ void cleanup()
}
}
-void countFiles(char *dirName)
+void countFiles(const char *dirName)
{
DIR *dirp, *dirp2;
dirent *dfile;
@@ -79,7 +79,7 @@ void countFiles(char *dirName)
fileData = new FileData[totalFiles];
}
-void recurseDirectory(char *dirName)
+void recurseDirectory(const char *dirName)
{
DIR *dirp, *dirp2;
dirent *dfile;
diff --git a/src/resources.cpp b/src/resources.cpp
index 9f87250..a470eb8 100644
--- a/src/resources.cpp
+++ b/src/resources.cpp
@@ -119,6 +119,8 @@ void loadResources()
audio.loadSound(SND_POWERUP, "sound/powerup.wav");
audio.loadSound(SND_CLOCK, "sound/clock.wav");
audio.loadSound(SND_EXPLOSION, "sound/explosion.wav");
+
+ audio.loadSound(SND_ITEM, "sound/item.wav");
audio.loadSound(SND_GAMEOVER, "sound/gameOver.wav");
diff --git a/src/title.cpp b/src/title.cpp
index 534ef4d..8130cf2 100644
--- a/src/title.cpp
+++ b/src/title.cpp
@@ -273,7 +273,7 @@ int doTitle()
graphics.setFontSize(0);
graphics.setFontColor(0xff, 0xff, 0xff, 0x00, 0x00, 0x00);
- graphics.drawString(10, 580, TXT_LEFT, graphics.screen, "Copyright (c) Parallel Realities 2005");
+ graphics.drawString(10, 580, TXT_LEFT, graphics.screen, "Copyright (c) Parallel Realities 2005, 2010");
graphics.drawString(790, 580, TXT_RIGHT, graphics.screen, "Version %.1f", VERSION);
graphics.setFontSize(1);
diff --git a/src/viruses.cpp b/src/viruses.cpp
index cdc2a8d..4457a05 100644
--- a/src/viruses.cpp
+++ b/src/viruses.cpp
@@ -20,6 +20,25 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "viruses.h"
+void checkVirusMedal()
+{
+ if (gameData.skill > MODE_EASY && gameData.skill < MODE_NIGHTMARE)
+ {
+ if (gameData.virusesKilled == 500)
+ {
+ presentPlayerMedal("VK_Kill500");
+ }
+ else if (gameData.virusesKilled == 1000)
+ {
+ presentPlayerMedal("VK_Kill1000");
+ }
+ else if (gameData.virusesKilled == 1500)
+ {
+ presentPlayerMedal("VK_Kill1500");
+ }
+ }
+}
+
void nightmareVirusGetStart(Virus *virus)
{
int place = rand() % 4;
@@ -144,6 +163,7 @@ void nukeAllViruses()
addVirusDeathParticles((int)virus->x, (int)virus->y, virus->type);
gameData.virusesKilled++;
+ checkVirusMedal();
if (gameData.skill < 3)
{
@@ -151,7 +171,7 @@ void nukeAllViruses()
graphics.setFontSize(0);
graphics.setFontColor(0xff, 0x00, 0x00, 0x00, 0x00, 0x00);
virus->pointsImage = graphics.getString(true, "+500");
- gameData.score += 500;
+ addScore(500);
}
}
@@ -186,19 +206,37 @@ void doVirusBulletCollisions()
addVirusDeathParticles((int)virus->x, (int)virus->y, virus->type);
gameData.virusesKilled++;
gameData.roundVirusesKilled++;
+ checkVirusMedal();
graphics.setFontSize(0);
graphics.setFontColor(0xff, 0x00, 0x00, 0x00, 0x00, 0x00);
if (gameData.skill < 3)
{
- gameData.score += 50 + (50 * gameData.skill);
+ addScore(50 + (50 * gameData.skill));
virus->pointsImage = graphics.getString(true, "+%d", 50 + (50 * gameData.skill));
}
- if (gameData.lastVirusKilled > 0)
+ if (gameData.lastVirusKilled > 0 && gameData.skill < MODE_NIGHTMARE)
{
gameData.currentChain++;
+
+ if (gameData.currentChain == 25)
+ {
+ presentPlayerMedal("VK_Chain25");
+ }
+ else if (gameData.currentChain == 50)
+ {
+ presentPlayerMedal("VK_Chain50");
+ }
+ else if (gameData.currentChain == 75)
+ {
+ presentPlayerMedal("VK_Chain75");
+ }
+ else if (gameData.currentChain == 100)
+ {
+ presentPlayerMedal("VK_Chain100");
+ }
if (gameData.currentChain > gameData.roundBiggestChain)
{
@@ -212,7 +250,7 @@ void doVirusBulletCollisions()
if (gameData.skill < 3)
{
virus->pointsImage = graphics.getString(true, "+%d", (50 + (50 * gameData.skill)) * gameData.currentChain);
- gameData.score += ((50 + (50 * gameData.skill)) * gameData.currentChain);
+ addScore(((50 + (50 * gameData.skill)) * gameData.currentChain));
gameData.lastVirusKilled = 50;
}
}
@@ -259,7 +297,7 @@ void virusDestroyFile(Virus *virus)
gameData.roundFilesLost++;
gameData.filesLost++;
- gameData.score -= 1000;
+ addScore(-1000);
}
void virusEatFile(Virus *virus)
@@ -437,6 +475,8 @@ void doViruses()
if ((virus->x < 0) || (virus->x > 800) || (virus->y < 0) || (virus->y > 600))
{
virus->thinktime = 0;
+ Math::limitFloat(&virus->x, 0, 790);
+ Math::limitFloat(&virus->y, 0, 590);
}
}
else
diff --git a/src/viruses.h b/src/viruses.h
index e513e70..7cd3b16 100644
--- a/src/viruses.h
+++ b/src/viruses.h
@@ -21,6 +21,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "headers.h"
extern void addVirusDeathParticles(int x, int y, int virusType);
+extern void presentPlayerMedal(const char *tname);
+extern void addScore(int amount);
extern Audio audio;
extern Engine engine;
diff --git a/viruskiller.spec b/viruskiller.spec
new file mode 100644
index 0000000..0e9b2a5
--- /dev/null
+++ b/viruskiller.spec
@@ -0,0 +1,39 @@
+Summary: A Shoot 'Em Up that uses your file system
+Name: %{name}
+Version: %{version}
+Release: %{release}
+Source: %{name}-%{version}-%{release}.tar.gz
+Vendor: Parallel Realities
+Packager: Stephen Sweeney
+URL: http://www.parallelrealities.co.uk/projects/virusKiller.php
+Group: Games/Arcade
+License: GPL
+%description
+A virus killing simulation, that makes use of your own file system
+
+%prep
+%setup -q
+
+%build
+make VERSION=%{version} RELEASE=%{release}
+
+%install
+make install
+
+%clean
+
+%post
+
+
+%files
+%dir /usr/games
+%dir /usr/share/games/viruskiller
+%dir /usr/share/doc/%{name}
+%dir /usr/share/applnk
+/usr/games/%{name}
+/usr/share/games/viruskiller/%{name}.pak
+/usr/share/doc/%{name}/*
+/usr/share/applications/viruskiller.desktop
+/usr/share/icons/hicolor/16x16/apps/viruskiller.png
+/usr/share/icons/hicolor/32x32/apps/viruskiller.png
+/usr/share/icons/hicolor/64x64/apps/viruskiller.png
--
game about viruses invading your computer
More information about the Pkg-games-commits
mailing list