From 6265f81b14e95e939119a4e22132cd69261118e0 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Sun, 10 Feb 2019 16:35:23 +0000 Subject: [PATCH 1/3] Added cursors --- Makefile | 2 ++ res/CURSOR/CURSOR_IKA.bmp | Bin 0 -> 654 bytes res/CURSOR/CURSOR_IKA.png | Bin 0 -> 400 bytes res/CURSOR/CURSOR_NORMAL.bmp | Bin 0 -> 258 bytes res/CURSOR/CURSOR_NORMAL.png | Bin 0 -> 338 bytes src/Main.cpp | 22 ++++++++++++ src/Resource.cpp | 14 ++++++++ src/Resource/CURSOR/CURSOR_IKA.bmp.h | 45 ++++++++++++++++++++++++ src/Resource/CURSOR/CURSOR_NORMAL.bmp.h | 21 +++++++++++ 9 files changed, 104 insertions(+) create mode 100644 res/CURSOR/CURSOR_IKA.bmp create mode 100644 res/CURSOR/CURSOR_IKA.png create mode 100644 res/CURSOR/CURSOR_NORMAL.bmp create mode 100644 res/CURSOR/CURSOR_NORMAL.png create mode 100644 src/Resource/CURSOR/CURSOR_IKA.bmp.h create mode 100644 src/Resource/CURSOR/CURSOR_NORMAL.bmp.h diff --git a/Makefile b/Makefile index a8b33ca1..7a6caea2 100644 --- a/Makefile +++ b/Makefile @@ -129,6 +129,8 @@ RESOURCES = \ BITMAP/CREDIT16.bmp \ BITMAP/CREDIT17.bmp \ BITMAP/CREDIT18.bmp \ + CURSOR/CURSOR_IKA.bmp \ + CURSOR/CURSOR_NORMAL.bmp \ ICON/4.bmp \ ORG/ACCESS \ ORG/ANZEN \ diff --git a/res/CURSOR/CURSOR_IKA.bmp b/res/CURSOR/CURSOR_IKA.bmp new file mode 100644 index 0000000000000000000000000000000000000000..6c14d1a20daeb6f858c3ff53b4585fc4e727b32c GIT binary patch literal 654 zcmd5(F%H5o40MUv+aDmYqYQmO6i#Ad;T>#zpfBi~`m=B*NoiOR89!C8V#ikial4P1DS(ZgoN;3RI^dC!T*A_Ii9WFE- zy?AUVoR@Kn72-Cy2Lf+WD&3&4288S>{TQsFDyWPKfCHJ=U=YC-ONBEG8MA=G8%>35 spoj`OoQofUkdF28#HLsww=pfh9>8#{%d%=1Z#v^DPQLu@b^goa3E=5Ej{pDw literal 0 HcmV?d00001 diff --git a/res/CURSOR/CURSOR_IKA.png b/res/CURSOR/CURSOR_IKA.png new file mode 100644 index 0000000000000000000000000000000000000000..c497cca7c126dae9ebd94eea5bc78d32851fb251 GIT binary patch literal 400 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE0wix1Z>k4UEa{HEjtmSN`?>!lvVtU&J%W50 z7^>757#dm_7=8hT8eT9klo~KFyh>nTu$sZZAYL$MSD+10f+@+{-G$+Qd;gjJKpuOE zr>`sfBTgX!UB2CKEUy5CW_Y?dhIkx*JH=6~L4m{N`3t$;*%uEfIlClWb&C3#@{eWF z0sE%8`fMAT4iyPcm?+&aO)G(^;oy{C-JbtqmoluExnGpjuuR3ji?)005oz6I=iQ literal 0 HcmV?d00001 diff --git a/res/CURSOR/CURSOR_NORMAL.png b/res/CURSOR/CURSOR_NORMAL.png new file mode 100644 index 0000000000000000000000000000000000000000..b708311ff07ebc194cdfa4b2d8d64e82b67281b3 GIT binary patch literal 338 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnH3?%tPCZz)@mUKs7M+SzC{oH>NSwWJ?9znhg z3{`3j3=J&|48MRv4KElNN(~qoUL`OvSj}Ky5HFasE6@fg!5QEa;tHf0{xkgl|KD>b zM;wsNSQ6wH%;50sMjD8d21sKjP%)Ru|yp(SHXNvh;Lu43W5; zoY27NW^tJD7)OJlQ$kMwI`hEN8-m9Y8YFuYI;<8LM@YWlWjIsH@$LNcLnc5&R7+eV zN>UO_QmvAUQh^kMk%6Iwu7Rblp=pSrp_Q?vm7$rgfw`4|fuc-iJ&K0h{FKbJO57R( T94{UQYGCkm^>bP0l+XkKXc<~- literal 0 HcmV?d00001 diff --git a/src/Main.cpp b/src/Main.cpp index 547cb977..38c9fc79 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -204,7 +204,29 @@ int main(int argc, char *argv[]) } RECT unused_rect = {0, 0, 320, 240}; + + //Load cursor + SDL_RWops *fp = FindResource("CURSOR_NORMAL"); + if (fp) + { + SDL_Surface *cursor_surface = SDL_LoadBMP_RW(fp, 1); + SDL_SetColorKey(cursor_surface, SDL_TRUE, SDL_MapRGB(cursor_surface->format, 0xFF, 0, 0xFF)); // Pink regions are transparent + + SDL_Cursor *cursor = SDL_CreateColorCursor(cursor_surface, 0, 0); // Don't worry, the hotspots are accurate to the original files + + if (cursor) + SDL_SetCursor(cursor); + else + printf("Failed to load cursor"); + + SDL_FreeSurface(cursor_surface); + } + else + { + printf("Failed to load cursor"); + } + //Get window dimensions and colour depth int colourDepth = 16; diff --git a/src/Resource.cpp b/src/Resource.cpp index 1cae74a4..52e704c5 100644 --- a/src/Resource.cpp +++ b/src/Resource.cpp @@ -70,6 +70,8 @@ #include "Resource/BITMAP/PIXEL.bmp.h" #endif #include "Resource/ICON/4.bmp.h" +#include "Resource/CURSOR/CURSOR_IKA.bmp.h" +#include "Resource/CURSOR/CURSOR_NORMAL.bmp.h" const unsigned char* GetResource(const char *name, size_t *size) { @@ -395,6 +397,18 @@ const unsigned char* GetResource(const char *name, size_t *size) *size = sizeof(r4); return r4; } + + //CURSOR + if (!strcmp(name, "CURSOR_NORMAL")) + { + *size = sizeof(rCURSOR_NORMAL); + return rCURSOR_NORMAL; + } + if (!strcmp(name, "CURSOR_IKA")) + { + *size = sizeof(rCURSOR_IKA); + return rCURSOR_IKA; + } return NULL; } diff --git a/src/Resource/CURSOR/CURSOR_IKA.bmp.h b/src/Resource/CURSOR/CURSOR_IKA.bmp.h new file mode 100644 index 00000000..6d3a1368 --- /dev/null +++ b/src/Resource/CURSOR/CURSOR_IKA.bmp.h @@ -0,0 +1,45 @@ +#pragma once + +const unsigned char rCURSOR_IKA[0x28E] = { + 0x42, 0x4D, 0x8E, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8E, 0x00, 0x00, 0x00, 0x6C, 0x00, + 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x23, 0x2E, 0x00, 0x00, 0x23, 0x2E, 0x00, 0x00, 0x05, 0x00, + 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x42, 0x47, 0x52, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, + 0xFF, 0x00, 0x80, 0x80, 0x80, 0x00, 0xC0, 0xC0, 0xC0, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x10, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x04, 0x01, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x04, 0x40, 0x10, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x03, 0x40, 0x04, 0x01, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x10, 0x00, 0x30, 0x44, 0x01, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x03, 0x30, 0x00, 0x34, 0x01, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x04, 0x44, 0x00, 0x03, 0x01, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x10, 0x44, 0x44, 0x40, 0x00, 0x00, 0x00, 0x01, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x01, + 0x11, 0x04, 0x44, 0x04, 0x44, 0x00, 0x03, 0x44, 0x40, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x00, + 0x10, 0x34, 0x40, 0x44, 0x44, 0x40, 0x00, 0x34, 0x01, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x04, + 0x00, 0x34, 0x04, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x04, + 0x40, 0x04, 0x44, 0x44, 0x44, 0x44, 0x40, 0x03, 0x44, 0x01, 0x11, 0x11, 0x11, 0x11, 0x11, 0x04, + 0x44, 0x03, 0x44, 0x44, 0x44, 0x44, 0x44, 0x00, 0x34, 0x40, 0x11, 0x11, 0x11, 0x11, 0x11, 0x04, + 0x44, 0x30, 0x44, 0x44, 0x44, 0x40, 0x44, 0x40, 0x00, 0x01, 0x11, 0x11, 0x11, 0x11, 0x11, 0x04, + 0x44, 0x42, 0x04, 0x44, 0x44, 0x04, 0x44, 0x43, 0x01, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x04, + 0x44, 0x44, 0x00, 0x44, 0x40, 0x44, 0x42, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x04, + 0x44, 0x44, 0x40, 0x04, 0x44, 0x44, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x04, + 0x44, 0x44, 0x44, 0x00, 0x34, 0x30, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x04, + 0x44, 0x44, 0x44, 0x42, 0x00, 0x01, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x04, + 0x44, 0x44, 0x44, 0x44, 0x30, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x04, + 0x44, 0x44, 0x44, 0x44, 0x43, 0x01, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11 +}; diff --git a/src/Resource/CURSOR/CURSOR_NORMAL.bmp.h b/src/Resource/CURSOR/CURSOR_NORMAL.bmp.h new file mode 100644 index 00000000..084f17af --- /dev/null +++ b/src/Resource/CURSOR/CURSOR_NORMAL.bmp.h @@ -0,0 +1,21 @@ +#pragma once + +const unsigned char rCURSOR_NORMAL[0x102] = { + 0x42, 0x4D, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x6C, 0x00, + 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x23, 0x2E, 0x00, 0x00, 0x23, 0x2E, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x42, 0x47, 0x52, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xF0, + 0x00, 0x00, 0x10, 0xF0, 0x00, 0x00, 0x19, 0xE0, 0x00, 0x00, 0x1F, 0xE0, 0x00, 0x00, 0x1F, 0xC0, + 0x00, 0x00, 0x1F, 0xFC, 0x00, 0x00, 0x1F, 0xF8, 0x00, 0x00, 0x1F, 0xF0, 0x00, 0x00, 0x1F, 0xE0, + 0x00, 0x00, 0x1F, 0xC0, 0x00, 0x00, 0x1F, 0x80, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x1E, 0x00, + 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00 +}; From d4c0cde7488eace1e177aea488e433b6836f829a Mon Sep 17 00:00:00 2001 From: Clownacy Date: Sun, 10 Feb 2019 16:55:54 +0000 Subject: [PATCH 2/3] Added Windows-specific icon files --- Makefile | 13 ++++++++++++- res/ICON/0.ico | Bin 0 -> 766 bytes res/ICON/ICON.rc | 2 ++ res/ICON/ICON_MINI.ico | Bin 0 -> 318 bytes src/Main.cpp | 14 +++++++++++--- src/Resource.cpp | 6 +++++- 6 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 res/ICON/0.ico create mode 100644 res/ICON/ICON.rc create mode 100644 res/ICON/ICON_MINI.ico diff --git a/Makefile b/Makefile index 7a6caea2..99bc70bc 100644 --- a/Makefile +++ b/Makefile @@ -131,7 +131,6 @@ RESOURCES = \ BITMAP/CREDIT18.bmp \ CURSOR/CURSOR_IKA.bmp \ CURSOR/CURSOR_NORMAL.bmp \ - ICON/4.bmp \ ORG/ACCESS \ ORG/ANZEN \ ORG/BALCONY \ @@ -182,8 +181,16 @@ else RESOURCES += BITMAP/PIXEL.bmp endif +ifneq ($(WINDOWS), 1) + RESOURCES += ICON/4.bmp +endif + OBJECTS = $(addprefix obj/$(FILENAME)/, $(addsuffix .o, $(SOURCES))) +ifeq ($(WINDOWS), 1) +OBJECTS += obj/$(FILENAME)/win_icon.o +endif + all: build/$(FILENAME) build/$(FILENAME): $(OBJECTS) @@ -211,5 +218,9 @@ obj/bin2h: res/bin2h.c @echo Compiling $^ @gcc -O3 -s -static $^ -o $@ +obj/$(FILENAME)/win_icon.o: res/ICON/ICON.rc res/ICON/0.ico res/ICON/ICON_MINI.ico + @mkdir -p $(@D) + @windres $< $@ + clean: @rm -rf build obj diff --git a/res/ICON/0.ico b/res/ICON/0.ico new file mode 100644 index 0000000000000000000000000000000000000000..33fc2aa3c0323cfa9877ff309e47b8640446278d GIT binary patch literal 766 zcmcgqF>b>!45XU^DzcJmLhP-N5X)!N}xWrimU53(mT(crs$X#f%;d ziyJ=xM!=rFV=K8NIe91@|zdUj7{GRqJQx% zPxN8AXem12Wh}W~GeRFHv(uiu5PEJryRJvGV>^@QIXmSGaN@i3Bc}j~C+7^0 zQvwdoOz#|-2|FSnfgOC-UwAEjC=xr4lxVGyDPVD7=8DPVErO~715vduL0W2OtM3pm vUt;|DzK;?ZeIRtPLG`(st)GoAdX>p+I_s?f^GxSbJt!XB4};BxANnJ{3z1#C literal 0 HcmV?d00001 diff --git a/src/Main.cpp b/src/Main.cpp index 38c9fc79..0d91786c 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -102,7 +102,13 @@ int main(int argc, char *argv[]) //Get path of the data folder strcpy(gDataPath, gModulePath); memcpy(&gDataPath[strlen(gDataPath)], "/data", 6); //Pixel didn't use a strcat - + +#ifdef WINDOWS + // Set the window icons. See icon.rc. + SDL_SetHint(SDL_HINT_WINDOWS_INTRESOURCE_ICON, "101"); + SDL_SetHint(SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL, "102"); +#endif + //Initialize SDL if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_EVENTS | SDL_INIT_GAMECONTROLLER) >= 0) { @@ -226,7 +232,7 @@ int main(int argc, char *argv[]) { printf("Failed to load cursor"); } - + //Get window dimensions and colour depth int colourDepth = 16; @@ -285,6 +291,7 @@ int main(int argc, char *argv[]) if (CheckFileExists("fps")) bFps = true; +#ifndef WINDOWS //Load icon SDL_RWops *fp = FindResource("ICON4"); @@ -303,7 +310,8 @@ int main(int argc, char *argv[]) { printf("Failed to load icon"); } - +#endif + //Set rects RECT loading_rect = {0, 0, 64, 8}; RECT clip_rect = {0, 0, gWindowWidth, gWindowHeight}; diff --git a/src/Resource.cpp b/src/Resource.cpp index 52e704c5..4db11132 100644 --- a/src/Resource.cpp +++ b/src/Resource.cpp @@ -69,7 +69,9 @@ #else #include "Resource/BITMAP/PIXEL.bmp.h" #endif +#ifndef WINDOWS #include "Resource/ICON/4.bmp.h" +#endif #include "Resource/CURSOR/CURSOR_IKA.bmp.h" #include "Resource/CURSOR/CURSOR_NORMAL.bmp.h" @@ -391,13 +393,15 @@ const unsigned char* GetResource(const char *name, size_t *size) #endif } +#ifndef WINDOWS //ICON if (!strcmp(name, "ICON4")) { *size = sizeof(r4); return r4; } - +#endif + //CURSOR if (!strcmp(name, "CURSOR_NORMAL")) { From 4e61be56d03d46953d480329325b4173f117bd83 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Sun, 10 Feb 2019 17:03:55 +0000 Subject: [PATCH 3/3] Renamed the SDL icon file Turns out it has an actual name in the original EXE --- Makefile | 2 +- res/ICON/{4.bmp => ICON_MINI.bmp} | Bin src/Main.cpp | 8 ++++---- src/Resource.cpp | 8 ++++---- src/Resource/ICON/{4.bmp.h => ICON_MINI.bmp.h} | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) rename res/ICON/{4.bmp => ICON_MINI.bmp} (100%) rename src/Resource/ICON/{4.bmp.h => ICON_MINI.bmp.h} (97%) diff --git a/Makefile b/Makefile index 99bc70bc..2f91fa1b 100644 --- a/Makefile +++ b/Makefile @@ -182,7 +182,7 @@ else endif ifneq ($(WINDOWS), 1) - RESOURCES += ICON/4.bmp + RESOURCES += ICON/ICON_MINI.bmp endif OBJECTS = $(addprefix obj/$(FILENAME)/, $(addsuffix .o, $(SOURCES))) diff --git a/res/ICON/4.bmp b/res/ICON/ICON_MINI.bmp similarity index 100% rename from res/ICON/4.bmp rename to res/ICON/ICON_MINI.bmp diff --git a/src/Main.cpp b/src/Main.cpp index 0d91786c..326b9a4c 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -104,9 +104,9 @@ int main(int argc, char *argv[]) memcpy(&gDataPath[strlen(gDataPath)], "/data", 6); //Pixel didn't use a strcat #ifdef WINDOWS - // Set the window icons. See icon.rc. - SDL_SetHint(SDL_HINT_WINDOWS_INTRESOURCE_ICON, "101"); - SDL_SetHint(SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL, "102"); + // Set the window icons. See res/ICON/ICON.rc. + SDL_SetHint(SDL_HINT_WINDOWS_INTRESOURCE_ICON, "101"); + SDL_SetHint(SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL, "102"); #endif //Initialize SDL @@ -293,7 +293,7 @@ int main(int argc, char *argv[]) #ifndef WINDOWS //Load icon - SDL_RWops *fp = FindResource("ICON4"); + SDL_RWops *fp = FindResource("ICON_MINI"); if (fp) { diff --git a/src/Resource.cpp b/src/Resource.cpp index 4db11132..4ab54a9e 100644 --- a/src/Resource.cpp +++ b/src/Resource.cpp @@ -70,7 +70,7 @@ #include "Resource/BITMAP/PIXEL.bmp.h" #endif #ifndef WINDOWS -#include "Resource/ICON/4.bmp.h" +#include "Resource/ICON/ICON_MINI.bmp.h" #endif #include "Resource/CURSOR/CURSOR_IKA.bmp.h" #include "Resource/CURSOR/CURSOR_NORMAL.bmp.h" @@ -395,10 +395,10 @@ const unsigned char* GetResource(const char *name, size_t *size) #ifndef WINDOWS //ICON - if (!strcmp(name, "ICON4")) + if (!strcmp(name, "ICON_MINI")) { - *size = sizeof(r4); - return r4; + *size = sizeof(rICON_MINI); + return rICON_MINI; } #endif diff --git a/src/Resource/ICON/4.bmp.h b/src/Resource/ICON/ICON_MINI.bmp.h similarity index 97% rename from src/Resource/ICON/4.bmp.h rename to src/Resource/ICON/ICON_MINI.bmp.h index e4a42eb0..0fa84f4d 100644 --- a/src/Resource/ICON/4.bmp.h +++ b/src/Resource/ICON/ICON_MINI.bmp.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char r4[0x11A] = { +const unsigned char rICON_MINI[0x11A] = { 0x42, 0x4D, 0x1A, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9A, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x23, 0x2E, 0x00, 0x00, 0x23, 0x2E, 0x00, 0x00, 0x08, 0x00,