Commits

volca  committed d3a19cf

* Fix for rendering problems caused by CLUT alpha setting change

  • Participants
  • Parent commits 24439e7

Comments (0)

Files changed (3)

File src/renderman.c

 	if (!rmPrepareTexture(q->txt)) // won't render if not ready!
 		return;
 
-	if (q->txt->PSM == GS_PSM_CT32 || q->txt->ClutPSM == GS_PSM_CT32)
+	if ((q->txt->PSM == GS_PSM_CT32) || 
+		(q->txt->Clut && q->txt->ClutPSM == GS_PSM_CT32))
+	{
 		gsKit_set_primalpha(gsGlobal, gDefaultAlpha, 0);
+	}
 	
 	gsKit_prim_sprite_texture(gsGlobal, q->txt, q->ul.x + transX, q->ul.y + transY, q->ul.u,
 		q->ul.v, q->br.x + transX, q->br.y + transY, q->br.u, q->br.v, order, q->color);
 	order++;
-	gsKit_set_primalpha(gsGlobal, GS_BLEND_BACK2FRONT, 0);
+	
+	gsKit_set_primalpha(gsGlobal, GS_BLEND_BACK2FRONT, 0);	
 }
 
 /** If txt is null, don't use DIM_UNDEF size ! */

File src/texcache.c

 	if(texture->Mem != NULL) {
 		free(texture->Mem);
 		texture->Mem = NULL;
+		texture->ClutPSM = 0;
 		texture->Clut = NULL;
 		texture->Vram = 0;
 		texture->VramClut = 0;

File src/textures.c

 
 void texPrepare(GSTEXTURE* texture, short psm) {
 	texture->PSM = psm;
+	texture->ClutPSM = 0;
 	texture->Filter = GS_FILTER_LINEAR;
 	texture->Mem = NULL;
 	texture->Vram = 0;