hello all,
i realised my mistake in the DATA PREFIX i gave the wrong path ,
it shud have been *"/images/backgrounds/icon.png"* instead of *
"images/background/icon.png"*
so , i will submit a patch soon for this fixme..
regards
akash gangil
---------- Forwarded message ----------
From: akash gangil <akashg1611@...>
Date: Thu, Mar 26, 2009 at 6:25 AM
Subject: need help..
To: tuxpaint-devel@...
hello all,
I was just trying on a FIXME which wanted to change the background in the
hall of fame in tuxmath to an image of a trophy...
Considering , it as a nice way to pratically go thru the code..
i decided to go for it...
and whew! i learned a lot..(thnx kendrick)
i decided to pick an arbitary image , first for my attempt.
then i saved that image in images/background in the trunk..
now , the changes that i made to the files r along with the patches that r
needed to achieve it.
*1. I simple added the enum entry for the new image.*
akash@...$ diff -u fileops.h nfileops.h
--- fileops.h 2009-03-26 06:10:01.000000000 +0530
+++ nfileops.h 2009-03-26 06:08:03.000000000 +0530
@@ -27,7 +27,7 @@
/* Names for images (formerly in images.h) */
enum {
-
+ IMG_BAT,
IMG_STANDBY,
IMG_MENU_BKG,
IMG_MENU_TITLE,
*2. then i added the data prefix to the images array.*
akash@...$ diff -u fileops_media.c
nfileops_media.c--- fileops_media.c 2009-03-26 06:11:15.000000000 +0530
+++ nfileops_media.c 2009-03-26 06:07:17.000000000 +0530
@@ -22,7 +22,7 @@
int i;
static char* image_filenames[NUM_IMAGES] = {
-
+ DATA_PREFIX "/images/background/icon.png",
DATA_PREFIX "/images/status/standby.png",
DATA_PREFIX "/images/title/menu_bkg.jpg",
DATA_PREFIX "/images/title/title1.png",
*
3.the final step was to try it anywhere ( i was just testing if it works,
only then proceed with the rt material)
*
akash@...$ diff -u highscore.c nhighscore.c---
highscore.c 2009-03-26 06:12:50.000000000 +0530
+++ nhighscore.c 2009-03-26 06:08:23.000000000 +0530
@@ -176,6 +176,9 @@
SDL_BlitSurface( current_bkg(), NULL, screen, NULL );
/* FIXME maybe add image of trophy or similar pic */
/* Draw Tux: */
+ if(images[IMG_BAT])
+ SDL_BlitSurface(images[IMG_BAT], NULL, screen, NULL);
+
if (Tux && Tux->frame[0]) /* make sure sprite has at least one frame
*/
SDL_BlitSurface(Tux->frame[0], NULL, screen, &TuxRect);
/* Draw controls: */
*But I got the following error
*
Error: I couldn't load a graphics file:
/usr/local/share/tuxmath/images/background/icon.png
The Simple DirectMedia error that occured was:
Couldn't open /usr/local/share/tuxmath/images/background/icon.png
that shows it isnt able to load the image data..
can somebody plz. guide me as to where i made a mistake..
this is the 1st time i hv tried to fiddle with the tuxmath src code..
so, pardon me for any stupidity...
but i must say it gave me a preview of most of the files.
regards
akash gangil.
|