-added new boxmesh for homebrew view that the icons

are not stretched anymore (I added it for a very special
person and I know that this person will read this log)
This commit is contained in:
fix94.1 2012-03-14 20:00:01 +00:00
parent 99f3e035c4
commit 36f75ca434
4 changed files with 360 additions and 58 deletions

View File

@ -126,7 +126,7 @@ const SMeshVert g_boxMeshT[] = { // Triangles
#undef h
#undef w
const SMeshVert g_flatCoverMesh[] ATTRIBUTE_ALIGN(32) = {
const SMeshVert g_flatCoverMesh[] = {
{ { g_coverBL.x, g_coverBL.y, g_coverBL.z }, CTexCoord(0.f, 1.f) },
{ { g_coverTR.x, g_coverBL.y, g_coverBL.z }, CTexCoord(1.f, 1.f) },
{ { g_coverTR.x, g_coverTR.y, g_coverBL.z }, CTexCoord(1.f, 0.f) },

186
source/gui/boxmesh_hb.cpp Normal file
View File

@ -0,0 +1,186 @@
#include "boxmesh_hb.hpp"
// Quick and dirty hardcoded DVD box mesh
static const guVector g_coverBL_HB = { -0.65f, -0.315f, 0.f };
static const guVector g_coverTR_HB = { 0.65f, 0.315f, 0.f };
static const float g_boxCoverY_HB = 0.1f;
static const float g_boxBorderWidth_HB = 0.025f;
static const guVector g_frontCoverBL_HB = { g_coverBL_HB.x, g_coverBL_HB.y + g_boxCoverY_HB, g_coverBL_HB.z };
static const guVector g_frontCoverTR_HB = { g_coverTR_HB.x, g_coverTR_HB.y + g_boxCoverY_HB, g_coverTR_HB.z };
static const guVector g_backCoverBL_HB = { g_frontCoverBL_HB.x, g_frontCoverBL_HB.y, g_frontCoverBL_HB.z - 0.16f };
static const guVector g_backCoverTR_HB = { g_frontCoverTR_HB.x, g_frontCoverTR_HB.y, g_frontCoverTR_HB.z - 0.16f };
const float g_boxCoverY_HBCenter_HB = (g_frontCoverTR_HB.y - g_frontCoverBL_HB.y) * 0.5f;
const float g_coverYCenter_HB = (g_coverTR_HB.y - g_coverBL_HB.y) * 0.5f;
const Vector3D g_boxSize_HB(
g_coverTR_HB.x - g_coverBL_HB.x + 2 * g_boxBorderWidth_HB,
g_coverTR_HB.y - g_coverBL_HB.y + 2 * g_boxBorderWidth_HB,
g_coverTR_HB.z - g_coverBL_HB.z + 2 * g_boxBorderWidth_HB);
#define w(x) ((float)x / 64.0f)
#define h(y) ((float)y / 256.0f)
const SMeshVert g_boxMeshQ_HB[] = { // Quads
// Bordure du bas devant
{ { g_frontCoverBL_HB.x, g_frontCoverBL_HB.y, g_frontCoverBL_HB.z }, CTexCoord(w(0), h(256)) },
{ { g_frontCoverBL_HB.x, g_frontCoverBL_HB.y - g_boxBorderWidth_HB, g_frontCoverBL_HB.z - g_boxBorderWidth_HB }, CTexCoord(w(10), h(256)) },
{ { g_frontCoverTR_HB.x, g_frontCoverBL_HB.y - g_boxBorderWidth_HB, g_frontCoverBL_HB.z - g_boxBorderWidth_HB }, CTexCoord(w(10), h(224)) },
{ { g_frontCoverTR_HB.x, g_frontCoverBL_HB.y, g_frontCoverBL_HB.z }, CTexCoord(w(0), h(224)) },
// Bordure du haut devant
{ { g_frontCoverBL_HB.x, g_frontCoverTR_HB.y + g_boxBorderWidth_HB, g_frontCoverBL_HB.z - g_boxBorderWidth_HB }, CTexCoord(w(10), h(0)) },
{ { g_frontCoverBL_HB.x, g_frontCoverTR_HB.y, g_frontCoverBL_HB.z }, CTexCoord(w(0), h(0)) },
{ { g_frontCoverTR_HB.x, g_frontCoverTR_HB.y, g_frontCoverBL_HB.z }, CTexCoord(w(0), h(32)) },
{ { g_frontCoverTR_HB.x, g_frontCoverTR_HB.y + g_boxBorderWidth_HB, g_frontCoverBL_HB.z - g_boxBorderWidth_HB }, CTexCoord(w(10), h(32)) },
// Bordure du bas derrière
{ { g_backCoverBL_HB.x, g_backCoverBL_HB.y - g_boxBorderWidth_HB, g_backCoverBL_HB.z + g_boxBorderWidth_HB }, CTexCoord(w(54), h(256)) },
{ { g_backCoverBL_HB.x, g_backCoverBL_HB.y, g_backCoverBL_HB.z }, CTexCoord(w(64), h(256)) },
{ { g_backCoverTR_HB.x, g_backCoverBL_HB.y, g_backCoverBL_HB.z }, CTexCoord(w(64), h(224)) },
{ { g_backCoverTR_HB.x, g_backCoverBL_HB.y - g_boxBorderWidth_HB, g_backCoverBL_HB.z + g_boxBorderWidth_HB }, CTexCoord(w(54), h(224)) },
// Bordure du haut derrière
{ { g_backCoverBL_HB.x, g_backCoverTR_HB.y, g_backCoverBL_HB.z }, CTexCoord(w(64), h(0)) },
{ { g_backCoverBL_HB.x, g_backCoverTR_HB.y + g_boxBorderWidth_HB, g_backCoverBL_HB.z + g_boxBorderWidth_HB }, CTexCoord(w(54), h(0)) },
{ { g_backCoverTR_HB.x, g_backCoverTR_HB.y + g_boxBorderWidth_HB, g_backCoverBL_HB.z + g_boxBorderWidth_HB }, CTexCoord(w(54), h(32)) },
{ { g_backCoverTR_HB.x, g_backCoverTR_HB.y, g_backCoverBL_HB.z }, CTexCoord(w(64), h(32)) },
// Bordure de droite devant
{ { g_frontCoverTR_HB.x, g_frontCoverBL_HB.y, g_frontCoverBL_HB.z }, CTexCoord(w(0), h(256)) },
{ { g_frontCoverTR_HB.x + g_boxBorderWidth_HB, g_frontCoverBL_HB.y, g_frontCoverBL_HB.z - g_boxBorderWidth_HB }, CTexCoord(w(10), h(256)) },
{ { g_frontCoverTR_HB.x + g_boxBorderWidth_HB, g_frontCoverTR_HB.y, g_frontCoverBL_HB.z - g_boxBorderWidth_HB }, CTexCoord(w(10), h(0)) },
{ { g_frontCoverTR_HB.x, g_frontCoverTR_HB.y, g_frontCoverBL_HB.z }, CTexCoord(w(0), h(0)) },
// Bordure de droite derrière
{ { g_backCoverTR_HB.x + g_boxBorderWidth_HB, g_backCoverBL_HB.y, g_backCoverBL_HB.z + g_boxBorderWidth_HB }, CTexCoord(w(54), h(256)) },
{ { g_backCoverTR_HB.x, g_backCoverBL_HB.y, g_backCoverBL_HB.z }, CTexCoord(w(64), h(256)) },
{ { g_backCoverTR_HB.x, g_backCoverTR_HB.y, g_backCoverBL_HB.z }, CTexCoord(w(64), h(0)) },
{ { g_backCoverTR_HB.x + g_boxBorderWidth_HB, g_backCoverTR_HB.y, g_backCoverBL_HB.z + g_boxBorderWidth_HB }, CTexCoord(w(54), h(0)) },
// Face du haut
{ { g_frontCoverBL_HB.x, g_frontCoverTR_HB.y + g_boxBorderWidth_HB, g_frontCoverBL_HB.z - g_boxBorderWidth_HB }, CTexCoord(w(10), h(0)) },
{ { g_frontCoverTR_HB.x, g_frontCoverTR_HB.y + g_boxBorderWidth_HB, g_frontCoverBL_HB.z - g_boxBorderWidth_HB }, CTexCoord(w(10), h(32)) },
{ { g_backCoverTR_HB.x, g_backCoverTR_HB.y + g_boxBorderWidth_HB, g_backCoverBL_HB.z + g_boxBorderWidth_HB }, CTexCoord(w(54), h(32)) },
{ { g_backCoverBL_HB.x, g_backCoverTR_HB.y + g_boxBorderWidth_HB, g_backCoverBL_HB.z + g_boxBorderWidth_HB }, CTexCoord(w(54), h(0)) },
// Angle face du haut / face de droite
{ { g_frontCoverTR_HB.x, g_frontCoverTR_HB.y + g_boxBorderWidth_HB, g_frontCoverBL_HB.z - g_boxBorderWidth_HB }, CTexCoord(w(10), h(32)) },
{ { g_frontCoverTR_HB.x + g_boxBorderWidth_HB, g_frontCoverTR_HB.y, g_frontCoverBL_HB.z - g_boxBorderWidth_HB }, CTexCoord(w(10), h(0)) },
{ { g_backCoverTR_HB.x + g_boxBorderWidth_HB, g_backCoverTR_HB.y, g_backCoverBL_HB.z + g_boxBorderWidth_HB }, CTexCoord(w(54), h(0)) },
{ { g_backCoverTR_HB.x, g_backCoverTR_HB.y + g_boxBorderWidth_HB, g_backCoverBL_HB.z + g_boxBorderWidth_HB }, CTexCoord(w(54), h(32)) },
// Face de droite
{ { g_frontCoverTR_HB.x + g_boxBorderWidth_HB, g_frontCoverTR_HB.y, g_frontCoverBL_HB.z - g_boxBorderWidth_HB }, CTexCoord(w(10), h(0)) },
{ { g_frontCoverTR_HB.x + g_boxBorderWidth_HB, g_frontCoverBL_HB.y, g_frontCoverBL_HB.z - g_boxBorderWidth_HB }, CTexCoord(w(10), h(256)) },
{ { g_backCoverTR_HB.x + g_boxBorderWidth_HB, g_backCoverBL_HB.y, g_backCoverBL_HB.z + g_boxBorderWidth_HB }, CTexCoord(w(54), h(256)) },
{ { g_backCoverTR_HB.x + g_boxBorderWidth_HB, g_backCoverTR_HB.y, g_backCoverBL_HB.z + g_boxBorderWidth_HB }, CTexCoord(w(54), h(0)) },
// Angle face de droite / face du bas
{ { g_frontCoverTR_HB.x + g_boxBorderWidth_HB, g_frontCoverBL_HB.y, g_frontCoverBL_HB.z - g_boxBorderWidth_HB }, CTexCoord(w(10), h(256)) },
{ { g_frontCoverTR_HB.x, g_frontCoverBL_HB.y - g_boxBorderWidth_HB, g_frontCoverBL_HB.z - g_boxBorderWidth_HB }, CTexCoord(w(10), h(224)) },
{ { g_backCoverTR_HB.x, g_backCoverBL_HB.y - g_boxBorderWidth_HB, g_backCoverBL_HB.z + g_boxBorderWidth_HB }, CTexCoord(w(54), h(224)) },
{ { g_backCoverTR_HB.x + g_boxBorderWidth_HB, g_backCoverBL_HB.y, g_backCoverBL_HB.z + g_boxBorderWidth_HB }, CTexCoord(w(54), h(256)) },
// Face du bas
{ { g_frontCoverTR_HB.x, g_frontCoverBL_HB.y - g_boxBorderWidth_HB, g_frontCoverBL_HB.z - g_boxBorderWidth_HB }, CTexCoord(w(10), h(224)) },
{ { g_frontCoverBL_HB.x, g_frontCoverBL_HB.y - g_boxBorderWidth_HB, g_frontCoverBL_HB.z - g_boxBorderWidth_HB }, CTexCoord(w(10), h(256)) },
{ { g_backCoverBL_HB.x, g_backCoverBL_HB.y - g_boxBorderWidth_HB, g_backCoverBL_HB.z + g_boxBorderWidth_HB }, CTexCoord(w(54), h(256)) },
{ { g_backCoverTR_HB.x, g_backCoverBL_HB.y - g_boxBorderWidth_HB, g_backCoverBL_HB.z + g_boxBorderWidth_HB }, CTexCoord(w(54), h(224)) },
// Face de gauche en haut
{ { g_frontCoverBL_HB.x, g_frontCoverTR_HB.y, g_frontCoverBL_HB.z }, CTexCoord(w(0), h(0)) },
{ { g_frontCoverBL_HB.x, g_frontCoverTR_HB.y + g_boxBorderWidth_HB, g_frontCoverBL_HB.z - g_boxBorderWidth_HB }, CTexCoord(w(0), h(0)) },
{ { g_backCoverBL_HB.x, g_backCoverTR_HB.y + g_boxBorderWidth_HB, g_backCoverBL_HB.z + g_boxBorderWidth_HB }, CTexCoord(w(0), h(0)) },
{ { g_backCoverBL_HB.x, g_backCoverTR_HB.y, g_backCoverBL_HB.z}, CTexCoord(w(0), h(0)) },
// Face de gauche en bas
{ { g_frontCoverBL_HB.x, g_frontCoverBL_HB.y - g_boxBorderWidth_HB, g_frontCoverBL_HB.z - g_boxBorderWidth_HB }, CTexCoord(w(0), h(0)) },
{ { g_frontCoverBL_HB.x, g_frontCoverBL_HB.y, g_frontCoverBL_HB.z }, CTexCoord(w(0), h(0)) },
{ { g_backCoverBL_HB.x, g_backCoverBL_HB.y, g_backCoverBL_HB.z }, CTexCoord(w(0), h(0)) },
{ { g_backCoverBL_HB.x, g_backCoverBL_HB.y - g_boxBorderWidth_HB, g_backCoverBL_HB.z + g_boxBorderWidth_HB }, CTexCoord(w(0), h(0)) }
};
const SMeshVert g_boxMeshT_HB[] = { // Triangles
// Haut devant
{ { g_frontCoverTR_HB.x, g_frontCoverTR_HB.y, g_frontCoverBL_HB.z }, CTexCoord(w(0), h(16)) },
{ { g_frontCoverTR_HB.x + g_boxBorderWidth_HB, g_frontCoverTR_HB.y, g_frontCoverBL_HB.z - g_boxBorderWidth_HB }, CTexCoord(w(10), h(0)) },
{ { g_frontCoverTR_HB.x, g_frontCoverTR_HB.y + g_boxBorderWidth_HB, g_frontCoverBL_HB.z - g_boxBorderWidth_HB }, CTexCoord(w(10), h(32)) },
// Haut derrière
{ { g_backCoverTR_HB.x, g_backCoverTR_HB.y, g_backCoverBL_HB.z }, CTexCoord(w(64), h(16)) },
{ { g_backCoverTR_HB.x, g_backCoverTR_HB.y + g_boxBorderWidth_HB, g_backCoverBL_HB.z + g_boxBorderWidth_HB }, CTexCoord(w(54), h(32)) },
{ { g_backCoverTR_HB.x + g_boxBorderWidth_HB, g_backCoverTR_HB.y, g_backCoverBL_HB.z + g_boxBorderWidth_HB }, CTexCoord(w(54), h(0)) },
// Bas devant
{ { g_frontCoverTR_HB.x, g_frontCoverBL_HB.y, g_frontCoverBL_HB.z }, CTexCoord(w(0), h(240)) },
{ { g_frontCoverTR_HB.x, g_frontCoverBL_HB.y - g_boxBorderWidth_HB, g_frontCoverBL_HB.z - g_boxBorderWidth_HB }, CTexCoord(w(10), h(224)) },
{ { g_frontCoverTR_HB.x + g_boxBorderWidth_HB, g_frontCoverBL_HB.y, g_frontCoverBL_HB.z - g_boxBorderWidth_HB }, CTexCoord(w(10), h(256)) },
// Bas derrière
{ { g_backCoverTR_HB.x, g_backCoverBL_HB.y, g_backCoverBL_HB.z }, CTexCoord(w(64), h(240)) },
{ { g_backCoverTR_HB.x + g_boxBorderWidth_HB, g_backCoverBL_HB.y, g_backCoverBL_HB.z + g_boxBorderWidth_HB }, CTexCoord(w(54), h(256)) },
{ { g_backCoverTR_HB.x, g_backCoverBL_HB.y - g_boxBorderWidth_HB, g_backCoverBL_HB.z + g_boxBorderWidth_HB }, CTexCoord(w(54), h(224)) }
};
#undef h
#undef w
const SMeshVert g_flatCoverMesh_HB[] = {
{ { g_coverBL_HB.x, g_coverBL_HB.y, g_coverBL_HB.z }, CTexCoord(0.f, 1.f) },
{ { g_coverTR_HB.x, g_coverBL_HB.y, g_coverBL_HB.z }, CTexCoord(1.f, 1.f) },
{ { g_coverTR_HB.x, g_coverTR_HB.y, g_coverBL_HB.z }, CTexCoord(1.f, 0.f) },
{ { g_coverBL_HB.x, g_coverTR_HB.y, g_coverBL_HB.z }, CTexCoord(0.f, 0.f) }
};
const CTexCoord g_flatCoverBoxTex_HB[sizeof g_flatCoverMesh_HB / sizeof g_flatCoverMesh_HB[0]] = {
CTexCoord(1.46f / 2.76f, 1.f),
CTexCoord(1.f, 1.f),
CTexCoord(1.f, 0.f),
CTexCoord(1.46f / 2.76f, 0.f)
};
const SMeshVert g_boxBackCoverMesh_HB[] = {
{ { g_backCoverTR_HB.x, g_backCoverBL_HB.y, g_backCoverBL_HB.z }, CTexCoord(0.f, 1.f) },
{ { g_backCoverBL_HB.x, g_backCoverBL_HB.y, g_backCoverBL_HB.z }, CTexCoord(1.3f / 2.76f, 1.f) },
{ { g_backCoverBL_HB.x, g_backCoverTR_HB.y, g_backCoverBL_HB.z }, CTexCoord(1.3f / 2.76f, 0.f) },
{ { g_backCoverTR_HB.x, g_backCoverTR_HB.y, g_backCoverBL_HB.z }, CTexCoord(0.f, 0.f) },
{ { g_frontCoverBL_HB.x, g_frontCoverBL_HB.y, g_frontCoverBL_HB.z }, CTexCoord(1.46f / 2.76f, 1.f) },
{ { g_frontCoverBL_HB.x, g_frontCoverTR_HB.y, g_frontCoverBL_HB.z }, CTexCoord(1.46f / 2.76f, 0.f) },
{ { g_backCoverBL_HB.x, g_backCoverTR_HB.y, g_backCoverBL_HB.z }, CTexCoord(1.3f / 2.76f, 0.f) },
{ { g_backCoverBL_HB.x, g_backCoverBL_HB.y, g_backCoverBL_HB.z }, CTexCoord(1.3f / 2.76f, 1.f) },
};
const SMeshVert g_boxCoverMesh_HB[] = {
{ { g_frontCoverBL_HB.x, g_frontCoverBL_HB.y, g_frontCoverBL_HB.z }, CTexCoord(1.46f / 2.76f, 1.f) },
{ { g_frontCoverTR_HB.x, g_frontCoverBL_HB.y, g_frontCoverBL_HB.z }, CTexCoord(1.f, 1.f) },
{ { g_frontCoverTR_HB.x, g_frontCoverTR_HB.y, g_frontCoverBL_HB.z }, CTexCoord(1.f, 0.f) },
{ { g_frontCoverBL_HB.x, g_frontCoverTR_HB.y, g_frontCoverBL_HB.z }, CTexCoord(1.46f / 2.76f, 0.f) }
};
const CTexCoord g_boxCoverFlatTex_HB[sizeof g_boxCoverMesh_HB / sizeof g_boxCoverMesh_HB[0]] = {
CTexCoord(0.f, 1.f),
CTexCoord(1.f, 1.f),
CTexCoord(1.f, 0.f),
CTexCoord(0.f, 0.f)
};
const CTexCoord g_boxCoverBackTex_HB[sizeof g_boxBackCoverMesh_HB / sizeof g_boxBackCoverMesh_HB[0]] =
{
CTexCoord(0.f, 1.f),
CTexCoord(1.3f / 1.46f, 1.f),
CTexCoord(1.3f / 1.46f, 0.f),
CTexCoord(0.f, 0.f),
CTexCoord(1.f, 1.f),
CTexCoord(1.f, 0.f),
CTexCoord(1.3f / 1.46f, 0.f),
CTexCoord(1.3f / 1.46f, 1.f)
};
const u32 g_flatCoverMesh_HBSize = sizeof g_flatCoverMesh_HB / sizeof g_flatCoverMesh_HB[0];
const u32 g_boxMeshQ_HBSize = sizeof g_boxMeshQ_HB / sizeof g_boxMeshQ_HB[0];
const u32 g_boxMeshT_HBSize = sizeof g_boxMeshT_HB / sizeof g_boxMeshT_HB[0];
const u32 g_boxCoverMesh_HBSize = sizeof g_boxCoverMesh_HB / sizeof g_boxCoverMesh_HB[0];
const u32 g_boxBackCoverMesh_HBSize = sizeof g_boxBackCoverMesh_HB / sizeof g_boxBackCoverMesh_HB[0];

36
source/gui/boxmesh_hb.hpp Normal file
View File

@ -0,0 +1,36 @@
#ifndef __BOXMESH_HB_HPP
#define __BOXMESH_HB_HPP
#include "video.hpp"
#include "boxmesh.hpp"
// Quick and dirty hardcoded DVD box mesh
// Should be replaced by a true mesh loader
// Lacks normals
// Flat cover
extern const SMeshVert g_flatCoverMesh_HB[];
extern const u32 g_flatCoverMesh_HBSize;
extern const CTexCoord g_flatCoverBoxTex_HB[];
// Box
extern const SMeshVert g_boxMeshQ_HB[]; // Quads
extern const u32 g_boxMeshQ_HBSize;
extern const SMeshVert g_boxMeshT_HB[]; // Triangles
extern const u32 g_boxMeshT_HBSize;
// Box cover
extern const SMeshVert g_boxBackCoverMesh_HB[];
extern const u32 g_boxBackCoverMesh_HBSize;
extern const SMeshVert g_boxCoverMesh_HB[];
extern const u32 g_boxCoverMesh_HBSize;
extern const CTexCoord g_boxCoverFlatTex_HB[];
extern const CTexCoord g_boxCoverBackTex_HB[];
//
extern const float g_boxCoverYCenter_HB;
extern const float g_coverYCenter_HB;
// Bounding box size
extern const Vector3D g_boxSize_HB;
#endif // !defined(__BOXMESH_HB_HPP)

View File

@ -13,6 +13,7 @@
#include "coverflow.hpp"
#include "pngu.h"
#include "boxmesh.hpp"
#include "boxmesh_hb.hpp"
#include "wstringEx.hpp"
#include "lockMutex.hpp"
#include "fonts.h"
@ -1276,19 +1277,38 @@ void CCoverFlow::_drawCoverFlat(int i, bool mirror, CCoverFlow::DrawMode dm)
GX_InitTexObjLOD(&texObj, GX_LIN_MIP_LIN, GX_LINEAR, 0.f, (float)tex.maxLOD, mirror ? 1.f : m_lodBias, GX_FALSE, m_edgeLOD ? GX_TRUE : GX_FALSE, m_aniso);
GX_LoadTexObj(&texObj, GX_TEXMAP0);
}
GX_Begin(GX_QUADS, GX_VTXFMT0, g_flatCoverMeshSize);
for (u32 j = 0; j < g_flatCoverMeshSize; ++j)
if(strstr(m_items[m_covers[i].index].picPath.c_str(),"/apps") == NULL && strstr(m_items[m_covers[i].index].boxPicPath.c_str(),"/apps") == NULL)
{
GX_Position3f32(g_flatCoverMesh[j].pos.x, g_flatCoverMesh[j].pos.y, g_flatCoverMesh[j].pos.z);
if (dm == CCoverFlow::CFDR_NORMAL)
GX_Begin(GX_QUADS, GX_VTXFMT0, g_flatCoverMeshSize);
for (u32 j = 0; j < g_flatCoverMeshSize; ++j)
{
if (boxTex)
GX_TexCoord2f32(g_flatCoverBoxTex[j].x, g_flatCoverBoxTex[j].y);
else
GX_TexCoord2f32(g_flatCoverMesh[j].texCoord.x, g_flatCoverMesh[j].texCoord.y);
GX_Position3f32(g_flatCoverMesh[j].pos.x, g_flatCoverMesh[j].pos.y, g_flatCoverMesh[j].pos.z);
if (dm == CCoverFlow::CFDR_NORMAL)
{
if (boxTex)
GX_TexCoord2f32(g_flatCoverBoxTex[j].x, g_flatCoverBoxTex[j].y);
else
GX_TexCoord2f32(g_flatCoverMesh[j].texCoord.x, g_flatCoverMesh[j].texCoord.y);
}
}
GX_End();
}
else
{
GX_Begin(GX_QUADS, GX_VTXFMT0, g_flatCoverMesh_HBSize);
for (u32 j = 0; j < g_flatCoverMesh_HBSize; ++j)
{
GX_Position3f32(g_flatCoverMesh_HB[j].pos.x, g_flatCoverMesh_HB[j].pos.y, g_flatCoverMesh_HB[j].pos.z);
if (dm == CCoverFlow::CFDR_NORMAL)
{
if (boxTex)
GX_TexCoord2f32(g_flatCoverBoxTex_HB[j].x, g_flatCoverBoxTex_HB[j].y);
else
GX_TexCoord2f32(g_flatCoverMesh_HB[j].texCoord.x, g_flatCoverMesh_HB[j].texCoord.y);
}
}
GX_End();
}
GX_End();
}
bool CCoverFlow::_checkCoverColor(char* gameID, const char* checkID[], int len)
@ -1375,60 +1395,120 @@ void CCoverFlow::_drawCoverBox(int i, bool mirror, CCoverFlow::DrawMode dm)
}
GX_LoadTexObj(&texObj, GX_TEXMAP0);
}
GX_Begin(GX_QUADS, GX_VTXFMT0, g_boxMeshQSize);
for (u32 j = 0; j < g_boxMeshQSize; ++j)
if(strstr(m_items[m_covers[i].index].picPath.c_str(),"/apps") == NULL && strstr(m_items[m_covers[i].index].boxPicPath.c_str(),"/apps") == NULL)
{
GX_Position3f32(g_boxMeshQ[j].pos.x, g_boxMeshQ[j].pos.y, g_boxMeshQ[j].pos.z);
if (dm == CCoverFlow::CFDR_NORMAL)
GX_TexCoord2f32(g_boxMeshQ[j].texCoord.x, g_boxMeshQ[j].texCoord.y);
}
GX_End();
GX_Begin(GX_TRIANGLES, GX_VTXFMT0, g_boxMeshTSize);
for (u32 j = 0; j < g_boxMeshTSize; ++j)
{
GX_Position3f32(g_boxMeshT[j].pos.x, g_boxMeshT[j].pos.y, g_boxMeshT[j].pos.z);
if (dm == CCoverFlow::CFDR_NORMAL)
GX_TexCoord2f32(g_boxMeshT[j].texCoord.x, g_boxMeshT[j].texCoord.y);
}
GX_End();
if (dm == CCoverFlow::CFDR_NORMAL)
{
STexture *myTex = &tex;
if (flatTex)
myTex = &m_noCoverTexture;
GX_InitTexObj(&texObj, myTex->data.get(), myTex->width, myTex->height, myTex->format, GX_CLAMP, GX_CLAMP, GX_FALSE);
if (myTex->maxLOD > 0)
GX_InitTexObjLOD(&texObj, GX_LIN_MIP_LIN, GX_LINEAR, 0.f, (float)myTex->maxLOD, mirror ? 1.f : m_lodBias, GX_FALSE, m_edgeLOD ? GX_TRUE : GX_FALSE, m_aniso);
GX_LoadTexObj(&texObj, GX_TEXMAP0);
}
GX_Begin(GX_QUADS, GX_VTXFMT0, g_boxBackCoverMeshSize);
for (u32 j = 0; j < g_boxBackCoverMeshSize; ++j)
{
GX_Position3f32(g_boxBackCoverMesh[j].pos.x, g_boxBackCoverMesh[j].pos.y, g_boxBackCoverMesh[j].pos.z);
if (dm == CCoverFlow::CFDR_NORMAL)
GX_TexCoord2f32(g_boxBackCoverMesh[j].texCoord.x, g_boxBackCoverMesh[j].texCoord.y);
}
GX_End();
if (dm == CCoverFlow::CFDR_NORMAL && flatTex)
{
GX_InitTexObj(&texObj, tex.data.get(), tex.width, tex.height, tex.format, GX_CLAMP, GX_CLAMP, GX_FALSE);
if (tex.maxLOD > 0)
GX_InitTexObjLOD(&texObj, GX_LIN_MIP_LIN, GX_LINEAR, 0.f, (float)tex.maxLOD, mirror ? 1.f : m_lodBias, GX_FALSE, m_edgeLOD ? GX_TRUE : GX_FALSE, m_aniso);
GX_LoadTexObj(&texObj, GX_TEXMAP0);
}
GX_Begin(GX_QUADS, GX_VTXFMT0, g_boxCoverMeshSize);
for (u32 j = 0; j < g_boxCoverMeshSize; ++j)
{
GX_Position3f32(g_boxCoverMesh[j].pos.x, g_boxCoverMesh[j].pos.y, g_boxCoverMesh[j].pos.z);
GX_Begin(GX_QUADS, GX_VTXFMT0, g_boxMeshQSize);
for (u32 j = 0; j < g_boxMeshQSize; ++j)
{
GX_Position3f32(g_boxMeshQ[j].pos.x, g_boxMeshQ[j].pos.y, g_boxMeshQ[j].pos.z);
if (dm == CCoverFlow::CFDR_NORMAL)
GX_TexCoord2f32(g_boxMeshQ[j].texCoord.x, g_boxMeshQ[j].texCoord.y);
}
GX_End();
GX_Begin(GX_TRIANGLES, GX_VTXFMT0, g_boxMeshTSize);
for (u32 j = 0; j < g_boxMeshTSize; ++j)
{
GX_Position3f32(g_boxMeshT[j].pos.x, g_boxMeshT[j].pos.y, g_boxMeshT[j].pos.z);
if (dm == CCoverFlow::CFDR_NORMAL)
GX_TexCoord2f32(g_boxMeshT[j].texCoord.x, g_boxMeshT[j].texCoord.y);
}
GX_End();
if (dm == CCoverFlow::CFDR_NORMAL)
{
STexture *myTex = &tex;
if (flatTex)
GX_TexCoord2f32(g_boxCoverFlatTex[j].x, g_boxCoverFlatTex[j].y);
else
GX_TexCoord2f32(g_boxCoverMesh[j].texCoord.x, g_boxCoverMesh[j].texCoord.y);
myTex = &m_noCoverTexture;
GX_InitTexObj(&texObj, myTex->data.get(), myTex->width, myTex->height, myTex->format, GX_CLAMP, GX_CLAMP, GX_FALSE);
if (myTex->maxLOD > 0)
GX_InitTexObjLOD(&texObj, GX_LIN_MIP_LIN, GX_LINEAR, 0.f, (float)myTex->maxLOD, mirror ? 1.f : m_lodBias, GX_FALSE, m_edgeLOD ? GX_TRUE : GX_FALSE, m_aniso);
GX_LoadTexObj(&texObj, GX_TEXMAP0);
}
GX_Begin(GX_QUADS, GX_VTXFMT0, g_boxBackCoverMeshSize);
for (u32 j = 0; j < g_boxBackCoverMeshSize; ++j)
{
GX_Position3f32(g_boxBackCoverMesh[j].pos.x, g_boxBackCoverMesh[j].pos.y, g_boxBackCoverMesh[j].pos.z);
if (dm == CCoverFlow::CFDR_NORMAL)
GX_TexCoord2f32(g_boxBackCoverMesh[j].texCoord.x, g_boxBackCoverMesh[j].texCoord.y);
}
GX_End();
if (dm == CCoverFlow::CFDR_NORMAL && flatTex)
{
GX_InitTexObj(&texObj, tex.data.get(), tex.width, tex.height, tex.format, GX_CLAMP, GX_CLAMP, GX_FALSE);
if (tex.maxLOD > 0)
GX_InitTexObjLOD(&texObj, GX_LIN_MIP_LIN, GX_LINEAR, 0.f, (float)tex.maxLOD, mirror ? 1.f : m_lodBias, GX_FALSE, m_edgeLOD ? GX_TRUE : GX_FALSE, m_aniso);
GX_LoadTexObj(&texObj, GX_TEXMAP0);
}
GX_Begin(GX_QUADS, GX_VTXFMT0, g_boxCoverMeshSize);
for (u32 j = 0; j < g_boxCoverMeshSize; ++j)
{
GX_Position3f32(g_boxCoverMesh[j].pos.x, g_boxCoverMesh[j].pos.y, g_boxCoverMesh[j].pos.z);
if (dm == CCoverFlow::CFDR_NORMAL)
{
if (flatTex)
GX_TexCoord2f32(g_boxCoverFlatTex[j].x, g_boxCoverFlatTex[j].y);
else
GX_TexCoord2f32(g_boxCoverMesh[j].texCoord.x, g_boxCoverMesh[j].texCoord.y);
}
}
GX_End();
}
else
{
GX_Begin(GX_QUADS, GX_VTXFMT0, g_boxMeshQ_HBSize);
for (u32 j = 0; j < g_boxMeshQ_HBSize; ++j)
{
GX_Position3f32(g_boxMeshQ_HB[j].pos.x, g_boxMeshQ_HB[j].pos.y, g_boxMeshQ_HB[j].pos.z);
if (dm == CCoverFlow::CFDR_NORMAL)
GX_TexCoord2f32(g_boxMeshQ_HB[j].texCoord.x, g_boxMeshQ_HB[j].texCoord.y);
}
GX_End();
GX_Begin(GX_TRIANGLES, GX_VTXFMT0, g_boxMeshT_HBSize);
for (u32 j = 0; j < g_boxMeshT_HBSize; ++j)
{
GX_Position3f32(g_boxMeshT_HB[j].pos.x, g_boxMeshT_HB[j].pos.y, g_boxMeshT_HB[j].pos.z);
if (dm == CCoverFlow::CFDR_NORMAL)
GX_TexCoord2f32(g_boxMeshT_HB[j].texCoord.x, g_boxMeshT_HB[j].texCoord.y);
}
GX_End();
if (dm == CCoverFlow::CFDR_NORMAL)
{
STexture *myTex = &tex;
if (flatTex)
myTex = &m_noCoverTexture;
GX_InitTexObj(&texObj, myTex->data.get(), myTex->width, myTex->height, myTex->format, GX_CLAMP, GX_CLAMP, GX_FALSE);
if (myTex->maxLOD > 0)
GX_InitTexObjLOD(&texObj, GX_LIN_MIP_LIN, GX_LINEAR, 0.f, (float)myTex->maxLOD, mirror ? 1.f : m_lodBias, GX_FALSE, m_edgeLOD ? GX_TRUE : GX_FALSE, m_aniso);
GX_LoadTexObj(&texObj, GX_TEXMAP0);
}
GX_Begin(GX_QUADS, GX_VTXFMT0, g_boxBackCoverMesh_HBSize);
for (u32 j = 0; j < g_boxBackCoverMesh_HBSize; ++j)
{
GX_Position3f32(g_boxBackCoverMesh_HB[j].pos.x, g_boxBackCoverMesh_HB[j].pos.y, g_boxBackCoverMesh_HB[j].pos.z);
if (dm == CCoverFlow::CFDR_NORMAL)
GX_TexCoord2f32(g_boxBackCoverMesh_HB[j].texCoord.x, g_boxBackCoverMesh_HB[j].texCoord.y);
}
GX_End();
if (dm == CCoverFlow::CFDR_NORMAL && flatTex)
{
GX_InitTexObj(&texObj, tex.data.get(), tex.width, tex.height, tex.format, GX_CLAMP, GX_CLAMP, GX_FALSE);
if (tex.maxLOD > 0)
GX_InitTexObjLOD(&texObj, GX_LIN_MIP_LIN, GX_LINEAR, 0.f, (float)tex.maxLOD, mirror ? 1.f : m_lodBias, GX_FALSE, m_edgeLOD ? GX_TRUE : GX_FALSE, m_aniso);
GX_LoadTexObj(&texObj, GX_TEXMAP0);
}
GX_Begin(GX_QUADS, GX_VTXFMT0, g_boxCoverMesh_HBSize);
for (u32 j = 0; j < g_boxCoverMeshSize; ++j)
{
GX_Position3f32(g_boxCoverMesh_HB[j].pos.x, g_boxCoverMesh_HB[j].pos.y, g_boxCoverMesh_HB[j].pos.z);
if (dm == CCoverFlow::CFDR_NORMAL)
{
if (flatTex)
GX_TexCoord2f32(g_boxCoverFlatTex_HB[j].x, g_boxCoverFlatTex_HB[j].y);
else
GX_TexCoord2f32(g_boxCoverMesh_HB[j].texCoord.x, g_boxCoverMesh_HB[j].texCoord.y);
}
}
GX_End();
}
GX_End();
}
void CCoverFlow::_loadCover(int i, int item)