Forum

PSP Tutorial: Add r_dithering (like DQuake)

Post tutorials on how to do certain tasks within game or engine code here.

Moderator: InsideQC Admins

PSP Tutorial: Add r_dithering (like DQuake)

Postby Baker » Fri Feb 24, 2012 4:45 am

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 ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Return to Programming Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest