summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-05-07libstage: update copyright linesVito Caputo
2019-05-07libstage: use dll.h for linked lists, rm list.hVito Caputo
2019-05-07dll_h: move to include/dll_hVito Caputo
2019-05-07dll_h: add dll_h linked list header submoduleVito Caputo
Preparing to discard src/list.h
2018-09-11libstage: remove SDL2 dependency from configure.acVito Caputo
Now that libstage has no coupling to the rendering backend, there's no need for this.
2018-09-11libstage: remove everything dimensionalVito Caputo
Having the stage manage the rendering dimensions for nodes seemed like a good idea at the time. This commit removes all that so there's no more coupling to SDL or dimensional types. Now the stage really is nothing more than a thin drawing list abstraction. The layers can be used for ordering the drawing, which is the only semi-dimensional thing remaining. The stage_fit() helper remains for now out of convenience, but it's really out of place in this library.
2018-07-12libstage: add {position,aabb}_map concept to stageVito Caputo
I added a way to set these mappings per-node, but not per-stage. This adds setters for the stage, and new nodes are created with the current per-stage setting. The nodes may still have their mapping mode changed independent of the stage and one another, but this gives a means of easily setting a global mapping mode for a given stage.
2018-06-11libstage: add alternate node mappingsVito Caputo
Until now all aabb and position mapping has been simple linear filling of the stage. When the stage isn't square, which is usually, this isn't always desirable especially for the aabb sizing of things. This introduces per-node settings for the mapping of the node's aabb and position. The default continues to be to map the full stage, with two new settings for the minimum square and maximum square.
2018-06-09libstage: add stage_node_set_static()Vito Caputo
Static nodes are unaffected by stage movement, or if later there's a hierarchy in the stage, this would probably escape all ancestral influence. The anticipated use case is overlays like consoles, HUDs, and scores etc. Things which don't move with the dynamic game field.
2018-06-09libstage: simplify aabb_to_rect to operate on nodeVito Caputo
Initially it seemed plausible this might have to work on more than stage nodes, like composite or ephemeral constructions involving the same aabb/pos/origin types, but it doesn't seem to be the case for now so operate on the higher order node and stage types. Also makes it simpler to stick logic conditional on node state inside the function...
2018-06-09libstage: simplify set active and locked node apiVito Caputo
Just pass in the boolean setting rather than having different functions.
2018-06-09libstage: forward declare SDL types in stage.hVito Caputo
Callers of libstage may be middle abstractions which don't actually have any SDL dependency, don't unnecessarily introduce one by forcing them to include SDL headers.
2018-05-24libstage: rewrite aabb_to_rect() for less errorVito Caputo
There was too much fractional math happening at once resulting in artifacts like nodes sharing the same position jiggling relative to eachother as they moved. Instead compute the various values discretely, flooring their values. This also integrates the node origin, which previously was ignored. A clamp has also been added to prevent zero-size nodes in rect w or h when their AABB dimensions are non-zero.
2018-05-24libstage: add stage_node_[sg]et_origin()Vito Caputo
A way to specify how the node's position relates to the node's AABB rather than always being centered. An origin of -1,-1 would place position at the bottom left corner of the node's AABB, and +1,+1 the top right corner.
2018-05-24libstage: add stage_[sg]et_position()Vito Caputo
Starting to get an inkling of a need for a more hierarchical structure for the stage. Something which allows arbitrary grouping of nodes which can then be moved around and even scaled as one at the parent.
2018-05-24libstage: use v2f_t instead of float x,y in apiVito Caputo
2018-05-24libstage: decouple stage_fit() from stage_tVito Caputo
It's desirable to be able to fit dimensions to an aspect ratio prior to stage creation. Since stage creation requires an SDL2 Renderer, it must already have the window etc. Turn this into a lower level helper for fitting so the window can be sized before creating the renderer from it. Should probably name it differently, but this is fine for now.
2018-05-15stage: add stage_[sg]et_alpha()Vito Caputo
Convenient for whole-stage fades...
2018-05-14LICENSE: add copy of GPLv3Vito Caputo
2018-05-04stage: introduce stage_node_[sg]et_position()Vito Caputo
Leaving the existing node aabb semantics as both sizing and placing the node relative to the stage size and its center, add a simple means of statefully shifting the aabb. When the position is left unset, it's 0,0, and effectively a noop leaving the aabb to exclusively size and place the node. If you treat the aabb as purely sizing the node, treating it as centered at 0,0 then you can exclusively use this position api for placement of the node.
2018-05-03*: initial commit derived from whale stage codeVito Caputo
This code was used in whale [1], and prior to that was used in a smaller project called mal. Since I seemed to be doing a lot of reusing and building upon this, it seemed prudent to just stick it in a repo as a .a I could submodule in future SDL2 art projects. There are some kludges in this code currently, which will be fixed up in time.
© All Rights Reserved