2929#include "SDL_ogcgxcommon.h"
3030#include "SDL_ogcmouse.h"
3131#include "SDL_ogcpixels.h"
32+ #include "SDL_ogcvideo.h"
3233
3334#include "../SDL_sysvideo.h"
3435#include "../../render/SDL_sysrender.h"
@@ -175,7 +176,7 @@ void OGC_draw_cursor(_THIS)
175176 SDL_Mouse * mouse = SDL_GetMouse ();
176177 OGC_CursorData * curdata ;
177178 Mtx mv ;
178- int screen_w , screen_h ;
179+ int screen_w , screen_h , viewport_w ;
179180 float angle = 0.0f ;
180181
181182 if (!mouse || !mouse -> cursor_shown ||
@@ -191,17 +192,15 @@ void OGC_draw_cursor(_THIS)
191192 if (!data -> ir .valid ) return ;
192193 }
193194
194- screen_w = _this -> displays [0 ].current_mode .w ;
195+ viewport_w = _this -> displays [0 ].current_mode .w ;
196+ screen_w = ((SDL_VideoData * )_this -> displays [0 ].current_mode .driverdata )-> vmode -> fbWidth ;
195197 screen_h = _this -> displays [0 ].current_mode .h ;
196198
197199 curdata = mouse -> cur_cursor -> driverdata ;
198200 OGC_load_texture (curdata -> texels , curdata -> w , curdata -> h , GX_TF_RGBA8 ,
199201 SDL_ScaleModeNearest );
200202
201203 guMtxIdentity (mv );
202- if (screen_w == 854 )
203- guMtxScaleApply (mv , mv , screen_w / 854.0f , screen_h / 480.0f , 1.0f );
204- else
205204 guMtxScaleApply (mv , mv , screen_w / 640.0f , screen_h / 480.0f , 1.0f );
206205
207206 if (angle != 0.0f ) {
@@ -212,7 +211,7 @@ void OGC_draw_cursor(_THIS)
212211 guMtxTransApply (mv , mv , mouse -> x , mouse -> y , 0 );
213212 GX_LoadPosMtxImm (mv , GX_PNMTX1 );
214213
215- OGC_set_viewport (0 , 0 , screen_w , screen_h , screen_w );
214+ OGC_set_viewport (0 , 0 , screen_w , screen_h , viewport_w );
216215
217216 GX_ClearVtxDesc ();
218217 GX_SetVtxDesc (GX_VA_POS , GX_DIRECT );
@@ -244,7 +243,8 @@ void OGC_draw_cursor(_THIS)
244243 SDL_Renderer * renderer = SDL_GetRenderer (_this -> windows );
245244 if (renderer ) {
246245 OGC_set_viewport (renderer -> viewport .x , renderer -> viewport .y ,
247- renderer -> viewport .w , renderer -> viewport .h );
246+ renderer -> viewport .w , renderer -> viewport .h ,
247+ renderer -> viewport .w );
248248 }
249249 }
250250}
0 commit comments