Silly minor problem with extra-large window

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bron
    Knight
    • May 2008
    • 515

    Silly minor problem with extra-large window

    Since my utf-8 problem seems to have been overcome, I wanted to try out my snazzy new ultra-huge monitor. So I open a max-sized window, run "./angband -- -b" and ... it fails. Complains that the "main window is too small" ?!?! It didn't take me long to figure out that the problem is that Term->wid (and also Term->hgt) are stored as *bytes*, which meant that my huge window (with >256 columns) wrapped the available range.

    Once I understood this, it was easy enough to create a window with "only" 254 columns, and everything works great. I think it would be nice if "hgt" and "wid" could be made shorts rather than bytes, but perhaps an easier change/fix would be to just limit the value to 255 (e.g. use something like:
    Term->wid = min(COLS,255);
    when assigning a value to "wid").
  • Derakon
    Prophet
    • Dec 2009
    • 9022

    #2
    ...we're actually using bytes for anything other than ASCII chars? That's really rather sad.

    Comment

    • Magnate
      Angband Devteam member
      • May 2007
      • 5110

      #3
      Originally posted by Derakon
      ...we're actually using bytes for anything other than ASCII chars? That's really rather sad.
      Er ... don't forget that when Angband was written the average RAM on a PC was about 1MB. Every byte counted - so yes, we have all of byte, s16b and u16b to save memory over using 4-byte integers ...
      "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

      Comment

      • Derakon
        Prophet
        • Dec 2009
        • 9022

        #4
        Okay, let me rephrase.

        We're still using bytes for anything other than ASCII chars? That's really rather sad.

        Comment

        • buzzkill
          Prophet
          • May 2008
          • 2939

          #5
          Originally posted by bron
          Complains that the "main window is too small" ?!?! It didn't take me long to figure out that the problem is that Term->wid (and also Term->hgt) are stored as *bytes*, which meant that my huge window (with >256 columns) wrapped the available range.
          I get this error with tiles too, before I learned to avoid it. If I maximize the screen during character creation, it would crash upon arrival in town, or just before that happened, or at least I used to. I don't recall the circumstances exactly but it's probably worth fixing (in variants too, you crazy variant maintainers).
          www.mediafire.com/buzzkill - Get your 32x32 tiles here. UT32 now compatible Ironband and Quickband 9/6/2012.
          My banding life on Buzzkill's ladder.

          Comment

          • PowerWyrm
            Prophet
            • Apr 2008
            • 2987

            #6
            For my variant I've limited row/col size to 255. I've tried to change them to short ints, but this would have meant rewriting half of the code, since those bytes are spreading all over the place in the code
            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...
            😀
            😂
            🥰
            😘
            🤢
            😎
            😞
            😡
            👍
            👎