Jackalope / jrf (public) (License: GPLv3 or later version) (since 2019-11-21) (hash sha1)
Libriary for reading and writing resource files: vertices, indices, meshes, images, models and scene data.
Supports reading from filesystem as well as from zip files.
It uses unique binary container format for those resources.
It is used in tool for converting popular formats like wavefront .obj file, TARGA image to this container and also used in resource loader as part of graphics framework.

It requires jlib libriary (see my user repositories) and libzip.
It is possible to remove libzip dependency.
List of commits:
Subject Hash Author Date (UTC)
added lost changes 1e60b3d0d8ecda7995f3a102257d8f3c0ca4b15e Jackalope 2020-05-24 13:27:42
CMake installation target 57ba69a5bc17124a96b401c20e68f1602345c4f7 Jackalope 2020-05-24 13:22:15
Moved read,write functions to read.h,write.h, merged vertices,indices and mesh files to mesh.h 365bcb01b01e95448e223de82e9f9e96b51fa789 Jackalope 2020-05-24 13:21:23
Update for new JLIB target a1152ffa6340863fbbd216a4d38806e2d31d3dd5 Jackalope 2020-05-23 23:27:05
added CMake project PARENT_SCOPE variables JRF_* 5ac8009d6709f681fbe0d59dba8cdd646a3cdc47 Jackalope 2020-05-20 19:06:51
added version number definitions, changed magic number (because incompatible) 46ccce5359274d660b327c667903b9534dc3bfe0 Jackalope 2020-05-19 17:39:57
Changed image formats, BGR->RGB convertion while reading from TARGA 297dd913b6084e890e5bd3d53f88d06a8f14657a Jackalope 2020-05-19 17:17:53
Changed cmake library interface 9c704c515769a03e5b1f82dcb1fd947884f1bd1e Jackalope 2020-05-12 06:58:47
added copyright notice to convert.cpp and convert.h a778f4f4a4783656fefac85440e135ddcda3788c Jackalope 2020-05-12 05:18:35
fixes after prev commit changes fc46b4bacf1c69f6eae0c679b26e3b88d1796217 Jackalope 2020-05-11 08:14:50
convert image from tga and add alpha channel functions 4541972149b6b19afda05c608d4abe88a72098bb Jackalope 2020-05-11 07:49:43
more image formats 77bf7ec016cfb604e4a8e06734a4eb71bb299df0 Jackalope 2020-05-11 07:48:46
added license d7c63a0b6199c7f5c1680559953eef1699ec9a48 Jackalope 2020-05-10 01:01:00
refactoring 66f541c32f51d6ed6f90fba1f3b58561726e8659 Jackalope 2020-05-10 00:55:34
extra vertices check c3bd2141d2eaeb96beb5c8ad29e3333c015db4c8 jp.larry 2019-12-26 14:38:29
removed dead code f4ddde689122f1b96fda5292e69f612bf2ca327d jp.larry 2019-12-26 14:38:06
removed forgotten vertex data_size writing 25244188b395b6cca35502f4156d3e78cc1e74ec jp.larry 2019-12-26 13:19:31
better read errors d6d7bc5df695d694ea0dee225905212ef1dfe41b jp.larry 2019-12-26 13:18:55
changed vertices file structure to prevent undefined behaviour 603e283ccf234f87f6e8c38a669280be36a5aafb jp.larry 2019-12-26 12:35:05
vertex attributes is separated, not inteleaved now d3e7b79c74e9fae7b8b788d1a55db2e664feb107 jp.larry 2019-12-26 01:19:17
Commit 1e60b3d0d8ecda7995f3a102257d8f3c0ca4b15e - added lost changes
Author: Jackalope
Author date (UTC): 2020-05-24 13:27
Committer name: Jackalope
Committer date (UTC): 2020-05-24 13:27
Parent(s): 57ba69a5bc17124a96b401c20e68f1602345c4f7
Signing key:
Tree: 8f6916c78e02776a18a031892f95ae0e7cd36c49
File Lines added Lines deleted
include/jrf/mesh.h 14 9
include/jrf/read.h 2 2
File include/jrf/mesh.h changed (mode: 100644) (index ceca7ff..e2acfcb)
... ... namespace jrf {
40 40 1, 2, 4, 8, 1, 2, 4, 8,
41 41 1, 2, 4, 8 1, 2, 4, 8
42 42 }; };
43 enum VertexAttributeType {
44 POSITION, TEX_COORD, NORMAL,
45 RESERVED_BEGIN,
46 RESERVED_COUNT = 16
47 };
48 static_assert (RESERVED_BEGIN < RESERVED_COUNT);
49 constexpr static const uint8_t VERTEX_ATTRIBUTE_COUNT = RESERVED_COUNT;
43 namespace VertexAttributeT {
44 enum T {
45 POSITION, TEX_COORD, NORMAL,
46 RESERVED_BEGIN,
47 RESERVED_COUNT = 16
48 };
49 static_assert (RESERVED_BEGIN < RESERVED_COUNT);
50 }
51 using VertexAttribute = VertexAttributeT::T;
52 constexpr static const
53 uint8_t VERTEX_ATTRIBUTE_COUNT = VertexAttribute::RESERVED_COUNT;
50 54
51 struct VertexAttribute {
55 struct VertexAttributeData {
52 56 uint32_t offset; uint32_t offset;
53 57 uint16_t dimension_count; uint16_t dimension_count;
54 58 VertexFormat format; VertexFormat format;
55 59 }; };
56 using VertexAttributes = jl::array<VertexAttribute, VERTEX_ATTRIBUTE_COUNT>;
60 using VertexAttributes =
61 jl::array<VertexAttributeData, VERTEX_ATTRIBUTE_COUNT>;
57 62
58 63 namespace IndexFormatT { enum T : uint32_t { namespace IndexFormatT { enum T : uint32_t {
59 64 U16 = 2, U16 = 2,
File include/jrf/read.h changed (mode: 100644) (index ada8262..9a42965)
... ... namespace jrf {
46 46 switch(p->mode) { switch(p->mode) {
47 47 case ResourceMode::NONE: break; case ResourceMode::NONE: break;
48 48 case ResourceMode::DATA: { case ResourceMode::DATA: {
49 Result res = p->u.data.read(p_io);
49 Result res = read(&p->u.data, p_io);
50 50 if (res != Result::SUCCESS) if (res != Result::SUCCESS)
51 51 return res; return res;
52 52 } break; } break;
 
... ... namespace jrf
226 226 return Result::FILE_WRONG_HEADER; return Result::FILE_WRONG_HEADER;
227 227 if (header.type != RT) if (header.type != RT)
228 228 return Result::RESOURCE_TYPE_MISMATCH; return Result::RESOURCE_TYPE_MISMATCH;
229 return p_resource->read(p_io);
229 return read(p_resource, p_io);
230 230 } }
231 231 template<ResourceType RT> [[nodiscard]] inline template<ResourceType RT> [[nodiscard]] inline
232 232 Result read(typename Resource<RT>::T *p_resource, const char *p_file_path) { Result read(typename Resource<RT>::T *p_resource, const char *p_file_path) {
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/Jackalope/jrf

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/Jackalope/jrf

Clone this repository using git:
git clone git://git.rocketgit.com/user/Jackalope/jrf

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main