Merge 'NetHack-3.6' changes into NetHack-3.7-Jan2020

This commit is contained in:
nhmall
2020-01-25 22:17:42 -05:00
8 changed files with 55 additions and 21 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ Fixes to Post-3.6.4 Problems that Were Exposed Via git Repository
Platform- and/or Interface-Specific Fixes or Features Platform- and/or Interface-Specific Fixes or Features
----------------------------------------------------- -----------------------------------------------------
Windows OPTIONS=map_mode:fit_to_screen could cause a game start failure Windows OPTIONS=map_mode:fit_to_screen could cause a game start failure
Windows users with C-locale unmappable names could get game start failure
General New Features General New Features
-------------------- --------------------
+5 -2
View File
@@ -123,8 +123,11 @@ spec_levs:
quest_levs: quest_levs:
touch quest_levs touch quest_levs
spotless: # gitinfo.txt is optionally made by src/Makefile when creating date.h
-rm -f spec_levs quest_levs *.lev $(VARDAT) clean:
-rm -f gitinfo.txt
spotless: clean
-rm -f nhdat x11tiles beostiles pet_mark.xbm pilemark.xbm rip.xpm mapbg.xpm -rm -f nhdat x11tiles beostiles pet_mark.xbm pilemark.xbm rip.xpm mapbg.xpm
-rm -f rip.img GEM_RSC.RSC title.img nh16.img NetHack.ad -rm -f rip.img GEM_RSC.RSC title.img nh16.img NetHack.ad
-rm -f nhsplash.xpm nhtiles.bmp -rm -f nhsplash.xpm nhtiles.bmp
+1
View File
@@ -308,6 +308,7 @@ install: rootcheck $(GAME) recover $(VARDAT) spec_levs
clean: clean:
( cd src ; $(MAKE) clean ) ( cd src ; $(MAKE) clean )
( cd util ; $(MAKE) clean ) ( cd util ; $(MAKE) clean )
( cd dat ; $(MAKE) clean )
( cd doc ; $(MAKE) clean ) ( cd doc ; $(MAKE) clean )
( cd lib/lua-$(LUA_VERSION)/src && $(MAKE) clean ) ( cd lib/lua-$(LUA_VERSION)/src && $(MAKE) clean )
+13 -1
View File
@@ -151,6 +151,14 @@
54FCE8292223261F00F393C8 /* isaac64.c in Sources */ = {isa = PBXBuildFile; fileRef = 54FCE8282223261F00F393C8 /* isaac64.c */; }; 54FCE8292223261F00F393C8 /* isaac64.c in Sources */ = {isa = PBXBuildFile; fileRef = 54FCE8282223261F00F393C8 /* isaac64.c */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
inputFiles = (
);
inputFiles = (
);
inputFiles = (
);
inputFiles = (
);
/* Begin PBXContainerItemProxy section */ /* Begin PBXContainerItemProxy section */
316B91CA21A3BD7C00EC3E81 /* PBXContainerItemProxy */ = { 316B91CA21A3BD7C00EC3E81 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy; isa = PBXContainerItemProxy;
@@ -976,7 +984,7 @@
3189576921A1FCC100FB2ABE /* Project object */ = { 3189576921A1FCC100FB2ABE /* Project object */ = {
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastUpgradeCheck = 1120; LastUpgradeCheck = 1130;
ORGANIZATIONNAME = "Bart House"; ORGANIZATIONNAME = "Bart House";
TargetAttributes = { TargetAttributes = {
3189577021A1FCC100FB2ABE = { 3189577021A1FCC100FB2ABE = {
@@ -1837,6 +1845,10 @@
}; };
name = Release; name = Release;
}; };
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_IDENTITY = "-";
31B8A44F21A26A4B0055BD01 /* Debug */ = { 31B8A44F21A26A4B0055BD01 /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "1120" LastUpgradeVersion = "1130"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "1120" LastUpgradeVersion = "1130"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "1120" LastUpgradeVersion = "1130"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"
+32 -14
View File
@@ -78,24 +78,34 @@ static struct stat hbuf;
extern char orgdir[]; extern char orgdir[];
void int
get_known_folder_path( get_known_folder_path(
const KNOWNFOLDERID * folder_id, const KNOWNFOLDERID * folder_id,
char * path char * path
, size_t path_size) , size_t path_size)
{ {
PWSTR wide_path; PWSTR wide_path;
if (FAILED(SHGetKnownFolderPath(folder_id, 0, NULL, &wide_path))) if (FAILED(SHGetKnownFolderPath(folder_id, 0, NULL, &wide_path))) {
error("Unable to get known folder path"); error("Unable to get known folder path");
return FALSE;
}
size_t converted; size_t converted;
errno_t err; errno_t err;
err = wcstombs_s(&converted, path, path_size, wide_path, path_size - 1); err = wcstombs_s(&converted, path, path_size, wide_path, _TRUNCATE);
CoTaskMemFree(wide_path); CoTaskMemFree(wide_path);
if (err != 0) error("Failed folder path string conversion"); if (err == STRUNCATE || err == EILSEQ) {
// silently handle this problem
return FALSE;
} else if (err != 0) {
error("Failed folder (%u) path string conversion, unexpected err = %d", folder_id->Data1, err);
return FALSE;
}
return TRUE;
} }
void void
@@ -107,14 +117,16 @@ create_directory(const char * path)
error("Unable to create directory '%s'", path); error("Unable to create directory '%s'", path);
} }
void int
build_known_folder_path( build_known_folder_path(
const KNOWNFOLDERID * folder_id, const KNOWNFOLDERID * folder_id,
char * path, char * path,
size_t path_size, size_t path_size,
boolean versioned) boolean versioned)
{ {
get_known_folder_path(folder_id, path, path_size); if(!get_known_folder_path(folder_id, path, path_size))
return FALSE;
strcat(path, "\\NetHack\\"); strcat(path, "\\NetHack\\");
create_directory(path); create_directory(path);
if (versioned) { if (versioned) {
@@ -122,6 +134,7 @@ build_known_folder_path(
VERSION_MAJOR, VERSION_MINOR); VERSION_MAJOR, VERSION_MINOR);
create_directory(path); create_directory(path);
} }
return TRUE;
} }
void void
@@ -249,17 +262,22 @@ set_default_prefix_locations(const char *programPath)
g.fqn_prefix[TROUBLEPREFIX] = portable_device_path; g.fqn_prefix[TROUBLEPREFIX] = portable_device_path;
g.fqn_prefix[DATAPREFIX] = executable_path; g.fqn_prefix[DATAPREFIX] = executable_path;
} else { } else {
build_known_folder_path(&FOLDERID_Profile, profile_path, if(!build_known_folder_path(&FOLDERID_Profile, profile_path,
sizeof(profile_path), FALSE); sizeof(profile_path), FALSE))
strcpy(profile_path, executable_path);
build_known_folder_path(&FOLDERID_Profile, versioned_profile_path, if(!build_known_folder_path(&FOLDERID_Profile, versioned_profile_path,
sizeof(profile_path), TRUE); sizeof(profile_path), TRUE))
strcpy(versioned_profile_path, executable_path);
build_known_folder_path(&FOLDERID_LocalAppData, if(!build_known_folder_path(&FOLDERID_LocalAppData,
versioned_user_data_path, sizeof(versioned_user_data_path), TRUE); versioned_user_data_path, sizeof(versioned_user_data_path), TRUE))
strcpy(versioned_user_data_path, executable_path);
if(!build_known_folder_path(&FOLDERID_ProgramData,
versioned_global_data_path, sizeof(versioned_global_data_path), TRUE))
strcpy(versioned_global_data_path, executable_path);
build_known_folder_path(&FOLDERID_ProgramData,
versioned_global_data_path, sizeof(versioned_global_data_path), TRUE);
g.fqn_prefix[SYSCONFPREFIX] = versioned_global_data_path; g.fqn_prefix[SYSCONFPREFIX] = versioned_global_data_path;
g.fqn_prefix[CONFIGPREFIX] = profile_path; g.fqn_prefix[CONFIGPREFIX] = profile_path;
g.fqn_prefix[HACKPREFIX] = versioned_profile_path; g.fqn_prefix[HACKPREFIX] = versioned_profile_path;