Upload Direct16 pic
This commit is contained in:
@@ -13,19 +13,19 @@ struct __no_align SimpleTIM : private ComplexBitMap<uint32_t> {
|
||||
this->raw = 0;
|
||||
}
|
||||
|
||||
constexpr SimpleTIM(uint16_t texX, uint16_t texY, uint16_t clutX, uint16_t clutY) : ComplexBitMap(ComplexBitMap::with(TextureX.with(texX), TextureY.with(texY), ClutX.with(clutX), ClutY.with(clutY))) {
|
||||
constexpr SimpleTIM(uint16_t texX, uint16_t texY, uint16_t clutX, uint16_t clutY) : ComplexBitMap(ComplexBitMap::with(TextureX.with(texX >> 1), TextureY.with(texY >> 1), ClutX.with(clutX >> 4), ClutY.with(clutY))) {
|
||||
}
|
||||
|
||||
constexpr uint16_t getTextureX() const {
|
||||
return ComplexBitMap<uint32_t>::get_value(SimpleTIM::TextureX);
|
||||
return (ComplexBitMap<uint32_t>::get_value(SimpleTIM::TextureX) << 1);
|
||||
}
|
||||
|
||||
constexpr uint16_t getTextureY() const {
|
||||
return ComplexBitMap<uint32_t>::get_value(SimpleTIM::TextureY);
|
||||
return (ComplexBitMap<uint32_t>::get_value(SimpleTIM::TextureY) << 1);
|
||||
}
|
||||
|
||||
constexpr uint16_t getClutX() const {
|
||||
return ComplexBitMap<uint32_t>::get_value(SimpleTIM::ClutX);
|
||||
return (ComplexBitMap<uint32_t>::get_value(SimpleTIM::ClutX) << 4);
|
||||
}
|
||||
|
||||
constexpr uint16_t getClutY() const {
|
||||
|
@@ -10,7 +10,7 @@ namespace FileProcessor {
|
||||
};
|
||||
|
||||
struct Configuration;
|
||||
typedef bool (*ProcessRoutine)(Configuration&, Reserved&);
|
||||
typedef bool (*ProcessRoutine)(Configuration&, Reserved&, bool);
|
||||
|
||||
struct Configuration {
|
||||
ProcessRoutine process_routine = nullptr;
|
||||
@@ -18,7 +18,7 @@ namespace FileProcessor {
|
||||
size_t data_size = 0ull;
|
||||
|
||||
template<typename T>
|
||||
static __always_inline Configuration from(bool (*process_routine)(Configuration&, T&), const uint32_t* data_adr) {
|
||||
static __always_inline Configuration from(bool (*process_routine)(Configuration&, T&, bool), const uint32_t* data_adr) {
|
||||
return {reinterpret_cast<ProcessRoutine>(process_routine), data_adr};
|
||||
}
|
||||
};
|
||||
@@ -28,15 +28,15 @@ namespace FileProcessor {
|
||||
Reserved reserved;
|
||||
|
||||
template<typename T>
|
||||
static __always_inline State from(const T& reserved, const uint32_t* data_adr, bool (*process_routine)(Configuration&, T&)) {
|
||||
static __always_inline State from(const T& reserved, const uint32_t* data_adr, bool (*process_routine)(Configuration&, T&, bool)) {
|
||||
return {Configuration::from(process_routine, data_adr), *reinterpret_cast<const Reserved*>(&reserved)};
|
||||
static_assert(sizeof(T) <= sizeof(Reserved));
|
||||
}
|
||||
|
||||
public:
|
||||
bool process(size_t size) {
|
||||
bool process(size_t size, bool is_last) {
|
||||
this->config.data_size += size;
|
||||
return (*this->config.process_routine)(this->config, this->reserved);
|
||||
return (*this->config.process_routine)(this->config, this->reserved, is_last);
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user