Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Akari

Pages: 1 ... 22 23 24 25 26 [27] 28 29 30 31
651
Q-Gears / Re: About camera in field file.
« on: 2006-06-22 02:49:09 »
Synergy Blades, could you post struct and code that reads values from file (the walkmesh and camera). My error might be in there.

Here s mine

Code: [Select]
void
DatFile::GetWalkMesh(TotalGeometry &walkmesh)
{
    u32 offset_to_walkmesh = 0x1C + GetU32LE(0x04) - GetU32LE(0x00);

    Geometry geometry;
    geometry.TexEnabled = false;

    u32 number_of_poly = GetU32LE(offset_to_walkmesh);
    int start = offset_to_walkmesh + 0x04;

    for (u32 i = 0; i < number_of_poly; ++i)
    {
        Vertex v[3];

        v[0].p.x = -static_cast<s16>(GetU16LE(start + 0x00));
        v[0].p.z =  static_cast<s16>(GetU16LE(start + 0x02));
        v[0].p.y =  static_cast<s16>(GetU16LE(start + 0x04));
        v[0].c.r = 1.0f; v[0].c.g = 0.0f; v[0].c.b = 0.0f; v[0].c.a = 1.0f;
        v[1].p.x = -static_cast<s16>(GetU16LE(start + 0x08));
        v[1].p.z =  static_cast<s16>(GetU16LE(start + 0x0A));
        v[1].p.y =  static_cast<s16>(GetU16LE(start + 0x0C));
        v[1].c.r = 1.0f; v[1].c.g = 0.0f; v[1].c.b = 0.0f; v[1].c.a = 1.0f;
        v[2].p.x = -static_cast<s16>(GetU16LE(start + 0x10));
        v[2].p.z =  static_cast<s16>(GetU16LE(start + 0x12));
        v[2].p.y =  static_cast<s16>(GetU16LE(start + 0x14));
        v[2].c.r = 1.0f; v[2].c.g = 0.0f; v[2].c.b = 0.0f; v[2].c.a = 1.0f;

        geometry.AddTriangle(v);

        // go to the next triangle
        start += 0x18;

    }

    walkmesh.GeometryVector.push_back(geometry);
}

Code: [Select]
void
DatFile::GetCameraMatrix(Matrix &camera)
{
    u32 offset_to_camera = 0x1C + GetU32LE(0x0C) - GetU32LE(0x00);

    // get camera matrix (3 vectors)
    float vxx = static_cast<float>( static_cast<s16>(GetU16LE(offset_to_camera + 0x00))) / 4096.0f;
    float vxy = static_cast<float>( static_cast<s16>(GetU16LE(offset_to_camera + 0x04))) / 4096.0f;
    float vxz = static_cast<float>( static_cast<s16>(GetU16LE(offset_to_camera + 0x02))) / 4096.0f;

    float vyx = static_cast<float>(-static_cast<s16>(GetU16LE(offset_to_camera + 0x06))) / 4096.0f;
    float vyy = static_cast<float>(-static_cast<s16>(GetU16LE(offset_to_camera + 0x0A))) / 4096.0f;
    float vyz = static_cast<float>(-static_cast<s16>(GetU16LE(offset_to_camera + 0x08))) / 4096.0f;

    float vzx = static_cast<float>( static_cast<s16>(GetU16LE(offset_to_camera + 0x0C))) / 4096.0f;
    float vzy = static_cast<float>( static_cast<s16>(GetU16LE(offset_to_camera + 0x10))) / 4096.0f;
    float vzz = static_cast<float>( static_cast<s16>(GetU16LE(offset_to_camera + 0x0E))) / 4096.0f;

    Matrix mat(vxx, vyx, vzx, 0,
               vxy, vyy, vzy, 0,
               vxz, vyz, vzz, 0,
               0,   0,   0,   1);

    // get camera position in world
    s16 ox  =  static_cast<s16>(GetU16LE(offset_to_camera + 0x14));
    s16 oy  = -static_cast<s16>(GetU16LE(offset_to_camera + 0x16));
    s16 oz  =  static_cast<s16>(GetU16LE(offset_to_camera + 0x18));

    float tx = -(ox * vxx + oy * vyx + oz * vzx);
    float ty = -(ox * vxy + oy * vyy + oz * vzy);
    float tz = -(ox * vxz + oy * vyz + oz * vzz);

//    Matrix mat2;
//    MatrixTranslation(mat2, -tx, -ty, -tz);

//    printf("%f %f %f", tx, ty, tz);
//    MatrixMultiply(camera, mat, mat2);

    camera = LookAt(tx, ty, tz, vzx, vzy, vzz, 0, 1, 0);
}

652
Q-Gears / Re: About camera in field file.
« on: 2006-06-21 16:59:17 »
Could someone post source of programm that load camera matrix. I get confused with it.
I believe this was discused when the walk map was being worked on in technical no?
Camera and walkmesh via Reunion
It doesn't seem to be there anymore (sigh) there was a huge long thing on the walk mesh information.  Someone had a nice viewer for it (unless that was you Akari :D)

I found description of sector 2 in this post http://forums.qhimm.com/index.php?topic=3247.0 as well as Kero programm that loads it. I has problems with signs of vectors... and maybe with something else. Just looking at code that loads this thing makes things much more clear.

653
Q-Gears / About camera in field file.
« on: 2006-06-21 04:17:59 »
Could someone post source of programm that load camera matrix. I get confused with it.

654
Q-Gears / Re: SDL/SDL.h: No such file or directory
« on: 2006-06-18 00:06:43 »
I used this http://www.libsdl.org/release/SDL-devel-1.2.10-VC6.zip
Just create directory "SDL" in your devcpp "include" directory and copy files from include directory of SDL-devel in there.

Kay, that worked. Did the same with zlib. But now I get: cannot find -ISDL. :(

It needs library. You need to copy library from SDL-devel to your DEV c++ library directory.

655
Q-Gears / Re: SDL/SDL.h: No such file or directory
« on: 2006-06-17 17:24:37 »
I used this http://www.libsdl.org/release/SDL-devel-1.2.10-VC6.zip
Just create directory "SDL" in your devcpp "include" directory and copy files from include directory of SDL-devel in there.

656
Q-Gears / Re: Todo list
« on: 2006-06-16 19:39:58 »
What's next? Will I need to start work on the field module?

657
Q-Gears / Re: ChangeLog
« on: 2006-06-16 19:38:11 »
New Update... you'll need savemap (put it into data directory under name "savemap") and INIT and MENU directory. Place them into data dir.

658
Q-Gears / Re: Initial savemap?
« on: 2006-06-16 19:31:49 »
Then the question are - what the hell is the 3rd file in kernel archive?

And.... could you write code that initialize savemap with initial values? I'm not good with asm =)

659
Q-Gears / Re: Initial savemap?
« on: 2006-06-16 16:40:45 »
It's the 4th file.

I thought 4th file are initial data for characters... and it seems to be true...
And you're searching for...?

I'm looking for initial values for dialog colors, config values, script variables and so on.

660
Q-Gears / Re: Initial savemap?
« on: 2006-06-16 02:43:54 »
It's the 4th file.

I thought 4th file are initial data for characters... and it seems to be true...

Quote
The inital savemap was discoverd by comparing only the first few hundered bytes or so. I might be off by a planet or two.

But such thing existed?

661
Q-Gears / Initial savemap?
« on: 2006-06-15 18:08:04 »
The 3rd file in kernel archive doesn't seems like initial savemap to me.

Look at http://omake.ru/bakari/q-gears/_savemap ...this is not savemap =(

or maybe I'm doing something wrong?

662
Q-Gears / About textures in exp bar and exp.
« on: 2006-06-15 18:03:52 »
I have two questions:

1) Where to get overlay texture that used as color in experience and limit bar in party menu.

2) How calculate how much experience bar must be filled? Therer are only total EXP and current EXP to next level... this info just not enough =(

663
Q-Gears / Re: Plotting menu windows
« on: 2006-06-15 15:48:55 »
I almost finished test party menu. It appeared with sliding, content info from real savemap... even update timer =)


664
Q-Gears / Re: Plotting menu windows
« on: 2006-06-13 14:16:43 »
Hi there,
Just letting you guys know. I worked on plotting where the menu windows go. Here is a grid to help render the main character status menu. You can download the files here.

Read the readme.

-halkun



You are reading my mind =) I just think about create at least one real menu to test savemap  :roll:

665
Q-Gears / Re: Text format in KERNEL.
« on: 2006-06-12 18:05:08 »
An icon maybe, or DTE? (dual tile encoding)  "it"-"em"

We need to know what it is. There are a lot of rows that content 0xF9 and some character after this. In this case it can be "_item", but how decode all others, they are all different?

666
Q-Gears / Text format in KERNEL.
« on: 2006-06-12 16:32:35 »
Did someone knew format of text in KERNEL, because some bytes dont have any sense to me. What are they?

For example string
Code: [Select]
33 54 45 41 4C F9 4A FFIn game it means "Steal item". 33 54 45 41 4C is "Steal", but what are F9 4A means? It differs from the one in fields...

667
Q-Gears / Re: Memory Allocation (Linux abort issue)
« on: 2006-06-10 11:00:02 »
Quote
Anyway, in src/utilities/logger.cpp on line 51, you have a delete[] attempting to be executed on a statically allocated RString. This one causes an abort.

Next, in src/utilities/config.cpp on line 59, delete is being used on an array instead of delete[]. Doesn't cause an abort, but valgrind sure didn't like it.


Fixed. Thanks a lot.  :-)

668
Q-Gears / Re: Todo list
« on: 2006-06-09 15:34:03 »
Now I created timers to FPS limit, and start to work on database to where all data from KERNEL will be loaded.

669
Q-Gears / Re: ChangeLog
« on: 2006-06-09 15:32:03 »
up.

670
Q-Gears / Re: Coords for tiles in window.bin
« on: 2006-06-07 16:33:33 »
No comments


671
Q-Gears / Re: Coords for tiles in window.bin
« on: 2006-06-05 19:27:03 »
Quote
Clut 3
Purple ATB bar, red text
                                                                               
Clut 4
Blue ATB bar, pink text
                                                                               
Clut 5
Green text

Clut 7
Yellow text
                                                                               
Clut 8
White text

Hmm... the color of those are transparent. So we cant see the font... although it works on window borders. Any comments?

Maybe I made some mistake?
Code: [Select]
u16 col = GetU16LE(sizeof(timHeader) + clut_number * tim_header->number_of_colors * 2 + i * 2);
clut[i].b = ((col      ) & 31) * 8;
clut[i].g = ((col >>  5) & 31) * 8;
clut[i].r = ((col >> 10) & 31) * 8;
clut[i].a = ((col & 0x8000) || (col == 0x0000)) ? 0 : 255;
Although this works in all times  :-(

By the way.. some progress

672
Q-Gears / Re: Coords for tiles in window.bin
« on: 2006-06-04 02:54:57 »
Last part is font's size (for each char).

Can you describe the format?

Quote
I may put my fieldscript opcodes to the side and knock that out real quick.

It will be very helpfull. And I need to know which palette use for each part of window.bin. Because I need to create usual textures, but dont want create 17 copies of the same texture with different palettes.

673
Q-Gears / Re: Coords for tiles in window.bin
« on: 2006-06-03 14:11:25 »
It's hardcoded. At least for items I looked at.

Hmm... then why last part of window.bin looks so like the tile size? Can someone with knowledge of disasm check out for what this file used and what are exact coords for first archive in window.bin

For the time being I hardcoded coords. Soon I update SVN with support for fonts and windows.

Halkun, by the way, how internally position for the text set? For now I set window space as 320x240 and it could be set as is     KERNEL->DrawString("AKARI\nIS\tBAKA!", 200, 200);

And I need char table for real char assosiation, not the ASCII.

674
Q-Gears / Coords for tiles in window.bin
« on: 2006-06-03 03:47:21 »
How square set up coords for the tiles in window.bin interface elements? It's hardcoded in the exe or they have some sort of description for it?

675
Q-Gears / Palettes?
« on: 2006-06-02 18:13:49 »
I'm working on Fonts, Windows and other elements and met some sort of trouble.
All interface elements stored in 4bpp tim... there are more than 10 palettes there. If I render texture with direct colors it will be more than 10 200kbytes textures that are permanently loaded... I think this is too much.

Did someone work with indexed textures in opengl? How can I set palettes, load texture and change palette during render?

Pages: 1 ... 22 23 24 25 26 [27] 28 29 30 31