Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
converting Crusader ingame sprites into *.tga files
05-17-2007, 09:05 PM,
#11
Re: converting Crusader ingame sprites into *.tga files
Sorry for the double post, but I've got a couple of questions...

(05-16-2007, 06:59 AM)RPGman link Wrote: TGA don't have fields to store such info. If you have your format, you (or I) can fix it. Sprite origin stored in CrusaderSpriteFrame struct.

Is it possible for you to export the crusader files directly into an animated gif file? If not I think there are animated *.mng files which are a 'free' format.


(05-16-2007, 06:59 AM)RPGman link Wrote: I can upload compiled versions for linux and windows. Does this site has file archive, or should I do it with rapidshare?

Has this been uploaded anywhere yet? Could yo please post a link to rapidshare? Thanks Smile
[Image: signiturema1.jpg]
Reply
05-18-2007, 04:31 AM,
#12
Re: converting Crusader ingame sprites into *.tga files
Making *.mng output. There's always free time lack.
Reply
05-19-2007, 09:33 AM,
#13
Re: converting Crusader ingame sprites into *.tga files
Here is your converter http://rapidshare.com/files/32142943/cru...g.rar.html (5Mb)

Converter takes crusader sprite as parameters, and create two files - mng file with the same name, and ini file with origin.
Both versions compiled - win32 and linux. Some sprites added for testing purposes (and a couple of mng files)
Note - complete sprites required. Crusader explorer available from this site can save only separate animation frames.
Reply
05-19-2007, 11:38 AM,
#14
Re: converting Crusader ingame sprites into *.tga files
Neat! If you don't mind, we can host that file here.
"First let me say welcome to the Resistance, Captain."
Reply
05-19-2007, 11:39 AM,
#15
Re: converting Crusader ingame sprites into *.tga files
Sure  Smile
Reply
05-20-2007, 03:15 PM,
#16
Re: converting Crusader ingame sprites into *.tga files
Hey bro, I didn't get how to work with the tool. Could you describe the procedure of extracting *.spr files and converting them into mng.
"Time is a great teacher, but unfortunately it kills all its pupils." - Hector Berlioz
Reply
05-20-2007, 03:38 PM,
#17
Re: converting Crusader ingame sprites into *.tga files
Here is *.flx unpacker. It will rip separate sprites from *.flx files.
Run it like `flx_unpacker.exe  shapes.flx`, and you'll get a lot of files like File_0001.spr, File_0002.spr....
Id's the same as in left panel of CrusaderExplorer.

Code:
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>

#ifndef O_BINARY
#define O_BINARY 0
#endif

#pragma pack(1)
struct FilePos
{
    unsigned offset;
    unsigned size;
};
#pragma pack()

int main(int argc, char **argv)
{
    int arc = open(argv[1], O_BINARY|O_RDONLY);
    lseek(arc, 0x54, SEEK_SET);

    int files;
    read(arc, &files, sizeof(files));

    FilePos *dir = new FilePos[files];
    lseek(arc, 0x80, SEEK_SET);
    read(arc, dir, files*sizeof(FilePos));

    static const int storage_size = 1024*1024;
    char *storage = new char[storage_size];

    printf("Files: %d\n", files);

    for(int i=0; i<files; ++i)
    {
    if(dir[i].offset && dir[i].size)
    {
        char name[128];
        snprintf(name, sizeof(name), "File_%04x.spr", i);
        printf("Writing %s...\n", name);
        int ouf = open(name, O_RDWR|O_CREAT|O_TRUNC, S_IREAD|S_IWRITE);
        int blocks = dir[i].size/storage_size;
        int rest = dir[i].size%storage_size;

        lseek(arc, dir[i].offset, SEEK_SET);
       
        for(int j=0; j<blocks; ++j)
        {
        read(arc, storage, storage_size);
        write(ouf, storage, storage_size);
        }
        if(rest)
        {
        read(arc, storage, rest);
        write(ouf, storage, rest);
        }
        close(ouf);
    }
    }

    delete[] storage;
    delete[] dir;
}

When you got *.spr, run `crusder2mng File_0001.spr`  to get File_0001.mng and File_0001.ini.
Reply
05-20-2007, 05:22 PM,
#18
Re: converting Crusader ingame sprites into *.tga files
heh I do not have any compiler to compiler the flx_unpacker.exe. Could you compile it if that's not a trouble for you. If so, tell me, maybe I can download free compiler to compiler the file.
"Time is a great teacher, but unfortunately it kills all its pupils." - Hector Berlioz
Reply
05-20-2007, 05:54 PM,
#19
Re: converting Crusader ingame sprites into *.tga files
http://rapidshare.com/files/32400839/flx...r.rar.html
Both linux and windows versions.
Reply
05-20-2007, 08:45 PM,
#20
Re: converting Crusader ingame sprites into *.tga files
Dont take this the wrong way, but I love you man  Big Grin

Does the FLX extractor work with both no remorse and no regret?
[Image: signiturema1.jpg]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)