starting rev 94, fixing some textMode issues, additions to the faq, toxi

code for tga leniancy
This commit is contained in:
benfry
2005-10-15 18:13:01 +00:00
parent 31af9c9246
commit 88efb88a38
7 changed files with 40 additions and 27 deletions
+2 -2
View File
@@ -50,8 +50,8 @@ import processing.core.*;
* files and images, etc) that comes from that.
*/
public class Base {
static final int VERSION = 93;
static final String VERSION_NAME = "0093 Beta";
static final int VERSION = 94;
static final String VERSION_NAME = "0094 Beta";
/**
* Path of filename opened on the command line,
+4 -3
View File
@@ -2749,11 +2749,12 @@ public class PApplet extends Applet
byte[] buffer = loadBytes(filename);
// check if it's a TGA and has 8bits/colour channel
if (buffer[2] == 2 && buffer[17] == 8) {
//if (buffer[2] == 2 && buffer[17] == 8) {
// [toxi20050929] changed format validation
// only number of bits/pixel are checked now...
if (buffer[2] == 2 && (buffer[16] == 24 || buffer[16]==32 )) {
// get image dimensions
//int w=(b2i(buffer[13])<<8) + b2i(buffer[12]);
int w = ((buffer[13] & 0xff) << 8) + (buffer[12] & 0xff);
//int h=(b2i(buffer[15])<<8) + b2i(buffer[14]);
int h = ((buffer[15] & 0xff) << 8) + (buffer[14] & 0xff);
// check if image has alpha
boolean hasAlpha=(buffer[16] == 32);
+15 -13
View File
@@ -1707,7 +1707,8 @@ public class PGraphics extends PImage implements PConstants {
throw new RuntimeException("use textFont() before textAscent()");
}
return textFont.ascent() * textSize;
return textFont.ascent() *
((textMode == SCREEN) ? textFont.size : textSize);
}
@@ -1718,7 +1719,8 @@ public class PGraphics extends PImage implements PConstants {
*/
public float textDescent() {
if (textFont != null) {
return textFont.descent() * textSize;
return textFont.descent() *
((textMode == SCREEN) ? textFont.size : textSize);
} else {
throw new RuntimeException("use textFont() before textDescent()");
@@ -1734,8 +1736,8 @@ public class PGraphics extends PImage implements PConstants {
public void textFont(PFont which) {
if (which != null) {
textFont = which;
textSize(which.size);
textFontNative = which.font;
textSize(textFont.size);
} else {
throw new RuntimeException("a null PFont was passed to textFont()");
@@ -1780,18 +1782,18 @@ public class PGraphics extends PImage implements PConstants {
"are available with this renderer.");
}
if (textFont != null) {
textMode = mode;
//if (textFont != null) {
textMode = mode;
// reset the font to its natural size
// (helps with width calculations and all that)
if (textMode == SCREEN) {
textSize(textFont.size);
}
// reset the font to its natural size
// (helps with width calculations and all that)
//if (textMode == SCREEN) {
//textSize(textFont.size);
//}
} else {
throw new RuntimeException("use textFont() before textMode()");
}
//} else {
//throw new RuntimeException("use textFont() before textMode()");
//}
}
+5 -4
View File
@@ -679,10 +679,11 @@ public class PGraphics2 extends PGraphics {
* will get recorded properly.
*/
public void textSize(float size) {
if (textFontNative == null) {
super.textSize(size);
return;
}
// take care of setting the textSize and textLeading vars
//if (textFontNative == null) {
super.textSize(size);
//return;
//}
textFontNative = textFontNative.deriveFont(size);
g2.setFont(textFontNative);
+8 -3
View File
@@ -1,6 +1,10 @@
0094 core
X fix bug that was causing font sizes not to be set on opengl
X http://dev.processing.org/bugs/show_bug.cgi?id=174
X apply fix from toxi to make targa files less picky
X http://processing.org/discourse/yabb_beta/YaBB.cgi?board=SoftwareBugs;action=display;num=1127999630
_ update to latest 1.4.2 java vm
_ update to java 1.4.2_09
_ add auto-install of cab file inside applet.html
http://java.sun.com/update/1.4.2/jinstall-1_4_2_09-windows-i586.cab
for the 1.5 versions:
@@ -568,12 +572,13 @@ _ http://dev.processing.org/bugs/show_bug.cgi?id=100
_ gl points not working again
_ polygon z-order with alpha in opengl
_ at least add it to the faq, or this would be a test case w/ the sorting
_ http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Programs;action=display;num=1115222332
_ http://dev.processing.org/bugs/show_bug.cgi?id=176
_ invocationtargetexception in gl with aioobe:
_ http://processing.org/discourse/yabb_beta/YaBB.cgi?board=SoftwareBugs;action=display;num=1115185737
_ don't let users no java < 1.4 load OPENGL
_ don't let users with java < 1.4 load OPENGL
_ noLoop() broken on opengl
_ http://processing.org/discourse/yabb_beta/YaBB.cgi?board=SoftwareBugs;action=display;num=1115330568;start=0
_ http://dev.processing.org/bugs/show_bug.cgi?id=164
_ fix non-bound textures from mangling everything else
_ fix enable/disable textures for some objects
_ fix endian ordering issues so that things work properly
+3 -2
View File
@@ -939,8 +939,9 @@ public class PGraphicsGL extends PGraphics3 {
*/
protected void textCharImpl(char ch, float x, float y) {
if ((textMode == SHAPE) && (textFontNative == null)) {
System.err.println("textMode(SHAPE) is disabled because the font " +
"\"" + textFont.name + "\" is not available.");
throw new RuntimeException("textMode(SHAPE) is disabled " +
"because the font \"" + textFont.name +
"\" is not available.");
}
if ((textMode != SHAPE) || (textFontNative == null)) {
super.textCharImpl(ch, x, y);
+3
View File
@@ -1,5 +1,7 @@
0094 pde
_ don't write stdout.txt to the processing folder (write it to build dir?)
_ http://processing.org/discourse/yabb_beta/YaBB.cgi?board=SoftwareBugs;action=display;num=1129066571
_ external apps should inherit memory settings from p5 itself
_ too confusing to set the memory in two places
@@ -23,6 +25,7 @@ _ explanation of what the areas are
_ be sure to look at the reference, especially the extended reference
other faq
_ change bugs.html to issues.html
_ fastest machine possible
_ turn off hyperthreading in the bios
_ nice gfx card only helps opengl