Skip to content

Commit

Permalink
adjustments to better support the JFTekWar editor stub
Browse files Browse the repository at this point in the history
Adds an external callback for editor sprite deletion before the sprite
actually gets removed.
  • Loading branch information
jonof committed Oct 22, 2024
1 parent af65381 commit 3f84314
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions kenbuild/src/bstub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions src/build.c
Original file line number Diff line number Diff line change
Expand Up @@ -2327,6 +2327,7 @@ void editinput(void)
{
if (searchstat == 3)
{
ExtDeleteSprite(searchwall);
deletesprite(searchwall);
updatenumsprites();
asksave = 1;
Expand Down Expand Up @@ -4920,6 +4921,7 @@ void overheadeditor(void)
{
if ((pointhighlight&0xc000) == 16384) //Sprite Delete
{
ExtDeleteSprite(pointhighlight&16383);
deletesprite(pointhighlight&16383);
printmessage16("Sprite deleted.");
updatenumsprites();
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 3f84314

Please sign in to comment.