mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-22 03:30:05 +02:00
New recipe for updated LBreakout2 version 2.6.5
Pulled the rdef out of the patchset into additional-files. Added the I-O-M icon file to the additional-files. Re-created the patchset as the old one didn't apply cleanly anymore. Removed the $localStateDir as otherwise there was a stray var folder in the hpkg.
This commit is contained in:
BIN
games-puzzle/lbreakout2/additional-files/LBreakout2.iom
Normal file
BIN
games-puzzle/lbreakout2/additional-files/LBreakout2.iom
Normal file
Binary file not shown.
34
games-puzzle/lbreakout2/additional-files/lbreakout2.rdef
Normal file
34
games-puzzle/lbreakout2/additional-files/lbreakout2.rdef
Normal file
@@ -0,0 +1,34 @@
|
||||
resource app_signature "application/x-vnd.lgames.lbreakout2";
|
||||
|
||||
resource app_flags B_SINGLE_LAUNCH;
|
||||
|
||||
resource app_version {
|
||||
major = 2,
|
||||
middle = 6,
|
||||
minor = 5,
|
||||
|
||||
/* 0 = development 1 = alpha 2 = beta
|
||||
3 = gamma 4 = golden master 5 = final */
|
||||
variety = 5,
|
||||
|
||||
internal = 0,
|
||||
|
||||
short_info = "LBreakout2 arcade game",
|
||||
long_info = "LBreakout2 is a fun breakout-style arcade game."
|
||||
};
|
||||
|
||||
resource vector_icon {
|
||||
$"6E63696605020106023D5FC8326AB4B225F53CFFCE4A14594559B7FFA5040400"
|
||||
$"FF9E9E02000205B6B6DB3925EEBD5FCABAE8BF4A54944AC9EB00FFCD22FF34EA"
|
||||
$"BE26FF77F1D806F983E5D882FFFEC2A43EFF020106023B7084B697593638963A"
|
||||
$"F2BB44015549CCC600AAD2A5F440503F050001010000850502044C24C62E24C2"
|
||||
$"E124442C44B62144B96E4C34C2E134C62E34542C54B96E54B6210604AF303937"
|
||||
$"3C2B3A2948243E2D4A48584E450204B6C93AB86F3AB5223AB3CBC0BFB3CBBEE0"
|
||||
$"B3CBC29DB6C94BB5224BB86F4B31C0BF31C29D31BEE006033E402E5037423A50"
|
||||
$"374438493B3F330606BE0F3039243D28352342294822452948445653574D5C5A"
|
||||
$"504E4555474642090A040104023FFB5DB90A98390A983FFB5D4347234571E30A"
|
||||
$"03010430222001178500040A020102024000000000000000003FC3C3430000BD"
|
||||
$"C3C30A0101012022200A02010202404DAB000000000000404DAB4A46D645D13D"
|
||||
$"0A0001002022200A03010030222001178100040A0301032022200A030103023E"
|
||||
$"C27B0000000000003EC27B46B88E46B10D"
|
||||
};
|
||||
70
games-puzzle/lbreakout2/lbreakout2-2.6.5.recipe
Normal file
70
games-puzzle/lbreakout2/lbreakout2-2.6.5.recipe
Normal file
@@ -0,0 +1,70 @@
|
||||
SUMMARY="A fun breakout-style arcade game"
|
||||
DESCRIPTION="The successor to LBreakout offers you a new challenge in more \
|
||||
than 50 levels with loads of new bonuses (goldshower, joker, explosive balls, \
|
||||
bonus magnet), maluses (chaos, darkness, weak balls, malus magnet) \
|
||||
and special bricks (growing bricks, explosive bricks, regenerative bricks).
|
||||
If you are hungry for more you can create your own levelsets with the \
|
||||
integrated level editor.
|
||||
There is also an experimental two player mode (via LAN) available."
|
||||
HOMEPAGE="http://lgames.sourceforge.net/"
|
||||
COPYRIGHT="2001-2015 Michael Speck"
|
||||
LICENSE="GNU GPL v2"
|
||||
REVISION="1"
|
||||
SOURCE_URI="https://sourceforge.net/projects/lgames/files/lbreakout2/2.6/lbreakout2-$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="9104d6175553da3442dc6a5fc407a669e2f5aff3eedc5d30409eb003b7a78d6f"
|
||||
PATCHES="lbreakout2-$portVersion.patchset"
|
||||
ADDITIONAL_FILES="lbreakout2.rdef"
|
||||
|
||||
ARCHITECTURES="x86_gcc2 ?x86 ?x86_64"
|
||||
|
||||
PROVIDES="
|
||||
lbreakout2 = $portVersion
|
||||
cmd:lbreakout2 = $portVersion
|
||||
cmd:lbreakout2server = $portVersion
|
||||
"
|
||||
REQUIRES="
|
||||
haiku
|
||||
lib:libsdl
|
||||
lib:libsdl_mixer
|
||||
lib:libsdl_net_1.2
|
||||
lib:libpng
|
||||
lib:libz
|
||||
lib:libintl
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku_devel
|
||||
devel:libsdl
|
||||
devel:libsdl_mixer
|
||||
devel:libsdl_net_1.2
|
||||
devel:libintl
|
||||
devel:libz
|
||||
devel:libpng
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:make
|
||||
cmd:gcc
|
||||
cmd:ld
|
||||
cmd:libtoolize
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
libtoolize --force --copy --install
|
||||
LDFLAGS="-lintl -lnetwork" runConfigure ./configure --with-docdir=$documentationDir
|
||||
make $jobArgs
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
make install
|
||||
|
||||
addResourcesToBinaries $portDir/additional-files/lbreakout2.rdef \
|
||||
$binDir/lbreakout2
|
||||
|
||||
rm -rf $localStateDir
|
||||
rm -rf $dataDir/applications
|
||||
rm -rf $dataDir/icons
|
||||
|
||||
addAppDeskbarSymlink $binDir/lbreakout2 LBreakout2
|
||||
}
|
||||
503
games-puzzle/lbreakout2/patches/lbreakout2-2.6.5.patchset
Normal file
503
games-puzzle/lbreakout2/patches/lbreakout2-2.6.5.patchset
Normal file
@@ -0,0 +1,503 @@
|
||||
From a2d2c254f96fe00ed597632009108674aca5316f Mon Sep 17 00:00:00 2001
|
||||
From: Humdinger <humdingerb@gmail.com>
|
||||
Date: Sat, 16 Jul 2016 09:26:26 +0200
|
||||
Subject: Relocate save files, high scores and config
|
||||
|
||||
Originally by Markus Himmel.
|
||||
|
||||
diff --git a/client/chart.c b/client/chart.c
|
||||
index 68e9f44..7da0542 100644
|
||||
--- a/client/chart.c
|
||||
+++ b/client/chart.c
|
||||
@@ -202,17 +202,22 @@ void chart_load()
|
||||
if ( charts ) list_delete( charts ); charts = 0;
|
||||
charts = list_create( LIST_AUTO_DELETE, chart_set_delete );
|
||||
/* load highscore */
|
||||
+#ifndef __HAIKU__
|
||||
if ( !chart_load_from_path( HI_DIR ) ) {
|
||||
fprintf( stderr, _("Unable to access highscore chart in '%s'.\n"), HI_DIR );
|
||||
fprintf( stderr, _("Trying to use config directory '%s'.\n"), config.dir_name );
|
||||
+#endif
|
||||
if ( !chart_load_from_path( config.dir_name ) ) {
|
||||
fprintf( stderr, _("Unable to access highscore chart in config directory... won't be "
|
||||
"able to save any results. Sorry.\n") );
|
||||
return;
|
||||
}
|
||||
+#ifndef __HAIKU__
|
||||
}
|
||||
+#endif
|
||||
printf( _("Saving highscore chart in: %s\n"), chart_path );
|
||||
/* compute size and position stuff of highscore */
|
||||
+ {
|
||||
char *cheader = _("Name Level Score");
|
||||
chart_pos.w = stk_font_string_width( ccfont, cheader );
|
||||
chart_pos.h = ccfont->height + chart_gap + /* title + gap */
|
||||
@@ -220,6 +225,7 @@ void chart_load()
|
||||
chart_gap + /*gap between caption and entries */
|
||||
ccfont->height; /* caption size */
|
||||
chart_level_offset = stk_font_string_width( ccfont, _("name.-----") ) + stk_font_string_width( ccfont, _("Level") ) / 2; /* level offset centered */
|
||||
+ }
|
||||
}
|
||||
/*
|
||||
====================================================================
|
||||
@@ -344,6 +350,7 @@ void chart_show( Set_Chart *chart, int x, int y, int w, int h )
|
||||
chart->name );
|
||||
/* caption */
|
||||
ccfont->align = STK_FONT_ALIGN_LEFT | STK_FONT_ALIGN_TOP;
|
||||
+ {
|
||||
char *cheader = _("Name Level Score");
|
||||
stk_font_write( ccfont, stk_display,
|
||||
chart_pos.x, chart_pos.y + ccfont->height + chart_gap, -1,
|
||||
@@ -370,6 +377,7 @@ void chart_show( Set_Chart *chart, int x, int y, int w, int h )
|
||||
chart_pos.x + chart_pos.w, entry_offset, -1, number_buffer );
|
||||
/* change offset */
|
||||
entry_offset += font->height;
|
||||
+ }
|
||||
}
|
||||
stk_display_store_rect( &chart_pos );
|
||||
}
|
||||
@@ -389,12 +397,13 @@ void chart_show_compact( Set_Chart *chart, int x, int y, int w, int h )
|
||||
|
||||
/* caption */
|
||||
ccfont->align = STK_FONT_ALIGN_LEFT | STK_FONT_ALIGN_TOP;
|
||||
+ {
|
||||
char *cheader = _("Name Level Score");
|
||||
stk_font_write( ccfont, stk_display, px, py, -1, cheader );
|
||||
|
||||
/* get entry offset */
|
||||
entry_offset = ( ccfont->height + 2) + py;
|
||||
-
|
||||
+
|
||||
/* entries */
|
||||
for ( i = 0; i < CHART_ENTRY_COUNT; i++ ) {
|
||||
font = cfont;
|
||||
@@ -416,6 +425,7 @@ void chart_show_compact( Set_Chart *chart, int x, int y, int w, int h )
|
||||
/* change offset */
|
||||
entry_offset += font->height - 1;
|
||||
}
|
||||
+ }
|
||||
{ SDL_Rect region = { x, y, w, h };
|
||||
stk_display_store_rect( ®ion ); }
|
||||
}
|
||||
diff --git a/client/config.c b/client/config.c
|
||||
index 83a924c..42faa07 100644
|
||||
--- a/client/config.c
|
||||
+++ b/client/config.c
|
||||
@@ -21,6 +21,11 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
+#ifdef __HAIKU__
|
||||
+#include <FindDirectory.h>
|
||||
+#include <fs_info.h>
|
||||
+#endif
|
||||
+
|
||||
#include "config.h"
|
||||
#include "../common/parser.h"
|
||||
|
||||
@@ -38,7 +43,19 @@ Config config;
|
||||
void config_check_dir()
|
||||
{
|
||||
char level_dir[512];
|
||||
- snprintf( config.dir_name, sizeof(config.dir_name)-1, "%s/%s", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME );
|
||||
+#ifdef __HAIKU__
|
||||
+ dev_t volume = dev_for_path("/boot");
|
||||
+ if ( find_directory( B_USER_SETTINGS_DIRECTORY, volume, false,
|
||||
+ config.dir_name, sizeof(config.dir_name)-1 ) == B_OK &&
|
||||
+ strlen(config.dir_name) + strlen(CONFIG_DIR_NAME)
|
||||
+ < sizeof(config.dir_name)-1 ) {
|
||||
+ strcat(config.dir_name, "/");
|
||||
+ strcat(config.dir_name, CONFIG_DIR_NAME);
|
||||
+ } else
|
||||
+ snprintf( config.dir_name, sizeof(config.dir_name)-1, "%s/%s", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME );
|
||||
+#else
|
||||
+ snprintf( config.dir_name, sizeof(config.dir_name)-1, "%s/%s", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME );
|
||||
+#endif
|
||||
/* test and create .lgames */
|
||||
if ( opendir( config.dir_name ) == 0 ) {
|
||||
fprintf( stderr, "couldn't find/open config directory '%s'\n", config.dir_name );
|
||||
diff --git a/client/editor.c b/client/editor.c
|
||||
index e182081..ff8503e 100644
|
||||
--- a/client/editor.c
|
||||
+++ b/client/editor.c
|
||||
@@ -15,6 +15,11 @@
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
+#ifdef __HAIKU__
|
||||
+#include <FindDirectory.h>
|
||||
+#include <fs_info.h>
|
||||
+#endif
|
||||
+
|
||||
#include "lbreakout.h"
|
||||
#include "../game/game.h"
|
||||
#include "game.h"
|
||||
@@ -722,7 +727,22 @@ int editor_init( char *file_name )
|
||||
{
|
||||
FILE *file = 0;
|
||||
/* set full file name */
|
||||
- snprintf( edit_file_name, sizeof(edit_file_name)-1, "%s/%s/lbreakout2-levels/%s", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME, file_name );
|
||||
+#ifdef __HAIKU__
|
||||
+ dev_t volume = dev_for_path("/boot");
|
||||
+ if ( find_directory(B_USER_SETTINGS_DIRECTORY, volume, false,
|
||||
+ edit_file_name, sizeof(edit_file_name)-1 ) == B_OK &&
|
||||
+ strlen(edit_file_name) + strlen(CONFIG_DIR_NAME) + strlen(file_name)
|
||||
+ < sizeof(edit_file_name) - 18 ) {
|
||||
+ strcat(edit_file_name, "/");
|
||||
+ strcat(edit_file_name, CONFIG_DIR_NAME);
|
||||
+ strcat(edit_file_name, "/lbreakout2-levels/");
|
||||
+ strcat(edit_file_name, file_name);
|
||||
+ } else
|
||||
+ snprintf( edit_file_name, sizeof(edit_file_name)-1, "%s/%s/lbreakout2-levels/%s", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME, file_name );
|
||||
+ fprintf( stderr, "HAIKU: Saving at %s\n", edit_file_name);
|
||||
+#else
|
||||
+ snprintf( edit_file_name, sizeof(edit_file_name)-1, "%s/%s/lbreakout2-levels/%s", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME, file_name );
|
||||
+#endif
|
||||
/* test this file for write access. use append to keep contents */
|
||||
if ( ( file = fopen( edit_file_name, "a" ) ) == 0 ) {
|
||||
fprintf( stderr, "Permission to write to file '%s' denied.\n", edit_file_name );
|
||||
diff --git a/client/lbreakout.h b/client/lbreakout.h
|
||||
index 4b0090c..8ab9cd6 100644
|
||||
--- a/client/lbreakout.h
|
||||
+++ b/client/lbreakout.h
|
||||
@@ -48,6 +48,8 @@ Global definitions for LBreakout and general system includes.
|
||||
/* config directory name in home directory */
|
||||
#ifdef _WIN32
|
||||
#define CONFIG_DIR_NAME "lgames"
|
||||
+#elif __HAIKU__
|
||||
+#define CONFIG_DIR_NAME "LGames"
|
||||
#else
|
||||
#define CONFIG_DIR_NAME ".lgames"
|
||||
#endif
|
||||
diff --git a/client/main.c b/client/main.c
|
||||
index 81e7f57..7f29cfc 100644
|
||||
--- a/client/main.c
|
||||
+++ b/client/main.c
|
||||
@@ -23,6 +23,11 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
+#ifdef __HAIKU__
|
||||
+#include <FindDirectory.h>
|
||||
+#include <fs_info.h>
|
||||
+#endif
|
||||
+
|
||||
#include "lbreakout.h"
|
||||
#include "../game/game.h"
|
||||
#include "file.h"
|
||||
@@ -198,7 +203,19 @@ int main(int argc, char *argv[])
|
||||
/* new set? */
|
||||
if ( strequal( NEW_SET, edit_set ) ) {
|
||||
editor_file = calloc( 16, sizeof( char ) );
|
||||
+#ifdef __HAIKU__
|
||||
+ if ( find_directory(B_USER_SETTINGS_DIRECTORY, dev_for_path("/boot"), false,
|
||||
+ path, sizeof(path)-1 ) == B_OK &&
|
||||
+ strlen(path) + strlen(CONFIG_DIR_NAME)
|
||||
+ < sizeof(path) - 18 ) {
|
||||
+ strcat(path, "/");
|
||||
+ strcat(path, CONFIG_DIR_NAME);
|
||||
+ strcat(path, "/lbreakout2-levels");
|
||||
+ } else
|
||||
+ snprintf( path, sizeof(path)-1, "%s/%s/lbreakout2-levels", getenv( "HOME" )? getenv("HOME"):".", CONFIG_DIR_NAME );
|
||||
+#else
|
||||
snprintf( path, sizeof(path)-1, "%s/%s/lbreakout2-levels", getenv( "HOME" )? getenv("HOME"):".", CONFIG_DIR_NAME );
|
||||
+#endif
|
||||
if ( !enter_string( font, _("Set Name:"), editor_file, 12 ) || !file_check( path, editor_file, "w" ) ) {
|
||||
free( editor_file );
|
||||
break;
|
||||
diff --git a/client/manager.c b/client/manager.c
|
||||
index 5c94c38..c798bc1 100644
|
||||
--- a/client/manager.c
|
||||
+++ b/client/manager.c
|
||||
@@ -15,6 +15,11 @@
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
+#ifdef __HAIKU__
|
||||
+#include <FindDirectory.h>
|
||||
+#include <fs_info.h>
|
||||
+#endif
|
||||
+
|
||||
#include "manager.h"
|
||||
#include "../game/game.h"
|
||||
#include "file.h"
|
||||
@@ -278,7 +283,19 @@ void levelsets_load_names()
|
||||
delete_text( text );
|
||||
}
|
||||
/* parse home directory */
|
||||
- snprintf( level_dir, sizeof(level_dir)-1, "%s/%s/lbreakout2-levels", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME );
|
||||
+#ifdef __HAIKU__
|
||||
+ if ( find_directory( B_USER_SETTINGS_DIRECTORY, dev_for_path("/boot"), false,
|
||||
+ level_dir, sizeof(level_dir)-1 ) == B_OK &&
|
||||
+ strlen(level_dir) + strlen(CONFIG_DIR_NAME)
|
||||
+ < sizeof(level_dir)-19 ) {
|
||||
+ strcat(level_dir, "/");
|
||||
+ strcat(level_dir, CONFIG_DIR_NAME);
|
||||
+ strcat(level_dir, "/lbreakout2-levels");
|
||||
+ } else
|
||||
+ snprintf( level_dir, sizeof(level_dir)-1, "%s/%s/lbreakout2-levels", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME );
|
||||
+#else
|
||||
+ snprintf( level_dir, sizeof(level_dir)-1, "%s/%s/lbreakout2-levels", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME );
|
||||
+#endif
|
||||
if ( ( text = get_file_list( level_dir, 0, level_dir ) ) ) {
|
||||
for ( i = 0; i < text->count; i++ ) {
|
||||
/* filter stuff */
|
||||
@@ -353,7 +370,21 @@ void cb_delete_set()
|
||||
return;
|
||||
}
|
||||
/* get file name + path */
|
||||
- snprintf( fname, sizeof(fname)-1,"%s/%s/lbreakout2-levels/%s", getenv( "HOME" ), CONFIG_DIR_NAME, levelset_names_home[config.levelset_id_home] );
|
||||
+#ifdef __HAIKU__
|
||||
+ if ( find_directory( B_USER_SETTINGS_DIRECTORY, dev_for_path("/boot"), false,
|
||||
+ fname, sizeof(fname)-1 ) == B_OK &&
|
||||
+ strlen(fname) + strlen(CONFIG_DIR_NAME)
|
||||
+ + strlen(levelset_names_home[config.levelset_id_home])
|
||||
+ < sizeof(fname)-19 ) {
|
||||
+ strcat(fname, "/");
|
||||
+ strcat(fname, CONFIG_DIR_NAME);
|
||||
+ strcat(fname, "/lbreakout2-levels/");
|
||||
+ strcat(fname, levelset_names_home[config.levelset_id_home]);
|
||||
+ } else
|
||||
+ snprintf( fname, sizeof(fname)-1,"%s/%s/lbreakout2-levels/%s", getenv( "HOME" ), CONFIG_DIR_NAME, levelset_names_home[config.levelset_id_home] );
|
||||
+#else
|
||||
+ snprintf( fname, sizeof(fname)-1,"%s/%s/lbreakout2-levels/%s", getenv( "HOME" ), CONFIG_DIR_NAME, levelset_names_home[config.levelset_id_home] );
|
||||
+#endif
|
||||
remove( fname );
|
||||
levelsets_load_names(); /* reinit name lists and configs indices */
|
||||
/* reassign these name lists as position in memory has changed */
|
||||
diff --git a/client/slot.c b/client/slot.c
|
||||
index 238d4c8..a32805a 100644
|
||||
--- a/client/slot.c
|
||||
+++ b/client/slot.c
|
||||
@@ -15,15 +15,34 @@
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
+#ifdef __HAIKU__
|
||||
+#include <FindDirectory.h>
|
||||
+#include <fs_info.h>
|
||||
+#endif
|
||||
+
|
||||
#include "lbreakout.h"
|
||||
#include "slot.h"
|
||||
|
||||
static FILE *open_slot( int id, char *mode )
|
||||
{
|
||||
char fname[512];
|
||||
- snprintf( fname, 511, "%s/%s/lbr2_save_%d",
|
||||
- (getenv( "HOME" )?getenv( "HOME" ):"."),
|
||||
+#ifdef __HAIKU__
|
||||
+ dev_t volume = dev_for_path("/boot");
|
||||
+ if ( find_directory(B_USER_SETTINGS_DIRECTORY, volume, false,
|
||||
+ fname, sizeof(fname)-1 ) == B_OK && strlen(fname) +
|
||||
+ strlen(CONFIG_DIR_NAME) < sizeof(fname) - 16 ) {
|
||||
+ off_t len = strlen(fname);
|
||||
+ snprintf( fname+len, 511-len, "/%s/lbr2_save_%d", CONFIG_DIR_NAME, id);
|
||||
+ } else
|
||||
+ snprintf( fname, 511, "%s/%s/lbr2_save_%d",
|
||||
+ (getenv( "HOME" )?getenv( "HOME" ):"."),
|
||||
CONFIG_DIR_NAME, id );
|
||||
+ fprintf( stderr, "HAIKU: Accessing savefile at %s\n", fname );
|
||||
+#else
|
||||
+ snprintf( fname, 511, "%s/%s/lbr2_save_%d",
|
||||
+ (getenv( "HOME" )?getenv( "HOME" ):"."),
|
||||
+ CONFIG_DIR_NAME, id );
|
||||
+#endif
|
||||
//printf( "accessing '%s' in mode '%s'\n", fname, mode );
|
||||
return fopen( fname, mode );
|
||||
}
|
||||
@@ -62,9 +81,22 @@ int slot_save( int slot_id, GameSlot *gs )
|
||||
int slot_delete( int slot_id )
|
||||
{
|
||||
char fname[512];
|
||||
+#ifdef __HAIKU__
|
||||
+ dev_t volume = dev_for_path("/boot");
|
||||
+ if ( find_directory(B_USER_SETTINGS_DIRECTORY, volume, false,
|
||||
+ fname, sizeof(fname)-1 ) == B_OK && strlen(fname) +
|
||||
+ strlen(CONFIG_DIR_NAME) < sizeof(fname) - 16 ) {
|
||||
+ off_t len = strlen(fname);
|
||||
+ snprintf( fname+len, 511-len, "/%s/lbr2_save_%d", CONFIG_DIR_NAME, slot_id);
|
||||
+ } else
|
||||
+ snprintf( fname, 511, "%s/%s/lbr2_save_%d",
|
||||
+ (getenv( "HOME" )?getenv( "HOME" ):"."),
|
||||
+ CONFIG_DIR_NAME, slot_id );
|
||||
+#else
|
||||
snprintf( fname, 511, "%s/%s/lbr2_save_%d",
|
||||
(getenv( "HOME" )?getenv( "HOME" ):"."),
|
||||
CONFIG_DIR_NAME, slot_id );
|
||||
+#endif
|
||||
if ( remove(fname) != 0 )
|
||||
{
|
||||
fprintf( stderr, "ERROR: couldn't delete file %s\n", fname );
|
||||
diff --git a/client/theme.c b/client/theme.c
|
||||
index ad6de96..b1ef0a3 100644
|
||||
--- a/client/theme.c
|
||||
+++ b/client/theme.c
|
||||
@@ -15,6 +15,11 @@
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
+#ifdef __HAIKU__
|
||||
+#include <FindDirectory.h>
|
||||
+#include <fs_info.h>
|
||||
+#endif
|
||||
+
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
@@ -133,10 +138,25 @@ static char theme_dir[512];
|
||||
static char theme_path[512];
|
||||
void theme_set_dir( char *name )
|
||||
{
|
||||
- if ( name[0] == '~' )
|
||||
+ if ( name[0] == '~' ) {
|
||||
+#ifdef __HAIKU__
|
||||
+ dev_t volume = dev_for_path("/boot");
|
||||
+ if ( find_directory( B_USER_SETTINGS_DIRECTORY, volume, false,
|
||||
+ theme_dir, sizeof(theme_dir)-1 ) == B_OK &&
|
||||
+ strlen(theme_dir) + strlen(CONFIG_DIR_NAME) + strlen(name)
|
||||
+ < sizeof(theme_dir)-19 ) {
|
||||
+ strcat(theme_dir, "/");
|
||||
+ strcat(theme_dir, CONFIG_DIR_NAME);
|
||||
+ strcat(theme_dir, "/lbreakout2-themes/");
|
||||
+ strcat(theme_dir, name + (off_t)1);
|
||||
+ } else
|
||||
+ snprintf( theme_dir, sizeof(theme_dir)-1, "%s/%s/lbreakout2-themes/%s",
|
||||
+ (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME, name + 1 );
|
||||
+#else
|
||||
snprintf( theme_dir, sizeof(theme_dir)-1, "%s/%s/lbreakout2-themes/%s",
|
||||
(getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME, name + 1 );
|
||||
- else {
|
||||
+#endif
|
||||
+ } else {
|
||||
if ( STRCMP( SRC_DIR, "." ) ) {
|
||||
getcwd( theme_dir, 511 );
|
||||
strcat( theme_dir, "/gfx/" );
|
||||
@@ -327,6 +347,19 @@ void theme_get_list()
|
||||
closedir( hdir );
|
||||
}
|
||||
/* home theme directory */
|
||||
+#ifdef __HAIKU__
|
||||
+ if ( find_directory( B_USER_SETTINGS_DIRECTORY, dev_for_path("/boot"), false,
|
||||
+ dir, sizeof(dir)-1 ) == B_OK &&
|
||||
+ strlen(dir) + strlen(CONFIG_DIR_NAME)
|
||||
+ < sizeof(dir)-19 ) {
|
||||
+ strcat(dir, "/");
|
||||
+ strcat(dir, CONFIG_DIR_NAME);
|
||||
+ strcat(dir, "/lbreakout2-themes");
|
||||
+ } else
|
||||
+ snprintf( dir, sizeof(dir)-1, "%s/%s/lbreakout2-themes", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME );
|
||||
+#else
|
||||
+ snprintf( dir, sizeof(dir)-1, "%s/%s/lbreakout2-themes", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME );
|
||||
+#endif
|
||||
snprintf( dir, sizeof(dir)-1, "%s/%s/lbreakout2-themes", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME );
|
||||
if ( ( hdir = opendir( dir ) ) != 0 ) {
|
||||
while ( ( entry = readdir( hdir ) ) ) {
|
||||
diff --git a/game/levels.c b/game/levels.c
|
||||
index a93a633..2d7e84c 100644
|
||||
--- a/game/levels.c
|
||||
+++ b/game/levels.c
|
||||
@@ -15,6 +15,11 @@
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
+#ifdef __HAIKU__
|
||||
+#include <FindDirectory.h>
|
||||
+#include <fs_info.h>
|
||||
+#endif
|
||||
+
|
||||
#include "levels.h"
|
||||
|
||||
/*
|
||||
@@ -66,9 +71,26 @@ FILE *levelset_open( const char *fname, char *mode )
|
||||
FILE *file;
|
||||
char path[512];
|
||||
if ( fname[0] == '~' ) {
|
||||
- snprintf( path, sizeof(path)-1, "%s/%s/lbreakout2-levels/%s",
|
||||
- (getenv( "HOME" )?getenv( "HOME" ):"."),
|
||||
+#ifdef __HAIKU__
|
||||
+ if ( find_directory( B_USER_SETTINGS_DIRECTORY, dev_for_path("/boot"), false,
|
||||
+ path, sizeof(path)-1 ) == B_OK &&
|
||||
+ strlen(path) + strlen(CONFIG_DIR_NAME)
|
||||
+ + strlen(fname)
|
||||
+ < sizeof(path)-19 ) {
|
||||
+ strcat(path, "/");
|
||||
+ strcat(path, CONFIG_DIR_NAME);
|
||||
+ strcat(path, "/lbreakout2-levels/");
|
||||
+ strcat(path, fname + 1);
|
||||
+ } else
|
||||
+ snprintf( path, sizeof(path)-1, "%s/%s/lbreakout2-levels/%s",
|
||||
+ (getenv( "HOME" )?getenv( "HOME" ):"."),
|
||||
+ CONFIG_DIR_NAME, fname + 1 );
|
||||
+ fprintf ( stderr, "HAIKU: opening %s\n", path );
|
||||
+#else
|
||||
+ snprintf( path, sizeof(path)-1, "%s/%s/lbreakout2-levels/%s",
|
||||
+ (getenv( "HOME" )?getenv( "HOME" ):"."),
|
||||
CONFIG_DIR_NAME, fname + 1 );
|
||||
+#endif
|
||||
}
|
||||
else
|
||||
if ( fname[0] != '/' ) /* keep global pathes */
|
||||
@@ -275,10 +297,25 @@ int levelset_save( LevelSet *set, char *fname )
|
||||
int i, j, k;
|
||||
|
||||
if ( set == 0 || set->count == 0 ) return 0;
|
||||
-
|
||||
+#ifdef __HAIKU__
|
||||
+ if ( find_directory( B_USER_SETTINGS_DIRECTORY, dev_for_path("/boot"), false,
|
||||
+ path, sizeof(path)-1 ) == B_OK &&
|
||||
+ strlen(path) + strlen(CONFIG_DIR_NAME)
|
||||
+ + strlen(fname)
|
||||
+ < sizeof(path)-19 ) {
|
||||
+ strcat(path, "/");
|
||||
+ strcat(path, CONFIG_DIR_NAME);
|
||||
+ strcat(path, "/lbreakout2-levels/");
|
||||
+ strcat(path, (fname[0]=='~') ? fname + 1 : fname);
|
||||
+ } else
|
||||
+ snprintf( path, sizeof(path)-1, "%s/%s/lbreakout2-levels/%s",
|
||||
+ (getenv( "HOME" )?getenv( "HOME" ):"."),
|
||||
+ CONFIG_DIR_NAME, (fname[0]=='~')?fname+1:fname );
|
||||
+#else
|
||||
snprintf( path, sizeof(path)-1, "%s/%s/lbreakout2-levels/%s",
|
||||
(getenv( "HOME" )?getenv( "HOME" ):"."),
|
||||
CONFIG_DIR_NAME, (fname[0]=='~')?fname+1:fname );
|
||||
+#endif
|
||||
if ( ( file = fopen( path, "w" ) ) == 0 ) {
|
||||
fprintf( stderr, "couldn't open %s\n", path );
|
||||
return 0;
|
||||
--
|
||||
2.7.0
|
||||
|
||||
|
||||
From 01b2e359745bf090fe5c17c65ff29f2a794ecee2 Mon Sep 17 00:00:00 2001
|
||||
From: Humdinger <humdingerb@gmail.com>
|
||||
Date: Sat, 16 Jul 2016 09:31:55 +0200
|
||||
Subject: Changes to configure
|
||||
|
||||
Remove -lm, originally by Markus Himmel.
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index 6f899f5..5f1dc4c 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -8573,7 +8573,7 @@ if ${ac_cv_lib_m_main+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
ac_check_lib_save_LIBS=$LIBS
|
||||
-LIBS="-lm $LIBS"
|
||||
+LIBS="$LIBS"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
@@ -8602,7 +8602,7 @@ if test "x$ac_cv_lib_m_main" = xyes; then :
|
||||
#define HAVE_LIBM 1
|
||||
_ACEOF
|
||||
|
||||
- LIBS="-lm $LIBS"
|
||||
+ LIBS="$LIBS"
|
||||
|
||||
else
|
||||
as_fn_error $? "lib math is needed" "$LINENO" 5
|
||||
--
|
||||
2.7.0
|
||||
|
||||
Reference in New Issue
Block a user