Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old September 23, 2018, 09:07   #21
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 5,057
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate
Hi Shirish, thanks for the email. It's funny how life happens sometimes, I was thinking only the other day it's time I updated Angband in Debian, 4.x must be pretty mature now and I expect some free time this fall ... and lo, something happens to pull me back.

I can't promise anything soon, but months rather than years. I'll start with a bog-standard package of Angband 4.x, then I'm going to fix up angband-audio, then I'll see if I can help on SDL2.

Derakon, Nick - hope you're well.

CC
__________________
"3.4 is much better than 3.1, 3.2 or 3.3. It still is easier than 3.0.9, but it is more convenient to play without being ridiculously easy, so it is my new favorite of the versions." - Timo Pietila
Magnate is offline   Reply With Quote
Old September 23, 2018, 11:19   #22
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 53
Posts: 7,189
Donated: $60
Nick is on a distinguished road
Quote:
Originally Posted by Magnate View Post
Hi Shirish, thanks for the email. It's funny how life happens sometimes, I was thinking only the other day it's time I updated Angband in Debian, 4.x must be pretty mature now and I expect some free time this fall ... and lo, something happens to pull me back.

I can't promise anything soon, but months rather than years. I'll start with a bog-standard package of Angband 4.x, then I'm going to fix up angband-audio, then I'll see if I can help on SDL2.

Derakon, Nick - hope you're well.

CC
Good to hear from you! Am currently recovering from surgery according to plan, so let's call that well
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is offline   Reply With Quote
Old September 23, 2018, 15:49   #23
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 8,504
Derakon is on a distinguished road
Good to see you, Magnate! I'm doing decently well. Life continues on, no great peaks nor abyssal chasms.
Derakon is offline   Reply With Quote
Old September 24, 2018, 12:27   #24
t4nk
Swordsman
 
Join Date: May 2016
Posts: 306
t4nk is on a distinguished road
I sent the pull request:
https://github.com/angband/angband/pull/502

For those who are interested in compiling it (instructions for Debian-based systems!):

You'll need three libraries: the "base" SDL2, SDL2_ttf (fonts stuff) and SDL2_image (loading .png files and such). Also, their dependecies (Freetype, zlib and co). If you want sounds, you'll also need SDL2_mixer. In short:
Code:
apt-get install libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libsdl2-mixer-dev
Clone the repo and switch to sdl2 branch:
Code:
git clone https://github.com/t4nk074/angband
git checkout sdl2
Configure Angband without any frontends (just in case):
Code:
cd angband
./autogen.sh
./configure --with-no-install --disable-curses --disable-x11
(I think other stuff is disabled by default)

Now compile the game using Makefile.sdl2:
Code:
cd src
make -f Makefile.sdl2
If you want sounds, use this instead:
Code:
cd src
SOUND=yes make -f Makefile.sdl2
Now it should work... well, works for me
Code:
cd ..
./angband
Let me know if there are any problems!
t4nk is offline   Reply With Quote
Old September 24, 2018, 16:57   #25
shirish
Rookie
 
Join Date: Aug 2018
Posts: 22
shirish is on a distinguished road
Reply in-line :-

Quote:
Originally Posted by t4nk View Post
I sent the pull request:
https://github.com/angband/angband/pull/502

For those who are interested in compiling it (instructions for Debian-based systems!):

You'll need three libraries: the "base" SDL2, SDL2_ttf (fonts stuff) and SDL2_image (loading .png files and such). Also, their dependecies (Freetype, zlib and co). If you want sounds, you'll also need SDL2_mixer. In short:
Code:
apt-get install libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libsdl2-mixer-dev
Clone the repo and switch to sdl2 branch:
Code:
git clone https://github.com/t4nk074/angband
git checkout sdl2
Shouldn't this be from inside the repo. I have done the following -

Code:
~/games$ git clone https://github.com/t4nk074/angband angband-t4nk074
Cloning into 'angband-t4nk074'...
remote: Counting objects: 56527, done.
remote: Compressing objects: 100% (30/30), done.
remote: Total 56527 (delta 15), reused 14 (delta 8), pack-reused 56489
Receiving objects: 100% (56527/56527), 64.93 MiB | 287.00 KiB/s, done.
Resolving deltas: 100% (45476/45476), done.
Then -

Code:
~/games$ cd angband-t4nk074/
~/games/angband-t4nk074$ git checkout sdl2
Branch 'sdl2' set up to track remote branch 'sdl2' from 'origin'.
Switched to a new branch 'sdl2'
I would be updating my answer as I do the next steps.

Quote:
Originally Posted by t4nk View Post
Configure Angband without any frontends (just in case):
Code:
cd angband
./autogen.sh
./configure --with-no-install --disable-curses --disable-x11
(I think other stuff is disabled by default)

Now compile the game using Makefile.sdl2:
Code:
cd src
make -f Makefile.sdl2
If you want sounds, use this instead:
Code:
cd src
SOUND=yes make -f Makefile.sdl2
Now it should work... well, works for me
Code:
cd ..
./angband
Let me know if there are any problems!
The compilation terminated see https://paste.debian.net/1043948/

This is when I have all the -dev versions that were needed -

Code:
$ apt-cache policy libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libsdl2-mixer-dev
libsdl2-dev:
  Installed: 2.0.8+dfsg1-2
  Candidate: 2.0.8+dfsg1-2
  Version table:
 *** 2.0.8+dfsg1-2 500
        500 http://deb.debian.org/debian buster/main amd64 Packages
        100 http://deb.debian.org/debian unstable/main amd64 Packages
        100 /var/lib/dpkg/status
libsdl2-ttf-dev:
  Installed: 2.0.14+dfsg1-2
  Candidate: 2.0.14+dfsg1-2
  Version table:
 *** 2.0.14+dfsg1-2 500
        500 http://deb.debian.org/debian buster/main amd64 Packages
        100 http://deb.debian.org/debian unstable/main amd64 Packages
        100 /var/lib/dpkg/status
libsdl2-image-dev:
  Installed: 2.0.3+dfsg1-1
  Candidate: 2.0.3+dfsg1-1
  Version table:
 *** 2.0.3+dfsg1-1 500
        500 http://deb.debian.org/debian buster/main amd64 Packages
        100 http://deb.debian.org/debian unstable/main amd64 Packages
        100 /var/lib/dpkg/status
libsdl2-mixer-dev:
  Installed: 2.0.2+dfsg1-2
  Candidate: 2.0.2+dfsg1-2
  Version table:
 *** 2.0.2+dfsg1-2 500
        500 http://deb.debian.org/debian buster/main amd64 Packages
        100 http://deb.debian.org/debian unstable/main amd64 Packages
        100 /var/lib/dpkg/status

Last edited by shirish; September 24, 2018 at 17:08.
shirish is offline   Reply With Quote
Old September 24, 2018, 17:37   #26
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,859
Donated: $40
takkaria is on a distinguished road
You should probably run ./configure with --disable-sdl-mixer too. (Hi magnate!)
__________________
"Physician, heal thyself."
takkaria is offline   Reply With Quote
Old September 24, 2018, 17:59   #27
shirish
Rookie
 
Join Date: Aug 2018
Posts: 22
shirish is on a distinguished road
Quote:
Originally Posted by takkaria View Post
You should probably run ./configure with --disable-sdl-mixer too. (Hi magnate!)
Hi all,

I retried and failed -

Code:
~/games/angband-t4nk074$ ./autogen.sh
*info* running aclocal (-I m4)
*info* running autoheader
*info* running autoconf
and then - will be sharing just the start and end messages -

Code:
~/games/angband-t4nk074$ ./configure --with-no-install --disable-curses --disable-x11 --disable-sdl-mixer
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
.....
.....
configure: creating ./config.status
config.status: creating mk/buildsys.mk
config.status: creating mk/extra.mk
config.status: creating mk/sinclude.mk
config.status: creating src/autoconf.h
config.status: src/autoconf.h is unchanged

Configuration:

  Install path:                           (not used)
  binary path:                            ..
  config path:                            /home/shirish/games/angband-t4nk074/lib/
  lib path:                               /home/shirish/games/angband-t4nk074/lib/
  doc path:                               /home/shirish/games/angband-t4nk074/doc/
  var path:                               /home/shirish/games/angband-t4nk074/lib/

-- Frontends --
- Curses                                  Disabled
- X11                                     Disabled
- SDL                                     Disabled
- Windows                                 Disabled
- Test                                    No
- Stats                                   No

- SDL sound                               Disabled
Still got the same issue -

Code:
shirish@debian:~/games/angband-t4nk074$ cd src/
shirish@debian:~/games/angband-t4nk074/src$ SOUND=yes make -f Makefile.sdl2
        CC snd-sdl.c           
snd-sdl.c:25:10: fatal error: SDL/SDL.h: No such file or directory
 #include <SDL/SDL.h>
          ^~~~~~~~~~~
compilation terminated.
make: *** [Makefile.sdl2:100: snd-sdl.o] Error 1
Perhaps it should be -
SDL2/SDL.h

Code:
$ dpkg -L libsdl2-dev | grep SDL.h
/usr/include/SDL2/SDL.h
/usr/include/SDL2/SDL_haptic.h
/usr/include/SDL2/SDL_hints.h
I was able to fix it by doing in sdl2.c -

Code:
$ cat snd-sdl.c | grep include
 *    are included in all such copies.  Other copyrights may also apply.
#include "angband.h"
#include "init.h"
#include "sound.h"
#include <SDL2/SDL.h>
#include <SDL2/SDL_mixer.h>
just changed SDL/SDL.h and SDL/SDL_mixer.h to SDL2/SDL.h and SDL2/SDL.mixer.h

and was able to compile -

Code:
~/games/angband-t4nk074/src$ SOUND=yes make -f Makefile.sdl2
        CC snd-sdl.c           
      LINK angband             
cp angband ..

Last edited by shirish; September 24, 2018 at 18:08.
shirish is offline   Reply With Quote
Old September 24, 2018, 18:06   #28
t4nk
Swordsman
 
Join Date: May 2016
Posts: 306
t4nk is on a distinguished road
Quote:
Originally Posted by shirish View Post
The compilation terminated see https://paste.debian.net/1043948/
Ah, I see. I have SDL1 headers installed, so gcc looks into /usr/include and there is "SDL" directory there. You have only SDL2, so you have /usr/include/SDL2 (but not /usr/include/SDL). So it fails to find it (SDL_mixer API hasn't changed between 1 and 2).

Anyway, looks like you're close snd-sdl.c has two lines:

Code:
#include <SDL/SDL.h>
#include <SDL/SDL_mixer.h>
(lines 25 and 26)

Those need to be replaced with:

Code:
#include <SDL.h>
#include <SDL_mixer.h>
t4nk is offline   Reply With Quote
Old September 24, 2018, 18:09   #29
shirish
Rookie
 
Join Date: Aug 2018
Posts: 22
shirish is on a distinguished road
@t4nk, I just did that, see above

Btw we don't seem to have any graphics, it still shows up in ASCII mode with the skeletons as background.

I did try -
Code:
~/games/angband-t4nk074$ ./angband -g -ssdl -msdl2
Also angband doesn't seem to have any options for windowed mode from what all I could see/gather -

Code:
$ ./angband --help
Usage: angband [options] [-- subopts]
  -n             Start a new character (WARNING: overwrites default savefile without -u)
  -l             Lists all savefiles you can play
  -w             Resurrect dead character (marks savefile)
  -g             Request graphics mode
  -x<opt>        Debug options; see -xhelp
  -u<who>        Use your <who> savefile
  -d<dir>=<path> Override a specific directory with <path>. <path> can be:
    scores (default is /home/shirish/games/angband-t4nk074/lib/scores)
    gamedata (default is /home/shirish/games/angband-t4nk074/lib/gamedata)
    screens (default is /home/shirish/games/angband-t4nk074/lib/screens)
    help (default is /home/shirish/games/angband-t4nk074/lib/help)
    info (default is /home/shirish//.angband/Angband/info)
    pref (default is /home/shirish/games/angband-t4nk074/lib/customize)
    fonts (default is /home/shirish/games/angband-t4nk074/lib/fonts)
    tiles (default is /home/shirish/games/angband-t4nk074/lib/tiles)
    sounds (default is /home/shirish/games/angband-t4nk074/lib/sounds)
    icons (default is /home/shirish/games/angband-t4nk074/lib/icons)
    user (default is /home/shirish//.angband/Angband)
    save (default is /home/shirish/games/angband-t4nk074/lib/save)
                 Multiple -d options are allowed.
  -s<mod>        Use sound module <sys>:
     sdl   SDL_mixer sound module
        
  -m<sys>        Use module <sys>, where <sys> can be:
     sdl2   SDL2 frontend
Also for the mixer, shouldn't it be sdl2_mixer. I haven't been able to hear any sound

Last edited by shirish; September 24, 2018 at 18:19.
shirish is offline   Reply With Quote
Old September 24, 2018, 18:10   #30
t4nk
Swordsman
 
Join Date: May 2016
Posts: 306
t4nk is on a distinguished road
p.s. Hi, Takkaria
t4nk is offline   Reply With Quote
Reply

Tags
libsdl2


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Android-port not work Angrist Vanilla 1 October 14, 2014 04:24
Web Port wilbur07 Vanilla 6 February 27, 2014 14:39
OpenGL port BreathesFire Development 2 November 3, 2011 08:22
[FA] NDS port Donald Jonker Variants 54 October 6, 2011 16:49
[V] Gtk port Magnate Development 1 February 24, 2009 10:48


All times are GMT +1. The time now is 17:10.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.