Add placeholder application icon

This commit is contained in:
Jonas Kulla 2014-11-29 17:23:42 +01:00
parent cfd9345e87
commit 5979c5f778
5 changed files with 96 additions and 11 deletions

View File

@ -230,6 +230,7 @@ set(EMBEDDED_INPUT
shader/blurV.vert
shader/simpleMatrix.vert
assets/liberation.ttf
assets/icon.png
)
if (RGSS2)

BIN
assets/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

76
assets/icon.svg Normal file
View File

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="744.09448819"
height="1052.3622047"
id="svg2"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="icon.svg"
inkscape:export-filename="/home/Ancurio/programming/C++/mkxp/assets/icon.png"
inkscape:export-xdpi="13.53801"
inkscape:export-ydpi="13.53801">
<defs
id="defs4">
<linearGradient
id="linearGradient3821">
<stop
style="stop-color:#00ff88;stop-opacity:1;"
offset="0"
id="stop3823" />
<stop
style="stop-color:#00ff86;stop-opacity:1;"
offset="1"
id="stop3825" />
</linearGradient>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.49497475"
inkscape:cx="313.90532"
inkscape:cy="517.4865"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="978"
inkscape:window-height="599"
inkscape:window-x="264"
inkscape:window-y="516"
inkscape:window-maximized="0" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<path
style="fill:#00ff87;fill-opacity:1;stroke:#000000;stroke-width:24;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
d="M 373.75 285.9375 C 262.88803 285.9375 173.03125 375.82553 173.03125 486.6875 C 173.03125 597.54947 262.88803 687.40625 373.75 687.40625 C 484.61197 687.40625 574.5 597.54947 574.5 486.6875 C 574.5 375.82553 484.61197 285.9375 373.75 285.9375 z M 373.75 400 C 421.61925 400 460.4375 438.81825 460.4375 486.6875 C 460.4375 534.55675 421.61925 573.34375 373.75 573.34375 C 325.88075 573.34375 287.09375 534.55675 287.09375 486.6875 C 287.09375 438.81825 325.88075 400 373.75 400 z "
id="path2985"
inkscape:export-xdpi="13.79744"
inkscape:export-ydpi="13.79744" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -202,7 +202,8 @@ EMBED = \
shader/blurV.vert \
shader/simpleMatrix.vert \
shader/tilemapvx.vert \
assets/liberation.ttf
assets/liberation.ttf \
assets/icon.png
SHARED_FLUID {
DEFINES += SHARED_FLUID

View File

@ -26,6 +26,9 @@
#include <SDL_ttf.h>
#include <SDL_sound.h>
#include <unistd.h>
#include <string.h>
#include <assert.h>
#include <string>
#include "sharedstate.h"
@ -37,9 +40,7 @@
#include "binding.h"
#include <unistd.h>
#include <string.h>
#include <assert.h>
#include "icon.png.xxd"
static void
rgssThreadError(RGSSThreadData *rtData, const std::string &msg)
@ -236,6 +237,16 @@ int main(int argc, char *argv[])
return 0;
}
/* Setup application icon */
SDL_RWops *iconSrc;
if (conf.iconPath.empty())
iconSrc = SDL_RWFromConstMem(assets_icon_png, assets_icon_png_len);
else
iconSrc = SDL_RWFromFile(conf.iconPath.c_str(), "rb");
SDL_Surface *iconImg = IMG_Load_RW(iconSrc, SDL_TRUE);
SDL_SetHint("SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS", "0");
SDL_Window *win;
@ -256,14 +267,10 @@ int main(int argc, char *argv[])
return 0;
}
if (!conf.iconPath.empty())
if (iconImg)
{
SDL_Surface *iconImg = IMG_Load(conf.iconPath.c_str());
if (iconImg)
{
SDL_SetWindowIcon(win, iconImg);
SDL_FreeSurface(iconImg);
}
SDL_SetWindowIcon(win, iconImg);
SDL_FreeSurface(iconImg);
}
EventThread eventThread;