[3.4-dev] Cannot compile with BC5

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PowerWyrm
    Prophet
    • Apr 2008
    • 2987

    [3.4-dev] Cannot compile with BC5

    Got this error in main-win.c: unknown symbol AC_SRC_NO_PREMULT_ALPHA.
    Looking at wingdi.h, both AC_SRC_ALPHA and AC_SRC_OVER symbols are defined, but not AC_SRC_NO_PREMULT_ALPHA.

    Any idea what to do? Define AC_SRC_NO_PREMULT_ALPHA manually? With which value? Use AC_SRC_ALPHA instead?
    PWMAngband variant maintainer - check https://github.com/draconisPW/PWMAngband (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!
  • APWhite
    Adept
    • Jul 2007
    • 244

    #2
    Originally posted by PowerWyrm
    Got this error in main-win.c: unknown symbol AC_SRC_NO_PREMULT_ALPHA.
    Looking at wingdi.h, both AC_SRC_ALPHA and AC_SRC_OVER symbols are defined, but not AC_SRC_NO_PREMULT_ALPHA.

    Any idea what to do? Define AC_SRC_NO_PREMULT_ALPHA manually? With which value? Use AC_SRC_ALPHA instead?
    I've been waiting for this one too. This is one of the stop-points for me and the 3.4 borg.
    St George Chiropractor
    Angband Borg Homepage

    Comment

    • Blue Baron
      Adept
      • Apr 2011
      • 103

      #3
      Originally posted by PowerWyrm
      Got this error in main-win.c: unknown symbol AC_SRC_NO_PREMULT_ALPHA.
      Looking at wingdi.h, both AC_SRC_ALPHA and AC_SRC_OVER symbols are defined, but not AC_SRC_NO_PREMULT_ALPHA.

      Any idea what to do? Define AC_SRC_NO_PREMULT_ALPHA manually? With which value? Use AC_SRC_ALPHA instead?
      AC_SRC_NO_PREMULT_ALPHA should have been defined in wingdi.h. If it wasn't, it has the value 0x01. If it wasn't, you might want to add a compatibility define:

      #ifndef AC_SRC_NO_PREMULT_ALPHA
      #define AC_SRC_NO_PREMULT_ALPHA 0x01
      #endif

      Comment

      • PowerWyrm
        Prophet
        • Apr 2008
        • 2987

        #4
        The only value that's defines in all versions is AC_SRC_ALPHA. Use that instead of AC_SRC_NO_PREMULT_ALPHA which is not portable.
        PWMAngband variant maintainer - check https://github.com/draconisPW/PWMAngband (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!

        Comment

        • Blue Baron
          Adept
          • Apr 2011
          • 103

          #5
          Originally posted by PowerWyrm
          The only value that's defines in all versions is AC_SRC_ALPHA. Use that instead of AC_SRC_NO_PREMULT_ALPHA which is not portable.
          Actually, only AC_SRC_ALPHA is used in the code, so I don't know how AC_SRC_NO_PREMULT_ALPHA is being used. (I just did a search for "AC_SRC_" in both 3.4.1 and the current dev version.)

          However, I think that AC_SRC_NO_PREMULT_ALPHA is being used internally somewhere, because when I did a google search for AC_SRC_NO_PREMULT_ALPHA the first entry is an old irc dev log from Sept 19, 2011, where Magnate had the same problem. I replied:"Hi magnate: รข€˜AC_SRC_NO_PREMULT_ALPHA' should be defined in wingdi.h, but that should already be included, since the standard drawing function already uses it. It is in wingdi.h, both in visual studio and mingw."

          I can't find anything now to support that "since the standard drawing function already uses it" but I'm sure I did back then.

          Later on in the log, d_m writes: "that was one of the mingw bugs before... we needed to define WINVER (or something like it) at a higher level." This could be the problem, I recall that I needed a WINVER of 0x0400, magnate needed a WINVER of 0x0410, and someone else needed 0x0500, though that might have been for the alpha blend function. Perhaps your wingdi.h needs a higher WINVER to define it?

          If it is not in your wingdi.h, I guess try adding the compatibility define just below "#include <wingdi.h>"?

          hmm I went back through old angband directories and AC_SRC_NO_PREMULT_ALPHA was being used in main-win.c in that period. However, it was changed to AC_SRC_ALPHA sometime between Dec 2011 and Jan 2012. So if you have the line:
          "blendfn.AlphaFormat = AC_SRC_NO_PREMULT_ALPHA;//AC_SRC_ALPHA;"
          in your main-win.c, then it should be:
          "blendfn.AlphaFormat = AC_SRC_ALPHA;"

          Whew. Lots of options here, which seems closest to the problem?

          Comment

          • PowerWyrm
            Prophet
            • Apr 2008
            • 2987

            #6
            My code has: blendfn.AlphaFormat = AC_SRC_ALPHA. I guess I changed it at the same time as it was changed.
            PWMAngband variant maintainer - check https://github.com/draconisPW/PWMAngband (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!

            Comment

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