Setting up a colorkey -> compiler-error

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@t-online.de (Marc Gerritzen)
To:
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

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

Don’t you miss some ‘;’ at the end of SDL_SetColorKey() ?On Sunday 16 May 2004 20:22, Marc Gerritzen wrote:

hello,
I have a problem concerning the Colorkeys.
SDL_SetColorKey(rotozoom, SDL_SRCCOLORKEY,
SDL_MapRGB(rotozoom->format, 255, 255, 255)) //copy the rotated image to

error: Failed to pase before token (

it refers to the line after the colorkey-line

OMG!!!
Thank you for helping me :slight_smile: . I think I need some glasses.
Sorry for asking such a dumb question. But I really didn’t find the error … heheOn Sun, 16 May 2004 15:47:34 +0100 “John Silicon” wrote:

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:
Sent: Sunday, May 16, 2004 9:22 PM
Subject: [SDL] Setting up a colorkey -> compiler-error

Well, it’s not like your average C compiler is too helpful when it
comes to that kind of typos… I’ve seen compilers generally freak
out and even crash because of a single missing semicolon! hehe

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se —On Monday 17 May 2004 07.29, Marc Gerritzen wrote:

On Sun, 16 May 2004 15:47:34 +0100 “John Silicon” wrote:

OMG!!!
Thank you for helping me :slight_smile: . I think I need some glasses.
Sorry for asking such a dumb question. But I really didn’t find the
error … hehe