id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
1,700 | nguillaumin/slick2d-maven | slick2d-peditor/src/main/java/org/newdawn/slick/tools/peditor/ParticleGame.java | ParticleGame.setSystem | public void setSystem(ParticleSystem system) {
this.system = system;
emitters.clear();
system.setRemoveCompletedEmitters(false);
for (int i = 0; i < system.getEmitterCount(); i++) {
emitters.add(system.getEmitter(i));
}
} | java | public void setSystem(ParticleSystem system) {
this.system = system;
emitters.clear();
system.setRemoveCompletedEmitters(false);
for (int i = 0; i < system.getEmitterCount(); i++) {
emitters.add(system.getEmitter(i));
}
} | [
"public",
"void",
"setSystem",
"(",
"ParticleSystem",
"system",
")",
"{",
"this",
".",
"system",
"=",
"system",
";",
"emitters",
".",
"clear",
"(",
")",
";",
"system",
".",
"setRemoveCompletedEmitters",
"(",
"false",
")",
";",
"for",
"(",
"int",
"i",
"="... | Set the particle system to be displayed
@param system
The system to be displayed | [
"Set",
"the",
"particle",
"system",
"to",
"be",
"displayed"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-peditor/src/main/java/org/newdawn/slick/tools/peditor/ParticleGame.java#L198-L205 |
1,701 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/CharSet.java | CharSet.copy | public CharSet copy() {
CharSet copy = new CharSet();
copy.name = name;
copy.source = source;
copy.mutable = true;
copy.chars = new boolean[256];
System.arraycopy(chars, 0, copy.chars, 0, chars.length);
return copy;
} | java | public CharSet copy() {
CharSet copy = new CharSet();
copy.name = name;
copy.source = source;
copy.mutable = true;
copy.chars = new boolean[256];
System.arraycopy(chars, 0, copy.chars, 0, chars.length);
return copy;
} | [
"public",
"CharSet",
"copy",
"(",
")",
"{",
"CharSet",
"copy",
"=",
"new",
"CharSet",
"(",
")",
";",
"copy",
".",
"name",
"=",
"name",
";",
"copy",
".",
"source",
"=",
"source",
";",
"copy",
".",
"mutable",
"=",
"true",
";",
"copy",
".",
"chars",
... | Copy this character set
@return A copy of this character set | [
"Copy",
"this",
"character",
"set"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/CharSet.java#L60-L70 |
1,702 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/CharSet.java | CharSet.save | public void save(File file) throws IOException {
DataOutputStream dout = new DataOutputStream(new FileOutputStream(file));
dout.writeUTF(name);
for (int i=0;i<256;i++) {
dout.writeBoolean(chars[i]);
}
dout.close();
} | java | public void save(File file) throws IOException {
DataOutputStream dout = new DataOutputStream(new FileOutputStream(file));
dout.writeUTF(name);
for (int i=0;i<256;i++) {
dout.writeBoolean(chars[i]);
}
dout.close();
} | [
"public",
"void",
"save",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"DataOutputStream",
"dout",
"=",
"new",
"DataOutputStream",
"(",
"new",
"FileOutputStream",
"(",
"file",
")",
")",
";",
"dout",
".",
"writeUTF",
"(",
"name",
")",
";",
"for",... | Save the set to a file
@param file The file to save to
@throws IOException Indicates a failure to write to disk | [
"Save",
"the",
"set",
"to",
"a",
"file"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/CharSet.java#L105-L112 |
1,703 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/geom/Path.java | Path.lineTo | public void lineTo(float x, float y) {
if (hole != null) {
hole.add(new float[] {x,y});
} else {
localPoints.add(new float[] {x,y});
}
cx = x;
cy = y;
pointsDirty = true;
} | java | public void lineTo(float x, float y) {
if (hole != null) {
hole.add(new float[] {x,y});
} else {
localPoints.add(new float[] {x,y});
}
cx = x;
cy = y;
pointsDirty = true;
} | [
"public",
"void",
"lineTo",
"(",
"float",
"x",
",",
"float",
"y",
")",
"{",
"if",
"(",
"hole",
"!=",
"null",
")",
"{",
"hole",
".",
"add",
"(",
"new",
"float",
"[",
"]",
"{",
"x",
",",
"y",
"}",
")",
";",
"}",
"else",
"{",
"localPoints",
".",... | Add a line to the contour or hole which ends at the specified
location.
@param x The x coordinate to draw the line to
@param y The y coordiante to draw the line to | [
"Add",
"a",
"line",
"to",
"the",
"contour",
"or",
"hole",
"which",
"ends",
"at",
"the",
"specified",
"location",
"."
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/geom/Path.java#L56-L65 |
1,704 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/geom/Path.java | Path.transform | private ArrayList transform(ArrayList pts, Transform t) {
float[] in = new float[pts.size()*2];
float[] out = new float[pts.size()*2];
for (int i=0;i<pts.size();i++) {
in[i*2] = ((float[]) pts.get(i))[0];
in[(i*2)+1] = ((float[]) pts.get(i))[1];
}
t.transform(in, 0, out, 0, pts.size());
... | java | private ArrayList transform(ArrayList pts, Transform t) {
float[] in = new float[pts.size()*2];
float[] out = new float[pts.size()*2];
for (int i=0;i<pts.size();i++) {
in[i*2] = ((float[]) pts.get(i))[0];
in[(i*2)+1] = ((float[]) pts.get(i))[1];
}
t.transform(in, 0, out, 0, pts.size());
... | [
"private",
"ArrayList",
"transform",
"(",
"ArrayList",
"pts",
",",
"Transform",
"t",
")",
"{",
"float",
"[",
"]",
"in",
"=",
"new",
"float",
"[",
"pts",
".",
"size",
"(",
")",
"*",
"2",
"]",
";",
"float",
"[",
"]",
"out",
"=",
"new",
"float",
"["... | Transform a list of points
@param pts The pts to transform
@param t The transform to apply
@return The transformed points | [
"Transform",
"a",
"list",
"of",
"points"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/geom/Path.java#L155-L171 |
1,705 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/svg/NonGeometricData.java | NonGeometricData.morphColor | private String morphColor(String str) {
if (str.equals("")) {
return "#000000";
}
if (str.equals("white")) {
return "#ffffff";
}
if (str.equals("black")) {
return "#000000";
}
return str;
} | java | private String morphColor(String str) {
if (str.equals("")) {
return "#000000";
}
if (str.equals("white")) {
return "#ffffff";
}
if (str.equals("black")) {
return "#000000";
}
return str;
} | [
"private",
"String",
"morphColor",
"(",
"String",
"str",
")",
"{",
"if",
"(",
"str",
".",
"equals",
"(",
"\"\"",
")",
")",
"{",
"return",
"\"#000000\"",
";",
"}",
"if",
"(",
"str",
".",
"equals",
"(",
"\"white\"",
")",
")",
"{",
"return",
"\"#ffffff\... | Morph the color from a string
@param str The string to morph
@return The new color string | [
"Morph",
"the",
"color",
"from",
"a",
"string"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/svg/NonGeometricData.java#L57-L69 |
1,706 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/svg/NonGeometricData.java | NonGeometricData.addAttribute | public void addAttribute(String attribute, String value) {
if (value == null) {
value = "";
}
if (attribute.equals(FILL) ) {
value = morphColor(value);
}
if (attribute.equals(STROKE_OPACITY)) {
if (value.equals("0")) {
props.setProperty(STROKE, "none");
}
}
if (attribute.eq... | java | public void addAttribute(String attribute, String value) {
if (value == null) {
value = "";
}
if (attribute.equals(FILL) ) {
value = morphColor(value);
}
if (attribute.equals(STROKE_OPACITY)) {
if (value.equals("0")) {
props.setProperty(STROKE, "none");
}
}
if (attribute.eq... | [
"public",
"void",
"addAttribute",
"(",
"String",
"attribute",
",",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"value",
"=",
"\"\"",
";",
"}",
"if",
"(",
"attribute",
".",
"equals",
"(",
"FILL",
")",
")",
"{",
"value",
... | Add a configured style attribute into the data set
@param attribute The attribute to add
@param value The value to assign | [
"Add",
"a",
"configured",
"style",
"attribute",
"into",
"the",
"data",
"set"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/svg/NonGeometricData.java#L77-L109 |
1,707 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/svg/NonGeometricData.java | NonGeometricData.getAsColor | public Color getAsColor(String attribute) {
if (!isColor(attribute)) {
throw new RuntimeException("Attribute "+attribute+" is not specified as a color:"+getAttribute(attribute));
}
int col = Integer.parseInt(getAttribute(attribute).substring(1), 16);
return new Color(col);
} | java | public Color getAsColor(String attribute) {
if (!isColor(attribute)) {
throw new RuntimeException("Attribute "+attribute+" is not specified as a color:"+getAttribute(attribute));
}
int col = Integer.parseInt(getAttribute(attribute).substring(1), 16);
return new Color(col);
} | [
"public",
"Color",
"getAsColor",
"(",
"String",
"attribute",
")",
"{",
"if",
"(",
"!",
"isColor",
"(",
"attribute",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Attribute \"",
"+",
"attribute",
"+",
"\" is not specified as a color:\"",
"+",
"getAtt... | Get an attribute value converted to a color. isColor should first be checked
@param attribute The attribute whose value should be interpreted as a color
@return The color based on the attribute | [
"Get",
"an",
"attribute",
"value",
"converted",
"to",
"a",
"color",
".",
"isColor",
"should",
"first",
"be",
"checked"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/svg/NonGeometricData.java#L147-L155 |
1,708 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/svg/NonGeometricData.java | NonGeometricData.getAsFloat | public float getAsFloat(String attribute) {
String value = getAttribute(attribute);
if (value == null) {
return 0;
}
try {
return Float.parseFloat(value);
} catch (NumberFormatException e) {
throw new RuntimeException("Attribute "+attribute+" is not specified as a float:"+getAttribute(att... | java | public float getAsFloat(String attribute) {
String value = getAttribute(attribute);
if (value == null) {
return 0;
}
try {
return Float.parseFloat(value);
} catch (NumberFormatException e) {
throw new RuntimeException("Attribute "+attribute+" is not specified as a float:"+getAttribute(att... | [
"public",
"float",
"getAsFloat",
"(",
"String",
"attribute",
")",
"{",
"String",
"value",
"=",
"getAttribute",
"(",
"attribute",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"0",
";",
"}",
"try",
"{",
"return",
"Float",
".",
"parseFl... | Get an attribute converted to a float value
@param attribute The attribute to retrieve
@return The float value derived from the attribute | [
"Get",
"an",
"attribute",
"converted",
"to",
"a",
"float",
"value"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/svg/NonGeometricData.java#L180-L191 |
1,709 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/font/GlyphPage.java | GlyphPage.loadGlyphs | public int loadGlyphs (List glyphs, int maxGlyphsToLoad) throws SlickException {
if (rowHeight != 0 && maxGlyphsToLoad == -1) {
// If this page has glyphs and we are not loading incrementally, return zero if any of the glyphs don't fit.
int testX = pageX;
int testY = pageY;
int testRowHeight = rowHei... | java | public int loadGlyphs (List glyphs, int maxGlyphsToLoad) throws SlickException {
if (rowHeight != 0 && maxGlyphsToLoad == -1) {
// If this page has glyphs and we are not loading incrementally, return zero if any of the glyphs don't fit.
int testX = pageX;
int testY = pageY;
int testRowHeight = rowHei... | [
"public",
"int",
"loadGlyphs",
"(",
"List",
"glyphs",
",",
"int",
"maxGlyphsToLoad",
")",
"throws",
"SlickException",
"{",
"if",
"(",
"rowHeight",
"!=",
"0",
"&&",
"maxGlyphsToLoad",
"==",
"-",
"1",
")",
"{",
"// If this page has glyphs and we are not loading increm... | Loads glyphs to the backing texture and sets the image on each loaded glyph. Loaded glyphs are removed from the list.
If this page already has glyphs and maxGlyphsToLoad is -1, then this method will return 0 if all the new glyphs don't fit.
This reduces texture binds when drawing since glyphs loaded at once are typica... | [
"Loads",
"glyphs",
"to",
"the",
"backing",
"texture",
"and",
"sets",
"the",
"image",
"on",
"each",
"loaded",
"glyph",
".",
"Loaded",
"glyphs",
"are",
"removed",
"from",
"the",
"list",
"."
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/font/GlyphPage.java#L119-L186 |
1,710 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/font/GlyphPage.java | GlyphPage.renderGlyph | private void renderGlyph(Glyph glyph, int width, int height) throws SlickException {
// Draw the glyph to the scratch image using Java2D.
scratchGraphics.setComposite(AlphaComposite.Clear);
scratchGraphics.fillRect(0, 0, MAX_GLYPH_SIZE, MAX_GLYPH_SIZE);
scratchGraphics.setComposite(AlphaComposite.SrcOver);
... | java | private void renderGlyph(Glyph glyph, int width, int height) throws SlickException {
// Draw the glyph to the scratch image using Java2D.
scratchGraphics.setComposite(AlphaComposite.Clear);
scratchGraphics.fillRect(0, 0, MAX_GLYPH_SIZE, MAX_GLYPH_SIZE);
scratchGraphics.setComposite(AlphaComposite.SrcOver);
... | [
"private",
"void",
"renderGlyph",
"(",
"Glyph",
"glyph",
",",
"int",
"width",
",",
"int",
"height",
")",
"throws",
"SlickException",
"{",
"// Draw the glyph to the scratch image using Java2D.\r",
"scratchGraphics",
".",
"setComposite",
"(",
"AlphaComposite",
".",
"Clear... | Loads a single glyph to the backing texture, if it fits.
@param glyph The glyph to be rendered
@param width The expected width of the glyph
@param height The expected height of the glyph
@throws SlickException if the glyph could not be rendered. | [
"Loads",
"a",
"single",
"glyph",
"to",
"the",
"backing",
"texture",
"if",
"it",
"fits",
"."
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/font/GlyphPage.java#L196-L217 |
1,711 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/font/GlyphPage.java | GlyphPage.getIterator | private Iterator getIterator(List glyphs) {
if (orderAscending) return glyphs.iterator();
final ListIterator iter = glyphs.listIterator(glyphs.size());
return new Iterator() {
public boolean hasNext () {
return iter.hasPrevious();
}
public Object next () {
return iter.previous();
}
... | java | private Iterator getIterator(List glyphs) {
if (orderAscending) return glyphs.iterator();
final ListIterator iter = glyphs.listIterator(glyphs.size());
return new Iterator() {
public boolean hasNext () {
return iter.hasPrevious();
}
public Object next () {
return iter.previous();
}
... | [
"private",
"Iterator",
"getIterator",
"(",
"List",
"glyphs",
")",
"{",
"if",
"(",
"orderAscending",
")",
"return",
"glyphs",
".",
"iterator",
"(",
")",
";",
"final",
"ListIterator",
"iter",
"=",
"glyphs",
".",
"listIterator",
"(",
"glyphs",
".",
"size",
"(... | Returns an iterator for the specified glyphs, sorted either ascending or descending.
@param glyphs The glyphs to return if present
@return An iterator of the sorted list of glyphs | [
"Returns",
"an",
"iterator",
"for",
"the",
"specified",
"glyphs",
"sorted",
"either",
"ascending",
"or",
"descending",
"."
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/font/GlyphPage.java#L225-L241 |
1,712 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java | TTFFile.seekTab | boolean seekTab(FontFileReader in, String name,
long offset) throws IOException {
TTFDirTabEntry dt = (TTFDirTabEntry)dirTabs.get(name);
if (dt == null) {
log.error("Dirtab " + name + " not found.");
return false;
} else {
in.seekSet(dt.getOf... | java | boolean seekTab(FontFileReader in, String name,
long offset) throws IOException {
TTFDirTabEntry dt = (TTFDirTabEntry)dirTabs.get(name);
if (dt == null) {
log.error("Dirtab " + name + " not found.");
return false;
} else {
in.seekSet(dt.getOf... | [
"boolean",
"seekTab",
"(",
"FontFileReader",
"in",
",",
"String",
"name",
",",
"long",
"offset",
")",
"throws",
"IOException",
"{",
"TTFDirTabEntry",
"dt",
"=",
"(",
"TTFDirTabEntry",
")",
"dirTabs",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"dt",
"=... | Position inputstream to position indicated
in the dirtab offset + offset
@param in The reader to read the tables from
@param name The table to search for
@param offset The offset to start at
@return True if found the table
@throws IOException Indicatesa a failure to read | [
"Position",
"inputstream",
"to",
"position",
"indicated",
"in",
"the",
"dirtab",
"offset",
"+",
"offset"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java#L207-L218 |
1,713 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java | TTFFile.createCMaps | private void createCMaps() {
cmaps = new java.util.ArrayList();
TTFCmapEntry tce = new TTFCmapEntry();
Iterator e = unicodeMapping.listIterator();
UnicodeMapping um = (UnicodeMapping)e.next();
UnicodeMapping lastMapping = um;
tce.setUnicodeStart(um.getUnicodeIndex());
... | java | private void createCMaps() {
cmaps = new java.util.ArrayList();
TTFCmapEntry tce = new TTFCmapEntry();
Iterator e = unicodeMapping.listIterator();
UnicodeMapping um = (UnicodeMapping)e.next();
UnicodeMapping lastMapping = um;
tce.setUnicodeStart(um.getUnicodeIndex());
... | [
"private",
"void",
"createCMaps",
"(",
")",
"{",
"cmaps",
"=",
"new",
"java",
".",
"util",
".",
"ArrayList",
"(",
")",
";",
"TTFCmapEntry",
"tce",
"=",
"new",
"TTFCmapEntry",
"(",
")",
";",
"Iterator",
"e",
"=",
"unicodeMapping",
".",
"listIterator",
"("... | Create teh CMAPS table | [
"Create",
"teh",
"CMAPS",
"table"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java#L568-L595 |
1,714 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java | TTFFile.getFlags | public int getFlags() {
int flags = 32; // Use Adobe Standard charset
if (italicAngle != 0) {
flags = flags | 64;
}
if (isFixedPitch != 0) {
flags = flags | 2;
}
if (hasSerifs) {
flags = flags | 1;
}
return flags;
... | java | public int getFlags() {
int flags = 32; // Use Adobe Standard charset
if (italicAngle != 0) {
flags = flags | 64;
}
if (isFixedPitch != 0) {
flags = flags | 2;
}
if (hasSerifs) {
flags = flags | 1;
}
return flags;
... | [
"public",
"int",
"getFlags",
"(",
")",
"{",
"int",
"flags",
"=",
"32",
";",
"// Use Adobe Standard charset",
"if",
"(",
"italicAngle",
"!=",
"0",
")",
"{",
"flags",
"=",
"flags",
"|",
"64",
";",
"}",
"if",
"(",
"isFixedPitch",
"!=",
"0",
")",
"{",
"f... | Returns the Flags attribute of the font.
@return int The Flags | [
"Returns",
"the",
"Flags",
"attribute",
"of",
"the",
"font",
"."
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java#L653-L665 |
1,715 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java | TTFFile.getFontBBox | public int[] getFontBBox() {
final int[] fbb = new int[4];
fbb[0] = fontBBox1;
fbb[1] = fontBBox2;
fbb[2] = fontBBox3;
fbb[3] = fontBBox4;
return fbb;
} | java | public int[] getFontBBox() {
final int[] fbb = new int[4];
fbb[0] = fontBBox1;
fbb[1] = fontBBox2;
fbb[2] = fontBBox3;
fbb[3] = fontBBox4;
return fbb;
} | [
"public",
"int",
"[",
"]",
"getFontBBox",
"(",
")",
"{",
"final",
"int",
"[",
"]",
"fbb",
"=",
"new",
"int",
"[",
"4",
"]",
";",
"fbb",
"[",
"0",
"]",
"=",
"fontBBox1",
";",
"fbb",
"[",
"1",
"]",
"=",
"fontBBox2",
";",
"fbb",
"[",
"2",
"]",
... | Returns the font bounding box.
@return int[] The font bbox | [
"Returns",
"the",
"font",
"bounding",
"box",
"."
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java#L696-L704 |
1,716 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java | TTFFile.getWidths | public int[] getWidths() {
int[] wx = new int[mtxTab.length];
for (int i = 0; i < wx.length; i++) {
wx[i] = (mtxTab[i].getWx());
}
return wx;
} | java | public int[] getWidths() {
int[] wx = new int[mtxTab.length];
for (int i = 0; i < wx.length; i++) {
wx[i] = (mtxTab[i].getWx());
}
return wx;
} | [
"public",
"int",
"[",
"]",
"getWidths",
"(",
")",
"{",
"int",
"[",
"]",
"wx",
"=",
"new",
"int",
"[",
"mtxTab",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"wx",
".",
"length",
";",
"i",
"++",
")",
"{",
"wx",
... | Returns an array of character widths.
@return int[] The character widths | [
"Returns",
"an",
"array",
"of",
"character",
"widths",
"."
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java#L743-L750 |
1,717 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java | TTFFile.readHorizontalHeader | protected void readHorizontalHeader(FontFileReader in)
throws IOException {
seekTab(in, "hhea", 4);
hheaAscender = in.readTTFShort();
log.debug("hhea.Ascender: " + hheaAscender + " " + (hheaAscender));
hheaDescender = in.readTTFShort();
log.debug("hhea.Descender: " +... | java | protected void readHorizontalHeader(FontFileReader in)
throws IOException {
seekTab(in, "hhea", 4);
hheaAscender = in.readTTFShort();
log.debug("hhea.Ascender: " + hheaAscender + " " + (hheaAscender));
hheaDescender = in.readTTFShort();
log.debug("hhea.Descender: " +... | [
"protected",
"void",
"readHorizontalHeader",
"(",
"FontFileReader",
"in",
")",
"throws",
"IOException",
"{",
"seekTab",
"(",
"in",
",",
"\"hhea\"",
",",
"4",
")",
";",
"hheaAscender",
"=",
"in",
".",
"readTTFShort",
"(",
")",
";",
"log",
".",
"debug",
"(",... | Read the "hhea" table to find the ascender and descender and
size of "hmtx" table, as a fixed size font might have only
one width.
@param in FontFileReader to read the hhea table from
@throws IOException in case of an I/O problem | [
"Read",
"the",
"hhea",
"table",
"to",
"find",
"the",
"ascender",
"and",
"descender",
"and",
"size",
"of",
"hmtx",
"table",
"as",
"a",
"fixed",
"size",
"font",
"might",
"have",
"only",
"one",
"width",
"."
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java#L850-L863 |
1,718 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java | TTFFile.readPostScript | private final void readPostScript(FontFileReader in) throws IOException {
seekTab(in, "post", 0);
postFormat = in.readTTFLong();
italicAngle = in.readTTFULong();
underlinePosition = in.readTTFShort();
underlineThickness = in.readTTFShort();
isFixedPitch = in.readTTFULong(... | java | private final void readPostScript(FontFileReader in) throws IOException {
seekTab(in, "post", 0);
postFormat = in.readTTFLong();
italicAngle = in.readTTFULong();
underlinePosition = in.readTTFShort();
underlineThickness = in.readTTFShort();
isFixedPitch = in.readTTFULong(... | [
"private",
"final",
"void",
"readPostScript",
"(",
"FontFileReader",
"in",
")",
"throws",
"IOException",
"{",
"seekTab",
"(",
"in",
",",
"\"post\"",
",",
"0",
")",
";",
"postFormat",
"=",
"in",
".",
"readTTFLong",
"(",
")",
";",
"italicAngle",
"=",
"in",
... | Read the "post" table
containing the PostScript names of the glyphs.
@param in The reader to get the names from
@throws IOException Indicates a failure to read the table | [
"Read",
"the",
"post",
"table",
"containing",
"the",
"PostScript",
"names",
"of",
"the",
"glyphs",
"."
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java#L916-L993 |
1,719 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java | TTFFile.readIndexToLocation | protected final void readIndexToLocation(FontFileReader in)
throws IOException {
if (!seekTab(in, "loca", 0)) {
throw new IOException("'loca' table not found, happens when the font file doesn't"
+ " contain TrueType outlines (trying to read an OpenType CFF font maybe?... | java | protected final void readIndexToLocation(FontFileReader in)
throws IOException {
if (!seekTab(in, "loca", 0)) {
throw new IOException("'loca' table not found, happens when the font file doesn't"
+ " contain TrueType outlines (trying to read an OpenType CFF font maybe?... | [
"protected",
"final",
"void",
"readIndexToLocation",
"(",
"FontFileReader",
"in",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"seekTab",
"(",
"in",
",",
"\"loca\"",
",",
"0",
")",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"'loca' table not found, ... | Read the "loca" table.
@param in FontFileReader to read from
@throws IOException In case of a I/O problem | [
"Read",
"the",
"loca",
"table",
"."
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java#L1046-L1058 |
1,720 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java | TTFFile.readGlyf | private final void readGlyf(FontFileReader in) throws IOException {
TTFDirTabEntry dirTab = (TTFDirTabEntry)dirTabs.get("glyf");
if (dirTab == null) {
throw new IOException("glyf table not found, cannot continue");
}
for (int i = 0; i < (numberOfGlyphs - 1); i++) {
... | java | private final void readGlyf(FontFileReader in) throws IOException {
TTFDirTabEntry dirTab = (TTFDirTabEntry)dirTabs.get("glyf");
if (dirTab == null) {
throw new IOException("glyf table not found, cannot continue");
}
for (int i = 0; i < (numberOfGlyphs - 1); i++) {
... | [
"private",
"final",
"void",
"readGlyf",
"(",
"FontFileReader",
"in",
")",
"throws",
"IOException",
"{",
"TTFDirTabEntry",
"dirTab",
"=",
"(",
"TTFDirTabEntry",
")",
"dirTabs",
".",
"get",
"(",
"\"glyf\"",
")",
";",
"if",
"(",
"dirTab",
"==",
"null",
")",
"... | Read the "glyf" table to find the bounding boxes.
@param in FontFileReader to read from
@throws IOException In case of a I/O problem | [
"Read",
"the",
"glyf",
"table",
"to",
"find",
"the",
"bounding",
"boxes",
"."
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java#L1065-L1113 |
1,721 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java | TTFFile.readName | private final void readName(FontFileReader in) throws IOException {
seekTab(in, "name", 2);
int i = in.getCurrentPos();
int n = in.readTTFUShort();
int j = in.readTTFUShort() + i - 2;
i += 2 * 2;
while (n-- > 0) {
// getLogger().debug("Iteration: " + n);
... | java | private final void readName(FontFileReader in) throws IOException {
seekTab(in, "name", 2);
int i = in.getCurrentPos();
int n = in.readTTFUShort();
int j = in.readTTFUShort() + i - 2;
i += 2 * 2;
while (n-- > 0) {
// getLogger().debug("Iteration: " + n);
... | [
"private",
"final",
"void",
"readName",
"(",
"FontFileReader",
"in",
")",
"throws",
"IOException",
"{",
"seekTab",
"(",
"in",
",",
"\"name\"",
",",
"2",
")",
";",
"int",
"i",
"=",
"in",
".",
"getCurrentPos",
"(",
")",
";",
"int",
"n",
"=",
"in",
".",... | Read the "name" table.
@param in FontFileReader to read from
@throws IOException In case of a I/O problem | [
"Read",
"the",
"name",
"table",
"."
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java#L1120-L1174 |
1,722 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java | TTFFile.readPCLT | private final boolean readPCLT(FontFileReader in) throws IOException {
TTFDirTabEntry dirTab = (TTFDirTabEntry)dirTabs.get("PCLT");
if (dirTab != null) {
in.seekSet(dirTab.getOffset() + 4 + 4 + 2);
xHeight = in.readTTFUShort();
log.debug("xHeight from PCLT: " + xHeigh... | java | private final boolean readPCLT(FontFileReader in) throws IOException {
TTFDirTabEntry dirTab = (TTFDirTabEntry)dirTabs.get("PCLT");
if (dirTab != null) {
in.seekSet(dirTab.getOffset() + 4 + 4 + 2);
xHeight = in.readTTFUShort();
log.debug("xHeight from PCLT: " + xHeigh... | [
"private",
"final",
"boolean",
"readPCLT",
"(",
"FontFileReader",
"in",
")",
"throws",
"IOException",
"{",
"TTFDirTabEntry",
"dirTab",
"=",
"(",
"TTFDirTabEntry",
")",
"dirTabs",
".",
"get",
"(",
"\"PCLT\"",
")",
";",
"if",
"(",
"dirTab",
"!=",
"null",
")",
... | Read the "PCLT" table to find xHeight and capHeight.
@param in The reader to get the table from
@return True if the table has been read
@throws IOException Indicates a failure to read the table | [
"Read",
"the",
"PCLT",
"table",
"to",
"find",
"xHeight",
"and",
"capHeight",
"."
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java#L1183-L1208 |
1,723 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java | TTFFile.checkTTC | protected final boolean checkTTC(FontFileReader in, String name) throws IOException {
String tag = in.readTTFString(4);
if ("ttcf".equals(tag)) {
// This is a TrueType Collection
in.skip(4);
// Read directory offsets
int numDirectories = (int)in.readTTFU... | java | protected final boolean checkTTC(FontFileReader in, String name) throws IOException {
String tag = in.readTTFString(4);
if ("ttcf".equals(tag)) {
// This is a TrueType Collection
in.skip(4);
// Read directory offsets
int numDirectories = (int)in.readTTFU... | [
"protected",
"final",
"boolean",
"checkTTC",
"(",
"FontFileReader",
"in",
",",
"String",
"name",
")",
"throws",
"IOException",
"{",
"String",
"tag",
"=",
"in",
".",
"readTTFString",
"(",
"4",
")",
";",
"if",
"(",
"\"ttcf\"",
".",
"equals",
"(",
"tag",
")... | Check if this is a TrueType collection and that the given
name exists in the collection.
If it does, set offset in fontfile to the beginning of
the Table Directory for that font.
@param in FontFileReader to read from
@param name The name to check
@return True if not collection or font name present, false otherwise
@thr... | [
"Check",
"if",
"this",
"is",
"a",
"TrueType",
"collection",
"and",
"that",
"the",
"given",
"name",
"exists",
"in",
"the",
"collection",
".",
"If",
"it",
"does",
"set",
"offset",
"in",
"fontfile",
"to",
"the",
"beginning",
"of",
"the",
"Table",
"Directory",... | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java#L1427-L1480 |
1,724 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java | TTFFile.unicodeToWinAnsi | private Integer[] unicodeToWinAnsi(int unicode) {
List ret = new java.util.ArrayList();
for (int i = 32; i < Glyphs.WINANSI_ENCODING.length; i++) {
if (unicode == Glyphs.WINANSI_ENCODING[i]) {
ret.add(new Integer(i));
}
}
return (Integer[])ret.toAr... | java | private Integer[] unicodeToWinAnsi(int unicode) {
List ret = new java.util.ArrayList();
for (int i = 32; i < Glyphs.WINANSI_ENCODING.length; i++) {
if (unicode == Glyphs.WINANSI_ENCODING[i]) {
ret.add(new Integer(i));
}
}
return (Integer[])ret.toAr... | [
"private",
"Integer",
"[",
"]",
"unicodeToWinAnsi",
"(",
"int",
"unicode",
")",
"{",
"List",
"ret",
"=",
"new",
"java",
".",
"util",
".",
"ArrayList",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"32",
";",
"i",
"<",
"Glyphs",
".",
"WINANSI_ENCODING",... | Helper methods, they are not very efficient, but that really
doesn't matter...
@param unicode The unicode character to convert
@return The converted WinAnsi value | [
"Helper",
"methods",
"they",
"are",
"not",
"very",
"efficient",
"but",
"that",
"really",
"doesn",
"t",
"matter",
"..."
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java#L1489-L1497 |
1,725 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java | TTFFile.printStuff | public void printStuff() {
System.out.println("Font name: " + fontName);
System.out.println("Full name: " + fullName);
System.out.println("Family name: " + familyName);
System.out.println("Subfamily name: " + subFamilyName);
System.out.println("Notice: " + notice);
... | java | public void printStuff() {
System.out.println("Font name: " + fontName);
System.out.println("Full name: " + fullName);
System.out.println("Family name: " + familyName);
System.out.println("Subfamily name: " + subFamilyName);
System.out.println("Notice: " + notice);
... | [
"public",
"void",
"printStuff",
"(",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"Font name: \"",
"+",
"fontName",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"Full name: \"",
"+",
"fullName",
")",
";",
"System",
".",
"out",
"."... | Dumps a few informational values to System.out. | [
"Dumps",
"a",
"few",
"informational",
"values",
"to",
"System",
".",
"out",
"."
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java#L1502-L1526 |
1,726 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java | TTFFile.unicodeToGlyph | private Integer unicodeToGlyph(int unicodeIndex) throws IOException {
final Integer result =
(Integer) unicodeToGlyphMap.get(new Integer(unicodeIndex));
if (result == null) {
throw new IOException(
"Glyph index not found for unicode value " + unicodeIndex);
... | java | private Integer unicodeToGlyph(int unicodeIndex) throws IOException {
final Integer result =
(Integer) unicodeToGlyphMap.get(new Integer(unicodeIndex));
if (result == null) {
throw new IOException(
"Glyph index not found for unicode value " + unicodeIndex);
... | [
"private",
"Integer",
"unicodeToGlyph",
"(",
"int",
"unicodeIndex",
")",
"throws",
"IOException",
"{",
"final",
"Integer",
"result",
"=",
"(",
"Integer",
")",
"unicodeToGlyphMap",
".",
"get",
"(",
"new",
"Integer",
"(",
"unicodeIndex",
")",
")",
";",
"if",
"... | Map a unicode code point to the corresponding glyph index
@param unicodeIndex unicode code point
@return glyph index
@throws IOException if unicodeIndex not found | [
"Map",
"a",
"unicode",
"code",
"point",
"to",
"the",
"corresponding",
"glyph",
"index"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java#L1546-L1554 |
1,727 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java | TTFFile.main | public static void main(String[] args) {
try {
TTFFile ttfFile = new TTFFile();
FontFileReader reader = new FontFileReader(args[0]);
String name = null;
if (args.length >= 2) {
name = args[1];
}
ttfFile.readFont(reader, n... | java | public static void main(String[] args) {
try {
TTFFile ttfFile = new TTFFile();
FontFileReader reader = new FontFileReader(args[0]);
String name = null;
if (args.length >= 2) {
name = args[1];
}
ttfFile.readFont(reader, n... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"try",
"{",
"TTFFile",
"ttfFile",
"=",
"new",
"TTFFile",
"(",
")",
";",
"FontFileReader",
"reader",
"=",
"new",
"FontFileReader",
"(",
"args",
"[",
"0",
"]",
")",
";",
"St... | Static main method to get info about a TrueType font.
@param args The command line arguments | [
"Static",
"main",
"method",
"to",
"get",
"info",
"about",
"a",
"TrueType",
"font",
"."
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFFile.java#L1560-L1578 |
1,728 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/openal/OggDecoder.java | OggDecoder.getData | public OggData getData(InputStream input) throws IOException {
if (input == null) {
throw new IOException("Failed to read OGG, source does not exist?");
}
ByteArrayOutputStream dataout = new ByteArrayOutputStream();
// SyncState oy = new SyncState(); // sync and verify incoming physical bitstream
//... | java | public OggData getData(InputStream input) throws IOException {
if (input == null) {
throw new IOException("Failed to read OGG, source does not exist?");
}
ByteArrayOutputStream dataout = new ByteArrayOutputStream();
// SyncState oy = new SyncState(); // sync and verify incoming physical bitstream
//... | [
"public",
"OggData",
"getData",
"(",
"InputStream",
"input",
")",
"throws",
"IOException",
"{",
"if",
"(",
"input",
"==",
"null",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"Failed to read OGG, source does not exist?\"",
")",
";",
"}",
"ByteArrayOutputStream",
... | Get the data out of an OGG file
@param input The input stream from which to read the OGG file
@return The data describing the OGG thats been read
@throws IOException Indicaites a failure to read the OGG file | [
"Get",
"the",
"data",
"out",
"of",
"an",
"OGG",
"file"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/openal/OggDecoder.java#L32-L328 |
1,729 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java | TTFSubSetFile.createDirectory | private void createDirectory() {
int numTables = 9;
// Create the TrueType header
writeByte((byte)0);
writeByte((byte)1);
writeByte((byte)0);
writeByte((byte)0);
realSize += 4;
writeUShort(numTables);
realSize += 2;
// Create searchRange,... | java | private void createDirectory() {
int numTables = 9;
// Create the TrueType header
writeByte((byte)0);
writeByte((byte)1);
writeByte((byte)0);
writeByte((byte)0);
realSize += 4;
writeUShort(numTables);
realSize += 2;
// Create searchRange,... | [
"private",
"void",
"createDirectory",
"(",
")",
"{",
"int",
"numTables",
"=",
"9",
";",
"// Create the TrueType header",
"writeByte",
"(",
"(",
"byte",
")",
"0",
")",
";",
"writeByte",
"(",
"(",
"byte",
")",
"1",
")",
";",
"writeByte",
"(",
"(",
"byte",
... | Create the directory table | [
"Create",
"the",
"directory",
"table"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java#L113-L184 |
1,730 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java | TTFSubSetFile.createCvt | private void createCvt(FontFileReader in) throws IOException {
TTFDirTabEntry entry = (TTFDirTabEntry)dirTabs.get("cvt ");
if (entry != null) {
pad4();
seekTab(in, "cvt ", 0);
System.arraycopy(in.getBytes((int)entry.getOffset(), (int)entry.getLength()),
... | java | private void createCvt(FontFileReader in) throws IOException {
TTFDirTabEntry entry = (TTFDirTabEntry)dirTabs.get("cvt ");
if (entry != null) {
pad4();
seekTab(in, "cvt ", 0);
System.arraycopy(in.getBytes((int)entry.getOffset(), (int)entry.getLength()),
... | [
"private",
"void",
"createCvt",
"(",
"FontFileReader",
"in",
")",
"throws",
"IOException",
"{",
"TTFDirTabEntry",
"entry",
"=",
"(",
"TTFDirTabEntry",
")",
"dirTabs",
".",
"get",
"(",
"\"cvt \"",
")",
";",
"if",
"(",
"entry",
"!=",
"null",
")",
"{",
"pad4"... | Copy the cvt table as is from original font to subset font
@param in The input to read the CVT from
@throws IOException Indicates a failure to read the entry | [
"Copy",
"the",
"cvt",
"table",
"as",
"is",
"from",
"original",
"font",
"to",
"subset",
"font"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java#L193-L210 |
1,731 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java | TTFSubSetFile.createLoca | private void createLoca(int size) throws IOException {
pad4();
locaOffset = currentPos;
writeULong(locaDirOffset + 4, currentPos);
writeULong(locaDirOffset + 8, size * 4 + 4);
currentPos += size * 4 + 4;
realSize += size * 4 + 4;
} | java | private void createLoca(int size) throws IOException {
pad4();
locaOffset = currentPos;
writeULong(locaDirOffset + 4, currentPos);
writeULong(locaDirOffset + 8, size * 4 + 4);
currentPos += size * 4 + 4;
realSize += size * 4 + 4;
} | [
"private",
"void",
"createLoca",
"(",
"int",
"size",
")",
"throws",
"IOException",
"{",
"pad4",
"(",
")",
";",
"locaOffset",
"=",
"currentPos",
";",
"writeULong",
"(",
"locaDirOffset",
"+",
"4",
",",
"currentPos",
")",
";",
"writeULong",
"(",
"locaDirOffset"... | Create an empty loca table without updating checksum
@param size The size of the loca to create
@throws IOException Indicate a failure to store the loca | [
"Create",
"an",
"empty",
"loca",
"table",
"without",
"updating",
"checksum"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java#L255-L262 |
1,732 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java | TTFSubSetFile.createMaxp | private void createMaxp(FontFileReader in, int size) throws IOException {
TTFDirTabEntry entry = (TTFDirTabEntry)dirTabs.get("maxp");
if (entry != null) {
pad4();
seekTab(in, "maxp", 0);
System.arraycopy(in.getBytes((int)entry.getOffset(), (int)entry.getLength()),
... | java | private void createMaxp(FontFileReader in, int size) throws IOException {
TTFDirTabEntry entry = (TTFDirTabEntry)dirTabs.get("maxp");
if (entry != null) {
pad4();
seekTab(in, "maxp", 0);
System.arraycopy(in.getBytes((int)entry.getOffset(), (int)entry.getLength()),
... | [
"private",
"void",
"createMaxp",
"(",
"FontFileReader",
"in",
",",
"int",
"size",
")",
"throws",
"IOException",
"{",
"TTFDirTabEntry",
"entry",
"=",
"(",
"TTFDirTabEntry",
")",
"dirTabs",
".",
"get",
"(",
"\"maxp\"",
")",
";",
"if",
"(",
"entry",
"!=",
"nu... | Copy the maxp table as is from original font to subset font
and set num glyphs to size
@param in The reader from which to obtain the info
@param size The size of the MAXP table to write
@throws IOException Indicates a failure to write | [
"Copy",
"the",
"maxp",
"table",
"as",
"is",
"from",
"original",
"font",
"to",
"subset",
"font",
"and",
"set",
"num",
"glyphs",
"to",
"size"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java#L273-L291 |
1,733 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java | TTFSubSetFile.createHead | private void createHead(FontFileReader in) throws IOException {
TTFDirTabEntry entry = (TTFDirTabEntry)dirTabs.get("head");
if (entry != null) {
pad4();
seekTab(in, "head", 0);
System.arraycopy(in.getBytes((int)entry.getOffset(), (int)entry.getLength()),
... | java | private void createHead(FontFileReader in) throws IOException {
TTFDirTabEntry entry = (TTFDirTabEntry)dirTabs.get("head");
if (entry != null) {
pad4();
seekTab(in, "head", 0);
System.arraycopy(in.getBytes((int)entry.getOffset(), (int)entry.getLength()),
... | [
"private",
"void",
"createHead",
"(",
"FontFileReader",
"in",
")",
"throws",
"IOException",
"{",
"TTFDirTabEntry",
"entry",
"=",
"(",
"TTFDirTabEntry",
")",
"dirTabs",
".",
"get",
"(",
"\"head\"",
")",
";",
"if",
"(",
"entry",
"!=",
"null",
")",
"{",
"pad4... | Copy the head table as is from original font to subset font
and set indexToLocaFormat to long and set
checkSumAdjustment to 0, store offset to checkSumAdjustment
in checkSumAdjustmentOffset
@param in The reader to read the HEAD table from
@throws IOException Failure to read the table | [
"Copy",
"the",
"head",
"table",
"as",
"is",
"from",
"original",
"font",
"to",
"subset",
"font",
"and",
"set",
"indexToLocaFormat",
"to",
"long",
"and",
"set",
"checkSumAdjustment",
"to",
"0",
"store",
"offset",
"to",
"checkSumAdjustment",
"in",
"checkSumAdjustme... | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java#L358-L384 |
1,734 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java | TTFSubSetFile.createGlyf | private void createGlyf(FontFileReader in,
Map glyphs) throws IOException {
TTFDirTabEntry entry = (TTFDirTabEntry)dirTabs.get("glyf");
int size = 0;
int start = 0;
int endOffset = 0; // Store this as the last loca
if (entry != null) {
p... | java | private void createGlyf(FontFileReader in,
Map glyphs) throws IOException {
TTFDirTabEntry entry = (TTFDirTabEntry)dirTabs.get("glyf");
int size = 0;
int start = 0;
int endOffset = 0; // Store this as the last loca
if (entry != null) {
p... | [
"private",
"void",
"createGlyf",
"(",
"FontFileReader",
"in",
",",
"Map",
"glyphs",
")",
"throws",
"IOException",
"{",
"TTFDirTabEntry",
"entry",
"=",
"(",
"TTFDirTabEntry",
")",
"dirTabs",
".",
"get",
"(",
"\"glyf\"",
")",
";",
"int",
"size",
"=",
"0",
";... | Create the glyf table and fill in loca table
@param in Reader to get the table from
@param glyphs The glpyhs table to populate
@throws IOException Indicates a failure to read data | [
"Create",
"the",
"glyf",
"table",
"and",
"fill",
"in",
"loca",
"table"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java#L394-L464 |
1,735 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java | TTFSubSetFile.getIncludedGlyphs | private List getIncludedGlyphs(FontFileReader in, int glyphOffset,
Integer glyphIdx) throws IOException {
List ret = new ArrayList();
ret.add(glyphIdx);
int offset = glyphOffset + (int)mtxTab[glyphIdx.intValue()].getOffset() + 10;
Integer compositeIdx... | java | private List getIncludedGlyphs(FontFileReader in, int glyphOffset,
Integer glyphIdx) throws IOException {
List ret = new ArrayList();
ret.add(glyphIdx);
int offset = glyphOffset + (int)mtxTab[glyphIdx.intValue()].getOffset() + 10;
Integer compositeIdx... | [
"private",
"List",
"getIncludedGlyphs",
"(",
"FontFileReader",
"in",
",",
"int",
"glyphOffset",
",",
"Integer",
"glyphIdx",
")",
"throws",
"IOException",
"{",
"List",
"ret",
"=",
"new",
"ArrayList",
"(",
")",
";",
"ret",
".",
"add",
"(",
"glyphIdx",
")",
"... | Returns a List containing the glyph itself plus all glyphs
that this composite glyph uses
@param in The input from which to determine the included glyphs
@param glyphOffset The offset the glyph
@param glyphIdx The index of the base glyph
@return The list of glyphs building the composite
@throws IOException Indicates a... | [
"Returns",
"a",
"List",
"containing",
"the",
"glyph",
"itself",
"plus",
"all",
"glyphs",
"that",
"this",
"composite",
"glyph",
"uses"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java#L520-L557 |
1,736 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java | TTFSubSetFile.remapComposite | private void remapComposite(FontFileReader in, Map glyphs,
int glyphOffset,
Integer glyphIdx) throws IOException {
int offset = glyphOffset + (int)mtxTab[glyphIdx.intValue()].getOffset()
+ 10;
Integer compositeIdx = nu... | java | private void remapComposite(FontFileReader in, Map glyphs,
int glyphOffset,
Integer glyphIdx) throws IOException {
int offset = glyphOffset + (int)mtxTab[glyphIdx.intValue()].getOffset()
+ 10;
Integer compositeIdx = nu... | [
"private",
"void",
"remapComposite",
"(",
"FontFileReader",
"in",
",",
"Map",
"glyphs",
",",
"int",
"glyphOffset",
",",
"Integer",
"glyphIdx",
")",
"throws",
"IOException",
"{",
"int",
"offset",
"=",
"glyphOffset",
"+",
"(",
"int",
")",
"mtxTab",
"[",
"glyph... | Rewrite all compositepointers in glyphindex glyphIdx
@param in The input from which to remap
@param glyphs The glyphs to remap
@param glyphOffset The offset to start at
@param glyphIdx The index of the glyph
@throws IOException Indicates a failure to read from the font file. | [
"Rewrite",
"all",
"compositepointers",
"in",
"glyphindex",
"glyphIdx"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java#L569-L619 |
1,737 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java | TTFSubSetFile.scanGlyphs | private void scanGlyphs(FontFileReader in,
Map glyphs) throws IOException {
TTFDirTabEntry entry = (TTFDirTabEntry)dirTabs.get("glyf");
Map newComposites = null;
Map allComposites = new java.util.HashMap();
int newIndex = glyphs.size();
if (entry != ... | java | private void scanGlyphs(FontFileReader in,
Map glyphs) throws IOException {
TTFDirTabEntry entry = (TTFDirTabEntry)dirTabs.get("glyf");
Map newComposites = null;
Map allComposites = new java.util.HashMap();
int newIndex = glyphs.size();
if (entry != ... | [
"private",
"void",
"scanGlyphs",
"(",
"FontFileReader",
"in",
",",
"Map",
"glyphs",
")",
"throws",
"IOException",
"{",
"TTFDirTabEntry",
"entry",
"=",
"(",
"TTFDirTabEntry",
")",
"dirTabs",
".",
"get",
"(",
"\"glyf\"",
")",
";",
"Map",
"newComposites",
"=",
... | Scan all the original glyphs for composite glyphs and add those glyphs
to the glyphmapping also rewrite the composite glyph pointers to the new
mapping
@param in The input stream to read the glyphs from
@param glyphs The glyphs map to populate
@throws IOException Indicates a failure to read from the reader | [
"Scan",
"all",
"the",
"original",
"glyphs",
"for",
"composite",
"glyphs",
"and",
"add",
"those",
"glyphs",
"to",
"the",
"glyphmapping",
"also",
"rewrite",
"the",
"composite",
"glyph",
"pointers",
"to",
"the",
"new",
"mapping"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java#L631-L690 |
1,738 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java | TTFSubSetFile.readFont | public byte[] readFont(FontFileReader in, String name,
Map glyphs) throws IOException {
//Check if TrueType collection, and that the name exists in the collection
if (!checkTTC(in, name)) {
throw new IOException("Failed to read font");
}
output = ... | java | public byte[] readFont(FontFileReader in, String name,
Map glyphs) throws IOException {
//Check if TrueType collection, and that the name exists in the collection
if (!checkTTC(in, name)) {
throw new IOException("Failed to read font");
}
output = ... | [
"public",
"byte",
"[",
"]",
"readFont",
"(",
"FontFileReader",
"in",
",",
"String",
"name",
",",
"Map",
"glyphs",
")",
"throws",
"IOException",
"{",
"//Check if TrueType collection, and that the name exists in the collection",
"if",
"(",
"!",
"checkTTC",
"(",
"in",
... | Returns a subset of the original font.
@param in FontFileReader to read from
@param name Name to be checked for in the font file
@param glyphs Map of glyphs (glyphs has old index as (Integer) key and
new index as (Integer) value)
@return A subset of the original font
@throws IOException in case of an I/O problem | [
"Returns",
"a",
"subset",
"of",
"the",
"original",
"font",
"."
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java#L704-L772 |
1,739 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java | TTFSubSetFile.writeUShort | private void writeUShort(int s) {
byte b1 = (byte)((s >> 8) & 0xff);
byte b2 = (byte)(s & 0xff);
writeByte(b1);
writeByte(b2);
} | java | private void writeUShort(int s) {
byte b1 = (byte)((s >> 8) & 0xff);
byte b2 = (byte)(s & 0xff);
writeByte(b1);
writeByte(b2);
} | [
"private",
"void",
"writeUShort",
"(",
"int",
"s",
")",
"{",
"byte",
"b1",
"=",
"(",
"byte",
")",
"(",
"(",
"s",
">>",
"8",
")",
"&",
"0xff",
")",
";",
"byte",
"b2",
"=",
"(",
"byte",
")",
"(",
"s",
"&",
"0xff",
")",
";",
"writeByte",
"(",
... | Appends a USHORT to the output array,
updates currentPost but not realSize
@param s The short to write | [
"Appends",
"a",
"USHORT",
"to",
"the",
"output",
"array",
"updates",
"currentPost",
"but",
"not",
"realSize"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java#L811-L816 |
1,740 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java | TTFSubSetFile.writeUShort | private void writeUShort(int pos, int s) {
byte b1 = (byte)((s >> 8) & 0xff);
byte b2 = (byte)(s & 0xff);
output[pos] = b1;
output[pos + 1] = b2;
} | java | private void writeUShort(int pos, int s) {
byte b1 = (byte)((s >> 8) & 0xff);
byte b2 = (byte)(s & 0xff);
output[pos] = b1;
output[pos + 1] = b2;
} | [
"private",
"void",
"writeUShort",
"(",
"int",
"pos",
",",
"int",
"s",
")",
"{",
"byte",
"b1",
"=",
"(",
"byte",
")",
"(",
"(",
"s",
">>",
"8",
")",
"&",
"0xff",
")",
";",
"byte",
"b2",
"=",
"(",
"byte",
")",
"(",
"s",
"&",
"0xff",
")",
";",... | Appends a USHORT to the output array,
at the given position without changing currentPos
@param pos The position to write to
@param s The short to be written | [
"Appends",
"a",
"USHORT",
"to",
"the",
"output",
"array",
"at",
"the",
"given",
"position",
"without",
"changing",
"currentPos"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java#L825-L830 |
1,741 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java | TTFSubSetFile.writeULong | private void writeULong(int s) {
byte b1 = (byte)((s >> 24) & 0xff);
byte b2 = (byte)((s >> 16) & 0xff);
byte b3 = (byte)((s >> 8) & 0xff);
byte b4 = (byte)(s & 0xff);
writeByte(b1);
writeByte(b2);
writeByte(b3);
writeByte(b4);
} | java | private void writeULong(int s) {
byte b1 = (byte)((s >> 24) & 0xff);
byte b2 = (byte)((s >> 16) & 0xff);
byte b3 = (byte)((s >> 8) & 0xff);
byte b4 = (byte)(s & 0xff);
writeByte(b1);
writeByte(b2);
writeByte(b3);
writeByte(b4);
} | [
"private",
"void",
"writeULong",
"(",
"int",
"s",
")",
"{",
"byte",
"b1",
"=",
"(",
"byte",
")",
"(",
"(",
"s",
">>",
"24",
")",
"&",
"0xff",
")",
";",
"byte",
"b2",
"=",
"(",
"byte",
")",
"(",
"(",
"s",
">>",
"16",
")",
"&",
"0xff",
")",
... | Appends a ULONG to the output array,
updates currentPos but not realSize
@param s The value to write | [
"Appends",
"a",
"ULONG",
"to",
"the",
"output",
"array",
"updates",
"currentPos",
"but",
"not",
"realSize"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java#L838-L847 |
1,742 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java | TTFSubSetFile.readUShort | private int readUShort(int pos) {
int ret = output[pos];
if (ret < 0) {
ret += 256;
}
ret = ret << 8;
if (output[pos + 1] < 0) {
ret |= output[pos + 1] + 256;
} else {
ret |= output[pos + 1];
}
return ret;
} | java | private int readUShort(int pos) {
int ret = output[pos];
if (ret < 0) {
ret += 256;
}
ret = ret << 8;
if (output[pos + 1] < 0) {
ret |= output[pos + 1] + 256;
} else {
ret |= output[pos + 1];
}
return ret;
} | [
"private",
"int",
"readUShort",
"(",
"int",
"pos",
")",
"{",
"int",
"ret",
"=",
"output",
"[",
"pos",
"]",
";",
"if",
"(",
"ret",
"<",
"0",
")",
"{",
"ret",
"+=",
"256",
";",
"}",
"ret",
"=",
"ret",
"<<",
"8",
";",
"if",
"(",
"output",
"[",
... | Read a unsigned short value at given position
@param pos The position from the file to read
@return The short read | [
"Read",
"a",
"unsigned",
"short",
"value",
"at",
"given",
"position"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java#L885-L898 |
1,743 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java | TTFSubSetFile.pad4 | private void pad4() {
int padSize = currentPos % 4;
for (int i = 0; i < padSize; i++) {
output[currentPos++] = 0;
realSize++;
}
} | java | private void pad4() {
int padSize = currentPos % 4;
for (int i = 0; i < padSize; i++) {
output[currentPos++] = 0;
realSize++;
}
} | [
"private",
"void",
"pad4",
"(",
")",
"{",
"int",
"padSize",
"=",
"currentPos",
"%",
"4",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"padSize",
";",
"i",
"++",
")",
"{",
"output",
"[",
"currentPos",
"++",
"]",
"=",
"0",
";",
"realSize... | Create a padding in the fontfile to align
on a 4-byte boundary | [
"Create",
"a",
"padding",
"in",
"the",
"fontfile",
"to",
"align",
"on",
"a",
"4",
"-",
"byte",
"boundary"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java#L904-L910 |
1,744 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java | TTFSubSetFile.getLongCheckSum | private long getLongCheckSum(int start, int size) {
// All the tables here are aligned on four byte boundaries
// Add remainder to size if it's not a multiple of 4
int remainder = size % 4;
if (remainder != 0) {
size += remainder;
}
long sum = 0;
for... | java | private long getLongCheckSum(int start, int size) {
// All the tables here are aligned on four byte boundaries
// Add remainder to size if it's not a multiple of 4
int remainder = size % 4;
if (remainder != 0) {
size += remainder;
}
long sum = 0;
for... | [
"private",
"long",
"getLongCheckSum",
"(",
"int",
"start",
",",
"int",
"size",
")",
"{",
"// All the tables here are aligned on four byte boundaries",
"// Add remainder to size if it's not a multiple of 4",
"int",
"remainder",
"=",
"size",
"%",
"4",
";",
"if",
"(",
"remai... | Get the checksum as a long
@param start The start value
@param size The size of the values to checksum
@return The long checksum | [
"Get",
"the",
"checksum",
"as",
"a",
"long"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFSubSetFile.java#L956-L978 |
1,745 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/gui/TextField.java | TextField.setText | public void setText(String value) {
this.value = value;
if (cursorPos > value.length()) {
cursorPos = value.length();
}
} | java | public void setText(String value) {
this.value = value;
if (cursorPos > value.length()) {
cursorPos = value.length();
}
} | [
"public",
"void",
"setText",
"(",
"String",
"value",
")",
"{",
"this",
".",
"value",
"=",
"value",
";",
"if",
"(",
"cursorPos",
">",
"value",
".",
"length",
"(",
")",
")",
"{",
"cursorPos",
"=",
"value",
".",
"length",
"(",
")",
";",
"}",
"}"
] | Set the value to be displayed in the text field
@param value
The value to be displayed in the text field | [
"Set",
"the",
"value",
"to",
"be",
"displayed",
"in",
"the",
"text",
"field"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/gui/TextField.java#L290-L295 |
1,746 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/gui/TextField.java | TextField.setCursorPos | public void setCursorPos(int pos) {
cursorPos = pos;
if (cursorPos > value.length()) {
cursorPos = value.length();
}
} | java | public void setCursorPos(int pos) {
cursorPos = pos;
if (cursorPos > value.length()) {
cursorPos = value.length();
}
} | [
"public",
"void",
"setCursorPos",
"(",
"int",
"pos",
")",
"{",
"cursorPos",
"=",
"pos",
";",
"if",
"(",
"cursorPos",
">",
"value",
".",
"length",
"(",
")",
")",
"{",
"cursorPos",
"=",
"value",
".",
"length",
"(",
")",
";",
"}",
"}"
] | Set the position of the cursor
@param pos
The new position of the cursor | [
"Set",
"the",
"position",
"of",
"the",
"cursor"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/gui/TextField.java#L303-L308 |
1,747 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/gui/TextField.java | TextField.setMaxLength | public void setMaxLength(int length) {
maxCharacter = length;
if (value.length() > maxCharacter) {
value = value.substring(0, maxCharacter);
}
} | java | public void setMaxLength(int length) {
maxCharacter = length;
if (value.length() > maxCharacter) {
value = value.substring(0, maxCharacter);
}
} | [
"public",
"void",
"setMaxLength",
"(",
"int",
"length",
")",
"{",
"maxCharacter",
"=",
"length",
";",
"if",
"(",
"value",
".",
"length",
"(",
")",
">",
"maxCharacter",
")",
"{",
"value",
"=",
"value",
".",
"substring",
"(",
"0",
",",
"maxCharacter",
")... | Set the length of the allowed input
@param length
The length of the allowed input | [
"Set",
"the",
"length",
"of",
"the",
"allowed",
"input"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/gui/TextField.java#L326-L331 |
1,748 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/gui/TextField.java | TextField.doPaste | protected void doPaste(String text) {
recordOldPosition();
for (int i=0;i<text.length();i++) {
keyPressed(-1, text.charAt(i));
}
} | java | protected void doPaste(String text) {
recordOldPosition();
for (int i=0;i<text.length();i++) {
keyPressed(-1, text.charAt(i));
}
} | [
"protected",
"void",
"doPaste",
"(",
"String",
"text",
")",
"{",
"recordOldPosition",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"text",
".",
"length",
"(",
")",
";",
"i",
"++",
")",
"{",
"keyPressed",
"(",
"-",
"1",
",",
"... | Do the paste into the field, overrideable for custom behaviour
@param text The text to be pasted in | [
"Do",
"the",
"paste",
"into",
"the",
"field",
"overrideable",
"for",
"custom",
"behaviour"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/gui/TextField.java#L338-L344 |
1,749 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/gui/TextField.java | TextField.doUndo | protected void doUndo(int oldCursorPos, String oldText) {
if (oldText != null) {
setText(oldText);
setCursorPos(oldCursorPos);
}
} | java | protected void doUndo(int oldCursorPos, String oldText) {
if (oldText != null) {
setText(oldText);
setCursorPos(oldCursorPos);
}
} | [
"protected",
"void",
"doUndo",
"(",
"int",
"oldCursorPos",
",",
"String",
"oldText",
")",
"{",
"if",
"(",
"oldText",
"!=",
"null",
")",
"{",
"setText",
"(",
"oldText",
")",
";",
"setCursorPos",
"(",
"oldCursorPos",
")",
";",
"}",
"}"
] | Do the undo of the paste, overrideable for custom behaviour
@param oldCursorPos before the paste
@param oldText The text before the last paste | [
"Do",
"the",
"undo",
"of",
"the",
"paste",
"overrideable",
"for",
"custom",
"behaviour"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/gui/TextField.java#L360-L365 |
1,750 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/FontData.java | FontData.getPlain | public static FontData getPlain(String familyName) {
FontData data = (FontData) plain.get(familyName);
return data;
} | java | public static FontData getPlain(String familyName) {
FontData data = (FontData) plain.get(familyName);
return data;
} | [
"public",
"static",
"FontData",
"getPlain",
"(",
"String",
"familyName",
")",
"{",
"FontData",
"data",
"=",
"(",
"FontData",
")",
"plain",
".",
"get",
"(",
"familyName",
")",
";",
"return",
"data",
";",
"}"
] | Get the plain version of a family name
@param familyName The font family to retrieve
@return The plain version of the font or null if no plain version exits | [
"Get",
"the",
"plain",
"version",
"of",
"a",
"family",
"name"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/FontData.java#L101-L105 |
1,751 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/FontData.java | FontData.getBold | public static FontData getBold(String familyName) {
FontData data = (FontData) bold.get(familyName);
return data;
} | java | public static FontData getBold(String familyName) {
FontData data = (FontData) bold.get(familyName);
return data;
} | [
"public",
"static",
"FontData",
"getBold",
"(",
"String",
"familyName",
")",
"{",
"FontData",
"data",
"=",
"(",
"FontData",
")",
"bold",
".",
"get",
"(",
"familyName",
")",
";",
"return",
"data",
";",
"}"
] | Get the bold version of the font
@param familyName The name of the font family
@return The bold version of the font or null if no bold version exists | [
"Get",
"the",
"bold",
"version",
"of",
"the",
"font"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/FontData.java#L113-L117 |
1,752 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/FontData.java | FontData.getBoldItalic | public static FontData getBoldItalic(String familyName) {
FontData data = (FontData) bolditalic.get(familyName);
return data;
} | java | public static FontData getBoldItalic(String familyName) {
FontData data = (FontData) bolditalic.get(familyName);
return data;
} | [
"public",
"static",
"FontData",
"getBoldItalic",
"(",
"String",
"familyName",
")",
"{",
"FontData",
"data",
"=",
"(",
"FontData",
")",
"bolditalic",
".",
"get",
"(",
"familyName",
")",
";",
"return",
"data",
";",
"}"
] | Get the bold italic version of the font
@param familyName The name of the font family
@return The bold italic version of the font or null if no bold italic version exists | [
"Get",
"the",
"bold",
"italic",
"version",
"of",
"the",
"font"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/FontData.java#L125-L129 |
1,753 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/FontData.java | FontData.getItalic | public static FontData getItalic(String familyName) {
FontData data = (FontData) italic.get(familyName);
return data;
} | java | public static FontData getItalic(String familyName) {
FontData data = (FontData) italic.get(familyName);
return data;
} | [
"public",
"static",
"FontData",
"getItalic",
"(",
"String",
"familyName",
")",
"{",
"FontData",
"data",
"=",
"(",
"FontData",
")",
"italic",
".",
"get",
"(",
"familyName",
")",
";",
"return",
"data",
";",
"}"
] | Get the italic version of the font
@param familyName The name of the font family
@return The italic version of the font or null if no italic version exists | [
"Get",
"the",
"italic",
"version",
"of",
"the",
"font"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/FontData.java#L137-L141 |
1,754 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/FontData.java | FontData.getStyled | public static FontData getStyled(String familyName, int style) {
boolean b = (style & Font.BOLD) != 0;
boolean i = (style & Font.ITALIC) != 0;
if (b & i) {
return getBoldItalic(familyName);
} else if (b) {
return getBold(familyName);
} else if (i) {
return getItalic(familyName);
} else ... | java | public static FontData getStyled(String familyName, int style) {
boolean b = (style & Font.BOLD) != 0;
boolean i = (style & Font.ITALIC) != 0;
if (b & i) {
return getBoldItalic(familyName);
} else if (b) {
return getBold(familyName);
} else if (i) {
return getItalic(familyName);
} else ... | [
"public",
"static",
"FontData",
"getStyled",
"(",
"String",
"familyName",
",",
"int",
"style",
")",
"{",
"boolean",
"b",
"=",
"(",
"style",
"&",
"Font",
".",
"BOLD",
")",
"!=",
"0",
";",
"boolean",
"i",
"=",
"(",
"style",
"&",
"Font",
".",
"ITALIC",
... | Get a styled version of a particular font family
@param familyName The name of the font family
@param style The style (@see java.awt.Font#PLAIN)
@return The styled font or null if no such font exists | [
"Get",
"a",
"styled",
"version",
"of",
"a",
"particular",
"font",
"family"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/FontData.java#L150-L163 |
1,755 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/FontData.java | FontData.processFontDirectory | private static void processFontDirectory(File dir, ArrayList fonts) {
if (!dir.exists()) {
return;
}
if (processed.contains(dir)) {
return;
}
processed.add(dir);
File[] sources = dir.listFiles();
if (sources == null) {
return;
}
for (int j=0;j<sources.length;j++) {
Fil... | java | private static void processFontDirectory(File dir, ArrayList fonts) {
if (!dir.exists()) {
return;
}
if (processed.contains(dir)) {
return;
}
processed.add(dir);
File[] sources = dir.listFiles();
if (sources == null) {
return;
}
for (int j=0;j<sources.length;j++) {
Fil... | [
"private",
"static",
"void",
"processFontDirectory",
"(",
"File",
"dir",
",",
"ArrayList",
"fonts",
")",
"{",
"if",
"(",
"!",
"dir",
".",
"exists",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"processed",
".",
"contains",
"(",
"dir",
")",
")",... | Process a directory potentially full of fonts
@param dir The directory of fonts to process
@param fonts The fonts list to add to | [
"Process",
"a",
"directory",
"potentially",
"full",
"of",
"fonts"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/FontData.java#L171-L233 |
1,756 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/FontData.java | FontData.getAllFonts | public static FontData[] getAllFonts() {
if (fonts == null) {
fonts = new ArrayList();
String os = System.getProperty("os.name");
File[] locs = new File[0];
if (os.startsWith("Windows")) {
locs = win32;
}
if (os.startsWith("Linux")) {
locs = linux;
}
if (os.startsW... | java | public static FontData[] getAllFonts() {
if (fonts == null) {
fonts = new ArrayList();
String os = System.getProperty("os.name");
File[] locs = new File[0];
if (os.startsWith("Windows")) {
locs = win32;
}
if (os.startsWith("Linux")) {
locs = linux;
}
if (os.startsW... | [
"public",
"static",
"FontData",
"[",
"]",
"getAllFonts",
"(",
")",
"{",
"if",
"(",
"fonts",
"==",
"null",
")",
"{",
"fonts",
"=",
"new",
"ArrayList",
"(",
")",
";",
"String",
"os",
"=",
"System",
".",
"getProperty",
"(",
"\"os.name\"",
")",
";",
"Fil... | Get all the fonts available
@return The list of fonts available | [
"Get",
"all",
"the",
"fonts",
"available"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/FontData.java#L240-L270 |
1,757 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/FontData.java | FontData.locateLinuxFonts | private static void locateLinuxFonts(File file) {
if (!file.exists()) {
System.err.println("Unable to open: "+file.getAbsolutePath());
return;
}
try {
InputStream in = new FileInputStream(file);
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
ByteArrayOutputStre... | java | private static void locateLinuxFonts(File file) {
if (!file.exists()) {
System.err.println("Unable to open: "+file.getAbsolutePath());
return;
}
try {
InputStream in = new FileInputStream(file);
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
ByteArrayOutputStre... | [
"private",
"static",
"void",
"locateLinuxFonts",
"(",
"File",
"file",
")",
"{",
"if",
"(",
"!",
"file",
".",
"exists",
"(",
")",
")",
"{",
"System",
".",
"err",
".",
"println",
"(",
"\"Unable to open: \"",
"+",
"file",
".",
"getAbsolutePath",
"(",
")",
... | Locate the linux fonts based on the XML configuration file
@param file The location of the XML file | [
"Locate",
"the",
"linux",
"fonts",
"based",
"on",
"the",
"XML",
"configuration",
"file"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/FontData.java#L277-L331 |
1,758 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/FontData.java | FontData.deriveFont | public FontData deriveFont(float size, int style) {
FontData original = getStyled(getFamilyName(), style);
FontData data = new FontData();
data.size = size;
data.javaFont = original.javaFont.deriveFont(style, size);
data.upem = upem;
data.ansiKerning = ansiKerning;
data.charWidth = charWidth;
... | java | public FontData deriveFont(float size, int style) {
FontData original = getStyled(getFamilyName(), style);
FontData data = new FontData();
data.size = size;
data.javaFont = original.javaFont.deriveFont(style, size);
data.upem = upem;
data.ansiKerning = ansiKerning;
data.charWidth = charWidth;
... | [
"public",
"FontData",
"deriveFont",
"(",
"float",
"size",
",",
"int",
"style",
")",
"{",
"FontData",
"original",
"=",
"getStyled",
"(",
"getFamilyName",
"(",
")",
",",
"style",
")",
";",
"FontData",
"data",
"=",
"new",
"FontData",
"(",
")",
";",
"data",
... | Derive a new version of this font based on a new size
@param size The size of the new font
@param style The style of the new font
@return The new font data | [
"Derive",
"a",
"new",
"version",
"of",
"this",
"font",
"based",
"on",
"a",
"new",
"size"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/FontData.java#L438-L448 |
1,759 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/FontData.java | FontData.getKerning | public int getKerning(char first, char second) {
Map toMap = (Map) ansiKerning.get(new Integer(first));
if (toMap == null) {
return 0;
}
Integer kerning = (Integer) toMap.get(new Integer(second));
if (kerning == null) {
return 0;
}
return Math.round(convertUnitToEm(size, kerning.int... | java | public int getKerning(char first, char second) {
Map toMap = (Map) ansiKerning.get(new Integer(first));
if (toMap == null) {
return 0;
}
Integer kerning = (Integer) toMap.get(new Integer(second));
if (kerning == null) {
return 0;
}
return Math.round(convertUnitToEm(size, kerning.int... | [
"public",
"int",
"getKerning",
"(",
"char",
"first",
",",
"char",
"second",
")",
"{",
"Map",
"toMap",
"=",
"(",
"Map",
")",
"ansiKerning",
".",
"get",
"(",
"new",
"Integer",
"(",
"first",
")",
")",
";",
"if",
"(",
"toMap",
"==",
"null",
")",
"{",
... | Get the kerning value between two characters
@param first The first character
@param second The second character
@return The amount of kerning to apply between the two characters | [
"Get",
"the",
"kerning",
"value",
"between",
"two",
"characters"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/FontData.java#L493-L505 |
1,760 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/opengl/ImageDataFactory.java | ImageDataFactory.checkProperty | private static void checkProperty() {
if (!pngLoaderPropertyChecked) {
pngLoaderPropertyChecked = true;
try {
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
String val = System.getProperty(PNG_LOADER);
if ("false".equalsIgnoreCase(val)) {
... | java | private static void checkProperty() {
if (!pngLoaderPropertyChecked) {
pngLoaderPropertyChecked = true;
try {
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
String val = System.getProperty(PNG_LOADER);
if ("false".equalsIgnoreCase(val)) {
... | [
"private",
"static",
"void",
"checkProperty",
"(",
")",
"{",
"if",
"(",
"!",
"pngLoaderPropertyChecked",
")",
"{",
"pngLoaderPropertyChecked",
"=",
"true",
";",
"try",
"{",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedAction",
"(",
")",
"{",
... | Check PNG loader property. If set the native PNG loader will
not be used. | [
"Check",
"PNG",
"loader",
"property",
".",
"If",
"set",
"the",
"native",
"PNG",
"loader",
"will",
"not",
"be",
"used",
"."
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/opengl/ImageDataFactory.java#L28-L48 |
1,761 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/opengl/ImageDataFactory.java | ImageDataFactory.getImageDataFor | public static LoadableImageData getImageDataFor(String ref) {
LoadableImageData imageData;
checkProperty();
ref = ref.toLowerCase();
if (ref.endsWith(".tga")) {
return new TGAImageData();
}
if (ref.endsWith(".png")) {
CompositeImageData data = new Composi... | java | public static LoadableImageData getImageDataFor(String ref) {
LoadableImageData imageData;
checkProperty();
ref = ref.toLowerCase();
if (ref.endsWith(".tga")) {
return new TGAImageData();
}
if (ref.endsWith(".png")) {
CompositeImageData data = new Composi... | [
"public",
"static",
"LoadableImageData",
"getImageDataFor",
"(",
"String",
"ref",
")",
"{",
"LoadableImageData",
"imageData",
";",
"checkProperty",
"(",
")",
";",
"ref",
"=",
"ref",
".",
"toLowerCase",
"(",
")",
";",
"if",
"(",
"ref",
".",
"endsWith",
"(",
... | Create an image data that is appropriate for the reference supplied
@param ref The reference to the image to retrieve
@return The image data that can be used to retrieve the data for that resource | [
"Create",
"an",
"image",
"data",
"that",
"is",
"appropriate",
"for",
"the",
"reference",
"supplied"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/opengl/ImageDataFactory.java#L56-L76 |
1,762 | nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFDirTabEntry.java | TTFDirTabEntry.read | public String read(FontFileReader in) throws IOException {
tag[0] = in.readTTFByte();
tag[1] = in.readTTFByte();
tag[2] = in.readTTFByte();
tag[3] = in.readTTFByte();
in.skip(4); // Skip checksum
offset = in.readTTFULong();
length = in.readTTFULong();
... | java | public String read(FontFileReader in) throws IOException {
tag[0] = in.readTTFByte();
tag[1] = in.readTTFByte();
tag[2] = in.readTTFByte();
tag[3] = in.readTTFByte();
in.skip(4); // Skip checksum
offset = in.readTTFULong();
length = in.readTTFULong();
... | [
"public",
"String",
"read",
"(",
"FontFileReader",
"in",
")",
"throws",
"IOException",
"{",
"tag",
"[",
"0",
"]",
"=",
"in",
".",
"readTTFByte",
"(",
")",
";",
"tag",
"[",
"1",
"]",
"=",
"in",
".",
"readTTFByte",
"(",
")",
";",
"tag",
"[",
"2",
"... | Read Dir Tab, return tag name
@param in The stream to read from
@return The string read
@throws IOException Indicates a failure to read from the stream | [
"Read",
"Dir",
"Tab",
"return",
"tag",
"name"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/truetype/TTFDirTabEntry.java#L46-L59 |
1,763 | nguillaumin/slick2d-maven | slick2d-peditor/src/main/java/org/newdawn/slick/tools/peditor/WhiskasPanel.java | WhiskasPanel.addEnableControl | private void addEnableControl(String text, ItemListener listener) {
JCheckBox enableControl = new JCheckBox("Enable " + text);
enableControl.setBounds(10, offset, 200, 20);
enableControl.addItemListener(listener);
add(enableControl);
controlToValueName.put(enableControl, text);
valueNameToControl.pu... | java | private void addEnableControl(String text, ItemListener listener) {
JCheckBox enableControl = new JCheckBox("Enable " + text);
enableControl.setBounds(10, offset, 200, 20);
enableControl.addItemListener(listener);
add(enableControl);
controlToValueName.put(enableControl, text);
valueNameToControl.pu... | [
"private",
"void",
"addEnableControl",
"(",
"String",
"text",
",",
"ItemListener",
"listener",
")",
"{",
"JCheckBox",
"enableControl",
"=",
"new",
"JCheckBox",
"(",
"\"Enable \"",
"+",
"text",
")",
";",
"enableControl",
".",
"setBounds",
"(",
"10",
",",
"offse... | Add a control for enablement
@param text The label to be associated with the check box
@param listener The listener to be notified of updates to the new control | [
"Add",
"a",
"control",
"for",
"enablement"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-peditor/src/main/java/org/newdawn/slick/tools/peditor/WhiskasPanel.java#L79-L88 |
1,764 | nguillaumin/slick2d-maven | slick2d-peditor/src/main/java/org/newdawn/slick/tools/peditor/WhiskasPanel.java | WhiskasPanel.itemStateChangedHandler | public void itemStateChangedHandler(ItemEvent e) {
String valueName = (String) controlToValueName.get(e.getSource());
LinearInterpolator value = (LinearInterpolator) valueMap.get(valueName);
if (e.getStateChange() == ItemEvent.SELECTED) {
value.setActive(true);
editor.registerValue(value, valueName);... | java | public void itemStateChangedHandler(ItemEvent e) {
String valueName = (String) controlToValueName.get(e.getSource());
LinearInterpolator value = (LinearInterpolator) valueMap.get(valueName);
if (e.getStateChange() == ItemEvent.SELECTED) {
value.setActive(true);
editor.registerValue(value, valueName);... | [
"public",
"void",
"itemStateChangedHandler",
"(",
"ItemEvent",
"e",
")",
"{",
"String",
"valueName",
"=",
"(",
"String",
")",
"controlToValueName",
".",
"get",
"(",
"e",
".",
"getSource",
"(",
")",
")",
";",
"LinearInterpolator",
"value",
"=",
"(",
"LinearIn... | Notificaiton that one of the configuration option has changed state
@param e The event describing the change of state | [
"Notificaiton",
"that",
"one",
"of",
"the",
"configuration",
"option",
"has",
"changed",
"state"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-peditor/src/main/java/org/newdawn/slick/tools/peditor/WhiskasPanel.java#L95-L106 |
1,765 | nguillaumin/slick2d-maven | slick2d-peditor/src/main/java/org/newdawn/slick/tools/peditor/WhiskasPanel.java | WhiskasPanel.linkToEmitter | private void linkToEmitter(String name, LinearInterpolator interpol) {
// put to value map
valueMap.put(name, interpol);
// now update the checkbox to represent the state of the given
// interpolator
boolean checked = interpol.isActive();
JCheckBox enableControl = (JCheckBox) valueNameToControl.get(... | java | private void linkToEmitter(String name, LinearInterpolator interpol) {
// put to value map
valueMap.put(name, interpol);
// now update the checkbox to represent the state of the given
// interpolator
boolean checked = interpol.isActive();
JCheckBox enableControl = (JCheckBox) valueNameToControl.get(... | [
"private",
"void",
"linkToEmitter",
"(",
"String",
"name",
",",
"LinearInterpolator",
"interpol",
")",
"{",
"// put to value map\r",
"valueMap",
".",
"put",
"(",
"name",
",",
"interpol",
")",
";",
"// now update the checkbox to represent the state of the given\r",
"// int... | Link this set of controls to a linear interpolater within the particle emitter
@param name The name of the article emitter being linked
@param interpol The interpolator being configured | [
"Link",
"this",
"set",
"of",
"controls",
"to",
"a",
"linear",
"interpolater",
"within",
"the",
"particle",
"emitter"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-peditor/src/main/java/org/newdawn/slick/tools/peditor/WhiskasPanel.java#L141-L152 |
1,766 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/font/effects/ShadowEffect.java | ShadowEffect.blur | private void blur(BufferedImage image) {
float[] matrix = GAUSSIAN_BLUR_KERNELS[blurKernelSize - 1];
Kernel gaussianBlur1 = new Kernel(matrix.length, 1, matrix);
Kernel gaussianBlur2 = new Kernel(1, matrix.length, matrix);
RenderingHints hints = new RenderingHints(RenderingHints.KEY_RENDERING, RenderingHint... | java | private void blur(BufferedImage image) {
float[] matrix = GAUSSIAN_BLUR_KERNELS[blurKernelSize - 1];
Kernel gaussianBlur1 = new Kernel(matrix.length, 1, matrix);
Kernel gaussianBlur2 = new Kernel(1, matrix.length, matrix);
RenderingHints hints = new RenderingHints(RenderingHints.KEY_RENDERING, RenderingHint... | [
"private",
"void",
"blur",
"(",
"BufferedImage",
"image",
")",
"{",
"float",
"[",
"]",
"matrix",
"=",
"GAUSSIAN_BLUR_KERNELS",
"[",
"blurKernelSize",
"-",
"1",
"]",
";",
"Kernel",
"gaussianBlur1",
"=",
"new",
"Kernel",
"(",
"matrix",
".",
"length",
",",
"1... | Apply blurring to the generate image
@param image The image to be blurred | [
"Apply",
"blurring",
"to",
"the",
"generate",
"image"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/font/effects/ShadowEffect.java#L97-L109 |
1,767 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/opengl/InternalTextureLoader.java | InternalTextureLoader.getTexture | public Texture getTexture(File source, boolean flipped,int filter) throws IOException {
String resourceName = source.getAbsolutePath();
InputStream in = new FileInputStream(source);
return getTexture(in, resourceName, flipped, filter, null);
} | java | public Texture getTexture(File source, boolean flipped,int filter) throws IOException {
String resourceName = source.getAbsolutePath();
InputStream in = new FileInputStream(source);
return getTexture(in, resourceName, flipped, filter, null);
} | [
"public",
"Texture",
"getTexture",
"(",
"File",
"source",
",",
"boolean",
"flipped",
",",
"int",
"filter",
")",
"throws",
"IOException",
"{",
"String",
"resourceName",
"=",
"source",
".",
"getAbsolutePath",
"(",
")",
";",
"InputStream",
"in",
"=",
"new",
"Fi... | Get a texture from a specific file
@param source The file to load the texture from
@param flipped True if we should flip the texture on the y axis while loading
@param filter The filter to use
@return The texture loaded
@throws IOException Indicates a failure to load the image | [
"Get",
"a",
"texture",
"from",
"a",
"specific",
"file"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/opengl/InternalTextureLoader.java#L135-L140 |
1,768 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/opengl/InternalTextureLoader.java | InternalTextureLoader.getTexture | public Texture getTexture(String resourceName, boolean flipped, int filter) throws IOException {
InputStream in = ResourceLoader.getResourceAsStream(resourceName);
return getTexture(in, resourceName, flipped, filter, null);
} | java | public Texture getTexture(String resourceName, boolean flipped, int filter) throws IOException {
InputStream in = ResourceLoader.getResourceAsStream(resourceName);
return getTexture(in, resourceName, flipped, filter, null);
} | [
"public",
"Texture",
"getTexture",
"(",
"String",
"resourceName",
",",
"boolean",
"flipped",
",",
"int",
"filter",
")",
"throws",
"IOException",
"{",
"InputStream",
"in",
"=",
"ResourceLoader",
".",
"getResourceAsStream",
"(",
"resourceName",
")",
";",
"return",
... | Get a texture from a resource location
@param resourceName The location to load the texture from
@param flipped True if we should flip the texture on the y axis while loading
@param filter The filter to use when scaling the texture
@return The texture loaded
@throws IOException Indicates a failure to load the image | [
"Get",
"a",
"texture",
"from",
"a",
"resource",
"location"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/opengl/InternalTextureLoader.java#L168-L172 |
1,769 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/opengl/InternalTextureLoader.java | InternalTextureLoader.reload | public void reload() {
Iterator texs = texturesLinear.values().iterator();
while (texs.hasNext()) {
((TextureImpl) texs.next()).reload();
}
texs = texturesNearest.values().iterator();
while (texs.hasNext()) {
((TextureImpl) texs.next()).reload();
}
} | java | public void reload() {
Iterator texs = texturesLinear.values().iterator();
while (texs.hasNext()) {
((TextureImpl) texs.next()).reload();
}
texs = texturesNearest.values().iterator();
while (texs.hasNext()) {
((TextureImpl) texs.next()).reload();
}
} | [
"public",
"void",
"reload",
"(",
")",
"{",
"Iterator",
"texs",
"=",
"texturesLinear",
".",
"values",
"(",
")",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"texs",
".",
"hasNext",
"(",
")",
")",
"{",
"(",
"(",
"TextureImpl",
")",
"texs",
".",
"nex... | Reload all the textures loaded in this loader | [
"Reload",
"all",
"the",
"textures",
"loaded",
"in",
"this",
"loader"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/opengl/InternalTextureLoader.java#L486-L495 |
1,770 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/opengl/InternalTextureLoader.java | InternalTextureLoader.reload | public int reload(TextureImpl texture, int srcPixelFormat, int componentCount,
int minFilter, int magFilter, ByteBuffer textureBuffer) {
int target = SGL.GL_TEXTURE_2D;
int textureID = createTextureID();
GL.glBindTexture(target, textureID);
GL.glTexParameteri(target, SGL... | java | public int reload(TextureImpl texture, int srcPixelFormat, int componentCount,
int minFilter, int magFilter, ByteBuffer textureBuffer) {
int target = SGL.GL_TEXTURE_2D;
int textureID = createTextureID();
GL.glBindTexture(target, textureID);
GL.glTexParameteri(target, SGL... | [
"public",
"int",
"reload",
"(",
"TextureImpl",
"texture",
",",
"int",
"srcPixelFormat",
",",
"int",
"componentCount",
",",
"int",
"minFilter",
",",
"int",
"magFilter",
",",
"ByteBuffer",
"textureBuffer",
")",
"{",
"int",
"target",
"=",
"SGL",
".",
"GL_TEXTURE_... | Reload a given texture blob
@param texture The texture being reloaded
@param srcPixelFormat The source pixel format
@param componentCount The component count
@param minFilter The minification filter
@param magFilter The magnification filter
@param textureBuffer The pixel data
@return The ID of the newly created textur... | [
"Reload",
"a",
"given",
"texture",
"blob"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/opengl/InternalTextureLoader.java#L508-L529 |
1,771 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/PackedSpriteSheet.java | PackedSpriteSheet.getSprite | public Image getSprite(String name) {
Section section = (Section) sections.get(name);
if (section == null) {
throw new RuntimeException("Unknown sprite from packed sheet: "+name);
}
return image.getSubImage(section.x, section.y, section.width, section.height);
} | java | public Image getSprite(String name) {
Section section = (Section) sections.get(name);
if (section == null) {
throw new RuntimeException("Unknown sprite from packed sheet: "+name);
}
return image.getSubImage(section.x, section.y, section.width, section.height);
} | [
"public",
"Image",
"getSprite",
"(",
"String",
"name",
")",
"{",
"Section",
"section",
"=",
"(",
"Section",
")",
"sections",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"section",
"==",
"null",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Un... | Get a single named sprite from the sheet
@param name The name of the sprite to retrieve
@return The sprite requested (image of) | [
"Get",
"a",
"single",
"named",
"sprite",
"from",
"the",
"sheet"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/PackedSpriteSheet.java#L96-L104 |
1,772 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/PackedSpriteSheet.java | PackedSpriteSheet.getSpriteSheet | public SpriteSheet getSpriteSheet(String name) {
Image image = getSprite(name);
Section section = (Section) sections.get(name);
return new SpriteSheet(image, section.width / section.tilesx, section.height / section.tilesy);
} | java | public SpriteSheet getSpriteSheet(String name) {
Image image = getSprite(name);
Section section = (Section) sections.get(name);
return new SpriteSheet(image, section.width / section.tilesx, section.height / section.tilesy);
} | [
"public",
"SpriteSheet",
"getSpriteSheet",
"(",
"String",
"name",
")",
"{",
"Image",
"image",
"=",
"getSprite",
"(",
"name",
")",
";",
"Section",
"section",
"=",
"(",
"Section",
")",
"sections",
".",
"get",
"(",
"name",
")",
";",
"return",
"new",
"Sprite... | Get a sprite sheet that has been packed into the greater image
@param name The name of the sprite sheet to retrieve
@return The sprite sheet from the packed sheet | [
"Get",
"a",
"sprite",
"sheet",
"that",
"has",
"been",
"packed",
"into",
"the",
"greater",
"image"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/PackedSpriteSheet.java#L112-L117 |
1,773 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/PackedSpriteSheet.java | PackedSpriteSheet.loadDefinition | private void loadDefinition(String def, Color trans) throws SlickException {
BufferedReader reader = new BufferedReader(new InputStreamReader(ResourceLoader.getResourceAsStream(def)));
try {
image = new Image(basePath+reader.readLine(), false, filter, trans);
while (reader.ready()) {
if (reader.re... | java | private void loadDefinition(String def, Color trans) throws SlickException {
BufferedReader reader = new BufferedReader(new InputStreamReader(ResourceLoader.getResourceAsStream(def)));
try {
image = new Image(basePath+reader.readLine(), false, filter, trans);
while (reader.ready()) {
if (reader.re... | [
"private",
"void",
"loadDefinition",
"(",
"String",
"def",
",",
"Color",
"trans",
")",
"throws",
"SlickException",
"{",
"BufferedReader",
"reader",
"=",
"new",
"BufferedReader",
"(",
"new",
"InputStreamReader",
"(",
"ResourceLoader",
".",
"getResourceAsStream",
"(",... | Load the definition file and parse each of the sections
@param def The location of the definitions file
@param trans The color to be treated as transparent
@throws SlickException Indicates a failure to read or parse the definitions file
or referenced image. | [
"Load",
"the",
"definition",
"file",
"and",
"parse",
"each",
"of",
"the",
"sections"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/PackedSpriteSheet.java#L127-L148 |
1,774 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/geom/MannTriangulator.java | MannTriangulator.reset | public void reset() {
while (holes != null) {
holes = freePointBag(holes);
}
contour.clear();
holes = null;
} | java | public void reset() {
while (holes != null) {
holes = freePointBag(holes);
}
contour.clear();
holes = null;
} | [
"public",
"void",
"reset",
"(",
")",
"{",
"while",
"(",
"holes",
"!=",
"null",
")",
"{",
"holes",
"=",
"freePointBag",
"(",
"holes",
")",
";",
"}",
"contour",
".",
"clear",
"(",
")",
";",
"holes",
"=",
"null",
";",
"}"
] | Reset the internal state of the triangulator | [
"Reset",
"the",
"internal",
"state",
"of",
"the",
"triangulator"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/geom/MannTriangulator.java#L69-L76 |
1,775 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/geom/MannTriangulator.java | MannTriangulator.addPoint | private void addPoint(Vector2f pt) {
if (holes == null) {
Point p = getPoint(pt);
contour.add(p);
} else {
Point p = getPoint(pt);
holes.add(p);
}
} | java | private void addPoint(Vector2f pt) {
if (holes == null) {
Point p = getPoint(pt);
contour.add(p);
} else {
Point p = getPoint(pt);
holes.add(p);
}
} | [
"private",
"void",
"addPoint",
"(",
"Vector2f",
"pt",
")",
"{",
"if",
"(",
"holes",
"==",
"null",
")",
"{",
"Point",
"p",
"=",
"getPoint",
"(",
"pt",
")",
";",
"contour",
".",
"add",
"(",
"p",
")",
";",
"}",
"else",
"{",
"Point",
"p",
"=",
"get... | Add a defined point to the current contour
@param pt The point to add | [
"Add",
"a",
"defined",
"point",
"to",
"the",
"current",
"contour"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/geom/MannTriangulator.java#L92-L100 |
1,776 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/geom/MannTriangulator.java | MannTriangulator.freePointBag | private PointBag freePointBag(PointBag pb) {
PointBag next = pb.next;
pb.clear();
pb.next = nextFreePointBag;
nextFreePointBag = pb;
return next;
} | java | private PointBag freePointBag(PointBag pb) {
PointBag next = pb.next;
pb.clear();
pb.next = nextFreePointBag;
nextFreePointBag = pb;
return next;
} | [
"private",
"PointBag",
"freePointBag",
"(",
"PointBag",
"pb",
")",
"{",
"PointBag",
"next",
"=",
"pb",
".",
"next",
";",
"pb",
".",
"clear",
"(",
")",
";",
"pb",
".",
"next",
"=",
"nextFreePointBag",
";",
"nextFreePointBag",
"=",
"pb",
";",
"return",
"... | Release a pooled bag
@param pb The bag to release
@return The next available bag | [
"Release",
"a",
"pooled",
"bag"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/geom/MannTriangulator.java#L244-L250 |
1,777 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/geom/MannTriangulator.java | MannTriangulator.getPoint | private Point getPoint(Vector2f pt) {
Point p = nextFreePoint;
if (p != null) {
nextFreePoint = p.next;
// initialize new point to safe values
p.next = null;
p.prev = null;
p.pt = pt;
return p;
}
return new Point(pt);
} | java | private Point getPoint(Vector2f pt) {
Point p = nextFreePoint;
if (p != null) {
nextFreePoint = p.next;
// initialize new point to safe values
p.next = null;
p.prev = null;
p.pt = pt;
return p;
}
return new Point(pt);
} | [
"private",
"Point",
"getPoint",
"(",
"Vector2f",
"pt",
")",
"{",
"Point",
"p",
"=",
"nextFreePoint",
";",
"if",
"(",
"p",
"!=",
"null",
")",
"{",
"nextFreePoint",
"=",
"p",
".",
"next",
";",
"// initialize new point to safe values\r",
"p",
".",
"next",
"="... | Create or reuse a point
@param pt The point data to set
@return The new point | [
"Create",
"or",
"reuse",
"a",
"point"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/geom/MannTriangulator.java#L258-L269 |
1,778 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/geom/MannTriangulator.java | MannTriangulator.freePoints | private void freePoints(Point head) {
head.prev.next = nextFreePoint;
head.prev = null;
nextFreePoint = head;
} | java | private void freePoints(Point head) {
head.prev.next = nextFreePoint;
head.prev = null;
nextFreePoint = head;
} | [
"private",
"void",
"freePoints",
"(",
"Point",
"head",
")",
"{",
"head",
".",
"prev",
".",
"next",
"=",
"nextFreePoint",
";",
"head",
".",
"prev",
"=",
"null",
";",
"nextFreePoint",
"=",
"head",
";",
"}"
] | Release all points
@param head The head of the points bag | [
"Release",
"all",
"points"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/geom/MannTriangulator.java#L286-L290 |
1,779 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/openal/OpenALStreamPlayer.java | OpenALStreamPlayer.initStreams | private void initStreams() throws IOException {
if (audio != null) {
audio.close();
}
OggInputStream audio;
if (url != null) {
audio = new OggInputStream(url.openStream());
} else {
audio = new OggInputStream(ResourceLoader.getResourceAsStream(ref));
}
this.audio = audio;
... | java | private void initStreams() throws IOException {
if (audio != null) {
audio.close();
}
OggInputStream audio;
if (url != null) {
audio = new OggInputStream(url.openStream());
} else {
audio = new OggInputStream(ResourceLoader.getResourceAsStream(ref));
}
this.audio = audio;
... | [
"private",
"void",
"initStreams",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"audio",
"!=",
"null",
")",
"{",
"audio",
".",
"close",
"(",
")",
";",
"}",
"OggInputStream",
"audio",
";",
"if",
"(",
"url",
"!=",
"null",
")",
"{",
"audio",
"=",
... | Initialise our connection to the underlying resource
@throws IOException Indicates a failure to open the underling resource | [
"Initialise",
"our",
"connection",
"to",
"the",
"underlying",
"resource"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/openal/OpenALStreamPlayer.java#L89-L104 |
1,780 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/openal/OpenALStreamPlayer.java | OpenALStreamPlayer.play | public void play(boolean loop) throws IOException {
this.loop = loop;
initStreams();
done = false;
AL10.alSourceStop(source);
removeBuffers();
startPlayback();
} | java | public void play(boolean loop) throws IOException {
this.loop = loop;
initStreams();
done = false;
AL10.alSourceStop(source);
removeBuffers();
startPlayback();
} | [
"public",
"void",
"play",
"(",
"boolean",
"loop",
")",
"throws",
"IOException",
"{",
"this",
".",
"loop",
"=",
"loop",
";",
"initStreams",
"(",
")",
";",
"done",
"=",
"false",
";",
"AL10",
".",
"alSourceStop",
"(",
"source",
")",
";",
"removeBuffers",
... | Start this stream playing
@param loop True if the stream should loop
@throws IOException Indicates a failure to read from the stream | [
"Start",
"this",
"stream",
"playing"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/openal/OpenALStreamPlayer.java#L135-L145 |
1,781 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/openal/OpenALStreamPlayer.java | OpenALStreamPlayer.stream | public boolean stream(int bufferId) {
try {
int count = audio.read(buffer);
if (count != -1) {
bufferData.clear();
bufferData.put(buffer,0,count);
bufferData.flip();
int format = audio.getChannels() > 1 ? AL10.AL_FORMAT_STEREO16 : AL10.AL_FORMAT_MONO16;
try {
AL10.alBuff... | java | public boolean stream(int bufferId) {
try {
int count = audio.read(buffer);
if (count != -1) {
bufferData.clear();
bufferData.put(buffer,0,count);
bufferData.flip();
int format = audio.getChannels() > 1 ? AL10.AL_FORMAT_STEREO16 : AL10.AL_FORMAT_MONO16;
try {
AL10.alBuff... | [
"public",
"boolean",
"stream",
"(",
"int",
"bufferId",
")",
"{",
"try",
"{",
"int",
"count",
"=",
"audio",
".",
"read",
"(",
"buffer",
")",
";",
"if",
"(",
"count",
"!=",
"-",
"1",
")",
"{",
"bufferData",
".",
"clear",
"(",
")",
";",
"bufferData",
... | Stream some data from the audio stream to the buffer indicates by the ID
@param bufferId The ID of the buffer to fill
@return True if another section was available | [
"Stream",
"some",
"data",
"from",
"the",
"audio",
"stream",
"to",
"the",
"buffer",
"indicates",
"by",
"the",
"ID"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/openal/OpenALStreamPlayer.java#L219-L250 |
1,782 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/openal/OpenALStreamPlayer.java | OpenALStreamPlayer.setPosition | public boolean setPosition(float position) {
try {
if (getPosition() > position) {
initStreams();
}
float sampleRate = audio.getRate();
float sampleSize;
if (audio.getChannels() > 1) {
sampleSize = 4; // AL10.AL_FORMAT_STEREO16
} else {
sampleSize = 2; // AL10.AL_FORMAT_MONO1... | java | public boolean setPosition(float position) {
try {
if (getPosition() > position) {
initStreams();
}
float sampleRate = audio.getRate();
float sampleSize;
if (audio.getChannels() > 1) {
sampleSize = 4; // AL10.AL_FORMAT_STEREO16
} else {
sampleSize = 2; // AL10.AL_FORMAT_MONO1... | [
"public",
"boolean",
"setPosition",
"(",
"float",
"position",
")",
"{",
"try",
"{",
"if",
"(",
"getPosition",
"(",
")",
">",
"position",
")",
"{",
"initStreams",
"(",
")",
";",
"}",
"float",
"sampleRate",
"=",
"audio",
".",
"getRate",
"(",
")",
";",
... | Seeks to a position in the music.
@param position Position in seconds.
@return True if the setting of the position was successful | [
"Seeks",
"to",
"a",
"position",
"in",
"the",
"music",
"."
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/openal/OpenALStreamPlayer.java#L258-L294 |
1,783 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/openal/OpenALStreamPlayer.java | OpenALStreamPlayer.startPlayback | private void startPlayback() {
AL10.alSourcei(source, AL10.AL_LOOPING, AL10.AL_FALSE);
AL10.alSourcef(source, AL10.AL_PITCH, pitch);
remainingBufferCount = BUFFER_COUNT;
for (int i = 0; i < BUFFER_COUNT; i++) {
stream(bufferNames.get(i));
}
AL10.alSourceQueueBuffers(source, bufferNames);
... | java | private void startPlayback() {
AL10.alSourcei(source, AL10.AL_LOOPING, AL10.AL_FALSE);
AL10.alSourcef(source, AL10.AL_PITCH, pitch);
remainingBufferCount = BUFFER_COUNT;
for (int i = 0; i < BUFFER_COUNT; i++) {
stream(bufferNames.get(i));
}
AL10.alSourceQueueBuffers(source, bufferNames);
... | [
"private",
"void",
"startPlayback",
"(",
")",
"{",
"AL10",
".",
"alSourcei",
"(",
"source",
",",
"AL10",
".",
"AL_LOOPING",
",",
"AL10",
".",
"AL_FALSE",
")",
";",
"AL10",
".",
"alSourcef",
"(",
"source",
",",
"AL10",
".",
"AL_PITCH",
",",
"pitch",
")"... | Starts the streaming. | [
"Starts",
"the",
"streaming",
"."
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/openal/OpenALStreamPlayer.java#L299-L311 |
1,784 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/particles/ParticleSystem.java | ParticleSystem.reset | public void reset() {
Iterator pools = particlesByEmitter.values().iterator();
while (pools.hasNext()) {
ParticlePool pool = (ParticlePool) pools.next();
pool.reset(this);
}
for (int i=0;i<emitters.size();i++) {
ParticleEmitter emitter = (ParticleEmitter) emitters.get(i);
emitter.resetSt... | java | public void reset() {
Iterator pools = particlesByEmitter.values().iterator();
while (pools.hasNext()) {
ParticlePool pool = (ParticlePool) pools.next();
pool.reset(this);
}
for (int i=0;i<emitters.size();i++) {
ParticleEmitter emitter = (ParticleEmitter) emitters.get(i);
emitter.resetSt... | [
"public",
"void",
"reset",
"(",
")",
"{",
"Iterator",
"pools",
"=",
"particlesByEmitter",
".",
"values",
"(",
")",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"pools",
".",
"hasNext",
"(",
")",
")",
"{",
"ParticlePool",
"pool",
"=",
"(",
"ParticlePoo... | Reset the state of the system | [
"Reset",
"the",
"state",
"of",
"the",
"system"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/particles/ParticleSystem.java#L156-L167 |
1,785 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/particles/ParticleSystem.java | ParticleSystem.addEmitter | public void addEmitter(ParticleEmitter emitter) {
emitters.add(emitter);
ParticlePool pool= new ParticlePool( this, maxParticlesPerEmitter );
particlesByEmitter.put( emitter, pool );
} | java | public void addEmitter(ParticleEmitter emitter) {
emitters.add(emitter);
ParticlePool pool= new ParticlePool( this, maxParticlesPerEmitter );
particlesByEmitter.put( emitter, pool );
} | [
"public",
"void",
"addEmitter",
"(",
"ParticleEmitter",
"emitter",
")",
"{",
"emitters",
".",
"add",
"(",
"emitter",
")",
";",
"ParticlePool",
"pool",
"=",
"new",
"ParticlePool",
"(",
"this",
",",
"maxParticlesPerEmitter",
")",
";",
"particlesByEmitter",
".",
... | Add a particle emitter to be used on this system
@param emitter The emitter to be added | [
"Add",
"a",
"particle",
"emitter",
"to",
"be",
"used",
"on",
"this",
"system"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/particles/ParticleSystem.java#L319-L324 |
1,786 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/particles/ParticleSystem.java | ParticleSystem.removeAllEmitters | public void removeAllEmitters() {
for (int i=0;i<emitters.size();i++) {
removeEmitter((ParticleEmitter) emitters.get(i));
i--;
}
} | java | public void removeAllEmitters() {
for (int i=0;i<emitters.size();i++) {
removeEmitter((ParticleEmitter) emitters.get(i));
i--;
}
} | [
"public",
"void",
"removeAllEmitters",
"(",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"emitters",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"removeEmitter",
"(",
"(",
"ParticleEmitter",
")",
"emitters",
".",
"get",
"(",
"i",... | Remove all the emitters from the system | [
"Remove",
"all",
"the",
"emitters",
"from",
"the",
"system"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/particles/ParticleSystem.java#L339-L344 |
1,787 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/particles/ParticleSystem.java | ParticleSystem.render | public void render(float x, float y) {
if ((sprite == null) && (defaultImageName != null)) {
loadSystemParticleImage();
}
if (!visible) {
return;
}
GL.glTranslatef(x,y,0);
if (blendingMode == BLEND_ADDITIVE) {
GL.glBlendFunc(SGL.GL_SRC_ALPHA, SGL.GL_ONE);
}
if (usePoints(... | java | public void render(float x, float y) {
if ((sprite == null) && (defaultImageName != null)) {
loadSystemParticleImage();
}
if (!visible) {
return;
}
GL.glTranslatef(x,y,0);
if (blendingMode == BLEND_ADDITIVE) {
GL.glBlendFunc(SGL.GL_SRC_ALPHA, SGL.GL_ONE);
}
if (usePoints(... | [
"public",
"void",
"render",
"(",
"float",
"x",
",",
"float",
"y",
")",
"{",
"if",
"(",
"(",
"sprite",
"==",
"null",
")",
"&&",
"(",
"defaultImageName",
"!=",
"null",
")",
")",
"{",
"loadSystemParticleImage",
"(",
")",
";",
"}",
"if",
"(",
"!",
"vis... | Render the particles in the system
@param x The x coordinate to render the particle system at (in the current coordinate space)
@param y The y coordinate to render the particle system at (in the current coordiante space) | [
"Render",
"the",
"particles",
"in",
"the",
"system"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/particles/ParticleSystem.java#L389-L459 |
1,788 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/particles/ParticleSystem.java | ParticleSystem.loadSystemParticleImage | private void loadSystemParticleImage() {
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
try {
if (mask != null) {
sprite = new Image(defaultImageName, mask);
} else {
sprite = new Image(defaultImageName);
... | java | private void loadSystemParticleImage() {
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
try {
if (mask != null) {
sprite = new Image(defaultImageName, mask);
} else {
sprite = new Image(defaultImageName);
... | [
"private",
"void",
"loadSystemParticleImage",
"(",
")",
"{",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedAction",
"(",
")",
"{",
"public",
"Object",
"run",
"(",
")",
"{",
"try",
"{",
"if",
"(",
"mask",
"!=",
"null",
")",
"{",
"sprite",
... | Load the system particle image as the extension permissions | [
"Load",
"the",
"system",
"particle",
"image",
"as",
"the",
"extension",
"permissions"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/particles/ParticleSystem.java#L464-L480 |
1,789 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/particles/ParticleSystem.java | ParticleSystem.update | public void update(int delta) {
if ((sprite == null) && (defaultImageName != null)) {
loadSystemParticleImage();
}
removeMe.clear();
ArrayList emitters = new ArrayList(this.emitters);
for (int i=0;i<emitters.size();i++) {
ParticleEmitter emitter = (ParticleEmitter) emitters.get(i);
if (em... | java | public void update(int delta) {
if ((sprite == null) && (defaultImageName != null)) {
loadSystemParticleImage();
}
removeMe.clear();
ArrayList emitters = new ArrayList(this.emitters);
for (int i=0;i<emitters.size();i++) {
ParticleEmitter emitter = (ParticleEmitter) emitters.get(i);
if (em... | [
"public",
"void",
"update",
"(",
"int",
"delta",
")",
"{",
"if",
"(",
"(",
"sprite",
"==",
"null",
")",
"&&",
"(",
"defaultImageName",
"!=",
"null",
")",
")",
"{",
"loadSystemParticleImage",
"(",
")",
";",
"}",
"removeMe",
".",
"clear",
"(",
")",
";"... | Update the system, request the assigned emitters update the particles
@param delta The amount of time thats passed since last update in milliseconds | [
"Update",
"the",
"system",
"request",
"the",
"assigned",
"emitters",
"update",
"the",
"particles"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/particles/ParticleSystem.java#L487-L527 |
1,790 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/particles/ParticleSystem.java | ParticleSystem.getNewParticle | public Particle getNewParticle(ParticleEmitter emitter, float life)
{
ParticlePool pool = (ParticlePool) particlesByEmitter.get(emitter);
ArrayList available = pool.available;
if (available.size() > 0)
{
Particle p = (Particle) available.remove(available.size()-1);
p.init(emitter, life);
p.set... | java | public Particle getNewParticle(ParticleEmitter emitter, float life)
{
ParticlePool pool = (ParticlePool) particlesByEmitter.get(emitter);
ArrayList available = pool.available;
if (available.size() > 0)
{
Particle p = (Particle) available.remove(available.size()-1);
p.init(emitter, life);
p.set... | [
"public",
"Particle",
"getNewParticle",
"(",
"ParticleEmitter",
"emitter",
",",
"float",
"life",
")",
"{",
"ParticlePool",
"pool",
"=",
"(",
"ParticlePool",
")",
"particlesByEmitter",
".",
"get",
"(",
"emitter",
")",
";",
"ArrayList",
"available",
"=",
"pool",
... | Get a new particle from the system. This should be used by emitters to
request particles
@param emitter The emitter requesting the particle
@param life The time the new particle should live for
@return A particle from the system | [
"Get",
"a",
"new",
"particle",
"from",
"the",
"system",
".",
"This",
"should",
"be",
"used",
"by",
"emitters",
"to",
"request",
"particles"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/particles/ParticleSystem.java#L546-L561 |
1,791 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/particles/ParticleSystem.java | ParticleSystem.release | public void release(Particle particle) {
if (particle != dummy)
{
ParticlePool pool = (ParticlePool)particlesByEmitter.get( particle.getEmitter() );
pool.available.add(particle);
}
} | java | public void release(Particle particle) {
if (particle != dummy)
{
ParticlePool pool = (ParticlePool)particlesByEmitter.get( particle.getEmitter() );
pool.available.add(particle);
}
} | [
"public",
"void",
"release",
"(",
"Particle",
"particle",
")",
"{",
"if",
"(",
"particle",
"!=",
"dummy",
")",
"{",
"ParticlePool",
"pool",
"=",
"(",
"ParticlePool",
")",
"particlesByEmitter",
".",
"get",
"(",
"particle",
".",
"getEmitter",
"(",
")",
")",
... | Release a particle back to the system once it has expired
@param particle The particle to be released | [
"Release",
"a",
"particle",
"back",
"to",
"the",
"system",
"once",
"it",
"has",
"expired"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/particles/ParticleSystem.java#L568-L574 |
1,792 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/particles/ParticleSystem.java | ParticleSystem.releaseAll | public void releaseAll(ParticleEmitter emitter) {
if( !particlesByEmitter.isEmpty() )
{
Iterator it= particlesByEmitter.values().iterator();
while( it.hasNext())
{
ParticlePool pool= (ParticlePool)it.next();
for (int i=0;i<pool.particles.length;i++) {
if (pool.particles[i].inUse()) {
... | java | public void releaseAll(ParticleEmitter emitter) {
if( !particlesByEmitter.isEmpty() )
{
Iterator it= particlesByEmitter.values().iterator();
while( it.hasNext())
{
ParticlePool pool= (ParticlePool)it.next();
for (int i=0;i<pool.particles.length;i++) {
if (pool.particles[i].inUse()) {
... | [
"public",
"void",
"releaseAll",
"(",
"ParticleEmitter",
"emitter",
")",
"{",
"if",
"(",
"!",
"particlesByEmitter",
".",
"isEmpty",
"(",
")",
")",
"{",
"Iterator",
"it",
"=",
"particlesByEmitter",
".",
"values",
"(",
")",
".",
"iterator",
"(",
")",
";",
"... | Release all the particles owned by the specified emitter
@param emitter The emitter owning the particles that should be released | [
"Release",
"all",
"the",
"particles",
"owned",
"by",
"the",
"specified",
"emitter"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/particles/ParticleSystem.java#L581-L598 |
1,793 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/particles/ParticleSystem.java | ParticleSystem.moveAll | public void moveAll(ParticleEmitter emitter, float x, float y) {
ParticlePool pool = (ParticlePool) particlesByEmitter.get(emitter);
for (int i=0;i<pool.particles.length;i++) {
if (pool.particles[i].inUse()) {
pool.particles[i].move(x, y);
}
}
} | java | public void moveAll(ParticleEmitter emitter, float x, float y) {
ParticlePool pool = (ParticlePool) particlesByEmitter.get(emitter);
for (int i=0;i<pool.particles.length;i++) {
if (pool.particles[i].inUse()) {
pool.particles[i].move(x, y);
}
}
} | [
"public",
"void",
"moveAll",
"(",
"ParticleEmitter",
"emitter",
",",
"float",
"x",
",",
"float",
"y",
")",
"{",
"ParticlePool",
"pool",
"=",
"(",
"ParticlePool",
")",
"particlesByEmitter",
".",
"get",
"(",
"emitter",
")",
";",
"for",
"(",
"int",
"i",
"="... | Move all the particles owned by the specified emitter
@param emitter The emitter owning the particles that should be released
@param x The amount on the x axis to move the particles
@param y The amount on the y axis to move the particles | [
"Move",
"all",
"the",
"particles",
"owned",
"by",
"the",
"specified",
"emitter"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/particles/ParticleSystem.java#L607-L614 |
1,794 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/particles/ParticleSystem.java | ParticleSystem.duplicate | public ParticleSystem duplicate() throws SlickException {
for (int i=0;i<emitters.size();i++) {
if (!(emitters.get(i) instanceof ConfigurableEmitter)) {
throw new SlickException("Only systems contianing configurable emitters can be duplicated");
}
}
ParticleSystem theCopy = null;
try {
B... | java | public ParticleSystem duplicate() throws SlickException {
for (int i=0;i<emitters.size();i++) {
if (!(emitters.get(i) instanceof ConfigurableEmitter)) {
throw new SlickException("Only systems contianing configurable emitters can be duplicated");
}
}
ParticleSystem theCopy = null;
try {
B... | [
"public",
"ParticleSystem",
"duplicate",
"(",
")",
"throws",
"SlickException",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"emitters",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"if",
"(",
"!",
"(",
"emitters",
".",
"get",
"(",
"i... | Create a duplicate of this system. This would have been nicer as a different interface
but may cause to much API change headache. Maybe next full version release it should be
rethought.
TODO: Consider refactor at next point release
@return A copy of this particle system
@throws SlickException Indicates a failure duri... | [
"Create",
"a",
"duplicate",
"of",
"this",
"system",
".",
"This",
"would",
"have",
"been",
"nicer",
"as",
"a",
"different",
"interface",
"but",
"may",
"cause",
"to",
"much",
"API",
"change",
"headache",
".",
"Maybe",
"next",
"full",
"version",
"release",
"i... | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/particles/ParticleSystem.java#L626-L645 |
1,795 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/opengl/renderer/Renderer.java | Renderer.setRenderer | public static void setRenderer(int type) {
switch (type) {
case IMMEDIATE_RENDERER:
setRenderer(new ImmediateModeOGLRenderer());
return;
case VERTEX_ARRAY_RENDERER:
setRenderer(new VAOGLRenderer());
return;
}
throw new RuntimeException("Unknown renderer type: "+type);
} | java | public static void setRenderer(int type) {
switch (type) {
case IMMEDIATE_RENDERER:
setRenderer(new ImmediateModeOGLRenderer());
return;
case VERTEX_ARRAY_RENDERER:
setRenderer(new VAOGLRenderer());
return;
}
throw new RuntimeException("Unknown renderer type: "+type);
} | [
"public",
"static",
"void",
"setRenderer",
"(",
"int",
"type",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"IMMEDIATE_RENDERER",
":",
"setRenderer",
"(",
"new",
"ImmediateModeOGLRenderer",
"(",
")",
")",
";",
"return",
";",
"case",
"VERTEX_ARRAY_RENDERE... | Set the renderer to one of the known types
@param type The type of renderer to use | [
"Set",
"the",
"renderer",
"to",
"one",
"of",
"the",
"known",
"types"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/opengl/renderer/Renderer.java#L32-L43 |
1,796 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/opengl/renderer/Renderer.java | Renderer.setLineStripRenderer | public static void setLineStripRenderer(int type) {
switch (type) {
case DEFAULT_LINE_STRIP_RENDERER:
setLineStripRenderer(new DefaultLineStripRenderer());
return;
case QUAD_BASED_LINE_STRIP_RENDERER:
setLineStripRenderer(new QuadBasedLineStripRenderer());
return;
}
throw new RuntimeE... | java | public static void setLineStripRenderer(int type) {
switch (type) {
case DEFAULT_LINE_STRIP_RENDERER:
setLineStripRenderer(new DefaultLineStripRenderer());
return;
case QUAD_BASED_LINE_STRIP_RENDERER:
setLineStripRenderer(new QuadBasedLineStripRenderer());
return;
}
throw new RuntimeE... | [
"public",
"static",
"void",
"setLineStripRenderer",
"(",
"int",
"type",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"DEFAULT_LINE_STRIP_RENDERER",
":",
"setLineStripRenderer",
"(",
"new",
"DefaultLineStripRenderer",
"(",
")",
")",
";",
"return",
";",
"cas... | Set the line strip renderer to one of the known types
@param type The type of renderer to use | [
"Set",
"the",
"line",
"strip",
"renderer",
"to",
"one",
"of",
"the",
"known",
"types"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/opengl/renderer/Renderer.java#L50-L61 |
1,797 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/geom/Transform.java | Transform.transform | public void transform(float source[], int sourceOffset, float destination[], int destOffset, int numberOfPoints) {
//TODO performance can be improved by removing the safety to the destination array
float result[] = source == destination ? new float[numberOfPoints * 2] : destination;
... | java | public void transform(float source[], int sourceOffset, float destination[], int destOffset, int numberOfPoints) {
//TODO performance can be improved by removing the safety to the destination array
float result[] = source == destination ? new float[numberOfPoints * 2] : destination;
... | [
"public",
"void",
"transform",
"(",
"float",
"source",
"[",
"]",
",",
"int",
"sourceOffset",
",",
"float",
"destination",
"[",
"]",
",",
"int",
"destOffset",
",",
"int",
"numberOfPoints",
")",
"{",
"//TODO performance can be improved by removing the safety to the dest... | Transform the point pairs in the source array and store them in the destination array.
All operations will be done before storing the results in the destination. This way the source
and destination array can be the same without worry of overwriting information before it is transformed.
@param source Array of floats c... | [
"Transform",
"the",
"point",
"pairs",
"in",
"the",
"source",
"array",
"and",
"store",
"them",
"in",
"the",
"destination",
"array",
".",
"All",
"operations",
"will",
"be",
"done",
"before",
"storing",
"the",
"results",
"in",
"the",
"destination",
".",
"This",... | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/geom/Transform.java#L92-L109 |
1,798 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/geom/Transform.java | Transform.concatenate | public Transform concatenate(Transform tx) {
float[] mp = new float[9];
float n00 = matrixPosition[0] * tx.matrixPosition[0] + matrixPosition[1] * tx.matrixPosition[3];
float n01 = matrixPosition[0] * tx.matrixPosition[1] + matrixPosition[1] * tx.matrixPosition[4];
float n02 = matrixPosition[... | java | public Transform concatenate(Transform tx) {
float[] mp = new float[9];
float n00 = matrixPosition[0] * tx.matrixPosition[0] + matrixPosition[1] * tx.matrixPosition[3];
float n01 = matrixPosition[0] * tx.matrixPosition[1] + matrixPosition[1] * tx.matrixPosition[4];
float n02 = matrixPosition[... | [
"public",
"Transform",
"concatenate",
"(",
"Transform",
"tx",
")",
"{",
"float",
"[",
"]",
"mp",
"=",
"new",
"float",
"[",
"9",
"]",
";",
"float",
"n00",
"=",
"matrixPosition",
"[",
"0",
"]",
"*",
"tx",
".",
"matrixPosition",
"[",
"0",
"]",
"+",
"m... | Update this Transform by concatenating the given Transform to this one.
@param tx The Transfrom to concatenate to this one.
@return The resulting Transform | [
"Update",
"this",
"Transform",
"by",
"concatenating",
"the",
"given",
"Transform",
"to",
"this",
"one",
"."
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/geom/Transform.java#L117-L141 |
1,799 | nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/geom/Transform.java | Transform.createRotateTransform | public static Transform createRotateTransform(float angle) {
return new Transform((float)FastTrig.cos(angle), -(float)FastTrig.sin(angle), 0, (float)FastTrig.sin(angle), (float)FastTrig.cos(angle), 0);
} | java | public static Transform createRotateTransform(float angle) {
return new Transform((float)FastTrig.cos(angle), -(float)FastTrig.sin(angle), 0, (float)FastTrig.sin(angle), (float)FastTrig.cos(angle), 0);
} | [
"public",
"static",
"Transform",
"createRotateTransform",
"(",
"float",
"angle",
")",
"{",
"return",
"new",
"Transform",
"(",
"(",
"float",
")",
"FastTrig",
".",
"cos",
"(",
"angle",
")",
",",
"-",
"(",
"float",
")",
"FastTrig",
".",
"sin",
"(",
"angle",... | Create a new rotation Transform
@param angle The angle in radians to set the transform.
@return The resulting Transform | [
"Create",
"a",
"new",
"rotation",
"Transform"
] | 8251f88a0ed6a70e726d2468842455cd1f80893f | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/geom/Transform.java#L172-L174 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.