awlib.git
3 weeks agoqueue: Fix copy constructor master
Hudd [Fri, 1 May 2020 23:36:19 +0000 (02:36 +0300)]
queue: Fix copy constructor

3 weeks agoqueue: Add comparison operators
Hudd [Fri, 1 May 2020 23:31:17 +0000 (02:31 +0300)]
queue: Add comparison operators

3 weeks agoqueue: Add missing return
Hudd [Fri, 1 May 2020 23:30:25 +0000 (02:30 +0300)]
queue: Add missing return

3 weeks agoqueue: Fix compile error when copying a const queue
Hudd [Fri, 1 May 2020 23:00:43 +0000 (02:00 +0300)]
queue: Fix compile error when copying a const queue

Sometimes const-correctness is so annoying...

3 weeks agodoc: Fix const-correctness
Hedede [Fri, 1 May 2020 23:48:59 +0000 (02:48 +0300)]
doc: Fix const-correctness

Weird, I've checked it. Did I forget to commit?

2 months agodoc: Additional methods for getting a list of nodes
Hudd [Sat, 21 Mar 2020 06:42:50 +0000 (09:42 +0300)]
doc: Additional methods for getting a list of nodes

2 months agoawdoc: libdoc -> libawdoc
Hudd [Mon, 16 Mar 2020 20:27:59 +0000 (23:27 +0300)]
awdoc: libdoc -> libawdoc

2 months agoconfig: Add aw_force_inline macro
Hudd [Mon, 16 Mar 2020 20:19:09 +0000 (23:19 +0300)]
config: Add aw_force_inline macro

2 months agoutility: Add _unreachable
Hudd [Mon, 16 Mar 2020 20:01:43 +0000 (23:01 +0300)]
utility: Add _unreachable

2 months agobuild: hdf -> doc
Hudd [Mon, 16 Mar 2020 19:43:36 +0000 (22:43 +0300)]
build: hdf -> doc

2 months agofileformat/obj: Ignore leading-whitespace in obj
Hudd [Sat, 14 Mar 2020 13:42:46 +0000 (16:42 +0300)]
fileformat/obj: Ignore leading-whitespace in obj

2 months agotypes/tests: Shorten tmpflag duration
Hudd [Sun, 15 Mar 2020 08:30:36 +0000 (11:30 +0300)]
types/tests: Shorten tmpflag duration

2 months agovariant: Fix binary search dispatch
Hudd [Sun, 15 Mar 2020 08:14:49 +0000 (11:14 +0300)]
variant: Fix binary search dispatch

I accidentally tuned left half of it into a linear search. Now it should
be optimal

2 months agovariant: Add type deduction and linear dispatch
Hudd [Sun, 15 Mar 2020 07:30:04 +0000 (10:30 +0300)]
variant: Add type deduction and linear dispatch

I think linear dispatch should perform better than binary search when
there are only 2 or 3 alternatives (maybe even more?)

Type deduction wasn't tested, but doesn't break tests so whatever (I'm
thinking of ditching my variant in favour of std::variant)

2 months agoawdoc: Add document
Hudd [Sun, 15 Mar 2020 00:46:27 +0000 (03:46 +0300)]
awdoc: Add document

Convenient container for an awdoc. Allows searching nodes by path

2 months agovariant: Remove specialization of vh_recursive
Hudd [Sun, 15 Mar 2020 00:15:04 +0000 (03:15 +0300)]
variant: Remove specialization of vh_recursive

2 months agoawdoc: Rename hdf->doc
Hudd [Sat, 14 Mar 2020 15:28:08 +0000 (18:28 +0300)]
awdoc: Rename hdf->doc

2 months agoawdoc: Rename hdf into awdoc
Hudd [Sat, 14 Mar 2020 14:33:32 +0000 (17:33 +0300)]
awdoc: Rename hdf into awdoc

There is an already established file format called 'hdf' so I decided to
rename my file format to avoid confusion down the road

2 months agobuild: Upgrade to C++17
Hedede [Sat, 14 Mar 2020 13:18:37 +0000 (16:18 +0300)]
build: Upgrade to C++17

2 months agoawdoc: Fix build #2
Hedede [Sat, 14 Mar 2020 11:47:36 +0000 (14:47 +0300)]
awdoc: Fix build #2

What is even log_fwd? It used to compile, so it was there... when did I
remove it?

2 months agoawdoc: fix build
Hedede [Sat, 14 Mar 2020 11:35:19 +0000 (14:35 +0300)]
awdoc: fix build

I'm unsure why was it declared friend in the first place.

14 months agohdf: Add utility functions
Hudd [Fri, 8 Mar 2019 22:15:49 +0000 (01:15 +0300)]
hdf: Add utility functions

I took them from Havogrek, these are high-level wrappers for parser
class. I did some minor cleanup, because this was C++98 code.

14 months agohdf: Rewrite node class
Hudd [Fri, 8 Mar 2019 22:13:12 +0000 (01:13 +0300)]
hdf: Rewrite node class

I took the new code from Havogrek, I am not sure why the newer version
of node wasn't committed into this repository, it is 3 years old by now.

14 months agohdf: Convert writer to snake_case
Hudd [Thu, 7 Mar 2019 10:45:01 +0000 (13:45 +0300)]
hdf: Convert writer to snake_case

14 months agoFix more of missing returns
Hedede [Tue, 5 Mar 2019 13:33:47 +0000 (16:33 +0300)]
Fix more of missing returns

14 months agoAdd missing return in gl::load_functions
Hedede [Tue, 5 Mar 2019 13:30:16 +0000 (16:30 +0300)]
Add missing return in gl::load_functions

It is a temporary fix, because it should return something different
(maybe a simple bool will suffice?)
It wan't a prooblem, because func is static, but since blah blah
swithced -Werror on

14 months agohdf: Update reader example
Hudd [Mon, 4 Mar 2019 12:48:20 +0000 (15:48 +0300)]
hdf: Update reader example

14 months agohdf: Fix return-type compile errors
Hudd [Mon, 4 Mar 2019 12:47:51 +0000 (15:47 +0300)]
hdf: Fix return-type compile errors

14 months agoAdd default case for ostream_logger
Hedede [Tue, 5 Mar 2019 13:26:06 +0000 (16:26 +0300)]
Add default case for ostream_logger

16 months agoutility: Add hash_combine
Hedede [Mon, 21 Jan 2019 03:47:24 +0000 (06:47 +0300)]
utility: Add hash_combine

It is based on popular version which is also found in boost.
I added a rotate (so that xor's don't cancel out) and a bigger prime for
64 bit values.

16 months agomath: Replace rotl/rotr with template function
Hedede [Mon, 21 Jan 2019 03:09:57 +0000 (06:09 +0300)]
math: Replace rotl/rotr with template function

+ Works for all unsigned integral types
+ Now constexpr
- I've removed MSVC built-ins because
C2131: expression did not evaluate to a constant
- It doesn't have an optimization built into it, but oh well

16 months agoBuild: Add -Werror=return-type
Hudd [Mon, 14 Jan 2019 18:54:58 +0000 (21:54 +0300)]
Build: Add -Werror=return-type

I forget the return inside operator= quite often.

16 months agogl3: Fix missing returns in assinment operators
Hudd [Mon, 14 Jan 2019 18:51:38 +0000 (21:51 +0300)]
gl3: Fix missing returns in assinment operators

This also caused a crash in resource manager.

16 months agoranges: Fix missing return in ipairs
Hudd [Mon, 14 Jan 2019 18:50:07 +0000 (21:50 +0300)]
ranges: Fix missing return in ipairs

16 months agocontainers: Fix allocator type in flat_map
Hudd [Mon, 14 Jan 2019 18:47:53 +0000 (21:47 +0300)]
containers: Fix allocator type in flat_map

Curiously, this is UB.

2 years agomath: C++17ify math.h
Hudd [Sat, 5 May 2018 11:44:00 +0000 (14:44 +0300)]
math: C++17ify math.h

2 years agomath: Improve the description of lerp()
Hudd [Sat, 5 May 2018 11:08:33 +0000 (14:08 +0300)]
math: Improve the description of lerp()

2 years agoplatform: Add missing `using`s
Hudd [Sun, 29 Apr 2018 18:16:01 +0000 (21:16 +0300)]
platform: Add missing `using`s

2 years agotypes: Extend array_view test
Hudd [Sun, 29 Apr 2018 18:11:41 +0000 (21:11 +0300)]
types: Extend array_view test

2 years agoplatform: Add spawn & friends io-process
Hudd [Sun, 29 Apr 2018 17:31:14 +0000 (20:31 +0300)]
platform: Add spawn & friends

(Migrated from drpd)

2 years agotypes: Fix critical mistake in array_view::back()
Hudd [Sun, 29 Apr 2018 17:50:42 +0000 (20:50 +0300)]
types: Fix critical mistake in array_view::back()

2 years agoplatform: Update os_version test
Hudd [Sun, 29 Apr 2018 13:19:58 +0000 (16:19 +0300)]
platform: Update os_version test

2 years agoplatform: Move demangle strings into separate file
Hudd [Sun, 29 Apr 2018 13:18:34 +0000 (16:18 +0300)]
platform: Move demangle strings into separate file

2 years agoplatform: Remove old outdated code
Hudd [Sun, 29 Apr 2018 13:13:58 +0000 (16:13 +0300)]
platform: Remove old outdated code

2 years agomath: Add make_inverse_transform
Hudd [Fri, 27 Apr 2018 11:13:37 +0000 (14:13 +0300)]
math: Add make_inverse_transform

2 years agoFix build error
Hudd [Sun, 22 Apr 2018 12:33:13 +0000 (15:33 +0300)]
Fix build error

It is annoying when other headers mask the error.

2 years agographics: Improve shader loader utilities
Hudd [Sun, 22 Apr 2018 12:27:01 +0000 (15:27 +0300)]
graphics: Improve shader loader utilities

2 years agotypes: Add initializer list support to array_view
Hudd [Sun, 22 Apr 2018 12:26:24 +0000 (15:26 +0300)]
types: Add initializer list support to array_view

2 years agomath: Add make_transform()
Hudd [Sat, 21 Apr 2018 21:27:46 +0000 (00:27 +0300)]
math: Add make_transform()

2 years agographics: Fix incorrect usage of transpose()
Hudd [Sat, 21 Apr 2018 21:19:30 +0000 (00:19 +0300)]
graphics: Fix incorrect usage of transpose()

2 years agographics: Add few uasages of extend()
Hudd [Sat, 21 Apr 2018 21:18:05 +0000 (00:18 +0300)]
graphics: Add few uasages of extend()

2 years agomath: Rename expand_matrix() -> extend()
Hudd [Sat, 21 Apr 2018 21:14:23 +0000 (00:14 +0300)]
math: Rename expand_matrix() -> extend()

I believe this name is more correct. Dropped _matrix, because it is
shorter to read this way and it is already unambigous.

2 years agomath: Add translation_matrix()
Hudd [Sat, 21 Apr 2018 21:10:41 +0000 (00:10 +0300)]
math: Add translation_matrix()

Quite useful utility, should've made it earlier.

2 years agomath: Fix look_at_inverse
Hudd [Sat, 21 Apr 2018 20:56:21 +0000 (23:56 +0300)]
math: Fix look_at_inverse

I forgot that inversing a product of two matrices also inverses order of
operations.

(A·B)⁻¹ = B⁻¹·A⁻¹                   (1)

2 years agomath: Replace pow(1./3.) with cbrt()
Hudd [Sat, 21 Apr 2018 19:47:28 +0000 (22:47 +0300)]
math: Replace pow(1./3.) with cbrt()

It is more accurate (and probably performant).

(Good thing I noticed this)

2 years agomath: Add second overload of look_at_inverse
Hudd [Wed, 18 Apr 2018 09:20:40 +0000 (12:20 +0300)]
math: Add second overload of look_at_inverse

2 years agomath: Fix typo in look_at()
Hudd [Wed, 18 Apr 2018 08:56:54 +0000 (11:56 +0300)]
math: Fix typo in look_at()

2 years agoFix missing return
Hudd [Wed, 18 Apr 2018 08:38:34 +0000 (11:38 +0300)]
Fix missing return

2 years agomath: Add look_at_inverse
Hudd [Wed, 18 Apr 2018 06:34:42 +0000 (09:34 +0300)]
math: Add look_at_inverse

2 years agogl3: Allow passing mat3 to uniforms
Hudd [Thu, 12 Apr 2018 12:11:28 +0000 (15:11 +0300)]
gl3: Allow passing mat3 to uniforms

2 years agocontainers: Convert queue to use circular_iterator
Hudd [Sat, 14 Apr 2018 08:25:17 +0000 (11:25 +0300)]
containers: Convert queue to use circular_iterator

Part of the series introducing circular_buffer.

(Forgot to commit 177 commits ago)

2 years agomath: Remove <iostream> from angle.h
Hudd [Sat, 7 Apr 2018 12:46:54 +0000 (15:46 +0300)]
math: Remove <iostream> from angle.h

2 years agomath: Update angle to C++17
Hudd [Sat, 7 Apr 2018 11:35:54 +0000 (14:35 +0300)]
math: Update angle to C++17

2 years agomath: Disambiguate different versions of look_at
Hudd [Fri, 6 Apr 2018 22:45:43 +0000 (01:45 +0300)]
math: Disambiguate different versions of look_at

2 years agomath: Add look_at function
Hudd [Fri, 6 Apr 2018 22:19:51 +0000 (01:19 +0300)]
math: Add look_at function

2 years agomath: Rename polar.h -> orientaion.h
Hudd [Fri, 6 Apr 2018 21:53:32 +0000 (00:53 +0300)]
math: Rename polar.h -> orientaion.h

2 years agomath: Add vector cross-product tests
Hudd [Fri, 6 Apr 2018 19:29:22 +0000 (22:29 +0300)]
math: Add vector cross-product tests

2 years agographics: Fix include path
Hudd [Fri, 6 Apr 2018 19:28:34 +0000 (22:28 +0300)]
graphics: Fix include path

2 years agomath: Fix vector.normalize()
Hudd [Fri, 6 Apr 2018 19:28:19 +0000 (22:28 +0300)]
math: Fix vector.normalize()

2 years agomath: Remove static qualifier from matrix functions
Hudd [Fri, 6 Apr 2018 19:27:21 +0000 (22:27 +0300)]
math: Remove static qualifier from matrix functions

These were static members of matrix_ops class, and looks like I forgot
to remove the qualifier when I moved them into namespacec.

2 years agomath: Add expand_matrix
Hudd [Fri, 6 Apr 2018 19:26:39 +0000 (22:26 +0300)]
math: Add expand_matrix

2 years agomath: Add [[nodiscard]] to transpose/inverse
Hudd [Fri, 6 Apr 2018 19:24:15 +0000 (22:24 +0300)]
math: Add [[nodiscard]] to transpose/inverse

Forgetting that transpose() has value seantics has bitten me several
times. It is harder to forget how inverse() works, but I it is possible.

2 years agomath: Add spherical_to_cartesian
Hudd [Thu, 5 Apr 2018 16:20:48 +0000 (19:20 +0300)]
math: Add spherical_to_cartesian

Convert spherical coordiantes into cartesian coordinates.
This is intended to be used in orbit camera implementation (i.e. one
that is used in most of model editors).

2 years agoMerge remote-tracking branch 'origin/gl3-wip'
Hedede [Thu, 22 Mar 2018 09:01:09 +0000 (12:01 +0300)]
Merge remote-tracking branch 'origin/gl3-wip'

2 years agogl/utility: Add load_program() func
Hudd [Thu, 22 Mar 2018 08:58:22 +0000 (11:58 +0300)]
gl/utility: Add load_program() func

2 years agogl: Move header shader_file -> program_loader
Hudd [Thu, 22 Mar 2018 08:56:07 +0000 (11:56 +0300)]
gl: Move header shader_file -> program_loader

2 years agoUpdate logger library
Hedede [Wed, 21 Mar 2018 05:02:16 +0000 (08:02 +0300)]
Update logger library

2 years agoMerge branch 'gl3-wip' of ~git/awlib
Hedede [Wed, 21 Mar 2018 03:45:56 +0000 (06:45 +0300)]
Merge branch 'gl3-wip' of ~git/awlib

2 years agogl: Add program_manager
Hudd [Wed, 21 Mar 2018 03:34:10 +0000 (06:34 +0300)]
gl: Add program_manager

2 years agomath: Extend rotation-matrix test
Hudd [Mon, 19 Feb 2018 08:49:59 +0000 (11:49 +0300)]
math: Extend rotation-matrix test

2 years agoranges: Add forward() in zip constructor
Hudd [Mon, 19 Feb 2018 05:56:14 +0000 (08:56 +0300)]
ranges: Add forward() in zip constructor

This is necessary in this case, because otherwise argument becomes an
lvalue and cannot bind to rvalue-reference.

2 years agoMove forward.h to utility
Hudd [Mon, 19 Feb 2018 05:38:28 +0000 (08:38 +0300)]
Move forward.h to utility

2 years agomath: Update matrix3 test
Hudd [Tue, 13 Feb 2018 08:16:26 +0000 (11:16 +0300)]
math: Update matrix3 test

2 years agomath: Add deduction guide for vector
Hudd [Tue, 13 Feb 2018 08:15:56 +0000 (11:15 +0300)]
math: Add deduction guide for vector

2 years agoMerge branch 'gl3-wip' into gl3-merge
Hudd [Tue, 13 Feb 2018 07:51:55 +0000 (10:51 +0300)]
Merge branch 'gl3-wip' into gl3-merge

2 years agotest: Remove `tests` directory
Hudd [Tue, 13 Feb 2018 07:07:58 +0000 (10:07 +0300)]
test: Remove `tests` directory

It was deprecated for a long time, but I had beeb too lazy to properly
rewrite test that were left there.

2 years agomath: Add test for matrix3 rotation
Hudd [Tue, 13 Feb 2018 07:06:56 +0000 (10:06 +0300)]
math: Add test for matrix3 rotation

2 years agoranges: Add `inline` to char_range
Hudd [Sun, 11 Feb 2018 09:38:25 +0000 (12:38 +0300)]
ranges: Add `inline` to char_range

2 years agocontainer: Fix typo in circular_buffer test
Hudd [Sun, 11 Feb 2018 09:38:07 +0000 (12:38 +0300)]
container: Fix typo in circular_buffer test

2 years agoUpdate readme
Hudd [Sat, 10 Feb 2018 15:17:25 +0000 (18:17 +0300)]
Update readme

It was beyond out-of-date. AWLIB hasn't been a part of AWRTS repository
for quite some time.
It is still a stub, but at least it gives better picture of what this
is.

2 years agotypes: Add circular_buffer
Hudd [Fri, 9 Feb 2018 22:20:29 +0000 (01:20 +0300)]
types: Add circular_buffer

A fixed-size buffer that overwrites itself (FIFO). This is useful for
various purposes, for example, for a fixed-size log, which holds last N
messages.

2 years agobuild: Make dependency paths absolute
Hudd [Wed, 7 Feb 2018 18:45:09 +0000 (21:45 +0300)]
build: Make dependency paths absolute

2 years agoMerge remote branch 'origin/master' into gl3-wip
Hudd [Wed, 7 Feb 2018 18:42:00 +0000 (21:42 +0300)]
Merge remote branch 'origin/master' into gl3-wip

Conflicts:
include/aw/io/mmap_file.h

2 years agogl/test: Add little explanation to camera_controller
Hudd [Wed, 7 Feb 2018 18:30:44 +0000 (21:30 +0300)]
gl/test: Add little explanation to camera_controller

2 years agographics/test: Add logger
Hudd [Fri, 10 Nov 2017 19:15:13 +0000 (22:15 +0300)]
graphics/test: Add logger

2 years agopng: Reorganize loader
Hudd [Fri, 10 Nov 2017 19:12:16 +0000 (22:12 +0300)]
png: Reorganize loader

2 years agopng: Fix crashes and heap corruption
Hudd [Fri, 10 Nov 2017 19:09:58 +0000 (22:09 +0300)]
png: Fix crashes and heap corruption

png_row_bytes() was called before png_read_update_info(), thus returning
old (before transformations) value.

2 years agoutility/ranges: C++17-ify ipairs
Hudd [Fri, 10 Nov 2017 19:03:35 +0000 (22:03 +0300)]
utility/ranges: C++17-ify ipairs

2 years agoutility/ranges: C++17-ify zip
Hudd [Fri, 10 Nov 2017 07:23:10 +0000 (10:23 +0300)]
utility/ranges: C++17-ify zip

- Make zip_iterator::iters private
- Make use of class argument deduction to get rid of index_sequence.

2 years agoutility/ranges: Replace pairs_adapter with zip
Hudd [Fri, 10 Nov 2017 07:17:35 +0000 (10:17 +0300)]
utility/ranges: Replace pairs_adapter with zip