/**
 * Copyright (c) 2021 Dominic Masters
 * 
 * This software is released under the MIT License.
 * https://opensource.org/licenses/MIT
 */
#include "pokergameassets.h"

bool pokerGameAssetsInit(pokergameassets_t *assets) {
  // Load the game's shader
  assetShaderLoad(&assets->shader,
    "shaders/textured.vert", "shaders/textured.frag"
  );

  // Load the game's font
  assetFontLoad(&assets->font, "fonts/opensans/OpenSans-Bold.ttf");

  // Initialize the language buffer.
  languageInit(&assets->language, "locale/language/en-US.csv");

  // Load the world textures.
  assetTextureLoad(&assets->testTexture, "test_texture.png");
  assetTextureLoad(&assets->roomTexture, "world/pub/pub_skywall.png");

  // Load the character textures.
  assetTextureLoad(&assets->pennyTexture, "characters/penny/sprites/sheet.png");

  return true;
}

void pokerGameAssetsDispose(pokergameassets_t *assets) {
  // Now we unload in what is essentially the reverse of the above.
  textureDispose(&assets->roomTexture);
  textureDispose(&assets->testTexture);

  languageDispose(&assets->language);

  fontDispose(&assets->font);

  shaderDispose(&assets->shader);
}