1 /****************************
2 ** Tsunagari Tile Engine **
4 ** Copyright 2012 OmegaSDG **
5 ****************************/
7 #include <Gosu/Input.hpp>
12 BitRecord
BitRecord::fromGosuInput()
14 size_t cnt
= Gosu::numButtons
;
15 Gosu::Input
& in
= GameWindow::instance().input();
18 for (size_t i
= 0; i
< cnt
; i
++)
19 rec
.states
[i
] = in
.down(Gosu::Button((unsigned)i
));
24 bool BitRecord::operator[] (size_t idx
)
29 std::vector
<size_t> BitRecord::diff(const BitRecord
& other
)
31 std::vector
<size_t> changes
;
33 for (size_t i
= 0; i
< states
.size(); i
++)
34 if (states
[i
] != other
.states
[i
])
39 BitRecord::BitRecord(size_t length
)