From: Holger Schemel Date: Tue, 27 Feb 2024 21:07:29 +0000 (+0100) Subject: added saving native BDCFF file with cheat code ":save-native-level" X-Git-Tag: 4.4.0.0-test-1~270 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=157fb76461d332a22233e6664cd294d7db5d3558;p=rocksndiamonds.git added saving native BDCFF file with cheat code ":save-native-level" --- diff --git a/src/files.c b/src/files.c index 1cb235ce..60d3ae0d 100644 --- a/src/files.c +++ b/src/files.c @@ -6491,7 +6491,17 @@ void CopyNativeLevel_Native_to_RND(struct LevelInfo *level) void SaveNativeLevel(struct LevelInfo *level) { - if (level->game_engine_type == GAME_ENGINE_TYPE_SP) + if (level->game_engine_type == GAME_ENGINE_TYPE_BD) + { + char *basename = getSingleLevelBasenameExt(level->file_info.nr, "bd"); + char *filename = getLevelFilenameFromBasename(basename); + + CopyNativeLevel_RND_to_BD(level); + // CopyNativeTape_RND_to_BD(level); + + SaveNativeLevel_BD(filename); + } + else if (level->game_engine_type == GAME_ENGINE_TYPE_SP) { char *basename = getSingleLevelBasenameExt(level->file_info.nr, "sp"); char *filename = getLevelFilenameFromBasename(basename); diff --git a/src/game_bd/export_bd.h b/src/game_bd/export_bd.h index a56e948b..1db82520 100644 --- a/src/game_bd/export_bd.h +++ b/src/game_bd/export_bd.h @@ -98,6 +98,7 @@ void InitGfxBuffers_BD(void); void setLevelInfoToDefaults_BD_Ext(int, int); void setLevelInfoToDefaults_BD(void); boolean LoadNativeLevel_BD(char *, int, boolean); +boolean SaveNativeLevel_BD(char *); unsigned int InitEngineRandom_BD(int); void InitGameEngine_BD(void); diff --git a/src/game_bd/main_bd.c b/src/game_bd/main_bd.c index 0ffea6be..3cda1ac5 100644 --- a/src/game_bd/main_bd.c +++ b/src/game_bd/main_bd.c @@ -154,6 +154,11 @@ boolean LoadNativeLevel_BD(char *filename, int level_pos, boolean level_info_onl return TRUE; } +boolean SaveNativeLevel_BD(char *filename) +{ + return gd_caveset_save_to_file(filename); +} + // ============================================================================ // game engine functions