blockout2: small tweaks. (#8512)

- Added a crude icon (modified from Haiku's one for "Links").
  Better than nothing, until someone creates a new one.
- Added resource / signature / app-flags, so it gets listed on
  Deskbar's "Recent Application" list (Happy now AlienSoldier?)
- Moved settings/score files from ~/.bl2 to
  $B_USER_SETTINGS_DIRECTORY/blockout2.
This commit is contained in:
OscarL
2023-04-25 04:09:11 -03:00
committed by GitHub
parent 8119bd88ad
commit 8e5f0e8d4b
4 changed files with 309 additions and 198 deletions

View File

@@ -0,0 +1,39 @@
resource app_flags B_SINGLE_LAUNCH;
resource app_version {
major = @MAJOR@,
middle = @MIDDLE@,
minor = @MINOR@,
variety = B_APPV_FINAL,
internal = 0,
short_info = "@SHORT_INFO@",
long_info = "@LONG_INFO@"
};
resource app_signature "application/x-vnd.games-puzzle.blockout2";
resource vector_icon {
$"6E6369661305000200060237E670B8880E39469D39AE144A52234B0D2500C6D7"
$"F5FF6B94DD03EC6666020006023B2B47BB18653D0FA53D225148297046CA1900"
$"00FF00FFA9FF00020016023B2B47BB18653D0FA53D225148297046CA1900FFFF"
$"8A020006023B3049396B0ABA90833C646E4A101543299500FFFFFFFF52FF5202"
$"0016023B3049396B0ABA90833C646E4A101543299500FFFFC9020006023C71E3"
$"3A0C78BA15E43C7D2149055549455700E3EDFFFF9EC2FF020006023CD8653068"
$"26B065D13CD5A34A6E4A46E21900FFDCDCFFDA5858020006023A1DA6393F04BB"
$"B5BC3C6B074AEA364809110087CA05FF026802020016023C00913B1266BB9E06"
$"3C5B934A01F04914EC00FFFF4E03003CB00200060230B31E3A09B9BB024238A1"
$"2F4BAB534AFF0B00A3043CFFFFDCE603CD4D4D030D296402000602BD498B3E11"
$"59BF219BBE7D2F4BE71F4AB31300C13E3EFFE27A7A040174020016023F2938BB"
$"F60A3BA9823EEC25C40E6348C15D0099FF00020016023E8FA33A7B71BA9D783E"
$"B2C049F7BAC28CE500C8FF000B0A06322E323E42464C3C4C2C3D260A04322E32"
$"3E424642350A04322E42354C2C3D260A04423542464C3C4C2C0A0338423C4D3C"
$"440A08335C395C41544F5C555C6051594D3E510A0422422252325A32490A0422"
$"4232493C402D3A0A043249325A3C503C400A043E424E495840493A0A043E524E"
$"5A4E493E420D0A1001052022120A00010030103701178400040A010101201037"
$"0A0B01032010370A0101072020230A00010030101C01178400040A02010A2004"
$"080A0C010320101C0A0801092004080A000100302A2001178400040A03010120"
$"2A200A050102202A200A090103202A20"
};

View File

@@ -7,11 +7,12 @@ game. BlockOut II has been designed by an addicted player for addicted players."
HOMEPAGE="http://www.blockout.net/blockout2/"
COPYRIGHT="2007-2014 Jean-Luc Pons"
LICENSE="GNU GPL v2"
REVISION="1"
REVISION="2"
SOURCE_URI="https://salsa.debian.org/games-team/blockout2/-/archive/master/blockout2-master.tar.bz2"
CHECKSUM_SHA256="08b677be01c02e6695559ccc65df1cafcac0793b7864ba7e2285059babf57349"
SOURCE_DIR="blockout2-master/"
PATCHES="blockout2-2.5.patchset"
ADDITIONAL_FILES="blockout2.rdef.in"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
@@ -55,5 +56,21 @@ INSTALL()
cp -rf BlockOut/images BlockOut/sounds $appsDir/Blockout2
cp obj/blockout2 $appsDir/Blockout2/Blockout2
# Add Haiku resources
local MAJOR="$(echo ${portVersion%%_*} | cut -d. -f1)"
local MIDDLE="$(echo ${portVersion%%_*} | cut -d. -f2)"
local MINOR="0"
local SHORT_INFO="Blockout II"
local LONG_INFO="$SUMMARY"
sed \
-e "s|@MAJOR@|$MAJOR|" \
-e "s|@MIDDLE@|$MIDDLE|" \
-e "s|@MINOR@|$MINOR|" \
-e "s|@SHORT_INFO@|$SHORT_INFO|" \
-e "s|@LONG_INFO@|$LONG_INFO|" \
"$portDir/additional-files/blockout2.rdef.in" > blockout2.rdef
addResourcesToBinaries blockout2.rdef "$appsDir/Blockout2/Blockout2"
addAppDeskbarSymlink $appsDir/Blockout2/Blockout2 "BlockOut II"
}

View File

@@ -1,4 +1,4 @@
From 0eaf01bac5e6ea62711e921bbcdffe5189089e88 Mon Sep 17 00:00:00 2001
From 052ff67446c69fccd633c1b517c66fdfa29a411c Mon Sep 17 00:00:00 2001
From: eblanca <eblanca76@users.sourceforge.net>
Date: Sun, 23 Apr 2023 18:52:22 +0000
Subject: applying patch 01_blockout2-2.4-alt-x86_64.patch
@@ -36,7 +36,7 @@ index 4ccd8df..06391f8 100644
2.37.3
From a91b745cd0dd7e7547bdcf7dc663e6a8ddba7c3d Mon Sep 17 00:00:00 2001
From fd8dffc6284483b3c318c16867c96e61fc8ace06 Mon Sep 17 00:00:00 2001
From: eblanca <eblanca76@users.sourceforge.net>
Date: Sun, 23 Apr 2023 18:52:22 +0000
Subject: applying patch 02_debian-kfreebsd.ftbfs.patch
@@ -62,7 +62,7 @@ index 0b4f12b..b8b5f5f 100644
2.37.3
From 0b9359819e528cb6a84754d30f6234754bec7726 Mon Sep 17 00:00:00 2001
From 2c7f50f93e1d0253ba5aa7e9d16c4b5687dccd0a Mon Sep 17 00:00:00 2001
From: eblanca <eblanca76@users.sourceforge.net>
Date: Sun, 23 Apr 2023 18:52:22 +0000
Subject: applying patch 03_debian_multimedia_paths.patch
@@ -91,7 +91,7 @@ index 06391f8..a220660 100644
2.37.3
From 83a874a9bc77c1f0fb7a222edb579b68681e9125 Mon Sep 17 00:00:00 2001
From 567454a27b16957334b261402baf0d97aae9c5db Mon Sep 17 00:00:00 2001
From: eblanca <eblanca76@users.sourceforge.net>
Date: Sun, 23 Apr 2023 18:52:22 +0000
Subject: applying patch 04_fixed_all_gcc_warnings.patch
@@ -287,31 +287,31 @@ index a26e86e..de0be06 100644
float startLine = 0.515f;
float startColumn = 0.15f;
diff --git a/BlockOut/SetupManager.cpp b/BlockOut/SetupManager.cpp
index 2d549dc..bb47a0a 100644
index 2d549dc..e142dbe 100644
--- a/BlockOut/SetupManager.cpp
+++ b/BlockOut/SetupManager.cpp
@@ -364,7 +364,7 @@ int SetupManager::GetTimeout() {
// ------------------------------------------------
-char *SetupManager::GetName() {
// ------------------------------------------------
-char *SetupManager::GetName() {
+const char *SetupManager::GetName() {
static char ret[32];
strcpy(ret,"");
static char ret[32];
strcpy(ret,"");
diff --git a/BlockOut/SetupManager.h b/BlockOut/SetupManager.h
index 16bf0ca..469a343 100644
index 16bf0ca..42d8a6b 100644
--- a/BlockOut/SetupManager.h
+++ b/BlockOut/SetupManager.h
@@ -67,7 +67,7 @@ class SetupManager {
float GetAnimationTime(); /* in seconds */
// Names
- char *GetName();
float GetAnimationTime(); /* in seconds */
// Names
- char *GetName();
+ const char *GetName();
const char *GetBlockSetName();
// Sound
const char *GetBlockSetName();
// Sound
diff --git a/BlockOut/SoundManager.cpp b/BlockOut/SoundManager.cpp
index bfb2ffd..2996900 100644
--- a/BlockOut/SoundManager.cpp
@@ -417,242 +417,242 @@ index a220660..1d3020e 100644
*hmap = 0;
CImage img;
diff --git a/ImageLib/include/CImage.h b/ImageLib/include/CImage.h
index cdc350a..85e3838 100644
index cdc350a..882d009 100644
--- a/ImageLib/include/CImage.h
+++ b/ImageLib/include/CImage.h
@@ -16,7 +16,7 @@ public:
// Load an image
// Supports GIF , JPG or PNG format
// Return 1 when image has been succesfully load , 0 otherwise.
- int LoadImage(char *FileName);
// Load an image
// Supports GIF , JPG or PNG format
// Return 1 when image has been succesfully load , 0 otherwise.
- int LoadImage(char *FileName);
+ int LoadImage(const char *FileName);
// Get error message if LoadImage fails.
char *GetErrorMessage();
// Get error message if LoadImage fails.
char *GetErrorMessage();
diff --git a/ImageLib/src/CImage.cpp b/ImageLib/src/CImage.cpp
index c68eed7..2f889bd 100644
index c68eed7..ad14053 100644
--- a/ImageLib/src/CImage.cpp
+++ b/ImageLib/src/CImage.cpp
@@ -27,7 +27,7 @@ CImage::CImage() {
// ------ Load image -----
-int CImage::LoadImage(char *FileName) {
// ------ Load image -----
-int CImage::LoadImage(char *FileName) {
+int CImage::LoadImage(const char *FileName) {
Release();
Release();
diff --git a/ImageLib/src/CImage.h b/ImageLib/src/CImage.h
index 2602989..ffb3d6f 100644
index 2602989..d93bc0d 100644
--- a/ImageLib/src/CImage.h
+++ b/ImageLib/src/CImage.h
@@ -18,7 +18,7 @@ public:
// Load an image
// Supports GIF , JPG or PNG format
// Return 1 when image has been succesfully load , 0 otherwise.
- int LoadImage(char *FileName);
// Load an image
// Supports GIF , JPG or PNG format
// Return 1 when image has been succesfully load , 0 otherwise.
- int LoadImage(char *FileName);
+ int LoadImage(const char *FileName);
// Get error message if LoadImage fails.
char *GetErrorMessage();
// Get error message if LoadImage fails.
char *GetErrorMessage();
diff --git a/ImageLib/src/png/hpng.c b/ImageLib/src/png/hpng.c
index 25c7089..eb8cc05 100644
index 25c7089..e270095 100644
--- a/ImageLib/src/png/hpng.c
+++ b/ImageLib/src/png/hpng.c
@@ -1,5 +1,6 @@
#include <malloc.h>
#include <math.h>
#include <malloc.h>
#include <math.h>
+#include <string.h>
#include "png/png.h"
#include "hpng.h"
#include "png/png.h"
#include "hpng.h"
--
2.37.3
From e654389c8d4276b5d7c93dc2e66ab500506a550b Mon Sep 17 00:00:00 2001
From a908bbd2b8ddc75ad221d73b06674d86f918f232 Mon Sep 17 00:00:00 2001
From: eblanca <eblanca76@users.sourceforge.net>
Date: Sun, 23 Apr 2023 18:52:23 +0000
Subject: applying patch 05_remove_unnecessary_libdeps.patch
diff --git a/ImageLib/src/CImage.cpp b/ImageLib/src/CImage.cpp
index 2f889bd..d1d7a55 100644
index ad14053..0746002 100644
--- a/ImageLib/src/CImage.cpp
+++ b/ImageLib/src/CImage.cpp
@@ -4,10 +4,10 @@
/* Use an ultra fast compression method */
/***************************************************/
#include <stdio.h>
/* Use an ultra fast compression method */
/***************************************************/
#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
#include "CImage.h"
-#include "gif/gif.h"
-#include "jpg/jpegdecoder.h"
#include "png/hpng.h"
#ifdef WINDOWS
#include "CImage.h"
-#include "gif/gif.h"
-#include "jpg/jpegdecoder.h"
#include "png/hpng.h"
#ifdef WINDOWS
@@ -50,55 +50,6 @@ int CImage::LoadImage(const char *FileName) {
return 0;
}
- // Load GIF image
- if( strcasecmp(ext,"gif")==0 ) {
-
- GIF_IMAGE img;
- int Length;
-
- strcpy(img.FileName,FileName);
- if( !LoadGifImage(&img) ) {
- strcpy(m_LastError,GifErrorMessage);
- return 0;
- }
-
- m_Width=img.width;
- m_Height=img.height;
- Length=m_Width*m_Height;
-
- m_Data=(BYTE *)malloc( Length*3 );
-
- for(int i=0,j=0;i<Length;i++,j+=3) {
- m_Data[j+0] = (BYTE)( img.Blue[ (BYTE)img.data[i] ] );
- m_Data[j+1] = (BYTE)( img.Green[ (BYTE)img.data[i] ] );
- m_Data[j+2] = (BYTE)( img.Red[ (BYTE)img.data[i] ] );
- }
-
- free(img.data);
-
- return 1;
-
- }
-
- // Load JPG image
- if( strcasecmp(ext,"jpg")==0 || strcasecmp(ext,"jpeg")==0 ) {
-
- JPEG_IMAGE img;
-
- strcpy(img.FileName,FileName);
- if( !LoadJpegImage(&img) ) {
- strcpy(m_LastError,JpegErrorMessage);
- return 0;
- }
-
- m_Width=img.width;
- m_Height=img.height;
- m_Data=(BYTE *)img.data;
-
- return 1;
-
- }
-
// Load PNG image
if( strcasecmp(ext,"png")==0 ) {
return 0;
}
- // Load GIF image
- if( strcasecmp(ext,"gif")==0 ) {
-
- GIF_IMAGE img;
- int Length;
-
- strcpy(img.FileName,FileName);
- if( !LoadGifImage(&img) ) {
- strcpy(m_LastError,GifErrorMessage);
- return 0;
- }
-
- m_Width=img.width;
- m_Height=img.height;
- Length=m_Width*m_Height;
-
- m_Data=(BYTE *)malloc( Length*3 );
-
- for(int i=0,j=0;i<Length;i++,j+=3) {
- m_Data[j+0] = (BYTE)( img.Blue[ (BYTE)img.data[i] ] );
- m_Data[j+1] = (BYTE)( img.Green[ (BYTE)img.data[i] ] );
- m_Data[j+2] = (BYTE)( img.Red[ (BYTE)img.data[i] ] );
- }
-
- free(img.data);
-
- return 1;
-
- }
-
- // Load JPG image
- if( strcasecmp(ext,"jpg")==0 || strcasecmp(ext,"jpeg")==0 ) {
-
- JPEG_IMAGE img;
-
- strcpy(img.FileName,FileName);
- if( !LoadJpegImage(&img) ) {
- strcpy(m_LastError,JpegErrorMessage);
- return 0;
- }
-
- m_Width=img.width;
- m_Height=img.height;
- m_Data=(BYTE *)img.data;
-
- return 1;
-
- }
-
// Load PNG image
if( strcasecmp(ext,"png")==0 ) {
diff --git a/ImageLib/src/png/hpng.c b/ImageLib/src/png/hpng.c
index eb8cc05..17b273d 100644
index e270095..f7817d3 100644
--- a/ImageLib/src/png/hpng.c
+++ b/ImageLib/src/png/hpng.c
@@ -1,7 +1,7 @@
#include <malloc.h>
#include <math.h>
#include <malloc.h>
#include <math.h>
#include <string.h>
-#include "png/png.h"
-#include "png/png.h"
+#include <libpng12/png.h>
#include "hpng.h"
char PngErrorMessage[1024];
#include "hpng.h"
char PngErrorMessage[1024];
@@ -100,8 +100,8 @@ int LoadPngImage(PNG_IMAGE *d) {
// Convert the image
{
- unsigned char *src = data;
- unsigned char *dst = (unsigned char *)malloc(width*height*3);
// Convert the image
{
- unsigned char *src = data;
- unsigned char *dst = (unsigned char *)malloc(width*height*3);
+ char *src = data;
+ char *dst = (char *)malloc(width*height*3);
d->data = dst;
for(i = 0 ; i < height ; i++) {
for(j = 0 ; j < width ; j++) {
d->data = dst;
for(i = 0 ; i < height ; i++) {
for(j = 0 ; j < width ; j++) {
@@ -192,5 +192,4 @@ char *WritePngImage(char *file_name,unsigned long width,unsigned long height,uns
/* that's it */
return NULL;
-
}
/* that's it */
return NULL;
-
}
--
2.37.3
From bed61bc65ac8e4930d205ff9f667485d50d9795a Mon Sep 17 00:00:00 2001
From bdd71f290262ce57492d0d3e07b86b9a303bc94f Mon Sep 17 00:00:00 2001
From: eblanca <eblanca76@users.sourceforge.net>
Date: Sun, 23 Apr 2023 18:52:23 +0000
Subject: applying patch 06_ubuntu_fix_invalid_conversion.patch
diff --git a/ImageLib/src/CImage.cpp b/ImageLib/src/CImage.cpp
index d1d7a55..5cc8cbe 100644
index 0746002..a509ceb 100644
--- a/ImageLib/src/CImage.cpp
+++ b/ImageLib/src/CImage.cpp
@@ -32,7 +32,7 @@ int CImage::LoadImage(const char *FileName) {
Release();
// Get extensions
- char *p = strrchr(FileName,'.');
Release();
// Get extensions
- char *p = strrchr(FileName,'.');
+ const char *p = strrchr(FileName,'.');
char ext[12];
if( p==NULL ) {
char ext[12];
if( p==NULL ) {
--
2.37.3
From 565da92d5a82baa1d0c67751f83e47e13374501a Mon Sep 17 00:00:00 2001
From 7629321cbce86fbe98ebec3b303291653cbd28bb Mon Sep 17 00:00:00 2001
From: eblanca <eblanca76@users.sourceforge.net>
Date: Sun, 23 Apr 2023 18:52:23 +0000
Subject: applying patch 07_ftbfs-with-libpng15.patch
diff --git a/ImageLib/src/png/hpng.c b/ImageLib/src/png/hpng.c
index 17b273d..ec67887 100644
index f7817d3..02b6343 100644
--- a/ImageLib/src/png/hpng.c
+++ b/ImageLib/src/png/hpng.c
@@ -1,7 +1,7 @@
#include <malloc.h>
#include <math.h>
#include <malloc.h>
#include <math.h>
#include <string.h>
-#include <libpng12/png.h>
+#include <libpng/png.h>
#include "hpng.h"
char PngErrorMessage[1024];
#include "hpng.h"
char PngErrorMessage[1024];
@@ -46,8 +46,12 @@ int LoadPngImage(PNG_IMAGE *d) {
// ---------------- Error handling
png_set_error_fn(png,NULL,my_png_error,NULL);
// ---------------- Error handling
png_set_error_fn(png,NULL,my_png_error,NULL);
+#if (PNG_LIBPNG_VER < 10500)
if (setjmp(png->jmpbuf)) {
- png_destroy_read_struct(&png, &info, &endinfo);
if (setjmp(png->jmpbuf)) {
- png_destroy_read_struct(&png, &info, &endinfo);
+#else
+ if ( setjmp(png_jmpbuf(png)) ) {
+#endif
+ png_destroy_read_struct(&png, &info, &endinfo);
return 0;
}
return 0;
}
@@ -155,7 +159,7 @@ char *WritePngImage(char *file_name,unsigned long width,unsigned long height,uns
{
sprintf(PngErrorMessage,"png_create_info_struct() failed");
fclose(fp);
- png_destroy_write_struct(&png_ptr, png_infopp_NULL);
{
sprintf(PngErrorMessage,"png_create_info_struct() failed");
fclose(fp);
- png_destroy_write_struct(&png_ptr, png_infopp_NULL);
+ png_destroy_write_struct(&png_ptr, NULL);
return PngErrorMessage;
}
return PngErrorMessage;
}
--
2.37.3
From 2d4e22202ac7fdeb9e8ff2eda08640355cb1fa95 Mon Sep 17 00:00:00 2001
From b361b1918b56bd536dc3042970ec9b2ef0c29255 Mon Sep 17 00:00:00 2001
From: eblanca <eblanca76@users.sourceforge.net>
Date: Sun, 23 Apr 2023 18:52:23 +0000
Subject: applying patch 08_spelling.patch
@@ -685,18 +685,18 @@ index b8b5f5f..332ab96 100644
}
#endif
diff --git a/BlockOut/README.txt b/BlockOut/README.txt
index b4cd5db..6e6ef9e 100644
index b4cd5db..6a4a91a 100644
--- a/BlockOut/README.txt
+++ b/BlockOut/README.txt
@@ -74,7 +74,7 @@ Version history
-Added player/rank name when replaying
-New punctuation characters added
-Little effect when rotation is blocked
- -Fixed "Cannot open blX.bl2replay for writting"
-Added player/rank name when replaying
-New punctuation characters added
-Little effect when rotation is blocked
- -Fixed "Cannot open blX.bl2replay for writting"
+ -Fixed "Cannot open blX.bl2replay for writing"
-New style (Marble/Arcade)
-Fixed crash when pressing [Esc]
-Pit animation when the game is over
-New style (Marble/Arcade)
-Fixed crash when pressing [Esc]
-Pit animation when the game is over
diff --git a/BlockOut/Utils.cpp b/BlockOut/Utils.cpp
index 1d3020e..a6b2e63 100644
--- a/BlockOut/Utils.cpp
@@ -711,23 +711,23 @@ index 1d3020e..a6b2e63 100644
return FALSE;
}
diff --git a/ImageLib/src/png/hpng.c b/ImageLib/src/png/hpng.c
index ec67887..9efa9a4 100644
index 02b6343..23a3077 100644
--- a/ImageLib/src/png/hpng.c
+++ b/ImageLib/src/png/hpng.c
@@ -139,7 +139,7 @@ char *WritePngImage(char *file_name,unsigned long width,unsigned long height,uns
fp = fopen(file_name, "wb");
if (fp == NULL) {
- sprintf(PngErrorMessage,"Unable to open the file %s for writting",file_name);
fp = fopen(file_name, "wb");
if (fp == NULL) {
- sprintf(PngErrorMessage,"Unable to open the file %s for writting",file_name);
+ sprintf(PngErrorMessage,"Unable to open the file %s for writing",file_name);
return PngErrorMessage;
}
return PngErrorMessage;
}
--
2.37.3
From ba9176eb74b5d6e2fd16b2334814866cd3ea3d5a Mon Sep 17 00:00:00 2001
From 9da60d5cbcccfee230d0b3033977c6eea01f2b45 Mon Sep 17 00:00:00 2001
From: eblanca <eblanca@libero.it>
Date: Sun, 23 Apr 2023 18:55:57 +0000
Subject: update Makefile and optimize build
@@ -761,7 +761,7 @@ index 0830ca5..b6d7370 100644
2.37.3
From 14bb02b24722a197be5cea3c91338183d8cf1c7e Mon Sep 17 00:00:00 2001
From 69f72fbd47c0b4a26b95b675f383c691a94b53f4 Mon Sep 17 00:00:00 2001
From: eblanca <eblanca@libero.it>
Date: Sun, 23 Apr 2023 19:01:45 +0000
Subject: fix header search paths
@@ -835,23 +835,23 @@ index a4d2793..a6d433a 100644
#ifndef SOUNDMANAGERH
#define SOUNDMANAGERH
diff --git a/ImageLib/src/png/hpng.c b/ImageLib/src/png/hpng.c
index 9efa9a4..d640caf 100644
index 23a3077..941fd43 100644
--- a/ImageLib/src/png/hpng.c
+++ b/ImageLib/src/png/hpng.c
@@ -1,7 +1,7 @@
#include <malloc.h>
#include <math.h>
#include <malloc.h>
#include <math.h>
#include <string.h>
-#include <libpng/png.h>
+#include <png.h>
#include "hpng.h"
char PngErrorMessage[1024];
#include "hpng.h"
char PngErrorMessage[1024];
--
2.37.3
From bc30bc5b4b9d66b72b11420657aee41c546e409f Mon Sep 17 00:00:00 2001
From 038d1a805b7907adb841d816dac6396a4a125914 Mon Sep 17 00:00:00 2001
From: eblanca <eblanca@libero.it>
Date: Sun, 23 Apr 2023 19:03:20 +0000
Subject: keycodes handling
@@ -891,7 +891,7 @@ index d51837c..af6da1a 100644
2.37.3
From 0834914c585710e6290cbb2b99bab2fe3feb3c75 Mon Sep 17 00:00:00 2001
From 688f51a2f85d77cea129aa89fc0aaf3637490811 Mon Sep 17 00:00:00 2001
From: eblanca <eblanca@libero.it>
Date: Sun, 23 Apr 2023 19:06:06 +0000
Subject: locate real executable path
@@ -944,8 +944,8 @@ index a6b2e63..115a6e1 100644
-
+#endif
#ifdef WINDOWS
strcpy(usrHome,"");
strcpy(usrHome,"");
@@ -208,11 +211,23 @@ BOOL CheckEnv() {
printf("Please set the HOME variable to your home directory (ex: HOME=/users/jeanluc)\n");
return FALSE;
@@ -975,3 +975,58 @@ index a6b2e63..115a6e1 100644
--
2.37.3
From b261153f03310e88a9d4be3384882bc3fa7808ed Mon Sep 17 00:00:00 2001
From: Oscar Lesta <oscar.lesta@gmail.com>
Date: Tue, 25 Apr 2023 02:25:38 -0300
Subject: Move settings out of $HOME.
Needed to patch Types.h to avoid a "conflicting declaration" error.
diff --git a/BlockOut/Types.h b/BlockOut/Types.h
index 45ec75a..f3f2d3a 100644
--- a/BlockOut/Types.h
+++ b/BlockOut/Types.h
@@ -27,6 +27,8 @@
typedef unsigned __int32 uint32;
typedef __int32 int32;
+#elif __HAIKU__
+ #include <SupportDefs.h>
#else
typedef unsigned int uint32;
diff --git a/BlockOut/Utils.cpp b/BlockOut/Utils.cpp
index 115a6e1..1d1c042 100644
--- a/BlockOut/Utils.cpp
+++ b/BlockOut/Utils.cpp
@@ -15,6 +15,11 @@
GNU General Public License for more details.
*/
+#ifdef __HAIKU__
+#include <FindDirectory.h>
+#include <fs_info.h>
+#endif
+
#include "Types.h"
#include <math.h>
#include <time.h>
@@ -229,7 +234,14 @@ BOOL CheckEnv() {
strcpy( bl2Home , blockoutHome );
#endif
char bl2Dir[512];
+#ifdef __HAIKU__
+ dev_t volume = dev_for_path("/boot");
+ char settingsDir[B_PATH_NAME_LENGTH+B_FILE_NAME_LENGTH];
+ status_t result = find_directory(B_USER_SETTINGS_DIRECTORY, volume, false, settingsDir, sizeof(settingsDir));
+ sprintf(bl2Dir, "%s/blockout2", settingsDir);
+#else
sprintf(bl2Dir,"%s/.bl2",homePath);
+#endif
if( !DirExists(bl2Dir) ) {
// Create it
if( mkdir(bl2Dir,S_IRWXU) < 0 ) {
--
2.37.3