So now I have a simple perl script that can parse a data file like
art-data.txt and produce an enum.h and enum.js file.
Upon review, I see there is something else in enum.h that I missed,
#ifdef's.
For example there is this:
#if TAG_MAJOR_VERSION == 32
OBJ_UNKNOWN_I, // (use unknown) labeled as books in invent.cc {dlb}
#endif
Is this significant functionality that must be preserved? If so, I'll try
to add something to the perl script, but it will be a pain because
Javascript doesn't have a pre-processor. What is the purpose of this #if?
--Jeff
On Sat, Apr 23, 2011 at 5:05 AM, <
crawl-ref-discuss-requ...@lists.sourceforge.net> wrote:
> Send Crawl-ref-discuss mailing list submissions to
> crawl-ref-discuss@lists.sourceforge.net
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.sourceforge.net/lists/listinfo/crawl-ref-discuss
> or, via email, send a message with subject or body 'help' to
> crawl-ref-discuss-requ...@lists.sourceforge.net
>
> You can reach the person managing the list at
> crawl-ref-discuss-ow...@lists.sourceforge.net
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Crawl-ref-discuss digest..."
>
> Today's Topics:
>
> 1. Re: Online Tiles - Data Format (Adam Borowski)
>
>
> ---------- Forwarded message ----------
> From: Adam Borowski <kilob...@angband.pl>
> To: crawl-ref-discuss@lists.sourceforge.net
> Date: Fri, 22 Apr 2011 18:27:14 +0200
> Subject: Re: [Crawl-ref-discuss] Online Tiles - Data Format
> 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
>
>
------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network
management toolset available today. Delivers lowest initial
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Crawl-ref-discuss mailing list
Crawl-ref-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/crawl-ref-discuss