From 6123d0b90456c5428492921612cc01fc5362bb33 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Fri, 20 Nov 2015 20:26:51 +0000 Subject: [PATCH] Mapster32: add byte array editorcolors[256] to m32script variables. This makes it possible to set up editor colors at startup (from m32_autoexec.cfg). For example: script_expertmode 1 do for i range 256 ifge i 33 { set editorcolors[i] i } script_expertmode 0 Use this method in the description of how to get old-style 2D colors in tiles.cfg and suggest an alternative color index pair. git-svn-id: https://svn.eduke32.com/eduke32@5433 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/package/sdk/tiles.cfg | 15 +++++++++++---- polymer/eduke32/source/m32vars.c | 1 + 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/polymer/eduke32/package/sdk/tiles.cfg b/polymer/eduke32/package/sdk/tiles.cfg index 573c23beb..4051cc906 100644 --- a/polymer/eduke32/package/sdk/tiles.cfg +++ b/polymer/eduke32/package/sdk/tiles.cfg @@ -177,11 +177,18 @@ tilegroup "All" // // For example, under the Duke3D palette, one can create a color scheme // similar to earlier Mapster32 builds (non-blocking sprites have an orange - // tint, blocking ones are purple) by declaring in a loaded DEF file - // 2dcolidxrange 33 33 255 + // tint, blocking ones are purple) by first putting in your m32_autoexec.cfg + // file the lines + // + // // do gamevar i 0 1 // only if a.m32 is not loaded + // script_expertmode 1 + // do for i range 256 ifge i 33 { set editorcolors[i] i } + // script_expertmode 0 + // // which maps editorcolor[] indices 33 through 255 to the same actual color - // indices, and then setting here: - colors 139 231 + // indices, and then setting here one of the alternatives: + colors 139 231 // reddish orange / purple +// colors 208 64 // brighter orange / sky blue // This sets tile colors for all sprites excluding those which have been // assigned a color by the above tile group declarations. } diff --git a/polymer/eduke32/source/m32vars.c b/polymer/eduke32/source/m32vars.c index 742844ffc..8037553f9 100644 --- a/polymer/eduke32/source/m32vars.c +++ b/polymer/eduke32/source/m32vars.c @@ -671,6 +671,7 @@ static void Gv_AddSystemVars(void) Gv_NewArray("headsectbunchf", (void *)headsectbunch[1], YAX_MAXBUNCHES, GAMEARRAY_READONLY|GAMEARRAY_OFSHORT); Gv_NewArray("nextsectbunchf", (void *)nextsectbunch[1], MAXSECTORS, GAMEARRAY_READONLY|GAMEARRAY_OFSHORT); #endif + Gv_NewArray("editorcolors", (void *)editorcolors, 256, GAMEARRAY_READONLY|GAMEARRAY_OFCHAR); Gv_NewArray("tilesizx", (void *)&tilesiz[0].x, MAXTILES, GAMEARRAY_STRIDE2|GAMEARRAY_READONLY|GAMEARRAY_OFINT); Gv_NewArray("tilesizy", (void *)&tilesiz[0].y, MAXTILES, GAMEARRAY_STRIDE2|GAMEARRAY_READONLY|GAMEARRAY_OFINT); // Gv_NewArray("picsiz", (void *)picsiz, MAXTILES, GAMEARRAY_READONLY|GAMEARRAY_OFCHAR);