public inbox for xconq7@sourceware.org
 help / color / mirror / Atom feed
From: mskala@ansuz.sooke.bc.ca
To: Eric McDonald <mcdonald@phy.cmich.edu>
Cc: xconq7@sources.redhat.com, xconq-hackers@lists.sourceforge.net
Subject: Re: Thoughts on terrain imaging
Date: Thu, 25 Nov 2004 02:50:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.21.0411232340430.21286-100000@diamond.ansuz.sooke.bc.ca> (raw)
In-Reply-To: <41A40CF5.9020303@phy.cmich.edu>

On Tue, 23 Nov 2004, Eric McDonald wrote:
> > black.  As far as I can tell, for some reason the automatic scale-down
> > code isn't running.  Isn't it supposed to?  
> 
> Yes, I thought so. I think it does with unit images.

The bug may not be in the scale-down code, it turns out (althogh, as I
said, there *are* plenty of problems with the scale-down code... this just
might not be one of them).  It seems to be in the TK stuff, and I'm
probably going to be able to find and fix it myself.  The general idea
seems to be that there is an extra step that needs to happen to convert an
XConq "image" structure into a "TkImage".  I'm not sure exactly *when*
that happens, because I've found the code that does it but not the code
that calls that code, but the overall result seems to be that the
conversion happens for explicitly specified cell-terrain images but not
for ones generated by scaling.  As a result, the code in tkmap.c gets all
the way to the bottom, where it's about to draw the cell terrain, and then
aborts (leaving black space) because the TkImage pointer is null.

There is some kind of callback that gets set for doing the image-to-Tk
(or, hypothetically, image-to-someotherinterface) conversion, so it may be
that the scale-down code isn't calling that callback when it should, but
the scale-down code *seems* to be calling it, so I think the problem may
really be that the callback isn't doing its job when called; possibly
because it's already been called before, when the explicit images were
loaded, and it sets some kind of flag incorrectly telling itself "I don't
need to run again" - but that's only a guess as to what's going on.

> I played around with 'maptest.g' for a little while. If you reduce the 
> image cutout size down to 44x48 and change the subimage selection 
> offsets to 44, then the subimages show up at normal resolution. It does 
> not appear to matter whether the 'terrain' keyword is used or not.

Yes, and the scaled-*up* images (88x96 generated when you only specify
44x48) seem to work, so the problem seems to be specific to scaling
*down*.
-- 
Matthew Skala
mskala@ansuz.sooke.bc.ca                    Embrace and defend.
http://ansuz.sooke.bc.ca/

      reply	other threads:[~2004-11-24 13:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-23 16:44 mskala
2004-11-23 22:08 ` Eric McDonald
2004-11-24  3:18   ` mskala
2004-11-24  4:25     ` Eric McDonald
2004-11-24 13:00 ` Eric McDonald
2004-11-25  2:50   ` mskala [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.21.0411232340430.21286-100000@diamond.ansuz.sooke.bc.ca \
    --to=mskala@ansuz.sooke.bc.ca \
    --cc=mcdonald@phy.cmich.edu \
    --cc=xconq-hackers@lists.sourceforge.net \
    --cc=xconq7@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).