2012-07-03 18:26:49 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Copyright (C) 2012 Dimok
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
****************************************************************************/
|
|
|
|
#ifndef BANNERWINDOW_HPP_
|
|
|
|
#define BANNERWINDOW_HPP_
|
|
|
|
|
|
|
|
#include <gccore.h>
|
|
|
|
|
|
|
|
#include "AnimatedBanner.h"
|
|
|
|
#include "channel/banner.h"
|
2012-08-05 15:48:15 +02:00
|
|
|
#include "gui/video.hpp"
|
|
|
|
#include "loader/disc.h"
|
|
|
|
#include "music/gui_sound.h"
|
2012-07-03 18:26:49 +02:00
|
|
|
|
|
|
|
#define FAVORITE_STARS 5
|
|
|
|
|
2012-07-06 02:36:45 +02:00
|
|
|
typedef struct _GC_OpeningBnr
|
|
|
|
{
|
|
|
|
u32 magic; // BNR1 or BNR2
|
|
|
|
u8 pad[0x1C];
|
|
|
|
u8 tpl_data[0x1800]; // 96x32 pixel format GX_TF_RGB5A3
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
u8 disc_title[0x20]; // Gamename
|
|
|
|
u8 developer_short[0x20]; // Company/Developer
|
|
|
|
u8 full_title[0x40]; // Full Game Title
|
|
|
|
u8 developer[0x40]; // Company/Developer Full name, or description
|
|
|
|
u8 long_description[0x80]; // Game Description
|
|
|
|
} description[6]; // 6 only on BNR2 => English, German, French, Spanish, Italian, Dutch ??
|
|
|
|
} GC_OpeningBnr;
|
|
|
|
|
2012-07-03 18:26:49 +02:00
|
|
|
class BannerWindow
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
BannerWindow();
|
2012-07-04 15:45:39 +02:00
|
|
|
void DeleteBanner(bool gamechange = false);
|
2012-10-13 18:57:03 +02:00
|
|
|
void LoadBanner(Banner *banner, u8 *font1, u8 *font2);
|
|
|
|
void LoadBannerBin(u8 *bnr, u32 bnr_size, u8 *font1, u8 *font2);
|
2012-07-03 18:26:49 +02:00
|
|
|
int GetSelectedGame() { return gameSelected; }
|
2012-07-04 13:56:02 +02:00
|
|
|
bool GetZoomSetting() { return AnimZoom; }
|
2012-07-10 14:02:06 +02:00
|
|
|
bool GetInGameSettings() { return (Brightness > 1.f ? true : false); }
|
2012-10-13 18:57:03 +02:00
|
|
|
void CreateGCBanner(u8 *bnr, u8 *font1, u8 *font2, const wchar_t *title);
|
2012-07-03 18:26:49 +02:00
|
|
|
void Draw(void);
|
2012-07-04 13:56:02 +02:00
|
|
|
bool ToogleZoom(void);
|
2012-07-10 14:02:06 +02:00
|
|
|
void ToogleGameSettings();
|
2012-08-26 17:20:51 +02:00
|
|
|
bool GetShowBanner() { return ShowBanner; }
|
|
|
|
void SetShowBanner(bool show) { ShowBanner = show; }
|
2012-09-23 14:10:25 +02:00
|
|
|
void ReSetup_GX(void);
|
2012-07-03 18:26:49 +02:00
|
|
|
protected:
|
|
|
|
int MainLoop();
|
|
|
|
void Animate(void);
|
|
|
|
void ChangeGame(Banner *banner);
|
2012-07-04 13:56:02 +02:00
|
|
|
void DrawRectangle(f32 x, f32 y, f32 width, f32 height, GXColor color);
|
2012-10-13 18:57:03 +02:00
|
|
|
void Init(u8 *font1, u8 *font2);
|
2012-07-03 18:26:49 +02:00
|
|
|
|
|
|
|
static const float fBannerWidth = 608.f;
|
|
|
|
static const float fBannerHeight = 448.f;
|
|
|
|
static const float fIconWidth = 128.f;
|
|
|
|
static const float fIconHeight = 96.f;
|
|
|
|
|
|
|
|
bool reducedVol;
|
|
|
|
int returnVal;
|
|
|
|
int gameSelected;
|
|
|
|
dir_discHdr dvdheader;
|
2012-07-09 22:06:53 +02:00
|
|
|
float Brightness;
|
2012-07-03 18:26:49 +02:00
|
|
|
int MaxAnimSteps;
|
|
|
|
|
|
|
|
int AnimStep;
|
|
|
|
float AnimPosX, AnimPosY;
|
|
|
|
float fAnimScale;
|
2012-07-04 13:56:02 +02:00
|
|
|
bool AnimZoom;
|
2012-07-03 18:26:49 +02:00
|
|
|
bool AnimationRunning;
|
2012-07-04 00:08:51 +02:00
|
|
|
bool changing;
|
2012-08-26 17:20:51 +02:00
|
|
|
bool ShowBanner;
|
2012-07-03 18:26:49 +02:00
|
|
|
|
2012-07-10 16:43:32 +02:00
|
|
|
float xDiff, yDiff;
|
|
|
|
float iconWidth, iconHeight;
|
|
|
|
float stepx1, stepx2, stepy1, stepy2;
|
|
|
|
f32 ratioX, ratioY;
|
|
|
|
|
2012-07-03 18:26:49 +02:00
|
|
|
Mtx modelview;
|
|
|
|
Mtx44 projection;
|
|
|
|
Vec2f ScreenProps;
|
|
|
|
|
|
|
|
AnimatedBanner *gameBanner;
|
|
|
|
u8 *sysFont1;
|
|
|
|
u8 *sysFont2;
|
2012-07-04 13:56:02 +02:00
|
|
|
bool FontLoaded;
|
2012-07-03 18:26:49 +02:00
|
|
|
};
|
|
|
|
|
2012-10-13 18:57:03 +02:00
|
|
|
extern BannerWindow m_banner;
|
2012-07-04 13:56:02 +02:00
|
|
|
|
2012-07-03 18:26:49 +02:00
|
|
|
#endif
|