git.y1.nz

gbdk-2020

GameBoy Development Kit
download: https://git.y1.nz/archives/gbdk.tar.gz
README | Files | Log | Refs | LICENSE

gbdk-support/png2asset/tiles.cpp

      1 #include "tiles.h"
      2 
      3 Tile FlipH(const Tile& tile)
      4 {
      5     Tile ret;
      6     for(int j = (int)tile.data.size() - 8; j >= 0; j -= 8)
      7     {
      8         for(int i = 0; i < 8; ++i)
      9         {
     10             ret.data.push_back(tile.data[j + i]);
     11         }
     12     }
     13     ret.pal = tile.pal;
     14     return ret;
     15 }
     16 
     17 Tile FlipV(const Tile& tile)
     18 {
     19     Tile ret;
     20     for(int j = 0; j < (int)tile.data.size(); j += 8)
     21     {
     22         for(int i = 7; i >= 0; --i)
     23         {
     24             ret.data.push_back(tile.data[j + i]);
     25         }
     26     }
     27     ret.pal = tile.pal;
     28     return ret;
     29 }

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.