Tuesday, January 9, 2018

Filesystem Abstraction

It's cold up here...
So there is a new weather satellite that was recently launched by NOAA that is beyond anything we currently have up there. This one is in geosynchronous orbit and has a high-resolution infrared camera so you can see weather patterns at night. During few days of cold I took a look at it and realized why it was dipping down past freezing for the last week or so. I wish Canada would find a better way of invading us.

Bright and early I was back into the code. Now that I have a good idea of what is what. I'm not as terrified to move things around and change up the program outside of Nermal. I have a few major goals this time around. The first I want to reduce the number of dependencies. First I'm abstracting the filesystem through Allegro and making it as generic as possible. The back-end, which currently points to my hard drive can be swapped out for any other kind of file system. This will make porting the game to Android/iOS a lot easier as the filesystems in those environments are abstracted and sandboxed anyway. In the meantime Not only do I find myself able to get rid of old DOS/Windows functions, but some POSIX ones as well.

I'm also getting rid of the insecure string functions and replacing them with their secure _s counterparts. The difference between srtcpy() and strcpy_s() is that the secure ones requires me tell it how big of a string buffer is I'm using. This is to stop buffer overruns from happening. The good news is all the strings I'm running into so far are not dynamically created so I can just pass the new functions the length of the buffers directly.

The audio functions are proving to be a bit more complicated than I thought. I also had to re-render the opening theme to Ogg Vorbis. Looks like mp3 support was not implemented due to patents. It's only very recently that those have expired. Doesn't really matter, they all sound the same.

I'm hoping tomorrow I'll have the opening done in 1280x800 with audio as a proof of concept. That should motivate me to start updating all the graphical assets and fix the 1Ch thread once an for all.

(I made an edit to this blog after the fact. My secure code looked awful!)

No comments:

Post a Comment