optimitzant textureToRenderer()

This commit is contained in:
2026-03-27 09:46:25 +01:00
parent 92453a6104
commit c5a7c9e70d
10 changed files with 748 additions and 154 deletions
+6 -6
View File
@@ -53,7 +53,7 @@ namespace Resource {
}
// Load a resource
auto Loader::loadResource(const std::string& filename) -> std::vector<uint8_t> { // NOLINT(readability-make-member-function-const)
auto Loader::loadResource(const std::string& filename) -> std::vector<uint8_t> { // NOLINT(readability-make-member-function-const)
if (!initialized_) {
std::cerr << "Loader: Not initialized\n";
return {};
@@ -81,7 +81,7 @@ namespace Resource {
}
// Check if a resource exists
auto Loader::resourceExists(const std::string& filename) -> bool { // NOLINT(readability-make-member-function-const)
auto Loader::resourceExists(const std::string& filename) -> bool { // NOLINT(readability-make-member-function-const)
if (!initialized_) {
return false;
}
@@ -107,7 +107,7 @@ namespace Resource {
}
// Get pack statistics
auto Loader::getPackResourceCount() const -> size_t { // NOLINT(readability-convert-member-functions-to-static)
auto Loader::getPackResourceCount() const -> size_t { // NOLINT(readability-convert-member-functions-to-static)
if (resource_pack_ && resource_pack_->isLoaded()) {
return resource_pack_->getResourceCount();
}
@@ -122,7 +122,7 @@ namespace Resource {
}
// Load from filesystem
auto Loader::loadFromFilesystem(const std::string& filepath) // NOLINT(readability-convert-member-functions-to-static)
auto Loader::loadFromFilesystem(const std::string& filepath) // NOLINT(readability-convert-member-functions-to-static)
-> std::vector<uint8_t> {
std::ifstream file(filepath, std::ios::binary | std::ios::ate);
if (!file) {
@@ -147,7 +147,7 @@ namespace Resource {
}
// Validate pack integrity
auto Loader::validatePack() const -> bool { // NOLINT(readability-convert-member-functions-to-static)
auto Loader::validatePack() const -> bool { // NOLINT(readability-convert-member-functions-to-static)
if (!initialized_ || !resource_pack_ || !resource_pack_->isLoaded()) {
std::cerr << "Loader: Cannot validate - pack not loaded\n";
return false;
@@ -168,7 +168,7 @@ namespace Resource {
}
// Load assets.yaml from pack
auto Loader::loadAssetsConfig() const -> std::string { // NOLINT(readability-convert-member-functions-to-static)
auto Loader::loadAssetsConfig() const -> std::string { // NOLINT(readability-convert-member-functions-to-static)
if (!initialized_ || !resource_pack_ || !resource_pack_->isLoaded()) {
std::cerr << "Loader: Cannot load assets config - pack not loaded\n";
return "";