Angband Forums

Angband Forums (http://angband.oook.cz/forum/index.php)
-   Development (http://angband.oook.cz/forum/forumdisplay.php?f=10)
-   -   SDL2 port when ? (http://angband.oook.cz/forum/showthread.php?t=9076)

shirish September 19, 2018 22:27

SDL2 port when ?
 
Can anybody comment on when can we expect an SDL 2 port , not SDL 1.2 but SDL2 port.

Derakon September 20, 2018 00:59

As soon as someone with the necessary time, willingness, and expertise makes one. So far as I'm aware, nobody has expressed any interest in doing that yet. You'd be more than welcome to take a stab at it yourself though.

t4nk September 20, 2018 01:25

Hahaha... oh wow :rolleyes:

Quote:

Originally Posted by Derakon (Post 133337)
As soon as someone with the necessary time, willingness, and expertise makes one

Nope :)

Quote:

So far as I'm aware, nobody has expressed any interest in doing that yet.
Hey Derakon... what if I told you that someone has already written an SDL2 frontend for Angband years ago? I'm not talking about textui2, but an honest-to-god frontend for Ben Harrison's z-term.c...

Quote:

You'd be more than welcome to take a stab at it yourself though.
Whatever for?

Derakon September 20, 2018 01:27

Quote:

Originally Posted by t4nk (Post 133338)
Hey Derakon... what if I told you that someone has already written an SDL2 frontend for Angband years ago? I'm not talking about textui2, but an honest-to-god frontend for Ben Harrison's z-term.c...

Sounds like I need to eat some crow then. I sincerely apologize!

t4nk September 20, 2018 01:44

Quote:

Originally Posted by Derakon (Post 133339)
Sounds like I need to eat some crow then. I sincerely apologize!

No problem. I think everyone just forgot about it after this story with rewriting the UI... I also forgot (hence my "oh wow" :)). So now that I remembered, I wonder what happened with this code? I don't have it, I only have textui2, cloned from Takkaria's repo (which also doesn't seem to have it)... Maybe it's lost forever. Meh, whatever...

t4nk September 20, 2018 02:14

Hey, I found it!
https://github.com/takkaria/angband/...rc/main-sdl2.c

Well, OP, now that you have it, what are you going to do with it? :)

shirish September 20, 2018 09:47

Quote:

Originally Posted by t4nk (Post 133341)
Hey, I found it!
https://github.com/takkaria/angband/...rc/main-sdl2.c

Well, OP, now that you have it, what are you going to do with it? :)

I tried it actually :-

Code:

~/games/takkaria-angband$ git-info

## Remote URLs:

origin        https://github.com/takkaria/angband.git (fetch)
origin        https://github.com/takkaria/angband.git (push)

## Remote Branches:

  origin/HEAD -> origin/master
  origin/avg-dmg
  origin/los-searching
  origin/master
  origin/pr-auto-books
  origin/pr-heal-other
  origin/pr-slot-sizes
  origin/text-out-cleanup
  origin/wip-textui2

## Local Branches:

* master

## Most Recent Commit:

commit 6a5df0b662caca9fff9d332c1ec6b21e7b36e595
Author: Nick McConnell <nckmccnnll@gmail.com>

    Remove trap, door and stair detection

Type 'git log' for more commits, or 'git show <commit id>' for full commit details.

## Configuration (.git/config):

user.name=shirish agarwal
user.email=xxxxxxxxxxxx
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=https://github.com/takkaria/angband.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master


https://paste.debian.net/1043405/

The compilation fails as it looks for libsdl1.2 config

The relevant bits -

Code:

checking for sdl-config... no
checking for SDL - version >= 1.2.10... no
*** The sdl-config script installed by SDL could not be found
*** If SDL was installed in PREFIX, make sure PREFIX/bin is in
*** your path, or set the SDL_CONFIG environment variable to the
*** full path to sdl-config.
checking for Mix_OpenAudio in -lSDL_mixer... no

where it should be looking for libsdl2-config :-
Code:

$ sdl2-config --version
2.0.8

FWIW, there are two libsdl2 audio libraries that upstream could look at -

http://www.libsdl.org/projects/SDL_mixer/

https://github.com/katajakasa/SDL_kitchensink

The first one is an all encompassing one, the second one is supposedly more narrower in scope.

I am no developer but can help with compiling and telling what seems to come up short.

t4nk September 20, 2018 14:34

Quote:

Originally Posted by shirish (Post 133343)
I tried it actually :-

https://paste.debian.net/1043405/

The compilation fails as it looks for libsdl1.2 config

Indeed, since it was never incorporated into Angband. I recall you need to run autoconf with "--disable-sdl" actually (which disables SDL1), and then manually hack the Makefile.std (that's what I did back then)...

Quote:

I am no developer but can help with compiling and telling what seems to come up short.
You can try to go back futher in this branch and look for something like Makefile.sdl2... although it probably shouldn't be there. If not, I can write the Makefile, but not right now, maybe in several days (also, I still don't know how autoconf works :))

shirish September 20, 2018 14:55

Quote:

Originally Posted by t4nk (Post 133346)
Indeed, since it was never incorporated into Angband. I recall you need to run autoconf with "--disable-sdl" actually (which disables SDL1), and then manually hack the Makefile.std (that's what I did back then)...


You can try to go back futher in this branch and look for something like Makefile.sdl2... although it probably shouldn't be there. If not, I can write the Makefile, but not right now, maybe in several days (also, I still don't know how autoconf works :))

Hi,

It actually uses autogen.sh .

When I run ./autogen.sh the following takes place -

Code:

~/games/takkaria-angband$ ./autogen.sh
*info* running aclocal (-I m4)
*info* running autoheader
*info* running autoconf

which forms the .configure script

The Makefile is generated when the .configure script is taken care of . Once it is complete, you get a makefile.

If I just do -

Code:

~/games/takkaria-angband$ ./configure --with-no-install
then a makefile will be generated which has the sdl frontline disabled.

There is a Makefile though but that's in -

Code:

~/games/takkaria-angband/src$ cat Makefile.src | grep sdl
SDLMAINFILES = main-sdl.o
SNDSDLFILES = snd-sdl.o

There is this Q&A on stackoverflow I saw but dunno if its just what is needed

https://stackoverflow.com/questions/...n-linux-ubuntu

Reading it few times it seems it needs the following info. -
Code:

/usr/bin/sdl2-config
/usr/include/SDL2/SDL.h
/usr/lib/x86_64-linux-gnu/libSDL2.so

for libsdl2 and -

Code:

/usr/include/SDL2/SDL_mixer
/usr/lib/x86_64-linux-gnu/libSDL2_mixer.so

Edit - I found what needs to be fixed -

from https://wiki.libsdl.org/FAQLinux#How..._my_project.3F

it seems acinclude.m4 is what needs to be fixed -

it needs https://hg.libsdl.org/SDL/file/default/sdl2.m4

I did try to do a copy and replace but didn't get far.

This is what I did with acinclude.m4

https://paste.debian.net/1043458/

I get the following errors when I try to ./autogen.sh it -

Code:

~/games/takkaria-angband$ ./autogen.sh
*info* running aclocal (-I m4)
acinclude.m4:157: warning: the serial number must appear before any macro definition
configure.ac:269: warning: macro 'AM_PATH_SDL' not found in library
*info* running autoheader
*info* running autoconf
configure.ac:269: error: possibly undefined macro: AM_PATH_SDL
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
*error* autoconf failed. (exit code = 1)


t4nk September 20, 2018 16:00

Quote:

Originally Posted by shirish (Post 133348)
Hi,

It actually uses autogen.sh .

When I run ./autogen.sh the following takes place -

Code:

~/games/takkaria-angband$ ./autogen.sh
*info* running aclocal (-I m4)
*info* running autoheader
*info* running autoconf

which forms the .configure script

The Makefile is generated when the .configure script is taken care of . Once it is complete, you get a makefile.

Yeah, in principle, it should be simple enough. Replace main-sdl.c (SDL1 version) with main-sdl2.c, replace all references to main-sdl.c with references to main-sdl2.c in autogen stuff, link with SDL2 instead of SDL1, and then it should work. I just don't know how to do it :)
Code:

/usr/lib/x86_64-linux-gnu/libSDL2.so
/usr/lib/x86_64-linux-gnu/libSDL2_mixer.so

You'll also need libSDL2_ttf.so (for loading fonts) and libSDL2_image.so (for loading tiles).

Quote:

I get the following errors when I try to ./autogen.sh it -

Code:

~/games/takkaria-angband$ ./autogen.sh
*info* running aclocal (-I m4)
acinclude.m4:157: warning: the serial number must appear before any macro definition
configure.ac:269: warning: macro 'AM_PATH_SDL' not found in library
*info* running autoheader
*info* running autoconf
configure.ac:269: error: possibly undefined macro: AM_PATH_SDL
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
*error* autoconf failed. (exit code = 1)


Well, if you're serious about it, I'll write the Makefile. It'll be simpler than trying to figure out autoconf :) The only problem with that is I now have a new hobby , which is writing a roguelike, loosely inspired by (among other things) Angband. And I'm not using C or Make for that, so it'll cause me some moral suffering to go back to those, and I need to muster my strength first :)


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

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