Dawn/src/file/loaders/scaledtexture.h
2021-11-25 08:31:35 -08:00

50 lines
1.4 KiB
C

/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "item.h"
#include "../xml.h"
#include "../asset.h"
#include "../../save/save.h"
/**
* Load the given texture scale for a scaled texture.
*
* @param manager Manager to queue on to.
* @param owner Owner ID requesting to load this resource.
* @param path Path of the texture size sets
* @param file Name of the texture that was generated.
* @return A pointer to the asset manager item for tracking.
*/
assetmanageritem_t * assetManagerLoadScaledTexture(
assetmanager_t *manager, assetmanagerowner_t owner, char *path, char *file
);
bool _assetManagerLoaderScaledTextureAsync(assetmanageritem_t *item);
bool _assetManagerLoaderScaledTextureSync(assetmanageritem_t *item);
bool _assetManagerLoaderScaledTextureDispose(assetmanageritem_t *item);
/**
* Private method to resize a texture after it has been loaded.
*
* @param manager
* @param item
* @param scale
* @return true
* @return false
*/
bool _assetManagerLoaderScaledTextureResize(
assetmanager_t *manager, assetmanageritem_t *item, uint8_t scale
);
/**
* Method that when called will scan the asset manager and find any scaled
* textures that need resizing, and resize them.
*
* @param manager Manager to check against.
*/
void assetManagerScaledTextureRescaleAll(assetmanager_t *manager);