You are not logged in.

#1 2010-08-20 17:20:48

marc_max
Member

Different results with Dolphin & real Wii

I'm having serious problems with the following code:

Code:

#define BLACK 0x000000FF
void __Graficos_PintarCasilla(u16 x, u16 y, u8 width, u8 type, u32 value){
if(value>0){
GRRLIB_Line(x, y+3, x, y+29, BLACK);
GRRLIB_Rectangle(x+1, y+1, 2, 30, BLACK, true);
GRRLIB_Rectangle(x+3, y, width-6, 32, BLACK, true);
GRRLIB_Rectangle(x+width-3, y+1, 2, 30, BLACK, true);
GRRLIB_Line(x+width-1, y+3, x+width-1, y+29, BLACK);
...
//write value inside the black box
}
}

Basically, I want to draw rounded-borders rectangles in a specified x and y, with an specified width and with a number written on it. I only want that.

This is drawn correctly on Dolphin. But when I run this code on my Wii, the box looks more or less like this:
http://a.imageshack.us/img571/1296/grrlib.png

I tried changing the Wii's settings to normal 4:3 instead of 16:9 but I get the same results (as far as I know the framebuffer is always the same even if I use 16:9 so I don't think this is a problem, but I wanted to try it).


My DOL is already 3.7megabytes. I have a lot of PNG files, almost all of them are very small (less than 10kb). Only 35 of them are big (30~90kb). The small ones are always on memory, but the biggest ones I try to free them when I'm not using them in that moment in order to get the maximum free memory. Maybe I don't have enough memory and the program is becoming 'crazy'?

Offline

 

#2 2010-08-20 19:12:12

NoNameNo
Administrator

Re: Different results with Dolphin & real Wii

1st try to make a tiny project, make ONLY this box, a remove all other stuff around to see if it is specificaly this code.
then we will investigate further after this. wink

Offline

 

#3 2010-08-21 20:12:05

marc_max
Member

Re: Different results with Dolphin & real Wii

http://pastie.org/1106357

I tried it, and the same. So it's not a bug on my program.
I pasted the code there, you can check it out.

The font is the same used on GRRLib examples.

Last edited by marc_max (2010-08-21 20:12:32)

Offline

 

#4 2010-08-22 02:22:19

Crayon
Bad Mother Fucker

Re: Different results with Dolphin & real Wii

I just notice there is a difference between a rectangle and a filled rectangle.

Here is my test code:

Code:

GRRLIB_Line(300, 200, 300, 200+25, 0x000000FF);
GRRLIB_Line(301, 200, 301, 200+25, 0xFF0000FF);
GRRLIB_Line(302, 200, 302, 200+25, 0x000000FF);
GRRLIB_Line(303, 200, 303, 200+25, 0xFF0000FF);

GRRLIB_Rectangle(300, 225, 3, 25, 0x00FF00FF, false);

GRRLIB_Rectangle(300, 250, 3, 25, 0xFF00FFFF, true);

The result (zoomed):
http://i38.tinypic.com/dzcdmr.png

Until we decide what to do with that, just add an offset, sorry sad

Off topic: You should use GRRLIB_FreeTexture instead of this:

Code:

    free(GFX_Font->data);
    free(GFX_Font);

Offline

 

#5 2010-08-23 14:29:58

marc_max
Member

Re: Different results with Dolphin & real Wii

Yes I know, that was just a test smile

Thank you, I hope you find the problem.

Offline

 

Board footer

Powered by FluxBB