Allent1 / wagic

Automatically exported from code.google.com/p/wagic
Other
0 stars 0 forks source link

Menu sides are displaced #460

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
1. Enter the menu
2. Look at the misplaced sides

Look at the attached capture

Original issue reported on code.google.com by jean.cha...@gmail.com on 22 Sep 2010 at 1:57

Attachments:

GoogleCodeExporter commented 8 years ago
Damn, thanks.
I assume this happens on Linux ? We don't have the problem on the PSP or on 
windows, but I've seen it in the N900 port.

Original comment by wagic.the.homebrew@gmail.com on 22 Sep 2010 at 10:59

GoogleCodeExporter commented 8 years ago

Original comment by wagic.the.homebrew@gmail.com on 22 Sep 2010 at 10:59

GoogleCodeExporter commented 8 years ago
This has to do with rotations.
In SimpleMenu.cpp, the following line:
renderer->RenderQuad(side, x - SIDE_SIZE / 2, y + height - 5, -M_PI/2, height - 
10);

replacing -M_PI/2 with M_PI/2 solves the issue. However, of course, then the 
issue happens on OpenGL1 and the PSP.

Could it be because some coordinates are reversed in openGL2?

Original comment by wagic.the.homebrew@gmail.com on 23 Sep 2010 at 1:32

GoogleCodeExporter commented 8 years ago
in renderQuad, replacing
esRotate(&mvpMatrix, -angle*RAD2DEG, 0.0f, 0.0f, 1.0f);
with
esRotate(&mvpMatrix, angle*RAD2DEG, 0.0f, 0.0f, 1.0f);
fixes the issue, and overall seems to make the rotations behave much more like 
in the opengl1 version

Question is: is this the good fix, or
1) is the previous version of JGE incorrect ?
or
2) is esRotate incorrect, in which case the fix should be done there ?

Original comment by wagic.the.homebrew@gmail.com on 23 Sep 2010 at 1:43

GoogleCodeExporter commented 8 years ago
fixed in r2300 with the above fix.
Please verify (both Linux and N900 if possible)

Original comment by wagic.the.homebrew@gmail.com on 23 Sep 2010 at 4:01

GoogleCodeExporter commented 8 years ago

Original comment by wagic.the.homebrew@gmail.com on 23 Sep 2010 at 4:05

GoogleCodeExporter commented 8 years ago
For comment 4 I think -angle*RAD2DEG is correct and new-added esRotate() seems 
to place the matrix in an wrong order. Please check r2303.

Original comment by linshier@gmail.com on 23 Sep 2010 at 5:22

GoogleCodeExporter commented 8 years ago
Seems to be working under linux

Original comment by jean.cha...@gmail.com on 23 Sep 2010 at 8:20