// Copyright (C) 2015-2015 ChaosForge Ltd // http://chaosforge.org/ // // This file is part of Nova libraries. // For conditions of distribution and use, see copying.txt file in root folder. #include "nv/engine/image_manager.hh" #include "nv/image/png_loader.hh" #include "nv/io/c_file_system.hh" using namespace nv; bool image_manager::load_resource( const string_view& filename ) { c_file_system fs; if ( stream* file = open_stream( fs, filename ) ) { png_loader loader; image_data* result = loader.load( *file ); delete file; if ( result ) { add( filename, result ); return true; } } return false; }