From e3ef41011a3564492d12988716af8fc1f090ac6b Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Mon, 11 Jan 2010 01:38:53 +0100 Subject: [PATCH] rnd-20100111-2-src --- ChangeLog | 3 ++- Makefile | 4 ++++ src/conftime.h | 2 +- src/files.c | 24 +++++++++++++++--------- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0ba17267..c4ffb811 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,11 @@ 2010-01-10 - * added new element "from_level_template" that is replaced by element + * added new element "from_level_template" which is replaced by element from level template at same playfield position when loaded (currently not accessible from level editor, but only used for special Sokoban level conversion when using "special_flags: load_xsb_to_ces") * added special behaviour for "special_flags: load_xsb_to_ces": global settings of individual level files are overwritten by template level + (except playfield size, level name, level author and template flag) 2010-01-07 * added handling of gravity ports when converting Supaplex style R'n'D diff --git a/Makefile b/Makefile index a7222e6a..c157ab64 100644 --- a/Makefile +++ b/Makefile @@ -150,6 +150,10 @@ backup_gfx: # prerelease: # ./Scripts/make_prerelease.sh +jue: + sed -e 's/# SPECIAL_EDITION/SPECIAL_EDITION/' Makefile > Makefile.jue + $(MAKE) -f Makefile.jue cross-win32 + dist-clean: @$(MAKE_CMD) dist-clean diff --git a/src/conftime.h b/src/conftime.h index 77c9dec9..ddc93aa3 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2010-01-11 00:22" +#define COMPILE_DATE_STRING "2010-01-11 01:33" diff --git a/src/files.c b/src/files.c index 792d2cdd..ab949e18 100644 --- a/src/files.c +++ b/src/files.c @@ -1785,20 +1785,26 @@ static void ActivateLevelTemplate() if (check_special_flags("load_xsb_to_ces")) { - short FieldBackup[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; + struct LevelInfo level_backup = level; - /* backup playfield from individual level */ - for (x = 0; x < level.fieldx; x++) - for (y = 0; y < level.fieldy; y++) - FieldBackup[x][y] = level.field[x][y]; - - /* set all individual level settings to template level settings */ + /* overwrite all individual level settings from template level settings */ level = level_template; - /* restore playfield from individual level */ + /* restore playfield size */ + level.fieldx = level_backup.fieldx; + level.fieldy = level_backup.fieldy; + + /* restore playfield content */ for (x = 0; x < level.fieldx; x++) for (y = 0; y < level.fieldy; y++) - level.field[x][y] = FieldBackup[x][y]; + level.field[x][y] = level_backup.field[x][y]; + + /* restore name and author from individual level */ + strcpy(level.name, level_backup.name); + strcpy(level.author, level_backup.author); + + /* restore flag "use_custom_template" */ + level.use_custom_template = level_backup.use_custom_template; } } -- 2.34.1