There were no updates in a long time so while I'm working on something else (and it seems I will have some time now to finish everything) I thought it would be a good idea to post at least these things that are working fine (for some time already)
- Added "Add file" command (adds files to save) - menu, rightclick, drag&drop
- Added "Delete File" command (deletes single file from save) - menu, rightclick or del key
- Few minor bugfixes in xps reading function.
- Corrected incorrect display of zero-length files in psu.
- Corrected some parts of xps code, that could cause problems in certain cimcurstances.
- Corrected menu enabling/disabling issues (the entries in edit menu remained sometimes active when no file was selected - happened, when you were loading a save (just some leftover from testing). You couldn't use them, but they were not greyed out). Save as in file manu wasn't enabled after successul file read.
New version can be downloaded from the attachement in the first post.
I'm working now on ps2 icon import from 3dsmax's 3ds binary format (it's more than enough for ps2 icon). Basic conversion already works fine (first frame from 3ds file - or any other single frame). But I have some problem with animations.
In one format description I found there are some mistakes (some fields are marked as u32 when they should be marked as float) and one big error (in the frame struct there are two unknowns after shapeId and keyNumber. This struct should contain only two members. The other two are in fact first key so they should belong to other struct). It still doesn't help much with the keys.
I'll try to work on example (hex values in big endian):
First the structs (the're not complete struct, just simplified to make it easier to read).
In one of the saves the animation header looks like this:Code:
DWORD animId; //usually 0x01
DWORD frameLength; //length of single animation frame
float animationOne; //animation speed. Divide every float in anim by this. Probably??
DWORD startFrame; //starting frame of animation
DWORD numOfFrames; //total number of frames
float time; //time
float value; //value between 0.0f - 1.0f
DWORD ShapeId; //id of shape to be displayed - first shape is 0x00
DWORD numOfKeys; //total number of keys. Max key time should be equal to frameLength-1
first frame data looks like this:Code:
frameLength = 31
animationOne = 1.0f
startFrame = 0
numOfFrames = 6
then key data followsCode:
ShapeId = 0
numOfKeys = 7
Next frames (except the last one) are almost identical - only the shapeId changes and the values of first key is 0.0f in other frames. The last frame is similiar, but the key6 has value of 1.0f and key7 has value of 0.0f.Code:
key 1: time= 0.0f (0x00000000), value=1.0f (0x803F0000)
key 2: time= 5.0f (0x40A00000), value=0.0f (0x00000000)
key 3: time=10.0f (0x41200000), value=0.0f (0x00000000)
key 4: time=15.0f (0x41700000), value=0.0f (0x00000000)
key 5: time=20.0f (0x41A00000), value=0.0f (0x00000000)
key 6: time=25.0f (0x41C80000), value=0.0f (0x00000000)
key 7: time=30.0f (0x41F00000), value=1.0f (0x803F0000)
It seems that max "time" depends on frameLength (max time is frameLength-1). The first thought I had was, that those keys could be used for frame inbetween interpolations (in the meaning that values would describe how much movement occured from previous frame position to current). But the value of 1.0f at the first key of the first frame makes this little more complicated... Also in 3 or four saves I already checked, there is always repeated this scheme (0,0,0,0,...,1 for values of keys - so no other values than zero and one).
Could someone confirm this? Or maybe someone knows exactly what is the purpose of these keys? Any suggestion would be more than welcome.
Tomorrow I'll try to do some tests with different key times and values...