On Fri, Apr 22, 2011 at 11:53:51AM +0200, Johanna Ploog wrote: > On 22 April 2011 08:16, Jeff Johnson <jeffjohns...@gmail.com> wrote: > > 1) Type in all the values by hand. Not good because they will always be > > out of sync. > > 2) Write a parser to read enum.h and output Javascript. Possible, maybe > > fragile and has some dependencies on keeping enum.h around. > > 3) Wrap all enum.h enums in a macro so it can be optionally compiled to > > emit Javascript. Nice, but makes enum.h look a bit messy. > > To me, option 2 sounds like the most sensible one. It might be > worthwhile to split enum.h into two files beforehand: One for enums > that actually are required for the tiles client (including abilities > as those are going to get tiles at some point in the future) and the > other for the rest (e.g. activity_interrupt_type, attribute_type, ...) > That will require modifications to all files that include enum.h, so > pretty much all of them, but the splitting of large files is generally > welcome, so such a change is likely to be merged into the main code > even independently of the rest of your modifications.
enum.h: #include "tile-enums-for-the-client.h" > Also, the tilepick mappings differ wildly in complexity. A lot of > tiles simply use enum-to-tile mappings, but some of them use special > checks to decide on the actual tile to be used (depending on the > current branch, for example, on some monster properties etc). The > latter might be too complicated for the client (maybe that's what you > mean by "dumbing down"), but some of the checks could probably be > simplified. Conversely, it might be possible to split the simple > mappings into a text file which is parsed to generate both a cc file > and a javascript one. (Similarly to how art-data.txt is parsed.) Having two code paths would be harder to code and maintain than just one. For the time being, passing the tile data as a stack of texture fragments would be easier. Heck, it might even stay in the final code, it's not that costly to pass both. > Good luck with your project! > > Johanna <- *waves into the round* Still alive, see? :) Yay! -- 1KB // Microsoft corollary to Hanlon's razor: // Never attribute to stupidity what can be // adequately explained by malice. ------------------------------------------------------------------------------ Fulfilling the Lean Software Promise Lean software platforms are now widely adopted and the benefits have been demonstrated beyond question. Learn why your peers are replacing JEE containers with lightweight application servers - and what you can gain from the move. http://p.sf.net/sfu/vmware-sfemails _______________________________________________ Crawl-ref-discuss mailing list Crawl-ref-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/crawl-ref-discuss