Misc small fixes

git-svn-id: https://svn.eduke32.com/eduke32@1390 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2009-05-22 23:49:25 +00:00
parent 82211327e8
commit 8474211c95
10 changed files with 43 additions and 23 deletions

View file

@ -268,6 +268,7 @@ typedef struct s_pranimatespritesinfo {
// EXTERNAL FUNCTIONS // EXTERNAL FUNCTIONS
int32_t polymer_init(void); int32_t polymer_init(void);
void polymer_uninit(void);
void polymer_glinit(void); void polymer_glinit(void);
void polymer_loadboard(void); void polymer_loadboard(void);
void polymer_drawrooms(int32_t daposx, int32_t daposy, int32_t daposz, int16_t daang, int32_t dahoriz, int16_t dacursectnum); void polymer_drawrooms(int32_t daposx, int32_t daposy, int32_t daposz, int16_t daang, int32_t dahoriz, int16_t dacursectnum);
@ -284,7 +285,7 @@ static void polymer_displayrooms(int16_t sectnum);
static void polymer_drawplane(_prplane* plane); static void polymer_drawplane(_prplane* plane);
static inline void polymer_inb4mirror(GLfloat* buffer, GLfloat* plane); static inline void polymer_inb4mirror(GLfloat* buffer, GLfloat* plane);
static void polymer_animatesprites(void); static void polymer_animatesprites(void);
static void polymer_clearmapdata(void); static void polymer_freeboard(void);
static void polymer_editorselect(void); static void polymer_editorselect(void);
// SECTORS // SECTORS
static int32_t polymer_initsector(int16_t sectnum); static int32_t polymer_initsector(int16_t sectnum);

View file

@ -5698,6 +5698,9 @@ void uninitengine(void)
polymost_glreset(); polymost_glreset();
hicinit(); hicinit();
freeallmodels(); freeallmodels();
#ifdef POLYMER
polymer_uninit();
#endif
/* if (cachefilehandle > -1) /* if (cachefilehandle > -1)
Bclose(cachefilehandle); Bclose(cachefilehandle);
if (cacheindexptr != NULL) if (cacheindexptr != NULL)

View file

@ -625,6 +625,11 @@ int32_t polymer_init(void)
return (1); return (1);
} }
void polymer_uninit(void)
{
polymer_freeboard();
}
void polymer_glinit(void) void polymer_glinit(void)
{ {
bglClearColor(0.0f, 0.0f, 0.0f, 1.0f); bglClearColor(0.0f, 0.0f, 0.0f, 1.0f);
@ -668,7 +673,7 @@ void polymer_loadboard(void)
{ {
int32_t i; int32_t i;
polymer_clearmapdata(); polymer_freeboard();
i = 0; i = 0;
while (i < numsectors) while (i < numsectors)
@ -1563,7 +1568,7 @@ static void polymer_animatesprites(void)
asi.animatesprites(globalposx, globalposy, viewangle, asi.smoothratio); asi.animatesprites(globalposx, globalposy, viewangle, asi.smoothratio);
} }
static void polymer_clearmapdata(void) static void polymer_freeboard(void)
{ {
int32_t i; int32_t i;

View file

@ -341,7 +341,7 @@ void initprintf(const char *f, ...)
va_end(va); va_end(va);
OSD_Printf(buf); OSD_Printf(buf);
Bprintf(buf); Bprintf("%s", buf);
if (Bstrlen(dabuf) + Bstrlen(buf) > 1022) if (Bstrlen(dabuf) + Bstrlen(buf) > 1022)
{ {

View file

@ -38,7 +38,7 @@
#include "build.h" #include "build.h"
#include "a.h" #include "a.h"
#include "osd.h" #include "osd.h"
#include "mmulti.h"
// undefine to restrict windowed resolutions to conventional sizes // undefine to restrict windowed resolutions to conventional sizes
#define ANY_WINDOWED_SIZE #define ANY_WINDOWED_SIZE
@ -626,7 +626,7 @@ void initprintf(const char *f, ...)
Bstrcat(dabuf,buf); Bstrcat(dabuf,buf);
if (++cnt < 16 || flushlogwindow || Bstrlen(dabuf) > 768) if (++cnt < 16 || flushlogwindow || Bstrlen(dabuf) > 768 || numplayers > 1)
{ {
startwin_puts(dabuf); startwin_puts(dabuf);
handleevents(); handleevents();

View file

@ -2285,6 +2285,8 @@ static void G_MoveWeapons(void)
// if( g_sounds[WIERDSHOT_FLY].num == 0 ) // if( g_sounds[WIERDSHOT_FLY].num == 0 )
// A_PlaySound(WIERDSHOT_FLY,i); // A_PlaySound(WIERDSHOT_FLY,i);
Bmemcpy(&davect,s,sizeof(vec3_t));
if (ActorExtra[i].projectile.flashcolor) if (ActorExtra[i].projectile.flashcolor)
G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 2048, ActorExtra[i].projectile.flashcolor,PR_LIGHT_PRIO_LOW_GAME); G_AddGameLight(0, s->sectnum, s->x, s->y, s->z-((s->yrepeat*tilesizy[s->picnum])<<1), 2048, ActorExtra[i].projectile.flashcolor,PR_LIGHT_PRIO_LOW_GAME);
@ -2299,7 +2301,7 @@ static void G_MoveWeapons(void)
{ {
k = A_Spawn(i,ActorExtra[i].projectile.spawns); k = A_Spawn(i,ActorExtra[i].projectile.spawns);
Bmemcpy(&sprite[k],&davect,sizeof(vec3_t)); // Bmemcpy(&sprite[k],&davect,sizeof(vec3_t));
/* /*
sprite[k].x = dax; sprite[k].x = dax;
sprite[k].y = day; sprite[k].y = day;
@ -2350,8 +2352,6 @@ static void G_MoveWeapons(void)
ll = s->zvel>>1; ll = s->zvel>>1;
} }
Bmemcpy(&davect,s,sizeof(vec3_t));
A_GetZLimits(i); A_GetZLimits(i);
qq = CLIPMASK1; qq = CLIPMASK1;

View file

@ -50,7 +50,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <shellapi.h> #include <shellapi.h>
#endif #endif
#define BUILDDATE " 20090512" #define BUILDDATE " 20090522"
static int32_t floor_over_floor; static int32_t floor_over_floor;
@ -166,10 +166,11 @@ void create_map_snapshot(void)
while (next->prev) while (next->prev)
{ {
next = next->prev; next = next->prev;
if (next->next->sectors && next->next->sectors != next->sectors) Bfree(next->next->sectors); if (next->next->sectors && (next->next->sectors != next->sectors)) Bfree(next->next->sectors);
if (next->next->walls && next->next->walls != next->walls) Bfree(next->next->walls); if (next->next->walls && (next->next->walls != next->walls)) Bfree(next->next->walls);
if (next->next->sprites && next->next->sprites != next->sprites) Bfree(next->next->sprites); if (next->next->sprites && (next->next->sprites != next->sprites)) Bfree(next->next->sprites);
Bfree(next->next); Bfree(next->next);
next->next = NULL;
} }
} }
@ -265,13 +266,17 @@ void map_undoredo_free(void)
while (next->prev) while (next->prev)
{ {
next = next->prev; next = next->prev;
if (next->next->sectors && next->next->sectors != next->sectors) Bfree(next->next->sectors); if (next->next->sectors && (next->next->sectors != next->sectors)) Bfree(next->next->sectors);
if (next->next->walls && next->next->walls != next->walls) Bfree(next->next->walls); if (next->next->walls && (next->next->walls != next->walls)) Bfree(next->next->walls);
if (next->next->sprites && next->next->sprites != next->sprites) Bfree(next->next->sprites); if (next->next->sprites && (next->next->sprites != next->sprites)) Bfree(next->next->sprites);
if (next->next == mapstate)
mapstate = NULL;
Bfree(next->next); Bfree(next->next);
next->next = NULL;
} }
} }
if (mapstate)
Bfree(mapstate); Bfree(mapstate);
mapstate = NULL; mapstate = NULL;
} }

View file

@ -196,7 +196,7 @@ void CONFIG_SetDefaults(void)
#endif #endif
ud.config.useprecache = 1; ud.config.useprecache = 1;
ud.config.ForceSetup = 1; ud.config.ForceSetup = 1;
ud.config.NoAutoLoad = 0; ud.config.NoAutoLoad = 1;
ud.config.AmbienceToggle = 1; ud.config.AmbienceToggle = 1;
ud.config.AutoAim = 1; ud.config.AutoAim = 1;
ud.config.FXDevice = 0; ud.config.FXDevice = 0;

View file

@ -1011,6 +1011,7 @@ void C_FreeHashes(void)
hash_free(&labelH); hash_free(&labelH);
} }
// "magic" number for { and }, overrides line number in compiled code for later detection
#define IFELSE_MAGIC 31337 #define IFELSE_MAGIC 31337
static int32_t g_ifElseAborted; static int32_t g_ifElseAborted;
@ -1097,12 +1098,17 @@ static int32_t C_SetScriptSize(int32_t size)
// Bmemset(&bitptr[osize],0,size-osize); // Bmemset(&bitptr[osize],0,size-osize);
Bmemcpy(newbitptr,bitptr,sizeof(uint8_t) *((osize+7)>>3)); Bmemcpy(newbitptr,bitptr,sizeof(uint8_t) *((osize+7)>>3));
} }
else if (size < osize) else
Bmemcpy(newbitptr,bitptr,sizeof(uint8_t) *((size+7)>>3)); Bmemcpy(newbitptr,bitptr,sizeof(uint8_t) *((size+7)>>3));
Bfree(bitptr); Bfree(bitptr);
bitptr = newbitptr; bitptr = newbitptr;
if (script != newscript)
{
initprintf("Relocating compiled code from to 0x%x to 0x%x\n", script, newscript);
script = newscript; script = newscript;
}
g_scriptPtr = (intptr_t *)(script+oscriptPtr); g_scriptPtr = (intptr_t *)(script+oscriptPtr);
// initprintf("script: %d, bitptr: %d\n",script,bitptr); // initprintf("script: %d, bitptr: %d\n",script,bitptr);
@ -1122,7 +1128,7 @@ static int32_t C_SetScriptSize(int32_t size)
} }
} }
if (size > osize) if (size >= osize)
{ {
for (i=g_scriptSize-(size-osize)-1; i>=0; i--) for (i=g_scriptSize-(size-osize)-1; i>=0; i--)
if (scriptptrs[i]) if (scriptptrs[i])

View file

@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
#include "duke3d.h" #include "duke3d.h"
const char *s_buildDate = "20090512"; const char *s_buildDate = "20090522";
char *MusicPtr = NULL; char *MusicPtr = NULL;
int32_t g_musicSize; int32_t g_musicSize;
@ -115,7 +115,7 @@ char *label;
char ActorType[MAXTILES]; char ActorType[MAXTILES];
intptr_t *script = NULL; intptr_t *script = NULL;
int32_t g_scriptSize = 16384; int32_t g_scriptSize = 1048576;
char typebuflen,typebuf[141]; char typebuflen,typebuf[141];