Ancurio / mkxp

Free Software implementation of the Ruby Game Scripting System (RGSS)
GNU General Public License v2.0
512 stars 130 forks source link

Add icon and resource files for windows #160

Closed hanetzer closed 7 years ago

hanetzer commented 7 years ago

Not yet integrated into the cmake build, will look into doing that soonish. As of right now this works with your ad-hoc build script you mentioned in #35 with a small bit of tweaking.

Ancurio commented 7 years ago

Hmm. I actually want to solve this differently, by having the previous icon loading code only run on Linux (we also want to avoid it on OSX because it clashes with the bundle-provided high resolution icons).
I'll push a commit soon, then you can base your changes ontop of that.

Ancurio commented 7 years ago

Also in the future, consider squashing fixup commits (and force-pushing to your branch if required); no need to have these in the official history.

hanetzer commented 7 years ago

To be honest I have no idea about the squashing and such, really need to brush up on my git-fu. Reason I have a separate header is the potential of adding manifests and version information and whatnot, its just a starting point.

On another note, I've set up the ugliest Makefile ever, but it works and is much faster than the ad-hoc build script. But, this is mostly a stop-gap, as I'd like to get a windows build to work with cmake alone if possible.

Ancurio commented 7 years ago

Pushed 6349146e0198c995cadb923a7991576064df7e90

On another note, I've set up the ugliest Makefile ever, but it works and is much faster than the ad-hoc build script. But, this is mostly a stop-gap, as I'd like to get a windows build to work with cmake alone if possible.

Yeah, my script recompiles everything everytime :) I used ccache internally to work around that, but a Makefile is of course the saner approach.

hanetzer commented 7 years ago

For x86_64-w64-mingw32-g++

#define _WIN32 1
#define _WIN64 1
#define __WINT_MAX__ 0xffff
#define __WINT_MIN__ 0
#define __WIN32 1
#define __WIN64 1
#define __WINNT 1
#define __WINNT__ 1
#define __WIN32__ 1
#define __SIZEOF_WINT_T__ 2
#define WIN32 1
#define WIN64 1
#define __WINT_TYPE__ short unsigned int
#define WINNT 1
#define __WIN64__ 1

and i686-w64-mingw32-g++

#define _WIN32 1
#define __WINT_MAX__ 0xffff
#define __WINT_MIN__ 0
#define __WIN32 1
#define __WINNT 1
#define __WINNT__ 1
#define __WIN32__ 1
#define __SIZEOF_WINT_T__ 2
#define WIN32 1
#define __WINT_TYPE__ short unsigned int
#define WINNT 1

the diff:

--- i686.h  2017-03-04 10:14:53.610710212 +0000
+++ x86_64.h    2017-03-04 10:14:42.307376535 +0000
@@ -1,11 +1,15 @@
 #define _WIN32 1
+#define _WIN64 1
 #define __WINT_MAX__ 0xffff
 #define __WINT_MIN__ 0
 #define __WIN32 1
+#define __WIN64 1
 #define __WINNT 1
 #define __WINNT__ 1
 #define __WIN32__ 1
 #define __SIZEOF_WINT_T__ 2
 #define WIN32 1
+#define WIN64 1
 #define __WINT_TYPE__ short unsigned int
 #define WINNT 1
+#define __WIN64__ 1
Ancurio commented 7 years ago

https://hg.libsdl.org/SDL/rev/cb37776926ad implies that __WINDOWS__ works on both.

hanetzer commented 7 years ago

There we go. Well, is __WINDOWS__ supplied by SDL or by the compiler? Suppose that works, since SDL.h is included on the very file in question.

hanetzer commented 7 years ago

@carstene1ns

Suppose your right. To be frank I don't care about what MSVC supports at all, but I agree #elif is nicer looking and shorter.

hanetzer commented 7 years ago

@Ancurio well?

Ancurio commented 7 years ago

Sorry, didn't see that the commit changed. LGTM.
What image is inside the .ico? Is it the same as icon.png?

hanetzer commented 7 years ago

@Ancurio yeah, same as ico.png