PSP Tutorial: Add r_dithering (like DQuake)

Post tutorials on how to do certain tasks within game or engine code here.
Post Reply
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

PSP Tutorial: Add r_dithering (like DQuake)

Post by Baker »

Tutorial is based off the DQuake engine implementation by crowbar. DQuake's home page is: http://pdquake.svn.sourceforge.net/


The short version:

Create a cvar called r_dithering. DQuake does it in video_hardware_screen.cpp

Code: Select all

cvar_t		r_dithering = {"r_dithering","1",true};
Register it somewhere. DQuake does it in video_hardware_screen.cpp in SCR_Init

Code: Select all

Cvar_RegisterVariable (&r_dithering);
In video_hardware.cpp, modify GL_BeginRendering ...

Code: Select all

extern cvar_t	r_dithering; // <----------------------------------------------  add me
void GL_BeginRendering (int *x, int *y, int *width, int *height)
{
	*x = 2048;
	*y = 2048;
	*width = screen_width;
	*height = screen_height;
	
	if (r_dithering.value)  // <--------------------------------------------- add me
		sceGuEnable(GU_DITHER);   // <--------------------------------------------- add me
	else   // <--------------------------------------------- add me
		sceGuDisable(GU_DITHER);
}
The end.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
Post Reply