From 3f84314d6745e2ff32e588b0114679518621cd99 Mon Sep 17 00:00:00 2001 From: Jonathon Fowler Date: Sun, 11 Dec 2022 18:03:34 +1000 Subject: [PATCH] adjustments to better support the JFTekWar editor stub Adds an external callback for editor sprite deletion before the sprite actually gets removed. --- include/editor.h | 1 + kenbuild/src/bstub.c | 5 +++++ src/build.c | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/include/editor.h b/include/editor.h index 6d8d5120..c3e7cb22 100644 --- a/include/editor.h +++ b/include/editor.h @@ -56,6 +56,7 @@ extern void ExtShowSpriteData(short spritenum); extern void ExtEditSectorData(short sectnum); extern void ExtEditWallData(short wallnum); extern void ExtEditSpriteData(short spritenum); +extern void ExtDeleteSprite(short spritenum); #define STATUS2DSIZ 144 diff --git a/kenbuild/src/bstub.c b/kenbuild/src/bstub.c index 7144f829..a06043cd 100644 --- a/kenbuild/src/bstub.c +++ b/kenbuild/src/bstub.c @@ -257,6 +257,11 @@ void ExtPreCheckKeys(void) #endif } +void ExtDeleteSprite(short spritenum) +{ + (void)spritenum; +} + #define MAXVOXMIPS 5 extern unsigned char *voxoff[][MAXVOXMIPS]; void ExtAnalyzeSprites(void) diff --git a/src/build.c b/src/build.c index c1406a5b..9ddf3a12 100644 --- a/src/build.c +++ b/src/build.c @@ -2327,6 +2327,7 @@ void editinput(void) { if (searchstat == 3) { + ExtDeleteSprite(searchwall); deletesprite(searchwall); updatenumsprites(); asksave = 1; @@ -4920,6 +4921,7 @@ void overheadeditor(void) { if ((pointhighlight&0xc000) == 16384) //Sprite Delete { + ExtDeleteSprite(pointhighlight&16383); deletesprite(pointhighlight&16383); printmessage16("Sprite deleted."); updatenumsprites(); @@ -5848,7 +5850,10 @@ int deletesector(short sucksect) int i, j, k, nextk, startwall, endwall; while (headspritesect[sucksect] >= 0) + { + ExtDeleteSprite(headspritesect[sucksect]); deletesprite(headspritesect[sucksect]); + } updatenumsprites(); startwall = sector[sucksect].wallptr;