Page 1 of 1

About mouse pointers

Posted: Sat Jan 12, 2008 9:59 pm
by Balthazar
Requesting size and format of mouse pointers to make new ones.

How did they animated? Is it separate images or some-kind of looping frame sequence?

Can they be switched for 3D pointers? What format?

Posted: Sat Jan 12, 2008 11:28 pm
by zuzuf
cursors are images, well animated images, so it's a sequence of frames that is looping. There is no need for 3D pointers, you can have a 3D model and then render a cursor animation from it, you'll get a 3D cursor that way.

for size information, look at anims/cursors.gaf (with HPIView for example).

Currently cursors are stored in gaf files, but gaf only supports 8bits textures, so I'll make a new format in order to have 32 bits (24bits RGB + 8bits alpha) animations stored in a gaf like format (probably a 24bits JPG for RGB components and a less compressed greyscale JPG for alpha, it's the way 3DM stores textures).

I suggest you make 32 bits frames using alpha for transparency in .tga or .png (not jpg because it doesn't support alpha channel and it's a lossy format so it's not good when creating an image)

PS: cursors are 15fps animations.

Posted: Sun Jan 13, 2008 12:52 am
by REVENGE
What about implementing something like APNG or MNG?

http://en.wikipedia.org/wiki/Animated_P ... k_Graphics

Posted: Sun Jan 13, 2008 1:00 am
by zuzuf
APNG and MNG only support one animated sequence ... GAF supports more than only one and also stores offsets required for cursors. For the same reason TA didn't use gif, we cannot use APNG or MNG.

Posted: Sun Jan 13, 2008 8:58 am
by Balthazar
Thanks :)

Posted: Sat Jan 19, 2008 3:16 pm
by zuzuf
I've just finished support for 24/32bits GAFs (alpha channel is saved only if needed).

It's an extension of the GAF format specific to TA3D, you cannot read those HD GAFs with TA.

Currently there is only one tool to make those GAFs: hpiview
You have to use it that way:

./hpiview create_gaf gaf_descriptor
or
hpiview.exe create_gaf gaf_descriptor

where gaf_descriptor is the name of the text file that describes the file you want to create. It's made like this:

Code: Select all

[gadget0]
{
  entries=the number of anims you want to put in the file;
  filename=the destination file.gaf;
}
[gadget1]          // The first animation
{
  frames=number of frames;
  name=the name of this animation; // has to be set otherwise you won't be able to find your animation in the resulting GAF
  [frame0]    // The first frame
  {
    XPos=the offset on the x axis;
    YPos=the offets on the y axis;
    filename=the image file to use as this frame;
  }
  [frame...]
  ...
}
If you want an example of this syntax you can extract the content of a GAF (any GAF type is supported) with hpiview:

./hpiview extract_gaf anims\\cursors.gaf

this command will extract all the frames within anims\cursors.gaf (note the \\, if you don't want to type \\ you can type "anims\cursors.gaf"), and it'll create a anims\cursors.gaf.txt file with the above syntax so that you can modify the frames and then put them back into GAF format (but it'll be 24/32bits GAF not TA 8bits GAF).

This feature is available in current SVN, I'll make a test release soon so you can do new cursors.

Also, can you write a page in our new wiki to explain how to create and extract frames from GAFs ? since I've created this mechanism I don't know what is obvious and what isn't.

Posted: Sat Jan 19, 2008 3:25 pm
by Balthazar
Thanks for information!1 I`ll try to create something nice with it :) And after that add page in ta3d wiki discribing it.

Posted: Mon Jan 21, 2008 3:29 am
by REVENGE
How interesting. It would be nice for someone to write a GUI frontend to hpiview, but for now it seems sufficient.

By the way, what exactly will the new GAFs be used for other than to replace the cursor animations? I'm assuming we'll have proper 3d explosions someday, so what else are we using them for?

Posted: Mon Jan 21, 2008 1:45 pm
by zuzuf
24/32bits gafs can be used for everything normal GAFs are used:
* cursors
* explosions
* unit textures
* in game GUI (build menus, ...)
* everything I forgot

hpiview will need a frontend some day, but it would be better not to write it using the TA3D API, it wouldn't be well integrated in the desktop environment.