-added id6 support for thp files

-updated wiiflow to the latest devkitppc and latest libogc
This commit is contained in:
fix94.1 2014-05-25 20:54:39 +00:00
parent dbb9266eaf
commit ca8bec90d1
13 changed files with 88 additions and 47 deletions

View File

@ -113,17 +113,17 @@ GXRModeObj TVPal528ProgUnknown =
};
GXRModeObj TVMpal480Prog =
GXRModeObj TVPal574IntDfScale =
{
10, // viDisplayMode
VI_TVMODE_PAL_INT, // viDisplayMode
640, // fbWidth
480, // efbHeight
480, // xfbHeight
(VI_MAX_WIDTH_NTSC - 640)/2, // viXOrigin
(VI_MAX_HEIGHT_NTSC - 480)/2, // viYOrigin
574, // xfbHeight
(VI_MAX_WIDTH_PAL - 640)/2, // viXOrigin
(VI_MAX_HEIGHT_PAL - 574)/2, // viYOrigin
640, // viWidth
480, // viHeight
VI_XFBMODE_SF, // xFBmode
574, // viHeight
VI_XFBMODE_DF, // xFBmode
GX_FALSE, // field_rendering
GX_FALSE, // aa
@ -134,16 +134,15 @@ GXRModeObj TVMpal480Prog =
{6,6},{6,6},{6,6}, // pix 2
{6,6},{6,6},{6,6} // pix 3
},
// vertical filter[7], 1/64 units, 6 bits each
{
0, // line n-1
0, // line n-1
21, // line n
22, // line n
21, // line n
0, // line n+1
0 // line n+1
8, // line n-1
8, // line n-1
10, // line n
12, // line n
10, // line n
8, // line n+1
8 // line n+1
}
};

View File

@ -46,15 +46,15 @@ typedef struct
} Vec3f;
#define ALIGN32(x) (((x) + 31) & ~31)
#define LIMIT(x, min, max) \
({ \
typeof( x ) _x = x; \
typeof( min ) _min = min; \
typeof( max ) _max = max; \
( ( ( _x ) < ( _min ) ) ? ( _min ) : ( ( _x ) > ( _max ) ) ? ( _max) : ( _x ) ); \
})
static inline u8 LIMIT(u8 x, u8 min, u8 max)
{
return ( ( ( x ) < ( min ) ) ? ( min ) : ( ( x ) > ( max ) ) ? ( max) : ( x ) );
}
#define MultiplyAlpha(a1, a2) ((u16) (a1) * (u16) (a2) / 0xFF)
static inline u8 MultiplyAlpha(u16 a1, u16 a2)
{
return a1 * a2 / 0xFF;
}
#define FLOAT_2_U8(x) ((u8)((x) > 255.0f ? 255.0f : ((x) < 0.0f ? 0.0f : (x) + 0.5f)))
#define FLOAT_2_S16(x) ((s16)((x) > 32767.0f ? 32767.0f : ((x) < -32768.0f ? 32768.0f : (x) + 0.5f)))

View File

@ -43,7 +43,7 @@ void BannerWindow::Init(u8 *font1, u8 *font2)
AnimPosX = 0.5f * (ScreenProps.x - fIconWidth);
AnimPosY = 0.5f * (ScreenProps.y - fIconHeight);
AnimationRunning = false;
Brightness = 0.f;
Brightness = 0;
// this just looks better for banner/icon ratio
xDiff = 0.5f * (m_vid.wide() ? (m_vid.vid_50hz() ? 616 : 620.0f) : 608.0f);
@ -161,7 +161,7 @@ void BannerWindow::Draw(void)
// draw a black background image first
if(AnimStep >= MaxAnimSteps)
DrawRectangle(0.0f, 0.0f, m_vid.width(), m_vid.height(), (GXColor) {0, 0, 0, 255.f});
DrawRectangle(0.0f, 0.0f, m_vid.width(), m_vid.height(), (GXColor) {0, 0, 0, 0xFF});
if(changing)
return;
@ -216,14 +216,14 @@ void BannerWindow::Draw(void)
m_vid.setup2DProjection();
// If wanted
if(Brightness > 1.f)
if(Brightness == 200)
DrawRectangle(0.0f, 0.0f, m_vid.width(), m_vid.height(), (GXColor) {0, 0, 0, Brightness});
}
void BannerWindow::ToogleGameSettings()
{
ToogleZoom();
Brightness = (Brightness > 1.f ? 0.f : 200.f);
Brightness = (Brightness == 200 ? 0 : 200);
}
void BannerWindow::ReSetup_GX(void)

View File

@ -51,7 +51,7 @@ public:
void LoadBannerBin(u8 *bnr, u32 bnr_size, u8 *font1, u8 *font2);
int GetSelectedGame() { return gameSelected; }
bool GetZoomSetting() { return AnimZoom; }
bool GetInGameSettings() { return (Brightness > 1.f ? true : false); }
bool GetInGameSettings() { return (Brightness == 200 ? true : false); }
void CreateGCBanner(u8 *bnr, u8 *font1, u8 *font2, const wchar_t *title);
void Draw(void);
bool ToogleZoom(void);
@ -73,7 +73,7 @@ protected:
bool reducedVol;
int returnVal;
int gameSelected;
float Brightness;
u8 Brightness;
int MaxAnimSteps;
int AnimStep;

View File

@ -44,6 +44,7 @@ public:
} ATTRIBUTE_PACKED;
Material();
virtual ~Material() { };
void Load(Material::Header *mat);
void Apply(const BannerResources& resources, u8 render_alpha, bool modulate) const;

View File

@ -105,13 +105,13 @@ ftgxCharData *FreeTypeGX::cacheGlyphData(wchar_t charCode)
this->fontData[charCode] = (ftgxCharData)
{
this->ftSlot->advance.x >> 6,
gIndex,
(u16)(this->ftSlot->advance.x >> 6),
(u16)(gIndex),
textureWidth,
textureHeight,
this->ftSlot->bitmap_top,
this->ftSlot->bitmap_top,
textureHeight - this->ftSlot->bitmap_top,
(u16)(this->ftSlot->bitmap_top),
(u16)(this->ftSlot->bitmap_top),
(u16)(textureHeight - this->ftSlot->bitmap_top),
NULL
};
this->loadGlyphData(glyphBitmap, &this->fontData[charCode]);
@ -144,7 +144,7 @@ void FreeTypeGX::loadGlyphData(FT_Bitmap *bmp, ftgxCharData *charData)
int glyphSize = (charData->textureWidth * charData->textureHeight) >> 1;
uint8_t *glyphData = (uint8_t *) MEM2_alloc(glyphSize);
if(glyphData < 0)
if(glyphData == NULL)
return;
memset(glyphData, 0x00, glyphSize);

View File

@ -79,6 +79,39 @@ const float CVideo::_jitter8[8][2] = {
{ 0.164216f, -0.054399f }
};
GXRModeObj TVPal574IntDfScale =
{
VI_TVMODE_PAL_INT, // viDisplayMode
640, // fbWidth
480, // efbHeight
574, // xfbHeight
(VI_MAX_WIDTH_PAL - 640)/2, // viXOrigin
(VI_MAX_HEIGHT_PAL - 574)/2, // viYOrigin
640, // viWidth
574, // viHeight
VI_XFBMODE_DF, // xFBmode
GX_FALSE, // field_rendering
GX_FALSE, // aa
// sample points arranged in increasing Y order
{
{6,6},{6,6},{6,6}, // pix 0, 3 sample points, 1/12 units, 4 bits each
{6,6},{6,6},{6,6}, // pix 1
{6,6},{6,6},{6,6}, // pix 2
{6,6},{6,6},{6,6} // pix 3
},
// vertical filter[7], 1/64 units, 6 bits each
{
8, // line n-1
8, // line n-1
10, // line n
12, // line n
10, // line n
8, // line n+1
8 // line n+1
}
};
struct movieP normalMoviePos = { 410, 31, 610, 181 };
struct movieP zoomedMoviePos = { 0, 0, 640, 480 };
struct movieP currentMoviePos = normalMoviePos;

View File

@ -303,7 +303,7 @@ void CMenu::init()
m_helpDir = m_cfg.getString("GENERAL", "dir_help", fmt("%s/help", m_dataDir.c_str()));
/* Cache Reload Checks */
u32 ini_rev = m_cfg.getInt("GENERAL", "ini_rev", 0);
int ini_rev = m_cfg.getInt("GENERAL", "ini_rev", 0);
if(ini_rev != SVN_REV_NUM)
fsop_deleteFolder(m_listCacheDir.c_str());
m_cfg.setInt("GENERAL", "ini_rev", SVN_REV_NUM);

View File

@ -1192,7 +1192,7 @@ private:
static int _version[9];
static const SCFParamDesc _cfParams[];
static const int _nbCfgPages;
static const u32 SVN_REV_NUM;
static const int SVN_REV_NUM;
//thread stack
static u8 downloadStack[8192];
static const u32 downloadStackSize;

View File

@ -398,11 +398,19 @@ bool CMenu::_startVideo()
}
const char *videoPath = getVideoPath(m_videoDir, videoId);
const char *THP_Path = fmt("%s.thp", videoPath);
if(!fsop_FileExist(THP_Path) && m_current_view == COVERFLOW_PLUGIN)
if(!fsop_FileExist(THP_Path))
{
if(m_current_view == COVERFLOW_PLUGIN)
{
videoPath = getVideoDefaultPath(m_videoDir);
THP_Path = fmt("%s.thp", videoPath);
}
else if(!NoGameID(CoverFlow.getHdr()->type))
{
videoPath = getVideoPath(m_videoDir, CoverFlow.getId());
THP_Path = fmt("%s.thp", videoPath);
}
}
if(fsop_FileExist(THP_Path))
{
m_gameSound.FreeMemory();

View File

@ -5,7 +5,7 @@
#include "loader/wbfs.h"
int version_num = 0, num_versions = 0, i;
const u32 CMenu::SVN_REV_NUM = atoi(SVN_REV);
const int CMenu::SVN_REV_NUM = atoi(SVN_REV);
int CMenu::_version[9] = {0, SVN_REV_NUM, SVN_REV_NUM, SVN_REV_NUM, SVN_REV_NUM, SVN_REV_NUM, SVN_REV_NUM, SVN_REV_NUM, SVN_REV_NUM};
const int pixels_to_skip = 10;

View File

@ -50,7 +50,7 @@ public:
SoundDecoder();
SoundDecoder(const char * filepath);
SoundDecoder(const u8 * buffer, int size);
~SoundDecoder();
virtual ~SoundDecoder();
virtual int Read(u8 * buffer, int buffer_size, int pos);
virtual int Tell() { return CurPos; };
virtual int Seek(int pos) { CurPos = pos; return file_fd->seek(CurPos, SEEK_SET); };

View File

@ -45,7 +45,7 @@ void add_game_to_card(const char *gameid)
int i;
char *url = (char *)MEM2_alloc(MAX_URL_SIZE); // Too much memory, but only like 10 bytes
memset(url, 0, sizeof(url));
memset(url, 0, MAX_URL_SIZE);
for(i = 0; i < amount_of_providers && providers != NULL; i++)
{