Forum

Reducing the kludge in menu.c

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

Postby silverjoel » Sun May 01, 2011 10:11 pm

Baker wrote:
silverjoel wrote:Have you looked at the Quake 3 menu system?


I haven't, at least not the code. As far as menu systems go, I think Quake's menu system is rather effective, with one such an example of expanding it (ezQuake) taking it, in my opinion, a bit farther than it needed to go.

I'm kind of looking for a happy medium. But with one eye on making the code easy to maintain and modify.


I've been slowly putting the Quake 3 menu in DP. I pretty much have it implemented, but have to clean it up some. It seems like a nice way to go, at least for me. If you look at it, you want to check out ui_qmenu.c and ui_atoms.c. That is the base part of the menu system and each menu has it's own c file. I like it.
silverjoel
 
Posts: 51
Joined: Thu Sep 30, 2010 6:46 am

Postby Baker » Thu Jun 09, 2011 5:49 pm

mh wrote::D

Same realization some years ago (have a look at my menu_common.cpp), but it's uncanny when you think about it - that's really all that a menu actually is. Build a controls library around some drawing and input functions, add some event handlers and you're there. (Plus you'll be able to build new menus - and add new items to existing menus - really quickly, easily and safely).


Hehe, no kidding ...

// sound
menu_Sound.AddOption (new CQMenuCustomEnter (Menu_SoundCustomEnter));
menu_Sound.AddOption (new CQMenuCustomDraw (Menu_SoundCustomDraw));
menu_Sound.AddOption (new CQMenuBanner (&gfx_p_option_lmp));
menu_Sound.AddOption (new CQMenuTitle ("Sound Options"));
menu_Sound.AddOption (new CQMenuCvarSlider ("Music Volume", &bgmvolume, 0, 1, 0.05));
menu_Sound.AddOption (new CQMenuCvarSlider ("Sound Volume", &volume, 0, 1, 0.05));
menu_Sound.AddOption (new CQMenuSpacer (DIVIDER_LINE));
menu_Sound.AddOption (new CQMenuCvarSlider ("Clip Distance", &sound_nominal_clip_dist, 500, 2000, 100));
menu_Sound.AddOption (new CQMenuCvarSlider ("Ambient Level", &ambient_level, 0, 1, 0.05));
menu_Sound.AddOption (new CQMenuCvarSlider ("Ambient Fade", &ambient_fade, 50, 200, 10));


Was mostly taking a look at your in_win.cpp and decided to look at the menu stuffs.

I see RawInput stuffs in there, amongst other things.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Previous

Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest