r677 - trunk/game

black at icculus.org black at icculus.org
Mon Mar 13 17:27:57 EST 2006


Author: black
Date: 2006-03-13 17:27:57 -0500 (Mon, 13 Mar 2006)
New Revision: 677

Modified:
   trunk/game/m_menucore.h
Log:
Updated the member comment style (now I see them all).


Modified: trunk/game/m_menucore.h
===================================================================
--- trunk/game/m_menucore.h	2006-03-13 22:08:52 UTC (rev 676)
+++ trunk/game/m_menucore.h	2006-03-13 22:27:57 UTC (rev 677)
@@ -54,10 +54,13 @@
 {
 	Menu_Item super;
 
-	char *text;	//what to display (warning: it's a pointer, isn't freed, and isn't copied)
-	void *cookie;	//command is a misnomer, it should be used as a cookie for the text item
+	// what to display (warning: it's a pointer, isn't freed, and isn't copied)
+	char *text;
+	// command is a misnomer, it should be used as a cookie for the text item
+	void *cookie;
 
-	void (*UseItem) (struct Menu_TextItem *item, void *cookie);	//called when the user uses (clicks) this item
+	// called when the user uses (clicks) this item
+	void (*UseItem) (struct Menu_TextItem *item, void *cookie);
 }
 Menu_TextItem;
 
@@ -65,11 +68,16 @@
 {
 	Menu_Item super;
 
-	Nbool editable;	//user may type into the control
-	char *text;	//what it currently says
-	NUint cursorpos; //where the cursor is, set between 0 and strlen(text)
-	NSint scrollpos; //fixme
-	NUint maxchars;  //0 for unlimited
+	// user may type into the control
+	Nbool editable;
+	// what it currently says
+	char *text;
+	// where the cursor is, set between 0 and strlen(text)
+	NUint cursorpos;
+	// FIXME: this was empty (for VC7 task window use uppercase&':' please :-/)
+	NSint scrollpos;
+	// 0 for unlimited
+	NUint maxchars;
 
 	void (*ChangeEvent) (struct Menu_EditItem *item, char *newtext, void *cookie);
 }
@@ -77,22 +85,28 @@
 
 typedef struct Menu_ComboOption
 {
-	char *text;	//the text of the item
-	NSint ident;	//if you wish to assosiate an int key with the item.
+	// the text of the item
+	char *text;
+	// if you wish to assosiate an int key with the item.
+	NSint ident;
 	struct Menu_ComboOption *next;
 }
 Menu_ComboOption;
 
 typedef struct Menu_ComboItem
 {
-	Menu_EditItem super;	//this is one advantage of c++.
+	// TODO: use composition instead and initialize it properly with Edit_Create?
+	Menu_EditItem super;
 
-	struct Menu_ComboOption *options;	//a list of the current options
-	struct Menu_ComboOption *selected;	//set 
+	// a list of the current options
+	struct Menu_ComboOption *options;
+	// set
+	struct Menu_ComboOption *selected;
 
 	struct Menu_SubMenu *popup;
 
-	void (*ChangeEvent) (struct Menu_EditItem *item, char *newtext, NSint optionident, void *cookie);	//we use the ChangeEvent of the text item to set our 'selected' value
+	// we use the ChangeEvent of the text item to set our 'selected' value
+	void (*ChangeEvent) (struct Menu_EditItem *item, char *newtext, NSint optionident, void *cookie);
 }
 Menu_ComboItem;
 
@@ -101,9 +115,11 @@
 	Menu_Item super;
 
 	char *imagename;
-	void *cookie;	//console command when clicked
+	// console command when clicked
+	void *cookie;
 
-	void (*UseItem) (struct Menu_PictureItem *item, void *cookie);	//called when the user uses (clicks) this item
+	// called when the user uses (clicks) this item
+	void (*UseItem) (struct Menu_PictureItem *item, void *cookie);
 }
 Menu_PictureItem;
 
@@ -112,20 +128,28 @@
 	Menu_Item super;
 	NUint axis;
 
-	void *cookie;	//for custom stuff
-	Nfloat value;//set and used in the slider code
+	// for custom stuff
+	void *cookie;
+	// set and used in the slider code
+	Nfloat value;
 
-	Nfloat minv;//min value
-	Nfloat maxv;//max (can be inverted)
+	// min value
+	Nfloat minv;
+	// max (can be inverted)
+	Nfloat maxv;
 
-	Nfloat scale;//size of slider, in pixels.
+	// size of slider, in pixels
+	Nfloat scale;
 
-	//notification function
-	void (*SliderChanged) (struct Menu_SliderItem *slider, void *cookie);	//the user just changed the slider->value
-	void (*SliderUpdate) (struct Menu_SliderItem *slider, void *cookie);		//about to draw the slider's value, where you should feel free to update the value from external sources
+	// notification functions
+	// the user just changed the slider->value
+	void (*SliderChanged) (struct Menu_SliderItem *slider, void *cookie);
+	// about to draw the slider's value, where you should feel free to update the value from external sources
+	void (*SliderUpdate) (struct Menu_SliderItem *slider, void *cookie);
 
-	//internal
-	Nbool mousepressed; //adjust the slider with the mouse
+	// internal
+	// adjust the slider with the mouse
+	Nbool mousepressed;
 }
 Menu_SliderItem;
 
@@ -151,7 +175,7 @@
 
 
 
-//Entry points central to the menu's workings
+// entry points central to the menu's workings
 void Menu_Draw(void);
 void Menu_Frame(void);
 void Menu_Main(void);
@@ -160,7 +184,7 @@
 Nbool Menu_KeyEvent(NUint mod, NUint sym, NUint character, Nbool downevent);
 
 
-//Entry points for using the menu in other systems
+// entry points for using the menu in other systems
 Menu_SubMenu *Menu_SubMenu_Create(Menu_SubMenu *parent);
 Menu_SliderItem *Menu_VSlider_Create(Menu_SubMenu *parent, NSint x, NSint y, NUint w, NUint h, Nfloat minv, Nfloat maxv, Nfloat defaultv, void (*ChangeNotification)(Menu_SliderItem *item, void *cookie), void (*UpdateSlider)(Menu_SliderItem *item, void *cookie), void *cookie);//vertical scrolling bar
 Menu_SliderItem *Menu_HSlider_Create(Menu_SubMenu *parent, NSint x, NSint y, NUint w, NUint h, Nfloat minv, Nfloat maxv, Nfloat defaultv, void (*ChangeNotification)(Menu_SliderItem *item, void *cookie), void (*UpdateSlider)(Menu_SliderItem *item, void *cookie), void *cookie);//horizontal scrolling bar




More information about the neither-commits mailing list