mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-12-28 20:21:48 +01:00
+added missing image
+added throbber support ~fixed texture rotation ~improved wiimote pointing
This commit is contained in:
parent
2a26480498
commit
599aecb9d0
@ -63,7 +63,7 @@ u32 dvd_read (void *dst, u32 len, u64 offset)
|
|||||||
dvd[7] = 3;
|
dvd[7] = 3;
|
||||||
|
|
||||||
/*** Enable reading with DMA ***/
|
/*** Enable reading with DMA ***/
|
||||||
while (dvd[7] & 1);
|
while (dvd[7] & 1) usleep(10);
|
||||||
memcpy (dst, buffer, len);
|
memcpy (dst, buffer, len);
|
||||||
|
|
||||||
/*** Ensure it has completed ***/
|
/*** Ensure it has completed ***/
|
||||||
@ -88,7 +88,7 @@ u32 dvd_read (void *dst, u32 len, u64 offset)
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
void dvd_motor_off( )
|
void dvd_motor_off( )
|
||||||
{
|
{
|
||||||
GUI_MsgBoxOpen("Information", "Stopping DVD drive ...");
|
GUI_MsgBoxOpen("Information", "Stopping DVD drive ...", 1);
|
||||||
|
|
||||||
#ifndef HW_RVL
|
#ifndef HW_RVL
|
||||||
dvd[0] = 0x2e;
|
dvd[0] = 0x2e;
|
||||||
@ -99,7 +99,7 @@ void dvd_motor_off( )
|
|||||||
dvd[5] = 0;
|
dvd[5] = 0;
|
||||||
dvd[6] = 0;
|
dvd[6] = 0;
|
||||||
dvd[7] = 1; // Do immediate
|
dvd[7] = 1; // Do immediate
|
||||||
while (dvd[7] & 1);
|
while (dvd[7] & 1) usleep(10);
|
||||||
|
|
||||||
/*** PSO Stops blackscreen at reload ***/
|
/*** PSO Stops blackscreen at reload ***/
|
||||||
dvd[0] = 0x14;
|
dvd[0] = 0x14;
|
||||||
@ -133,7 +133,7 @@ void uselessinquiry ()
|
|||||||
dvd[6] = 0x20;
|
dvd[6] = 0x20;
|
||||||
dvd[7] = 1;
|
dvd[7] = 1;
|
||||||
|
|
||||||
while (dvd[7] & 1);
|
while (dvd[7] & 1) usleep(10);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -152,7 +152,7 @@ void dvd_drive_detect()
|
|||||||
dvd[5] = 0x80000000;
|
dvd[5] = 0x80000000;
|
||||||
dvd[6] = 0x20;
|
dvd[6] = 0x20;
|
||||||
dvd[7] = 3;
|
dvd[7] = 3;
|
||||||
while( dvd[7] & 1 );
|
while( dvd[7] & 1 ) usleep(10);
|
||||||
DCFlushRange((void *)0x80000000, 32);
|
DCFlushRange((void *)0x80000000, 32);
|
||||||
|
|
||||||
int driveid = (int)inquiry[2];
|
int driveid = (int)inquiry[2];
|
||||||
|
@ -302,7 +302,7 @@ int DVD_LoadFile(u8 *buffer)
|
|||||||
{
|
{
|
||||||
char msg[50];
|
char msg[50];
|
||||||
sprintf(msg,"Loading %d bytes...", length);
|
sprintf(msg,"Loading %d bytes...", length);
|
||||||
GUI_MsgBoxOpen("Information",msg);
|
GUI_MsgBoxOpen("Information",msg,1);
|
||||||
/* How many 2k blocks to read */
|
/* How many 2k blocks to read */
|
||||||
int blocks = length / 2048;
|
int blocks = length / 2048;
|
||||||
int readoffset = 0;
|
int readoffset = 0;
|
||||||
@ -351,7 +351,7 @@ int DVD_Open(void)
|
|||||||
if (!getpvd())
|
if (!getpvd())
|
||||||
{
|
{
|
||||||
/* mount DVD */
|
/* mount DVD */
|
||||||
GUI_MsgBoxOpen("Information", "Mounting DVD ... Wait");
|
GUI_MsgBoxOpen("Information", "Mounting DVD ...",1);
|
||||||
|
|
||||||
#ifdef HW_RVL
|
#ifdef HW_RVL
|
||||||
u32 val;
|
u32 val;
|
||||||
@ -364,7 +364,7 @@ int DVD_Open(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
DI_Mount();
|
DI_Mount();
|
||||||
while(DI_GetStatus() & DVD_INIT);
|
while(DI_GetStatus() & DVD_INIT) usleep(10);
|
||||||
if (!(DI_GetStatus() & DVD_READY))
|
if (!(DI_GetStatus() & DVD_READY))
|
||||||
{
|
{
|
||||||
char msg[50];
|
char msg[50];
|
||||||
|
@ -196,7 +196,7 @@ int FAT_LoadFile(u8 *buffer)
|
|||||||
{
|
{
|
||||||
char msg[50];
|
char msg[50];
|
||||||
sprintf(msg,"Loading %d bytes ...", length);
|
sprintf(msg,"Loading %d bytes ...", length);
|
||||||
GUI_MsgBoxOpen("Information",msg);
|
GUI_MsgBoxOpen("Information",msg,1);
|
||||||
fread(buffer, 1, length, sdfile);
|
fread(buffer, 1, length, sdfile);
|
||||||
fclose(sdfile);
|
fclose(sdfile);
|
||||||
return length;
|
return length;
|
||||||
|
@ -232,8 +232,8 @@ int ManageSRAM (u8 direction, u8 device)
|
|||||||
|
|
||||||
char filename[MAXJOLIET];
|
char filename[MAXJOLIET];
|
||||||
|
|
||||||
if (direction) GUI_MsgBoxOpen("Information","Loading SRAM ...");
|
if (direction) GUI_MsgBoxOpen("Information","Loading SRAM ...",1);
|
||||||
else GUI_MsgBoxOpen("Information","Saving SRAM ...");
|
else GUI_MsgBoxOpen("Information","Saving SRAM ...",1);
|
||||||
|
|
||||||
/* clean buffer */
|
/* clean buffer */
|
||||||
memset(savebuffer, 0, STATE_SIZE);
|
memset(savebuffer, 0, STATE_SIZE);
|
||||||
@ -432,8 +432,8 @@ int ManageState (u8 direction, u8 device)
|
|||||||
|
|
||||||
char filename[MAXJOLIET];
|
char filename[MAXJOLIET];
|
||||||
|
|
||||||
if (direction) GUI_MsgBoxOpen("Information","Loading State ...");
|
if (direction) GUI_MsgBoxOpen("Information","Loading State ...",1);
|
||||||
else GUI_MsgBoxOpen("Information","Saving State ...");
|
else GUI_MsgBoxOpen("Information","Saving State ...",1);
|
||||||
|
|
||||||
/* clean buffer */
|
/* clean buffer */
|
||||||
memset(savebuffer, 0, STATE_SIZE);
|
memset(savebuffer, 0, STATE_SIZE);
|
||||||
|
@ -131,7 +131,7 @@ int UnZipBuffer (unsigned char *outbuffer, u64 discoffset, char *filename)
|
|||||||
memcpy (&pkzip, &readbuffer, sizeof (PKZIPHEADER));
|
memcpy (&pkzip, &readbuffer, sizeof (PKZIPHEADER));
|
||||||
|
|
||||||
sprintf (msg, "Unzipping %d bytes ...", FLIP32 (pkzip.uncompressedSize));
|
sprintf (msg, "Unzipping %d bytes ...", FLIP32 (pkzip.uncompressedSize));
|
||||||
GUI_MsgBoxOpen("Information",msg);
|
GUI_MsgBoxOpen("Information",msg,1);
|
||||||
|
|
||||||
/*** Prepare the zip stream ***/
|
/*** Prepare the zip stream ***/
|
||||||
memset (&zs, 0, sizeof (z_stream));
|
memset (&zs, 0, sizeof (z_stream));
|
||||||
|
@ -316,22 +316,20 @@ int FileSelector(unsigned char *buffer)
|
|||||||
y = m_input.ir.y;
|
y = m_input.ir.y;
|
||||||
|
|
||||||
/* draw wiimote pointer */
|
/* draw wiimote pointer */
|
||||||
gxResetAngle(m_input.ir.angle);
|
gxDrawTextureRotate(w_pointer, x-w_pointer->width/2, y-w_pointer->height/2, w_pointer->width, w_pointer->height,m_input.ir.angle,255);
|
||||||
gxDrawTexture(w_pointer, x-w_pointer->width/2, y-w_pointer->height/2, w_pointer->width, w_pointer->height,255);
|
|
||||||
gxResetAngle(0.0);
|
|
||||||
|
|
||||||
/* find selected item */
|
/* find selected item */
|
||||||
yoffset = PAGEOFFSET - 2;
|
yoffset = PAGEOFFSET - 4;
|
||||||
m->selected = m->max_buttons + 2;
|
m->selected = m->max_buttons + 2;
|
||||||
for (i = offset; i < (offset + PAGESIZE) && (i < maxfiles); i++)
|
for (i = offset; i < (offset + PAGESIZE) && (i < maxfiles); i++)
|
||||||
{
|
{
|
||||||
if ((x<=380)&&(y>=yoffset)&&(y<(yoffset+24)))
|
if ((x<=380)&&(y>=yoffset)&&(y<(yoffset+(bar_over.h))))
|
||||||
{
|
{
|
||||||
selection = i;
|
selection = i;
|
||||||
m->selected = -1;
|
m->selected = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
yoffset += 24;
|
yoffset += (bar_over.h);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* find selected button */
|
/* find selected button */
|
||||||
|
@ -484,9 +484,7 @@ int GUI_UpdateMenu(gui_menu *menu)
|
|||||||
int y = m_input.ir.y;
|
int y = m_input.ir.y;
|
||||||
|
|
||||||
/* draw wiimote pointer */
|
/* draw wiimote pointer */
|
||||||
gxResetAngle(m_input.ir.angle);
|
gxDrawTextureRotate(w_pointer, x-w_pointer->width/2, y-w_pointer->height/2, w_pointer->width, w_pointer->height,m_input.ir.angle,255);
|
||||||
gxDrawTexture(w_pointer, x-w_pointer->width/2, y-w_pointer->height/2, w_pointer->width, w_pointer->height,255);
|
|
||||||
gxResetAngle(0.0);
|
|
||||||
|
|
||||||
/* check for valid buttons */
|
/* check for valid buttons */
|
||||||
selected = max_buttons + 2;
|
selected = max_buttons + 2;
|
||||||
@ -804,9 +802,7 @@ int GUI_WindowPrompt(gui_menu *parent, char *title, char *items[], u8 nb_items)
|
|||||||
y = m_input.ir.y;
|
y = m_input.ir.y;
|
||||||
|
|
||||||
/* draw wiimote pointer */
|
/* draw wiimote pointer */
|
||||||
gxResetAngle(m_input.ir.angle);
|
gxDrawTextureRotate(w_pointer, x-w_pointer->width/2, y-w_pointer->height/2, w_pointer->width, w_pointer->height,m_input.ir.angle,255);
|
||||||
gxDrawTexture(w_pointer, x-w_pointer->width/2, y-w_pointer->height/2, w_pointer->width, w_pointer->height,255);
|
|
||||||
gxResetAngle(0.0);
|
|
||||||
|
|
||||||
/* check for valid buttons */
|
/* check for valid buttons */
|
||||||
selected = -1;
|
selected = -1;
|
||||||
@ -935,9 +931,7 @@ void GUI_SlideMenuTitle(gui_menu *m, int title_offset)
|
|||||||
y = m_input.ir.y;
|
y = m_input.ir.y;
|
||||||
|
|
||||||
/* draw wiimote pointer */
|
/* draw wiimote pointer */
|
||||||
gxResetAngle(m_input.ir.angle);
|
gxDrawTextureRotate(w_pointer, x-w_pointer->width/2, y-w_pointer->height/2, w_pointer->width, w_pointer->height,m_input.ir.angle,255);
|
||||||
gxDrawTexture(w_pointer, x-w_pointer->width/2, y-w_pointer->height/2, w_pointer->width, w_pointer->height,255);
|
|
||||||
gxResetAngle(0.0);
|
|
||||||
|
|
||||||
/* check for valid buttons */
|
/* check for valid buttons */
|
||||||
m->selected = m->max_buttons + 2;
|
m->selected = m->max_buttons + 2;
|
||||||
@ -1010,6 +1004,12 @@ static void *MsgBox_Thread(void *arg)
|
|||||||
if (message_box.msg)
|
if (message_box.msg)
|
||||||
FONT_writeCenter(message_box.msg,18,xwindow,xwindow+message_box.window->width,ypos,(GXColor)WHITE);
|
FONT_writeCenter(message_box.msg,18,xwindow,xwindow+message_box.window->width,ypos,(GXColor)WHITE);
|
||||||
|
|
||||||
|
/* draw throbber */
|
||||||
|
if (message_box.throbber)
|
||||||
|
{
|
||||||
|
gxDrawTextureRotate(message_box.throbber,xwindow+(message_box.window->width-message_box.throbber->width)/2,ywindow+message_box.window->height-message_box.throbber->height-20,message_box.throbber->width,message_box.throbber->height,(message_box.progress * 360.0) / 100.0, 255);
|
||||||
|
}
|
||||||
|
|
||||||
/* draw exit message */
|
/* draw exit message */
|
||||||
if (message_box.buttonB)
|
if (message_box.buttonB)
|
||||||
{
|
{
|
||||||
@ -1026,6 +1026,10 @@ static void *MsgBox_Thread(void *arg)
|
|||||||
|
|
||||||
/* update display */
|
/* update display */
|
||||||
gxSetScreen();
|
gxSetScreen();
|
||||||
|
|
||||||
|
/* update progression */
|
||||||
|
message_box.progress++;
|
||||||
|
if (message_box.progress > 100) message_box.progress = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1045,7 +1049,7 @@ void GUI_MsgBoxUpdate(gui_menu *parent, char *title, char *msg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* setup current Message Box */
|
/* setup current Message Box */
|
||||||
void GUI_MsgBoxOpen(char *title, char *msg)
|
void GUI_MsgBoxOpen(char *title, char *msg, bool throbber)
|
||||||
{
|
{
|
||||||
if (SILENT) return;
|
if (SILENT) return;
|
||||||
|
|
||||||
@ -1058,6 +1062,7 @@ void GUI_MsgBoxOpen(char *title, char *msg)
|
|||||||
/* initialize default textures */
|
/* initialize default textures */
|
||||||
message_box.window = gxTextureOpenPNG(Frame_s4_png,0);
|
message_box.window = gxTextureOpenPNG(Frame_s4_png,0);
|
||||||
message_box.top = gxTextureOpenPNG(Frame_s4_title_png,0);
|
message_box.top = gxTextureOpenPNG(Frame_s4_title_png,0);
|
||||||
|
if (throbber) message_box.throbber = gxTextureOpenPNG(Frame_throbber_png,0);
|
||||||
|
|
||||||
/* window position */
|
/* window position */
|
||||||
int xwindow = (vmode->fbWidth - message_box.window->width)/2;
|
int xwindow = (vmode->fbWidth - message_box.window->width)/2;
|
||||||
@ -1093,6 +1098,7 @@ void GUI_MsgBoxOpen(char *title, char *msg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* resume LWP thread for MessageBox refresh */
|
/* resume LWP thread for MessageBox refresh */
|
||||||
|
message_box.progress = 0;
|
||||||
message_box.refresh = TRUE;
|
message_box.refresh = TRUE;
|
||||||
LWP_ResumeThread(msgboxthread);
|
LWP_ResumeThread(msgboxthread);
|
||||||
}
|
}
|
||||||
@ -1151,6 +1157,7 @@ void GUI_MsgBoxClose(void)
|
|||||||
gxTextureClose(&message_box.top);
|
gxTextureClose(&message_box.top);
|
||||||
gxTextureClose(&message_box.buttonA);
|
gxTextureClose(&message_box.buttonA);
|
||||||
gxTextureClose(&message_box.buttonB);
|
gxTextureClose(&message_box.buttonB);
|
||||||
|
gxTextureClose(&message_box.throbber);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1159,7 +1166,8 @@ void GUI_WaitPrompt(char *title, char *msg)
|
|||||||
if (SILENT) return;
|
if (SILENT) return;
|
||||||
|
|
||||||
/* update message box */
|
/* update message box */
|
||||||
GUI_MsgBoxOpen(title, msg);
|
gxTextureClose(&message_box.throbber);
|
||||||
|
GUI_MsgBoxOpen(title, msg, 0);
|
||||||
|
|
||||||
/* allocate texture memory */
|
/* allocate texture memory */
|
||||||
message_box.buttonA = gxTextureOpenPNG(Key_A_png,0);
|
message_box.buttonA = gxTextureOpenPNG(Key_A_png,0);
|
||||||
@ -1198,7 +1206,7 @@ void GUI_Initialize(void)
|
|||||||
{
|
{
|
||||||
/* create LWP thread for MessageBox refresh */
|
/* create LWP thread for MessageBox refresh */
|
||||||
message_box.refresh = FALSE;
|
message_box.refresh = FALSE;
|
||||||
LWP_CreateThread (&msgboxthread, MsgBox_Thread, NULL, NULL, 0, 50);
|
LWP_CreateThread (&msgboxthread, MsgBox_Thread, NULL, NULL, 0, 10);
|
||||||
LWP_SuspendThread(msgboxthread);
|
LWP_SuspendThread(msgboxthread);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,14 +121,16 @@ typedef struct
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
bool refresh; /* messagebox current state */
|
u32 progress; /* progress counter */
|
||||||
gui_menu *parent; /* parent menu */
|
bool refresh; /* messagebox current state */
|
||||||
char title[64]; /* box title */
|
gui_menu *parent; /* parent menu */
|
||||||
char msg[64]; /* box message */
|
char title[64]; /* box title */
|
||||||
gx_texture *window; /* pointer to box texture */
|
char msg[64]; /* box message */
|
||||||
gx_texture *top; /* pointer to box title texture */
|
gx_texture *window; /* pointer to box texture */
|
||||||
gx_texture *buttonA; /* pointer to button A texture */
|
gx_texture *top; /* pointer to box title texture */
|
||||||
gx_texture *buttonB; /* pointer to button B texture */
|
gx_texture *buttonA; /* pointer to button A texture */
|
||||||
|
gx_texture *buttonB; /* pointer to button B texture */
|
||||||
|
gx_texture *throbber; /* pointer to throbber texture */
|
||||||
} gui_message;
|
} gui_message;
|
||||||
|
|
||||||
/* Menu Inputs */
|
/* Menu Inputs */
|
||||||
@ -165,6 +167,7 @@ extern const u8 Frame_s3_png[];
|
|||||||
extern const u8 Frame_s4_png[];
|
extern const u8 Frame_s4_png[];
|
||||||
extern const u8 Frame_s1_title_png[];
|
extern const u8 Frame_s1_title_png[];
|
||||||
extern const u8 Frame_s4_title_png[];
|
extern const u8 Frame_s4_title_png[];
|
||||||
|
extern const u8 Frame_throbber_png[];
|
||||||
|
|
||||||
/* ROM Browser */
|
/* ROM Browser */
|
||||||
extern const u8 Overlay_bar_png[];
|
extern const u8 Overlay_bar_png[];
|
||||||
@ -276,7 +279,7 @@ extern int GUI_UpdateMenu(gui_menu *menu);
|
|||||||
extern int GUI_RunMenu(gui_menu *menu);
|
extern int GUI_RunMenu(gui_menu *menu);
|
||||||
extern int GUI_WindowPrompt(gui_menu *parent, char *title, char *items[], u8 nb_items);
|
extern int GUI_WindowPrompt(gui_menu *parent, char *title, char *items[], u8 nb_items);
|
||||||
extern void GUI_SlideMenuTitle(gui_menu *m, int title_offset);
|
extern void GUI_SlideMenuTitle(gui_menu *m, int title_offset);
|
||||||
extern void GUI_MsgBoxOpen(char *title, char *msg);
|
extern void GUI_MsgBoxOpen(char *title, char *msg, bool throbber);
|
||||||
extern void GUI_MsgBoxUpdate(gui_menu *parent, char *title, char *msg);
|
extern void GUI_MsgBoxUpdate(gui_menu *parent, char *title, char *msg);
|
||||||
extern void GUI_MsgBoxClose(void);
|
extern void GUI_MsgBoxClose(void);
|
||||||
extern void GUI_WaitPrompt(char *title, char *msg);
|
extern void GUI_WaitPrompt(char *title, char *msg);
|
||||||
|
@ -285,9 +285,9 @@ static gui_butn buttons_main[9] =
|
|||||||
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_FADE|BUTTON_OVER_SFX ,{3,0,1,1}, 80,194,148,132},
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_FADE|BUTTON_OVER_SFX ,{3,0,1,1}, 80,194,148,132},
|
||||||
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_FADE|BUTTON_OVER_SFX ,{3,0,1,1},246,194,148,132},
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_FADE|BUTTON_OVER_SFX ,{3,0,1,1},246,194,148,132},
|
||||||
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_FADE|BUTTON_OVER_SFX ,{3,0,1,0},412,194,148,132},
|
{&button_icon_data,BUTTON_VISIBLE|BUTTON_ACTIVE|BUTTON_FADE|BUTTON_OVER_SFX ,{3,0,1,0},412,194,148,132},
|
||||||
{NULL , BUTTON_FADE|BUTTON_OVER_SFX ,{3,0,1,1}, 0,360, 88, 48},
|
{NULL , BUTTON_FADE|BUTTON_OVER_SFX ,{3,0,1,1}, 10,372, 84, 32},
|
||||||
{NULL , BUTTON_FADE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{2,1,1,1},542,330, 88, 38},
|
{NULL , BUTTON_FADE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{2,1,1,1},546,334, 84, 32},
|
||||||
{NULL , BUTTON_FADE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{1,0,1,0},542,370, 88, 48}
|
{NULL , BUTTON_FADE|BUTTON_OVER_SFX|BUTTON_SELECT_SFX,{1,0,1,0},546,372, 84, 32}
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Controllers Menu */
|
/* Controllers Menu */
|
||||||
@ -1506,7 +1506,7 @@ static void ctrlmenu(void)
|
|||||||
|
|
||||||
case 12: /* Controller Keys Configuration */
|
case 12: /* Controller Keys Configuration */
|
||||||
if (config.input[player].device < 0) break;
|
if (config.input[player].device < 0) break;
|
||||||
GUI_MsgBoxOpen("Keys Configuration", "");
|
GUI_MsgBoxOpen("Keys Configuration", "",0);
|
||||||
if (config.input[player].padtype == DEVICE_6BUTTON)
|
if (config.input[player].padtype == DEVICE_6BUTTON)
|
||||||
{
|
{
|
||||||
/* 6-buttons gamepad */
|
/* 6-buttons gamepad */
|
||||||
|
@ -662,6 +662,56 @@ void gxDrawTexture(gx_texture *texture, s32 x, s32 y, s32 w, s32 h, u8 alpha)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void gxDrawTextureRotate(gx_texture *texture, s32 x, s32 y, s32 w, s32 h, f32 angle, u8 alpha)
|
||||||
|
{
|
||||||
|
if (!texture) return;
|
||||||
|
if (texture->data)
|
||||||
|
{
|
||||||
|
/* load texture object */
|
||||||
|
GXTexObj texObj;
|
||||||
|
GX_InitTexObj(&texObj, texture->data, texture->width, texture->height, GX_TF_RGBA8, GX_CLAMP, GX_CLAMP, GX_FALSE);
|
||||||
|
GX_InitTexObjLOD(&texObj,GX_LINEAR,GX_LIN_MIP_LIN,0.0,10.0,0.0,GX_FALSE,GX_TRUE,GX_ANISO_4);
|
||||||
|
GX_LoadTexObj(&texObj, GX_TEXMAP0);
|
||||||
|
GX_InvalidateTexAll();
|
||||||
|
|
||||||
|
/* vertex coordinate */
|
||||||
|
x -= (vmode->fbWidth/2);
|
||||||
|
y -= (vmode->efbHeight/2);
|
||||||
|
|
||||||
|
/* Modelview rotation */
|
||||||
|
Mtx m,mv;
|
||||||
|
Vector axis = (Vector) {0,0,1};
|
||||||
|
guLookAt(mv, &cam.pos, &cam.up, &cam.view);
|
||||||
|
guMtxRotAxisDeg (m, &axis, angle);
|
||||||
|
guMtxTransApply(m,m, x+w/2,y+h/2,0);
|
||||||
|
guMtxConcat(mv,m,mv);
|
||||||
|
GX_LoadPosMtxImm(mv, GX_PNMTX0);
|
||||||
|
GX_Flush();
|
||||||
|
|
||||||
|
/* draw textured quad */
|
||||||
|
GX_Begin(GX_QUADS, GX_VTXFMT0, 4);
|
||||||
|
GX_Position2s16(-w/2,-h/2);
|
||||||
|
GX_Color4u8(0xff,0xff,0xff,alpha);
|
||||||
|
GX_TexCoord2f32(0.0, 0.0);
|
||||||
|
GX_Position2s16(w/2,-h/2);
|
||||||
|
GX_Color4u8(0xff,0xff,0xff,alpha);
|
||||||
|
GX_TexCoord2f32(1.0, 0.0);
|
||||||
|
GX_Position2s16(w/2,h/2);
|
||||||
|
GX_Color4u8(0xff,0xff,0xff,alpha);
|
||||||
|
GX_TexCoord2f32(1.0, 1.0);
|
||||||
|
GX_Position2s16(-w/2,h/2);
|
||||||
|
GX_Color4u8(0xff,0xff,0xff,alpha);
|
||||||
|
GX_TexCoord2f32(0.0, 1.0);
|
||||||
|
GX_End ();
|
||||||
|
GX_DrawDone();
|
||||||
|
|
||||||
|
/* restore default Modelview */
|
||||||
|
guLookAt(mv, &cam.pos, &cam.up, &cam.view);
|
||||||
|
GX_LoadPosMtxImm(mv, GX_PNMTX0);
|
||||||
|
GX_Flush();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void gxDrawTextureRepeat(gx_texture *texture, s32 x, s32 y, s32 w, s32 h, u8 alpha)
|
void gxDrawTextureRepeat(gx_texture *texture, s32 x, s32 y, s32 w, s32 h, u8 alpha)
|
||||||
{
|
{
|
||||||
if (!texture) return;
|
if (!texture) return;
|
||||||
@ -794,27 +844,6 @@ void gxCopyScreenshot(gx_texture *texture)
|
|||||||
DCFlushRange(texture->data, texture->width * texture->height * 4);
|
DCFlushRange(texture->data, texture->width * texture->height * 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gxResetAngle(f32 angle)
|
|
||||||
{
|
|
||||||
Mtx view;
|
|
||||||
|
|
||||||
if (angle)
|
|
||||||
{
|
|
||||||
Mtx m,m1;
|
|
||||||
Vector axis = (Vector) {0,0,1};
|
|
||||||
guLookAt(m, &cam.pos, &cam.up, &cam.view);
|
|
||||||
guMtxRotAxisDeg (m1, &axis, angle);
|
|
||||||
guMtxConcat(m,m1,view);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
guLookAt(view, &cam.pos, &cam.up, &cam.view);
|
|
||||||
}
|
|
||||||
|
|
||||||
GX_LoadPosMtxImm(view, GX_PNMTX0);
|
|
||||||
GX_Flush();
|
|
||||||
}
|
|
||||||
|
|
||||||
void gxSetScreen(void)
|
void gxSetScreen(void)
|
||||||
{
|
{
|
||||||
GX_CopyDisp(xfb[whichfb], GX_FALSE);
|
GX_CopyDisp(xfb[whichfb], GX_FALSE);
|
||||||
|
@ -51,9 +51,9 @@ extern u8 gc_pal;
|
|||||||
extern void gxDrawRectangle(s32 x, s32 y, s32 w, s32 h, u8 alpha, GXColor color);
|
extern void gxDrawRectangle(s32 x, s32 y, s32 w, s32 h, u8 alpha, GXColor color);
|
||||||
extern void gxDrawTexture(gx_texture *texture, s32 x, s32 y, s32 w, s32 h, u8 alpha);
|
extern void gxDrawTexture(gx_texture *texture, s32 x, s32 y, s32 w, s32 h, u8 alpha);
|
||||||
extern void gxDrawTextureRepeat(gx_texture *texture, s32 x, s32 y, s32 w, s32 h, u8 alpha);
|
extern void gxDrawTextureRepeat(gx_texture *texture, s32 x, s32 y, s32 w, s32 h, u8 alpha);
|
||||||
|
extern void gxDrawTextureRotate(gx_texture *texture, s32 x, s32 y, s32 w, s32 h, f32 angle, u8 alpha);
|
||||||
extern void gxDrawScreenshot(u8 alpha);
|
extern void gxDrawScreenshot(u8 alpha);
|
||||||
extern void gxCopyScreenshot(gx_texture *texture);
|
extern void gxCopyScreenshot(gx_texture *texture);
|
||||||
extern void gxResetAngle(f32 angle);
|
|
||||||
extern void gxClearScreen(GXColor color);
|
extern void gxClearScreen(GXColor color);
|
||||||
extern void gxSetScreen(void);
|
extern void gxSetScreen(void);
|
||||||
|
|
||||||
|
BIN
source/gx/images/Frame_s4_title.png
Normal file
BIN
source/gx/images/Frame_s4_title.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.2 KiB |
BIN
source/gx/images/Frame_throbber.png
Normal file
BIN
source/gx/images/Frame_throbber.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
Loading…
Reference in New Issue
Block a user