mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-11-22 11:19:17 +01:00
*Changed FreeTypeGX to use IA4 textures for font glyphs (saves a bit memory)
*Fixed cutoff of box cover when it is too near and increased zoom range of the box cover. Reworked the move/zoom of the cover. *Change wiimote icon when grabbing and dragging the box cover to grab icon *Fixed bug in homebrew browser (crash) *Changed a few default GX view configurations *Use proper size of wiimote pointer image instead of hard coded values *Reworked scroll/B hold movement stuff from the game list layout *Removed buildtype.sh and added the define directly in makefile. No need to make an extra header for that. *Changed makefile a to allow different IOS build modes. The build IOS is used at the start of the loader to load the settings under. If the build IOS is the same as the settings boot IOS the startup is a lot faster since no IOS reload is required. To build yourself a special IOS build version type:"make IOS=XXX" where XXX is the number of the IOS (CSettings.cp has to be recompiled for that at least). If nothing is defined IOS222 is taken. There will now be always two versions supplied (IOS222 and IOS249 version). If another build is required build it yourself. You can see the revisions until now as the "IOS249 build version" since they behaved like that.
This commit is contained in:
parent
a087ba8036
commit
e11901bc09
@ -2,8 +2,8 @@
|
|||||||
<app version="1">
|
<app version="1">
|
||||||
<name> USB Loader GX</name>
|
<name> USB Loader GX</name>
|
||||||
<coder>USB Loader GX Team</coder>
|
<coder>USB Loader GX Team</coder>
|
||||||
<version>2.0 r1072</version>
|
<version>2.0 r1073</version>
|
||||||
<release_date>201102121826</release_date>
|
<release_date>201102141852</release_date>
|
||||||
<no_ios_reload/>
|
<no_ios_reload/>
|
||||||
<short_description>Loads games from USB-devices</short_description>
|
<short_description>Loads games from USB-devices</short_description>
|
||||||
<long_description>USB Loader GX is a libwiigui based USB iso loader with a wii-like GUI. You can install games to your HDDs and boot them with shorter loading times.
|
<long_description>USB Loader GX is a libwiigui based USB iso loader with a wii-like GUI. You can install games to your HDDs and boot them with shorter loading times.
|
||||||
|
22
Makefile
22
Makefile
@ -51,15 +51,26 @@ SOURCES := source \
|
|||||||
DATA := data
|
DATA := data
|
||||||
INCLUDES := source
|
INCLUDES := source
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
# Default cIOS to load into to load the settings
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
ifndef $(IOS)
|
||||||
|
IOS = 222
|
||||||
|
endif
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
# options for code generation
|
# options for code generation
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
|
CFLAGS = -g -O3 -Wall -Wno-multichar -Wno-unused-parameter -Wextra $(MACHDEP) $(INCLUDE) -DBUILD_IOS=$(IOS)
|
||||||
CFLAGS = -g -O3 -Wall -Wno-multichar -Wno-unused-parameter -Wextra $(MACHDEP) $(INCLUDE)
|
|
||||||
CXXFLAGS = -Xassembler -aln=$@.lst $(CFLAGS)
|
CXXFLAGS = -Xassembler -aln=$@.lst $(CFLAGS)
|
||||||
LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map,--section-start,.init=0x80B00000,-wrap,malloc,-wrap,free,-wrap,memalign,-wrap,calloc,-wrap,realloc,-wrap,malloc_usable_size
|
LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map,--section-start,.init=0x80B00000,-wrap,malloc,-wrap,free,-wrap,memalign,-wrap,calloc,-wrap,realloc,-wrap,malloc_usable_size
|
||||||
-include $(PROJECTDIR)/Make.config
|
-include $(PROJECTDIR)/Make.config
|
||||||
|
|
||||||
|
ifeq ($(BUILDMODE),channel)
|
||||||
|
CFLAGS += -DFULLCHANNEL
|
||||||
|
CXXFLAGS += -DFULLCHANNEL
|
||||||
|
endif
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
# any extra libraries we wish to link with the project
|
# any extra libraries we wish to link with the project
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
@ -137,15 +148,11 @@ export OUTPUT := $(CURDIR)/$(TARGET)
|
|||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
$(BUILD):
|
$(BUILD):
|
||||||
@[ -d $@ ] || mkdir -p $@
|
@[ -d $@ ] || mkdir -p $@
|
||||||
@/bin/bash ./buildtype.sh
|
|
||||||
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
|
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
|
||||||
# @echo debug...
|
|
||||||
# start geckoreader.exe
|
|
||||||
|
|
||||||
channel:
|
channel:
|
||||||
@[ -d build ] || mkdir -p build
|
@[ -d build ] || mkdir -p build
|
||||||
@/bin/bash ./buildtype.sh FULLCHANNEL
|
@$(MAKE) BUILDMODE=channel --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
|
||||||
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
lang:
|
lang:
|
||||||
@ -160,7 +167,6 @@ theme:
|
|||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
all:
|
all:
|
||||||
@[ -d build ] || mkdir -p build
|
@[ -d build ] || mkdir -p build
|
||||||
@./buildtype.sh
|
|
||||||
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
|
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
|
||||||
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile language
|
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile language
|
||||||
|
|
||||||
|
14
buildtype.sh
14
buildtype.sh
@ -1,14 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
if [ ! -z "$1" ];
|
|
||||||
then
|
|
||||||
if [ ! -s source/buildtype.h ];
|
|
||||||
then
|
|
||||||
echo "#define $1" > source/buildtype.h
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
if [[ ! -f source/buildtype.h || -s source/buildtype.h ]];
|
|
||||||
then
|
|
||||||
cp /dev/null source/buildtype.h
|
|
||||||
fi
|
|
||||||
fi
|
|
File diff suppressed because one or more lines are too long
@ -25,6 +25,8 @@
|
|||||||
#include "BoxMesh.hpp"
|
#include "BoxMesh.hpp"
|
||||||
#include "themes/CTheme.h"
|
#include "themes/CTheme.h"
|
||||||
|
|
||||||
|
extern GuiImageData * pointer[4];
|
||||||
|
|
||||||
BoxCover::BoxCover(GuiImageData * img, bool flat)
|
BoxCover::BoxCover(GuiImageData * img, bool flat)
|
||||||
: GuiImage(img),
|
: GuiImage(img),
|
||||||
boxBorder(Resources::GetFile("boxBorder.png"), Resources::GetFileSize("boxBorder.png")),
|
boxBorder(Resources::GetFile("boxBorder.png"), Resources::GetFileSize("boxBorder.png")),
|
||||||
@ -42,8 +44,7 @@ BoxCover::BoxCover(GuiImageData * img, bool flat)
|
|||||||
RotZ = 0.0f;
|
RotZ = 0.0f;
|
||||||
PosX = 0.0f;
|
PosX = 0.0f;
|
||||||
PosY = 0.0f;
|
PosY = 0.0f;
|
||||||
PosZ = -4.5f;
|
PosZ = -27.f;
|
||||||
BoxScale = 1.0f;
|
|
||||||
AnimRotate = 0.0f;
|
AnimRotate = 0.0f;
|
||||||
last_manual_move_frame = 0;
|
last_manual_move_frame = 0;
|
||||||
camera = (guVector) {0.0F, 0.0F, 0.0F};
|
camera = (guVector) {0.0F, 0.0F, 0.0F};
|
||||||
@ -53,6 +54,15 @@ BoxCover::BoxCover(GuiImageData * img, bool flat)
|
|||||||
|
|
||||||
guLookAt(view, &camera, &up, &look);
|
guLookAt(view, &camera, &up, &look);
|
||||||
|
|
||||||
|
//! Remove me later
|
||||||
|
for(int i = 0; i < 4; ++i)
|
||||||
|
{
|
||||||
|
char name[50];
|
||||||
|
snprintf(name, sizeof(name), "player%i_grab.png", i+1);
|
||||||
|
GrabPointers[i] = Resources::GetImageData(name);
|
||||||
|
NormalPointers[i] = pointer[i];
|
||||||
|
}
|
||||||
|
|
||||||
if(flatCover || !image)
|
if(flatCover || !image)
|
||||||
{
|
{
|
||||||
defaultBox = Resources::GetImageData("nocoverFull.png");
|
defaultBox = Resources::GetImageData("nocoverFull.png");
|
||||||
@ -73,8 +83,14 @@ BoxCover::BoxCover(GuiImageData * img, bool flat)
|
|||||||
BoxCover::~BoxCover()
|
BoxCover::~BoxCover()
|
||||||
{
|
{
|
||||||
delete defaultBox;
|
delete defaultBox;
|
||||||
|
for(int i = 0; i < 4; ++i)
|
||||||
|
{
|
||||||
|
pointer[i] = NormalPointers[i];
|
||||||
|
delete GrabPointers[i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//! Remove me later
|
||||||
void BoxCover::WiiPADControl(GuiTrigger *t)
|
void BoxCover::WiiPADControl(GuiTrigger *t)
|
||||||
{
|
{
|
||||||
if(t->wpad.btns_d & WPAD_BUTTON_A)
|
if(t->wpad.btns_d & WPAD_BUTTON_A)
|
||||||
@ -88,16 +104,23 @@ void BoxCover::WiiPADControl(GuiTrigger *t)
|
|||||||
PosY += movePosY;
|
PosY += movePosY;
|
||||||
movePosX = 0.0f;
|
movePosX = 0.0f;
|
||||||
movePosY = 0.0f;
|
movePosY = 0.0f;
|
||||||
|
for(int i = 0; i < 4; ++i)
|
||||||
|
pointer[i] = GrabPointers[i];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
moveChan = -1;
|
moveChan = -1;
|
||||||
}
|
}
|
||||||
else if((t->wpad.btns_h & WPAD_BUTTON_A) && moveChan == t->chan && t->wpad.ir.valid)
|
else if((t->wpad.btns_h & WPAD_BUTTON_A) && moveChan == t->chan && t->wpad.ir.valid)
|
||||||
{
|
{
|
||||||
movePosX = (t->wpad.ir.x-moveStartPosX) / 180.0f;
|
movePosX = (t->wpad.ir.x-moveStartPosX) * fabs(PosZ)/3400.f;
|
||||||
movePosY = (moveStartPosY-t->wpad.ir.y) / 180.0f;
|
movePosY = (moveStartPosY-t->wpad.ir.y) * fabs(PosZ)/3400.f;
|
||||||
last_manual_move_frame = frameCount;
|
last_manual_move_frame = frameCount;
|
||||||
}
|
}
|
||||||
|
else if(!(t->wpad.btns_h & WPAD_BUTTON_A) && moveChan == t->chan)
|
||||||
|
{
|
||||||
|
for(int i = 0; i < 4; ++i)
|
||||||
|
pointer[i] = NormalPointers[i];
|
||||||
|
}
|
||||||
|
|
||||||
if(t->wpad.btns_h & WPAD_BUTTON_UP)
|
if(t->wpad.btns_h & WPAD_BUTTON_UP)
|
||||||
{
|
{
|
||||||
@ -129,21 +152,13 @@ void BoxCover::WiiPADControl(GuiTrigger *t)
|
|||||||
}
|
}
|
||||||
if(t->wpad.btns_h & WPAD_BUTTON_PLUS)
|
if(t->wpad.btns_h & WPAD_BUTTON_PLUS)
|
||||||
{
|
{
|
||||||
if(PosZ < -3.4f)
|
if(PosZ < -2.8f)
|
||||||
PosZ += 0.1f;
|
PosZ += 0.4f*fabs(PosZ)/19.f;
|
||||||
else if(BoxScale < 2.4f)
|
|
||||||
BoxScale += 0.05f;
|
|
||||||
}
|
}
|
||||||
if(t->wpad.btns_h & WPAD_BUTTON_MINUS)
|
if(t->wpad.btns_h & WPAD_BUTTON_MINUS)
|
||||||
{
|
{
|
||||||
if(BoxScale > 1.0f)
|
if(PosZ > -43.0f)
|
||||||
BoxScale -= 0.05f;
|
PosZ -= 0.4f*fabs(PosZ)/19.f;
|
||||||
else
|
|
||||||
{
|
|
||||||
BoxScale = 1.0f;
|
|
||||||
PosZ -= 0.1f;
|
|
||||||
if(PosZ < -6.0f) PosZ = -6.0f;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,9 +195,8 @@ void BoxCover::Draw()
|
|||||||
u8 BoxAlpha = (int) (alpha+angleDyn) & 0xFF;
|
u8 BoxAlpha = (int) (alpha+angleDyn) & 0xFF;
|
||||||
|
|
||||||
Mtx44 projection;
|
Mtx44 projection;
|
||||||
guPerspective(projection, 45, (f32)screenwidth/(f32)screenheight, fabs(PosZ)-1.3f > 1.0f ? fabs(PosZ)-1.3f : 1.0f, -300.0F);
|
guPerspective(projection, 8, (f32)screenwidth/(f32)screenheight, 1.0f, 300.0F);
|
||||||
GX_LoadProjectionMtx(projection, GX_PERSPECTIVE);
|
GX_LoadProjectionMtx(projection, GX_PERSPECTIVE);
|
||||||
GX_SetTevOp(GX_TEVSTAGE0, GX_MODULATE);
|
|
||||||
|
|
||||||
GX_SetVtxDesc(GX_VA_POS, GX_INDEX8);
|
GX_SetVtxDesc(GX_VA_POS, GX_INDEX8);
|
||||||
GX_SetVtxDesc(GX_VA_CLR0, GX_DIRECT);
|
GX_SetVtxDesc(GX_VA_CLR0, GX_DIRECT);
|
||||||
@ -201,7 +215,7 @@ void BoxCover::Draw()
|
|||||||
guMtxRotAxisDeg(modelView, &cubeAxis, RotZ-Animation);
|
guMtxRotAxisDeg(modelView, &cubeAxis, RotZ-Animation);
|
||||||
guMtxConcat(modelView3, modelView2, modelView2);
|
guMtxConcat(modelView3, modelView2, modelView2);
|
||||||
guMtxConcat(modelView2, modelView, modelView);
|
guMtxConcat(modelView2, modelView, modelView);
|
||||||
guMtxScaleApply(modelView, modelView, BoxScale, BoxScale, BoxScale);
|
//guMtxScaleApply(modelView, modelView, BoxScale, BoxScale, BoxScale);
|
||||||
guMtxTransApply(modelView, modelView, PosX+xoffsetDyn/680.0f+movePosX, PosY+yoffsetDyn/680.0f+movePosY, PosZ);
|
guMtxTransApply(modelView, modelView, PosX+xoffsetDyn/680.0f+movePosX, PosY+yoffsetDyn/680.0f+movePosY, PosZ);
|
||||||
guMtxConcat(view,modelView,modelView);
|
guMtxConcat(view,modelView,modelView);
|
||||||
|
|
||||||
@ -289,11 +303,6 @@ void BoxCover::Draw()
|
|||||||
GX_End();
|
GX_End();
|
||||||
}
|
}
|
||||||
|
|
||||||
GX_SetVtxDesc(GX_VA_POS, GX_DIRECT);
|
|
||||||
GX_SetVtxDesc(GX_VA_CLR0, GX_DIRECT);
|
|
||||||
GX_SetVtxDesc(GX_VA_TEX0, GX_DIRECT);
|
|
||||||
GX_SetTevOp(GX_TEVSTAGE0, GX_PASSCLR);
|
|
||||||
|
|
||||||
UpdateEffects();
|
UpdateEffects();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -309,17 +318,17 @@ void BoxCover::UpdateEffects()
|
|||||||
if(effects & EFFECT_BOX_FLY_CENTRE)
|
if(effects & EFFECT_BOX_FLY_CENTRE)
|
||||||
{
|
{
|
||||||
if(PosX > 0.01f)
|
if(PosX > 0.01f)
|
||||||
PosX -= effectAmount/1000.0f;
|
PosX -= effectAmount/1200.0f;
|
||||||
if(PosY > 0.01f)
|
if(PosY > 0.01f)
|
||||||
PosY -= effectAmount/1000.0f;
|
PosY -= effectAmount/1200.0f;
|
||||||
if(PosX < -0.01f)
|
if(PosX < -0.01f)
|
||||||
PosX += effectAmount/1000.0f;
|
PosX += effectAmount/1200.0f;
|
||||||
if(PosY < -0.01f)
|
if(PosY < -0.01f)
|
||||||
PosY += effectAmount/1000.0f;
|
PosY += effectAmount/1200.0f;
|
||||||
|
|
||||||
movePosX = 0.0f;
|
movePosX = 0.0f;
|
||||||
movePosY = 0.0f;
|
movePosY = 0.0f;
|
||||||
PosZ += 0.1f;
|
PosZ += 0.4f;
|
||||||
RotY += effectAmount/4.9f;
|
RotY += effectAmount/4.9f;
|
||||||
|
|
||||||
if(fabs(PosX) < 0.1f && fabs(PosY) < 0.1f)
|
if(fabs(PosX) < 0.1f && fabs(PosY) < 0.1f)
|
||||||
@ -333,18 +342,16 @@ void BoxCover::UpdateEffects()
|
|||||||
else if(effects & EFFECT_BOX_FLY_BACK)
|
else if(effects & EFFECT_BOX_FLY_BACK)
|
||||||
{
|
{
|
||||||
if(PosX > PosXOrig+0.1f)
|
if(PosX > PosXOrig+0.1f)
|
||||||
PosX -= effectAmount/1000.0f;
|
PosX -= effectAmount/1200.0f;
|
||||||
if(PosY > PosYOrig+0.1f)
|
if(PosY > PosYOrig+0.1f)
|
||||||
PosY -= effectAmount/1000.0f;
|
PosY -= effectAmount/1200.0f;
|
||||||
if(PosX < PosXOrig-0.1f)
|
if(PosX < PosXOrig-0.1f)
|
||||||
PosX += effectAmount/1000.0f;
|
PosX += effectAmount/1200.0f;
|
||||||
if(PosY < PosYOrig-0.1f)
|
if(PosY < PosYOrig-0.1f)
|
||||||
PosY += effectAmount/1000.0f;
|
PosY += effectAmount/1200.0f;
|
||||||
|
|
||||||
PosZ -= 0.1f;
|
PosZ -= 0.4f;
|
||||||
RotY -= effectAmount/4.9f;
|
RotY -= effectAmount/4.9f;
|
||||||
if(BoxScale > 1.0f)
|
|
||||||
BoxScale -= 0.08f;
|
|
||||||
|
|
||||||
if(movePosX > 0.1f)
|
if(movePosX > 0.1f)
|
||||||
movePosX -= 0.1f;
|
movePosX -= 0.1f;
|
||||||
@ -359,7 +366,6 @@ void BoxCover::UpdateEffects()
|
|||||||
{
|
{
|
||||||
movePosX = 0.0f;
|
movePosX = 0.0f;
|
||||||
movePosY = 0.0f;
|
movePosY = 0.0f;
|
||||||
BoxScale = 1.0f;
|
|
||||||
PosX = PosXOrig;
|
PosX = PosXOrig;
|
||||||
PosY = PosYOrig;
|
PosY = PosYOrig;
|
||||||
PosZ = PosZOrig;
|
PosZ = PosZOrig;
|
||||||
|
@ -58,7 +58,6 @@ class BoxCover : public GuiImage
|
|||||||
f32 PosXOrig;
|
f32 PosXOrig;
|
||||||
f32 PosYOrig;
|
f32 PosYOrig;
|
||||||
f32 PosZOrig;
|
f32 PosZOrig;
|
||||||
f32 BoxScale;
|
|
||||||
f32 AnimRotate;
|
f32 AnimRotate;
|
||||||
f32 Animation;
|
f32 Animation;
|
||||||
f32 Animation2;
|
f32 Animation2;
|
||||||
@ -73,6 +72,8 @@ class BoxCover : public GuiImage
|
|||||||
guVector camera, up, look;
|
guVector camera, up, look;
|
||||||
GuiImageData boxBorder;
|
GuiImageData boxBorder;
|
||||||
GuiImageData *defaultBox;
|
GuiImageData *defaultBox;
|
||||||
|
GuiImageData *NormalPointers[4];
|
||||||
|
GuiImageData *GrabPointers[4];
|
||||||
Mtx view;
|
Mtx view;
|
||||||
GXTexObj coverTex;
|
GXTexObj coverTex;
|
||||||
GXTexObj boxBorderTex;
|
GXTexObj boxBorderTex;
|
||||||
|
@ -50,19 +50,26 @@ DirList::~DirList()
|
|||||||
|
|
||||||
bool DirList::LoadPath(const char * folder, const char *filter, u32 flags)
|
bool DirList::LoadPath(const char * folder, const char *filter, u32 flags)
|
||||||
{
|
{
|
||||||
if(!folder)
|
if(!folder) return false;
|
||||||
|
|
||||||
|
std::string folderpath(folder);
|
||||||
|
|
||||||
|
return LoadPath(folderpath, filter, flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool DirList::LoadPath(std::string &folderpath, const char *filter, u32 flags)
|
||||||
|
{
|
||||||
|
if(folderpath.size() < 3)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
struct stat st;
|
|
||||||
struct dirent *dirent = NULL;
|
struct dirent *dirent = NULL;
|
||||||
DIR *dir = NULL;
|
DIR *dir = NULL;
|
||||||
std::string folderpath = folder;
|
|
||||||
|
|
||||||
if(folderpath[folderpath.size()-1] == '/')
|
if(folderpath[folderpath.size()-1] == '/')
|
||||||
folderpath.erase(folderpath.size()-1, 1);
|
folderpath.erase(folderpath.size()-1);
|
||||||
|
|
||||||
const char * notRoot = strchr(folderpath.c_str(), '/');
|
bool isRoot = (folderpath.find('/') == std::string::npos);
|
||||||
if(!notRoot)
|
if(isRoot)
|
||||||
folderpath += '/';
|
folderpath += '/';
|
||||||
|
|
||||||
dir = opendir(folderpath.c_str());
|
dir = opendir(folderpath.c_str());
|
||||||
@ -70,22 +77,28 @@ bool DirList::LoadPath(const char * folder, const char *filter, u32 flags)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
char * filename = new (std::nothrow) char[MAXPATHLEN];
|
char * filename = new (std::nothrow) char[MAXPATHLEN];
|
||||||
if(!filename)
|
struct stat *st = new (std::nothrow) struct stat;
|
||||||
|
if(!filename || !st)
|
||||||
{
|
{
|
||||||
|
delete [] filename;
|
||||||
|
delete filename;
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
while ((dirent = readdir(dir)) != 0)
|
while ((dirent = readdir(dir)) != 0)
|
||||||
{
|
{
|
||||||
|
if(!dirent->d_name)
|
||||||
|
continue;
|
||||||
|
|
||||||
snprintf(filename, MAXPATHLEN, "%s/%s", folderpath.c_str(), dirent->d_name);
|
snprintf(filename, MAXPATHLEN, "%s/%s", folderpath.c_str(), dirent->d_name);
|
||||||
|
|
||||||
if(stat(filename, &st) != 0)
|
if(stat(filename, st) != 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
snprintf(filename, MAXPATHLEN, dirent->d_name);
|
snprintf(filename, MAXPATHLEN, dirent->d_name);
|
||||||
|
|
||||||
if(st.st_mode & S_IFDIR)
|
if(st->st_mode & S_IFDIR)
|
||||||
{
|
{
|
||||||
if(!(flags & Dirs))
|
if(!(flags & Dirs))
|
||||||
continue;
|
continue;
|
||||||
@ -95,10 +108,11 @@ bool DirList::LoadPath(const char * folder, const char *filter, u32 flags)
|
|||||||
|
|
||||||
if(flags & CheckSubfolders)
|
if(flags & CheckSubfolders)
|
||||||
{
|
{
|
||||||
std::string newFolder = folderpath;
|
int length = folderpath.size();
|
||||||
if(notRoot) newFolder += '/';
|
if(!isRoot) folderpath += '/';
|
||||||
newFolder += filename;
|
folderpath += filename;
|
||||||
LoadPath(newFolder.c_str(), filter, flags);
|
LoadPath(folderpath, filter, flags);
|
||||||
|
folderpath.erase(length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -114,15 +128,16 @@ bool DirList::LoadPath(const char * folder, const char *filter, u32 flags)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(strtokcmp(fileext, filter, ",") == 0)
|
if(strtokcmp(fileext, filter, ",") == 0)
|
||||||
AddEntrie(folderpath.c_str(), filename, st.st_size, (st.st_mode & S_IFDIR) ? true : false);
|
AddEntrie(folderpath.c_str(), filename, st->st_size, (st->st_mode & S_IFDIR) ? true : false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AddEntrie(folderpath.c_str(), filename, st.st_size, (st.st_mode & S_IFDIR) ? true : false);
|
AddEntrie(folderpath.c_str(), filename, st->st_size, (st->st_mode & S_IFDIR) ? true : false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
delete [] filename;
|
delete [] filename;
|
||||||
|
delete st;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -168,13 +183,10 @@ static bool SortCallback(const FileInfos & f1, const FileInfos & f2)
|
|||||||
if(f1.isDir && !(f2.isDir)) return true;
|
if(f1.isDir && !(f2.isDir)) return true;
|
||||||
if(!(f1.isDir) && f2.isDir) return false;
|
if(!(f1.isDir) && f2.isDir) return false;
|
||||||
|
|
||||||
const char * Filename1 = FullpathToFilename(f1.FilePath);
|
if(f1.FilePath && !f2.FilePath) return true;
|
||||||
const char * Filename2 = FullpathToFilename(f2.FilePath);
|
if(!f1.FilePath) return false;
|
||||||
|
|
||||||
if(Filename1 && !Filename2) return true;
|
if(strcasecmp(f1.FilePath, f2.FilePath) > 0)
|
||||||
if(!Filename1 && Filename2) return false;
|
|
||||||
|
|
||||||
if(strcasecmp(Filename1, Filename2) > 0)
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -182,7 +194,14 @@ static bool SortCallback(const FileInfos & f1, const FileInfos & f2)
|
|||||||
|
|
||||||
void DirList::SortList()
|
void DirList::SortList()
|
||||||
{
|
{
|
||||||
std::sort(FileInfo.begin(), FileInfo.end(), SortCallback);
|
if(FileInfo.size() > 1)
|
||||||
|
std::sort(FileInfo.begin(), FileInfo.end(), SortCallback);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DirList::SortList(bool (*SortFunc)(const FileInfos &a, const FileInfos &b))
|
||||||
|
{
|
||||||
|
if(FileInfo.size() > 1)
|
||||||
|
std::sort(FileInfo.begin(), FileInfo.end(), SortFunc);
|
||||||
}
|
}
|
||||||
|
|
||||||
int DirList::GetFileIndex(const char *filename)
|
int DirList::GetFileIndex(const char *filename)
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#define ___DIRLIST_H_
|
#define ___DIRLIST_H_
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
#include <gctypes.h>
|
#include <gctypes.h>
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
@ -49,6 +50,7 @@ class DirList
|
|||||||
~DirList();
|
~DirList();
|
||||||
//! Load all the files from a directory
|
//! Load all the files from a directory
|
||||||
bool LoadPath(const char * path, const char *filter = NULL, u32 flags = Files | Dirs);
|
bool LoadPath(const char * path, const char *filter = NULL, u32 flags = Files | Dirs);
|
||||||
|
bool LoadPath(std::string &path, const char *filter = NULL, u32 flags = Files | Dirs);
|
||||||
//! Get a filename of the list
|
//! Get a filename of the list
|
||||||
//!\param list index
|
//!\param list index
|
||||||
const char * GetFilename(int index);
|
const char * GetFilename(int index);
|
||||||
@ -65,6 +67,8 @@ class DirList
|
|||||||
int GetFilecount() { return FileInfo.size(); };
|
int GetFilecount() { return FileInfo.size(); };
|
||||||
//! Sort list by filepath
|
//! Sort list by filepath
|
||||||
void SortList();
|
void SortList();
|
||||||
|
//! Custom sort command for custom sort functions definitions
|
||||||
|
void SortList(bool (*SortFunc)(const FileInfos &a, const FileInfos &b));
|
||||||
//! Get the index of the specified filename
|
//! Get the index of the specified filename
|
||||||
int GetFileIndex(const char *filename);
|
int GetFileIndex(const char *filename);
|
||||||
//! Enum for search/filter flags
|
//! Enum for search/filter flags
|
||||||
|
@ -21,10 +21,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "FreeTypeGX.h"
|
#include "FreeTypeGX.h"
|
||||||
#include "utils/tools.h"
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
#define EXPLODE_UINT8_TO_UINT32(x) ((x << 24) | (x << 16) | (x << 8) | x)
|
||||||
|
#define ALIGN8(x) (((x) + 7) & ~7)
|
||||||
|
#define ALIGN32(x) (((x) + 31) & ~31)
|
||||||
|
#define RGBA_TO_IA4(x) (((x & 0x0000f000) >> 8) | ((x & 0x000000f0) >> 4))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a short char string to a wide char string.
|
* Convert a short char string to a wide char string.
|
||||||
*
|
*
|
||||||
@ -132,14 +136,10 @@ void FreeTypeGX::unloadFont()
|
|||||||
*/
|
*/
|
||||||
ftgxCharData * FreeTypeGX::cacheGlyphData(wchar_t charCode, int16_t pixelSize)
|
ftgxCharData * FreeTypeGX::cacheGlyphData(wchar_t charCode, int16_t pixelSize)
|
||||||
{
|
{
|
||||||
map<int16_t, map<wchar_t, ftgxCharData> >::iterator itr;
|
map<int16_t, map<wchar_t, ftgxCharData> >::iterator itr = fontData.find(pixelSize);
|
||||||
map<wchar_t, ftgxCharData>::iterator itr2;
|
|
||||||
|
|
||||||
itr = fontData.find(pixelSize);
|
|
||||||
if (itr != fontData.end())
|
if (itr != fontData.end())
|
||||||
{
|
{
|
||||||
itr2 = itr->second.find(charCode);
|
map<wchar_t, ftgxCharData>::iterator itr2 = itr->second.find(charCode);
|
||||||
|
|
||||||
if (itr2 != itr->second.end())
|
if (itr2 != itr->second.end())
|
||||||
{
|
{
|
||||||
return &itr2->second;
|
return &itr2->second;
|
||||||
@ -172,12 +172,12 @@ ftgxCharData * FreeTypeGX::cacheGlyphData(wchar_t charCode, int16_t pixelSize)
|
|||||||
{
|
{
|
||||||
FT_Bitmap *glyphBitmap = &ftFace->glyph->bitmap;
|
FT_Bitmap *glyphBitmap = &ftFace->glyph->bitmap;
|
||||||
|
|
||||||
textureWidth = ALIGN(glyphBitmap->width);
|
textureWidth = ALIGN8(glyphBitmap->width);
|
||||||
textureHeight = ALIGN(glyphBitmap->rows);
|
textureHeight = ALIGN8(glyphBitmap->rows);
|
||||||
if(textureWidth == 0)
|
if(textureWidth == 0)
|
||||||
textureWidth = 4;
|
textureWidth = 8;
|
||||||
if(textureHeight == 0)
|
if(textureHeight == 0)
|
||||||
textureHeight = 4;
|
textureHeight = 8;
|
||||||
|
|
||||||
fontData[pixelSize][charCode].renderOffsetX = (int16_t) ftFace->glyph->bitmap_left;
|
fontData[pixelSize][charCode].renderOffsetX = (int16_t) ftFace->glyph->bitmap_left;
|
||||||
fontData[pixelSize][charCode].glyphAdvanceX = (uint16_t) (ftFace->glyph->advance.x >> 6);
|
fontData[pixelSize][charCode].glyphAdvanceX = (uint16_t) (ftFace->glyph->advance.x >> 6);
|
||||||
@ -225,37 +225,52 @@ uint16_t FreeTypeGX::cacheGlyphDataComplete(int16_t pixelSize)
|
|||||||
*
|
*
|
||||||
* @param bmp A pointer to the most recently rendered glyph's bitmap.
|
* @param bmp A pointer to the most recently rendered glyph's bitmap.
|
||||||
* @param charData A pointer to an allocated ftgxCharData structure whose data represent that of the last rendered glyph.
|
* @param charData A pointer to an allocated ftgxCharData structure whose data represent that of the last rendered glyph.
|
||||||
*
|
|
||||||
*
|
|
||||||
* Optimized for RGBA8 use by Dimok.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void FreeTypeGX::loadGlyphData(FT_Bitmap *bmp, ftgxCharData *charData)
|
void FreeTypeGX::loadGlyphData(FT_Bitmap *bmp, ftgxCharData *charData)
|
||||||
{
|
{
|
||||||
int length = ALIGN32(((charData->textureWidth+3)>>2)*((charData->textureHeight+3)>>2)*32*2);
|
uint32_t *glyphData = (uint32_t *) memalign(32, charData->textureWidth * charData->textureHeight * 4);
|
||||||
|
memset(glyphData, 0x00, charData->textureWidth * charData->textureHeight * 4);
|
||||||
|
|
||||||
uint8_t * glyphData = (uint8_t *) memalign(32, length);
|
uint8_t *bmsrc = (uint8_t *)bmp->buffer;
|
||||||
if (!glyphData) return;
|
uint32_t *dest = glyphData, *ptr = dest;
|
||||||
|
|
||||||
memset(glyphData, 0x00, length);
|
for (uint16_t imagePosY = 0; imagePosY < bmp->rows; ++imagePosY)
|
||||||
|
{
|
||||||
|
for (uint16_t imagePosX = 0; imagePosX < bmp->width; ++imagePosX)
|
||||||
|
{
|
||||||
|
*ptr++ = EXPLODE_UINT8_TO_UINT32(*bmsrc);
|
||||||
|
++bmsrc;
|
||||||
|
}
|
||||||
|
ptr = dest += charData->textureWidth;
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t *src = (uint8_t *) bmp->buffer;
|
uint32_t bufferSize = charData->textureWidth * charData->textureHeight;
|
||||||
uint32_t offset;
|
uint32_t* dataBufferIA4 = (uint32_t *)memalign(32, ALIGN32(bufferSize));
|
||||||
|
memset(dataBufferIA4, 0x00, bufferSize);
|
||||||
|
|
||||||
for (int imagePosY = 0; imagePosY < bmp->rows; ++imagePosY)
|
uint32_t *src = glyphData;
|
||||||
{
|
uint8_t* dst = (uint8_t *) dataBufferIA4;
|
||||||
for (int imagePosX = 0; imagePosX < bmp->width; ++imagePosX)
|
|
||||||
{
|
|
||||||
offset = (((((imagePosY >> 2) * (charData->textureWidth >> 2) + (imagePosX >> 2)) << 5) + ((imagePosY & 3) << 2) + (imagePosX & 3)) << 1);
|
|
||||||
glyphData[offset] = *src;
|
|
||||||
glyphData[offset + 1] = *src;
|
|
||||||
glyphData[offset + 32] = *src;
|
|
||||||
glyphData[offset + 33] = *src;
|
|
||||||
++src;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
DCFlushRange(glyphData, length);
|
|
||||||
|
|
||||||
charData->glyphDataTexture = glyphData;
|
for(uint16_t y = 0; y < charData->textureHeight; y += 4) {
|
||||||
|
for(uint16_t x = 0; x < charData->textureWidth; x += 8) {
|
||||||
|
for(uint16_t rows = 0; rows < 4; rows++) {
|
||||||
|
*dst++ = RGBA_TO_IA4(src[((y + rows) * charData->textureWidth) + (x + 0)]);
|
||||||
|
*dst++ = RGBA_TO_IA4(src[((y + rows) * charData->textureWidth) + (x + 1)]);
|
||||||
|
*dst++ = RGBA_TO_IA4(src[((y + rows) * charData->textureWidth) + (x + 2)]);
|
||||||
|
*dst++ = RGBA_TO_IA4(src[((y + rows) * charData->textureWidth) + (x + 3)]);
|
||||||
|
*dst++ = RGBA_TO_IA4(src[((y + rows) * charData->textureWidth) + (x + 4)]);
|
||||||
|
*dst++ = RGBA_TO_IA4(src[((y + rows) * charData->textureWidth) + (x + 5)]);
|
||||||
|
*dst++ = RGBA_TO_IA4(src[((y + rows) * charData->textureWidth) + (x + 6)]);
|
||||||
|
*dst++ = RGBA_TO_IA4(src[((y + rows) * charData->textureWidth) + (x + 7)]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DCFlushRange(dataBufferIA4, bufferSize);
|
||||||
|
free(glyphData);
|
||||||
|
|
||||||
|
charData->glyphDataTexture = (uint8_t *) dataBufferIA4;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -368,7 +383,7 @@ uint16_t FreeTypeGX::drawText(int16_t x, int16_t y, int16_t z, const wchar_t *te
|
|||||||
}
|
}
|
||||||
|
|
||||||
GX_InitTexObj(&glyphTexture, glyphData->glyphDataTexture, glyphData->textureWidth,
|
GX_InitTexObj(&glyphTexture, glyphData->glyphDataTexture, glyphData->textureWidth,
|
||||||
glyphData->textureHeight, GX_TF_RGBA8, GX_CLAMP, GX_CLAMP, GX_FALSE);
|
glyphData->textureHeight, GX_TF_IA4, GX_CLAMP, GX_CLAMP, GX_FALSE);
|
||||||
copyTextureToFramebuffer(&glyphTexture, glyphData->textureWidth, glyphData->textureHeight, x_pos
|
copyTextureToFramebuffer(&glyphTexture, glyphData->textureWidth, glyphData->textureHeight, x_pos
|
||||||
+ glyphData->renderOffsetX + x_offset, y - glyphData->renderOffsetY + y_offset, z, color);
|
+ glyphData->renderOffsetX + x_offset, y - glyphData->renderOffsetY + y_offset, z, color);
|
||||||
|
|
||||||
@ -540,8 +555,9 @@ void FreeTypeGX::copyTextureToFramebuffer(GXTexObj *texObj, f32 texWidth, f32 te
|
|||||||
GX_LoadTexObj(texObj, GX_TEXMAP0);
|
GX_LoadTexObj(texObj, GX_TEXMAP0);
|
||||||
GX_InvalidateTexAll();
|
GX_InvalidateTexAll();
|
||||||
|
|
||||||
GX_SetTevOp(GX_TEVSTAGE0, GX_MODULATE);
|
GX_SetVtxDesc(GX_VA_POS, GX_DIRECT);
|
||||||
GX_SetVtxDesc(GX_VA_TEX0, GX_DIRECT);
|
GX_SetVtxDesc(GX_VA_TEX0, GX_DIRECT);
|
||||||
|
GX_SetVtxDesc(GX_VA_CLR0, GX_DIRECT);
|
||||||
|
|
||||||
GX_Begin(GX_QUADS, this->vertexIndex, 4);
|
GX_Begin(GX_QUADS, this->vertexIndex, 4);
|
||||||
GX_Position3s16(screenX, screenY, screenZ);
|
GX_Position3s16(screenX, screenY, screenZ);
|
||||||
@ -560,9 +576,6 @@ void FreeTypeGX::copyTextureToFramebuffer(GXTexObj *texObj, f32 texWidth, f32 te
|
|||||||
GX_Color4u8(color.r, color.g, color.b, color.a);
|
GX_Color4u8(color.r, color.g, color.b, color.a);
|
||||||
GX_TexCoord2f32(0.0f, 1.0f);
|
GX_TexCoord2f32(0.0f, 1.0f);
|
||||||
GX_End();
|
GX_End();
|
||||||
|
|
||||||
GX_SetTevOp(GX_TEVSTAGE0, GX_PASSCLR);
|
|
||||||
GX_SetVtxDesc(GX_VA_TEX0, GX_NONE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -580,6 +593,8 @@ void FreeTypeGX::copyFeatureToFramebuffer(f32 featureWidth, f32 featureHeight, i
|
|||||||
int16_t screenZ, GXColor color)
|
int16_t screenZ, GXColor color)
|
||||||
{
|
{
|
||||||
GX_SetTevOp(GX_TEVSTAGE0, GX_PASSCLR);
|
GX_SetTevOp(GX_TEVSTAGE0, GX_PASSCLR);
|
||||||
|
GX_SetVtxDesc(GX_VA_POS, GX_DIRECT);
|
||||||
|
GX_SetVtxDesc(GX_VA_CLR0, GX_DIRECT);
|
||||||
GX_SetVtxDesc(GX_VA_TEX0, GX_NONE);
|
GX_SetVtxDesc(GX_VA_TEX0, GX_NONE);
|
||||||
|
|
||||||
GX_Begin(GX_QUADS, this->vertexIndex, 4);
|
GX_Begin(GX_QUADS, this->vertexIndex, 4);
|
||||||
@ -596,6 +611,5 @@ void FreeTypeGX::copyFeatureToFramebuffer(f32 featureWidth, f32 featureHeight, i
|
|||||||
GX_Color4u8(color.r, color.g, color.b, color.a);
|
GX_Color4u8(color.r, color.g, color.b, color.a);
|
||||||
GX_End();
|
GX_End();
|
||||||
|
|
||||||
GX_SetTevOp(GX_TEVSTAGE0, GX_PASSCLR);
|
GX_SetTevOp(GX_TEVSTAGE0, GX_MODULATE);
|
||||||
GX_SetVtxDesc(GX_VA_TEX0, GX_NONE);
|
|
||||||
}
|
}
|
||||||
|
@ -242,6 +242,18 @@ extern const u32 player3_point_png_size;
|
|||||||
extern const u8 player4_point_png[];
|
extern const u8 player4_point_png[];
|
||||||
extern const u32 player4_point_png_size;
|
extern const u32 player4_point_png_size;
|
||||||
|
|
||||||
|
extern const u8 player1_grab_png[];
|
||||||
|
extern const u32 player1_grab_png_size;
|
||||||
|
|
||||||
|
extern const u8 player2_grab_png[];
|
||||||
|
extern const u32 player2_grab_png_size;
|
||||||
|
|
||||||
|
extern const u8 player3_grab_png[];
|
||||||
|
extern const u32 player3_grab_png_size;
|
||||||
|
|
||||||
|
extern const u8 player4_grab_png[];
|
||||||
|
extern const u32 player4_grab_png_size;
|
||||||
|
|
||||||
extern const u8 rplayer1_point_png[];
|
extern const u8 rplayer1_point_png[];
|
||||||
extern const u32 rplayer1_point_png_size;
|
extern const u32 rplayer1_point_png_size;
|
||||||
|
|
||||||
|
@ -184,16 +184,25 @@ void HomebrewBrowser::SetupMainButtons()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const char * shortpath = strrchr(HomebrewList->GetFilename(i), '/');
|
const char * shortpath = HomebrewList->GetFilepath(i);
|
||||||
if(shortpath)
|
const char * ptr = shortpath;
|
||||||
|
const char * ptr2 = NULL;
|
||||||
|
while(*ptr != '\0')
|
||||||
{
|
{
|
||||||
metapath = shortpath;
|
if(*ptr == '/')
|
||||||
metapath = '/';
|
{
|
||||||
metapath = HomebrewList->GetFilename(i);
|
shortpath = ptr2;
|
||||||
HomebrewName = metapath.c_str();
|
ptr2 = ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
++ptr;
|
||||||
}
|
}
|
||||||
else
|
if(!shortpath && ptr2)
|
||||||
HomebrewName = HomebrewList->GetFilename(i);
|
shortpath = ptr2;
|
||||||
|
else if(!shortpath)
|
||||||
|
shortpath = HomebrewList->GetFilename(i);
|
||||||
|
|
||||||
|
HomebrewName = shortpath;
|
||||||
MainButtonDesc[i]->SetText(" ");
|
MainButtonDesc[i]->SetText(" ");
|
||||||
MainButtonDescOver[i]->SetText(" ");
|
MainButtonDescOver[i]->SetText(" ");
|
||||||
}
|
}
|
||||||
@ -369,6 +378,14 @@ int HomebrewBrowser::ReceiveFile()
|
|||||||
{
|
{
|
||||||
// It's compressed, uncompress
|
// It's compressed, uncompress
|
||||||
u8 *unc = (u8 *) malloc(uncfilesize);
|
u8 *unc = (u8 *) malloc(uncfilesize);
|
||||||
|
if(!unc)
|
||||||
|
{
|
||||||
|
ProgressStop();
|
||||||
|
free(buffer);
|
||||||
|
CloseConnection();
|
||||||
|
WindowPrompt(tr( "Not enough memory." ), 0, tr( "OK" ));
|
||||||
|
return MENU_NONE;
|
||||||
|
}
|
||||||
uLongf f = uncfilesize;
|
uLongf f = uncfilesize;
|
||||||
error = uncompress(unc, &f, buffer, infilesize) != Z_OK;
|
error = uncompress(unc, &f, buffer, infilesize) != Z_OK;
|
||||||
uncfilesize = f;
|
uncfilesize = f;
|
||||||
|
BIN
source/images/player1_grab.png
Normal file
BIN
source/images/player1_grab.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.2 KiB |
BIN
source/images/player2_grab.png
Normal file
BIN
source/images/player2_grab.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
BIN
source/images/player3_grab.png
Normal file
BIN
source/images/player3_grab.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
BIN
source/images/player4_grab.png
Normal file
BIN
source/images/player4_grab.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
@ -25,6 +25,10 @@
|
|||||||
|
|
||||||
void GuiBox::Draw()
|
void GuiBox::Draw()
|
||||||
{
|
{
|
||||||
|
GX_SetTevOp(GX_TEVSTAGE0, GX_PASSCLR);
|
||||||
|
GX_SetVtxDesc(GX_VA_POS, GX_DIRECT);
|
||||||
|
GX_SetVtxDesc(GX_VA_CLR0, GX_DIRECT);
|
||||||
|
GX_SetVtxDesc(GX_VA_TEX0, GX_NONE);
|
||||||
u32 n = filled ? 4 : 5;
|
u32 n = filled ? 4 : 5;
|
||||||
f32 x = GetLeft();
|
f32 x = GetLeft();
|
||||||
f32 y = GetTop();
|
f32 y = GetTop();
|
||||||
@ -39,4 +43,5 @@ void GuiBox::Draw()
|
|||||||
GX_Color4u8(color[i].r, color[i].g, color[i].b, color[i].a);
|
GX_Color4u8(color[i].r, color[i].g, color[i].b, color[i].a);
|
||||||
}
|
}
|
||||||
GX_End();
|
GX_End();
|
||||||
|
GX_SetTevOp(GX_TEVSTAGE0, GX_MODULATE);
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
|
|
||||||
static int scrollison;
|
static int scrollison = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for the GuiButton class.
|
* Constructor for the GuiButton class.
|
||||||
@ -351,9 +351,9 @@ void GuiButton::DrawTooltip()
|
|||||||
}
|
}
|
||||||
void GuiButton::ScrollIsOn(int f)
|
void GuiButton::ScrollIsOn(int f)
|
||||||
{
|
{
|
||||||
LOCK( this );
|
|
||||||
scrollison = f;
|
scrollison = f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GuiButton::Update(GuiTrigger * t)
|
void GuiButton::Update(GuiTrigger * t)
|
||||||
{
|
{
|
||||||
LOCK( this );
|
LOCK( this );
|
||||||
|
@ -47,6 +47,11 @@ void GuiCircle::SetLinewidth(float s)
|
|||||||
|
|
||||||
void GuiCircle::Draw()
|
void GuiCircle::Draw()
|
||||||
{
|
{
|
||||||
|
GX_SetTevOp(GX_TEVSTAGE0, GX_PASSCLR);
|
||||||
|
GX_SetVtxDesc(GX_VA_POS, GX_DIRECT);
|
||||||
|
GX_SetVtxDesc(GX_VA_CLR0, GX_DIRECT);
|
||||||
|
GX_SetVtxDesc(GX_VA_TEX0, GX_NONE);
|
||||||
|
|
||||||
int loopAmount = filled ? accuracy : accuracy+1;
|
int loopAmount = filled ? accuracy : accuracy+1;
|
||||||
|
|
||||||
GX_Begin(filled ? GX_TRIANGLEFAN : GX_LINESTRIP, GX_VTXFMT0, loopAmount);
|
GX_Begin(filled ? GX_TRIANGLEFAN : GX_LINESTRIP, GX_VTXFMT0, loopAmount);
|
||||||
@ -60,4 +65,5 @@ void GuiCircle::Draw()
|
|||||||
GX_Color4u8(color.r, color.g, color.b, color.a);
|
GX_Color4u8(color.r, color.g, color.b, color.a);
|
||||||
}
|
}
|
||||||
GX_End();
|
GX_End();
|
||||||
|
GX_SetTevOp(GX_TEVSTAGE0, GX_MODULATE);
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,11 @@
|
|||||||
|
|
||||||
void GuiCross::Draw()
|
void GuiCross::Draw()
|
||||||
{
|
{
|
||||||
|
GX_SetTevOp(GX_TEVSTAGE0, GX_PASSCLR);
|
||||||
|
GX_SetVtxDesc(GX_VA_POS, GX_DIRECT);
|
||||||
|
GX_SetVtxDesc(GX_VA_CLR0, GX_DIRECT);
|
||||||
|
GX_SetVtxDesc(GX_VA_TEX0, GX_NONE);
|
||||||
|
|
||||||
f32 x1 = GetLeft();
|
f32 x1 = GetLeft();
|
||||||
f32 x2 = x1 + width;
|
f32 x2 = x1 + width;
|
||||||
f32 y1 = GetTop();
|
f32 y1 = GetTop();
|
||||||
@ -40,4 +45,5 @@ void GuiCross::Draw()
|
|||||||
GX_Position3f32(x1, y2, 0.0f);
|
GX_Position3f32(x1, y2, 0.0f);
|
||||||
GX_Color4u8(color.r, color.g, color.b, color.a);
|
GX_Color4u8(color.r, color.g, color.b, color.a);
|
||||||
GX_End();
|
GX_End();
|
||||||
|
GX_SetTevOp(GX_TEVSTAGE0, GX_MODULATE);
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,10 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
#define GAMESELECTSIZE 30
|
#define GAMESELECTSIZE 30
|
||||||
int txtscroll = 0;
|
// scrolldelay affects how fast the list scrolls
|
||||||
|
// when the arrows are clicked
|
||||||
|
static const u32 DEFAULT_SCROLL_DELAY = 4;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for the GuiGameBrowser class.
|
* Constructor for the GuiGameBrowser class.
|
||||||
*/
|
*/
|
||||||
@ -359,12 +362,16 @@ void GuiGameBrowser::Update(GuiTrigger * t)
|
|||||||
LOCK( this );
|
LOCK( this );
|
||||||
if (state == STATE_DISABLED || !t || !gameList.size()) return;
|
if (state == STATE_DISABLED || !t || !gameList.size()) return;
|
||||||
|
|
||||||
|
static int pressedChan = -1;
|
||||||
int next, prev;
|
int next, prev;
|
||||||
int old_listOffset = listOffset;
|
int old_listOffset = listOffset;
|
||||||
static int position2;
|
static int position2;
|
||||||
// scrolldelay affects how fast the list scrolls
|
static u32 scrolldelay = 0;
|
||||||
// when the arrows are clicked
|
|
||||||
float scrolldelay = 3.5;
|
if(t->wpad.btns_d)
|
||||||
|
{
|
||||||
|
pressedChan = t->chan;
|
||||||
|
}
|
||||||
|
|
||||||
if (scrollbaron == 1)
|
if (scrollbaron == 1)
|
||||||
{
|
{
|
||||||
@ -376,11 +383,9 @@ void GuiGameBrowser::Update(GuiTrigger * t)
|
|||||||
|
|
||||||
next = listOffset;
|
next = listOffset;
|
||||||
|
|
||||||
u32 buttonshold = ButtonsHold();
|
if(pressedChan == -1 || (pressedChan == t->chan && !(t->wpad.btns_h & WPAD_BUTTON_UP) &&
|
||||||
|
!(t->wpad.btns_h & WPAD_BUTTON_DOWN) && !(t->wpad.btns_h & WPAD_BUTTON_B)))
|
||||||
if (buttonshold != WPAD_BUTTON_UP && buttonshold != WPAD_BUTTON_DOWN)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
for (int i = 0; i < pagesize; i++)
|
for (int i = 0; i < pagesize; i++)
|
||||||
{
|
{
|
||||||
if (next >= 0) next = this->FindMenuItem(next, 1);
|
if (next >= 0) next = this->FindMenuItem(next, 1);
|
||||||
@ -389,8 +394,8 @@ void GuiGameBrowser::Update(GuiTrigger * t)
|
|||||||
{
|
{
|
||||||
if (i != selectedItem && game[i]->GetState() == STATE_SELECTED)
|
if (i != selectedItem && game[i]->GetState() == STATE_SELECTED)
|
||||||
game[i]->ResetState();
|
game[i]->ResetState();
|
||||||
else if (i == selectedItem && game[i]->GetState() == STATE_DEFAULT) game[selectedItem]->SetState(
|
else if (i == selectedItem && game[i]->GetState() == STATE_DEFAULT)
|
||||||
STATE_SELECTED, t->chan);
|
game[selectedItem]->SetState(STATE_SELECTED, t->chan);
|
||||||
}
|
}
|
||||||
|
|
||||||
game[i]->Update(t);
|
game[i]->Update(t);
|
||||||
@ -407,86 +412,14 @@ void GuiGameBrowser::Update(GuiTrigger * t)
|
|||||||
|
|
||||||
if (scrollbaron == 1)
|
if (scrollbaron == 1)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (t->Down() || arrowDownBtn->GetState() == STATE_CLICKED || arrowDownBtn->GetState() == STATE_HELD) //down
|
if (t->Down() || arrowDownBtn->GetState() == STATE_CLICKED || arrowDownBtn->GetState() == STATE_HELD) //down
|
||||||
{
|
{
|
||||||
|
if(scrolldelay > 0)
|
||||||
next = this->FindMenuItem(gameIndex[selectedItem], 1);
|
--scrolldelay;
|
||||||
|
else
|
||||||
if (next >= 0)
|
|
||||||
{
|
|
||||||
if (selectedItem == pagesize - 1)
|
|
||||||
{
|
|
||||||
// move list down by 1
|
|
||||||
listOffset = this->FindMenuItem(listOffset, 1);
|
|
||||||
}
|
|
||||||
else if (game[selectedItem + 1]->IsVisible())
|
|
||||||
{
|
|
||||||
game[selectedItem]->ResetState();
|
|
||||||
game[selectedItem + 1]->SetState(STATE_SELECTED, t->chan);
|
|
||||||
selectedItem++;
|
|
||||||
}
|
|
||||||
// scrollbarBoxBtn->Draw();
|
|
||||||
usleep(10000 * scrolldelay);
|
|
||||||
}
|
|
||||||
if (!(ButtonsHold() & WPAD_BUTTON_A)) arrowDownBtn->ResetState();
|
|
||||||
}
|
|
||||||
else if (t->Up() || arrowUpBtn->GetState() == STATE_CLICKED || arrowUpBtn->GetState() == STATE_HELD) //up
|
|
||||||
{
|
|
||||||
prev = this->FindMenuItem(gameIndex[selectedItem], -1);
|
|
||||||
|
|
||||||
if (prev >= 0)
|
|
||||||
{
|
|
||||||
if (selectedItem == 0)
|
|
||||||
{
|
|
||||||
// move list up by 1
|
|
||||||
listOffset = prev;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
game[selectedItem]->ResetState();
|
|
||||||
game[selectedItem - 1]->SetState(STATE_SELECTED, t->chan);
|
|
||||||
selectedItem--;
|
|
||||||
}
|
|
||||||
// scrollbarBoxBtn->Draw();
|
|
||||||
usleep(10000 * scrolldelay);
|
|
||||||
}
|
|
||||||
if (!(ButtonsHold() & WPAD_BUTTON_A)) arrowUpBtn->ResetState();
|
|
||||||
}
|
|
||||||
int position1 = t->wpad.ir.y;
|
|
||||||
|
|
||||||
if (position2 == 0 && position1 > 0)
|
|
||||||
{
|
|
||||||
position2 = position1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((buttonshold & WPAD_BUTTON_B) && position1 > 0)
|
|
||||||
{
|
|
||||||
scrollbarBoxBtn->ScrollIsOn(1);
|
|
||||||
if (position2 > position1)
|
|
||||||
{
|
|
||||||
|
|
||||||
prev = this->FindMenuItem(gameIndex[selectedItem], -1);
|
|
||||||
|
|
||||||
if (prev >= 0)
|
|
||||||
{
|
|
||||||
if (selectedItem == 0)
|
|
||||||
{
|
|
||||||
// move list up by 1
|
|
||||||
listOffset = prev;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
game[selectedItem]->ResetState();
|
|
||||||
game[selectedItem - 1]->SetState(STATE_SELECTED, t->chan);
|
|
||||||
selectedItem--;
|
|
||||||
}
|
|
||||||
// scrollbarBoxBtn->Draw();
|
|
||||||
usleep(10000 * scrolldelay);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (position2 < position1)
|
|
||||||
{
|
{
|
||||||
|
if(arrowDownBtn->GetState() == STATE_CLICKED || arrowDownBtn->GetState() == STATE_HELD)
|
||||||
|
scrolldelay = DEFAULT_SCROLL_DELAY;
|
||||||
next = this->FindMenuItem(gameIndex[selectedItem], 1);
|
next = this->FindMenuItem(gameIndex[selectedItem], 1);
|
||||||
|
|
||||||
if (next >= 0)
|
if (next >= 0)
|
||||||
@ -502,13 +435,94 @@ void GuiGameBrowser::Update(GuiTrigger * t)
|
|||||||
game[selectedItem + 1]->SetState(STATE_SELECTED, t->chan);
|
game[selectedItem + 1]->SetState(STATE_SELECTED, t->chan);
|
||||||
selectedItem++;
|
selectedItem++;
|
||||||
}
|
}
|
||||||
// scrollbarBoxBtn->Draw();
|
|
||||||
usleep(10000 * scrolldelay);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (pressedChan == -1 || (pressedChan == t->chan && !(t->wpad.btns_d & WPAD_BUTTON_A) && !(t->wpad.btns_h & WPAD_BUTTON_A)))
|
||||||
|
arrowDownBtn->ResetState();
|
||||||
}
|
}
|
||||||
else if (!(buttonshold & WPAD_BUTTON_B))
|
else if (t->Up() || arrowUpBtn->GetState() == STATE_CLICKED || arrowUpBtn->GetState() == STATE_HELD) //up
|
||||||
|
{
|
||||||
|
if(scrolldelay > 0)
|
||||||
|
--scrolldelay;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(arrowUpBtn->GetState() == STATE_CLICKED || arrowUpBtn->GetState() == STATE_HELD)
|
||||||
|
scrolldelay = DEFAULT_SCROLL_DELAY;
|
||||||
|
prev = this->FindMenuItem(gameIndex[selectedItem], -1);
|
||||||
|
|
||||||
|
if (prev >= 0)
|
||||||
|
{
|
||||||
|
if (selectedItem == 0)
|
||||||
|
{
|
||||||
|
// move list up by 1
|
||||||
|
listOffset = prev;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
game[selectedItem]->ResetState();
|
||||||
|
game[selectedItem - 1]->SetState(STATE_SELECTED, t->chan);
|
||||||
|
selectedItem--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (pressedChan == -1 || (pressedChan == t->chan && !(t->wpad.btns_d & WPAD_BUTTON_A) && !(t->wpad.btns_h & WPAD_BUTTON_A)))
|
||||||
|
arrowUpBtn->ResetState();
|
||||||
|
}
|
||||||
|
int position1 = t->wpad.ir.y;
|
||||||
|
|
||||||
|
if (position2 == 0 && t->wpad.ir.valid)
|
||||||
|
{
|
||||||
|
position2 = position1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pressedChan == t->chan && (t->wpad.btns_h & WPAD_BUTTON_B) && t->wpad.ir.valid)
|
||||||
|
{
|
||||||
|
if(scrolldelay > 0)
|
||||||
|
--scrolldelay;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
scrolldelay = DEFAULT_SCROLL_DELAY-2;
|
||||||
|
scrollbarBoxBtn->ScrollIsOn(1);
|
||||||
|
if (position2 > position1)
|
||||||
|
{
|
||||||
|
prev = this->FindMenuItem(gameIndex[selectedItem], -1);
|
||||||
|
|
||||||
|
if (prev >= 0)
|
||||||
|
{
|
||||||
|
if (selectedItem == 0)
|
||||||
|
{
|
||||||
|
// move list up by 1
|
||||||
|
listOffset = prev;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
game[selectedItem]->ResetState();
|
||||||
|
game[selectedItem - 1]->SetState(STATE_SELECTED, t->chan);
|
||||||
|
selectedItem--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (position2 < position1)
|
||||||
|
{
|
||||||
|
next = this->FindMenuItem(gameIndex[selectedItem], 1);
|
||||||
|
if (next >= 0)
|
||||||
|
{
|
||||||
|
if (selectedItem == pagesize - 1)
|
||||||
|
{
|
||||||
|
// move list down by 1
|
||||||
|
listOffset = this->FindMenuItem(listOffset, 1);
|
||||||
|
}
|
||||||
|
else if (game[selectedItem + 1]->IsVisible())
|
||||||
|
{
|
||||||
|
game[selectedItem]->ResetState();
|
||||||
|
game[selectedItem + 1]->SetState(STATE_SELECTED, t->chan);
|
||||||
|
selectedItem++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (pressedChan == -1 || (pressedChan == t->chan && !(t->wpad.btns_h & WPAD_BUTTON_B)))
|
||||||
{
|
{
|
||||||
scrollbarBoxBtn->ScrollIsOn(0);
|
scrollbarBoxBtn->ScrollIsOn(0);
|
||||||
position2 = 0;
|
position2 = 0;
|
||||||
@ -600,6 +614,11 @@ void GuiGameBrowser::Update(GuiTrigger * t)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(pressedChan == t->chan && !t->wpad.btns_d && !t->wpad.btns_h)
|
||||||
|
{
|
||||||
|
pressedChan = -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (old_listOffset != listOffset) UpdateListEntries();
|
if (old_listOffset != listOffset) UpdateListEntries();
|
||||||
|
|
||||||
if (updateCB) updateCB(this);
|
if (updateCB) updateCB(this);
|
||||||
|
@ -106,15 +106,17 @@ static void * UpdateGUI(void *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
mainWindow->Draw();
|
mainWindow->Draw();
|
||||||
if (Settings.tooltips == ON && Theme::ShowTooltips && mainWindow->GetState() != STATE_DISABLED) mainWindow->DrawTooltip();
|
if (Settings.tooltips && Theme::ShowTooltips && mainWindow->GetState() != STATE_DISABLED) mainWindow->DrawTooltip();
|
||||||
|
|
||||||
for (i = 3; i >= 0; i--)
|
for (i = 3; i >= 0; i--)
|
||||||
{
|
{
|
||||||
if (userInput[i].wpad.ir.valid)
|
if (userInput[i].wpad.ir.valid)
|
||||||
{
|
{
|
||||||
Menu_DrawImg(userInput[i].wpad.ir.x - 48, userInput[i].wpad.ir.y - 48, 200.0, 96, 96,
|
Menu_DrawImg(userInput[i].wpad.ir.x - pointer[i]->GetWidth()/2,
|
||||||
pointer[i]->GetImage(), userInput[i].wpad.ir.angle, Settings.widescreen ? 0.8 : 1, 1, 255, 0,
|
userInput[i].wpad.ir.y - pointer[i]->GetHeight()/2,
|
||||||
0, 0, 0, 0, 0, 0, 0);
|
9900.0f, pointer[i]->GetWidth(), pointer[i]->GetHeight(),
|
||||||
|
pointer[i]->GetImage(), userInput[i].wpad.ir.angle,
|
||||||
|
Settings.widescreen ? 0.8f : 1.f, 1.f, 255, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +49,6 @@
|
|||||||
#include "xml/WiiTDB.hpp"
|
#include "xml/WiiTDB.hpp"
|
||||||
#include "wad/nandtitle.h"
|
#include "wad/nandtitle.h"
|
||||||
#include "wad/wad.h"
|
#include "wad/wad.h"
|
||||||
#include "buildtype.h"
|
|
||||||
#include "sys.h"
|
#include "sys.h"
|
||||||
#include "svnrev.h"
|
#include "svnrev.h"
|
||||||
|
|
||||||
|
@ -41,7 +41,6 @@
|
|||||||
#include "language/UpdateLanguage.h"
|
#include "language/UpdateLanguage.h"
|
||||||
#include "gecko.h"
|
#include "gecko.h"
|
||||||
#include "lstub.h"
|
#include "lstub.h"
|
||||||
#include "buildtype.h"
|
|
||||||
|
|
||||||
/*** Extern variables ***/
|
/*** Extern variables ***/
|
||||||
s32 gameStart = 0;
|
s32 gameStart = 0;
|
||||||
|
@ -363,7 +363,7 @@ static int InternalShowGameInfo(char *ID)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
boxCov = new BoxCover(cover, loadFlatCover);
|
boxCov = new BoxCover(cover, loadFlatCover);
|
||||||
boxCov->SetPosition(-1.75f, 0.4f, -5.0f);
|
boxCov->SetPosition(-1.6f, 0.4f, -27.0f);
|
||||||
boxCov->SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_IN, 40);
|
boxCov->SetEffect(EFFECT_SLIDE_LEFT | EFFECT_SLIDE_IN, 40);
|
||||||
|
|
||||||
if(GameInfo.CaseColor == 0xFF0000)
|
if(GameInfo.CaseColor == 0xFF0000)
|
||||||
|
@ -91,7 +91,7 @@ void CSettings::SetDefault()
|
|||||||
tooltips = ON;
|
tooltips = ON;
|
||||||
gamesound = ON;
|
gamesound = ON;
|
||||||
parentalcontrol = PARENTAL_LVL_ADULT;
|
parentalcontrol = PARENTAL_LVL_ADULT;
|
||||||
cios = 249;
|
cios = BUILD_IOS;
|
||||||
gridRows = 3;
|
gridRows = 3;
|
||||||
error002 = 2;
|
error002 = 2;
|
||||||
partition = -1;
|
partition = -1;
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
#include "gecko.h"
|
#include "gecko.h"
|
||||||
#include "xml/xml.h"
|
#include "xml/xml.h"
|
||||||
#include "wad/nandtitle.h"
|
#include "wad/nandtitle.h"
|
||||||
#include "buildtype.h"
|
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
|
@ -72,6 +72,10 @@ RecourceFile Resources::RecourceFiles[] =
|
|||||||
{"player2_point.png", player2_point_png, player2_point_png_size, NULL, 0},
|
{"player2_point.png", player2_point_png, player2_point_png_size, NULL, 0},
|
||||||
{"player3_point.png", player3_point_png, player3_point_png_size, NULL, 0},
|
{"player3_point.png", player3_point_png, player3_point_png_size, NULL, 0},
|
||||||
{"player4_point.png", player4_point_png, player4_point_png_size, NULL, 0},
|
{"player4_point.png", player4_point_png, player4_point_png_size, NULL, 0},
|
||||||
|
{"player1_grab.png", player1_grab_png, player1_grab_png_size, NULL, 0},
|
||||||
|
{"player2_grab.png", player2_grab_png, player2_grab_png_size, NULL, 0},
|
||||||
|
{"player3_grab.png", player3_grab_png, player3_grab_png_size, NULL, 0},
|
||||||
|
{"player4_grab.png", player4_grab_png, player4_grab_png_size, NULL, 0},
|
||||||
{"rplayer1_point.png", rplayer1_point_png, rplayer1_point_png_size, NULL, 0},
|
{"rplayer1_point.png", rplayer1_point_png, rplayer1_point_png_size, NULL, 0},
|
||||||
{"rplayer2_point.png", rplayer2_point_png, rplayer2_point_png_size, NULL, 0},
|
{"rplayer2_point.png", rplayer2_point_png, rplayer2_point_png_size, NULL, 0},
|
||||||
{"rplayer3_point.png", rplayer3_point_png, rplayer3_point_png_size, NULL, 0},
|
{"rplayer3_point.png", rplayer3_point_png, rplayer3_point_png_size, NULL, 0},
|
||||||
|
@ -26,19 +26,16 @@ static GXRModeObj *vmode; // Menu video mode
|
|||||||
static unsigned char gp_fifo[DEFAULT_FIFO_SIZE] ATTRIBUTE_ALIGN ( 32 );
|
static unsigned char gp_fifo[DEFAULT_FIFO_SIZE] ATTRIBUTE_ALIGN ( 32 );
|
||||||
static Mtx GXmodelView2D;
|
static Mtx GXmodelView2D;
|
||||||
static Mtx44 projection;
|
static Mtx44 projection;
|
||||||
int screenheight;
|
int screenheight = 480;
|
||||||
int screenwidth;
|
int screenwidth = 640;
|
||||||
u32 frameCount = 0;
|
u32 frameCount = 0;
|
||||||
|
|
||||||
u8 * gameScreenTex = NULL; // a GX texture screen capture of the game
|
|
||||||
u8 * gameScreenTex2 = NULL; // a GX texture screen capture of the game (copy)
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* ResetVideo_Menu
|
* ResetVideo_Menu
|
||||||
*
|
*
|
||||||
* Reset the video/rendering mode for the menu
|
* Reset the video/rendering mode for the menu
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
void ResetVideo_Menu()
|
static void ResetVideo_Menu()
|
||||||
{
|
{
|
||||||
f32 yscale;
|
f32 yscale;
|
||||||
u32 xfbHeight;
|
u32 xfbHeight;
|
||||||
@ -85,15 +82,15 @@ void ResetVideo_Menu()
|
|||||||
|
|
||||||
GX_SetNumChans(1);
|
GX_SetNumChans(1);
|
||||||
GX_SetNumTexGens(1);
|
GX_SetNumTexGens(1);
|
||||||
GX_SetTevOp(GX_TEVSTAGE0, GX_PASSCLR);
|
GX_SetTevOp(GX_TEVSTAGE0, GX_MODULATE);
|
||||||
GX_SetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0);
|
GX_SetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0);
|
||||||
GX_SetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY);
|
GX_SetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY);
|
||||||
|
|
||||||
guMtxIdentity(GXmodelView2D);
|
guMtxIdentity(GXmodelView2D);
|
||||||
guMtxTransApply(GXmodelView2D, GXmodelView2D, 0.0F, 0.0F, -200.0F);
|
guMtxTransApply(GXmodelView2D, GXmodelView2D, 0.0F, 0.0F, -9900.0F);
|
||||||
GX_LoadPosMtxImm(GXmodelView2D, GX_PNMTX0);
|
GX_LoadPosMtxImm(GXmodelView2D, GX_PNMTX0);
|
||||||
|
|
||||||
guOrtho(projection, 0, 479, 0, 639, 0, 300);
|
guOrtho(projection, 0, screenheight-1, 0, screenwidth-1, 0, 10000);
|
||||||
GX_LoadProjectionMtx(projection, GX_ORTHOGRAPHIC);
|
GX_LoadProjectionMtx(projection, GX_ORTHOGRAPHIC);
|
||||||
|
|
||||||
GX_SetViewport(0.0f, 0.0f, vmode->fbWidth, vmode->efbHeight, 0.0f, 1.0f);
|
GX_SetViewport(0.0f, 0.0f, vmode->fbWidth, vmode->efbHeight, 0.0f, 1.0f);
|
||||||
@ -220,7 +217,8 @@ void Menu_DrawImg(f32 xpos, f32 ypos, f32 zpos, f32 width, f32 height, u8 data[]
|
|||||||
GX_LoadTexObj(&texObj, GX_TEXMAP0);
|
GX_LoadTexObj(&texObj, GX_TEXMAP0);
|
||||||
GX_InvalidateTexAll();
|
GX_InvalidateTexAll();
|
||||||
|
|
||||||
GX_SetTevOp(GX_TEVSTAGE0, GX_MODULATE);
|
GX_SetVtxDesc(GX_VA_POS, GX_DIRECT);
|
||||||
|
GX_SetVtxDesc(GX_VA_CLR0, GX_DIRECT);
|
||||||
GX_SetVtxDesc(GX_VA_TEX0, GX_DIRECT);
|
GX_SetVtxDesc(GX_VA_TEX0, GX_DIRECT);
|
||||||
|
|
||||||
Mtx m, m1, m2, mv;
|
Mtx m, m1, m2, mv;
|
||||||
@ -228,18 +226,13 @@ void Menu_DrawImg(f32 xpos, f32 ypos, f32 zpos, f32 width, f32 height, u8 data[]
|
|||||||
height *= 0.5f;
|
height *= 0.5f;
|
||||||
guMtxIdentity(m1);
|
guMtxIdentity(m1);
|
||||||
guMtxScaleApply(m1, m1, scaleX, scaleY, 1.0f);
|
guMtxScaleApply(m1, m1, scaleX, scaleY, 1.0f);
|
||||||
guVector axis = ( guVector )
|
guVector axis = (guVector) {0 , 0, 1};
|
||||||
{
|
guMtxRotAxisDeg (m2, &axis, degrees);
|
||||||
0 , 0, 1
|
|
||||||
};
|
|
||||||
guMtxRotAxisDeg ( m2, &axis, degrees );
|
|
||||||
// guMtxConcat(m2,m1,m);
|
|
||||||
guMtxConcat(m1, m2, m);
|
guMtxConcat(m1, m2, m);
|
||||||
|
|
||||||
guMtxTransApply(m, m, xpos + width + 0.5f, ypos + height + 0.5f, zpos);
|
guMtxTransApply(m, m, xpos + width + 0.5f, ypos + height + 0.5f, zpos);
|
||||||
guMtxConcat(GXmodelView2D, m, mv);
|
guMtxConcat(GXmodelView2D, m, mv);
|
||||||
GX_LoadPosMtxImm(mv, GX_PNMTX0);
|
GX_LoadPosMtxImm(mv, GX_PNMTX0);
|
||||||
//
|
|
||||||
|
|
||||||
GX_Begin(GX_QUADS, GX_VTXFMT0, 4);
|
GX_Begin(GX_QUADS, GX_VTXFMT0, 4);
|
||||||
GX_Position3f32(-width + XX1, -height + YY1, 0);
|
GX_Position3f32(-width + XX1, -height + YY1, 0);
|
||||||
@ -258,13 +251,9 @@ void Menu_DrawImg(f32 xpos, f32 ypos, f32 zpos, f32 width, f32 height, u8 data[]
|
|||||||
GX_Color4u8(0xFF, 0xFF, 0xFF, alpha);
|
GX_Color4u8(0xFF, 0xFF, 0xFF, alpha);
|
||||||
GX_TexCoord2f32(0, 1);
|
GX_TexCoord2f32(0, 1);
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
GX_End();
|
GX_End();
|
||||||
GX_LoadPosMtxImm(GXmodelView2D, GX_PNMTX0);
|
|
||||||
|
|
||||||
GX_SetTevOp(GX_TEVSTAGE0, GX_PASSCLR);
|
GX_LoadPosMtxImm(GXmodelView2D, GX_PNMTX0);
|
||||||
GX_SetVtxDesc(GX_VA_TEX0, GX_NONE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -274,7 +263,11 @@ void Menu_DrawImg(f32 xpos, f32 ypos, f32 zpos, f32 width, f32 height, u8 data[]
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
void Menu_DrawRectangle(f32 x, f32 y, f32 width, f32 height, GXColor color, u8 filled)
|
void Menu_DrawRectangle(f32 x, f32 y, f32 width, f32 height, GXColor color, u8 filled)
|
||||||
{
|
{
|
||||||
|
GX_SetTevOp(GX_TEVSTAGE0, GX_PASSCLR);
|
||||||
GX_LoadProjectionMtx(projection, GX_ORTHOGRAPHIC);
|
GX_LoadProjectionMtx(projection, GX_ORTHOGRAPHIC);
|
||||||
|
GX_SetVtxDesc(GX_VA_POS, GX_DIRECT);
|
||||||
|
GX_SetVtxDesc(GX_VA_CLR0, GX_DIRECT);
|
||||||
|
GX_SetVtxDesc(GX_VA_TEX0, GX_NONE);
|
||||||
|
|
||||||
u8 fmt;
|
u8 fmt;
|
||||||
long n;
|
long n;
|
||||||
@ -301,6 +294,7 @@ void Menu_DrawRectangle(f32 x, f32 y, f32 width, f32 height, GXColor color, u8 f
|
|||||||
GX_Color4u8(color.r, color.g, color.b, color.a);
|
GX_Color4u8(color.r, color.g, color.b, color.a);
|
||||||
}
|
}
|
||||||
GX_End();
|
GX_End();
|
||||||
|
GX_SetTevOp(GX_TEVSTAGE0, GX_MODULATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Menu_DrawDiskCover(f32 xpos, f32 ypos, f32 zpos, u16 width, u16 height, u16 distance, u8 data[], f32 deg_alpha,
|
void Menu_DrawDiskCover(f32 xpos, f32 ypos, f32 zpos, u16 width, u16 height, u16 distance, u8 data[], f32 deg_alpha,
|
||||||
@ -316,7 +310,8 @@ void Menu_DrawDiskCover(f32 xpos, f32 ypos, f32 zpos, u16 width, u16 height, u16
|
|||||||
GX_LoadTexObj(&texObj, GX_TEXMAP0);
|
GX_LoadTexObj(&texObj, GX_TEXMAP0);
|
||||||
GX_InvalidateTexAll();
|
GX_InvalidateTexAll();
|
||||||
|
|
||||||
GX_SetTevOp(GX_TEVSTAGE0, GX_MODULATE);
|
GX_SetVtxDesc(GX_VA_POS, GX_DIRECT);
|
||||||
|
GX_SetVtxDesc(GX_VA_CLR0, GX_DIRECT);
|
||||||
GX_SetVtxDesc(GX_VA_TEX0, GX_DIRECT);
|
GX_SetVtxDesc(GX_VA_TEX0, GX_DIRECT);
|
||||||
|
|
||||||
f32 cos_beta = cos(DegToRad( deg_beta ));
|
f32 cos_beta = cos(DegToRad( deg_beta ));
|
||||||
@ -332,17 +327,10 @@ void Menu_DrawDiskCover(f32 xpos, f32 ypos, f32 zpos, u16 width, u16 height, u16
|
|||||||
|
|
||||||
guMtxIdentity(m1);
|
guMtxIdentity(m1);
|
||||||
guMtxScaleApply(m1, m1, scaleX, scaleY, 1.0);
|
guMtxScaleApply(m1, m1, scaleX, scaleY, 1.0);
|
||||||
guVector axis2 = ( guVector )
|
guVector axis2 = (guVector) {0 , 1, 0};
|
||||||
{
|
|
||||||
0 , 1, 0
|
|
||||||
};
|
|
||||||
guMtxRotAxisDeg ( m2, &axis2, deg_beta );
|
guMtxRotAxisDeg ( m2, &axis2, deg_beta );
|
||||||
guVector axis = ( guVector )
|
guVector axis = (guVector) {0 , 0, 1};
|
||||||
{
|
|
||||||
0 , 0, 1
|
|
||||||
};
|
|
||||||
guMtxRotAxisDeg ( m3, &axis, deg_alpha );
|
guMtxRotAxisDeg ( m3, &axis, deg_alpha );
|
||||||
// guMtxConcat(m2,m1,m);
|
|
||||||
guMtxConcat(m3, m4, m3); // move distance then rotate z-axis
|
guMtxConcat(m3, m4, m3); // move distance then rotate z-axis
|
||||||
guMtxConcat(m2, m3, m2); // rotate y-axis
|
guMtxConcat(m2, m3, m2); // rotate y-axis
|
||||||
guMtxConcat(m1, m2, m); // scale
|
guMtxConcat(m1, m2, m); // scale
|
||||||
@ -355,9 +343,9 @@ void Menu_DrawDiskCover(f32 xpos, f32 ypos, f32 zpos, u16 width, u16 height, u16
|
|||||||
guMtxConcat(GXmodelView2D, m, mv);
|
guMtxConcat(GXmodelView2D, m, mv);
|
||||||
GX_LoadPosMtxImm(mv, GX_PNMTX0);
|
GX_LoadPosMtxImm(mv, GX_PNMTX0);
|
||||||
|
|
||||||
|
GX_Begin(GX_QUADS, GX_VTXFMT0, 4);
|
||||||
if (shadow)
|
if (shadow)
|
||||||
{
|
{
|
||||||
GX_Begin(GX_QUADS, GX_VTXFMT0, 4);
|
|
||||||
GX_Position3f32(-width, -height, 0);
|
GX_Position3f32(-width, -height, 0);
|
||||||
GX_Color4u8(0, 0, 0, alpha);
|
GX_Color4u8(0, 0, 0, alpha);
|
||||||
GX_TexCoord2f32(0, 0);
|
GX_TexCoord2f32(0, 0);
|
||||||
@ -376,7 +364,6 @@ void Menu_DrawDiskCover(f32 xpos, f32 ypos, f32 zpos, u16 width, u16 height, u16
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GX_Begin(GX_QUADS, GX_VTXFMT0, 4);
|
|
||||||
GX_Position3f32(-width, -height, 0);
|
GX_Position3f32(-width, -height, 0);
|
||||||
GX_Color4u8(0xFF, 0xFF, 0xFF, alpha);
|
GX_Color4u8(0xFF, 0xFF, 0xFF, alpha);
|
||||||
GX_TexCoord2f32(0, 0);
|
GX_TexCoord2f32(0, 0);
|
||||||
@ -396,9 +383,6 @@ void Menu_DrawDiskCover(f32 xpos, f32 ypos, f32 zpos, u16 width, u16 height, u16
|
|||||||
|
|
||||||
GX_End();
|
GX_End();
|
||||||
GX_LoadPosMtxImm(GXmodelView2D, GX_PNMTX0);
|
GX_LoadPosMtxImm(GXmodelView2D, GX_PNMTX0);
|
||||||
|
|
||||||
GX_SetTevOp(GX_TEVSTAGE0, GX_PASSCLR);
|
|
||||||
GX_SetVtxDesc(GX_VA_TEX0, GX_NONE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Menu_DrawTPLImg(f32 xpos, f32 ypos, f32 zpos, f32 width, f32 height, GXTexObj *texObj, f32 degrees, f32 scaleX,
|
void Menu_DrawTPLImg(f32 xpos, f32 ypos, f32 zpos, f32 width, f32 height, GXTexObj *texObj, f32 degrees, f32 scaleX,
|
||||||
@ -409,7 +393,8 @@ void Menu_DrawTPLImg(f32 xpos, f32 ypos, f32 zpos, f32 width, f32 height, GXTexO
|
|||||||
GX_LoadTexObj(texObj, GX_TEXMAP0);
|
GX_LoadTexObj(texObj, GX_TEXMAP0);
|
||||||
GX_InvalidateTexAll();
|
GX_InvalidateTexAll();
|
||||||
|
|
||||||
GX_SetTevOp(GX_TEVSTAGE0, GX_REPLACE);
|
GX_SetVtxDesc(GX_VA_POS, GX_DIRECT);
|
||||||
|
GX_SetVtxDesc(GX_VA_CLR0, GX_DIRECT);
|
||||||
GX_SetVtxDesc(GX_VA_TEX0, GX_DIRECT);
|
GX_SetVtxDesc(GX_VA_TEX0, GX_DIRECT);
|
||||||
|
|
||||||
Mtx m, m1, m2, mv;
|
Mtx m, m1, m2, mv;
|
||||||
@ -417,10 +402,7 @@ void Menu_DrawTPLImg(f32 xpos, f32 ypos, f32 zpos, f32 width, f32 height, GXTexO
|
|||||||
height *= .5;
|
height *= .5;
|
||||||
guMtxIdentity(m1);
|
guMtxIdentity(m1);
|
||||||
guMtxScaleApply(m1, m1, scaleX, scaleY, 1.0);
|
guMtxScaleApply(m1, m1, scaleX, scaleY, 1.0);
|
||||||
guVector axis = ( guVector )
|
guVector axis = (guVector) {0 , 0, 1};
|
||||||
{
|
|
||||||
0 , 0, 1
|
|
||||||
};
|
|
||||||
guMtxRotAxisDeg ( m2, &axis, degrees );
|
guMtxRotAxisDeg ( m2, &axis, degrees );
|
||||||
guMtxConcat(m1, m2, m);
|
guMtxConcat(m1, m2, m);
|
||||||
|
|
||||||
@ -446,10 +428,8 @@ void Menu_DrawTPLImg(f32 xpos, f32 ypos, f32 zpos, f32 width, f32 height, GXTexO
|
|||||||
GX_TexCoord2f32(0, 1);
|
GX_TexCoord2f32(0, 1);
|
||||||
|
|
||||||
GX_End();
|
GX_End();
|
||||||
GX_LoadPosMtxImm(GXmodelView2D, GX_PNMTX0);
|
|
||||||
|
|
||||||
GX_SetTevOp(GX_TEVSTAGE0, GX_PASSCLR);
|
GX_LoadPosMtxImm(GXmodelView2D, GX_PNMTX0);
|
||||||
GX_SetVtxDesc(GX_VA_TEX0, GX_NONE);
|
|
||||||
}
|
}
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* TakeScreenshot
|
* TakeScreenshot
|
||||||
|
@ -12,9 +12,7 @@
|
|||||||
#include <ogcsys.h>
|
#include <ogcsys.h>
|
||||||
|
|
||||||
void InitVideo();
|
void InitVideo();
|
||||||
void InitVideodebug();
|
|
||||||
void StopGX();
|
void StopGX();
|
||||||
void ResetVideo_Menu();
|
|
||||||
void Menu_Render();
|
void Menu_Render();
|
||||||
void Menu_DrawImg(f32 xpos, f32 ypos, f32 zpos, f32 width, f32 height, u8 data[], f32 degrees, f32 scaleX, f32 scaleY,
|
void Menu_DrawImg(f32 xpos, f32 ypos, f32 zpos, f32 width, f32 height, u8 data[], f32 degrees, f32 scaleX, f32 scaleY,
|
||||||
u8 alphaF, int XX1, int YY1, int XX2, int YY2, int XX3, int YY3, int XX4, int YY4);
|
u8 alphaF, int XX1, int YY1, int XX2, int YY2, int XX3, int YY3, int XX4, int YY4);
|
||||||
|
Loading…
Reference in New Issue
Block a user