P: n/a | Right. I`m using Dev-Cpp, and I`m working on a game at this time in SDL (http://libsdl.org), and I`ve come across this error: ------------------------------------------ main.c: In function `SDL_main': main.c:140: error: stray '160' in program main.c:140: error: stray '160' in program main.c:140: error: stray '160' in program main.c:140: error: stray '160' in program make.exe: *** [main.o] Error 1 Execution terminated ------------------------------------------ Which halts my entire game development, and I`ve no idea whats wrong. Here`s the full source: (it`s messy, because I`ve tried to debug it a lot, ignore the commented statements and such) ------------------------------------------------------------------------------------------------- #include <stdio.h> #include <SDL/SDL.h> #include 'include/SDL_std.h' SDL_Surface *screen; SDL_Surface *image; void DrawIMG(SDL_Surface *img, int x, int y, int w, int h, int x2, int y2) { SDL_Rect dest; dest.x = x; dest.y = y; SDL_Rect dest2; dest2.x = x2; dest2.y = y2; dest2.w = w; dest2.h = h; SDL_BlitSurface(img, &dest2, screen, &dest); } void patchbg(int x, int y) { DrawIMG(image, 0, 0, 50, 50, x-2, y-2); } void ShowBMP(char *file, SDL_Surface *screen, int x, int y) { SDL_Rect dest; /* Load the BMP file into a surface */ image = SDL_LoadBMP(file); if ( image NULL ) { fprintf(stderr, 'Couldn't load %s: %sn', file, SDL_GetError()); return; } /* Blit onto the screen surface. The surfaces should not be locked at this point. */ dest.x = x; dest.y = y; dest.w = image->w; dest.h = image->h; SDL_BlitSurface(image, NULL, screen, &dest); /* Update the changed portion of the screen */ SDL_UpdateRects(screen, 1, &dest); } void blit_mb(x, y) { SDL_Surface *redblock; redblock = SDL_LoadBMP('data/meatball.bmp'); SDL_Rect source; source.x = x; source.y = y; source.w = 50; source.h = 50; SDL_Rect destination; destination.x = x; destination.y = y; destination.w = 50; destination.h = 50; SDL_SetColorKey(redblock,SDL_SRCCOLORKEY,SDL_MapRG B(redblock->format,255,255,255)); SDL_BlitSurface(redblock, &source, screen, &destination); } int main(int argc, char *argv[]) { if ( SDL_Init(SDL_INIT_AUDIO SDL_INIT_VIDEO) < 0 ) { printf('Unable to init SDL: %sn', SDL_GetError()); exit(1); } atexit(SDL_Quit); SDL_Surface *screen; screen=SDL_SetVideoMode(600,600,32,SDL_SWSURFACE S DL_DOUBLEBUF); if ( screen NULL ) { printf('Unable to set 640x480 video: %sn', SDL_GetError()); exit(1); } int xpos, ypos = 0; ShowBMP('data/logo.bmp', screen, 0, 0); //ShowBMP('data/meatball.bmp', screen, 0, 0); blit_mb(0, 0); int done=0; while(done 0) { SDL_Event event; while(SDL_PollEvent(&event)) { if(event.type SDL_QUIT) done = 1; if(event.type SDL_KEYDOWN) { if (event.key.keysym.sym SDLK_ESCAPE) done = 1; } Uint8* keys; keys = SDL_GetKeyState(NULL); if(keys[SDLK_UP]) ypos -= 5; if(keys[SDLK_DOWN]) ypos += 5; if(keys[SDLK_LEFT]) xpos -= 5; if(keys[SDLK_RIGHT]) xpos += 5; //ShowBMP('data/meatball.bmp', screen, xpos, ypos); blit_mb(xpos, ypos); SDL_UpdateRect(screen, 25, 25, xpos-25, ypos-25); //SDL_SetColorKey(image, SDL_SRCCOLORKEY, SDL_MapRGB(image->format, 255, 255, 255)); //patchbg(xpos, ypos); //ShowBMP('data/meatball.bmp', screen, x, y); //ShowBMP('data/logo.bmp', screen, 0, 0); //ShowBMP('data/meatball.bmp', screen, x, y); //SDL_Flip(screen); } } return 0; } ------------------------------------------------------------------------------------------------- Help would me much appreciated. Thanks.
|