Skip to content

Commit

Permalink
Basic detection of N3D #712
Browse files Browse the repository at this point in the history
  • Loading branch information
cxong committed Mar 26, 2024
1 parent 315c2ca commit 63ace03
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 2 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ install:
- cd %APPVEYOR_BUILD_FOLDER%

before_build:
- .\build\windows\get-sdl2-dlls.bat dll 32 "appveyor DownloadFile"
- .\build\windows\get-sdl2-dlls.bat dll 86 "appveyor DownloadFile"
- cmake -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -G "Visual Studio 17 2022" -A Win32 .

build:
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ install:
- cd %APPVEYOR_BUILD_FOLDER%

before_build:
- .\build\windows\get-sdl2-dlls.bat dll 32 "appveyor DownloadFile"
- .\build\windows\get-sdl2-dlls.bat dll 86 "appveyor DownloadFile"
- cmake -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -G "Visual Studio 17 2022" -A Win32 .

build:
Expand Down
12 changes: 12 additions & 0 deletions data/.wolf3d/N3D.cdogscpn/campaign.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"Version": 16,
"Title": "Super 3-D Noah's Ark",
"Author": "Wisdom Tree",
"Description": "",
"Ammo": true,
"WeaponPersist": true,
"SkipWeaponMenu": true,
"RandomPickups": false,
"DoorOpenTicks": 210,
"Missions": 0
}
4 changes: 4 additions & 0 deletions data/.wolf3d/N3D.cdogscpn/characters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"Version": 13,
"Characters": []
}
3 changes: 3 additions & 0 deletions data/.wolf3d/N3D.cdogscpn/missions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"Missions": []
}
15 changes: 15 additions & 0 deletions src/cdogs/map_wolf.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ CWolfMap *defaultSpearMap = NULL;

#define WOLF_STEAM_NAME "Wolfenstein 3D"
#define SPEAR_STEAM_NAME "Spear of Destiny"
#define N3D_STEAM_NAME "Super 3-D Noah's Ark"
#define WOLF_GOG_ID "1441705046"
#define WOLF_SPEAR_GOG_ID "1441705226"
#define SPEAR_GOG_ID "1441705126"
#define N3D_GOG_ID "1672565562"
#define WOLF_DATA_DIR "data/.wolf3d/"

#define TILE_CLASS_WALL_OFFSET 63
Expand Down Expand Up @@ -95,6 +97,9 @@ static void GetCampaignPath(
break;
}
break;
case CWMAPTYPE_N3D:
GetDataFilePath(buf, WOLF_DATA_DIR "N3D.cdogscpn");
break;
default:
// TODO: implement unknown map types
LOG(LM_MAP, LL_ERROR, "Unknown wolf map type %d", (int)type);
Expand Down Expand Up @@ -473,6 +478,8 @@ static bool IsDefaultMap(const char *filename)
// Steam Windows
StrEndsWith(buf, "WOLFENSTEIN 3D/BASE") ||
StrEndsWith(buf, "SPEAR OF DESTINY/BASE") ||
// GOG/Steam Windows
StrEndsWith(buf, "Super 3-D Noah's Ark") ||
// Steam Linux
StrEndsWith(buf, "Wolfenstein 3D/base") ||
StrEndsWith(buf, "Spear of Destiny/base"));
Expand Down Expand Up @@ -2516,6 +2523,14 @@ void MapWolfLoadCampaignsFromSystem(CampaignList *list)
{
TryLoadSpearGOG(list, numLoaded);
}

// Super 3D Noah's Ark
fsg_get_steam_game_path(buf, N3D_STEAM_NAME);
if (!TryLoadCampaign(list, buf))
{
fsg_get_gog_game_path(buf, N3D_GOG_ID);
TryLoadCampaign(list, buf);
}
}
static bool TryLoadSpearSteamVanilla(CampaignList *list);
static bool TryLoadSpearSteamInWolf3D(CampaignList *list);
Expand Down

0 comments on commit 63ace03

Please sign in to comment.