Inside3D!
     

What's going on in the Nexuiz menu code

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
Swift



Joined: 26 Jan 2010
Posts: 44

PostPosted: Sun Apr 11, 2010 8:32 am    Post subject: What's going on in the Nexuiz menu code Reply with quote

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
View user's profile Send private message
Teiman



Joined: 03 Jun 2007
Posts: 309

PostPosted: Sun Apr 11, 2010 12:07 pm    Post subject: Reply with quote

could you post the .h file that define all these macros?
Back to top
View user's profile Send private message
Swift



Joined: 26 Jan 2010
Posts: 44

PostPosted: Sun Apr 11, 2010 1:49 pm    Post subject: Reply with quote

Googling provides:

http://dev.alientrap.org/projects/nexuiz/repository/revisions/7709/show/data/qcsrc/menu

Specfically for the header files:

http://dev.alientrap.org/projects/nexuiz/repository/revisions/7709/show/data/qcsrc/menu/oo
Back to top
View user's profile Send private message
Teiman



Joined: 03 Jun 2007
Posts: 309

PostPosted: Mon Apr 12, 2010 8:46 am    Post subject: Reply with quote

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
View user's profile Send private message
Swift



Joined: 26 Jan 2010
Posts: 44

PostPosted: Mon Apr 12, 2010 12:44 pm    Post subject: Reply with quote

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
View user's profile Send private message
leileilol



Joined: 15 Oct 2004
Posts: 1321

PostPosted: Mon Apr 12, 2010 1:26 pm    Post subject: Reply with quote

div0 and Black did the menu
Spike and timeserv did the compiler
I did absolutely nothing
_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group