diff --git a/.gitignore b/.gitignore index 58bcbf8..b9d6bd9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,43 +1,215 @@ -# Windows image file caches -Thumbs.db -ehthumbs.db - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msm -*.msp - -# ========================= -# Operating System Files -# ========================= - -# OSX -# ========================= - +################# +## Eclipse +################# + +*.pydevproject +.project +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.classpath +.settings/ +.loadpath + +# External tool builders +.externalToolBuilders/ + +# 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 -.AppleDouble -.LSOverride -# Icon must end with two \r -Icon -# Thumbnails -._* +############# +## Python +############# -# Files that might appear on external disk -.Spotlight-V100 -.Trashes +*.py[co] -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk +# Packages +*.egg +*.egg-info +dist/ +build/ +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 diff --git a/bin/MAndApps/AppHelper.class b/bin/MAndApps/AppHelper.class deleted file mode 100644 index 59aa296..0000000 Binary files a/bin/MAndApps/AppHelper.class and /dev/null differ diff --git a/bin/MAndApps/BasicApp.class b/bin/MAndApps/BasicApp.class deleted file mode 100644 index b33fe2c..0000000 Binary files a/bin/MAndApps/BasicApp.class and /dev/null differ diff --git a/bin/MAndApps/Button.class b/bin/MAndApps/Button.class deleted file mode 100644 index 6f314ea..0000000 Binary files a/bin/MAndApps/Button.class and /dev/null differ diff --git a/bin/MAndApps/ButtonListener.class b/bin/MAndApps/ButtonListener.class deleted file mode 100644 index e30ff24..0000000 Binary files a/bin/MAndApps/ButtonListener.class and /dev/null differ diff --git a/bin/MAndApps/Engine.class b/bin/MAndApps/Engine.class deleted file mode 100644 index b58fc87..0000000 Binary files a/bin/MAndApps/Engine.class and /dev/null differ diff --git a/bin/MAndApps/ImageCreator.class b/bin/MAndApps/ImageCreator.class deleted file mode 100644 index a19db15..0000000 Binary files a/bin/MAndApps/ImageCreator.class and /dev/null differ diff --git a/bin/MAndApps/LogItem.class b/bin/MAndApps/LogItem.class deleted file mode 100644 index ba36531..0000000 Binary files a/bin/MAndApps/LogItem.class and /dev/null differ diff --git a/bin/MAndApps/Pointer.class b/bin/MAndApps/Pointer.class deleted file mode 100644 index 4e5d0e2..0000000 Binary files a/bin/MAndApps/Pointer.class and /dev/null differ diff --git a/bin/MAndApps/Variable$1.class b/bin/MAndApps/Variable$1.class deleted file mode 100644 index 8862777..0000000 Binary files a/bin/MAndApps/Variable$1.class and /dev/null differ diff --git a/bin/MAndApps/Variable.class b/bin/MAndApps/Variable.class deleted file mode 100644 index 16fb5f5..0000000 Binary files a/bin/MAndApps/Variable.class and /dev/null differ diff --git a/bin/MAndApps/VariableNotFoundException.class b/bin/MAndApps/VariableNotFoundException.class deleted file mode 100644 index 48f41fc..0000000 Binary files a/bin/MAndApps/VariableNotFoundException.class and /dev/null differ diff --git a/src/MAndApps/AppHelper.java b/src/MAndEngine/AppHelper.java similarity index 99% rename from src/MAndApps/AppHelper.java rename to src/MAndEngine/AppHelper.java index 4db6ba1..23f2493 100644 --- a/src/MAndApps/AppHelper.java +++ b/src/MAndEngine/AppHelper.java @@ -1,4 +1,4 @@ -package MAndApps; +package MAndEngine; import java.io.BufferedReader; import java.io.File; diff --git a/src/MAndApps/BasicApp.java b/src/MAndEngine/BasicApp.java similarity index 99% rename from src/MAndApps/BasicApp.java rename to src/MAndEngine/BasicApp.java index d740bf8..45a3a67 100644 --- a/src/MAndApps/BasicApp.java +++ b/src/MAndEngine/BasicApp.java @@ -1,4 +1,4 @@ -package MAndApps; +package MAndEngine; import java.awt.*; import java.awt.event.KeyEvent; diff --git a/src/MAndApps/Button.java b/src/MAndEngine/Button.java similarity index 97% rename from src/MAndApps/Button.java rename to src/MAndEngine/Button.java index a15abd2..5654aeb 100644 --- a/src/MAndApps/Button.java +++ b/src/MAndEngine/Button.java @@ -1,4 +1,4 @@ -package MAndApps; +package MAndEngine; import java.awt.AlphaComposite; @@ -7,9 +7,9 @@ import java.awt.Graphics2D; import java.awt.Image; import java.awt.image.BufferedImage; -import static MAndApps.Engine.mouseX; -import static MAndApps.Engine.mouseY; -import static MAndApps.Engine.mouse; +import static MAndEngine.Engine.mouse; +import static MAndEngine.Engine.mouseX; +import static MAndEngine.Engine.mouseY; public class Button { private int clickLevel = 0; diff --git a/src/MAndApps/ButtonListener.java b/src/MAndEngine/ButtonListener.java similarity index 81% rename from src/MAndApps/ButtonListener.java rename to src/MAndEngine/ButtonListener.java index 2e82146..bbf337f 100644 --- a/src/MAndApps/ButtonListener.java +++ b/src/MAndEngine/ButtonListener.java @@ -1,4 +1,4 @@ -package MAndApps; +package MAndEngine; diff --git a/src/MAndApps/Engine.java b/src/MAndEngine/Engine.java similarity index 84% rename from src/MAndApps/Engine.java rename to src/MAndEngine/Engine.java index 885bd21..1c15bf7 100644 --- a/src/MAndApps/Engine.java +++ b/src/MAndEngine/Engine.java @@ -1,4 +1,4 @@ -package MAndApps; +package MAndEngine; import java.awt.*; import java.awt.event.KeyEvent; @@ -11,8 +11,7 @@ import java.util.Stack; import javax.swing.*; -public class Engine extends Canvas implements KeyListener, MouseMotionListener, - MouseListener { +public class Engine extends Canvas implements KeyListener, MouseMotionListener, MouseListener { /** * to track the x and y @@ -54,8 +53,7 @@ public class Engine extends Canvas implements KeyListener, MouseMotionListener, /** * more framerate stuff, again, chill. */ - private static long nextSecond = System.currentTimeMillis() + 1000, - startTime = 0; + private static long nextSecond = System.currentTimeMillis() + 1000, startTime = 0; /** * 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; /** - * These are fonts. because STANDARDIZATION! - * worked good for oil, WHY NOT ME? + * These are fonts. because STANDARDIZATION! worked good for oil, WHY NOT + * ME? */ public static final Font largerFont = new Font("Ubuntu", Font.BOLD, 20); 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) { - //frame.setVisible(true); - + // frame.setVisible(true); + // set static object staticMain = this; // initialize keys keys = new boolean[512]; - + // set up window frame = new JFrame(); setSize(WIDTH, HEIGHT); @@ -148,50 +146,46 @@ public class Engine extends Canvas implements KeyListener, MouseMotionListener, addKeyListener(this); requestFocus(); - 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(); - - + if (showLoading) + frame.setVisible(true); - //we need to make a frame and such first - //more on that later - createBuffer(); - - - //while its faffing about, RENDER THINGS AND MAKE A LOADY THING - while(!appInitializer.getDone() || !(progress >= 0.999)){ - try{ + // 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 + // 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); - }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(); - progress += (appInitializer.getProgress() - progress)/ANIMATION_CONSTANT; + progress += (appInitializer.getProgress() - progress) / ANIMATION_CONSTANT; } - //we done now, gather the loot. - apps = appInitializer.getApps(); + // we done now, gather the loot. + apps = appInitializer.getApps(); + + switchApps(0); - switchApps(0); - } + //TODO at some point redo this to allow frame drop + //if it gets laggy.... public void run() { - // REALLY???? running = true; - - frame.setVisible(true); - // now we do stuff. while (running) { // 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. try { if (!overclock) - Thread.sleep((long) Math.floor(sleepTime - - (System.currentTimeMillis() - startTime))); + Thread.sleep((long) Math.floor(sleepTime - (System.currentTimeMillis() - startTime))); else Thread.sleep(0); 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 */ private static void createBuffer() { - buffer = (Image) (new BufferedImage(WIDTH, HEIGHT, - BufferedImage.TRANSLUCENT)); + buffer = (Image) (new BufferedImage(WIDTH, HEIGHT, BufferedImage.TRANSLUCENT)); g2 = (Graphics2D) buffer.getGraphics(); } @@ -259,7 +251,7 @@ public class Engine extends Canvas implements KeyListener, MouseMotionListener, log("setting window properties"); setWindowProperties(apps[app]); log("Started up " + apps[app].getTitle()); - + frame.pack(); // because we now use the ONE buffer system... yeah @@ -280,8 +272,7 @@ public class Engine extends Canvas implements KeyListener, MouseMotionListener, * @param app */ private static void setWindowProperties(BasicApp app) { - setWindowProperties(app.getResolution(), app.getFramerate(), - app.getResizable()); + setWindowProperties(app.getResolution(), app.getFramerate(), app.getResizable()); } /** @@ -291,8 +282,7 @@ public class Engine extends Canvas implements KeyListener, MouseMotionListener, * @param fps * @param resizable */ - private static void setWindowProperties(Dimension dimension, int fps, - boolean resizable) { + private static void setWindowProperties(Dimension dimension, int fps, boolean resizable) { staticMain.setSize(dimension); frame.setResizable(true); @@ -315,10 +305,8 @@ public class Engine extends Canvas implements KeyListener, MouseMotionListener, private static void render(Graphics2D g) { - g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, - RenderingHints.VALUE_TEXT_ANTIALIAS_ON); - g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, - RenderingHints.VALUE_ANTIALIAS_ON); + g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); + g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g.setFont(defaultFont); @@ -345,8 +333,7 @@ public class Engine extends Canvas implements KeyListener, MouseMotionListener, g.setColor(Color.WHITE); if (!(log.size() == 0)) for (int i = log.size() - 1; i >= 0; i--) - log.elementAt(i).render(g, WIDTH - 200, - HEIGHT - 10 - (i * 12)); + log.elementAt(i).render(g, WIDTH - 200, HEIGHT - 10 - (i * 12)); } catch (Exception e) { g.setFont(largerFont); g.setColor(Color.BLACK); @@ -387,7 +374,7 @@ public class Engine extends Canvas implements KeyListener, MouseMotionListener, @Override public void keyPressed(KeyEvent e) { apps[app].keyPressed(e); - if (e.getKeyCode() == KeyEvent.VK_O) { + if (e.getKeyCode() == KeyEvent.VK_O && keys[KeyEvent.VK_CONTROL]) { overclock = !overclock; } keys[e.getKeyCode()] = true; @@ -398,27 +385,27 @@ public class Engine extends Canvas implements KeyListener, MouseMotionListener, apps[app].keyReleased(e); keys[e.getKeyCode()] = false; } - + @Override public void keyTyped(KeyEvent arg0) { } - + public static void exit() { frame.dispose(); System.exit(0); } - + private static void setFramerate(int fps) { frameSync = fps; sleepTime = 1000 / frameSync; } - + @Override public void mouseDragged(MouseEvent e) { mouseX = e.getX(); mouseY = e.getY(); } - + @Override public void mouseMoved(MouseEvent e) { mouseX = e.getX(); diff --git a/src/MAndApps/ImageCreator.java b/src/MAndEngine/ImageCreator.java similarity index 99% rename from src/MAndApps/ImageCreator.java rename to src/MAndEngine/ImageCreator.java index c07be57..27586c5 100644 --- a/src/MAndApps/ImageCreator.java +++ b/src/MAndEngine/ImageCreator.java @@ -1,4 +1,4 @@ -package MAndApps; +package MAndEngine; import java.awt.Color; diff --git a/src/MAndApps/LogItem.java b/src/MAndEngine/LogItem.java similarity index 97% rename from src/MAndApps/LogItem.java rename to src/MAndEngine/LogItem.java index 464c8fd..0f0badd 100644 --- a/src/MAndApps/LogItem.java +++ b/src/MAndEngine/LogItem.java @@ -1,4 +1,4 @@ -package MAndApps; +package MAndEngine; import java.awt.Graphics; diff --git a/src/MAndApps/Pointer.java b/src/MAndEngine/Pointer.java similarity index 86% rename from src/MAndApps/Pointer.java rename to src/MAndEngine/Pointer.java index cf59058..6d48247 100644 --- a/src/MAndApps/Pointer.java +++ b/src/MAndEngine/Pointer.java @@ -1,4 +1,4 @@ -package MAndApps; +package MAndEngine; public class Pointer { private volatile E object; diff --git a/src/MAndApps/Variable.java b/src/MAndEngine/Variable.java similarity index 99% rename from src/MAndApps/Variable.java rename to src/MAndEngine/Variable.java index f9d51b4..7388ffa 100644 --- a/src/MAndApps/Variable.java +++ b/src/MAndEngine/Variable.java @@ -1,4 +1,4 @@ -package MAndApps; +package MAndEngine; import java.io.File; diff --git a/src/MAndApps/VariableNotFoundException.java b/src/MAndEngine/VariableNotFoundException.java similarity index 87% rename from src/MAndApps/VariableNotFoundException.java rename to src/MAndEngine/VariableNotFoundException.java index 80a59cb..963f6a2 100644 --- a/src/MAndApps/VariableNotFoundException.java +++ b/src/MAndEngine/VariableNotFoundException.java @@ -1,4 +1,4 @@ -package MAndApps; +package MAndEngine;