Skip to content

Commit

Permalink
MergeFixes 0.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
fd committed Sep 26, 2015
1 parent a158558 commit c23a39b
Show file tree
Hide file tree
Showing 35 changed files with 303 additions and 188 deletions.
Binary file removed libs/org.json-20131017.jar
Binary file not shown.
12 changes: 0 additions & 12 deletions src/fluddokt/opsu/fake/AudioDevicePlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,62 +5,50 @@ public abstract class AudioDevicePlayer {
public abstract void setAudioDeviceListener(AudioDeviceListener audioDeviceListener);

public boolean setPosition(float f) {
// TODO Auto-generated method stub
return false;
}

public void loop() {
// TODO Auto-generated method stub

}

public void play() {
// TODO Auto-generated method stub

}

public boolean playing() {
// TODO Auto-generated method stub
return false;
}

public void pause() {
// TODO Auto-generated method stub

}

public void resume() {
// TODO Auto-generated method stub

}

public void setVolume(float volume) {
// TODO Auto-generated method stub

}

public void stop() {
// TODO Auto-generated method stub

}

public float getPosition() {
// TODO Auto-generated method stub
return 0;
}

public void dispose() {
// TODO Auto-generated method stub

}

public String getName() {
// TODO Auto-generated method stub
return null;
}

public void setPitch(float pitch) {
// TODO Auto-generated method stub

}

Expand Down
7 changes: 7 additions & 0 deletions src/fluddokt/opsu/fake/Color.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,12 @@ public int getAlpha() {
return (int)(a * 255);
}

public void init(float r, float g, float b, float a) {
this.r = r;
this.g = g;
this.b = b;
this.a = a;
}


}
2 changes: 0 additions & 2 deletions src/fluddokt/opsu/fake/Desktop.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

import com.badlogic.gdx.Gdx;

import fluddokt.opsu.fake.Desktop.Action;

public class Desktop {

public enum Action {
Expand Down
8 changes: 8 additions & 0 deletions src/fluddokt/opsu/fake/Font.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,13 @@ public void setPaddingBottom(int padding) {
public void setPaddingTop(int padding) {
padtop = padding;
}

public int getPaddingTop() {
return padtop;
}

public int getPaddingBottom() {
return padbottom;
}

}
9 changes: 4 additions & 5 deletions src/fluddokt/opsu/fake/GameContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Application.ApplicationType;

public class GameContainer {
import fluddokt.opsu.fake.gui.GUIContext;

public class GameContainer extends GUIContext{
public static StateBasedGame sbg;

public int width = 800;
public int height = 600;
public boolean hasFocus = true;
Input input = new Input();

protected boolean running;
protected boolean forceExit;
Expand Down Expand Up @@ -48,9 +49,7 @@ protected void close_sub() {
// TODO Auto-generated method stub

}
public Input getInput() {
return input;
}


public boolean hasFocus() {
return hasFocus;
Expand Down
2 changes: 1 addition & 1 deletion src/fluddokt/opsu/fake/GameOpsu.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

public class GameOpsu extends com.badlogic.gdx.Game {

final String VERSION = "OpsuAnd0.11.0a";
final String VERSION = "OpsuAnd0.12.0a";
public StateBasedGame sbg;

Stage stage;
Expand Down
18 changes: 14 additions & 4 deletions src/fluddokt/opsu/fake/Graphics.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,17 @@ public void fillArc(float x, float y, float w, float h, float start,

}

public void copyArea(Image screen, int i, int j) {
public void fillRoundRect(float x, float y, float w, float h, float m) {
// TODO Auto-generated method stub

checkMode(SHAPEFILLED);
shapeRender.rect(x, y, w, h);
}

public void fillRoundRect(float x, float y, float w, float h, float m) {
public void drawRoundRect(float x, float y, int w, int h, int m) {
// TODO Auto-generated method stub
checkMode(SHAPEFILLED);
checkMode(SHAPELINE);
shapeRender.rect(x, y, w, h);

}

public void drawLine(float x1, float y1, float x2, float y2) {
Expand Down Expand Up @@ -307,6 +309,14 @@ public void setDrawMode(int mode) {
//batch.setBlendFunction(GL20.GL_ZERO, GL20.GL_ZERO);
//Gdx.gl.glBlendFunc(GL20.GL_ZERO, GL20.GL_ONE);
}

public Color getColor() {
return fgcolor;
}

public float getLineWidth() {
return 1;
}



Expand Down
38 changes: 38 additions & 0 deletions src/fluddokt/opsu/fake/Image.java
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,18 @@ private int gpow2(int n) {
private int nextmultipleof4(int n) {
return ((n + 3) / 4) * 4;
}

public Image(Image copy) {
//texinfo = copy.texinfo;
//texinfo.add(this);
parentImage = copy;

tex = copy.tex;
width = copy.width;
height = copy.height;
filename = copy.filename;
name = copy.name+"[c]";
}
public Image(Image copy, float wid, float hei) {
//texinfo = copy.texinfo;
//texinfo.add(this);
Expand Down Expand Up @@ -414,4 +425,31 @@ public Color getColor(int x, int y) {
pixmap = new Pixmap(ResourceLoader.getFileHandle(filename));
return new Color(pixmap.getPixel((int)(x *pixmap.getWidth() / width), (int) (y * pixmap.getHeight() / height)));
}

public Image copy() {
return new Image(this);
}

public void startUse() {
// TODO Auto-generated method stub

}
public void endUse() {
// TODO Auto-generated method stub

}

Color imageColor = new Color(0xffffffff);
public void setImageColor(float r, float g, float b, float a) {
imageColor.init(r, g, b, a);
}

public void drawEmbedded(float x, float y, int w, int h, float r) {
Graphics.getGraphics().setColor(imageColor);
Graphics.getGraphics().drawTexture(getTextureRegion(), x, y,
w, h, r);

}


}
1 change: 0 additions & 1 deletion src/fluddokt/opsu/fake/Log.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public static void setVerbose(boolean b) {
}

public static void warn(String string, Throwable e) {
System.out.println("HSDFHGKSDHFKUSDF");
if(e != null)
Gdx.app.log("warn", string, e);
else{
Expand Down
1 change: 1 addition & 0 deletions src/fluddokt/opsu/fake/UnicodeFont.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ public UnicodeFont(Font font) {
super(font.name, font.style, font.size, font.file);
}


}
45 changes: 4 additions & 41 deletions src/fluddokt/opsu/fake/gl/GL11.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,47 +118,6 @@ public static void glDeleteTextures(int texId) {
Gdx.gl20.glDeleteTextures(1, UtilBuff.prepare(texId));
}

/*
public static void glMatrixMode(int glProjection) {
// TODO Auto-generated method stub
//Gdx.gl20.glMatrixMode
}
public static void glPushMatrix() {
// TODO Auto-generated method stub
//Gdx.gl20.glPushMatrix
}
public static void glLoadIdentity() {
// TODO Auto-generated method stub
//Gdx.gl20.glLoadIdentity
}
public static void glPopMatrix() {
// TODO Auto-generated method stub
//Gdx.gl20.glPopMatrix
}
public static void glColor4f(float f, float g, float h, float alpha) {
// TODO Auto-generated method stub
// Gdx.gl20.glColor4f
}
public static void glBegin(int glQuads) {
// TODO Auto-generated method stub
//Gdx.gl20.glBegin
}
public static void glTexCoord2f(float f, float g) {
// TODO Auto-generated method stub
//Gdx.gl20.glTexCoord2f
}
public static void glVertex2i(int width, int i) {
// TODO Auto-generated method stub
//Gdx.gl20.glVertex2i
}
*/
public static void glEnd() {
GL20.glDisableVertexAttribArray(texCoordLoc);
GL20.glDisableVertexAttribArray(vertLoc);
Expand Down Expand Up @@ -308,4 +267,8 @@ public static void glTexImage2D(int target, int level, int internalformat, int w
Gdx.gl20.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
}

public static void glFlush() {
Gdx.gl20.glFlush();
}

}
6 changes: 0 additions & 6 deletions src/fluddokt/opsu/fake/gl/GL20.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,6 @@ public static void glDeleteProgram(int program) {
Gdx.gl20.glDeleteProgram(program);
}

/*public static void glDrawBuffers(int glColorAttachment0) {
// TODO Auto-generated method stub
//Gdx.gl20.glDrawBuffers
Gdx.gl20.glDrawBuffers
}*/

public static void glCompileShader(int shader) {
Gdx.gl20.glCompileShader(shader);

Expand Down
63 changes: 63 additions & 0 deletions src/fluddokt/opsu/fake/gui/AbstractComponent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package fluddokt.opsu.fake.gui;

import fluddokt.opsu.fake.Graphics;
import fluddokt.opsu.fake.InputListener;
import fluddokt.opsu.fake.SlickException;

public abstract class AbstractComponent {

public AbstractComponent(GUIContext container) {
container.addInputListener(new InputListener() {

@Override
public void touchUp(int screenX, int screenY, int pointer, int button) {
mouseReleased(button, screenX, screenY);
}

@Override
public void touchDragged(int screenX, int screenY, int pointer) {
}

@Override
public void touchDown(int screenX, int screenY, int pointer, int button) {
mousePressed(button, screenX, screenY);
}

@Override
public void keyUp(int keycode) {
}

@Override
public void keyType(char character) {
}

@Override
public void keyDown(int keycode) {
}
});
}

public abstract int getWidth();

public abstract int getHeight();

public abstract int getY();

public abstract int getX();

public abstract void mousePressed(int button, int x, int y);

public abstract void mouseReleased(int button, int x, int y);

public abstract void render(GUIContext container, Graphics g) throws SlickException;

public abstract void setFocus(boolean focus);

public abstract void setLocation(int x, int y);

public void consumeEvent(){

}


}
21 changes: 21 additions & 0 deletions src/fluddokt/opsu/fake/gui/GUIContext.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package fluddokt.opsu.fake.gui;

import com.badlogic.gdx.utils.TimeUtils;

import fluddokt.opsu.fake.Input;
import fluddokt.opsu.fake.InputListener;

public abstract class GUIContext {
Input input = new Input();
public Input getInput() {
return input;
}

public abstract void addInputListener(InputListener listener);
public abstract void removeInputListener(InputListener listener);

public long getTime() {
return TimeUtils.millis();
}

}
Loading

0 comments on commit c23a39b

Please sign in to comment.