Advertisement
xerpi

oslDrawFillCircle

Feb 14th, 2012
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.70 KB | None | 0 0
  1. void oslDrawFillCircle(int x, int y, float radius, OSL_COLOR color){
  2.     OSL_LINE_VERTEX *vertices;
  3.  
  4.     vertices = (OSL_LINE_VERTEX*)sceGuGetMemory(36 * sizeof(OSL_LINE_VERTEX));
  5.     color = oslBlendColor(color);
  6.     int i;
  7.     float angle;
  8.  
  9.     for (i = 0; i < 36; i++) {
  10.         angle = i * 10;
  11.         vertices[i].x = x + oslCos(angle, radius);
  12.         vertices[i].y = y + oslSin(angle, radius);
  13.         vertices[i].z = 0.0f;
  14.         vertices[i].color = color;
  15.     }
  16.     int wasEnable = osl_textureEnabled;
  17.     oslDisableTexturing();
  18.    
  19.     sceGuDrawArray(GU_TRIANGLE_FAN, GU_COLOR_8888|GU_VERTEX_16BIT|GU_TRANSFORM_2D, 36, 0, vertices);
  20.     sceKernelDcacheWritebackRange(vertices, 36 * sizeof(OSL_LINE_VERTEX)); //SAKYA
  21.     if(wasEnable) oslEnableTexturing();
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement