[Freeciv-Dev] [bug #17579] Ocean city gfx uses memory many times

2012-06-17 Thread Jacob Nevins
Update of bug #17579 (project freeciv):

  Status:None = Confirmed  
 Planned Release:   2.4.0 =

___

Follow-up Comment #2:

I think this is still true.

Looking at tilespec.c:scan_specfile(), there are a couple of things we can do
about this.

First, the tileset loading code already supports a way for multiple tags to
share the same sprite in memory, but it needs explicit markup in the tilespec
file -- you have to put all tags on the same line.
See the following example. I've tested it works, but not that it saves memory.
There are existing examples of this being used.


--- a/data/amplio2/ancientcities.spec
+++ b/data/amplio2/ancientcities.spec
@@ -43,11 +43,7 @@ tiles = { row, column, tag

 ; used by all city styles

- 2,  11, city.asian_occupied_0
- 2,  11, city.tropical_occupied_0
- 2,  11, city.celtic_occupied_0
- 2,  11, city.classical_occupied_0
- 2,  11, city.babylonian_occupied_0
+ 2,  11, city.asian_occupied_0, city.tropical_occupied_0,
city.celtic_occupied_0, city.classical_occupied_0,
city.babylonian_occupied_0


 ;


However, that's not great for readability/maintainability of the tilespec
file.

I think it would be a simple matter to create a temporary hash of
small_sprite structures in scan_specfile(), lasting for the lifetime of a
grid_XXX section, and keyed by {row,column,hot_x,hot_y}. That would allow tags
defined on separate lines to share the same graphics data in memory; the above
example should start saving memory with no change to syntax.
All the reference counting and many:1 tag:small_sprite mechanism is already in
place and apparently working.

However, this doesn't seem particularly urgent, so I'm removing the 2.4.0
target.

___

Reply to this item at:

  http://gna.org/bugs/?17579

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #17579] Ocean city gfx uses memory many times

2012-06-17 Thread Marko Lindqvist
Follow-up Comment #3, bug #17579 (project freeciv):

I investigated this a bit some months back, but it seems I have failed to
update the ticket with my findings.

At least for the cases listed so far there's no problem. Sprites are already
hashed by tag name. So if several city_styles (or base_types) use identical
tag, gfx is loaded only once.

I'm not closing this ticket as there's one case which we could improve. If
given ruleset is used with several tilesets of which one does have different
gfx for different era ocean cities, ruleset cannot use identical tag for them.
Then the other tileset with just one ocean gfx will have several copies of its
only gfx in memory. That's not pressing problem with what we currently
officially distribute, but we could have separate full-featured tileset for
high-end systems and minimal tileset for embedded systems.

___

Reply to this item at:

  http://gna.org/bugs/?17579

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #17579] Ocean city gfx uses memory many times

2011-01-26 Thread Marko Lindqvist

URL:
  http://gna.org/bugs/?17579

 Summary: Ocean city gfx uses memory many times
 Project: Freeciv
Submitted by: cazfi
Submitted on: Wed 26 Jan 2011 01:55:36 PM EET
Category: client
Severity: 3 - Normal
Priority: 5 - Normal
  Status: None
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Release: 
 Discussion Lock: Any
Operating System: None
 Planned Release: 2.4.0

___

Details:

I write this bug report just to save my old notes (from the time when
separate ocean city gfx was added). I have not checked if all of this apply to
current codebase.

It's likely that tileset has more styles for land cities than for ocean
cities. Both land and ocean city gfx are defined in same city_style structure.
In practice there is one city_style structure / land city style, and multiple
city_styles use same ocean city style.
Problem is that each city_style loads ocean city gfx to memory independently.
Even if they in fact use same gfx, each of them use separate copy in memory.
There should be way to different city_style structures to share same gfx in
memory.




___

Reply to this item at:

  http://gna.org/bugs/?17579

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #17579] Ocean city gfx uses memory many times

2011-01-26 Thread Marko Lindqvist

Follow-up Comment #1, bug #17579 (project freeciv):

Same problem probably applies to multiple bases sharing same gfx. Sensible
use-case for such bases would be scenario where somewhat different (maybe only
differently named) unbuildable bases are already placed on map.

___

Reply to this item at:

  http://gna.org/bugs/?17579

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev