Skip to content

Commit

Permalink
Change selection icon for menus to be apple logo.
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/tkieft/code/SVN/snake/trunk@71 2d1a4ccd-f515-0410-a99d-d1a2ee3908d6
  • Loading branch information
tkieft committed Jun 13, 2007
1 parent b6c6d68 commit 2366f9f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
11 changes: 9 additions & 2 deletions Snake/Menu.cpp
Expand Up @@ -6,6 +6,7 @@
* Copyright 2006 Tyler Kieft. All rights reserved.
*
* CHANGE LOG:
* 13Jun07 TDK Change selection indicator to be apple from game.
* 3Nov06 TDK Reset method.
* 3Nov06 TDK Fool around with colors.
* 3Nov06 TDK Draw smaller black rectangle so background is shown.
Expand All @@ -25,13 +26,17 @@ Menu::Menu( string theTitle, string rsrcPath ) : options() {
textColor.r = 0x07; textColor.g = 0x7E; textColor.b = 0x41;
textSelectedColor.r = 0xFB; textSelectedColor.g = 0xFF; textSelectedColor.b = 0x00;
bgColor.r = 0x00; bgColor.g = 0x00; bgColor.b = 0x00;

apple = load_image( rsrcPath + "apple.bmp", 0xFF, 0x00, 0xFF );
}

Menu::~Menu() {
for( int i = 0; i < numOptions; i++ )
delete options[i];

TTF_CloseFont( theFont );

SDL_FreeSurface( apple );
}

void Menu::addOption( string newOption ) {
Expand Down Expand Up @@ -152,7 +157,8 @@ void Menu::drawSelectableOption( SGameEngine* game, int q, int yofs )
where.y += 12;
where.w = 12;
where.h = 12;
SDL_FillRect( game->screen, &where, SDL_MapRGB( game->screen->format, textSelectedColor.r, textSelectedColor.g, textSelectedColor.b));
//SDL_FillRect( game->screen, &where, SDL_MapRGB( game->screen->format, textSelectedColor.r, textSelectedColor.g, textSelectedColor.b));
SDL_BlitSurface( apple, NULL, game->screen, &where );
}
SDL_FreeSurface( fontSurface );
}
Expand Down Expand Up @@ -180,7 +186,8 @@ void Menu::drawOption( SGameEngine* game, int q, int yofs )
where2.y += 12;
where2.w = 12;
where2.h = 12;
SDL_FillRect( game->screen, &where2, SDL_MapRGB( game->screen->format, textSelectedColor.r, textSelectedColor.g, textSelectedColor.b));
//SDL_FillRect( game->screen, &where2, SDL_MapRGB( game->screen->format, textSelectedColor.r, textSelectedColor.g, textSelectedColor.b));
SDL_BlitSurface( apple, NULL, game->screen, &where2 );
}
where.x += 30 + fSurfaces[i]->w;
SDL_FreeSurface( fSurfaces[i] );
Expand Down
2 changes: 2 additions & 0 deletions Snake/Menu.h
Expand Up @@ -38,6 +38,8 @@ class Menu {
SDL_Color textColor;
SDL_Color textSelectedColor;
SDL_Color bgColor;

SDL_Surface *apple;

void drawSelectableOption( SGameEngine* game, int q, int yofs );
void drawOption( SGameEngine* game, int q, int yofs );
Expand Down
6 changes: 3 additions & 3 deletions Snake/Snake.xcodeproj/tkieft.pbxuser
Expand Up @@ -373,7 +373,7 @@
06D789940BDAE7B3005505FB /* Credits.rtf */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {863, 665}}";
sepNavSelRange = "{0, 146}";
sepNavSelRange = "{26, 0}";
sepNavVisRect = "{{0, 0}, {863, 665}}";
sepNavWindowFrame = "{{15, 48}, {908, 779}}";
};
Expand Down Expand Up @@ -624,8 +624,8 @@
PBXFileDataSource_Warnings_ColumnID,
);
};
PBXPerProjectTemplateStateSaveDate = 198894001;
PBXWorkspaceStateSaveDate = 198894001;
PBXPerProjectTemplateStateSaveDate = 203470699;
PBXWorkspaceStateSaveDate = 203470699;
};
sourceControlManager = 063E7B720A3C84C9005C4507 /* Source Control */;
userBuildSettings = {
Expand Down

0 comments on commit 2366f9f

Please sign in to comment.