Subversion Repository Public Repository


This repository has no backups
This repository's network speed is throttled to 100KB/sec

#include "Core/Resources/Headers/ResourceLoader.h"
#include "Core/Resources/Headers/ResourceCache.h"
#include "Geometry/Shapes/Headers/Mesh.h"
#include "Geometry/Importer/Headers/MeshImporter.h"

namespace Divide {

Resource_ptr ImplResourceLoader<Mesh>::operator()() {
    MeshImporter& importer = MeshImporter::instance();

    Mesh_ptr ptr;
    Import::ImportData tempMeshData(_descriptor.getResourceLocation());
    if (importer.loadMeshDataFromFile(tempMeshData)) {
        ptr = importer.loadMesh(_descriptor.getName(), tempMeshData);
    } else {
        //handle error
        DIVIDE_UNEXPECTED_CALL(Util::StringFormat("Failed to import mesh [ %s ]!",

    if (!load(ptr) || !ptr) {
    } else {
        if (_descriptor.getFlag()) {

    return ptr;


Commits for Divide-Framework/trunk/Source Code/Core/Resources/ConcreteLoaders/MeshLoaderImpl.cpp

Diff revisions: vs.
Revision Author Commited Message
727 Diff Diff IonutCava picture IonutCava Tue 14 Jun, 2016 16:01:38 +0000

- Remove node and cmd buffers from GFXDevice and add them as a new BufferData struct to RenderPass class.
— Each render pass holds its own buffers
- Improvements / fixes to the CSM code
- Added a global toggle to enable/disable custom memory allocators

709 Diff Diff IonutCava picture IonutCava Thu 19 May, 2016 16:21:46 +0000

- Massive rewrite of the resource system:
— ResourceCache now uses a map of weak pointers and passes shared pointers to the call point of CreateResource
— RemoveResource is no longer needed, but resource based smart pointers use a custom deleter that calls unload()
— Keep a shared_ptr of the resource in the entity that needs it and pass shared_ptr references from getter methods
-— All of this removed the need for calls to RemoveResource, REGISTER_TRACKED_DEPENDENCY and UNREGISTER_TRACKED_DEPENDENCY reducing the number of mutex locks and atomic exchanges
- Singleton cleanup:
— Removed ShaderManager singleton and merged it’s data and responsibilities in static methods in both ShaderProgram and Shader classes.
Explanation: Due to the complex interdependency chains in the system, copying, updating, tracking the cache in a thread safe way became a lot more slower than a straight forward smart pointer based implementation. (e.g. scene graph nodes have 3d objects and material instances, 3d objects have materials, materials have textures and shaders, etc)

692 Diff Diff IonutCava picture IonutCava Wed 27 Apr, 2016 16:24:26 +0000

- Resource system cleanup:
— Resource name and resource file location (if any) is now passed only via explicit constructors! (ResourceDescriptors already contain this data, so why use setters?)
- Fix a bug with ortho projection matrix calculation (set m[3][3] to 1. this was skipped when the identity() call was changed to zero() in the ortho() function)
— This also fixed text rendering

670 Diff Diff IonutCava picture IonutCava Wed 06 Apr, 2016 16:21:35 +0000

- getInstance() renamed to instance() for simplicity (should really go away altogether, but that’s a different issue)
- some particle emitter threading updates

567 Diff Diff IonutCava picture IonutCava Sun 15 Nov, 2015 18:37:02 +0000

- Reduce some virtual function call overhead:
— Remove HardwareResource and merge it’s responsibilities back into Resource
— GFXDevice class doesn’t need to inherit from RenderAPIWrapper as it’s not a rendering API

519 Diff Diff IonutCava picture IonutCava Mon 05 Oct, 2015 16:04:47 +0000

- More separation between DVDConverter and MeshImporter:
— DVDConverter is no longer a singleton. Multiple converters can be used at the same time
— More sanity checks added to MeshImporter
- Performance tweak: faster animated bounding box calculations
- Don’t pass input to application if it got processed by CEGUI (helped in removing editor/console visibility check hack)

518 Diff Diff IonutCava picture IonutCava Sun 04 Oct, 2015 20:08:56 +0000

- New asset loading system and new asset formats (DVDGeom – geometry and material data. DVDAnim – animation data):
— Separate ASSIMP importing process (including animations) from Mesh/SubMesh/Material creation:
— Interface ASSIMP with the rest of the framework via a “ImportData” structure.
— Allow saving/loading from file of the entire ImportData and animation data entries via serialization.
— Allow serialization of VertexBuffers and update animation system’s serialization structure as well
— Base all serialization/deserialization processes on the ByteBuffer class with support for loading/saving to files
— If DVDGeom and DVDAnim files are not found, fall back to ASSIMP to load the data and save them for later use
-— Loading times reduce in half if data is already present.
-— Multi-threaded asset loading is now possible.
-— Other (non-ASSIMP) importing libraries can now be used.
-— DVDGeom and DVDAnim files can be shared/moved but not edited (they hold binary data for smaller memory usage)
- OpenGL/Direct3D usage is a compile time toggle (for now) for performance reasons.

460 Diff Diff IonutCava picture IonutCava Tue 02 Jun, 2015 22:11:41 +0000

- Linux port work

350 Diff Diff IonutCava picture IonutCava Tue 10 Feb, 2015 16:25:39 +0000

- Simplified some Util-namespace level functions by using STL algorithms where possible
- Formatted the entire codebase using clang-format with the following style: "{BasedOnStyle: Google, IndentWidth: 4}"
- Attempted to make ProfileTimer thread-safe (temp fix until std::chrono works properly in Visual Studio)

331 IonutCava picture IonutCava Sat 06 Dec, 2014 20:53:45 +0000

- Limited line length to 132 characters to improve readability and diff-comparisons
- Refactored memory allocation/deallocation functions
- Fixed a few compatibility issues with HashMap.h
- Fixed a bug in GPU Skinning shaders (cast a float to int)