@@ -230,14 +230,14 @@ public static int getLabelHeight(FontRenderer fr, boolean fontShadow)
230
230
return fr .FONT_HEIGHT + (2 * vpad );
231
231
}
232
232
233
- private static void drawQuad (TextureImpl texture , float alpha , final double x , final double y , final double width , final double height , boolean flip , double rotation )
233
+ private static void drawQuad (TextureImpl texture , float alpha , final double x , final double y , final double width , final double height , boolean flip , double rotation , boolean linear )
234
234
{
235
- drawQuad (texture , x , y , width , height , rotation , null , alpha , flip , true , GL11 .GL_SRC_ALPHA , GL11 .GL_ONE_MINUS_SRC_ALPHA , false );
235
+ drawQuad (texture , x , y , width , height , rotation , null , alpha , flip , true , GL11 .GL_SRC_ALPHA , GL11 .GL_ONE_MINUS_SRC_ALPHA , false , linear );
236
236
}
237
237
238
238
private static void drawQuad (TextureImpl texture , final double x , final double y , final double width , final double height , boolean flip , double rotation )
239
239
{
240
- drawQuad (texture , x , y , width , height , rotation , null , 1f , flip , true , GL11 .GL_SRC_ALPHA , GL11 .GL_ONE_MINUS_SRC_ALPHA , false );
240
+ drawQuad (texture , x , y , width , height , rotation , null , 1f , flip , true , GL11 .GL_SRC_ALPHA , GL11 .GL_ONE_MINUS_SRC_ALPHA , false , true );
241
241
}
242
242
243
243
/**
@@ -252,7 +252,7 @@ private static void drawQuad(TextureImpl texture, final double x, final double y
252
252
* @param glBlendSfactor For normal alpha blending: GL11.GL_SRC_ALPHA
253
253
* @param glBlendDFactor For normal alpha blending: GL11.GL_ONE_MINUS_SRC_ALPHA
254
254
*/
255
- public static void drawQuad (TextureImpl texture , final double x , final double y , final double width , final double height , double rotation , Integer color , float alpha , boolean flip , boolean blend , int glBlendSfactor , int glBlendDFactor , boolean clampTexture )
255
+ public static void drawQuad (TextureImpl texture , final double x , final double y , final double width , final double height , double rotation , Integer color , float alpha , boolean flip , boolean blend , int glBlendSfactor , int glBlendDFactor , boolean clampTexture , boolean linear )
256
256
{
257
257
GL11 .glPushMatrix ();
258
258
@@ -277,8 +277,8 @@ public static void drawQuad(TextureImpl texture, final double x, final double y,
277
277
renderHelper .glColor4f (1 , 1 , 1 , alpha );
278
278
}
279
279
280
- renderHelper .glTexParameteri (GL11 .GL_TEXTURE_2D , GL11 .GL_TEXTURE_MIN_FILTER , GL11 .GL_LINEAR );
281
- renderHelper .glTexParameteri (GL11 .GL_TEXTURE_2D , GL11 .GL_TEXTURE_MAG_FILTER , GL11 .GL_LINEAR );
280
+ renderHelper .glTexParameteri (GL11 .GL_TEXTURE_2D , GL11 .GL_TEXTURE_MIN_FILTER , linear ? GL11 .GL_LINEAR : GL11 . GL_NEAREST );
281
+ renderHelper .glTexParameteri (GL11 .GL_TEXTURE_2D , GL11 .GL_TEXTURE_MAG_FILTER , linear ? GL11 .GL_LINEAR : GL11 . GL_NEAREST );
282
282
283
283
int texEdgeBehavior = clampTexture ? GL12 .GL_CLAMP_TO_EDGE : GL11 .GL_REPEAT ;
284
284
renderHelper .glTexParameteri (GL11 .GL_TEXTURE_2D , GL11 .GL_TEXTURE_WRAP_S , texEdgeBehavior );
@@ -388,9 +388,9 @@ public static void drawBoundTexture(double startU, double startV, double startX,
388
388
renderHelper .draw ();
389
389
}
390
390
391
- public static void drawImage (TextureImpl texture , double x , double y , boolean flip , float alpha , float scale , double rotation )
391
+ public static void drawImage (TextureImpl texture , double x , double y , boolean flip , float alpha , float scale , double rotation , boolean linear )
392
392
{
393
- drawQuad (texture , alpha , x , y , (texture .getWidth () * scale ), (texture .getHeight () * scale ), flip , rotation );
393
+ drawQuad (texture , alpha , x , y , (texture .getWidth () * scale ), (texture .getHeight () * scale ), flip , rotation , linear );
394
394
}
395
395
396
396
public static void drawImage (TextureImpl texture , double x , double y , boolean flip , float scale , double rotation )
@@ -405,17 +405,17 @@ public static void drawClampedImage(TextureImpl texture, double x, double y, flo
405
405
406
406
public static void drawClampedImage (TextureImpl texture , Integer color , double x , double y , float scale , float alpha , double rotation )
407
407
{
408
- drawQuad (texture , x , y , (texture .getWidth () * scale ), (texture .getHeight () * scale ), rotation , color , alpha , false , true , GL11 .GL_SRC_ALPHA , GL11 .GL_ONE_MINUS_SRC_ALPHA , true );
408
+ drawQuad (texture , x , y , (texture .getWidth () * scale ), (texture .getHeight () * scale ), rotation , color , alpha , false , true , GL11 .GL_SRC_ALPHA , GL11 .GL_ONE_MINUS_SRC_ALPHA , true , true );
409
409
}
410
410
411
411
public static void drawColoredImage (TextureImpl texture , int alpha , Integer color , double x , double y , float scale , double rotation )
412
412
{
413
- drawQuad (texture , x , y , (texture .getWidth () * scale ), (texture .getHeight () * scale ), rotation , color , alpha , false , true , GL11 .GL_SRC_ALPHA , GL11 .GL_ONE_MINUS_SRC_ALPHA , false );
413
+ drawQuad (texture , x , y , (texture .getWidth () * scale ), (texture .getHeight () * scale ), rotation , color , alpha , false , true , GL11 .GL_SRC_ALPHA , GL11 .GL_ONE_MINUS_SRC_ALPHA , false , true );
414
414
}
415
415
416
416
public static void drawColoredImage (TextureImpl texture , int alpha , Integer color , double x , double y , double rotation )
417
417
{
418
- drawQuad (texture , x , y , texture .getWidth (), texture .getHeight (), rotation , color , alpha , false , true , GL11 .GL_SRC_ALPHA , GL11 .GL_ONE_MINUS_SRC_ALPHA , false );
418
+ drawQuad (texture , x , y , texture .getWidth (), texture .getHeight (), rotation , color , alpha , false , true , GL11 .GL_SRC_ALPHA , GL11 .GL_ONE_MINUS_SRC_ALPHA , false , true );
419
419
}
420
420
421
421
/**
@@ -430,7 +430,7 @@ public static void drawColoredImage(TextureImpl texture, int alpha, Integer colo
430
430
*/
431
431
public static void drawEntity (double x , double y , double heading , boolean flipInsteadOfRotate , TextureImpl texture , float scale , double rotation )
432
432
{
433
- drawEntity (x , y , heading , flipInsteadOfRotate , texture , 1f , scale , rotation );
433
+ drawEntity (x , y , heading , flipInsteadOfRotate , texture , 1f , scale , rotation , true );
434
434
}
435
435
436
436
/**
@@ -443,7 +443,7 @@ public static void drawEntity(double x, double y, double heading, boolean flipIn
443
443
* @param flipInsteadOfRotate
444
444
* @param texture
445
445
*/
446
- public static void drawEntity (double x , double y , double heading , boolean flipInsteadOfRotate , TextureImpl texture , float alpha , float scale , double rotation )
446
+ public static void drawEntity (double x , double y , double heading , boolean flipInsteadOfRotate , TextureImpl texture , float alpha , float scale , double rotation , boolean linear )
447
447
{
448
448
// Adjust to scale
449
449
double width = (texture .getWidth () * scale );
@@ -454,12 +454,12 @@ public static void drawEntity(double x, double y, double heading, boolean flipIn
454
454
if (flipInsteadOfRotate )
455
455
{
456
456
boolean flip = (heading % 180 ) < 90 ;
457
- drawImage (texture , drawX , drawY , flip , alpha , scale , -rotation );
457
+ drawImage (texture , drawX , drawY , flip , alpha , scale , -rotation , linear );
458
458
}
459
459
else
460
460
{
461
461
// Draw texture in rotated position
462
- drawImage (texture , drawX , drawY , false , alpha , scale , heading );
462
+ drawImage (texture , drawX , drawY , false , alpha , scale , heading , linear );
463
463
}
464
464
}
465
465
0 commit comments