Rez: don't get confused about ID -1 vs ID 65535

This commit is contained in:
Wolfgang Thaller 2015-07-20 03:27:26 +02:00
parent f549ead8ac
commit 036a45152e
3 changed files with 7 additions and 7 deletions

View File

@ -21,15 +21,15 @@ public:
std::ostream& operator<<(std::ostream& out, ResType t);
struct ResRef : public std::pair<ResType, int>
struct ResRef : public std::pair<ResType, short>
{
ResRef() : std::pair<ResType, int>(ResType(), 0) {}
ResRef(ResType t, int id) : std::pair<ResType, int>(t,id) {}
ResRef() : std::pair<ResType, short>(ResType(), 0) {}
ResRef(ResType t, int id) : std::pair<ResType, short>(t,id) {}
ResType& type() { return first; }
ResType type() const { return first; }
int& id() { return second; }
int id() const { return second; }
short& id() { return second; }
short id() const { return second; }
};
#endif // RESTYPE_H

View File

@ -133,7 +133,7 @@ Resources::Resources(std::istream &in)
for(int j = 0; j < nRes; j++)
{
in.seekg(start + std::streampos(resmapOffset + typeListOffset + refListOffset + j * 12));
int id = word(in);
int id = (short) word(in);
int nameOffset = word(in);
int attr = byte(in);
int off1 = byte(in);

View File

@ -8,7 +8,7 @@
class Resource
{
ResType type;
int id;
short id;
std::string name;
std::string data;
int attr;