Finished localization
This commit is contained in:
@ -62,7 +62,6 @@ namespace Dawn {
|
||||
* @return 0 if successful, otherwise unsuccessful.
|
||||
*/
|
||||
int32_t rewind();
|
||||
|
||||
|
||||
/**
|
||||
* Retreive the current byte position within the asset that the head is
|
||||
|
@ -19,10 +19,18 @@ void AssetManager::queueLoad(std::vector<Asset*> assets) {
|
||||
vectorAppend(&this->assetsToLoad, &assets);
|
||||
}
|
||||
|
||||
void AssetManager::queueLoad(Asset *asset) {
|
||||
this->assetsToLoad.push_back(asset);
|
||||
}
|
||||
|
||||
void AssetManager::queueUnload(std::vector<Asset*> assets) {
|
||||
vectorAppend(&this->assetsToUnload, &assets);
|
||||
}
|
||||
|
||||
void AssetManager::queueUnload(Asset *asset) {
|
||||
this->assetsToUnload.push_back(asset);
|
||||
}
|
||||
|
||||
void AssetManager::queueSwap(
|
||||
std::vector<Asset*> newAssets,
|
||||
std::vector<Asset*> oldAssets
|
||||
@ -57,6 +65,7 @@ void AssetManager::syncTick() {
|
||||
auto asset = *it;
|
||||
if(asset->loaded) {
|
||||
it = this->assetsToLoad.erase(it);
|
||||
asset->eventLoaded.invoke();
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -65,6 +74,7 @@ void AssetManager::syncTick() {
|
||||
|
||||
if(asset->loaded) {
|
||||
it = this->assetsToLoad.erase(it);
|
||||
asset->eventLoaded.invoke();
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -32,6 +32,7 @@ namespace Dawn {
|
||||
* @param assets Assets to load.
|
||||
*/
|
||||
void queueLoad(std::vector<Asset*> assets);
|
||||
void queueLoad(Asset *assets);
|
||||
|
||||
/**
|
||||
* Takes a list of lists to queue to unload. Does not immediately unload.
|
||||
@ -39,6 +40,7 @@ namespace Dawn {
|
||||
* @param assets Assets to unload.
|
||||
*/
|
||||
void queueUnload(std::vector<Asset*> assets);
|
||||
void queueUnload(Asset* assets);
|
||||
|
||||
/**
|
||||
* Queues load and unload based on the difference between two sets of
|
||||
@ -82,10 +84,26 @@ namespace Dawn {
|
||||
return asset;
|
||||
}
|
||||
|
||||
/**
|
||||
* Both gets an asset, and puts it into the load queue.
|
||||
*
|
||||
* @param name Name of the asset to load.
|
||||
* @return The asset element to be loaded.
|
||||
*/
|
||||
template<class T>
|
||||
T * getAndLoad(std::string name) {
|
||||
auto asset = this->get<T>(name);
|
||||
this->queueLoad(asset);
|
||||
return asset;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void unload(T *asset) {
|
||||
assertUnreachable();
|
||||
}
|
||||
|
||||
void unload(std::string name) {
|
||||
assertUnreachable();
|
||||
//should delete the asset for you
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -24,7 +24,6 @@ void TextureAsset::updateSync() {
|
||||
this->texture.buffer(this->colors);
|
||||
this->state = 0x05;
|
||||
this->loaded = true;
|
||||
this->eventLoaded.invoke();
|
||||
}
|
||||
|
||||
void TextureAsset::updateAsync() {
|
||||
|
@ -95,7 +95,6 @@ void TilesetAsset::updateAsync() {
|
||||
|
||||
this->state = 0x07;
|
||||
this->loaded = true;
|
||||
this->eventLoaded.invoke();
|
||||
|
||||
memoryFree(buffer);
|
||||
}
|
@ -29,7 +29,6 @@ void TrueTypeAsset::updateSync() {
|
||||
|
||||
this->state = 0x05;
|
||||
this->loaded = true;
|
||||
this->eventLoaded.invoke();
|
||||
}
|
||||
|
||||
void TrueTypeAsset::updateAsync() {
|
||||
|
Reference in New Issue
Block a user