The International Simutrans Forum

 

Author Topic: special_pal  (Read 1695 times)

0 Members and 1 Guest are viewing this topic.

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
special_pal
« on: October 17, 2010, 09:08:55 PM »
Hi,
together with Sim we tried to replace the player colour schemes. This is not possible, because these data serve more than one purpose - in fact, so far we found these interpretations:
  • player schemes
  • minimap
  • gui - buttons etc.
  • font
  • intro screen

Indexing into the array changes what programmer writes from triple to char. That's all, still magic numbers and no symbolic names. This feels wonderfully 1980 - a relic from the ancient times of Simutrans, no doubt :D

At this moment I haven't looked yet where the array is used in the code. However - is this the desirable state? Are there any reasons to not attempt a rewrite? If so, what should be the new organization of data like? As far as I can tell, minimap should have its own array and the gui-related stuff perhaps macros (constants?).


edit: Of course I'll gladly do the coding, but talking first seems more safe :)
« Last Edit: October 17, 2010, 09:15:49 PM by VS »

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9460
  • Languages: De,EN,JP
Re: special_pal
« Reply #1 on: October 17, 2010, 11:20:18 PM »
Reason not to rewrite:
colors are mostly balanced
colors are used for UI and for minimap

One could use another array for player colors, since those are used normally with a flag. (Mostly) This is probably the only proper way of doing this.

What is the purpose of the rewrite?