#+feature dynamic-literals package demonchime // DO NOT EDIT // // This file is autogenerated by tools/compile_assets // All resource types are defined in 'src/resources.odin'. import rl "vendor:raylib" Image_Id :: enum { TILESETS, PLAYER, } Animation_Id :: enum { PLAYER, } Map_Id :: enum { ROOM_BEGIN_1, ROOM_BEGIN, } Tileset_Id :: enum { TILESET, } Resource_Id :: union { Image_Id, Animation_Id, Map_Id, Tileset_Id, } images: [Image_Id]Image_Resource animations: [Animation_Id]Animation_Resource maps: [Map_Id]Map_Resource tilesets: [Tileset_Id]Tileset_Resource path_to_id: map[string]Resource_Id load_resources :: proc() { load_images() load_anims() load_maps() load_tilesets() // Allow conversion from paths to a resource id, since it's a better way to // reference resources in other resources (JSON is a good example). path_to_id["res/tileset.tsj"] = Tileset_Id.TILESET path_to_id["res/img/player.ase"] = Image_Id.PLAYER path_to_id["res/img/tilesets.png"] = Image_Id.TILESETS path_to_id["res/room_begin.tmj"] = Map_Id.ROOM_BEGIN path_to_id["res/room_begin_1.tmj"] = Map_Id.ROOM_BEGIN_1 } @(private="file") load_images :: proc() { images[.TILESETS] = {data = #load("/home/xswan/demonchime/.compiled-res/tilesets.qoi")} images[.PLAYER] = {data = #load("/home/xswan/demonchime/.compiled-res/player-sheet.qoi")} } @(private="file") load_anims :: proc() { animations[.PLAYER] = {frame_count = 23, frame_durations = {100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100}, tags = {"jump_trans"={from = 16, to = 16}, "jump_down"={from = 17, to = 18}, "idle"={from = 0, to = 5}, "sleep"={from = 19, to = 22}, "jump_up"={from = 14, to = 15}, "run"={from = 6, to = 13}}} } @(private="file") load_maps :: proc() { maps[.ROOM_BEGIN_1] = #load("/home/xswan/demonchime/res/room_begin_1.tmj") maps[.ROOM_BEGIN] = #load("/home/xswan/demonchime/res/room_begin.tmj") } @(private="file") load_tilesets :: proc() { tilesets[.TILESET] = #load("/home/xswan/demonchime/res/tileset.tsj") }