Game Development Community

Big Shapes DTS Exporter BugFix

by Vincent BILLET · in Artist Corner · 12/06/2006 (5:50 am) · 3 replies

I discoverd a small bug in DTS exporter which doesn't allow to export Heavy Shapes. The solution is here :

In DTSPython/dts_stream.py, replace whole def stroreCheck with :
def storeCheck(self, checkPoint= -1):
		# Write checkpoints (unsigned presumably)
		a=self.checkCount
		b=self.checkCount
		while a>=256:
                                      a=a-256
		while b>=256*256:
                                      b=b-256*256
		self.writeu8(a)
		self.writeu16(b)
		self.writeu32(self.checkCount)
		self.checkCount += 1

Enjoy !

#1
12/06/2006 (7:35 am)
Hey vincent,

Interesting workaround. Checkpoints are indeed unsigned, and i thought that they wrapped round usually?

In any case, your solution would best be implemented by the modulus operator, i.e.:
a = self.checkCount % 256
      b = self.checkCount % 65536

And if you are really crazy, you could also add:
c = self.checkCount % (2**32)

Nice fix.
#2
12/06/2006 (7:53 am)
Lol,
Why sometimes did I forget programming basics ?

Thank you :).
#3
12/10/2006 (8:38 am)
...