Forum

What's going on in the Nexuiz menu code

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

What's going on in the Nexuiz menu code

Postby Swift » Sun Apr 11, 2010 8:32 am

Seriously. It's awesome. OO inheritance. I'm in awe.

With blocks like:
#ifdef INTERFACE
CLASS(NexuizWeaponsDialog) EXTENDS(NexuizDialog)
METHOD(NexuizWeaponsDialog, toString, string(entity))
METHOD(NexuizWeaponsDialog, fill, void(entity))
METHOD(NexuizWeaponsDialog, showNotify, void(entity))
ATTRIB(NexuizWeaponsDialog, title, string, "Weapon settings")
ATTRIB(NexuizWeaponsDialog, color, vector, SKINCOLOR_DIALOG_WEAPONS)
ATTRIB(NexuizWeaponsDialog, intendedWidth, float, 0.35)
ATTRIB(NexuizWeaponsDialog, rows, float, 16)
ATTRIB(NexuizWeaponsDialog, columns, float, 4)
ATTRIB(NexuizWeaponsDialog, weaponsList, entity, NULL)
ENDCLASS(NexuizWeaponsDialog)
#endif


Has anybody adapted it for vanilla Quake 1? : )
Swift
 
Posts: 60
Joined: Tue Jan 26, 2010 11:02 am

Postby Teiman » Sun Apr 11, 2010 12:07 pm

could you post the .h file that define all these macros?
Teiman
 
Posts: 309
Joined: Sun Jun 03, 2007 9:39 am

Postby Swift » Sun Apr 11, 2010 1:49 pm

Swift
 
Posts: 60
Joined: Tue Jan 26, 2010 11:02 am

Postby Teiman » Mon Apr 12, 2010 8:46 am

I don't fully understand it, withouth looking at the big picture. But looks sexy.

Anyway on file
root / data / qcsrc / menu / oo / constructors.h

This line:
22 #define ATTRIBARRAY(cname,name,type,cnt) me.name = me.name;

Is this right? looks weird that soo complex definition end on a inane code that does nothing.
Teiman
 
Posts: 309
Joined: Sun Jun 03, 2007 9:39 am

Postby Swift » Mon Apr 12, 2010 12:44 pm

I think it's a compiler macro.
Fteqcc does inheritance?
I damn wish this thing was properly documented. Who wrote it?
Last edited by Swift on Mon Apr 12, 2010 1:55 pm, edited 1 time in total.
Swift
 
Posts: 60
Joined: Tue Jan 26, 2010 11:02 am

Postby leileilol » Mon Apr 12, 2010 1:26 pm

div0 and Black did the menu
Spike and timeserv did the compiler
I did absolutely nothing
i should not be here
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest