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

Last change on this file since 510 was 505, checked in by epyon, 9 years ago
  • several STL updates
  • several minor fixes
File size: 662 bytes
Line 
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;
17        if ( stream* file = open_stream( fs, filename ) )
18        {
19                png_loader loader;
20                image_data* result = loader.load( *file );
21                delete file;
22                if ( result )
23                {
24                        add( filename, result );
25                        return true;
26                }
27        }
28        return false;
29}
30
Note: See TracBrowser for help on using the repository browser.