| View previous topic :: View next topic |
| Author |
Message |
Draik
Joined: 26 Jul 2008 Posts: 71
|
Posted: Fri Dec 18, 2009 6:05 am Post subject: Mysterious C++/SDL error |
|
|
Right, so I'm writing a Crystal Caves level editor, and it's written in C++ using SDL (Win32 with MinGW, in case it helps). And for some reason it won't compile this perfectly reasonable line of code:
| Code: | | screen = SDL_SetVideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP, SDL_SWSURFACE) |
I'm using the latest version of SDL. It comes out with
| Code: | D:\Stuff\ccleved\main.cpp:17: error: expected primary-expression before '=' token
D:\Stuff\ccleved\main.cpp:17: error: expected primary-expression before ',' token
|
about 3 times, finishing with
| Code: | | D:\Stuff\ccleved\main.cpp:17: error: expected `;' before ')' token |
That's the offending line of code above. I haven't missed any closing brackets or semicolons on previous lines, and screen is a pointer to an SDL_Surface. What the heck is wrong? |
|
| Back to top |
|
 |
CommanderSpleen

Joined: 31 Aug 2003 Posts: 898 Location: The Land of Sparkly Things
|
Posted: Fri Dec 18, 2009 7:41 am Post subject: |
|
|
How is that screen variable defined? I deal with Allegro, so SDL is outside of my experience.
You are missing a semicolon at the end of the statement. But the rest looks fine. The screen part at the beginning seems to be the problem. Are you sure you need to apply the return value of SDL_SetVideoMode to it? |
|
| Back to top |
|
 |
Draik
Joined: 26 Jul 2008 Posts: 71
|
Posted: Fri Dec 18, 2009 8:13 am Post subject: |
|
|
| Well, it's not the semicolon. But yes, SDL_SetVideoMode returns a pointer to an SDL_Surface. I'll just rewrite the code from scratch, and see if that fixes it. :P |
|
| Back to top |
|
 |
levellass
Joined: 11 Oct 2006 Posts: 1404 Location: Ngaruawahia New Zealand
|
Posted: Fri Dec 18, 2009 12:13 pm Post subject: |
|
|
| Interesting. I take it you found the level data. However, since it's in the executable, does this mean all the levels cannot be larger in size than the originals, or did you find a way around this? |
|
| Back to top |
|
 |
KeenRush Patch Maker

Joined: 31 Aug 2003 Posts: 2036 Location: Sand Yego
|
Posted: Fri Dec 18, 2009 9:47 pm Post subject: |
|
|
I think every level in CC has the exactly same size -- I don't think the dimensions even can be changed.
By the way, it's about time there'll be an editor for this game, definitely going to use it. :) |
|
| Back to top |
|
 |
Draik
Joined: 26 Jul 2008 Posts: 71
|
Posted: Fri Dec 18, 2009 10:15 pm Post subject: |
|
|
| lemm found it, the discussion page for CC at the ModdingWiki has his findings. And yeah, the dimensions are fixed (as in, unchangeable, not hacked so we can change level size). |
|
| Back to top |
|
 |
levellass
Joined: 11 Oct 2006 Posts: 1404 Location: Ngaruawahia New Zealand
|
Posted: Tue Dec 22, 2009 4:23 am Post subject: |
|
|
Aaah, I see now. So the levels are uncompressed and of a fixed size, which would make editing easier. I was worried they would be compressed or of variable size, which would mean there was a 'limit' you couldn't exceed.
I would be interested in the progress of this project. I have coded a small program to edit the fullscreen images, which I haven't seen anywhere else if you want to add that to your editor code (The modding wiki has the PCX format now.) which should allow full graphical modding now. |
|
| Back to top |
|
 |
gerstrong
Joined: 25 Jan 2009 Posts: 51
|
Posted: Sat Jul 31, 2010 4:17 pm Post subject: Re: Mysterious C++/SDL error |
|
|
| Draik wrote: | Right, so I'm writing a Crystal Caves level editor, and it's written in C++ using SDL (Win32 with MinGW, in case it helps). And for some reason it won't compile this perfectly reasonable line of code:
| Code: | | screen = SDL_SetVideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP, SDL_SWSURFACE) |
I'm using the latest version of SDL. It comes out with
| Code: | D:\Stuff\ccleved\main.cpp:17: error: expected primary-expression before '=' token
D:\Stuff\ccleved\main.cpp:17: error: expected primary-expression before ',' token
|
about 3 times, finishing with
| Code: | | D:\Stuff\ccleved\main.cpp:17: error: expected `;' before ')' token |
That's the offending line of code above. I haven't missed any closing brackets or semicolons on previous lines, and screen is a pointer to an SDL_Surface. What the heck is wrong? |
Guess I come too late with that, but if you ask me, it's the missing semicolon at the end. Maybe you can show me the source code. I have good knowledge about SDL. |
|
| Back to top |
|
 |
|