diff --git a/Makefile b/Makefile index 135a56d8..33681ad3 100644 --- a/Makefile +++ b/Makefile @@ -117,6 +117,7 @@ TXTFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.txt))) BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.bin))) TTFFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.ttf))) PNGFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.png))) +JPGFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.jpg))) MP3FILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.mp3))) OGGFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.ogg))) @@ -137,10 +138,9 @@ endif export OFILES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \ $(sFILES:.s=.o) $(SFILES:.S=.o) \ - $(TTFFILES:.ttf=.ttf.o) $(PNGFILES:.png=.png.o) $(DOLFILES:.dol=.dol.o) \ - $(OGGFILES:.ogg=.ogg.o) $(PCMFILES:.pcm=.pcm.o) $(MP3FILES:.mp3=.mp3.o) \ - $(WAVFILES:.wav=.wav.o) $(ELFFILES:.elf=.elf.o) $(BINFILES:.bin=.bin.o) \ - $(TXTFILES:.txt=.txt.o) + $(JPGFILES:.jpg=.jpg.o) $(PNGFILES:.png=.png.o) $(DOLFILES:.dol=.dol.o) \ + $(OGGFILES:.ogg=.ogg.o) $(WAVFILES:.wav=.wav.o) $(MP3FILES:.mp3=.mp3.o) \ + $(ELFFILES:.elf=.elf.o) $(BINFILES:.bin=.bin.o) $(TXTFILES:.txt=.txt.o) \ #--------------------------------------------------------------------------------- # build a list of include paths @@ -210,16 +210,16 @@ $(BUILD)/alt_ios_gen.o: alt_ios_gen.c @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 $<) @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 $<) @bin2s -a 32 $< | $(AS) -o $(@) @@ -230,13 +230,6 @@ $(BUILD)/alt_ios_gen.o: alt_ios_gen.c @echo $(notdir $<) @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 #--------------------------------------------------------------------------------- @@ -244,13 +237,6 @@ $(BUILD)/alt_ios_gen.o: alt_ios_gen.c @echo $(notdir $<) @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 #--------------------------------------------------------------------------------- diff --git a/data/images/dvdskin.jpg b/data/images/dvdskin.jpg new file mode 100644 index 00000000..10fddd77 Binary files /dev/null and b/data/images/dvdskin.jpg differ diff --git a/data/images/dvdskin_black.jpg b/data/images/dvdskin_black.jpg new file mode 100644 index 00000000..870e737d Binary files /dev/null and b/data/images/dvdskin_black.jpg differ diff --git a/data/images/dvdskin_greenone.jpg b/data/images/dvdskin_greenone.jpg new file mode 100644 index 00000000..23f693cb Binary files /dev/null and b/data/images/dvdskin_greenone.jpg differ diff --git a/data/images/dvdskin_greentwo.jpg b/data/images/dvdskin_greentwo.jpg new file mode 100644 index 00000000..6c234b58 Binary files /dev/null and b/data/images/dvdskin_greentwo.jpg differ diff --git a/data/images/dvdskin_red.jpg b/data/images/dvdskin_red.jpg new file mode 100644 index 00000000..1facb4bf Binary files /dev/null and b/data/images/dvdskin_red.jpg differ diff --git a/data/images/dvdskin_yellow.jpg b/data/images/dvdskin_yellow.jpg new file mode 100644 index 00000000..2c494e7f Binary files /dev/null and b/data/images/dvdskin_yellow.jpg differ diff --git a/data/images/wait_01.jpg b/data/images/wait_01.jpg new file mode 100644 index 00000000..5283eefe Binary files /dev/null and b/data/images/wait_01.jpg differ diff --git a/data/images/wait_01.png b/data/images/wait_01.png deleted file mode 100644 index 0ff17f44..00000000 Binary files a/data/images/wait_01.png and /dev/null differ diff --git a/data/images/wait_02.jpg b/data/images/wait_02.jpg new file mode 100644 index 00000000..61c765ff Binary files /dev/null and b/data/images/wait_02.jpg differ diff --git a/data/images/wait_02.png b/data/images/wait_02.png deleted file mode 100644 index af5b7d39..00000000 Binary files a/data/images/wait_02.png and /dev/null differ diff --git a/data/images/wait_03.jpg b/data/images/wait_03.jpg new file mode 100644 index 00000000..9d83b3e6 Binary files /dev/null and b/data/images/wait_03.jpg differ diff --git a/data/images/wait_03.png b/data/images/wait_03.png deleted file mode 100644 index 3b65eb3d..00000000 Binary files a/data/images/wait_03.png and /dev/null differ diff --git a/data/images/wait_04.jpg b/data/images/wait_04.jpg new file mode 100644 index 00000000..31c128b5 Binary files /dev/null and b/data/images/wait_04.jpg differ diff --git a/data/images/wait_04.png b/data/images/wait_04.png deleted file mode 100644 index 4950a17a..00000000 Binary files a/data/images/wait_04.png and /dev/null differ diff --git a/data/images/wait_05.jpg b/data/images/wait_05.jpg new file mode 100644 index 00000000..fe43a944 Binary files /dev/null and b/data/images/wait_05.jpg differ diff --git a/data/images/wait_05.png b/data/images/wait_05.png deleted file mode 100644 index e988b2e1..00000000 Binary files a/data/images/wait_05.png and /dev/null differ diff --git a/data/images/wait_06.jpg b/data/images/wait_06.jpg new file mode 100644 index 00000000..c31dd96d Binary files /dev/null and b/data/images/wait_06.jpg differ diff --git a/data/images/wait_07.jpg b/data/images/wait_07.jpg new file mode 100644 index 00000000..172df584 Binary files /dev/null and b/data/images/wait_07.jpg differ diff --git a/data/images/wait_08.jpg b/data/images/wait_08.jpg new file mode 100644 index 00000000..de4f8b83 Binary files /dev/null and b/data/images/wait_08.jpg differ diff --git a/data/images/dvdskin.png b/resources/theme_pngs/dvdskin.png similarity index 100% rename from data/images/dvdskin.png rename to resources/theme_pngs/dvdskin.png diff --git a/data/images/dvdskin_black.png b/resources/theme_pngs/dvdskin_black.png similarity index 100% rename from data/images/dvdskin_black.png rename to resources/theme_pngs/dvdskin_black.png diff --git a/data/images/dvdskin_greenone.png b/resources/theme_pngs/dvdskin_greenone.png similarity index 100% rename from data/images/dvdskin_greenone.png rename to resources/theme_pngs/dvdskin_greenone.png diff --git a/data/images/dvdskin_greentwo.png b/resources/theme_pngs/dvdskin_greentwo.png similarity index 100% rename from data/images/dvdskin_greentwo.png rename to resources/theme_pngs/dvdskin_greentwo.png diff --git a/data/images/dvdskin_red.png b/resources/theme_pngs/dvdskin_red.png similarity index 100% rename from data/images/dvdskin_red.png rename to resources/theme_pngs/dvdskin_red.png diff --git a/data/images/dvdskin_yellow.png b/resources/theme_pngs/dvdskin_yellow.png similarity index 100% rename from data/images/dvdskin_yellow.png rename to resources/theme_pngs/dvdskin_yellow.png diff --git a/resources/theme_pngs/wait_01.png b/resources/theme_pngs/wait_01.png new file mode 100644 index 00000000..196f0c65 Binary files /dev/null and b/resources/theme_pngs/wait_01.png differ diff --git a/resources/theme_pngs/wait_02.png b/resources/theme_pngs/wait_02.png new file mode 100644 index 00000000..3e532720 Binary files /dev/null and b/resources/theme_pngs/wait_02.png differ diff --git a/resources/theme_pngs/wait_03.png b/resources/theme_pngs/wait_03.png new file mode 100644 index 00000000..7e7021a2 Binary files /dev/null and b/resources/theme_pngs/wait_03.png differ diff --git a/resources/theme_pngs/wait_04.png b/resources/theme_pngs/wait_04.png new file mode 100644 index 00000000..30d69bda Binary files /dev/null and b/resources/theme_pngs/wait_04.png differ diff --git a/resources/theme_pngs/wait_05.png b/resources/theme_pngs/wait_05.png new file mode 100644 index 00000000..0dc8a367 Binary files /dev/null and b/resources/theme_pngs/wait_05.png differ diff --git a/resources/theme_pngs/wait_06.png b/resources/theme_pngs/wait_06.png new file mode 100644 index 00000000..556e368c Binary files /dev/null and b/resources/theme_pngs/wait_06.png differ diff --git a/resources/theme_pngs/wait_07.png b/resources/theme_pngs/wait_07.png new file mode 100644 index 00000000..b5f48025 Binary files /dev/null and b/resources/theme_pngs/wait_07.png differ diff --git a/resources/theme_pngs/wait_08.png b/resources/theme_pngs/wait_08.png new file mode 100644 index 00000000..f52bbd99 Binary files /dev/null and b/resources/theme_pngs/wait_08.png differ diff --git a/source/gui/coverflow.cpp b/source/gui/coverflow.cpp index a1bd225b..1f231500 100644 --- a/source/gui/coverflow.cpp +++ b/source/gui/coverflow.cpp @@ -17,12 +17,19 @@ #include "gecko.h" #include "types.h" -extern const u8 dvdskin_png[]; -extern const u8 dvdskin_red_png[]; -extern const u8 dvdskin_black_png[]; -extern const u8 dvdskin_yellow_png[]; -extern const u8 dvdskin_greenone_png[]; -extern const u8 dvdskin_greentwo_png[]; +extern const u8 dvdskin_jpg[]; +extern const u32 dvdskin_jpg_size; +extern const u8 dvdskin_red_jpg[]; +extern const u32 dvdskin_red_jpg_size; +extern const u8 dvdskin_black_jpg[]; +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 loading_png[]; extern const u8 flatnopic_png[]; @@ -176,6 +183,7 @@ CCoverFlow::CCoverFlow(void) m_minDelay = 5; m_jump = 0; m_mutex = 0; + m_dvdskin_loaded = false; m_loadingCovers = false; m_moved = false; m_selected = false; @@ -649,6 +657,28 @@ void CCoverFlow::clear(void) 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) { m_items.reserve(capacity); @@ -1799,14 +1829,24 @@ bool CCoverFlow::start(const char *id) sort(m_items.begin(), m_items.end(), CCoverFlow::_sortByWifiPlayers); // Load resident textures - if (STexture::TE_OK != m_dvdSkin.fromPNG(dvdskin_png)) return false; - 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 (STexture::TE_OK != m_dvdSkin_Yellow.fromPNG(dvdskin_yellow_png)) return false; - if (STexture::TE_OK != m_dvdSkin_GreenOne.fromPNG(dvdskin_greenone_png)) return false; - if (STexture::TE_OK != m_dvdSkin_GreenTwo.fromPNG(dvdskin_greentwo_png)) return false; + if(!m_dvdskin_loaded) + { + if(m_dvdSkin.fromJPG(dvdskin_jpg, dvdskin_jpg_size) != STexture::TE_OK) + return false; + if(m_dvdSkin_Red.fromJPG(dvdskin_red_jpg, dvdskin_red_jpg_size) != STexture::TE_OK) + 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) { if (m_pngLoadCover.empty() || STexture::TE_OK != m_loadingTexture.fromPNGFile(m_pngLoadCover.c_str(), GX_TF_CMPR, ALLOC_MEM2, 32, 512)) if (STexture::TE_OK != m_loadingTexture.fromPNG(loading_png, GX_TF_CMPR, ALLOC_MEM2, 32, 512)) return false; diff --git a/source/gui/coverflow.hpp b/source/gui/coverflow.hpp index 3d8dcd19..4580b99f 100644 --- a/source/gui/coverflow.hpp +++ b/source/gui/coverflow.hpp @@ -43,6 +43,7 @@ public: bool init(const SmartBuf &font, u32 font_size, bool vid_50hz); // Cover list management void clear(void); + void shutdown(void); void reserve(u32 capacity); 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(); } @@ -259,6 +260,7 @@ private: bool m_fanartPlaying; bool m_box; bool m_useHQcover; + bool m_dvdskin_loaded; u32 m_range; u32 m_rows; u32 m_columns; diff --git a/source/gui/gcvid.cpp b/source/gui/gcvid.cpp index 2df6696b..7ef60d92 100644 --- a/source/gui/gcvid.cpp +++ b/source/gui/gcvid.cpp @@ -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) { //convert format so jpeglib understands it... diff --git a/source/gui/gcvid.h b/source/gui/gcvid.h index 4023a69e..0353cd91 100644 --- a/source/gui/gcvid.h +++ b/source/gui/gcvid.h @@ -330,4 +330,6 @@ class JpgVideoFile : public VideoFile VideoFrame _currFrame; }; +void decodeRealJpeg(const u8* data, int size, VideoFrame& dest); + #endif //THAKIS_GCVID_H diff --git a/source/gui/texture.cpp b/source/gui/texture.cpp index 6416dd87..15187118 100644 --- a/source/gui/texture.cpp +++ b/source/gui/texture.cpp @@ -4,6 +4,7 @@ #include "texture.hpp" #include "pngu.h" +#include "gcvid.h" 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; } -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: - tmpData = smartMem2Alloc(GX_GetTexBufferSize(w, h, f, GX_FALSE, 0)); + rawData = smartMem2Alloc(GX_GetTexBufferSize(w, h, format, GX_FALSE, 0)); break; case ALLOC_MALLOC: - tmpData = smartMemAlign32(GX_GetTexBufferSize(w, h, f, GX_FALSE, 0)); + rawData = smartMemAlign32(GX_GetTexBufferSize(w, h, format, GX_FALSE, 0)); break; } - if (!tmpData) return STexture::TE_NOMEM; + if(rawData.get() == NULL) + return STexture::TE_NOMEM; - format = f; width = w; height = h; maxLOD = 0; - data = tmpData; - switch (f) - { - 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; - } + STexture::_convertToFlippedRGBA8(rawData.get(), buffer, width, height); + data = rawData; DCFlushRange(data.get(), GX_GetTexBufferSize(width, height, format, GX_FALSE, 0)); 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) { PNGUPROP imgProp; diff --git a/source/gui/texture.hpp b/source/gui/texture.hpp index 8ad87c25..b54f49ca 100644 --- a/source/gui/texture.hpp +++ b/source/gui/texture.hpp @@ -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 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 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: 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); diff --git a/source/gui/video.cpp b/source/gui/video.cpp index aba49656..d84ad3c2 100644 --- a/source/gui/video.cpp +++ b/source/gui/video.cpp @@ -7,11 +7,23 @@ #define DEFAULT_FIFO_SIZE (256 * 1024) -extern const u8 wait_01_png[]; -extern const u8 wait_02_png[]; -extern const u8 wait_03_png[]; -extern const u8 wait_04_png[]; -extern const u8 wait_05_png[]; +extern const u8 wait_01_jpg[]; +extern const u32 wait_01_jpg_size; +extern const u8 wait_02_jpg[]; +extern const u32 wait_02_jpg_size; +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 m_defaultWaitMessages; const float CVideo::_jitter2[2][2] = { @@ -489,45 +501,38 @@ void CVideo::_showWaitMessages(CVideo *m) m->waitMessage(*waitItr); waitItr += PNGfadeDirection; - if (m->m_useWiiLight) - { - wiiLightSetLevel(0); - wiiLightOn(); - } + wiiLightSetLevel(0); + wiiLightOn(); - while (m->m_showWaitMessage) + while(m->m_showWaitMessage) { - if (m->m_useWiiLight) + currentLightLevel += (fadeStep * fadeDirection); + if(currentLightLevel >= 255) { - currentLightLevel += (fadeStep * fadeDirection); - if (currentLightLevel >= 255) - { - currentLightLevel = 255; - fadeDirection = -1; - } - else if (currentLightLevel <= 0) - { - currentLightLevel = 0; - fadeDirection = 1; - } - wiiLightSetLevel(currentLightLevel); + currentLightLevel = 255; + fadeDirection = -1; } - - if (waitFrames == 0) + else if(currentLightLevel <= 0) + { + currentLightLevel = 0; + fadeDirection = 1; + } + wiiLightSetLevel(currentLightLevel); + + if(waitFrames == 0) { m->waitMessage(*waitItr); waitItr += PNGfadeDirection; - if(waitItr + 1 == m->m_waitMessages.end() || waitItr == m->m_waitMessages.begin()) - PNGfadeDirection *= (-1); + if(waitItr == m->m_waitMessages.end()) + waitItr = m->m_waitMessages.begin(); waitFrames = frames; } waitFrames--; VIDEO_WaitVSync(); } - if (m->m_useWiiLight) - wiiLightOff(); + wiiLightOff(); m->m_showingWaitMessages = false; gprintf("Stop showing images\n"); } @@ -561,28 +566,29 @@ void CVideo::waitMessage(float delay) { if(m_defaultWaitMessages.size() == 0) { - STexture m_wTextures[5]; - m_wTextures[0].fromPNG(wait_01_png); - m_wTextures[1].fromPNG(wait_02_png); - m_wTextures[2].fromPNG(wait_03_png); - m_wTextures[3].fromPNG(wait_04_png); - m_wTextures[4].fromPNG(wait_05_png); - for (int i = 0; i < 5; i++) + STexture m_wTextures[8]; + m_wTextures[0].fromJPG(wait_01_jpg, wait_01_jpg_size); + m_wTextures[1].fromJPG(wait_02_jpg, wait_02_jpg_size); + m_wTextures[2].fromJPG(wait_03_jpg, wait_03_jpg_size); + m_wTextures[3].fromJPG(wait_04_jpg, wait_04_jpg_size); + m_wTextures[4].fromJPG(wait_05_jpg, wait_05_jpg_size); + 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]); } waitMessage(vector(), delay); } -void CVideo::waitMessage(const vector &tex, float delay, bool useWiiLight) +void CVideo::waitMessage(const vector &tex, float delay) { hideWaitMessage(); - m_useWiiLight = useWiiLight; - - if (tex.size() == 0) + if(tex.size() == 0) { m_waitMessages = m_defaultWaitMessages; - m_waitMessageDelay = 0.3f; + m_waitMessageDelay = 0.2f; } else { @@ -593,7 +599,7 @@ void CVideo::waitMessage(const vector &tex, float delay, bool useWiiLi if (m_waitMessages.size() == 1) waitMessage(m_waitMessages[0]); - else if (m_waitMessages.size() > 1) + else if(m_waitMessages.size() > 1) { CheckWaitThread(); m_showWaitMessage = true; diff --git a/source/gui/video.hpp b/source/gui/video.hpp index 7af5879d..ff467c4d 100644 --- a/source/gui/video.hpp +++ b/source/gui/video.hpp @@ -70,7 +70,7 @@ public: int stencilVal(int x, int y); void hideWaitMessage(); void waitMessage(float delay); - void waitMessage(const vector &tex, float delay, bool useWiiLight = true); + void waitMessage(const vector &tex, float delay); void waitMessage(const STexture &tex); void CheckWaitThread(bool force = false); s32 TakeScreenshot(const char *); @@ -102,7 +102,6 @@ private: float m_waitMessageDelay; bool m_showWaitMessage; volatile bool m_showingWaitMessages; - bool m_useWiiLight; vector m_waitMessages; // static const int _stencilWidth; diff --git a/source/menu/menu.cpp b/source/menu/menu.cpp index 5ec93259..5ddc0748 100644 --- a/source/menu/menu.cpp +++ b/source/menu/menu.cpp @@ -36,7 +36,6 @@ extern const u32 hover_wav_size; extern const u8 camera_wav[]; extern const u32 camera_wav_size; // Pics -extern const u8 wait_png[]; extern const u8 btnplus_png[]; extern const u8 btnpluss_png[]; extern const u8 btnminus_png[]; @@ -500,10 +499,7 @@ void CMenu::cleanup(bool hb) if(cleaned_up) return; gprintf("MEM1_freesize(): %i\nMEM2_freesize(): %i\n", MEM1_freesize(), MEM2_freesize()); - m_cf.stopCoverLoader(); _cleanupDefaultFont(); - m_cf.clear(); - m_banner->DeleteBanner(); m_plugin.Cleanup(); @@ -520,7 +516,11 @@ void CMenu::cleanup(bool hb) DeviceHandler::DestroyInstance(); m_vid.CheckWaitThread(true); m_vid.cleanup(); + m_cf.shutdown(); } + else + m_cf.clear(); + wiiLightOff(); _deinitNetwork(); @@ -2331,11 +2331,7 @@ void CMenu::_hideWaitMessage() void CMenu::_showWaitMessage() { TexSet texSet; - m_vid.waitMessage( - _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)) - ); + m_vid.waitMessage(_textures(texSet, "GENERAL", "waitmessage"), m_theme.getFloat("GENERAL", "waitmessage_delay", 0.f)); } typedef struct map_entry diff --git a/wiiflow.pnproj b/wiiflow.pnproj index 9ecf4cdb..ff80e0aa 100644 --- a/wiiflow.pnproj +++ b/wiiflow.pnproj @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file