Another thing I'll mention is that char isn't portable anymore. C# and Java have 16-bit chars.
The 8-bit value in both languages is called "byte". For small numeric values it thus might be better to replace char with byte and use a typedef.
My plan is to replace just about every single usage of char, short, and byte with int. If it is meant to represent a character, it will use a Character. If it is meant to represent a number, it will use an Integer. The way LCS interchanges char and short is a nightmare of ambiguity. There was a safehouse bug that used ">= char" that broke when converted to a short or an int, because certain characters have a negative value when interpreted as a short. Any number with an absolute value smaller than 1 Billion can be represented with a 32 bit integer, and it is unnecessary to use a special data type just because its value allows for more compact storage. Modern compilers are optimized for usage of 32 bit integers and 64 bit floating points. That brief moment of confusion a programmer feels when trying to remember if a function returns its value as a char, byte, short, or int is too high a price for the possible benefits of using an 8 or 16 bit value. The only reason we even have shorts and bytes as standard datatypes are because C++ was first used 33 years ago, because back then it made a difference. 95% of the filesize for LCS is located in its music files. We don't need to use shorts, bytes, or chars. And as long as I have a say, we won't.
o.o;
Sorry, got a little carried away there.
Another thing is that we could use is to wrap all the curses calls up in our own class so that we don't have to have those crappy calls everywhere. A custom interface would be a lot cleaner.
That's what that header file I kept going on about was.
Nowhere in the LCS source code, except cursesAlternative.cpp, is usage of the curses library.
Heck, most instances of
move(x,y);
addstr(...);
have been replaced with
mvaddstr(x,y, ...);
Just to avoid having to implement move(x,y);
If move(x,y) and addstr(...) can be replaced with mvaddstr(...) entirely, it will make mvaddstr(...) easier to implement, as it will no longer need to store current position. It's one of the reasons I've been replacing char* with string.
PTWing, although will also say that I have the (apparently disappeared from Play) LCS install on an older tablet, which I might be able to get the..pkg of out of if I specifically do a bit of digging up of the necessary old hardware, then digging into its file system.
Seems like you're already doing it properly, though.
The current code is so far different from what's in the pkg though and we'd need the source code anyway. But sure if some people want to play around with that version then it's cool that someone kept it, you could put it on mediafire or something.
http://www.mediafire.com/file/7zykkvii3cd19su/lcsagame%20Android.zipIncludes source.