Loading ...
Sorry, an error occurred while loading the content.

Re: [cc2-dev-l] SVG

Expand Messages
  • Ross Alexander
    A while back I wrote a small C program converting CC2 files to SVG. I came across a number of problems. 1) The compression code is obscure but I managed to
    Message 1 of 46 , Dec 6, 2004
    • 0 Attachment
      A while back I wrote a small C program converting CC2
      files to SVG. I came across a number of problems.

      1) The compression code is obscure but I managed to
      find enough references to it to write a decoder.

      2) CC2 has the Y-axis going up (like Postscript) but
      SVG has it going down (like raster images). I solved
      this by creating a transform which inverts any Y
      points but keeps the Y-max and Y-mins of the whole
      image the same.

      3) However symbols are not transformed when they are
      processed, since the place symbol command has a
      transform (basically multiply the place symbol
      transform with the svg transform).

      4) Simple multipolygons work okay. I had to glue all
      the component pieces into a single SVG <path/> and
      make sure the odd-even rule has set correctly.

      5) The fill rules don't translate very well, and my
      code is just plain ugly. I never really got it all
      working but I managed to translate most of the fantasy
      symbol sets okay.

      6) SVG files get very big and cumbersome if symbols
      are not put into the <defs> and referenced.


      Cheers,

      Ross





      ___________________________________________________________
      ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
    • amdobritt
      I m willing to be a guinea pig. :) Tutorials on how to make an XP would be good too. Anna M. Dobritt Cartography Unlimited for RPGs
      Message 46 of 46 , Nov 15, 2005
      • 0 Attachment
        I'm willing to be a guinea pig. :)

        Tutorials on how to make an XP would be good too.

        Anna M. Dobritt
        Cartography Unlimited for RPGs
        http://www.rpgcartography.com

        --- In cc2-dev-l@yahoogroups.com, "L. Lee Saunders" <saunderl@h...>
        wrote:
        >
        > Everyone,
        >
        > The Microsoft .Net Framework has been our since 2002. When it was
        first
        > released I tried to integrate it with CC2. Building an unmanaged
        C++ dill
        > (XP) that ran under CC2 was simple but trying to call managed C# or
        VB.Net
        > code from an unmanaged dll was out of the range of most casual
        programmers
        > (Or full time programmers, like myself, that only wanted to do this
        for a
        > hobby and not for work.)
        >
        > But now with the release of the 2.0 version of the Framework, most
        of the
        > interop issues are fixed so it is quite simple.
        >
        > Microsoft is giving away the scaled down version of there IDE at:
        > http://msdn.microsoft.com/vstudio/express/
        >
        > You can download the C#, the VB and the C++ editions! To create a
        CC2 XP
        > dll you will also need to download (for free) the Win32 SDK, but
        that is
        > explained on the C++ express edition page.
        >
        > I've rewritten the random name generator XP that I did as a bridge
        between
        > C++ and VB6, in C#. It works flawlessly. This opens up the ease
        of use C#
        > for things like database access and forms programming. It does not
        get the
        > programmer out of having to learn the CC2 entites database and
        functions
        > though. Maybe a bridge can be created later but not now.
        >
        > So, is there enough interest in writing hybrid C++/C# or VB.Net
        XP's on this
        > list for some tutorials? (I'll also need one or two guinea pigs as
        well)
        >
        > Or, should we, as members of the list, concentrate on writing XP's
        in C++
        > and helping new programmers up the C++ learning curve?
        >
        > L. Lee Saunders
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.