~ubuntu-branches/ubuntu/maverick/crossfire-client/maverick

« back to all changes in this revision

Viewing changes to gtk/image.c

  • Committer: Bazaar Package Importer
  • Author(s): Kari Pahula
  • Date: 2007-04-13 21:15:44 UTC
  • mfrom: (1.2.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20070413211544-vjo6zesj6g0wgmwf
Tags: 1.10.0-1
* New upstream release
* Install the README, README-dev and TODO files specific to the GTK2
  client to the corresponding package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
const char *rcsid_gtk_image_c =
2
 
    "$Id: image.c,v 1.27 2006/02/23 20:18:28 akirschbaum Exp $";
 
2
    "$Id: image.c 5086 2006-11-06 05:49:27Z mwedel $";
3
3
/*
4
4
    Crossfire client, a client program for the crossfire program.
5
5
 
158
158
             */
159
159
            g=(77*(*l)+151*(*(l+1))+28*(*(l+2)))>>8;
160
160
            p = (uint32*) fog->pixels + i;
161
 
            *(uint32*) p = g | (g << 8) | (g << 16) | (*(l + 3) << 24);
 
161
            *p = g | (g << 8) | (g << 16) | (*(l + 3) << 24);
162
162
        }
163
163
 
164
164
        SDL_UnlockSurface(fog);
193
193
             */
194
194
            g=(77*(*l)+151*(*(l+1))+28*(*(l+2)))>>8;
195
195
            p = (uint32*) fog->pixels + i;
196
 
            *(uint32*) p = (g << 8) | (g << 16) | (g << 24) | *(l + 3);
 
196
            *p = (g << 8) | (g << 16) | (g << 24) | *(l + 3);
197
197
        }
198
198
 
199
199
        for (i=0; i < pi->map_width * pi->map_height; i+= 4) {
 
200
            uint32 *tmp;
 
201
 
200
202
            /* The pointer arithemtic below looks suspicious, but it is a patch that
201
203
             * is submitted, so just putting it in as submitted.
202
204
             * MSW 2004-05-11
203
205
             */
204
206
            p = (uint32*) (fog->pixels + i);
205
207
            g = ( ((*p >> 24) & 0xff)  + ((*p >> 16) & 0xff) + ((*p >> 8) & 0xff)) / 3;
206
 
            l = (uint32*) fog->pixels + i;
207
 
            *(uint32*) l = (g << 24) | (g << 16) | (g << 8) | (*p & 0xff);
 
208
            tmp = (uint32*) fog->pixels + i;
 
209
            *tmp = (g << 24) | (g << 16) | (g << 8) | (*p & 0xff);
208
210
 
209
211
        }
210
212
 
307
309
     *  maybe, but it uses graphical resources, and takes time (don't laugh, some people use
308
310
     *   slow old comps! :p)
309
311
     *  Ryo 2005-09-05
 
312
     *
 
313
     * Maybe, but only if were using PIXMAP mode - otherwise, SDL doesn't know how to
 
314
     * draw GDK pixmaps.
 
315
     * MSW 2006-11-05                                                   
310
316
     */
311
 
    if (iscale == use_config[CONFIG_MAPSCALE]) {
 
317
    if (iscale == use_config[CONFIG_MAPSCALE] && use_config[CONFIG_DISPLAYMODE]==CFG_DM_PIXMAP) {
312
318
        pi->map_height = pi->icon_height;
313
319
        pi->map_width = pi->icon_width;
314
320
        pi->map_mask = pi->icon_mask;