~michael.rawson/tuxpoker/trunk

« back to all changes in this revision

Viewing changes to util/blit.cpp

  • Committer: Michael Rawson
  • Date: 2012-05-05 18:41:48 UTC
  • Revision ID: michaelrawson76@gmail.com-20120505184148-48x1bricescln3xd
More fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#include <SDL/SDL.h>
2
2
#include <cassert>
 
3
#include <iostream>
 
4
 
 
5
#include "entity.h"
3
6
#include "constant.h"
4
7
 
5
8
//applies a surface to another-utility for blitting stuff
15
18
        assert(source != NULL && destination != NULL);
16
19
        
17
20
        //check blitting is within boundaries of screen
18
 
        assert(x <= constants::SCREEN_WIDTH && y <= constants::SCREEN_HEIGHT);
 
21
        //assert(x <= constants::SCREEN_WIDTH && y <= constants::SCREEN_HEIGHT);
19
22
        
20
23
        //apply source to destination, with co-ordinates temp_pos.
21
24
        SDL_BlitSurface(source, NULL, destination, &temp_pos);
33
36
        //blit!
34
37
        SDL_BlitSurface(source, NULL, screen, &temp_pos);
35
38
}
 
39
 
 
40
void apply_entity(entity* in_entity, SDL_Surface* screen) {
 
41
        assert(in_entity->texture != NULL && screen != NULL);
 
42
        
 
43
        SDL_BlitSurface(in_entity->texture, NULL, screen, &in_entity->coverage);
 
44
}
36
45