mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +00:00
Haiku support, code simplification.
using more straightforward approach to get the current binary path. Actual approach more fit to get other infos (e.g. address mappings and so on).
This commit is contained in:
parent
56ddda7021
commit
e4fac541a9
1 changed files with 3 additions and 14 deletions
|
@ -46,7 +46,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __HAIKU__
|
#ifdef __HAIKU__
|
||||||
#include <kernel/image.h>
|
#include <FindDirectory.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef PATH_MAX
|
#ifndef PATH_MAX
|
||||||
|
@ -123,20 +123,9 @@ static void SetExecutablePath(char* exePath)
|
||||||
// TODO: realpath() ?
|
// TODO: realpath() ?
|
||||||
// TODO: no idea what this is if the executable is in an app bundle
|
// TODO: no idea what this is if the executable is in an app bundle
|
||||||
#elif defined(__HAIKU__)
|
#elif defined(__HAIKU__)
|
||||||
image_info ii;
|
if (find_path(B_APP_IMAGE_SYMBOL, B_FIND_PATH_IMAGE_PATH, NULL, exePath, PATH_MAX) != B_OK)
|
||||||
int32_t id = 0;
|
|
||||||
|
|
||||||
exePath[0] = '\0';
|
|
||||||
|
|
||||||
for (; get_next_image_info(0, &id, &ii) == B_OK;)
|
|
||||||
{
|
{
|
||||||
if (ii.type == B_APP_IMAGE)
|
exePath[0] = '\0';
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ii.type == B_APP_IMAGE)
|
|
||||||
{
|
|
||||||
Q_strlcpy(exePath, ii.name, PATH_MAX);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in a new issue