pingus-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SmallMap issue(s)


From: Ingo Ruhnke
Subject: Re: SmallMap issue(s)
Date: 09 Oct 2002 01:24:38 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Gervase Lam <address@hidden> writes:

> I'm looking at SmallMap doesn't show exit (Bug 1213). The solution
> says "to add a generic WorldObj::draw_smallmap() and let Entrance
> and Exit classes do the rest. ExitTrap classes could also draw
> themself on the map." Does this mean something a bit like
> Entrance::put_onto_smallmap() and Exit::put_onto_smallmap()?

My solution isn't really correct, I tried this yesterday and it didn't
really work out, but anyway the 'correct' solution would look similar.
 
> In a way this is a good thing is it enables the 'terrain' on the
> smallmap to be constantly updated, unlike what happens now.

Smallmap gets updated since a few days ago (every 3 seconds and only
if the map changes).

> If the SmallMap class were to be given the resposibility of updating
> the 'terrain', it would have to go through the whole colmap array
> after every game "update". This could slow things down.

I have added a serial number that gets increased on every colmap
change. See the CVS comments:

http://mail.freesoftware.fsf.org/mailman/listinfo/pingus-cvs

Update takes 2-3ms currently (thats all I could get with
CL_System::get_time()), but the slowdown is still noticable, probally
just because a frame_skip due to a missed timeframe, but I am not
sure.
 
> Also, how would each object access the small map so that it can be
> altered? Should a pointer or reference to the small map be passed to
> each object? How and where in the code should the small map object
> or data type be instantiated?

SmallMap::draw()
{
        world->draw_smallmap(this);
}
[...]
void
Exit::draw_smallmap(SmallMap* smallmap)
{
  smallmap->draw_surface(exit_surface, pos);
}

The SmallMap would then calculate the World-CO pos into Screen-CO pos
and draw the surface. The SmallMap surface would stay untouched.

BTW. We also need a way to 'disable' the colmap so that a user can not
see clearly where the exits and the ground is, indiana-yingwan.xml and
fake_exits are the reason for this.

-- 
WWW:      http://pingus.seul.org/~grumbel/ 
Games:    http://pingus.seul.org/~grumbel/gamedesigns/
JabberID: address@hidden 
ICQ:      59461927




reply via email to

[Prev in Thread] Current Thread [Next in Thread]