diff --git a/aegisub/src/libresrc/Makefile.am b/aegisub/src/libresrc/Makefile.am index 618a000d2..82f95067c 100644 --- a/aegisub/src/libresrc/Makefile.am +++ b/aegisub/src/libresrc/Makefile.am @@ -7,4 +7,4 @@ EXTRA_DIST = \ wxicon_xpm.xpm libresrc.cpp: ../../tools/common-respack - ../../tools/common-respack libresrc.cpp ../bitmaps/16/* ../bitmaps/24/* + ../../tools/common-respack libresrc.cpp ../bitmaps/16 ../bitmaps/24 ../bitmaps/misc/splash.png diff --git a/aegisub/tools/common-respack.cpp b/aegisub/tools/common-respack.cpp index 4ceb283d9..bce26543c 100644 --- a/aegisub/tools/common-respack.cpp +++ b/aegisub/tools/common-respack.cpp @@ -113,14 +113,20 @@ int main(int argc, const char *argv[]) { ofstream outH(headerFileName.GetFullPath().char_str()); ofstream outC(argv[1]); - outC << "/* This is an automatically generated file and should not be modified directly */" << endl; - outC << "#include \"" << headerFileName.GetFullName() << "\"" << endl; + outC << "/* This is an automatically generated file and should not be modified directly */" << endl + << "#include \"" << headerFileName.GetFullName() << "\"" << endl + << "wxBitmap " << headerFileName.GetName() << "_getimage(const unsigned char *buff, size_t size) {" << endl + << " wxMemoryInputStream mem(buff, size);" << endl + << " wxImage image(mem);" << endl + << " return wxBitmap(image);" << endl + << "}" << endl; - outH << "/* This is an automatically generated file and should not be modified directly */" << endl; - outH << "#include " << endl; - outH << "#include " << endl; - outH << "#include " << endl; - outH << "#define GETIMAGE(a) wxBitmap(wxImage(wxMemoryInputStream(a, sizeof(a))))" << endl; + outH << "/* This is an automatically generated file and should not be modified directly */" << endl + << "#include " << endl + << "#include " << endl + << "#include " << endl + << "wxBitmap " << headerFileName.GetName() << "_getimage(const unsigned char *image, size_t size);" << endl + << "#define GETIMAGE(a) " << headerFileName.GetName() << "_getimage(a, sizeof(a))" << endl; wxRegEx nameCleaner("[^A-Za-z_0-9]"); wxString filename;