[SDL] Setting up a colorkey -> compiler-error

John Silicon jsilicon at earthlink.net
Sun May 16 07:47:34 PDT 2004


Missing a ; on the colorkey line.
(You know, it always comes down to something like that, when you can't see
it and have to ask others, and makes you look foolish.  It's God's way of
punishing us Programmers [that and bladders too small to hold any more than
27 cups of coffee].).


----- Original Message -----
From: "Marc Gerritzen" <Marc.Gerritzen at t-online.de>
To: <sdl at libsdl.org>
Sent: Sunday, May 16, 2004 9:22 PM
Subject: [SDL] Setting up a colorkey -> compiler-error


> hello,
> I have a problem concerning the Colorkeys.
> I wanted to do a rotating logo in the left-lower-corner with the white
transparent.
> the code of the loop to do this:
>      //paint over the leften sdl-logos
>      SDL_FillRect(display,&drect,SDL_MapRGB(display->format, 0, 0, 0));
>      //turn the logo
>      rotozoom=rotozoomSurface(image, degree, 1, 0);
>      //srcrect
>      srect.x = 0;
>      srect.y = 0;
>      srect.w = rotozoom->w;
>      srect.h = rotozoom->h;
>
>      //where to paint?
>      drect.x = 0;
>      drect.y = 1024-(rotozoom->h);
>      drect.w = rotozoom->w;
>      drect.h = (rotozoom->h);
>
>      //set up the colorkey for white
>      SDL_SetColorKey(rotozoom, SDL_SRCCOLORKEY,
SDL_MapRGB(rotozoom->format, 255, 255, 255))
>      //copy the rotated image to the mainsurface
>      SDL_BlitSurface(rotozoom, &srect, display,&drect);
>      //updated the changed parts of the surface
>      SDL_UpdateRects(display,1,&drect);
>
>      //look that degree doesn't go over 360
>      if(degree>=360)
>      {
>        degree=0;
>      }
>      //slow down the rotation
>      SDL_Delay(50);
>
> but now I get an compiler-error (it compiles without the colorkey!):
> main.cpp:94: error: Fehler beim Parsen before `(' token
> in English:
> error: Failed to pase before token `(`
>
> it refers to the line after the colorkey-line
>
> tanks,
> Marc Gerritzen
>
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.677 / Virus Database: 439 - Release Date: 5/4/2004





More information about the SDL mailing list