summaryrefslogtreecommitdiff
path: root/tools/src/asset_processor/assets/palette.cpp
blob: f37504e70247a21929bc932d2946e285544f6c25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "palette.h"
#include "util.h"

std::filesystem::path PaletteAsset::generateAssetPath() {
    std::filesystem::path asset_path = path;
    return asset_path.replace_extension(".pal");
}

void PaletteAsset::convertToHumanReadable(const std::vector<char>& baserom) {
    (void)baserom;

    std::filesystem::path toolsPath = "tools";
    std::vector<std::string> cmd;
    cmd.push_back(toolsPath / "bin" / "gbagfx");
    cmd.push_back(path);
    cmd.push_back(assetPath);
    check_call(cmd);
}

void PaletteAsset::buildToBinary() {
    std::filesystem::path toolsPath = "tools";
    std::vector<std::string> cmd;
    cmd.push_back(toolsPath / "bin" / "gbagfx");
    cmd.push_back(assetPath);
    cmd.push_back(path);
    check_call(cmd);
}