Merge pull request #66 from n00b87/post_process_fx

Post process fx
This commit is contained in:
Rodney Cunningham
2025-11-26 01:08:12 -06:00
committed by GitHub
57 changed files with 6337 additions and 3527 deletions

View File

@@ -19,7 +19,7 @@
hinge&nbsp;=&nbsp;CreateHingeConstraint<b>(</b>actorA,&nbsp;frameA,&nbsp;<span class="rc_keyword">true</span><b>)</b>&nbsp;<br>
</code></p>
<p>
Note: It is recommended to use CreateSlideConstraintEx() in most cases
Note: It is recommended to use CreateHingeConstraintEx() in most cases
</p>
<br><p>Related:
<a href="createhingeconstraintex.html">CreateHingeConstraintEx</a>

View File

@@ -7,7 +7,7 @@
</head>
<body>
<p><h2>function CreateSprite( img ) </h2></p>
<p><h2>function CreateSprite( img, frame_w, frame_h ) </h2></p>
<p>
This function returns a new sprite which you can place in a variable for use in your program.
</p>

View File

@@ -9,6 +9,9 @@
<body>
<p><h2>Function GetSpriteAlpha(sprite) </h2></p>
<p>
Returns the alpha value of a sprite
</p>
<p>
</body>
</html>

View File

@@ -299,6 +299,10 @@ ul, #myUL {
<li><a href="stack_size_s.html" target="main">Stack_Size_S</a></li>
<li><a href="stack_n_exists.html" target="main">Stack_N_Exists</a></li>
<li><a href="stack_s_exists.html" target="main">Stack_S_Exists</a></li>
</ul>
</li>
@@ -569,6 +573,18 @@ ul, #myUL {
<li><a href="getspritecanvasrenderpriority.html" target="main">GetSpriteCanvasRenderPriority</a></li>
<li><a href="setposteffect.html" target="main">SetPostEffect</a></li>
<li><a href="clearposteffect.html" target="main">ClearPostEffect</a></li>
<li><a href="setposteffectproperty.html" target="main">SetPostEffectProperty</a></li>
<li><a href="getposteffectproperty.html" target="main">GetPostEffectProperty</a></li>
<li><a href="setposteffectactive.html" target="main">SetPostEffectActive</a></li>
<li><a href="posteffectisactive.html" target="main">PostEffectIsActive</a></li>
</ul>
</li>
@@ -1173,6 +1189,8 @@ ul, #myUL {
<li><a href="getmatrixscale.html" target="main">GetMatrixScale</a></li>
<li><a href="matrixexists.html" target="main">MatrixExists</a></li>
</ul>
</li>
@@ -1451,6 +1469,8 @@ ul, #myUL {
<li><a href="getspriteshapeoffset.html" target="main">GetSpriteShapeOffset</a></li>
<li><a href="getspriteworldcenter.html" target="main">GetSpriteWorldCenter</a></li>
</ul>
</li>
@@ -1691,6 +1711,16 @@ ul, #myUL {
<li><a href="flipmeshsurfaces.html" target="main">FlipMeshSurfaces</a></li>
<li><a href="setmeshbuffer.html" target="main">SetMeshBuffer</a></li>
<li><a href="getmeshbuffercount.html" target="main">GetMeshBufferCount</a></li>
<li><a href="getmeshbuffervertexcount.html" target="main">GetMeshBufferVertexCount</a></li>
<li><a href="getmeshbufferindexcount.html" target="main">GetMeshBufferIndexCount</a></li>
<li><a href="getmeshbuffer.html" target="main">GetMeshBuffer</a></li>
</ul>
</li>
@@ -1927,6 +1957,8 @@ ul, #myUL {
<li><a href="getrayhit3d.html" target="main">GetRayHit3D</a></li>
<li><a href="setactorshapeex.html" target="main">SetActorShapeEx</a></li>
</ul>
</li>
@@ -2231,6 +2263,12 @@ ul, #myUL {
<li><a href="getsceneambientcolor.html" target="main">GetSceneAmbientColor</a></li>
<li><a href="pipeline_begin.html" target="main">Pipeline_Begin</a></li>
<li><a href="pipeline_end.html" target="main">Pipeline_End</a></li>
<li><a href="pipeline_render.html" target="main">Pipeline_Render</a></li>
</ul>
</li>

View File

@@ -143,7 +143,7 @@
</p>
<ul>
<li>
Type - The type of layer selected. There are 4 types of layers: sprite, tile, canvas 2d, and canvas 3d.
Type - The type of layer selected. There are 5 types of layers: sprite, tile, isometric tile, canvas 2d, and canvas 3d.
</li>
<li>
Name - The name of the layer
@@ -161,6 +161,26 @@
<p>
</p>
</p>
<p>
<p>#5 - Sprite Layers have extra settings that can be changed.
</p>
<ul>
<li>
Sprite Grid - Grid type can be either SQUARE or ISOMETRIC and determines how sprites move and snap when snap tile movement is enabled.
</li>
<li>
Sort By - This setting will override SpriteZ values and determines the priority sprites are rendered in
</li>
<li>
Order - This determines whether the priority set by Sort By is in ascending or descending order
</li>
<li>
Shape Data - You can use this to have the editor generate the shapes when generating code or just export the shape data so you can handle collision yourself
</li>
</ul>
<p>
</p>
</p>
<p>
<br> <h2>Editor Settings</h2>
</p>
@@ -206,6 +226,9 @@
<p>
These tools are only usable when a tile layer is selected.
</p>
<p>
NOTE: There is a subset of these tools available on sprite layers. The sprite layer tools will create a sprite with the selected tiles.
</p>
<p><img src="images/nirvana_tilemap_tools.png" ></p>
<p>
<p>#1 - Tools

View File

@@ -12,10 +12,10 @@
Sets the constant value of an FX material
</p>
<p>
NOTE: Each constant can ve of type Float, Vec2, Vec3, or Vec4. The ones listed as defined are set internally by the runtime.
NOTE: Each constant can be of type Float, Vec2, Vec3, or Vec4. The ones listed as defined are set internally by the runtime.
</p>
<p>
<b>FX_MATERIAL_TYPE_NORMAL_BLEND</b> Possible Constants
<b>FX_MATERIAL_TYPE_NORMAL_BLEND</b><br> Possible Constants
</p>
<ul>
<li>
@@ -23,7 +23,7 @@
</li>
</ul>
<p>
<b>FX_MATERIAL_TYPE_REFRACTION</b> Possible Constants
<b>FX_MATERIAL_TYPE_REFRACTION</b><br> Possible Constants
</p>
<ul>
<li>
@@ -49,7 +49,7 @@
</li>
</ul>
<p>
<b>FX_MATERIAL_TYPE_REFRACTION2</b> Possible Constants
<b>FX_MATERIAL_TYPE_REFRACTION2</b><br> Possible Constants
</p>
<ul>
<li>
@@ -57,7 +57,7 @@
</li>
</ul>
<p>
<b>FX_MATERIAL_TYPE_GOOCH</b> Possible Constants
<b>FX_MATERIAL_TYPE_GOOCH</b><br> Possible Constants
</p>
<ul>
<li>
@@ -77,7 +77,7 @@
</li>
</ul>
<p>
<b>FX_MATERIAL_TYPE_PLASTIC</b> Possible Constants
<b>FX_MATERIAL_TYPE_PLASTIC</b><br> Possible Constants
</p>
<ul>
<li>
@@ -88,7 +88,7 @@
</li>
</ul>
<p>
<b>FX_MATERIAL_TYPE_TANGENT</b> Possible Constants
<b>FX_MATERIAL_TYPE_TANGENT</b><br> Possible Constants
</p>
<ul>
<li>
@@ -99,7 +99,7 @@
</li>
</ul>
<p>
<b>FX_MATERIAL_TYPE_SPEAKER</b> Possible Constants
<b>FX_MATERIAL_TYPE_SPEAKER</b><br> Possible Constants
</p>
<ul>
<li>
@@ -128,7 +128,7 @@
</li>
</ul>
<p>
<b>FX_MATERIAL_TYPE_PHONG_TEXTURE</b> Possible Constants
<b>FX_MATERIAL_TYPE_PHONG_TEXTURE</b><br> Possible Constants
</p>
<ul>
<li>
@@ -151,7 +151,7 @@
</li>
</ul>
<p>
<b>FX_MATERIAL_TYPE_STYLE</b> Possible Constants
<b>FX_MATERIAL_TYPE_STYLE</b><br> Possible Constants
</p>
<ul>
<li>
@@ -159,7 +159,7 @@
</li>
</ul>
<p>
<b>FX_MATERIAL_TYPE_STYLE2</b> Possible Constants
<b>FX_MATERIAL_TYPE_STYLE2</b><br> Possible Constants
</p>
<ul>
<li>
@@ -167,7 +167,7 @@
</li>
</ul>
<p>
<b>FX_MATERIAL_TYPE_STYLE3</b> Possible Constants
<b>FX_MATERIAL_TYPE_STYLE3</b><br> Possible Constants
</p>
<ul>
<li>
@@ -175,7 +175,7 @@
</li>
</ul>
<p>
<b>FX_MATERIAL_TYPE_STYLE4</b> Possible Constants
<b>FX_MATERIAL_TYPE_STYLE4</b><br> Possible Constants
</p>
<ul>
<li>

View File

@@ -9,6 +9,9 @@
<body>
<p><h2>Sub SetSpriteAlpha(sprite, alpha) </h2></p>
<p>
Sets the alpha value of a sprite
</p>
<p>
</body>
</html>

View File

@@ -9,6 +9,9 @@
<body>
<p><h2>Sub SetSpriteColorMod(sprite, color) </h2></p>
<p>
Sets the color modulation of a sprite.
</p>
<p>
</body>
</html>

View File

@@ -9,6 +9,9 @@
<body>
<p><h2>Function SpriteAnimationIsPlaying(sprite) </h2></p>
<p>
Returns true if there is an animation playing on the sprite
</p>
<p>
</body>
</html>

View File

@@ -9,6 +9,9 @@
<body>
<p><h2>Function SpriteExists(sprite) </h2></p>
<p>
Returns true if the sprite id is a valid sprite id
</p>
<p>
</body>
</html>

View File

@@ -11,7 +11,7 @@ SetMatrixTranslation(frameA, 0, 1, 0) 'Sets the attach point of the constraint t
hinge = CreateHingeConstraint(actorA, frameA, true)
#/code
Note: It is recommended to use CreateSlideConstraintEx() in most cases
Note: It is recommended to use CreateHingeConstraintEx() in most cases
#ref CreateHingeConstraintEx SetIdentityMatrix SetMatrixTranslation SetMatrixRotation

View File

@@ -1,4 +1,4 @@
#title GetSpriteAlpha [RCBasic Doc]
#header Function GetSpriteAlpha(sprite)
Returns the alpha value of a sprite

View File

@@ -3,17 +3,16 @@
Sets the constant value of an FX material
NOTE: Each constant can be of type Float, Vec2, Vec3, or Vec4. The ones listed as defined are set internally by the runtime.
NOTE: Each constant can ve of type Float, Vec2, Vec3, or Vec4. The ones listed as defined are set internally by the runtime.
<b>FX_MATERIAL_TYPE_NORMAL_BLEND</b>
<b>FX_MATERIAL_TYPE_NORMAL_BLEND</b><br>
Possible Constants
#list ul
#li [Float] Alpha
#/list
<b>FX_MATERIAL_TYPE_REFRACTION</b>
<b>FX_MATERIAL_TYPE_REFRACTION</b><br>
Possible Constants
#list ul
#li [Vec3] BaseColor
@@ -26,13 +25,13 @@ Possible Constants
#/list
<b>FX_MATERIAL_TYPE_REFRACTION2</b>
<b>FX_MATERIAL_TYPE_REFRACTION2</b><br>
Possible Constants
#list ul
#li NONE
#/list
<b>FX_MATERIAL_TYPE_GOOCH</b>
<b>FX_MATERIAL_TYPE_GOOCH</b><br>
Possible Constants
#list ul
#li [Vec3] SurfaceColor
@@ -42,7 +41,7 @@ Possible Constants
#li [Float] DiffuseCool
#/list
<b>FX_MATERIAL_TYPE_PLASTIC</b>
<b>FX_MATERIAL_TYPE_PLASTIC</b><br>
Possible Constants
#list ul
#li [Vec4] Color
@@ -50,7 +49,7 @@ Possible Constants
#/list
<b>FX_MATERIAL_TYPE_TANGENT</b>
<b>FX_MATERIAL_TYPE_TANGENT</b><br>
Possible Constants
#list ul
#li [Float] BViewSpace
@@ -58,7 +57,7 @@ Possible Constants
#/list
<b>FX_MATERIAL_TYPE_SPEAKER</b>
<b>FX_MATERIAL_TYPE_SPEAKER</b><br>
Possible Constants
#list ul
#li [Float] PulseSharpness
@@ -72,7 +71,7 @@ Possible Constants
#/list
<b>FX_MATERIAL_TYPE_PHONG_TEXTURE</b>
<b>FX_MATERIAL_TYPE_PHONG_TEXTURE</b><br>
Possible Constants
#list ul
#li [Vec4] fvAmbient
@@ -84,27 +83,27 @@ Possible Constants
#/list
<b>FX_MATERIAL_TYPE_STYLE</b>
<b>FX_MATERIAL_TYPE_STYLE</b><br>
Possible Constants
#list ul
#li [-Defined-] LightPos
#/list
<b>FX_MATERIAL_TYPE_STYLE2</b>
<b>FX_MATERIAL_TYPE_STYLE2</b><br>
Possible Constants
#list ul
#li [-Defined-] BaseMap
#/list
<b>FX_MATERIAL_TYPE_STYLE3</b>
<b>FX_MATERIAL_TYPE_STYLE3</b><br>
Possible Constants
#list ul
#li NONE
#/list
<b>FX_MATERIAL_TYPE_STYLE4</b>
<b>FX_MATERIAL_TYPE_STYLE4</b><br>
Possible Constants
#list ul
#li [Float] SilhouetteThreshold

View File

@@ -1,4 +1,4 @@
#title SetSpriteAlpha [RCBasic Doc]
#header Sub SetSpriteAlpha(sprite, alpha)
Sets the alpha value of a sprite

View File

@@ -1,4 +1,5 @@
#title SetSpriteColorMod [RCBasic Doc]
#header Sub SetSpriteColorMod(sprite, color)
Sets the color modulation of a sprite.

View File

@@ -1,4 +1,4 @@
#title SpriteAnimationIsPlaying [RCBasic Doc]
#header Function SpriteAnimationIsPlaying(sprite)
Returns true if there is an animation playing on the sprite

View File

@@ -1,4 +1,4 @@
#title SpriteExists [RCBasic Doc]
#header Function SpriteExists(sprite)
Returns true if the sprite id is a valid sprite id

View File

@@ -143,7 +143,7 @@
</p>
<ul>
<li>
Type - The type of layer selected. There are 4 types of layers: sprite, tile, canvas 2d, and canvas 3d.
Type - The type of layer selected. There are 5 types of layers: sprite, tile, isometric tile, canvas 2d, and canvas 3d.
</li>
<li>
Name - The name of the layer
@@ -161,6 +161,26 @@
<p>
</p>
</p>
<p>
<p>#5 - Sprite Layers have extra settings that can be changed.
</p>
<ul>
<li>
Sprite Grid - Grid type can be either SQUARE or ISOMETRIC and determines how sprites move and snap when snap tile movement is enabled.
</li>
<li>
Sort By - This setting will override SpriteZ values and determines the priority sprites are rendered in
</li>
<li>
Order - This determines whether the priority set by Sort By is in ascending or descending order
</li>
<li>
Shape Data - You can use this to have the editor generate the shapes when generating code or just export the shape data so you can handle collision yourself
</li>
</ul>
<p>
</p>
</p>
<p>
<br> <h2>Editor Settings</h2>
</p>
@@ -206,6 +226,9 @@
<p>
These tools are only usable when a tile layer is selected.
</p>
<p>
NOTE: There is a subset of these tools available on sprite layers. The sprite layer tools will create a sprite with the selected tiles.
</p>
<p><img src="images/nirvana_tilemap_tools.png" ></p>
<p>
<p>#1 - Tools

View File

@@ -80,7 +80,7 @@ This is where you create layers and edit layer settings
<p>#4 - Layer Settings
#list ul
#li Type - The type of layer selected. There are 4 types of layers: sprite, tile, canvas 2d, and canvas 3d.
#li Type - The type of layer selected. There are 5 types of layers: sprite, tile, isometric tile, canvas 2d, and canvas 3d.
#li Name - The name of the layer
#li HScroll - The speed the layer scrolls horizontally
#li VScrol - The speed the layer scrolls vertically
@@ -88,6 +88,14 @@ This is where you create layers and edit layer settings
#/list
</p>
<p>#5 - Sprite Layers have extra settings that can be changed.
#list ul
#li Sprite Grid - Grid type can be either SQUARE or ISOMETRIC and determines how sprites move and snap when snap tile movement is enabled.
#li Sort By - This setting will override SpriteZ values and determines the priority sprites are rendered in
#li Order - This determines whether the priority set by Sort By is in ascending or descending order
#li Shape Data - You can use this to have the editor generate the shapes when generating code or just export the shape data so you can handle collision yourself
#/list
</p>
<br>
<h2>Editor Settings</h2>
@@ -116,6 +124,9 @@ This is where you can change editor settings
<h2>Tile Map Tools</h2>
These tools are only usable when a tile layer is selected.
NOTE: There is a subset of these tools available on sprite layers. The sprite layer tools will create a sprite with the selected tiles.
#image "images/nirvana_tilemap_tools.png"
<p>#1 - Tools

View File

@@ -1,673 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title>Nirvana2D [RCBasic Doc] </title>
</head>
<body>
<p><h2>Nirvana2D API </h2></p>
<p>
This API is what allows developers to access objects created in the Nirvana2D editor inside RCBasic.
</p>
<p>
<h3><u>Nirvana Types</u></h3>
</p>
<p>
<b>Type Nirvana_Vector2D</b>
</p>
<ul>
<li>
Dim X
</li>
<li>
Dim Y
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Type Nirvana_Size2D</b>
</p>
<ul>
<li>
Dim Width
</li>
<li>
Dim Height
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Type Nirvana_Sprite</b>
</p>
<ul>
<li>
Dim Name$
</li>
<li>
Dim BaseName$
</li>
<li>
Dim Sprite_ID
</li>
<li>
Dim Animation_Name_Index
</li>
<li>
Dim Animation_Count
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Type Nirvana_TileMap</b>
</p>
<ul>
<li>
Dim TilesetName$
</li>
<li>
Dim Tileset_ID
</li>
<li>
Dim TileMap_ID
</li>
<li>
Dim Mask_Index
</li>
<li>
Dim Mask_Count
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Type Nirvana_Background</b>
</p>
<ul>
<li>
Dim Image_ID
</li>
<li>
Dim RenderSetting
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Type Nirvana_Shape</b>
</p>
<ul>
<li>
Dim Sprite_ID
</li>
<li>
Dim ShapeType
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Type Nirvana_Layer</b>
</p>
<ul>
<li>
Dim Name$
</li>
<li>
Dim LayerType
</li>
<li>
Dim Visible
</li>
<li>
Dim Alpha
</li>
<li>
Dim Scroll_Speed As Nirvana_Vector2D
</li>
<li>
Dim Ref_Canvas
</li>
<li>
Dim Layer_TileMap As Nirvana_TileMap
</li>
<li>
Dim Layer_Sprite_Count
</li>
<li>
Dim Layer_Shape_Count
</li>
<li>
Dim Bkg As Nirvana_Background
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Type Nirvana_Stage</b>
</p>
<ul>
<li>
Dim Active
</li>
<li>
Dim Name$
</li>
<li>
Dim Tile_Size As Nirvana_Size2D
</li>
<li>
Dim Stage_Size As Nirvana_Size2D
</li>
<li>
Dim Layer_Count
</li>
<li>
Dim Viewport_Size As Nirvana_Size2D
</li>
<li>
Dim Stage_Offset As Nirvana_Vector2D
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Function Nirvana_CreateVector2D(x, y) As Nirvana_Vector2D</b>
</p>
<ul>
<li>
Create a 2D Vector
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Function Nirvana_CreateSize2D(w, h) As Nirvana_Size2D</b>
</p>
<ul>
<li>
Create a 2D Size
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Function Nirvana_CreateSprite(spriteDefinition_name$, sprite_name$) As Nirvana_Sprite</b>
</p>
<ul>
<li>
Create a Nirvana Sprite
<ul>
<li>
NOTE: spriteDefinition_name$ is the name of the base sprite created in the Sprite Editor
</li>
</ul>
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Function Nirvana_CreateTileMap(tset_name$, tmap_width, tmap_height) As Nirvana_TileMap</b>
</p>
<ul>
<li>
Create a Nirvana TileMap
</li>
</ul>
<p>
<br>
</p>
<p>
<br> <h3><u>Nirvana Stages</u></h3>
</p>
<p>
<b>Function Nirvana_LoadStage(stage_name$, viewport_x, viewport_y, viewport_w, viewport_h)</b>
</p>
<ul>
<li>
Loads a stage and sets the part of the window to render it to
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Sub Nirvana_Update()</b>
</p>
<ul>
<li>
This update function must be used in place of Update() when using Nirvana2D
</li>
</ul>
<p>
<br>
</p>
<p>
<br> <h3><u>Nirvana Layers</u></h3>
</p>
<p>
<b>Function Nirvana_GetLayerIndex(layer_name$)</b>
</p>
<ul>
<li>
Returns the internal nirvana index associated with the given layer name or -1 if layer name is not an existing layer
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Function Nirvana_GetLayerCanvasID(layer_index)</b>
</p>
<ul>
<li>
Returns the RCBasic canvas of the given nirvana layer index or -1 if layer_index is not a valid layer
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Function Nirvana_GetLayerType(layer_index)</b>
</p>
<ul>
<li>
Returns the layer type or -1 if layer_index is not a valid layer
</li>
<li>
Possible Layer Types
<ul>
<li>
NIRVANA_LAYER_TYPE_TILEMAP
</li>
<li>
NIRVANA_LAYER_TYPE_SPRITE
</li>
<li>
NIRVANA_LAYER_TYPE_CANVAS_2D
</li>
<li>
NIRVANA_LAYER_TYPE_CANVAS_3D
</li>
</ul>
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Function Nirvana_GetLayerName$(layer_index)</b>
</p>
<ul>
<li>
Returns the name of the given layer or an empty string if layer is not valid
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Function Nirvana_GetLayerAlpha(layer_index)</b>
</p>
<ul>
<li>
Returns the layer alpha value set in the layer settings in Nirvana
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Function Nirvana_GetLayerScrollSpeed(layer_index) As Nirvana_Vector2D</b>
</p>
<ul>
<li>
Returns the HScroll and VScroll speed as a vector
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Function Nirvana_GetLayerTileSetName$(layer_index)</b>
</p>
<ul>
<li>
Returns the name of tileset associated with the given layer or empty string if layer is not valid
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Function Nirvana_GetLayerTileSetID(layer_index)</b>
</p>
<ul>
<li>
Returns the RCBasic tileset associated with the given Nirvana layer or -1 if layer is not valid
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Function Nirvana_GetLayerTileMapID(layer_index)</b>
</p>
<ul>
<li>
Returns the RCBasic tile map associated with the given layer or -1 if layer is not valid
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Function Nirvana_GetLayerTileMaskCount(layer_index)</b>
</p>
<ul>
<li>
Returns the number of tile mask on a layers tileset
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Function Nirvana_GetLayerTileMaskIndex(layer_index, mask_num)</b>
</p>
<ul>
<li>
Returns the Nirvana tile mask index for the given mask number in a layer or -1 if not a valid layer or mask number
<ul>
<li>
mask_num should be a number from 0 to Nirvana_GetLayerTileMaskCount(layer_index)-1
</li>
</ul>
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Function Nirvana_GetLayerSpriteCount(layer_index)</b>
</p>
<ul>
<li>
Returns the number of sprites in a layer
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Function Nirvana_GetLayerSpriteIndex(layer_index, sprite_name$)</b>
</p>
<ul>
<li>
Returns the Nirvana sprite index of the given sprite name in the given layer or -1 if sprite is not found
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Function Nirvana_GetLayerShapeCount(layer_index)</b>
</p>
<ul>
<li>
Returns the number of stage collision shapes in the given layer
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Function Nirvana_GetLayerBackgroundImageID(layer_index)</b>
</p>
<ul>
<li>
Returns the RCBasic image id of the image set on the given layer or -1 if no image is set
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Function Nirvana_SetLayerBackgroundImage(layer_index, image_id)</b>
</p>
<ul>
<li>
Sets a new image on the given layer (NOTE: Layer must be a Canvas2D layer)
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Function Nirvana_GetLayerBackgroundRenderType(layer_index)</b>
</p>
<ul>
<li>
Returns the render type of the layer image set in Nirvana2D
</li>
<li>
Possible Render Types
<ul>
<li>
NIRVANA_IMG_RENDER_SETTING_NORMAL
</li>
<li>
NIRVANA_IMG_RENDER_SETTING_STRETCHED
</li>
<li>
NIRVANA_IMG_RENDER_SETTING_TILED
</li>
</ul>
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Function Nirvana_SetLayerBackgroundRenderType(layer_index, render_type)</b>
</p>
<ul>
<li>
Sets the render type of the layer image (NOTE: Layer must be a Canvas2D layer)
</li>
<li>
Possible Render Types
<ul>
<li>
NIRVANA_IMG_RENDER_SETTING_NORMAL
</li>
<li>
NIRVANA_IMG_RENDER_SETTING_STRETCHED
</li>
<li>
NIRVANA_IMG_RENDER_SETTING_TILED
</li>
</ul>
</li>
</ul>
<p>
<br>
</p>
<p>
<br> <h3><u>TILE MASK</u></h3>
</p>
<p>
<b>Function Nirvana_GetTileMaskName$(mask_index)</b>
</p>
<ul>
<li>
Returns the name of the given tile mask or an empty string if the mask index is not valid
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Function Nirvana_GetTileMaskMatrix(mask_index)</b>
</p>
<ul>
<li>
Returns the RCBasic matrix id of the given mask or -1 if the mask is not valid
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Function Nirvana_GetLayerMaskHit(layer_index, mask_index, x, y)</b>
</p>
<ul>
<li>
Returns TRUE if the tile at the given position is flagged in the given mask
<ul>
<li>
NOTE: (x, y) is a world position and not a row and column position in the tile map
</li>
</ul>
</li>
</ul>
<p>
<br>
</p>
<p>
<br> <h3><u>SPRITES</u></h3>
</p>
<p>
<b>Function Nirvana_GetSpriteID(sprite_index)</b>
</p>
<ul>
<li>
Returns the RCBasic sprite id of the given Nirvana sprite index or -1 if the sprite index is not valid
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Function Nirvana_GetSpriteName$(sprite_index)</b>
</p>
<ul>
<li>
Returns the sprite name of the given Nirvana sprite index or an empty string if sprite index is not valid
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Function Nirvana_GetSpriteDefinitionName$(sprite_index)</b>
</p>
<ul>
<li>
Returns the sprite definition name of the given sprite index
<ul>
<li>
NOTE: Sprite Definition name is the name of the base sprite created in the Sprite Editor and not the name of the sprite in the stage
</li>
<li>
NOTE: There is almost no reason to get this definition name unless you wanted to look up sprites in the stage by the base sprite
</li>
</ul>
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Function Nirvana_GetSpriteAnimationCount(sprite_index)</b>
</p>
<ul>
<li>
Returns the number of animations for the given Nirvana sprite index
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Function Nirvana_GetSpriteAnimationName$(sprite_index, animation_num)</b>
</p>
<ul>
<li>
Returns the name of the given Nirvana Sprite Index animation number
</li>
</ul>
<p>
<br>
</p>
<p>
<br> <h3><u>CAMERA</u></h3> <b>Sub Nirvana_SetStageOffset(offset As Nirvana_Vector2D)</b>
</p>
<ul>
<li>
Sets the camera position
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Function Nirvana_GetStageOffset() As Nirvana_Vector2D</b>
</p>
<ul>
<li>
Returns the camera position
</li>
</ul>
<p>
<br>
</p>
<p>
<br> <h3><u>VIEWPORT</u></h3> <b>Sub Nirvana_SetStageViewport(v_position As Nirvana_Vector2D, v_size As Nirvana_Size2D)</b>
</p>
<ul>
<li>
Returns the current viewport position and size
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Function Nirvana_GetViewportPosition() As Nirvana_Vector2D</b>
</p>
<ul>
<li>
Returns the current viewport position
</li>
</ul>
<p>
<br>
</p>
<p>
<b>Function Nirvana_GetViewportSize() As Nirvana_Size2D</b>
</p>
<ul>
<li>
Returns the current viewport size
</li>
</ul>
<p>
</body>
</html>

View File

@@ -91,6 +91,8 @@ rc_intern_push_s( PUSH_S_STR_STACK, PUSH_S_S$ )
rc_intern_pop_s( POP_S$_STR_STACK )
rc_intern_n_stack_size( STACK_SIZE_N_NUM_STACK )
rc_intern_s_stack_size( STACK_SIZE_S_STR_STACK )
rc_intern_n_stack_exists( STACK_N_EXISTS_NUM_STACK )
rc_intern_s_stack_exists( STACK_S_EXISTS_STR_STACK )
rc_intern_fileOpen( OPENFILE_FILENAME$, OPENFILE_MODE )
rc_intern_fileClose( CLOSEFILE_STREAM )
rc_intern_fileReadByte( READBYTE_STREAM )
@@ -206,6 +208,12 @@ rc_getSpriteCanvasBilinearFilter( GETSPRITECANVASBILINEARFILTER_C_NUM )
rc_getSpriteCanvasPhysics( GETSPRITECANVASPHYSICS_C_NUM )
rc_setSpriteCanvasRenderPriority( SETSPRITECANVASRENDERPRIORITY_C_NUM, SETSPRITECANVASRENDERPRIORITY_PRIORITY, SETSPRITECANVASRENDERPRIORITY_ORDER )
rc_getSpriteCanvasRenderPriority( GETSPRITECANVASRENDERPRIORITY_C_NUM, &GETSPRITECANVASRENDERPRIORITY_PRIORITY, &GETSPRITECANVASRENDERPRIORITY_ORDER )
rc_setPostEffect( SETPOSTEFFECT_C_NUM, SETPOSTEFFECT_EFFECT_TYPE )
rc_clearPostEffect( CLEARPOSTEFFECT_C_NUM )
rc_setPostEffectProperty( SETPOSTEFFECTPROPERTY_C_NUM, SETPOSTEFFECTPROPERTY_PROPERTY, SETPOSTEFFECTPROPERTY_PROPERTY_VALUE )
rc_getPostEffectProperty( GETPOSTEFFECTPROPERTY_C_NUM, GETPOSTEFFECTPROPERTY_PROPERTY )
rc_setPostEffectActive( SETPOSTEFFECTACTIVE_C_NUM, SETPOSTEFFECTACTIVE_FLAG )
rc_postEffectIsActive( POSTEFFECTISACTIVE_C_NUM )
rc_drawCircle( CIRCLE_X, CIRCLE_Y, CIRCLE_RADIUS )
rc_drawCircleFill( CIRCLEFILL_X, CIRCLEFILL_Y, CIRCLEFILL_RADIUS )
rc_drawEllipse( ELLIPSE_X, ELLIPSE_Y, ELLIPSE_RX, ELLIPSE_RY )
@@ -464,6 +472,7 @@ rc_setMatrixScale( SETMATRIXSCALE_MA, SETMATRIXSCALE_X, SETMATRIXSCALE_Y, SET
rc_getMatrixTranslation( GETMATRIXTRANSLATION_MA, &GETMATRIXTRANSLATION_X, &GETMATRIXTRANSLATION_Y, &GETMATRIXTRANSLATION_Z )
rc_getMatrixRotation( GETMATRIXROTATION_MA, &GETMATRIXROTATION_X, &GETMATRIXROTATION_Y, &GETMATRIXROTATION_Z )
rc_getMatrixScale( GETMATRIXSCALE_MA, &GETMATRIXSCALE_X, &GETMATRIXSCALE_Y, &GETMATRIXSCALE_Z )
rc_matrixExists( MATRIXEXISTS_MA )
rc_getClipboardText( )
rc_setClipboardText( SETCLIPBOARDTEXT_TXT$ )
rc_hasClipboardText( )
@@ -583,6 +592,7 @@ rc_setSpriteChainLoop( SETSPRITECHAINLOOP_SPR_ID, &SETSPRITECHAINLOOP_VX, &SET
rc_setSpritePolygon( SETSPRITEPOLYGON_SPR_ID, &SETSPRITEPOLYGON_VX, &SETSPRITEPOLYGON_VY, SETSPRITEPOLYGON_V_COUNT )
rc_setSpriteShapeOffset( SETSPRITESHAPEOFFSET_SPR_ID, SETSPRITESHAPEOFFSET_X, SETSPRITESHAPEOFFSET_Y )
rc_getSpriteShapeOffset( GETSPRITESHAPEOFFSET_SPR_ID, &GETSPRITESHAPEOFFSET_X, &GETSPRITESHAPEOFFSET_Y )
rc_getSpriteWorldCenter( GETSPRITEWORLDCENTER_SPR_ID, &GETSPRITEWORLDCENTER_X, &GETSPRITEWORLDCENTER_Y )
rc_createDistanceJoint( CREATEDISTANCEJOINT_SPRITEA, CREATEDISTANCEJOINT_SPRITEB, CREATEDISTANCEJOINT_AX, CREATEDISTANCEJOINT_AY, CREATEDISTANCEJOINT_BX, CREATEDISTANCEJOINT_BY, CREATEDISTANCEJOINT_COLLIDE_CONNECT )
rc_createFrictionJoint( CREATEFRICTIONJOINT_SPRITEA, CREATEFRICTIONJOINT_SPRITEB, CREATEFRICTIONJOINT_X, CREATEFRICTIONJOINT_Y, CREATEFRICTIONJOINT_COLLIDE_CONNECT )
rc_createGearJoint( CREATEGEARJOINT_JOINTA, CREATEGEARJOINT_JOINTB, CREATEGEARJOINT_G_RATIO, CREATEGEARJOINT_COLLIDE_CONNECT )
@@ -691,6 +701,11 @@ rc_makePlanarTextureMap( MAKEPLANARTEXTUREMAP_MESH, MAKEPLANARTEXTUREMAP_RESOLU
rc_reCalculateMeshNormals( RECALCULATEMESHNORMALS_MESH )
rc_getMeshPolygonCount( GETMESHPOLYGONCOUNT_MESH )
rc_flipMeshSurfaces( FLIPMESHSURFACES_MESH )
rc_setMeshBuffer( SETMESHBUFFER_MESH_ID, SETMESHBUFFER_BUFFER_NUM, SETMESHBUFFER_VERTEX_COUNT, &SETMESHBUFFER_VERTEX_DATA, &SETMESHBUFFER_NORMAL_DATA, &SETMESHBUFFER_UV_DATA, SETMESHBUFFER_INDEX_COUNT, &SETMESHBUFFER_INDEX_DATA )
rc_getMeshBufferCount( GETMESHBUFFERCOUNT_MESH_ID )
rc_getMeshBufferVertexCount( GETMESHBUFFERVERTEXCOUNT_MESH_ID, GETMESHBUFFERVERTEXCOUNT_BUFFER_INDEX )
rc_getMeshBufferIndexCount( GETMESHBUFFERINDEXCOUNT_MESH_ID, GETMESHBUFFERINDEXCOUNT_BUFFER_INDEX )
rc_getMeshBuffer( GETMESHBUFFER_MESH_ID, GETMESHBUFFER_BUFFER_INDEX, &GETMESHBUFFER_VERTEX_DATA, &GETMESHBUFFER_NORMAL_DATA, &GETMESHBUFFER_UV_DATA, &GETMESHBUFFER_INDEX_DATA )
rc_createAnimatedActor( CREATEANIMATEDACTOR_MESH )
rc_createOctreeActor( CREATEOCTREEACTOR_MESH )
rc_createCubeActor( CREATECUBEACTOR_CUBE_SIZE )
@@ -938,6 +953,9 @@ rc_setSceneShadowColor( SETSCENESHADOWCOLOR_COLOR )
rc_getSceneShadowColor( )
rc_setSceneAmbientColor( SETSCENEAMBIENTCOLOR_COLOR )
rc_getSceneAmbientColor( )
rc_pipeline_Begin( )
rc_pipeline_End( )
rc_pipeline_Render( )
rc_startParticleEmitter( STARTPARTICLEEMITTER_ACTOR )
rc_stopParticleEmitter( STOPPARTICLEEMITTER_ACTOR )
rc_setParticleDirection( SETPARTICLEDIRECTION_ACTOR, SETPARTICLEDIRECTION_X, SETPARTICLEDIRECTION_Y, SETPARTICLEDIRECTION_Z )

View File

@@ -30,3 +30,9 @@ function GetSpriteCanvasBilinearFilter( c_num )
function GetSpriteCanvasPhysics( c_num )
function SetSpriteCanvasRenderPriority( c_num, priority, order )
sub GetSpriteCanvasRenderPriority( c_num, ByRef priority, ByRef order )
function SetPostEffect( c_num, effect_type )
sub ClearPostEffect( c_num )
sub SetPostEffectProperty( c_num, property, property_value )
function GetPostEffectProperty( c_num, property)
sub SetPostEffectActive( c_num, flag )
function PostEffectIsActive( c_num )

View File

@@ -52,3 +52,4 @@ sub SetMatrixScale( mA, x, y, z )
sub GetMatrixTranslation( mA, ByRef x, ByRef y, ByRef z)
sub GetMatrixRotation( mA, ByRef x, ByRef y, ByRef z)
sub GetMatrixScale( mA, ByRef x, ByRef y, ByRef z)
Function MatrixExists( mA )

View File

@@ -19,3 +19,8 @@ Sub MakePlanarTextureMap( mesh, resolution )
Sub ReCalculateMeshNormals( mesh )
Function GetMeshPolygonCount( mesh )
Sub FlipMeshSurfaces( mesh )
Function SetMeshBuffer( mesh_id, buffer_num, vertex_count, ByRef vertex_data, ByRef normal_data, ByRef uv_data, index_count, ByRef index_data )
Function GetMeshBufferCount( mesh_id )
Function GetMeshBufferVertexCount( mesh_id, buffer_index )
Function GetMeshBufferIndexCount( mesh_id, buffer_index )
Function GetMeshBuffer( mesh_id, buffer_index, ByRef vertex_data, ByRef normal_data, ByRef uv_data, ByRef index_data )

View File

@@ -13,3 +13,6 @@ Sub SetSceneShadowColor(color)
Function GetSceneShadowColor()
Sub SetSceneAmbientColor(color)
Function GetSceneAmbientColor()
Sub Pipeline_Begin()
Sub Pipeline_End()
Sub Pipeline_Render()

View File

@@ -63,3 +63,4 @@ Sub SetSpriteChainLoop(spr_id, ByRef vx, ByRef vy, v_count)
Sub SetSpritePolygon(spr_id, ByRef vx, ByRef vy, v_count)
Sub SetSpriteShapeOffset( spr_id, x, y )
Sub GetSpriteShapeOffset( spr_id, ByRef x, ByRef y )
Sub GetSpriteWorldCenter( spr_id, ByRef x, ByRef y )

View File

@@ -10,3 +10,5 @@ sub Push_S( str_stack, s$ )
function Pop_S$( str_stack )
function Stack_Size_N( num_stack )
function Stack_Size_S( str_stack )
Function Stack_N_Exists( num_stack )
Function Stack_S_Exists( str_stack )

View File

@@ -926,7 +926,7 @@ int main(int argc, char * argv[])
bool clean_after_build = true;
//DEBUG START
//chdir("/home/n00b/GameDev/Ambient/Ambient_Project");
//chdir("/home/n00b/Music/v47/RCBasic_Package/examples/Serenity_Demo2");
//rc_filename = "main.bas";
//rc_filename = "/home/n00b/test/SpriteShapeTest/main.bas";
//rc_filename = "/home/n00b/Programs/RCBasic_v400_Linux64/examples/Constraint/main.bas";
@@ -966,7 +966,7 @@ int main(int argc, char * argv[])
if(rc_filename.compare("--version")==0)
{
cout << "RCBASIC Compiler v4.6" << endl;
cout << "RCBASIC Compiler v4.7" << endl;
return 0;
}

View File

@@ -275,6 +275,10 @@ void init_embedded_functions()
add_embedded_arg("num_stack", ID_TYPE_NUM);
embed_function("Stack_Size_S", ID_TYPE_FN_NUM);
add_embedded_arg("str_stack", ID_TYPE_NUM);
embed_function("Stack_N_Exists", ID_TYPE_FN_NUM);
add_embedded_arg("num_stack", ID_TYPE_NUM);
embed_function("Stack_S_Exists", ID_TYPE_FN_NUM);
add_embedded_arg("str_stack", ID_TYPE_NUM);
embed_function("OpenFile", ID_TYPE_FN_NUM);
add_embedded_arg("fileName$", ID_TYPE_STR);
add_embedded_arg("mode", ID_TYPE_NUM);
@@ -551,6 +555,23 @@ void init_embedded_functions()
add_embedded_arg("c_num", ID_TYPE_NUM);
add_embedded_arg("priority", ID_TYPE_BYREF_NUM);
add_embedded_arg("order", ID_TYPE_BYREF_NUM);
embed_function("SetPostEffect", ID_TYPE_FN_NUM);
add_embedded_arg("c_num", ID_TYPE_NUM);
add_embedded_arg("effect_type", ID_TYPE_NUM);
embed_function("ClearPostEffect", ID_TYPE_SUB);
add_embedded_arg("c_num", ID_TYPE_NUM);
embed_function("SetPostEffectProperty", ID_TYPE_SUB);
add_embedded_arg("c_num", ID_TYPE_NUM);
add_embedded_arg("property", ID_TYPE_NUM);
add_embedded_arg("property_value", ID_TYPE_NUM);
embed_function("GetPostEffectProperty", ID_TYPE_FN_NUM);
add_embedded_arg("c_num", ID_TYPE_NUM);
add_embedded_arg("property", ID_TYPE_NUM);
embed_function("SetPostEffectActive", ID_TYPE_SUB);
add_embedded_arg("c_num", ID_TYPE_NUM);
add_embedded_arg("flag", ID_TYPE_NUM);
embed_function("PostEffectIsActive", ID_TYPE_FN_NUM);
add_embedded_arg("c_num", ID_TYPE_NUM);
embed_function("Circle", ID_TYPE_SUB);
add_embedded_arg("x", ID_TYPE_NUM);
add_embedded_arg("y", ID_TYPE_NUM);
@@ -1344,6 +1365,8 @@ void init_embedded_functions()
add_embedded_arg("x", ID_TYPE_BYREF_NUM);
add_embedded_arg("y", ID_TYPE_BYREF_NUM);
add_embedded_arg("z", ID_TYPE_BYREF_NUM);
embed_function("MatrixExists", ID_TYPE_FN_NUM);
add_embedded_arg("mA", ID_TYPE_NUM);
embed_function("GetClipboardText$", ID_TYPE_FN_STR);
embed_function("SetClipboardText", ID_TYPE_SUB);
add_embedded_arg("txt$", ID_TYPE_STR);
@@ -1709,6 +1732,10 @@ void init_embedded_functions()
add_embedded_arg("spr_id", ID_TYPE_NUM);
add_embedded_arg("x", ID_TYPE_BYREF_NUM);
add_embedded_arg("y", ID_TYPE_BYREF_NUM);
embed_function("GetSpriteWorldCenter", ID_TYPE_SUB);
add_embedded_arg("spr_id", ID_TYPE_NUM);
add_embedded_arg("x", ID_TYPE_BYREF_NUM);
add_embedded_arg("y", ID_TYPE_BYREF_NUM);
embed_function("createDistanceJoint", ID_TYPE_FN_NUM);
add_embedded_arg("spriteA", ID_TYPE_NUM);
add_embedded_arg("spriteB", ID_TYPE_NUM);
@@ -2090,6 +2117,30 @@ void init_embedded_functions()
add_embedded_arg("mesh", ID_TYPE_NUM);
embed_function("FlipMeshSurfaces", ID_TYPE_SUB);
add_embedded_arg("mesh", ID_TYPE_NUM);
embed_function("SetMeshBuffer", ID_TYPE_FN_NUM);
add_embedded_arg("mesh_id", ID_TYPE_NUM);
add_embedded_arg("buffer_num", ID_TYPE_NUM);
add_embedded_arg("vertex_count", ID_TYPE_NUM);
add_embedded_arg("vertex_data", ID_TYPE_BYREF_NUM);
add_embedded_arg("normal_data", ID_TYPE_BYREF_NUM);
add_embedded_arg("uv_data", ID_TYPE_BYREF_NUM);
add_embedded_arg("index_count", ID_TYPE_NUM);
add_embedded_arg("index_data", ID_TYPE_BYREF_NUM);
embed_function("GetMeshBufferCount", ID_TYPE_FN_NUM);
add_embedded_arg("mesh_id", ID_TYPE_NUM);
embed_function("GetMeshBufferVertexCount", ID_TYPE_FN_NUM);
add_embedded_arg("mesh_id", ID_TYPE_NUM);
add_embedded_arg("buffer_index", ID_TYPE_NUM);
embed_function("GetMeshBufferIndexCount", ID_TYPE_FN_NUM);
add_embedded_arg("mesh_id", ID_TYPE_NUM);
add_embedded_arg("buffer_index", ID_TYPE_NUM);
embed_function("GetMeshBuffer", ID_TYPE_FN_NUM);
add_embedded_arg("mesh_id", ID_TYPE_NUM);
add_embedded_arg("buffer_index", ID_TYPE_NUM);
add_embedded_arg("vertex_data", ID_TYPE_BYREF_NUM);
add_embedded_arg("normal_data", ID_TYPE_BYREF_NUM);
add_embedded_arg("uv_data", ID_TYPE_BYREF_NUM);
add_embedded_arg("index_data", ID_TYPE_BYREF_NUM);
embed_function("CreateAnimatedActor", ID_TYPE_FN_NUM);
add_embedded_arg("mesh", ID_TYPE_NUM);
embed_function("CreateOctreeActor", ID_TYPE_FN_NUM);
@@ -2956,6 +3007,9 @@ void init_embedded_functions()
embed_function("SetSceneAmbientColor", ID_TYPE_SUB);
add_embedded_arg("color", ID_TYPE_NUM);
embed_function("GetSceneAmbientColor", ID_TYPE_FN_NUM);
embed_function("Pipeline_Begin", ID_TYPE_SUB);
embed_function("Pipeline_End", ID_TYPE_SUB);
embed_function("Pipeline_Render", ID_TYPE_SUB);
embed_function("startParticleEmitter", ID_TYPE_SUB);
add_embedded_arg("actor", ID_TYPE_NUM);
embed_function("stopParticleEmitter", ID_TYPE_SUB);

Binary file not shown.

View File

@@ -1,5 +1,5 @@
# depslib dependency file v1.0
1756692651 source:/home/n00b/Projects/RCBASIC4/rcbasic_build/main.cpp
1763889330 source:/home/n00b/Projects/RCBASIC4/rcbasic_build/main.cpp
<iostream>
<stack>
<vector>
@@ -14,7 +14,7 @@
"env_resolve.h"
"identifier.h"
1752004854 /home/n00b/Projects/RCBASIC4/rcbasic_build/tokenizer.h
1763959497 /home/n00b/Projects/RCBASIC4/rcbasic_build/tokenizer.h
<iostream>
<string>
<cctype>
@@ -37,14 +37,14 @@
1752004854 /home/n00b/Projects/RCBASIC4/rcbasic_build/constants.h
<vector>
1752004854 /home/n00b/Projects/RCBASIC4/rcbasic_build/parser.h
1758412944 /home/n00b/Projects/RCBASIC4/rcbasic_build/parser.h
"tokenizer.h"
"identifier.h"
"rc_global.h"
"constants.h"
<inttypes.h>
1752004854 /home/n00b/Projects/RCBASIC4/rcbasic_build/identifier.h
1758412944 /home/n00b/Projects/RCBASIC4/rcbasic_build/identifier.h
<inttypes.h>
<stack>
"rc_global.h"
@@ -54,7 +54,7 @@
1752004854 /home/n00b/Projects/RCBASIC4/rcbasic_build/rc_global.h
<inttypes.h>
1756692659 /home/n00b/Projects/RCBASIC4/rcbasic_build/rc_builtin.h
1763875558 /home/n00b/Projects/RCBASIC4/rcbasic_build/rc_builtin.h
"identifier.h"
1752004854 /home/n00b/Projects/RCBASIC4/rcbasic_build/rc_vm_asm.h
@@ -77,7 +77,7 @@
<windows.h>
<winbase.h>
1752004854 /home/n00b/Projects/RCBASIC4/rcbasic_build/env_resolve.h
1759207960 /home/n00b/Projects/RCBASIC4/rcbasic_build/env_resolve.h
<winbase.h>
<cstdlib>

View File

@@ -2,29 +2,14 @@
<CodeBlocks_layout_file>
<FileVersion major="1" minor="0" />
<ActiveTarget name="Debug" />
<File name="identifier.h" open="0" top="0" tabpos="26" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="tokenizer.h" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="9544" topLine="341" />
<Cursor1 position="53563" topLine="1298" />
</Cursor>
</File>
<File name="keywords.h" open="0" top="0" tabpos="25" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="env_resolve.h" open="0" top="0" tabpos="29" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="105" topLine="17" />
</Cursor>
</File>
<File name="tokenizer.h" open="1" top="0" tabpos="17" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="52116" topLine="1283" />
</Cursor>
</File>
<File name="rc_utility.h" open="0" top="0" tabpos="27" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1747" topLine="35" />
</Cursor>
</File>
<File name="env_resolve.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="615" topLine="32" />
<Cursor1 position="1114" topLine="29" />
</Cursor>
</File>
<File name="constants.h" open="0" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
@@ -32,32 +17,47 @@
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="rc_builtin.h" open="0" top="0" tabpos="28" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="112317" topLine="2521" />
</Cursor>
</File>
<File name="rc_vm_asm.h" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="41761" topLine="1347" />
</Cursor>
</File>
<File name="parser.h" open="1" top="0" tabpos="16" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="192713" topLine="4632" />
</Cursor>
<Folding>
<Collapse line="6341" />
</Folding>
</File>
<File name="main.cpp" open="1" top="1" tabpos="18" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="28436" topLine="905" />
</Cursor>
</File>
<File name="rc_builtin.h" open="1" top="0" tabpos="19" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="112317" topLine="2532" />
</Cursor>
</File>
<File name="rc_global.h" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="13014" topLine="163" />
</Cursor>
</File>
<File name="keywords.h" open="0" top="0" tabpos="25" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="105" topLine="17" />
</Cursor>
</File>
<File name="parser.h" open="0" top="0" tabpos="25" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="192713" topLine="4659" />
</Cursor>
<Folding>
<Collapse line="6341" />
</Folding>
</File>
<File name="main.cpp" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="28876" topLine="908" />
</Cursor>
</File>
<File name="rc_utility.h" open="0" top="0" tabpos="27" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1747" topLine="35" />
</Cursor>
</File>
<File name="identifier.h" open="0" top="0" tabpos="26" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="9544" topLine="341" />
</Cursor>
</File>
</CodeBlocks_layout_file>

View File

@@ -269,6 +269,10 @@ embed_function("Stack_Size_N", ID_TYPE_FN_NUM);
add_embedded_arg("num_stack", ID_TYPE_NUM);
embed_function("Stack_Size_S", ID_TYPE_FN_NUM);
add_embedded_arg("str_stack", ID_TYPE_NUM);
embed_function("Stack_N_Exists", ID_TYPE_FN_NUM);
add_embedded_arg("num_stack", ID_TYPE_NUM);
embed_function("Stack_S_Exists", ID_TYPE_FN_NUM);
add_embedded_arg("str_stack", ID_TYPE_NUM);
embed_function("OpenFile", ID_TYPE_FN_NUM);
add_embedded_arg("fileName$", ID_TYPE_STR);
add_embedded_arg("mode", ID_TYPE_NUM);
@@ -545,6 +549,23 @@ embed_function("GetSpriteCanvasRenderPriority", ID_TYPE_SUB);
add_embedded_arg("c_num", ID_TYPE_NUM);
add_embedded_arg("priority", ID_TYPE_BYREF_NUM);
add_embedded_arg("order", ID_TYPE_BYREF_NUM);
embed_function("SetPostEffect", ID_TYPE_FN_NUM);
add_embedded_arg("c_num", ID_TYPE_NUM);
add_embedded_arg("effect_type", ID_TYPE_NUM);
embed_function("ClearPostEffect", ID_TYPE_SUB);
add_embedded_arg("c_num", ID_TYPE_NUM);
embed_function("SetPostEffectProperty", ID_TYPE_SUB);
add_embedded_arg("c_num", ID_TYPE_NUM);
add_embedded_arg("property", ID_TYPE_NUM);
add_embedded_arg("property_value", ID_TYPE_NUM);
embed_function("GetPostEffectProperty", ID_TYPE_FN_NUM);
add_embedded_arg("c_num", ID_TYPE_NUM);
add_embedded_arg("property", ID_TYPE_NUM);
embed_function("SetPostEffectActive", ID_TYPE_SUB);
add_embedded_arg("c_num", ID_TYPE_NUM);
add_embedded_arg("flag", ID_TYPE_NUM);
embed_function("PostEffectIsActive", ID_TYPE_FN_NUM);
add_embedded_arg("c_num", ID_TYPE_NUM);
embed_function("Circle", ID_TYPE_SUB);
add_embedded_arg("x", ID_TYPE_NUM);
add_embedded_arg("y", ID_TYPE_NUM);
@@ -1338,6 +1359,8 @@ add_embedded_arg("mA", ID_TYPE_NUM);
add_embedded_arg("x", ID_TYPE_BYREF_NUM);
add_embedded_arg("y", ID_TYPE_BYREF_NUM);
add_embedded_arg("z", ID_TYPE_BYREF_NUM);
embed_function("MatrixExists", ID_TYPE_FN_NUM);
add_embedded_arg("mA", ID_TYPE_NUM);
embed_function("GetClipboardText$", ID_TYPE_FN_STR);
embed_function("SetClipboardText", ID_TYPE_SUB);
add_embedded_arg("txt$", ID_TYPE_STR);
@@ -1703,6 +1726,10 @@ embed_function("GetSpriteShapeOffset", ID_TYPE_SUB);
add_embedded_arg("spr_id", ID_TYPE_NUM);
add_embedded_arg("x", ID_TYPE_BYREF_NUM);
add_embedded_arg("y", ID_TYPE_BYREF_NUM);
embed_function("GetSpriteWorldCenter", ID_TYPE_SUB);
add_embedded_arg("spr_id", ID_TYPE_NUM);
add_embedded_arg("x", ID_TYPE_BYREF_NUM);
add_embedded_arg("y", ID_TYPE_BYREF_NUM);
embed_function("createDistanceJoint", ID_TYPE_FN_NUM);
add_embedded_arg("spriteA", ID_TYPE_NUM);
add_embedded_arg("spriteB", ID_TYPE_NUM);
@@ -2084,6 +2111,30 @@ embed_function("GetMeshPolygonCount", ID_TYPE_FN_NUM);
add_embedded_arg("mesh", ID_TYPE_NUM);
embed_function("FlipMeshSurfaces", ID_TYPE_SUB);
add_embedded_arg("mesh", ID_TYPE_NUM);
embed_function("SetMeshBuffer", ID_TYPE_FN_NUM);
add_embedded_arg("mesh_id", ID_TYPE_NUM);
add_embedded_arg("buffer_num", ID_TYPE_NUM);
add_embedded_arg("vertex_count", ID_TYPE_NUM);
add_embedded_arg("vertex_data", ID_TYPE_BYREF_NUM);
add_embedded_arg("normal_data", ID_TYPE_BYREF_NUM);
add_embedded_arg("uv_data", ID_TYPE_BYREF_NUM);
add_embedded_arg("index_count", ID_TYPE_NUM);
add_embedded_arg("index_data", ID_TYPE_BYREF_NUM);
embed_function("GetMeshBufferCount", ID_TYPE_FN_NUM);
add_embedded_arg("mesh_id", ID_TYPE_NUM);
embed_function("GetMeshBufferVertexCount", ID_TYPE_FN_NUM);
add_embedded_arg("mesh_id", ID_TYPE_NUM);
add_embedded_arg("buffer_index", ID_TYPE_NUM);
embed_function("GetMeshBufferIndexCount", ID_TYPE_FN_NUM);
add_embedded_arg("mesh_id", ID_TYPE_NUM);
add_embedded_arg("buffer_index", ID_TYPE_NUM);
embed_function("GetMeshBuffer", ID_TYPE_FN_NUM);
add_embedded_arg("mesh_id", ID_TYPE_NUM);
add_embedded_arg("buffer_index", ID_TYPE_NUM);
add_embedded_arg("vertex_data", ID_TYPE_BYREF_NUM);
add_embedded_arg("normal_data", ID_TYPE_BYREF_NUM);
add_embedded_arg("uv_data", ID_TYPE_BYREF_NUM);
add_embedded_arg("index_data", ID_TYPE_BYREF_NUM);
embed_function("CreateAnimatedActor", ID_TYPE_FN_NUM);
add_embedded_arg("mesh", ID_TYPE_NUM);
embed_function("CreateOctreeActor", ID_TYPE_FN_NUM);
@@ -2950,6 +3001,9 @@ embed_function("GetSceneShadowColor", ID_TYPE_FN_NUM);
embed_function("SetSceneAmbientColor", ID_TYPE_SUB);
add_embedded_arg("color", ID_TYPE_NUM);
embed_function("GetSceneAmbientColor", ID_TYPE_FN_NUM);
embed_function("Pipeline_Begin", ID_TYPE_SUB);
embed_function("Pipeline_End", ID_TYPE_SUB);
embed_function("Pipeline_Render", ID_TYPE_SUB);
embed_function("startParticleEmitter", ID_TYPE_SUB);
add_embedded_arg("actor", ID_TYPE_NUM);
embed_function("stopParticleEmitter", ID_TYPE_SUB);

File diff suppressed because it is too large Load Diff

View File

@@ -304,6 +304,12 @@ case FN_Stack_Size_N: //Number Function
case FN_Stack_Size_S: //Number Function
rc_push_num(rc_intern_s_stack_size( STACK_SIZE_S_STR_STACK ));
break;
case FN_Stack_N_Exists: //Number Function
rc_push_num(rc_intern_n_stack_exists( STACK_N_EXISTS_NUM_STACK ));
break;
case FN_Stack_S_Exists: //Number Function
rc_push_num(rc_intern_s_stack_exists( STACK_S_EXISTS_STR_STACK ));
break;
case FN_OpenFile: //Number Function
rc_push_num(rc_intern_fileOpen( OPENFILE_FILENAME$, OPENFILE_MODE ));
break;
@@ -649,6 +655,24 @@ case FN_SetSpriteCanvasRenderPriority: //Number Function
case FN_GetSpriteCanvasRenderPriority: //Sub Procedure
rc_getSpriteCanvasRenderPriority( GETSPRITECANVASRENDERPRIORITY_C_NUM, &GETSPRITECANVASRENDERPRIORITY_PRIORITY, &GETSPRITECANVASRENDERPRIORITY_ORDER );
break;
case FN_SetPostEffect: //Number Function
rc_push_num(rc_setPostEffect( SETPOSTEFFECT_C_NUM, SETPOSTEFFECT_EFFECT_TYPE ));
break;
case FN_ClearPostEffect: //Sub Procedure
rc_clearPostEffect( CLEARPOSTEFFECT_C_NUM );
break;
case FN_SetPostEffectProperty: //Sub Procedure
rc_setPostEffectProperty( SETPOSTEFFECTPROPERTY_C_NUM, SETPOSTEFFECTPROPERTY_PROPERTY, SETPOSTEFFECTPROPERTY_PROPERTY_VALUE );
break;
case FN_GetPostEffectProperty: //Number Function
rc_push_num(rc_getPostEffectProperty( GETPOSTEFFECTPROPERTY_C_NUM, GETPOSTEFFECTPROPERTY_PROPERTY ));
break;
case FN_SetPostEffectActive: //Sub Procedure
rc_setPostEffectActive( SETPOSTEFFECTACTIVE_C_NUM, SETPOSTEFFECTACTIVE_FLAG );
break;
case FN_PostEffectIsActive: //Number Function
rc_push_num(rc_postEffectIsActive( POSTEFFECTISACTIVE_C_NUM ));
break;
case FN_Circle: //Sub Procedure
rc_drawCircle( CIRCLE_X, CIRCLE_Y, CIRCLE_RADIUS );
break;
@@ -1424,6 +1448,9 @@ case FN_GetMatrixRotation: //Sub Procedure
case FN_GetMatrixScale: //Sub Procedure
rc_getMatrixScale( GETMATRIXSCALE_MA, &GETMATRIXSCALE_X, &GETMATRIXSCALE_Y, &GETMATRIXSCALE_Z );
break;
case FN_MatrixExists: //Number Function
rc_push_num(rc_matrixExists( MATRIXEXISTS_MA ));
break;
case FN_GetClipboardText$: //String Function
rc_push_str(rc_getClipboardText( ));
break;
@@ -1781,6 +1808,9 @@ case FN_SetSpriteShapeOffset: //Sub Procedure
case FN_GetSpriteShapeOffset: //Sub Procedure
rc_getSpriteShapeOffset( GETSPRITESHAPEOFFSET_SPR_ID, &GETSPRITESHAPEOFFSET_X, &GETSPRITESHAPEOFFSET_Y );
break;
case FN_GetSpriteWorldCenter: //Sub Procedure
rc_getSpriteWorldCenter( GETSPRITEWORLDCENTER_SPR_ID, &GETSPRITEWORLDCENTER_X, &GETSPRITEWORLDCENTER_Y );
break;
case FN_createDistanceJoint: //Number Function
rc_push_num(rc_createDistanceJoint( CREATEDISTANCEJOINT_SPRITEA, CREATEDISTANCEJOINT_SPRITEB, CREATEDISTANCEJOINT_AX, CREATEDISTANCEJOINT_AY, CREATEDISTANCEJOINT_BX, CREATEDISTANCEJOINT_BY, CREATEDISTANCEJOINT_COLLIDE_CONNECT ));
break;
@@ -2105,6 +2135,21 @@ case FN_GetMeshPolygonCount: //Number Function
case FN_FlipMeshSurfaces: //Sub Procedure
rc_flipMeshSurfaces( FLIPMESHSURFACES_MESH );
break;
case FN_SetMeshBuffer: //Number Function
rc_push_num(rc_setMeshBuffer( SETMESHBUFFER_MESH_ID, SETMESHBUFFER_BUFFER_NUM, SETMESHBUFFER_VERTEX_COUNT, &SETMESHBUFFER_VERTEX_DATA, &SETMESHBUFFER_NORMAL_DATA, &SETMESHBUFFER_UV_DATA, SETMESHBUFFER_INDEX_COUNT, &SETMESHBUFFER_INDEX_DATA ));
break;
case FN_GetMeshBufferCount: //Number Function
rc_push_num(rc_getMeshBufferCount( GETMESHBUFFERCOUNT_MESH_ID ));
break;
case FN_GetMeshBufferVertexCount: //Number Function
rc_push_num(rc_getMeshBufferVertexCount( GETMESHBUFFERVERTEXCOUNT_MESH_ID, GETMESHBUFFERVERTEXCOUNT_BUFFER_INDEX ));
break;
case FN_GetMeshBufferIndexCount: //Number Function
rc_push_num(rc_getMeshBufferIndexCount( GETMESHBUFFERINDEXCOUNT_MESH_ID, GETMESHBUFFERINDEXCOUNT_BUFFER_INDEX ));
break;
case FN_GetMeshBuffer: //Number Function
rc_push_num(rc_getMeshBuffer( GETMESHBUFFER_MESH_ID, GETMESHBUFFER_BUFFER_INDEX, &GETMESHBUFFER_VERTEX_DATA, &GETMESHBUFFER_NORMAL_DATA, &GETMESHBUFFER_UV_DATA, &GETMESHBUFFER_INDEX_DATA ));
break;
case FN_CreateAnimatedActor: //Number Function
rc_push_num(rc_createAnimatedActor( CREATEANIMATEDACTOR_MESH ));
break;
@@ -2846,6 +2891,15 @@ case FN_SetSceneAmbientColor: //Sub Procedure
case FN_GetSceneAmbientColor: //Number Function
rc_push_num(rc_getSceneAmbientColor( ));
break;
case FN_Pipeline_Begin: //Sub Procedure
rc_pipeline_Begin( );
break;
case FN_Pipeline_End: //Sub Procedure
rc_pipeline_End( );
break;
case FN_Pipeline_Render: //Sub Procedure
rc_pipeline_Render( );
break;
case FN_startParticleEmitter: //Sub Procedure
rc_startParticleEmitter( STARTPARTICLEEMITTER_ACTOR );
break;

View File

@@ -1300,6 +1300,30 @@ string rc_keywordToken(string sline)
return "<num>0";
else if(sline.compare("SPRITE_ORDER_DESCENDING")==0)
return "<num>1";
else if(sline.compare("POST_EFFECT_TYPE_BLOOM")==0)
return "<num>1";
else if(sline.compare("POST_EFFECT_TYPE_BLUR")==0)
return "<num>2";
else if(sline.compare("POST_EFFECT_TYPE_MOTION_BLUR")==0)
return "<num>3";
else if(sline.compare("POST_EFFECT_TYPE_RADIAL_BLUR")==0)
return "<num>4";
else if(sline.compare("POST_EFFECT_TYPE_COLORIZE")==0)
return "<num>5";
else if(sline.compare("POST_EFFECT_TYPE_INVERT")==0)
return "<num>6";
else if(sline.compare("POST_EFFECT_TYPE_MINERAL")==0)
return "<num>7";
else if(sline.compare("POST_EFFECT_PROPERTY_STRENGTH")==0)
return "<num>1";
else if(sline.compare("POST_EFFECT_PROPERTY_DISTANCE")==0)
return "<num>2";
else if(sline.compare("POST_EFFECT_PROPERTY_MULTIPLIER")==0)
return "<num>3";
else if(sline.compare("POST_EFFECT_PROPERTY_SATURATION")==0)
return "<num>4";
else if(sline.compare("POST_EFFECT_PROPERTY_COLOR")==0)
return "<num>5";
else
{
for(int i = 0; i < rc_constants.size(); i++)

180
rcbasic_runtime/Android.mk Executable file → Normal file
View File

@@ -1,151 +1,85 @@
LOCAL_PATH := $(call my-dir)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := Bullet-prebuilt
LOCAL_SRC_FILES := ../bullet3/build3/Android/obj/local/$(TARGET_ARCH_ABI)/libBullet.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/..
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := freetype-prebuilt
LOCAL_SRC_FILES := ../freetype/Android/libs/$(TARGET_ARCH_ABI)/libfreetype.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/..
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := main
SDL_PATH := ../SDL
SDL_IMAGE_PATH := ../SDL2_image
SDL_MIXER_PATH := ../SDL2_mixer
SDL_NET_PATH := ../SDL2_net
IRRLICHT_PATH := ../RCIrrlicht
SDL_MIXER_PATH := ../SDL_mixer
SDL_NET_PATH := ../SDL_net
THEORA_PATH := ../theora
IRR_PATH := ../RCIrrlicht
BULLET_PATH := ../bullet3
IRRBULLET_PATH := ../irrBullet
IRRTHEORA_PATH := ../irrTheora
FREETYPE_PATH := ../freetype
BOX2D_PATH := ../box2d-2.4.2
IRR_THEORA_PATH := ../irrTheora
AN8_PATH := ../an8-parser
BOX2D_PATH := ../box2d-2.4.2
BULLET_PATH := ../bullet3
IRR_BULLET_PATH := ../irrBullet
VORBIS_LIBRARY_PATH := ../libvorbis64
THEORAPLAY_PATH := ../src/theoraplay
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
VORBIS_LIBRARY_PATH := ../libvorbisidec-1.2.1
THEORAPLAY_PATH := ../src/theoraplay_tremor
endif
FREETYPE_PATH := ../freetype-2.9.1
LOCAL_CFLAGS := -I$(LOCAL_PATH)/$(THEORAPLAY_PATH) -I$(LOCAL_PATH)/$(IRR_PATH)/include -DRC_ANDROID_BUILD
LOCAL_CPP_FEATURES += exceptions
LOCAL_CFLAGS := -I$(LOCAL_PATH)/$(THEORAPLAY_PATH) -DRC_ANDROID_BUILD
LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(SDL_PATH)/include \
$(LOCAL_PATH)/$(SDL_IMAGE_PATH) \
$(LOCAL_PATH)/$(SDL_MIXER_PATH) \
$(LOCAL_PATH)/$(SDL_NET_PATH) \
$(LOCAL_PATH)/$(THEORA_PATH) \
$(LOCAL_PATH)/$(SDL_MIXER_PATH)/include \
$(LOCAL_PATH)/$(SDL_NET_PATH)/include \
$(LOCAL_PATH)/$(THEORA_PATH)/include \
$(LOCAL_PATH)/$(VORBIS_LIBRARY_PATH)/include \
$(LOCAL_PATH)/$(THEORAPLAY_PATH) \
$(LOCAL_PATH)/$(IRR_PATH)/include \
$(LOCAL_PATH)/$(BULLET_PATH)/src \
$(LOCAL_PATH)/$(IRRBULLET_PATH)/include \
$(LOCAL_PATH)/$(IRRTHEORA_PATH) \
$(LOCAL_PATH)/$(IRR_THEORA_PATH) \
$(LOCAL_PATH)/$(FREETYPE_PATH)/include \
$(LOCAL_PATH)/$(AN8_PATH) \
$(LOCAL_PATH)/$(BOX2D_PATH)/include
$(LOCAL_PATH)/$(BOX2D_PATH)/include \
$(LOCAL_PATH)/$(BULLET_PATH)/src \
$(LOCAL_PATH)/$(IRR_BULLET_PATH)/include
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(IRRLICHT_PATH)/include
# Add your application source files here...
LOCAL_SRC_FILES := main.cpp $(LOCAL_PATH)/$(THEORAPLAY_PATH)/theoraplay.c gui_freetype_font.cpp
LOCAL_SRC_FILES := main.cpp \
CShader.cpp \
gui_freetype_font.cpp \
ProjectiveTextures.cpp \
theoraplay.c
LOCAL_SRC_FILES += \
$(BOX2D_PATH)/src/collision/b2_broad_phase.cpp \
$(BOX2D_PATH)/src/collision/b2_chain_shape.cpp \
$(BOX2D_PATH)/src/collision/b2_circle_shape.cpp \
$(BOX2D_PATH)/src/collision/b2_collide_circle.cpp \
$(BOX2D_PATH)/src/collision/b2_collide_edge.cpp \
$(BOX2D_PATH)/src/collision/b2_collide_polygon.cpp \
$(BOX2D_PATH)/src/collision/b2_collision.cpp \
$(BOX2D_PATH)/src/collision/b2_distance.cpp \
$(BOX2D_PATH)/src/collision/b2_dynamic_tree.cpp \
$(BOX2D_PATH)/src/collision/b2_edge_shape.cpp \
$(BOX2D_PATH)/src/collision/b2_polygon_shape.cpp \
$(BOX2D_PATH)/src/collision/b2_time_of_impact.cpp \
$(BOX2D_PATH)/src/common/b2_block_allocator.cpp \
$(BOX2D_PATH)/src/common/b2_draw.cpp \
$(BOX2D_PATH)/src/common/b2_math.cpp \
$(BOX2D_PATH)/src/common/b2_settings.cpp \
$(BOX2D_PATH)/src/common/b2_stack_allocator.cpp \
$(BOX2D_PATH)/src/common/b2_timer.cpp \
$(BOX2D_PATH)/src/dynamics/b2_body.cpp \
$(BOX2D_PATH)/src/dynamics/b2_chain_circle_contact.cpp \
$(BOX2D_PATH)/src/dynamics/b2_chain_polygon_contact.cpp \
$(BOX2D_PATH)/src/dynamics/b2_circle_contact.cpp \
$(BOX2D_PATH)/src/dynamics/b2_contact.cpp \
$(BOX2D_PATH)/src/dynamics/b2_contact_manager.cpp \
$(BOX2D_PATH)/src/dynamics/b2_contact_solver.cpp \
$(BOX2D_PATH)/src/dynamics/b2_distance_joint.cpp \
$(BOX2D_PATH)/src/dynamics/b2_edge_circle_contact.cpp \
$(BOX2D_PATH)/src/dynamics/b2_edge_polygon_contact.cpp \
$(BOX2D_PATH)/src/dynamics/b2_fixture.cpp \
$(BOX2D_PATH)/src/dynamics/b2_friction_joint.cpp \
$(BOX2D_PATH)/src/dynamics/b2_gear_joint.cpp \
$(BOX2D_PATH)/src/dynamics/b2_island.cpp \
$(BOX2D_PATH)/src/dynamics/b2_joint.cpp \
$(BOX2D_PATH)/src/dynamics/b2_motor_joint.cpp \
$(BOX2D_PATH)/src/dynamics/b2_mouse_joint.cpp \
$(BOX2D_PATH)/src/dynamics/b2_polygon_circle_contact.cpp \
$(BOX2D_PATH)/src/dynamics/b2_polygon_contact.cpp \
$(BOX2D_PATH)/src/dynamics/b2_prismatic_joint.cpp \
$(BOX2D_PATH)/src/dynamics/b2_pulley_joint.cpp \
$(BOX2D_PATH)/src/dynamics/b2_revolute_joint.cpp \
$(BOX2D_PATH)/src/dynamics/b2_weld_joint.cpp \
$(BOX2D_PATH)/src/dynamics/b2_wheel_joint.cpp \
$(BOX2D_PATH)/src/dynamics/b2_world_callbacks.cpp \
$(BOX2D_PATH)/src/dynamics/b2_world.cpp \
$(BOX2D_PATH)/src/rope/b2_rope.cpp \
$(IRRBULLET_PATH)/src/irrBulletBoxShape.cpp \
$(IRRBULLET_PATH)/src/irrBulletBvhTriangleMeshShape.cpp \
$(IRRBULLET_PATH)/src/irrBulletCapsuleShape.cpp \
$(IRRBULLET_PATH)/src/irrBulletCollisionCallBackInformation.cpp \
$(IRRBULLET_PATH)/src/irrBulletCollisionObjectAffectorAttract.cpp \
$(IRRBULLET_PATH)/src/irrBulletCollisionObjectAffector.cpp \
$(IRRBULLET_PATH)/src/irrBulletCollisionObjectAffectorDelete.cpp \
$(IRRBULLET_PATH)/src/irrBulletCollisionObject.cpp \
$(IRRBULLET_PATH)/src/irrBulletCollisionShape.cpp \
$(IRRBULLET_PATH)/src/irrBulletcommon.cpp \
$(IRRBULLET_PATH)/src/irrBulletConeShape.cpp \
$(IRRBULLET_PATH)/src/irrBulletConvexHullShape.cpp \
$(IRRBULLET_PATH)/src/irrBullet.cpp \
$(IRRBULLET_PATH)/src/irrBulletCylinderShape.cpp \
$(IRRBULLET_PATH)/src/irrBulletGhostObject.cpp \
$(IRRBULLET_PATH)/src/irrBulletGImpactMeshShape.cpp \
$(IRRBULLET_PATH)/src/irrBulletLiquidBody.cpp \
$(IRRBULLET_PATH)/src/irrBulletMotionState.cpp \
$(IRRBULLET_PATH)/src/irrBulletPhysicsDebug.cpp \
$(IRRBULLET_PATH)/src/irrBulletRayCastVehicle.cpp \
$(IRRBULLET_PATH)/src/irrBulletRigidBody.cpp \
$(IRRBULLET_PATH)/src/irrBulletSoftBody.cpp \
$(IRRBULLET_PATH)/src/irrBulletSphereShape.cpp \
$(IRRBULLET_PATH)/src/irrBulletTriangleMeshShape.cpp \
$(IRRBULLET_PATH)/src/irrBulletWorld.cpp
# Add irrBullet source files
LOCAL_SRC_FILES += $(LOCAL_PATH)/$(IRR_BULLET_PATH)/src/irrBulletBoxShape.cpp \
$(LOCAL_PATH)/$(IRR_BULLET_PATH)/src/irrBulletBvhTriangleMeshShape.cpp \
$(LOCAL_PATH)/$(IRR_BULLET_PATH)/src/irrBulletCapsuleShape.cpp \
$(LOCAL_PATH)/$(IRR_BULLET_PATH)/src/irrBulletCollisionCallBackInformation.cpp \
$(LOCAL_PATH)/$(IRR_BULLET_PATH)/src/irrBulletCollisionObjectAffectorAttract.cpp \
$(LOCAL_PATH)/$(IRR_BULLET_PATH)/src/irrBulletCollisionObjectAffector.cpp \
$(LOCAL_PATH)/$(IRR_BULLET_PATH)/src/irrBulletCollisionObjectAffectorDelete.cpp \
$(LOCAL_PATH)/$(IRR_BULLET_PATH)/src/irrBulletCollisionObject.cpp \
$(LOCAL_PATH)/$(IRR_BULLET_PATH)/src/irrBulletCollisionShape.cpp \
$(LOCAL_PATH)/$(IRR_BULLET_PATH)/src/irrBulletcommon.cpp \
$(LOCAL_PATH)/$(IRR_BULLET_PATH)/src/irrBulletConeShape.cpp \
$(LOCAL_PATH)/$(IRR_BULLET_PATH)/src/irrBulletConvexHullShape.cpp \
$(LOCAL_PATH)/$(IRR_BULLET_PATH)/src/irrBullet.cpp \
$(LOCAL_PATH)/$(IRR_BULLET_PATH)/src/irrBulletCylinderShape.cpp \
$(LOCAL_PATH)/$(IRR_BULLET_PATH)/src/irrBulletGhostObject.cpp \
$(LOCAL_PATH)/$(IRR_BULLET_PATH)/src/irrBulletGImpactMeshShape.cpp \
$(LOCAL_PATH)/$(IRR_BULLET_PATH)/src/irrBulletLiquidBody.cpp \
$(LOCAL_PATH)/$(IRR_BULLET_PATH)/src/irrBulletMotionState.cpp \
$(LOCAL_PATH)/$(IRR_BULLET_PATH)/src/irrBulletPhysicsDebug.cpp \
$(LOCAL_PATH)/$(IRR_BULLET_PATH)/src/irrBulletRayCastVehicle.cpp \
$(LOCAL_PATH)/$(IRR_BULLET_PATH)/src/irrBulletRigidBody.cpp \
$(LOCAL_PATH)/$(IRR_BULLET_PATH)/src/irrBulletSoftBody.cpp \
$(LOCAL_PATH)/$(IRR_BULLET_PATH)/src/irrBulletSphereShape.cpp \
$(LOCAL_PATH)/$(IRR_BULLET_PATH)/src/irrBulletTriangleMeshShape.cpp \
$(LOCAL_PATH)/$(IRR_BULLET_PATH)/src/irrBulletWorld.cpp
# LOCAL_SHARED_LIBRARIES := SDL2 SDL2_mixer SDL2_net ogg_shared vorbis64 theora
LOCAL_SHARED_LIBRARIES := SDL2 SDL2_mixer SDL2_net SDL2_ttf ogg_shared vorbis64 theora
LOCAL_STATIC_LIBRARIES := Irrlicht Box2d Bullet freetype
LOCAL_SHARED_LIBRARIES := SDL2 SDL2_image SDL2_mixer SDL2_net Irrlicht freetype-prebuilt
LOCAL_STATIC_LIBRARIES := Bullet-prebuilt android_native_app_glue
RC_TH_LOCAL_SHARED_LIBRARIES := ogg_shared vorbis64 theora
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
RC_TH_LOCAL_SHARED_LIBRARIES := ogg_shared tremor theora
LOCAL_CFLAGS += -DRC_USE_TREMOR -O2
endif
LOCAL_SHARED_LIBRARIES += $(RC_TH_LOCAL_SHARED_LIBRARIES)
LOCAL_LDLIBS := -lGLESv1_CM -lGLESv2 -lOpenSLES -llog -landroid
LOCAL_LDLIBS := -lGLESv1_CM -lGLESv2 -lOpenSLES -llog -landroid
include $(BUILD_SHARED_LIBRARY)

View File

@@ -0,0 +1,616 @@
#include "gui_freetype_font.h"
#include <SDL_ttf.h>
#if COMPILE_WITH_FREETYPE
#include <cassert>
#include <android/log.h>
#define LOGE(TAG, ...) __android_log_print(ANDROID_LOG_ERROR , TAG,__VA_ARGS__)
using namespace irr;
using namespace gui;
#ifdef _MSC_VER
#pragma warning(disable: 4996)
#endif
// --------------------------------------------------------
CGUITTGlyph::CGUITTGlyph()
: IReferenceCounted()
,cached(false)
,size(0)
,top(0)
,left(0)
,texw(0)
,texh(0)
,imgw(0)
,imgh(0)
,tex(NULL)
,top16(0)
,left16(0)
,texw16(0)
,texh16(0)
,imgw16(0)
,imgh16(0)
,tex16(NULL)
,image(NULL)
{
}
CGUITTGlyph::~CGUITTGlyph()
{
delete[] image;
}
//void CGUITTGlyph::cache(u32 idx_, CGUITTFace& ttFace_, video::IVideoDriver* driver_, irr::core::dimension2d<irr::u32> &largestSize)
void CGUITTGlyph::cache(u32 idx_, const CGUIFreetypeFont * freetypeFont)
{
assert(freetypeFont);
FT_Face face = freetypeFont->TrueTypeFace->face;
FT_Set_Pixel_Sizes(face, 0, size);
if ( size > freetypeFont->LargestGlyph.Height )
freetypeFont->LargestGlyph.Height = size;
if ( !FT_Load_Glyph(face, idx_, FT_LOAD_NO_HINTING|FT_LOAD_NO_BITMAP) )
{
FT_GlyphSlot glyph = face->glyph;
FT_Bitmap bits;
if (glyph->format == ft_glyph_format_outline )
{
if (!FT_Render_Glyph( glyph, FT_RENDER_MODE_NORMAL))
{
bits = glyph->bitmap;
u8 *pt = bits.buffer;
delete[] image;
image = new u8[bits.width * bits.rows];
memcpy(image,pt,bits.width * bits.rows);
top = glyph->bitmap_top;
left = glyph->bitmap_left;
imgw = 1;
imgh = 1;
texw = bits.width;
texh = bits.rows;
for(;;)
{
if (imgw > texw)
{
break;
}
else
{
imgw <<= 1;
}
}
for(;;)
{
if (imgh > texh)
{
break;
}
else
{
imgh <<= 1;
}
}
if (imgw > imgh)
{
imgh = imgw;
}
else
{
imgw = imgh;
}
s32 offx = left;
s32 offy = size - top;
if ( offx+texw > freetypeFont->LargestGlyph.Width )
freetypeFont->LargestGlyph.Width = offx+texw;
if ( offy+texh > freetypeFont->LargestGlyph.Height )
freetypeFont->LargestGlyph.Height = offy+texh;
u32 *texd = new u32[imgw*imgh];
memset(texd,0,imgw*imgh*sizeof(u32));
u32 *texp = texd;
bool cflag = (freetypeFont->Driver->getDriverType() == video::EDT_DIRECT3D9);
for (int i = 0;i < bits.rows;i++)
{
u32 *rowp = texp;
for (int j = 0;j < bits.width;j++)
{
if (*pt)
{
if (cflag)
{
*rowp = *pt;
*rowp *= 0x01010101;
}
else
{
*rowp = *pt << 24;
*rowp |= 0xffffff;
}
}
else
{
*rowp = 0;
}
pt++;
rowp++;
}
texp += imgw;
}
c8 name[128];
sprintf(name,"ttf%d_%d_%p",idx_, size, freetypeFont );
video::IImage *img = freetypeFont->Driver->createImageFromData(video::ECF_A8R8G8B8,core::dimension2d<u32>(imgw,imgh),texd);
setGlyphTextureFlags(freetypeFont->Driver);
tex = freetypeFont->Driver->addTexture(name,img);
img->drop();
restoreTextureFlags(freetypeFont->Driver);
delete[] texd;
cached = true;
}
}
}
if (!FT_Load_Glyph(face,idx_,FT_LOAD_NO_HINTING|FT_LOAD_RENDER|FT_LOAD_MONOCHROME))
{
FT_GlyphSlot glyph = face->glyph;
FT_Bitmap bits = glyph->bitmap;
u8 *pt = bits.buffer;
top16 = glyph->bitmap_top;
left16 = glyph->bitmap_left;
imgw16 = 1;
imgh16 = 1;
texw16 = bits.width;
texh16 = bits.rows;
for(;;)
{
if (imgw16 >= texw16)
{
break;
}
else
{
imgw16 <<= 1;
}
}
for(;;)
{
if (imgh16 >= texh16)
{
break;
}
else
{
imgh16 <<= 1;
}
}
if (imgw16 > imgh16)
{
imgh16 = imgw16;
}
else
{
imgw16 = imgh16;
}
s32 offx = left;
s32 offy = size - top;
if ( offx+texw > freetypeFont->LargestGlyph.Width )
freetypeFont->LargestGlyph.Width = offx+texw;
if ( offy+texh > freetypeFont->LargestGlyph.Height )
freetypeFont->LargestGlyph.Height = offy+texh;
u16 *texd16 = new u16[imgw16*imgh16];
memset(texd16,0,imgw16*imgh16*sizeof(u16));
u16 *texp16 = texd16;
for (int y = 0;y < bits.rows;y++)
{
u16 *rowp = texp16;
for (int x = 0;x < bits.width;x++)
{
if (pt[y * bits.pitch + (x / 8)] & (0x80 >> (x % 8)))
{
*rowp = 0xffff;
}
rowp++;
}
texp16 += imgw16;
}
c8 name[128];
sprintf(name,"ttf%d_%d_%p_16",idx_, size, freetypeFont );
video::IImage *img = freetypeFont->Driver->createImageFromData(video::ECF_A1R5G5B5,core::dimension2d<u32>(imgw16,imgh16),texd16);
setGlyphTextureFlags(freetypeFont->Driver);
tex16 = freetypeFont->Driver->addTexture(name,img);
img->drop();
restoreTextureFlags(freetypeFont->Driver);
// freetypeFont->Driver->makeColorKeyTexture(tex16,video::SColor(0,0,0,0));
delete[] texd16;
}
}
bool CGUITTGlyph::mTexFlag16 = false;
bool CGUITTGlyph::mTexFlag32 = true;
bool CGUITTGlyph::mTexFlagMip = false;
void CGUITTGlyph::setGlyphTextureFlags(video::IVideoDriver* driver_)
{
mTexFlag16 = driver_->getTextureCreationFlag(video::ETCF_ALWAYS_16_BIT);
mTexFlag32 = driver_->getTextureCreationFlag(video::ETCF_ALWAYS_32_BIT);
mTexFlagMip = driver_->getTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS);
driver_->setTextureCreationFlag(video::ETCF_ALWAYS_16_BIT,false);
driver_->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT,true);
driver_->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false);
}
void CGUITTGlyph::restoreTextureFlags(video::IVideoDriver* driver_)
{
driver_->setTextureCreationFlag(video::ETCF_ALWAYS_16_BIT, mTexFlag16);
driver_->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, mTexFlag32);
driver_->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, mTexFlagMip);
}
// --------------------------------------------------------
FT_Library CGUITTFace::library = 0;
int CGUITTFace::countClassObjects = 0;
bool CGUITTFace::ttf_init = false;
CGUITTFace::CGUITTFace()
: face(0)
{
++countClassObjects;
is_sdl = false;
if(!ttf_init)
{
TTF_Init();
ttf_init = true;
}
}
CGUITTFace::~CGUITTFace()
{
if( is_sdl )
{
TTF_CloseFont(sdl_font);
face = NULL;
sdl_font = NULL;
}
if ( face )
FT_Done_Face( face );
--countClassObjects;
assert(countClassObjects >= 0 );
if ( !countClassObjects && library )
{
FT_Done_FreeType( library );
library = 0;
}
}
//! loads a font file
bool CGUITTFace::load(const irr::io::path& filename)
{
//TTF_Font* sdl_font = TTF_Open
if ( !library )
{
if (FT_Init_FreeType( &library ))
{
return false;
}
}
core::stringc ansiFilename(filename); // path can be anything but freetype can only work with ansi-filenames
if (FT_New_Face( library,ansiFilename.c_str(),0,&face ))
{
return false;
}
return true;
}
// --------------------------------------------------------
//! constructor
CGUIFreetypeFont::CGUIFreetypeFont(video::IVideoDriver* driver)
: Driver(driver)
, TrueTypeFace(0)
{
#ifdef _DEBUG
setDebugName("CGUIFreetypeFont");
#endif
if (Driver)
Driver->grab();
AntiAlias = false;
Transparency = false;
}
//! destructor
CGUIFreetypeFont::~CGUIFreetypeFont()
{
if ( TrueTypeFace )
TrueTypeFace->drop();
if (Driver)
Driver->drop();
clearGlyphs();
}
bool CGUIFreetypeFont::attach(CGUITTFace *Face,u32 size)
{
if (!Driver || !Face)
return false;
Face->grab();
if ( TrueTypeFace )
TrueTypeFace->drop();
TrueTypeFace = Face;
if ( !TrueTypeFace )
return false;
clearGlyphs();
Glyphs.reallocate(TrueTypeFace->face->num_glyphs);
Glyphs.set_used(TrueTypeFace->face->num_glyphs);
for (int i = 0;i < TrueTypeFace->face->num_glyphs;i++)
{
CGUITTGlyph * glyph = new CGUITTGlyph();
glyph->size = size;
// glyph->cache((wchar_t)i + 1);
Glyphs[i] = glyph;
}
// TODO: this is a workaround to get a probably ok height for getDimensions. So we check a few extreme characters which usually make trouble.
getGlyphByChar(L'A');
getGlyphByChar(L'g');
getGlyphByChar(L'.');
getGlyphByChar(L'(');
return true;
}
bool CGUIFreetypeFont::sdl_loadfont(irr::io::path font_file,irr::u32 size)
{
if (!Driver)
return false;
CGUITTFace *Face = new CGUITTFace();
if(!Face)
return false;
TTF_Font* sdl_font = TTF_OpenFont(font_file.c_str(), size);
if(!sdl_font)
{
LOGE("RCTEST", "TTF_OpenFont(%s) FAILED -> error: %s", font_file.c_str(), TTF_GetError());
delete Face;
return false;
}
Face->face = (FT_Face)TTF_GetFreeTypeFace(sdl_font);
Face->is_sdl = true;
Face->grab();
if ( TrueTypeFace )
TrueTypeFace->drop();
TrueTypeFace = Face;
if ( !TrueTypeFace )
return false;
clearGlyphs();
Glyphs.reallocate(TrueTypeFace->face->num_glyphs);
Glyphs.set_used(TrueTypeFace->face->num_glyphs);
for (int i = 0;i < TrueTypeFace->face->num_glyphs;i++)
{
CGUITTGlyph * glyph = new CGUITTGlyph();
glyph->size = size;
// glyph->cache((wchar_t)i + 1);
Glyphs[i] = glyph;
}
// TODO: this is a workaround to get a probably ok height for getDimensions. So we check a few extreme characters which usually make trouble.
getGlyphByChar(L'A');
getGlyphByChar(L'g');
getGlyphByChar(L'.');
getGlyphByChar(L'(');
return true;
}
CGUITTFace* CGUIFreetypeFont::getFace()
{
return TrueTypeFace;
}
void CGUIFreetypeFont::clearGlyphs()
{
for ( unsigned int i=0; i < Glyphs.size(); ++i )
{
if ( Glyphs[i] )
{
Glyphs[i]->drop();
}
Glyphs[i] = 0;
}
}
u32 CGUIFreetypeFont::getGlyphByChar(wchar_t c) const
{
u32 idx = FT_Get_Char_Index( TrueTypeFace->face, c );
if ( idx && !Glyphs[idx - 1]->cached )
Glyphs[idx - 1]->cache(idx, this);
return idx;
}
//! returns the dimension of a text
core::dimension2d<u32> CGUIFreetypeFont::getDimension(const wchar_t* text) const
{
core::dimension2d<u32> dim(0, Glyphs[0]->size);
for(const wchar_t* p = text; *p; ++p)
{
dim.Width += getWidthFromCharacter(*p);
}
// TODO: The correct solution might be working with TrueTypeFace->height but I can't figure out how to use units_per_EM
// even if I know which FT_Render_Mode I used. I'm sure there is some way to figure that out, but I have to give up for now.
if ( TrueTypeFace && LargestGlyph.Height > dim.Height)
dim.Height = LargestGlyph.Height;
return dim;
}
inline u32 CGUIFreetypeFont::getWidthFromCharacter(wchar_t c) const
{
u32 n = getGlyphByChar(c);
if ( n > 0)
{
int w = Glyphs[n - 1]->texw;
s32 left = Glyphs[n - 1]->left;
if (w + left > 0)
return w + left;
}
if (c >= 0x2000)
{
return Glyphs[0]->size;
}
else
{
return Glyphs[0]->size / 2;
}
}
//! draws an text and clips it to the specified rectangle if wanted
void CGUIFreetypeFont::draw(const irr::core::stringw& textstring, const irr::core::rect<s32>& position, video::SColor color, bool hcenter, bool vcenter, const core::rect<s32>* clip)
{
if (!Driver)
return;
core::dimension2d<s32> textDimension;
core::position2d<s32> offset = position.UpperLeftCorner;
video::SColor colors[4];
for (int i = 0;i < 4;i++)
{
colors[i] = color;
}
const wchar_t * text = textstring.c_str();
if (hcenter || vcenter)
{
textDimension = getDimension(text);
if (hcenter)
offset.X = ((position.getWidth() - textDimension.Width)>>1) + offset.X;
if (vcenter)
offset.Y = ((position.getHeight() - textDimension.Height)>>1) + offset.Y;
}
u32 n;
while(*text)
{
n = getGlyphByChar(*text);
if ( n > 0)
{
if (AntiAlias)
{
// s32 imgw = Glyphs[n-1]->imgw;
// s32 imgh = Glyphs[n-1]->imgh;
s32 texw = Glyphs[n-1]->texw;
s32 texh = Glyphs[n-1]->texh;
s32 offx = Glyphs[n-1]->left;
s32 offy = Glyphs[n-1]->size - Glyphs[n-1]->top;
if (Driver->getDriverType() != video::EDT_SOFTWARE)
{
if (!Transparency)
color.color |= 0xff000000;
Driver->draw2DImage(Glyphs[n-1]->tex,core::position2d<s32>(offset.X+offx,offset.Y+offy),core::rect<s32>(0,0,texw,texh),clip,color,true);
}
else
{
s32 a = color.getAlpha();
s32 r = color.getRed();
s32 g = color.getGreen();
s32 b = color.getBlue();
u8 *pt = Glyphs[n-1]->image;
if (!Transparency) a = 255;
for (int y = 0;y < texh;y++)
{
for (int x = 0;x < texw;x++)
{
if (!clip || clip->isPointInside(core::position2d<s32>(offset.X+x+offx,offset.Y+y+offy)))
{
if (*pt)
{
Driver->draw2DRectangle(video::SColor((a * *pt)/255,r,g,b),core::rect<s32>(offset.X+x+offx,offset.Y+y+offy,offset.X+x+offx+1,offset.Y+y+offy+1));
}
pt++;
}
}
}
}
}
else
{
// s32 imgw = Glyphs[n-1]->imgw16;
// s32 imgh = Glyphs[n-1]->imgh16;
s32 texw = Glyphs[n-1]->texw16;
s32 texh = Glyphs[n-1]->texh16;
s32 offx = Glyphs[n-1]->left16;
s32 offy = Glyphs[n-1]->size - Glyphs[n-1]->top16;
if (!Transparency)
{
color.color |= 0xff000000;
}
Driver->draw2DImage(Glyphs[n-1]->tex16,
core::position2d<s32>(offset.X+offx,offset.Y+offy),
core::rect<s32>(0,0,texw,texh),
clip, color, true);
}
offset.X += getWidthFromCharacter(*text);
}
else
{
offset.X += getWidthFromCharacter(*text);
}
++text;
}
}
//! Calculates the index of the character in the text which is on a specific position.
s32 CGUIFreetypeFont::getCharacterFromPos(const wchar_t* text, s32 pixel_x) const
{
s32 x = 0;
s32 idx = 0;
while (text[idx])
{
x += getWidthFromCharacter(text[idx]);
if (x >= pixel_x)
return idx;
++idx;
}
return -1;
}
#endif // #if COMPILE_WITH_FREETYPE

View File

@@ -0,0 +1,141 @@
#include "rc_os_defines.h"
#ifndef _GUI_FREETYPE_FONT_H
#define _GUI_FREETYPE_FONT_H
//! freetype support enabled with 1 and disabled with 0
#define COMPILE_WITH_FREETYPE 1
#if COMPILE_WITH_FREETYPE
#ifdef RC_ANDROID
#include "ft2build.h"
#include "freetype/freetype.h"
#include <SDL_ttf.h>
#else
#include <freetype2/ft2build.h>
#include <freetype/freetype.h>
#endif // RC_ANDROID
#include <irrlicht.h>
class CGUITTFace : public irr::IReferenceCounted
{
public:
CGUITTFace();
virtual ~CGUITTFace();
bool load(const irr::io::path& filename);
FT_Face face; // handle to face
bool is_sdl;
private:
static bool ttf_init;
static int countClassObjects;
static FT_Library library; // handle to library
TTF_Font* sdl_font;
};
class CGUIFreetypeFont;
class CGUITTGlyph : public irr::IReferenceCounted
{
public:
CGUITTGlyph();
virtual ~CGUITTGlyph();
bool cached;
void cache(irr::u32 idx_, const CGUIFreetypeFont * freetypeFont);
irr::u32 size;
irr::u32 top;
irr::u32 left;
irr::u32 texw;
irr::u32 texh;
irr::u32 imgw;
irr::u32 imgh;
irr::video::ITexture *tex;
irr::u32 top16;
irr::u32 left16;
irr::u32 texw16;
irr::u32 texh16;
irr::u32 imgw16;
irr::u32 imgh16;
irr::video::ITexture *tex16;
irr::u8 *image;
private:
void setGlyphTextureFlags(irr::video::IVideoDriver* driver_);
void restoreTextureFlags(irr::video::IVideoDriver* driver_);
static bool mTexFlag16;
static bool mTexFlag32;
static bool mTexFlagMip;
};
class CGUIFreetypeFont : public irr::gui::IGUIFont
{
friend class CGUITTGlyph;
public:
//! constructor
CGUIFreetypeFont(irr::video::IVideoDriver* Driver);
//! destructor
virtual ~CGUIFreetypeFont();
//! loads a truetype font file
bool attach(CGUITTFace *Face,irr::u32 size);
//! loads a truetype font file using SDL2
bool sdl_loadfont(irr::io::path font_file,irr::u32 size);
CGUITTFace* getFace();
//! draws an text and clips it to the specified rectangle if wanted
virtual void draw(const irr::core::stringw& text, const irr::core::rect<irr::s32>& position, irr::video::SColor color, bool hcenter=false, bool vcenter=false, const irr::core::rect<irr::s32>* clip=0);
//! returns the dimension of a text
virtual irr::core::dimension2d<irr::u32> getDimension(const wchar_t* text) const;
//! Calculates the index of the character in the text which is on a specific position.
virtual irr::s32 getCharacterFromPos(const wchar_t* text, irr::s32 pixel_x) const;
//! Not yet supported
virtual void setKerningWidth (irr::s32 kerning) {}
//! Not yet supported
virtual void setKerningHeight (irr::s32 kerning) {}
//! Not yet supported
virtual irr::s32 getKerningWidth(const wchar_t* thisLetter=0, const wchar_t* previousLetter=0) const { return 0; }
//! Not yet supported
virtual irr::s32 getKerningHeight() const { return 0; }
//! Not yet supported
virtual void setInvisibleCharacters( const wchar_t *s ) {}
bool AntiAlias;
bool Transparency;
protected:
void clearGlyphs();
private:
irr::u32 getWidthFromCharacter(wchar_t c) const;
irr::u32 getGlyphByChar(wchar_t c) const;
irr::video::IVideoDriver* Driver;
irr::core::array< CGUITTGlyph* > Glyphs;
CGUITTFace * TrueTypeFace;
mutable irr::core::dimension2d<irr::u32> LargestGlyph;
};
#endif // #if COMPILE_WITH_FREETYPE
#endif // _GUI_FREETYPE_FONT_H

View File

@@ -57,6 +57,7 @@
#include "rc_video.h"
#include "rc_steam_lib.h"
#include "rc_windowclose.h"
#include "rc_render_control.h"
#include "rc_test.h"
#include <irrtheora.h>
@@ -4398,7 +4399,7 @@ int main(int argc, char * argv[])
if(rc_filename.compare("--version")==0)
{
cout << "RCBASIC Runtime v4.6" << endl;
cout << "RCBASIC Runtime v4.7" << endl;
return 0;
}
@@ -4452,7 +4453,7 @@ int main(int argc, char * argv[])
//ogles2 test
#ifdef RC_TESTING
rc_intern_dirChange("/home/n00b/GameDev/Irrlicht Demo");
rc_intern_dirChange("/home/n00b/Music/v47/RCBasic_Package/examples/Custom Rendering");
//rc_intern_dirChange("");
rc_filename = "main.cbc";

View File

@@ -839,6 +839,8 @@ int rc_createProjectorActor()
rc_setActorCollisionShape(actor_id, RC_NODE_SHAPE_TYPE_BOX, 1);
rc_projector_actors.push_back(actor_id);
return actor_id;
}
@@ -851,7 +853,23 @@ void rc_deleteActor(int actor_id)
if(!rc_actor[actor_id].mesh_node)
return;
rc_physics3D.world->removeCollisionObject(rc_actor[actor_id].physics.rigid_body, false);
if(rc_actor[actor_id].node_type == RC_NODE_TYPE_PROJECTOR)
{
for(int i = 0; i < rc_projector_actors.size(); i++)
{
if(rc_projector_actors[i] == actor_id)
{
rc_projector_actors.erase(i);
break;
}
}
}
if(rc_actor[actor_id].physics.rigid_body)
rc_physics3D.world->removeCollisionObject(rc_actor[actor_id].physics.rigid_body, false);
rc_actor[actor_id].physics.rigid_body = NULL;
rc_actor[actor_id].physics.collisions.clear();
rc_actor[actor_id].mesh_node->remove();

File diff suppressed because it is too large Load Diff

View File

@@ -304,6 +304,12 @@ case FN_Stack_Size_N: //Number Function
case FN_Stack_Size_S: //Number Function
rc_push_num(rc_intern_s_stack_size( STACK_SIZE_S_STR_STACK ));
break;
case FN_Stack_N_Exists: //Number Function
rc_push_num(rc_intern_n_stack_exists( STACK_N_EXISTS_NUM_STACK ));
break;
case FN_Stack_S_Exists: //Number Function
rc_push_num(rc_intern_s_stack_exists( STACK_S_EXISTS_STR_STACK ));
break;
case FN_OpenFile: //Number Function
rc_push_num(rc_intern_fileOpen( OPENFILE_FILENAME$, OPENFILE_MODE ));
break;
@@ -649,6 +655,24 @@ case FN_SetSpriteCanvasRenderPriority: //Number Function
case FN_GetSpriteCanvasRenderPriority: //Sub Procedure
rc_getSpriteCanvasRenderPriority( GETSPRITECANVASRENDERPRIORITY_C_NUM, &GETSPRITECANVASRENDERPRIORITY_PRIORITY, &GETSPRITECANVASRENDERPRIORITY_ORDER );
break;
case FN_SetPostEffect: //Number Function
rc_push_num(rc_setPostEffect( SETPOSTEFFECT_C_NUM, SETPOSTEFFECT_EFFECT_TYPE ));
break;
case FN_ClearPostEffect: //Sub Procedure
rc_clearPostEffect( CLEARPOSTEFFECT_C_NUM );
break;
case FN_SetPostEffectProperty: //Sub Procedure
rc_setPostEffectProperty( SETPOSTEFFECTPROPERTY_C_NUM, SETPOSTEFFECTPROPERTY_PROPERTY, SETPOSTEFFECTPROPERTY_PROPERTY_VALUE );
break;
case FN_GetPostEffectProperty: //Number Function
rc_push_num(rc_getPostEffectProperty( GETPOSTEFFECTPROPERTY_C_NUM, GETPOSTEFFECTPROPERTY_PROPERTY ));
break;
case FN_SetPostEffectActive: //Sub Procedure
rc_setPostEffectActive( SETPOSTEFFECTACTIVE_C_NUM, SETPOSTEFFECTACTIVE_FLAG );
break;
case FN_PostEffectIsActive: //Number Function
rc_push_num(rc_postEffectIsActive( POSTEFFECTISACTIVE_C_NUM ));
break;
case FN_Circle: //Sub Procedure
rc_drawCircle( CIRCLE_X, CIRCLE_Y, CIRCLE_RADIUS );
break;
@@ -1424,6 +1448,9 @@ case FN_GetMatrixRotation: //Sub Procedure
case FN_GetMatrixScale: //Sub Procedure
rc_getMatrixScale( GETMATRIXSCALE_MA, &GETMATRIXSCALE_X, &GETMATRIXSCALE_Y, &GETMATRIXSCALE_Z );
break;
case FN_MatrixExists: //Number Function
rc_push_num(rc_matrixExists( MATRIXEXISTS_MA ));
break;
case FN_GetClipboardText$: //String Function
rc_push_str(rc_getClipboardText( ));
break;
@@ -1781,6 +1808,9 @@ case FN_SetSpriteShapeOffset: //Sub Procedure
case FN_GetSpriteShapeOffset: //Sub Procedure
rc_getSpriteShapeOffset( GETSPRITESHAPEOFFSET_SPR_ID, &GETSPRITESHAPEOFFSET_X, &GETSPRITESHAPEOFFSET_Y );
break;
case FN_GetSpriteWorldCenter: //Sub Procedure
rc_getSpriteWorldCenter( GETSPRITEWORLDCENTER_SPR_ID, &GETSPRITEWORLDCENTER_X, &GETSPRITEWORLDCENTER_Y );
break;
case FN_createDistanceJoint: //Number Function
rc_push_num(rc_createDistanceJoint( CREATEDISTANCEJOINT_SPRITEA, CREATEDISTANCEJOINT_SPRITEB, CREATEDISTANCEJOINT_AX, CREATEDISTANCEJOINT_AY, CREATEDISTANCEJOINT_BX, CREATEDISTANCEJOINT_BY, CREATEDISTANCEJOINT_COLLIDE_CONNECT ));
break;
@@ -2105,6 +2135,21 @@ case FN_GetMeshPolygonCount: //Number Function
case FN_FlipMeshSurfaces: //Sub Procedure
rc_flipMeshSurfaces( FLIPMESHSURFACES_MESH );
break;
case FN_SetMeshBuffer: //Number Function
rc_push_num(rc_setMeshBuffer( SETMESHBUFFER_MESH_ID, SETMESHBUFFER_BUFFER_NUM, SETMESHBUFFER_VERTEX_COUNT, &SETMESHBUFFER_VERTEX_DATA, &SETMESHBUFFER_NORMAL_DATA, &SETMESHBUFFER_UV_DATA, SETMESHBUFFER_INDEX_COUNT, &SETMESHBUFFER_INDEX_DATA ));
break;
case FN_GetMeshBufferCount: //Number Function
rc_push_num(rc_getMeshBufferCount( GETMESHBUFFERCOUNT_MESH_ID ));
break;
case FN_GetMeshBufferVertexCount: //Number Function
rc_push_num(rc_getMeshBufferVertexCount( GETMESHBUFFERVERTEXCOUNT_MESH_ID, GETMESHBUFFERVERTEXCOUNT_BUFFER_INDEX ));
break;
case FN_GetMeshBufferIndexCount: //Number Function
rc_push_num(rc_getMeshBufferIndexCount( GETMESHBUFFERINDEXCOUNT_MESH_ID, GETMESHBUFFERINDEXCOUNT_BUFFER_INDEX ));
break;
case FN_GetMeshBuffer: //Number Function
rc_push_num(rc_getMeshBuffer( GETMESHBUFFER_MESH_ID, GETMESHBUFFER_BUFFER_INDEX, &GETMESHBUFFER_VERTEX_DATA, &GETMESHBUFFER_NORMAL_DATA, &GETMESHBUFFER_UV_DATA, &GETMESHBUFFER_INDEX_DATA ));
break;
case FN_CreateAnimatedActor: //Number Function
rc_push_num(rc_createAnimatedActor( CREATEANIMATEDACTOR_MESH ));
break;
@@ -2846,6 +2891,15 @@ case FN_SetSceneAmbientColor: //Sub Procedure
case FN_GetSceneAmbientColor: //Number Function
rc_push_num(rc_getSceneAmbientColor( ));
break;
case FN_Pipeline_Begin: //Sub Procedure
rc_pipeline_Begin( );
break;
case FN_Pipeline_End: //Sub Procedure
rc_pipeline_End( );
break;
case FN_Pipeline_Render: //Sub Procedure
rc_pipeline_Render( );
break;
case FN_startParticleEmitter: //Sub Procedure
rc_startParticleEmitter( STARTPARTICLEEMITTER_ACTOR );
break;

View File

@@ -10,6 +10,12 @@
#if defined(RC_ANDROID) || defined(RC_WINDOWS)
#include <irrlicht.h>
#include <btBulletDynamicsCommon.h>
#if defined(RC_ANDROID)
#include <android/log.h>
#define LOGE(TAG, ...) __android_log_print(ANDROID_LOG_ERROR , TAG,__VA_ARGS__)
#endif // defined
#else
#include <irrlicht.h>
#include <bullet/btBulletDynamicsCommon.h>
@@ -29,6 +35,7 @@
#include "rc_spritelib.h"
#include "rc_tilelib.h"
#include "rc_joints.h"
#include "rc_post_fx.h"
#include <irrtheora.h>
@@ -392,7 +399,7 @@ bool rc_windowOpenEx(std::string title, int x, int y, int w, int h, uint32_t win
irr_creation_params.EventReceiver = 0;
irr_creation_params.WindowPosition = position2d<s32>(x, y);
irr_creation_params.AntiAlias = AntiAlias;
irr_creation_params.OGLES2ShaderPath = ".shaders/";
irr_creation_params.OGLES2ShaderPath = "shaders/";
rc_window_setfps = vsync;
@@ -1077,6 +1084,9 @@ int rc_canvasOpen(int w, int h, int vx, int vy, int vw, int vh, int mode, int ca
canvas.type = canvas_type;
canvas.show3D = false;
canvas.physics2D.enabled = false;
canvas.post_effect.object = NULL;
canvas.post_effect.type = -1;
canvas.post_effect.is_active = false;
#ifdef RC_DRIVER_GLES2
Uint32 size_n = 2;
@@ -1245,6 +1255,10 @@ void rc_canvasClose(int canvas_id)
rc_canvas[canvas_id].sprite_id.clear();
//delete post effects for canvas
rc_clearPostEffect(canvas_id);
if(rc_active_canvas == canvas_id)
rc_active_canvas = -1;
@@ -1528,6 +1542,9 @@ int rc_cloneCanvas(int origin_canvas_id, int mode)
canvas.show3D = rc_canvas[origin_canvas_id].show3D;
canvas.color_mod = rc_canvas[origin_canvas_id].color_mod;
canvas.texture = rc_canvas[origin_canvas_id].texture;
canvas.post_effect.is_active = false;
canvas.post_effect.object = NULL;
canvas.post_effect.type = -1;
//canvas.sprite_layer = rc_canvas[origin_canvas_id].sprite_layer;
if(!canvas.texture)
@@ -1734,7 +1751,7 @@ struct CircleSettings
f32 radius; // in pixels
f32 radius2;
video::SColor color;
u32 numVertices = 21; // including center
u32 numVertices = 121; // including center
};
void makeCircle(irr::core::array<irr::video::S3DVertex>& vertices, irr::core::array<irr::u16>& indices, const CircleSettings& settings)
@@ -1971,7 +1988,77 @@ void rc_drawCircleFill(int x, int y, double r)
video::EIT_16BIT);
}
#ifdef RC_ANDROID
int rc_loadFont(std::string fnt_file, int font_size)
{
irr::io::path file_path = fnt_file.c_str();
int font_id = -1;
for(int i = 0; i < rc_font.size(); i++)
{
if(!rc_font[i].active)
{
font_id = i;
break;
}
}
CGUITTFace* Face;
CGUIFreetypeFont* dfont;
dfont = new CGUIFreetypeFont(VideoDriver);
bool load_status = dfont->sdl_loadfont(fnt_file.c_str(), font_size);
if(!load_status)
{
LOGE("RCTEST", "LOAD STATUS FALSE");
return -1;
}
if(!dfont)
{
LOGE("RCTEST", "DFONT FAILED");
return -1;
}
Face = dfont->getFace();
if(!Face)
{
LOGE("RCTEST", "FACE NULL");
return -1;
}
LOGE("RCTEST", "ATTACH FACE SUCCESS");
if(font_id < 0)
{
font_id = rc_font.size();
rc_font_obj f;
f.face = Face;
f.font = dfont;
f.font_size = font_size;
f.active = true;
rc_font.push_back(f);
rc_active_font = font_id;
}
else
{
rc_font[font_id].face = Face;
rc_font[font_id].font = dfont;
rc_font[font_id].font_size = font_size;
rc_font[font_id].active = true;
}
//std::cout << "id: " << font_id << std::endl;
return font_id;
}
#else
int rc_loadFont(std::string fnt_file, int font_size)
{
irr::io::path file_path = fnt_file.c_str();
@@ -2022,6 +2109,7 @@ int rc_loadFont(std::string fnt_file, int font_size)
return font_id;
}
#endif // RC_ANDROID
bool rc_fontExists(int font_id)
{

View File

@@ -334,6 +334,28 @@ struct rc_spriteCanvasProperties
int order;
};
#define RC_POST_PROCESS_BLOOM 1
#define RC_POST_PROCESS_BLUR 2
#define RC_POST_PROCESS_MOTION_BLUR 3
#define RC_POST_PROCESS_RADIAL_BLUR 4
#define RC_POST_PROCESS_COLORIZE 5
#define RC_POST_PROCESS_INVERT 6
#define RC_POST_PROCESS_MINERAL 7
// strength, distance, multiplier, saturation, color
#define RC_PP_PROPERTY_STRENGTH 1
#define RC_PP_PROPERTY_DISTANCE 2
#define RC_PP_PROPERTY_MULTIPLIER 3
#define RC_PP_PROPERTY_SATURATION 4
#define RC_PP_PROPERTY_COLOR 5
struct rc_post_effect
{
int type;
void* object;
bool is_active;
};
#define RC_CANVAS_TYPE_2D 0
#define RC_CANVAS_TYPE_3D 1
#define RC_CANVAS_TYPE_SPRITE 2
@@ -382,12 +404,15 @@ struct rc_canvas_obj
rc_physicsWorld2D_obj physics2D;
irr::core::array<irr::s32> sprite_id;
rc_spriteCanvasProperties spriteCanvasProperties;
rc_post_effect post_effect;
};
irr::core::array<rc_canvas_obj> rc_canvas;
irr::core::array<u32> rc_canvas_zOrder;
int rc_active_canvas = -1;
bool hasPreUpdated = false;
bool manual_render_control = false;
irr::video::SColor rc_active_color(0,0,0,0);
irr::video::SColor rc_clear_color(0,0,0,0);
@@ -614,7 +639,7 @@ struct rc_scene_node
};
irr::core::array<rc_scene_node> rc_actor;
irr::core::array<int> rc_projector_actors;
irr::core::array<int> rc_transition_actor;

View File

@@ -1346,6 +1346,13 @@ void rc_getMatrixScale(int mA, double* x, double* y, double* z)
*x = m.getScale().X;
*y = m.getScale().Y;
*z = m.getScale().Z;
}
bool rc_matrixExists(int mA)
{
if(mA < 0 || mA >= rc_matrix.size())
return false;
return rc_matrix[mA].active;
}
#endif // RC_MATRIX_H_INCLUDED

View File

@@ -398,7 +398,7 @@ int rc_createVolumeLightMesh( double u, double v, double foot_color, double tail
//create mesh from geometry data [TODO]
bool rc_addMeshBuffer(int mesh_id, int vertex_count, double* vertex_data, double* normal_data, double* uv_data, int index_count, double* index_data)
int rc_addMeshBuffer(int mesh_id, int vertex_count, double* vertex_data, double* normal_data, double* uv_data, int index_count, double* index_data)
{
irr::scene::ISkinnedMesh * mesh = (irr::scene::ISkinnedMesh*) rc_mesh[mesh_id].mesh;
@@ -407,7 +407,7 @@ bool rc_addMeshBuffer(int mesh_id, int vertex_count, double* vertex_data, double
if(!mbuf)
{
mesh->drop();
return false;
return -1;
}
irr::core::array<irr::video::S3DVertex> vertices;
@@ -437,7 +437,162 @@ bool rc_addMeshBuffer(int mesh_id, int vertex_count, double* vertex_data, double
}
int mbuf_index = mesh->getMeshBufferCount()-1;
return mbuf_index;
}
bool rc_setMeshBuffer(int mesh_id, int buffer_index, int vertex_count, double* vertex_data, double* normal_data, double* uv_data, int index_count, double* index_data)
{
irr::scene::ISkinnedMesh * mesh = (irr::scene::ISkinnedMesh*) rc_mesh[mesh_id].mesh;
if(buffer_index < 0 || buffer_index >= mesh->getMeshBufferCount())
return false;
irr::scene::SSkinMeshBuffer* mbuf = (irr::scene::SSkinMeshBuffer*)mesh->getMeshBuffer(buffer_index);
if(!mbuf)
{
mesh->drop();
return false;
}
irr::core::array<irr::video::S3DVertex> vertices;
irr::core::array<irr::u16> indices;
for(int i = 0; i < vertex_count; i++)
{
irr::video::S3DVertex v;
v.Pos = irr::core::vector3df( (irr::f32) vertex_data[i*3], (irr::f32) vertex_data[i*3+1], (irr::f32) vertex_data[i*3+2] );
v.Normal = irr::core::vector3df( (irr::f32) normal_data[i*3], (irr::f32) normal_data[i*3+1], (irr::f32) normal_data[i*3+2] );
v.TCoords = irr::core::vector2df( (irr::f32) uv_data[i*2], (irr::f32) uv_data[i*2+1] );
vertices.push_back(v);
}
for(int i = 0; i < index_count; i++)
{
indices.push_back( (irr::u16) index_data[i] );
}
if(indices.size() > 0)
{
mbuf->Indices.clear();
mbuf->Vertices_Standard.clear();
for(int i = 0; i < vertices.size(); i++)
mbuf->Vertices_Standard.push_back(vertices[i]);
for(int i = 0; i < indices.size(); i++)
mbuf->Indices.push_back(indices[i]);
}
return true;
}
int rc_getMeshBufferCount(int mesh_id)
{
irr::scene::ISkinnedMesh * mesh = (irr::scene::ISkinnedMesh*) rc_mesh[mesh_id].mesh;
if(mesh_id < 0 || mesh_id >= rc_mesh.size())
return false;
return rc_mesh[mesh_id].mesh->getMeshBufferCount();
}
int rc_getMeshBufferVertexCount(int mesh_id, int buffer_index)
{
irr::scene::ISkinnedMesh * mesh = (irr::scene::ISkinnedMesh*) rc_mesh[mesh_id].mesh;
if(mesh_id < 0 || mesh_id >= rc_mesh.size())
return 0;
int buffer_count = rc_mesh[mesh_id].mesh->getMeshBufferCount();
if(buffer_index < 0 || buffer_index >= buffer_count)
return 0;
irr::scene::SSkinMeshBuffer* mbuf = (irr::scene::SSkinMeshBuffer*)mesh->getMeshBuffer(buffer_index);
if(!mbuf)
{
return 0;
}
return mbuf->getVertexCount();
}
int rc_getMeshBufferIndexCount(int mesh_id, int buffer_index)
{
irr::scene::ISkinnedMesh * mesh = (irr::scene::ISkinnedMesh*) rc_mesh[mesh_id].mesh;
if(mesh_id < 0 || mesh_id >= rc_mesh.size())
return 0;
int buffer_count = rc_mesh[mesh_id].mesh->getMeshBufferCount();
if(buffer_index < 0 || buffer_index >= buffer_count)
return 0;
irr::scene::SSkinMeshBuffer* mbuf = (irr::scene::SSkinMeshBuffer*)mesh->getMeshBuffer(buffer_index);
if(!mbuf)
{
return 0;
}
return mbuf->getIndexCount();
}
bool rc_getMeshBuffer(int mesh_id, int buffer_index, double* vertex_data, double* normal_data, double* uv_data, double* index_data)
{
irr::scene::ISkinnedMesh * mesh = (irr::scene::ISkinnedMesh*) rc_mesh[mesh_id].mesh;
if(mesh_id < 0 || mesh_id >= rc_mesh.size())
return false;
int buffer_count = rc_mesh[mesh_id].mesh->getMeshBufferCount();
if(buffer_index < 0 || buffer_index >= buffer_count)
return false;
irr::scene::SSkinMeshBuffer* mbuf = (irr::scene::SSkinMeshBuffer*)mesh->getMeshBuffer(buffer_index);
if(!mbuf)
{
return false;
}
int vertex_count = mbuf->getVertexCount();
int index_count = mbuf->getIndexCount();
for(int i = 0; i < vertex_count; i++)
{
irr::video::S3DVertex* v = mbuf->getVertex(i);
vertex_data[i*3] = (double)v->Pos.X;
vertex_data[i*3+1] = (double)v->Pos.Y;
vertex_data[i*3+2] = (double)v->Pos.Z;
normal_data[i*3] = (double)v->Normal.X;
normal_data[i*3+1] = (double)v->Normal.Y;
normal_data[i*3+2] = (double)v->Normal.Z;
uv_data[i*2] = (double)v->TCoords.X;
uv_data[i*2+1] = (double)v->TCoords.Y;
}
for(int i = 0; i < index_count; i++)
{
index_data[i] = (double)mbuf->getIndices()[i];
}
return true;
}
#endif // RC_MESH_H_INCLUDED

View File

@@ -455,7 +455,7 @@ void rc_net_udp_closeSocket(int socket)
int rc_net_udp_sendData(int slot, std::string host, Uint16 port, std::string s_data)
{
if(socket < 0 || socket >= rc_udp_socket.size())
if(slot < 0 || slot >= rc_udp_socket.size())
return 0;
IPaddress srvadd;

1542
rcbasic_runtime/rc_post_fx.h Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,285 @@
#ifndef RC_RENDER_CONTROL_H_INCLUDED
#define RC_RENDER_CONTROL_H_INCLUDED
#include <irrlicht.h>
#include "rc_gfx_core.h"
#include "rc_post_fx.h"
void rc_pipeline_Begin()
{
manual_render_control = true;
VideoDriver->beginScene(true, true);
Uint32 current_time_ms = SDL_GetTicks();
double frame_current_time = ((double)current_time_ms)/1000.0;
for(int i = 0; i < rc_transition_actor.size();)
{
int t_actor = rc_transition_actor[i];
if((frame_current_time - rc_actor[t_actor].transition_start_time) >= rc_actor[t_actor].transition_time)
{
irr::scene::IAnimatedMeshSceneNode* node = (irr::scene::IAnimatedMeshSceneNode*)rc_actor[t_actor].mesh_node;
node->setTransitionTime(0);
node->setJointMode(irr::scene::EJUOR_NONE);
rc_actor[t_actor].transition = false;
rc_actor[t_actor].transition_time = 0;
rc_actor[t_actor].transition_start_time = 0;
rc_transition_actor.erase(t_actor);
rc_actor[t_actor].animation[0].start_frame = (int)rc_actor[t_actor].transition_frame;
rc_actor[t_actor].animation[0].end_frame = (int)rc_actor[t_actor].transition_frame;
rc_actor[t_actor].animation[0].fps = 0;
rc_actor[t_actor].current_animation_loop = 0;
rc_actor[t_actor].isPlaying = true;
rc_actor[t_actor].current_animation = 0;
}
else
{
//std::cout << "Animate dammit" << std::endl;
irr::scene::IAnimatedMeshSceneNode* node = (irr::scene::IAnimatedMeshSceneNode*)rc_actor[t_actor].mesh_node;
node->animateJoints();
i++;
}
}
}
void rc_pipeline_End()
{
int win_w = 0, win_h = 0;
double w_scale = 1, h_scale = 1;
if(rc_window)
{
SDL_GetWindowSize(rc_window, &win_w, &win_h);
}
if(manual_render_control)
{
#ifdef RC_DRIVER_GLES2
w_scale = ( (double)win_w / (double)rc_window_size.Width );
h_scale = ( (double)win_h / (double)rc_window_size.Height );
irr::core::rect<s32> src( irr::core::vector2d<s32>(0,0), rc_canvas[0].texture->getSize() );
irr::core::rect<s32> dest( irr::core::vector2d<s32>(0,0), irr::core::dimension2d<s32>(win_w*w_scale, win_h*h_scale) );
#else
irr::core::rect<s32> src( irr::core::vector2d<s32>(0,0), rc_window_size );
irr::core::rect<s32> dest;
if(rc_windowIsFullscreen())
dest = irr::core::rect<s32>( irr::core::vector2d<s32>(0,0), irr::core::dimension2d<s32>(win_w, win_h) );
else
dest = irr::core::rect<s32>( irr::core::vector2d<s32>(0,rc_canvas[0].texture->getSize().Height - rc_window_size.Height), irr::core::dimension2d<s32>(win_w, win_h) );
#endif // RC_DRIVER_GLES2
VideoDriver->draw2DImage(rc_canvas[0].texture, dest, src);
VideoDriver->endScene();
rc_setActiveCanvas(rc_active_canvas);
#ifdef RC_WEB
emscripten_sleep(0);
#else
SDL_Delay(0);
#endif // RC_WEB
}
manual_render_control = false;
}
void rc_pipeline_Render()
{
if(!manual_render_control)
return;
//std::cout << "db 1" << std::endl;
if(rc_active_canvas < 0 || rc_active_canvas >= rc_canvas.size())
return;
//std::cout << "db 2: " << (rc_canvas[rc_active_canvas].texture == NULL ? "NULL" : "OK") << std::endl;
if(!rc_canvas[rc_active_canvas].texture)
return;
//std::cout << "Render" << std::endl;
//VideoDriver->setRenderTarget(rc_canvas[0].texture);
irr::core::vector2d<s32> bb_position(0,0);
irr::core::dimension2d<u32> bb_dimension = rc_canvas[0].texture->getSize();
VideoDriver->setViewPort( irr::core::rect<irr::s32>(bb_position, bb_dimension) );
if(rc_canvas[rc_active_canvas].show3D)
{
if(rc_canvas[rc_active_canvas].post_effect.is_active)
{
if(rc_canvas[rc_active_canvas].post_effect.type == RC_POST_PROCESS_MINERAL)
{
IPostProcessGlass* post_process = (IPostProcessGlass*) rc_canvas[rc_active_canvas].post_effect.object;
VideoDriver->setRenderTarget(post_process->rt0, true, true);
}
else if(rc_canvas[rc_active_canvas].post_effect.type == RC_POST_PROCESS_BLOOM)
{
IPostProcessBloom* post_process = (IPostProcessBloom*) rc_canvas[rc_active_canvas].post_effect.object;
VideoDriver->setRenderTarget(post_process->rt0, true, true);
}
else if(rc_canvas[rc_active_canvas].post_effect.type == RC_POST_PROCESS_BLUR)
{
IPostProcessBlur* post_process = (IPostProcessBlur*) rc_canvas[rc_active_canvas].post_effect.object;
VideoDriver->setRenderTarget(post_process->rt0, true, true);
}
else if(rc_canvas[rc_active_canvas].post_effect.type == RC_POST_PROCESS_COLORIZE)
{
IPostProcessColor* post_process = (IPostProcessColor*) rc_canvas[rc_active_canvas].post_effect.object;
VideoDriver->setRenderTarget(post_process->rt0, true, true);
}
else if(rc_canvas[rc_active_canvas].post_effect.type == RC_POST_PROCESS_INVERT)
{
IPostProcessInvert* post_process = (IPostProcessInvert*) rc_canvas[rc_active_canvas].post_effect.object;
VideoDriver->setRenderTarget(post_process->rt0, true, true, irr::video::SColor(0,0,0,0));
}
else if(rc_canvas[rc_active_canvas].post_effect.type == RC_POST_PROCESS_RADIAL_BLUR)
{
IPostProcessRadialBlur* post_process = (IPostProcessRadialBlur*) rc_canvas[rc_active_canvas].post_effect.object;
VideoDriver->setRenderTarget(post_process->rt0, true, true);
}
else
{
VideoDriver->setRenderTarget(rc_canvas[rc_active_canvas].texture, true, true, rc_clear_color);
}
}
else
{
VideoDriver->setRenderTarget(rc_canvas[rc_active_canvas].texture, false, false);
}
if(rc_canvas[rc_active_canvas].camera.camera)
SceneManager->setActiveCamera(rc_canvas[rc_active_canvas].camera.camera);
rc_canvas[rc_active_canvas].camera.update();
VideoDriver->setViewPort(irr::core::rect<irr::s32>(0,0,rc_canvas[rc_active_canvas].texture->getSize().Width,rc_canvas[rc_active_canvas].texture->getSize().Height));
irr::video::SColor current_color = rc_active_color;
irr::video::SMaterial m;
m.Lighting=false;
VideoDriver->setMaterial(m);
VideoDriver->setTransform(video::ETS_WORLD, core::matrix4());
for(int i = 0; i < rc_prim3d_operation.size(); i++)
{
switch(rc_prim3d_operation[i].prim_type)
{
case PRIM3D_LINE:
rc_active_color = rc_prim3d_operation[i].color;
prim3d_drawLine3D(rc_prim3d_operation[i].x[0], rc_prim3d_operation[i].y[0], rc_prim3d_operation[i].z[0],
rc_prim3d_operation[i].x[1], rc_prim3d_operation[i].y[1], rc_prim3d_operation[i].z[1]);
break;
case PRIM3D_BOX:
rc_active_color = rc_prim3d_operation[i].color;
prim3d_drawBox3D(rc_prim3d_operation[i].x[0], rc_prim3d_operation[i].y[0], rc_prim3d_operation[i].z[0],
rc_prim3d_operation[i].x[1], rc_prim3d_operation[i].y[1], rc_prim3d_operation[i].z[1]);
break;
case PRIM3D_TRIANGLE:
rc_active_color = rc_prim3d_operation[i].color;
prim3d_drawTriangle3D(rc_prim3d_operation[i].x[0], rc_prim3d_operation[i].y[0], rc_prim3d_operation[i].z[0],
rc_prim3d_operation[i].x[1], rc_prim3d_operation[i].y[1], rc_prim3d_operation[i].z[1],
rc_prim3d_operation[i].x[2], rc_prim3d_operation[i].y[2], rc_prim3d_operation[i].z[2]);
break;
}
}
rc_active_color = current_color;
rc_setDriverMaterial();
if(rc_canvas[rc_active_canvas].post_effect.type == RC_POST_PROCESS_MOTION_BLUR && rc_canvas[rc_active_canvas].post_effect.is_active)
{
//render motion blur
IPostProcessMotionBlur* post_process = (IPostProcessMotionBlur*) rc_canvas[rc_active_canvas].post_effect.object;
post_process->render();
}
else
{
//std::cout << "draw all" << std::endl;
SceneManager->drawAll();
}
for(int p_actor = 0; p_actor < rc_projector_actors.size(); p_actor++)
{
int actor_id = rc_projector_actors[p_actor];
if(actor_id < 0 || actor_id >= rc_actor.size())
continue;
if(!rc_actor[actor_id].mesh_node)
continue;
if(rc_actor[actor_id].mesh_node->isVisible())
{
CProjectiveTextures* pt_node = (CProjectiveTextures*)rc_actor[actor_id].mesh_node;
pt_node->render();
}
}
//render post effects
if(rc_canvas[rc_active_canvas].post_effect.is_active)
{
rc_renderPostEffect(rc_active_canvas);
}
}
int canvas_id = rc_active_canvas;
if(rc_canvas[canvas_id].texture && rc_canvas[canvas_id].visible)
{
irr::core::rect<s32> dest(rc_canvas[canvas_id].viewport.position, rc_canvas[canvas_id].viewport.dimension);
irr::core::rect<s32> src(rc_canvas[canvas_id].offset, rc_canvas[canvas_id].viewport.dimension);
irr::video::SColor color(rc_canvas[canvas_id].color_mod);
#if defined(RC_DRIVER_GLES2)
if(rc_canvas[canvas_id].type == RC_CANVAS_TYPE_3D)
{
src = irr::core::rect<s32>( irr::core::vector2d<s32>(0, 0), rc_canvas[canvas_id].texture->getSize() );
dest = irr::core::rect<s32>( irr::core::vector2d<s32>(dest.UpperLeftCorner.X, dest.UpperLeftCorner.Y + dest.getHeight()), irr::core::dimension2d<s32>(dest.getWidth(), -1*dest.getHeight()) );
}
else if(rc_canvas[canvas_id].type == RC_CANVAS_TYPE_2D)
{
irr::core::dimension2d<irr::u32> cv_dim = rc_canvas[canvas_id].viewport.dimension;
irr::core::position2d<irr::s32> cv_pos = rc_canvas[canvas_id].viewport.position;
irr::core::vector2d<irr::s32> cv_offset(rc_canvas[canvas_id].offset.X, rc_canvas[canvas_id].texture->getSize().Height - rc_canvas[canvas_id].offset.Y - cv_dim.Height);
src = irr::core::rect<s32>( cv_offset, cv_dim );
dest = irr::core::rect<s32>( irr::core::vector2d<s32>(cv_pos.X, cv_pos.Y + cv_dim.Height), irr::core::dimension2d<s32>(cv_dim.Width, -1*cv_dim.Height) );
}
else if(rc_canvas[canvas_id].type == RC_CANVAS_TYPE_SPRITE)
{
src = irr::core::rect<s32>( irr::core::vector2d<s32>(0, 0), rc_canvas[canvas_id].texture->getSize() );
dest = irr::core::rect<s32>( irr::core::vector2d<s32>(dest.UpperLeftCorner.X, dest.UpperLeftCorner.Y + dest.getHeight()), irr::core::dimension2d<s32>(dest.getWidth(), -1*dest.getHeight()) );
drawSprites(canvas_id);
}
#else
if(rc_canvas[canvas_id].type == RC_CANVAS_TYPE_SPRITE)
{
src = irr::core::rect<s32>( irr::core::vector2d<s32>(0, 0), rc_canvas[canvas_id].viewport.dimension); //sprite layers will just offset the sprites in drawSprites()
drawSprites(canvas_id);
}
#endif // defined
}
}
#endif // RC_RENDER_CONTROL_H_INCLUDED

View File

@@ -86,11 +86,17 @@ void rc_clearScene()
}
}
rc_projector_actors.clear();
for(int i = 0; i < rc_actor.size(); i++)
{
if(rc_actor[i].mesh_node)
{
rc_physics3D.world->removeCollisionObject(rc_actor[i].physics.rigid_body, false);
if(rc_actor[i].physics.rigid_body)
rc_physics3D.world->removeCollisionObject(rc_actor[i].physics.rigid_body, false);
rc_actor[i].physics.rigid_body = NULL;
rc_actor[i].physics.collisions.clear();
rc_actor[i].mesh_node->remove();

View File

@@ -12,6 +12,18 @@ void rc_getSpriteCenter(int spr_id, double* x, double* y)
*y = (double)rc_sprite[spr_id].physics.body->GetLocalCenter().y;
}
void rc_getSpriteWorldCenter(int spr_id, double* x, double* y)
{
if(spr_id < 0 || spr_id >= rc_sprite.size())
return;
if(!rc_sprite[spr_id].active)
return;
*x = (double)rc_sprite[spr_id].physics.body->GetWorldCenter().x;
*y = (double)rc_sprite[spr_id].physics.body->GetWorldCenter().y;
}
void rc_setSpriteLinearVelocity(int spr_id, double x, double y)
{
if(spr_id < 0 || spr_id >= rc_sprite.size())

View File

@@ -1547,6 +1547,20 @@ inline unsigned long rc_intern_s_stack_size( int stack_id )
return rc_user_s_stack[stack_id].data.size();
}
inline bool rc_intern_n_stack_exists( int stack_id )
{
if(stack_id < 0 || stack_id >= rc_user_n_stack.size())
return false;
return rc_user_n_stack[stack_id].active;
}
inline bool rc_intern_s_stack_exists( int stack_id )
{
if(stack_id < 0 || stack_id >= rc_user_s_stack.size())
return false;
return rc_user_s_stack[stack_id].active;
}
inline void rc_intern_getPowerInfo(double * status, double * secs, double * pct)
{
int s = 0;

View File

@@ -489,38 +489,42 @@ bool rc_update()
Uint32 current_time_ms = SDL_GetTicks();
double frame_current_time = ((double)current_time_ms)/1000.0;
for(int i = 0; i < rc_transition_actor.size();)
{
int t_actor = rc_transition_actor[i];
if(!manual_render_control)
{
for(int i = 0; i < rc_transition_actor.size();)
{
int t_actor = rc_transition_actor[i];
if((frame_current_time - rc_actor[t_actor].transition_start_time) >= rc_actor[t_actor].transition_time)
{
irr::scene::IAnimatedMeshSceneNode* node = (irr::scene::IAnimatedMeshSceneNode*)rc_actor[t_actor].mesh_node;
node->setTransitionTime(0);
node->setJointMode(irr::scene::EJUOR_NONE);
rc_actor[t_actor].transition = false;
rc_actor[t_actor].transition_time = 0;
rc_actor[t_actor].transition_start_time = 0;
rc_transition_actor.erase(t_actor);
if((frame_current_time - rc_actor[t_actor].transition_start_time) >= rc_actor[t_actor].transition_time)
{
irr::scene::IAnimatedMeshSceneNode* node = (irr::scene::IAnimatedMeshSceneNode*)rc_actor[t_actor].mesh_node;
node->setTransitionTime(0);
node->setJointMode(irr::scene::EJUOR_NONE);
rc_actor[t_actor].transition = false;
rc_actor[t_actor].transition_time = 0;
rc_actor[t_actor].transition_start_time = 0;
rc_transition_actor.erase(t_actor);
rc_actor[t_actor].animation[0].start_frame = (int)rc_actor[t_actor].transition_frame;
rc_actor[t_actor].animation[0].end_frame = (int)rc_actor[t_actor].transition_frame;
rc_actor[t_actor].animation[0].fps = 0;
rc_actor[t_actor].current_animation_loop = 0;
rc_actor[t_actor].isPlaying = true;
rc_actor[t_actor].current_animation = 0;
}
else
{
//std::cout << "Animate dammit" << std::endl;
irr::scene::IAnimatedMeshSceneNode* node = (irr::scene::IAnimatedMeshSceneNode*)rc_actor[t_actor].mesh_node;
node->animateJoints();
i++;
}
}
rc_actor[t_actor].animation[0].start_frame = (int)rc_actor[t_actor].transition_frame;
rc_actor[t_actor].animation[0].end_frame = (int)rc_actor[t_actor].transition_frame;
rc_actor[t_actor].animation[0].fps = 0;
rc_actor[t_actor].current_animation_loop = 0;
rc_actor[t_actor].isPlaying = true;
rc_actor[t_actor].current_animation = 0;
}
else
{
//std::cout << "Animate dammit" << std::endl;
irr::scene::IAnimatedMeshSceneNode* node = (irr::scene::IAnimatedMeshSceneNode*)rc_actor[t_actor].mesh_node;
node->animateJoints();
i++;
}
}
}
VideoDriver->beginScene(true, true);
if(!manual_render_control)
VideoDriver->beginScene(true, true);
if(!hasPreUpdated)
{
@@ -532,61 +536,138 @@ bool rc_update()
rc_physics3D.world->stepSimulation(rc_physics3D.DeltaTime*0.001f, rc_physics3D.maxSubSteps, fixed_timestep);
}
for(int i = 0; i < rc_canvas.size(); i++)
if(!manual_render_control)
{
if(rc_canvas[i].show3D)
for(int canvas_id = 0; canvas_id < rc_canvas.size(); canvas_id++)
{
VideoDriver->setRenderTarget(rc_canvas[i].texture, true, true, irr::video::SColor(255,120,120,120));
if(rc_canvas[canvas_id].show3D)
{
if(rc_canvas[canvas_id].post_effect.is_active)
{
if(rc_canvas[canvas_id].post_effect.type == RC_POST_PROCESS_MINERAL)
{
IPostProcessGlass* post_process = (IPostProcessGlass*) rc_canvas[canvas_id].post_effect.object;
VideoDriver->setRenderTarget(post_process->rt0, true, true);
}
else if(rc_canvas[canvas_id].post_effect.type == RC_POST_PROCESS_BLOOM)
{
IPostProcessBloom* post_process = (IPostProcessBloom*) rc_canvas[canvas_id].post_effect.object;
VideoDriver->setRenderTarget(post_process->rt0, true, true);
}
else if(rc_canvas[canvas_id].post_effect.type == RC_POST_PROCESS_BLUR)
{
IPostProcessBlur* post_process = (IPostProcessBlur*) rc_canvas[canvas_id].post_effect.object;
VideoDriver->setRenderTarget(post_process->rt0, true, true);
}
else if(rc_canvas[canvas_id].post_effect.type == RC_POST_PROCESS_COLORIZE)
{
IPostProcessColor* post_process = (IPostProcessColor*) rc_canvas[canvas_id].post_effect.object;
VideoDriver->setRenderTarget(post_process->rt0, true, true);
}
else if(rc_canvas[canvas_id].post_effect.type == RC_POST_PROCESS_INVERT)
{
IPostProcessInvert* post_process = (IPostProcessInvert*) rc_canvas[canvas_id].post_effect.object;
VideoDriver->setRenderTarget(post_process->rt0, true, true, irr::video::SColor(0,0,0,0));
}
else if(rc_canvas[canvas_id].post_effect.type == RC_POST_PROCESS_RADIAL_BLUR)
{
IPostProcessRadialBlur* post_process = (IPostProcessRadialBlur*) rc_canvas[canvas_id].post_effect.object;
VideoDriver->setRenderTarget(post_process->rt0, true, true);
}
else
{
VideoDriver->setRenderTarget(rc_canvas[canvas_id].texture, true, true, rc_clear_color);
}
}
else
{
VideoDriver->setRenderTarget(rc_canvas[canvas_id].texture, true, true, rc_clear_color);
}
if(rc_canvas[i].camera.camera)
SceneManager->setActiveCamera(rc_canvas[i].camera.camera);
if(rc_canvas[canvas_id].camera.camera)
SceneManager->setActiveCamera(rc_canvas[canvas_id].camera.camera);
rc_canvas[i].camera.update();
rc_canvas[canvas_id].camera.update();
VideoDriver->setViewPort(irr::core::rect<irr::s32>(0,0,rc_canvas[i].texture->getSize().Width,rc_canvas[i].texture->getSize().Height));
VideoDriver->setViewPort(irr::core::rect<irr::s32>(0,0,rc_canvas[canvas_id].texture->getSize().Width,rc_canvas[canvas_id].texture->getSize().Height));
//irr::core::rect viewport(irr::core::position, rc_canvas[i].viewport.dimension);
//VideoDriver->setViewPort(viewport);
irr::video::SColor current_color = rc_active_color;
irr::video::SMaterial m;
m.Lighting=false;
VideoDriver->setMaterial(m);
VideoDriver->setTransform(video::ETS_WORLD, core::matrix4());
for(int i = 0; i < rc_prim3d_operation.size(); i++)
{
switch(rc_prim3d_operation[i].prim_type)
{
case PRIM3D_LINE:
rc_active_color = rc_prim3d_operation[i].color;
prim3d_drawLine3D(rc_prim3d_operation[i].x[0], rc_prim3d_operation[i].y[0], rc_prim3d_operation[i].z[0],
rc_prim3d_operation[i].x[1], rc_prim3d_operation[i].y[1], rc_prim3d_operation[i].z[1]);
break;
case PRIM3D_BOX:
rc_active_color = rc_prim3d_operation[i].color;
prim3d_drawBox3D(rc_prim3d_operation[i].x[0], rc_prim3d_operation[i].y[0], rc_prim3d_operation[i].z[0],
rc_prim3d_operation[i].x[1], rc_prim3d_operation[i].y[1], rc_prim3d_operation[i].z[1]);
break;
case PRIM3D_TRIANGLE:
rc_active_color = rc_prim3d_operation[i].color;
prim3d_drawTriangle3D(rc_prim3d_operation[i].x[0], rc_prim3d_operation[i].y[0], rc_prim3d_operation[i].z[0],
rc_prim3d_operation[i].x[1], rc_prim3d_operation[i].y[1], rc_prim3d_operation[i].z[1],
rc_prim3d_operation[i].x[2], rc_prim3d_operation[i].y[2], rc_prim3d_operation[i].z[2]);
break;
}
}
rc_active_color = current_color;
rc_setDriverMaterial();
//irr::core::rect viewport(irr::core::position, rc_canvas[i].viewport.dimension);
//VideoDriver->setViewPort(viewport);
irr::video::SColor current_color = rc_active_color;
irr::video::SMaterial m;
m.Lighting=false;
VideoDriver->setMaterial(m);
VideoDriver->setTransform(video::ETS_WORLD, core::matrix4());
for(int i = 0; i < rc_prim3d_operation.size(); i++)
{
switch(rc_prim3d_operation[i].prim_type)
{
case PRIM3D_LINE:
rc_active_color = rc_prim3d_operation[i].color;
prim3d_drawLine3D(rc_prim3d_operation[i].x[0], rc_prim3d_operation[i].y[0], rc_prim3d_operation[i].z[0],
rc_prim3d_operation[i].x[1], rc_prim3d_operation[i].y[1], rc_prim3d_operation[i].z[1]);
break;
case PRIM3D_BOX:
rc_active_color = rc_prim3d_operation[i].color;
prim3d_drawBox3D(rc_prim3d_operation[i].x[0], rc_prim3d_operation[i].y[0], rc_prim3d_operation[i].z[0],
rc_prim3d_operation[i].x[1], rc_prim3d_operation[i].y[1], rc_prim3d_operation[i].z[1]);
break;
case PRIM3D_TRIANGLE:
rc_active_color = rc_prim3d_operation[i].color;
prim3d_drawTriangle3D(rc_prim3d_operation[i].x[0], rc_prim3d_operation[i].y[0], rc_prim3d_operation[i].z[0],
rc_prim3d_operation[i].x[1], rc_prim3d_operation[i].y[1], rc_prim3d_operation[i].z[1],
rc_prim3d_operation[i].x[2], rc_prim3d_operation[i].y[2], rc_prim3d_operation[i].z[2]);
break;
}
}
rc_active_color = current_color;
rc_setDriverMaterial();
SceneManager->drawAll();
//VideoDriver->draw2DRectangle(irr::video::SColor(255,0,255,0), irr::core::rect<irr::s32>(10,40,100,500));
if(rc_canvas[canvas_id].post_effect.type == RC_POST_PROCESS_MOTION_BLUR && rc_canvas[canvas_id].post_effect.is_active)
{
//render motion blur
IPostProcessMotionBlur* post_process = (IPostProcessMotionBlur*) rc_canvas[canvas_id].post_effect.object;
post_process->render();
}
else
{
SceneManager->drawAll();
}
//vector3df p0(0, 0, 0);
//vector3df p1(10, 30, 0);
//vector3df p2(20, -30, 0);
//vector3df p3(30, 0, 0);
//drawBezierCurve(VideoDriver, p0, p1, p2, p3, irr::video::SColor(255, 0, 255, 0), 100);
for(int p_actor = 0; p_actor < rc_projector_actors.size(); p_actor++)
{
int actor_id = rc_projector_actors[p_actor];
VideoDriver->setRenderTarget(rc_canvas[0].texture);
if(actor_id < 0 || actor_id >= rc_actor.size())
continue;
if(!rc_actor[actor_id].mesh_node)
continue;
if(rc_actor[actor_id].mesh_node->isVisible())
{
CProjectiveTextures* pt_node = (CProjectiveTextures*)rc_actor[actor_id].mesh_node;
pt_node->render();
}
}
//render post effects
if(rc_canvas[canvas_id].post_effect.is_active)
{
VideoDriver->setRenderTarget(rc_canvas[canvas_id].texture, true, true, rc_clear_color);
rc_renderPostEffect(canvas_id);
}
//VideoDriver->draw2DRectangle(irr::video::SColor(255,0,255,0), irr::core::rect<irr::s32>(10,40,100,500));
//vector3df p0(0, 0, 0);
//vector3df p1(10, 30, 0);
//vector3df p2(20, -30, 0);
//vector3df p3(30, 0, 0);
//drawBezierCurve(VideoDriver, p0, p1, p2, p3, irr::video::SColor(255, 0, 255, 0), 100);
VideoDriver->setRenderTarget(rc_canvas[0].texture);
}
}
}
@@ -607,35 +688,41 @@ bool rc_update()
//std::cout << "draw canvas[" << canvas_id << "] (" << rc_canvas[canvas_id].offset.X << ", " << rc_canvas[canvas_id].offset.Y << ") (" << rc_canvas[canvas_id].viewport.dimension.Width << ", " << rc_canvas[canvas_id].viewport.dimension.Height << ")" << std::endl;
#if defined(RC_DRIVER_GLES2)
if(rc_canvas[canvas_id].type == RC_CANVAS_TYPE_3D)
if(!manual_render_control)
{
src = irr::core::rect<s32>( irr::core::vector2d<s32>(0, 0), rc_canvas[canvas_id].texture->getSize() );
dest = irr::core::rect<s32>( irr::core::vector2d<s32>(dest.UpperLeftCorner.X, dest.UpperLeftCorner.Y + dest.getHeight()), irr::core::dimension2d<s32>(dest.getWidth(), -1*dest.getHeight()) );
}
else if(rc_canvas[canvas_id].type == RC_CANVAS_TYPE_2D)
{
irr::core::dimension2d<irr::u32> cv_dim = rc_canvas[canvas_id].viewport.dimension;
irr::core::position2d<irr::s32> cv_pos = rc_canvas[canvas_id].viewport.position;
irr::core::vector2d<irr::s32> cv_offset(rc_canvas[canvas_id].offset.X, rc_canvas[canvas_id].texture->getSize().Height - rc_canvas[canvas_id].offset.Y - cv_dim.Height);
src = irr::core::rect<s32>( cv_offset, cv_dim );
dest = irr::core::rect<s32>( irr::core::vector2d<s32>(cv_pos.X, cv_pos.Y + cv_dim.Height), irr::core::dimension2d<s32>(cv_dim.Width, -1*cv_dim.Height) );
}
else if(rc_canvas[canvas_id].type == RC_CANVAS_TYPE_SPRITE)
{
if(rc_canvas[canvas_id].type == RC_CANVAS_TYPE_3D)
{
src = irr::core::rect<s32>( irr::core::vector2d<s32>(0, 0), rc_canvas[canvas_id].texture->getSize() );
dest = irr::core::rect<s32>( irr::core::vector2d<s32>(dest.UpperLeftCorner.X, dest.UpperLeftCorner.Y + dest.getHeight()), irr::core::dimension2d<s32>(dest.getWidth(), -1*dest.getHeight()) );
}
else if(rc_canvas[canvas_id].type == RC_CANVAS_TYPE_2D)
{
irr::core::dimension2d<irr::u32> cv_dim = rc_canvas[canvas_id].viewport.dimension;
irr::core::position2d<irr::s32> cv_pos = rc_canvas[canvas_id].viewport.position;
irr::core::vector2d<irr::s32> cv_offset(rc_canvas[canvas_id].offset.X, rc_canvas[canvas_id].texture->getSize().Height - rc_canvas[canvas_id].offset.Y - cv_dim.Height);
src = irr::core::rect<s32>( cv_offset, cv_dim );
dest = irr::core::rect<s32>( irr::core::vector2d<s32>(cv_pos.X, cv_pos.Y + cv_dim.Height), irr::core::dimension2d<s32>(cv_dim.Width, -1*cv_dim.Height) );
}
else if(rc_canvas[canvas_id].type == RC_CANVAS_TYPE_SPRITE)
{
src = irr::core::rect<s32>( irr::core::vector2d<s32>(0, 0), rc_canvas[canvas_id].texture->getSize() );
dest = irr::core::rect<s32>( irr::core::vector2d<s32>(dest.UpperLeftCorner.X, dest.UpperLeftCorner.Y + dest.getHeight()), irr::core::dimension2d<s32>(dest.getWidth(), -1*dest.getHeight()) );
drawSprites(canvas_id);
}
src = irr::core::rect<s32>( irr::core::vector2d<s32>(0, 0), rc_canvas[canvas_id].texture->getSize() );
dest = irr::core::rect<s32>( irr::core::vector2d<s32>(dest.UpperLeftCorner.X, dest.UpperLeftCorner.Y + dest.getHeight()), irr::core::dimension2d<s32>(dest.getWidth(), -1*dest.getHeight()) );
drawSprites(canvas_id);
}
}
//dest = irr::core::rect<s32>( irr::core::vector2d<s32>(dest.UpperLeftCorner.X, dest.UpperLeftCorner.Y + dest.getHeight()), irr::core::dimension2d<s32>(dest.getWidth(), -1*dest.getHeight()) );
draw2DImage2(VideoDriver, rc_canvas[canvas_id].texture, src, dest, irr::core::position2d<irr::s32>(0, 0), 0, true, color, screenSize);
#else
if(rc_canvas[canvas_id].type == RC_CANVAS_TYPE_SPRITE)
{
if(!manual_render_control)
{
if(rc_canvas[canvas_id].type == RC_CANVAS_TYPE_SPRITE)
{
src = irr::core::rect<s32>( irr::core::vector2d<s32>(0, 0), rc_canvas[canvas_id].viewport.dimension); //sprite layers will just offset the sprites in drawSprites()
drawSprites(canvas_id);
}
src = irr::core::rect<s32>( irr::core::vector2d<s32>(0, 0), rc_canvas[canvas_id].viewport.dimension); //sprite layers will just offset the sprites in drawSprites()
drawSprites(canvas_id);
}
}
draw2DImage2(VideoDriver, rc_canvas[canvas_id].texture, src, dest, irr::core::position2d<irr::s32>(0, 0), 0, true, color, screenSize);
#endif // defined
@@ -653,49 +740,56 @@ bool rc_update()
//VideoDriver->draw2DRectangle(irr::video::SColor(255,255,0,0), irr::core::rect<irr::s32>(0,0,100,500));
VideoDriver->setRenderTarget(0);
//VideoDriver->beginScene(true, true);
//VideoDriver->draw2DImage(rc_canvas[0].texture, irr::core::vector2d<irr::s32>(0,0));
//debug
//std::cout << "scale:: " << rc_window_size.Width << ", " << win_w << ", " << rc_canvas[0].texture->getSize().Width << std::endl;
//irr::core::rect<s32> src( irr::core::vector2d<s32>(0,0), rc_canvas[0].texture->getSize() );
#ifdef RC_DRIVER_GLES2
irr::core::rect<s32> src( irr::core::vector2d<s32>(0,0), rc_canvas[0].texture->getSize() );
irr::core::rect<s32> dest( irr::core::vector2d<s32>(0,0), irr::core::dimension2d<s32>(win_w*w_scale, win_h*h_scale) );
#else
irr::core::rect<s32> src( irr::core::vector2d<s32>(0,0), rc_window_size );
irr::core::rect<s32> dest;
if(!manual_render_control)
{
//VideoDriver->beginScene(true, true);
//VideoDriver->draw2DImage(rc_canvas[0].texture, irr::core::vector2d<irr::s32>(0,0));
if(rc_windowIsFullscreen())
dest = irr::core::rect<s32>( irr::core::vector2d<s32>(0,0), irr::core::dimension2d<s32>(win_w, win_h) );
else
dest = irr::core::rect<s32>( irr::core::vector2d<s32>(0,rc_canvas[0].texture->getSize().Height - rc_window_size.Height), irr::core::dimension2d<s32>(win_w, win_h) );
#endif // RC_DRIVER_GLES2
//debug
//std::cout << "scale:: " << rc_window_size.Width << ", " << win_w << ", " << rc_canvas[0].texture->getSize().Width << std::endl;
//irr::core::rect<s32> src( irr::core::vector2d<s32>(0,0), rc_canvas[0].texture->getSize() );
#ifdef RC_DRIVER_GLES2
irr::core::rect<s32> src( irr::core::vector2d<s32>(0,0), rc_canvas[0].texture->getSize() );
irr::core::rect<s32> dest( irr::core::vector2d<s32>(0,0), irr::core::dimension2d<s32>(win_w*w_scale, win_h*h_scale) );
#else
irr::core::rect<s32> src( irr::core::vector2d<s32>(0,0), rc_window_size );
irr::core::rect<s32> dest;
//irr::video::SColor color(0);
VideoDriver->draw2DImage(rc_canvas[0].texture, dest, src);
//draw2DImage2(VideoDriver, rc_canvas[0].texture, src, dest, irr::core::position2d<irr::s32>(0, 0), 0, false, color, screenSize);
//irr::core::rect<irr::s32> src( irr::core::vector2d<irr::s32>(0, 0), rc_canvas[0].texture->getSize() );
//irr::core::rect<irr::s32> dest( irr::core::vector2d<irr::s32>(0, 0), irr::core::dimension2d<irr::s32>( );
//draw2DImage2(VideoDriver, rc_canvas[canvas_id].texture, src, dest, irr::core::position2d<irr::s32>(0, 0), 0, true, color, screenSize);
if(rc_windowIsFullscreen())
dest = irr::core::rect<s32>( irr::core::vector2d<s32>(0,0), irr::core::dimension2d<s32>(win_w, win_h) );
else
dest = irr::core::rect<s32>( irr::core::vector2d<s32>(0,rc_canvas[0].texture->getSize().Height - rc_window_size.Height), irr::core::dimension2d<s32>(win_w, win_h) );
#endif // RC_DRIVER_GLES2
//VideoDriver->draw2DImage(rc_image[0].image, irr::core::rect<irr::s32>(0,0,100,100), irr::core::rect<irr::s32>(0,0,100,100));
//VideoDriver->draw2DRectangle(irr::video::SColor(255,255,0,0), irr::core::rect<irr::s32>(0,0,100,100));
//end debug
//irr::video::SColor color(0);
VideoDriver->draw2DImage(rc_canvas[0].texture, dest, src);
//draw2DImage2(VideoDriver, rc_canvas[0].texture, src, dest, irr::core::position2d<irr::s32>(0, 0), 0, false, color, screenSize);
//irr::core::rect<irr::s32> src( irr::core::vector2d<irr::s32>(0, 0), rc_canvas[0].texture->getSize() );
//irr::core::rect<irr::s32> dest( irr::core::vector2d<irr::s32>(0, 0), irr::core::dimension2d<irr::s32>( );
//draw2DImage2(VideoDriver, rc_canvas[canvas_id].texture, src, dest, irr::core::position2d<irr::s32>(0, 0), 0, true, color, screenSize);
//device->getGUIEnvironment()->drawAll();
VideoDriver->endScene();
//VideoDriver->draw2DImage(rc_image[0].image, irr::core::rect<irr::s32>(0,0,100,100), irr::core::rect<irr::s32>(0,0,100,100));
//VideoDriver->draw2DRectangle(irr::video::SColor(255,255,0,0), irr::core::rect<irr::s32>(0,0,100,100));
//end debug
rc_setActiveCanvas(rc_active_canvas);
//device->getGUIEnvironment()->drawAll();
VideoDriver->endScene();
rc_setActiveCanvas(rc_active_canvas);
}
}
hasPreUpdated = false; //Will be set to true if PreUpdate() is called
#ifdef RC_WEB
emscripten_sleep(0);
#else
SDL_Delay(0);
#endif // RC_WEB
if(!manual_render_control)
{
#ifdef RC_WEB
emscripten_sleep(0);
#else
SDL_Delay(0);
#endif // RC_WEB
}
return (!Close);
}

View File

@@ -130,6 +130,8 @@
<Unit filename="rc_os_defines.h" />
<Unit filename="rc_particles.h" />
<Unit filename="rc_physics3D_base.h" />
<Unit filename="rc_post_fx.h" />
<Unit filename="rc_render_control.h" />
<Unit filename="rc_scene.h" />
<Unit filename="rc_sprite2D.h" />
<Unit filename="rc_sprite_physics.h" />

File diff suppressed because it is too large Load Diff

View File

@@ -2,57 +2,92 @@
<CodeBlocks_layout_file>
<FileVersion major="1" minor="0" />
<ActiveTarget name="Debug" />
<File name="rc_net.h" open="0" top="0" tabpos="13" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="10210" topLine="395" />
</Cursor>
</File>
<File name="rc_tilemap.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="243" topLine="26" />
</Cursor>
</File>
<File name="rc_gfx.h" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="33063" topLine="1051" />
</Cursor>
</File>
<File name="rc_base_actor.h" open="1" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="22683" topLine="853" />
</Cursor>
</File>
<File name="rc_actor_material.h" open="0" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="751" topLine="1310" />
</Cursor>
</File>
<File name="rc_font.h" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="rc_os_defines.h" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="93" topLine="0" />
</Cursor>
</File>
<File name="../../an8-parser/an8parser.h" open="1" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="rc_joints.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="310" topLine="0" />
</Cursor>
</File>
<File name="rc_particles.h" open="0" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="6262" topLine="615" />
</Cursor>
</File>
<File name="rc_post_fx.h" open="1" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="50148" topLine="1509" />
</Cursor>
</File>
<File name="rc_func130_cases.h" open="1" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="24252" topLine="649" />
</Cursor>
</File>
<File name="../../irrBullet/src/irrBulletCollisionObject.cpp" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="322" topLine="4" />
</Cursor>
</File>
<File name="rc_sprite2D.h" open="0" top="0" tabpos="14" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="558" topLine="2" />
</Cursor>
</File>
<File name="rc_physics3D_base.h" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="3283" topLine="66" />
</Cursor>
</File>
<File name="../../irrBullet/src/irrBullet.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="rc_gfx_core.h" open="1" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="7" />
</Cursor>
</File>
<File name="rc_func130_cases.h" open="1" top="0" tabpos="15" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="22965" topLine="627" />
</Cursor>
</File>
<File name="rc_defines.h" open="0" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="190390" topLine="2847" />
</Cursor>
</File>
<File name="rc_audio.h" open="0" top="0" tabpos="18" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="6531" topLine="311" />
</Cursor>
</File>
<File name="../../irrBullet/src/irrBulletRigidBody.cpp" open="0" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="2248" topLine="493" />
</Cursor>
</File>
<File name="rc_stdlib.h" open="1" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1212" topLine="51" />
</Cursor>
</File>
<File name="rc_gfx_core.h" open="1" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="11667" topLine="204" />
<Cursor1 position="11943" topLine="187" />
</Cursor>
<Folding>
<Collapse line="104" />
</Folding>
</File>
<File name="../../irrBullet/src/irrBulletBvhTriangleMeshShape.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="rc_fx_materials.h" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="680" topLine="19" />
</Cursor>
</File>
<File name="rc_actor_animation.h" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="9592" topLine="289" />
<Cursor1 position="921" topLine="589" />
</Cursor>
</File>
<File name="../../irrBullet/src/irrBulletTriangleMeshShape.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
@@ -65,9 +100,216 @@
<Cursor1 position="1253" topLine="0" />
</Cursor>
</File>
<File name="rc_spritelib.h" open="1" top="0" tabpos="13" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="../../irrBullet/include/irrBulletBvhTriangleMeshShape.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="60528" topLine="1252" />
<Cursor1 position="1301" topLine="20" />
</Cursor>
</File>
<File name="../../irrBullet/src/irrBulletcommon.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="924" topLine="6" />
</Cursor>
</File>
<File name="gui_freetype_font.h" open="0" top="0" tabpos="14" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1638" topLine="52" />
</Cursor>
</File>
<File name="CShader.h" open="0" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1204" topLine="34" />
</Cursor>
</File>
<File name="rc_stdlib.h" open="0" top="0" tabpos="41" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="35266" topLine="1531" />
</Cursor>
</File>
<File name="rc_actor_physics.h" open="0" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="../../irrBullet/src/irrBullet.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="7" />
</Cursor>
</File>
<File name="rc_steam_lib.h" open="0" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1942" topLine="71" />
</Cursor>
</File>
<File name="rc_actor_animation.h" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="9998" topLine="302" />
</Cursor>
</File>
<File name="rc_scene.h" open="1" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="2212" topLine="82" />
</Cursor>
</File>
<File name="rc_steam.h" open="0" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="854" topLine="0" />
</Cursor>
</File>
<File name="gui_freetype_font.cpp" open="0" top="0" tabpos="24" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="792" topLine="0" />
</Cursor>
</File>
<File name="rc_geometry.h" open="0" top="0" tabpos="20" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="20919" topLine="652" />
</Cursor>
</File>
<File name="main.cpp" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="133550" topLine="4446" />
</Cursor>
</File>
<File name="rc_render_control.h" open="1" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="4040" topLine="97" />
</Cursor>
<Folding>
<Collapse line="202" />
<Collapse line="214" />
<Collapse line="232" />
<Collapse line="242" />
</Folding>
</File>
<File name="../../irrBullet/src/irrBulletRigidBody.cpp" open="0" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="2248" topLine="493" />
</Cursor>
</File>
<File name="../../irrBullet/src/irrBulletBvhTriangleMeshShape.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="680" topLine="19" />
</Cursor>
</File>
<File name="../../irrBullet/include/irrBulletConeShape.h" open="0" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="rc_test.h" open="0" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="115" topLine="0" />
</Cursor>
</File>
<File name="rc_mesh.h" open="0" top="0" tabpos="24" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="4771" topLine="208" />
</Cursor>
</File>
<File name="rc_matrix.h" open="0" top="0" tabpos="42" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="36505" topLine="1323" />
</Cursor>
</File>
<File name="rc_media.h" open="0" top="0" tabpos="17" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="72119" topLine="1937" />
</Cursor>
</File>
<File name="rc_gfx3D.h" open="0" top="0" tabpos="14" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="565" topLine="0" />
</Cursor>
</File>
<File name="rc_fx_shaders.h" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="178" topLine="769" />
</Cursor>
</File>
<File name="rc_windowclose.h" open="1" top="1" tabpos="16" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="17639" topLine="204" />
</Cursor>
<Folding>
<Collapse line="157" />
<Collapse line="492" />
<Collapse line="717" />
<Collapse line="744" />
</Folding>
</File>
<File name="rc_steam.cpp" open="0" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1410" topLine="0" />
</Cursor>
</File>
<File name="camera.h" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="4758" topLine="241" />
</Cursor>
</File>
<File name="../../irrBullet/include/irrBulletTriangleMeshShape.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="366" topLine="0" />
</Cursor>
</File>
<File name="../../irrBullet/src/irrBulletSoftBody.cpp" open="0" top="0" tabpos="14" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="885" topLine="2" />
</Cursor>
</File>
<File name="rc_constraint.h" open="0" top="0" tabpos="15" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="8391" topLine="231" />
</Cursor>
</File>
<File name="../../irrBullet/src/irrBulletWorld.cpp" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="18445" topLine="18" />
</Cursor>
</File>
<File name="ProjectiveTextures.h" open="0" top="0" tabpos="34" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="110" topLine="0" />
</Cursor>
</File>
<File name="../../irrBullet/src/irrBulletCapsuleShape.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="522" topLine="9" />
</Cursor>
</File>
<File name="rc_defines.h" open="0" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="190390" topLine="2847" />
</Cursor>
</File>
<File name="rc_tilelib.h" open="0" top="0" tabpos="17" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="10085" topLine="360" />
</Cursor>
</File>
<File name="../../irrBullet/src/irrBulletGhostObject.cpp" open="0" top="0" tabpos="13" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1861" topLine="27" />
</Cursor>
</File>
<File name="rc_audio.h" open="0" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="6652" topLine="38" />
</Cursor>
</File>
<File name="CShader.cpp" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1032" topLine="31" />
</Cursor>
</File>
<File name="rc_video.h" open="0" top="0" tabpos="19" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="515" topLine="80" />
</Cursor>
</File>
<File name="rc_spritelib.h" open="0" top="0" tabpos="13" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="61144" topLine="1289" />
</Cursor>
<Folding>
<Collapse line="464" />
@@ -91,219 +333,14 @@
<Collapse line="1143" />
</Folding>
</File>
<File name="rc_actor_physics.h" open="1" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="rc_sprite_physics.h" open="0" top="0" tabpos="38" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="../../irrBullet/src/irrBulletSoftBody.cpp" open="0" top="0" tabpos="14" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="885" topLine="2" />
<Cursor1 position="605" topLine="0" />
</Cursor>
</File>
<File name="ProjectiveTextures.cpp" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="348" topLine="166" />
</Cursor>
</File>
<File name="rc_tilelib.h" open="1" top="0" tabpos="17" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="10085" topLine="360" />
</Cursor>
</File>
<File name="rc_tilemap.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="243" topLine="26" />
</Cursor>
</File>
<File name="../../irrBullet/src/irrBulletGhostObject.cpp" open="0" top="0" tabpos="13" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1861" topLine="27" />
</Cursor>
</File>
<File name="rc_fx_materials.h" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="921" topLine="589" />
</Cursor>
</File>
<File name="rc_steam.cpp" open="0" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1410" topLine="0" />
</Cursor>
</File>
<File name="rc_geometry.h" open="0" top="0" tabpos="20" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="20919" topLine="652" />
</Cursor>
</File>
<File name="rc_sprite_physics.h" open="0" top="0" tabpos="38" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="16031" topLine="523" />
</Cursor>
</File>
<File name="../../irrBullet/src/irrBulletWorld.cpp" open="0" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="18445" topLine="18" />
</Cursor>
</File>
<File name="../../irrBullet/src/irrBulletCollisionObject.cpp" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="322" topLine="4" />
</Cursor>
</File>
<File name="gui_freetype_font.cpp" open="0" top="0" tabpos="24" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="792" topLine="0" />
</Cursor>
</File>
<File name="rc_steam_lib.h" open="0" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1942" topLine="71" />
</Cursor>
</File>
<File name="../../irrBullet/src/irrBulletcommon.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="924" topLine="6" />
</Cursor>
</File>
<File name="rc_net.h" open="0" top="0" tabpos="13" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="3769" topLine="186" />
</Cursor>
</File>
<File name="camera.h" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="4758" topLine="241" />
</Cursor>
</File>
<File name="ProjectiveTextures.h" open="0" top="0" tabpos="34" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="110" topLine="0" />
</Cursor>
</File>
<File name="CShader.h" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1204" topLine="34" />
</Cursor>
</File>
<File name="rc_media.h" open="0" top="0" tabpos="17" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="72119" topLine="1937" />
</Cursor>
</File>
<File name="rc_steam.h" open="0" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="854" topLine="0" />
</Cursor>
</File>
<File name="rc_joints.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="310" topLine="0" />
</Cursor>
</File>
<File name="CShader.cpp" open="1" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1032" topLine="31" />
</Cursor>
</File>
<File name="rc_sprite2D.h" open="1" top="0" tabpos="14" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="558" topLine="2" />
</Cursor>
</File>
<File name="rc_font.h" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="0" topLine="0" />
</Cursor>
</File>
<File name="main.cpp" open="1" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="132313" topLine="4388" />
</Cursor>
</File>
<File name="rc_mesh.h" open="0" top="0" tabpos="16" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1830" topLine="71" />
</Cursor>
</File>
<File name="rc_os_defines.h" open="1" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="93" topLine="0" />
</Cursor>
</File>
<File name="gui_freetype_font.h" open="0" top="0" tabpos="23" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="183" topLine="0" />
</Cursor>
</File>
<File name="rc_gfx.h" open="1" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="27507" topLine="1044" />
</Cursor>
</File>
<File name="rc_actor_material.h" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="751" topLine="1310" />
</Cursor>
</File>
<File name="../../irrBullet/include/irrBulletTriangleMeshShape.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="366" topLine="0" />
</Cursor>
</File>
<File name="rc_matrix.h" open="0" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="34977" topLine="1288" />
</Cursor>
</File>
<File name="rc_windowclose.h" open="1" top="0" tabpos="16" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="22534" topLine="595" />
</Cursor>
</File>
<File name="rc_constraint.h" open="0" top="0" tabpos="15" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="8391" topLine="231" />
</Cursor>
</File>
<File name="rc_base_actor.h" open="1" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="4146" topLine="113" />
</Cursor>
</File>
<File name="rc_video.h" open="0" top="0" tabpos="21" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="169" topLine="6" />
</Cursor>
</File>
<File name="rc_test.h" open="0" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="115" topLine="0" />
</Cursor>
</File>
<File name="rc_fx_shaders.h" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="178" topLine="769" />
</Cursor>
</File>
<File name="../../irrBullet/include/irrBulletBvhTriangleMeshShape.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1301" topLine="20" />
</Cursor>
</File>
<File name="rc_particles.h" open="0" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="6262" topLine="615" />
</Cursor>
</File>
<File name="rc_gfx3D.h" open="0" top="0" tabpos="14" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="565" topLine="0" />
</Cursor>
</File>
<File name="rc_scene.h" open="0" top="0" tabpos="30" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1298" topLine="28" />
<Cursor1 position="6152" topLine="0" />
</Cursor>
</File>
</CodeBlocks_layout_file>