View previous topic :: View next topic |
Author |
Message |
Swift
Joined: 26 Jan 2010 Posts: 44
|
Posted: Sun Apr 11, 2010 8:32 am Post subject: What's going on in the Nexuiz menu code |
|
|
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? : ) |
|
Back to top |
|
 |
Teiman
Joined: 03 Jun 2007 Posts: 309
|
Posted: Sun Apr 11, 2010 12:07 pm Post subject: |
|
|
could you post the .h file that define all these macros? |
|
Back to top |
|
 |
Swift
Joined: 26 Jan 2010 Posts: 44
|
|
Back to top |
|
 |
Teiman
Joined: 03 Jun 2007 Posts: 309
|
Posted: Mon Apr 12, 2010 8:46 am Post subject: |
|
|
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. |
|
Back to top |
|
 |
Swift
Joined: 26 Jan 2010 Posts: 44
|
Posted: Mon Apr 12, 2010 12:44 pm Post subject: |
|
|
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 |
|
Back to top |
|
 |
leileilol

Joined: 15 Oct 2004 Posts: 1321
|
Posted: Mon Apr 12, 2010 1:26 pm Post subject: |
|
|
div0 and Black did the menu
Spike and timeserv did the compiler
I did absolutely nothing _________________
 |
|
Back to top |
|
 |
|