|
|
Thread Tools | Display Modes |
![]() |
#1 |
Rookie
Join Date: Sep 2012
Posts: 8
![]() |
Sil 1.2.1 bug - viewport shakes when moving with "center map continuously" option
When the "center map continuously" option is enabled and the player moves, the map will constantly shift its view of the dungeon which is extremely distracting. I think this was reported before, but nobody could work out what was causing it... until now.
The culprit is in verify_panel() in xtra2.c, which adjusts the coords of the visible part of the map based on the player's position. It has a couple of blocks that look like this: Code:
/* Scroll screen vertically when off-center */ if (center_player && (!p_ptr->running || !run_avoid_center) && (py != wy + SCREEN_HGT / 2)) { wy = py - SCREEN_HGT / 2; } // Sil-y: make this an option //by default it is 2 for vertical and 4 for hor //needs to be programmed better //this doesn't do quite what it says on bigscreen //it can end up assymmetric up/down or l/r due to panels /* Scroll screen vertically when 2 grids from top/bottom edge */ else if ((py < wy + 13) || (py >= wy + SCREEN_HGT - 13)) { wy = ((py - PANEL_HGT / 2) / PANEL_HGT) * PANEL_HGT; } With the option on, the first block of the 'if-else' runs... sometimes. The bug is that the 'if' condition is badly written: it falls through to the 'else' when the player is centered from the previous update, which does its grid alignment thing, and on the next update the view is grid aligned and not centered on the player, hence the oscillation. The code for the 'if' condition and block should look like this instead: Code:
/* Scroll screen vertically when off-center */ if (center_player) { if (!p_ptr->running || !run_avoid_center) { wy = py - SCREEN_HGT / 2; } } else (/* ... */) { /* ... */ } Same fix needs to be done for the x position 'if-else' block below that one too. |
![]() |
![]() |
Tags |
bug, sil |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Bug with "Turn" in the "Player History" dump | bron | Vanilla | 3 | January 17, 2014 17:35 |
3.5 key map error "x" | Ingwe Ingweron | Development | 1 | January 4, 2014 03:29 |
in-game map is "squished" | runequester | Vanilla | 6 | April 23, 2012 13:08 |
Can we have the "map remembers torch-lit grids" option back? | Max Stats | Development | 11 | March 4, 2011 16:20 |
"Master" option & variant selection..? | Lord Fell | Vanilla | 15 | November 13, 2010 20:45 |