pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
witchblast: import witchblast-0.7.5 as wip/witchblast
Module Name: pkgsrc-wip
Committed By: Yorick Hardy <yorickhardy%gmail.com@localhost>
Pushed By: yhardy
Date: Sun Mar 18 23:05:01 2018 +0200
Changeset: e621eb967baf07faa22ea5a6990adb19769c89ed
Modified Files:
Makefile
Added Files:
witchblast/DESCR
witchblast/Makefile
witchblast/PLIST
witchblast/distinfo
witchblast/patches/patch-src_Constants.h
witchblast/patches/patch-src_DungeonMapEntity.cpp
witchblast/patches/patch-src_TextMapper.cpp
witchblast/patches/patch-src_WitchBlastGame.cpp
Log Message:
witchblast: import witchblast-0.7.5 as wip/witchblast
Witch Blast is a free roguelite dungeon crawl shooter heavily
inspired from Binding Of Isaac. The player plays as a novice magician
in a dungeon who is trying to get as far as he can, using various
items he can find to defeat the inhabitants of the dungeon.
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=e621eb967baf07faa22ea5a6990adb19769c89ed
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
Makefile | 1 +
witchblast/DESCR | 4 +
witchblast/Makefile | 37 ++++
witchblast/PLIST | 238 ++++++++++++++++++++++
witchblast/distinfo | 10 +
witchblast/patches/patch-src_Constants.h | 23 +++
witchblast/patches/patch-src_DungeonMapEntity.cpp | 39 ++++
witchblast/patches/patch-src_TextMapper.cpp | 15 ++
witchblast/patches/patch-src_WitchBlastGame.cpp | 103 ++++++++++
9 files changed, 470 insertions(+)
diffs:
diff --git a/Makefile b/Makefile
index fb60f2d37a..131f375d4a 100644
--- a/Makefile
+++ b/Makefile
@@ -4562,6 +4562,7 @@ SUBDIR+= weland
SUBDIR+= weplab
SUBDIR+= west
SUBDIR+= which
+SUBDIR+= witchblast
SUBDIR+= why
SUBDIR+= why3
SUBDIR+= wicd
diff --git a/witchblast/DESCR b/witchblast/DESCR
new file mode 100644
index 0000000000..ffe37bfaa0
--- /dev/null
+++ b/witchblast/DESCR
@@ -0,0 +1,4 @@
+Witch Blast is a free roguelite dungeon crawl shooter heavily
+inspired from Binding Of Isaac. The player plays as a novice magician
+in a dungeon who is trying to get as far as he can, using various
+items he can find to defeat the inhabitants of the dungeon.
diff --git a/witchblast/Makefile b/witchblast/Makefile
new file mode 100644
index 0000000000..e6eb032187
--- /dev/null
+++ b/witchblast/Makefile
@@ -0,0 +1,37 @@
+# $NetBSD$
+
+PKGNAME= ${GITHUB_PROJECT}-0.7.5
+GITHUB_PROJECT= witchblast
+DISTNAME= v${PKGVERSION_NOREV}
+CATEGORIES= games
+MASTER_SITES= ${MASTER_SITE_GITHUB:=Cirrus-Minor/}
+DIST_SUBDIR= ${GITHUB_PROJECT}
+GITHUB_TAG= v${PKGVERSION_NOREV}
+
+MAINTAINER= pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE= https://github.com/Cirrus-Minor/witchblast/
+COMMENT= Roguelite dungeon crawler game
+LICENSE= gnu-gpl-v3
+
+WRKSRC= ${WRKDIR}/witchblast-0.7.5
+USE_CMAKE= yes
+USE_LANGUAGES= c c++
+
+CXXFLAGS+= -D WITCHBLAST_DATA_DIR=\"${PREFIX}/${WITCHBLAST_DATA_DIR}/\"
+
+INSTALLATION_DIRS+= bin
+INSTALLATION_DIRS+= share/doc/witchblast
+INSTALLATION_DIRS+= ${WITCHBLAST_DATA_DIR}/data
+INSTALLATION_DIRS+= ${WITCHBLAST_DATA_DIR}/media
+INSTALLATION_DIRS+= ${WITCHBLAST_DATA_DIR}/media/sound
+WITCHBLAST_DATA_DIR= share/witchblast
+
+do-install:
+ ${INSTALL_GAME} ${WRKSRC}/Witch_Blast ${DESTDIR}${PREFIX}/bin/witchblast
+ ${INSTALL_DATA} ${WRKSRC}/readme.txt ${DESTDIR}${PREFIX}/share/doc/witchblast/
+ ${INSTALL_GAME_DATA} ${WRKSRC}/data/* ${DESTDIR}${PREFIX}/${WITCHBLAST_DATA_DIR}/data/
+ ${INSTALL_GAME_DATA} ${WRKSRC}/media/*.* ${DESTDIR}${PREFIX}/${WITCHBLAST_DATA_DIR}/media/
+ ${INSTALL_GAME_DATA} ${WRKSRC}/media/sound/* ${DESTDIR}${PREFIX}/${WITCHBLAST_DATA_DIR}/media/sound/
+
+.include "../../wip/sfml+/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/witchblast/PLIST b/witchblast/PLIST
new file mode 100644
index 0000000000..5c22b13181
--- /dev/null
+++ b/witchblast/PLIST
@@ -0,0 +1,238 @@
+@comment $NetBSD$
+bin/witchblast
+share/doc/witchblast/readme.txt
+share/witchblast/data/labels.txt
+share/witchblast/media/Caudex-Bold.ttf
+share/witchblast/media/DejaVuSans-Bold.ttf
+share/witchblast/media/SIL Open Font License.txt
+share/witchblast/media/achievements.png
+share/witchblast/media/bag.png
+share/witchblast/media/bat.png
+share/witchblast/media/blood.png
+share/witchblast/media/bogeyman.png
+share/witchblast/media/bolt.png
+share/witchblast/media/boss_pictures.png
+share/witchblast/media/bubble.png
+share/witchblast/media/butcher.png
+share/witchblast/media/cauldron.png
+share/witchblast/media/chest.png
+share/witchblast/media/corpses.png
+share/witchblast/media/corpses_big.png
+share/witchblast/media/cyclops.png
+share/witchblast/media/death_certificate.png
+share/witchblast/media/destroyable_objects.png
+share/witchblast/media/divinity.png
+share/witchblast/media/doors.png
+share/witchblast/media/dungeon_objects.png
+share/witchblast/media/dungeon_random.png
+share/witchblast/media/evil_flower.png
+share/witchblast/media/explosion.png
+share/witchblast/media/eyeball.png
+share/witchblast/media/fairy.png
+share/witchblast/media/fog.png
+share/witchblast/media/francky.png
+share/witchblast/media/ghost.png
+share/witchblast/media/giant_slime.png
+share/witchblast/media/giant_spider.png
+share/witchblast/media/hall_of_fame.png
+share/witchblast/media/hof_win_seal.png
+share/witchblast/media/hud_shots.png
+share/witchblast/media/hurt_impact.png
+share/witchblast/media/imp.png
+share/witchblast/media/interface.png
+share/witchblast/media/item_description.png
+share/witchblast/media/items.png
+share/witchblast/media/items_equip.png
+share/witchblast/media/key_area.png
+share/witchblast/media/keys_azer.png
+share/witchblast/media/keys_qwer.png
+share/witchblast/media/king_rat.png
+share/witchblast/media/light_cone.png
+share/witchblast/media/lightning.png
+share/witchblast/media/little_spider.png
+share/witchblast/media/map_background.png
+share/witchblast/media/minimap.png
+share/witchblast/media/night.png
+share/witchblast/media/overlay_00.png
+share/witchblast/media/overlay_boss_01.png
+share/witchblast/media/overlay_boss_02.png
+share/witchblast/media/overlay_boss_03.png
+share/witchblast/media/overlay_boss_04.png
+share/witchblast/media/overlay_boss_05.png
+share/witchblast/media/overlay_boss_06.png
+share/witchblast/media/overlay_boss_07.png
+share/witchblast/media/overlay_shop.png
+share/witchblast/media/overlay_temple.png
+share/witchblast/media/player_0.png
+share/witchblast/media/player_1.png
+share/witchblast/media/player_2.png
+share/witchblast/media/pnj.png
+share/witchblast/media/portrait_part.png
+share/witchblast/media/pumpkin.png
+share/witchblast/media/rat.png
+share/witchblast/media/sausage.png
+share/witchblast/media/score_font.png
+share/witchblast/media/shadows_corners.png
+share/witchblast/media/shadows_medium.png
+share/witchblast/media/shadows_small.png
+share/witchblast/media/shadows_standard.png
+share/witchblast/media/slime.png
+share/witchblast/media/snake.png
+share/witchblast/media/sound/AmbiantMedieval.ogg
+share/witchblast/media/sound/HauntedLighthouse.ogg
+share/witchblast/media/sound/HellsFire.ogg
+share/witchblast/media/sound/SavageLife.ogg
+share/witchblast/media/sound/ShowMeThePower.ogg
+share/witchblast/media/sound/WitchBlastTheme.ogg
+share/witchblast/media/sound/achievement.ogg
+share/witchblast/media/sound/barrel_hit.ogg
+share/witchblast/media/sound/barrel_smash.ogg
+share/witchblast/media/sound/bat_die.ogg
+share/witchblast/media/sound/big_wall_impact.ogg
+share/witchblast/media/sound/blast00.ogg
+share/witchblast/media/sound/blast01.ogg
+share/witchblast/media/sound/blast_elec.ogg
+share/witchblast/media/sound/blast_fire.ogg
+share/witchblast/media/sound/blast_ice.ogg
+share/witchblast/media/sound/blast_illusion.ogg
+share/witchblast/media/sound/blast_poison.ogg
+share/witchblast/media/sound/blast_stone.ogg
+share/witchblast/media/sound/bogeyman_attack.ogg
+share/witchblast/media/sound/bogeyman_die.ogg
+share/witchblast/media/sound/bogeyman_vortex_00.ogg
+share/witchblast/media/sound/bogeyman_vortex_01.ogg
+share/witchblast/media/sound/bonus.ogg
+share/witchblast/media/sound/bonus_score.ogg
+share/witchblast/media/sound/boom_00.ogg
+share/witchblast/media/sound/bottle.ogg
+share/witchblast/media/sound/bubble_00.ogg
+share/witchblast/media/sound/bubble_01.ogg
+share/witchblast/media/sound/butcher_00.ogg
+share/witchblast/media/sound/butcher_01.ogg
+share/witchblast/media/sound/butcher_die.ogg
+share/witchblast/media/sound/butcher_hurt.ogg
+share/witchblast/media/sound/cauldron.ogg
+share/witchblast/media/sound/cauldron_die.ogg
+share/witchblast/media/sound/chest_opening.ogg
+share/witchblast/media/sound/clang_00.ogg
+share/witchblast/media/sound/coin.ogg
+share/witchblast/media/sound/critical.ogg
+share/witchblast/media/sound/cyclop00.ogg
+share/witchblast/media/sound/cyclop_die.ogg
+share/witchblast/media/sound/cyclops_impact.ogg
+share/witchblast/media/sound/door_closing.ogg
+share/witchblast/media/sound/door_opening.ogg
+share/witchblast/media/sound/door_opening_boss.ogg
+share/witchblast/media/sound/drink.ogg
+share/witchblast/media/sound/earthquake.ogg
+share/witchblast/media/sound/eat.ogg
+share/witchblast/media/sound/egg_smash_00.ogg
+share/witchblast/media/sound/egg_smash_01.ogg
+share/witchblast/media/sound/electric.ogg
+share/witchblast/media/sound/electric_blast.ogg
+share/witchblast/media/sound/electricity.ogg
+share/witchblast/media/sound/ennemy_dying.ogg
+share/witchblast/media/sound/fireball.ogg
+share/witchblast/media/sound/force_field.ogg
+share/witchblast/media/sound/francky_00.ogg
+share/witchblast/media/sound/francky_01.ogg
+share/witchblast/media/sound/francky_02.ogg
+share/witchblast/media/sound/francky_die.ogg
+share/witchblast/media/sound/ghost.ogg
+share/witchblast/media/sound/ghost_die.ogg
+share/witchblast/media/sound/glass.ogg
+share/witchblast/media/sound/gong.ogg
+share/witchblast/media/sound/grumble.ogg
+share/witchblast/media/sound/heart.ogg
+share/witchblast/media/sound/heavy_step_00.ogg
+share/witchblast/media/sound/heavy_step_01.ogg
+share/witchblast/media/sound/hiccup.ogg
+share/witchblast/media/sound/ice_block.ogg
+share/witchblast/media/sound/ice_charge.ogg
+share/witchblast/media/sound/imp_die.ogg
+share/witchblast/media/sound/imp_hurt.ogg
+share/witchblast/media/sound/impact.ogg
+share/witchblast/media/sound/intro_witch.ogg
+share/witchblast/media/sound/invoke.ogg
+share/witchblast/media/sound/king_rat_cry_1.ogg
+share/witchblast/media/sound/king_rat_cry_2.ogg
+share/witchblast/media/sound/king_rat_die.ogg
+share/witchblast/media/sound/little_spider_die.ogg
+share/witchblast/media/sound/message.ogg
+share/witchblast/media/sound/night.ogg
+share/witchblast/media/sound/om.ogg
+share/witchblast/media/sound/pay.ogg
+share/witchblast/media/sound/player_die.ogg
+share/witchblast/media/sound/player_hit.ogg
+share/witchblast/media/sound/pumpkin_00.ogg
+share/witchblast/media/sound/pumpkin_01.ogg
+share/witchblast/media/sound/pumpkin_die.ogg
+share/witchblast/media/sound/rat_die.ogg
+share/witchblast/media/sound/rock_impact.ogg
+share/witchblast/media/sound/rock_impact_heavy.ogg
+share/witchblast/media/sound/rock_impact_medium.ogg
+share/witchblast/media/sound/scroll.ogg
+share/witchblast/media/sound/secret.ogg
+share/witchblast/media/sound/select.ogg
+share/witchblast/media/sound/slime_impact.ogg
+share/witchblast/media/sound/slime_impact_boss.ogg
+share/witchblast/media/sound/slime_impact_weak.ogg
+share/witchblast/media/sound/slime_jump.ogg
+share/witchblast/media/sound/slime_smash.ogg
+share/witchblast/media/sound/snake_die.ogg
+share/witchblast/media/sound/spell_charge.ogg
+share/witchblast/media/sound/spell_freeze.ogg
+share/witchblast/media/sound/spell_shield.ogg
+share/witchblast/media/sound/spider_die.ogg
+share/witchblast/media/sound/spider_hurt.ogg
+share/witchblast/media/sound/spider_walking.ogg
+share/witchblast/media/sound/spider_web.ogg
+share/witchblast/media/sound/splatch.ogg
+share/witchblast/media/sound/step.ogg
+share/witchblast/media/sound/teleport.ogg
+share/witchblast/media/sound/throw.ogg
+share/witchblast/media/sound/thunder.ogg
+share/witchblast/media/sound/tic_tac.ogg
+share/witchblast/media/sound/trap.ogg
+share/witchblast/media/sound/vampire_cry.ogg
+share/witchblast/media/sound/vampire_dying.ogg
+share/witchblast/media/sound/vampire_flap.ogg
+share/witchblast/media/sound/vampire_flying.ogg
+share/witchblast/media/sound/vampire_hypnosis.ogg
+share/witchblast/media/sound/vampire_laughing.ogg
+share/witchblast/media/sound/vampire_sonic.ogg
+share/witchblast/media/sound/vampire_transform_bat.ogg
+share/witchblast/media/sound/vampire_transform_bolt.ogg
+share/witchblast/media/sound/vib.ogg
+share/witchblast/media/sound/wall_impact.ogg
+share/witchblast/media/sound/witch_00.ogg
+share/witchblast/media/sound/witch_01.ogg
+share/witchblast/media/sound/witch_02.ogg
+share/witchblast/media/sound/witch_die_00.ogg
+share/witchblast/media/sound/witch_die_01.ogg
+share/witchblast/media/sound/zombie_00.ogg
+share/witchblast/media/sound/zombie_01.ogg
+share/witchblast/media/sound/zombie_attack.ogg
+share/witchblast/media/sound/zombie_die.ogg
+share/witchblast/media/spider_egg.png
+share/witchblast/media/spider_web.png
+share/witchblast/media/splatter.png
+share/witchblast/media/star.png
+share/witchblast/media/star2.png
+share/witchblast/media/tiles.png
+share/witchblast/media/title.png
+share/witchblast/media/title_animation.png
+share/witchblast/media/ui_achiev.png
+share/witchblast/media/ui_life.png
+share/witchblast/media/ui_mana.png
+share/witchblast/media/ui_message.png
+share/witchblast/media/ui_pause.png
+share/witchblast/media/ui_spells.png
+share/witchblast/media/ui_top_layer.png
+share/witchblast/media/vampire.png
+share/witchblast/media/vampire_bat.png
+share/witchblast/media/vampire_part.png
+share/witchblast/media/win_seal.png
+share/witchblast/media/witch.png
+share/witchblast/media/witch_intro.png
+share/witchblast/media/zombie.png
diff --git a/witchblast/distinfo b/witchblast/distinfo
new file mode 100644
index 0000000000..169017cdcd
--- /dev/null
+++ b/witchblast/distinfo
@@ -0,0 +1,10 @@
+$NetBSD$
+
+SHA1 (witchblast/v0.7.5.tar.gz) = 16dbcc0039b56cec4f6c98e36d1773f09889a209
+RMD160 (witchblast/v0.7.5.tar.gz) = b49f3759feeba5848f6e33081c96611e2183519c
+SHA512 (witchblast/v0.7.5.tar.gz) = bd04ada1f6dee2ab9a7e09fe964f6dabd159f9bff69d189e76938781a7ecf7237a4203a0e4e27146220731152e7e0cef5b814c09d07050020a3fd6d18b67942a
+Size (witchblast/v0.7.5.tar.gz) = 41334398 bytes
+SHA1 (patch-src_Constants.h) = 17fdc3d3c140f10337d1d4ac6355a8932b61d1a3
+SHA1 (patch-src_DungeonMapEntity.cpp) = 61d9416ef13059acac01d63a0514d7818beed1a5
+SHA1 (patch-src_TextMapper.cpp) = c93471feb2d46fea8cbd237765da611a863c2854
+SHA1 (patch-src_WitchBlastGame.cpp) = 13a4e8f8a16a07e0f091270358b0b8e8e8921da1
diff --git a/witchblast/patches/patch-src_Constants.h b/witchblast/patches/patch-src_Constants.h
new file mode 100644
index 0000000000..30cc17925b
--- /dev/null
+++ b/witchblast/patches/patch-src_Constants.h
@@ -0,0 +1,23 @@
+$NetBSD$
+
+Store game data in the user's home directory.
+Should we use XDG paths instead?
+
+--- src/Constants.h.orig 2015-10-29 08:36:26.000000000 +0000
++++ src/Constants.h
+@@ -22,10 +22,11 @@
+ const std::string APP_NAME = "Witch Blast";
+ const std::string APP_VERSION = "0.7.5";
+
+-const std::string CONFIG_FILE = "config.dat";
+-const std::string SAVE_FILE = "game.sav";
+-const std::string SAVE_DATA_FILE = "data/data.sav";
+-const std::string HISCORES_FILE = "data/scores.dat";
++const std::string PLAYER_DATA = getenv("HOME") + std::string("/.witchblast/");
++const std::string CONFIG_FILE = PLAYER_DATA + "config.dat";
++const std::string SAVE_FILE = PLAYER_DATA + "game.sav";
++const std::string SAVE_DATA_FILE = PLAYER_DATA + "data.sav";
++const std::string HISCORES_FILE = PLAYER_DATA + "scores.dat";
+
+ const std::string SAVE_VERSION = "SAVE_0.7";
+ const std::string SCORE_VERSION = "V075";
diff --git a/witchblast/patches/patch-src_DungeonMapEntity.cpp b/witchblast/patches/patch-src_DungeonMapEntity.cpp
new file mode 100644
index 0000000000..422735ad1e
--- /dev/null
+++ b/witchblast/patches/patch-src_DungeonMapEntity.cpp
@@ -0,0 +1,39 @@
+$NetBSD$
+
+Search the installation directories for data files.
+
+--- src/DungeonMapEntity.cpp.orig 2015-10-29 08:36:26.000000000 +0000
++++ src/DungeonMapEntity.cpp
+@@ -848,16 +848,16 @@ void DungeonMapEntity::computeVertices()
+ switch (roomType)
+ {
+ case roomTypeChallenge:
+- ImageManager::getInstance().getImage(IMAGE_OVERLAY)->loadFromFile("media/overlay_boss_01.png");
++ ImageManager::getInstance().getImage(IMAGE_OVERLAY)->loadFromFile(WITCHBLAST_DATA_DIR "media/overlay_boss_01.png");
+ break;
+ case roomTypeTemple:
+- ImageManager::getInstance().getImage(IMAGE_OVERLAY)->loadFromFile("media/overlay_temple.png");
++ ImageManager::getInstance().getImage(IMAGE_OVERLAY)->loadFromFile(WITCHBLAST_DATA_DIR "media/overlay_temple.png");
+ break;
+ case roomTypeMerchant:
+- ImageManager::getInstance().getImage(IMAGE_OVERLAY)->loadFromFile("media/overlay_shop.png");
++ ImageManager::getInstance().getImage(IMAGE_OVERLAY)->loadFromFile(WITCHBLAST_DATA_DIR "media/overlay_shop.png");
+ break;
+ case roomTypeBoss:
+- ss << "media/overlay_boss_0" << game().getLevel() << ".png";
++ ss << WITCHBLAST_DATA_DIR "media/overlay_boss_0" << game().getLevel() << ".png";
+ ImageManager::getInstance().getImage(IMAGE_OVERLAY)->loadFromFile(ss.str());
+ break;
+ default:
+@@ -868,9 +868,9 @@ void DungeonMapEntity::computeVertices()
+ || gameMap->getObjectTile(8, 2) == MAPOBJ_BANK
+ || gameMap->getObjectTile(8, 2) == MAPOBJ_BANK_BOTTOM
+ )
+- ImageManager::getInstance().getImage(IMAGE_OVERLAY)->loadFromFile("media/overlay_temple.png");
++ ImageManager::getInstance().getImage(IMAGE_OVERLAY)->loadFromFile(WITCHBLAST_DATA_DIR "media/overlay_temple.png");
+ else
+- ImageManager::getInstance().getImage(IMAGE_OVERLAY)->loadFromFile("media/overlay_00.png");
++ ImageManager::getInstance().getImage(IMAGE_OVERLAY)->loadFromFile(WITCHBLAST_DATA_DIR "media/overlay_00.png");
+ break;
+ }
+ overlaySprite.setTexture(*ImageManager::getInstance().getImage(IMAGE_OVERLAY));
diff --git a/witchblast/patches/patch-src_TextMapper.cpp b/witchblast/patches/patch-src_TextMapper.cpp
new file mode 100644
index 0000000000..244f998bf9
--- /dev/null
+++ b/witchblast/patches/patch-src_TextMapper.cpp
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Search the installation directories for data files.
+
+--- src/TextMapper.cpp.orig 2015-10-29 08:36:26.000000000 +0000
++++ src/TextMapper.cpp
+@@ -37,7 +37,7 @@ namespace tools
+ void TextMapper::LoadTextFile(const std::string & language)
+ {
+ // 1. open file
+- std::ifstream textFile("data/" + textFileName);
++ std::ifstream textFile(WITCHBLAST_DATA_DIR "data/" + textFileName);
+ if (!textFile)
+ std::cout << "[ERROR] No text file !";
+
diff --git a/witchblast/patches/patch-src_WitchBlastGame.cpp b/witchblast/patches/patch-src_WitchBlastGame.cpp
new file mode 100644
index 0000000000..12424798d0
--- /dev/null
+++ b/witchblast/patches/patch-src_WitchBlastGame.cpp
@@ -0,0 +1,103 @@
+$NetBSD$
+
+Search the installation directories for data files.
+Create the player data directory.
+
+--- src/WitchBlastGame.cpp.orig 2015-10-29 08:36:26.000000000 +0000
++++ src/WitchBlastGame.cpp
+@@ -68,6 +68,7 @@
+ #include <ctime>
+ #include <iomanip>
+ #include <algorithm>
++#include <sys/stat.h>
+
+ //#define LEVEL_TEST_MODE
+
+@@ -349,7 +350,11 @@ WitchBlastGame::WitchBlastGame()
+ };
+
+ for (const char *const filename : images)
+- ImageManager::getInstance().addImage(filename);
++ {
++ std::string fullname = WITCHBLAST_DATA_DIR;
++ fullname += filename;
++ ImageManager::getInstance().addImage(fullname.c_str());
++ }
+
+ const char *const sounds[] =
+ {
+@@ -432,14 +437,16 @@ WitchBlastGame::WitchBlastGame()
+ SoundManager::getInstance().setVolume(parameters.soundVolume);
+ for (const char *const filename : sounds)
+ {
+- SoundManager::getInstance().addSound(filename);
++ std::string fullname = WITCHBLAST_DATA_DIR;
++ fullname += filename;
++ SoundManager::getInstance().addSound(fullname.c_str());
+ }
+
+- if (font.loadFromFile("media/DejaVuSans-Bold.ttf"))
++ if (font.loadFromFile(WITCHBLAST_DATA_DIR "media/DejaVuSans-Bold.ttf"))
+ {
+ myText.setFont(font);
+ }
+- graphicsFont.loadFromFile("media/Caudex-Bold.ttf");
++ graphicsFont.loadFromFile(WITCHBLAST_DATA_DIR "media/Caudex-Bold.ttf");
+
+ miniMap = NULL;
+ currentMap = NULL;
+@@ -480,6 +487,8 @@ WitchBlastGame::WitchBlastGame()
+ scoreState = ScoreOK;
+ loopCounter = 0;
+
++ mkdir(PLAYER_DATA.c_str(), 0700);
++
+ loadGameData();
+ loadHiScores();
+ receiveScoreFromServer();
+@@ -5544,9 +5553,9 @@ void WitchBlastGame::playMusic(musicEnum
+
+ switch (r)
+ {
+- case 0: ok = music.openFromFile("media/sound/WitchBlastTheme.ogg"); break;
+- case 1: ok = music.openFromFile("media/sound/SavageLife.ogg"); break;
+- case 2: ok = music.openFromFile("media/sound/HauntedLighthouse.ogg"); break;
++ case 0: ok = music.openFromFile(WITCHBLAST_DATA_DIR "media/sound/WitchBlastTheme.ogg"); break;
++ case 1: ok = music.openFromFile(WITCHBLAST_DATA_DIR "media/sound/SavageLife.ogg"); break;
++ case 2: ok = music.openFromFile(WITCHBLAST_DATA_DIR "media/sound/HauntedLighthouse.ogg"); break;
+ }
+
+ currentStandardMusic = r;
+@@ -5554,19 +5563,19 @@ void WitchBlastGame::playMusic(musicEnum
+ break;
+
+ case MusicEnding:
+- ok = music.openFromFile("media/sound/AmbiantMedieval.ogg");
++ ok = music.openFromFile(WITCHBLAST_DATA_DIR "media/sound/AmbiantMedieval.ogg");
+ break;
+
+ case MusicBoss:
+- ok = music.openFromFile("media/sound/ShowMeThePower.ogg");
++ ok = music.openFromFile(WITCHBLAST_DATA_DIR "media/sound/ShowMeThePower.ogg");
+ break;
+
+ case MusicChallenge:
+- ok = music.openFromFile("media/sound/HellsFire.ogg");
++ ok = music.openFromFile(WITCHBLAST_DATA_DIR "media/sound/HellsFire.ogg");
+ break;
+
+ case MusicIntro:
+- ok = music.openFromFile("media/sound/WitchBlastTheme.ogg");
++ ok = music.openFromFile(WITCHBLAST_DATA_DIR "media/sound/WitchBlastTheme.ogg");
+ break;
+ }
+
+@@ -5597,7 +5606,7 @@ void WitchBlastGame::updateMusicVolume()
+ {
+ if (parameters.musicVolume > 0)
+ {
+- bool ok = music.openFromFile("media/sound/wb.ogg");
++ bool ok = music.openFromFile(WITCHBLAST_DATA_DIR "media/sound/wb.ogg");
+ music.setVolume(parameters.musicVolume * VolumeModifier / 100);
+ if (ok) music.play();
+ }
Home |
Main Index |
Thread Index |
Old Index