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
This commit is contained in:
helixhorned 2015-11-20 20:26:51 +00:00
parent 56672fd5e2
commit 6123d0b904
2 changed files with 12 additions and 4 deletions

View file

@ -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.
}

View file

@ -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);