About mouse pointers

Everything related to the code /
Tout ce qui touche au code
Post Reply
User avatar
Balthazar
Moderator
Posts: 2055
Joined: Wed Nov 01, 2006 4:31 pm
Location: Russian Federation
Contact:

About mouse pointers

Post by Balthazar » Sat Jan 12, 2008 9:59 pm

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?

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Sat Jan 12, 2008 11:28 pm

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.
=>;-D Penguin Powered

User avatar
REVENGE
Posts: 17
Joined: Tue Jan 01, 2008 8:53 am

Post by REVENGE » Sun Jan 13, 2008 12:52 am

What about implementing something like APNG or MNG?

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

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Sun Jan 13, 2008 1:00 am

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.
=>;-D Penguin Powered

User avatar
Balthazar
Moderator
Posts: 2055
Joined: Wed Nov 01, 2006 4:31 pm
Location: Russian Federation
Contact:

Post by Balthazar » Sun Jan 13, 2008 8:58 am

Thanks :)

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Sat Jan 19, 2008 3:16 pm

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.
=>;-D Penguin Powered

User avatar
Balthazar
Moderator
Posts: 2055
Joined: Wed Nov 01, 2006 4:31 pm
Location: Russian Federation
Contact:

Post by Balthazar » Sat Jan 19, 2008 3:25 pm

Thanks for information!1 I`ll try to create something nice with it :) And after that add page in ta3d wiki discribing it.

User avatar
REVENGE
Posts: 17
Joined: Tue Jan 01, 2008 8:53 am

Post by REVENGE » Mon Jan 21, 2008 3:29 am

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?

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Post by zuzuf » Mon Jan 21, 2008 1:45 pm

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.
=>;-D Penguin Powered

Post Reply

Who is online

Users browsing this forum: No registered users and 38 guests