From dc9f4eb36053018857a2a66b50356573aa913066 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Wed, 16 Jan 2013 20:38:56 +0000 Subject: [PATCH] Mapster32: add cvar/mapster32.cfg option "keeptexturestretch". If enabled, dragging wall vertices will correct the xrepeat after the mouse button is released, so that the pre-drag absolute stretching is restored. git-svn-id: https://svn.eduke32.com/eduke32@3398 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/editor.h | 2 ++ polymer/eduke32/build/src/build.c | 3 ++- polymer/eduke32/build/src/config.c | 15 ++++++++++----- polymer/eduke32/source/astub.c | 10 ++++++++++ 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/polymer/eduke32/build/include/editor.h b/polymer/eduke32/build/include/editor.h index 6cb6e3c64..2f3f42313 100644 --- a/polymer/eduke32/build/include/editor.h +++ b/polymer/eduke32/build/include/editor.h @@ -141,6 +141,8 @@ extern int32_t getinvdisplacement(int32_t *dx, int32_t *dy, int32_t dz) ATTRIBUT extern int32_t getscreenvdisp(int32_t bz, int32_t zoome); extern void setup_sideview_sincos(void); +extern int8_t keeptexturestretch; + extern int32_t wallength(int16_t i); extern void fixrepeats(int16_t i); extern uint32_t getlenbyrep(int32_t len, int32_t repeat); diff --git a/polymer/eduke32/build/src/build.c b/polymer/eduke32/build/src/build.c index c446df77a..86cc86712 100644 --- a/polymer/eduke32/build/src/build.c +++ b/polymer/eduke32/build/src/build.c @@ -199,6 +199,7 @@ int32_t pk_turnaccel=16; int32_t pk_turndecel=12; int32_t pk_uedaccel=3; +int8_t keeptexturestretch = 1; int8_t sideview_reversehrot = 0; char lastpm16buf[156]; @@ -5185,7 +5186,7 @@ end_autoredwall: if (dragwall[i] < 0) break; - if (olen[i] != 0) + if (keeptexturestretch && olen[i] != 0) { #ifndef YAX_ENABLE j = dragwall[i]; diff --git a/polymer/eduke32/build/src/config.c b/polymer/eduke32/build/src/config.c index c26422d9b..fef5e830c 100644 --- a/polymer/eduke32/build/src/config.c +++ b/polymer/eduke32/build/src/config.c @@ -266,13 +266,14 @@ int32_t loadsetup(const char *fn) if (readconfig(fp, "turndecel", val, VL) > 0) pk_turndecel = atoi_safe(val); -// if (readconfig(fp, "autosave", val, VL) > 0) autosave = atoi_safe(val)*60; if (readconfig(fp, "autosavesec", val, VL) > 0) autosave = max(0, atoi_safe(val)); if (readconfig(fp, "autocorruptchecksec", val, VL) > 0) autocorruptcheck = max(0, atoi_safe(val)); if (readconfig(fp, "corruptcheck_noalreadyrefd", val, VL) > 0) corruptcheck_noalreadyrefd = !!atoi_safe(val); if (readconfig(fp, "fixmaponsave_sprites", val, VL) > 0) fixmaponsave_sprites = !!atoi_safe(val); + if (readconfig(fp, "keeptexturestretch", val, VL) > 0) + keeptexturestretch = !!atoi_safe(val); if (readconfig(fp, "showheightindicators", val, VL) > 0) showheightindicators = clamp(atoi_safe(val), 0, 2); @@ -488,6 +489,9 @@ int32_t writesetup(const char *fn) "; Fix sprite sectnums when saving a map or entering 3D mode\n" "fixmaponsave_sprites = %d\n" "\n" + "; Keep texture stretching when dragging wall vertices\n" + "keeptexturestretch = %d\n" + "\n" "; Height indicators (0:none, 1:only 2-sided&different, 2:all)\n" "showheightindicators = %d\n" "\n" @@ -497,8 +501,8 @@ int32_t writesetup(const char *fn) "; TROR: Automatic grayout of plain (non-extended) sectors,\n" "; toggled with Ctrl-A:\n" "autogray = %d\n" - "; TROR: Show inner gray walls, toggled with Ctrl-Alt-A:\n" - "showinnergray = %d\n" +// "; TROR: Show inner gray walls, toggled with Ctrl-Alt-A:\n" +// "showinnergray = %d\n" "\n" "; 2D mode display type (0:classic, 1:textured, 2:textured/animated)\n" "graphicsmode = %d\n" @@ -598,8 +602,9 @@ int32_t writesetup(const char *fn) msens, unrealedlook, pk_uedaccel, quickmapcycling, sideview_reversehrot, revertCTRL,scrollamount,pk_turnaccel,pk_turndecel,autosave,autocorruptcheck, - corruptcheck_noalreadyrefd, fixmaponsave_sprites, showheightindicators,showambiencesounds, - autogray,showinnergray, + corruptcheck_noalreadyrefd, fixmaponsave_sprites, keeptexturestretch, + showheightindicators,showambiencesounds, + autogray, //showinnergray, graphicsmode, MixRate,AmbienceToggle,ParentalLock, !!m32_osd_tryscript, #if 1 diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index db9c276ca..798bb4313 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -9105,6 +9105,14 @@ static int32_t osdcmd_vars_pk(const osdfuncparm_t *parm) return OSDCMD_OK; } + if (!Bstrcasecmp(parm->name, "keeptexturestretch")) + { + keeptexturestretch = !keeptexturestretch; + OSD_Printf("Keep texture stretching when dragging wall vertices: %s\n", + ONOFF(keeptexturestretch)); + return OSDCMD_OK; + } + if (!Bstrcasecmp(parm->name, "corruptcheck")) { if (parm->numparms >= 1) @@ -9501,6 +9509,8 @@ static int32_t registerosdcommands(void) OSD_RegisterFunction("show_heightindicators", "show_heightindicators {0, 1 or 2}: sets display of height indicators in 2D mode", osdcmd_vars_pk); OSD_RegisterFunction("show_ambiencesounds", "show_ambiencesounds {0, 1 or 2}>: sets display of MUSICANDSFX circles in 2D mode", osdcmd_vars_pk); OSD_RegisterFunction("corruptcheck_noalreadyrefd", "corruptcheck_noalreadyrefd: toggles ignoring of one-to-many red wall connections", osdcmd_vars_pk); + OSD_RegisterFunction("keeptexturestretch", "toggles keeping texture stretching when dragging wall vertices", osdcmd_vars_pk); + OSD_RegisterFunction("corruptcheck", "corruptcheck {|now|tryfix}: sets auto corruption check interval if given, otherwise as indicated", osdcmd_vars_pk); #ifdef USE_OPENGL OSD_RegisterFunction("tint", "tint : queries or sets hightile tinting", osdcmd_tint);