Skip to content

Instantly share code, notes, and snippets.

View jrenner's full-sized avatar

Jon Renner jrenner

  • Minneapolis, Minnesota, USA
View GitHub Profile
@jrenner
jrenner / font-writing-saving.java
Last active August 29, 2015 13:56
write generated fonts
/** Convenience method for generating a font, and then writing the fnt and png files.
* Writing a generated font to files allows the possibility of only generating the fonts when they are missing, otherwise
* loading from a previously generated file.
* @param fontFile
* @param fontSize
*/
private static BitmapFont generateFontWriteFiles(String fontName, FileHandle fontFile, int fontSize, int pageWidth, int pageHeight) {
FreeTypeFontGenerator generator = new FreeTypeFontGenerator(fontFile);
PixmapPacker packer = new PixmapPacker(pageWidth, pageHeight, Format.RGBA8888, 2, false);
#!/bin/bash
ROBO="/Users/jonrenner/robovm"
MISSILE="/Users/jonrenner/projects/missile-designer"
OUT="$MISSILE/out/production"
STARTER_CLASS_FILE="$MISSILE/ios/src/org/jrenner/superior/ios/RoboVMStarter.java"
IOS_LIBS="$MISSILE/ios/libs"
MAIN_LIBS="$MISSILE/main/libs"
EXT_LIBS="$IOS_LIBS/ios/libgdx.a:$IOS_LIBS/ios/libObjectAL.a:$IOS_LIBS/ios/libgdx-freetype.a"
Jons-Mac-mini:missile-designer jonrenner$ ./run-robo.sh robo
RoboVM/JavaC utility script v0.01 - by github.com/jrenner
RoboVM Compile Bash Script
Linking 2980 classes
Building executable /var/folders/42/gstp6b3n0b78990dfn5tf9x80000gn/T/robovm5767984756372582062.tmp/org.jrenner.superior.ios.RoboVMStarter
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -o /var/folders/42/gstp6b3n0b78990dfn5tf9x80000gn/T/robovm5767984756372582062.tmp/org.jrenner.superior.ios.RoboVMStarter -g -arch i386 -Wl,-filelist,/var/folders/42/gstp6b3n0b78990dfn5tf9x80000gn/T/robovm5767984756372582062.tmp/objects -L /Users/jonrenner/robovm/lib/vm/ios/x86 -ObjC -exported_symbols_list /var/folders/42/gstp6b3n0b78990dfn5tf9x80000gn/T/robovm5767984756372582062.tmp/exported_symbols -Wl,-no_implicit_dylibs -Wl,-dead_strip -mios-simulator-version-min=5.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -lrobovm-bc -force_load
RoboVM Compile Bash Script
Compiling robokot.RobokotPackage (linux x86)
Compiling jet.runtime.typeinfo.JetValueParameter (linux x86)
Compiling kotlin.jvm.internal.KotlinPackage (linux x86)
Compiling robokot.RobokotPackage-Start-80c4f241 (linux x86)
Compiling kotlin.io.IoPackage (linux x86)
Compiling kotlin.ByteIterator (linux x86)
Compiling kotlin.Function1 (linux x86)
Compiling kotlin.Function2 (linux x86)
Compiling kotlin.io.IoPackage-Files-7bf2ec89 (linux x86)
fun StringBuilder.plus(added: String?): StringBuilder {
this.append(added ?: "null")
return this
}
fun example() {
val sb = StringBuilder()
sb + "hello" + "I" + "am" + "a" + "StringBuilder".toString()
}
Vector3 forwardInRest = Vector3.Z; // object's front is facing Z
Vector3 target = tmp.set(Input.worldMouse); // object should face mouse
q.setFromCross(forwardInRest, target.sub(pos).nor());
gameObj.transform.set(q);
gameObj.transform.setTranslation(pos);
package org.jrenner.tac;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Mesh;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.VertexAttributes;
import com.badlogic.gdx.graphics.g3d.Material;
import com.badlogic.gdx.graphics.g3d.Model;
@jrenner
jrenner / heightmapmodel.java
Created August 30, 2014 03:55
HeightMapModel.java
package org.jrenner.tac;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Mesh;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.VertexAttributes;
import com.badlogic.gdx.graphics.g3d.Material;
import com.badlogic.gdx.graphics.g3d.Model;
@jrenner
jrenner / groundchunk.java
Created August 30, 2014 07:53
GroundChunk.java
public class GroundChunk extends ModelInstance implements Visible {
private static final BoundingBox box = new BoundingBox();
public Vector3 position;
public Vector3 dimensions;
public float radius;
public GroundChunk(Model model) {
super(model);
calculateTransforms();
calculateBoundingBox(box);
@jrenner
jrenner / kot-strings-bytecode
Created October 12, 2014 14:00
testing kotlin string concatenation bytecode results
fun test() {
val x = "a" + "b" + "c"
}
fun test2() {
val sb = StringBuilder()
sb.append("a").append("b").append("c")
val x = sb.toString()
}