git-svn-id: https://svn.eduke32.com/eduke32@1082 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2008-09-29 02:12:53 +00:00
parent 0f0572ee69
commit 16cd3c353d
8 changed files with 24 additions and 7 deletions

View file

@ -8950,7 +8950,8 @@ void dragpoint(short pointhighlight, int dax, int day)
wall[pointhighlight].x = dax; wall[pointhighlight].x = dax;
wall[pointhighlight].y = day; wall[pointhighlight].y = day;
wall[pointhighlight].cstat |= (1<<14); wall[pointhighlight].cstat |= (1<<14);
wall[linehighlight].cstat |= (1<<14); if (linehighlight >= 0 && linehighlight < MAXWALLS)
wall[linehighlight].cstat |= (1<<14);
wall[lastwall(pointhighlight)].cstat |= (1<<14); wall[lastwall(pointhighlight)].cstat |= (1<<14);
cnt = MAXWALLS; cnt = MAXWALLS;

View file

@ -247,6 +247,7 @@ void CONFIG_SetDefaults(void)
ud.config.UseMouse = 1; ud.config.UseMouse = 1;
ud.config.VoiceToggle = 5; // bitfield, 1 = local, 2 = dummy, 4 = other players in DM ud.config.VoiceToggle = 5; // bitfield, 1 = local, 2 = dummy, 4 = other players in DM
ud.display_bonus_screen = 1; ud.display_bonus_screen = 1;
ud.show_level_text = 1;
ud.configversion = 0; ud.configversion = 0;
Bstrcpy(ud.rtsname, "DUKE.RTS"); Bstrcpy(ud.rtsname, "DUKE.RTS");

View file

@ -429,6 +429,7 @@ typedef struct {
char savegame[10][22]; char savegame[10][22];
char pwlockout[128],rtsname[128]; char pwlockout[128],rtsname[128];
char display_bonus_screen; char display_bonus_screen;
char show_level_text;
config_t config; config_t config;
} user_defs; } user_defs;

View file

@ -3787,7 +3787,7 @@ void displayrest(int smoothratio)
operatefta(); operatefta();
if (hud_showmapname && leveltexttime > 1) if (ud.show_level_text && hud_showmapname && leveltexttime > 1)
{ {
int bits = 10+16; int bits = 10+16;

View file

@ -913,6 +913,7 @@ const memberlabel_t userdefslabels[]=
{ "crosshairscale", USERDEFS_CROSSHAIRSCALE, 0, 0 }, { "crosshairscale", USERDEFS_CROSSHAIRSCALE, 0, 0 },
{ "althud", USERDEFS_ALTHUD, 0, 0 }, { "althud", USERDEFS_ALTHUD, 0, 0 },
{ "display_bonus_screen", USERDEFS_DISPLAY_BONUS_SCREEN, 0, 0 }, { "display_bonus_screen", USERDEFS_DISPLAY_BONUS_SCREEN, 0, 0 },
{ "show_level_text", USERDEFS_SHOW_LEVEL_TEXT, 0, 0 },
{ "", -1, 0, 0 } // END OF LIST { "", -1, 0, 0 } // END OF LIST
}; };
@ -1090,7 +1091,7 @@ static int increasescriptsize(int size)
newscript = (intptr_t *)Brealloc(script, g_ScriptSize * sizeof(intptr_t)); newscript = (intptr_t *)Brealloc(script, g_ScriptSize * sizeof(intptr_t));
// bitptr = (char *)Brealloc(bitptr, g_ScriptSize * sizeof(char)); // bitptr = (char *)Brealloc(bitptr, g_ScriptSize * sizeof(char));
newbitptr = Bcalloc(1,((size+7)>>3) * sizeof(char)); newbitptr = Bcalloc(1,(((size+7)>>3)+1) * sizeof(char));
if (newscript == NULL || newbitptr == NULL) if (newscript == NULL || newbitptr == NULL)
{ {
@ -5681,7 +5682,7 @@ void loadefs(const char *filenam)
Bfree(script); Bfree(script);
script = Bcalloc(1,g_ScriptSize * sizeof(intptr_t)); script = Bcalloc(1,g_ScriptSize * sizeof(intptr_t));
bitptr = Bcalloc(1,((g_ScriptSize+7)>>3) * sizeof(char)); bitptr = Bcalloc(1,(((g_ScriptSize+7)>>3)+1) * sizeof(char));
// initprintf("script: %d, bitptr: %d\n",script,bitptr); // initprintf("script: %d, bitptr: %d\n",script,bitptr);
labelcnt = defaultlabelcnt = 0; labelcnt = defaultlabelcnt = 0;

View file

@ -368,6 +368,7 @@ enum userdefslabels
USERDEFS_CROSSHAIRSCALE, USERDEFS_CROSSHAIRSCALE,
USERDEFS_ALTHUD, USERDEFS_ALTHUD,
USERDEFS_DISPLAY_BONUS_SCREEN, USERDEFS_DISPLAY_BONUS_SCREEN,
USERDEFS_SHOW_LEVEL_TEXT,
USERDEFS_END USERDEFS_END
}; };

View file

@ -877,6 +877,15 @@ void DoUserDef(int iSet, int lLabelID, int lVar2)
SetGameVarID(lVar2, ud.display_bonus_screen, g_i, g_p); SetGameVarID(lVar2, ud.display_bonus_screen, g_i, g_p);
return; return;
case USERDEFS_SHOW_LEVEL_TEXT:
if (iSet)
{
ud.show_level_text = lValue;
return;
}
SetGameVarID(lVar2, ud.show_level_text, g_i, g_p);
return;
default: default:
return; return;
} }

View file

@ -277,7 +277,9 @@ int loadplayer(int spot)
if (kdfread(&g_ScriptSize,sizeof(g_ScriptSize),1,fil) != 1) goto corrupt; if (kdfread(&g_ScriptSize,sizeof(g_ScriptSize),1,fil) != 1) goto corrupt;
if (!g_ScriptSize) goto corrupt; if (!g_ScriptSize) goto corrupt;
scriptptrs = Bcalloc(1,g_ScriptSize * sizeof(scriptptrs)); scriptptrs = Bcalloc(1,g_ScriptSize * sizeof(scriptptrs));
if (kdfread(&bitptr[0],sizeof(bitptr),(g_ScriptSize+7)>>3,fil) != ((g_ScriptSize+7)>>3)) goto corrupt; Bfree(bitptr);
bitptr = Bcalloc(1,(((g_ScriptSize+7)>>3)+1) * sizeof(char));
if (kdfread(&bitptr[0],sizeof(char),(g_ScriptSize+7)>>3,fil) != ((g_ScriptSize+7)>>3)) goto corrupt;
if (script != NULL) if (script != NULL)
Bfree(script); Bfree(script);
script = Bcalloc(1,g_ScriptSize * sizeof(intptr_t)); script = Bcalloc(1,g_ScriptSize * sizeof(intptr_t));
@ -662,7 +664,7 @@ int saveplayer(int spot)
} }
// dfwrite(&scriptptrs[0],sizeof(scriptptrs),g_ScriptSize,fil); // dfwrite(&scriptptrs[0],sizeof(scriptptrs),g_ScriptSize,fil);
dfwrite(&bitptr[0],sizeof(bitptr),(g_ScriptSize+7)>>3,fil); dfwrite(&bitptr[0],sizeof(char),(g_ScriptSize+7)>>3,fil);
dfwrite(&script[0],sizeof(script),g_ScriptSize,fil); dfwrite(&script[0],sizeof(script),g_ScriptSize,fil);
for (i=0;i<g_ScriptSize;i++) for (i=0;i<g_ScriptSize;i++)
@ -700,7 +702,8 @@ int saveplayer(int spot)
actorLoadEventScrptr[i] = (intptr_t *)j; actorLoadEventScrptr[i] = (intptr_t *)j;
} }
scriptptrs = Brealloc(scriptptrs, MAXSPRITES * sizeof(scriptptrs)); Bfree(scriptptrs);
scriptptrs = Bcalloc(1, MAXSPRITES * sizeof(scriptptrs));
for (i=0;i<MAXSPRITES;i++) for (i=0;i<MAXSPRITES;i++)
{ {