Skip to content

Commit

Permalink
Merge branch 'release/v0.10.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
ColdenCullen committed Sep 8, 2014
2 parents 6d21891 + 62677eb commit 20d68de
Show file tree
Hide file tree
Showing 27 changed files with 1,592 additions and 515 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,4 @@ __dummy.html
docs.json
libdash.a
__test__*__
dub.selections.json
2 changes: 1 addition & 1 deletion .travis/setup_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ if [[ $TRAVIS_OS_NAME == "linux" ]]; then
sudo dpkg -i ${DMD_DEB}

# Install other dependencies
sudo apt-get install libfreeimage-dev libjpeg62-dev
sudo apt-get install libfreeimage-dev libjpeg62-dev libevent-dev libssl-dev
fi
1 change: 1 addition & 0 deletions .travis/setup_osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ if [[ $TRAVIS_OS_NAME == "osx" ]]; then

brew update
brew install freeimage
brew install libevent
fi
11 changes: 9 additions & 2 deletions dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
"Eric Christenson",
"Tyler Wozniak",
"Sean Brennan",
"Timothy Reynolds"
"Timothy Reynolds",
"Dan Wild",
"Jim Arnold",
"Derin Yarsuvat"
],

"dependencies": {
Expand All @@ -20,16 +23,20 @@
"dyaml": "~>0.5",
"gl3n" : "~master",
"dlogg": "~>0.3",
"msgpack-d": "==0.9.2",
"vibe-d": "==0.7.21-alpha.4",
"x11": { "version": "~>1.0", "optional": true }
},

"targetName": "dash",
"targetType": "library",

"mainSourceFile": "source/app.d",
"mainSourceFile": "source/dash/core/main.d",
"sourcePaths": [ "source/" ],
"importPaths": [ "source/" ],

"versions": [ "VibeCustomMain" ],

"-ddoxFilterArgs": [ "--min-protection=Protected" ],

"importPaths-windows": [ "third_party/DWinProgramming" ],
Expand Down
19 changes: 0 additions & 19 deletions source/app.d

This file was deleted.

13 changes: 8 additions & 5 deletions source/dash/components/lights.d
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,18 @@ mixin( registerComponents!q{dash.components.lights} );
*/
abstract class Light : Component
{
private:
bool _castShadows;

public:
/// The color the light gives off.
@field( "Color" )
vec3 color;
/// If it should cast shadows
mixin( Property!( _castShadows ) );
@field( "CastShadows" )
bool castShadows;

this( vec3 color )
{
this.color = color;
_castShadows = false;
castShadows = false;
}

override void update() { }
Expand Down Expand Up @@ -76,6 +74,11 @@ public:
this.direction = direction;
super( color );
this.castShadows = castShadows;
}

/// Initializes the lights.
override void initialize()
{
if( castShadows )
{
// generate framebuffer for shadow map
Expand Down
15 changes: 11 additions & 4 deletions source/dash/core/dgame.d
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ enum EngineState
{
/// The main game state.
Run,
/// In edit mode
Editor,
/// Refresh changed assets, but don't reset state.
Refresh,
/// Reload all assets at the beginning of the next cycle.
Expand Down Expand Up @@ -61,6 +63,9 @@ public:
/// The instance to be running from
static DGame instance;

/// The editor controller, resolved by reflection.d
Editor editor;

/// Current state of the game
EngineState currentState;

Expand All @@ -83,7 +88,6 @@ public:
*/
final void run()
{

// Init tasks
//TaskManager.initialize();
start();
Expand Down Expand Up @@ -140,13 +144,14 @@ public:
// Do the updating of the child class.
onUpdate();

// Update the editor.
//if( currentState == EngineState.Editor )
editor.update();

//////////////////////////////////////////////////////////////////////////
// Draw
//////////////////////////////////////////////////////////////////////////

// Begin drawing
Graphics.beginDraw();

activeScene.draw();

// Draw in child class
Expand Down Expand Up @@ -206,6 +211,7 @@ private:
bench!( { Assets.initialize(); } )( "Assets init" );
bench!( { Prefabs.initialize(); } )( "Prefabs init" );
bench!( { UserInterface.initializeAwesomium(); } )( "UI init" );
bench!( { editor.initialize( this ); } )( "Editor init" );
bench!( { DGame.instance.onInitialize(); } )( "Game init" );

debug scheduleIntervaledTask( 1.seconds, { if( stateFlags.autoRefresh ) currentState = EngineState.Refresh; return false; } );
Expand All @@ -217,6 +223,7 @@ private:
final void stop()
{
onShutdown();
editor.shutdown();
resetTasks();
UserInterface.shutdownAwesomium();
Assets.shutdown();
Expand Down
45 changes: 45 additions & 0 deletions source/dash/core/main.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
module dash.core.main;
import dash.core.dgame, dash.editor.editor;

/**
* Initializes reflection things.
*/
static this()
{
ClassInfo gameType = typeid(DGame);
ClassInfo editorType = typeid(Editor);

foreach( mod; ModuleInfo )
{
foreach( klass; mod.localClasses )
{
// Find the appropriate game loop.
if( klass.base == typeid(DGame) )
gameType = klass;
else if( klass.base == typeid(Editor) )
editorType = klass;
}
}

DGame.instance = cast(DGame)gameType.create();
DGame.instance.editor = cast(Editor)editorType.create();
}

version( unittest ) { }
else
{
import dash.core.dgame;
import std.stdio;

/// Does exactly what you think it does.
void main()
{
if( !DGame.instance )
{
writeln( "No game supplied." );
return;
}

DGame.instance.run();
}
}
2 changes: 1 addition & 1 deletion source/dash/core/package.d
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ import dash.core.gameobject;
import dash.core.scene;
import dash.core.prefabs;
import dash.core.properties;
import dash.core.reflection;
import dash.core.main;
18 changes: 0 additions & 18 deletions source/dash/core/reflection.d

This file was deleted.

2 changes: 1 addition & 1 deletion source/dash/core/scene.d
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public:
* Params:
* oldChild = The object to remove.
*/
final void removechild( GameObject oldChild )
final void removeChild( GameObject oldChild )
{
_root.removeChild( oldChild );
}
Expand Down
Loading

0 comments on commit 20d68de

Please sign in to comment.