Android Open Source - TinyVoxel Desktop Config From Project Back to project page TinyVoxel .
License The source code is released under:
GNU General Public License
If you think the Android project TinyVoxel listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code package com.toet.TinyVoxel.desktop;
/ / f r o m w w w . j a v a 2 s . c o m
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.glutils.ShaderProgram;
import com.badlogic.gdx.math.Matrix4;
import com.badlogic.gdx.utils.BufferUtils;
import com.toet.TinyVoxel.Config;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
/**
* Created by Kajos on 8/30/2014.
*/
public class DesktopConfig extends Config {
private static IntBuffer paletteBuffer = BufferUtils.newIntBuffer(Config.TINY_GRID_TOTAL * Config.GRID_TOTAL);
private static IntBuffer tinyPaletteBuffer = BufferUtils.newIntBuffer(Config.TINY_GRID_TOTAL);
@Override
public void putPalette(int color) {
paletteBuffer.put(color);
}
@Override
public void putSinglePalette(int color) {
tinyPaletteBuffer.put(color);
}
@Override
public void uploadPalette(int width, int height) {
paletteBuffer.rewind();
Gdx.graphics.getGL20().glPixelStorei(GL20.GL_UNPACK_ALIGNMENT, 1);
Gdx.graphics.getGL20().glTexImage2D(GL20.GL_TEXTURE_2D, 0, GL20.GL_RGBA, width, height, 0,
GL20.GL_RGBA,
GL20.GL_UNSIGNED_BYTE, paletteBuffer);
}
@Override
public void uploadSinglePalette(int paletteId) {
tinyPaletteBuffer.rewind();
Gdx.graphics.getGL20().glPixelStorei(GL20.GL_UNPACK_ALIGNMENT, 1);
Gdx.graphics.getGL20().glTexSubImage2D(GL20.GL_TEXTURE_2D, 0, 0, paletteId, Config.TINY_GRID_TOTAL, 1,
GL20.GL_RGBA,
GL20.GL_UNSIGNED_BYTE, tinyPaletteBuffer);
}
@Override
public void rewindPalette() {
paletteBuffer.rewind();
}
@Override
public void rewindSinglePalette() {
tinyPaletteBuffer.rewind();
}
@Override
public int getLOD() {
return 60000;
}
@Override
public boolean getPostFBOShader() {
return false;
}
@Override
public boolean getTransparentTools() {
return true;
}
}
Java Source Code List com.badlogic.gdx.backends.gwt.GwtApplicationConfiguration.java com.badlogic.gdx.backends.gwt.GwtApplication.java com.badlogic.gdx.backends.gwt.GwtGL20.java com.badlogic.gdx.backends.gwt.GwtInput.java com.badlogic.gdx.backends.gwt.GwtNet.java com.badlogic.gdx.graphics.Pixmap.java com.toet.TinyVoxel.Config.java com.toet.TinyVoxel.Game.java com.toet.TinyVoxel.IOSConfig.java com.toet.TinyVoxel.IOSLauncher.java com.toet.TinyVoxel.OuyaController.java com.toet.TinyVoxel.Time.java com.toet.TinyVoxel.Character.Character.java com.toet.TinyVoxel.Debug.LogHandler.java com.toet.TinyVoxel.GameControllers.CharacterController.java com.toet.TinyVoxel.GameControllers.CustomTouchPad.java com.toet.TinyVoxel.GameControllers.KeyBoardController.java com.toet.TinyVoxel.GameControllers.TouchPadController.java com.toet.TinyVoxel.Importer.BinvoxImporter.java com.toet.TinyVoxel.Importer.DataInputStream.java com.toet.TinyVoxel.Importer.MeshImporter.java com.toet.TinyVoxel.Renderer.BlockBuilder.java com.toet.TinyVoxel.Renderer.Floor.java com.toet.TinyVoxel.Renderer.Manager.java com.toet.TinyVoxel.Renderer.Bundles.ArrayBundle.java com.toet.TinyVoxel.Renderer.Bundles.Bundle.java com.toet.TinyVoxel.Renderer.Bundles.GridBundle.java com.toet.TinyVoxel.Renderer.Bundles.GridInterface.java com.toet.TinyVoxel.Renderer.Bundles.Grid.java com.toet.TinyVoxel.Renderer.Bundles.GroundBundle.java com.toet.TinyVoxel.Renderer.Bundles.SingleBundle.java com.toet.TinyVoxel.Renderer.Bundles.TinyGrid.java com.toet.TinyVoxel.Renderer.Tools.BrushUtils.java com.toet.TinyVoxel.Renderer.Tools.GridUtils.java com.toet.TinyVoxel.Renderer.Wrapped.WrappedBoolean.java com.toet.TinyVoxel.Renderer.Wrapped.WrappedInteger.java com.toet.TinyVoxel.Screens.GUI.java com.toet.TinyVoxel.Screens.Menu.java com.toet.TinyVoxel.Shaders.ShaderManager.java com.toet.TinyVoxel.Shadow.ShadowManager.java com.toet.TinyVoxel.Util.Box.java com.toet.TinyVoxel.Util.FullscreenQuad.java com.toet.TinyVoxel.Util.JobManager.java com.toet.TinyVoxel.Util.NonBackedTexture.java com.toet.TinyVoxel.Util.Position.java com.toet.TinyVoxel.Util.RLEInputStream.java com.toet.TinyVoxel.Util.RLEOutputStream.java com.toet.TinyVoxel.Util.SimpleMath.java com.toet.TinyVoxel.Util.StreamUtil.java com.toet.TinyVoxel.android.AndroidConfig.java com.toet.TinyVoxel.android.AndroidConfig.java com.toet.TinyVoxel.android.AndroidLauncher.java com.toet.TinyVoxel.android.AndroidLauncher.java com.toet.TinyVoxel.client.GwtConfig.java com.toet.TinyVoxel.client.HtmlLauncher.java com.toet.TinyVoxel.desktop.DesktopConfig.java com.toet.TinyVoxel.desktop.DesktopLauncher.java