Skip to content

Commit

Permalink
Merge branch 'release/v0.6.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
ColdenCullen committed Apr 20, 2014
2 parents 203118f + 9125491 commit cf32171
Show file tree
Hide file tree
Showing 12 changed files with 211 additions and 97 deletions.
39 changes: 18 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
language: dlang
language: d
install:
- sudo wget http://netcologne.dl.sourceforge.net/project/d-apt/files/d-apt.list -O /etc/apt/sources.list.d/d-apt.list
- sudo apt-get update
- sudo apt-get -y --allow-unauthenticated install --reinstall d-apt-keyring
- sudo apt-get update
- sudo apt-get install dub
- sudo apt-get install dmd-bin
- sudo dub install x11
- sudo dub add-local . ~master
- sudo bash ./setup-ubuntu.sh
- cd ../
- sudo git clone https://github.com/Circular-Studios/Sample-Dash-Game.git
- cd Sample-Dash-Game/
- git branch -r | grep -q $TRAVIS_BRANCH && sudo git checkout $TRAVIS_BRANCH || (exit 0)
- sudo cp libawesomium-1.6.5.so /usr/lib/libawesomium-1.6.5.so.0
- sudo wget http://netcologne.dl.sourceforge.net/project/d-apt/files/d-apt.list -O
/etc/apt/sources.list.d/d-apt.list
- sudo apt-get update
- sudo apt-get -y --allow-unauthenticated install --reinstall d-apt-keyring
- sudo apt-get update
- sudo apt-get install dmd-bin dub libfreeimage-dev libjpeg62-dev
- sudo dub install x11
- sudo dub add-local . ~master
- cd ../
- sudo git clone https://github.com/Circular-Studios/Sample-Dash-Game.git
- cd Sample-Dash-Game/
- git branch -r | grep -q $TRAVIS_BRANCH && sudo git checkout $TRAVIS_BRANCH || true
- sudo cp libawesomium-1.6.5.so /usr/lib/libawesomium-1.6.5.so.0
script: sudo dub test -q

# For pushing results to gitter.im
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/89d5205a2483bcd72a32
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: false # default: false
- https://webhooks.gitter.im/e/89d5205a2483bcd72a32
on_success: change
on_failure: always
on_start: never
29 changes: 29 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Contributing to Dash

First of all, thanks for choosing Dash! We really hope you enjoy your time working with our engine. To get setup with the engine, see our page on [setting up your environment](Setting-Up-Your-Environment-(Engine)).

## Communication

Most communication takes place as comments in issues and pull requests. When more immediate communication is required, we will use our [gitter.im room](https://gitter.im/Circular-Studios/Dash).

## Coding Standards

We here at Circular Studios loosely follow the [Official D Style](http://dlang.org/dstyle.html), however we do have some more specialized coding standards that you can read about [here](Coding-Standards).

## Git Workflow

Dash uses [Git Flow](http://nvie.com/posts/a-successful-git-branching-model/) as its branching model.

We use [semantic versioning](http://semver.org/). Each minor version gets a milestone, and release branches for them start when the milestone is complete. They are merged to master once it is decided that the release is stable. Patch versions are only created though hotfix branches, which do not need pull requests.

All major features or enhancements being added are done on feature branches, then merged to develop through Pull Requests. Pull requests should be named as `Type: Name`, where `Type` could be `Feature`, `Refactor`, `Cleanup`, etc.

Issues should be created for all tasks and bugs. Issues should be assigned to a milestone, and then claimed by a developer.

## What to Work On

Now that you know how to contribute, you may be wondering what to work on.

If you're looking for a large task, the first place to look would be on the [Planned Features](Planned-Features) page. This is where the list of all of the big things we want lives.

If you're looking for an intro to the code base, or only really have time for little things, check out the "Ready" column of our [waffle.io board](https://waffle.io/Circular-Studios/Dash). Things here could range from adding support for loading YAML arrays to fixing a bug in the linux build.
44 changes: 44 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Dash contributors (sorted alphabetically)
============================================

* **[Anton Gushcha](https://github.com/NCrashed)**

* Early contributor who helped with Linux builds and bug fixes.

* **[Brandon Littell](https://github.com/BrandonLittell)**

* Primary UI programmer, first implementing Awesomium and later CEF.
* Created engine states to give game creators flexibility in running different parts of the engine.

* **[Colden Cullen](https://github.com/ColdenCullen)**

* The creator of the engine.
* Core systems and network engineering.

* **[Daniel Jost](https://github.com/PxlBuzzard)**

* Team lead of Spectral Robot Task Force, acted as the bridge between the game and the engine.
* Drove engine development from a game programmer's perspective, found many of the early bugs and missing features needed to make a game.

* **[Eric Christenson](https://github.com/ericchristenson)**

* Graphics programmer, worked on deferred rendering and lights.

* **[Sean Brennan](https://github.com/ScrappyOrc)**

* Lead developer of [Speed](https://github.com/Circular-Studios/Speed), the networking library used in Dash.

* **[Théo Bueno](https://github.com/Munrek)**

* Early contributor who helped with Linux builds.

* **[Timothy Reynolds](https://github.com/tmr9209)**

* Lead animation programmer.
* Implemented Assimp for model loading.

* **[Tyler Wozniak](https://github.com/zeDoctor)**

* Graphics programmer, engine producer for Spring 2014.

**[Full contributors list](https://github.com/Circular-Studios/Dash/graphs/contributors).**
41 changes: 10 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,21 @@
[![Dash Logo](https://cloud.githubusercontent.com/assets/512416/2726786/6618d624-c5c2-11e3-9049-23637e5a1739.png)](https://github.com/Circular-Studios/Dash/wiki)

# [![Build Status](https://travis-ci.org/Circular-Studios/Dash.png?branch=develop)](https://travis-ci.org/Circular-Studios/Dash) [![Stories in Ready](https://badge.waffle.io/Circular-Studios/Dash.png?label=ready)](http://waffle.io/Circular-Studios/Dash) [![Docs](http://img.shields.io/badge/docs-ddoc-yellow.svg)](http://circular-studios.github.io/Dash/docs/) [![Gitter Chat](http://img.shields.io/badge/gitter-dash-brightgreen.svg)](https://gitter.im/Circular-Studios/Dash) [![Release](http://img.shields.io/github/release/Circular-Studios/Dash.svg)](http://code.dlang.org/packages/dash)
# [![Build Status](http://img.shields.io/travis/Circular-Studios/Dash/develop.svg)](https://travis-ci.org/Circular-Studios/Dash) [![Docs](http://img.shields.io/badge/docs-ddoc-yellow.svg)](http://circular-studios.github.io/Dash/docs/) [![Gitter Chat](http://img.shields.io/badge/chat-gitter-brightgreen.svg)](https://gitter.im/Circular-Studios/Dash) [![Release](http://img.shields.io/github/release/Circular-Studios/Dash.svg)](http://code.dlang.org/packages/dash) [![Stories in Ready](https://badge.waffle.io/Circular-Studios/Dash.png?label=ready)](http://waffle.io/Circular-Studios/Dash)

If you're reading this page, chances are you fall into one of the following categories:

Dash is an free and open game engine written in the D Programming Language.
#### I am a game devloper interested in making games with Dash:

#### [Our Wiki](https://github.com/Circular-Studios/Dash/wiki)
#### [Planned Features & Wish List](https://github.com/Circular-Studios/Dash/wiki/Planned-Features-&-Wish-List)
Our [readme.io page](http://dash.circularstudios.com/) has all the info you could ever want for building a game with Dash. Pro tip: you'll want to read up on [YAML](http://www.yaml.org/) and [D](http://dlang.org) before getting started.

### Running Dash
#### I am an engine developer looking to contribute to Dash:

[Setting up your environment](https://github.com/Circular-Studios/Dash/wiki/Setting-Up-Your-Environment-(Engine)) is your one-stop-shop to running Dash.
Great! We'd love to have your support/input/code. Check out [CONTRIBUTING.md](https://github.com/Circular-Studios/Dash/blob/develop/CONTRIBUTING.md) for a guide on how to get started.

### About Us
#### I have no idea what this is, I just want to see it running:

We are a team of 6 students attending Rochester Institute of Technology's Game Design & Development program.
The easiest way to get Dash running (on Windows) is to head over to our [Releases](https://github.com/Circular-Studios/Dash/releases) page and download the most recent `dash-game.zip`, and double clicking on `Dash Game`. On Linux, you'll want to check out the simple instructions at [Setting up Your Environment page](https://github.com/Circular-Studios/Dash/wiki/Setting-Up-Your-Environment-(Engine)).

### Contact
### Contact Us

We'd love to hear from you, feel free to email us at dash [at] circularstudios [dot] com. We'll do our best to have the appropriate team member respond as quickly as we can.

### Copyright & License

Copyright (c) 2013-2014 Circular Studios - Released under the MIT License.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
We'd love to hear from you, feel free to hit us up in [gitter](https://gitter.im/Circular-Studios/Dash) or email us at dash [at] circularstudios [dot] com. We'll do our best to have the appropriate team member respond as quickly as we can.
1 change: 0 additions & 1 deletion setup-ubuntu.sh

This file was deleted.

6 changes: 0 additions & 6 deletions setup-windows.bat

This file was deleted.

33 changes: 17 additions & 16 deletions source/core/dgame.d
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ enum EngineState
}

/**
* TODO
* Contains flags for all things that could be disabled.
*/
shared struct UpdateFlags
shared struct GameStateFlags
{
bool updateScene;
bool updateUI;
Expand All @@ -32,19 +32,19 @@ shared struct UpdateFlags
*/
void pauseAll()
{
foreach( member; __traits(allMembers, UpdateFlags) )
static if( __traits(compiles, __traits(getMember, UpdateFlags, member) = false) )
__traits(getMember, UpdateFlags, member) = false;
foreach( member; __traits(allMembers, GameStateFlags) )
static if( __traits(compiles, __traits(getMember, GameStateFlags, member) = false) )
__traits(getMember, GameStateFlags, member) = false;
}

/**
* Set each member to true.
*/
void resumeAll()
{
foreach( member; __traits(allMembers, UpdateFlags) )
static if( __traits(compiles, __traits(getMember, UpdateFlags, member) = true) )
__traits(getMember, UpdateFlags, member) = true;
foreach( member; __traits(allMembers, GameStateFlags) )
static if( __traits(compiles, __traits(getMember, GameStateFlags, member) = true) )
__traits(getMember, GameStateFlags, member) = true;
}
}

Expand All @@ -60,8 +60,8 @@ public:
/// Current state of the game
EngineState currentState;

///
UpdateFlags* updateFlags;
/// The current update settings
GameStateFlags* stateFlags;

/// The currently active scene
Scene activeScene;
Expand Down Expand Up @@ -104,21 +104,21 @@ public:
Input.update();

// Update webcore
if ( updateFlags.updateUI )
if ( stateFlags.updateUI )
{
UserInterface.updateAwesomium();
}

// Update physics
//if( updateFlags.updatePhysics )
//if( stateFlags.updatePhysics )
// PhysicsController.stepPhysics( Time.deltaTime );

if ( updateFlags.updateTasks )
if ( stateFlags.updateTasks )
{
executeTasks();
}

if ( updateFlags.updateScene )
if ( stateFlags.updateScene )
{
activeScene.update();
}
Expand Down Expand Up @@ -175,8 +175,8 @@ private:
{
currentState = EngineState.Run;

updateFlags = new shared UpdateFlags;
updateFlags.resumeAll();
stateFlags = new shared GameStateFlags;
stateFlags.resumeAll();

logDebug( "Initializing..." );
bench!( { Config.initialize(); } )( "Config init" );
Expand All @@ -195,6 +195,7 @@ private:
final void stop()
{
onShutdown();
resetTasks();
UserInterface.shutdownAwesomium();
Assets.shutdown();
Graphics.shutdown();
Expand Down
62 changes: 56 additions & 6 deletions source/core/gameobject.d
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,37 @@ import std.conv, std.variant;

enum AnonymousName = "__anonymous";

/**
* Contains flags for all things that could be disabled.
*/
shared struct ObjectStateFlags
{
bool update;
bool updateChildren;
bool drawMesh;
bool drawLight;

/**
* Set each member to false.
*/
void pauseAll()
{
foreach( member; __traits(allMembers, ObjectStateFlags) )
static if( __traits(compiles, __traits(getMember, ObjectStateFlags, member) = false) )
__traits(getMember, ObjectStateFlags, member) = false;
}

/**
* Set each member to true.
*/
void resumeAll()
{
foreach( member; __traits(allMembers, ObjectStateFlags) )
static if( __traits(compiles, __traits(getMember, ObjectStateFlags, member) = true) )
__traits(getMember, ObjectStateFlags, member) = true;
}
}

/**
* Manages all components and transform in the world. Can be overridden.
*/
Expand All @@ -27,6 +58,7 @@ private:
GameObject[] _children;
IComponent[TypeInfo] componentList;
string _name;
ObjectStateFlags* _stateFlags;
static uint nextId = 1;

package:
Expand All @@ -51,6 +83,8 @@ public:
mixin( Property!( _children, AccessModifier.Public ) );
/// The name of the object.
mixin( Property!( _name, AccessModifier.Public ) );
/// The current update settings
mixin( Property!( _stateFlags, AccessModifier.Public ) );
/// The ID of the object
immutable uint id;

Expand Down Expand Up @@ -178,6 +212,9 @@ public:
// Create default material
material = new shared Material();
id = nextId++;

stateFlags = new ObjectStateFlags;
stateFlags.resumeAll();
}

~this()
Expand All @@ -190,13 +227,17 @@ public:
*/
final void update()
{
onUpdate();
if( stateFlags.update )
{
onUpdate();

foreach( obj; children )
obj.update();
foreach( ci, component; componentList )
component.update();
}

foreach( ci, component; componentList )
component.update();
if( stateFlags.updateChildren )
foreach( obj; children )
obj.update();
}

/**
Expand Down Expand Up @@ -258,7 +299,16 @@ public:
return;
// Remove from current parent
else if( newChild.parent && cast()newChild.parent != cast()this )
newChild.parent.children = cast(shared)(cast(GameObject[])newChild.parent.children).remove( (cast(GameObject[])newChild.parent.children).countUntil( cast()newChild ) );
{
// Get index of object being removed
auto newChildIndex = (cast(GameObject[])newChild.parent.children).countUntil( cast()newChild );
// Get objects after one being removed
auto end = newChild.parent.children[ newChildIndex+1..$ ];
// Get objects before one being removed
newChild.parent.children = newChild.parent.children[ 0..newChildIndex ];
// Add end back
newChild.parent._children ~= end;
}

_children ~= newChild;
newChild.parent = this;
Expand Down
Loading

0 comments on commit cf32171

Please sign in to comment.