Subversion Repository Public Repository

Divide-Framework

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "Headers/ByteBuffer.h"

namespace Divide {

void ByteBuffer::append(const U8 *src, size_t cnt) {
    if (src != nullptr && cnt > 0) {
        if (_storage.size() < _wpos + cnt) {
            _storage.resize(_wpos + cnt);
        }

        memcpy(&_storage[_wpos], src, cnt);
        _wpos += cnt;
    }
}


bool ByteBuffer::dumpToFile(const stringImpl& fileName) const {
    return writeFile(fileName, _storage, FileType::BINARY);
}

bool ByteBuffer::loadFromFile(const stringImpl& fileName) {
    return readFile(fileName, _storage, FileType::BINARY);
}

};  // namespace Divide

Commits for Divide-Framework/trunk/Source Code/Platform/ByteBuffer.cpp

Diff revisions: vs.
Revision Author Commited Message
832 Diff Diff IonutCava picture IonutCava Thu 26 Jan, 2017 17:23:11 +0000

[IonutCava]
- More path related work
- Initial code to centralize file I/O (does not compile yet)

671 Diff Diff IonutCava picture IonutCava Fri 08 Apr, 2016 16:26:49 +0000

[Ionut]
- Custom memory allocation system part 1:
— Add http://www.codeproject.com/Articles/1089905/A-Custom-STL-std-allocator-Replacement-Improves-Pe
— Add custom allocators to strings and vectors
— Add custom allocators to a few test classes
— No support for aligned memory yet, so vec4<F32> and mat4<F32> vectors use the old allocation system
- Replace more std::async call with our custom task system

540 Diff Diff IonutCava picture IonutCava Wed 28 Oct, 2015 19:06:28 +0000

[IonutCava]
- Remove the “Platform” folder from the Platform project as the name is redundant. Move files one level up

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

[IonutCava]
- 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.

513 Diff Diff IonutCava picture IonutCava Mon 21 Sep, 2015 16:04:28 +0000

[IonutCava]
- Some code cleanup

512 Diff Diff IonutCava picture IonutCava Fri 04 Sep, 2015 10:23:54 +0000

[IonutCava]
- Small correction to vertex buffer compression

510 IonutCava picture IonutCava Thu 03 Sep, 2015 16:01:22 +0000

[IonutCava]
- Modify VertexBuffer classes to use interleaved data
— Needs a lot of optimizations. Higher RAM and VRAM usage currently, but faster access