~ubuntu-branches/debian/jessie/bristol/jessie

« back to all changes in this revision

Viewing changes to libbrighton/brightonLayer.c

  • Committer: Bazaar Package Importer
  • Author(s): Alessio Treglia
  • Date: 2009-11-10 12:21:04 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20091110122104-432yau0haobyl122
Tags: 0.40.6-1
* Adopting this (Closes: #546954).
* Create new bristol-data runtime package, it will contain application's
  architecture-indipendent data files.
* Drop all patches, now useless.
* Switch to debhelper 7.
* debian/copyright: Update according to DEP-5 spec.
* debian/bristol.1: Fix little spelling mistake.
* Replace patch system, from dpatch to quilt.
* Add 01-spelling_errors.patch patch to fix spelling-error-in-binary.
* debian/rules: dh_makeshlibs doesn't touch shlibs/symbols file, libraries
  under /usr/lib/bristol/ are private.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
/*
4
4
 *  Diverse Bristol audio routines.
5
 
 *  Copyright (c) by Nick Copeland <nickycopeland@hotmail.com> 1996,2008
 
5
 *  Copyright (c) by Nick Copeland <nickycopeland@hotmail.com> 1996,2009
6
6
 *
7
7
 *
8
8
 *   This program is free software; you can redistribute it and/or modify
204
204
        bwin->items[i].y = y;
205
205
        bwin->items[i].w = w;
206
206
        bwin->items[i].h = h;
 
207
        bwin->items[i].scale = bwin->width;
207
208
 
208
209
        if (bwin->items[i].image != NULL)
209
210
                brightonFreeBitmap(bwin, bwin->items[i].image);
230
231
 
231
232
        brightonFinalRender(bwin, x, y, w, h);
232
233
 
 
234
        bwin->items[i].flags = BRIGHTON_LAYER_PUT;
 
235
        if ((w == bwin->width) && (h == bwin->height))
 
236
                bwin->items[i].flags |= BRIGHTON_LAYER_ALL;
 
237
 
233
238
        return(i);
234
239
}
235
240
 
262
267
        bwin->items[i].y = y;
263
268
        bwin->items[i].w = w;
264
269
        bwin->items[i].h = h;
 
270
        bwin->items[i].scale = bwin->width;
265
271
 
266
272
        if (bwin->items[i].image != NULL)
267
273
                brightonFreeBitmap(bwin, bwin->items[i].image);
312
318
 
313
319
        brightonFinalRender(bwin, a, b, c - a + 6, d - b);
314
320
 
 
321
        bwin->items[i].flags = BRIGHTON_LAYER_PLACE;
 
322
 
315
323
        return(i);
316
324
}
317
325
 
371
379
        return(0);
372
380
}
373
381
 
 
382
static char tImage[256];
 
383
 
 
384
/*
 
385
 * This is called for world changes
 
386
 */
 
387
int
 
388
brightonRePlace(brightonWindow *bwin)
 
389
{
 
390
        int id, flags;
 
391
        float x = 0, y = 0, w = 0, h = 0, scale = 1.0;
 
392
 
 
393
        for (id = 0; id < BRIGHTON_ITEM_COUNT; id++)
 
394
        {
 
395
                if (bwin->items[id].id > 0)
 
396
                {
 
397
                        scale = ((float) bwin->width) / ((float) bwin->items[id].scale);
 
398
                        flags = bwin->items[id].flags;
 
399
                        w = ((float) bwin->items[id].w) * scale;
 
400
                        h = ((float) bwin->items[id].h) * scale;
 
401
                        x = ((float) bwin->items[id].x) * scale;
 
402
                        y = ((float) bwin->items[id].y) * scale;
 
403
 
 
404
                        sprintf(tImage, "%s", bwin->items[id].image->name);
 
405
 
 
406
                        /* Remove this, it will result in the rest being repainted */
 
407
                        brightonRemove(bwin, id);
 
408
 
 
409
                        if (flags & BRIGHTON_LAYER_PLACE)
 
410
                                brightonPlace(bwin, &tImage[0], x, y, w, h);
 
411
                        else
 
412
                                brightonPut(bwin, &tImage[0], x, y, w, h);
 
413
                }
 
414
        }
 
415
 
 
416
        if (id == BRIGHTON_ITEM_COUNT)
 
417
                return(0);
 
418
 
 
419
        return(0);
 
420
}
 
421