我注意到的一件事是在gfxpLead .c中,特别是gfxxLaytoTooRealDead空间函数。对于180°,这将为所有层初始,上下文-gt;层。用户的0°立场实际上是180°旋转的起源。此外,方向颠倒,在LiRiaAiUTLS和GFXUTIL文件中找到的Orrunt180函数中得到正确的反映。这可能解释了为什么180°模式工作。好吧,那么,90°,如果我们把旋转按顺时针方向处理,意味着新的起源是AT(479, 0)。我真的把最后一个位子拧错了。然后,我期望上面的值是:对于RcT.Studio:x= 49y= 02.52Health= 480Rec.Posi:x= 0y= 0Gule= 22Health= 480i,猜测大小(宽度和高度)是相同的,因为描述GFSH层中的显示和局部的语句。在这些REST之间冗余,但是它使得调用gfxl ReCt的函数作为参数GFxReCt显示;/ /表示显示空间gfxl Rct局部的区域;//表示局部空间中的位置};由于我在180°模式中发现的,显示WOW是有意义的。LD表示实际的像素位置,而局部则是更为逻辑的东西,即您已经在该空间内旋转了。不幸的是,这是调试器中弹出的东西:Rect。显示:x= 0y= 080Leave=对我来说没什么意义。为什么显示器完全不变?为什么要改变本地,但是基于旋转的改变?无论如何,有些东西在分层中是错误的,因为我删除了除了Leal0以外的所有东西。为了显示一些东西,我使用不同的方案使背景蓝。不用说,出来的是垃圾。我会得到像屏幕蓝色一半(更像条纹),另一半是白色,就像没有画它。
以上来自于百度翻译
以下为原文
One thing that I've noticed is in gfx_layer.c, specifically the GFX_LayerToOrientedSpace function. For 180° this will leave, for all layers initially, context->layer.layers.rect.display and context->layer.layers.rect.local to two different settings:
for rect.display:
x = 479
y = 271
width = 480
height = 272
for rect.local:
x = 0
y = 0
width = 480
height = 272
This makes sense because (479,271) from a user's 0° standpoint is actually the origin for 180° rotation. Additionally the directions are reversed, which is reflected correctly in the orient_180 functions found in the libaria_utils and gfx_util files. This probably explains why 180° mode works.
Ok then, so 90°, if we're treating the rotation as clockwise, implies that the new origin is at (479, 0). I actually screwed that last bit up rotating the wrong way. I would then expect the values from above to be:
for rect.display:
x = 479
y = 0
width = 272
height = 480
for rect.local:
x = 0
y = 0
width = 272
height = 480
I'm guessing that the sizes (width and height) are the same because of the statement describing display and local in gfx_layer.h:
struct
{
// sizes are redundant between these rects but it makes for cleaner code
// when calling functions that take GFX_Rect as arguments
GFX_Rect display; // represents area in display space
GFX_Rect local; // represents position in local space
} rect;
Due to what I found in 180° mode, it makes sense that display would represent the actual pixel locations, while local is more of a logical thing, i.e. you're already rotated so within that space.
Unfortunately, this is now what pops out in the debugger:
for rect.display:
x =0
y = 0
width = 480
height = 272
for rect.local:
x = 0
y = 0
width = 272
height = 480
This doesn't make any sense to me. Why is rect.display completely unchanged? Why change local, but _GFX_LayerSizeSet display is changed based on the rotation?
At any rate, something is just plain wrong with the layering as I've removed everything except Layer0. In order to show something I'm using a different scheme to make the background blue. Needless to say, what comes out is garbage. I'll get what appears like half of the screen blue (more like striped) and the other half is white like nothing painted it.