![]() |
#1 |
Knight
Join Date: Jan 2009
Posts: 657
![]() |
Quick Term_erase question.
And the question is ... what's this bit in aid of?
Code:
if ((n > 0) && (scr_cc[x] == (char) -1) && (scr_aa[x] == 255)) { x--; n++; } Incidentally, if I was going to guess, I'd suspect it might have something to do with BIGTILE mode? (Maybe not). [EDIT] Yeah, looks like it's BIGTILE stuff. I think I've got a handle on it, but I guess I'll end up changing some code for this.
__________________
Currently turning (Angband) Japanese. Last edited by PaulBlay; May 27, 2009 at 21:34. |
![]() |
![]() |
![]() |
#2 |
Prophet
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,992
Donated: $40
![]() |
Ain't that some nice 80's-style code. Sweet!
It's stepping back the pad character of a tile in double-wide mode. |
![]() |
![]() |
![]() |
#3 | |
Knight
Join Date: Jan 2009
Posts: 657
![]() |
Tell me about it. There don't seem to be any #defines for attribute values so you just have to hope somebody left a comment or hope your psychic powers are up to stuff.
![]() Quote:
__________________
Currently turning (Angband) Japanese. |
|
![]() |
![]() |
![]() |
#4 |
Prophet
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,992
Donated: $40
![]() |
I can write it more efficiently, if you like. The if statement is unnecessarily verbose.
Code:
(n > 0) && (scr_cc[x] == (char) -1) && (scr_aa[x] == 255) && (x--, n++); |
![]() |
![]() |
![]() |
#5 | |
Vanilla maintainer
Join Date: Apr 2007
Location: Canberra, Australia
Age: 55
Posts: 8,658
Donated: $60
![]() |
Quote:
![]()
__________________
One for the Dark Lord on his dark throne In the Land of Mordor where the Shadows lie. |
|
![]() |
![]() |
![]() |
#6 | |
Knight
Join Date: Jan 2009
Posts: 657
![]() |
Quote:
That seems unlikely. ![]()
__________________
Currently turning (Angband) Japanese. |
|
![]() |
![]() |
![]() |
#7 | |
Knight
Join Date: Apr 2007
Posts: 590
![]() |
Quote:
scr_aa originally was unsigned char; 255 is UCHAR_MAX assuming CHAR_BIT is 8 (which the entire V codebase does, I put a preprocessor test for this into Zaiband to trigger a preprocessing error on such unsupported systems). If you're not using a proper UNICODE library, try WCHAR_MAX (C++) or WINT_MAX (C) in place of 255/UCHAR_MAX. [Note that the standards do *not* guarantee any particular encoding for wchar_t/wint_t . As usual, Solaris will give you a porting sunburn.] Note that you will want to use a proper UNICODE library, because Linux will railroad you into UTF-8 while Windows demands you use UCS-2 in practice. |
|
![]() |
![]() |
![]() |
#8 | ||
Knight
Join Date: Jan 2009
Posts: 657
![]() |
Quote:
![]() Quote:
__________________
Currently turning (Angband) Japanese. |
||
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Yum! Favorite quick recipe. | Pete Mack | Idle chatter | 1 | April 22, 2009 11:12 |
Quick Diving versus "Recommended Depths" | Wraitheist | Vanilla | 14 | May 4, 2008 09:12 |