Add BitmapCanvasPipeline, more CgxViewer updates
This commit is contained in:
@@ -38,13 +38,12 @@ class Bitmap {
|
||||
this->pixel_data_[position] = value;
|
||||
}
|
||||
|
||||
int GetWidth() const { return width_; }
|
||||
int GetHeight() const { return height_; }
|
||||
auto GetSize() const { return data_size_; }
|
||||
auto GetData() const { return pixel_data_; }
|
||||
auto GetByte(int i) const { return pixel_data_[i]; }
|
||||
auto GetTexture() const { return texture_.get(); }
|
||||
auto GetSurface() const { return surface_.get(); }
|
||||
int width() const { return width_; }
|
||||
int height() const { return height_; }
|
||||
auto size() const { return data_size_; }
|
||||
auto data() const { return pixel_data_; }
|
||||
auto at(int i) const { return pixel_data_[i]; }
|
||||
auto texture() const { return texture_.get(); }
|
||||
auto IsActive() const { return active_; }
|
||||
|
||||
private:
|
||||
|
||||
@@ -153,6 +153,23 @@ Bytes BPP8SNESToIndexed(Bytes data, uint64_t bpp) {
|
||||
return buffer;
|
||||
}
|
||||
|
||||
ushort TileInfoToShort(TileInfo tile_info) {
|
||||
ushort result = 0;
|
||||
|
||||
// Copy the id_ value
|
||||
result |= tile_info.id_ & 0x3FF; // ids are 10 bits
|
||||
|
||||
// Set the vertical_mirror_, horizontal_mirror_, and over_ flags
|
||||
result |= (tile_info.vertical_mirror_ ? 1 : 0) << 10;
|
||||
result |= (tile_info.horizontal_mirror_ ? 1 : 0) << 11;
|
||||
result |= (tile_info.over_ ? 1 : 0) << 12;
|
||||
|
||||
// Set the palette_
|
||||
result |= (tile_info.palette_ & 0x07) << 13; // palettes are 3 bits
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
TileInfo GetTilesInfo(ushort tile) {
|
||||
// vhopppcc cccccccc
|
||||
bool o = false;
|
||||
|
||||
@@ -40,25 +40,10 @@ class TileInfo {
|
||||
vertical_mirror_(v),
|
||||
horizontal_mirror_(h),
|
||||
palette_(palette) {}
|
||||
|
||||
ushort ToShort() const {
|
||||
ushort result = 0;
|
||||
|
||||
// Copy the id_ value
|
||||
result |= id_ & 0x3FF; // ids are 10 bits
|
||||
|
||||
// Set the vertical_mirror_, horizontal_mirror_, and over_ flags
|
||||
result |= (vertical_mirror_ ? 1 : 0) << 10;
|
||||
result |= (horizontal_mirror_ ? 1 : 0) << 11;
|
||||
result |= (over_ ? 1 : 0) << 12;
|
||||
|
||||
// Set the palette_
|
||||
result |= (palette_ & 0x07) << 13; // palettes are 3 bits
|
||||
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
ushort TileInfoToShort(TileInfo tile_info);
|
||||
|
||||
TileInfo GetTilesInfo(ushort tile);
|
||||
|
||||
class Tile32 {
|
||||
|
||||
Reference in New Issue
Block a user