Mark Sibly před 8 roky
rodič
revize
194e8db295

+ 4 - 1
modules/std/audio/audiodata.monkey2

@@ -102,7 +102,10 @@ Class AudioData Extends Resource
 		Return 0
 	End
 	
-	#rem monkey Loads audio data from a file.
+	#rem monkeydoc Loads audio data from a file.
+	
+	The file must be in "wav" or ".ogg" format.
+	
 	#end
 	Function Load:AudioData( path:String )
 	

+ 1 - 0
modules/std/audio/load_vorbis.monkey2

@@ -29,6 +29,7 @@ Class StbAudioData Extends AudioData
 	
 End
 
+Internal
 
 Function LoadAudioData_OGG:AudioData( path:String )
 

+ 1 - 1
modules/std/audio/load_wav.monkey2

@@ -98,7 +98,7 @@ Function ReadWAV:AudioData( stream:std.stream.Stream )
 
 End
 
-Public
+Internal
 
 Function LoadAudioData_WAV:AudioData( path:String )
 

+ 34 - 4
modules/std/collections/deque.monkey2

@@ -247,7 +247,7 @@ Class Deque<T> Implements IContainer<T>
 	
 	#rem monkeydoc Adds a value at the start of the deque.
 	#end
-	Method PushFirst( value:T )
+	Method AddFirst( value:T )
 		If Length+1=Capacity Reserve( Capacity+1 )
 
 		_head-=1
@@ -257,7 +257,7 @@ Class Deque<T> Implements IContainer<T>
 	
 	#rem monkeydoc Adds a value at the end of the deque.
 	#end
-	Method PushLast( value:T )
+	Method AddLast( value:T )
 		If Length+1=Capacity Reserve( Capacity+1 )
 
 		_data[_tail]=value
@@ -265,12 +265,26 @@ Class Deque<T> Implements IContainer<T>
 		If _tail=Capacity _tail=0
 	End
 	
+	#rem monkeydoc @deprecated Use [[AddFirst]]
+	#end
+	Method PushFirst( value:T )
+	
+		AddFirst( value)
+	End
+
+	#rem monkeydoc @deprecated Use [[AddLast]]
+	#end
+	Method PushLast( value:T )
+	
+		AddLast( value)
+	End
+	
 	#rem monkeydoc Removes and returns the first value in a deque.
 	
 	In debug builds, a runtime error will occur if the deque is empty.
 	
 	#end
-	Method PopFirst:T()
+	Method RemoveFirst:T()
 		DebugAssert( Not Empty,"Illegal operation on empty deque" )
 
 		Local value:=_data[_head]
@@ -285,7 +299,7 @@ Class Deque<T> Implements IContainer<T>
 	In debug builds, a runtime error will occur if the deque is empty.
 
 	#end
-	Method PopLast:T()
+	Method RemoveLast:T()
 		DebugAssert( Not Empty,"Illegal operation on empty deque" )
 		
 		_tail-=1
@@ -295,6 +309,22 @@ Class Deque<T> Implements IContainer<T>
 		Return value
 	End
 	
+	#rem monkeydoc @deprecated use [[RemoveFirst]].
+	#end
+	Method PopFirst:T()
+	
+		Return RemoveFirst()
+	End
+
+	#rem monkeydoc @deprecated use [[RemoveLast]].
+	#end
+	Method PopLast:T()
+	
+		Return RemoveLast()
+	End
+	
+	
+	
 	#rem monkeydoc Returns the first value in the deque.
 
 	In debug builds, a runtime error will occur if the deque is empty.

+ 26 - 11
modules/std/geom/affinemat3.monkey2

@@ -5,12 +5,16 @@ Namespace std.geom
 #end
 Alias AffineMat3f:AffineMat3<Float>
 
-#rem monkeydoc Affine 3x3 matrix class.
+#rem monkeydoc The generic AffineMat3f class provides support for affine 3x3 matrices.
 
 An affine 3x3 matrix is a 3x3 matrix whose right hand column is always 0,0,1.
 
 Affine 3x3 matrices are often used for 2d transformations such as scaling, rotation and translation.
 
+Unless otherwise noted, methods and operators always return a new vec3 containing the result, without modifying any parameters or 'self'.
+
+This allows you to chain operators together easily just like 'real' expressions.
+
 #end
 Struct AffineMat3<T>
 
@@ -40,7 +44,7 @@ Struct AffineMat3<T>
 		Self.i.x=ix;Self.i.y=iy;Self.j.x=jx;Self.j.y=jy;Self.t.x=tx;Self.t.y=ty
 	End
 	
-	#rem monkeydoc Converts the matrix to a matrix of a different type.
+	#rem monkeydoc Converts the matrix to a matrix of a different type, or a printable string.
 	#end
 	Operator To<C>:AffineMat3<C>()
 		Return New AffineMat3<C>( i.x,i.y,j.x,j.y,t.x,t.y )
@@ -52,7 +56,7 @@ Struct AffineMat3<T>
 		Return "AffineMat3("+i.x+","+i.y+","+j.x+","+j.y+","+t.x+","+t.y+")"
 	End
 	
-	#rem monkeydoc Returns the inverse of the matrix.
+	#rem monkeydoc Inverts the matrix.
 	#end
 	Operator-:AffineMat3()
 		Local idet:=1.0/(i.x*j.y-i.y*j.x)
@@ -62,13 +66,13 @@ Struct AffineMat3<T>
 			(j.x*t.y-j.y*t.x)*idet , (i.y*t.x-i.x*t.y)*idet )
 	End
 	
-	#rem monkeydoc Multiplies a vector by the matrix and returns the result.
+	#rem monkeydoc Multiplies a vector by the matrix.
 	#end
 	Operator*:Vec2<T>( v:Vec2<T> )
 		Return New Vec2<T>( i.x*v.x + j.x*v.y + t.x , i.y*v.x + j.y*v.y + t.y )
 	End
 	
-	#rem monkeydoc Multiplies the matrix by another matrix and returns the result.
+	#rem monkeydoc Multiplies the matrix by another matrix.
 	#end
 	Operator*:AffineMat3( m:AffineMat3 )
 		Return New AffineMat3(
@@ -77,19 +81,19 @@ Struct AffineMat3<T>
 			i.x*m.t.x + j.x*m.t.y + t.x , i.y*m.t.x + j.y*m.t.y + t.y )
 	End
 	
-	#rem monkeydoc Multiplies a vector by the matrix and returns the result.
+	#rem monkeydoc Multiplies a vector by the matrix.
 	#end
 	Method Transform:Vec2<T>( v:Vec2<T> )
 		Return New Vec2<T>( i.x*v.x + j.x*v.y + t.x , i.y*v.x + j.y*v.y + t.y )
 	End
 			
-	#rem monkeydoc Multiplies a vector by the matrix and returns the result.
+	#rem monkeydoc Multiplies a vector by the matrix.
 	#end
 	Method Transform:Vec2<T>( x:T,y:T )
 		Return New Vec2<T>( i.x*x + j.x*y + t.x , i.y*x + j.y*y + t.y )
 	End
 	
-	#rem monkeydoc Multiplies the matrix by another matrix and returns the result.
+	#rem monkeydoc Multiplies the matrix by another matrix.
 	#end
 	Method Transform:AffineMat3( ix:Float,iy:Float,jx:Float,jy:Float,tx:Float,ty:Float )
 		Return New AffineMat3(
@@ -98,7 +102,7 @@ Struct AffineMat3<T>
 			i.x*tx + j.x*ty + t.x , i.y*tx + j.y*ty + t.y )
 	End
 	
-	#rem monkeydoc Applies a translation transformation to the matrix and returns the result.
+	#rem monkeydoc Applies a translation transformation to the matrix.
 	#end
 	Method Translate:AffineMat3( tx:T,ty:T )
 		Return Transform( 1,0,0,1,tx,ty )
@@ -108,13 +112,13 @@ Struct AffineMat3<T>
 		Return Transform( 1,0,0,1,tv.x,tv.y )
 	End
 	
-	#rem monkeydoc Applies a rotation transformation to the matrix and returns the result.
+	#rem monkeydoc Applies a rotation transformation to the matrix.
 	#end
 	Method Rotate:AffineMat3( rz:Double )
 		Return Transform( Cos( rz ),-Sin( rz ),Sin( rz ),Cos( rz ),0,0 )
 	End
 	
-	#rem monkeydoc Applies a scale transformation to the matrix and returns the result.
+	#rem monkeydoc Applies a scale transformation to the matrix.
 	#end
 	Method Scale:AffineMat3( sx:T,sy:T )
 		Return Transform( sx,0,0,sy,0,0 )
@@ -124,6 +128,8 @@ Struct AffineMat3<T>
 		Return Transform( sv.x,0,0,sv.y,0,0 )
 	End
 	
+	#rem monkeydoc Creates a matrix representing a translation.
+	#end
 	Function Translation:AffineMat3( tx:T,ty:T )
 		Return New AffineMat3( 1,0,0,1,tx,ty )
 	End
@@ -132,10 +138,17 @@ Struct AffineMat3<T>
 		Return New AffineMat3( 1,0,0,1,tv.x,tv.y )
 	End
 	
+	#rem monkeydoc Creates a matrix representing a rotation.
+	
+	The `rotation` parameter is in radians.
+	
+	#end
 	Function Rotation:AffineMat3( rz:Double )
 		Return New AffineMat3( Cos( rz ),-Sin( rz ),Sin( rz ),Cos( rz ),0,0 )
 	End
 	
+	#rem monkeydoc Creates a matrix representing a scaling.
+	#end
 	Function Scaling:AffineMat3( sx:T,sy:T )
 		Return New AffineMat3( sx,0,0,sy,0,0 )
 	End
@@ -144,6 +157,8 @@ Struct AffineMat3<T>
 		Return New AffineMat3( sv.x,0,0,sv.y,0,0 )
 	End
 
+	#rem monkeydoc Creates a matrix representing an orthographic projection.
+	#end
 	Function Ortho:AffineMat3( left:T,right:T,bottom:T,top:T )
 
 		Local w:=right-left,h:=top-bottom

+ 28 - 14
modules/std/geom/affinemat4.monkey2

@@ -5,18 +5,29 @@ Namespace std.geom
 #end
 Alias AffineMat4f:AffineMat4<Float>
 
-#rem monkeydoc Affine 4x4 matrix class.
+#rem monkeydoc The generic AffineMat4f class provides support for affine 4x4 matrices.
 
 An affine 4x4 matrix is a 4x4 matrix whose right hand column is always 0,0,0,1.
 
 Affine 4x4 matrices are often used for 3d transformations such as scaling, rotation and translation.
 
+Unless otherwise noted, methods and operators always return a new vec3 containing the result, without modifying any parameters or 'self'.
+
+This allows you to chain operators together easily just like 'real' expressions.
+
 #end
 Struct AffineMat4<T>
 
+	#rem monkeydoc The matrix component of the matrix.
+	#end
 	Field m:Mat3<T>
+
+	#rem monkeydoc The translation component of the matrix.
+	#end
 	Field t:Vec3<T>
 	
+	#rem monkeydoc Creates a new matrix.
+	#end
 	Method New()
 		m.i.x=1; m.j.y=1; m.k.z=1
 	End
@@ -58,39 +69,40 @@ Struct AffineMat4<T>
 		Self.t=m.t.XYZ
 	End
 	
-	#rem monkeydoc Converts the matrix to a matrix of a different type.
+	#rem monkeydoc Converts the matrix to a matrix of a different type, or a printable string.
 	#end
 	Operator To<C>:AffineMat4<C>()
 		Return New AffineMat4<C>( m,t )
 	End
 	
-	#rem monkeydoc Converts the matrix to a printable string.
-	#end
 	Operator To:String()
 		Return "AffineMat4("+m+","+t+")"
 	End
 	
-	#rem monkeydoc Returns the transpose of the matrix.
+	#rem monkeydoc Transposes the matrix.
+	
+	Transposing a matrix swaps rows and columns.
+	
 	#End
 	Operator~:AffineMat4()
 		Local i:=~m
 		Return New AffineMat4( i,i*-t )
 	End
 	
-	#rem monkeydoc Returns the inverse of the matrix.
+	#rem monkeydoc Inverts the matrix.
 	#end
 	Operator-:AffineMat4()
 		Local i:=-m
 		Return New AffineMat4( i,i*-t )
 	End
 	
-	#rem monkeydoc Multiplies the matrix by another matrix and returns the result.
+	#rem monkeydoc Multiplies the matrix by another matrix.
 	#end
 	Operator*:AffineMat4( q:AffineMat4 )
 		Return New AffineMat4( m*q.m,m*q.t+t )
 	End
 	
-	#rem monkeydoc Multiplies a vector by the matrix and returns the result.
+	#rem monkeydoc Multiplies a vector by the matrix.
 	#end
 	Operator*:Vec3<T>( v:Vec3<T> )
 		Return New Vec3<T>( 
@@ -99,7 +111,7 @@ Struct AffineMat4<T>
 			m.i.z*v.x+m.j.z*v.y+m.k.z*v.z+t.z )
 	End
 
-	#rem monkeydoc Applies a translation transformation to the matrix and returns the result.
+	#rem monkeydoc Applies a translation transformation to the matrix.
 	#end
 	Method Translate:AffineMat4( tx:T,ty:T,tz:T )
 		Return Self * Translation( tx,ty,tz )
@@ -109,7 +121,7 @@ Struct AffineMat4<T>
 		Return Self * Translation( tv )
 	End
 
-	#rem monkeydoc Applies a rotation transformation to the matrix and returns the result.
+	#rem monkeydoc Applies a rotation transformation to the matrix.
 	#end
 	Method Rotate:AffineMat4( rx:Double,ry:Double,rz:Double )
 		Return Self * Rotation( rx,ry,rz )
@@ -123,7 +135,7 @@ Struct AffineMat4<T>
 		Return Self * Rotation( q )
 	End
 	
-	#rem monkeydoc Applies a scaling transformation to the matrix and returns the result.
+	#rem monkeydoc Applies a scaling transformation to the matrix.
 	#end
 	Method Scale:AffineMat4( sx:T,sy:T,sz:T )
 		Return Self * Scaling( sx,sy,sz )
@@ -137,7 +149,7 @@ Struct AffineMat4<T>
 		Return Self * Scaling( scaling )
 	End
 	
-	#rem monkeydoc Creates a translation matrix.
+	#rem monkeydoc Creates a matrix representing a translation.
 	#end
 	Function Translation:AffineMat4( tv:Vec3<T> )
 		Return New AffineMat4( tv )
@@ -147,10 +159,12 @@ Struct AffineMat4<T>
 		Return New AffineMat4( New Vec3<T>( tx,ty,tz ) )
 	End
 
-	#rem monkeydoc Creates a rotation matrix from euler angles.
+	#rem monkeydoc Creates a matrix repsenting a rotation form eular angles or a quat.
 	
 	Order of rotation is Yaw * Pitch * Roll.
 	
+	The `rotation` angle  is in radians.
+	
 	#end
 	Function Rotation:AffineMat4( rv:Vec3<Double> )
 		Return New AffineMat4( Mat3<T>.Rotation( rv ) )
@@ -164,7 +178,7 @@ Struct AffineMat4<T>
 		Return New AffineMat4( q )
 	End
 	
-	#rem monkeydoc Creates a scaling matrix.
+	#rem monkeydoc Creates a matrix representing a scaling.
 	#end
 	Function Scaling:AffineMat4( sv:Vec3<T> )
 		Return New AffineMat4( Mat3<T>.Scaling( sv ) )

+ 58 - 10
modules/std/geom/mat3.monkey2

@@ -5,15 +5,24 @@ Namespace std.geom
 #end
 Alias Mat3f:Mat3<Float>
 
-#rem monkeydoc The Mat3 class provides support for 3x3 matrices.
-
+#rem monkeydoc The generic Mat3 class provides support for 3x3 matrices.
 #end
 Struct Mat3<T>
 
+	#rem monkeydoc The first row of the matrix.
+	#end
 	Field i:Vec3<T>
+	
+	#rem monkeydoc The second row of the matrix.
+	#end
 	Field j:Vec3<T>
+	
+	#rem monkeydoc The third row of the matrix.
+	#end
 	Field k:Vec3<T>
 	
+	#rem monkeydoc Creates a new Matrix.
+	#end
 	Method New()
 		i.x=1;j.y=1;k.z=1
 	End
@@ -41,6 +50,8 @@ Struct Mat3<T>
 		k.x=  2*(xz-wy) ; k.y=  2*(yz+wx) ; k.z=1-2*(xx+yy)
 	End
 	
+	#rem monkeydoc Converts the matrix to a matrix of another type, or to a quaternion or printable string.
+	#end
 	Operator To<C>:Mat3<C>()
 		Return New Mat3<C>( i,j,k )
 	End
@@ -53,14 +64,20 @@ Struct Mat3<T>
 		Return "Mat3("+i+","+j+","+k+")"
 	End
 	
+	#rem monkeydoc The determinant of the matrix.
+	#end
 	Property Determinant:T()
 		Return i.x*(j.y*k.z-j.z*k.y )-i.y*(j.x*k.z-j.z*k.x )+i.z*(j.x*k.y-j.y*k.x )
 	End
 	
+	#rem monkeydoc Computes the transpose of the matrix.
+	#end
 	Operator~:Mat3()
 		Return New Mat3( i.x,j.x,k.x, i.y,j.y,k.y, i.z,j.z,k.z )
 	End
 	
+	#rem monkeydoc Computes the inverse of the matrix.
+	#end
 	Operator-:Mat3()
 		Local t:=1.0/Determinant
 		Return New Mat3(
@@ -69,6 +86,8 @@ Struct Mat3<T>
 			 t*(j.x*k.y-j.y*k.x),-t*(i.x*k.y-i.y*k.x), t*(i.x*j.y-i.y*j.x) )
 	End
 	
+	#rem monkeydoc Multiplies the matrix by another matrix.
+	#end
 	Operator*:Mat3( m:Mat3 )
 		Return New Mat3(
 			i.x*m.i.x+j.x*m.i.y+k.x*m.i.z, i.y*m.i.x+j.y*m.i.y+k.y*m.i.z, i.z*m.i.x+j.z*m.i.y+k.z*m.i.z,
@@ -76,22 +95,26 @@ Struct Mat3<T>
 			i.x*m.k.x+j.x*m.k.y+k.x*m.k.z, i.y*m.k.x+j.y*m.k.y+k.y*m.k.z, i.z*m.k.x+j.z*m.k.y+k.z*m.k.z )
 	End
 	
-'	Operator*:Mat3( q:Quat<T> )
-'		Return Self * New Mat3( q )
-'	End
-	
+	#rem monkeydoc Multiplies a vector by the matrix.
+	#end
 	Operator*:Vec3<T>( v:Vec3<T> )
 		Return New Vec3<T>( i.x*v.x+j.x*v.y+k.x*v.z,i.y*v.x+j.y*v.y+k.y*v.z,i.z*v.x+j.z*v.y+k.z*v.z )
 	End
 	
+	#rem monkeydoc Gets a row of the matrix.
+	#end
 	Method GetRow:Vec3<T>( row:Int )
 		Return row=0 ? i Else (row=1 ? j Else k)
 	End
 	
+	#rem monkeydoc Gets a column of the matrix.
+	#end
 	Method GetColumn:Vec3<T>( col:Int )
 		Return col=0 ? New Vec3<T>( i.x,j.x,k.x ) Else (col=1 ? New Vec3<T>( i.y,j.y,k.y ) Else New Vec3<T>( i.z,j.z,k.z ))
 	End
 	
+	#rem monkeydocs Computes the cofactor matrix.
+	#end
 	Method Cofactor:Mat3()
 		Return New Mat3(
 			 (j.y*k.z-j.z*k.y),-(j.x*k.z-j.z*k.x), (j.x*k.y-j.y*k.x),
@@ -99,26 +122,47 @@ Struct Mat3<T>
 			 (i.y*j.z-i.z*j.y),-(i.x*j.z-i.z*j.x), (i.x*j.y-i.y*j.x) )
 	End
 	
+	#rem monkeydocs Computes the pitch of the matrix in radians.
+	
+	Pitch is the angle of rotation around the X axis.
+	
+	#end
 	Method GetPitch:Double()
 		Return k.Pitch
 	End
 	
+	#rem monkeydocs Computes the yaw of the matrix in radians.
+
+	Yaw is the angle of rotation around the Y axis.
+	
+	#end
 	Method GetYaw:Double()
 		Return k.Yaw
 	End
 	
+	#rem monkeydocs Computes the roll of the matrix in radians.
+	
+	Roll is the angle of rotation around the Z axis.
+	
+	#end
 	Method GetRoll:Double()
 		Return ATan2( i.y,j.y )
 	End
 	
+	#rem monkeydoc Computes the pitch, yaw and roll angles of rotation in radians.
+	#end
 	Method GetRotation:Vec3<T>()
 		Return New Vec3<T>( GetPitch(),GetYaw(),GetRoll() )
 	End
 	
+	#rem monkeydoc Computes the scaling term of the matrix.
+	#end
 	Method GetScaling:Vec3<T>()
 		Return New Vec3<T>( i.Length,j.Length,k.Length )
 	End
 	
+	#rem monkeydoc Rotates the matrix by euler angles or a quaternion.
+	#end
 	Method Rotate:Mat3( rv:Vec3<T> )
 		Return Self * Rotation( rv )
 	End
@@ -131,6 +175,8 @@ Struct Mat3<T>
 		Return Self * Rotation( q )
 	End
 	
+	#rem monkeydoc Scales the matrix.
+	#end
 	Method Scale:Mat3( rv:Vec3<T> )
 		Return Self * Scaling( rv )
 	End
@@ -142,7 +188,9 @@ Struct Mat3<T>
 	Method Scale:Mat3( t:T )
 		Return Self * Scaling( t )
 	End
-
+	
+	#rem monkeydoc Orthogonalizes the matrix.
+	#end
 	Method Orthogonalize:Mat3()
 		Local k:=Self.k.Normalize()
 		Return New Mat3( j.Cross( k ).Normalize(),k.Cross( i ).Normalize(),k )
@@ -150,7 +198,7 @@ Struct Mat3<T>
 	
 	#rem monkeydoc Creates a yaw rotation matrix.
 	
-	Returns a matrix representing a rotation around the Y axis of `angle` radians.
+	Returns a matrix representing a rotation of `angle` radians around the Y axis.
 	
 	#end
 	Function Yaw:Mat3( angle:Double )
@@ -160,7 +208,7 @@ Struct Mat3<T>
 	
 	#rem monkeydoc Creates a pitch rotation matrix.
 	
-	Returns a matrix representing a rotation around the X axis of `angle` radians.
+	Returns a matrix representing a rotation of `angle` radians around the X axis.
 	
 	#end
 	Function Pitch:Mat3( angle:Double )
@@ -170,7 +218,7 @@ Struct Mat3<T>
 	
 	#rem monkeydoc Creates a yaw rotation matrix.
 	
-	Returns a matrix representing a rotation around the Y axis of `an` radians.
+	Returns a matrix representing a rotation of `angle` radians around the Y axis.
 	
 	#end
 	Function Roll:Mat3( angle:Double )

+ 2 - 0
modules/std/geom/mat4.monkey2

@@ -5,6 +5,8 @@ Namespace std.geom
 #end
 Alias Mat4f:Mat4<Float>
 
+#rem monkeydoc The generic Mat3 class provides support for 4x4 matrices.
+#end
 Struct Mat4<T>
 
 	Field i:Vec4<T>

+ 5 - 41
modules/std/graphics/color.monkey2

@@ -1,9 +1,11 @@
 
 Namespace std.graphics
 
-	#rem monkeydoc The Color type provides support for manipulating red, green blue, alpha colors.
-	#end
-	Struct Color
+using std.geom
+
+#rem monkeydoc The Color type provides support for manipulating red, green blue, alpha colors.
+#end
+Struct Color
 		
 	#rem monkeydoc Transparent black.
 	#end
@@ -141,44 +143,6 @@ Namespace std.graphics
 	#end
 	Const Platinum:=New Color( 0.83493408973507777,0.81484503266020314,0.78399912482207756 )
 	
-#rem	
-	#rem monkeydoc Silver.
-	#end
-	Const Silver:=New Color( .971519,.959915,.915324,1 )
-	
-	#rem monkeydoc Aluminum.
-	#end
-	Const Aluminum:=New Color( .913183,.921494,.924524,1 )
-	
-	#rem monkeydoc Gold.
-	#end
-	Const Gold:=New Color( 1,.765557,.336057,1 )
-	
-	#rem monkeydoc Copper.
-	#end
-	Const Copper:=New Color( .955008,.637427,.538163,1 )
-	
-	#rem monkeydoc Chromium.
-	#end
-	Const Chromium:=New Color( .549585,.556114,.554256,1 )
-	
-	#rem monkeydoc Nickel.
-	#end
-	Const Nickel:=New Color( .659777,.608679,.525649,1 )
-	
-	#rem monkeydoc Titanium.
-	#end
-	Const Titanium:=New Color( .541931,.496791,.449419,1 )
-	
-	#rem monkeydoc Cobalt.
-	#end
-	Const Cobalt:=New Color( .662124,.654864,.633732,1 )
-	
-	#rem monkeydoc Platinum.
-	#end
-	Const Platinum:=New Color( .672411,.637331,.585456,1 )
-#end
-
 	#rem monkeydoc Red component of color.
 	#end
 	Field r:Float

+ 33 - 4
modules/std/process/process.monkey2

@@ -9,36 +9,65 @@ Namespace std.process
 
 Extern
 
+#rem The Process class.
+
+Note that stderr output handling is not yet implemented.
+
+#end
 Class Process="bbProcess"
 
+	#rem monkeydoc Invoked when process has finished executing.
+	#end
 	Field Finished:Void()="finished"
 	
+	#rem monkeydoc Invoked when process has written to stdout.
+	#end
 	Field StdoutReady:Void()="stdoutReady"
 	
+	#rem monkeydoc Invoked when proces has written to stderr (TODO).
+	#end
 	Field StderrReady:Void()="stderrReady"
-
-	Property ExitCode:Int()="exitCode"
 	
+	#rem monkeydoc Process exit code.
+	#end
+	Property ExitCode:Int()="exitCode"
+
+	#rem monkeydoc Process stdout bytes available to read.
+	#end	
 	Property StdoutAvail:Int()="stdoutAvail"
 
+	#rem monkeydoc Process stder bytes available to read (TODO).
+	#end	
 	Property StderrAvail:Int()="stderrAvail"
 	
+	#rem monkeydoc Starts a new process.
+	#end
 	Method Start:Bool( cmd:String )="start"
-	
+
+	#rem monkeydoc Read process stdout.
+	#end	
 	Method ReadStdout:String()="readStdout"
 	
 	Method ReadStdout:Int( buf:Void Ptr,count:Int )="readStdout"
 
+	#rem monkeydoc Read process stderr (TODO).
+	#end	
 	Method ReadStderr:String()="readStderr"
 	
 	Method ReadStderr:Int( buf:Void Ptr,count:Int )="readStderr"
 
+	#rem monkeydoc Write process stdin.
+	#end
 	Method WriteStdin( str:String )="writeStdin"
 	
 	Method WriteStdin:Int( buf:Void Ptr,count:Int )="writeStdin"
-	
+
+	#rem monkeydoc Send break signal to process.
+	#end	
 	Method SendBreak()="sendBreak"
 	
+	#rem monkeydoc Terminate process.
+	#end
 	Method Terminate:Void()="terminate"
 
 End

+ 2 - 0
modules/std/process/processstream.monkey2

@@ -3,6 +3,8 @@ Namespace std.process
 
 #If __TARGET__<>"emscripten"
 
+#rem monkeydoc The ProcessStream class.
+#end
 Class ProcessStream Extends Stream
 
 	#rem monkeydoc The underlying process.

+ 13 - 6
modules/std/resource/resource.monkey2

@@ -11,12 +11,14 @@ Class BBResource="bbResource"
 	
 	Protected
 	
-	Method InternalDiscard()="discard"
-		
 	Method OnDiscard() Virtual="onDiscard"
 	
 	Method OnFinalize() Virtual="onFinalize"
 	
+	Internal
+
+	Method InternalDiscard()="discard"
+	
 End
 
 Public
@@ -25,10 +27,10 @@ Public
 
 The resource class helps with managing finite OS resources in a garbage collected environment.
 
-To implement a resource object, you should extend the Resource class and override the OnDiscard and/or OnFinalize methods.
+To implement a resource object, you should extend the Resource class and override the [[OnDiscard]] and/or [[OnFinalize]] methods.
 
-Code to actually discard the resource should be placed in [[OnDiscard]]. Discarding a resource might involve closing a file, deleting 
-a texture handle or other similar actions. 'Last chance' cleanup code should be placed in [[OnFinalize]].
+Code to actually discard the resource should be placed in OnDiscard. Discarding a resource might involve closing a file, deleting 
+a texture handle or other similar actions. 'Last chance' cleanup code should be placed in OnFinalize.
 
 IMPORTANT! There are a number of restrictions on code that may be placed in OnFinalize, please refer to the documentation for [[OnFinalize]]
 for more information.
@@ -52,7 +54,7 @@ Class Resource Extends BBResource
 	
 	Protected
 	
-	#rem monkeyoc The OnDiscard method.
+	#rem monkeydoc The OnDiscard method.
 	
 	This is where subclasses should place their actual discard code.
 	
@@ -138,6 +140,11 @@ Class ResourceManager Extends Resource
 	Field _retained:=New StringMap<Resource>
 End
 
+#rem monkeydoc Safely discards a resource.
+
+Invoke [[Resource.Discard]] on the given resource `r` only if `r` is non-null.
+
+#end
 Function SafeDiscard( r:Resource )
 	
 	If r r.Discard()

+ 1 - 1
modules/std/std.monkey2

@@ -75,7 +75,7 @@ Namespace std
 #Import "misc/chartype"
 #Import "misc/stringio"
 #Import "misc/json"
-#Import "misc/jsonify"
+'#Import "misc/jsonify"
 #Import "misc/zipfile"
 
 #Import "socket/socket"

+ 15 - 1
modules/std/time/timer.monkey2

@@ -15,8 +15,17 @@ Using std.fiber
 
 Public
 
+#rem monkeydoc The Timer class.
+#end
 Class Timer
 
+	#rem monkeydoc Creates a new Timer.
+	
+	Creates new timer with `hertz` frequency.
+	
+	The timer will continually invoke the `fired` function at the rate of `hertz` times per second.
+	
+	#end
 	Method New( hertz:Double,fired:Void() )
 	
 		New Fiber( Lambda()
@@ -46,7 +55,10 @@ Class Timer
 		End )
 
 	End
-	
+
+	#rem monkeydoc Timer suspended state.
+	#end
+		
 	Property Suspended:Bool()
 	
 		Return _suspended
@@ -56,6 +68,8 @@ Class Timer
 		_suspended=suspended
 	End
 	
+	#rem monkeydoc Cancels the timer.
+	#end
 	Method Cancel()
 	
 		_cancelled=True