source: abuse/branches/lol/src/imlib/video.cpp @ 732

Last change on this file since 732 was 732, checked in by Sam Hocevar, 8 years ago

build: SDL2 compilation fixes.

  • Property svn:keywords set to Id
File size: 1.2 KB
Line 
1/*
2 *  Abuse - dark 2D side-scrolling platform game
3 *  Copyright (c) 1995 Crack dot Com
4 *  Copyright (c) 2005-2013 Sam Hocevar <sam@hocevar.net>
5 *
6 *  This software was released into the Public Domain. As with most public
7 *  domain software, no warranty is made or implied by Crack dot Com, by
8 *  Jonathan Clark, or by Sam Hocevar.
9 */
10
11#if HAVE_CONFIG_H
12#   include "config.h"
13#endif
14
15#include <stdlib.h>
16
17#include "common.h"
18
19#include "imlib/image.h"
20#include "imlib/video.h"
21
22void update_dirty(AImage *im, int xoff, int yoff)
23{
24    // make sure the image has the ability to contain dirty areas
25    ASSERT(im->m_special);
26
27    if (im->m_special->keep_dirt == 0)
28    {
29        put_image(im, xoff, yoff);
30    }
31    else
32    {
33        for (int i = 0; i < im->m_special->m_dirties.Count(); ++i)
34        {
35            ADirtyRect &rect = im->m_special->m_dirties[i];
36
37            put_part_image(im, xoff + rect.m_aa.x, yoff + rect.m_aa.y,
38                           rect.m_aa.x, rect.m_aa.y,
39                           rect.m_bb.x + 1, rect.m_bb.y + 1);
40        }
41
42        im->m_special->m_dirties.Resize(0);
43    }
44
45    UpdateScreen();
46}
47
48void put_image(AImage * im, int x, int y)
49{
50    put_part_image(im, x, y, 0, 0, im->Size().x - 1, im->Size().y - 1);
51}
52
Note: See TracBrowser for help on using the repository browser.