Loading pictures into the HUD - FAIL?


(IgelHaut) #1

Hello,
I am trying add a picture into the HUD, but everytime I am
getting a orange-black texture (texture not found).
I defined it already in cg_local.h:


qhandle_t	crosshair;

and cg_main.c:


cgs.media.crosshair = trap_R_RegisterShader( "images/2d/crosshair" );

and than i am trying to get the crosshair on the screen in cg_draw.c:


	hShader = cgs.media.crosshair;

	trap_R_DrawStretchPic( x + 0.5 * (cg.refdef_current->width - w), y + 0.5 * (cg.refdef_current->height - h), w, h, 0, 0, 1, 1, hShader );

Could you help me please?

Greet IgelHaut


(dutchmeat) #2

What does the almighty console say about that sprite ?


(IgelHaut) #3

“Couldn’t find image for shader”, but i packed it in a pk3-file
so, whats the problem?
the path is correct too…
Maybe CG_LoadingString(); ?


(aaa4) #4

sounds to me like a typical power of 2 problem. is your pic custom width/height or is that the original crosshair pic. maybe try take another.


(aaa4) #5

testtestjhkjhkj j hkjhkj


(IgelHaut) #6

Other pictures don’t get loaded too… :[


(IgelHaut) #7

Here a screenshot of the mod with the picture errors:


(IgelHaut) #8

if i dont pack the images in a pk3-file they are ok…


(dutchmeat) #9

With a power of 2 problem, console would say something like, could not load image, instead of could not find.

@IgelHaut,

  • Edit your posts, instead of a new reply
  • Check the image path, and compare it to other images in the source/ pk3’s

(dwe_flame) #10

exactly what dutchmeat says.
check the console when the game has started, when you start to scroll up, you probably will see some errormessages, they may even be colored red or yellow.
please check and let us know what the message says.
maybe even attach the specific pk3 to a reply here ?


(Scennative) #11

He has write:

cgs.media.crosshair = trap_R_RegisterShader( “images/2d/crosshair.tga” );

but these is right!

cgs.media.crosshair = trap_R_RegisterShader( “images/2d/crosshair” );

Without .tga :stuck_out_tongue: