Commit graph

125 commits

Author SHA1 Message Date
06e3bfdeb7 New Line class and related algorithms and functions. 2014-07-16 23:42:37 +02:00
3f79507beb Assertion that the ObserverManager is empty when it's destroyed and verbosity. 2014-07-10 21:56:05 +02:00
9c660caec6 Use the new tree-based registration system in the mover. 2014-07-10 21:56:05 +02:00
61f0c28983 Revert "Refactoring in ObserversManager."
This reverts commit 9c2f61991869b7eacbb2bf3bfc257480aa1b24ba.

Conflicts:
	src/observersmanager.hpp
2014-07-10 21:56:05 +02:00
1682b1ade7 Use the new tree class instead of a flat array.
This is so that observers being registered can refer
"sub-observers" recursively. When such observer is deleted,
the whole underlying subtree is removed with it. This facilitates
the process of unregistering observers - ie: when the main
observer goes down because it is destroyed, all of its sub-observers
are removed as well, because in this architecture they are expected
to be aggregated to the main observer.
2014-07-10 21:56:05 +02:00
103689a29a Refactoring in ObserversManager.
Pull out the storage part so the class is more tidy.
2014-07-10 21:56:05 +02:00
b4ddfa8f4f Fix for a crash occurring when the window is resized.
Temporary Platform objects were registering themselves.
The move ctor would then initialize the final object in
the circular buffer (see PlatformSystem), but it would
leave the address of the temporary object registered in
the ObserversManager.
2014-07-06 02:21:25 +02:00
0c8e9b2d7c Typo fix. 2014-07-05 22:46:09 +02:00
4a3a0a4782 Add some (badly) generated platforms that will scroll
down whenever the player's top side depasses the middle
of the screen.
WiP.
2014-07-05 20:33:16 +02:00
976d34f17e Movers moved into a separate directory. 2014-07-05 18:48:04 +02:00
9a8367c00c Bugfix.
Too many elements were trimmed from the end of the lists
due to a wrong calculation of the last unused chunk length.
2014-07-04 13:23:37 +02:00
765e28849c Add a circular buffer class.
This was necessary as the one provided by boost didn't work
with my use case (though I don't remember, I wrote this code
months ago and I'm only committing now).
2014-07-04 13:22:42 +02:00
a95fcd629f Constructors that only throw if the operation they perform can throw. 2014-05-13 11:45:53 +02:00
fc50c6af55 Generate one platform and draw it. WiP. 2014-03-28 10:55:09 +01:00
b21fe20459 Buildfix 2014-03-28 10:51:48 +01:00
bf8d9ea327 Call std::srand() at the beginning. 2014-03-28 10:50:33 +01:00
2a4ae78374 Move semantics in SizeNotifiable. 2014-03-26 23:00:02 +01:00
6fe884cd5a Platform and PlatformSystem added to the game. WiP. 2014-03-26 10:44:01 +01:00
4d9190b0db Swapping support added to SizeNotifiable. 2014-03-26 10:42:43 +01:00
79fbf0faf7 Support drawing textures without doing any clipping. 2014-03-25 10:32:34 +01:00
0674f2d28d Set the viewport size and resolution on resoultion change. 2014-03-25 00:21:10 +01:00
a1e507ef12 Clip texture before rendering. 2014-03-24 21:32:24 +01:00
8af4e432e7 Debug only code for printing vectors. 2014-03-24 00:28:21 +01:00
108c10883a Support for unary minus operator. 2014-03-23 22:07:01 +01:00
452761985d Buildfix for clang 2014-03-21 22:51:28 +01:00
2b9746b868 Warning fix when T is a short int 2014-03-21 19:44:16 +01:00
46ad5ea5fe Tiled wallpaper replicated all over. 2014-03-20 22:07:47 +01:00
d0a052ddb2 Refactoring in SizeNotifiable.
Class is a template now and accepts a registraton policy.
2014-03-20 20:21:59 +01:00
dbf29f13d1 Use the new notifiable system to scale the character. 2014-03-20 12:39:39 +01:00
85d57fd681 Fixed a problem where only the x part was initialized. 2014-03-20 12:39:39 +01:00
f0a38a2f8a Adding new files to register objects that require to be notified when resolution changes.
Also added a structure that holds the resolution and the current scaling ratio.
2014-03-20 12:39:39 +01:00
b627b69221 Send resolution change notification when window is resized. 2014-03-20 12:39:39 +01:00
0c6275f41c Draw in abstract units and scale to pixels at the end. 2014-03-20 12:39:39 +01:00
a561242395 Implementation of == != < <= > >= operators. 2014-03-20 12:39:39 +01:00
ccc831e34d Refactoring in SDLMain. 2014-03-20 12:39:39 +01:00
4e3ad27ae8 Unneeded code. 2014-03-20 12:39:39 +01:00
8d2ddaa9ff New TiledWallpaper class for the background. 2014-03-20 12:39:09 +01:00
83d139d4b5 Support loading of 24 bit png. 2014-03-06 10:55:14 +01:00
d27b5773ca Temporary movement code. 2014-03-05 22:09:32 +01:00
fce08ed793 GPLv3 license. 2014-02-25 14:17:09 +01:00
ab31e94bf0 Movement with left/right arrow keys.
Movement is hardcoded but it works.
Also fixed some typos that gave me a hard time figuring out why
movement was giving all sort of crazy problems. Very bad typos,
see gameplaysceneclassic.cpp, inputbag.cpp, inputbag.hpp and key.hpp
if you want to get goosebumps.
2014-02-25 00:36:33 +01:00
597607366e InputBag in a working state and getting used. 2014-02-24 21:16:00 +01:00
d9ccbede66 Removed unneeded code in Placeable. 2014-02-24 21:09:33 +01:00
a9b53f33e1 Comments to clarify difference between MoverOneShot and MoverRelative. 2014-02-24 21:08:08 +01:00
3e8084c385 Bugfix in MoverRelative.
Old code was "undoing" offsets other than their own, so stacking
multiple movers was broken.
2014-02-24 21:07:35 +01:00
383ea0c17b New InputBag, not used yet. 2014-02-23 19:32:47 +01:00
68ebc16422 Speed up jumping. 2014-02-22 17:07:23 +01:00
897e4fd271 Flip vertical axis. 2014-02-22 17:07:02 +01:00
0978206a6c Helper code to pretty print vectors. 2014-02-22 17:06:43 +01:00
ac85f96907 Small refactoring in Placeable. 2014-02-22 17:06:25 +01:00
85c65b3e68 Refactoring in Movers.
The displayed texture now bounces vertically.
2014-02-22 13:13:49 +01:00
3269b469e3 Fix in contracted operators. 2014-02-22 13:12:50 +01:00
239a1c88d8 Only cast the result. 2014-02-22 12:26:26 +01:00
739b75b0b6 Support texture resizing. 2014-02-22 12:25:16 +01:00
e2bd48ec90 Using the new ObserversManager. 2014-02-21 23:13:15 +01:00
402681762a New class to manage subscribers and give IDs. 2014-02-21 23:11:02 +01:00
05a8d0188c PNG loading fixed. 2014-02-21 22:31:16 +01:00
28bd73a1f7 PNG loading and major refactoring.
PNG loading is not working properly yet.
2014-02-21 21:51:56 +01:00
d0893cba3a Added some structuring.
The game runs but only a black window is shown.
2014-02-21 21:28:34 +01:00
f132916a0f Typo fix and ctor params reordering. 2014-02-20 22:27:42 +01:00
c9a99f7e99 Stop complaining about the unused param. 2014-02-13 00:03:31 +01:00
93634da6fa Stop using the do-nothing Path class.
Instead use the newly imported PhysicsFS through a wrapper.
2014-02-13 00:01:29 +01:00
bcc0937726 New code, WiP.
New Path, Character and other simple classes, but a renderer is missing so now nothing gets displayed anymore.
2014-02-12 00:27:55 +01:00
8b11e76835 Warning fix. 2014-02-11 23:38:29 +01:00
ed4e73f0d9 Fix in Vector conversion.
No need for a conversion overload.
Conversion constructor should cast whatever it's assigning.
2014-02-11 23:38:22 +01:00
abee07a844 Use the new vector class wherever possible. 2014-02-10 01:20:16 +01:00
e2e932358b New operators and stuff in vector class. 2014-02-10 01:19:45 +01:00
bb98651307 New checked_numcast. 2014-02-10 01:18:44 +01:00
07225e3aea Math vector class. 2014-02-09 23:07:57 +01:00
93a7796c5a User can quit manually.
The program doesn't run for a fixed time anymore.
Instead it listens to events and user can quit by closing the window.
2014-02-09 21:15:43 +01:00
fb92097419 Draw and move the texture.
Display the test texture and move it on a line.
The program is unresponsive to events and quits automatically after 15 seconnds.
2014-02-09 01:19:40 +01:00
a8f8d50129 New code and data to get something on screen.
WiP.
2014-02-09 00:32:11 +01:00
2429229a95 Code refactored into different files. 2014-02-08 23:11:26 +01:00
036fec62e5 Taking the width and height from the config file. 2014-02-08 20:25:30 +01:00
ef3a4c1ef6 First commit 2014-01-10 00:04:39 +01:00