123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|656|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> C/C++/C#/Other -> Flash ActionScript > C#

Tue, 02 Jun 2009, 09:52
Afr0
I need some help with converting code written in ActionScript for Adobe Flash to C#.

Here's the class I'm trying to convert:



Can someone please help me figure out exactly how this class works? I know it's a singleton, but I don't really know much more than that.

Here is an example of how this class is used:



Here's what I've converted so far:



One theory I have is that _converted is some kind of array containing elenents of... some kind of type. What kind of type, I'm not sure. :|
If this theory is correct, the above example would be the ActionScript way of implementing [Array]Indexers like in C#.
Bah... I'm confused!!

Someone please help!!

IffChunkReturnType simply looks like this:



-=-=-
Afr0 Games

Project Dollhouse on Github - Please fork!
Wed, 03 Jun 2009, 14:40
Scherererer
I think you're right about it converting data formats. I'm guessing all of these things are some kinds of commands passed in as a byte array, and then it converts that array into a single unsigned integer, and then compares that to all of the IFFChunkID's possible, and if it is one of those it converts it.

I think that the IFFChunkID is acting kind of like an enum? It really looks like a poor implementation to me. It looks to me like the functions like this:



are just supposed to return the fields of _instance from a static context. I think they're some kind of settings that you can make, maybe they're trying to map values to those constants (like PALT) and couldn't do it with actionscript enums, and so they did this bastard practice.

Having never used action script before, and not knowing what this api is for exactly, I can't tell much more than that, but this is all my best guess.

-=-=-
YouTube Twitter
Computer Science Series: Logic (pt1) (part 2) (part 3) 2's Complement Mathematics: Basic Differential Calculus
Wed, 10 Jun 2009, 02:20
Afr0
Thanks for your input!
I've found alot of sourcecode after doing conciderable research that seems to work alot better than this Flash code.
In fact as of today I managed to extract most of the chunks inside an iff file.
I'm actually concidering putting up a Wiki on my site (https://www.afr0games.com) where I'll document all the information I have on the various formats from The Sims so other developers can gain from it.

-=-=-
Afr0 Games

Project Dollhouse on Github - Please fork!
Wed, 10 Jun 2009, 15:41
Afr0
And I just did put up a Wiki!

Iff format, documented once and for all

If anyone has anything at all to contribute to this Wiki, please do so!

-=-=-
Afr0 Games

Project Dollhouse on Github - Please fork!