source: trunk/src/engine/image_manager.cc @ 505

Last change on this file since 505 was 505, checked in by epyon, 9 years ago
  • several STL updates
  • several minor fixes
File size: 662 bytes
RevLine 
[484]1// Copyright (C) 2015-2015 ChaosForge Ltd
2// http://chaosforge.org/
3//
4// This file is part of Nova libraries.
5// For conditions of distribution and use, see copying.txt file in root folder.
6
7#include "nv/engine/image_manager.hh"
8
9#include "nv/image/png_loader.hh"
10#include "nv/io/c_file_system.hh"
11
12using namespace nv;
13
14bool image_manager::load_resource( const string_view& filename )
15{
16        c_file_system fs;
[505]17        if ( stream* file = open_stream( fs, filename ) )
[504]18        {
[505]19                png_loader loader;
20                image_data* result = loader.load( *file );
[504]21                delete file;
[505]22                if ( result )
[504]23                {
[505]24                        add( filename, result );
25                        return true;
[504]26                }
27        }
[505]28        return false;
[484]29}
30
Note: See TracBrowser for help on using the repository browser.