Comments (1)
Sorry, was seek for some time, now I'm back...
Okay, after a bit of research (mostly by looking back in time on why this change has been done), here is a result:
First of all, yes, it does create an empty light type with index 0 (zero), but it doesn't used anywhere at all, as - skipped:
void LightInfo::packExtended( BitStream *stream ) const
{
for ( U32 i = 0; i < mExtended.size(); i++ )
if ( mExtended[ i ] )
mExtended[ i ]->packUpdate( stream );
}
When this bit of code is called (like from the ScatterSky::packUpdate()
, it will call the pack function for all non-empty lights.
And it is possible to build the T3D on Linux without this change, but...
Second, lightShadowMap.cpp and lightMapParams.cpp are link-order-dependent as it uses global c-tors (right for LightInfoExType).
So, it's possible that on one platform the ShadowMapParams is constructed before LightMapParams, and on another - in different order. In this case those two builds will crash upon connect, as one will assume it is sending data for ShadowMapParams (index=0), but the other retrieving it as LightMapParams (but in this build ShadowMapParams has index=1 as linked in reversed order).
So it will either try to read more from the stream in unpack, or the unpacked data will be corrupted (as it used for wrong light type), anyway at some moment it will crash.
To sum up everything:
It can be left as is now, with empty light type (at index zero), as it doesn't add any overhead at all and there are no objects created with empty type.
Or, we can refactor the code not to construct LightInfoExType globally, and change it to be pointer instead and create it by using MODULEs.
As far as I remember, the whole "MODULE__" system in T3D was implemented exactly for this - to avoid such problems in the code. And I believe the _LightInfoExType* is the only thingy left unchanged.
@DavidWyand-GG you can see my initial post about this problem here: http://www.garagegames.com/community/forums/viewthread/110087/3#comment-737441
from torque3d.
Related Issues (20)
- Volumetric Fog doesn't work on dedicated. HOT 2
- Crash on shipping build, console HOT 1
- No lighting for a moment at level load HOT 2
- bullet and physx collision meshes are broke HOT 2
- OpenAL SFX should be relative to "ear" bone HOT 4
- Openal-soft Broke Linux HOT 3
- NFD open file browser crash HOT 1
- Whether the-Forge for Torque3D is ready now or still in developing? HOT 1
- BaseGame Script Review HOT 2
- Terrain shadow wiggle issue HOT 3
- Cmake 3.16.rc warnings
- Build failing on Ubuntu 18.04.3 HOT 2
- GUI editor crashes engine when attempting to save outside of the program directory.
- aarch64 architecture support for linux and Windows 10 on ARM
- SFXEnvironment = busted
- Is Torque3D dead? HOT 2
- I need some help with the launching
- TC game
- Tcgame
- Torque on Solaris Illumos
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from torque3d.