Merge branch 'Preview4_0' of https://github.com/TorqueGameEngines/Torque3D into Preview4_0

This commit is contained in:
JeffR 2022-02-17 18:30:23 -06:00
commit 6a357d8dfb
1537 changed files with 173488 additions and 37732 deletions

View file

@ -141,9 +141,8 @@ U32 Projectile::smProjectileWarpTicks = 5;
//
afxMagicMissileData::afxMagicMissileData()
{
INIT_SHAPEASSET(ProjectileShape);
sound = NULL;
INIT_ASSET(ProjectileShape);
INIT_ASSET(ProjectileSound);
/* From stock Projectile code...
explosion = NULL;
@ -246,9 +245,9 @@ afxMagicMissileData::afxMagicMissileData()
afxMagicMissileData::afxMagicMissileData(const afxMagicMissileData& other, bool temp_clone) : GameBaseData(other, temp_clone)
{
CLONE_SHAPEASSET(ProjectileShape);
CLONE_ASSET(ProjectileShape);
projectileShape = other.projectileShape; // -- TSShape loads using projectileShapeName
sound = other.sound;
CLONE_ASSET(ProjectileSound);
splash = other.splash;
splashId = other.splashId; // -- for pack/unpack of splash ptr
lightDesc = other.lightDesc;
@ -338,7 +337,7 @@ void afxMagicMissileData::initPersistFields()
INITPERSISTFIELD_SHAPEASSET(ProjectileShape, afxMagicMissileData, "Shape for the projectile");
addField("scale", TypePoint3F, Offset(scale, afxMagicMissileData));
addField("sound", TypeSFXTrackName, Offset(sound, afxMagicMissileData));
INITPERSISTFIELD_SOUNDASSET(ProjectileSound, afxMagicMissileData, "sound for the projectile");
/* From stock Projectile code...
addField("explosion", TYPEID< ExplosionData >(), Offset(explosion, ProjectileData));
@ -533,9 +532,12 @@ bool afxMagicMissileData::preload(bool server, String &errorStr)
Con::errorf(ConsoleLogEntry::General, "ProjectileData::preload: Invalid packet, bad datablockId(decal): %d", decalId);
*/
String sfxErrorStr;
if( !sfxResolve( &sound, sfxErrorStr) )
Con::errorf(ConsoleLogEntry::General, "afxMagicMissileData::preload: Invalid packet: %s", sfxErrorStr.c_str());
_setProjectileSound(getProjectileSound());
if (getProjectileSound() != StringTable->EmptyString())
{
if (!getProjectileSoundProfile())
Con::errorf(ConsoleLogEntry::General, "afxMagicMissileData::preload: Cant get an sfxProfile for afxMagicMissileData.");
}
if (!lightDesc && lightDescId != 0)
if (Sim::findObject(lightDescId, lightDesc) == false)
@ -547,7 +549,7 @@ bool afxMagicMissileData::preload(bool server, String &errorStr)
projectileShape = mProjectileShapeAsset->getShapeResource();
if (bool(projectileShape) == false)
{
errorStr = String::ToString("afxMagicMissileData::load: Couldn't load shape \"%s\"", mProjectileShapeAssetId);
errorStr = String::ToString("afxMagicMissileData::preload: Couldn't load shape \"%s\"", mProjectileShapeAssetId);
return false;
}
/* From stock Projectile code...
@ -599,7 +601,7 @@ void afxMagicMissileData::packData(BitStream* stream)
{
Parent::packData(stream);
PACKDATA_SHAPEASSET(ProjectileShape);
PACKDATA_ASSET(ProjectileShape);
/* From stock Projectile code...
stream->writeFlag(faceViewer);
@ -641,7 +643,7 @@ void afxMagicMissileData::packData(BitStream* stream)
DataBlockObjectIdLast);
*/
sfxWrite( stream, sound );
PACKDATA_ASSET(ProjectileSound);
if ( stream->writeFlag(lightDesc != NULL))
stream->writeRangedU32(lightDesc->getId(), DataBlockObjectIdFirst,
@ -710,7 +712,7 @@ void afxMagicMissileData::unpackData(BitStream* stream)
{
Parent::unpackData(stream);
UNPACKDATA_SHAPEASSET(ProjectileShape);
UNPACKDATA_ASSET(ProjectileShape);
/* From stock Projectile code...
faceViewer = stream->readFlag();
*/
@ -747,7 +749,7 @@ void afxMagicMissileData::unpackData(BitStream* stream)
decalId = stream->readRangedU32(DataBlockObjectIdFirst, DataBlockObjectIdLast);
*/
sfxRead( stream, &sound );
UNPACKDATA_ASSET(ProjectileSound);
if (stream->readFlag())
lightDescId = stream->readRangedU32(DataBlockObjectIdFirst, DataBlockObjectIdLast);
@ -1170,8 +1172,8 @@ bool afxMagicMissile::onNewDataBlock(GameBaseData* dptr, bool reload)
SFX_DELETE( mSound );
if ( mDataBlock->sound )
mSound = SFX->createSource( mDataBlock->sound );
if (mDataBlock->getProjectileSound())
mSound = SFX->createSource(mDataBlock->getProjectileSoundProfile());
}
return true;
@ -2006,7 +2008,7 @@ void afxMagicMissile::get_launch_data(Point3F& pos, Point3F& vel)
void afxMagicMissile::updateSound()
{
if (!mDataBlock->sound)
if (!mDataBlock->isProjectileSoundValid())
return;
if ( mSound )

View file

@ -72,7 +72,7 @@ public:
// variables set in datablock definition:
// Shape related
DECLARE_SHAPEASSET(afxMagicMissileData, ProjectileShape, onShapeChanged);
DECLARE_SHAPEASSET_SETGET(afxMagicMissileData, ProjectileShape);
DECLARE_ASSET_SETGET(afxMagicMissileData, ProjectileShape);
//StringTableEntry projectileShapeName;
//bool hasLight;
@ -126,7 +126,8 @@ public:
SplashData* splash; // Water Splash Datablock
S32 splashId; // Water splash ID
SFXTrack* sound; // Projectile Sound
DECLARE_SOUNDASSET(afxMagicMissileData, ProjectileSound);
DECLARE_ASSET_SETGET(afxMagicMissileData, ProjectileSound);
LightDescription *lightDesc;
S32 lightDescId;

View file

@ -51,7 +51,7 @@ ConsoleDocClass( afxBillboardData,
afxBillboardData::afxBillboardData()
{
color.set(1.0f, 1.0f, 1.0f, 1.0f);
INIT_IMAGEASSET(Texture);
INIT_ASSET(Texture);
dimensions.set(1.0f, 1.0f);
texCoords[0].set(0.0f, 0.0f);
texCoords[1].set(0.0f, 1.0f);
@ -66,7 +66,7 @@ afxBillboardData::afxBillboardData(const afxBillboardData& other, bool temp_clon
: GameBaseData(other, temp_clone)
{
color = other.color;
CLONE_IMAGEASSET(Texture);
CLONE_ASSET(Texture);
dimensions = other.dimensions;
texCoords[0] = other.texCoords[0];
texCoords[1] = other.texCoords[1];
@ -123,7 +123,7 @@ void afxBillboardData::packData(BitStream* stream)
Parent::packData(stream);
stream->write(color);
PACKDATA_IMAGEASSET(Texture);
PACKDATA_ASSET(Texture);
mathWrite(*stream, dimensions);
mathWrite(*stream, texCoords[0]);
@ -140,7 +140,7 @@ void afxBillboardData::unpackData(BitStream* stream)
Parent::unpackData(stream);
stream->read(&color);
UNPACKDATA_IMAGEASSET(Texture);
UNPACKDATA_ASSET(Texture);
mathRead(*stream, &dimensions);
mathRead(*stream, &texCoords[0]);
mathRead(*stream, &texCoords[1]);

View file

@ -48,7 +48,7 @@ public:
public:
DECLARE_IMAGEASSET(afxBillboardData, Texture, onChangeTexture, GFXStaticTextureSRGBProfile);
DECLARE_IMAGEASSET_SETGET(afxBillboardData, Texture);
DECLARE_ASSET_SETGET(afxBillboardData, Texture);
LinearColorF color;

View file

@ -54,7 +54,7 @@ ConsoleDocClass( afxModelData,
afxModelData::afxModelData()
{
INIT_SHAPEASSET(Shape);
INIT_ASSET(Shape);
sequence = ST_NULLSTRING;
seq_rate = 1.0f;
seq_offset = 0.0f;
@ -84,7 +84,7 @@ afxModelData::afxModelData()
afxModelData::afxModelData(const afxModelData& other, bool temp_clone) : GameBaseData(other, temp_clone)
{
CLONE_SHAPEASSET(Shape);
CLONE_ASSET(Shape);
sequence = other.sequence;
seq_rate = other.seq_rate;
seq_offset = other.seq_offset;
@ -253,7 +253,7 @@ void afxModelData::packData(BitStream* stream)
{
Parent::packData(stream);
PACKDATA_SHAPEASSET(Shape);
PACKDATA_ASSET(Shape);
stream->writeString(sequence);
stream->write(seq_rate);
stream->write(seq_offset);
@ -285,7 +285,7 @@ void afxModelData::unpackData(BitStream* stream)
{
Parent::unpackData(stream);
UNPACKDATA_SHAPEASSET(Shape);
UNPACKDATA_ASSET(Shape);
sequence = stream->readSTString();
stream->read(&seq_rate);
stream->read(&seq_offset);

View file

@ -44,7 +44,7 @@ struct afxModelData : public GameBaseData
typedef GameBaseData Parent;
DECLARE_SHAPEASSET(afxModelData, Shape, onShapeChanged);
DECLARE_SHAPEASSET_SETGET(afxModelData, Shape);
DECLARE_ASSET_SETGET(afxModelData, Shape);
StringTableEntry sequence;

View file

@ -78,7 +78,7 @@ bool afxZodiacData::sPreferDestinationGradients = false;
afxZodiacData::afxZodiacData()
{
INIT_IMAGEASSET(Texture);
INIT_ASSET(Texture);
radius_xy = 1;
vert_range.set(0.0f, 0.0f);
@ -120,7 +120,7 @@ afxZodiacData::afxZodiacData()
afxZodiacData::afxZodiacData(const afxZodiacData& other, bool temp_clone) : GameBaseData(other, temp_clone)
{
CLONE_IMAGEASSET(Texture);
CLONE_ASSET(Texture);
radius_xy = other.radius_xy;
vert_range = other.vert_range;
@ -269,7 +269,7 @@ void afxZodiacData::packData(BitStream* stream)
merge_zflags();
PACKDATA_IMAGEASSET(Texture);
PACKDATA_ASSET(Texture);
stream->write(radius_xy);
stream->write(vert_range.x);
stream->write(vert_range.y);
@ -294,7 +294,7 @@ void afxZodiacData::unpackData(BitStream* stream)
{
Parent::unpackData(stream);
UNPACKDATA_IMAGEASSET(Texture);
UNPACKDATA_ASSET(Texture);
stream->read(&radius_xy);
stream->read(&vert_range.x);
stream->read(&vert_range.y);

View file

@ -60,7 +60,7 @@ public:
public:
DECLARE_IMAGEASSET(afxZodiacData, Texture, onImageChanged, AFX_GFXZodiacTextureProfile);
DECLARE_IMAGEASSET_SETGET(afxZodiacData, Texture);
DECLARE_ASSET_SETGET(afxZodiacData, Texture);
F32 radius_xy;
Point2F vert_range;

View file

@ -51,7 +51,7 @@ ConsoleDocClass( afxZodiacPlaneData,
afxZodiacPlaneData::afxZodiacPlaneData()
{
INIT_IMAGEASSET(Texture);
INIT_ASSET(Texture);
radius_xy = 1;
start_ang = 0;
@ -71,7 +71,7 @@ afxZodiacPlaneData::afxZodiacPlaneData()
afxZodiacPlaneData::afxZodiacPlaneData(const afxZodiacPlaneData& other, bool temp_clone)
: GameBaseData(other, temp_clone)
{
CLONE_IMAGEASSET(Texture);
CLONE_ASSET(Texture);
radius_xy = other.radius_xy;
start_ang = other.start_ang;
@ -165,7 +165,7 @@ void afxZodiacPlaneData::packData(BitStream* stream)
merge_zflags();
PACKDATA_IMAGEASSET(Texture);
PACKDATA_ASSET(Texture);
stream->write(radius_xy);
stream->write(start_ang);
@ -184,7 +184,7 @@ void afxZodiacPlaneData::unpackData(BitStream* stream)
{
Parent::unpackData(stream);
UNPACKDATA_IMAGEASSET(Texture);
UNPACKDATA_ASSET(Texture);
stream->read(&radius_xy);
stream->read(&start_ang);

View file

@ -60,7 +60,7 @@ public:
public:
DECLARE_IMAGEASSET(afxZodiacPlaneData, Texture, onImageChanged, AFX_GFXZodiacTextureProfile);
DECLARE_IMAGEASSET_SETGET(afxZodiacPlaneData, Texture);
DECLARE_ASSET_SETGET(afxZodiacPlaneData, Texture);
F32 radius_xy;
F32 start_ang;