PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Resource compilation

Pejo Software - Per · 13 Mar 2004, 15:22 UTC
I am trying to do the following in my resource file:
Code:
#if defined(WIN32_PLATFORM_WFSP)
#define RESOURCE_PATH "..\\resources\\176x220\\"
#else
#define RESOURCE_PATH "..\\resources\\240x320\\"
#endif

IDB_EXPLOSION9 PNG DISCARDABLE RESOURCE_PATH"Explosion9.png"


,but it doesn't work.

Any ideas, someone?
Wouldn't that translate to:
Code:

IDB_EXPLOSION9 PNG DISCARDABLE "..\\resources\\240x320\\""Explosion9.png"


which the compiler won't know how to handle. Two strings where it expects only one.

I did something similar by having two different resource files, then this:
Code:

#ifdef _WIN32_WCE
#include "../res/resource.h"
#else
#include "../res/resource1.h"
#endif
Pejo Software - Per · 13 Mar 2004, 16:25 UTC
The C++ compiler can do string concatenation, but maybe the resource compiler can't.
I don't wan't to have different resource files!
Pejo Software - Per · 13 Mar 2004, 19:06 UTC
Strange!
I tried some different things but got really strange errors!
I finaly came up with a solution that works:
Code:
#if defined(WIN32_PLATFORM_WFSP)
#define RESOURCE_PATH(y) .\..\resources\176x220##y
#else
#define RESOURCE_PATH(y) .\..\resources\240x320##y
#endif

IDB_EXPLOSION9 PNG DISCARDABLE RESOURCE_PATH(\Explosion9.png)

If quotes aren't necessary, can't you do this:

Code:

#if defined(WIN32_PLATFORM_WFSP)
#define RESOURCE_PATH .\..\resources\176x220
#else
#define RESOURCE_PATH .\..\resources\240x320
#endif

IDB_EXPLOSION9 PNG DISCARDABLE RESOURCE_PATH##\Explosion9.png
Pejo Software - Per · 13 Mar 2004, 20:37 UTC
No