- Make the autosegs read-only.

- Derive PClass from dobject.cpp. This has one major ramification: Since the PClass
  is not allocated until runtime, you cannot initialize any static/global data
  structures with pointers to PClasses using RUNTIME_CLASS. Attempting to do so
  will just initialize with a NULL pointer. Instead, you can initialize using
  the address of the pointer returned by RUNTIME_CLASS and dereference that. By
  the time you have an opportunity to dereference it, it will no longer be NULL.
- Sync CmakeLists.txt.
- Random fixes for problems GCC spotted.

SVN r1852 (scripting)
This commit is contained in:
Randy Heit 2009-09-17 01:36:14 +00:00
commit 1eb7912bd8
35 changed files with 258 additions and 207 deletions

View file

@ -1760,16 +1760,16 @@ static int PatchMisc (int dummy)
"Minotaur",
NULL
};
static const PClass * const types[] =
static const PClass * const *types[] =
{
RUNTIME_CLASS(APowerInvulnerable),
RUNTIME_CLASS(APowerStrength),
RUNTIME_CLASS(APowerInvisibility),
RUNTIME_CLASS(APowerIronFeet),
RUNTIME_CLASS(APowerLightAmp),
RUNTIME_CLASS(APowerWeaponLevel2),
RUNTIME_CLASS(APowerSpeed),
RUNTIME_CLASS(APowerMinotaur)
&RUNTIME_CLASS(APowerInvulnerable),
&RUNTIME_CLASS(APowerStrength),
&RUNTIME_CLASS(APowerInvisibility),
&RUNTIME_CLASS(APowerIronFeet),
&RUNTIME_CLASS(APowerLightAmp),
&RUNTIME_CLASS(APowerWeaponLevel2),
&RUNTIME_CLASS(APowerSpeed),
&RUNTIME_CLASS(APowerMinotaur)
};
int i;
@ -1795,7 +1795,7 @@ static int PatchMisc (int dummy)
}
else
{
static_cast<APowerup *>(GetDefaultByType (types[i]))->BlendColor = PalEntry(
static_cast<APowerup *>(GetDefaultByType (*types[i]))->BlendColor = PalEntry(
BYTE(clamp(a,0.f,1.f)*255.f),
clamp(r,0,255),
clamp(g,0,255),