Commit Graph

19 Commits

Author SHA1 Message Date
Bryan Schumaker 8f7a610d6d libsaria: Remove DataState optimization
It made sense at the time, but I'm not convinced the added complexity is
actually worth it.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker b7a21789b6 libsaria: Pass around more const strings
This allows me to pass them by reference, it should be a bit more
efficient.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker 258875bdb8 libsaria: Move header files out of include/libsaria/
Ocarina no longer has a header file subdirectory so there is no reason
to have a libsaria subdirectory anymore.  Putting header files directly
in the include/ directory is a bit simpler.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-12 08:15:31 -04:00
Bryan Schumaker a9d875e05e libsaria: Better prefs::init() function
The preference may be set to zero by the user but default to a non-zero
value.  This can cause frustration on both the user and developer ends.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-09 13:42:05 -04:00
Bryan Schumaker d0a1b9fdf8 libsaria: Save library
- Change WriteTask() to take an extra void pointer argument
- Pass library path pointer through WriteTask
- Store tracks to file named after library id.
- Remove newline from tags

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:17 -04:00
Bryan Schumaker e1b410845d ocarina: Set child propertys for GtkNotebook
The set_tab_packing() function is deprecated, so I might as well just
use the real way to do this...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:15 -04:00
Bryan Schumaker 292d237561 libsaria: Idle queue cleanups
To make the code easier to follow and maintain.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:15 -04:00
Bryan Schumaker 84582ae9d8 libsaria: load preferences from disk during startup
This is one of the first things that happens when initializing libsaria.
This also allows me to remove the remaining commented out code from the
preferences file.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:15 -04:00
Bryan Schumaker 06412afeed libsaria: Save preferences in idle task after they change
I made a WriteTask class to use for saving files.  This allows me to
create a file in the appdir and write out the new preferences if they've
changed.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:14 -04:00
Bryan Schumaker a0da654fc6 ocarina: Resize window to match preference
I initialize the window size preferences to (800, 600) and then resize
the window to match.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:14 -04:00
Bryan Schumaker 1933689d4f Added copyright lines to everything
I probably should have done this earlier... oh well

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-02-19 17:17:24 -05:00
Bryan Schumaker da118b2281 libsaria: Switch to the new OutFile() class
The new class is more convenient to work with since it's the output
stream with my save protocol built in.  I should have done this earlier!
2011-12-25 22:34:12 -05:00
Bryan Schumaker 5877d3ac4a libsaria: Created a new OutFile() class
Similar to how I created a new InFile() class.  The new one can be used
directly as a stream, only it has my save file protocol stuff built in.
2011-12-25 22:21:11 -05:00
Bryan Schumaker 6794ce15e5 libsaria: Return ifstream reference from operator>>
This allows me to chain calls to the same stream, cleaning up the code.
2011-12-25 22:20:04 -05:00
Bryan Schumaker d39536d7d0 libsaria: Completely replace old InFile() class
My InFile2() class is clearer and simpler, so I've replaced InFile()
with it.
2011-12-25 21:24:02 -05:00
Bryan Schumaker 5e308202a0 libsaria: Create a new way to save files
I inherit from the ifstream class, so I can override the insertion
operator for string handling.  I can then use templates to save
everything else.
2011-12-25 21:16:09 -05:00
Bryan Schumaker f7d7d5e038 libsaria: Add floats as preferenc type
Now I can store floating point numbers in addition to booleans.
2011-12-23 22:03:31 -05:00
Bryan Schumaker 958020f270 libsaria: Check stream status before reading
If we are unable to open the preferences file we shouldn't try to read
from it.  This led to a segmentation fault when compiled in release
mode, but for some reason it worked when compiled in debug mode?
2011-11-09 17:28:19 -05:00
Bryan Schumaker b6f21d5705 libsaria: Added preferences
Right now I only store boolean values, but I think I've coded this in a
way to make adding new values easy.
2011-11-07 08:30:53 -05:00