Windows PNG support in staging

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • d_m
    Angband Devteam member
    • Aug 2008
    • 1517

    Windows PNG support in staging

    Hi everybody,

    Thanks to Blue Baron's work, PNG support has been added to the staging repo. I hope to get it into master (and into a nighly build) in the next few days. This will allow tile authors to just use PNGs, and not have to mess with mask files for bitmaps.

    This is still something of a work in progress, and while I expect that the nightly builds should be playable, my changes may cause problems for people who are building Angband from source for Windows. If you do this (or are interested) keep reading for a more in-depth explanation of what's going on.

    Since most devs (and the autobuilder) build with Mingw, we need to have a solution which works with Mingw. Unfortunately, I wasn't able to find a version of the DirectX headers/libraries that Mingw could use. So I went with libpng (which depends on zlib) which are both GPL-2 compatible. But since building/crossbuilding them for Windows is hard, I took the easy way out and copied in headers, libraries and DLLs, which I found prebuilt on the gnuwin32 site.

    I wasn't able to get Angband to statically link against the libraries, which is why I have to include (and ship) the DLLs. I realize this is a bit junky but it seems to work.

    I would *love* to get libpng/zlib building (and crossbuilding) from source, or at least, linking against the libraries statically. But I lack the knowledge about Windows development to get that working at the moment, and I know that MSVC++ uses a completely different build infrastructure.

    TL;DR -- It's junky, but I think it works. Feedback and patches happily accepted!
    linux->xterm->screen->pmacs
  • konijn_
    Hellband maintainer
    • Jul 2007
    • 367

    #2
    I am trying to be positive here, but did you just say that now the only way to develop on Windows is mingw ? Which, by the way does not have a decent debugger ( gdb is not a decent debugger ).

    Still, png for the win, but ouch for poor windows folks like me.

    T.
    * Are you ready for something else ? Hellband 0.8.8 is out! *

    Comment

    • Magnate
      Angband Devteam member
      • May 2007
      • 5110

      #3
      Originally posted by konijn_
      gdb is not a decent debugger
      Flames off, please. Quite a lot of people find gdb an excellent debugger. I don't develop on Windows though - perhaps it is somehow gimped on that OS.

      As d_m said in another thread, we have only one Windows developer on the team, and he uses mingw. To improve support for Windows development, we need more Windows developers to contribute.
      "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

      Comment

      • Blue Baron
        Adept
        • Apr 2011
        • 103

        #4
        Would you like makefiles exported from MSVC++ 6.0? would the information in there help with statically compiling libpng/zlib?

        Also wikepedia and the mingw website imply mingw can use .lib libraries in addition to .a libraries. If so, you are welcome to the static libraries that I built for myself from libpng 1.5.2 (and zlib 1.2.4).

        Comment

        • konijn_
          Hellband maintainer
          • Jul 2007
          • 367

          #5
          Originally posted by Blue Baron
          Would you like makefiles exported from MSVC++ 6.0? would the information in there help with statically compiling libpng/zlib?

          Also wikepedia and the mingw website imply mingw can use .lib libraries in addition to .a libraries. If so, you are welcome to the static libraries that I built for myself from libpng 1.5.2 (and zlib 1.2.4).
          Thanks. In fact I only got to download MSVC++ 2010..
          And I think I have this guy's issue :
          I am converting my project from vc6 to VS 2010.When I compile my project i get error as below for may .lib inputs. I have added all these lib in the Linker-> Input-> Additional Dependencies, also


          I have no idea on how to fix that ;\

          T.
          * Are you ready for something else ? Hellband 0.8.8 is out! *

          Comment

          • Blue Baron
            Adept
            • Apr 2011
            • 103

            #6
            Originally posted by konijn_
            Thanks. In fact I only got to download MSVC++ 2010..
            And I think I have this guy's issue :
            I am converting my project from vc6 to VS 2010.When I compile my project i get error as below for may .lib inputs. I have added all these lib in the Linker-> Input-> Additional Dependencies, also


            I have no idea on how to fix that ;\

            T.
            so you are getting unresolved external symbol errors? with what library or file?

            Comment

            • d_m
              Angband Devteam member
              • Aug 2008
              • 1517

              #7
              Originally posted by Blue Baron
              Would you like makefiles exported from MSVC++ 6.0? would the information in there help with statically compiling libpng/zlib?

              Also wikepedia and the mingw website imply mingw can use .lib libraries in addition to .a libraries. If so, you are welcome to the static libraries that I built for myself from libpng 1.5.2 (and zlib 1.2.4).
              I wasn't able to get Mingw to build against the .lib files--I would prefer to use those if Mingw and MSVC++ can both use them. Do you have links and/or instructions? I tried to get the .lib files found via CFLAGS/LDFLAGS without much luck, but I will try again. The current DLL situation isn't ideal.

              Please email me about the static libraries: d_m * plastic-idolatry * com

              Any help you can give me would be greatly appreciated!

              @konijn -- I'm just muddling through here. Any patches or simple instructions which will keep Cygwin and/or MSVC++ supported are welcome.
              linux->xterm->screen->pmacs

              Comment

              • Blue Baron
                Adept
                • Apr 2011
                • 103

                #8
                Originally posted by d_m
                I wasn't able to get Mingw to build against the .lib files--I would prefer to use those if Mingw and MSVC++ can both use them. Do you have links and/or instructions? I tried to get the .lib files found via CFLAGS/LDFLAGS without much luck, but I will try again. The current DLL situation isn't ideal.
                I read it at in the FAQ on the mingw website at http://mingw.org/wiki/Specify_the_li..._linker_to_use

                Comment

                • konijn_
                  Hellband maintainer
                  • Jul 2007
                  • 367

                  #9
                  [QUOTE=d_m;53468
                  @konijn -- I'm just muddling through here. Any patches or simple instructions which will keep Cygwin and/or MSVC++ supported are welcome.[/QUOTE]

                  Well, at least you know how to muddle, I have no idea about Windows/Cygwin development. I know how to change logic and type make -Fmakefile.win :\

                  Dont worry about it, I will code on my Mac and that's the end of it.

                  T.
                  * Are you ready for something else ? Hellband 0.8.8 is out! *

                  Comment

                  • d_m
                    Angband Devteam member
                    • Aug 2008
                    • 1517

                    #10
                    Originally posted by konijn_
                    Well, at least you know how to muddle, I have no idea about Windows/Cygwin development. I know how to change logic and type make -Fmakefile.win :\

                    Dont worry about it, I will code on my Mac and that's the end of it.

                    T.
                    So, I have updated staging to use .lib files instead of .a files. Blue Baron pointed out that they do work with Mingw (although you have to say -llibpng instead of -lpng like with .a files).

                    I hope this makes it possible to develop with MSVC++ (and maybe Cygwin) again? Feedback appreciated.
                    linux->xterm->screen->pmacs

                    Comment

                    Working...
                    😀
                    😂
                    🥰
                    😘
                    🤢
                    😎
                    😞
                    😡
                    👍
                    👎