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)
changed transformation matrix to 4x4 from 3x3 5b5728dabefb471cf126bf4b524f5079a14c0735 Your Name 2019-11-30 15:16:50
added missing return 94644ed6f61207f664ac4675fa015afbe017ddea jp.larry 2019-11-29 09:03:14
scene improvements, changed shift type to unsigned, set default-value funtions, model must be path a2708b94b88eb0ede73b9aab396e7a13f13baa52 Your Name 2019-11-29 09:27:32
separate function for str reading 9127f9a18f9f4974975fa35d58f596952b6aa4e5 Your Name 2019-11-29 09:26:43
new result errors ef56e017e2e761fdf23c6a64ed33277c98569e13 Your Name 2019-11-29 09:26:12
new types for Scene e2fde0d2b66e125ba3bfd86b8f51c81ecb5ab047 Your Name 2019-11-29 00:38:27
shift scale added to Scene 974752944e73bbc2949ff399ab9d806baeeab751 Your Name 2019-11-29 00:38:06
new resource type - scene - list of models f3eea43135dad8b3e24cf6683e5abc1a5e2e57ad Your Name 2019-11-28 07:59:59
model correctly handling error returns 3df9ec0f9abed56709b8b9556a5291217ad8744d Your Name 2019-11-28 07:59:25
updated jlib 2a28ba18170dc757f7bad931a12a34ee3e7e1c46 Your Name 2019-11-27 03:44:11
replaced free with jl::deallocate ab8d6cb89f814227c280797dbe654971a85264a6 Your Name 2019-11-25 07:29:05
second initial commit fb7a7e999477c84f10b3d618f6b00347fd0a9ca7 Your Name 2019-11-23 01:38:14
initial commit 3dc064f64d245d1dddcbdf8493b0be0a321cb65d Your Name 2019-11-22 20:10:24
Commit 5b5728dabefb471cf126bf4b524f5079a14c0735 - changed transformation matrix to 4x4 from 3x3
Author: Your Name
Author date (UTC): 2019-11-30 15:16
Committer name: Your Name
Committer date (UTC): 2019-11-30 15:16
Parent(s): 94644ed6f61207f664ac4675fa015afbe017ddea
Signing key:
Tree: cd4d98b6cb82dfb428b2129ca923312bf72455ca
File Lines added Lines deleted
include/jrf/scene.h 8 8
File include/jrf/scene.h changed (mode: 100644) (index de9fc6c..208616c)
... ... struct jrf::SceneEntry
12 12 pos = {}; pos = {};
13 13 shift = {}; shift = {};
14 14 transform = {}; transform = {};
15 transform[0] = transform[4] = transform[8] = 1;
15 transform[0] = transform[5] = transform[10] = transform[15] = 1;
16 16 } }
17 17
18 18 jl::array<float, 3> pos; ///< position jl::array<float, 3> pos; ///< position
19 19 jl::array<int32_t,3> shift; ///< shift of position jl::array<int32_t,3> shift; ///< shift of position
20 jl::array<float, 9> transform; ///< transformation matrix 3x3
20 jl::array<float, 16> transform; ///< transformation matrix 4x4
21 21 }; };
22 22
23 23 void destroy() { model_path.destroy(); } void destroy() { model_path.destroy(); }
 
... ... struct jrf::SceneEntry
32 32 if (res != Result::SUCCESS) if (res != Result::SUCCESS)
33 33 return res; return res;
34 34
35 jl::io_agent_alt<IO> *p_io = p_mediator;
35 auto *p_io = jl::io_agent_p_alt_cast(p_mediator);
36 36 if (not p_io->read_items(&options.pos)) if (not p_io->read_items(&options.pos))
37 37 goto CANCEL; goto CANCEL;
38 38 if (not p_io->read_items(&options.shift)) if (not p_io->read_items(&options.shift))
 
... ... struct jrf::Scene
81 81 template<typename IO = jl::io_agent> template<typename IO = jl::io_agent>
82 82 [[nodiscard]] Result read(IO *p_mediator) [[nodiscard]] Result read(IO *p_mediator)
83 83 { {
84 jl::io_agent_alt<IO> *p_io = p_mediator;
84 auto *p_io = jl::io_agent_p_alt_cast(p_mediator);
85 85 if (not p_io->read_items(&options.shift)) if (not p_io->read_items(&options.shift))
86 86 return Result::MEDIATOR_ERROR; return Result::MEDIATOR_ERROR;
87 87 if (not p_io->read_items(&options.shift_scale)) if (not p_io->read_items(&options.shift_scale))
 
... ... struct jrf::Scene
98 98 if (not entries.init(entry_count)) if (not entries.init(entry_count))
99 99 return Result::ALLOCATION_FAIL; return Result::ALLOCATION_FAIL;
100 100
101 Result res;
102 for (uint64_t i = 0; i < entry_count; ++i) {
103 res = entries[i].read(p_mediator);
101 for (uint64_t i = 0; i < entry_count; ++i)
102 {
103 Result res = entries[i].read(p_mediator);
104 104 if (res != Result::SUCCESS) if (res != Result::SUCCESS)
105 105 { {
106 106 while(i > 0) while(i > 0)
 
... ... struct jrf::Scene
109 109 break; break;
110 110 } }
111 111 } }
112 return res;
112 return Result::SUCCESS;
113 113 } }
114 114
115 115 template<typename IO = jl::io_agent> template<typename IO = jl::io_agent>
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