Game Development Community

Torque_no_dso_generation Bug

by Tom Spilman · in Torque Game Engine Advanced · 01/19/2007 (7:53 pm) · 5 replies

The implementation if the TORQUE_NO_DSO_GENERATION flag breaks some extremely useful Torsion as how it currently works Torque will never report a syntax error on compile(). Currently the code looks like this...

bool CodeBlock::compile(const char *codeFileName, StringTableEntry fileName, const char *inScript)
{
#if defined(TORQUE_NO_DSO_GENERATION)
   // There is probably a better way to do this.  
   return false;
#endif

That comment was absolutely right... this breaks the script compile() command which Torsion uses to check for script errors. The proper fix is to move this check before the DSO is written further down in the same function.

if(gSyntaxError)
   {
      consoleAllocReset();
      return false;
   }   

// MOVED HERE BEFORE THE DSO FILE IS WRITTEN!
#if defined(TORQUE_NO_DSO_GENERATION)
   return false;
#endif

   FileStream st;
   if(!ResourceManager->openFileForWrite(st, codeFileName)) 
      return false;
   st.write(U32(Con::DSOVersion));

This way the script is compiled and error and warnings are pushed out to the console log, but the DSO is not written. I really hope to see this in the new 4.2 release.

About the author

Tom is a programmer and co-owner of Sickhead Games, LLC.


#1
01/19/2007 (8:03 pm)
Issue #2563. Thanks Tom!
#2
01/20/2007 (8:32 pm)
If nothing else, I would like to point out that my comment was at least correct ;)
#3
01/21/2007 (12:03 pm)
Heh... that it was! :)
#4
06/13/2007 (10:04 pm)
Bump... seems this fix isn't in TGEA 1.01?
#5
06/14/2007 (8:36 am)
I turned DSO generation back on in TGEA mainly because Torsion wasn't catching my syntax errors anymore. When DSO generation was off it created some frustrating situations where functions would only "half-exist" in code, and still "kind of" get executed but work very strangely.