Commit 2d9fbfaf authored by Aloshi's avatar Aloshi

New icon + splash screen.

Fixed window icon being upside down.
parent 23b826c4
......@@ -311,8 +311,8 @@ set(ES_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/src/animations/AnimationController.cpp
${CMAKE_CURRENT_SOURCE_DIR}/data/ResourceUtil.cpp
${CMAKE_CURRENT_SOURCE_DIR}/data/converted/ES_logo_16_png.cpp
${CMAKE_CURRENT_SOURCE_DIR}/data/converted/ES_logo_32_png.cpp
${CMAKE_CURRENT_SOURCE_DIR}/data/converted/splash_svg.cpp
${CMAKE_CURRENT_SOURCE_DIR}/data/converted/window_icon_256_png.cpp
${CMAKE_CURRENT_SOURCE_DIR}/data/converted/button_png.cpp
${CMAKE_CURRENT_SOURCE_DIR}/data/converted/button_filled_png.cpp
${CMAKE_CURRENT_SOURCE_DIR}/data/converted/textinput_ninepatch_png.cpp
......
......@@ -13,8 +13,6 @@ const Res2hEntry res2hFiles[res2hNrOfFiles] = {
{":/button_filled.png", button_filled_png_size, button_filled_png_data},
{":/checkbox_checked.svg", checkbox_checked_svg_size, checkbox_checked_svg_data},
{":/checkbox_unchecked.svg", checkbox_unchecked_svg_size, checkbox_unchecked_svg_data},
{":/ES_logo_16.png", ES_logo_16_png_size, ES_logo_16_png_data},
{":/ES_logo_32.png", ES_logo_32_png_size, ES_logo_32_png_data},
{":/fav_add.svg", fav_add_svg_size, fav_add_svg_data},
{":/fav_remove.svg", fav_remove_svg_size, fav_remove_svg_data},
{":/frame.png", frame_png_size, frame_png_data},
......@@ -25,10 +23,12 @@ const Res2hEntry res2hFiles[res2hNrOfFiles] = {
{":/option_arrow.svg", option_arrow_svg_size, option_arrow_svg_data},
{":/scroll_gradient.png", scroll_gradient_png_size, scroll_gradient_png_data},
{":/slider_knob.svg", slider_knob_svg_size, slider_knob_svg_data},
{":/splash.svg", splash_svg_size, splash_svg_data},
{":/star_filled.svg", star_filled_svg_size, star_filled_svg_data},
{":/star_unfilled.svg", star_unfilled_svg_size, star_unfilled_svg_data},
{":/textinput_ninepatch.png", textinput_ninepatch_png_size, textinput_ninepatch_png_data},
{":/textinput_ninepatch_active.png", textinput_ninepatch_active_png_size, textinput_ninepatch_active_png_data},
{":/window_icon_256.png", window_icon_256_png_size, window_icon_256_png_data},
{":/help/button_a.svg", help_button_a_svg_size, help_button_a_svg_data},
{":/help/button_b.svg", help_button_b_svg_size, help_button_b_svg_data},
{":/help/button_l.svg", help_button_l_svg_size, help_button_l_svg_data},
......@@ -56,22 +56,22 @@ res2hMapType::value_type mapTemp[] = {
std::make_pair(":/button_filled.png", res2hFiles[6]),
std::make_pair(":/checkbox_checked.svg", res2hFiles[7]),
std::make_pair(":/checkbox_unchecked.svg", res2hFiles[8]),
std::make_pair(":/ES_logo_16.png", res2hFiles[9]),
std::make_pair(":/ES_logo_32.png", res2hFiles[10]),
std::make_pair(":/fav_add.svg", res2hFiles[11]),
std::make_pair(":/fav_remove.svg", res2hFiles[12]),
std::make_pair(":/frame.png", res2hFiles[13]),
std::make_pair(":/off.svg", res2hFiles[14]),
std::make_pair(":/on.svg", res2hFiles[15]),
std::make_pair(":/opensans_hebrew_condensed_light.ttf", res2hFiles[16]),
std::make_pair(":/opensans_hebrew_condensed_regular.ttf", res2hFiles[17]),
std::make_pair(":/option_arrow.svg", res2hFiles[18]),
std::make_pair(":/scroll_gradient.png", res2hFiles[19]),
std::make_pair(":/slider_knob.svg", res2hFiles[20]),
std::make_pair(":/star_filled.svg", res2hFiles[21]),
std::make_pair(":/star_unfilled.svg", res2hFiles[22]),
std::make_pair(":/textinput_ninepatch.png", res2hFiles[23]),
std::make_pair(":/textinput_ninepatch_active.png", res2hFiles[24]),
std::make_pair(":/fav_add.svg", res2hFiles[9]),
std::make_pair(":/fav_remove.svg", res2hFiles[10]),
std::make_pair(":/frame.png", res2hFiles[11]),
std::make_pair(":/off.svg", res2hFiles[12]),
std::make_pair(":/on.svg", res2hFiles[13]),
std::make_pair(":/opensans_hebrew_condensed_light.ttf", res2hFiles[14]),
std::make_pair(":/opensans_hebrew_condensed_regular.ttf", res2hFiles[15]),
std::make_pair(":/option_arrow.svg", res2hFiles[16]),
std::make_pair(":/scroll_gradient.png", res2hFiles[17]),
std::make_pair(":/slider_knob.svg", res2hFiles[18]),
std::make_pair(":/splash.svg", res2hFiles[19]),
std::make_pair(":/star_filled.svg", res2hFiles[20]),
std::make_pair(":/star_unfilled.svg", res2hFiles[21]),
std::make_pair(":/textinput_ninepatch.png", res2hFiles[22]),
std::make_pair(":/textinput_ninepatch_active.png", res2hFiles[23]),
std::make_pair(":/window_icon_256.png", res2hFiles[24]),
std::make_pair(":/help/button_a.svg", res2hFiles[25]),
std::make_pair(":/help/button_b.svg", res2hFiles[26]),
std::make_pair(":/help/button_l.svg", res2hFiles[27]),
......
......@@ -32,12 +32,6 @@ extern const unsigned char checkbox_checked_svg_data[];
extern const size_t checkbox_unchecked_svg_size;
extern const unsigned char checkbox_unchecked_svg_data[];
extern const size_t ES_logo_16_png_size;
extern const unsigned char ES_logo_16_png_data[];
extern const size_t ES_logo_32_png_size;
extern const unsigned char ES_logo_32_png_data[];
extern const size_t fav_add_svg_size;
extern const unsigned char fav_add_svg_data[];
......@@ -68,6 +62,9 @@ extern const unsigned char scroll_gradient_png_data[];
extern const size_t slider_knob_svg_size;
extern const unsigned char slider_knob_svg_data[];
extern const size_t splash_svg_size;
extern const unsigned char splash_svg_data[];
extern const size_t star_filled_svg_size;
extern const unsigned char star_filled_svg_data[];
......@@ -80,6 +77,9 @@ extern const unsigned char textinput_ninepatch_png_data[];
extern const size_t textinput_ninepatch_active_png_size;
extern const unsigned char textinput_ninepatch_active_png_data[];
extern const size_t window_icon_256_png_size;
extern const unsigned char window_icon_256_png_data[];
extern const size_t help_button_a_svg_size;
extern const unsigned char help_button_a_svg_data[];
......
//this file was auto-generated from "ES_logo_16.png" by res2h
#include "../Resources.h"
const size_t ES_logo_16_png_size = 954;
const unsigned char ES_logo_16_png_data[954] = {
0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,
0x00,0x0d,0x49,0x48,0x44,0x52,0x00,0x00,0x00,0x10,
0x00,0x00,0x00,0x10,0x08,0x06,0x00,0x00,0x00,0x1f,
0xf3,0xff,0x61,0x00,0x00,0x00,0x04,0x73,0x42,0x49,
0x54,0x08,0x08,0x08,0x08,0x7c,0x08,0x64,0x88,0x00,
0x00,0x00,0x09,0x70,0x48,0x59,0x73,0x00,0x00,0x00,
0xc0,0x00,0x00,0x00,0xc0,0x01,0x30,0x77,0xdf,0x5e,
0x00,0x00,0x00,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,
0x66,0x74,0x77,0x61,0x72,0x65,0x00,0x77,0x77,0x77,
0x2e,0x69,0x6e,0x6b,0x73,0x63,0x61,0x70,0x65,0x2e,
0x6f,0x72,0x67,0x9b,0xee,0x3c,0x1a,0x00,0x00,0x03,
0x37,0x49,0x44,0x41,0x54,0x38,0x8d,0x75,0x93,0x5d,
0x68,0x9b,0x75,0x14,0xc6,0x9f,0xf3,0xcf,0x67,0xb3,
0xb6,0xf2,0xe6,0xa3,0x1b,0xef,0x3a,0xa9,0x59,0x43,
0xda,0x24,0x14,0xd2,0x37,0xe8,0xfc,0xa0,0x6e,0xdd,
0x86,0x48,0xb7,0xc9,0x36,0x64,0xe2,0xc0,0x0e,0xa3,
0xa0,0x5d,0xd7,0x8b,0x3a,0xe8,0xc5,0xae,0xd4,0x5d,
0x88,0x17,0xbb,0x08,0xf3,0xca,0x4d,0xe8,0x6e,0x62,
0xaf,0xf4,0xca,0x0f,0xba,0x6a,0x19,0x8c,0x81,0xeb,
0x9a,0x20,0xcb,0xd6,0x60,0xa1,0x29,0x34,0x25,0xf6,
0x6d,0xdf,0xb4,0x91,0x9a,0xbc,0x69,0xde,0xff,0xf1,
0xc2,0xb5,0x9b,0x50,0x1f,0x38,0x70,0x2e,0xce,0x81,
0xe7,0x70,0x7e,0x0f,0x31,0x33,0x76,0x53,0xb2,0x7d,
0x64,0xa2,0xbb,0x1a,0x8f,0x03,0xc0,0xe3,0xa6,0x4c,
0xe6,0xe6,0x52,0xea,0xdc,0x6e,0x73,0xf6,0xed,0x26,
0x91,0x48,0x38,0x74,0x3d,0x96,0xb2,0xdb,0x97,0xaf,
0x85,0x64,0xeb,0xd1,0x23,0xb5,0x37,0xa2,0xa7,0x8d,
0x0b,0x21,0x00,0xb0,0x7c,0x8d,0xfa,0xc9,0x17,0x4e,
0x7e,0x64,0x8a,0x47,0x53,0x6a,0xa3,0x31,0xfa,0x30,
0x10,0x18,0x99,0x99,0x99,0xd9,0x02,0x00,0x30,0x33,
0x34,0x4d,0x73,0xa8,0xea,0xd8,0xa4,0x10,0x15,0x56,
0x94,0x74,0x51,0x75,0x16,0xb2,0xf3,0x90,0x9c,0xb5,
0xad,0x73,0xd6,0xb6,0xce,0xf3,0x90,0x9c,0x73,0x9e,
0xcd,0xa6,0x15,0xa5,0x58,0x11,0x82,0xc7,0x54,0x75,
0x52,0xd3,0x34,0x07,0x33,0xff,0xeb,0x40,0xd7,0x63,
0xa9,0x52,0xe9,0xca,0x31,0x29,0x9b,0x51,0x2e,0xbf,
0xad,0x92,0x77,0xbc,0xfe,0xe9,0x9e,0x07,0xb7,0xca,
0x36,0x7d,0x16,0x00,0x7c,0x96,0xbf,0xb7,0x6f,0x73,
0xba,0x6f,0xd0,0x28,0xab,0x02,0xc0,0x95,0x52,0xe9,
0x58,0xc9,0x6e,0x4f,0x01,0xf8,0x18,0xcc,0x8c,0x60,
0xf0,0x78,0x48,0x51,0xd2,0x45,0xa0,0xc1,0xaa,0x7a,
0xf9,0x7e,0x67,0x67,0xff,0x41,0x66,0xc6,0xb3,0xd5,
0xdf,0xd9,0x79,0xf0,0xb2,0xaa,0xde,0x6f,0x00,0x9c,
0x56,0x94,0xe2,0xf1,0x60,0x30,0xc4,0xcc,0x10,0x00,
0xc0,0xb1,0xd6,0xc3,0x9b,0x47,0x5e,0xd6,0xbd,0xbe,
0xf1,0x42,0x6b,0xeb,0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4,0xe5,0x7e,0xfe,0xb1,0xe5,0x7a,0x65,
0x59,0x4c,0xa9,0x4d,0x8d,0xd1,0x87,0x7f,0x3d,0x0d,
0x13,0xfd,0x5f,0x9c,0x47,0x86,0xdb,0x27,0xe2,0x5a,
0x35,0x0e,0x00,0x99,0x07,0x4d,0x99,0xd4,0xf5,0xa5,
0x5d,0xe3,0xfc,0x0f,0x8e,0x59,0x81,0x6e,0x31,0xc1,
0x05,0xe7,0x00,0x00,0x00,0x00,0x49,0x45,0x4e,0x44,
0xae,0x42,0x60,0x82
};
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -20,7 +20,7 @@ BEGIN
BLOCK "040904E4"
BEGIN
VALUE "Comments", "\0"
VALUE "FileDescription", "EmulationStation multi-emulator frontend\0"
VALUE "FileDescription", "EmulationStation - emulator frontend\0"
VALUE "FileVersion", RESOURCE_VERSION_STRING
VALUE "InternalName", "emulationstation.exe\0"
VALUE "LegalCopyright", "\0"
......@@ -36,4 +36,4 @@ BEGIN
END
END
IDI_ES_LOGO ICON DISCARDABLE "../data/logo/ES_logo.ico"
\ No newline at end of file
IDI_ES_LOGO ICON DISCARDABLE "../data/es_icon.ico"
\ No newline at end of file
......@@ -76,3 +76,18 @@ std::vector<unsigned char> ImageIO::loadFromMemoryRGBA32(const unsigned char * d
}
return rawData;
}
void ImageIO::flipPixelsVert(unsigned char* imagePx, const size_t& width, const size_t& height)
{
unsigned int temp;
unsigned int* arr = (unsigned int*)imagePx;
for(size_t y = 0; y < height / 2; y++)
{
for(size_t x = 0; x < width; x++)
{
temp = arr[x + (y * width)];
arr[x + (y * width)] = arr[x + (height * width) - ((y + 1) * width)];
arr[x + (height * width) - ((y + 1) * width)] = temp;
}
}
}
......@@ -8,4 +8,5 @@ class ImageIO
{
public:
static std::vector<unsigned char> loadFromMemoryRGBA32(const unsigned char * data, const size_t size, size_t & width, size_t & height);
static void flipPixelsVert(unsigned char* imagePx, const size_t& width, const size_t& height);
};
\ No newline at end of file
......@@ -75,9 +75,11 @@ namespace Renderer
//set an icon for the window
size_t width = 0;
size_t height = 0;
std::vector<unsigned char> rawData = ImageIO::loadFromMemoryRGBA32(ES_logo_32_png_data, ES_logo_32_png_size, width, height);
std::vector<unsigned char> rawData = ImageIO::loadFromMemoryRGBA32(window_icon_256_png_data, window_icon_256_png_size, width, height);
if (!rawData.empty())
{
ImageIO::flipPixelsVert(rawData.data(), width, height);
//SDL interprets each pixel as a 32-bit number, so our masks must depend on the endianness (byte order) of the machine
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
Uint32 rmask = 0xff000000; Uint32 gmask = 0x00ff0000; Uint32 bmask = 0x0000ff00; Uint32 amask = 0x000000ff;
......
......@@ -232,11 +232,18 @@ void Window::renderLoadingScreen()
{
Eigen::Affine3f trans = Eigen::Affine3f::Identity();
Renderer::setMatrix(trans);
Renderer::drawRect(0, 0, Renderer::getScreenWidth(), Renderer::getScreenHeight(), 0x000000FF);
auto& font = mDefaultFonts.at(2);
TextCache* cache = font->buildTextCache("LOADING", 0, 0, 0xFFFFFFFF);
trans.translation() = Eigen::Vector3f((Renderer::getScreenWidth() - cache->metrics.size.x())/2, (Renderer::getScreenHeight() - cache->metrics.size.y())/2, 0);
Renderer::drawRect(0, 0, Renderer::getScreenWidth(), Renderer::getScreenHeight(), 0xFFFFFFFF);
ImageComponent splash(this);
splash.setResize(Renderer::getScreenWidth() * 0.6f, 0.0f);
splash.setImage(":/splash.svg");
splash.setPosition((Renderer::getScreenWidth() - splash.getSize().x()) / 2, (Renderer::getScreenHeight() - splash.getSize().y()) / 2 * 0.6f);
splash.render(trans);
auto& font = mDefaultFonts.at(1);
TextCache* cache = font->buildTextCache("LOADING...", 0, 0, 0x656565FF);
trans = trans.translate(Eigen::Vector3f(round((Renderer::getScreenWidth() - cache->metrics.size.x()) / 2.0f),
round(Renderer::getScreenHeight() * 0.835f), 0.0f));
Renderer::setMatrix(trans);
font->renderTextCache(cache);
delete cache;
......
......@@ -3,6 +3,7 @@
#include "../nanosvg/nanosvgrast.h"
#include "../Log.h"
#include "../Util.h"
#include "../ImageIO.h"
#define DPI 96
......@@ -77,18 +78,7 @@ void SVGResource::rasterizeAt(size_t width, size_t height)
nsvgRasterize(rast, mSVGImage, 0, 0, height / mSVGImage->height, imagePx, width, height, width * 4);
nsvgDeleteRasterizer(rast);
// flip the pixels
unsigned int temp;
unsigned int* arr = (unsigned int*)imagePx;
for(size_t y = 0; y < height / 2; y++)
{
for(size_t x = 0; x < width; x++)
{
temp = arr[x + (y * width)];
arr[x + (y * width)] = arr[x + (height * width) - ((y + 1) * width)];
arr[x + (height * width) - ((y + 1) * width)] = temp;
}
}
ImageIO::flipPixelsVert(imagePx, width, height);
initFromPixels(imagePx, width, height);
free(imagePx);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment