From: Johnathan G. <da...@us...> - 2002-10-19 15:27:52
|
daren 2002/10/19 08:27:51 PDT Modified files: src GameState.cpp GameState.h InputBinder.cpp InputBinder.h SConscript Added files: src InputParser.cpp InputParser.h InputSymbol.cpp InputSymbol.h btn.cfg Log: We now have an InputSymbol Library that handles SDLKeys and converts them into InputKeys. If the function that does this looks surprisingly similar to Chad Austin's gluttophuikey function, don't be alarmed (thanks Chad). We also have an InputParser that parses a cfg file for action to key bindings. The parser will then take action pointers and their names and bind them to keys read from the cfg file. The format for the cfg file is KEY=ACTION where KEY is a string handled in the function InputSymbol::StringtoISym and ACTION is a string you have chosen to identify that action as. For an example, look at GameState.cpp Finally, I commented out some of the ai stuff to fix the build. I have the latest and greatest version of loom, and the code still wouldn't compile :( Revision Changes Path 1.62 +63 -43 midworld/src/GameState.cpp 1.41 +13 -14 midworld/src/GameState.h 1.2 +3 -3 midworld/src/InputBinder.cpp 1.2 +5 -3 midworld/src/InputBinder.h 1.1 +80 -0 midworld/src/InputParser.cpp (new) 1.1 +68 -0 midworld/src/InputParser.h (new) 1.1 +471 -0 midworld/src/InputSymbol.cpp (new) 1.1 +125 -0 midworld/src/InputSymbol.h (new) 1.46 +2 -0 midworld/src/SConscript 1.1 +16 -0 midworld/src/btn.cfg (new) http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/isugamedev/midworld/src/GameState.cpp.diff?r1=1.61&r2=1.62&diff_format=h http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/isugamedev/midworld/src/GameState.h.diff?r1=1.40&r2=1.41&diff_format=h http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/isugamedev/midworld/src/InputBinder.cpp.diff?r1=1.1&r2=1.2&diff_format=h http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/isugamedev/midworld/src/InputBinder.h.diff?r1=1.1&r2=1.2&diff_format=h http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/isugamedev/midworld/src/InputParser.cpp?rev=1.1&content-type=text/plain http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/isugamedev/midworld/src/InputParser.h?rev=1.1&content-type=text/plain http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/isugamedev/midworld/src/InputSymbol.cpp?rev=1.1&content-type=text/plain http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/isugamedev/midworld/src/InputSymbol.h?rev=1.1&content-type=text/plain http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/isugamedev/midworld/src/SConscript.diff?r1=1.45&r2=1.46&diff_format=h http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/isugamedev/midworld/src/btn.cfg?rev=1.1&content-type=text/plain |