Skip to content

Commit 87f8e86

Browse files
authored
Merge pull request #1964 from nicolasnoble/tpageloc-fix
Properly returning a TPageLoc on TPageAttr::getPageLoc
2 parents a11e5ed + acdc7e5 commit 87f8e86

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/mips/psyqo/primitives/common.hh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ struct TPageLoc {
165165
}
166166

167167
private:
168+
TPageLoc(uint8_t i) : info(i) {}
168169
uint8_t info = 0;
169170
friend struct TPageAttr;
170171
};
@@ -246,7 +247,7 @@ struct TPageAttr {
246247
}
247248
uint8_t getPageX() const { return info & 0x000f; }
248249
uint8_t getPageY() const { return (info >> 4) & 0x0001; }
249-
uint8_t getPageLoc() const { return info & 0x001f; }
250+
TPageLoc getPageLoc() const { return TPageLoc(info & 0x001f); }
250251
Prim::TPageAttr::SemiTrans getSemiTrans() const {
251252
return static_cast<Prim::TPageAttr::SemiTrans>((info >> 5) & 0x0003);
252253
}

0 commit comments

Comments
 (0)