[Scummvm-cvs-logs] CVS: scummvm/dc selector.cpp,1.4,1.5
Marcus Comstedt
marcus_c at users.sourceforge.net
Sun Feb 3 06:57:02 CET 2002
Update of /cvsroot/scummvm/scummvm/dc
In directory usw-pr-cvs1:/tmp/cvs-serv10056
Modified Files:
selector.cpp
Log Message:
Neato demo-effect when game selected. ;)
Index: selector.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/dc/selector.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** selector.cpp 2002/02/02 23:31:50 1.4
--- selector.cpp 2002/02/03 14:56:11 1.5
***************
*** 244,247 ****
--- 244,253 ----
}
+ static void drawBackground()
+ {
+ draw_solid_quad(20.0, 20.0, 620.0, 460.0,
+ 0xff0000, 0x00ff00, 0x0000ff, 0xffffff);
+ }
+
void waitForDisk()
{
***************
*** 266,273 ****
ta_begin_frame();
-
- draw_solid_quad(20.0, 20.0, 620.0, 460.0,
- 0xff0000, 0x00ff00, 0x0000ff, 0xffffff);
ta_commit_end();
--- 272,278 ----
ta_begin_frame();
+ drawBackground();
+
ta_commit_end();
***************
*** 287,294 ****
}
int gameMenu(Game *games, int num_games)
{
int top_game = 0, selector_pos = 0;
! int16 mousex = 0, mousey = 0;
if(!num_games)
--- 292,308 ----
}
+ static void drawGameLabel(Game &game, int pal, float x, float y,
+ unsigned int argb, int fade = 0, float scale = 1.0)
+ {
+ unsigned int fade_alpha = (255-fade)<<24;
+
+ game.icon.draw(x, y, x+32.0*scale, y+32.0*scale, pal, 0xffffff|fade_alpha);
+ game.label.draw(x+54.0*scale, y+4.0*scale, argb|fade_alpha, scale);
+ }
+
int gameMenu(Game *games, int num_games)
{
int top_game = 0, selector_pos = 0;
! int16 mousex = 0, mousey = 64;
if(!num_games)
***************
*** 302,307 ****
ta_begin_frame();
! draw_solid_quad(20.0, 20.0, 620.0, 460.0,
! 0xff0000, 0x00ff00, 0x0000ff, 0xffffff);
ta_commit_end();
--- 316,320 ----
ta_begin_frame();
! drawBackground();
ta_commit_end();
***************
*** 310,315 ****
for(int i=top_game, cnt=0; cnt<10 && i<num_games; i++, cnt++) {
int pal = 48+(i&15);
- games[i].icon.set_palette(pal);
- games[i].icon.draw(50.0, y, 82.0, y+32.0, pal);
if(cnt == selector_pos)
--- 323,326 ----
***************
*** 317,323 ****
0x7000ff00, 0x7000ff00, 0x7000ff00, 0x7000ff00);
! games[i].label.draw(104.0, y+4.0, (cnt == selector_pos?
! 0xffffff00 : 0xffffffff));
!
y += 40.0;
}
--- 328,334 ----
0x7000ff00, 0x7000ff00, 0x7000ff00, 0x7000ff00);
! games[i].icon.set_palette(pal);
! drawGameLabel(games[i], pal, 50.0, y, (cnt == selector_pos?
! 0xffff00 : 0xffffff));
y += 40.0;
}
***************
*** 333,340 ****
setimask(mask);
! if(lmb || key==13 || key==319)
! return top_game + selector_pos;
! if(mousey>=16) {
if(selector_pos + top_game + 1 < num_games)
if(++selector_pos >= 10) {
--- 344,382 ----
setimask(mask);
! if(lmb || key==13 || key==319) {
! int selected_game = top_game + selector_pos;
! for(int fade=0; fade<=256; fade+=4) {
!
! unsigned int fade_colour = 0x00ffffff | ((255-fade)<<24);
!
! ta_begin_frame();
!
! drawBackground();
!
! ta_commit_end();
!
! float y = 40.0;
!
! if(fade < 256)
! for(int i=top_game, cnt=0; cnt<10 && i<num_games; i++, cnt++)
! if(cnt != selector_pos) {
! drawGameLabel(games[i], 48+(i&15), 50.0, y, 0xffffff, fade);
! y += 40.0;
! }
!
! y = (40.0/256.0 * (selector_pos + 1))*(256-fade) + 80.0/256.0*fade;
! float x = 50.0/256.0*(256-fade) + 160.0/256.0*fade;
! float scale = 1.0+9.0/256.0*fade;
!
! drawGameLabel(games[selector_pos], 48+(selected_game&15), x, y,
! 0xffff00, 0, scale);
!
! ta_commit_frame();
! }
! return selected_game;
! }
!
! if(mousey>=64+16) {
if(selector_pos + top_game + 1 < num_games)
if(++selector_pos >= 10) {
***************
*** 343,347 ****
}
mousey -= 16;
! } else if(mousey<=-16) {
if(selector_pos + top_game > 0)
if(--selector_pos < 0) {
--- 385,389 ----
}
mousey -= 16;
! } else if(mousey<=64-16) {
if(selector_pos + top_game > 0)
if(--selector_pos < 0) {
More information about the Scummvm-git-logs
mailing list