Minor glitch with item selection

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

    Minor glitch with item selection

    When you use a tileset with tile height greater than 1 (32x32 tileset for example), the portion containing item selection choices is not "rectangular".

    The problem comes from this code in Term_erase():

    Code:
            /* Fast access */
            scr_aa = Term->scr->a[y];
            scr_cc = Term->scr->c[y];
    
            scr_taa = Term->scr->ta[y];
            scr_tcc = Term->scr->tc[y];
    
            if ((n > 0) && (scr_aa[x] == 255))
            {
                x--;
                n++;
            }
    Removing the "if" block fixes the problem (and I don't really see the purpose of that "if" block -- but I could be wrong).
    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!
  • PowerWyrm
    Prophet
    • Apr 2008
    • 2986

    #2
    Browsing spells using 32x32 tileset in "nice graphics" mode (6x3 tiles) produces the same effect, in a worse way (description is not properly updated when moving the cursor). See attached screenshot.
    Attached Files
    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

    • PowerWyrm
      Prophet
      • Apr 2008
      • 2986

      #3
      There are two problems here:

      1) The irregular display of the left border is due to the code in Term_erase() which only works if tile width is 2 (the code has not been changed since bigtile mode -- double tile width -- was removed in favor of variable tile width/height.

      This is fixed by adapting the code above to start on the x axis at the beginning of a tile:

      Code:
              /* Hack -- Always start at the beginning of a tile in bigtile mode */
              if ((n > 0) && (scr_aa[x] == 255))
              {
                  int x0 = ((x - COL_MAP) / tile_width) * tile_width + COL_MAP;
      
                  x = x0;
                  n = n + x - x0;
              }
      2) The problem with spell description not properly updated when switching to another spell is the same, but this time on the y axis. I tried to fix it in the same function, but gave up after failing miserably (seems *really* tricky to fix). A proposed workaround is to fix the problem directly in the spell menu browser (spell_menu_browser method) by putting more empty lines under spell descriptions until the end of a tile is reached:

      Code:
          /* XXX */
          text_out_pad = 0;
          text_out_indent = 0;
      
          Term_locate(&x, &y);
      
          /* Hack -- Always finish at the end of a tile in bigtile mode */
          if (tile_height > 1)
          {
              int ymax = ((y - ROW_MAP) / tile_height) * tile_height + ROW_MAP + tile_height - 1;
      
              while (++y <= ymax) Term_erase(x - 1, y, 255);
          }
      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...
      😀
      😂
      🥰
      😘
      🤢
      😎
      😞
      😡
      👍
      👎