Opened 10 years ago

Closed 6 years ago

#400 closed task (fixed (in master))

Make graphics less hardcoded

Reported by: shanoah Owned by: takkaria
Milestone: 3.4.0 Keywords: graphics
Cc:

Description (last modified by fizzix)

Currently, there are several places where case statements are used to change what tiles are used, based on which tile set is used, and how light the square is. This should be moved out of the code, either into the graf.prf files or an info file, and it should be possible to add new tile sets by adding to this file, and adding a png file for the tile set.

It may be a good idea to clean up the dichotomy between arg_graphics and use_graphics, while at it.

Change History (13)

comment:1 Changed 10 years ago by shanoah

Lines 400 - 580 of cave.c, and the function bolt_pict in spells1.c are good places to start on this, btw.

comment:2 Changed 7 years ago by takkaria

  • Milestone changed from Future to 3.3.0
  • Owner set to takkaria
  • Status changed from new to assigned

have already done significant work on this, will be in post 3.2

comment:3 Changed 7 years ago by takkaria

https://github.com/takkaria/angband/tree/graphics-refactor completes this for the OS X port:

  • tilesets are specified in a settings file
  • there are no switch statements left in the code hardcoding graphics choices
  • OS X port dynamically creates menu entries depending on what tiles are available

Future work: porting SDL and Windows to this framework. Windows will I suspect be the hardest.

comment:4 Changed 7 years ago by magnate

  • Type changed from change to task

comment:5 Changed 7 years ago by takkaria

Some of that work is now in staging, see [fc5b02026621]. As of that commit, there is nowhere in the code that hardcodes any tile positions but there are still hardcodings of tilesets themselves.

comment:6 Changed 7 years ago by takkaria

OK, so things that are left to put in external files:

  • a list of all graphics tilesets, their files and settings
  • specification of trap detection attr/char
  • specification of pile attr/char
  • currently hardcoded lightening/darkening of ASCII terrain pictures

Also need to fix the knowledge browser so it can edit all three different kinds of lighting.

comment:7 Changed 6 years ago by takkaria

see also this thread for work towards achieving this on Windows

comment:8 Changed 6 years ago by takkaria

Blue Baron has a lot of solution here: oook thread

comment:9 Changed 6 years ago by magnate

  • Milestone changed from 3.3.0 to 3.4.0

Postponing to 3.4 per IRC

comment:10 Changed 6 years ago by fizzix

  • Description modified (diff)
  • Milestone changed from 3.4.0 to 3.5.0

Fixed in Windows and SDL, need confirmation for Mac to close.

Last edited 6 years ago by fizzix (previous) (diff)

comment:11 Changed 6 years ago by fizzix

  • Milestone changed from 3.5.0 to 3.4.0

comment:12 Changed 6 years ago by magnate

With the advent of graphics.txt, and the 'overlay' tiles for light/bright/dark, and the addition of trap detection and pile tiles for each set, is this now done? Comment 10 says "need confirmation for Mac", but OSX was the first to be done, according to the earlier comments ...

comment:13 Changed 6 years ago by magnate

  • Resolution set to fixed (in master)
  • Status changed from assigned to closed

Closed by agreement with Blubaron on IRC ...

Note: See TracTickets for help on using tickets.