Removed un-needed count variable.
This commit is contained in:
		@@ -8,11 +8,8 @@
 | 
			
		||||
#include "menulist.h"
 | 
			
		||||
 | 
			
		||||
void menuListInit(menulist_t *ml, texture_t *texture) {
 | 
			
		||||
  uint8_t i;
 | 
			
		||||
 | 
			
		||||
  ml->x = 0;
 | 
			
		||||
  ml->y = 0;
 | 
			
		||||
  ml->count = 0;
 | 
			
		||||
 | 
			
		||||
  menuInit(&ml->menu);
 | 
			
		||||
  
 | 
			
		||||
@@ -29,7 +26,7 @@ uint8_t menuListAdd(menulist_t *ml, font_t *font, char *text) {
 | 
			
		||||
  menuitem_t *item;
 | 
			
		||||
 | 
			
		||||
  // Get the variables.
 | 
			
		||||
  i = ml->count;
 | 
			
		||||
  i = ml->menu.itemCount;
 | 
			
		||||
  label = ml->labels + i;
 | 
			
		||||
  ml->items[i] = text;
 | 
			
		||||
 | 
			
		||||
@@ -50,8 +47,7 @@ uint8_t menuListAdd(menulist_t *ml, font_t *font, char *text) {
 | 
			
		||||
  item->height = 1;
 | 
			
		||||
  item->x = 0;
 | 
			
		||||
  item->y = i;
 | 
			
		||||
 | 
			
		||||
  ml->count++;
 | 
			
		||||
  
 | 
			
		||||
  return i;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -81,7 +77,7 @@ void menuListRender(menulist_t *ml, shader_t *shader) {
 | 
			
		||||
  rectangleRender(&ml->selection, shader);
 | 
			
		||||
 | 
			
		||||
  // Render each label.
 | 
			
		||||
  for(i = 0; i < ml->count; i++) {
 | 
			
		||||
  for(i = 0; i < ml->menu.itemCount; i++) {
 | 
			
		||||
    label = ml->labels + i;
 | 
			
		||||
    label->x = FRAME_BORDER_SIZE;
 | 
			
		||||
    label->y = FRAME_BORDER_SIZE + i * FONT_LINE_HEIGHT * fontScale;
 | 
			
		||||
@@ -91,7 +87,7 @@ void menuListRender(menulist_t *ml, shader_t *shader) {
 | 
			
		||||
 | 
			
		||||
void menuListDispose(menulist_t *ml) {
 | 
			
		||||
  uint8_t i;
 | 
			
		||||
  for(i = 0; i < ml->count; i++) {
 | 
			
		||||
  for(i = 0; i < ml->menu.itemCount; i++) {
 | 
			
		||||
    labelDispose(ml->labels + i);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user