Skip to content
Browse files

Decided on a version system:

 - all files that I assume done, are marked with a 1.0.0 tag
 - changes will increase the minor/major numbers
 - if I'm not done with a file it will be marked wit 0.x.0
 - this display the progress I think I made
  • Loading branch information...
1 parent b2f30f4 commit 0c95e61ed4801af1ba283c256d2715581c094c34 @Regiden committed
View
8 _RadicalFishDebug/src/de/radicalfish/debug/DebugPanel.java
@@ -49,7 +49,7 @@
* add {@link ResizableFrame}.
*
* @author Stefan Lange
- * @version 0.5.0
+ * @version 1.0.0
* @since 15.08.2012
*/
public class DebugPanel {
@@ -85,7 +85,6 @@ public void update() {
}
public void render() {
gui.draw();
-
}
public void addToRoot(Widget widget) {
@@ -96,10 +95,7 @@ public void addToRoot(Widget widget) {
// INTERN METHODS
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
private void createGUI(GameContainer container, String path) throws RadicalFishException {
- Logger.info("Initiating Debug...");
-
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
-
try {
root = new TWLRootPane();
root.setTheme("");
@@ -124,8 +120,6 @@ private void createGUI(GameContainer container, String path) throws RadicalFishE
TWLInputForwarder inputForwarder = new TWLInputForwarder(gui);
container.getInput().addPrimaryListener(inputForwarder);
-
- Logger.info("Debug successfully loaded!");
} catch (Throwable e) {
throw new RadicalFishException("Could not initialize TWL GUI", e);
} finally {
View
46 _RadicalFishGDX/src/de/radicalfish/GameContainer.java
@@ -62,7 +62,7 @@
* is the container is paused, it will not call any update or render code.
*
* @author Stefan Lange
- * @version 0.5.0
+ * @version 1.0.0
* @since 08.08.2012
*/
public class GameContainer implements ApplicationListener {
@@ -118,6 +118,7 @@
*/
public boolean clearScreen = true;
+ private boolean createYUp = false;
private boolean created = false;
private boolean running = true;
private boolean canSetFullScreen = true;
@@ -239,7 +240,7 @@ public void create() {
Logger.info(new Date() + " System: " + logSystemOS());
Logger.info(new Date() + " Original DisplayMode: " + Gdx.graphics.getDesktopDisplayMode());
currentDisplayMode = getCurrentDisplayMode();
- Logger.info(new Date() + " Current DisplayMode: " + currentDisplayMode);
+ Logger.info(new Date() + " Target DisplayMode: " + currentDisplayMode);
// set gdx stuff
input = new GameInput();
@@ -249,6 +250,9 @@ public void create() {
// init Graphics context which should work like the one in Slick2D
graphics = new Graphics(width, height, useGL20, batchSize);
+ if (createYUp) {
+ graphics.setYDown(false);
+ }
batch = graphics.getSpriteBatch();
if (debugCallBack != null) {
@@ -274,7 +278,7 @@ public void create() {
// load default font if no one was set
if (defaultFont == null) {
- defaultFont = new BMFont(new BitmapFont(true));
+ defaultFont = new BMFont(new BitmapFont(graphics.isYDown()));
}
}
@@ -303,7 +307,11 @@ public void render() {
Gdx.gl.glClearColor(0, 0, 0, 1);
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
Gdx.gl.glEnable(GL10.GL_SCISSOR_TEST);
- Gdx.gl.glScissor(0, Gdx.graphics.getHeight() - height, width, height);
+ if (graphics.isYDown()) {
+ Gdx.gl.glScissor(0, Gdx.graphics.getHeight() - height, width, height);
+ } else {
+ Gdx.gl.glScissor(0, 0, width, height);
+ }
graphics.setClearColor(graphics.getClearColor());
}
@@ -318,7 +326,6 @@ public void render() {
// reset all to make each frame normal
if (resetTransform) {
- // TODO fix to center and shit?
graphics.resetTransform(true);
}
@@ -327,8 +334,8 @@ public void render() {
// render fps
if (showDebug) {
batch.begin();
- defaultFont.draw(batch, "Fps: " + fps, 5, 5);
- defaultFont.draw(batch, "Delta: " + (int) (delta * 1000) + "ms", 5, 20);
+ defaultFont.draw(batch, "Fps: " + fps, 5, (!graphics.isYDown() ? height - 5 : 5));
+ defaultFont.draw(batch, "Delta: " + (int) (delta * 1000) + "ms", 5, (!graphics.isYDown() ? height - 20 : 20));
batch.end();
}
@@ -540,6 +547,19 @@ public void setVSync(boolean vsync) {
Gdx.graphics.setVSync(vsync);
}
+ /**
+ * Sets the y direction of the viewport. true stand for y-down while false stand for y-up. Default is y-down.
+ * <p>
+ * Set it before starting the game to start with a y-up viewport.
+ */
+ public void setYDown(boolean ydown) {
+ if (!created) {
+ createYUp = !ydown;
+ } else {
+ graphics.setYDown(ydown);
+ }
+ }
+
// GETTER
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
/**
@@ -568,7 +588,7 @@ public DebugCallback getDebugCallBack() {
}
/**
* @return the default font used by the container. This is null if called in the init method of the {@link Game}
- * instance.
+ * instance.
*/
public Font getFont() {
return defaultFont;
@@ -673,4 +693,14 @@ public int getDisplayHeight() {
return Gdx.graphics.getHeight();
}
+ /**
+ * @return true if the viewport direction is y-down, false otherwise.
+ */
+ public boolean isYDown() {
+ if (!created) {
+ return !createYUp;
+ }
+ return graphics.isYDown();
+ }
+
}
View
2 _RadicalFishGDX/src/de/radicalfish/GameInput.java
@@ -48,7 +48,7 @@
* copies from {@link Input} from libGDX. all credits goes to the creator of libGDX here :)
*
* @author Stefan Lange
- * @version 0.1.1
+ * @version 1.0.0
* @since 10.08.2012
*/
public class GameInput implements InputProcessor {
View
2 _RadicalFishGDX/src/de/radicalfish/animation/Animator.java
@@ -37,7 +37,7 @@
* Handles animations for entities.
*
* @author Stefan Lange
- * @version 0.5.0
+ * @version 1.0.0
* @since 11.06.2012
*/
public class Animator implements Serializable {
View
2 _RadicalFishGDX/src/de/radicalfish/assets/Assets.java
@@ -60,7 +60,7 @@
* on.
*
* @author Stefan Lange
- * @version 0.2.0
+ * @version 0.5.0
* @since 08.09.2012
*/
public class Assets extends AssetManager {
View
5 _RadicalFishGDX/src/de/radicalfish/assets/ShaderLoader.java
@@ -28,7 +28,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package de.radicalfish.assets;
-
import com.badlogic.gdx.assets.AssetDescriptor;
import com.badlogic.gdx.assets.AssetLoaderParameters;
import com.badlogic.gdx.assets.AssetManager;
@@ -46,10 +45,6 @@
* <p>
* Like in the other loaders provided by the engine the file name can be any name. The important part are the paths set
* in the {@link ShaderLoaderParameter}. A parameter must be given otherwise the loader will throw an exception.
- *
- * @author Stefan Lange
- * @version 1.0.0
- * @since 12.09.2012
*/
public class ShaderLoader extends AsynchronousAssetLoader<ShaderProgram, ShaderLoaderParameter> {
View
4 _RadicalFishGDX/src/de/radicalfish/assets/SpriteFontLoader.java
@@ -46,10 +46,6 @@
* You can name the SpriteFont like you want, the dependency will be loaded if needed. it must be set in the parameters.
* You can set a {@link FontSheetParameter} if the {@link FontSheet} was not loaded. With this the FontSheet will be
* loaded as dependency. This FontSheet will be loaded with the name of the {@link SpriteFont} + "_fs".
- *
- * @author Stefan Lange
- * @version 1.0.0
- * @since 08.09.2012
*/
public class SpriteFontLoader extends SynchronousAssetLoader<SpriteFont, SpriteFontParameter> {
View
4 _RadicalFishGDX/src/de/radicalfish/assets/TextureRegionLoader.java
@@ -47,10 +47,6 @@
* <p>
* You can use {@link TextureRegionLoaderParameter#TextureRegionLoaderParameter(String, Rectangle)} to shorten the code
* since the {@link Rectangle} values will be used to define the region.
- *
- * @author Stefan Lange
- * @version 1.0.0
- * @since 12.09.2012
*/
public class TextureRegionLoader extends SynchronousAssetLoader<TextureRegion, TextureRegionLoaderParameter> {
View
2 _RadicalFishGDX/src/de/radicalfish/font/commands/GroupCommand.java
@@ -32,8 +32,6 @@
import de.radicalfish.GameContainer;
import de.radicalfish.font.StyleInfo;
-// TODO fix doc for changes from repeat command to group command
-
/**
* A command that executes a group of commands starting from the given charpoint. the listm ust be ordered which means
* that
View
2 _RadicalFishGDX/src/de/radicalfish/font/commands/StyleCommand.java
@@ -38,7 +38,7 @@
* executed. of course the {@link Font} must offer the feature to use {@link StyleCommand}s.
*
* @author Stefan Lange
- * @version 0.5.0
+ * @version 1.0.0
* @since 08.12.2011
*/
public abstract class StyleCommand {
View
2 _RadicalFishGDX/src/de/radicalfish/graphics/BlendMode.java
@@ -35,7 +35,7 @@
* Simple enum for blend modes with method apply a blend mode. Note that {@link BlendMode#SUB} only works for GL20!
*
* @author Stefan Lange
- * @version 0.1.7
+ * @version 1.0.0
* @since 21.08.2012
*/
public enum BlendMode {
View
2 _RadicalFishGDX/src/de/radicalfish/world/CollisionManager.java
@@ -34,7 +34,7 @@
* A collision manager is responsible
*
* @author Stefan Lange
- * @version 0.0.0
+ * @version 1.0.0
* @since 16.06.2012
*/
public interface CollisionManager {

0 comments on commit 0c95e61

Please sign in to comment.
Something went wrong with that request. Please try again.