00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include "video_basic.h"
00012
00013 void NGT_Surface::draw(SDL_Surface *surf){
00014
00015 SDL_Rect destrect;
00016 destrect.x = x;
00017 destrect.y = y;
00018 printf("*NGT_Surface.draw: x=%i, y=%i\n", x, y);
00019 SDL_BlitSurface(surface, NULL, surf, &destrect);
00020 }
00021
00022
00023 int NGT_Surface::LoadIMG(char *filename){
00024 surface=IMG_Load(filename);
00025 if (surface==NULL){
00026 printf("*NGT_Surface.LoadIMG: ERROR Loading image file: '%s'\n",filename);
00027 return 1;
00028 }else{
00029
00030 printf("*NGT_Surface.LoadIMG: Loaded image file: '%s'\n",filename);
00031 return 0;
00032 }
00033 }
00034
00035
00036
00037
00038 SDL_Surface *NGT_SurfaceLoad(char* file)
00039 {
00040 return(IMG_Load(file));
00041 }
00042
00043
00044 void NNG_SurfaceDraw(SDL_Surface *screen, SDL_Surface *img, int x, int y)
00045 {
00046 SDL_Rect dest;
00047 dest.x = x;
00048 dest.y = y;
00049 SDL_BlitSurface(img, NULL, screen, &dest);
00050 }
00051
00052
00053 void NNG_SurfaceDraw(SDL_Surface *screen, SDL_Surface *img, int x, int y, int w, int h, int x2, int y2)
00054 {
00055 SDL_Rect dest;
00056 dest.x = x;
00057 dest.y = y;
00058 SDL_Rect dest2;
00059 dest2.x = x2;
00060 dest2.y = y2;
00061 dest2.w = w;
00062 dest2.h = h;
00063 SDL_BlitSurface(img, &dest2, screen, &dest);
00064 }