new gitignore, not much else.

master
Marcus Gosselin 2014-10-08 22:40:33 -04:00
parent 26b790ed78
commit 6d6c799904
22 changed files with 268 additions and 109 deletions

248
.gitignore vendored
View File

@ -1,43 +1,215 @@
# Windows image file caches #################
Thumbs.db ## Eclipse
ehthumbs.db #################
# Folder config file *.pydevproject
Desktop.ini .project
.metadata
# Recycle Bin used on file shares bin/
$RECYCLE.BIN/ tmp/
*.tmp
# Windows Installer files *.bak
*.cab *.swp
*.msi *~.nib
*.msm local.properties
*.msp .classpath
.settings/
# ========================= .loadpath
# Operating System Files
# ========================= # External tool builders
.externalToolBuilders/
# OSX
# ========================= # Locally stored "Eclipse launch configurations"
*.launch
# CDT-specific
.cproject
# PDT-specific
.buildpath
#################
## Visual Studio
#################
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
[Dd]ebug/
[Rr]elease/
x64/
build/
[Bb]in/
[Oo]bj/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.log
*.scc
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile
# Visual Studio profiler
*.psess
*.vsp
*.vspx
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
*.ncrunch*
.*crunch*.local.xml
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.Publish.xml
*.pubxml
# NuGet Packages Directory
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
#packages/
# Windows Azure Build Output
csx
*.build.csdef
# Windows Store app package directory
AppPackages/
# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.[Pp]ublish.xml
*.pfx
*.publishsettings
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
App_Data/*.mdf
App_Data/*.ldf
#############
## Windows detritus
#############
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Mac crap
.DS_Store .DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails #############
._* ## Python
#############
# Files that might appear on external disk *.py[co]
.Spotlight-V100
.Trashes
# Directories potentially created on remote AFP share # Packages
.AppleDB *.egg
.AppleDesktop *.egg-info
Network Trash Folder dist/
Temporary Items build/
.apdisk eggs/
parts/
var/
sdist/
develop-eggs/
.installed.cfg
# Installer logs
pip-log.txt
# Unit test / coverage reports
.coverage
.tox
#Translations
*.mo
#Mr Developer
.mr.developer.cfg

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,4 +1,4 @@
package MAndApps; package MAndEngine;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.File; import java.io.File;

View File

@ -1,4 +1,4 @@
package MAndApps; package MAndEngine;
import java.awt.*; import java.awt.*;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;

View File

@ -1,4 +1,4 @@
package MAndApps; package MAndEngine;
import java.awt.AlphaComposite; import java.awt.AlphaComposite;
@ -7,9 +7,9 @@ import java.awt.Graphics2D;
import java.awt.Image; import java.awt.Image;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import static MAndApps.Engine.mouseX; import static MAndEngine.Engine.mouse;
import static MAndApps.Engine.mouseY; import static MAndEngine.Engine.mouseX;
import static MAndApps.Engine.mouse; import static MAndEngine.Engine.mouseY;
public class Button { public class Button {
private int clickLevel = 0; private int clickLevel = 0;

View File

@ -1,4 +1,4 @@
package MAndApps; package MAndEngine;

View File

@ -1,4 +1,4 @@
package MAndApps; package MAndEngine;
import java.awt.*; import java.awt.*;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
@ -11,8 +11,7 @@ import java.util.Stack;
import javax.swing.*; import javax.swing.*;
public class Engine extends Canvas implements KeyListener, MouseMotionListener, public class Engine extends Canvas implements KeyListener, MouseMotionListener, MouseListener {
MouseListener {
/** /**
* to track the x and y * to track the x and y
@ -54,8 +53,7 @@ public class Engine extends Canvas implements KeyListener, MouseMotionListener,
/** /**
* more framerate stuff, again, chill. * more framerate stuff, again, chill.
*/ */
private static long nextSecond = System.currentTimeMillis() + 1000, private static long nextSecond = System.currentTimeMillis() + 1000, startTime = 0;
startTime = 0;
/** /**
* if our current framerate is below our expected. its not directly * if our current framerate is below our expected. its not directly
@ -102,8 +100,8 @@ public class Engine extends Canvas implements KeyListener, MouseMotionListener,
private static double progress = 1; private static double progress = 1;
/** /**
* These are fonts. because STANDARDIZATION! * These are fonts. because STANDARDIZATION! worked good for oil, WHY NOT
* worked good for oil, WHY NOT ME? * ME?
*/ */
public static final Font largerFont = new Font("Ubuntu", Font.BOLD, 20); public static final Font largerFont = new Font("Ubuntu", Font.BOLD, 20);
public static final Font defaultFont = new Font("Ubuntu", Font.BOLD, 11); public static final Font defaultFont = new Font("Ubuntu", Font.BOLD, 11);
@ -131,14 +129,14 @@ public class Engine extends Canvas implements KeyListener, MouseMotionListener,
*/ */
public Engine(String[] classes, boolean showLoading) { public Engine(String[] classes, boolean showLoading) {
//frame.setVisible(true); // frame.setVisible(true);
// set static object // set static object
staticMain = this; staticMain = this;
// initialize keys // initialize keys
keys = new boolean[512]; keys = new boolean[512];
// set up window // set up window
frame = new JFrame(); frame = new JFrame();
setSize(WIDTH, HEIGHT); setSize(WIDTH, HEIGHT);
@ -148,50 +146,46 @@ public class Engine extends Canvas implements KeyListener, MouseMotionListener,
addKeyListener(this); addKeyListener(this);
requestFocus(); requestFocus();
if(showLoading) frame.setVisible(true); if (showLoading)
frame.setVisible(true);
//make a new thread of the appinitializer thing
//and like... make it do things.
appInitializer = new AppHelper(classes);
Thread thread = new Thread(appInitializer);
thread.start();
//we need to make a frame and such first // make a new thread of the appinitializer thing
//more on that later // and like... make it do things.
createBuffer(); appInitializer = new AppHelper(classes);
Thread thread = new Thread(appInitializer);
thread.start();
//while its faffing about, RENDER THINGS AND MAKE A LOADY THING
while(!appInitializer.getDone() || !(progress >= 0.999)){ // we need to make a frame and such first
try{ // more on that later
createBuffer();
// while its faffing about, RENDER THINGS AND MAKE A LOADY THING
while (!appInitializer.getDone() || !(progress >= 0.999)) {
try {
Thread.sleep(17); Thread.sleep(17);
}catch(Exception e){ } catch (Exception e) {
} }
//this is the later part referred to by a few lines back // this is the later part referred to by a few lines back
repaint(); repaint();
progress += (appInitializer.getProgress() - progress)/ANIMATION_CONSTANT; progress += (appInitializer.getProgress() - progress) / ANIMATION_CONSTANT;
} }
//we done now, gather the loot. // we done now, gather the loot.
apps = appInitializer.getApps(); apps = appInitializer.getApps();
switchApps(0);
switchApps(0);
} }
//TODO at some point redo this to allow frame drop
//if it gets laggy....
public void run() { public void run() {
// REALLY???? // REALLY????
running = true; running = true;
frame.setVisible(true); frame.setVisible(true);
// now we do stuff. // now we do stuff.
while (running) { while (running) {
// FPS STUFF WORRY NOT, ITS ALL GOOD. MOVE ALONG. // FPS STUFF WORRY NOT, ITS ALL GOOD. MOVE ALONG.
@ -211,8 +205,7 @@ public class Engine extends Canvas implements KeyListener, MouseMotionListener,
// FRAMERATE OVERCLOCKING AND SUCH, MOVE ALONG. // FRAMERATE OVERCLOCKING AND SUCH, MOVE ALONG.
try { try {
if (!overclock) if (!overclock)
Thread.sleep((long) Math.floor(sleepTime Thread.sleep((long) Math.floor(sleepTime - (System.currentTimeMillis() - startTime)));
- (System.currentTimeMillis() - startTime)));
else else
Thread.sleep(0); Thread.sleep(0);
lag = false; lag = false;
@ -226,8 +219,7 @@ public class Engine extends Canvas implements KeyListener, MouseMotionListener,
* makes a buffer and stuff, called with new windows and things. MOVE ALONG * makes a buffer and stuff, called with new windows and things. MOVE ALONG
*/ */
private static void createBuffer() { private static void createBuffer() {
buffer = (Image) (new BufferedImage(WIDTH, HEIGHT, buffer = (Image) (new BufferedImage(WIDTH, HEIGHT, BufferedImage.TRANSLUCENT));
BufferedImage.TRANSLUCENT));
g2 = (Graphics2D) buffer.getGraphics(); g2 = (Graphics2D) buffer.getGraphics();
} }
@ -259,7 +251,7 @@ public class Engine extends Canvas implements KeyListener, MouseMotionListener,
log("setting window properties"); log("setting window properties");
setWindowProperties(apps[app]); setWindowProperties(apps[app]);
log("Started up " + apps[app].getTitle()); log("Started up " + apps[app].getTitle());
frame.pack(); frame.pack();
// because we now use the ONE buffer system... yeah // because we now use the ONE buffer system... yeah
@ -280,8 +272,7 @@ public class Engine extends Canvas implements KeyListener, MouseMotionListener,
* @param app * @param app
*/ */
private static void setWindowProperties(BasicApp app) { private static void setWindowProperties(BasicApp app) {
setWindowProperties(app.getResolution(), app.getFramerate(), setWindowProperties(app.getResolution(), app.getFramerate(), app.getResizable());
app.getResizable());
} }
/** /**
@ -291,8 +282,7 @@ public class Engine extends Canvas implements KeyListener, MouseMotionListener,
* @param fps * @param fps
* @param resizable * @param resizable
*/ */
private static void setWindowProperties(Dimension dimension, int fps, private static void setWindowProperties(Dimension dimension, int fps, boolean resizable) {
boolean resizable) {
staticMain.setSize(dimension); staticMain.setSize(dimension);
frame.setResizable(true); frame.setResizable(true);
@ -315,10 +305,8 @@ public class Engine extends Canvas implements KeyListener, MouseMotionListener,
private static void render(Graphics2D g) { private static void render(Graphics2D g) {
g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
RenderingHints.VALUE_TEXT_ANTIALIAS_ON); g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
g.setFont(defaultFont); g.setFont(defaultFont);
@ -345,8 +333,7 @@ public class Engine extends Canvas implements KeyListener, MouseMotionListener,
g.setColor(Color.WHITE); g.setColor(Color.WHITE);
if (!(log.size() == 0)) if (!(log.size() == 0))
for (int i = log.size() - 1; i >= 0; i--) for (int i = log.size() - 1; i >= 0; i--)
log.elementAt(i).render(g, WIDTH - 200, log.elementAt(i).render(g, WIDTH - 200, HEIGHT - 10 - (i * 12));
HEIGHT - 10 - (i * 12));
} catch (Exception e) { } catch (Exception e) {
g.setFont(largerFont); g.setFont(largerFont);
g.setColor(Color.BLACK); g.setColor(Color.BLACK);
@ -387,7 +374,7 @@ public class Engine extends Canvas implements KeyListener, MouseMotionListener,
@Override @Override
public void keyPressed(KeyEvent e) { public void keyPressed(KeyEvent e) {
apps[app].keyPressed(e); apps[app].keyPressed(e);
if (e.getKeyCode() == KeyEvent.VK_O) { if (e.getKeyCode() == KeyEvent.VK_O && keys[KeyEvent.VK_CONTROL]) {
overclock = !overclock; overclock = !overclock;
} }
keys[e.getKeyCode()] = true; keys[e.getKeyCode()] = true;
@ -398,27 +385,27 @@ public class Engine extends Canvas implements KeyListener, MouseMotionListener,
apps[app].keyReleased(e); apps[app].keyReleased(e);
keys[e.getKeyCode()] = false; keys[e.getKeyCode()] = false;
} }
@Override @Override
public void keyTyped(KeyEvent arg0) { public void keyTyped(KeyEvent arg0) {
} }
public static void exit() { public static void exit() {
frame.dispose(); frame.dispose();
System.exit(0); System.exit(0);
} }
private static void setFramerate(int fps) { private static void setFramerate(int fps) {
frameSync = fps; frameSync = fps;
sleepTime = 1000 / frameSync; sleepTime = 1000 / frameSync;
} }
@Override @Override
public void mouseDragged(MouseEvent e) { public void mouseDragged(MouseEvent e) {
mouseX = e.getX(); mouseX = e.getX();
mouseY = e.getY(); mouseY = e.getY();
} }
@Override @Override
public void mouseMoved(MouseEvent e) { public void mouseMoved(MouseEvent e) {
mouseX = e.getX(); mouseX = e.getX();

View File

@ -1,4 +1,4 @@
package MAndApps; package MAndEngine;
import java.awt.Color; import java.awt.Color;

View File

@ -1,4 +1,4 @@
package MAndApps; package MAndEngine;
import java.awt.Graphics; import java.awt.Graphics;

View File

@ -1,4 +1,4 @@
package MAndApps; package MAndEngine;
public class Pointer<E> { public class Pointer<E> {
private volatile E object; private volatile E object;

View File

@ -1,4 +1,4 @@
package MAndApps; package MAndEngine;
import java.io.File; import java.io.File;

View File

@ -1,4 +1,4 @@
package MAndApps; package MAndEngine;