From d099bdde849290ec678a8afbd5e51aa5be4e4edb Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Sun, 18 Jun 2023 01:24:28 -0700 Subject: [PATCH] Include game icon in executable and game window (such a PITA) --- Crawler/Crawler.rc | 57 ++++++++++++++++++++++++++++++++ Crawler/Crawler.vcxproj | 8 +++++ Crawler/Crawler.vcxproj.filters | 21 +++++++++++- Crawler/RCa12948 | Bin 0 -> 3504 bytes Crawler/assets/heart.ico | Bin 0 -> 382 bytes Crawler/olcPixelGameEngine.h | 6 +++- Crawler/resource.h | 16 +++++++++ Crawler/resource1.h | 17 ++++++++++ 8 files changed, 123 insertions(+), 2 deletions(-) create mode 100644 Crawler/Crawler.rc create mode 100644 Crawler/RCa12948 create mode 100644 Crawler/assets/heart.ico create mode 100644 Crawler/resource.h create mode 100644 Crawler/resource1.h diff --git a/Crawler/Crawler.rc b/Crawler/Crawler.rc new file mode 100644 index 00000000..dac9e0e4 --- /dev/null +++ b/Crawler/Crawler.rc @@ -0,0 +1,57 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" +///////////////////////////////////////////////////////////////////////////// +// English (United States) resources + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +MAINICON ICON "assets\\heart.ico" + + + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/Crawler/Crawler.vcxproj b/Crawler/Crawler.vcxproj index 0c199478..0b19cfbc 100644 --- a/Crawler/Crawler.vcxproj +++ b/Crawler/Crawler.vcxproj @@ -144,6 +144,8 @@ + + @@ -165,6 +167,12 @@ + + + + + + diff --git a/Crawler/Crawler.vcxproj.filters b/Crawler/Crawler.vcxproj.filters index e3726162..88e7fd9f 100644 --- a/Crawler/Crawler.vcxproj.filters +++ b/Crawler/Crawler.vcxproj.filters @@ -9,10 +9,13 @@ {93995380-89BD-4b04-88EB-625FBE52EBFB} h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + {50277c8c-92cf-4eef-81ed-3e70ff51ec56} + @@ -63,6 +66,12 @@ Header Files + + Header Files + + + Header Files + @@ -107,4 +116,14 @@ Documentation + + + Resource Files + + + + + Resource Files + + \ No newline at end of file diff --git a/Crawler/RCa12948 b/Crawler/RCa12948 new file mode 100644 index 0000000000000000000000000000000000000000..2988db1026f87df5c6998c2aec176061cbeda283 GIT binary patch literal 3504 zcmdUyU2hUW6o${WiT`1R8ygK;C`7#jT9F8}DbQ#_LI_`yC^TJ~-t@=&yfeFD%crOp z+f3NqIdjg;Iq$sZ%#gL8HnX{nEwEF|Sk*pRkJhyi*&R>yLUg9KK+pFUcF))l4fXGM z-!kfTtMmuK6Cl)e^w7rz6m5wBuRB0izF zuwS6J1S_G~A?j~D>qK28PT_HZJkM`^e-7`+gTvR`ZQqSkW{!PKAByrw-eqCg-0^Gz z4u8j$r#a(Un9hjfsPzum{W;mH`V+#Dz+S_NIlVY*+kE*P4(((MOTq}jWCi;W$!26= zV6P%%eJ+kzp=_UFq0hlK`PL;Ht9a6fjSZUCd87q9Ej!F{4d?qND>jg}kal_3 z9Is=E*Q+sio!tInZ<)J|UImG_S=Z<@>Z?GO`lPIyl1T&XhUAp0OCPzUVNgOMJ2oeU$#zkoH>eC}^nx=j`)u{?|R?Kv^?%2fp6Ag?_hD<&2rcGO``g^c#v z;^qG4_4ex|M>AB4kT#~8`Wu?g;{iLWo6jx#GmZGuq#kJ(>QqGCO@hSN{#kT4TST)Y zcdclp13dUYXF$4Hkwm0Kz4lB{P2P9%Z{|a~ql`JO_rKl=Ri6&s30Ij^dKR@IOV(|# Og>!O8|7ZTBCjJIap{nfw literal 0 HcmV?d00001 diff --git a/Crawler/assets/heart.ico b/Crawler/assets/heart.ico new file mode 100644 index 0000000000000000000000000000000000000000..4cdd093b549d5c85cc60c4d95d40518a470e3711 GIT binary patch literal 382 zcmZQzU<5)z0RaXE1{Q`4Mg|5kAWH*?1%X%rh#7(6_y8-bKZCGvG=qXdFFs{N$r&J2 zF$*KuhJtVjWJ{IhRh_#@xI@PogB;RAaE!vp39h69WZ3^0hU9>fR9fz&)`ZeRca#XA_Y literal 0 HcmV?d00001 diff --git a/Crawler/olcPixelGameEngine.h b/Crawler/olcPixelGameEngine.h index 43fb9460..f55ab4fb 100644 --- a/Crawler/olcPixelGameEngine.h +++ b/Crawler/olcPixelGameEngine.h @@ -5414,7 +5414,11 @@ namespace olc virtual olc::rcode CreateWindowPane(const olc::vi2d& vWindowPos, olc::vi2d& vWindowSize, bool bFullScreen) override { WNDCLASS wc; - wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); + wc.hIcon = static_cast(::LoadImage(GetModuleHandle(nullptr), + MAKEINTRESOURCE(102), + IMAGE_ICON, + 48, 48, + LR_DEFAULTCOLOR));; wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; wc.hInstance = GetModuleHandle(nullptr); diff --git a/Crawler/resource.h b/Crawler/resource.h new file mode 100644 index 00000000..c05965c6 --- /dev/null +++ b/Crawler/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by Crawler.rc +// +#define MAINICON 102 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 103 +#endif +#endif diff --git a/Crawler/resource1.h b/Crawler/resource1.h new file mode 100644 index 00000000..96294d9c --- /dev/null +++ b/Crawler/resource1.h @@ -0,0 +1,17 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by Crawler1.rc +// +#define MAINICON 101 +#define IDB_PNG1 102 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 103 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif