-new wait message (thanks jj-kwik for the awesome base)
-added BASIC jpg support (currently only for internal theme files and only with the power of 4 dimension images) -using dvdskin files in jpg format (you wont notice the diff) -created new folder in resources for the original theme pngs (@devs: if you update pictures and use jpg, place the original png inside that folder that we have the original one just in case)
30
Makefile
@ -117,6 +117,7 @@ TXTFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.txt)))
|
|||||||
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.bin)))
|
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.bin)))
|
||||||
TTFFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.ttf)))
|
TTFFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.ttf)))
|
||||||
PNGFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.png)))
|
PNGFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.png)))
|
||||||
|
JPGFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.jpg)))
|
||||||
|
|
||||||
MP3FILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.mp3)))
|
MP3FILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.mp3)))
|
||||||
OGGFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.ogg)))
|
OGGFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.ogg)))
|
||||||
@ -137,10 +138,9 @@ endif
|
|||||||
|
|
||||||
export OFILES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
|
export OFILES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
|
||||||
$(sFILES:.s=.o) $(SFILES:.S=.o) \
|
$(sFILES:.s=.o) $(SFILES:.S=.o) \
|
||||||
$(TTFFILES:.ttf=.ttf.o) $(PNGFILES:.png=.png.o) $(DOLFILES:.dol=.dol.o) \
|
$(JPGFILES:.jpg=.jpg.o) $(PNGFILES:.png=.png.o) $(DOLFILES:.dol=.dol.o) \
|
||||||
$(OGGFILES:.ogg=.ogg.o) $(PCMFILES:.pcm=.pcm.o) $(MP3FILES:.mp3=.mp3.o) \
|
$(OGGFILES:.ogg=.ogg.o) $(WAVFILES:.wav=.wav.o) $(MP3FILES:.mp3=.mp3.o) \
|
||||||
$(WAVFILES:.wav=.wav.o) $(ELFFILES:.elf=.elf.o) $(BINFILES:.bin=.bin.o) \
|
$(ELFFILES:.elf=.elf.o) $(BINFILES:.bin=.bin.o) $(TXTFILES:.txt=.txt.o) \
|
||||||
$(TXTFILES:.txt=.txt.o)
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
# build a list of include paths
|
# build a list of include paths
|
||||||
@ -210,16 +210,16 @@ $(BUILD)/alt_ios_gen.o: alt_ios_gen.c
|
|||||||
@bin2s -a 32 $< | $(AS) -o $(@)
|
@bin2s -a 32 $< | $(AS) -o $(@)
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
# This rule links in binary data with the .png extension
|
# This rule links in binary data with the .jpg extension
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
%.png.o : %.png
|
%.jpg.o : %.jpg
|
||||||
@echo $(notdir $<)
|
@echo $(notdir $<)
|
||||||
@bin2s -a 32 $< | $(AS) -o $(@)
|
@bin2s -a 32 $< | $(AS) -o $(@)
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
# This rule links in binary data with the .ttf extension
|
# This rule links in binary data with the .png extension
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
%.ttf.o : %.ttf
|
%.png.o : %.png
|
||||||
@echo $(notdir $<)
|
@echo $(notdir $<)
|
||||||
@bin2s -a 32 $< | $(AS) -o $(@)
|
@bin2s -a 32 $< | $(AS) -o $(@)
|
||||||
|
|
||||||
@ -230,13 +230,6 @@ $(BUILD)/alt_ios_gen.o: alt_ios_gen.c
|
|||||||
@echo $(notdir $<)
|
@echo $(notdir $<)
|
||||||
@bin2s -a 32 $< | $(AS) -o $(@)
|
@bin2s -a 32 $< | $(AS) -o $(@)
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# This rule links in binary data with the .pcm extension
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
%.pcm.o : %.pcm
|
|
||||||
@echo $(notdir $<)
|
|
||||||
@bin2s -a 32 $< | $(AS) -o $(@)
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
# This rule links in binary data with the .wav extension
|
# This rule links in binary data with the .wav extension
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
@ -244,13 +237,6 @@ $(BUILD)/alt_ios_gen.o: alt_ios_gen.c
|
|||||||
@echo $(notdir $<)
|
@echo $(notdir $<)
|
||||||
@bin2s -a 32 $< | $(AS) -o $(@)
|
@bin2s -a 32 $< | $(AS) -o $(@)
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
# This rule links in binary data with the .mp3 extension
|
|
||||||
#---------------------------------------------------------------------------------
|
|
||||||
%.mp3.o : %.mp3
|
|
||||||
@echo $(notdir $<)
|
|
||||||
@bin2s -a 32 $< | $(AS) -o $(@)
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
# This rule links in binary data with the .bin extension
|
# This rule links in binary data with the .bin extension
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
|
BIN
data/images/dvdskin.jpg
Normal file
After Width: | Height: | Size: 984 B |
BIN
data/images/dvdskin_black.jpg
Normal file
After Width: | Height: | Size: 636 B |
BIN
data/images/dvdskin_greenone.jpg
Normal file
After Width: | Height: | Size: 858 B |
BIN
data/images/dvdskin_greentwo.jpg
Normal file
After Width: | Height: | Size: 951 B |
BIN
data/images/dvdskin_red.jpg
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
data/images/dvdskin_yellow.jpg
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
data/images/wait_01.jpg
Normal file
After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 4.4 KiB |
BIN
data/images/wait_02.jpg
Normal file
After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 4.3 KiB |
BIN
data/images/wait_03.jpg
Normal file
After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 4.2 KiB |
BIN
data/images/wait_04.jpg
Normal file
After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 4.2 KiB |
BIN
data/images/wait_05.jpg
Normal file
After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 4.1 KiB |
BIN
data/images/wait_06.jpg
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
data/images/wait_07.jpg
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
data/images/wait_08.jpg
Normal file
After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
BIN
resources/theme_pngs/wait_01.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
resources/theme_pngs/wait_02.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
resources/theme_pngs/wait_03.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
resources/theme_pngs/wait_04.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
resources/theme_pngs/wait_05.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
resources/theme_pngs/wait_06.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
resources/theme_pngs/wait_07.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
resources/theme_pngs/wait_08.png
Normal file
After Width: | Height: | Size: 13 KiB |
@ -17,12 +17,19 @@
|
|||||||
#include "gecko.h"
|
#include "gecko.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
extern const u8 dvdskin_png[];
|
extern const u8 dvdskin_jpg[];
|
||||||
extern const u8 dvdskin_red_png[];
|
extern const u32 dvdskin_jpg_size;
|
||||||
extern const u8 dvdskin_black_png[];
|
extern const u8 dvdskin_red_jpg[];
|
||||||
extern const u8 dvdskin_yellow_png[];
|
extern const u32 dvdskin_red_jpg_size;
|
||||||
extern const u8 dvdskin_greenone_png[];
|
extern const u8 dvdskin_black_jpg[];
|
||||||
extern const u8 dvdskin_greentwo_png[];
|
extern const u32 dvdskin_black_jpg_size;
|
||||||
|
extern const u8 dvdskin_yellow_jpg[];
|
||||||
|
extern const u32 dvdskin_yellow_jpg_size;
|
||||||
|
extern const u8 dvdskin_greenone_jpg[];
|
||||||
|
extern const u32 dvdskin_greenone_jpg_size;
|
||||||
|
extern const u8 dvdskin_greentwo_jpg[];
|
||||||
|
extern const u32 dvdskin_greentwo_jpg_size;
|
||||||
|
|
||||||
extern const u8 nopic_png[];
|
extern const u8 nopic_png[];
|
||||||
extern const u8 loading_png[];
|
extern const u8 loading_png[];
|
||||||
extern const u8 flatnopic_png[];
|
extern const u8 flatnopic_png[];
|
||||||
@ -176,6 +183,7 @@ CCoverFlow::CCoverFlow(void)
|
|||||||
m_minDelay = 5;
|
m_minDelay = 5;
|
||||||
m_jump = 0;
|
m_jump = 0;
|
||||||
m_mutex = 0;
|
m_mutex = 0;
|
||||||
|
m_dvdskin_loaded = false;
|
||||||
m_loadingCovers = false;
|
m_loadingCovers = false;
|
||||||
m_moved = false;
|
m_moved = false;
|
||||||
m_selected = false;
|
m_selected = false;
|
||||||
@ -649,6 +657,28 @@ void CCoverFlow::clear(void)
|
|||||||
m_items.clear();
|
m_items.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CCoverFlow::shutdown(void)
|
||||||
|
{
|
||||||
|
gprintf("Cleanup Coverflow\n");
|
||||||
|
clear();
|
||||||
|
|
||||||
|
m_dvdSkin.data.release();
|
||||||
|
m_dvdSkin_Red.data.release();
|
||||||
|
m_dvdSkin_Black.data.release();
|
||||||
|
m_dvdSkin_Yellow.data.release();
|
||||||
|
m_dvdSkin_GreenOne.data.release();
|
||||||
|
m_dvdSkin_GreenTwo.data.release();
|
||||||
|
for(u8 i = 0; i < 4; i++)
|
||||||
|
{
|
||||||
|
if(m_sound[i].get())
|
||||||
|
m_sound[i].release();
|
||||||
|
}
|
||||||
|
m_hoverSound.release();
|
||||||
|
m_selectSound.release();
|
||||||
|
m_cancelSound.release();
|
||||||
|
LWP_MutexDestroy(m_mutex);
|
||||||
|
}
|
||||||
|
|
||||||
void CCoverFlow::reserve(u32 capacity)
|
void CCoverFlow::reserve(u32 capacity)
|
||||||
{
|
{
|
||||||
m_items.reserve(capacity);
|
m_items.reserve(capacity);
|
||||||
@ -1799,12 +1829,22 @@ bool CCoverFlow::start(const char *id)
|
|||||||
sort(m_items.begin(), m_items.end(), CCoverFlow::_sortByWifiPlayers);
|
sort(m_items.begin(), m_items.end(), CCoverFlow::_sortByWifiPlayers);
|
||||||
|
|
||||||
// Load resident textures
|
// Load resident textures
|
||||||
if (STexture::TE_OK != m_dvdSkin.fromPNG(dvdskin_png)) return false;
|
if(!m_dvdskin_loaded)
|
||||||
if (STexture::TE_OK != m_dvdSkin_Red.fromPNG(dvdskin_red_png)) return false;
|
{
|
||||||
if (STexture::TE_OK != m_dvdSkin_Black.fromPNG(dvdskin_black_png)) return false;
|
if(m_dvdSkin.fromJPG(dvdskin_jpg, dvdskin_jpg_size) != STexture::TE_OK)
|
||||||
if (STexture::TE_OK != m_dvdSkin_Yellow.fromPNG(dvdskin_yellow_png)) return false;
|
return false;
|
||||||
if (STexture::TE_OK != m_dvdSkin_GreenOne.fromPNG(dvdskin_greenone_png)) return false;
|
if(m_dvdSkin_Red.fromJPG(dvdskin_red_jpg, dvdskin_red_jpg_size) != STexture::TE_OK)
|
||||||
if (STexture::TE_OK != m_dvdSkin_GreenTwo.fromPNG(dvdskin_greentwo_png)) return false;
|
return false;
|
||||||
|
if(m_dvdSkin_Black.fromJPG(dvdskin_black_jpg, dvdskin_black_jpg_size) != STexture::TE_OK)
|
||||||
|
return false;
|
||||||
|
if(m_dvdSkin_Yellow.fromJPG(dvdskin_yellow_jpg, dvdskin_yellow_jpg_size) != STexture::TE_OK)
|
||||||
|
return false;
|
||||||
|
if(m_dvdSkin_GreenOne.fromJPG(dvdskin_greenone_jpg, dvdskin_greenone_jpg_size) != STexture::TE_OK)
|
||||||
|
return false;
|
||||||
|
if(m_dvdSkin_GreenTwo.fromJPG(dvdskin_greentwo_jpg, dvdskin_greentwo_jpg_size) != STexture::TE_OK)
|
||||||
|
return false;
|
||||||
|
m_dvdskin_loaded = true;
|
||||||
|
}
|
||||||
|
|
||||||
if(m_box)
|
if(m_box)
|
||||||
{
|
{
|
||||||
|
@ -43,6 +43,7 @@ public:
|
|||||||
bool init(const SmartBuf &font, u32 font_size, bool vid_50hz);
|
bool init(const SmartBuf &font, u32 font_size, bool vid_50hz);
|
||||||
// Cover list management
|
// Cover list management
|
||||||
void clear(void);
|
void clear(void);
|
||||||
|
void shutdown(void);
|
||||||
void reserve(u32 capacity);
|
void reserve(u32 capacity);
|
||||||
void addItem(dir_discHdr *hdr, const char *picPath, const char *boxPicPath, int playcount = 0, unsigned int lastPlayed = 0);
|
void addItem(dir_discHdr *hdr, const char *picPath, const char *boxPicPath, int playcount = 0, unsigned int lastPlayed = 0);
|
||||||
bool empty(void) const { return m_items.empty(); }
|
bool empty(void) const { return m_items.empty(); }
|
||||||
@ -259,6 +260,7 @@ private:
|
|||||||
bool m_fanartPlaying;
|
bool m_fanartPlaying;
|
||||||
bool m_box;
|
bool m_box;
|
||||||
bool m_useHQcover;
|
bool m_useHQcover;
|
||||||
|
bool m_dvdskin_loaded;
|
||||||
u32 m_range;
|
u32 m_range;
|
||||||
u32 m_rows;
|
u32 m_rows;
|
||||||
u32 m_columns;
|
u32 m_columns;
|
||||||
|
@ -693,8 +693,6 @@ void convertToRealJpeg(u8* dest, const u8* src, int srcSize, int start, int end)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void decodeRealJpeg(const u8* data, int size, VideoFrame& dest);
|
|
||||||
|
|
||||||
void decodeJpeg(const u8* data, int size, VideoFrame& dest)
|
void decodeJpeg(const u8* data, int size, VideoFrame& dest)
|
||||||
{
|
{
|
||||||
//convert format so jpeglib understands it...
|
//convert format so jpeglib understands it...
|
||||||
|
@ -330,4 +330,6 @@ class JpgVideoFile : public VideoFile
|
|||||||
VideoFrame _currFrame;
|
VideoFrame _currFrame;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void decodeRealJpeg(const u8* data, int size, VideoFrame& dest);
|
||||||
|
|
||||||
#endif //THAKIS_GCVID_H
|
#endif //THAKIS_GCVID_H
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
#include "texture.hpp"
|
#include "texture.hpp"
|
||||||
#include "pngu.h"
|
#include "pngu.h"
|
||||||
|
#include "gcvid.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@ -217,53 +218,42 @@ STexture::TexErr STexture::fromPNGFile(const char *filename, u8 f, Alloc alloc,
|
|||||||
return !!ptrPng ? fromPNG(ptrPng.get(), f, alloc, minMipSize, maxMipSize) : STexture::TE_NOMEM;
|
return !!ptrPng ? fromPNG(ptrPng.get(), f, alloc, minMipSize, maxMipSize) : STexture::TE_NOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
STexture::TexErr STexture::fromRAW(const u8 *buffer, u32 w, u32 h, u8 f, Alloc alloc)
|
STexture::TexErr STexture::fromRAW(const u8 *buffer, u32 w, u32 h, Alloc alloc)
|
||||||
{
|
{
|
||||||
SmartBuf tmpData;
|
SmartBuf rawData;
|
||||||
|
format = GX_TF_RGBA8;
|
||||||
switch (f)
|
|
||||||
{
|
|
||||||
case GX_TF_RGBA8:
|
|
||||||
case GX_TF_RGB565:
|
|
||||||
case GX_TF_CMPR:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
f = GX_TF_RGBA8;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch(alloc)
|
switch(alloc)
|
||||||
{
|
{
|
||||||
case ALLOC_MEM2:
|
case ALLOC_MEM2:
|
||||||
tmpData = smartMem2Alloc(GX_GetTexBufferSize(w, h, f, GX_FALSE, 0));
|
rawData = smartMem2Alloc(GX_GetTexBufferSize(w, h, format, GX_FALSE, 0));
|
||||||
break;
|
break;
|
||||||
case ALLOC_MALLOC:
|
case ALLOC_MALLOC:
|
||||||
tmpData = smartMemAlign32(GX_GetTexBufferSize(w, h, f, GX_FALSE, 0));
|
rawData = smartMemAlign32(GX_GetTexBufferSize(w, h, format, GX_FALSE, 0));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!tmpData) return STexture::TE_NOMEM;
|
if(rawData.get() == NULL)
|
||||||
|
return STexture::TE_NOMEM;
|
||||||
|
|
||||||
format = f;
|
|
||||||
width = w;
|
width = w;
|
||||||
height = h;
|
height = h;
|
||||||
maxLOD = 0;
|
maxLOD = 0;
|
||||||
data = tmpData;
|
STexture::_convertToFlippedRGBA8(rawData.get(), buffer, width, height);
|
||||||
switch (f)
|
data = rawData;
|
||||||
{
|
|
||||||
case GX_TF_RGBA8:
|
|
||||||
STexture::_convertToFlippedRGBA8(tmpData.get(), buffer, width, height);
|
|
||||||
break;
|
|
||||||
case GX_TF_RGB565:
|
|
||||||
STexture::_convertToRGB565(tmpData.get(), buffer, width, height);
|
|
||||||
break;
|
|
||||||
case GX_TF_CMPR:
|
|
||||||
STexture::_convertToCMPR(tmpData.get(), buffer, width, height);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
DCFlushRange(data.get(), GX_GetTexBufferSize(width, height, format, GX_FALSE, 0));
|
DCFlushRange(data.get(), GX_GetTexBufferSize(width, height, format, GX_FALSE, 0));
|
||||||
|
|
||||||
return STexture::TE_OK;
|
return STexture::TE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
STexture::TexErr STexture::fromJPG(const u8 *buffer, const u32 buffer_size)
|
||||||
|
{
|
||||||
|
VideoFrame VideoF;
|
||||||
|
decodeRealJpeg(buffer, buffer_size, VideoF);
|
||||||
|
if(!VideoF.getData())
|
||||||
|
return STexture::TE_ERROR;
|
||||||
|
return fromRAW(VideoF.getData(), VideoF.getWidth(), VideoF.getHeight());
|
||||||
|
}
|
||||||
|
|
||||||
STexture::TexErr STexture::fromPNG(const u8 *buffer, u8 f, Alloc alloc, u32 minMipSize, u32 maxMipSize)
|
STexture::TexErr STexture::fromPNG(const u8 *buffer, u8 f, Alloc alloc, u32 minMipSize, u32 maxMipSize)
|
||||||
{
|
{
|
||||||
PNGUPROP imgProp;
|
PNGUPROP imgProp;
|
||||||
|
@ -19,7 +19,8 @@ struct STexture
|
|||||||
// This function doesn't use MEM2 if the PNG is loaded from memory and there's no mip mapping
|
// This function doesn't use MEM2 if the PNG is loaded from memory and there's no mip mapping
|
||||||
TexErr fromPNG(const u8 *buffer, u8 f = -1, Alloc alloc = ALLOC_MEM2, u32 minMipSize = 0, u32 maxMipSize = 0);
|
TexErr fromPNG(const u8 *buffer, u8 f = -1, Alloc alloc = ALLOC_MEM2, u32 minMipSize = 0, u32 maxMipSize = 0);
|
||||||
TexErr fromPNGFile(const char *filename, u8 f = -1, Alloc alloc = ALLOC_MEM2, u32 minMipSize = 0, u32 maxMipSize = 0);
|
TexErr fromPNGFile(const char *filename, u8 f = -1, Alloc alloc = ALLOC_MEM2, u32 minMipSize = 0, u32 maxMipSize = 0);
|
||||||
TexErr fromRAW(const u8 *buffer, u32 w, u32 h, u8 f = -1, Alloc alloc = ALLOC_MEM2);
|
TexErr fromRAW(const u8 *buffer, u32 w, u32 h, Alloc alloc = ALLOC_MEM2);
|
||||||
|
TexErr fromJPG(const u8 *buffer, const u32 buffer_size);
|
||||||
private:
|
private:
|
||||||
static void _resize(u8 *dst, u32 dstWidth, u32 dstHeight, const u8 *src, u32 srcWidth, u32 srcHeight);
|
static void _resize(u8 *dst, u32 dstWidth, u32 dstHeight, const u8 *src, u32 srcWidth, u32 srcHeight);
|
||||||
static void _resizeD2x2(u8 *dst, const u8 *src, u32 srcWidth, u32 srcHeight);
|
static void _resizeD2x2(u8 *dst, const u8 *src, u32 srcWidth, u32 srcHeight);
|
||||||
|
@ -7,11 +7,23 @@
|
|||||||
|
|
||||||
#define DEFAULT_FIFO_SIZE (256 * 1024)
|
#define DEFAULT_FIFO_SIZE (256 * 1024)
|
||||||
|
|
||||||
extern const u8 wait_01_png[];
|
extern const u8 wait_01_jpg[];
|
||||||
extern const u8 wait_02_png[];
|
extern const u32 wait_01_jpg_size;
|
||||||
extern const u8 wait_03_png[];
|
extern const u8 wait_02_jpg[];
|
||||||
extern const u8 wait_04_png[];
|
extern const u32 wait_02_jpg_size;
|
||||||
extern const u8 wait_05_png[];
|
extern const u8 wait_03_jpg[];
|
||||||
|
extern const u32 wait_03_jpg_size;
|
||||||
|
extern const u8 wait_04_jpg[];
|
||||||
|
extern const u32 wait_04_jpg_size;
|
||||||
|
extern const u8 wait_05_jpg[];
|
||||||
|
extern const u32 wait_05_jpg_size;
|
||||||
|
extern const u8 wait_06_jpg[];
|
||||||
|
extern const u32 wait_06_jpg_size;
|
||||||
|
extern const u8 wait_07_jpg[];
|
||||||
|
extern const u32 wait_07_jpg_size;
|
||||||
|
extern const u8 wait_08_jpg[];
|
||||||
|
extern const u32 wait_08_jpg_size;
|
||||||
|
|
||||||
vector<STexture> m_defaultWaitMessages;
|
vector<STexture> m_defaultWaitMessages;
|
||||||
|
|
||||||
const float CVideo::_jitter2[2][2] = {
|
const float CVideo::_jitter2[2][2] = {
|
||||||
@ -489,15 +501,10 @@ void CVideo::_showWaitMessages(CVideo *m)
|
|||||||
m->waitMessage(*waitItr);
|
m->waitMessage(*waitItr);
|
||||||
waitItr += PNGfadeDirection;
|
waitItr += PNGfadeDirection;
|
||||||
|
|
||||||
if (m->m_useWiiLight)
|
|
||||||
{
|
|
||||||
wiiLightSetLevel(0);
|
wiiLightSetLevel(0);
|
||||||
wiiLightOn();
|
wiiLightOn();
|
||||||
}
|
|
||||||
|
|
||||||
while(m->m_showWaitMessage)
|
while(m->m_showWaitMessage)
|
||||||
{
|
|
||||||
if (m->m_useWiiLight)
|
|
||||||
{
|
{
|
||||||
currentLightLevel += (fadeStep * fadeDirection);
|
currentLightLevel += (fadeStep * fadeDirection);
|
||||||
if(currentLightLevel >= 255)
|
if(currentLightLevel >= 255)
|
||||||
@ -511,22 +518,20 @@ void CVideo::_showWaitMessages(CVideo *m)
|
|||||||
fadeDirection = 1;
|
fadeDirection = 1;
|
||||||
}
|
}
|
||||||
wiiLightSetLevel(currentLightLevel);
|
wiiLightSetLevel(currentLightLevel);
|
||||||
}
|
|
||||||
|
|
||||||
if(waitFrames == 0)
|
if(waitFrames == 0)
|
||||||
{
|
{
|
||||||
m->waitMessage(*waitItr);
|
m->waitMessage(*waitItr);
|
||||||
waitItr += PNGfadeDirection;
|
waitItr += PNGfadeDirection;
|
||||||
|
|
||||||
if(waitItr + 1 == m->m_waitMessages.end() || waitItr == m->m_waitMessages.begin())
|
if(waitItr == m->m_waitMessages.end())
|
||||||
PNGfadeDirection *= (-1);
|
waitItr = m->m_waitMessages.begin();
|
||||||
|
|
||||||
waitFrames = frames;
|
waitFrames = frames;
|
||||||
}
|
}
|
||||||
waitFrames--;
|
waitFrames--;
|
||||||
VIDEO_WaitVSync();
|
VIDEO_WaitVSync();
|
||||||
}
|
}
|
||||||
if (m->m_useWiiLight)
|
|
||||||
wiiLightOff();
|
wiiLightOff();
|
||||||
m->m_showingWaitMessages = false;
|
m->m_showingWaitMessages = false;
|
||||||
gprintf("Stop showing images\n");
|
gprintf("Stop showing images\n");
|
||||||
@ -561,28 +566,29 @@ void CVideo::waitMessage(float delay)
|
|||||||
{
|
{
|
||||||
if(m_defaultWaitMessages.size() == 0)
|
if(m_defaultWaitMessages.size() == 0)
|
||||||
{
|
{
|
||||||
STexture m_wTextures[5];
|
STexture m_wTextures[8];
|
||||||
m_wTextures[0].fromPNG(wait_01_png);
|
m_wTextures[0].fromJPG(wait_01_jpg, wait_01_jpg_size);
|
||||||
m_wTextures[1].fromPNG(wait_02_png);
|
m_wTextures[1].fromJPG(wait_02_jpg, wait_02_jpg_size);
|
||||||
m_wTextures[2].fromPNG(wait_03_png);
|
m_wTextures[2].fromJPG(wait_03_jpg, wait_03_jpg_size);
|
||||||
m_wTextures[3].fromPNG(wait_04_png);
|
m_wTextures[3].fromJPG(wait_04_jpg, wait_04_jpg_size);
|
||||||
m_wTextures[4].fromPNG(wait_05_png);
|
m_wTextures[4].fromJPG(wait_05_jpg, wait_05_jpg_size);
|
||||||
for (int i = 0; i < 5; i++)
|
m_wTextures[5].fromJPG(wait_06_jpg, wait_06_jpg_size);
|
||||||
|
m_wTextures[6].fromJPG(wait_07_jpg, wait_07_jpg_size);
|
||||||
|
m_wTextures[7].fromJPG(wait_08_jpg, wait_08_jpg_size);
|
||||||
|
for(int i = 0; i < 8; i++)
|
||||||
m_defaultWaitMessages.push_back(m_wTextures[i]);
|
m_defaultWaitMessages.push_back(m_wTextures[i]);
|
||||||
}
|
}
|
||||||
waitMessage(vector<STexture>(), delay);
|
waitMessage(vector<STexture>(), delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CVideo::waitMessage(const vector<STexture> &tex, float delay, bool useWiiLight)
|
void CVideo::waitMessage(const vector<STexture> &tex, float delay)
|
||||||
{
|
{
|
||||||
hideWaitMessage();
|
hideWaitMessage();
|
||||||
|
|
||||||
m_useWiiLight = useWiiLight;
|
|
||||||
|
|
||||||
if(tex.size() == 0)
|
if(tex.size() == 0)
|
||||||
{
|
{
|
||||||
m_waitMessages = m_defaultWaitMessages;
|
m_waitMessages = m_defaultWaitMessages;
|
||||||
m_waitMessageDelay = 0.3f;
|
m_waitMessageDelay = 0.2f;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -70,7 +70,7 @@ public:
|
|||||||
int stencilVal(int x, int y);
|
int stencilVal(int x, int y);
|
||||||
void hideWaitMessage();
|
void hideWaitMessage();
|
||||||
void waitMessage(float delay);
|
void waitMessage(float delay);
|
||||||
void waitMessage(const vector<STexture> &tex, float delay, bool useWiiLight = true);
|
void waitMessage(const vector<STexture> &tex, float delay);
|
||||||
void waitMessage(const STexture &tex);
|
void waitMessage(const STexture &tex);
|
||||||
void CheckWaitThread(bool force = false);
|
void CheckWaitThread(bool force = false);
|
||||||
s32 TakeScreenshot(const char *);
|
s32 TakeScreenshot(const char *);
|
||||||
@ -102,7 +102,6 @@ private:
|
|||||||
float m_waitMessageDelay;
|
float m_waitMessageDelay;
|
||||||
bool m_showWaitMessage;
|
bool m_showWaitMessage;
|
||||||
volatile bool m_showingWaitMessages;
|
volatile bool m_showingWaitMessages;
|
||||||
bool m_useWiiLight;
|
|
||||||
vector<STexture> m_waitMessages;
|
vector<STexture> m_waitMessages;
|
||||||
//
|
//
|
||||||
static const int _stencilWidth;
|
static const int _stencilWidth;
|
||||||
|
@ -36,7 +36,6 @@ extern const u32 hover_wav_size;
|
|||||||
extern const u8 camera_wav[];
|
extern const u8 camera_wav[];
|
||||||
extern const u32 camera_wav_size;
|
extern const u32 camera_wav_size;
|
||||||
// Pics
|
// Pics
|
||||||
extern const u8 wait_png[];
|
|
||||||
extern const u8 btnplus_png[];
|
extern const u8 btnplus_png[];
|
||||||
extern const u8 btnpluss_png[];
|
extern const u8 btnpluss_png[];
|
||||||
extern const u8 btnminus_png[];
|
extern const u8 btnminus_png[];
|
||||||
@ -500,10 +499,7 @@ void CMenu::cleanup(bool hb)
|
|||||||
if(cleaned_up)
|
if(cleaned_up)
|
||||||
return;
|
return;
|
||||||
gprintf("MEM1_freesize(): %i\nMEM2_freesize(): %i\n", MEM1_freesize(), MEM2_freesize());
|
gprintf("MEM1_freesize(): %i\nMEM2_freesize(): %i\n", MEM1_freesize(), MEM2_freesize());
|
||||||
m_cf.stopCoverLoader();
|
|
||||||
_cleanupDefaultFont();
|
_cleanupDefaultFont();
|
||||||
m_cf.clear();
|
|
||||||
|
|
||||||
m_banner->DeleteBanner();
|
m_banner->DeleteBanner();
|
||||||
m_plugin.Cleanup();
|
m_plugin.Cleanup();
|
||||||
|
|
||||||
@ -520,7 +516,11 @@ void CMenu::cleanup(bool hb)
|
|||||||
DeviceHandler::DestroyInstance();
|
DeviceHandler::DestroyInstance();
|
||||||
m_vid.CheckWaitThread(true);
|
m_vid.CheckWaitThread(true);
|
||||||
m_vid.cleanup();
|
m_vid.cleanup();
|
||||||
|
m_cf.shutdown();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
m_cf.clear();
|
||||||
|
|
||||||
wiiLightOff();
|
wiiLightOff();
|
||||||
_deinitNetwork();
|
_deinitNetwork();
|
||||||
|
|
||||||
@ -2331,11 +2331,7 @@ void CMenu::_hideWaitMessage()
|
|||||||
void CMenu::_showWaitMessage()
|
void CMenu::_showWaitMessage()
|
||||||
{
|
{
|
||||||
TexSet texSet;
|
TexSet texSet;
|
||||||
m_vid.waitMessage(
|
m_vid.waitMessage(_textures(texSet, "GENERAL", "waitmessage"), m_theme.getFloat("GENERAL", "waitmessage_delay", 0.f));
|
||||||
_textures(texSet, "GENERAL", "waitmessage"),
|
|
||||||
m_theme.getFloat("GENERAL", "waitmessage_delay", 0.f),
|
|
||||||
m_theme.getBool("GENERAL", "waitmessage_wiilight", m_cfg.getBool("GENERAL", "waitmessage_wiilight", true))
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct map_entry
|
typedef struct map_entry
|
||||||
|