Sil and Angband variants available on Android

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • takkaria
    Veteran
    • Apr 2007
    • 1951

    #16
    Originally posted by Psi
    Seems I have previously answered my own question from a future thread. That is special.

    I don't suppose that three years on the background tile effect will magically get fixed...
    I am not sure exactly what Sil's system for background colour changes is, but if it's like the Angband one (and it probably is because I'm not sure where else I would have stolen it from), I just implemented this for the Angband 4.0.5 port. The commit is here:

    angband port to android, based on angdroid. Contribute to takkaria/angband-android development by creating an account on GitHub.


    You want Term_text_and() in plugin/common/angdroid.c to look like:

    Code:
    static errr Term_text_and(int x, int y, int n, int a, const wchar_t *cp)
    {
    	int fg = a % MAX_COLORS;
    	int bg;
    
    	/* Handle background */
    	switch (a / MAX_COLORS) {
    		case BG_BLACK:  bg = COLOUR_DARK;  break;
    		case BG_SAME:   bg = fg;           break;
    		case BG_DARK:	bg = COLOUR_SHADE; break;
    	}
    
    	move(y, x);
    	attrset(fg);
    	bgattrset(bg);
    	addnwstr(n, cp);
    
    	return 0;
    }
    And then the rest of the patch I linked to should apply cleanly and get you background colours.
    takkaria whispers something about options. -more-

    Comment

    • Nick
      Vanilla maintainer
      • Apr 2007
      • 9647

      #17
      Originally posted by takkaria
      I am not sure exactly what Sil's system for background colour changes is, but if it's like the Angband one (and it probably is because I'm not sure where else I would have stolen it from)
      Pretty sure it is, and that it was me that stole it
      One for the Dark Lord on his dark throne
      In the Land of Mordor where the Shadows lie.

      Comment

      • Psi
        Knight
        • Apr 2007
        • 870

        #18
        Originally posted by takkaria
        And then the rest of the patch I linked to should apply cleanly and get you background colours.
        Wow - that was quick!

        Firstly I'm not going to pretend to know what I am doing. I could do all those changes manually but I'd much rather apply a patch file if possible like I did for the Sil bit. The link you provided looks like a patch, but I have no idea how to download that as a patch. Is there a button/link I am missing?

        Many, many thanks!

        Comment

        • Psi
          Knight
          • Apr 2007
          • 870

          #19
          Ah, a bit more googling suggests putting .patch on the url. That looks promising.

          Comment

          • takkaria
            Veteran
            • Apr 2007
            • 1951

            #20
            Originally posted by Psi
            Ah, a bit more googling suggests putting .patch on the url. That looks promising.
            I am also happy to modify the copy of Sil you have. If you put it zipped up on Dropbox or something, and email me the link (andi at takkaria dot org) I can apply it for you.
            takkaria whispers something about options. -more-

            Comment

            • Psi
              Knight
              • Apr 2007
              • 870

              #21
              Bits of the patch applied, bits I had to do manually. End result are these errors:

              plugin-lib:
              [exec] [arm64-v8a] Compile : sil <= angdroid.c
              [exec] /home/si/android-ndk-r13b/build/core/build-binary.mk:497: recipe for target 'obj/local/arm64-v8a/objs/sil/__/__/common/angdroid.o' failed
              [exec] jni/../../common/angdroid.c:652:24: error: use of undeclared identifier 'COLOUR_DARK'
              [exec] case BG_BLACK: bg = COLOUR_DARK; break;
              [exec] ^
              [exec] jni/../../common/angdroid.c:654:22: error: use of undeclared identifier 'COLOUR_SHADE'
              [exec] case BG_DARK: bg = COLOUR_SHADE; break;
              [exec] ^

              I'm no programmer, but I'm hoping that is just a definition somewhere. Will have a hunt, but I'll post it here as I suspect you'll know the answer!

              Comment

              • takkaria
                Veteran
                • Apr 2007
                • 1951

                #22
                Originally posted by Psi
                Bits of the patch applied, bits I had to do manually. End result are these errors:

                plugin-lib:
                [exec] [arm64-v8a] Compile : sil <= angdroid.c
                [exec] /home/si/android-ndk-r13b/build/core/build-binary.mk:497: recipe for target 'obj/local/arm64-v8a/objs/sil/__/__/common/angdroid.o' failed
                [exec] jni/../../common/angdroid.c:652:24: error: use of undeclared identifier 'COLOUR_DARK'
                [exec] case BG_BLACK: bg = COLOUR_DARK; break;
                [exec] ^
                [exec] jni/../../common/angdroid.c:654:22: error: use of undeclared identifier 'COLOUR_SHADE'
                [exec] case BG_DARK: bg = COLOUR_SHADE; break;
                [exec] ^

                I'm no programmer, but I'm hoping that is just a definition somewhere. Will have a hunt, but I'll post it here as I suspect you'll know the answer!
                Hmm. COLOUR_DARK should be TERM_DARK and COLOUR_SHADE should be TERM_SHADE. Then it will probably work.
                takkaria whispers something about options. -more-

                Comment

                • Psi
                  Knight
                  • Apr 2007
                  • 870

                  #23
                  Originally posted by takkaria
                  Hmm. COLOUR_DARK should be TERM_DARK and COLOUR_SHADE should be TERM_SHADE. Then it will probably work.
                  Well it compiles now, but trying to actually play just gives gibberish on the screen. I haven't the foggiest idea how I'd debug that.

                  {edit} when I say gibberish, I mean it looks like a load of control codes eg C0;AC~ repeated in columns (the A has an umlaut or something on it)
                  Last edited by Psi; November 5, 2016, 10:11.

                  Comment

                  • Psi
                    Knight
                    • Apr 2007
                    • 870

                    #24
                    Originally posted by takkaria
                    I am also happy to modify the copy of Sil you have. If you put it zipped up on Dropbox or something, and email me the link (andi at takkaria dot org) I can apply it for you.
                    I've zipped up my directory and shared my patched version with you on dropbox. If you're able to assist then I'm forever grateful!

                    Comment

                    • Nick
                      Vanilla maintainer
                      • Apr 2007
                      • 9647

                      #25
                      Originally posted by Psi
                      I'm no programmer
                      I beg to differ. You were responsible for releasing version 0.3.6 of FAangband, as I recall
                      One for the Dark Lord on his dark throne
                      In the Land of Mordor where the Shadows lie.

                      Comment

                      • Psi
                        Knight
                        • Apr 2007
                        • 870

                        #26
                        Originally posted by Nick
                        I beg to differ. You were responsible for releasing version 0.3.6 of FAangband, as I recall
                        I can tinker with existing code, but don't ask me to actually write anything!

                        Comment

                        • Psi
                          Knight
                          • Apr 2007
                          • 870

                          #27
                          Been experimenting and this might help in troubleshooting...

                          If I change your angdroid.c:

                          static errr Term_text_and(int x, int y, int n, int a, const wchar_t *cp)
                          to
                          static errr Term_text_and(int x, int y, int n, int a, const char *cp)

                          and

                          addnwstr(n, cp);
                          to
                          addnstr(n, cp);

                          Then I get normal text again.

                          However granite has become invisible (can only see quartz) and there are still no background colours on unaware monsters.

                          Comment

                          • takkaria
                            Veteran
                            • Apr 2007
                            • 1951

                            #28
                            Originally posted by Psi
                            I've zipped up my directory and shared my patched version with you on dropbox. If you're able to assist then I'm forever grateful!
                            I got the text displaying OK, but walls are just not appearing now. Hopefully will figure that out and then I'll send the angdroid.c file back to you

                            EDIT: Sorted! Just drop https://gist.githubusercontent.com/t...b63/angdroid.c over your existing angdroid.c file and all should be well.
                            Last edited by takkaria; November 5, 2016, 18:43.
                            takkaria whispers something about options. -more-

                            Comment

                            • Psi
                              Knight
                              • Apr 2007
                              • 870

                              #29
                              Brilliant. Thank you so much!

                              There is one oddity in that when an enemy notices you, the background doesn't clear until the next turn instead of when you get the message, but that is minor.

                              Thanks again!

                              Comment

                              • TJA
                                Adept
                                • Aug 2007
                                • 117

                                #30
                                Anything useful available on iPhone?
                                ;-)

                                Comment

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