With cordite in the air, splintered steel, shell casings and powder burns, there’s only one explanation...
Discuss & improve the game engine.

Moderators: sparcdr, torhu, Tequila

Use SMOKINGUNS define with release 77

Postby Tequila » Thu Jan 08, 2009 3:34 am

Hi,

as you know, I started to backport Smokin'Guns engine to ioQ3 SDK. In that way, I think it's important to keep common code to have the backport work as easy as possible. A big problem in the current code is that many original part has been commented out in so different way... I will have to read again almost all the code... Then I will try to reconciliate as many lines as possible and I need a tool. I decided that tool will be the SMOKINGUNS define. You still can see in code/cgame/cg_players.c in which way I can use it with #ifdef or #ifndef.

In the same way, I decided to rename the WQ3 define in SMOKINGUNS_SO define.

Then for the windows build, sparcdr, you will have to add -DSMOKINGUNS for all sources and replace -DWQ3 by -DSMOKINGUNS_SO for the client libraries build.

What do you think ?

PS: You know my english is almost poor... if you didn't understand tell me what you understood and I will try to be more clear... sorry I'm just a froggy :D
User avatar
Tequila
SG Team
 
Posts: 1100
Joined: Thu Nov 15, 2007 11:33 pm
Location: Montpellier, France



Re: Use SMOKINGUNS define with release 77

Postby torhu » Sat Jan 10, 2009 2:12 pm

Nothing like cleaning out some old cruft. :) It looks like most occurrences of "#if defined SMOKINGUNS_SO || defined Q3_VM" could be replaced with just "#ifdef SMOKINGUNS_SO". Should make it clearer what's what. I can look into that later today, just don't have commit access yet.

Are you planning to use SMOKINGUNS for the engine code too?


To recap what those defines mean, while it's still clear in my head:

SMOKINGUNS = SG specific code, currently only used in the mod part.

SMOKINGUNS_SO = Used in the files that are common to both engine and mod parts, to keep SG mod specific stuff out of engine builds. The changed layout of playerState_t in q_shared.h is a good example of this.
In game: =SG=monSter
Monster Browser
User avatar
torhu
SG Team
 
Posts: 1125
Joined: Thu Jan 06, 2005 8:12 pm
Location: Norway



Postby Tequila » Sun Jan 11, 2009 9:34 pm

Hi torhu,

not exactly, Q3_VM is defined when you are building mod game as QVM, and when you are building mod game as binary, that's SMOKINGUNS_SO which now defined. I mean by mod game all the game logic in cgam, game & ui folder.

Then, SMOKINGUNS will have to be used everywhere we have a difference with ioQ3 engine. You should consider SMOKINGUNS define as the SDK magic define which identify Smokin' Guns specificities. We could also use a STANDALONE define but I think we can just use SMOKINGUNS.

Actually, if you just use SMOKINGUNS in place of SG_SO || Q3_VM you just break the game logic... I still don't understand where...
User avatar
Tequila
SG Team
 
Posts: 1100
Joined: Thu Nov 15, 2007 11:33 pm
Location: Montpellier, France



Postby torhu » Sun Jan 11, 2009 11:15 pm

I probably didn't make myself clear, I'll try again. :)

What I meant was that most places where "#if defined SMOKINGUNS_SO || defined Q3_VM" are used are really just SG mod code, not code specific to qvms. Maybe Spoon just built qvm files at first, using Q3_VM as an easy way to mark wq3 code. When he start building dlls, defining Q3_VM would break the build, so he just added WQ3 too, which made Q3_VM redundant in those cases.

Edit: I should mention that SMOKINGUNS_SO is never used by itself, but always combined with Q3_VM.
In game: =SG=monSter
Monster Browser
User avatar
torhu
SG Team
 
Posts: 1125
Joined: Thu Jan 06, 2005 8:12 pm
Location: Norway



Postby Tequila » Mon Jan 12, 2009 12:20 am

Maybe I'm not clear enough too ;)

"#if defined SMOKINGUNS_SO || defined Q3_VM" is only used in few shared header.
Q3_VM is only defined with QVM build & SMOKINGUNS_SO is only defined for library builds (dlls if you prefer). If you replace SMOKINGUNS_SO by SMOKINGUNS, you will break somewhere the engine part (not dll)... Maybe that's bug, maybe not, I'm not totally confident with such kind of problem. So we can't just replace SMOKINGUNS_SO with SMOKINGUNS... we need the two defines.

I agree we you on one point, we can add the SMOKINGUNS_SO on QVM builds and remove Q3_VM on the lines where there is redundancy. But then I would prefer another name... would you propose another one ? maybe SMOKINGUNS_GAME ? or SG_MOD ? SG_GAME ?
User avatar
Tequila
SG Team
 
Posts: 1100
Joined: Thu Nov 15, 2007 11:33 pm
Location: Montpellier, France



Re: Use SMOKINGUNS define with release 77

Postby torhu » Mon Jan 12, 2009 12:49 am

torhu wrote:Nothing like cleaning out some old cruft. :) It looks like most occurrences of "#if defined SMOKINGUNS_SO || defined Q3_VM" could be replaced with just "#ifdef SMOKINGUNS_SO"
8O ... :roll: ... :lol: Looks like we wasted some time there... :D

Maybe renaming SMOKINGUNS_SO to SG_MOD_ONLY would be an idea. So it doesn't look too much like SMOKINGUNS. Only if we actually remove the Q3_VM abuse, that is. No big deal, just a source of confusion for new contributors.
In game: =SG=monSter
Monster Browser
User avatar
torhu
SG Team
 
Posts: 1125
Joined: Thu Jan 06, 2005 8:12 pm
Location: Norway



Postby Tequila » Mon Jan 12, 2009 1:04 am

:D
In fact I just saw your update on windows builds and I saw you have used Q3_VM & SMOKINGUNS_SO at the same time so I understand now your point of vue. In the Conscript scripts, I'm not using Q3_VM and SMOKINGUNS_SO at the same time. I just use SMOKINGUNS_SO when Q3_VM is not define on the Dlls build.

I saw also you forget to remove a WQ3 on ui.vcproj :D, not a big deal as it is not more used...

The important thing I wanted anybody noticed if the use of SMOKINGUNS define anywhere to keep sources as clean as possible when porting it back to ioQ3 SDK.
Then the discussion should have removed any confusion for new contributors. That's the good news ;)
User avatar
Tequila
SG Team
 
Posts: 1100
Joined: Thu Nov 15, 2007 11:33 pm
Location: Montpellier, France




Return to Code

Show Sidebar
Show Sidebar

User Control Panel

cron