Advertisement
Guest User

Untitled

a guest
Mar 27th, 2009
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. I have written a patch to the FIXME , changing the background to a trophy image in the hall of fame in tuxmath..
  2.  
  3. firstly , save that image in the trunk say /images/backgrounds/
  4.  
  5. 1. I simple added the enum entry for the new image.
  6.  
  7. *********************i have added that entry as IMG_BAT********************
  8.  
  9. this is the patch for this file:
  10.  
  11. PATCH:
  12.  
  13. akash@akash-laptop:~/tuxmath/
  14. trunk/src$ diff -u fileops.h nfileops.h
  15. --- fileops.h 2009-03-26 06:10:01.000000000 +0530
  16. +++ nfileops.h 2009-03-26 06:08:03.000000000 +0530
  17. @@ -27,7 +27,7 @@
  18.  
  19. /* Names for images (formerly in images.h) */
  20. enum {
  21. -
  22. + IMG_BAT,
  23. IMG_STANDBY,
  24. IMG_MENU_BKG,
  25. IMG_MENU_TITLE,
  26.  
  27. 2. then i added the data prefix to the images array.
  28.  
  29. then i added it's data prefix in fileops_media.c , say if my image is icon.png.....then i ll write /images/backgrounds/icon.png
  30.  
  31.  
  32. PATCH:
  33. akash@akash-laptop:~/tuxmath/trunk/src$ diff -u fileops_media.c nfileops_media.c--- fileops_media.c 2009-03-26 06:11:15.000000000 +0530
  34. +++ nfileops_media.c 2009-03-26 06:07:17.000000000 +0530
  35. @@ -22,7 +22,7 @@
  36. int i;
  37.  
  38. static char* image_filenames[NUM_IMAGES] = {
  39. -
  40. + DATA_PREFIX "/images/backgrounds/icon.png",
  41. DATA_PREFIX "/images/status/standby.png",
  42. DATA_PREFIX "/images/title/menu_bkg.jpg",
  43. DATA_PREFIX "/images/title/title1.png",
  44.  
  45.  
  46.  
  47. 3.the final step was to try it anywhere ( i was just testing if it works, only then proceed with the rt material)
  48.  
  49.  
  50. then i just blit(block image transfer )that image on the background....
  51.  
  52.  
  53. PATCH:
  54. akash@akash-laptop:~/tuxmath/trunk/src$ diff -u highscore.c nhighscore.c--- highscore.c 2009-03-26 06:12:50.000000000 +0530
  55. +++ nhighscore.c 2009-03-26 06:08:23.000000000 +0530
  56. @@ -176,6 +176,9 @@
  57. SDL_BlitSurface( current_bkg(), NULL, screen, NULL );
  58. /* FIXME maybe add image of trophy or similar pic */
  59. /* Draw Tux: */
  60. + if(images[IMG_BAT])
  61. + SDL_BlitSurface(images[IMG_BAT], NULL, screen, NULL);
  62. +
  63. if (Tux && Tux->frame[0]) /* make sure sprite has at least one frame */
  64. SDL_BlitSurface(Tux->frame[0], NULL, screen, &TuxRect);
  65. /* Draw controls: */
  66.  
  67.  
  68.  
  69.  
  70.  
  71. this way it is possible to change the background image the hall of fame....
  72.  
  73.  
  74. So, here i completed my first FIXME ,
  75. ll try to FIX more like those..
  76.  
  77.  
  78.  
  79. regards
  80. akash gangil
  81.  
  82.  
  83.  
  84.  
  85.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement