diff --git a/polymer/eduke32/build/include/polymer.h b/polymer/eduke32/build/include/polymer.h index ffeb0f433..0667543fd 100644 --- a/polymer/eduke32/build/include/polymer.h +++ b/polymer/eduke32/build/include/polymer.h @@ -287,6 +287,9 @@ typedef struct s_pranimatespritesinfo { int32_t x, y, a, smoothratio; } _pranimatespritesinfo; +// this one has to be provided by the application +extern void G_Polymer_UnInit(void); + // EXTERNAL FUNCTIONS int32_t polymer_init(void); void polymer_uninit(void); diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index c6a4a68ba..c2446efa8 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -15698,7 +15698,10 @@ int32_t setrendermode(int32_t renderer) renderer = 3; } else if (rendmode==4) // going from Polymer to another renderer + { + G_Polymer_UnInit(); polymer_uninit(); + } # else else renderer = 3; # endif diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index 606b5314e..9f895d92e 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -484,6 +484,23 @@ ACTOR_INLINE int32_t A_SetSprite(int32_t i,uint32_t cliptype) int32_t block_deletesprite = 0; +#ifdef POLYMER +static void A_DeletePolymerLight(int32_t s) +{ + polymer_deletelight(actor[s].lightId); + actor[s].lightId = -1; + actor[s].lightptr = NULL; +} + +void G_Polymer_UnInit(void) +{ + int32_t i; + + for (i=0; i