- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting

code to process their messages. This was necessary to handle the %zu format
  option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.


SVN r1056 (trunk)
This commit is contained in:
Christoph Oelckers 2008-06-29 08:42:07 +00:00
parent d0b2c41270
commit 2afac5c716
3 changed files with 56 additions and 38 deletions

View file

@ -1,12 +1,8 @@
June 28, 2008 (Changes by Graf Zahl) June 29, 2008 (Changes by Graf Zahl)
- Removed some unused constant definitions from sc_man.cpp. - Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
- Fixed: A_FireBlasterPL2 played the weapon sound with the missile as origin code to process their messages. This was necessary to handle the %zu format
instead of the shooting player. option used in some memory allocation failure messages.
- Fixed: Dead players didn't get the MF_CORPSE flag set. - Fixed: The flat texture scaling action specials were completely broken.
- Fixed: The internal definition of Floor_LowerToNearest had incorrect parameter
settings.
- Fixed: Heretic's ActivatedTimeBomb had the same spawn ID as the inventory item.
- fixed: Heretic's mace did not have its spawn ID set.
June 28, 2008 June 28, 2008
- The sound code now handles restarting looping sounds itself. As far as - The sound code now handles restarting looping sounds itself. As far as
@ -34,6 +30,16 @@ June 28, 2008
to dump them now, which leaves the movie player in a totally unworkable to dump them now, which leaves the movie player in a totally unworkable
state. state.
June 28, 2008 (Changes by Graf Zahl)
- Removed some unused constant definitions from sc_man.cpp.
- Fixed: A_FireBlasterPL2 played the weapon sound with the missile as origin
instead of the shooting player.
- Fixed: Dead players didn't get the MF_CORPSE flag set.
- Fixed: The internal definition of Floor_LowerToNearest had incorrect parameter
settings.
- Fixed: Heretic's ActivatedTimeBomb had the same spawn ID as the inventory item.
- fixed: Heretic's mace did not have its spawn ID set.
June 26, 2008 June 26, 2008
- Changed S_Sound() to take the same floating point attenuation that the - Changed S_Sound() to take the same floating point attenuation that the
internal S_StartSound() uses. Now ambient sounds can use the public internal S_StartSound() uses. Now ambient sounds can use the public

View file

@ -2181,6 +2181,28 @@ FUNC(LS_Sector_SetFloorPanning)
return true; return true;
} }
FUNC(LS_Sector_SetFloorScale)
// Sector_SetFloorScale (tag, x-int, x-frac, y-int, y-frac)
{
int secnum = -1;
fixed_t xscale = arg1 * FRACUNIT + arg2 * (FRACUNIT/100);
fixed_t yscale = arg3 * FRACUNIT + arg4 * (FRACUNIT/100);
if (xscale)
xscale = FixedDiv (FRACUNIT, xscale);
if (yscale)
yscale = FixedDiv (FRACUNIT, yscale);
while ((secnum = P_FindSectorFromTag (arg0, secnum)) >= 0)
{
if (xscale)
sectors[secnum].SetXScale(sector_t::floor, xscale);
if (yscale)
sectors[secnum].SetYScale(sector_t::floor, yscale);
}
return true;
}
FUNC(LS_Sector_SetCeilingScale) FUNC(LS_Sector_SetCeilingScale)
// Sector_SetCeilingScale (tag, x-int, x-frac, y-int, y-frac) // Sector_SetCeilingScale (tag, x-int, x-frac, y-int, y-frac)
{ {
@ -2196,9 +2218,9 @@ FUNC(LS_Sector_SetCeilingScale)
while ((secnum = P_FindSectorFromTag (arg0, secnum)) >= 0) while ((secnum = P_FindSectorFromTag (arg0, secnum)) >= 0)
{ {
if (xscale) if (xscale)
sectors[secnum].SetXScale(sector_t::ceiling, arg1); sectors[secnum].SetXScale(sector_t::ceiling, xscale);
if (yscale) if (yscale)
sectors[secnum].SetYScale(sector_t::ceiling, arg2); sectors[secnum].SetYScale(sector_t::ceiling, yscale);
} }
return true; return true;
} }
@ -2218,7 +2240,7 @@ FUNC(LS_Sector_SetFloorScale2)
if (arg1) if (arg1)
sectors[secnum].SetXScale(sector_t::floor, arg1); sectors[secnum].SetXScale(sector_t::floor, arg1);
if (arg2) if (arg2)
sectors[secnum].SetXScale(sector_t::floor, arg1); sectors[secnum].SetYScale(sector_t::floor, arg2);
} }
return true; return true;
} }
@ -2238,29 +2260,7 @@ FUNC(LS_Sector_SetCeilingScale2)
if (arg1) if (arg1)
sectors[secnum].SetXScale(sector_t::ceiling, arg1); sectors[secnum].SetXScale(sector_t::ceiling, arg1);
if (arg2) if (arg2)
sectors[secnum].SetXScale(sector_t::ceiling, arg1); sectors[secnum].SetYScale(sector_t::ceiling, arg2);
}
return true;
}
FUNC(LS_Sector_SetFloorScale)
// Sector_SetFloorScale (tag, x-int, x-frac, y-int, y-frac)
{
int secnum = -1;
fixed_t xscale = arg1 * FRACUNIT + arg2 * (FRACUNIT/100);
fixed_t yscale = arg3 * FRACUNIT + arg4 * (FRACUNIT/100);
if (xscale)
xscale = FixedDiv (FRACUNIT, xscale);
if (yscale)
yscale = FixedDiv (FRACUNIT, yscale);
while ((secnum = P_FindSectorFromTag (arg0, secnum)) >= 0)
{
if (xscale)
sectors[secnum].SetXScale(sector_t::floor, arg1);
if (yscale)
sectors[secnum].SetXScale(sector_t::floor, arg1);
} }
return true; return true;
} }

View file

@ -515,6 +515,19 @@ void I_Quit (void)
extern FILE *Logfile; extern FILE *Logfile;
bool gameisdead; bool gameisdead;
// We should use ZDoom's internal formatting routine here so that the extended
// format specifiers work here as well.
// However, since throwing FStrings around causes some problems in VC++ the
// error message is still copied to a local buffer.
static void myvsnprintf(char *DstBuf, size_t MaxCount, const char * Format, va_list ArgList)
{
FString formatstr;
formatstr.VFormat(Format, ArgList);
strncpy(DstBuf, formatstr.GetChars(), MaxCount);
DstBuf[MaxCount-1] = 0;
}
void STACK_ARGS I_FatalError (const char *error, ...) void STACK_ARGS I_FatalError (const char *error, ...)
{ {
static BOOL alreadyThrown = false; static BOOL alreadyThrown = false;
@ -524,10 +537,9 @@ void STACK_ARGS I_FatalError (const char *error, ...)
{ {
alreadyThrown = true; alreadyThrown = true;
char errortext[MAX_ERRORTEXT]; char errortext[MAX_ERRORTEXT];
int index;
va_list argptr; va_list argptr;
va_start (argptr, error); va_start (argptr, error);
index = vsprintf (errortext, error, argptr); myvsnprintf (errortext, MAX_ERRORTEXT, error, argptr);
va_end (argptr); va_end (argptr);
// Record error to log (if logging) // Record error to log (if logging)
@ -550,7 +562,7 @@ void STACK_ARGS I_Error (const char *error, ...)
char errortext[MAX_ERRORTEXT]; char errortext[MAX_ERRORTEXT];
va_start (argptr, error); va_start (argptr, error);
vsprintf (errortext, error, argptr); myvsnprintf (errortext, MAX_ERRORTEXT, error, argptr);
va_end (argptr); va_end (argptr);
throw CRecoverableError (errortext); throw CRecoverableError (errortext);