From: Holger Schemel Date: Mon, 11 Jan 2010 00:38:53 +0000 (+0100) Subject: rnd-20100111-2-src X-Git-Tag: 3.3.0.0^2~46 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=e3ef41011a3564492d12988716af8fc1f090ac6b;p=rocksndiamonds.git rnd-20100111-2-src --- 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; } }