diff --git a/source/frontends/ncurses/resources.cpp b/source/frontends/ncurses/resources.cpp index fbc6796a..fb359079 100644 --- a/source/frontends/ncurses/resources.cpp +++ b/source/frontends/ncurses/resources.cpp @@ -6,13 +6,13 @@ #include "Log.h" -HRSRC FindResource(void *, const std::string & filename, const char *) +HRSRC FindResource(void *, const char * filename, const char *) { HRSRC result; - if (!filename.empty()) + if (filename) { - const std::string path = "resource/" + filename; + const std::string path = std::string("resource/") + filename; int fd = open(path.c_str(), O_RDONLY); @@ -31,15 +31,15 @@ HRSRC FindResource(void *, const std::string & filename, const char *) if (result.data.empty()) { - LogFileOutput("FindResource: could not load resource %s\n", filename.c_str()); + LogFileOutput("FindResource: could not load resource %s\n", filename); } return result; } -HBITMAP LoadBitmap(HINSTANCE hInstance, const std::string & filename) +HBITMAP LoadBitmap(HINSTANCE hInstance, const char * filename) { - LogFileOutput("LoadBitmap: not loading resource %s\n", filename.c_str()); + LogFileOutput("LoadBitmap: not loading resource %s\n", filename); return nullptr; } diff --git a/source/frontends/qapple/qresources.cpp b/source/frontends/qapple/qresources.cpp index c82ae5ed..abfa7c09 100644 --- a/source/frontends/qapple/qresources.cpp +++ b/source/frontends/qapple/qresources.cpp @@ -5,13 +5,13 @@ #include "Log.h" -HRSRC FindResource(void *, const std::string & filename, const char *) +HRSRC FindResource(void *, const char * filename, const char *) { HRSRC result; - if (!filename.empty()) + if (filename) { - const std::string path = ":/resources/" + filename; + const std::string path = std::string(":/resources/") + filename; QFile res(QString::fromStdString(path)); if (res.exists() && res.open(QIODevice::ReadOnly)) @@ -23,7 +23,7 @@ HRSRC FindResource(void *, const std::string & filename, const char *) if (result.data.empty()) { - LogFileOutput("FindResource: could not load resource %s\n", filename.c_str()); + LogFileOutput("FindResource: could not load resource %s\n", filename); } return result; @@ -34,20 +34,20 @@ struct CBITMAP : public CHANDLE QImage image; }; -HBITMAP LoadBitmap(HINSTANCE hInstance, const std::string & filename) +HBITMAP LoadBitmap(HINSTANCE hInstance, const char * filename) { Q_UNUSED(hInstance) QImage image; - if (!filename.empty()) + if (filename) { - const std::string path = ":/resources/" + filename + ".BMP"; + const std::string path = std::string(":/resources/") + filename + ".BMP"; image = QImage(QString::fromStdString(path)); } if (image.isNull()) { - LogFileOutput("LoadBitmap: could not load resource %s\n", filename.c_str()); + LogFileOutput("LoadBitmap: could not load resource %s\n", filename); return nullptr; } else diff --git a/source/linux/interface.h b/source/linux/interface.h index 6e1261db..2975820f 100644 --- a/source/linux/interface.h +++ b/source/linux/interface.h @@ -9,10 +9,10 @@ // Resources -HRSRC FindResource(void *, const std::string & filename, const char *); +HRSRC FindResource(void *, const char * filename, const char *); // Bitmap -HBITMAP LoadBitmap(HINSTANCE hInstance, const std::string & filename); +HBITMAP LoadBitmap(HINSTANCE hInstance, const char * filename); LONG GetBitmapBits(HBITMAP hbit, LONG cb, LPVOID lpvBits); diff --git a/source/linux/windows/bitmap.h b/source/linux/windows/bitmap.h index f90050f9..46b1620f 100644 --- a/source/linux/windows/bitmap.h +++ b/source/linux/windows/bitmap.h @@ -38,7 +38,7 @@ typedef HANDLE HBITMAP; typedef HANDLE HGDIOBJ; // Bitmap -HBITMAP LoadBitmap(HINSTANCE hInstance, const std::string & filename); +HBITMAP LoadBitmap(HINSTANCE hInstance, const char * filename); LONG GetBitmapBits(HBITMAP hbit, LONG cb, LPVOID lpvBits); BOOL DeleteObject(HGDIOBJ ho); diff --git a/source/linux/windows/resources.cpp b/source/linux/windows/resources.cpp index d1266216..086a55a1 100644 --- a/source/linux/windows/resources.cpp +++ b/source/linux/windows/resources.cpp @@ -2,9 +2,6 @@ #include "../resource/resource.h" #include "Log.h" -// forward declared -HRSRC FindResource(void *, const std::string & filename, const char *); - const char * MAKEINTRESOURCE(int x) { switch (x) diff --git a/source/linux/windows/resources.h b/source/linux/windows/resources.h index 9d37c5fc..95dd57fd 100644 --- a/source/linux/windows/resources.h +++ b/source/linux/windows/resources.h @@ -19,7 +19,7 @@ struct HRSRC : public CHANDLE }; const char * MAKEINTRESOURCE(int x); -HRSRC FindResource(void *, const std::string & filename, const char *); +HRSRC FindResource(void *, const char * filename, const char *); DWORD SizeofResource(void *, const HRSRC &); HGLOBAL LoadResource(void *, HRSRC &); BYTE * LockResource(HGLOBAL); diff --git a/test/TestCPU6502/dummy.cpp b/test/TestCPU6502/dummy.cpp index cdf9e1d4..4e051223 100644 --- a/test/TestCPU6502/dummy.cpp +++ b/test/TestCPU6502/dummy.cpp @@ -10,7 +10,7 @@ void unregisterSoundBuffer(IDirectSoundBuffer * buffer) // Resources -HRSRC FindResource(void *, const std::string & filename, const char *) +HRSRC FindResource(void *, const char * filename, const char *) { return HRSRC(); } @@ -51,7 +51,7 @@ int MessageBox(HWND, const char * text, const char * caption, UINT type) { retur // Bitmap -HBITMAP LoadBitmap(HINSTANCE hInstance, const std::string & filename) +HBITMAP LoadBitmap(HINSTANCE hInstance, const char * filename) { return nullptr; }