/
logbook.txt
271 lines (230 loc) · 15.7 KB
/
logbook.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
20141016: Worked a bit on GameFrame.hpp, the thing that initializes
subsystems.
20141024: Finished GameFrame.hpp. Tinkered a bit with log.hpp. Settled on
ERROR, DEBUG, WARNING, INFO, TRACE logging calls. Also added a NullBuffer and
Nullstream class, acts like /dev/null. Don't instantiate them, just use the
global nullstream instance. Also added an exit() function to the statemachine,
manually changing to the exit state is a lot of typework.
20141025: Worked on Settings.hpp. Edited logger to use a conditional instead
of a null device. That way the compiler will optimize the debug loggings away.
20141026: Added a function chopLeft(). Haven't worked on it yet. Scratch that,
just finished chopLeft() and chopRight(). They just break a string in two.
Added stringhelpersfuncs toInt, toFloat and toString. And removed them, seems
that they are in the stl since C++11! Seems that Settings.hpp is finished.
Removed the possibility to set settings, since it might (not) preserve markup
of the file. And the getInt, getFloat functions use exceptions! stoi not
supported by 32bit MinGW??? Unbelievable. Fuck this, I'm writing my own str
<-> float,int functions!!!!!!111! Done. And Settings.hpp now also works, after
fixing a dealbreaking bug. I really should do some testing and documentation
soon. Altough documentation doesn't really matter since I don't have any
autocomplete in here. Testing is important though.
20141031: Updated todolist. Updated it some more. Changed a lot of dates to
YYYY-MM-DD. This should be default everywhere. Tried to get
CombineHeadersIntoParent.py to work for all header modules. Tup is still
whining about 64-bit executables. Have to try of cmd.exe can start in 32-bit
mode.
20141106: Made PersistentTexture use a unique_ptr for storing the texture
(since it is the owner and previously it just left a dangling pointer behind).
Next up: refactoring the names of PersistentText and PersistentTexture!
20141106: Refactored PersistentTexture into TextureContainer, and
PersistentText into Text.
20141128: Added a rather useless clone function to TextureContainer.
(assignment operator just copies anyway so it's really useless). Also changed
PointInRect to pointInRect.
20141201: Seems that I forgot that nnb::FontManager::getText() returned a
unique_ptr to a Text instance. Which is weird, a Text instance containing a
unique ptr to a SDL_Texture or something is way more elegant and clear.
Refactoring now. And apparently I had the SDL_Texture in a unique_ptr, PLUS I
deleted it in the destructor. Hurray for painfully defensive coding ;_; So
yeah. nnb::FontManager::getText() now returns a nnb::Text, which is kinda
different because it is not a smart pointer any longer but actually CONTAINS
one. Yes. AND: I fixed a major bug in nnb::Text, variable autoCommit was
initialized with autoCommit instead of autoCommit_. Yup, seriously.
20141206: Added a VAlign property to nnb::Text, and changed Align to HAlign
(along with the enum). Added lots of todo's. Ludum Dare 31!
20141208: Fixed an iterating/erasing bug which was strangely not a problem on
my laptop but was on my desktop. Lel
20141211: Fixed some nnb::Text warnings. Found maybe a bug in sdl2!
20141214: Made sure chopleft/chopRight would return the input if the chopping
point was not found. Added nnb::stol() (string to long). Gave nnb::getFiles a
default suffix argument of "". Also, removed the default suffix argument.
Added it, works now.
20141222: Wanted to work on GameStates but stopped mid-air (GameStateFactory
etc.).
20141228: Finished rewriting nnb::GameStateMachine! Very very abstract state
class is now nnb::State. This is basically for internal use. The class to use
for the client is nnb::GameState. You basically inherit from that class, pass
the current class as template parameter, give the class a constexpr static
auto id = "GameStateIDHere" public member, and pass that to the GameState
constructor. The class self registers with templating magic ( :D ) and you
can start using it by just calling
nnb::GameStateMachine::setState("GameStateIDHere"). It's a bit more typing but
it saves the hassle of having to add it manually. I also added a
SimpleGameState class which is basically a basic event - logic - render loop
without a fps lock. It basically runs as fast as possible and passes the
deltatime to logic. I should also make a fixed timestep one with a event -
logic - render*(times needed to fill 1000/60 ms), but that's something for
later. nnb::SimpleGameState now catches SDL_QUIT events. nnb::State has a
nnb::GameStateMachine* machine field to track his parent. Which can be
accessed by nnb::SimpleGameState with this-> because of templating, lol.
Added a build.bat which also aggregates the header in inbetween headers so you
don't have to include everything explicitly. Now you can just say #include
"nnb.hpp" to include everything, or for example #include "nnb/graphics.hpp" to
include the graphics module. nnb::GameState now infers (by T::id) the state
id, so you don't have to pass it to the constructor. Less typing, yay! Added a
nnb::TextureGroup class, which basically (given a nnb::TextureManager and a
groupname) loads a group upon construction and unloads it upon deconstruction.
Pretty useless but during LD31 I needed a quick hack like that so if I need it
next time it's there. Also started on nnb::Text copy/assignment constructors
(don't forget this!).
20141229: Working right now on those constructors. Aaaaaaand I think they're
finished now. nnb::chopLeft and nnb::chopRight now return 2 dimension
std::string tuples! Hurray c++11. Integrated Catch testing framework, now
everytime you compile a tests.exe is also compiled which can be run to check
for errors. It also caused a bug to be found in nnb::chopRight :p.
20150321: Let's try porting this thing to cmake. Well, that took a few hours.
About 7, I think. Now for some cleanup. Done. Should I commit this? Hmmm.
Ohwait, let's fix testing first. Testing works, and cleaned away all the
tupfiles. Time to commit!
20150322: Added some general functionality (getX, getY, etc.) to
nnb::TextureContainer. Fixed a bug in nnb::TextureContainer that caused alpha
to be shared between nnb::TextureContainers with the same base texture. Added
nnb::readLines() to StringHelpers.hpp. Seriously, MAKE nnb::Text CLONABLE.
20150514: Hahahaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ahahahah uesterday there was a
bellettrie thing hueeeheueeee why IS THIS HAPPENING whahaaaaaa bellettrie test
drum and bass it dshould continue here hahaha Well, I guess it works. Wordwrap
ftw!
20150515: Time to think some about the gamestate stuff. Started with a
harness, no implementation yet.
20150516: Okay, the gamestatemachine got a lot simpler. You just say
GameStateMachine::setNextState(new YourGameState()) and the machine runs your
state when you call update(). The idea is that if you want transitions, you
call the next state function something like this:
GameStateMachine::setNextState(new
RegularTransition(GameStateMachine::getCurrentState(), new NextState())). That
way transitions, loading assets, etc. is all done without the GameStateMachine
knowing about it, which makes it modular and extendable I guess. Way better
than before in any case. The only thing I'm unhappy about is how to exit -
right now the GameStateMachine has a static variable called "exit" which you
could use to signal that the game has to stop - a bit hacky, but it's a nice
default solution. Slowly the realization that I just broke 3 or 4 games by
removing the default game state machine is starting to seep through. Now it
just needs some transition classes and stuff. Time to update the todo list.
Added a RenderStack class, on which you can push/pop render targets. It's a
singleton! Turns out nnb::Text already has copy/assignment constructors! If I
knew that before... Lol. Gave nnb::TextureContainer default copy, assignment,
move constructors.
20150517: Added some license files (for SDL2 (is this one needed?), Catch, and
randutils. There are also random facilities now! Just include
utils/Random.hpp, and use the nnb::rng instance. This is ofcourse just an
instance if randutils::mt_19937 class, defined by the awesome randutils
library. It is thread safe since each thread has it's own instance! Removed
all the special constructors AND the destructor from nnb::TextureContainer.
All the special constructors should be defined by default, and it doesn't need
the destructor anyways.
20150522: Gonna work some more on the gamestate class. Has the time finally
come that I will use std::shared_ptr? Also, the gamestate needs to be
simplified. Why the hierarchy? Also wrote some example usage in the header.
Wow, nnb::GameStateMachine is becoming quite minimal... Allright, this is the
bare minimum I think. CoolGameState still has to be refactored (see
GameState.cpp and GameState.hpp). Finished refactoring. It's much prettier
this way, and still flexible as before but with less of the hierarchy bloat.
GameStateMachine should also be finished. I hope I get to use this soon! I
need to start reading about OpenGL ;_;
20150523: Switching from Eigen to GLM asap, Eigen sucks to use (read it on the
internet and found out myself). Also, OpenGL shit needs to start rolling.
Don't want to keep using the SDL2 render api!
20150525: nnb::getFiles works without extension now, and has a newline in the
error message. If it went right it should also now not output the . and ..
folder thingies.
20150527: Did some thinking about the subsystems. Check out the nnb::Context
idea! Be careful that it doesn't become too much of a monster though. E.g.,
random facilities should probably stay outside of the context.
20150528: It should only take care of stuff that either need to be
initialized/disposed of or are bound to SDL (and thus need a nice quick api).
Worked on nnb::Context. Time to implement all those functions and make some
more variables to keep track of all those init* calls.
20150529: See if I can move over mj3::Image to nnb. Also need to think about
representing colors in nnb. Continue at Color.hpp pls :) Templates ftw lol.
Typedefs! Let's work a bit more. I used an assert - IIRC they can be turned
off at compile time, so I should use them more often. nnb::BasicColor seems
finished. Worked a bit on refactoring nnb::Image. One thing that should be
split off into a function is the checking of an intersection of rectangles.
Also, need to write custom png/jpeg code using libjpg/libpng. Also, turn all
the funky (unique_)ptr business into references and value returns.
20150530: Maybe use nnb's intrect/floatrect for nnb::Image? Added an
NNB_UNPACK macro for unpacking tuples (up to eight elements). Worked on the
intersection rectangle stuff.
20150531: Finished the NNB_UNPACK macro. Worked a bit on the intersect thing.
Maybe next time implement some unit tests, and continue from there? It kind of
fits this rectangle thing.
20150601: Gonna work for a bit on the intersect code. Definitely not looking
forward to honours homework... :s. Maybe finished the intersect method and
thus the nnb::BasicRect class as a whole. Even added unit tests! Now I just
need to finish the nnb::Image class and get compiling working again. Hah! Now
nnb::Color is next (6). It seems to compile! IT HAS BEEN COMPILED!! And it
even passess all tests. Unbelievable. Maybe I should add some edge cases for
no intersections. Oh my god, I think I found a bug lol. Nope, I used
CHECK_FALSE instead of CHECK. Silly me :p. Did implement a toString method as
a side effect :D. Should do that more. Rects working, now for a quick update
of Catch.hpp... And now the tuples looks nice too :) Wicked! Now quickly
commit and push and then, BED! Bye bye.
20150603: Added toString/operator<< for nnb::Color. Also removed debug output
from unit tests.
20150608: Gonna work some on the image intersect stuff. Decided that I
implement some wrap policies. Will make copying/pasting a bit more resource
intensive but all the intersecting is just inflexible and difficult to
implement/maintain. It only has to be implemented in getpixel though.
Implemented the border one, the other ones will come later!
20150609: Implementing all the paste/copy functions without the intersecting
stuff. Everything is now getted according to the wrap policy, and out of
bounds setPixel calls will just be skipped. If you're doing it wrong we don't
mind but if you want performance your code should be correct :p Finished
implementing setColor/getColor, and copy/paste functionality. Now, maybe for
some image loading code? Worked on loadPng function. Broke at something called
the incomplete type :p
20150610: Fixed the incomplete type thing. Also typed up an initial
implementation of a png loader and a basic test framework.
20150611: Time to debug that png thingy! Working on nnb::exist now as well, it
seems to be a bit buggy. Will have to write unit tests for that thing
sometime. Wow, wrote a png reader/writer and a jpeg reader. Maybe tonight even
a jpeg writer? Unit tests as well, pretty sweet. Jup, jpeg writer as well :)
They'll probably break in due time but then I'll be smarter, wiser, and I'll
have plenty of unit tests to quickly find the error. Also fixed the unique_ptr
business in nnb::Image. Now they're all properly std::move'ing and stack based
objects. Allocating them on the heap is a bit tedious now (lots of typing),
but if that ever seems the case I'll add a few helper functions. Wow, actually
completed 4 minor points on the to-do list today. Ka-ching! Maybe it's time to
commit again :P Wrote a little specification for nnb::CursorManager (which
uses nnb::Image! Yay :D)
20150612: Made a skeleton for nnb::CursorManager, and already implemented
system cursors. Turns out SDL2 does have facilities for colored cursors, only
it wasn't documented that well. So we'll have monochrome and colored cursors!
:D PINKPOP!
20150613: Let's finish that cursormanager! And it looks like it's finished
now. I'm curious about if it'll even work, lol. Added SDL_Surface conversion
to nnb::Image, curious if it even works xD Removed an old color enumeration in
favour of the new nnb::Colour (it was leftover somewhere in SDL_Helpers.hpp).
nnb::Colour should now also have a few constant color instances, red, green,
etc. Also moved the imageToSDL_Surface function to SDL_Helpers.cpp, to keep
the nnb::Image nicely decoupled from SDL. Now it only depends in
libjpeg/libpng and the stl, yay.
20150713: Worked a bit on Directory.cpp and fleshed out the header of
nnb::SoundManager. Also moved the default build mode to unix (ubuntu?).
Should figure out a way to make cmake detect automatically what it should
build for. Also, all tests pass again!
20150714: Just added primitive support for cross platform-ness. Should test
this as soon as I get a compiler on windows 8 available. Also added a recursive
file discovery function, and a test for it. Gotta add some more tests for
those directory functions :S Also added a platform-dependant DIRSEP global
constant, depends on some variables set in cmake.
20150718: It seems that SoundManager is finished. Have done no debugging though.
Should do that soon. Also added two extra overloads to SDLDeleter, namely Mix_Chunk
and Mix_Music. I'm gonna try building SoundManager now. Wow, lots of errors.
This will take a while. Woah, all those errors pretty much proved I'm dead tired
AND still a shitty programmer :p I'll have to review that code tomorrow or smth.
And unit tests, altough I have no idea how that is gonna work.
20150719: Turns out I was able to get SoundManager to work with minimal changes.
I'm quite pleased with that :-) Don't have time/energy to thourougly test it
so time will have to tell once I actually start using the thing. Worked a
very small bit on nnb::Context. Too damn tired man.