Skip to content

Commit

Permalink
Merge pull request #1 from haxenme/master
Browse files Browse the repository at this point in the history
Last changes
  • Loading branch information
codeservice committed Jan 27, 2013
2 parents 09dab5e + ae94810 commit dde20f1
Show file tree
Hide file tree
Showing 37 changed files with 2,400 additions and 43 deletions.
2 changes: 1 addition & 1 deletion native/utils/ArrayBufferView.hx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class ArrayBufferView implements IMemoryRange {
untyped __global__.__hxcpp_memory_set_i16(bytes, bytePos + byteOffset, v);
#else
buffer.position = bytePos + byteOffset;
buffer.writeShort(v);
buffer.writeShort(Std.int (v));
#end

}
Expand Down
2 changes: 1 addition & 1 deletion nme/Assets.hx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package nme;
#if (!nme_install_tool)
#if (!nme_install_tool || display)


import format.display.MovieClip;
Expand Down
14 changes: 13 additions & 1 deletion project/opengl/OGLShaders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,22 @@ class OGLProg : public GPUProg
{
if (inData)
{
#ifndef NME_GLES
glEnable(GL_TEXTURE_2D);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(2, GL_FLOAT, 0, inData);
#endif
glVertexAttribPointer(mTextureSlot, 2, GL_FLOAT, GL_FALSE, 0, inData);
glEnableVertexAttribArray(mTextureSlot);
glUniform1i(mTextureSlot,0);
}
}
else
{
#ifndef NME_GLES
glDisable(GL_TEXTURE_2D);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
#endif
}
}

void setColourData(const int *inData)
Expand Down
57 changes: 57 additions & 0 deletions samples/ActuateExample/ActuateExample.hxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<project version="2">
<!-- Output SWF options -->
<output>
<movie outputType="Application" />
<movie input="" />
<movie path="project.nmml" />
<movie fps="30" />
<movie width="800" />
<movie height="600" />
<movie version="3" />
<movie minorVersion="0" />
<movie platform="NME" />
<movie background="#FFFFFF" />
</output>
<!-- Other classes to be compiled into your SWF -->
<classpaths>
<class path="Source" />
</classpaths>
<!-- Build options -->
<build>
<option directives="" />
<option flashStrict="False" />
<option mainClass="io.nme.samples.actuateexample" />
<option enabledebug="False" />
<option additional="" />
</build>
<!-- haxelib libraries -->
<haxelib>
<library name="nme" />
<library name="actuate" />
</haxelib>
<!-- Class files to compile (other referenced classes will automatically be included) -->
<compileTargets>
<!-- example: <compile path="..." /> -->
</compileTargets>
<!-- Assets to embed into the output SWF -->
<library>
<!-- example: <asset path="..." id="..." update="..." glyphs="..." mode="..." place="..." sharepoint="..." /> -->
</library>
<!-- Paths to exclude from the Project Explorer tree -->
<hiddenPaths>
<!-- example: <hidden path="..." /> -->
</hiddenPaths>
<!-- Executed before build -->
<preBuildCommand />
<!-- Executed after build -->
<postBuildCommand alwaysRun="False" />
<!-- Other project options -->
<options>
<option showHiddenPaths="False" />
<option testMovie="Custom" />
<option testMovieCommand="" />
</options>
<!-- Plugin storage -->
<storage />
</project>
17 changes: 17 additions & 0 deletions samples/ActuateExample/Assets/nme.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
90 changes: 90 additions & 0 deletions samples/ActuateExample/Source/Main.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import com.eclecticdesignstudio.motion.Actuate;
import com.eclecticdesignstudio.motion.easing.Quad;
import nme.display.Sprite;
import nme.events.Event;
import nme.Lib;


class Main extends Sprite {


public function new () {

super ();

initialize ();
construct ();

}


private function animateCircle (circle:Sprite):Void {

var duration = 1.5 + Math.random () * 4.5;
var targetX = Math.random () * Lib.current.stage.stageWidth;
var targetY = Math.random () * Lib.current.stage.stageHeight;

Actuate.tween (circle, duration, { x: targetX, y: targetY }, false).ease (Quad.easeOut).onComplete (animateCircle, [ circle ]);

}


private function construct ():Void {

for (i in 0...80) {

var creationDelay = Math.random () * 10;
Actuate.timer (creationDelay).onComplete (createCircle);

}

}


private function createCircle ():Void {

var size = 5 + Math.random () * 35 + 20;
var circle = new Sprite ();

circle.graphics.beginFill (Std.int (Math.random () * 0xFFFFFF));
circle.graphics.drawCircle (0, 0, size);
circle.alpha = 0.2 + Math.random () * 0.6;
circle.x = Math.random () * Lib.current.stage.stageWidth;
circle.y = Math.random () * Lib.current.stage.stageHeight;

addChildAt (circle, 0);
animateCircle (circle);

}


private function initialize ():Void {

Lib.current.stage.addEventListener (Event.ACTIVATE, stage_onActivate);
Lib.current.stage.addEventListener (Event.DEACTIVATE, stage_onDeactivate);

}




// Event Handlers




private function stage_onActivate (event:Event):Void {

Actuate.resumeAll ();

}


private function stage_onDeactivate (event:Event):Void {

Actuate.pauseAll ();

}


}
15 changes: 15 additions & 0 deletions samples/ActuateExample/project.nmml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<project>

<meta title="Actuate Example" package="io.nme.samples.actuateexample" version="1.0.0" company="NME" />
<app main="Main" path="Export" file="ActuateExample" />

<source path="Source" />

<haxelib name="nme" />
<haxelib name="actuate" />

<assets path="Assets" rename="assets" exclude="nme.svg" />
<icon path="Assets/nme.svg" />

</project>
17 changes: 17 additions & 0 deletions samples/HerokuShaders/Assets/nme.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions samples/HerokuShaders/HerokuShaders.hxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<project version="2">
<!-- Output SWF options -->
<output>
<movie outputType="Application" />
<movie input="" />
<movie path="project.nmml" />
<movie fps="30" />
<movie width="800" />
<movie height="600" />
<movie version="3" />
<movie minorVersion="0" />
<movie platform="NME" />
<movie background="#FFFFFF" />
</output>
<!-- Other classes to be compiled into your SWF -->
<classpaths>
<class path="Source" />
</classpaths>
<!-- Build options -->
<build>
<option directives="" />
<option flashStrict="False" />
<option mainClass="io.nme.samples.herokushaders" />
<option enabledebug="False" />
<option additional="" />
</build>
<!-- haxelib libraries -->
<haxelib>
<library name="nme" />
<library name="actuate" />
</haxelib>
<!-- Class files to compile (other referenced classes will automatically be included) -->
<compileTargets>
<!-- example: <compile path="..." /> -->
</compileTargets>
<!-- Assets to embed into the output SWF -->
<library>
<!-- example: <asset path="..." id="..." update="..." glyphs="..." mode="..." place="..." sharepoint="..." /> -->
</library>
<!-- Paths to exclude from the Project Explorer tree -->
<hiddenPaths>
<!-- example: <hidden path="..." /> -->
</hiddenPaths>
<!-- Executed before build -->
<preBuildCommand />
<!-- Executed after build -->
<postBuildCommand alwaysRun="False" />
<!-- Other project options -->
<options>
<option showHiddenPaths="False" />
<option testMovie="Custom" />
<option testMovieCommand="" />
</options>
<!-- Plugin storage -->
<storage />
</project>
Loading

0 comments on commit dde20f1

Please sign in to comment.