Thread: [Python-ogre-commit] SF.net SVN: python-ogre:[775] trunk/python-ogre (Page 3)
Brought to you by:
andy_miller,
roman_yakovenko
From: <and...@us...> - 2008-10-27 06:40:36
|
Revision: 775 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=775&view=rev Author: andy_miller Date: 2008-10-27 06:40:23 +0000 (Mon, 27 Oct 2008) Log Message: ----------- Preparing to implement Hydrax 0.4 Updated media for OgreForests Modified Paths: -------------- trunk/python-ogre/demos/ogreforests/media/grass/grass.material trunk/python-ogre/demos/ogreforests/media/terrains/terrain.cfg trunk/python-ogre/demos/ogreforests/media/trees/tree.material trunk/python-ogre/environment.py Added Paths: ----------- trunk/python-ogre/ThirdParty/Hydrax_0.3/ trunk/python-ogre/demos/ogreforests/media/terrain2/ trunk/python-ogre/demos/ogreforests/media/terrain2/densitymap.png trunk/python-ogre/demos/ogreforests/media/terrain2/terrain.cfg trunk/python-ogre/demos/ogreforests/media/terrain2/terrain.png trunk/python-ogre/demos/ogreforests/media/terrain2/terrain2.cfg trunk/python-ogre/demos/ogreforests/media/terrain2/terrain_detail.jpg trunk/python-ogre/demos/ogreforests/media/terrain2/terrain_lightmap.jpg trunk/python-ogre/demos/ogreforests/media/terrain2/terrain_texture2.jpg trunk/python-ogre/demos/ogreforests/media/trees2/ trunk/python-ogre/demos/ogreforests/media/trees2/3d-diggers_fir.material trunk/python-ogre/demos/ogreforests/media/trees2/3ddsky_0001.jpg trunk/python-ogre/demos/ogreforests/media/trees2/3ddsky_0002.jpg trunk/python-ogre/demos/ogreforests/media/trees2/3ddsky_0003.jpg trunk/python-ogre/demos/ogreforests/media/trees2/3ddsky_0004.jpg trunk/python-ogre/demos/ogreforests/media/trees2/3ddsky_0005.jpg trunk/python-ogre/demos/ogreforests/media/trees2/3ddsky_0006.jpg trunk/python-ogre/demos/ogreforests/media/trees2/3ddsky_0007.jpg trunk/python-ogre/demos/ogreforests/media/trees2/__ReadMe__.txt trunk/python-ogre/demos/ogreforests/media/trees2/farn01.png trunk/python-ogre/demos/ogreforests/media/trees2/farn02.png trunk/python-ogre/demos/ogreforests/media/trees2/farn1.mesh trunk/python-ogre/demos/ogreforests/media/trees2/farn1.mesh.material trunk/python-ogre/demos/ogreforests/media/trees2/farn2.mesh trunk/python-ogre/demos/ogreforests/media/trees2/farn2.mesh.material trunk/python-ogre/demos/ogreforests/media/trees2/fir01.png trunk/python-ogre/demos/ogreforests/media/trees2/fir02.jpg trunk/python-ogre/demos/ogreforests/media/trees2/fir05_30.mesh trunk/python-ogre/demos/ogreforests/media/trees2/fir06_30.mesh trunk/python-ogre/demos/ogreforests/media/trees2/fir14_25.mesh trunk/python-ogre/demos/ogreforests/media/trees2/plant1.mesh trunk/python-ogre/demos/ogreforests/media/trees2/plant1.mesh.material trunk/python-ogre/demos/ogreforests/media/trees2/plant1.png trunk/python-ogre/demos/ogreforests/media/trees2/plant2.mesh trunk/python-ogre/demos/ogreforests/media/trees2/plant2.mesh.material trunk/python-ogre/demos/ogreforests/media/trees2/plant2.png trunk/python-ogre/demos/ogreforests/media/trees2/shroom1.png trunk/python-ogre/demos/ogreforests/media/trees2/shroom1_1.mesh trunk/python-ogre/demos/ogreforests/media/trees2/shroom1_2.mesh trunk/python-ogre/demos/ogreforests/media/trees2/shroom1_3.mesh trunk/python-ogre/demos/ogreforests/media/trees2/shroom2.png trunk/python-ogre/demos/ogreforests/media/trees2/shroom2_1.mesh trunk/python-ogre/demos/ogreforests/media/trees2/shroom2_2.mesh trunk/python-ogre/demos/ogreforests/media/trees2/shroom2_3.mesh trunk/python-ogre/demos/ogreforests/media/trees2/shrooms.material trunk/python-ogre/demos/ogreforests/media/trees2/skybox.material Removed Paths: ------------- trunk/python-ogre/ThirdParty/Hydrax/ Modified: trunk/python-ogre/demos/ogreforests/media/grass/grass.material =================================================================== --- trunk/python-ogre/demos/ogreforests/media/grass/grass.material 2008-10-26 11:33:26 UTC (rev 774) +++ trunk/python-ogre/demos/ogreforests/media/grass/grass.material 2008-10-27 06:40:23 UTC (rev 775) @@ -1,20 +1,20 @@ -material grass -{ - technique - { - pass - { - //lighting off - cull_hardware none - cull_software none - scene_blend alpha_blend - alpha_rejection greater_equal 128 - //depth_write off - - texture_unit - { - texture grass2.png - } - } - } -} \ No newline at end of file +material grass +{ + technique + { + pass + { + //lighting off + cull_hardware none + cull_software none + scene_blend alpha_blend + alpha_rejection greater_equal 128 + //depth_write off + + texture_unit + { + texture grass2.png + } + } + } +} Added: trunk/python-ogre/demos/ogreforests/media/terrain2/densitymap.png =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/ogreforests/media/terrain2/densitymap.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/ogreforests/media/terrain2/terrain.cfg =================================================================== --- trunk/python-ogre/demos/ogreforests/media/terrain2/terrain.cfg (rev 0) +++ trunk/python-ogre/demos/ogreforests/media/terrain2/terrain.cfg 2008-10-27 06:40:23 UTC (rev 775) @@ -0,0 +1,71 @@ +# The main world texture (if you wish the terrain manager to create a material for you) +WorldTexture=terrain_texture.jpg + +# The detail texture (if you wish the terrain manager to create a material for you) +DetailTexture=terrain_detail.jpg + +#number of times the detail texture will tile in a terrain tile +DetailTile=5 + +# Heightmap source +PageSource=Heightmap + +# Heightmap-source specific settings +Heightmap.image=terrain.png + +# If you use RAW, fill in the below too +# RAW-specific setting - size (horizontal/vertical) +#Heightmap.raw.size=513 +# RAW-specific setting - bytes per pixel (1 = 8bit, 2=16bit) +#Heightmap.raw.bpp=2 + +# How large is a page of tiles (in vertices)? Must be (2^n)+1 +PageSize=513 + +# How large is each tile? Must be (2^n)+1 and be smaller than PageSize +TileSize=65 + +# The maximum error allowed when determining which LOD to use +MaxPixelError=3 + +# The size of a terrain page, in world units +PageWorldX=1500 +PageWorldZ=1500 +# Maximum height of the terrain +MaxHeight=100 + +# Upper LOD limit +MaxMipMapLevel=5 + +#VertexNormals=yes +#VertexColors=yes +#UseTriStrips=yes + +# Use vertex program to morph LODs, if available +VertexProgramMorph=yes + +# The proportional distance range at which the LOD morph starts to take effect +# This is as a proportion of the distance between the current LODs effective range, +# and the effective range of the next lower LOD +LODMorphStart=0.2 + +# This following section is for if you want to provide your own terrain shading routine +# Note that since you define your textures within the material this makes the +# WorldTexture and DetailTexture settings redundant + +# The name of the vertex program parameter you wish to bind the morph LOD factor to +# this is 0 when there is no adjustment (highest) to 1 when the morph takes it completely +# to the same position as the next lower LOD +# USE THIS IF YOU USE HIGH-LEVEL VERTEX PROGRAMS WITH LOD MORPHING +#MorphLODFactorParamName=morphFactor + +# The index of the vertex program parameter you wish to bind the morph LOD factor to +# this is 0 when there is no adjustment (highest) to 1 when the morph takes it completely +# to the same position as the next lower LOD +# USE THIS IF YOU USE ASSEMBLER VERTEX PROGRAMS WITH LOD MORPHING +#MorphLODFactorParamIndex=4 + +# The name of the material you will define to shade the terrain +#CustomMaterialName=TestTerrainMaterial + + Added: trunk/python-ogre/demos/ogreforests/media/terrain2/terrain.png =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/ogreforests/media/terrain2/terrain.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/ogreforests/media/terrain2/terrain2.cfg =================================================================== --- trunk/python-ogre/demos/ogreforests/media/terrain2/terrain2.cfg (rev 0) +++ trunk/python-ogre/demos/ogreforests/media/terrain2/terrain2.cfg 2008-10-27 06:40:23 UTC (rev 775) @@ -0,0 +1,71 @@ +# The main world texture (if you wish the terrain manager to create a material for you) +WorldTexture=terrain_texture2.jpg + +# The detail texture (if you wish the terrain manager to create a material for you) +DetailTexture=terrain_detail.jpg + +#number of times the detail texture will tile in a terrain tile +DetailTile=5 + +# Heightmap source +PageSource=Heightmap + +# Heightmap-source specific settings +Heightmap.image=terrain.png + +# If you use RAW, fill in the below too +# RAW-specific setting - size (horizontal/vertical) +#Heightmap.raw.size=513 +# RAW-specific setting - bytes per pixel (1 = 8bit, 2=16bit) +#Heightmap.raw.bpp=2 + +# How large is a page of tiles (in vertices)? Must be (2^n)+1 +PageSize=513 + +# How large is each tile? Must be (2^n)+1 and be smaller than PageSize +TileSize=65 + +# The maximum error allowed when determining which LOD to use +MaxPixelError=3 + +# The size of a terrain page, in world units +PageWorldX=1500 +PageWorldZ=1500 +# Maximum height of the terrain +MaxHeight=100 + +# Upper LOD limit +MaxMipMapLevel=5 + +#VertexNormals=yes +#VertexColors=yes +#UseTriStrips=yes + +# Use vertex program to morph LODs, if available +VertexProgramMorph=yes + +# The proportional distance range at which the LOD morph starts to take effect +# This is as a proportion of the distance between the current LODs effective range, +# and the effective range of the next lower LOD +LODMorphStart=0.2 + +# This following section is for if you want to provide your own terrain shading routine +# Note that since you define your textures within the material this makes the +# WorldTexture and DetailTexture settings redundant + +# The name of the vertex program parameter you wish to bind the morph LOD factor to +# this is 0 when there is no adjustment (highest) to 1 when the morph takes it completely +# to the same position as the next lower LOD +# USE THIS IF YOU USE HIGH-LEVEL VERTEX PROGRAMS WITH LOD MORPHING +#MorphLODFactorParamName=morphFactor + +# The index of the vertex program parameter you wish to bind the morph LOD factor to +# this is 0 when there is no adjustment (highest) to 1 when the morph takes it completely +# to the same position as the next lower LOD +# USE THIS IF YOU USE ASSEMBLER VERTEX PROGRAMS WITH LOD MORPHING +#MorphLODFactorParamIndex=4 + +# The name of the material you will define to shade the terrain +#CustomMaterialName=TestTerrainMaterial + + Added: trunk/python-ogre/demos/ogreforests/media/terrain2/terrain_detail.jpg =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/ogreforests/media/terrain2/terrain_detail.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/ogreforests/media/terrain2/terrain_lightmap.jpg =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/ogreforests/media/terrain2/terrain_lightmap.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/ogreforests/media/terrain2/terrain_texture2.jpg =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/ogreforests/media/terrain2/terrain_texture2.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/python-ogre/demos/ogreforests/media/terrains/terrain.cfg =================================================================== --- trunk/python-ogre/demos/ogreforests/media/terrains/terrain.cfg 2008-10-26 11:33:26 UTC (rev 774) +++ trunk/python-ogre/demos/ogreforests/media/terrains/terrain.cfg 2008-10-27 06:40:23 UTC (rev 775) @@ -1,71 +1,71 @@ -# The main world texture (if you wish the terrain manager to create a material for you) -WorldTexture=terrain_texture.jpg - -# The detail texture (if you wish the terrain manager to create a material for you) -DetailTexture=terrain_detail.jpg - -#number of times the detail texture will tile in a terrain tile -DetailTile=5 - -# Heightmap source -PageSource=Heightmap - -# Heightmap-source specific settings -Heightmap.image=terrain.png - -# If you use RAW, fill in the below too -# RAW-specific setting - size (horizontal/vertical) -#Heightmap.raw.size=513 -# RAW-specific setting - bytes per pixel (1 = 8bit, 2=16bit) -#Heightmap.raw.bpp=2 - -# How large is a page of tiles (in vertices)? Must be (2^n)+1 -PageSize=513 - -# How large is each tile? Must be (2^n)+1 and be smaller than PageSize -TileSize=65 - -# The maximum error allowed when determining which LOD to use -MaxPixelError=3 - -# The size of a terrain page, in world units -PageWorldX=1500 -PageWorldZ=1500 -# Maximum height of the terrain -MaxHeight=100 - -# Upper LOD limit -MaxMipMapLevel=5 - -#VertexNormals=yes -#VertexColors=yes -#UseTriStrips=yes - -# Use vertex program to morph LODs, if available -VertexProgramMorph=yes - -# The proportional distance range at which the LOD morph starts to take effect -# This is as a proportion of the distance between the current LODs effective range, -# and the effective range of the next lower LOD -LODMorphStart=0.2 - -# This following section is for if you want to provide your own terrain shading routine -# Note that since you define your textures within the material this makes the -# WorldTexture and DetailTexture settings redundant - -# The name of the vertex program parameter you wish to bind the morph LOD factor to -# this is 0 when there is no adjustment (highest) to 1 when the morph takes it completely -# to the same position as the next lower LOD -# USE THIS IF YOU USE HIGH-LEVEL VERTEX PROGRAMS WITH LOD MORPHING -#MorphLODFactorParamName=morphFactor - -# The index of the vertex program parameter you wish to bind the morph LOD factor to -# this is 0 when there is no adjustment (highest) to 1 when the morph takes it completely -# to the same position as the next lower LOD -# USE THIS IF YOU USE ASSEMBLER VERTEX PROGRAMS WITH LOD MORPHING -#MorphLODFactorParamIndex=4 - -# The name of the material you will define to shade the terrain -#CustomMaterialName=TestTerrainMaterial - - +# The main world texture (if you wish the terrain manager to create a material for you) +WorldTexture=terrain_texture.jpg + +# The detail texture (if you wish the terrain manager to create a material for you) +DetailTexture=terrain_detail.jpg + +#number of times the detail texture will tile in a terrain tile +DetailTile=5 + +# Heightmap source +PageSource=Heightmap + +# Heightmap-source specific settings +Heightmap.image=terrain.png + +# If you use RAW, fill in the below too +# RAW-specific setting - size (horizontal/vertical) +#Heightmap.raw.size=513 +# RAW-specific setting - bytes per pixel (1 = 8bit, 2=16bit) +#Heightmap.raw.bpp=2 + +# How large is a page of tiles (in vertices)? Must be (2^n)+1 +PageSize=513 + +# How large is each tile? Must be (2^n)+1 and be smaller than PageSize +TileSize=65 + +# The maximum error allowed when determining which LOD to use +MaxPixelError=3 + +# The size of a terrain page, in world units +PageWorldX=1500 +PageWorldZ=1500 +# Maximum height of the terrain +MaxHeight=100 + +# Upper LOD limit +MaxMipMapLevel=5 + +#VertexNormals=yes +#VertexColors=yes +#UseTriStrips=yes + +# Use vertex program to morph LODs, if available +VertexProgramMorph=yes + +# The proportional distance range at which the LOD morph starts to take effect +# This is as a proportion of the distance between the current LODs effective range, +# and the effective range of the next lower LOD +LODMorphStart=0.2 + +# This following section is for if you want to provide your own terrain shading routine +# Note that since you define your textures within the material this makes the +# WorldTexture and DetailTexture settings redundant + +# The name of the vertex program parameter you wish to bind the morph LOD factor to +# this is 0 when there is no adjustment (highest) to 1 when the morph takes it completely +# to the same position as the next lower LOD +# USE THIS IF YOU USE HIGH-LEVEL VERTEX PROGRAMS WITH LOD MORPHING +#MorphLODFactorParamName=morphFactor + +# The index of the vertex program parameter you wish to bind the morph LOD factor to +# this is 0 when there is no adjustment (highest) to 1 when the morph takes it completely +# to the same position as the next lower LOD +# USE THIS IF YOU USE ASSEMBLER VERTEX PROGRAMS WITH LOD MORPHING +#MorphLODFactorParamIndex=4 + +# The name of the material you will define to shade the terrain +#CustomMaterialName=TestTerrainMaterial + + Modified: trunk/python-ogre/demos/ogreforests/media/trees/tree.material =================================================================== --- trunk/python-ogre/demos/ogreforests/media/trees/tree.material 2008-10-26 11:33:26 UTC (rev 774) +++ trunk/python-ogre/demos/ogreforests/media/trees/tree.material 2008-10-27 06:40:23 UTC (rev 775) @@ -1,47 +1,59 @@ -material SOLID/TEX/wood7.jpg -{ - technique - { - pass - { - texture_unit - { - texture wood7.jpg - } - } - } -} - -material SOLID/TEX/Leaves.png -{ - technique - { - pass - { - cull_hardware none - alpha_rejection greater_equal 128 - - texture_unit - { - texture leaves.png alpha - } - } - } -} - -material SOLID/TEX/PineLeaves.png -{ - technique - { - pass - { - cull_hardware none - alpha_rejection greater_equal 128 - - texture_unit - { - texture pineleaves.png alpha - } - } - } -} +material SOLID/TEX/wood7.jpg +{ + technique + { + pass + { + ambient 0.4 0.4 0.4 1 + diffuse 1 1 1 1 + + scene_blend alpha_blend + + texture_unit + { + texture wood7.jpg + } + } + } +} + +material SOLID/TEX/Leaves.png +{ + technique + { + pass + { + ambient 0.5 0.5 0.5 1 + diffuse 0.6 0.6 0.6 1 + + cull_hardware none + alpha_rejection greater_equal 128 + //scene_blend alpha_blend + + texture_unit + { + texture Leaves.png alpha + } + } + } +} + +material SOLID/TEX/PineLeaves.png +{ + technique + { + pass + { + ambient 0.5 0.5 0.5 1 + diffuse 0.6 0.6 0.6 1 + + cull_hardware none + alpha_rejection greater_equal 128 + + texture_unit + { + texture PineLeaves.png alpha + } + } + } +} Added: trunk/python-ogre/demos/ogreforests/media/trees2/3d-diggers_fir.material =================================================================== --- trunk/python-ogre/demos/ogreforests/media/trees2/3d-diggers_fir.material (rev 0) +++ trunk/python-ogre/demos/ogreforests/media/trees2/3d-diggers_fir.material 2008-10-27 06:40:23 UTC (rev 775) @@ -0,0 +1,37 @@ + +material 3D-Diggers/fir01 +{ + technique Default + { + pass Main + { + ambient 0.5 0.5 0.5 1 + diffuse 0.6 0.6 0.6 1 + + alpha_rejection greater_equal 128 + + texture_unit + { + texture fir01.png alpha + } + } + } +} + +material 3D-Diggers/fir02 +{ + technique Default + { + pass Main + { + ambient 0.5 0.5 0.5 1 + diffuse 0.6 0.6 0.6 1 + + texture_unit + { + texture_alias diffuse + texture fir02.jpg -1 + } + } + } +} \ No newline at end of file Added: trunk/python-ogre/demos/ogreforests/media/trees2/3ddsky_0001.jpg =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/ogreforests/media/trees2/3ddsky_0001.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/ogreforests/media/trees2/3ddsky_0002.jpg =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/ogreforests/media/trees2/3ddsky_0002.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/ogreforests/media/trees2/3ddsky_0003.jpg =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/ogreforests/media/trees2/3ddsky_0003.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/ogreforests/media/trees2/3ddsky_0004.jpg =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/ogreforests/media/trees2/3ddsky_0004.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/ogreforests/media/trees2/3ddsky_0005.jpg =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/ogreforests/media/trees2/3ddsky_0005.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/ogreforests/media/trees2/3ddsky_0006.jpg =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/ogreforests/media/trees2/3ddsky_0006.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/ogreforests/media/trees2/3ddsky_0007.jpg =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/ogreforests/media/trees2/3ddsky_0007.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/ogreforests/media/trees2/__ReadMe__.txt =================================================================== --- trunk/python-ogre/demos/ogreforests/media/trees2/__ReadMe__.txt (rev 0) +++ trunk/python-ogre/demos/ogreforests/media/trees2/__ReadMe__.txt 2008-10-27 06:40:23 UTC (rev 775) @@ -0,0 +1,22 @@ +////////////////////////////////////////////////////////// +// "Veggies for the people" // +// (c) 3D-Diggers 2008 // +// Author: Christian Herzog // +// Web: www.3d-diggers.de // +////////////////////////////////////////////////////////// + ++--------------------------------------------------------+ +| License: | ++--------------------------------------------------------+ +"Do what you want" + +This is a free give away from the 3D-Diggers. +You can use it in any project you want (commercial, non-commercial, etc.). + + +I'd be happy though, if anybody using it, could send me a link to the project or so! (just to know IF this is actually being used... ;) ) +But again, you don't have to. +My email is Gi...@gm.... + +If you want to see more, drop by on our homepage: www.3d-diggers.de. +(you get the full fir pack there, which can easily be exported for OGRE as you can see) \ No newline at end of file Added: trunk/python-ogre/demos/ogreforests/media/trees2/farn01.png =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/ogreforests/media/trees2/farn01.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/ogreforests/media/trees2/farn02.png =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/ogreforests/media/trees2/farn02.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/ogreforests/media/trees2/farn1.mesh =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/ogreforests/media/trees2/farn1.mesh ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/ogreforests/media/trees2/farn1.mesh.material =================================================================== --- trunk/python-ogre/demos/ogreforests/media/trees2/farn1.mesh.material (rev 0) +++ trunk/python-ogre/demos/ogreforests/media/trees2/farn1.mesh.material 2008-10-27 06:40:23 UTC (rev 775) @@ -0,0 +1,18 @@ +material 3D-Diggers/farn01 +{ + technique Default + { + pass Main + { + ambient 0.5 0.5 0.5 1 + diffuse 0.6 0.6 0.6 1 + + alpha_rejection greater_equal 128 + + texture_unit + { + texture farn01.png alpha + } + } + } +} Added: trunk/python-ogre/demos/ogreforests/media/trees2/farn2.mesh =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/ogreforests/media/trees2/farn2.mesh ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/ogreforests/media/trees2/farn2.mesh.material =================================================================== --- trunk/python-ogre/demos/ogreforests/media/trees2/farn2.mesh.material (rev 0) +++ trunk/python-ogre/demos/ogreforests/media/trees2/farn2.mesh.material 2008-10-27 06:40:23 UTC (rev 775) @@ -0,0 +1,18 @@ +material 3D-Diggers/farn02 +{ + technique Default + { + pass Main + { + ambient 0.5 0.5 0.5 1 + diffuse 0.6 0.6 0.6 1 + + alpha_rejection greater_equal 128 + + texture_unit + { + texture farn02.png alpha + } + } + } +} Added: trunk/python-ogre/demos/ogreforests/media/trees2/fir01.png =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/ogreforests/media/trees2/fir01.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/ogreforests/media/trees2/fir02.jpg =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/ogreforests/media/trees2/fir02.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/ogreforests/media/trees2/fir05_30.mesh =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/ogreforests/media/trees2/fir05_30.mesh ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/ogreforests/media/trees2/fir06_30.mesh =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/ogreforests/media/trees2/fir06_30.mesh ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/ogreforests/media/trees2/fir14_25.mesh =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/ogreforests/media/trees2/fir14_25.mesh ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/ogreforests/media/trees2/plant1.mesh =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/ogreforests/media/trees2/plant1.mesh ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/ogreforests/media/trees2/plant1.mesh.material =================================================================== --- trunk/python-ogre/demos/ogreforests/media/trees2/plant1.mesh.material (rev 0) +++ trunk/python-ogre/demos/ogreforests/media/trees2/plant1.mesh.material 2008-10-27 06:40:23 UTC (rev 775) @@ -0,0 +1,40 @@ +material 3D-Diggers/plant1 +{ + technique Default + { + pass Main + { + ambient 0.5 0.5 0.5 1 + diffuse 0.6 0.6 0.6 1 + + alpha_rejection greater_equal 128 + + texture_unit + { + texture plant1.png alpha + } + } + } +} + +material 3D-Diggers/plant1sprite +{ + technique Default + { + pass Main + { + cull_hardware none + cull_software none + + ambient 0.5 0.5 0.5 1 + diffuse 0.6 0.6 0.6 1 + + alpha_rejection greater_equal 128 + + texture_unit + { + texture plant1.png alpha + } + } + } +} \ No newline at end of file Added: trunk/python-ogre/demos/ogreforests/media/trees2/plant1.png =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/ogreforests/media/trees2/plant1.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/ogreforests/media/trees2/plant2.mesh =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/ogreforests/media/trees2/plant2.mesh ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/ogreforests/media/trees2/plant2.mesh.material =================================================================== --- trunk/python-ogre/demos/ogreforests/media/trees2/plant2.mesh.material (rev 0) +++ trunk/python-ogre/demos/ogreforests/media/trees2/plant2.mesh.material 2008-10-27 06:40:23 UTC (rev 775) @@ -0,0 +1,18 @@ +material 3D-Diggers/plant2 +{ + technique Default + { + pass Main + { + ambient 0.5 0.5 0.5 1 + diffuse 0.6 0.6 0.6 1 + + alpha_rejection greater_equal 128 + + texture_unit + { + texture plant2.png alpha + } + } + } +} Added: trunk/python-ogre/demos/ogreforests/media/trees2/plant2.png =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/ogreforests/media/trees2/plant2.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/ogreforests/media/trees2/shroom1.png =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/ogreforests/media/trees2/shroom1.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/ogreforests/media/trees2/shroom1_1.mesh =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/ogreforests/media/trees2/shroom1_1.mesh ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/ogreforests/media/trees2/shroom1_2.mesh =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/ogreforests/media/trees2/shroom1_2.mesh ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/ogreforests/media/trees2/shroom1_3.mesh =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/ogreforests/media/trees2/shroom1_3.mesh ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/ogreforests/media/trees2/shroom2.png =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/ogreforests/media/trees2/shroom2.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/ogreforests/media/trees2/shroom2_1.mesh =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/ogreforests/media/trees2/shroom2_1.mesh ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/ogreforests/media/trees2/shroom2_2.mesh =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/ogreforests/media/trees2/shroom2_2.mesh ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/ogreforests/media/trees2/shroom2_3.mesh =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/ogreforests/media/trees2/shroom2_3.mesh ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/ogreforests/media/trees2/shrooms.material =================================================================== --- trunk/python-ogre/demos/ogreforests/media/trees2/shrooms.material (rev 0) +++ trunk/python-ogre/demos/ogreforests/media/trees2/shrooms.material 2008-10-27 06:40:23 UTC (rev 775) @@ -0,0 +1,37 @@ +material 3D-Diggers/shroom1 +{ + technique Default + { + pass Main + { + ambient 0.5 0.5 0.5 1 + diffuse 0.6 0.6 0.6 1 + + alpha_rejection greater_equal 128 + + texture_unit + { + texture shroom1.png alpha + } + } + } +} + +material 3D-Diggers/shroom2 +{ + technique Default + { + pass Main + { + ambient 0.5 0.5 0.5 1 + diffuse 0.6 0.6 0.6 1 + + alpha_rejection greater_equal 128 + + texture_unit + { + texture shroom2.png alpha + } + } + } +} Added: trunk/python-ogre/demos/ogreforests/media/trees2/skybox.material =================================================================== --- trunk/python-ogre/demos/ogreforests/media/trees2/skybox.material (rev 0) +++ trunk/python-ogre/demos/ogreforests/media/trees2/skybox.material 2008-10-27 06:40:23 UTC (rev 775) @@ -0,0 +1,18 @@ +material 3D-Diggers/SkyBox +{ + technique + { + pass + { + fog_override true none + lighting off + depth_write off + + texture_unit + { + cubic_texture 3ddsky_0001.jpg 3ddsky_0003.jpg 3ddsky_0004.jpg 3ddsky_0002.jpg 3ddsky_0005.jpg 3ddsky_0006.jpg separateUV + tex_address_mode clamp + } + } + } +} \ No newline at end of file Modified: trunk/python-ogre/environment.py =================================================================== --- trunk/python-ogre/environment.py 2008-10-26 11:33:26 UTC (rev 774) +++ trunk/python-ogre/environment.py 2008-10-27 06:40:23 UTC (rev 775) @@ -1137,7 +1137,7 @@ class ogreforests: active = True pythonModule = True - version="r2491" + version="r2504" name='ogreforests' parent="ogre/addons" CCFLAGS = ' ' # -D"FT2_BUILD_LIBRARY" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2008-10-30 06:06:02
|
Revision: 783 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=783&view=rev Author: andy_miller Date: 2008-10-30 06:06:00 +0000 (Thu, 30 Oct 2008) Log Message: ----------- Getting ready for next release - implemented threading in Ogre build Modified Paths: -------------- trunk/python-ogre/PythonOgreConfig_nt.py trunk/python-ogre/PythonOgreConfig_posix.py trunk/python-ogre/code_generators/caelum/generate_code.py trunk/python-ogre/code_generators/ogre/generate_code.py trunk/python-ogre/demos/ogreal/Demo_AL_01.py trunk/python-ogre/environment.py trunk/python-ogre/packages_2.5/ogre/renderer/OGRE/sf_OIS.py Modified: trunk/python-ogre/PythonOgreConfig_nt.py =================================================================== --- trunk/python-ogre/PythonOgreConfig_nt.py 2008-10-30 03:21:08 UTC (rev 782) +++ trunk/python-ogre/PythonOgreConfig_nt.py 2008-10-30 06:06:00 UTC (rev 783) @@ -44,7 +44,7 @@ PATH_ODE = os.path.join(BASE_DIR, 'ode-0.10.1') PATH_OGG = os.path.join(BASE_DIR, 'ogg') PATH_VORBIS= os.path.join(BASE_DIR, 'vorbis') -PATH_OPENAL= os.path.join(BASE_DIR, 'openal') +PATH_OPENAL= os.path.join(BASE_DIR, 'openal-soft-1.5.304') #'openal') PATH_OgreOde= os.path.join(BASE_DIR, PATH_OgreAddons,'ogreode') # # PATH_OgreBullet= os.path.join(PATH_OgreAddons,'ogrebullet') # # PATH_ogreforests= os.path.join(PATH_OgreAddons,'forests') @@ -133,6 +133,7 @@ PATH_INCLUDE_Ogre= os.path.join(PATH_Ogre,'OgreMain/include') +PATH_INCLUDE_NEDMALLOC= os.path.join(PATH_Ogre,'OgreMain', 'src', 'nedmalloc') PATH_INCLUDE_Ogre_Dependencies = os.path.join( PATH_Ogre, 'Dependencies/include') PATH_INCLUDE_OIS = os.path.join(PATH_OIS,'includes') ## Note the plural include's PATH_INCLUDE_OgreRefApp = os.path.join(PATH_Ogre,'ReferenceApplication/ReferenceAppLayer/include') Modified: trunk/python-ogre/PythonOgreConfig_posix.py =================================================================== --- trunk/python-ogre/PythonOgreConfig_posix.py 2008-10-30 03:21:08 UTC (rev 782) +++ trunk/python-ogre/PythonOgreConfig_posix.py 2008-10-30 06:06:00 UTC (rev 783) @@ -50,7 +50,7 @@ PATH_ODE = os.path.join(BASE_DIR, 'ode-0.9') PATH_OGG = os.path.join(BASE_DIR, 'libogg-1.1.3') PATH_VORBIS= os.path.join(BASE_DIR, 'libvorbis-1.2.0') -PATH_OPENAL= os.path.join(BASE_DIR, 'openal-0.0.8') +PATH_OPENAL= os.path.join(BASE_DIR, 'openal-soft-1.5.304') PATH_OgreOde= os.path.join(PATH_OgreAddons,'ogreode') PATH_OgreBullet= os.path.join(PATH_THIRDPARTY,'ogrebullet') Modified: trunk/python-ogre/code_generators/caelum/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/caelum/generate_code.py 2008-10-30 03:21:08 UTC (rev 782) +++ trunk/python-ogre/code_generators/caelum/generate_code.py 2008-10-30 06:06:00 UTC (rev 783) @@ -85,8 +85,8 @@ else: main_ns = global_ns - global_ns.namespace( 'Ogre' ).class_('FrameListener').include(already_exposed=True) - global_ns.namespace( 'Ogre' ).class_('RenderTargetListener').include(already_exposed=True) +# # global_ns.namespace( 'Ogre' ).class_('FrameListener').include(already_exposed=True) +# # global_ns.namespace( 'Ogre' ).class_('RenderTargetListener').include(already_exposed=True) ############################################################ ## @@ -221,30 +221,30 @@ # the 'main'function # def generate_code(): - messages.disable( -# Warnings 1020 - 1031 are all about why Py++ generates wrapper for class X - messages.W1020 - , messages.W1021 - , messages.W1022 - , messages.W1023 - , messages.W1024 - , messages.W1025 - , messages.W1026 - , messages.W1027 - , messages.W1028 - , messages.W1029 - , messages.W1030 - , messages.W1031 -# , messages.W1035 -# , messages.W1040 -# , messages.W1038 -# , messages.W1041 - , messages.W1036 # pointer to Python immutable member - , messages.W1033 # unnamed variables - , messages.W1018 # expose unnamed classes - , messages.W1049 # returns reference to local variable - , messages.W1014 # unsupported '=' operator - ) +# messages.disable( +# # Warnings 1020 - 1031 are all about why Py++ generates wrapper for class X +# messages.W1020 +# , messages.W1021 +# , messages.W1022 +# , messages.W1023 +# , messages.W1024 +# , messages.W1025 +# , messages.W1026 +# , messages.W1027 +# , messages.W1028 +# , messages.W1029 +# , messages.W1030 +# , messages.W1031 +# # , messages.W1035 +# # , messages.W1040 +# # , messages.W1038 +# # , messages.W1041 +# , messages.W1036 # pointer to Python immutable member +# , messages.W1033 # unnamed variables +# , messages.W1018 # expose unnamed classes +# , messages.W1049 # returns reference to local variable +# , messages.W1014 # unsupported '=' operator +# ) # # Use GCCXML to create the controlling XML file. # If the cache file (../cache/*.xml) doesn't exist it gets created, otherwise it just gets loaded Modified: trunk/python-ogre/code_generators/ogre/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/ogre/generate_code.py 2008-10-30 03:21:08 UTC (rev 782) +++ trunk/python-ogre/code_generators/ogre/generate_code.py 2008-10-30 06:06:00 UTC (rev 783) @@ -1064,13 +1064,18 @@ xml_cached_fc = parser.create_cached_source_fc( os.path.join( environment.ogre.root_dir, "python_ogre.h" ) , environment.ogre.cache_file ) - defined_symbols = [ 'OGRE_NONCLIENT_BUILD', 'OGRE_GCC_VISIBILITY'] + undefine_symbols=[] if environment._USE_THREADS: defined_symbols.append('BOOST_HAS_THREADS') defined_symbols.append('BOOST_HAS_WINTHREADS') defined_symbols.append( 'OGRE_VERSION_' + environment.ogre.version ) + print os.getcwd() + print environment.ogre.include_dirs + environment.ogre.include_dirs.insert ( 0,os.getcwd() ) + print environment.ogre.include_dirs + # # build the core Py++ system from the GCCXML created source # @@ -1079,6 +1084,7 @@ , working_directory=environment.root_dir , include_paths=environment.ogre.include_dirs , define_symbols=defined_symbols + , undefine_symbols=undefine_symbols , indexing_suite_version=2 , cflags=environment.ogre.cflags ) Modified: trunk/python-ogre/demos/ogreal/Demo_AL_01.py =================================================================== --- trunk/python-ogre/demos/ogreal/Demo_AL_01.py 2008-10-30 03:21:08 UTC (rev 782) +++ trunk/python-ogre/demos/ogreal/Demo_AL_01.py 2008-10-30 06:06:00 UTC (rev 783) @@ -81,12 +81,12 @@ self.mPlane = ogre.MovablePlane(name="ReflectPlane") self.mPlane.d = 0 - self.mPlane.normal =ogre.Vector3.UNIT_Y + self.mPlane.normal =ogre.Vector3().UNIT_Y ogre.MeshManager.getSingleton().createPlane("ReflectionPlane", ogre.ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME, self.mPlane, 2000.0, 2000.0, - 1, 1, True, 1, 1.0, 1.0, ogre.Vector3.UNIT_Z, + 1, 1, True, 1, 1.0, 1.0, ogre.Vector3().UNIT_Z, ogre.HardwareBuffer.HBU_STATIC_WRITE_ONLY, ogre.HardwareBuffer.HBU_STATIC_WRITE_ONLY, True,True ) @@ -150,15 +150,15 @@ # create ViewPort v = rttTex.addViewport( self.mReflectCam ) v.setClearEveryFrame ( True ) - v.setBackgroundColour (ogre.ColourValue.White) + v.setBackgroundColour (ogre.ColourValue().White) mat = ogre.MaterialManager.getSingleton().create("RttMat",ogre.ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME) t = mat.getTechnique(0).getPass(0).createTextureUnitState('RustedMetal.jpg') t = mat.getTechnique(0).getPass(0).createTextureUnitState('RttTex') # creates the reflection... # Blend with base texture t.setColourOperationEx( ogre.LBX_BLEND_MANUAL, ogre.LBS_TEXTURE, - ogre.LBS_CURRENT, ogre.ColourValue.White, - ogre.ColourValue.White, 0.25) + ogre.LBS_CURRENT, ogre.ColourValue().White, + ogre.ColourValue().White, 0.25) t.setTextureAddressingMode (ogre.TextureUnitState.TAM_CLAMP) t.setProjectiveTexturing(True, self.mReflectCam) Modified: trunk/python-ogre/environment.py =================================================================== --- trunk/python-ogre/environment.py 2008-10-30 03:21:08 UTC (rev 782) +++ trunk/python-ogre/environment.py 2008-10-30 06:06:00 UTC (rev 783) @@ -21,7 +21,7 @@ ## ## set this to True if you compiled Ogre with Threads enabled ## -_USE_THREADS = False +_USE_THREADS = True def log ( instring ): if _LOGGING_ON: @@ -615,6 +615,7 @@ ] include_dirs = [ Config.PATH_Boost , Config.PATH_INCLUDE_Ogre + , Config.PATH_INCLUDE_NEDMALLOC ] CCFLAGS = ' -DBOOST_PYTHON_MAX_ARITY=19 ' LINKFLAGS = '' @@ -1351,7 +1352,7 @@ ,os.path.join(Config.PATH_VORBIS, 'win32','Vorbis_Static_Release') ,os.path.join(Config.PATH_VORBIS, 'win32','VorbisEnc_Static_Release') ,os.path.join(Config.PATH_VORBIS, 'win32','VorbisFile_Static_Release') - ,os.path.join(Config.PATH_OPENAL, 'libs','Win32') + ,os.path.join(Config.PATH_OPENAL, 'Release' ) #'libs','Win32') ,Config.PATH_LIB_OgreAL ] CCFLAGS = ' -DWIN32 -DNDEBUG -D_LIB -D_WIN32 -D_WINDOWS ' #-DVORBIS_IEEE_FLOAT32 -D_USE_NON_INTEL_COMPILER ' @@ -1393,9 +1394,9 @@ [0, "tar zxf " + os.path.join(downloadPath, "libvorbis-1.2.0.tar.gz"), ''], [0, "./configure --prefix=%s\nmake\nmake install" % PREFIX, os.path.join(os.getcwd(), "libogg-1.1.3")], [0, "./configure --prefix=%s\nmake\nmake install" % PREFIX, os.path.join(os.getcwd(), "libvorbis-1.2.0")], - [0, "sed --in-place -s 's|( ALCvoid )|()|' alc.h",os.path.join(os.getcwd(),"openal-0.0.8","common", "include", "AL")], - [0, "aclocal\n./autogen.sh", os.path.join(os.getcwd(),"openal-0.0.8")], - [0, "./configure --prefix=%s\nmake\nmake install" % PREFIX, os.path.join(os.getcwd(), "openal-0.0.8")] +# [0, "sed --in-place -s 's|( ALCvoid )|()|' alc.h",os.path.join(os.getcwd(),"openal-0.0.8","common", "include", "AL")], +# [0, "aclocal\n./autogen.sh", os.path.join(os.getcwd(),"openal-0.0.8")], +# [0, "./configure --prefix=%s\nmake\nmake install" % PREFIX, os.path.join(os.getcwd(), "openal-0.0.8")] ] libs=[boost.lib, boost_python_index.lib, 'OgreMain', 'vorbisfile', #'ogg', Modified: trunk/python-ogre/packages_2.5/ogre/renderer/OGRE/sf_OIS.py =================================================================== --- trunk/python-ogre/packages_2.5/ogre/renderer/OGRE/sf_OIS.py 2008-10-30 03:21:08 UTC (rev 782) +++ trunk/python-ogre/packages_2.5/ogre/renderer/OGRE/sf_OIS.py 2008-10-30 06:06:00 UTC (rev 783) @@ -353,8 +353,6 @@ OIS.InputManager.destroyInputSystem(self.InputManager) self.InputManager=None - - ## NOTE the in Ogre 1.6 (1.7) this is changed to frameRenderingQueued !!! def frameRenderingQueued ( self, evt ): if(self.renderWindow.isClosed() or self.shouldQuit ): @@ -397,7 +395,6 @@ if not self.Mouse.buffered() or not self.Keyboard.buffered() or not buffJ: self._moveCamera() - return True This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2008-10-30 06:12:24
|
Revision: 784 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=784&view=rev Author: andy_miller Date: 2008-10-30 06:12:20 +0000 (Thu, 30 Oct 2008) Log Message: ----------- Updates for OgreAL on Linux Attempts to resolve Physx Issue on Linux (not yet successful) Modified Paths: -------------- trunk/python-ogre/ThirdParty/ogreal/OgreALPrereqs.h trunk/python-ogre/code_generators/physx/generate_code.py trunk/python-ogre/code_generators/physx/python_physx_aliases.h trunk/python-ogre/code_generators/physx/python_physx_sizeof.h trunk/python-ogre/demos/physx/physx_01.py trunk/python-ogre/demos/plugins.cfg trunk/python-ogre/environment.py Removed Paths: ------------- trunk/python-ogre/demos/ogreal/plugins.cfg Modified: trunk/python-ogre/ThirdParty/ogreal/OgreALPrereqs.h =================================================================== --- trunk/python-ogre/ThirdParty/ogreal/OgreALPrereqs.h 2008-10-30 06:06:00 UTC (rev 783) +++ trunk/python-ogre/ThirdParty/ogreal/OgreALPrereqs.h 2008-10-30 06:12:20 UTC (rev 784) @@ -53,8 +53,8 @@ # define OgreAL_Export // # endif #elif OGRE_COMPILER == OGRE_COMPILER_GNUC - # include "AL/al.h" - # include "AL/alc.h" + # include "al.h" + # include "alc.h" // # if defined(OGREAL_EXPORT) && OGRE_COMP_VER >= 400 // # define OgreAL_Export __attribute__ ((visibility("default"))) // # else Modified: trunk/python-ogre/code_generators/physx/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/physx/generate_code.py 2008-10-30 06:06:00 UTC (rev 783) +++ trunk/python-ogre/code_generators/physx/generate_code.py 2008-10-30 06:12:20 UTC (rev 784) @@ -62,7 +62,6 @@ excludes=[ '::NxArray<NxShapeDesc*, NxAllocatorDefault>::begin' ,'::NxArray< NxForceFieldShapeDesc*, NxAllocatorDefault >::resize' ,'::NxArray< NxForceFieldShapeGroup*, NxAllocatorDefault >::resize' - ,'::NxArray<NxFluidEmitterDesc, NxAllocatorDefault>::deleteEntry' ,'::NxArray<NxShapeDesc*, NxAllocatorDefault>::end' # ,'::NxCloth::overlapAABBTriangles' # ugly argument that boost doesn't like.. To Fix in hand wrappers # these have const refs to classes with protected desctuctors - a bad combination for boost @@ -79,6 +78,9 @@ ,'::NxVec3::isNotUsed' ] + if os.name =='nt': + excludes.append('::NxArray<NxFluidEmitterDesc, NxAllocatorDefault>::deleteEntry') + for e in excludes: print "excluding function", e global_ns.member_functions(e).exclude() @@ -92,7 +94,6 @@ global_ns.free_functions(e).exclude() excludes = ['NxArray<NxShapeDesc*, NxAllocatorDefault>', ## doesn't have a defult constructor for ElemType - 'NxArray<NxFluidEmitterDesc, NxAllocatorDefault>', ## needs ElemType changed to NxFluidEmitterDesc 'NxArray<NxForceFieldShapeDesc*, NxAllocatorDefault>', ## Elemtype issue 'NxArray<NxForceFieldShapeGroup*, NxAllocatorDefault>', ## Elemtype issue 'NxForceFieldShapeGroup' ## seems to have access issues.. @@ -100,6 +101,10 @@ ] # for c in global_ns.classes(): # print c + if os.name =='nt': + excludes.append('NxArray<NxFluidEmitterDesc, NxAllocatorDefault>') ## needs ElemType changed to NxFluidEmitterDesc + else: + excludes.append ( '::NxFluidUserNotify') for e in excludes: print "Excluding Class:", e global_ns.class_(e).exclude() @@ -136,7 +141,13 @@ ############################################################ def ManualFixes ( mb ): - global_ns = mb.global_ns + global_ns = mb.global_ns + # this change was for 1.7 but also needed for 1.4 + + noncopy=[] ###'NxPhysicsSDK'] + for c in noncopy: + global_ns.class_(c).noncopyable = True + # known = ['points', 'triangles'] # for c in global_ns.classes(): # if c.name.startswith ('Nx'): @@ -358,7 +369,7 @@ if os.name == 'nt': defined_symbols = ['NXPHYSICS_EXPORTS', 'WIN32', 'PHYSX_EXPORTS'] #'WIN32', else: - defined_symbols = ['LINUX'] + defined_symbols = ['LINUX','NX_DISABLE_FLUIDS'] defined_symbols.append( 'VERSION_' + environment.physx.version ) # Modified: trunk/python-ogre/code_generators/physx/python_physx_aliases.h =================================================================== --- trunk/python-ogre/code_generators/physx/python_physx_aliases.h 2008-10-30 06:06:00 UTC (rev 783) +++ trunk/python-ogre/code_generators/physx/python_physx_aliases.h 2008-10-30 06:12:20 UTC (rev 784) @@ -3,10 +3,11 @@ typedef NxUserEntityReport<unsigned> EntitiReportUnsigned; typedef NxUserEntityReport<NxSweepQueryHit> EntityReportSweepQuery; typedef NxArray<NxShapeDesc*, NxAllocatorDefault> NxArrayShapeDesc; -typedef NxArray<NxFluidEmitterDesc, NxAllocatorDefault> NxArrayFluidEmitterDesc; typedef NxArray< NxForceFieldShapeDesc*, NxAllocatorDefault > NxArrayNxForceFieldShapeDescPtr; typedef NxArray< NxForceFieldShapeGroup*, NxAllocatorDefault > NxArrayNxForceFieldShapeGroupPtr; + +//typedef NxArray<NxFluidEmitterDesc, NxAllocatorDefault> NxArrayFluidEmitterDesc; + - Modified: trunk/python-ogre/code_generators/physx/python_physx_sizeof.h =================================================================== --- trunk/python-ogre/code_generators/physx/python_physx_sizeof.h 2008-10-30 06:06:00 UTC (rev 783) +++ trunk/python-ogre/code_generators/physx/python_physx_sizeof.h 2008-10-30 06:12:20 UTC (rev 784) @@ -7,7 +7,8 @@ sizeof ( NxForceFieldShapeGroup ); sizeof ( NxArray<NxForceFieldShapeGroup*, NxAllocatorDefault> ); sizeof ( NxArray<NxShapeDesc*, NxAllocatorDefault> ); -sizeof ( NxArray<NxFluidEmitterDesc, NxAllocatorDefault> ); sizeof ( NxArray<NxForceFieldShapeDesc*, NxAllocatorDefault> ); sizeof ( _Nx3F32 ); + +//sizeof ( NxArray<NxFluidEmitterDesc, NxAllocatorDefault> ); Deleted: trunk/python-ogre/demos/ogreal/plugins.cfg =================================================================== --- trunk/python-ogre/demos/ogreal/plugins.cfg 2008-10-30 06:06:00 UTC (rev 783) +++ trunk/python-ogre/demos/ogreal/plugins.cfg 2008-10-30 06:12:20 UTC (rev 784) @@ -1,13 +0,0 @@ -# Defines plugins to load - -# Define plugin folder -PluginFolder=../../plugins - -# Define D3D rendering implementation plugin -Plugin=RenderSystem_GL.dll -Plugin=RenderSystem_Direct3D9.dll -Plugin=Plugin_ParticleFX.dll -Plugin=Plugin_BSPSceneManager.dll -Plugin=Plugin_OctreeSceneManager.dll -Plugin=Plugin_CgProgramManager.dll - Modified: trunk/python-ogre/demos/physx/physx_01.py =================================================================== --- trunk/python-ogre/demos/physx/physx_01.py 2008-10-30 06:06:00 UTC (rev 783) +++ trunk/python-ogre/demos/physx/physx_01.py 2008-10-30 06:12:20 UTC (rev 784) @@ -34,9 +34,19 @@ gCookingInitialized = False # Initialize PhysicsSDK - desc = physics.NxPhysicsSDKDesc() - - gPhysicsSDK, errorCode = physics.NxCreatePhysicsSDK(physics.NX_PHYSICS_SDK_VERSION(),desc=desc) +# desc = physics.NxPhysicsSDKDesc() +# print "DESC", desc + gPhysicsSDK = physics.NxCreatePhysicsSDK(physics.NX_PHYSICS_SDK_VERSION()) + print gPhysicsSDK + print "Getting master" + g = physics.getMasterPhysicsSDK() + print "Got Master" + print g + print dir(g) + print dir (gPhysicsSDK) + d = physics.NxPhysicsSDK ( ) + print d + print dir(d) if gPhysicsSDK == None : print "\nSDK create error (%d - %s).\nUnable to initialize the PhysX SDK, exiting the sample.\n\n" % (errorCode,"test") return False @@ -104,4 +114,4 @@ return True if __name__ == "__main__": - print InitNx() \ No newline at end of file + print InitNx() Modified: trunk/python-ogre/demos/plugins.cfg =================================================================== --- trunk/python-ogre/demos/plugins.cfg 2008-10-30 06:06:00 UTC (rev 783) +++ trunk/python-ogre/demos/plugins.cfg 2008-10-30 06:12:20 UTC (rev 784) @@ -2,14 +2,13 @@ ## Use this for Windows # Define plugin folder -PluginFolder=../../plugins -#home/andy/development/root/usr/lib/OGRE -Plugin=RenderSystem_GL.dll -Plugin=RenderSystem_Direct3D9.dll -Plugin=Plugin_ParticleFX.dll -Plugin=Plugin_BSPSceneManager.dll -Plugin=Plugin_OctreeSceneManager.dll -Plugin=Plugin_CgProgramManager.dll +#PluginFolder=../../plugins +#Plugin=RenderSystem_GL.dll +#Plugin=RenderSystem_Direct3D9.dll +#Plugin=Plugin_ParticleFX.dll +#Plugin=Plugin_BSPSceneManager.dll +#Plugin=Plugin_OctreeSceneManager.dll +#Plugin=Plugin_CgProgramManager.dll #Plugin=Plugin_PCZSceneManager.dll #Plugin=Plugin_OctreeZone.dll #Plugin=Plugin_OctreeSceneManager.dll @@ -17,8 +16,9 @@ ## ## NOTE use this for MacOS or Linux -# Plugin=RenderSystem_GL -# Plugin=Plugin_ParticleFX -# Plugin=Plugin_BSPSceneManager -# Plugin=Plugin_OctreeSceneManager -# Plugin=Plugin_CgProgramManager +PluginFolder=/home/andy/development/root/usr/lib/OGRE +Plugin=RenderSystem_GL +Plugin=Plugin_ParticleFX +Plugin=Plugin_BSPSceneManager +Plugin=Plugin_OctreeSceneManager +Plugin=Plugin_CgProgramManager Modified: trunk/python-ogre/environment.py =================================================================== --- trunk/python-ogre/environment.py 2008-10-30 06:06:00 UTC (rev 783) +++ trunk/python-ogre/environment.py 2008-10-30 06:12:20 UTC (rev 784) @@ -1275,7 +1275,7 @@ CCFLAGS = ' -D"WIN32" ' ## CCFLAGS = ' ' ## try to not define WIN 32 to remove inline assembly code that GCCxml doesn't like else: - CCFLAGS = ' -D"LINUX" ' + CCFLAGS = ' -D"LINUX" -D"NX_USE_SDK_DLLS" -D"_USRDLL" -D"NX_DISABLE_FLUIDS" ' lib_dirs = [Config.PATH_LIB_Boost, Config.PATH_LIB_Ogre_OgreMain, Config.PATH_LIB_PhysX @@ -1388,15 +1388,23 @@ ["wget", "http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.0.tar.gz",downloadPath], ] buildCmds = [ -# [0, "tar zxf " + os.path.join(downloadPath, "openal-0.0.8.tar.gz"), ''], +# [0, "tar zxf " + os.path.join(downloadPath, "openal-0.0.8.tar.gz"), ''], + [0, "tar jxf " + os.path.join(downloadPath, "openal-soft-1.5.304.tar.bz2"), ''], [0, "tar zxf " + os.path.join(downloadPath, "libogg-1.1.3.tar.gz"), ''], [0, "tar zxf " + os.path.join(downloadPath, "libvorbis-1.2.0.tar.gz"), ''], [0, "./configure --prefix=%s\nmake\nmake install" % PREFIX, os.path.join(os.getcwd(), "libogg-1.1.3")], - [0, "./configure --prefix=%s\nmake\nmake install" % PREFIX, os.path.join(os.getcwd(), "libvorbis-1.2.0")], -# [0, "sed --in-place -s 's|( ALCvoid )|()|' alc.h",os.path.join(os.getcwd(),"openal-0.0.8","common", "include", "AL")], -# [0, "aclocal\n./autogen.sh", os.path.join(os.getcwd(),"openal-0.0.8")], -# [0, "./configure --prefix=%s\nmake\nmake install" % PREFIX, os.path.join(os.getcwd(), "openal-0.0.8")] + + [0, "./configure --prefix=%s\nmake\nmake install" % PREFIX, os.path.join(os.getcwd(), "libvorbis-1.2.0")], + + [0,"cmake -DCMAKE_INSTALL_PREFIX:PATH="+ PREFIX, os.path.join(os.getcwd(),'openal-soft-1.5.304')], + [0,"make ", os.path.join(os.getcwd(),'openal-soft-1.5.304')], + [0,"cp -p libopenal* %s/lib " % PREFIX, os.path.join(os.getcwd(),'openal-soft-1.5.304')], + [0,"cp -p * %s/include " % PREFIX, os.path.join(os.getcwd(),'openal-soft-1.5.304', 'include','AL')] + +# [0, "sed --in-place -s 's|( ALCvoid )|()|' alc.h",os.path.join(os.getcwd(),"openal-0.0.8","common", "include", "AL")], +# [0, "aclocal\n./autogen.sh", os.path.join(os.getcwd(),"openal-0.0.8")], +# [0, "./configure --prefix=%s\nmake\nmake install" % PREFIX, os.path.join(os.getcwd(), "openal-0.0.8")] ] libs=[boost.lib, boost_python_index.lib, 'OgreMain', 'vorbisfile', #'ogg', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2008-10-27 12:54:12
|
Revision: 776 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=776&view=rev Author: andy_miller Date: 2008-10-27 12:54:04 +0000 (Mon, 27 Oct 2008) Log Message: ----------- Updates to Hydrax (0.4) and QuickGui Move Hikari into Thirdparty to make it easier Modified Paths: -------------- trunk/python-ogre/PythonOgreConfig_nt.py trunk/python-ogre/PythonOgreConfig_posix.py trunk/python-ogre/ThirdParty/quickgui/QuickGUIButton.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIButton.h trunk/python-ogre/ThirdParty/quickgui/QuickGUICharacter.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUICharacter.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIComponentWidget.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIComponentWidget.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIContainerWidget.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIContainerWidget.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIEventTypes.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIExportDLL.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIHScrollBar.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIHScrollBar.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIImage.h trunk/python-ogre/ThirdParty/quickgui/QuickGUILabel.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUILabel.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIList.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIList.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIListItem.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIListItem.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIListTextItem.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIManager.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIManager.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIMenu.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIMenu.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIMenuItem.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIMenuLabel.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIMenuLabel.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIMenuPanel.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIModalWindow.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIMouseCursor.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIPanel.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIPanel.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIProgressBar.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIRoot.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIRoot.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIScriptReader.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUISerialBase.h trunk/python-ogre/ThirdParty/quickgui/QuickGUISerialReader.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUISerialReader.h trunk/python-ogre/ThirdParty/quickgui/QuickGUISerialWriter.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUISerialWriter.h trunk/python-ogre/ThirdParty/quickgui/QuickGUISheet.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUISheet.h trunk/python-ogre/ThirdParty/quickgui/QuickGUISize.h trunk/python-ogre/ThirdParty/quickgui/QuickGUISkinElement.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIStringConverter.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIText.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIText.h trunk/python-ogre/ThirdParty/quickgui/QuickGUITextArea.h trunk/python-ogre/ThirdParty/quickgui/QuickGUITextBox.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUITextBox.h trunk/python-ogre/ThirdParty/quickgui/QuickGUITextCursor.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUITextCursor.h trunk/python-ogre/ThirdParty/quickgui/QuickGUITextLine.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUITextLine.h trunk/python-ogre/ThirdParty/quickgui/QuickGUITitleBar.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUITitleBar.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIToolBar.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIToolBar.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIToolBarItem.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIVScrollBar.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIVScrollBar.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIWidget.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIWidget.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIWindow.cpp trunk/python-ogre/code_generators/hikari/generate_code.py trunk/python-ogre/code_generators/quickgui/generate_code.py trunk/python-ogre/environment.py Added Paths: ----------- trunk/python-ogre/ThirdParty/Hikari/ trunk/python-ogre/ThirdParty/Hikari/Delegate.h trunk/python-ogre/ThirdParty/Hikari/FlashControl.cpp trunk/python-ogre/ThirdParty/Hikari/FlashControl.h trunk/python-ogre/ThirdParty/Hikari/FlashSite.h trunk/python-ogre/ThirdParty/Hikari/FlashValue.cpp trunk/python-ogre/ThirdParty/Hikari/FlashValue.h trunk/python-ogre/ThirdParty/Hikari/Hikari.cpp trunk/python-ogre/ThirdParty/Hikari/Hikari.h trunk/python-ogre/ThirdParty/Hikari/HikariPlatform.h trunk/python-ogre/ThirdParty/Hikari/KeyboardHook.cpp trunk/python-ogre/ThirdParty/Hikari/KeyboardHook.h trunk/python-ogre/ThirdParty/Hikari/Position.cpp trunk/python-ogre/ThirdParty/Hikari/Position.h trunk/python-ogre/ThirdParty/Hikari/RenderBuffer.cpp trunk/python-ogre/ThirdParty/Hikari/RenderBuffer.h trunk/python-ogre/ThirdParty/Hikari/ViewportOverlay.cpp trunk/python-ogre/ThirdParty/Hikari/ViewportOverlay.h trunk/python-ogre/ThirdParty/Hikari/flashhandler.h trunk/python-ogre/ThirdParty/Hydrax/ trunk/python-ogre/ThirdParty/Hydrax/CfgFileManager.cpp trunk/python-ogre/ThirdParty/Hydrax/CfgFileManager.h trunk/python-ogre/ThirdParty/Hydrax/DecalsManager.cpp trunk/python-ogre/ThirdParty/Hydrax/DecalsManager.h trunk/python-ogre/ThirdParty/Hydrax/Enums.cpp trunk/python-ogre/ThirdParty/Hydrax/Enums.h trunk/python-ogre/ThirdParty/Hydrax/GPUNormalMapManager.cpp trunk/python-ogre/ThirdParty/Hydrax/GPUNormalMapManager.h trunk/python-ogre/ThirdParty/Hydrax/GodRaysManager.cpp trunk/python-ogre/ThirdParty/Hydrax/GodRaysManager.h trunk/python-ogre/ThirdParty/Hydrax/Help.cpp trunk/python-ogre/ThirdParty/Hydrax/Help.h trunk/python-ogre/ThirdParty/Hydrax/Hydrax.cpp trunk/python-ogre/ThirdParty/Hydrax/Hydrax.h trunk/python-ogre/ThirdParty/Hydrax/Image.cpp trunk/python-ogre/ThirdParty/Hydrax/Image.h trunk/python-ogre/ThirdParty/Hydrax/MaterialManager.cpp trunk/python-ogre/ThirdParty/Hydrax/MaterialManager.h trunk/python-ogre/ThirdParty/Hydrax/Mesh.cpp trunk/python-ogre/ThirdParty/Hydrax/Mesh.h trunk/python-ogre/ThirdParty/Hydrax/Module.cpp trunk/python-ogre/ThirdParty/Hydrax/Module.h trunk/python-ogre/ThirdParty/Hydrax/Noise.cpp trunk/python-ogre/ThirdParty/Hydrax/Noise.h trunk/python-ogre/ThirdParty/Hydrax/Perlin.cpp trunk/python-ogre/ThirdParty/Hydrax/Perlin.h trunk/python-ogre/ThirdParty/Hydrax/Prerequisites.cpp trunk/python-ogre/ThirdParty/Hydrax/Prerequisites.h trunk/python-ogre/ThirdParty/Hydrax/ProjectedGrid.cpp trunk/python-ogre/ThirdParty/Hydrax/ProjectedGrid.h trunk/python-ogre/ThirdParty/Hydrax/RttManager.cpp trunk/python-ogre/ThirdParty/Hydrax/RttManager.h trunk/python-ogre/ThirdParty/Hydrax/SimpleGrid.cpp trunk/python-ogre/ThirdParty/Hydrax/SimpleGrid.h trunk/python-ogre/ThirdParty/Hydrax/TextureManager.cpp trunk/python-ogre/ThirdParty/Hydrax/TextureManager.h trunk/python-ogre/ThirdParty/quickgui/QuickGUICheckBox.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUICheckBox.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIConsole.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIConsole.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIForwardDeclaredDesc.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIForwardDeclaredDesc.h trunk/python-ogre/ThirdParty/quickgui/QuickGUITab.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUITab.h trunk/python-ogre/ThirdParty/quickgui/QuickGUITabControl.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUITabControl.h trunk/python-ogre/ThirdParty/quickgui/QuickGUITabPage.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUITabPage.h trunk/python-ogre/ThirdParty/quickgui/QuickGUITextInputValidator.h Removed Paths: ------------- trunk/python-ogre/ThirdParty/quickgui/QuickGUIButtonStates.h Modified: trunk/python-ogre/PythonOgreConfig_nt.py =================================================================== --- trunk/python-ogre/PythonOgreConfig_nt.py 2008-10-27 06:40:23 UTC (rev 775) +++ trunk/python-ogre/PythonOgreConfig_nt.py 2008-10-27 12:54:04 UTC (rev 776) @@ -81,8 +81,8 @@ PATH_particleuniverse = os.path.join(PATH_Ogre, 'PlugIns', 'ParticleUniverse' ) PATH_ogrepcz = os.path.join(PATH_Ogre, 'PlugIns', 'PCZSceneManager' ) -PATH_hydrax = os.path.join(PATH_THIRDPARTY, 'hydrax') -PATH_hikari = os.path.join(BASE_DIR, 'hikari', 'hikari') +PATH_hydrax = os.path.join(PATH_THIRDPARTY, 'Hydrax') +PATH_hikari = os.path.join(PATH_THIRDPARTY, 'Hikari' ) #BASE_DIR, 'hikari', 'hikari') # it's time for the SDK version if SDK: @@ -129,7 +129,7 @@ PATH_LIB_CEGUI = os.path.join( PATH_Ogre, 'lib' ) PATH_LIB_opensteer = os.path.join(PATH_opensteer, 'win32','release') -PATH_LIB_hikari = os.path.join(PATH_hikari, 'lib') +PATH_LIB_hikari = os.path.join(PATH_hikari ) # , 'lib') PATH_INCLUDE_Ogre= os.path.join(PATH_Ogre,'OgreMain/include') @@ -179,7 +179,7 @@ PATH_INCLUDE_particleuniverse = os.path.join(PATH_particleuniverse, 'include' ) PATH_INCLUDE_ogrepcz = os.path.join(PATH_ogrepcz,'include') PATH_INCLUDE_hydrax= PATH_hydrax -PATH_INCLUDE_hikari = os.path.join(PATH_hikari, 'include') +PATH_INCLUDE_hikari = os.path.join(PATH_hikari ) #, 'include') PATH_INCLUDE_OggVorbisTheora = [ os.path.join(BASE_DIR,'ogg','include') ,os.path.join(BASE_DIR, 'vorbis', 'include') Modified: trunk/python-ogre/PythonOgreConfig_posix.py =================================================================== --- trunk/python-ogre/PythonOgreConfig_posix.py 2008-10-27 06:40:23 UTC (rev 775) +++ trunk/python-ogre/PythonOgreConfig_posix.py 2008-10-27 12:54:04 UTC (rev 776) @@ -79,8 +79,8 @@ PATH_cadunetree= os.path.join(PATH_THIRDPARTY, 'cadunetree') PATH_opensteer = os.path.join(BASE_DIR, 'opensteer', 'trunk') PATH_ogrepcz = os.path.join(PATH_Ogre, 'PlugIns', 'PCZSceneManager' ) -PATH_hydrax = os.path.join(PATH_THIRDPARTY, 'hydrax') -PATH_hikari = os.path.join(BASE_DIR, 'hikari', 'hikari') +PATH_hydrax = os.path.join(PATH_THIRDPARTY, 'Hydrax') +PATH_hikari = os.path.join(PATH_THIRDPARTY, 'Hikari' ) # BASE_DIR, 'hikari', 'hikari') ### ### these paths assume you've left all the directory structure as standard @@ -119,7 +119,7 @@ PATH_LIB_navi= os.path.join(PATH_navi, 'lib') PATH_LIB_particleuniverse = os.path.join(PATH_particleuniverse, 'bin', 'release') PATH_LIB_opensteer = os.path.join(LOCAL_LIB) -PATH_LIB_hikari = os.path.join(PATH_hikari, 'lib') +PATH_LIB_hikari = os.path.join(PATH_hikari ) #, 'lib') PATH_INCLUDE_Ogre= os.path.join(LOCAL_INCLUDE,'OGRE') # os.path.join(PATH_Ogre,'OgreMain/include') PATH_INCLUDE_Ogre_Dependencies = PATH_INCLUDE_Ogre # os.path.join( PATH_Ogre, 'Dependencies/include') @@ -190,5 +190,5 @@ PATH_INCLUDE_opensteer_opensteer = os.path.join(LOCAL_INCLUDE, 'OpenSteer') PATH_INCLUDE_ogrepcz = os.path.join(PATH_ogrepcz,'include') PATH_INCLUDE_hydrax= PATH_hydrax -PATH_INCLUDE_hikari = os.path.join(PATH_hikari, 'include') +PATH_INCLUDE_hikari = os.path.join(PATH_hikari ) #, 'include') Added: trunk/python-ogre/ThirdParty/Hikari/Delegate.h =================================================================== --- trunk/python-ogre/ThirdParty/Hikari/Delegate.h (rev 0) +++ trunk/python-ogre/ThirdParty/Hikari/Delegate.h 2008-10-27 12:54:04 UTC (rev 776) @@ -0,0 +1,481 @@ +/* + FastDelegate.h v1.5, author: Don Clugston, Mar 2004 + Efficient delegates in C++ that generate only two lines of asm code! + Documentation is found at http://www.codeproject.com/cpp/FastDelegate.asp + + AJS: Modified for use with Hikari: trimmed out stuff we don't use. +*/ + +#ifndef __DELEGATE_H__ +#define __DELEGATE_H__ + +#include <memory.h> +#include "FlashValue.h" + +#define FASTDELEGATE_USESTATICFUNCTIONHACK +#if defined(_MSC_VER) && !defined(__MWERKS__) && !defined(__VECTOR_C) && !defined(__ICL) && !defined(__BORLANDC__) +#define FASTDLGT_ISMSVC +#if (_MSC_VER <1300) +#define FASTDLGT_VC6 +#pragma warning(disable:4786) +#endif +#endif +#if defined(_MSC_VER) && !defined(__MWERKS__) +#define FASTDLGT_MICROSOFT_MFP +#if !defined(__VECTOR_C) +#define FASTDLGT_HASINHERITANCE_KEYWORDS +#endif +#endif +#ifdef __GNUC__ + +#define FASTDELEGATE_GCC_BUG_8271 +#endif +namespace Hikari { +namespace Impl { +namespace fastdelegate { + namespace detail { + template <class OutputClass, class InputClass> + inline OutputClass implicit_cast(InputClass input){ + return input; + } + template <class OutputClass, class InputClass> + union horrible_union{ + OutputClass out; + InputClass in; + }; + template <class OutputClass, class InputClass> + inline OutputClass horrible_cast(const InputClass input){ + horrible_union<OutputClass, InputClass> u; + + typedef int ERROR_CantUseHorrible_cast[sizeof(InputClass)==sizeof(u) + && sizeof(InputClass)==sizeof(OutputClass) ? 1 : -1]; + u.in = input; + return u.out; + } +#define FASTDELEGATEDECLARE(CLASSNAME) class CLASSNAME; +#ifdef __MEDIUM__ +#undef FASTDELEGATE_USESTATICFUNCTIONHACK +#endif +#ifdef FASTDLGT_VC6 + typedef const void * DefaultVoid; +#else + typedef void DefaultVoid; +#endif + template <class T> + struct DefaultVoidToVoid { typedef T type; }; + template <> + struct DefaultVoidToVoid<DefaultVoid> { typedef void type; }; + template <class T> + struct VoidToDefaultVoid { typedef T type; }; + template <> + struct VoidToDefaultVoid<void> { typedef DefaultVoid type; }; +#ifdef FASTDLGT_MICROSOFT_MFP +#ifdef FASTDLGT_HASINHERITANCE_KEYWORDS + + class __single_inheritance GenericClass; +#endif + class GenericClass {}; +#else + class GenericClass; +#endif + const int SINGLE_MEMFUNCPTR_SIZE = sizeof(void (GenericClass::*)()); + template <int N> + struct SimplifyMemFunc { + template <class X, class XFuncType, class GenericMemFuncType> + inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind, + GenericMemFuncType &bound_func) { + + + typedef char ERROR_Unsupported_member_function_pointer_on_this_compiler[N-100]; + return 0; + } + }; + template <> + struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE> { + template <class X, class XFuncType, class GenericMemFuncType> + inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind, + GenericMemFuncType &bound_func) { +#if defined __DMC__ + + + + bound_func = horrible_cast<GenericMemFuncType>(function_to_bind); +#else + bound_func = reinterpret_cast<GenericMemFuncType>(function_to_bind); +#endif + return reinterpret_cast<GenericClass *>(pthis); + } + }; +#ifdef FASTDLGT_MICROSOFT_MFP + template<> + struct SimplifyMemFunc< SINGLE_MEMFUNCPTR_SIZE + sizeof(int) > { + template <class X, class XFuncType, class GenericMemFuncType> + inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind, + GenericMemFuncType &bound_func) { + + + union { + XFuncType func; + struct { + GenericMemFuncType funcaddress; + int delta; + }s; + } u; + + typedef int ERROR_CantUsehorrible_cast[sizeof(function_to_bind)==sizeof(u.s)? 1 : -1]; + u.func = function_to_bind; + bound_func = u.s.funcaddress; + return reinterpret_cast<GenericClass *>(reinterpret_cast<char *>(pthis) + u.s.delta); + } + }; + struct MicrosoftVirtualMFP { + void (GenericClass::*codeptr)(); + int delta; + int vtable_index; + }; + struct GenericVirtualClass : virtual public GenericClass + { + typedef GenericVirtualClass * (GenericVirtualClass::*ProbePtrType)(); + GenericVirtualClass * GetThis() { return this; } + }; + template <> + struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE + 2*sizeof(int) > + { + template <class X, class XFuncType, class GenericMemFuncType> + inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind, + GenericMemFuncType &bound_func) { + union { + XFuncType func; + GenericClass* (X::*ProbeFunc)(); + MicrosoftVirtualMFP s; + } u; + u.func = function_to_bind; + bound_func = reinterpret_cast<GenericMemFuncType>(u.s.codeptr); + union { + GenericVirtualClass::ProbePtrType virtfunc; + MicrosoftVirtualMFP s; + } u2; + + typedef int ERROR_CantUsehorrible_cast[sizeof(function_to_bind)==sizeof(u.s) + && sizeof(function_to_bind)==sizeof(u.ProbeFunc) + && sizeof(u2.virtfunc)==sizeof(u2.s) ? 1 : -1]; + u2.virtfunc = &GenericVirtualClass::GetThis; + u.s.codeptr = u2.s.codeptr; + return (pthis->*u.ProbeFunc)(); + } + }; +#if (_MSC_VER <1300) + template <> + struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE + 3*sizeof(int) > + { + template <class X, class XFuncType, class GenericMemFuncType> + inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind, + GenericMemFuncType &bound_func) { + + typedef char ERROR_VC6CompilerBug[-100]; + return 0; + } + }; +#else + template <> + struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE + 3*sizeof(int) > + { + template <class X, class XFuncType, class GenericMemFuncType> + inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind, + GenericMemFuncType &bound_func) { + + + union { + XFuncType func; + + + struct { + GenericMemFuncType m_funcaddress; + int delta; + int vtordisp; + int vtable_index; + } s; + } u; + + typedef int ERROR_CantUsehorrible_cast[sizeof(XFuncType)==sizeof(u.s)? 1 : -1]; + u.func = function_to_bind; + bound_func = u.s.funcaddress; + int virtual_delta = 0; + if (u.s.vtable_index) { + + + const int * vtable = *reinterpret_cast<const int *const*>( + reinterpret_cast<const char *>(pthis) + u.s.vtordisp ); + + virtual_delta = u.s.vtordisp + *reinterpret_cast<const int *>( + reinterpret_cast<const char *>(vtable) + u.s.vtable_index); + } + return reinterpret_cast<GenericClass *>( + reinterpret_cast<char *>(pthis) + u.s.delta + virtual_delta); + }; + }; +#endif +#endif + } + class DelegateMemento { + protected: + + typedef void (detail::GenericClass::*GenericMemFuncType)(); + detail::GenericClass *m_pthis; + GenericMemFuncType m_pFunction; +#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK) + typedef void (*GenericFuncPtr)(); + GenericFuncPtr m_pStaticFunction; +#endif + public: +#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK) + DelegateMemento() : m_pthis(0), m_pFunction(0), m_pStaticFunction(0) {}; + void clear() { + m_pthis=0; m_pFunction=0; m_pStaticFunction=0; + } +#else + DelegateMemento() : m_pthis(0), m_pFunction(0) {}; + void clear() { m_pthis=0; m_pFunction=0; } +#endif + public: +#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK) + inline bool IsEqual (const DelegateMemento &x) const{ + + if (m_pFunction!=x.m_pFunction) return false; + + if (m_pStaticFunction!=x.m_pStaticFunction) return false; + if (m_pStaticFunction!=0) return m_pthis==x.m_pthis; + else return true; + } +#else + inline bool IsEqual (const DelegateMemento &x) const{ + return m_pthis==x.m_pthis && m_pFunction==x.m_pFunction; + } +#endif + + inline bool IsLess(const DelegateMemento &right) const { + +#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK) + if (m_pStaticFunction !=0 || right.m_pStaticFunction!=0) + return m_pStaticFunction < right.m_pStaticFunction; +#endif + if (m_pthis !=right.m_pthis) return m_pthis < right.m_pthis; + + + + return memcmp(&m_pFunction, &right.m_pFunction, sizeof(m_pFunction)) < 0; + } + + inline bool operator ! () const + { return m_pthis==0 && m_pFunction==0; } + inline bool empty() const + { return m_pthis==0 && m_pFunction==0; } + public: + DelegateMemento & operator = (const DelegateMemento &right) { + SetMementoFrom(right); + return *this; + } + inline bool operator <(const DelegateMemento &right) { + return IsLess(right); + } + inline bool operator >(const DelegateMemento &right) { + return right.IsLess(*this); + } + DelegateMemento (const DelegateMemento &right) : + m_pFunction(right.m_pFunction), m_pthis(right.m_pthis) +#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK) + , m_pStaticFunction (right.m_pStaticFunction) +#endif + {} + protected: + void SetMementoFrom(const DelegateMemento &right) { + m_pFunction = right.m_pFunction; + m_pthis = right.m_pthis; +#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK) + m_pStaticFunction = right.m_pStaticFunction; +#endif + } + }; + namespace detail { + template < class GenericMemFunc, class StaticFuncPtr, class UnvoidStaticFuncPtr> + class ClosurePtr : public DelegateMemento { + public: + + template < class X, class XMemFunc > + inline void bindmemfunc(X *pthis, XMemFunc function_to_bind ) { + m_pthis = SimplifyMemFunc< sizeof(function_to_bind) > + ::Convert(pthis, function_to_bind, m_pFunction); +#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK) + m_pStaticFunction = 0; +#endif + } + + template < class X, class XMemFunc> + inline void bindconstmemfunc(const X *pthis, XMemFunc function_to_bind) { + m_pthis= SimplifyMemFunc< sizeof(function_to_bind) > + ::Convert(const_cast<X*>(pthis), function_to_bind, m_pFunction); +#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK) + m_pStaticFunction = 0; +#endif + } +#ifdef FASTDELEGATE_GCC_BUG_8271 + template < class X, class XMemFunc> + inline void bindmemfunc(const X *pthis, XMemFunc function_to_bind) { + bindconstmemfunc(pthis, function_to_bind); +#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK) + m_pStaticFunction = 0; +#endif + } +#endif + + inline GenericClass *GetClosureThis() const { return m_pthis; } + inline GenericMemFunc GetClosureMemPtr() const { return reinterpret_cast<GenericMemFunc>(m_pFunction); } +#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK) + public: + + template< class DerivedClass > + inline void CopyFrom (DerivedClass *pParent, const DelegateMemento &x) { + SetMementoFrom(x); + if (m_pStaticFunction!=0) { + + m_pthis=reinterpret_cast<GenericClass *>(pParent); + } + } + + template < class DerivedClass, class ParentInvokerSig > + inline void bindstaticfunc(DerivedClass *pParent, ParentInvokerSig static_function_invoker, + StaticFuncPtr function_to_bind ) { + if (function_to_bind==0) { + m_pFunction=0; + } else { + bindmemfunc(pParent, static_function_invoker); + } + m_pStaticFunction=reinterpret_cast<GenericFuncPtr>(function_to_bind); + } + inline UnvoidStaticFuncPtr GetStaticFunction() const { + return reinterpret_cast<UnvoidStaticFuncPtr>(m_pStaticFunction); + } +#else + template< class DerivedClass > + inline void CopyFrom (DerivedClass *pParent, const DelegateMemento &right) { + SetMementoFrom(right); + } + + template < class DerivedClass, class ParentInvokerSig> + inline void bindstaticfunc(DerivedClass *pParent, ParentInvokerSig static_function_invoker, + StaticFuncPtr function_to_bind) { + if (function_to_bind==0) { + m_pFunction=0; + } else { + + + bindmemfunc(pParent, static_function_invoker); + } + + typedef int ERROR_CantUseEvilMethod[sizeof(GenericClass *)==sizeof(function_to_bind) ? 1 : -1]; + m_pthis = horrible_cast<GenericClass *>(function_to_bind); + } + + inline UnvoidStaticFuncPtr GetStaticFunction() const { + + typedef int ERROR_CantUseEvilMethod[sizeof(UnvoidStaticFuncPtr)==sizeof(this) ? 1 : -1]; + return horrible_cast<UnvoidStaticFuncPtr>(this); + } +#endif + + inline bool IsEqualToStaticFuncPtr(StaticFuncPtr funcptr){ + if (funcptr==0) return empty(); + + + else return funcptr==reinterpret_cast<StaticFuncPtr>(GetStaticFunction()); + } + }; + } + template<class Param1, class Param2, class RetType=detail::DefaultVoid> + class FastDelegate2 { + private: + typedef typename detail::DefaultVoidToVoid<RetType>::type DesiredRetType; + typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2); + typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2); + typedef RetType (detail::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2); + typedef detail::ClosurePtr<GenericMemFn, StaticFunctionPtr, UnvoidStaticFunctionPtr> ClosureType; + ClosureType m_Closure; + public: + + typedef FastDelegate2 type; + + FastDelegate2() { clear(); } + FastDelegate2(const FastDelegate2 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + void operator = (const FastDelegate2 &x) { + m_Closure.CopyFrom(this, x.m_Closure); } + bool operator ==(const FastDelegate2 &x) const { + return m_Closure.IsEqual(x.m_Closure); } + bool operator !=(const FastDelegate2 &x) const { + return !m_Closure.IsEqual(x.m_Closure); } + bool operator <(const FastDelegate2 &x) const { + return m_Closure.IsLess(x.m_Closure); } + bool operator >(const FastDelegate2 &x) const { + return x.m_Closure.IsLess(m_Closure); } + + template < class X, class Y > + FastDelegate2(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2) ) { + m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); } + template < class X, class Y > + inline void bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2)) { + m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); } + + template < class X, class Y > + FastDelegate2(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2) const) { + m_Closure.bindconstmemfunc(detail::implicit_cast<const X*>(pthis), function_to_bind); } + template < class X, class Y > + inline void bind(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2) const) { + m_Closure.bindconstmemfunc(detail::implicit_cast<const X *>(pthis), function_to_bind); } + + + FastDelegate2(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2) ) { + bind(function_to_bind); } + + void operator = (DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2) ) { + bind(function_to_bind); } + inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2)) { + m_Closure.bindstaticfunc(this, &FastDelegate2::InvokeStaticFunction, + function_to_bind); } + + RetType operator() (Param1 p1, Param2 p2) const { + return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2); } + + private: + typedef struct SafeBoolStruct { + int a_data_pointer_to_this_is_0_on_buggy_compilers; + StaticFunctionPtr m_nonzero; + } UselessTypedef; + typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type; + public: + operator unspecified_bool_type() const { + return empty()? 0: &SafeBoolStruct::m_nonzero; + } + + inline bool operator==(StaticFunctionPtr funcptr) { + return m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator!=(StaticFunctionPtr funcptr) { + return !m_Closure.IsEqualToStaticFuncPtr(funcptr); } + inline bool operator ! () const { + return !m_Closure; } + inline bool empty() const { + return !m_Closure; } + void clear() { m_Closure.clear();} + + const DelegateMemento & GetMemento() { return m_Closure; } + void SetMemento(const DelegateMemento &any) { m_Closure.CopyFrom(this, any); } + private: + RetType InvokeStaticFunction(Param1 p1, Param2 p2) const { + return (*(m_Closure.GetStaticFunction()))(p1, p2); } + }; +} +} + class FlashControl; + + typedef Impl::fastdelegate::FastDelegate2<FlashControl*, const Arguments&, FlashValue> FlashDelegate; +} +#endif Added: trunk/python-ogre/ThirdParty/Hikari/FlashControl.cpp =================================================================== --- trunk/python-ogre/ThirdParty/Hikari/FlashControl.cpp (rev 0) +++ trunk/python-ogre/ThirdParty/Hikari/FlashControl.cpp 2008-10-27 12:54:04 UTC (rev 776) @@ -0,0 +1,670 @@ +/* + This file is part of Hikari, a library that allows developers + to use Flash in their Ogre3D applications. + + Copyright (C) 2008 Adam J. Simmons + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "FlashControl.h" +#include "FlashSite.h" +#include "FlashHandler.h" +#include "RenderBuffer.h" +#include "ViewportOverlay.h" +#include "Hikari.h" +#include "OgreBitwise.h" + +using namespace Hikari; +using namespace Ogre; + +FlashControl::FlashControl(const Ogre::String& name, Ogre::Viewport* viewport, int width, int height, const Position& position, Ogre::uchar zOrder, Ogre::uchar tier) +: name(name), + site(0), + handler(0), + flashInterface(0), + oleObject(0), windowlessObject(0), + width(width), height(height), + state(0), + comCount(0), + mainContext(0), mainBitmap(0), mainBuffer(0), + altContext(0), altBitmap(0), altBuffer(0), + renderBuffer(0), + usingAlphaHack(false), + isClean(true), isTotallyDirty(false), + overlay(0), + lastDirtyWidth(0), lastDirtyHeight(0), + texWidth(width), texHeight(height), texDepth(0), texPitch(0), texUnit(0), + compensateNPOT(false), isTransparent(false), okayToDelete(false), isDraggable(true), + isIgnoringTransparent(true), transThreshold(0.04) +{ + renderBuffer = new Impl::RenderBuffer(width, height); + createControl(); + createMaterial(); + overlay = new Impl::ViewportOverlay(name, viewport, width, height, position, materialName, zOrder, tier); + if(compensateNPOT) + overlay->panel->setUV(0, 0, (Real)width/(Real)texWidth, (Real)height/(Real)texHeight); +} + +FlashControl::FlashControl(const Ogre::String& name, int width, int height) +: name(name), + site(0), + handler(0), + flashInterface(0), + oleObject(0), windowlessObject(0), + width(width), height(height), + state(0), + comCount(0), + mainContext(0), mainBitmap(0), mainBuffer(0), + altContext(0), altBitmap(0), altBuffer(0), + renderBuffer(0), + usingAlphaHack(false), + isClean(true), isTotallyDirty(false), + overlay(0), + lastDirtyWidth(0), lastDirtyHeight(0), + texWidth(width), texHeight(height), texDepth(0), texPitch(0), texUnit(0), + compensateNPOT(false), isTransparent(false), okayToDelete(false), isDraggable(false), + isIgnoringTransparent(false), transThreshold(0) +{ + renderBuffer = new Impl::RenderBuffer(width, height); + createControl(); + createMaterial(); +} + +FlashControl::~FlashControl() +{ + if(overlay) delete overlay; + texture.setNull(); + MaterialManager::getSingletonPtr()->remove(name + "Material"); + TextureManager::getSingletonPtr()->remove(name + "Texture"); + + if(windowlessObject) windowlessObject->Release(); + if(flashInterface) flashInterface->Release(); + if(handler) + { + handler->Shutdown(); + handler->Release(); + } + + if(oleObject) + { + oleObject->Close(OLECLOSE_NOSAVE); + oleObject->Release(); + } + + if(site) site->Release(); + + if(comCount) + LogManager::getSingleton().logMessage("WARNING: Hikari::FlashControl is leaking COM objects!"); + + if(mainContext) ::DeleteDC(mainContext); + if(mainBitmap) ::DeleteObject(mainBitmap); + if(altContext) ::DeleteDC(altContext); + if(altBitmap) ::DeleteObject(altBitmap); + if(renderBuffer) delete renderBuffer; +} + +typedef HRESULT (__stdcall *GetClassObject)(REFCLSID rclsid, REFIID riid, LPVOID * ppv); + +void FlashControl::createControl() +{ + site = new Impl::FlashSite(); + site->AddRef(); + site->Init(this); + + HMODULE flashLib = HikariManager::Get().flashLib; + + // Try to load from user-supplied Flash OCX first + if(flashLib) + { + IClassFactory* factory = 0; + GetClassObject getClassFunc = (GetClassObject)GetProcAddress(flashLib, "DllGetClassObject"); + HRESULT result = getClassFunc(ShockwaveFlashObjects::CLSID_ShockwaveFlash, IID_IClassFactory, (void**)&factory); + if(SUCCEEDED(result)) + { + factory->CreateInstance(NULL, IID_IOleObject, (void**)&oleObject); + factory->Release(); + } + } + + // If we still don't have the object, try loading from registry + if(!oleObject) + { + HRESULT result = CoCreateInstance(ShockwaveFlashObjects::CLSID_ShockwaveFlash, 0, CLSCTX_INPROC_SERVER, IID_IOleObject, (void**)&oleObject); + if(FAILED(result)) + OGRE_EXCEPT(Ogre::Exception::ERR_RT_ASSERTION_FAILED, "Unable to load the Flash ActiveX control.", "FlashControl::createControl"); + } + + IOleClientSite* clientSite = 0; + site->QueryInterface(__uuidof(IOleClientSite), (void**)&clientSite); + oleObject->SetClientSite(clientSite); + clientSite->Release(); + + IOleInPlaceObject* inPlaceObject = 0; + oleObject->QueryInterface(__uuidof(IOleInPlaceObject), (LPVOID*)&inPlaceObject); + + if(inPlaceObject) + { + invalidateTotally(); + + inPlaceObject->SetObjectRects(&dirtyBounds, &dirtyBounds); + inPlaceObject->Release(); + } + + oleObject->QueryInterface(__uuidof(ShockwaveFlashObjects::IShockwaveFlash), (LPVOID*)&flashInterface); + + flashInterface->PutWMode("opaque"); + + oleObject->DoVerb(OLEIVERB_INPLACEACTIVATE, 0, clientSite, 0, 0, 0); + clientSite->Release(); + + oleObject->QueryInterface(__uuidof(IOleInPlaceObjectWindowless), (LPVOID*)&windowlessObject); + + handler = new Impl::FlashHandler(); + handler->AddRef(); + handler->Init(this); + + IViewObject* curView = 0; + flashInterface->QueryInterface(IID_IViewObject, (void**)&curView); +} + +void FlashControl::createMaterial() +{ + texture.setNull(); + MaterialManager::getSingletonPtr()->remove(name + "Material"); + TextureManager::getSingletonPtr()->remove(name + "Texture"); + + texWidth = width; + texHeight = height; + if(!Bitwise::isPO2(width) || !Bitwise::isPO2(height)) + { + if(Root::getSingleton().getRenderSystem()->getCapabilities()->hasCapability(RSC_NON_POWER_OF_2_TEXTURES)) + { + if(Root::getSingleton().getRenderSystem()->getCapabilities()->getNonPOW2TexturesLimited()) + compensateNPOT = true; + } + else compensateNPOT = true; + + if(compensateNPOT) + { + texWidth = Bitwise::firstPO2From(width); + texHeight = Bitwise::firstPO2From(height); + } + } + + // Create the texture + texture = TextureManager::getSingleton().createManual( + name + "Texture", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, + TEX_TYPE_2D, (uint)texWidth, (uint)texHeight, 0, isTransparent? PF_BYTE_BGRA : PF_BYTE_BGR, + TU_DYNAMIC_WRITE_ONLY_DISCARDABLE, this); + + HardwarePixelBufferSharedPtr pixelBuffer = texture->getBuffer(); + pixelBuffer->lock(HardwareBuffer::HBL_DISCARD); + const PixelBox& pixelBox = pixelBuffer->getCurrentLock(); + texDepth = Ogre::PixelUtil::getNumElemBytes(pixelBox.format); + texPitch = (pixelBox.rowPitch*texDepth); + + uint8* pDest = static_cast<uint8*>(pixelBox.data); + + memset(pDest, 128, texHeight*texPitch); + + pixelBuffer->unlock(); + + materialName = name + "Material"; + + MaterialPtr material = MaterialManager::getSingleton().create(materialName, ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME); + Pass* matPass = material->getTechnique(0)->getPass(0); + matPass->setSceneBlending(SBT_TRANSPARENT_ALPHA); + matPass->setDepthWriteEnabled(false); + + texUnit = matPass->createTextureUnitState(name + "Texture"); + texUnit->setTextureFiltering(FO_NONE, FO_NONE, FO_NONE); + + invalidateTotally(); + + if(overlay) + { + overlay->panel->setMaterialName(materialName); + if(compensateNPOT) + overlay->panel->setUV(0, 0, (Real)width/(Real)texWidth, (Real)height/(Real)texHeight); + } +} + +void FlashControl::load(const Ogre::String& movieFilename) +{ + std::string moviePath = HikariManager::Get().basePath + movieFilename; + + FILE* file = fopen(moviePath.c_str(), "r"); + if(file) + { + fclose(file); + flashInterface->PutMovie((moviePath).c_str()); + } + else + { + OGRE_EXCEPT(Ogre::Exception::ERR_FILE_NOT_FOUND, "Could not load '" + moviePath + "', the file was not found.", "FlashControl::load"); + } +} + +void FlashControl::play() +{ + flashInterface->Play(); +} + +void FlashControl::stop() +{ + flashInterface->Stop(); +} + +void FlashControl::rewind() +{ + flashInterface->Rewind(); +} + +void FlashControl::gotoFrame(long frameNum) +{ + flashInterface->raw_GotoFrame(frameNum); +} + +void FlashControl::setLoop(bool shouldLoop) +{ + flashInterface->PutLoop(shouldLoop); +} + +void FlashControl::setTransparent(bool isTransparent, bool useAlphaHack) +{ + this->isTransparent = isTransparent; + if(isTransparent) + { + flashInterface->PutWMode("transparent"); + usingAlphaHack = useAlphaHack; + } + else + { + flashInterface->PutWMode("opaque"); + usingAlphaHack = false; + } + + createMaterial(); +} + +void FlashControl::setQuality(short renderQuality) +{ + switch(renderQuality) + { + case RQ_LOW: + flashInterface->PutQuality2("low"); + break; + case RQ_MEDIUM: + flashInterface->PutQuality2("medium"); + break; + case RQ_HIGH: + flashInterface->PutQuality2("high"); + break; + case RQ_BEST: + flashInterface->PutQuality2("best"); + break; + case RQ_AUTOLOW: + flashInterface->PutQuality2("autolow"); + break; + case RQ_AUTOHIGH: + flashInterface->PutQuality2("autohigh"); + break; + } +} + +void FlashControl::setScaleMode(short scaleMode) +{ + flashInterface->PutScaleMode(scaleMode); +} + +void FlashControl::setDraggable(bool isDraggable) +{ + this->isDraggable = isDraggable; +} + +void FlashControl::setIgnoreTransparentPixels(bool shouldIgnore, Ogre::Real threshold) +{ + isIgnoringTransparent = shouldIgnore; + transThreshold = threshold; +} + +const Ogre::String & FlashControl::getName() const +{ + return name; +} + +const Ogre::String & FlashControl::getMaterialName() const +{ + return materialName; +} + +void FlashControl::bind(const Ogre::DisplayString& funcName, const FlashDelegate& callback) +{ + if(funcName.empty() || callback.empty()) + return; + + delegateMap[funcName] = callback; +} + +void FlashControl::unbind(const Ogre::DisplayString& funcName) +{ + DelegateIter i = delegateMap.find(funcName); + if(i != delegateMap.end()) + delegateMap.erase(i); +} + +FlashValue FlashControl::callFunction(Ogre::DisplayString funcName, const Arguments& args) +{ + BSTR returnVal = 0; + HRESULT result = flashInterface->raw_CallFunction(_bstr_t(Impl::serializeInvocation(funcName, args).c_str()), &returnVal); + +#ifdef _DEBUG + if(FAILED(result)) + OGRE_EXCEPT(Ogre::Exception::ERR_RT_ASSERTION_FAILED, + "Failed to call ActionScript function '" + funcName + "' from FlashControl '" + name + "'", + "FlashControl::callFunction"); +#endif + + return Impl::deserializeValue((wchar_t*)returnVal); +} + +void FlashControl::hide() +{ + if(overlay) + overlay->hide(); +} +void FlashControl::show() +{ + if(overlay) + overlay->show(); +} +bool FlashControl::getVisibility() const +{ + if(overlay) + return overlay->isVisible; + else + return false; +} +void FlashControl::setOpacity(Ogre::Real opacity) +{ + if(texUnit) + texUnit->setAlphaOperation(LBX_MODULATE, LBS_TEXTURE, LBS_MANUAL, 1, opacity); +} + +void FlashControl::focus() +{ + HikariManager::Get().focusControl(0, 0, this); +} + +void FlashControl::move(int deltaX, int deltaY) +{ + if(overlay) + overlay->move(deltaX, deltaY); +} + +void FlashControl::setPosition(const Position& position) +{ + if(overlay) + overlay->setPosition(position); +} + +void FlashControl::resetPosition() +{ + if(overlay) + overlay->resetPosition(); +} + +void FlashControl::getCoordinates(int& x, int& y) +{ + if(overlay) + { + x = overlay->getX(); + y = overlay->getY(); + } +} + +void FlashControl::getExtents(unsigned short &width, unsigned short &height) const +{ + width = this->width; + height = this->height; +} + +void FlashControl::getUVScale(Ogre::Real &uScale, Ogre::Real &vScale) const +{ + uScale = vScale = 1; + + if(compensateNPOT) + { + uScale = (Real)width/(Real)texWidth; + vScale = (Real)height/(Real)texHeight; + } +} + +void FlashControl::injectMouseMove(int xPos, int yPos) +{ + LRESULT result; + windowlessObject->OnWindowMessage(WM_MOUSEMOVE, 0, MAKELPARAM(xPos, yPos), &result); +} + +void FlashControl::injectMouseDown(int xPos, int yPos) +{ + LRESULT result; + windowlessObject->OnWindowMessage(WM_LBUTTONDOWN, MK_LBUTTON, MAKELPARAM(xPos, yPos), &result); +} + +void FlashControl::injectMouseUp(int xPos, int yPos) +{ + LRESULT result; + windowlessObject->OnWindowMessage(WM_LBUTTONUP, 0, MAKELPARAM(xPos, yPos), &result); +} + +#ifndef WM_MOUSEWHEEL +# define WM_MOUSEWHEEL 0x020A +#endif + +void FlashControl::injectMouseWheel(int relScroll, int xPos, int yPos) +{ + LRESULT result; + windowlessObject->OnWindowMessage(WM_MOUSEWHEEL, MAKEWPARAM(0, relScroll), MAKELPARAM(xPos, yPos), &result); +} + +bool FlashControl::isPointOverMe(int screenX, int screenY) +{ + if(!overlay) + return false; + + if(!overlay->isVisible) + return false; + + if(overlay->isWithinBounds(screenX, screenY)) + { + if(isTransparent && isIgnoringTransparent) + return renderBuffer->buffer[overlay->getRelativeY(screenY)*renderBuffer->rowSpan+overlay->getRelativeX(screenX)*4+3] > transThreshold * 255; + else + return true; + } + + return false; +} + +void FlashControl::invalidateTotally() +{ + isClean = false; + isTotallyDirty = true; + dirtyBounds.left = 0; + dirtyBounds.top = 0; + dirtyBounds.right = width; + dirtyBounds.bottom = height; +} + +void FlashControl::handleKeyEvent(UINT msg, WPARAM wParam, LPARAM lParam) +{ + LRESULT aResult; + windowlessObject->OnWindowMessage(msg, wParam, lParam, &aResult); +} + +void FlashControl::handleFlashCall(const std::wstring& xmlString) +{ + std::wstring funcName; + Arguments args; + + if(!Impl::deserializeInvocation(xmlString, funcName, args)) + return; + + DelegateIter i = delegateMap.find(funcName); + if(i != delegateMap.end()) + { + FlashValue retval = i->second(this, args); + flashInterface->SetReturnValue(Impl::serializeValue(retval).c_str()); + } +} + +void FlashControl::update() +{ + if(isClean) + return; + + if(overlay) + if(!overlay->isVisible) + return; + + int dirtyWidth = dirtyBounds.right - dirtyBounds.left; + int dirtyHeight = dirtyBounds.bottom - dirtyBounds.top; + int dirtyBufSize = dirtyWidth * dirtyHeight * 4; + + IViewObject* curView = 0; + flashInterface->QueryInterface(IID_IViewObject, (void**)&curView); + + if(!oleObject || !curView) + return; + + if(!mainContext || dirtyWidth != lastDirtyWidth || dirtyHeight != lastDirtyHeight) + { + if(mainContext) + { + DeleteDC(mainContext); + mainContext = 0; + } + if(mainBitmap) + { + DeleteObject(mainBitmap); + mainBitmap = 0; + } + + lastDirtyWidth = dirtyWidth; + lastDirtyHeight = dirtyHeight; + + HDC hdc = GetDC(0); + BITMAPINFOHEADER bih = {0}; + bih.biSize = sizeof(BITMAPINFOHEADER); + bih.biBitCount = 32; + bih.biCompression = BI_RGB; + bih.biPlanes = 1; + bih.biWidth = dirtyWidth; + bih.biHeight = -dirtyHeight; + mainContext = CreateCompatibleDC(hdc); + mainBitmap = CreateDIBSection(hdc, (BITMAPINFO*)&bih, DIB_RGB_COLORS, (void**)&mainBuffer, 0, 0); + SelectObject(mainContext, mainBitmap); + + if(usingAlphaHack) + { + if(altContext) + { + DeleteDC(altContext); + altContext = 0; + } + if(altBitmap) + { + DeleteObject(altBitmap); + altBitmap = 0; + } + + altContext = CreateCompatibleDC(hdc); + altBitmap = CreateDIBSection(hdc, (BITMAPINFO*)&bih, DIB_RGB_COLORS, (void **)&altBuffer, 0, 0); + SelectObject(altContext, altBitmap); + } + + ReleaseDC(0, hdc); + } + + RECT local; + local.left = -dirtyBounds.left; + local.top = -dirtyBounds.top; + local.right = local.left + dirtyBounds.right; + local.bottom = local.top + dirtyBounds.bottom; + + if(!usingAlphaHack) + { + memset(mainBuffer, 0, dirtyBufSize); + + HRESULT hr = OleDraw(curView, DVASPECT_TRANSPARENT, mainContext, &local); + } + else + { + memset(mainBuffer, 0, dirtyBufSize); + memset(altBuffer, 255, dirtyBufSize); + + OleDraw(curView, DVASPECT_TRANSPARENT, mainContext, &local); + OleDraw(curView, DVASPECT_TRANSPARENT, altContext, &local); + + // We've rendered the dirty area twice: once on black and once + // on white. Now we compare the red channels of each to determine + // the alpha value of each pixel. + BYTE *blackBuffer, *whiteBuffer; + blackBuffer = mainBuffer; + whiteBuffer = altBuffer; + BYTE blackRed, whiteRed; + int size = dirtyWidth * dirtyHeight; + for(int i = 0; i < size; i++) + { + blackRed = *blackBuffer; + whiteRed = *whiteBuffer; + blackBuffer += 3; + whiteBuffer += 4; + *blackBuffer++ = 255 - (whiteRed - blackRed); + } + } + + renderBuffer->copyArea(dirtyBounds, mainBuffer, dirtyWidth * 4); + + HardwarePixelBufferSharedPtr pixelBuffer = texture->getBuffer(); + pixelBuffer->lock(HardwareBuffer::HBL_DISCARD); + const PixelBox& pixelBox = pixelBuffer->getCurrentLock(); + + uint8* destBuffer = static_cast<uint8*>(pixelBox.data); + + renderBuffer->blitBGR(destBuffer, (int)texPitch, (int)texDepth); + + pixelBuffer->unlock(); + + isClean = true; + isTotallyDirty = false; +} + +void FlashControl::loadResource(Ogre::Resource* resource) +{ + Texture *tex = static_cast<Texture*>(resource); + + tex->setTextureType(TEX_TYPE_2D); + tex->setWidth(texWidth); + tex->setHeight(texHeight); + tex->setNumMipmaps(0); + tex->setFormat(isTransparent? PF_BYTE_BGRA : PF_BYTE_BGR); + tex->setUsage(TU_DYNAMIC_WRITE_ONLY_DISCARDABLE); + tex->createInternalResources(); + + invalidateTotally(); +} \ No newline at end of file Added: trunk/python-ogre/ThirdParty/Hikari/FlashControl.h =================================================================== --- trunk/python-ogre/ThirdParty/Hikari/FlashControl.h (rev 0) +++ trunk/python-ogre/ThirdParty/Hikari/FlashControl.h 2008-10-27 12:54:04 UTC (rev 776) @@ -0,0 +1,398 @@ +/* + This file is part of Hikari, a library that allows developers + to use Flash in their Ogre3D applications. + + Copyright (C) 2008 Adam J. Simmons + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef __FlashControl_H__ +#define __FlashControl_H__ + +#include "Position.h" +#include <windows.h> +#include "Ogre.h" +#include "Delegate.h" + +namespace ShockwaveFlashObjects { struct IShockwaveFlash; } +struct IOleObject; +class IOleInPlaceObjectWindowless; + +namespace Hikari { + +namespace Impl { + class FlashSite; + class FlashHandler; + class RenderBuffer; + class ViewportOverlay; +} + +/** +* Used by FlashControl::setQuality, defines the Flash rendering quality. +* +* <ul> +* <li>RQ_LOW - Favors playback speed over appearance and never uses anti-aliasing. +* <li>RQ_MEDIUM - Applies some anti-aliasing and does not smooth bitmaps. It produces a better quality than the Low setting, but lower quality than the High setting. +* <li>RQ_HIGH - Favors appearance over playback speed and always applies anti-aliasing. If the movie does not contain animation, bitmaps are smoothed; if the movie has animation, bitmaps are not smoothed. +* <li>RQ_BEST - Provides the best display quality and does not consider playback speed. All output is anti-aliased and all bitmaps are smoothed. +* <li>RQ_AUTOLOW - Emphasizes speed at first but improves appearance whenever possible. Playback begins with anti-aliasing turned off. If the Flash Player detects that the processor can handle it, anti-aliasing is turned on. +* <li>RQ_AUTOHIGH - Emphasizes playback speed and appearance equally at first but sacrifices appearance for playback speed if necessary. Playback begins with anti-aliasing turned on. If the actual frame rate drops below the specified frame rate, anti-aliasing is turned off to improve playback speed. +* </ul> +*/ +enum RenderQuality +{ + RQ_LOW, + RQ_MEDIUM, + RQ_HIGH, + RQ_BEST, + RQ_AUTOLOW, + RQ_AUTOHIGH +}; + +/** +* Used by FlashControl::setScaleMode, defines the scaling mode to use when the aspect ratio of the control does not match that of the movie. +* +* <ul> +* <li>SM_SHOWALL - Preserves the movie's aspect ratio by adding borders. (Default) +* <li>SM_NOBORDER - Preserves the movie's aspect ratio by cropping the sides. +* <li>SM_EXACTFIT - Does not preserve the movie's aspect ratio, scales the movie to the dimensions of the control. +*/ +enum ScaleMode +{ + SM_SHOWALL, + SM_NOBORDER, + SM_EXACTFIT +}; + +/** +* The FlashControl class is an instance of the Flash Player that is rendered dynamically to a texture and +* wrapped in an optional movable overlay using the Ogre3D engine. +*/ +class _HikariExport FlashControl : public Ogre::ManualResourceLoader +{ + friend class Impl::FlashSite; + friend class Impl::FlashHandler; + friend class HikariManager; +protected: + Impl::FlashSite* site; + Impl::FlashHandler* handler; + ShockwaveFlashObjects::IShockwaveFlash* flashInterface; + IOleObject* oleObject; + IOleInPlaceObjectWindowless* windowlessObject; + + Ogre::String name; + int width, height; + int state; + int comCount; + HDC mainContext, altContext; + HBITMAP mainBitmap, altBitmap; + BYTE *mainBuffer, *altBuffer; + Impl::RenderBuffer* renderBuffer; + bool usingAlphaHack; + RECT dirtyBounds; + int lastDirtyWidth, lastDirtyHeight; + bool isClean, isTotallyDirty; + + Impl::ViewportOverlay* overlay; + size_t texWidth, texHeight, texDepth, texPitch; + Ogre::TexturePtr texture; + Ogre::TextureUnitState* texUnit; + Ogre::String materialName; + bool compensateNPOT; + bool isTransparent; + bool isDraggable; + bool isIgnoringTransparent; + Ogre::Real transThreshold; + + typedef std::map<Ogre::DisplayString, FlashDelegate> DelegateMap; + typedef DelegateMap::iterator DelegateIter; + DelegateMap delegateMap; + bool okayToDelete; + + void createControl(); + void createMaterial(); + bool isPointOverMe(int screenX, int screenY); + void invalidateTotally(); + void handleKeyEvent(UINT msg, WPARAM wParam, LPARAM lParam); + void handleFlashCall(const std::wstring& xmlString); + void update(); + + FlashControl(const Ogre::String& name, Ogre::Viewport* viewport, int width, int height, const Position& position, Ogre::uchar zOrder, Ogre::uchar tier); + FlashControl(const Ogre::String& name, int width, int height); + +public: + ~FlashControl(); + + /** + * Loads a movie (a .swf file) into this FlashControl and begins playing. + * + * @param movieFilename The filename of the movie to load. + * + * @note The specified movie should reside in the "assetsDirectory" that + * was declared when the HikariManager was instantiated. + */ + void load(const Ogre::String& movieFilename); + + /** + * Plays the currently-loaded movie. + */ + void play(); + + /** + * Stops the currently-loaded movie. + */ + void stop(); + + /** + * Rewinds the currently-loaded movie to the beginning. + */ + void rewind(); + + /** + * Navigates the currently-loaded movie to a certain frame and stops there. + */ + void gotoFrame(long frameNum); + + /** + * Sets whether or not the currently-loaded movie should restart when + * it reaches the end. + * + * @param shouldLoop Whether the currently-loaded movie should loop. + */ + void setLoop(bool shouldLoop); + + /** + * Sets whether or not the currently-loaded movie should use a + * transparent background instead of the default background-color. + * + * @param isTransparent Whether or not the movie should use "transparent" rendering. + * @param useAlphaHack With some Flash versions, there are certain glitches with + * transparent rendering (usually with text and aliased geometry). + * Set this parameter to 'true' to use an alternative alpha-rendering + * hack that may mitigate these issues at the cost of some performance. + */ + void setTransparent(bool isTransparent, bool useAlphaHack = false); + + /** + * Sets the Flash rendering quality for the currently-loaded movie. + * + * @param renderQuality The RenderQuality to use. + */ + void setQuality(short renderQuality); + + /** + * Sets the scaling mode to use when the aspect ratio of the movie and control do not match. + * + * @param scaleMode The ScaleMode to use. + */ + void setScaleMode(short scaleMode); + + /** + * Sets whether this FlashControl is draggable via the right-mouse-button, + * this is only applicable to FlashControls created as an overlay. + * + * @param isDraggable Whether or not this FlashControl should be draggable. + */ + void setDraggable(bool isDraggable); + + /** + * Sets whether or not mouse-clicks over transparent pixels should be ignored (this is on by default), + * this is only applicable to transparent FlashControls created as an overlay. + * + * @param shouldIgnore Whether or not transparent pixels should be ignored. + * @param threshold The opacity threshold (in percent, 0 to 1.0), pixels with + * opacities less than this amount will be ignored. + */ + void setIgnoreTransparentPixels(bool shouldIgnore, Ogre::Real threshold = 0.04); + + /** + * Returns the name of this FlashControl. + */ + const Ogre::String & getName() const; + + /** + * Retrieves the name of the Ogre::Material used by this FlashControl. + */ + const Ogre::String & getMaterialName() const; + + /** + * Binds a local callback to a certain function name so that your Flash movie can call the function + * from ActionScript using ExternalInterface.call('functionName'). + * + * @param funcName The name to bind this callback to. + * @param callback The local function to call, see below for examples of declaring a FlashDelegate. + * + * \code + * // Example declaration of a compatible function (static function): + * FlashValue myStaticFunction(FlashControl* caller, const Arguments& args) + * { + * // Handle the callback here + * return FLASH_VOID; + * } + * + * // Example declaration of a compatible function (member function): + * FlashValue MyClass::myMemberFunction(FlashControl* caller, const Arguments& args) + * { + * // Handle the callback here + * return "Some return value!"; + * } + * + * // FlashDelegate (member function) instantiation: + * FlashDelegate callback(this, &MyClass::myMemberFunction); // within a class + * FlashDelegate callback2(pointerToClassInstance, &MyClass::myMemberFunction); + * + * // FlashDelegate (static function) instantiation: + * FlashDelegate callback(&myStaticFunction); + * \endcode + */ + void bind(const Ogre::DisplayString& funcName, const FlashDelegate& callback); + + /** + * Un-binds the specified callback. + * + * @param funcName The name that the callback was bound to. + */ + void unbind(const Ogre::DisplayString& funcName); + + /** + * Attempts to call a function declared as a callback in the ActionScript of the currently-loaded movie. + * + * @param funcName The name of the callback that was declared using 'ExternalInterface.addCallback(funcName, function)' + * in the ActionScript of the currently-loaded movie. + * @param args The arguments to pass to the ActionScript function. + * + * @return If the invocation was successful and the ActionScript function returned a value, returns a FlashValue with a non-null type. + * + * @note It is highly recommended to use the 'Args(arg1)(arg2)(arg3)...' helper class to pass arguments. + */ + FlashValue callFunction(Ogre::DisplayString funcName, const Arguments& args = Args()); + + /** + * If this FlashControl was created as an overlay, hides the overlay. + */ + void hide(); + + /** + * If this FlashControl was created as an overlay, shows the overlay. + */ + void show(); + + /** + * Returns whether or not the FlashControl overlay is currently visible. (See FlashControl::hide and FlashControl::show) + * If this FlashControl was not created as an overlay, always returns false. + */ + bool getVisibility() const; + + /** + * Sets the opacity of this FlashControl. + * + * @param opacity The opacity as a Real value; 0 is totally transparent, 1 is totally opaque. + */ + void setOpacity(Ogre::Real opacity); + + /** + * Gives this FlashControl keyboard focus. Additionally, if this FlashControl is an overlay, pops it to the front. + */ + void focus(); + + /** + * If this FlashControl was created as an overlay, moves the overlay in relative amounts. + * + * @param deltaX The amount (in pixels) to move the overlay in the X-axis. + * @param deltaY The amount (in pixels) to move the overlay in the Y-axis. + */ + void move(int deltaX, int deltaY); + + /** + * Changes the current position and sets it as the default. Only applicable if this FlashControl was created as an overlay. + * + * @param position The new position. + */ + void setPosition(const Position& position); + + /** + * Resets the current position to the default. Only applicable if this FlashControl was created as an overlay. + */ + void resetPosition(); + + /** + * Retrieves the current screen coordinates (in relation to the render-window) of the overlay. Only applicable if this + * FlashControl was created as an overlay. + * + * @param[out] x The integer to store the current x-coordinate in. + * @param[out] y The integer to store the current y-coordinate in. + */ + void getCoordinates(int& x, int& y); + + /** + * Retrieves the width and height that this FlashControl was created with. + * + * @param[out] width The unsigned short that will be used to store the retrieved width. + * + * @param[out] height The unsigned short that will be used to store the retrieved height. + */ + void getExtents(unsigned short &width, unsigned short &height) const; + + /** + * Gets the UV scale of this FlashControl's internal texture. On certain systems we must compensate for lack of + * NPOT-support on the videocard by using the next-highest POT texture. Normally, FlashControl overlays compensate + * their texture coordinates automatically however FlashControls created as pure materials will need to adjust + * their own by use of this function. + * + * @param[out] uScale The Ogre::Real that will be used to store the retrieved U-scale. + * @param[out] vScale The Ogre::Real that will be used to store the retrieved V-scale. + */ + void getUVScale(Ogre::Real &uScale, Ogre::Real &vScale) const; + + /** + * Injects a mouse-move event into this FlashControl (in the control's local coordinate-space). + * + * @param xPos The local X-coordinate. + * @param yPos The local Y-coordinate. + */ + void injectMouseMove(int xPos, int yPos); + + /** + * Injects a mouse-down event into this FlashControl (in the control's local coordinate-space). + * + * @param xPos The local X-coordinate. + * @param yPos The local Y-coordinate. + */ + void injectMouseDown(int xPos, int yPos); + + /** + * Injects a mouse-up event into this FlashControl (in the control's local coordinate-space). + * + * @param xPos The local X-coordinate. + * @param yPos The local Y-coordinate. + */ + void injectMouseUp(int xPos, int yPos); + + /** + * Injects a mouse-wheel event into this FlashControl (in the control's local coordinate-space). + * + * @param relScroll The relative scroll amount of the mouse-wheel. + * @param xPos The local X-coordinate of the mouse. + * @param yPos The local Y-coordinate of the mouse. + */ + void injectMouseWheel(int relScroll, int xPos, int yPos); + + void loadResource(Ogre::Resource* res... [truncated message content] |
From: <and...@us...> - 2008-10-31 08:18:21
|
Revision: 785 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=785&view=rev Author: andy_miller Date: 2008-10-31 08:18:17 +0000 (Fri, 31 Oct 2008) Log Message: ----------- Updates to enable threading in Ogre Modified Paths: -------------- trunk/python-ogre/code_generators/betagui/generate_code.py trunk/python-ogre/code_generators/cadunetree/generate_code.py trunk/python-ogre/code_generators/caelum/generate_code.py trunk/python-ogre/code_generators/cegui/generate_code.py trunk/python-ogre/code_generators/et/generate_code.py trunk/python-ogre/code_generators/hikari/generate_code.py trunk/python-ogre/code_generators/hydrax/generate_code.py trunk/python-ogre/code_generators/noise/generate_code.py trunk/python-ogre/code_generators/nxogre/generate_code.py trunk/python-ogre/code_generators/ofusion/generate_code.py trunk/python-ogre/code_generators/ogre/generate_code.py trunk/python-ogre/code_generators/ogreal/generate_code.py trunk/python-ogre/code_generators/ogrebulletc/generate_code.py trunk/python-ogre/code_generators/ogrebulletd/generate_code.py trunk/python-ogre/code_generators/ogreforests/generate_code.py trunk/python-ogre/code_generators/ogrenewt/generate_code.py trunk/python-ogre/code_generators/ogreode/generate_code.py trunk/python-ogre/code_generators/ogrepcz/generate_code.py trunk/python-ogre/code_generators/ogrerefapp/generate_code.py trunk/python-ogre/code_generators/particleuniverse/generate_code.py trunk/python-ogre/code_generators/quickgui/generate_code.py trunk/python-ogre/code_generators/theora/generate_code.py trunk/python-ogre/demos/particleuniverse/Demo_Particle.py trunk/python-ogre/environment.py trunk/python-ogre/scripts/compilesource.bat trunk/python-ogre/scripts/vsvars32.bat Modified: trunk/python-ogre/code_generators/betagui/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/betagui/generate_code.py 2008-10-30 06:12:20 UTC (rev 784) +++ trunk/python-ogre/code_generators/betagui/generate_code.py 2008-10-31 08:18:17 UTC (rev 785) @@ -371,7 +371,7 @@ os.path.join( environment.betagui.root_dir, "python_betagui.h" ) , environment.betagui.cache_file ) - defined_symbols = [ 'OGRE_NONCLIENT_BUILD' ] + defined_symbols = [ 'OGRE_NONCLIENT_BUILD','__PYTHONOGRE_BUILD_CODE' ] if environment._USE_THREADS: defined_symbols.append('BOOST_HAS_THREADS') Modified: trunk/python-ogre/code_generators/cadunetree/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/cadunetree/generate_code.py 2008-10-30 06:12:20 UTC (rev 784) +++ trunk/python-ogre/code_generators/cadunetree/generate_code.py 2008-10-31 08:18:17 UTC (rev 785) @@ -199,9 +199,13 @@ os.path.join( environment.cadunetree.root_dir, "python_cadunetree.h" ) , environment.cadunetree.cache_file ) - defined_symbols = [ 'OGRE_NONCLIENT_BUILD', 'OGRE_GCC_VISIBILITY' ] + defined_symbols = [ 'OGRE_NONCLIENT_BUILD', 'OGRE_GCC_VISIBILITY','__PYTHONOGRE_BUILD_CODE' ] defined_symbols.append( 'VERSION_' + environment.cadunetree.version ) - + + if environment._USE_THREADS: + defined_symbols.append('BOOST_HAS_THREADS') + defined_symbols.append('BOOST_HAS_WINTHREADS') + # # build the core Py++ system from the GCCXML created source # Modified: trunk/python-ogre/code_generators/caelum/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/caelum/generate_code.py 2008-10-30 06:12:20 UTC (rev 784) +++ trunk/python-ogre/code_generators/caelum/generate_code.py 2008-10-31 08:18:17 UTC (rev 785) @@ -254,8 +254,11 @@ os.path.join( environment.caelum.root_dir, "python_caelum.h" ) , environment.caelum.cache_file ) - defined_symbols = [ 'OGRE_NONCLIENT_BUILD' ] + defined_symbols = [ 'OGRE_NONCLIENT_BUILD','__PYTHONOGRE_BUILD_CODE' ] defined_symbols.append( 'VERSION_' + environment.caelum.version ) + if environment._USE_THREADS: + defined_symbols.append('BOOST_HAS_THREADS') + defined_symbols.append('BOOST_HAS_WINTHREADS') # # build the core Py++ system from the GCCXML created source Modified: trunk/python-ogre/code_generators/cegui/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/cegui/generate_code.py 2008-10-30 06:12:20 UTC (rev 784) +++ trunk/python-ogre/code_generators/cegui/generate_code.py 2008-10-31 08:18:17 UTC (rev 785) @@ -258,12 +258,19 @@ xml_cached_fc = parser.create_cached_source_fc( os.path.join( environment.cegui.root_dir, "python_CEGUI.h" ) , environment.cegui.cache_file ) + + defined_symbols = [ 'OGRE_NONCLIENT_BUILD', 'CEGUI_NONCLIENT_BUILD','OGRE_GCC_VISIBILITY','__PYTHONOGRE_BUILD_CODE' ] + defined_symbols.append( 'VERSION_' + environment.cegui.version ) + if environment._USE_THREADS: + defined_symbols.append('BOOST_HAS_THREADS') + defined_symbols.append('BOOST_HAS_WINTHREADS') + mb = module_builder.module_builder_t( [ xml_cached_fc ] , gccxml_path=environment.gccxml_bin , working_directory=environment.root_dir , include_paths=environment.cegui.include_dirs - , define_symbols=['CEGUI_NONCLIENT_BUILD', 'OGRE_NONCLIENT_BUILD'] + , define_symbols=defined_symbols , indexing_suite_version=2 ) filter_declarations (mb) Modified: trunk/python-ogre/code_generators/et/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/et/generate_code.py 2008-10-30 06:12:20 UTC (rev 784) +++ trunk/python-ogre/code_generators/et/generate_code.py 2008-10-31 08:18:17 UTC (rev 785) @@ -224,9 +224,12 @@ os.path.join( environment.et.root_dir, "python_et.h" ) , environment.et.cache_file ) - defined_symbols = ['OGRE_NONCLIENT_BUILD' ] + defined_symbols = ['OGRE_NONCLIENT_BUILD','__PYTHONOGRE_BUILD_CODE' ] defined_symbols.append( 'VERSION_' + environment.et.version ) - + if environment._USE_THREADS: + defined_symbols.append('BOOST_HAS_THREADS') + defined_symbols.append('BOOST_HAS_WINTHREADS') + # # build the core Py++ system from the GCCXML created source # Modified: trunk/python-ogre/code_generators/hikari/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/hikari/generate_code.py 2008-10-30 06:12:20 UTC (rev 784) +++ trunk/python-ogre/code_generators/hikari/generate_code.py 2008-10-31 08:18:17 UTC (rev 785) @@ -233,8 +233,11 @@ , environment.hikari.cache_file ) # Vector_c define to allow GCC to process delegates.h - defined_symbols = ['OGRE_NONCLIENT_BUILD', 'HIKARI_NONCLIENT_BUILD', '__VECTOR_C' ] + defined_symbols = ['OGRE_NONCLIENT_BUILD', 'HIKARI_NONCLIENT_BUILD', '__VECTOR_C', '__PYTHONOGRE_BUILD_CODE' ] defined_symbols.append( 'VERSION_' + environment.hikari.version ) + if environment._USE_THREADS: + defined_symbols.append('BOOST_HAS_THREADS') + defined_symbols.append('BOOST_HAS_WINTHREADS') # # build the core Py++ system from the GCCXML created source Modified: trunk/python-ogre/code_generators/hydrax/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/hydrax/generate_code.py 2008-10-30 06:12:20 UTC (rev 784) +++ trunk/python-ogre/code_generators/hydrax/generate_code.py 2008-10-31 08:18:17 UTC (rev 785) @@ -200,9 +200,12 @@ os.path.join( environment.hydrax.root_dir, "python_hydrax.h" ) , environment.hydrax.cache_file ) - defined_symbols = ['OGRE_NONCLIENT_BUILD' ] + defined_symbols = ['OGRE_NONCLIENT_BUILD','__PYTHONOGRE_BUILD_CODE' ] defined_symbols.append( 'VERSION_' + environment.hydrax.version ) - + if environment._USE_THREADS: + defined_symbols.append('BOOST_HAS_THREADS') + defined_symbols.append('BOOST_HAS_WINTHREADS') + # # build the core Py++ system from the GCCXML created source # Modified: trunk/python-ogre/code_generators/noise/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/noise/generate_code.py 2008-10-30 06:12:20 UTC (rev 784) +++ trunk/python-ogre/code_generators/noise/generate_code.py 2008-10-31 08:18:17 UTC (rev 785) @@ -248,7 +248,10 @@ , environment.noise.cache_file ) - defined_symbols = [ 'OGRE_NONCLIENT_BUILD' ] + defined_symbols = [ 'OGRE_NONCLIENT_BUILD','__PYTHONOGRE_BUILD_CODE' ] + if environment._USE_THREADS: + defined_symbols.append('BOOST_HAS_THREADS') + defined_symbols.append('BOOST_HAS_WINTHREADS') defined_symbols.append( 'VERSION_' + environment.noise.version ) Modified: trunk/python-ogre/code_generators/nxogre/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/nxogre/generate_code.py 2008-10-30 06:12:20 UTC (rev 784) +++ trunk/python-ogre/code_generators/nxogre/generate_code.py 2008-10-31 08:18:17 UTC (rev 785) @@ -612,9 +612,9 @@ os.path.join( environment.nxogre.root_dir, "python_nxogre.h" ) , environment.nxogre.cache_file ) if os.name == 'nt': - defined_symbols = [ 'NxExport','OGRE_NONCLIENT_BUILD', 'OGRE_GCC_VISIBILITY', 'WIN32', 'GCC_XML']#NXOGRE_EXPORTS' + defined_symbols = [ '__PYTHONOGRE_BUILD_CODE','NxExport','OGRE_NONCLIENT_BUILD', 'OGRE_GCC_VISIBILITY', 'WIN32', 'GCC_XML']#NXOGRE_EXPORTS' else: - defined_symbols = [ 'LINUX','NX_LINUX', 'NX_DISABLE_FLUIDS', 'OGRE_NONCLIENT_BUILD', 'OGRE_GCC_VISIBILITY', 'GCC_XML'] + defined_symbols = [ '__PYTHONOGRE_BUILD_CODE','LINUX','NX_LINUX', 'NX_DISABLE_FLUIDS', 'OGRE_NONCLIENT_BUILD', 'OGRE_GCC_VISIBILITY', 'GCC_XML'] if environment._USE_THREADS: defined_symbols.append('BOOST_HAS_THREADS') Modified: trunk/python-ogre/code_generators/ofusion/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/ofusion/generate_code.py 2008-10-30 06:12:20 UTC (rev 784) +++ trunk/python-ogre/code_generators/ofusion/generate_code.py 2008-10-31 08:18:17 UTC (rev 785) @@ -201,9 +201,12 @@ os.path.join( environment.ofusion.root_dir, "python_ofusion.h" ) , environment.ofusion.cache_file ) - defined_symbols = ['OGRE_NONCLIENT_BUILD' ] + defined_symbols = ['OGRE_NONCLIENT_BUILD','__PYTHONOGRE_BUILD_CODE' ] defined_symbols.append( 'VERSION_' + environment.ofusion.version ) - + if environment._USE_THREADS: + defined_symbols.append('BOOST_HAS_THREADS') + defined_symbols.append('BOOST_HAS_WINTHREADS') + # # build the core Py++ system from the GCCXML created source # Modified: trunk/python-ogre/code_generators/ogre/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/ogre/generate_code.py 2008-10-30 06:12:20 UTC (rev 784) +++ trunk/python-ogre/code_generators/ogre/generate_code.py 2008-10-31 08:18:17 UTC (rev 785) @@ -281,7 +281,14 @@ print '{*} function "%s" is marked as internal' % declarations.full_name( func ) # this change was for 1.7 but also needed for 1.4 - noncopy=['Camera','Frustum', 'Log'] + noncopy=['Camera','Frustum', 'Log' ] + + # these showed up during threading -- possible needs to be done all the time (needs to be looked at) + if environment._USE_THREADS: + noncopy = noncopy + ['Compositor', 'DefaultHardwareBufferManager', 'DefaultSceneManager', 'Font', 'FontManager', + 'HighLevelGpuProgramManager','Material', 'Mesh', 'MeshManager', + 'ParticleSystemManager', 'Pass', 'PatchMesh', 'ResourceGroupManager', + 'Skeleton', 'SkeletonInstance', 'SkeletonManager', 'UnifiedHighLevelGpuProgram'] for c in noncopy: main_ns.class_(c).noncopyable = True @@ -1064,7 +1071,7 @@ xml_cached_fc = parser.create_cached_source_fc( os.path.join( environment.ogre.root_dir, "python_ogre.h" ) , environment.ogre.cache_file ) - defined_symbols = [ 'OGRE_NONCLIENT_BUILD', 'OGRE_GCC_VISIBILITY'] + defined_symbols = [ 'OGRE_NONCLIENT_BUILD', 'OGRE_GCC_VISIBILITY', '__PYTHONOGRE_BUILD_CODE'] undefine_symbols=[] if environment._USE_THREADS: defined_symbols.append('BOOST_HAS_THREADS') Modified: trunk/python-ogre/code_generators/ogreal/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/ogreal/generate_code.py 2008-10-30 06:12:20 UTC (rev 784) +++ trunk/python-ogre/code_generators/ogreal/generate_code.py 2008-10-31 08:18:17 UTC (rev 785) @@ -235,8 +235,11 @@ os.path.join( environment.ogreal.root_dir, "python_ogreal.h" ) , environment.ogreal.cache_file ) - defined_symbols = [ 'OGRE_NONCLIENT_BUILD' ] + defined_symbols = [ 'OGRE_NONCLIENT_BUILD','__PYTHONOGRE_BUILD_CODE' ] defined_symbols.append( 'VERSION_' + environment.ogreal.version ) + if environment._USE_THREADS: + defined_symbols.append('BOOST_HAS_THREADS') + defined_symbols.append('BOOST_HAS_WINTHREADS') # # build the core Py++ system from the GCCXML created source Modified: trunk/python-ogre/code_generators/ogrebulletc/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/ogrebulletc/generate_code.py 2008-10-30 06:12:20 UTC (rev 784) +++ trunk/python-ogre/code_generators/ogrebulletc/generate_code.py 2008-10-31 08:18:17 UTC (rev 785) @@ -212,10 +212,14 @@ , environment.ogrebulletc.cache_file ) if os.name == 'nt': - defined_symbols = ["WIN32","NDEBUG","_WINDOWS", "_PRECOMP", 'OGRE_NONCLIENT_BUILD' ] + defined_symbols = ["WIN32","NDEBUG","_WINDOWS", "_PRECOMP", 'OGRE_NONCLIENT_BUILD','__PYTHONOGRE_BUILD_CODE' ] else: defined_symbols = ["NDEBUG", "_PRECOMP", 'OGRE_NONCLIENT_BUILD' ] - defined_symbols.append( 'VERSION_' + environment.ogrebulletc.version ) + defined_symbols.append( 'VERSION_' + environment.ogrebulletc.version ) + if environment._USE_THREADS: + defined_symbols.append('BOOST_HAS_THREADS') + defined_symbols.append('BOOST_HAS_WINTHREADS') + # # build the core Py++ system from the GCCXML created source Modified: trunk/python-ogre/code_generators/ogrebulletd/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/ogrebulletd/generate_code.py 2008-10-30 06:12:20 UTC (rev 784) +++ trunk/python-ogre/code_generators/ogrebulletd/generate_code.py 2008-10-31 08:18:17 UTC (rev 785) @@ -200,11 +200,15 @@ , environment.ogrebulletd.cache_file ) if os.name == 'nt': - defined_symbols = ["WIN32","NDEBUG","_WINDOWS", "_PRECOMP", 'OGRE_NONCLIENT_BUILD' ] + defined_symbols = ["WIN32","NDEBUG","_WINDOWS", "_PRECOMP", 'OGRE_NONCLIENT_BUILD','__PYTHONOGRE_BUILD_CODE' ] else: defined_symbols = ["NDEBUG", "_PRECOMP", 'OGRE_NONCLIENT_BUILD' ] - defined_symbols.append( 'VERSION_' + environment.ogrebulletd.version ) - + defined_symbols.append( 'VERSION_' + environment.ogrebulletd.version ) + + if environment._USE_THREADS: + defined_symbols.append('BOOST_HAS_THREADS') + defined_symbols.append('BOOST_HAS_WINTHREADS') + # # build the core Py++ system from the GCCXML created source # Modified: trunk/python-ogre/code_generators/ogreforests/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/ogreforests/generate_code.py 2008-10-30 06:12:20 UTC (rev 784) +++ trunk/python-ogre/code_generators/ogreforests/generate_code.py 2008-10-31 08:18:17 UTC (rev 785) @@ -255,7 +255,12 @@ os.path.join( environment.ogreforests.root_dir, "python_forests.h" ) , environment.ogreforests.cache_file ) - defined_symbols = ['OGRE_NONCLIENT_BUILD', 'WIN32', "GCCXML_BUG" ] + defined_symbols = ['OGRE_NONCLIENT_BUILD', 'WIN32', "GCCXML_BUG", '__PYTHONOGRE_BUILD_CODE' ] + undefine_symbols=[] + if environment._USE_THREADS: + defined_symbols.append('BOOST_HAS_THREADS') + defined_symbols.append('BOOST_HAS_WINTHREADS') + defined_symbols.append( 'VERSION_' + environment.ogreforests.version ) # Modified: trunk/python-ogre/code_generators/ogrenewt/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/ogrenewt/generate_code.py 2008-10-30 06:12:20 UTC (rev 784) +++ trunk/python-ogre/code_generators/ogrenewt/generate_code.py 2008-10-31 08:18:17 UTC (rev 785) @@ -207,13 +207,20 @@ xml_cached_fc = parser.create_cached_source_fc( os.path.join( environment.ogrenewt.root_dir, "python_ogrenewt.h" ) , environment.ogrenewt.cache_file ) - + + defined_symbols = [ 'OGRE_NONCLIENT_BUILD','__PYTHONOGRE_BUILD_CODE', + 'ogrenewt_NONCLIENT_BUILD','OIS_NONCLIENT_BUILD', 'OIS_STATIC_BUILD' ] + defined_symbols.append( 'VERSION_' + environment.ogrenewt.version ) + + if environment._USE_THREADS: + defined_symbols.append('BOOST_HAS_THREADS') + defined_symbols.append('BOOST_HAS_WINTHREADS') + mb = module_builder.module_builder_t( [ xml_cached_fc ] , gccxml_path=environment.gccxml_bin , working_directory=environment.root_dir , include_paths=environment.ogrenewt.include_dirs - , define_symbols=['ogrenewt_NONCLIENT_BUILD', 'OGRE_NONCLIENT_BUILD', - 'OIS_NONCLIENT_BUILD', 'OIS_STATIC_BUILD'] + , define_symbols=defined_symbols , indexing_suite_version=2 ) ## This module depends on Ogre Modified: trunk/python-ogre/code_generators/ogreode/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/ogreode/generate_code.py 2008-10-30 06:12:20 UTC (rev 784) +++ trunk/python-ogre/code_generators/ogreode/generate_code.py 2008-10-31 08:18:17 UTC (rev 785) @@ -265,9 +265,13 @@ os.path.join( environment.ogreode.root_dir, "python_ogreode.h" ) , environment.ogreode.cache_file ) - defined_symbols = ['OGRE_NONCLIENT_BUILD', 'ODE_LIB' ] - defined_symbols.append( 'OGREODE_VERSION_' + environment.ogreode.version ) - + defined_symbols = ['OGRE_NONCLIENT_BUILD', 'ODE_LIB','__PYTHONOGRE_BUILD_CODE' ] + defined_symbols.append( 'OGREODE_VERSION_' + environment.ogreode.version ) + + if environment._USE_THREADS: + defined_symbols.append('BOOST_HAS_THREADS') + defined_symbols.append('BOOST_HAS_WINTHREADS') + # # build the core Py++ system from the GCCXML created source # Modified: trunk/python-ogre/code_generators/ogrepcz/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/ogrepcz/generate_code.py 2008-10-30 06:12:20 UTC (rev 784) +++ trunk/python-ogre/code_generators/ogrepcz/generate_code.py 2008-10-31 08:18:17 UTC (rev 785) @@ -158,7 +158,13 @@ print "Including Special:", c c.include() - + noncopy=[] + # these showed up during threading -- possible needs to be done all the time (needs to be looked at) + if environment._USE_THREADS: + noncopy = noncopy + ['PCZSceneManager' ] + for c in noncopy: + main_ns.class_(c).noncopyable = True + ############################################################ ## ## And things that need to have their argument and call values fixed. @@ -282,9 +288,12 @@ os.path.join( environment.ogrepcz.root_dir, "python_ogrepcz.h" ) , environment.ogrepcz.cache_file ) - defined_symbols = [ 'OGRE_NONCLIENT_BUILD', 'OGRE_GCC_VISIBILITY'] + defined_symbols = [ 'OGRE_NONCLIENT_BUILD', 'OGRE_GCC_VISIBILITY','__PYTHONOGRE_BUILD_CODE'] defined_symbols.append( 'VERSION_' + environment.ogrepcz.version ) - + if environment._USE_THREADS: + defined_symbols.append('BOOST_HAS_THREADS') + defined_symbols.append('BOOST_HAS_WINTHREADS') + # # build the core Py++ system from the GCCXML created source # Modified: trunk/python-ogre/code_generators/ogrerefapp/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/ogrerefapp/generate_code.py 2008-10-30 06:12:20 UTC (rev 784) +++ trunk/python-ogre/code_generators/ogrerefapp/generate_code.py 2008-10-31 08:18:17 UTC (rev 785) @@ -75,8 +75,12 @@ os.path.join( environment.ogrerefapp.root_dir, "python_ogre.h" ) , environment.ogrerefapp.cache_file ) - defined_symbols = [ 'OGREREFAPP_NONCLIENT_BUILD', 'OGRE_NONCLIENT_BUILD' ] + defined_symbols = [ 'OGREREFAPP_NONCLIENT_BUILD', 'OGRE_NONCLIENT_BUILD','__PYTHONOGRE_BUILD_CODE' ] defined_symbols.append( 'OGREREFAPP_VERSION_' + environment.ogrerefapp.version ) + if environment._USE_THREADS: + defined_symbols.append('BOOST_HAS_THREADS') + defined_symbols.append('BOOST_HAS_WINTHREADS') + mb = module_builder.module_builder_t( [ xml_cached_fc ] , gccxml_path=environment.gccxml_bin , working_directory=environment.root_dir Modified: trunk/python-ogre/code_generators/particleuniverse/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/particleuniverse/generate_code.py 2008-10-30 06:12:20 UTC (rev 784) +++ trunk/python-ogre/code_generators/particleuniverse/generate_code.py 2008-10-31 08:18:17 UTC (rev 785) @@ -227,8 +227,11 @@ , environment.particleuniverse.cache_file ) defined_symbols = [ 'OGRE_NONCLIENT_BUILD', 'OGRE_GCC_VISIBILITY' ,'PARTICLE_UNIVERSE_EXPORTS', '__PYTHONOGRE_BUILD_CODE' ] - defined_symbols.append( 'VERSION_' + environment.particleuniverse.version ) - + defined_symbols.append( 'VERSION_' + environment.particleuniverse.version ) + if environment._USE_THREADS: + defined_symbols.append('BOOST_HAS_THREADS') + defined_symbols.append('BOOST_HAS_WINTHREADS') + # # build the core Py++ system from the GCCXML created source # Modified: trunk/python-ogre/code_generators/quickgui/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/quickgui/generate_code.py 2008-10-30 06:12:20 UTC (rev 784) +++ trunk/python-ogre/code_generators/quickgui/generate_code.py 2008-10-31 08:18:17 UTC (rev 785) @@ -422,7 +422,7 @@ os.path.join( environment.quickgui.root_dir, "python_quickgui.h" ) , environment.quickgui.cache_file ) - defined_symbols = [ 'OGRE_NONCLIENT_BUILD', + defined_symbols = [ 'OGRE_NONCLIENT_BUILD','__PYTHONOGRE_BUILD_CODE', 'WIN32', 'NDEBUG', 'WINDOWS' , '_PRECOMP'] ## , 'QUICKGUI_EXPORTS' if environment._USE_THREADS: defined_symbols.append('BOOST_HAS_THREADS') Modified: trunk/python-ogre/code_generators/theora/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/theora/generate_code.py 2008-10-30 06:12:20 UTC (rev 784) +++ trunk/python-ogre/code_generators/theora/generate_code.py 2008-10-31 08:18:17 UTC (rev 785) @@ -460,7 +460,7 @@ os.path.join( environment.theora.root_dir, "python_theora.h" ) , environment.theora.cache_file ) - defined_symbols = [ 'THEORAVIDEO_PLUGIN_EXPORTS','OGRE_NONCLIENT_BUILD', 'OGRE_GCC_VISIBILITY'] + defined_symbols = [ 'THEORAVIDEO_PLUGIN_EXPORTS','OGRE_NONCLIENT_BUILD', 'OGRE_GCC_VISIBILITY','__PYTHONOGRE_BUILD_CODE'] if os.name == 'nt': defined_symbols.append ( 'WIN32' ) if environment._USE_THREADS: Modified: trunk/python-ogre/demos/particleuniverse/Demo_Particle.py =================================================================== --- trunk/python-ogre/demos/particleuniverse/Demo_Particle.py 2008-10-30 06:12:20 UTC (rev 784) +++ trunk/python-ogre/demos/particleuniverse/Demo_Particle.py 2008-10-31 08:18:17 UTC (rev 785) @@ -60,6 +60,9 @@ # and don't forget to start it self.particleSystem2.start() + name= self.particleSystem2.name + self.ps = self.sceneManager.getMovableObject(name, PU.ParticleSystemFactory.PU_FACTORY_TYPE_NAME) + print "\n\n", self.ps if __name__ == '__main__': try: Modified: trunk/python-ogre/environment.py =================================================================== --- trunk/python-ogre/environment.py 2008-10-30 06:12:20 UTC (rev 784) +++ trunk/python-ogre/environment.py 2008-10-31 08:18:17 UTC (rev 785) @@ -563,7 +563,8 @@ pythonModule = True name='ogre' ModuleName='OGRE' - cflags = "" + CCFLAGS = "" + cflags='' moduleParentLocation = "renderer" parent = "ogre/renderer" dependsOn = ['boost'] @@ -1421,7 +1422,7 @@ version="0.2.1" name='ogrevideoffmpeg' parent="ogre/addons" - cflags = "" + CCFLAGS = "" include_dirs = [ Config.PATH_Boost, Config.PATH_INCLUDE_Ogre, Config.PATH_INCLUDE_ogrevideoffmpeg, @@ -1486,7 +1487,8 @@ ] ModuleName = 'et' CheckIncludes = ['boost/python.hpp'] - cflags = "" + CCFLAGS = " " + cflags='' class bullet: active = True Modified: trunk/python-ogre/scripts/compilesource.bat =================================================================== --- trunk/python-ogre/scripts/compilesource.bat 2008-10-30 06:12:20 UTC (rev 784) +++ trunk/python-ogre/scripts/compilesource.bat 2008-10-31 08:18:17 UTC (rev 785) @@ -4,13 +4,13 @@ set _ROOT=c:\\development call vcvars32 cd %_ROOT%\\ogre -%_VCBUILD% /useenv Ogre_vc8.sln "Release|Win32" +%_VCBUILD% /useenv Ogre_vc9.sln "Release|Win32" rem cd %_ROOT%\\NxOgre\\NxOgre rem %_VCBUILD% /useenv NxOgre.VC8.Windows.sln "Release|Win32" cd %_ROOT%\\ogreaddons\\ogreode\\scripts\\vc8 -%_VCBUILD% /useenv OgreOde_Source.sln "Release|Win32" +%_VCBUILD% /useenv OgreOde_SDK.sln "Release|Win32" cd %_ROOT%\\ogreaddons\\ogrenewt %_VCBUILD% /useenv OgreNewt_vc71.sln "Release|Win32" Modified: trunk/python-ogre/scripts/vsvars32.bat =================================================================== --- trunk/python-ogre/scripts/vsvars32.bat 2008-10-30 06:12:20 UTC (rev 784) +++ trunk/python-ogre/scripts/vsvars32.bat 2008-10-31 08:18:17 UTC (rev 785) @@ -22,9 +22,9 @@ @rem @set DevEnvDir=C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE -@set PATH=C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE;C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN;C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools;C:\WINDOWS\Microsoft.NET\Framework\v3.5;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;C:\Program Files\Microsoft Visual Studio 9.0\VC\VCPackages;%PATH% -@set INCLUDE=C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE;C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\include;c:\program files\Microsoft DirectX SDK (June 2008)\include;%INCLUDE% -@set LIB=C:\Program Files\Microsoft Visual Studio 9.0\VC\LIB;C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\lib;c:\program files\Microsoft DirectX SDK (June 2008)\lib\x86;%LIB% +@set PATH=%PATH%;C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE;C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN;C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools;C:\WINDOWS\Microsoft.NET\Framework\v3.5;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;C:\Program Files\Microsoft Visual Studio 9.0\VC\VCPackages +@set INCLUDE=%INCLUDE%;C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE;C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\include;c:\program files\Microsoft DirectX SDK (August 2008)\include +@set LIB=%LIB%;C:\Program Files\Microsoft Visual Studio 9.0\VC\LIB;C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\lib;c:\program files\Microsoft DirectX SDK (August 2008)\lib\x86 @set LIBPATH=C:\WINDOWS\Microsoft.NET\Framework\v3.5;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;C:\Program Files\Microsoft Visual Studio 9.0\VC\LIB;%LIBPATH% @goto end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2008-11-03 07:40:12
|
Revision: 786 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=786&view=rev Author: andy_miller Date: 2008-11-03 07:40:08 +0000 (Mon, 03 Nov 2008) Log Message: ----------- Updated to latest ET SceneManager - Changed to BetaGui to latest version Modified Paths: -------------- trunk/python-ogre/SConstruct trunk/python-ogre/ThirdParty/et/ETBrush.cpp trunk/python-ogre/ThirdParty/et/ETLightmap.cpp trunk/python-ogre/ThirdParty/et/ETLoadSaveHeightmap.cpp trunk/python-ogre/ThirdParty/et/ETPrerequisites.h trunk/python-ogre/ThirdParty/et/ETSplattingManager.cpp trunk/python-ogre/ThirdParty/et/ETTerrainInfo.cpp trunk/python-ogre/ThirdParty/et/ETTerrainInfo.h trunk/python-ogre/ThirdParty/et/ETTerrainManager.cpp trunk/python-ogre/ThirdParty/et/ETTerrainManager.h trunk/python-ogre/ThirdParty/et/ETTile.cpp trunk/python-ogre/ThirdParty/et/Impl/ETOptions.h trunk/python-ogre/ThirdParty/et/Impl/ETTerrainImpl.h trunk/python-ogre/ThirdParty/et/Impl/ETTile.h trunk/python-ogre/code_generators/betagui/customization_data.py trunk/python-ogre/code_generators/betagui/generate_code.py trunk/python-ogre/code_generators/betagui/python_betagui.h trunk/python-ogre/demos/ogre/Demo_Bezier.py trunk/python-ogre/demos/ogre/Demo_Smoke.py trunk/python-ogre/demos/plugins.cfg trunk/python-ogre/environment.py Modified: trunk/python-ogre/SConstruct =================================================================== --- trunk/python-ogre/SConstruct 2008-10-31 08:18:17 UTC (rev 785) +++ trunk/python-ogre/SConstruct 2008-11-03 07:40:08 UTC (rev 786) @@ -146,8 +146,13 @@ cls._source = cls.generated_dir cls._build_dir = os.path.join ( builddir, cls.dir_name) cls._name = name - _env = Environment(ENV=os.environ) + ## Note the change -- bug in scons means you have to set env seperately + _env = Environment(ENV = os.environ) + + print os.environ['PATH'] + print _env['ENV'] + if environment.rpath: _env.Append(RPATH=environment.rpath) @@ -209,7 +214,7 @@ if environment.isWindows(): ## and lets have it install the output into the 'package_dir_name/ModuleName' dir and rename to the PydName _env.AddPostAction(package,\ - 'mt.exe -nologo -manifest %(name)s.manifest -outputresource:%(name)s;2' % { 'name':package[index] } ) + Action ('mt.exe -nologo -manifest %(name)s.manifest -outputresource:%(name)s;2' % { 'name':package[index] } ) ) if environment.isLinux() and "-g" not in _env["CCFLAGS"]: _env.AddPostAction(package,\ '-strip -g -S -d --strip-debug -s %(name)s' % { 'name':package[index] } ) Modified: trunk/python-ogre/ThirdParty/et/ETBrush.cpp =================================================================== --- trunk/python-ogre/ThirdParty/et/ETBrush.cpp 2008-10-31 08:18:17 UTC (rev 785) +++ trunk/python-ogre/ThirdParty/et/ETBrush.cpp 2008-11-03 07:40:08 UTC (rev 786) @@ -120,7 +120,11 @@ void saveBrushToImage(const Brush& brush, Image& image) { // save brush as a 16bit grayscale image - ushort* data = new ushort[brush.getWidth()*brush.getHeight()]; +#if OGRE_VERSION_MINOR > 4 + ushort* data = (ushort*)OGRE_ALLOC_T(uchar, brush.getWidth()*brush.getHeight()*sizeof(ushort), MEMCATEGORY_GENERAL); +#else + ushort* data = (ushort*)new uchar[brush.getWidth()*brush.getHeight()*sizeof(ushort)]; +#endif for (size_t x = 0; x < brush.getWidth(); ++x) for (size_t y = 0; y < brush.getHeight(); ++y) data[y*brush.getWidth() + x] = ushort(brush.at(x, y) * 0xffff); Modified: trunk/python-ogre/ThirdParty/et/ETLightmap.cpp =================================================================== --- trunk/python-ogre/ThirdParty/et/ETLightmap.cpp 2008-10-31 08:18:17 UTC (rev 785) +++ trunk/python-ogre/ThirdParty/et/ETLightmap.cpp 2008-11-03 07:40:08 UTC (rev 786) @@ -285,7 +285,13 @@ step.z /= height; Vector3 pos = startPos; +#if OGRE_VERSION_MINOR > 4 + // Ogre::Image uses the memory allocation macros internally in Shoggoth, + // so we must use them as well. + uchar* lightMap = OGRE_ALLOC_T(uchar, width*height*3, MEMCATEGORY_GENERAL); +#else uchar* lightMap = new uchar[width*height * 3]; +#endif memset(lightMap, 255, width*height*3); for (size_t z = 0; z < height; ++z) @@ -322,6 +328,6 @@ // save lightmap to image image.loadDynamicImage(lightMap, width, height, 1, PF_BYTE_RGB, true); - // ownership of lightMap was transfered to image, don't need to delete + // ownership of lightMap was transfered to image, don't need to delete } } Modified: trunk/python-ogre/ThirdParty/et/ETLoadSaveHeightmap.cpp =================================================================== --- trunk/python-ogre/ThirdParty/et/ETLoadSaveHeightmap.cpp 2008-10-31 08:18:17 UTC (rev 785) +++ trunk/python-ogre/ThirdParty/et/ETLoadSaveHeightmap.cpp 2008-11-03 07:40:08 UTC (rev 786) @@ -105,7 +105,11 @@ uint maxVal = (1 << (bpp*8)) - 1; +#if OGRE_VERSION_MINOR > 4 + uchar* data = OGRE_ALLOC_T(uchar, info.getWidth()*info.getHeight()*bpp, MEMCATEGORY_GENERAL); +#else uchar* data = new uchar[info.getWidth()*info.getHeight()*bpp]; +#endif uchar* pos = data; // fill data array Modified: trunk/python-ogre/ThirdParty/et/ETPrerequisites.h =================================================================== --- trunk/python-ogre/ThirdParty/et/ETPrerequisites.h 2008-10-31 08:18:17 UTC (rev 785) +++ trunk/python-ogre/ThirdParty/et/ETPrerequisites.h 2008-11-03 07:40:08 UTC (rev 786) @@ -3,26 +3,20 @@ #include <OgrePlatform.h> -#define _ETManagerExport +// #if (OGRE_PLATFORM == OGRE_PLATFORM_WIN32 ) +// # ifdef ET_MANAGER_EXPORTS +// # define _ETManagerExport __declspec(dllexport) +// # else +// # if defined( __MINGW32__ ) +# define _ETManagerExport +// # else +// # define _ETManagerExport __declspec(dllimport) +// # endif +// # endif +// #elif defined ( OGRE_GCC_VISIBILITY ) +// # define _ETManagerExport __attribute__ ((visibility("default"))) +// #else +// # define _ETManagerExport +// #endif -// // #ifndef _ETManagerExport - -// // #if (OGRE_PLATFORM == OGRE_PLATFORM_WIN32 ) -// // # ifdef ET_MANAGER_EXPORTS -// // # define _ETManagerExport __declspec(dllexport) -// // # else -// // # if defined( __MINGW32__ ) -// // # define _ETManagerExport -// // # else -// // # define _ETManagerExport __declspec(dllimport) -// // # endif -// // # endif -// // #elif defined ( OGRE_GCC_VISIBILITY ) -// // # define _ETManagerExport __attribute__ ((visibility("default"))) -// // #else -// // # define _ETManagerExport -// // #endif - -// // #endif - #endif Modified: trunk/python-ogre/ThirdParty/et/ETSplattingManager.cpp =================================================================== --- trunk/python-ogre/ThirdParty/et/ETSplattingManager.cpp 2008-10-31 08:18:17 UTC (rev 785) +++ trunk/python-ogre/ThirdParty/et/ETSplattingManager.cpp 2008-11-03 07:40:08 UTC (rev 786) @@ -422,7 +422,11 @@ if (colours.size() > mImpl->numTextures) OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Given more colours than texture channels available.", __FUNCTION__); +#if OGRE_VERSION_MINOR > 4 + uchar* data = OGRE_ALLOC_T(uchar, mImpl->width*mImpl->height*3, MEMCATEGORY_GENERAL); +#else uchar* data = new uchar[mImpl->width*mImpl->height*3]; +#endif for (size_t y = 0; y < mImpl->height; ++y) { @@ -461,7 +465,11 @@ it->resize(scaleWidth, scaleHeight); // create the buffer to hold our generated base texture +#if OGRE_VERSION_MINOR > 4 + uchar* data = OGRE_ALLOC_T(uchar, width*height*3, MEMCATEGORY_GENERAL); +#else uchar* data = new uchar[width*height*3]; +#endif size_t pos = 0; for (size_t y = 0; y < height; ++y) { @@ -497,7 +505,11 @@ if (colourMap.getWidth() != lightMap.getWidth() || colourMap.getHeight() != lightMap.getHeight()) OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Images must have the same dimensions.", __FUNCTION__); +#if OGRE_VERSION_MINOR > 4 + uchar* data = OGRE_ALLOC_T(uchar, colourMap.getWidth()*colourMap.getHeight()*3, MEMCATEGORY_GENERAL); +#else uchar* data = new uchar[colourMap.getWidth()*colourMap.getHeight()*3]; +#endif for (size_t y = 0; y < colourMap.getWidth(); ++y) { Modified: trunk/python-ogre/ThirdParty/et/ETTerrainInfo.cpp =================================================================== --- trunk/python-ogre/ThirdParty/et/ETTerrainInfo.cpp 2008-10-31 08:18:17 UTC (rev 785) +++ trunk/python-ogre/ThirdParty/et/ETTerrainInfo.cpp 2008-11-03 07:40:08 UTC (rev 786) @@ -190,6 +190,25 @@ } + /** Addition from SongOfTheWeave */ + Vector3 TerrainInfo::getTangentAt(float x, float z) const + { + Ogre::Vector3 v3Return; + int flip = 1; + Vector3 here (x, getHeightAt(x, z), z); + Vector3 left (x - 1, getHeightAt(x - 1, z), z); + if (left.x < 0.0) + { + flip *= -1; + left = Vector3(x + 1, getHeightAt(x + 1, z), z); + } + left -= here; + v3Return = flip * left; + v3Return.normalise(); + return v3Return; + } + + std::pair<bool, Vector3> TerrainInfo::rayIntersects(const Ray& ray) const { AxisAlignedBox box = getExtents(); Modified: trunk/python-ogre/ThirdParty/et/ETTerrainInfo.h =================================================================== --- trunk/python-ogre/ThirdParty/et/ETTerrainInfo.h 2008-10-31 08:18:17 UTC (rev 785) +++ trunk/python-ogre/ThirdParty/et/ETTerrainInfo.h 2008-11-03 07:40:08 UTC (rev 786) @@ -107,6 +107,9 @@ /** Calculates the terrain normal at the given coordinates. */ Ogre::Vector3 getNormalAt(float x, float z) const; + /** Calculates the terrain tangent at the given coordinates. */ + Ogre::Vector3 getTangentAt(float x, float z) const; + /** * Checks if a ray intersects with the terrain. * @param ray The ray to check for intersection with the terrain. Modified: trunk/python-ogre/ThirdParty/et/ETTerrainManager.cpp =================================================================== --- trunk/python-ogre/ThirdParty/et/ETTerrainManager.cpp 2008-10-31 08:18:17 UTC (rev 785) +++ trunk/python-ogre/ThirdParty/et/ETTerrainManager.cpp 2008-11-03 07:40:08 UTC (rev 786) @@ -84,7 +84,7 @@ } - void TerrainImpl::createTerrain(const TerrainInfo& info, size_t tileSize, uint maxLOD, bool vertexNormals) + void TerrainImpl::createTerrain(const TerrainInfo& info, size_t tileSize, uint maxLOD, bool vertexNormals, bool vertexTangents) { // ensure we have a viewport height set if (mOpt.factorC <= 0) @@ -99,8 +99,11 @@ // load new terrain mInfo = info; mOpt.tileSize = tileSize; + if (maxLOD < 1) + maxLOD = 1; mOpt.maxMipMapLevel = min(maxLOD, maxPossibleLOD); mOpt.vertexNormals = vertexNormals; + mOpt.vertexTangents = vertexTangents; mIndexHandler = new IndexHandler(mOpt.tileSize, mOpt.maxMipMapLevel); createTiles(); @@ -332,9 +335,9 @@ delete mImpl; } - void TerrainManager::createTerrain(const TerrainInfo& info, size_t tileSize, uint maxLOD, bool vertexNormals) + void TerrainManager::createTerrain(const TerrainInfo& info, size_t tileSize, uint maxLOD, bool vertexNormals, bool vertexTangents) { - mImpl->createTerrain(info, tileSize, maxLOD, vertexNormals); + mImpl->createTerrain(info, tileSize, maxLOD, vertexNormals, vertexTangents); } void TerrainManager::destroyTerrain() Modified: trunk/python-ogre/ThirdParty/et/ETTerrainManager.h =================================================================== --- trunk/python-ogre/ThirdParty/et/ETTerrainManager.h 2008-10-31 08:18:17 UTC (rev 785) +++ trunk/python-ogre/ThirdParty/et/ETTerrainManager.h 2008-11-03 07:40:08 UTC (rev 786) @@ -77,8 +77,10 @@ * @param tileSize the tile size to use, must be (2^n+1) * @param maxLOD the maximal level of detail to be used * @param vertexNormals generate vertex normals? (necessary for dynamic lighting) + * @param vertexTangents generate vertex tangents? (necessary for adv. dynamic lighting) */ - void createTerrain(const TerrainInfo& info, size_t tileSize = 33, unsigned int maxLOD = 255, bool vertexNormals = false); + void createTerrain(const TerrainInfo& info, size_t tileSize = 33, unsigned int maxLOD = 255, + bool vertexNormals = false, bool vertexTangents = false); /** Destroys the currently loaded terrain (if any). */ void destroyTerrain(); Modified: trunk/python-ogre/ThirdParty/et/ETTile.cpp =================================================================== --- trunk/python-ogre/ThirdParty/et/ETTile.cpp 2008-10-31 08:18:17 UTC (rev 785) +++ trunk/python-ogre/ThirdParty/et/ETTile.cpp 2008-11-03 07:40:08 UTC (rev 786) @@ -55,8 +55,10 @@ mTerrain(0), mLastNextLevel(0) { + if (mOpt.maxMipMapLevel < 1) + mOpt.maxMipMapLevel = 1; // disable LOD morphing if max LOD is 1 - if (mOpt.maxMipMapLevel <= 1) + if (mOpt.maxMipMapLevel == 1) mOpt.useLODMorph = false; mCastShadows = false; @@ -70,6 +72,7 @@ Tile::~Tile() { + delete mTerrain; } const String& Tile::getMovableType() const @@ -160,6 +163,11 @@ decl->addElement(MAIN_BINDING, offset, VET_FLOAT3, VES_NORMAL); offset += VertexElement::getTypeSize(VET_FLOAT3); } + if (mOpt.vertexTangents) + { + decl->addElement(MAIN_BINDING, offset, VET_FLOAT3, VES_TANGENT); + offset += VertexElement::getTypeSize(VET_FLOAT3); + } decl->addElement(MAIN_BINDING, offset, VET_FLOAT2, VES_TEXTURE_COORDINATES, 0); offset += VertexElement::getTypeSize(VET_FLOAT2); @@ -239,6 +247,9 @@ // calc vertex normals, if necessary if (mOpt.vertexNormals) calculateVertexNormals(); + // calc vertex tangents, if necessary + if (mOpt.vertexTangents) + calculateVertexTangents(); } @@ -275,6 +286,38 @@ } + /** Addition by SongOfTheWeave */ + void Tile::calculateVertexTangents() + { + // set the vertex tangents of the tile + size_t startx = mStartX; + size_t startz = mStartZ; + size_t endx = startx + mOpt.tileSize; + size_t endz = startz + mOpt.tileSize; + //Real minHeight = mInfo.getOffset().y + mInfo.getScaling().y, maxHeight = mInfo.getOffset().y; + + const VertexElement* normElem = mTerrain->vertexDeclaration->findElementBySemantic(VES_TANGENT); + unsigned char* pBase = static_cast<unsigned char*>(mMainBuffer->lock(HardwareBuffer::HBL_NORMAL)); + + for (size_t j = startz; j < endz; ++j) + { + for (size_t i = startx; i < endx; ++i) + { + float* pTan; + normElem->baseVertexPointerToElement(pBase, &pTan); + + Vector3 tangent = mInfo.getTangentAt(mInfo.vertexToPosX((int)i), mInfo.vertexToPosZ((int)j)); + *pTan++ = tangent.x; + *pTan++ = tangent.y; + *pTan++ = tangent.z; + + pBase += mMainBuffer->getVertexSize(); + } + } + mMainBuffer->unlock(); + } + + IndexData* Tile::getIndexData() { IndexData* data = mIndexHandler->requestIndexData(mLOD, @@ -472,7 +515,7 @@ Real range = mLODChangeMinDistSqr[nextLevel] - mLODChangeMinDistSqr[mLOD]; Real percent = (L - mLODChangeMinDistSqr[mLOD]) / range; Real rescale = 1.0f / (1.0f - mOpt.lodMorphStart); - mLODMorphFactor = std::max((percent - mOpt.lodMorphStart), Real(0)); + mLODMorphFactor = std::max((percent - mOpt.lodMorphStart) * rescale, Real(0)); } if (mLastNextLevel != nextLevel) @@ -559,5 +602,14 @@ } +#if OGRE_VERSION_MINOR > 4 + /** Shoggoth compatibility function */ + void Tile::visitRenderables(Renderable::Visitor* visitor, bool debugRenderables) + { + visitor->visit(this, 0, false, 0); + } +#endif + + } } Modified: trunk/python-ogre/ThirdParty/et/Impl/ETOptions.h =================================================================== --- trunk/python-ogre/ThirdParty/et/Impl/ETOptions.h 2008-10-31 08:18:17 UTC (rev 785) +++ trunk/python-ogre/ThirdParty/et/Impl/ETOptions.h 2008-11-03 07:40:08 UTC (rev 786) @@ -44,6 +44,7 @@ float factorC; bool vertexNormals; + bool vertexTangents; bool useLODMorph; float lodMorphStart; Modified: trunk/python-ogre/ThirdParty/et/Impl/ETTerrainImpl.h =================================================================== --- trunk/python-ogre/ThirdParty/et/Impl/ETTerrainImpl.h 2008-10-31 08:18:17 UTC (rev 785) +++ trunk/python-ogre/ThirdParty/et/Impl/ETTerrainImpl.h 2008-11-03 07:40:08 UTC (rev 786) @@ -53,7 +53,7 @@ TerrainImpl(Ogre::SceneManager* sceneMgr, const std::string& name); ~TerrainImpl(); - void createTerrain(const TerrainInfo& info, size_t tileSize, unsigned int maxLOD, bool vertexNormals); + void createTerrain(const TerrainInfo& info, size_t tileSize, unsigned int maxLOD, bool vertexNormals, bool vertexTangents); void destroyTerrain(); bool isTerrainLoaded() const { return mTerrainLoaded; } Modified: trunk/python-ogre/ThirdParty/et/Impl/ETTile.h =================================================================== --- trunk/python-ogre/ThirdParty/et/Impl/ETTile.h 2008-10-31 08:18:17 UTC (rev 785) +++ trunk/python-ogre/ThirdParty/et/Impl/ETTile.h 2008-11-03 07:40:08 UTC (rev 786) @@ -105,6 +105,12 @@ */ void updateTerrain(size_t startx, size_t startz, size_t endx, size_t endz); + +#if OGRE_VERSION_MINOR > 4 + /** Shoggoth compatibility function */ + void visitRenderables(Ogre::Renderable::Visitor* visitor, bool debugRenderables); +#endif + private: /** Initialises the vertices */ void createVertexData(size_t startx, size_t startz); @@ -116,6 +122,9 @@ /** Calculates vertex normals */ void calculateVertexNormals(); + /** Calculates vertex tangents */ + void calculateVertexTangents(); + /** Retrieves the position vector for the given vertex */ Ogre::Vector3 getVector(size_t x, size_t z) const; Modified: trunk/python-ogre/code_generators/betagui/customization_data.py =================================================================== --- trunk/python-ogre/code_generators/betagui/customization_data.py 2008-10-31 08:18:17 UTC (rev 785) +++ trunk/python-ogre/code_generators/betagui/customization_data.py 2008-11-03 07:40:08 UTC (rev 786) @@ -1,6 +1,6 @@ def header_files( version ): - return [ 'BetaGUI.h'] + return [ 'BetaGUI2.h'] def huge_classes( version ): return [] Modified: trunk/python-ogre/code_generators/betagui/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/betagui/generate_code.py 2008-10-31 08:18:17 UTC (rev 785) +++ trunk/python-ogre/code_generators/betagui/generate_code.py 2008-11-03 07:40:08 UTC (rev 786) @@ -42,7 +42,7 @@ import common_utils.var_checker as varchecker import common_utils.ogre_properties as ogre_properties -MAIN_NAMESPACE = 'BetaGUI' +MAIN_NAMESPACE = 'BetaGUI2' ## small helper function def docit ( general, i, o ): @@ -99,26 +99,26 @@ global_ns = mb.global_ns main_ns = global_ns.namespace( MAIN_NAMESPACE ) - ## now expose but don't create class that exist in other modules - global_ns.namespace( 'Ogre' ).class_('OverlayContainer').include(already_exposed=True) - global_ns.namespace( 'Ogre' ).class_('Vector2').include(already_exposed=True) -# global_ns.namespace( 'Ogre' ).class_('Vector3').include(already_exposed=True) - global_ns.namespace( 'Ogre' ).class_('Vector4').include(already_exposed=True) - global_ns.namespace( 'Ogre' ).class_('RenderWindow').include(already_exposed=True) -# global_ns.namespace( 'Ogre' ).class_('RenderTexture').include(already_exposed=True) - global_ns.namespace( 'Ogre' ).class_('RenderOperation').include(already_exposed=True) -# global_ns.namespace( 'Ogre' ).class_('UTFString').include(already_exposed=True) -# global_ns.class_('::Ogre::FontPtr').include(already_exposed=True) -# global_ns.class_('::Ogre::RenderQueueListener').include(already_exposed=True) -# global_ns.class_('::Ogre::SceneManager').include(already_exposed=True) +# ## now expose but don't create class that exist in other modules +# global_ns.namespace( 'Ogre' ).class_('OverlayContainer').include(already_exposed=True) +# global_ns.namespace( 'Ogre' ).class_('Vector2').include(already_exposed=True) +# # global_ns.namespace( 'Ogre' ).class_('Vector3').include(already_exposed=True) +# global_ns.namespace( 'Ogre' ).class_('Vector4').include(already_exposed=True) +# global_ns.namespace( 'Ogre' ).class_('RenderWindow').include(already_exposed=True) +# # global_ns.namespace( 'Ogre' ).class_('RenderTexture').include(already_exposed=True) +# global_ns.namespace( 'Ogre' ).class_('RenderOperation').include(already_exposed=True) +# # global_ns.namespace( 'Ogre' ).class_('UTFString').include(already_exposed=True) +# # global_ns.class_('::Ogre::FontPtr').include(already_exposed=True) +# # global_ns.class_('::Ogre::RenderQueueListener').include(already_exposed=True) +# # global_ns.class_('::Ogre::SceneManager').include(already_exposed=True) +# # +# # +# # global_ns.namespace( 'Ogre' ).class_('Singleton<QuickGUI::GUIManager>').include() #already_exposed=True) +# # global_ns.namespace( 'Ogre' ).class_('Singleton<QuickGUI::MouseCursor>').include() #already_exposed=True) +# # global_ns.namespace( 'Ogre' ).class_('Singleton<QuickGUI::FontManager>').include() #already_exposed=True) # -# -# global_ns.namespace( 'Ogre' ).class_('Singleton<QuickGUI::GUIManager>').include() #already_exposed=True) -# global_ns.namespace( 'Ogre' ).class_('Singleton<QuickGUI::MouseCursor>').include() #already_exposed=True) -# global_ns.namespace( 'Ogre' ).class_('Singleton<QuickGUI::FontManager>').include() #already_exposed=True) - -# global_ns.namespace( 'Ogre' ).class_('PanelOverlayElement').include(already_exposed=True) -# global_ns.namespace( 'Ogre' ).class_('TextAreaOverlayElement').include(already_exposed=True) +# # global_ns.namespace( 'Ogre' ).class_('PanelOverlayElement').include(already_exposed=True) +# # global_ns.namespace( 'Ogre' ).class_('TextAreaOverlayElement').include(already_exposed=True) Modified: trunk/python-ogre/code_generators/betagui/python_betagui.h =================================================================== --- trunk/python-ogre/code_generators/betagui/python_betagui.h 2008-10-31 08:18:17 UTC (rev 785) +++ trunk/python-ogre/code_generators/betagui/python_betagui.h 2008-11-03 07:40:08 UTC (rev 786) @@ -1,4 +1,5 @@ -#include "BetaGUI.h" +typedef float NxReal; +#include "BetaGUI2.h" // First we create a magic namespace to hold all our aliases namespace pyplusplus { namespace aliases { @@ -8,9 +9,9 @@ // then we exposed everything needed (and more) to ensure GCCXML makes them visible to Py++ // -namespace python_BetaGUI{ namespace details{ +namespace python_BetaGUI2{ namespace details{ inline void instantiate(){ - using namespace BetaGUI; + using namespace BetaGUI2; #include "python_betagui_sizeof.h" } } } Modified: trunk/python-ogre/demos/ogre/Demo_Bezier.py =================================================================== --- trunk/python-ogre/demos/ogre/Demo_Bezier.py 2008-10-31 08:18:17 UTC (rev 785) +++ trunk/python-ogre/demos/ogre/Demo_Bezier.py 2008-11-03 07:40:08 UTC (rev 786) @@ -241,11 +241,11 @@ sf.Application.debugText = "STARTED" - def _destroyScene(self): +# # # def __del__(self): +# # # +# # # ## free up the pointer before we shut down OGRE +# # # patch.setNull() - ## free up the pointer before we shut down OGRE - patch.setNull() - def _createFrameListener(self): self.frameListener = BezierListener(self.renderWindow, self.camera) self.root.addFrameListener(self.frameListener) Modified: trunk/python-ogre/demos/ogre/Demo_Smoke.py =================================================================== --- trunk/python-ogre/demos/ogre/Demo_Smoke.py 2008-10-31 08:18:17 UTC (rev 785) +++ trunk/python-ogre/demos/ogre/Demo_Smoke.py 2008-11-03 07:40:08 UTC (rev 786) @@ -27,11 +27,13 @@ self.fountainNode = sceneManager.getRootSceneNode().createChildSceneNode() psm = ogre.ParticleSystemManager.getSingleton() - particleSystem2 = sceneManager.createParticleSystem('fountain1', 'Examples/Smoke') + self.particleSystem2 = sceneManager.createParticleSystem('fountain1', 'Examples/Smoke') node = self.fountainNode.createChildSceneNode() - node.attachObject(particleSystem2) + node.attachObject(self.particleSystem2) - + def __del__(self): + del self.particleSystem2 + sf.Application.__del__(self) if __name__ == '__main__': try: Modified: trunk/python-ogre/demos/plugins.cfg =================================================================== --- trunk/python-ogre/demos/plugins.cfg 2008-10-31 08:18:17 UTC (rev 785) +++ trunk/python-ogre/demos/plugins.cfg 2008-11-03 07:40:08 UTC (rev 786) @@ -2,23 +2,22 @@ ## Use this for Windows # Define plugin folder -#PluginFolder=../../plugins -#Plugin=RenderSystem_GL.dll -#Plugin=RenderSystem_Direct3D9.dll -#Plugin=Plugin_ParticleFX.dll -#Plugin=Plugin_BSPSceneManager.dll -#Plugin=Plugin_OctreeSceneManager.dll -#Plugin=Plugin_CgProgramManager.dll -#Plugin=Plugin_PCZSceneManager.dll -#Plugin=Plugin_OctreeZone.dll -#Plugin=Plugin_OctreeSceneManager.dll +PluginFolder=../../plugins +Plugin=RenderSystem_GL.dll +Plugin=RenderSystem_Direct3D9.dll +Plugin=Plugin_ParticleFX.dll +Plugin=Plugin_BSPSceneManager.dll +Plugin=Plugin_CgProgramManager.dll +Plugin=Plugin_PCZSceneManager.dll +Plugin=Plugin_OctreeZone.dll +Plugin=Plugin_OctreeSceneManager.dll ## ## NOTE use this for MacOS or Linux -PluginFolder=/home/andy/development/root/usr/lib/OGRE -Plugin=RenderSystem_GL -Plugin=Plugin_ParticleFX -Plugin=Plugin_BSPSceneManager -Plugin=Plugin_OctreeSceneManager -Plugin=Plugin_CgProgramManager +#PluginFolder=/home/andy/development/root/usr/lib/OGRE +#Plugin=RenderSystem_GL +#Plugin=Plugin_ParticleFX +#Plugin=Plugin_BSPSceneManager +#Plugin=Plugin_OctreeSceneManager +#Plugin=Plugin_CgProgramManager Modified: trunk/python-ogre/environment.py =================================================================== --- trunk/python-ogre/environment.py 2008-10-31 08:18:17 UTC (rev 785) +++ trunk/python-ogre/environment.py 2008-11-03 07:40:08 UTC (rev 786) @@ -1119,21 +1119,26 @@ class betagui: active = True pythonModule = True - version="1.7" + version="2" name='betagui' parent="ogre/gui" CCFLAGS = ' ' # -D"FT2_BUILD_LIBRARY" cflags="" include_dirs = [ Config.PATH_Boost, Config.PATH_INCLUDE_Ogre, + Config.PATH_INCLUDE_OIS, Config.PATH_INCLUDE_betagui ] lib_dirs = [Config.PATH_LIB_Boost, Config.PATH_LIB_Ogre_OgreMain, - Config.PATH_LIB_betagui + Config.PATH_LIB_betagui, + Config.PATH_LIB_OIS ] CheckIncludes=[] - libs=[ boost.lib, 'OgreMain' ] + libs=[ boost.lib, 'OgreMain', 'OIS_Static' ] + if os.name=="nt": + libs.append ( "User32" ) # needed for static linking + ModuleName="betagui" class ogreforests: @@ -1389,20 +1394,20 @@ ["wget", "http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.0.tar.gz",downloadPath], ] buildCmds = [ -# [0, "tar zxf " + os.path.join(downloadPath, "openal-0.0.8.tar.gz"), ''], +# [0, "tar zxf " + os.path.join(downloadPath, "openal-0.0.8.tar.gz"), ''], [0, "tar jxf " + os.path.join(downloadPath, "openal-soft-1.5.304.tar.bz2"), ''], [0, "tar zxf " + os.path.join(downloadPath, "libogg-1.1.3.tar.gz"), ''], [0, "tar zxf " + os.path.join(downloadPath, "libvorbis-1.2.0.tar.gz"), ''], [0, "./configure --prefix=%s\nmake\nmake install" % PREFIX, os.path.join(os.getcwd(), "libogg-1.1.3")], - - [0, "./configure --prefix=%s\nmake\nmake install" % PREFIX, os.path.join(os.getcwd(), "libvorbis-1.2.0")], - - [0,"cmake -DCMAKE_INSTALL_PREFIX:PATH="+ PREFIX, os.path.join(os.getcwd(),'openal-soft-1.5.304')], - [0,"make ", os.path.join(os.getcwd(),'openal-soft-1.5.304')], - [0,"cp -p libopenal* %s/lib " % PREFIX, os.path.join(os.getcwd(),'openal-soft-1.5.304')], - [0,"cp -p * %s/include " % PREFIX, os.path.join(os.getcwd(),'openal-soft-1.5.304', 'include','AL')] - + + [0, "./configure --prefix=%s\nmake\nmake install" % PREFIX, os.path.join(os.getcwd(), "libvorbis-1.2.0")], + + [0,"cmake -DCMAKE_INSTALL_PREFIX:PATH="+ PREFIX, os.path.join(os.getcwd(),'openal-soft-1.5.304')], + [0,"make ", os.path.join(os.getcwd(),'openal-soft-1.5.304')], + [0,"cp -p libopenal* %s/lib " % PREFIX, os.path.join(os.getcwd(),'openal-soft-1.5.304')], + [0,"cp -p * %s/include " % PREFIX, os.path.join(os.getcwd(),'openal-soft-1.5.304', 'include','AL')] + # [0, "sed --in-place -s 's|( ALCvoid )|()|' alc.h",os.path.join(os.getcwd(),"openal-0.0.8","common", "include", "AL")], # [0, "aclocal\n./autogen.sh", os.path.join(os.getcwd(),"openal-0.0.8")], # [0, "./configure --prefix=%s\nmake\nmake install" % PREFIX, os.path.join(os.getcwd(), "openal-0.0.8")] @@ -1470,7 +1475,7 @@ class et: ## editable terrain active = True pythonModule = True - version= "2.2" + version= "2.3.1" name='et' parent = "ogre/addons" if isLinux(): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2008-11-08 01:46:56
|
Revision: 788 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=788&view=rev Author: andy_miller Date: 2008-11-08 01:46:46 +0000 (Sat, 08 Nov 2008) Log Message: ----------- Further updated for Ogre 1.6 release Modified Paths: -------------- trunk/python-ogre/demos/ogre/Demo_Compositor.py trunk/python-ogre/demos/ogre/tests/Test_ManualMeshes.py trunk/python-ogre/environment.py Added Paths: ----------- trunk/python-ogre/patch/ogre_1.6.0.patch Modified: trunk/python-ogre/demos/ogre/Demo_Compositor.py =================================================================== --- trunk/python-ogre/demos/ogre/Demo_Compositor.py 2008-11-03 07:41:04 UTC (rev 787) +++ trunk/python-ogre/demos/ogre/Demo_Compositor.py 2008-11-08 01:46:46 UTC (rev 788) @@ -1,3 +1,4 @@ +# NO_UNITTEST # This code is in the Public Domain # ----------------------------------------------------------------------------- # This source file is part of Python-Ogre Modified: trunk/python-ogre/demos/ogre/tests/Test_ManualMeshes.py =================================================================== --- trunk/python-ogre/demos/ogre/tests/Test_ManualMeshes.py 2008-11-03 07:41:04 UTC (rev 787) +++ trunk/python-ogre/demos/ogre/tests/Test_ManualMeshes.py 2008-11-08 01:46:46 UTC (rev 788) @@ -21,8 +21,8 @@ assert len(Vertices_Pos)==len(Vertices_Colour) meshMgr = ogre.MeshManager.getSingleton() - self.mesh = mesh = meshMgr.createManual(Name, ogre.ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME) - self.subMesh = subMesh = mesh.createSubMesh() + self.mesh = meshMgr.createManual(Name, ogre.ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME) + self.subMesh = mesh.createSubMesh() POSITION_ELEMENT = 0 NORMAL_ELEMENT = 1 @@ -40,7 +40,7 @@ #work-around to prevent destruction self.sharedVertexData = mesh.sharedVertexData - declaration = mesh.sharedVertexData.vertexDeclaration + declaration = self.mesh.sharedVertexData.vertexDeclaration offset = 0 offset += ogre.VertexElement.getTypeSize(ogre.VET_FLOAT3) declaration.addElement(0, offset, ogre.VET_FLOAT3, ogre.VES_POSITION) @@ -56,15 +56,37 @@ # # pVertex = vbuf.lock(declaration, ogre.HardwareBuffer.HBL_DISCARD) pVertex = vbuf.lock(ogre.HardwareBuffer.HBL_DISCARD) - + print pVertex + + pVert= ( ctypes.c_float * (mesh.sharedVertexData.vertexCount)).from_address ( ogre.CastInt ( pVertex ) ) #loop through the position array + index = 0 for i in range(len(Vertices_Pos)): vx, vy, vz = Vertices_Pos[i] nx, ny, nz = Vertices_Norm[i] - + pVert[i pVertex.setFloat(i, POSITION_ELEMENT, vx, vy, vz) pVertex.setFloat(i, NORMAL_ELEMENT, nx, ny, nz) + + index = 0 + for i in range ( 3 ): + off = i*4 + pVert[ index ] = 0 + off + index +=1 + pVert[ index ] = 3 + off + index +=1 + pVert[ index ] = 1 + off + index +=1 + pVert[ index ] = 0 + off + index +=1 + pVert[ index ] = 2 + off + index +=1 + pVert[ index ] = 3 + off + index +=1 + + + bind = mesh.sharedVertexData.vertexBufferBinding bind.setBinding(0,vbuf) #Set vertex buffer binding so buffer 0 is bound to positional data @@ -194,8 +216,12 @@ # colours.append(rs.convertColourValue(ogre.ColourValue(0.0,1.0,1.0))) #6 colour # colours.append(rs.convertColourValue(ogre.ColourValue(0.0,0.0,1.0))) #7 colour - ManuallyDefinedMesh("cubeMesh",vert_pos,vert_norm,faces ) #,colours) + mm = ManuallyDefinedMesh("cubeMesh",vert_pos,vert_norm,faces ) #,colours) + print mm + mm.Print() + + self.cubeEntity = sceneManager.createEntity("myCubeEntity", "cubeMesh") self.cubeEntity.setMaterialName("Test/SimpleVertexColor") self.nd=sceneManager.rootSceneNode.createChildSceneNode() Modified: trunk/python-ogre/environment.py =================================================================== --- trunk/python-ogre/environment.py 2008-11-03 07:41:04 UTC (rev 787) +++ trunk/python-ogre/environment.py 2008-11-08 01:46:46 UTC (rev 788) @@ -575,32 +575,32 @@ if isWindows(): if _STABLE or not _STABLE: ## temp force to this version... - version="1.6.0RC1" + version="1.6.0" source = [ [ wget, "http://downloads.sourceforge.net/ogre/OgreDependencies_VC9_Eihort_20080203.zip", downloadPath], - [ wget, "http://downloads.sourceforge.net/ogre/ogre-v1-6-0RC1.zip", downloadPath], + [ wget, "http://downloads.sourceforge.net/ogre/ogre-v1-6-0.zip", downloadPath], ] buildCmds = [ - [0, unzip + os.path.join(downloadPath,"ogre-v1-6-0RC1.zip"),os.getcwd() ], + [0, unzip + os.path.join(downloadPath,"ogre-v1-6-0.zip"),os.getcwd() ], [0, unzip + os.path.join(downloadPath,"OgreDependencies_VC9_Eihort_20080203.zip"), os.path.join(os.getcwd(), 'ogre') ], - [0, "patch -s -N -i ./python-ogre/patch/ogre_1.6.0RC2.patch -p0 ", os.getcwd()], + [0, "patch -s -N -i ./python-ogre/patch/ogre_1.6.0.patch -p0 ", os.getcwd()], [0,'echo Please use MSVC Express Edition to build Ogre Release.',''] ] - else: +# else: +# +# version="trunk" +# source = [ +# [ wget, "http://downloads.sourceforge.net/ogre/OgreDependencies_VC9_Eihort_20080203.zip", downloadPath], +# [ svn, "https://svn.ogre3d.org/svnroot/ogre/trunk", os.path.join(os.getcwd(), 'ogre')] +# ] +# buildCmds = [ +# [0, unzip + os.path.join(downloadPath,"OgreDependencies_VC9_Eihort_20080203.zip"), +# os.path.join(os.getcwd(), 'ogre') ], +# [0, "patch -s -N -i ./python-ogre/patch/ogre_1.6.patch -p0 ", os.getcwd()], +# [0,'echo Please use MSVC Express Edition to build Ogre Release.',''] +# ] - version="1.7" - source = [ - [ wget, "http://downloads.sourceforge.net/ogre/OgreDependencies_VC9_Eihort_20080203.zip", downloadPath], - [ svn, "https://svn.ogre3d.org/svnroot/ogre/branches/v1-6", os.path.join(os.getcwd(), 'ogre')] - ] - buildCmds = [ - [0, unzip + os.path.join(downloadPath,"OgreDependencies_VC9_Eihort_20080203.zip"), - os.path.join(os.getcwd(), 'ogre') ], - [0, "patch -s -N -i ./python-ogre/patch/ogre_1.6.patch -p0 ", os.getcwd()], - [0,'echo Please use MSVC Express Edition to build Ogre Release.',''] - ] - # requirements to build a precompiled header on the fly if _PreCompiled: pchstop = 'python_ogre_precompiled.h' @@ -635,11 +635,11 @@ [0, "make install", os.path.join(os.getcwd(), 'ogre')], ] else: - version = "1.6.0RC1" - base = "ogre-v1-6-0RC1" + version = "1.6.0" + base = "ogre-v1-6-0" buildCmds = [ [0, tar + " jxf " + os.path.join(downloadPath,base)+".tar.bz2 --overwrite",os.getcwd() ], - [0, "patch -s -N -i ./python-ogre/patch/ogre_1.6.0RC1.patch -p0 ", os.getcwd()], + [0, "patch -s -N -i ./python-ogre/patch/ogre_1.6.0.patch -p0 ", os.getcwd()], [0, "aclocal", os.path.join(os.getcwd(), 'ogre')], [0, "./bootstrap", os.path.join(os.getcwd(), 'ogre')], [0, "./configure --prefix=%s --with-gui=Xt --disable-devil" % PREFIX, os.path.join(os.getcwd(), 'ogre')], Added: trunk/python-ogre/patch/ogre_1.6.0.patch =================================================================== --- trunk/python-ogre/patch/ogre_1.6.0.patch (rev 0) +++ trunk/python-ogre/patch/ogre_1.6.0.patch 2008-11-08 01:46:46 UTC (rev 788) @@ -0,0 +1,188 @@ +Index: ogre/Samples/Common/include/ExampleFrameListener.h +=================================================================== +--- ogre/Samples/Common/include/ExampleFrameListener.h (revision 8145) ++++ ogre/Samples/Common/include/ExampleFrameListener.h (working copy) +@@ -41,7 +41,7 @@ + + //Use this define to signify OIS will be used as a DLL + //(so that dll import/export macros are in effect) +-#define OIS_DYNAMIC_LIB ++//#define OIS_DYNAMIC_LIB + #include <OIS/OIS.h> + + using namespace Ogre; +Index: ogre/OgreMain/include/OgreMovableObject.h +=================================================================== +--- ogre/OgreMain/include/OgreMovableObject.h (revision 8145) ++++ ogre/OgreMain/include/OgreMovableObject.h (working copy) +@@ -482,7 +482,7 @@ + included too. + */ + virtual void visitRenderables(Renderable::Visitor* visitor, +- bool debugRenderables = false) = 0; ++ bool debugRenderables = false) { throw std::runtime_error ( std::string ("Virtual function MovableObject::visitRenderables called!") ); } + + /** Sets whether or not the debug display of this object is enabled. + @remarks +Index: ogre/OgreMain/include/OgreRenderQueueListener.h +=================================================================== +--- ogre/OgreMain/include/OgreRenderQueueListener.h (revision 8145) ++++ ogre/OgreMain/include/OgreRenderQueueListener.h (working copy) +@@ -31,7 +31,9 @@ + + #include "OgrePrerequisites.h" + #include "OgreRenderQueue.h" ++#include <stdexcept> + ++ + namespace Ogre { + + /** Abstract interface which classes must implement if they wish to receive +@@ -65,7 +67,7 @@ + for this queue group. + */ + virtual void renderQueueStarted(uint8 queueGroupId, const String& invocation, +- bool& skipThisInvocation) = 0; ++ bool& skipThisInvocation) { throw std::runtime_error ( std::string ("Virtual function RenderQueueListener::renderQueueStarted called!") ); } + + /** Event raised after a queue group is rendered. + @remarks +@@ -80,7 +82,7 @@ + events will also be fired for it again. + */ + virtual void renderQueueEnded(uint8 queueGroupId, const String& invocation, +- bool& repeatThisInvocation) = 0; ++ bool& repeatThisInvocation) { throw std::runtime_error ( std::string ("Virtual function RenderQueueListener::renderQueueEnded called!") ); } + }; + + } +Index: ogre/OgreMain/include/OgreResourceGroupManager.h +=================================================================== +--- ogre/OgreMain/include/OgreResourceGroupManager.h (revision 8145) ++++ ogre/OgreMain/include/OgreResourceGroupManager.h (working copy) +@@ -37,6 +37,7 @@ + #include "OgreArchive.h" + #include "OgreIteratorWrappers.h" + #include <ctime> ++#include <stdexcept> + + namespace Ogre { + +@@ -92,7 +93,7 @@ + parsed. Note that in this case the scriptParseEnded event will not be raised + for this script. + */ +- virtual void scriptParseStarted(const String& scriptName, bool& skipThisScript) = 0; ++ virtual void scriptParseStarted(const String& scriptName, bool& skipThisScript) { throw std::runtime_error ( std::string ("Virtual function ResourceGroupListener::scriptParseStarted called!") ); } + + /** This event is fired when the script has been fully parsed. + */ +Index: ogre/OgreMain/include/OgreDataStream.h +=================================================================== +--- ogre/OgreMain/include/OgreDataStream.h (revision 8145) ++++ ogre/OgreMain/include/OgreDataStream.h (working copy) +@@ -33,6 +33,7 @@ + #include "OgreString.h" + #include "OgreSharedPtr.h" + #include <istream> ++#include <stdexcept> + + namespace Ogre { + +@@ -79,7 +80,7 @@ + @param count Number of bytes to read + @returns The number of bytes read + */ +- virtual size_t read(void* buf, size_t count) = 0; ++ virtual size_t read(void* buf, size_t count) { throw std::runtime_error ( std::string ("Virtual function DataStream::read called!") ); } + /** Get a single line from the stream. + @remarks + The delimiter character is not included in the data +Index: ogre/OgreMain/include/OgreConfig.h +=================================================================== +--- ogre/OgreMain/include/OgreConfig.h (revision 8145) ++++ ogre/OgreMain/include/OgreConfig.h (working copy) +@@ -87,7 +87,7 @@ + #define OGRE_MEMORY_ALLOCATOR_NED 2 // you need to have nedmalloc on your path for this + #define OGRE_MEMORY_ALLOCATOR_USER 3 + +-#define OGRE_MEMORY_ALLOCATOR OGRE_MEMORY_ALLOCATOR_STD ++#define OGRE_MEMORY_ALLOCATOR OGRE_MEMORY_ALLOCATOR_NED + + // enable or disable the memory tracker, recording the memory allocations & tracking leaks + // default is to disable since it's expensive, but you can enable if needed per build target +@@ -123,7 +123,7 @@ + to be done in the background. + */ + #ifndef OGRE_THREAD_SUPPORT +-#define OGRE_THREAD_SUPPORT 0 ++#define OGRE_THREAD_SUPPORT 1 + #endif + #if OGRE_THREAD_SUPPORT != 0 && OGRE_THREAD_SUPPORT != 1 && OGRE_THREAD_SUPPORT != 2 + #define OGRE_THREAD_SUPPORT 1 +Index: ogre/OgreMain/include/OgreHardwareBuffer.h +=================================================================== +--- ogre/OgreMain/include/OgreHardwareBuffer.h (revision 8145) ++++ ogre/OgreMain/include/OgreHardwareBuffer.h (working copy) +@@ -31,7 +31,9 @@ + + // Precompiler options + #include "OgrePrerequisites.h" ++#include <stdexcept> + ++ + namespace Ogre { + + /** Abstract class defining common features of hardware buffers. +@@ -244,7 +246,7 @@ + @param pDest The area of memory in which to place the data, must be large enough to + accommodate the data! + */ +- virtual void readData(size_t offset, size_t length, void* pDest) = 0; ++ virtual void readData(size_t offset, size_t length, void* pDest) { throw std::runtime_error ( std::string ("Virtual function HardwareBuffer::readData called!") ); } + /** Writes data to the buffer from an area of system memory; note that you must + ensure that your buffer is big enough. + @param offset The byte offset from the start of the buffer to start writing +@@ -254,7 +256,7 @@ + such that DMA stalls can be avoided; use if you can. + */ + virtual void writeData(size_t offset, size_t length, const void* pSource, +- bool discardWholeBuffer = false) = 0; ++ bool discardWholeBuffer = false) { throw std::runtime_error ( std::string ("Virtual function HardwareBuffer::writeData called!") ); } + + /** Copy data from another buffer into this one. + @remarks +Index: ogre/OgreMain/include/OgreAtomicWrappers.h +=================================================================== +--- ogre/OgreMain/include/OgreAtomicWrappers.h (revision 8145) ++++ ogre/OgreMain/include/OgreAtomicWrappers.h (working copy) +@@ -170,7 +170,7 @@ + + } + +- #elif OGRE_COMPILER == OGRE_COMPILER_MSVC && OGRE_THREAD_SUPPORT ++ #elif OGRE_COMPILER == OGRE_COMPILER_MSVC && OGRE_THREAD_SUPPORT && ! defined(__PYTHONOGRE_BUILD_CODE) + + #undef NOMINMAX + #define NOMINMAX +Index: ogre/ReferenceApplication/ReferenceAppLayer/OgreRefAppWorld.cpp +=================================================================== +--- ogre/ReferenceApplication/ReferenceAppLayer/OgreRefAppWorld.cpp (revision 8151) ++++ ogre/ReferenceApplication/ReferenceAppLayer/OgreRefAppWorld.cpp (working copy) +@@ -54,6 +54,8 @@ + mSimulationStepSize = 0.01f; + + // Create the dynamics world ++ dInitODE2(0); ++ + mOdeWorld = new dWorld(); + mOdeContactGroup = new dJointGroup(); + +@@ -79,6 +81,7 @@ + // Destroy dynamix world + delete mOdeContactGroup; + delete mOdeWorld; ++ dCloseODE(); + + } + //------------------------------------------------------------------------- \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2008-11-15 01:16:17
|
Revision: 793 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=793&view=rev Author: andy_miller Date: 2008-11-15 01:16:12 +0000 (Sat, 15 Nov 2008) Log Message: ----------- Remove the docs dir from the svn Fix for Py++ etc now being and https svn access Fix to CEGUI demo (thanks Dermont) Tweak to config files Modified Paths: -------------- trunk/python-ogre/ChangeLog.txt trunk/python-ogre/PythonOgreConfig_posix.py trunk/python-ogre/PythonOgreInstallCreator.iss trunk/python-ogre/demos/cegui/Demo_CEGUI_Treev061.py trunk/python-ogre/environment.py Removed Paths: ------------- trunk/python-ogre/docs/ Modified: trunk/python-ogre/ChangeLog.txt =================================================================== --- trunk/python-ogre/ChangeLog.txt 2008-11-14 07:22:21 UTC (rev 792) +++ trunk/python-ogre/ChangeLog.txt 2008-11-15 01:16:12 UTC (rev 793) @@ -1,31 +1,38 @@ -xxxx xx 2008 : Release 1.6.0 xxxx +November 14 2008 : Release 1.6.0 ================================== -Fixed to smart pointer handling in Ogre -- getting clever about detecting them as arguments as well as return types -Fixed QuickGui with static consts not having default value and causing a boost load error -Removed constant 'vars' and replaced them with properties that return a copy of the object. Specifically ZERO, UNIT_X, - UNIT_Y, UNIT_Z, Black, White, Red, Green, Blue in Classes ColourValue, MatrixX, Quaternion and VectorX. - this is due to the fact they were actually passing a pointer to a non constant (mutable) variable which +Run "python ReportVersion.py" to get the module version information + +** Various Fixes/Changes ** +Fix: PSSM camera functionality - it was missing from the sizeof.h file +Fix: Smart pointer handling in Ogre -- getting clever about detecting them as arguments as well as return types +Fix: QuickGui with static consts not having default value and causing a boost load error +Fix/Update/Change: Removed constant 'vars' and replaced them with properties that return a copy of the object. + Specifically ZERO, UNIT_X, UNIT_Y, UNIT_Z, Black, White, Red, Green, Blue in Classes ColourValue, MatrixX, + Quaternion and VectorX. + This is due to the fact they were actually passing a pointer to a non constant (mutable) variable which caused very annoying bugs. So now Ogre.Vector3.ZERO has to be replaced with Ogre.Vector3().ZERO etc... +Fix: Auto transform funtion to not wrap reference arguments that are const (bug) +Fix: Auto transform funtion to handle extern free functions +Fix: to Py++ to handle bool/int references correctly (renderQueueListener functions) +Fix: a couple of incorrect versions in environment.py +Fix: code generation for QuickGui, bullet and noise to correctly generate PyDoc documentation strings -Changed all code generation modules to use the common_code Auto_Functional_Transformation function -Fix auto transform funtion to not wrap reference arguments that are const (bug) -Fix auto transform funtion to handle extern free functions -Removed 'asClassType' functions as they didn't actually do anything (and are not needed) -Added PSSM camera functionality - it was missing from the sizeof.h file -Added helper functions to OgreODE as constructors needed hand wrapping (makeTriangleMeshGeometry, makeConvexGeometry) -Fix to Py++ to handle bool/int references correctly (renderQueueListener functions) -Simplified Ogre patch file requirements due to fix in Py++ for bool refs -Fixed a couple of incorrect versions in environment.py -Added opensteer source code and inital wrapper -- not done yet -Updates to QuickGUI and Caelum C++ library source -Implemented Hikari demo (implemented callbacks in the wrapper generation) -Fixed code generation for QuickGui, bullet and noise to correctly generate PyDoc documentation strings -Implemented description text and description links in environment.py to help automate module summary -Changes to SampleFramework - additional function (_inputSystemParameters ) to pass parameters to OIS setup - see Hikari demo -Changes to SampleFramework - Move code from frameStarted to frameRenderingQueue +Change: All code generation modules to use the common_code Auto_Functional_Transformation function +Change: Added helper functions to OgreODE as constructors needed hand wrapping (makeTriangleMeshGeometry, makeConvexGeometry) +Change: Simplified Ogre patch file requirements due to fix in Py++ for bool refs +Change: Using OpenAL-soft-1.5.304 as this makes it consistant between platforms +Change: Including source libs and header files in the release so people can link c++ code with Python-Ogre modules +Update: NxOgre using 0.22 +Update: Removed 'asClassType' functions as they didn't actually do anything (and are not needed) +Update: All libraries including to QuickGUI and Caelum +Update: Implemented Hikari demo (implemented callbacks in the wrapper generation) +Update: Implemented description text and description links in environment.py to help automate module summary +Update: SampleFramework - additional function (_inputSystemParameters ) to pass parameters to OIS setup - see Hikari demo +Update: SampleFramework - Move code from frameStarted to frameRenderingQueue + August 29 2008 : Release 1.6.0 RC1 ================================== The Python-Ogre version numbering has changed to match the Ogre release versions along with the SVN release numbering Modified: trunk/python-ogre/PythonOgreConfig_posix.py =================================================================== --- trunk/python-ogre/PythonOgreConfig_posix.py 2008-11-14 07:22:21 UTC (rev 792) +++ trunk/python-ogre/PythonOgreConfig_posix.py 2008-11-15 01:16:12 UTC (rev 793) @@ -70,7 +70,7 @@ PATH_NxOgre= os.path.join(PATH_THIRDPARTY, 'nxogre') PATH_NxOgre_09= os.path.join(PATH_THIRDPARTY, 'nxogre_0.9') # PATH_NxOgre= os.path.join(BASE_DIR, 'nxogre/NxOgre') -PATH_Bullet= os.path.join(BASE_DIR, 'bullet-2.69') +PATH_Bullet= os.path.join(BASE_DIR, 'bullet-2.70') ###PATH_PhysX= os.path.join(BASE_DIR, 'Physx/v2.7.3/SDKs') PATH_Theora= os.path.join(PATH_OgreAddons,'videoplugin','TheoraVideo') PATH_ffmpeg= os.path.join(BASE_DIR, 'ffmpeg') Modified: trunk/python-ogre/PythonOgreInstallCreator.iss =================================================================== --- trunk/python-ogre/PythonOgreInstallCreator.iss 2008-11-14 07:22:21 UTC (rev 792) +++ trunk/python-ogre/PythonOgreInstallCreator.iss 2008-11-15 01:16:12 UTC (rev 793) @@ -3,13 +3,13 @@ ; [Setup] AppName=Python-Ogre -AppVerName=Python-Ogre 1.6RC1 +AppVerName=Python-Ogre 1.6.0 DefaultDirName=C:\PythonOgre DefaultGroupName=Python-Ogre OutputBaseFilename=PythonOgreInstaller OutputDir=C:\temp SourceDir=C:\Development\PythonOgreRelease -VersionInfoDescription=Release 1.6RC1 of Python-Ogre +VersionInfoDescription=Release 1.6.0 of Python-Ogre AllowNoIcons=true AppPublisher=OpenSource (Andy and Team) AppPublisherURL=http://www.python-ogre.org @@ -37,6 +37,8 @@ Source: plugins\*; DestDir: {app}\plugins Source: tools\*; DestDir: {app}\tools Source: docs\*; DestDir: {app}\docs +Source: SourceLibs\*; DestDir: {app}\SourceLibs; Flags: recursesubdirs + Source: ThirdParty\dxwebsetup.exe; DestDir: {app}\ThirdParty Source: ThirdParty\vcredist_x86.exe; DestDir: {app}\ThirdParty @@ -62,7 +64,11 @@ Source: demos\plib\*; DestDir: {app}\demos\plib; Flags: recursesubdirs Source: demos\qgui\*; DestDir: {app}\demos\qgui; Flags: recursesubdirs Source: demos\theora\*; DestDir: {app}\demos\theora; Flags: recursesubdirs +Source: demos\hikari\*; DestDir: {app}\demos\hikari; Flags: recursesubdirs +Source: demos\PSSM\*; DestDir: {app}\demos\PSSM; Flags: recursesubdirs + + ; the python modules - in the event we find python Source: packages_2.5\*; DestDir: {code:GetPythonSiteDir}; Flags: recursesubdirs; Check: SelectedPython('2.5') ; the python modules again - if we don't find python we install both versions in the app directory Modified: trunk/python-ogre/demos/cegui/Demo_CEGUI_Treev061.py =================================================================== --- trunk/python-ogre/demos/cegui/Demo_CEGUI_Treev061.py 2008-11-14 07:22:21 UTC (rev 792) +++ trunk/python-ogre/demos/cegui/Demo_CEGUI_Treev061.py 2008-11-15 01:16:12 UTC (rev 793) @@ -252,7 +252,9 @@ def addListToTree(resourceList, parentItem, iconName): for r in resourceList: meshCtrlItem = CEGUI.TreeItem(r) - meshCtrlItem.setIcon(drives.getImage(iconName)) +# meshCtrlItem.setIcon(drives.getImage(iconName)) + image = iconArray[ iconImages.index(iconName) ] + meshCtrlItem.setIcon( image ) meshCtrlItem.setSelectionBrushImage(IMAGES_FILE_NAME, BRUSH_NAME) meshCtrlItem.AutoDeleted = False meshCtrlItem.setFont("BlueHighway-12") @@ -262,7 +264,9 @@ ## helper to create TreeCtrl item def createListItem(text, parentItem, iconName): meshCtrlItem = CEGUI.TreeItem(text) - meshCtrlItem.setIcon(drives.getImage(iconName)) +# meshCtrlItem.setIcon(drives.getImage(iconName)) + image = iconArray[ iconImages.index(iconName) ] + meshCtrlItem.setIcon( image ) meshCtrlItem.setSelectionBrushImage(IMAGES_FILE_NAME, BRUSH_NAME) meshCtrlItem.AutoDeleted = False meshCtrlItem.setFont("BlueHighway-12") @@ -346,7 +350,7 @@ def handleEventBranchClosed(self, args): print "Branch Closed" return True - + def handleQuit(self, e): self.frameListener.requestShutdown() return True Modified: trunk/python-ogre/environment.py =================================================================== --- trunk/python-ogre/environment.py 2008-11-14 07:22:21 UTC (rev 792) +++ trunk/python-ogre/environment.py 2008-11-15 01:16:12 UTC (rev 793) @@ -282,12 +282,12 @@ if _STABLE: source_version = "1383" source = [ - [svn, " co -r 1383 http://pygccxml.svn.sourceforge.net/svnroot/pygccxml/pygccxml_dev "+base, os.getcwd()] + [svn, " co -r 1383 https://pygccxml.svn.sourceforge.net/svnroot/pygccxml/pygccxml_dev "+base, os.getcwd()] ] else: source_version = "1446" source = [ - [svn, " co -r 1446 http://pygccxml.svn.sourceforge.net/svnroot/pygccxml/pygccxml_dev "+base, os.getcwd()] + [svn, " co -r 1446 https://pygccxml.svn.sourceforge.net/svnroot/pygccxml/pygccxml_dev "+base, os.getcwd()] ] if isLinux() or isMac() : buildCmds = [ @@ -308,12 +308,12 @@ if _STABLE: source_version = "1383" source = [ - [svn, " co -r 1383 http://pygccxml.svn.sourceforge.net/svnroot/pygccxml/pyplusplus_dev "+base, os.getcwd()] + [svn, " co -r 1383 https://pygccxml.svn.sourceforge.net/svnroot/pygccxml/pyplusplus_dev "+base, os.getcwd()] ] else: source_version = "1446" source = [ - [svn, " co -r 1446 http://pygccxml.svn.sourceforge.net/svnroot/pygccxml/pyplusplus_dev "+base, os.getcwd()] + [svn, " co -r 1446 https://pygccxml.svn.sourceforge.net/svnroot/pygccxml/pyplusplus_dev "+base, os.getcwd()] ] if isLinux() or isMac() : buildCmds = [ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2008-11-14 07:08:27
|
Revision: 790 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=790&view=rev Author: andy_miller Date: 2008-11-14 07:08:16 +0000 (Fri, 14 Nov 2008) Log Message: ----------- QuickGui updated, NXOgre generator for 0.22, removed info message from doc generation Modified Paths: -------------- trunk/python-ogre/PythonOgreConfig_nt.py trunk/python-ogre/ThirdParty/ogreal/OgreALPrereqs.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIButton.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUICharacter.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUICharacter.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIExportDLL.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIForwardDeclaredDesc.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIForwardDeclaredDesc.h trunk/python-ogre/ThirdParty/quickgui/QuickGUILabel.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUILabel.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIListTextItem.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIListTextItem.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIMenu.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIMenuLabel.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIMenuLabel.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIProgressBar.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIProgressBar.h trunk/python-ogre/ThirdParty/quickgui/QuickGUISerialBase.h trunk/python-ogre/ThirdParty/quickgui/QuickGUISerialReader.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUISerialReader.h trunk/python-ogre/ThirdParty/quickgui/QuickGUISerialWriter.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUISerialWriter.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIStringConverter.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIStringConverter.h trunk/python-ogre/ThirdParty/quickgui/QuickGUITab.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUITab.h trunk/python-ogre/ThirdParty/quickgui/QuickGUITabPage.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUITabPage.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIText.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIText.h trunk/python-ogre/ThirdParty/quickgui/QuickGUITextAlignment.h trunk/python-ogre/ThirdParty/quickgui/QuickGUITextArea.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUITextArea.h trunk/python-ogre/ThirdParty/quickgui/QuickGUITextBox.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUITextBox.h trunk/python-ogre/ThirdParty/quickgui/QuickGUITitleBar.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUITitleBar.h trunk/python-ogre/ThirdParty/quickgui/QuickGUIToolBar.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIWindow.cpp trunk/python-ogre/ThirdParty/quickgui/QuickGUIWindow.h trunk/python-ogre/code_generators/common_utils/extract_documentation.py trunk/python-ogre/code_generators/nxogre/generate_code.py trunk/python-ogre/code_generators/nxogre/python_nxogre_aliases.h trunk/python-ogre/code_generators/nxogre/python_nxogre_sizeof.h trunk/python-ogre/demos/qgui/Demo_QuickGUI01.py trunk/python-ogre/demos/theora/demo_video.py trunk/python-ogre/environment.py trunk/python-ogre/packages_2.5/ogre/gui/CEGUI/__init__.py trunk/python-ogre/packages_2.5/ogre/renderer/OGRE/sf_OIS.py Removed Paths: ------------- trunk/python-ogre/generated/ Modified: trunk/python-ogre/PythonOgreConfig_nt.py =================================================================== --- trunk/python-ogre/PythonOgreConfig_nt.py 2008-11-10 17:16:49 UTC (rev 789) +++ trunk/python-ogre/PythonOgreConfig_nt.py 2008-11-14 07:08:16 UTC (rev 790) @@ -62,8 +62,8 @@ PATH_plib = os.path.join(PATH_THIRDPARTY, 'plib') PATH_et = os.path.join(PATH_THIRDPARTY, 'et') PATH_caelum = os.path.join(PATH_THIRDPARTY, 'caelum') -PATH_NxOgre= os.path.join(BASE_DIR, 'nxogre', 'NxOgre') -PATH_NxOgre= os.path.join(PATH_THIRDPARTY, 'nxogre') +PATH_NxOgre= os.path.join(BASE_DIR, 'nxogre_0.22') +# # # PATH_NxOgre= os.path.join(PATH_THIRDPARTY, 'nxogre') PATH_NxOgre_09= os.path.join(PATH_THIRDPARTY, 'nxogre_0.9') PATH_watermesh= os.path.join(PATH_THIRDPARTY, 'watermesh') PATH_noise= os.path.join(PATH_THIRDPARTY, 'noise') @@ -162,7 +162,7 @@ PATH_INCLUDE_quickgui = PATH_quickgui PATH_INCLUDE_NxOgre_09= PATH_NxOgre_09 PATH_INCLUDE_NxOgre= os.path.join(PATH_NxOgre, 'include') -PATH_INCLUDE_NxOgre= PATH_NxOgre +# # # PATH_INCLUDE_NxOgre= PATH_NxOgre PATH_INCLUDE_Bullet= os.path.join(PATH_Bullet, 'src') PATH_INCLUDE_freetype= os.path.join(PATH_INCLUDE_quickgui,'FreeType2.3.5') PATH_INCLUDE_betagui = PATH_betagui Modified: trunk/python-ogre/ThirdParty/ogreal/OgreALPrereqs.h =================================================================== --- trunk/python-ogre/ThirdParty/ogreal/OgreALPrereqs.h 2008-11-10 17:16:49 UTC (rev 789) +++ trunk/python-ogre/ThirdParty/ogreal/OgreALPrereqs.h 2008-11-14 07:08:16 UTC (rev 790) @@ -42,33 +42,15 @@ #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 # include "AL/al.h" # include "AL/alc.h" -// # include "xram.h" -// # if OGRE_COMPILER == OGRE_COMPILER_MSVC -// # ifdef OGREAL_EXPORT -// # define OgreAL_Export __declspec(dllexport) -// # else -// # define OgreAL_Export __declspec(dllimport) -// # endif -// # else - # define OgreAL_Export -// # endif + # define OgreAL_Export #elif OGRE_COMPILER == OGRE_COMPILER_GNUC # include "al.h" # include "alc.h" -// # if defined(OGREAL_EXPORT) && OGRE_COMP_VER >= 400 -// # define OgreAL_Export __attribute__ ((visibility("default"))) -// # else - # define OgreAL_Export - # endif - // fake EAX/X-RAM - typedef ALenum (*EAXGetBufferMode)(ALuint buffer, ALint *pReserved); - typedef ALboolean (*EAXSetBufferMode)(ALsizei n, ALuint *buffers, ALint value); -// #else // Other Compilers -// # include "al.h" -// # include "alc.h" -// # include "xram.h" -// # define OgreAL_Export -// #endif + # define OgreAL_Export + #endif + + typedef ALenum (*EAXGetBufferMode)(ALuint buffer, ALint *pReserved); + typedef ALboolean (*EAXSetBufferMode)(ALsizei n, ALuint *buffers, ALint value); #ifndef OGREAL_THREADED # define OGREAL_THREADED 0 Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIButton.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIButton.cpp 2008-11-10 17:16:49 UTC (rev 789) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIButton.cpp 2008-11-14 07:08:16 UTC (rev 790) @@ -21,6 +21,7 @@ ButtonDesc::ButtonDesc() : LabelDesc() { + textDesc.horizontalTextAlignment = TEXT_ALIGNMENT_HORIZONTAL_CENTER; } void ButtonDesc::serialize(SerialBase* b) @@ -42,6 +43,8 @@ { Label::_initialize(d); + ButtonDesc* bd = dynamic_cast<ButtonDesc*>(d); + mDesc = dynamic_cast<LabelDesc*>(mWidgetDesc); setSkinType(d->skinTypeName); @@ -68,33 +71,7 @@ void Button::onDraw() { - Brush* brush = Brush::getSingletonPtr(); - - brush->setFilterMode(mDesc->brushFilterMode); - - SkinType* st = mSkinType; - if(!mWidgetDesc->enabled && mWidgetDesc->disabledSkinType != "") - st = SkinTypeManager::getSingleton().getSkinType(getClass(),mWidgetDesc->disabledSkinType); - - brush->drawSkinElement(Rect(mTexturePosition,mWidgetDesc->dimensions.size),st->getSkinElement(mSkinElementName)); - - Ogre::ColourValue prevColor = brush->getColour(); - Rect prevClipRegion = brush->getClipRegion(); - - Rect clipRegion; - clipRegion.size = - Size( - mWidgetDesc->dimensions.size.width - mDesc->padding[PADDING_RIGHT] - mDesc->padding[PADDING_LEFT], - mWidgetDesc->dimensions.size.height - mDesc->padding[PADDING_BOTTOM] - mDesc->padding[PADDING_TOP]); - clipRegion.position = mTexturePosition; - clipRegion.translate(Point(mDesc->padding[PADDING_LEFT],mDesc->padding[PADDING_TOP])); - - brush->setClipRegion(prevClipRegion.getIntersection(clipRegion)); - - mText->draw(clipRegion.position); - - brush->setClipRegion(prevClipRegion); - brush->setColor(prevColor); + Label::onDraw(); } void Button::onMouseEnter(const EventArgs& args) Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUICharacter.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUICharacter.cpp 2008-11-10 17:16:49 UTC (rev 789) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUICharacter.cpp 2008-11-14 07:08:16 UTC (rev 790) @@ -3,7 +3,8 @@ namespace QuickGUI { - Character::Character() {}; + Character::Character( void ) {} ; + Character::Character(Ogre::UTFString::code_point cp, Ogre::FontPtr fp, Ogre::ColourValue cv) : codePoint(cp), fontPtr(fp), Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUICharacter.h =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUICharacter.h 2008-11-10 17:16:49 UTC (rev 789) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUICharacter.h 2008-11-14 07:08:16 UTC (rev 790) @@ -56,9 +56,10 @@ /// UV coords of glyph, retreived from Font texture generated by Ogre::Font class. UVRect uvCoords; + Character(); protected: - Character(void); + bool mHighlighted; bool mWhiteSpace; }; Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIExportDLL.h =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIExportDLL.h 2008-11-10 17:16:49 UTC (rev 789) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIExportDLL.h 2008-11-14 07:08:16 UTC (rev 790) @@ -4,19 +4,19 @@ #include "OgrePlatform.h" #ifndef _QuickGUIExport - #if defined(OGRE_PLATFORM) - #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 && !defined ( __MINGW32__ ) - # if defined( QUICKGUI_EXPORTS ) - # define _QuickGUIExport __declspec( dllexport ) - # else - # define _QuickGUIExport __declspec( dllimport ) - # endif - #else - # define _QuickGUIExport - #endif - #else +// #if defined(OGRE_PLATFORM) +// #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 && !defined ( __MINGW32__ ) +// # if defined( QUICKGUI_EXPORTS ) +// # define _QuickGUIExport __declspec( dllexport ) +// # else +// # define _QuickGUIExport __declspec( dllimport ) +// # endif +// #else +// # define _QuickGUIExport +// #endif +// #else #define _QuickGUIExport - #endif +// #endif #endif #endif Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIForwardDeclaredDesc.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIForwardDeclaredDesc.cpp 2008-11-10 17:16:49 UTC (rev 789) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIForwardDeclaredDesc.cpp 2008-11-14 07:08:16 UTC (rev 790) @@ -10,21 +10,17 @@ TabPageDesc::TabPageDesc() : PanelDesc() { - for(int i = 0; i < PADDING_COUNT; ++i) - padding[i] = 5.0; - supportScrollBars = false; tabFrontWidth = -1; + verticalTextAlignment = TEXT_ALIGNMENT_VERTICAL_CENTER; } void TabPageDesc::serialize(SerialBase* b) { PanelDesc::serialize(b); - for(int i = 0; i < PADDING_COUNT; ++i) - b->IO(StringConverter::toString(static_cast<Padding>(i)),&padding[i]); - b->IO("TabFrontWidth",&tabFrontWidth); + b->IO("VerticalTextAlignment",&verticalTextAlignment); } TabControlDesc::TabControlDesc() : Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIForwardDeclaredDesc.h =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIForwardDeclaredDesc.h 2008-11-10 17:16:49 UTC (rev 789) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIForwardDeclaredDesc.h 2008-11-14 07:08:16 UTC (rev 790) @@ -37,8 +37,8 @@ public: TabPageDesc(); - /// Describes the Padding around Tab's Text - float padding[PADDING_COUNT]; + /// Vertical alignment of text within this widget's client area. + VerticalTextAlignment verticalTextAlignment; /// Describes the Text used in this Label TextDesc textDesc; Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUILabel.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUILabel.cpp 2008-11-10 17:16:49 UTC (rev 789) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUILabel.cpp 2008-11-14 07:08:16 UTC (rev 790) @@ -17,18 +17,14 @@ LabelDesc::LabelDesc() : WidgetDesc() { - for(int i = 0; i < PADDING_COUNT; ++i) - { - padding[i] = 5.0; - } + verticalTextAlignment = TEXT_ALIGNMENT_VERTICAL_CENTER; } void LabelDesc::serialize(SerialBase* b) { WidgetDesc::serialize(b); - for(int i = 0; i < PADDING_COUNT; ++i) - b->IO(StringConverter::toString(static_cast<Padding>(i)),&padding[i]); + b->IO("VerticalTextAlignment",&verticalTextAlignment); textDesc.serialize(b); } @@ -59,29 +55,34 @@ // modify it directly, which is used for serialization. mDesc->textDesc = ld->textDesc; + // Store pointer to SkinType + SkinType* st = mSkinType; + if(!mWidgetDesc->enabled && mWidgetDesc->disabledSkinType != "") + { + st = SkinTypeManager::getSingleton().getSkinType(getClass(),mWidgetDesc->disabledSkinType); + } + + SkinElement* se = st->getSkinElement(mSkinElementName); + if(mDesc->dimensions.size.width == 0) { if(mDesc->textDesc.segments.empty()) mDesc->dimensions.size.width = 50; else - mDesc->dimensions.size.width = ld->padding[PADDING_LEFT] + mDesc->textDesc.getTextWidth() + ld->padding[PADDING_RIGHT]; + mDesc->dimensions.size.width = se->getBorderThickness(BORDER_LEFT) + mDesc->textDesc.getTextWidth() + se->getBorderThickness(BORDER_RIGHT); } if(mDesc->dimensions.size.height == 0) { if(mDesc->textDesc.segments.empty()) mDesc->dimensions.size.height = 20; else - mDesc->dimensions.size.height = ld->padding[PADDING_TOP] + mDesc->textDesc.getTextHeight() + ld->padding[PADDING_BOTTOM]; + mDesc->dimensions.size.height = se->getBorderThickness(BORDER_TOP) + mDesc->textDesc.getTextHeight() + se->getBorderThickness(BORDER_BOTTOM); } - mDesc->textDesc.allottedWidth = ld->dimensions.size.width - (ld->padding[PADDING_LEFT] + ld->padding[PADDING_RIGHT]); + mDesc->verticalTextAlignment = ld->verticalTextAlignment; + mDesc->textDesc.allottedWidth = ld->dimensions.size.width - (se->getBorderThickness(BORDER_LEFT) + se->getBorderThickness(BORDER_RIGHT)); mText = new Text(mDesc->textDesc); - setPadding(PADDING_BOTTOM,ld->padding[PADDING_BOTTOM]); - setPadding(PADDING_LEFT,ld->padding[PADDING_LEFT]); - setPadding(PADDING_RIGHT,ld->padding[PADDING_RIGHT]); - setPadding(PADDING_TOP,ld->padding[PADDING_TOP]); - mCurrentFontName = Text::getFirstAvailableFont()->getName(); mCurrentColourValue = Ogre::ColourValue::White; } @@ -100,12 +101,9 @@ return "Label"; } - float Label::getPadding(Padding p) + HorizontalTextAlignment Label::getHorizontalTextAlignment() { - if(p == PADDING_COUNT) - throw Exception(Exception::ERR_INVALIDPARAMS,"PADDING_COUNT is not a valid parameter!","Label::getPadding"); - - return mDesc->padding[p]; + return mText->getHorizontalTextAlignment(); } Ogre::UTFString Label::getText() @@ -118,6 +116,11 @@ return mText->getVerticalLineSpacing(); } + VerticalTextAlignment Label::getVerticalTextAlignment() + { + return mDesc->verticalTextAlignment; + } + void Label::onDraw() { Brush* brush = Brush::getSingletonPtr(); @@ -135,16 +138,35 @@ Ogre::ColourValue prevColor = brush->getColour(); Rect prevClipRegion = brush->getClipRegion(); - Rect clipRegion; - clipRegion.size = - Size( - mWidgetDesc->dimensions.size.width - mDesc->padding[PADDING_RIGHT] - mDesc->padding[PADDING_LEFT], - mWidgetDesc->dimensions.size.height - mDesc->padding[PADDING_BOTTOM] - mDesc->padding[PADDING_TOP]); - clipRegion.position = mTexturePosition; - clipRegion.translate(Point(mDesc->padding[PADDING_LEFT],mDesc->padding[PADDING_TOP])); + // Center Text Vertically + float textHeight = mText->getTextHeight(); + float yPos = 0; + + switch(mDesc->verticalTextAlignment) + { + case TEXT_ALIGNMENT_VERTICAL_BOTTOM: + yPos = mDesc->dimensions.size.height - st->getSkinElement(mSkinElementName)->getBorderThickness(BORDER_BOTTOM) - textHeight; + break; + case TEXT_ALIGNMENT_VERTICAL_CENTER: + yPos = (mDesc->dimensions.size.height / 2.0) - (textHeight / 2.0); + break; + case TEXT_ALIGNMENT_VERTICAL_TOP: + yPos = st->getSkinElement(mSkinElementName)->getBorderThickness(BORDER_TOP); + break; + } + + // Clip to client dimensions + Rect clipRegion(mClientDimensions); + clipRegion.translate(mTexturePosition); + brush->setClipRegion(prevClipRegion.getIntersection(clipRegion)); + // Adjust Rect to Text drawing region + clipRegion = mClientDimensions; + clipRegion.position.y = yPos; + clipRegion.translate(mTexturePosition); + mText->draw(clipRegion.position); brush->setClipRegion(prevClipRegion); @@ -225,14 +247,17 @@ redraw(); } - void Label::setPadding(Padding p, float distance) + void Label::setHorizontalTextAlignment(HorizontalTextAlignment a) { - if(p == PADDING_COUNT) - throw Exception(Exception::ERR_INVALIDPARAMS,"PADDING_COUNT is not a valid parameter!","Label::setPadding"); + mText->setHorizontalTextAlignment(a); - mDesc->padding[p] = distance; - mText->setAllottedWidth(mWidgetDesc->dimensions.size.width - (mDesc->padding[PADDING_LEFT] + mDesc->padding[PADDING_RIGHT])); + redraw(); + } + void Label::setVerticalTextAlignment(VerticalTextAlignment a) + { + mDesc->verticalTextAlignment = a; + redraw(); } Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUILabel.h =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUILabel.h 2008-11-10 17:16:49 UTC (rev 789) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUILabel.h 2008-11-14 07:08:16 UTC (rev 790) @@ -1,7 +1,6 @@ #ifndef QUICKGUILABEL_H #define QUICKGUILABEL_H -#include "QuickGUIPadding.h" #include "QuickGUIWidget.h" #include "QuickGUIText.h" @@ -13,7 +12,8 @@ public: LabelDesc(); - float padding[PADDING_COUNT]; + /// Vertical alignment of text within this widget's client area. + VerticalTextAlignment verticalTextAlignment; /// Describes the Text used in this Label TextDesc textDesc; @@ -59,9 +59,9 @@ */ virtual Ogre::String getClass(); /** - * Gets the distance between a Label border and the text. + * Returns the horizontal alignment of text within this widget's client area. */ - float getPadding(Padding p); + HorizontalTextAlignment getHorizontalTextAlignment(); /** * Gets the text in UTFString form. */ @@ -71,6 +71,10 @@ * are multiple lines of text. */ float getVerticalLineSpacing(); + /** + * Returns the vertical alignment of text within this widget's client area. + */ + VerticalTextAlignment getVerticalTextAlignment(); /** * Sets all characters of the text to the specified color. @@ -117,9 +121,9 @@ */ void setFont(const Ogre::String& fontName, Ogre::UTFString s, bool allOccurrences); /** - * Sets the distance between a Label border and the text. + * Sets the Horizontal alignment of Text as displayed within the Label area. */ - void setPadding(Padding p, float distance); + void setHorizontalTextAlignment(HorizontalTextAlignment a); /** * Sets the text for this object. */ @@ -137,6 +141,10 @@ * are multiple lines of text. */ void setVerticalLineSpacing(float distance); + /** + * Sets the Vertical alignment of Text as displayed within the Label area. + */ + void setVerticalTextAlignment(VerticalTextAlignment a); protected: Label(const Ogre::String& name); Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIListTextItem.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIListTextItem.cpp 2008-11-10 17:16:49 UTC (rev 789) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIListTextItem.cpp 2008-11-14 07:08:16 UTC (rev 790) @@ -17,20 +17,14 @@ ListTextItemDesc::ListTextItemDesc() : ListItemDesc() { - for(int i = 0; i < PADDING_COUNT; ++i) - { - padding[i] = 5.0; - } + verticalTextAlignment = TEXT_ALIGNMENT_VERTICAL_CENTER; } void ListTextItemDesc::serialize(SerialBase* b) { ListItemDesc::serialize(b); - for(int i = 0; i < PADDING_COUNT; ++i) - { - b->IO(StringConverter::toString(static_cast<Padding>(i)),&padding[i]); - } + b->IO("VerticalTextAlignment",&verticalTextAlignment); textDesc.serialize(b); } @@ -60,14 +54,9 @@ // Make a copy of the Text Desc. The Text object will // modify it directly, which is used for serialization. mDesc->textDesc = ltid->textDesc; - + mDesc->verticalTextAlignment = ltid->verticalTextAlignment; mText = new Text(mDesc->textDesc); - setPadding(PADDING_BOTTOM,ltid->padding[PADDING_BOTTOM]); - setPadding(PADDING_LEFT,ltid->padding[PADDING_LEFT]); - setPadding(PADDING_RIGHT,ltid->padding[PADDING_RIGHT]); - setPadding(PADDING_TOP,ltid->padding[PADDING_TOP]); - mCurrentFontName = Text::getFirstAvailableFont()->getName(); mCurrentColourValue = Ogre::ColourValue::White; } @@ -91,14 +80,6 @@ return mText->getText(); } - float ListTextItem::getPadding(Padding p) - { - if(p == PADDING_COUNT) - throw Exception(Exception::ERR_INVALIDPARAMS,"PADDING_COUNT is not a valid parameter!","Label::getPadding"); - - return mDesc->padding[p]; - } - void ListTextItem::onDraw() { Brush* brush = Brush::getSingletonPtr(); @@ -114,21 +95,39 @@ Ogre::ColourValue prevColor = brush->getColour(); Rect prevClipRegion = brush->getClipRegion(); - Rect clipRegion; - clipRegion.size = - Size( - mDesc->dimensions.size.width - mDesc->padding[PADDING_RIGHT], - mDesc->dimensions.size.height - mDesc->padding[PADDING_BOTTOM]); - clipRegion.position = mTexturePosition; - clipRegion.translate(Point(mDesc->padding[PADDING_LEFT],mDesc->padding[PADDING_TOP])); + // Center Text Vertically + float textHeight = mText->getTextHeight(); + float yPos = 0; + + switch(mDesc->verticalTextAlignment) + { + case TEXT_ALIGNMENT_VERTICAL_BOTTOM: + yPos = mDesc->dimensions.size.height - st->getSkinElement(mSkinElementName)->getBorderThickness(BORDER_BOTTOM) - textHeight; + break; + case TEXT_ALIGNMENT_VERTICAL_CENTER: + yPos = (mDesc->dimensions.size.height / 2.0) - (textHeight / 2.0); + break; + case TEXT_ALIGNMENT_VERTICAL_TOP: + yPos = st->getSkinElement(mSkinElementName)->getBorderThickness(BORDER_TOP); + break; + } + + // Clip to client dimensions + Rect clipRegion(mClientDimensions); + clipRegion.translate(mTexturePosition); + brush->setClipRegion(prevClipRegion.getIntersection(clipRegion)); + // Adjust Rect to Text drawing region + clipRegion = mClientDimensions; + clipRegion.position.y = yPos; + clipRegion.translate(mTexturePosition); + mText->draw(clipRegion.position); brush->setClipRegion(prevClipRegion); - - Brush::getSingleton().setColor(prevColor); + brush->setColor(prevColor); } void ListTextItem::setColor(const Ogre::ColourValue& cv) @@ -205,17 +204,6 @@ redraw(); } - void ListTextItem::setPadding(Padding p, float distance) - { - if(p == PADDING_COUNT) - throw Exception(Exception::ERR_INVALIDPARAMS,"PADDING_COUNT is not a valid parameter!","Label::setPadding"); - - mDesc->padding[p] = distance; - mText->setAllottedWidth(mWidgetDesc->dimensions.size.width - (mDesc->padding[PADDING_LEFT] + mDesc->padding[PADDING_RIGHT])); - - redraw(); - } - void ListTextItem::setText(Ogre::UTFString s, Ogre::FontPtr fp, const Ogre::ColourValue& cv) { mText->setText(s,fp,cv); @@ -237,6 +225,6 @@ { ListItem::setWidth(pixelWidth); - mText->setAllottedWidth(mDesc->dimensions.size.width - (mDesc->padding[PADDING_LEFT] + mDesc->padding[PADDING_RIGHT])); + mText->setAllottedWidth(mDesc->dimensions.size.width); } } Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIListTextItem.h =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIListTextItem.h 2008-11-10 17:16:49 UTC (rev 789) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIListTextItem.h 2008-11-14 07:08:16 UTC (rev 790) @@ -11,7 +11,8 @@ public: ListTextItemDesc(); - float padding[PADDING_COUNT]; + /// Vertical alignment of text within this widget's client area. + VerticalTextAlignment verticalTextAlignment; /// Describes the Text used in this Label TextDesc textDesc; @@ -55,10 +56,6 @@ */ virtual Ogre::String getClass(); /** - * Gets the distance between a Label border and the text. - */ - float getPadding(Padding p); - /** * Gets the text in UTFString form. */ Ogre::UTFString getText(); @@ -108,10 +105,6 @@ */ void setFont(const Ogre::String& fontName, Ogre::UTFString s, bool allOccurrences); /** - * Sets the distance between a Label border and the text. - */ - void setPadding(Padding p, float distance); - /** * Sets the text for this object. */ void setText(Ogre::UTFString s, Ogre::FontPtr fp, const Ogre::ColourValue& cv); Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIMenu.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIMenu.cpp 2008-11-10 17:16:49 UTC (rev 789) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIMenu.cpp 2008-11-14 07:08:16 UTC (rev 790) @@ -45,7 +45,7 @@ MenuLabel(name), mMenuPanel(NULL) { - mSkinElementName= DEFAULT; + mSkinElementName = DEFAULT; } Menu::~Menu() @@ -62,12 +62,6 @@ setSkinType(d->skinTypeName); MenuDesc* md = dynamic_cast<MenuDesc*>(d); - - mText->setAllottedWidth(md->dimensions.size.width - (md->padding[PADDING_LEFT] + md->padding[PADDING_RIGHT])); - setPadding(PADDING_BOTTOM,md->padding[PADDING_BOTTOM]); - setPadding(PADDING_LEFT,md->padding[PADDING_LEFT]); - setPadding(PADDING_RIGHT,md->padding[PADDING_RIGHT]); - setPadding(PADDING_TOP,md->padding[PADDING_TOP]); mDesc->menuWidth = md->menuWidth; @@ -188,7 +182,8 @@ // Determine position of MenuItem d.dimensions.position.y = mMenuPanel->getNextAvailableYPosition(); d.dimensions.size.width = mMenuPanel->getClientDimensions().size.width; - d.dimensions.size.height = d.textDesc.getTextHeight() + (d.padding[PADDING_TOP] + d.padding[PADDING_BOTTOM]); + SkinElement* se = mSkinType->getSkinElement(mSkinElementName); + d.dimensions.size.height = d.textDesc.getTextHeight() + se->getBorderThickness(BORDER_TOP) + se->getBorderThickness(BORDER_BOTTOM); MenuLabel* newMenuLabel = dynamic_cast<MenuLabel*>(Widget::create("MenuLabel",d)); addChild(newMenuLabel); @@ -207,7 +202,8 @@ // Determine position of Menu d.dimensions.position.y = mMenuPanel->getNextAvailableYPosition(); d.dimensions.size.width = mMenuPanel->getClientDimensions().size.width; - d.dimensions.size.height = d.textDesc.getTextHeight() + (d.padding[PADDING_TOP] + d.padding[PADDING_BOTTOM]); + SkinElement* se = mSkinType->getSkinElement(mSkinElementName); + d.dimensions.size.height = d.textDesc.getTextHeight() + se->getBorderThickness(BORDER_TOP) + se->getBorderThickness(BORDER_BOTTOM); Menu* newMenu = dynamic_cast<Menu*>(Widget::create("Menu",d)); @@ -369,7 +365,7 @@ else p.x = mParentWidget->getScreenPosition().x + mParentWidget->getSize().width - mDesc->subMenuOverlap; - p.y = getScreenPosition().y; + p.y = getScreenPosition().y - mMenuPanel->mSkinType->getSkinElement(mMenuPanel->mSkinElementName)->getBorderThickness(BORDER_TOP); } mMenuPanel->setPosition(p); Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIMenuLabel.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIMenuLabel.cpp 2008-11-10 17:16:49 UTC (rev 789) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIMenuLabel.cpp 2008-11-14 07:08:16 UTC (rev 790) @@ -23,20 +23,16 @@ MenuLabelDesc::MenuLabelDesc() : MenuItemDesc() { - for(int i = 0; i < PADDING_COUNT; ++i) - { - padding[i] = 5.0; - } + verticalTextAlignment = TEXT_ALIGNMENT_VERTICAL_CENTER; + + textDesc.horizontalTextAlignment = TEXT_ALIGNMENT_HORIZONTAL_LEFT; } void MenuLabelDesc::serialize(SerialBase* b) { MenuItemDesc::serialize(b); - for(int i = 0; i < PADDING_COUNT; ++i) - { - b->IO(StringConverter::toString(static_cast<Padding>(i)),&padding[i]); - } + b->IO("VerticalTextAlignment",&verticalTextAlignment); textDesc.serialize(b); } @@ -65,19 +61,16 @@ // modify it directly, which is used for serialization. mDesc->textDesc = mld->textDesc; - mDesc->textDesc.allottedWidth = mld->dimensions.size.width - (mld->padding[PADDING_LEFT] + mld->padding[PADDING_RIGHT]); + setSkinType(d->skinTypeName); + SkinElement* se = mSkinType->getSkinElement(mSkinElementName); + mDesc->textDesc.allottedWidth = mld->dimensions.size.width - (se->getBorderThickness(BORDER_LEFT) + se->getBorderThickness(BORDER_RIGHT)); + if(mText != NULL) delete mText; + mDesc->verticalTextAlignment = mld->verticalTextAlignment; mText = new Text(mDesc->textDesc); - - setPadding(PADDING_BOTTOM,mld->padding[PADDING_BOTTOM]); - setPadding(PADDING_LEFT,mld->padding[PADDING_LEFT]); - setPadding(PADDING_RIGHT,mld->padding[PADDING_RIGHT]); - setPadding(PADDING_TOP,mld->padding[PADDING_TOP]); - - setSkinType(d->skinTypeName); } Widget* MenuLabel::factory(const Ogre::String& widgetName) @@ -94,17 +87,14 @@ return "MenuLabel"; } - float MenuLabel::getPadding(Padding p) + float MenuLabel::getVerticalLineSpacing() { - if(p == PADDING_COUNT) - throw Exception(Exception::ERR_INVALIDPARAMS,"PADDING_COUNT is not a valid parameter!","MenuLabel::getPadding"); - - return mDesc->padding[p]; + return mText->getVerticalLineSpacing(); } - float MenuLabel::getVerticalLineSpacing() + VerticalTextAlignment MenuLabel::getVerticalTextAlignment() { - return mText->getVerticalLineSpacing(); + return mDesc->verticalTextAlignment; } void MenuLabel::onDraw() @@ -122,21 +112,39 @@ Ogre::ColourValue prevColor = brush->getColour(); Rect prevClipRegion = brush->getClipRegion(); - Rect clipRegion; - clipRegion.size = - Size( - mWidgetDesc->dimensions.size.width - mDesc->padding[PADDING_RIGHT] - mDesc->padding[PADDING_LEFT], - mWidgetDesc->dimensions.size.height - mDesc->padding[PADDING_BOTTOM] - mDesc->padding[PADDING_TOP]); - clipRegion.position = mTexturePosition; - clipRegion.translate(Point(mDesc->padding[PADDING_LEFT],mDesc->padding[PADDING_TOP])); + // Center Text Vertically + float textHeight = mText->getTextHeight(); + float yPos = 0; + + switch(mDesc->verticalTextAlignment) + { + case TEXT_ALIGNMENT_VERTICAL_BOTTOM: + yPos = mDesc->dimensions.size.height - st->getSkinElement(mSkinElementName)->getBorderThickness(BORDER_BOTTOM) - textHeight; + break; + case TEXT_ALIGNMENT_VERTICAL_CENTER: + yPos = (mDesc->dimensions.size.height / 2.0) - (textHeight / 2.0); + break; + case TEXT_ALIGNMENT_VERTICAL_TOP: + yPos = st->getSkinElement(mSkinElementName)->getBorderThickness(BORDER_TOP); + break; + } + + // Clip to client dimensions + Rect clipRegion(mClientDimensions); + clipRegion.translate(mTexturePosition); + brush->setClipRegion(prevClipRegion.getIntersection(clipRegion)); + // Adjust Rect to Text drawing region + clipRegion = mClientDimensions; + clipRegion.position.y = yPos; + clipRegion.translate(mTexturePosition); + mText->draw(clipRegion.position); brush->setClipRegion(prevClipRegion); - - Brush::getSingleton().setColor(prevColor); + brush->setColor(prevColor); } void MenuLabel::onMouseButtonUp(const EventArgs& args) @@ -235,17 +243,6 @@ redraw(); } - void MenuLabel::setPadding(Padding p, float distance) - { - if(p == PADDING_COUNT) - throw Exception(Exception::ERR_INVALIDPARAMS,"PADDING_COUNT is not a valid parameter!","MenuLabel::setPadding"); - - mDesc->padding[p] = distance; - mText->setAllottedWidth(mWidgetDesc->dimensions.size.width - (mDesc->padding[PADDING_LEFT] + mDesc->padding[PADDING_RIGHT])); - - redraw(); - } - void MenuLabel::setText(Ogre::UTFString s, Ogre::FontPtr fp, const Ogre::ColourValue& cv) { mText->setText(s,fp,cv); @@ -262,4 +259,11 @@ redraw(); } + + void MenuLabel::setVerticalTextAlignment(VerticalTextAlignment a) + { + mDesc->verticalTextAlignment = a; + + redraw(); + } } Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIMenuLabel.h =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIMenuLabel.h 2008-11-10 17:16:49 UTC (rev 789) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIMenuLabel.h 2008-11-14 07:08:16 UTC (rev 790) @@ -1,7 +1,6 @@ #ifndef QUICKGUIMENULABEL_H #define QUICKGUIMENULABEL_H -#include "QuickGUIPadding.h" #include "QuickGUIMenuItem.h" #include "QuickGUIText.h" @@ -13,7 +12,8 @@ public: MenuLabelDesc(); - float padding[PADDING_COUNT]; + /// Vertical alignment of text within this widget's client area. + VerticalTextAlignment verticalTextAlignment; /// Describes the Text used in this Label TextDesc textDesc; @@ -61,14 +61,14 @@ */ virtual Ogre::String getClass(); /** - * Gets the distance between a Label border and the text. - */ - float getPadding(Padding p); - /** * Returns the number of pixels placed between each line of text, if there * are multiple lines of text. */ float getVerticalLineSpacing(); + /** + * Returns the vertical alignment of text within this widget's client area. + */ + VerticalTextAlignment getVerticalTextAlignment(); /** * Sets all characters of the text to the specified color. @@ -115,10 +115,6 @@ */ void setFont(const Ogre::String& fontName, Ogre::UTFString s, bool allOccurrences); /** - * Sets the distance between a Label border and the text. - */ - void setPadding(Padding p, float distance); - /** * Sets the text for this object. */ void setText(Ogre::UTFString s, Ogre::FontPtr fp, const Ogre::ColourValue& cv); @@ -127,6 +123,10 @@ * are multiple lines of text. */ void setVerticalLineSpacing(float distance); + /** + * Sets the Vertical alignment of Text as displayed within the Label area. + */ + void setVerticalTextAlignment(VerticalTextAlignment a); protected: MenuLabel(const Ogre::String& name); Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIProgressBar.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIProgressBar.cpp 2008-11-10 17:16:49 UTC (rev 789) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIProgressBar.cpp 2008-11-14 07:08:16 UTC (rev 790) @@ -25,21 +25,14 @@ layout = PROGRESSBAR_LAYOUT_HORIZONTAL; clippingEdge = PROGRESSBAR_CLIP_LEFT_BOTTOM; progress = 100; - - for(int i = 0; i < PADDING_COUNT; ++i) - { - padding[i] = 5.0; - } + verticalTextAlignment = TEXT_ALIGNMENT_VERTICAL_CENTER; } void ProgressBarDesc::serialize(SerialBase* b) { WidgetDesc::serialize(b); - for(int i = 0; i < PADDING_COUNT; ++i) - { - b->IO(StringConverter::toString(static_cast<Padding>(i)),&padding[i]); - } + b->IO("VerticalTextAlignment",&verticalTextAlignment); textDesc.serialize(b); @@ -74,14 +67,11 @@ // modify it directly, which is used for serialization. mDesc->textDesc = pd->textDesc; - mDesc->textDesc.allottedWidth = pd->dimensions.size.width - (pd->padding[PADDING_LEFT] + pd->padding[PADDING_RIGHT]); + SkinElement* se = mSkinType->getSkinElement(mSkinElementName); + mDesc->textDesc.allottedWidth = pd->dimensions.size.width - (se->getBorderThickness(BORDER_LEFT) + se->getBorderThickness(BORDER_RIGHT)); + mDesc->verticalTextAlignment = pd->verticalTextAlignment; mText = new Text(mDesc->textDesc); - setPadding(PADDING_BOTTOM,pd->padding[PADDING_BOTTOM]); - setPadding(PADDING_LEFT,pd->padding[PADDING_LEFT]); - setPadding(PADDING_RIGHT,pd->padding[PADDING_RIGHT]); - setPadding(PADDING_TOP,pd->padding[PADDING_TOP]); - mCurrentFontName = Text::getFirstAvailableFont()->getName(); mCurrentColourValue = Ogre::ColourValue::White; @@ -166,17 +156,14 @@ return mDesc->fillDirection; } - ProgressBarLayout ProgressBar::setLayout() + HorizontalTextAlignment ProgressBar::getHorizontalTextAlignment() { - return mDesc->layout; + return mText->getHorizontalTextAlignment(); } - float ProgressBar::getPadding(Padding p) + ProgressBarLayout ProgressBar::setLayout() { - if(p == PADDING_COUNT) - throw Exception(Exception::ERR_INVALIDPARAMS,"PADDING_COUNT is not a valid parameter!","ProgressBar::getPadding"); - - return mDesc->padding[p]; + return mDesc->layout; } float ProgressBar::getProgress() @@ -194,6 +181,11 @@ return mText->getVerticalLineSpacing(); } + VerticalTextAlignment ProgressBar::getVerticalTextAlignment() + { + return mDesc->verticalTextAlignment; + } + void ProgressBar::onDraw() { Brush* brush = Brush::getSingletonPtr(); @@ -213,26 +205,45 @@ barRect.translate(mTexturePosition); brush->drawRectangle(barRect,UVRect(0,0,1,1)); - /* Ogre::ColourValue prevColor = brush->getColour(); Rect prevClipRegion = brush->getClipRegion(); - Rect clipRegion; - clipRegion.size = - Size( - mDesc->dimensions.size.width - mDesc->padding[PADDING_RIGHT], - mDesc->dimensions.size.height - mDesc->padding[PADDING_BOTTOM]); - clipRegion.position = mTexturePosition; - clipRegion.translate(Point(mDesc->padding[PADDING_LEFT],mDesc->padding[PADDING_TOP])); + if(mText->empty()) + return; + // Center Text Vertically + + float textHeight = mText->getTextHeight(); + float yPos = 0; + + switch(mDesc->verticalTextAlignment) + { + case TEXT_ALIGNMENT_VERTICAL_BOTTOM: + yPos = mDesc->dimensions.size.height - st->getSkinElement(mSkinElementName)->getBorderThickness(BORDER_BOTTOM) - textHeight; + break; + case TEXT_ALIGNMENT_VERTICAL_CENTER: + yPos = (mDesc->dimensions.size.height / 2.0) - (textHeight / 2.0); + break; + case TEXT_ALIGNMENT_VERTICAL_TOP: + yPos = st->getSkinElement(mSkinElementName)->getBorderThickness(BORDER_TOP); + break; + } + + // Clip to client dimensions + Rect clipRegion(mClientDimensions); + clipRegion.translate(mTexturePosition); + brush->setClipRegion(prevClipRegion.getIntersection(clipRegion)); + // Adjust Rect to Text drawing region + clipRegion = mClientDimensions; + clipRegion.position.y = yPos; + clipRegion.translate(mTexturePosition); + mText->draw(clipRegion.position); brush->setClipRegion(prevClipRegion); - - Brush::getSingleton().setColor(prevColor); - */ + brush->setColor(prevColor); } void ProgressBar::setClippingEdge(ProgressBarClippingEdge e) @@ -323,22 +334,18 @@ redraw(); } - void ProgressBar::setLayout(ProgressBarLayout l) + void ProgressBar::setHorizontalTextAlignment(HorizontalTextAlignment a) { - mDesc->layout = l; + mText->setHorizontalTextAlignment(a); - setProgress(mDesc->progress); + redraw(); } - void ProgressBar::setPadding(Padding p, float distance) + void ProgressBar::setLayout(ProgressBarLayout l) { - if(p == PADDING_COUNT) - throw Exception(Exception::ERR_INVALIDPARAMS,"PADDING_COUNT is not a valid parameter!","ProgressBar::setPadding"); + mDesc->layout = l; - mDesc->padding[p] = distance; - mText->setAllottedWidth(mWidgetDesc->dimensions.size.width - (mDesc->padding[PADDING_LEFT] + mDesc->padding[PADDING_RIGHT])); - - redraw(); + setProgress(mDesc->progress); } void ProgressBar::setProgress(float percent) @@ -542,4 +549,11 @@ redraw(); } + + void ProgressBar::setVerticalTextAlignment(VerticalTextAlignment a) + { + mDesc->verticalTextAlignment = a; + + redraw(); + } } Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIProgressBar.h =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIProgressBar.h 2008-11-10 17:16:49 UTC (rev 789) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIProgressBar.h 2008-11-14 07:08:16 UTC (rev 790) @@ -23,7 +23,8 @@ /// Percentage of progress of the bar. (0-100) float progress; - float padding[PADDING_COUNT]; + /// Vertical alignment of text within this widget's client area. + VerticalTextAlignment verticalTextAlignment; /// Describes the Text used in this Label TextDesc textDesc; @@ -107,14 +108,14 @@ */ ProgressBarFillDirection getFillDirection(); /** + * Returns the horizontal alignment of text within this widget's client area. + */ + HorizontalTextAlignment getHorizontalTextAlignment(); + /** * Gets the axis of progress growth, either horizontal or vertical. */ ProgressBarLayout setLayout(); /** - * Gets the distance between a Label border and the text. - */ - float getPadding(Padding p); - /** * Gets the progress of the ProgressBar, that is a visual indicator of percent complete. */ float getProgress(); @@ -127,6 +128,10 @@ * are multiple lines of text. */ float getVerticalLineSpacing(); + /** + * Returns the vertical alignment of text within this widget's client area. + */ + VerticalTextAlignment getVerticalTextAlignment(); /** * Sets the side of the bar texture that is clipped to simulate progress. @@ -181,14 +186,14 @@ */ void setFont(const Ogre::String& fontName, Ogre::UTFString s, bool allOccurrences); /** + * Sets the Horizontal alignment of Text as displayed within the Label area. + */ + void setHorizontalTextAlignment(HorizontalTextAlignment a); + /** * Sets the axis of progress growth, either horizontal or vertical. */ void setLayout(ProgressBarLayout l); /** - * Sets the distance between a Label border and the text. - */ - void setPadding(Padding p, float distance); - /** * Sets the progress of the ProgressBar, that is a visual indicator of percent complete. * NOTE: values above and below 0 will be capped to 0/100%. */ @@ -216,6 +221,10 @@ * are multiple lines of text. */ void setVerticalLineSpacing(float distance); + /** + * Sets the Vertical alignment of Text as displayed within the Label area. + */ + void setVerticalTextAlignment(VerticalTextAlignment a); protected: ProgressBar(const Ogre::String& name); Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUISerialBase.h =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUISerialBase.h 2008-11-10 17:16:49 UTC (rev 789) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUISerialBase.h 2008-11-14 07:08:16 UTC (rev 790) @@ -54,9 +54,10 @@ virtual void IO(const Ogre::String& propertyName, VScrollBarButtonLayout* member) = 0; virtual void IO(const Ogre::String& propertyName, HScrollBarButtonLayout* member) = 0; virtual void IO(const Ogre::String& propertyName, Size* member) = 0; - virtual void IO(const Ogre::String& propertyName, TextAlignment* member) = 0; + virtual void IO(const Ogre::String& propertyName, HorizontalTextAlignment* member) = 0; virtual void IO(const Ogre::String& propertyName, HorizontalAnchor* member) = 0; virtual void IO(const Ogre::String& propertyName, VerticalAnchor* member) = 0; + virtual void IO(const Ogre::String& propertyName, VerticalTextAlignment* member) = 0; protected: ScriptDefinition* mCurrentDefinition; Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUISerialReader.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUISerialReader.cpp 2008-11-10 17:16:49 UTC (rev 789) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUISerialReader.cpp 2008-11-14 07:08:16 UTC (rev 790) @@ -302,7 +302,7 @@ } } - void SerialReader::IO(const Ogre::String& propertyName, TextAlignment* member) + void SerialReader::IO(const Ogre::String& propertyName, HorizontalTextAlignment* member) { if(mCurrentDefinition == NULL) throw Exception(Exception::ERR_SERIALIZATION,"SerialReader has not been correctly setup to retrieve properties. (Missing call to SerialReader::begin?)","SerialReader::IO"); @@ -310,7 +310,7 @@ DefinitionProperty* prop = mCurrentDefinition->getProperty(propertyName); Ogre::StringVector sv = prop->getValues(); - *member = StringConverter::parseTextAlignment(sv[0]); + *member = StringConverter::parseHorizontalTextAlignment(sv[0]); } void SerialReader::IO(const Ogre::String& propertyName, HorizontalAnchor* member) @@ -335,6 +335,17 @@ *member = StringConverter::parseVerticalAnchor(sv[0]); } + void SerialReader::IO(const Ogre::String& propertyName, VerticalTextAlignment* member) + { + if(mCurrentDefinition == NULL) + throw Exception(Exception::ERR_SERIALIZATION,"SerialReader has not been correctly setup to retrieve properties. (Missing call to SerialReader::begin?)","SerialReader::IO"); + + DefinitionProperty* prop = mCurrentDefinition->getProperty(propertyName); + Ogre::StringVector sv = prop->getValues(); + + *member = StringConverter::parseVerticalTextAlignment(sv[0]); + } + bool SerialReader::isSerialWriter() { return false; Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUISerialReader.h =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUISerialReader.h 2008-11-10 17:16:49 UTC (rev 789) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUISerialReader.h 2008-11-14 07:08:16 UTC (rev 790) @@ -42,9 +42,10 @@ virtual void IO(const Ogre::String& propertyName, VScrollBarButtonLayout* member); virtual void IO(const Ogre::String& propertyName, HScrollBarButtonLayout* member); virtual void IO(const Ogre::String& propertyName, Size* member); - virtual void IO(const Ogre::String& propertyName, TextAlignment* member); + virtual void IO(const Ogre::String& propertyName, HorizontalTextAlignment* member); virtual void IO(const Ogre::String& propertyName, HorizontalAnchor* member); virtual void IO(const Ogre::String& propertyName, VerticalAnchor* member); + virtual void IO(const Ogre::String& propertyName, VerticalTextAlignment* member); bool isSerialWriter(); bool isSerialReader(); Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUISerialWriter.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUISerialWriter.cpp 2008-11-10 17:16:49 UTC (rev 789) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUISerialWriter.cpp 2008-11-14 07:08:16 UTC (rev 790) @@ -291,7 +291,7 @@ mCurrentDefinition->mProperties[propertyName] = newProp; } - void SerialWriter::IO(const Ogre::String& propertyName, TextAlignment* member) + void SerialWriter::IO(const Ogre::String& propertyName, HorizontalTextAlignment* member) { if(mCurrentDefinition == NULL) throw Exception(Exception::ERR_SERIALIZATION,"SerialWriter not setup to write! Did you miss a call to SerialWriter::begin()?","SerialWriter::IO"); @@ -333,6 +333,20 @@ mCurrentDefinition->mProperties[propertyName] = newProp; } + void SerialWriter::IO(const Ogre::String& propertyName, VerticalTextAlignment* member) + { + if(mCurrentDefinition == NULL) + throw Exception(Exception::ERR_SERIALIZATION,"SerialWriter not setup to write! Did you miss a call to SerialWriter::begin()?","SerialWriter::IO"); + + DefinitionProperty* newProp = new DefinitionProperty(propertyName); + newProp->mValues.push_back(StringConverter::toString(*member)); + + if(mCurrentDefinition->mProperties.find(propertyName) != mCurrentDefinition->mProperties.end()) + throw Exception(Exception::ERR_SERIALIZATION,"ScriptDefinition already contains the property \"" + propertyName + "\"!","SerialWriter::IO"); + else + mCurrentDefinition->mProperties[propertyName] = newProp; + } + bool SerialWriter::isSerialWriter() { return true; Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUISerialWriter.h =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUISerialWriter.h 2008-11-10 17:16:49 UTC (rev 789) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUISerialWriter.h 2008-11-14 07:08:16 UTC (rev 790) @@ -50,9 +50,10 @@ virtual void IO(const Ogre::String& propertyName, VScrollBarButtonLayout* member); virtual void IO(const Ogre::String& propertyName, HScrollBarButtonLayout* member); virtual void IO(const Ogre::String& propertyName, Size* member); - virtual void IO(const Ogre::String& propertyName, TextAlignment* member); + virtual void IO(const Ogre::String& propertyName, HorizontalTextAlignment* member); virtual void IO(const Ogre::String& propertyName, HorizontalAnchor* member); virtual void IO(const Ogre::String& propertyName, VerticalAnchor* member); + virtual void IO(const Ogre::String& propertyName, VerticalTextAlignment* member); bool isSerialWriter(); bool isSerialReader(); Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIStringConverter.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIStringConverter.cpp 2008-11-10 17:16:49 UTC (rev 789) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIStringConverter.cpp 2008-11-14 07:08:16 UTC (rev 790) @@ -29,16 +29,15 @@ } } - Ogre::String StringConverter::toString(Padding p) + Ogre::String StringConverter::toString(HorizontalTextAlignment a) { - switch(p) + switch(a) { - case PADDING_LEFT: return "PADDING_LEFT"; - case PADDING_RIGHT: return "PADDING_RIGHT"; - case PADDING_TOP: return "PADDING_TOP"; - case PADDING_BOTTOM: return "PADDING_BOTTOM"; + case TEXT_ALIGNMENT_HORIZONTAL_LEFT: return "TEXT_ALIGNMENT_HORIZONTAL_LEFT"; + case TEXT_ALIGNMENT_HORIZONTAL_RIGHT: return "TEXT_ALIGNMENT_HORIZONTAL_RIGHT"; + case TEXT_ALIGNMENT_HORIZONTAL_CENTER: return "TEXT_ALIGNMENT_HORIZONTAL_CENTER"; default: - throw Exception(Exception::ERR_SERIALIZATION,"Padding type does not have a string equivalent! Check if update is needed!","StringConverter::toString"); + throw Exception(Exception::ERR_SERIALIZATION,"HorizontalTextAlignment type does not have a string equivalent! Check if update is needed!","StringConverter::toString"); } } @@ -107,18 +106,6 @@ } } - Ogre::String StringConverter::toString(TextAlignment a) - { - switch(a) - { - case TEXT_ALIGNMENT_LEFT: return "TEXT_ALIGNMENT_LEFT"; - case TEXT_ALIGNMENT_RIGHT: return "TEXT_ALIGNMENT_RIGHT"; - case TEXT_ALIGNMENT_CENTER: return "TEXT_ALIGNMENT_CENTER"; - default: - throw Exception(Exception::ERR_SERIALIZATION,"TextAlignment type does not have a string equivalent! Check if update is needed!","StringConverter::toString"); - } - } - Ogre::String StringConverter::toString(ToolBarItemLayout l) { switch(l) @@ -145,6 +132,18 @@ } } + Ogre::String StringConverter::toString(VerticalTextAlignment a) + { + switch(a) + { + case TEXT_ALIGNMENT_VERTICAL_BOTTOM: return "TEXT_ALIGNMENT_VERTICAL_BOTTOM"; + case TEXT_ALIGNMENT_VERTICAL_CENTER: return "TEXT_ALIGNMENT_VERTICAL_CENTER"; + case TEXT_ALIGNMENT_VERTICAL_TOP: return "TEXT_ALIGNMENT_VERTICAL_TOP"; + default: + throw Exception(Exception::ERR_SERIALIZATION,"VerticalTextAlignment type does not have a string equivalent! Check if update is needed!","StringConverter::toString"); + } + } + Ogre::String StringConverter::toString(WidgetEvent e) { switch(e) @@ -209,14 +208,13 @@ throw Exception(Exception::ERR_SERIALIZATION,"\"" + s + "\" is not a recognized HorizontalAnchor type! (Possible need to update?)","StringConverter::parseHorizontalAnchor"); } - Padding StringConverter::parsePadding(const Ogre::String& s) + HorizontalTextAlignment StringConverter::parseHorizontalTextAlignment(const Ogre::String& s) { - if(s == "PADDING_LEFT") return PADDING_LEFT; - else if(s == "PADDING_RIGHT") return PADDING_RIGHT; - else if(s == "PADDING_TOP") return PADDING_TOP; - else if(s == "PADDING_BOTTOM") return PADDING_BOTTOM; + if(s == "TEXT_ALIGNMENT_HORIZONTAL_LEFT") return TEXT_ALIGNMENT_HORIZONTAL_LEFT; + else if(s == "TEXT_ALIGNMENT_HORIZONTAL_RIGHT") return TEXT_ALIGNMENT_HORIZONTAL_RIGHT; + else if(s == "TEXT_ALIGNMENT_HORIZONTAL_CENTER") return TEXT_ALIGNMENT_HORIZONTAL_CENTER; else - throw Exception(Exception::ERR_SERIALIZATION,"\"" + s + "\" is not a recognized Padding type! (Possible need to update?)","StringConverter::parsePadding"); + throw Exception(Exception::ERR_SERIALIZATION,"\"" + s + "\" is not a recognized HorizontalTextAlignment type! (Possible need to update?)","StringConverter::parseHorizontalTextAlignment"); } VScrollBarButtonLayout StringConverter::parseVScrollBarButtonLayout(const Ogre::String& s) @@ -269,15 +267,6 @@ throw Exception(Exception::ERR_SERIALIZATION,"\"" + s + "\" is not a recognized ProgressBarClippingEdge type! (Possible need to update?)","StringConverter::parseProgressBarClippingEdge"); } - TextAlignment StringConverter::parseTextAlignment(const Ogre::String& s) - { - if(s == "TEXT_ALIGNMENT_LEFT") return TEXT_ALIGNMENT_LEFT; - else if(s == "TEXT_ALIGNMENT_RIGHT") return TEXT_ALIGNMENT_RIGHT; - else if(s == "TEXT_ALIGNMENT_CENTER") return TEXT_ALIGNMENT_CENTER; - else - throw Exception(Exception::ERR_SERIALIZATION,"\"" + s + "\" is not a recognized TextAlignment type! (Possible need to update?)","StringConverter::parseTextAlignment"); - } - ToolBarItemLayout StringConverter::parseToolBarItemLayout(const Ogre::String& s) { if(s == "TOOLBAR_ITEM_LAYOUT_NEGATIVE_TO_POSITIVE") return TOOLBAR_ITEM_LAYOUT_NEGATIVE_TO_POSITIVE; @@ -298,6 +287,15 @@ throw Exception(Exception::ERR_SERIALIZATION,"\"" + s + "\" is not a recognized VerticalAnchor type! (Possible need to update?)","StringConverter::parseVerticalAnchor"); } + VerticalTextAlignment StringConverter::parseVerticalTextAlignment(const Ogre::String& s) + { + if(s == "TEXT_ALIGNMENT_VERTICAL_BOTTOM") return TEXT_ALIGNMENT_VERTICAL_BOTTOM; + else if(s == "TEXT_ALIGNMENT_VERTICAL_CENTER") return TEXT_ALIGNMENT_VERTICAL_CENTER; + else if(s == "TEXT_ALIGNMENT_VERTICAL_TOP") return TEXT_ALIGNMENT_VERTICAL_TOP; + else + throw Exception(Exception::ERR_SERIALIZATION,"\"" + s + "\" is not a recognized VerticalTextAlignment type! (Possible need to update?)","StringConverter::parseVerticalTextAlignment"); + } + WidgetEvent StringConverter::parseWidgetEvent(const Ogre::String& s) { if(s == "WIDGET_EVENT_ENABLED_CHANGED") return WIDGET_EVENT_ENABLED_CHANGED; Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUIStringConverter.h =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUIStringConverter.h 2008-11-10 17:16:49 UTC (rev 789) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUIStringConverter.h 2008-11-14 07:08:16 UTC (rev 790) @@ -5,7 +5,6 @@ #include "QuickGUIBrushEnums.h" #include "QuickGUIException.h" #include "QuickGUIExportDLL.h" -#include "QuickGUIPadding.h" #include "QuickGUIProgressBarEnums.h" #include "QuickGUIEventTypes.h" #include "QuickGUIScrollBarButtonLayouts.h" @@ -22,29 +21,29 @@ public: static Ogre::String toString(BrushFilterMode m); static Ogre::String toString(HorizontalAnchor a); - static Ogre::String toString(Padding p); - static Ogre::String toString(VScrollBarButtonLayout l); + static Ogre::String toString(HorizontalTextAlignment a); static Ogre::String toString(HScrollBarButtonLayout l); static Ogre::String toString(ProgressBarFillDirection d); static Ogre::String toString(ProgressBarLayout l); static Ogre::String toString(ProgressBarClippingEdge e); - static Ogre::String toString(TextAlignment a); static Ogre::String toString(ToolBarItemLayout l); static Ogre::String toString(VerticalAnchor a); + static Ogre::String toString(VerticalTextAlignment a); + static Ogre::String toString(VScrollBarButtonLayout l); static Ogre::String toString(WidgetEvent e); static Ogre::String toString(WindowEvent e); static BrushFilterMode parseBrushFilterMode(const Ogre::String& s); static HorizontalAnchor parseHorizontalAnchor(const Ogre::String& s); - static Padding parsePadding(const Ogre::String& s); - static VScrollBarButtonLayout parseVScrollBarButtonLayout(const Ogre::String& s); + static HorizontalTextAlignment parseHorizontalTextAlignment(const Ogre::String& s); static HScrollBarButtonLayout parseHScrollBarButtonLayout(const Ogre::String& s); static ProgressBarFillDirection parseProgressBarFillDirection(const Ogre::String& s); static ProgressBarLayout parseProgressBarLayout(const Ogre::String& s); static ProgressBarClippingEdge parseProgressBarClippingEdge(const Ogre::String& s); - static TextAlignment parseTextAlignment(const Ogre::String& s); static ToolBarItemLayout parseToolBarItemLayout(const Ogre::String& s); static VerticalAnchor parseVerticalAnchor(const Ogre::String& s); + static VerticalTextAlignment parseVerticalTextAlignment(const Ogre::String& s); + static VScrollBarButtonLayout parseVScrollBarButtonLayout(const Ogre::String& s); static WidgetEvent parseWidgetEvent(const Ogre::String& s); static WindowEvent parseWindowEvent(const Ogre::String& s); Modified: trunk/python-ogre/ThirdParty/quickgui/QuickGUITab.cpp =================================================================== --- trunk/python-ogre/ThirdParty/quickgui/QuickGUITab.cpp 2008-11-10 17:16:49 UTC (rev 789) +++ trunk/python-ogre/ThirdParty/quickgui/QuickGUITab.cpp 2008-11-14 07:08:16 UTC (rev 790) @@ -44,9 +44,9 @@ if(mDesc->textDesc.segments.empty()) mDesc->dimensions.size.width = mDesc->frontWidth + 50; else - mDesc->dimensions.size.width = mDesc->frontWidth + mDesc->textDesc.getTextWidth() + mDesc->padding[PADDING_RIGHT]; + mDesc->dimensions.size.width = mDesc->frontWidth + mDesc->textDesc.getTextWidth() + mSkinType->getSkinElement(mSkinElementName)->getBorderThickness(BORDER_RIGHT); - mText->setAllottedWidth(mDesc->textDesc.getTextWidth() + mDesc->padding[PADDING_RIGHT]); + mText->setAllottedWidth(mDesc->textDesc.getTextWidth() + mSkinType->getSkinElement(mSkinElementName)->getBorderThickness(BORDER_RIGHT)); } void Tab::_initialize(WidgetDesc* d) @@ -64,11 +64,6 @@ else mDesc->frontWidth = td->frontWidth; - mDesc->padding[PADDING_LEFT] = td->padding[PADDING_LEFT]; - mDesc->padding[PADDING_RIGHT] = td->padding[PADDING_RIGHT]; - mDesc->padding[PADDING_BOTTOM] = td->padding[PADDING_BOTTOM]; - mDesc->padding[PADDING_TOP] = td->padding[PADDING_TOP]; - // Make a copy of the Text Desc. The Text object will // modify it directly, which is used for serialization. mDesc->textDesc = td->textDesc; @@ -76,14 +71,15 @@ if(mDesc->textDesc.segments.empty()) mDesc->dimensions.size.width = mDesc->frontWidth + 50; else - mDesc->dimensions.size.width = mDesc->frontWidth + mDesc->padding[PADDING_LEFT] + mDesc->textDesc.getTextWidth() + mDesc->padding[PADDING_RIGHT]; + mDesc->dimensions.size.width = mDesc->frontWidth + mSkinType->getSkinElement(MAIN)->getBorderThickness(BORDER_LEFT) + mDesc->textDesc.getTextWidth() + mSkinType->getSkinElement(MAIN)->getBorderThickness(BORDER_RIGHT); if(mDesc->textDesc.segments.empty()) mDesc->dimensions.size.height = 20; else - mDesc->dimensions.size.height = mDesc->padding[PADDING_TOP] + mDesc->textDesc.getTextHeight() + mDesc->padding[PADDING_BOTTOM]; + mDesc->dimensions.size.height = mSkinType->getSkinElement(mSkinElementName)->getBorderThickness(BORDER_TOP) + mDesc->textDesc.getTextHeight() + mSkinType->getSkinElement(mSkinElementName)->getBorderThickness(BORDER_BOTTOM); - mDesc->textDesc.allottedWidth = mDesc->textDesc.getTextWidth() + mDesc->padding[PADDING_RIGHT]; + mDesc->verticalTextAlignment = td->verticalTextAlignment; + mDesc->textDesc.allottedWidth = mDesc->textDesc.getTextWidth() + mSkinType->getSkinElement(mSkinElementName)->getBorderThickness(BORDER_RIGHT); mText = new Text(mDesc->textDesc); mCurrentFontName = Text::get... [truncated message content] |
From: <and...@us...> - 2008-11-14 07:14:41
|
Revision: 791 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=791&view=rev Author: andy_miller Date: 2008-11-14 07:14:30 +0000 (Fri, 14 Nov 2008) Log Message: ----------- Cleaning up loder NxOgre files Modified Paths: -------------- trunk/python-ogre/environment.py Removed Paths: ------------- trunk/python-ogre/ThirdParty/nxogre/BetajaenCC.cpp trunk/python-ogre/ThirdParty/nxogre/BetajaenCC.h trunk/python-ogre/ThirdParty/nxogre/NxOgre.h trunk/python-ogre/ThirdParty/nxogre/NxOgreActor.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreActor.h trunk/python-ogre/ThirdParty/nxogre/NxOgreActors.h trunk/python-ogre/ThirdParty/nxogre/NxOgreAllocator.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreAllocator.h trunk/python-ogre/ThirdParty/nxogre/NxOgreAnimatedRenderable.h trunk/python-ogre/ThirdParty/nxogre/NxOgreBody.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreBody.h trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacter.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacter.h trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterController.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterController.h trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterModel.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterModel.h trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterMovementModel.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreCharacterMovementModel.h trunk/python-ogre/ThirdParty/nxogre/NxOgreCloth.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreCloth.h trunk/python-ogre/ThirdParty/nxogre/NxOgreClothRaycaster.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreClothRaycaster.h trunk/python-ogre/ThirdParty/nxogre/NxOgreCompoundActor.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreCompoundActor.h trunk/python-ogre/ThirdParty/nxogre/NxOgreConfig.h trunk/python-ogre/ThirdParty/nxogre/NxOgreContactCallback.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreContactCallback.h trunk/python-ogre/ThirdParty/nxogre/NxOgreContactCallbackController.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreContactCallbackController.h trunk/python-ogre/ThirdParty/nxogre/NxOgreContactStream.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreContactStream.h trunk/python-ogre/ThirdParty/nxogre/NxOgreContainer.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreContainer.h trunk/python-ogre/ThirdParty/nxogre/NxOgreDebugRenderer.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreDebugRenderer.h trunk/python-ogre/ThirdParty/nxogre/NxOgreDeletionCallback.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreDeletionCallback.h trunk/python-ogre/ThirdParty/nxogre/NxOgreDominanceGroup.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreDominanceGroup.h trunk/python-ogre/ThirdParty/nxogre/NxOgreDualIdentifier.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreDualIdentifier.h trunk/python-ogre/ThirdParty/nxogre/NxOgreEffectsSystem.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreEffectsSystem.h trunk/python-ogre/ThirdParty/nxogre/NxOgreEngine.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreEngine.h trunk/python-ogre/ThirdParty/nxogre/NxOgreError.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreError.h trunk/python-ogre/ThirdParty/nxogre/NxOgreExtendedTypes.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreExtendedTypes.h trunk/python-ogre/ThirdParty/nxogre/NxOgreFileResource.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreFileResource.h trunk/python-ogre/ThirdParty/nxogre/NxOgreFileResourceManager.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreFileResourceManager.h trunk/python-ogre/ThirdParty/nxogre/NxOgreFluid.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreFluid.h trunk/python-ogre/ThirdParty/nxogre/NxOgreForceField.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreForceField.h trunk/python-ogre/ThirdParty/nxogre/NxOgreGroup.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreGroup.h trunk/python-ogre/ThirdParty/nxogre/NxOgreHash.h trunk/python-ogre/ThirdParty/nxogre/NxOgreHeightfield.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreHeightfield.h trunk/python-ogre/ThirdParty/nxogre/NxOgreHelpers.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreHelpers.h trunk/python-ogre/ThirdParty/nxogre/NxOgreIntersection.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreIntersection.h trunk/python-ogre/ThirdParty/nxogre/NxOgreJoint.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreJoint.h trunk/python-ogre/ThirdParty/nxogre/NxOgreJointCallback.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreJointCallback.h trunk/python-ogre/ThirdParty/nxogre/NxOgreJointSet1.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreJointSet1.h trunk/python-ogre/ThirdParty/nxogre/NxOgreJointSet2.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreJointSet2.h trunk/python-ogre/ThirdParty/nxogre/NxOgreKinematicCharacter.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreKinematicCharacter.h trunk/python-ogre/ThirdParty/nxogre/NxOgreKinematicCharacterSweep.h trunk/python-ogre/ThirdParty/nxogre/NxOgreLog.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreLog.h trunk/python-ogre/ThirdParty/nxogre/NxOgreMachine.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreMachine.h trunk/python-ogre/ThirdParty/nxogre/NxOgreManualHeightfield.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreManualHeightfield.h trunk/python-ogre/ThirdParty/nxogre/NxOgreManualMesh.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreManualMesh.h trunk/python-ogre/ThirdParty/nxogre/NxOgreManualMeshUtil.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreManualMeshUtil.h trunk/python-ogre/ThirdParty/nxogre/NxOgreMaterial.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreMaterial.h trunk/python-ogre/ThirdParty/nxogre/NxOgreMaterialAlias.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreMaterialAlias.h trunk/python-ogre/ThirdParty/nxogre/NxOgreMemoryResource.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreMemoryResource.h trunk/python-ogre/ThirdParty/nxogre/NxOgreMemoryResourceManager.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreMemoryResourceManager.h trunk/python-ogre/ThirdParty/nxogre/NxOgreMesh.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreMesh.h trunk/python-ogre/ThirdParty/nxogre/NxOgreMeshParams.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreMeshParams.h trunk/python-ogre/ThirdParty/nxogre/NxOgreMeshRenderable.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreMeshRenderable.h trunk/python-ogre/ThirdParty/nxogre/NxOgreNodeRenderable.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreNodeRenderable.h trunk/python-ogre/ThirdParty/nxogre/NxOgreNxActorController.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreNxActorController.h trunk/python-ogre/ThirdParty/nxogre/NxOgreOgreMeshRenderable.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreOgreMeshRenderable.h trunk/python-ogre/ThirdParty/nxogre/NxOgreOgreNodeRenderable.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreOgreNodeRenderable.h trunk/python-ogre/ThirdParty/nxogre/NxOgreOgreSceneRenderer.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreOgreSceneRenderer.h trunk/python-ogre/ThirdParty/nxogre/NxOgreOgreTimeController.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreOgreTimeController.h trunk/python-ogre/ThirdParty/nxogre/NxOgreParams.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreParams.h trunk/python-ogre/ThirdParty/nxogre/NxOgreParticleSystem.h trunk/python-ogre/ThirdParty/nxogre/NxOgrePerformer.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgrePerformer.h trunk/python-ogre/ThirdParty/nxogre/NxOgrePhysXDriver.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgrePhysXDriver.h trunk/python-ogre/ThirdParty/nxogre/NxOgrePlatform.h trunk/python-ogre/ThirdParty/nxogre/NxOgrePose.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgrePose.h trunk/python-ogre/ThirdParty/nxogre/NxOgrePrerequisites.h trunk/python-ogre/ThirdParty/nxogre/NxOgrePrerequisitesOgre.h trunk/python-ogre/ThirdParty/nxogre/NxOgreRaycaster.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreRaycaster.h trunk/python-ogre/ThirdParty/nxogre/NxOgreRemoteDebuggerConnection.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreRemoteDebuggerConnection.h trunk/python-ogre/ThirdParty/nxogre/NxOgreRenderable.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreRenderable.h trunk/python-ogre/ThirdParty/nxogre/NxOgreRenderableSource.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreRenderableSource.h trunk/python-ogre/ThirdParty/nxogre/NxOgreResource.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreResource.h trunk/python-ogre/ThirdParty/nxogre/NxOgreResourceCallback.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreResourceCallback.h trunk/python-ogre/ThirdParty/nxogre/NxOgreResourceManager.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreResourceManager.h trunk/python-ogre/ThirdParty/nxogre/NxOgreResourceSystem.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreResourceSystem.h trunk/python-ogre/ThirdParty/nxogre/NxOgreScene.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreScene.h trunk/python-ogre/ThirdParty/nxogre/NxOgreSceneContactController.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSceneContactController.h trunk/python-ogre/ThirdParty/nxogre/NxOgreSceneController.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSceneController.h trunk/python-ogre/ThirdParty/nxogre/NxOgreSceneRenderer.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSceneRenderer.h trunk/python-ogre/ThirdParty/nxogre/NxOgreSceneSource.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSceneSource.h trunk/python-ogre/ThirdParty/nxogre/NxOgreSceneTriggerController.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSceneTriggerController.h trunk/python-ogre/ThirdParty/nxogre/NxOgreShape.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreShape.h trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeMeshes.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeMeshes.h trunk/python-ogre/ThirdParty/nxogre/NxOgreShapePrimitives.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreShapePrimitives.h trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeTerrain.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeTerrain.h trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeWheel.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreShapeWheel.h trunk/python-ogre/ThirdParty/nxogre/NxOgreSheet.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSheet.h trunk/python-ogre/ThirdParty/nxogre/NxOgreSimpleActor.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSimpleActor.h trunk/python-ogre/ThirdParty/nxogre/NxOgreSimpleShape.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSimpleShape.h trunk/python-ogre/ThirdParty/nxogre/NxOgreSkeletalRenderable.h trunk/python-ogre/ThirdParty/nxogre/NxOgreSkeleton.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSkeleton.h trunk/python-ogre/ThirdParty/nxogre/NxOgreSleepCallback.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSleepCallback.h trunk/python-ogre/ThirdParty/nxogre/NxOgreSoftBody.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreSoftBody.h trunk/python-ogre/ThirdParty/nxogre/NxOgreSpriteRenderable.h trunk/python-ogre/ThirdParty/nxogre/NxOgreStable.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreStable.h trunk/python-ogre/ThirdParty/nxogre/NxOgreTesting.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreTesting.h trunk/python-ogre/ThirdParty/nxogre/NxOgreThrow.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreTimeController.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreTimeController.h trunk/python-ogre/ThirdParty/nxogre/NxOgreTimeStep.h trunk/python-ogre/ThirdParty/nxogre/NxOgreTimer.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreTimer.h trunk/python-ogre/ThirdParty/nxogre/NxOgreTrigger.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreTrigger.h trunk/python-ogre/ThirdParty/nxogre/NxOgreTriggerCallback.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreTriggerCallback.h trunk/python-ogre/ThirdParty/nxogre/NxOgreTriggerFunction.h trunk/python-ogre/ThirdParty/nxogre/NxOgreUserAllocator.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreUserAllocator.h trunk/python-ogre/ThirdParty/nxogre/NxOgreVoidPointer.h trunk/python-ogre/ThirdParty/nxogre/NxOgreVoxelRenderable.h trunk/python-ogre/ThirdParty/nxogre/NxOgreWheelContactCallback.h trunk/python-ogre/ThirdParty/nxogre/NxOgreWheelSet.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreWheelSet.h trunk/python-ogre/ThirdParty/nxogre/NxOgreWhen.h trunk/python-ogre/ThirdParty/nxogre/NxOgreWorld.cpp trunk/python-ogre/ThirdParty/nxogre/NxOgreWorld.h trunk/python-ogre/ThirdParty/nxogre_0.9/ Deleted: trunk/python-ogre/ThirdParty/nxogre/BetajaenCC.cpp =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/BetajaenCC.cpp 2008-11-14 07:08:16 UTC (rev 790) +++ trunk/python-ogre/ThirdParty/nxogre/BetajaenCC.cpp 2008-11-14 07:14:30 UTC (rev 791) @@ -1,653 +0,0 @@ -/* - -Betajaen's Container Classes - -Copyright (c) 2007 Robin Southern, http://www.nxogre.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -*/ - -#include "NxOgreStable.h" -#include "BetajaenCC.h" - -#if 0 - -BETAJAEN_CC_NAMESPACE_START - -/* - Flat - - \note Iterator is known as Type* in this file only. -*/ - -template< class Type, class AllocatorType > -Flat<Type, AllocatorType>::Flat(AllocatorPtr allocator, bool deleteAllocator) - : First(NULL), Last(NULL), End(NULL), Allocator(allocator), AutoDeleteAllocator(deleteAllocator) -{ -} - -///////////////////////////////////////////////////////////// - -template< class Type, class AllocatorType > -Flat<Type, AllocatorType>::~Flat() -{ - _deallocate(First); - if (AutoDeleteAllocator) - delete Allocator; -} - -///////////////////////////////////////////////////////////// - -template< class Type, class AllocatorType > -unsigned int Flat<Type, AllocatorType>::_size() const -{ - return (unsigned int) (Last - First); -} - -///////////////////////////////////////////////////////////// - -template< class Type, class AllocatorType > -unsigned int Flat<Type, AllocatorType>::_capacity() const -{ - return (unsigned int) (First == 0 ? 0 : End - First); -} - -///////////////////////////////////////////////////////////// - -template< class Type, class AllocatorType > -Type* Flat<Type, AllocatorType>::_allocate(unsigned int size) -{ - return (Type*) Allocator->Allocate(size * sizeof(Type)); -} - -///////////////////////////////////////////////////////////// - -template< class Type, class AllocatorType > -void Flat<Type, AllocatorType>::_deallocate(Type* p) -{ - if (p) - Allocator->Deallocate(p); -} - -///////////////////////////////////////////////////////////// - -template< class Type, class AllocatorType > -Type* Flat<Type, AllocatorType>::_reallocate(Type* p, unsigned int size) -{ - return (Iterator) Allocator->Reallocate(p, size * sizeof(Type)); -} - -///////////////////////////////////////////////////////////// - -template< class Type, class AllocatorType > -void Flat<Type, AllocatorType>::_clip(unsigned int size) -{ - - if (size < _size()) - return; - - Iterator new_first = _allocate(size); - _copy(First, Last, new_first); - _destroy(First, Last); - _deallocate(First); - End = new_first + size; - Last = new_first + _size(); - First = new_first; - -} - -///////////////////////////////////////////////////////////// - -template< class Type, class AllocatorType > -void Flat<Type, AllocatorType>::_reserve(unsigned int new_size) -{ - if (_capacity() >= new_size) - return; - - Iterator new_first = _allocate(new_size); - _copy(First, Last, new_first); - _destroy(First, Last); - _deallocate(First); - End = new_first + new_size; - Last = new_first + _size(); - First = new_first; - -} - -///////////////////////////////////////////////////////////// - -template< class Type, class AllocatorType > -Type* Flat<Type, AllocatorType>::_copy(Type* begin, Type* end, Type* dest) -{ - for (;begin != end; ++dest, ++begin) - *dest = *begin; - return dest; -} - -///////////////////////////////////////////////////////////// - -template< class Type, class AllocatorType > -void Flat<Type, AllocatorType>::_delete_range(Type* begin, Type* end) -{ - for (; begin != end; ++begin) { - BETAJAEN_CC_DELETE(*begin); - } -} - -///////////////////////////////////////////////////////////// - -template< class Type, class AllocatorType > -void Flat<Type, AllocatorType>::_destroy(Type* begin, Type* end) -{ - for (; begin != end; ++begin) { - BETAJAEN_CC_DESTRUCTOR(begin) - begin->~Type(); - } -} - -BETAJAEN_CC_NAMESPACE_END - - -/** - SharedList -*/ - -BETAJAEN_CC_NAMESPACE_START - -///////////////////////////////////////////////////////////// - -#define SharedListType SharedList<Type, AllocatorType> -#define TypePtr Type* - -///////////////////////////////////////////////////////////// - -template < class Type, class AllocatorType > -SharedList<Type, AllocatorType>::SharedList(AllocatorType* _allocator, bool _auto_delete_allocator) -{ - if (_allocator == NULL) - _allocator = new AllocatorType(); - - _Flat = new FlatType(_allocator, _auto_delete_allocator); - _Usage = new unsigned int(1); - -} - -///////////////////////////////////////////////////////////// - -template < class Type, class AllocatorType > -SharedList<Type, AllocatorType>::SharedList(const SharedListType& other) -{ - - _Flat = other._Flat; - _Usage = other._Usage; - ++(*_Usage); - -} - -///////////////////////////////////////////////////////////// - -template < class Type, class AllocatorType > -SharedListType& SharedList<Type, AllocatorType>::operator=(const SharedListType& other) -{ - - if (_Flat) - { - _Flat->_delete_range(_Flat->First, _Flat->Last); - delete _Flat; - } - - if (_Usage) - delete _Usage; - - _Flat = other._Flat; - _Usage = other._Usage; - ++(*_Usage); - - return *this; - -} - -///////////////////////////////////////////////////////////// - -template < class Type, class AllocatorType > -TypePtr SharedList<Type, AllocatorType>::Get(size_t pos) -{ - if (pos > Size()) - return NULL; - - return *(_Flat->First + pos); -} - -///////////////////////////////////////////////////////////// - -template < class Type, class AllocatorType > -TypePtr SharedList<Type, AllocatorType>::operator[](size_t pos) -{ - if (pos > Size()) - return NULL; - - return *(_Flat->First + pos); -} - -///////////////////////////////////////////////////////////// - -template < class Type, class AllocatorType > -unsigned int SharedList<Type, AllocatorType>::WhereIs(TypePtr ptr) -{ - - if (_Flat->_size() == 0) - return 0; - - unsigned int i=0; - for(Iterator begin = _Flat->First; begin != _Flat->Last; ++begin, ++i) - { - if (ptr == (*begin)) - return i; - } - - return 0; -} - -///////////////////////////////////////////////////////////// - -template < class Type, class AllocatorType > -bool SharedList<Type, AllocatorType>::Has(TypePtr ptr) -{ - - if (_Flat->_size() == 0) - return false; - - for(Iterator begin = _Flat->First; begin != _Flat->Last; ++begin) - { - if (ptr == (*begin)) - return true; - } - - return false; - -} - -///////////////////////////////////////////////////////////// - -template < class Type, class AllocatorType > -unsigned SharedList<Type, AllocatorType>::Size() const -{ - return _Flat->_size(); -} - -///////////////////////////////////////////////////////////// - -template < class Type, class AllocatorType > -void SharedList<Type, AllocatorType>::Insert(Type* const & val) -{ - - if (_Flat->End <= _Flat->Last) - _Flat->_reserve( (1 + Size()) * 2); - - *_Flat->Last = val; - _Flat->Last++; - -} - -///////////////////////////////////////////////////////////// - -template < class Type, class AllocatorType > -void SharedList<Type, AllocatorType>::Clean(unsigned int n) -{ - _Flat->_clip(_Flat->_size() + n); -} - -///////////////////////////////////////////////////////////// - -template < class Type, class AllocatorType > -void SharedList<Type, AllocatorType>::Destroy(unsigned int n) -{ - if (n == 0) - return Destroy(First); - - if (n == Size()) - return Destroy(Last); - - delete *(_Flat->First + n); - - _Flat->_destroy(_Flat->First + n, _Flat->First + n + 1); - _Flat->_copy(_Flat->First + n + 1, _Flat->Last, _Flat->First + n); - _Flat->Last--; - -} - -///////////////////////////////////////////////////////////// - -template < class Type, class AllocatorType > -void SharedList<Type, AllocatorType>::DestroyAll() -{ - if (Size() == 0) - return; - - _Flat->_delete_range(_Flat->First, _Flat->Last); - // Could be iffy. - _Flat->Last = _Flat->First; - -} - -///////////////////////////////////////////////////////////// - -template < class Type, class AllocatorType > -void SharedList<Type, AllocatorType>::Destroy(TypePtr val) { - unsigned int i = WhereIs(val); - Destroy(i); -} - -///////////////////////////////////////////////////////////// - -template < class Type, class AllocatorType > -void SharedList<Type, AllocatorType>::Destroy(AbsolutePosition position) -{ - - switch(position) { - - case First: - { - delete *_Flat->First; - _Flat->_copy(_Flat->First + 1, _Flat->Last + 1, _Flat->First); - _Flat->Last--; - } - break; - - case Last: - { - _Flat->Last--; - delete *_Flat->Last; - } - break; - - } - -} - -///////////////////////////////////////////////////////////// - -template < class Type, class AllocatorType > -TypePtr SharedList<Type, AllocatorType>::Remove(unsigned int n) -{ - - if (n == 0) - return Remove(First); - - if (n == Size()) - return Remove(Last); - - TypePtr ptr = Get(n); - _Flat->_destroy(_Flat->First + n, _Flat->First + n + 1); - _Flat->_copy(_Flat->First + n + 1, _Flat->Last, _Flat->First + n); - _Flat->Last--; - - return ptr; -} - -///////////////////////////////////////////////////////////// - -template < class Type, class AllocatorType > -TypePtr SharedList<Type, AllocatorType>::Remove(AbsolutePosition position) -{ - - if (_Flat->_size() == 0) - return NULL; - - switch(position) { - - case First: - { - TypePtr t = *(_Flat->First); - _Flat->_copy(_Flat->First + 1, _Flat->Last + 1, _Flat->First); - _Flat->Last--; - return t; - } - - break; - - case Last: - { - _Flat->Last--; - return *(_Flat->Last); - } - break; - } - - return NULL; - -} - -///////////////////////////////////////////////////////////// - -template < class Type, class AllocatorType > -TypePtr SharedList<Type, AllocatorType>::Begin() -{ - - if (_Flat->_size() == 0) - return NULL; - - _Iterator = _Flat->First; - return *_Iterator; - -} - -///////////////////////////////////////////////////////////// - -template < class Type, class AllocatorType > -TypePtr SharedList<Type, AllocatorType>::Next() -{ - - if (_Flat->_size() == 0) - return NULL; - else if (_Iterator == _Flat->Last) - return NULL; - else - return (*_Iterator++); - -} - -///////////////////////////////////////////////////////////// - -template < class Type, class AllocatorType > -TypePtr SharedList<Type, AllocatorType>::End() -{ - - if (_Flat->_size() == 0) - return NULL; - - _Iterator = _Flat->Last - 1; - return *_Iterator; - -} - -///////////////////////////////////////////////////////////// - -template < class Type, class AllocatorType > -TypePtr SharedList<Type, AllocatorType>::Previous() -{ - - if (_Flat->_size() == 0) - return NULL; - else if (_Iterator == _Flat->First - 1) - return NULL; - else - return (*_Iterator--); - -} - -///////////////////////////////////////////////////////////// - -template < class Type, class AllocatorType > -void SharedList<Type, AllocatorType>::Each(void (Type::*MethodPtr)()) { - - if (_Flat->_size() == 0) - return; - - for(Iterator begin = _Flat->First; begin != _Flat->Last; ++begin) { - (*begin->*MethodPtr)(); - } - -} - -///////////////////////////////////////////////////////////// - -template < typename Type, typename AllocatorType> -template < typename _A > -void SharedList<Type, AllocatorType>::Each(void (Type::*MethodPtr)(_A), _A _1) { - - if (_Flat->_size() == 0) - return; - - for(Iterator begin = _Flat->First; begin != _Flat->Last; ++begin) { - (*begin->*MethodPtr)(_1); - } - -} - -///////////////////////////////////////////////////////////// - -template < typename Type, typename AllocatorType> -template < typename _A, typename _B> -void SharedList<Type, AllocatorType>::Each(void (Type::*MethodPtr)(_A, _B), _A _1, _B _2) { - - if (_Flat->_size() == 0) - return; - - for(Iterator begin = _Flat->First; begin != _Flat->Last; ++begin) - (*begin->*MethodPtr)(_1, _2); - -} - -///////////////////////////////////////////////////////////// - -template < typename Type, typename AllocatorType> -template <typename _A, typename _B, typename _C> -void SharedList<Type, AllocatorType>::Each(void (Type::*MethodPtr)(_A, _B, _C), _A _1, _B _2, _C _3) -{ - - if (_Flat->_size() == 0) - return; - - for(Iterator begin = _Flat->First; begin != _Flat->Last; ++begin) - (*begin->*MethodPtr)(_1, _2, _3); - -} - -///////////////////////////////////////////////////////////// - -template < typename Type, typename AllocatorType> -template <typename _A, typename _B, typename _C, typename _D> -void SharedList<Type, AllocatorType>::Each(void (Type::*MethodPtr)(_A, _B, _C, _D), _A _1, _B _2, _C _3, _D _4) -{ - - if (_Flat->_size() == 0) - return; - - for(Iterator begin = _Flat->First; begin != _Flat->Last; ++begin) - (*begin->*MethodPtr)(_1, _2, _3, _4); - -} - -///////////////////////////////////////////////////////////// - -template < typename Type, typename AllocatorType> -template <typename _A, typename _B, typename _C, typename _D, typename _E> -void SharedList<Type, AllocatorType>::Each(void (Type::*MethodPtr)(_A, _B, _C, _D), _A _1, _B _2, _C _3, _D _4, _E _5) { - - if (_Flat->_size() == 0) - return; - - for(Iterator begin = _Flat->First; begin != _Flat->Last; ++begin) - (*begin->*MethodPtr)(_1, _2, _3, _4, _5); - -} - -///////////////////////////////////////////////////////////// - -template < typename Type, typename AllocatorType> -template <typename _A, typename _B, typename _C, typename _D, typename _E, typename _F> -void SharedList<Type, AllocatorType>::Each(void (Type::*MethodPtr)(_A, _B, _C, _D), _A _1, _B _2, _C _3, _D _4, _E _5, _F _6) -{ - - if (_Flat->_size() == 0) - return; - - for(Iterator begin = _Flat->First; begin != _Flat->Last; ++begin) - (*begin->*MethodPtr)(_1, _2, _3, _4, _5, _6); - -} - -///////////////////////////////////////////////////////////// - -template < typename Type, typename AllocatorType> -template <typename _A, typename _B, typename _C, typename _D, typename _E, typename _F, typename _G> -void SharedList<Type, AllocatorType>::Each(void (Type::*MethodPtr)(_A, _B, _C, _D), _A _1, _B _2, _C _3, _D _4, _E _5, _F _6, _G _7) -{ - - if (_Flat->_size() == 0) - return; - - for(Iterator begin = _Flat->First; begin != _Flat->Last; ++begin) - (*begin->*MethodPtr)(_1, _2, _3, _4, _5, _6, _7); - -} - -///////////////////////////////////////////////////////////// - -template < typename Type, typename AllocatorType> -template <typename _A, typename _B, typename _C, typename _D, typename _E, typename _F, typename _G, typename _H> -void SharedList<Type, AllocatorType>::Each(void (Type::*MethodPtr)(_A, _B, _C, _D), _A _1, _B _2, _C _3, _D _4, _E _5, _F _6, _G _7, _H _8) -{ - - if (_Flat->_size() == 0) - return; - - for(Iterator begin = _Flat->First; begin != _Flat->Last; ++begin) - (*begin->*MethodPtr)(_1, _2, _3, _4, _5, _6, _7, _8); - -} - -///////////////////////////////////////////////////////////// - -template < class Type, class AllocatorType > -unsigned int SharedList<Type, AllocatorType>::getUsageCount() const -{ - return *_Usage; -} - -///////////////////////////////////////////////////////////// - -template < class Type, class AllocatorType > -Flat<Type*, AllocatorType>* SharedList<Type, AllocatorType>::getFlat() const { - return _Flat; -} - -///////////////////////////////////////////////////////////// - -#undef SharedListType -#undef TypePtr - -///////////////////////////////////////////////////////////// - -BETAJAEN_CC_NAMESPACE_END - - -#endif \ No newline at end of file Deleted: trunk/python-ogre/ThirdParty/nxogre/BetajaenCC.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/BetajaenCC.h 2008-11-14 07:08:16 UTC (rev 790) +++ trunk/python-ogre/ThirdParty/nxogre/BetajaenCC.h 2008-11-14 07:14:30 UTC (rev 791) @@ -1,3090 +0,0 @@ -/* - -Betajaen's Container Classes - -Copyright (c) 2007 Robin Southern, http://www.nxogre.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -*/ - -#ifndef BETAJAENS_CC_H -#define BETAJAENS_CC_H - -#include "NxOgrePlatform.h" -#include "NxOgreAllocator.h" - -// Configuration - -/** \brief Namespace to place the Containers in. Comment out if you want it in the global namespace. -*/ -#define BETAJAEN_CC_NAMESPACE Betajaen - - -/** \brief Enable debug comments. Set to zero to disable, 1 to enable -*/ -#define BETAJAEN_CC_DEBUG_COMMENTS 1 - - -/** \brief Export Class Macro, replace value with your export macro -*/ -#define BETAJAEN_CC_CLASS_EXPORT __declspec(dllexport) -#define BETAJAEN_CC_TEMPLATE_CLASS_EXPORT __forceinline -// #define BETAJAEN_CC_FUNCTION_EXPORT NxPublicFunction - - -/** \brief Delete macro. Used if you have your own leak checker, etc. -*/ -// #define BETAJAEN_CC_DELETE(ptr) \ -// {::NxOgre::Allocator::getPtr()->watch_delete(static_cast<void*>(ptr));}; \ -// delete ptr; - -// /** \brief Called just before when a class is destroyed using it's destructor. -// */ -// #define BETAJAEN_CC_DESTRUCTOR(ptr) \ -// ::NxOgre::Allocator::getPtr()->watch_delete(begin); - -////////////////////////////////////////////////////////////////////////// - -#if (BETAJAEN_CC_DEBUG_COMMENTS == 1) -# include <stdio.h> -#endif - -#ifdef BETAJAEN_CC_NAMESPACE -# define BETAJAEN_CC_NAMESPACE_START namespace BETAJAEN_CC_NAMESPACE { -# define BETAJAEN_CC_NAMESPACE_END } -#else -# define BETAJAEN_CC_NAMESPACE_START /**/ -# define BETAJAEN_CC_NAMESPACE_END /**/ -#endif - -BETAJAEN_CC_NAMESPACE_START - -#if (BETAJAEN_CC_DEBUG_COMMENTS == 1) -# define BETAJAEN_CC_PRINT(x) printf(x "\n"); -# define BETAJAEN_CC_PRINTF(x, y) printf(x "\n",y); -#else -# define BETAJAEN_CC_PRINT(x) /* x */ -# define BETAJAEN_CC_PRINTF(x,y) /* x, y*/ -#endif - -#if (_MSC_VER>=1000) -# define BETAJAEN_CC_INLINE __forceinline -#else -# define BETAJAEN_CC_INLINE inline -#endif - -#ifndef BETAJAEN_CC_CLASS_EXPORT -# define BETAJAEN_CC_CLASS_EXPORT -#endif - -#ifndef BETAJAEN_CC_TEMPLATE_CLASS_EXPORT -# define BETAJAEN_CC_TEMPLATE_CLASS_EXPORT -#endif - -#ifndef BETAJAEN_CC_FUNCTION_EXPORT -# define BETAJAEN_CC_FUNCTION_EXPORT -#endif - -#ifndef BETAJAEN_CC_DELETE -# define BETAJAEN_CC_DELETE(ptr) delete ptr; -#endif - -#ifndef BETAJAEN_CC_DESTRUCTOR -# define BETAJAEN_CC_DESTRUCTOR(ptr) -#endif - -BETAJAEN_CC_NAMESPACE_END - -////////////////////////////////////////////////////////////////////////// - -BETAJAEN_CC_NAMESPACE_START - -class SharedAllocator; -template <class TypePtr, class AllocatorType = SharedAllocator> class Flat; - -template <class BaseType, class AllocatorType = SharedAllocator> class Array; -template <class BaseType, class AllocatorType = SharedAllocator> class SharedList; -template <typename IdentifierType, class BaseType, class AllocatorType = SharedAllocator> class SharedMap; -template <typename IdentifierType, class TypePtr> class Tree; -template <typename> class Vector2; -template <typename> class Vector3; -template <typename> class Vector4; - -BETAJAEN_CC_NAMESPACE_END - -////////////////////////////////////////////////////////////////////////// - -BETAJAEN_CC_NAMESPACE_START - -class BETAJAEN_CC_CLASS_EXPORT SharedAllocator { - -public: - -///////////////////////////////////////////////////////////// - -void* Allocate(size_t size) -{ - return malloc(size); -} - -///////////////////////////////////////////////////////////// - -void Deallocate(void* mem) -{ - if (mem) - free(mem); -} - -///////////////////////////////////////////////////////////// - -void* Reallocate(void* mem, size_t size) -{ - return realloc(mem, size); -} - -///////////////////////////////////////////////////////////// - -}; // End of the SharedAllocator class. - -BETAJAEN_CC_NAMESPACE_END - -////////////////////////////////////////////////////////////////////////// - -BETAJAEN_CC_NAMESPACE_START - -template - < - class Type, - class AllocatorType - > -class BETAJAEN_CC_CLASS_EXPORT Flat -{ - -public: - -typedef Type * Iterator; -typedef AllocatorType* AllocatorPtr; - -///////////////////////////////////////////////////////////// - -BETAJAEN_CC_INLINE Flat(AllocatorPtr allocator, bool deleteAllocator) - : First(NULL), Last(NULL), End(NULL), Allocator(allocator), AutoDeleteAllocator(deleteAllocator) -{ -} - -///////////////////////////////////////////////////////////// - -BETAJAEN_CC_INLINE ~Flat() -{ - _deallocate(First); - if (AutoDeleteAllocator) - delete Allocator; -} - -///////////////////////////////////////////////////////////// - -BETAJAEN_CC_INLINE unsigned int _size() const -{ - return (unsigned int) (Last - First); -} - -///////////////////////////////////////////////////////////// - -BETAJAEN_CC_INLINE unsigned int _capacity() const -{ - return (unsigned int) (First == 0 ? 0 : End - First); -} - -///////////////////////////////////////////////////////////// - -BETAJAEN_CC_INLINE Type* _allocate(unsigned int size) -{ - return (Type*) Allocator->Allocate(size * sizeof(Type)); -} - -///////////////////////////////////////////////////////////// - -BETAJAEN_CC_INLINE void _deallocate(Type* p) -{ - if (p) - Allocator->Deallocate(p); -} - -///////////////////////////////////////////////////////////// - -BETAJAEN_CC_INLINE Iterator _reallocate(Iterator p, unsigned int size) -{ - return (Iterator) Allocator->Reallocate(p, size * sizeof(Type)); -} - -///////////////////////////////////////////////////////////// - -BETAJAEN_CC_INLINE void _clip(unsigned int size) -{ - - if (size < _size()) - return; - - Iterator new_first = _allocate(size); - _copy(First, Last, new_first); - _destroy(First, Last); - _deallocate(First); - End = new_first + size; - Last = new_first + _size(); - First = new_first; - -} - -///////////////////////////////////////////////////////////// - -BETAJAEN_CC_INLINE void _reserve(unsigned int new_size) -{ - if (_capacity() >= new_size) - return; - - Iterator new_first = _allocate(new_size); - _copy(First, Last, new_first); - _destroy(First, Last); - _deallocate(First); - End = new_first + new_size; - Last = new_first + _size(); - First = new_first; - -} - -///////////////////////////////////////////////////////////// - -BETAJAEN_CC_INLINE Iterator _copy(Iterator begin, Iterator end, Iterator dest) -{ - for (;begin != end; ++dest, ++begin) - *dest = *begin; - return dest; -} - -///////////////////////////////////////////////////////////// - -BETAJAEN_CC_INLINE void _delete_range(Iterator begin, Iterator end) -{ - for (; begin != end; ++begin) { - BETAJAEN_CC_DELETE(*begin); - } -} - -///////////////////////////////////////////////////////////// - -BETAJAEN_CC_INLINE void _destroy(Iterator begin, Iterator end) -{ - for (; begin != end; ++begin) { - BETAJAEN_CC_DESTRUCTOR(begin) - begin->~Type(); - } -} - -///////////////////////////////////////////////////////////// - -protected: AllocatorPtr Allocator; -protected: bool AutoDeleteAllocator; -public: Iterator First, Last, End; - -}; // End of Flat<Type,AllocatorType> class. - -BETAJAEN_CC_NAMESPACE_END - -////////////////////////////////////////////////////////////////////////// - -BETAJAEN_CC_NAMESPACE_START - -template - < - class Type, /* Class to Store; A, myClassName, etc. */ - class AllocatorType /* Allocator to use, or leave blank for SharedAllocator */ - > -class BETAJAEN_CC_CLASS_EXPORT Array { - -public: - -typedef Type* TypePtr; -typedef Array<Type, AllocatorType> ArrayType; -typedef Flat<Type, AllocatorType> FlatType; -typedef FlatType* FlatPtr; - -BETAJAEN_CC_INLINE Array(AllocatorType* _allocator = NULL, bool _auto_delete_allocator = true) -{ - if (_allocator == NULL) - _allocator = new AllocatorType(); - - _Flat = new FlatType(_allocator, _auto_delete_allocator); - -} - -BETAJAEN_CC_INLINE ~Array() -{ - delete _Flat; -} - -BETAJAEN_CC_INLINE TypePtr getPtr() -{ - return _Flat->First; -} - -BETAJAEN_CC_INLINE unsigned int Size() -{ - return _Flat->_size(); -} - -BETAJAEN_CC_INLINE void Append(Type v) { - - if (_Flat->End <= _Flat->Last) - _Flat->_reserve( (1 + _Flat->_size()) * 2); - - *_Flat->Last = v; - _Flat->Last++; - -} - -BETAJAEN_CC_INLINE void Clip() { - _Flat->_clip(0); -} - -private: FlatPtr _Flat; - -}; - -BETAJAEN_CC_NAMESPACE_END - -////////////////////////////////////////////////////////////////////////// - -BETAJAEN_CC_NAMESPACE_START - -/** \brief A list of pointers with garbage collections and the ability to - share the same list with similar lists. Like STL's Vector. - - \example - <code> - class A; - - SharedList<A> aList; - a.Insert(new A()); - a.Remove(a.Last); - </code> - -*/ -template - < - class Type, /* Class to Store; A, myClassName, etc. */ - class AllocatorType /* Allocator to use, or leave blank for SharedAllocator */ - > -class BETAJAEN_CC_CLASS_EXPORT SharedList { - -public: - -typedef Type* TypePtr; -typedef TypePtr* Iterator; -typedef SharedList<Type, AllocatorType> SharedListType; -typedef Flat<TypePtr, AllocatorType> FlatType; -typedef FlatType* FlatPtr; - -///////////////////////////////////////////////////////////// - -enum AbsolutePosition -{ - First, - Last -}; - -/** - Constructor with optional custom allocator -*/ -BETAJAEN_CC_INLINE SharedList(AllocatorType* _allocator = NULL, bool _auto_delete_allocator = true) -{ - if (_allocator == NULL) - _allocator = new AllocatorType(); - - _Flat = new FlatType(_allocator, _auto_delete_allocator); - _Usage = new unsigned int(1); - -} - -/** \brief Copy Constructor between SharedList's. The Flat will not be copied but referenced. - Any action on this list will effect all lists using the same Flat. Clean up will only - happen on the destruction of the last surviving list. - - \example - <code> - typedef SharedList<A> AList; - AList a; - AList b(a); - </code> -*/ -BETAJAEN_CC_INLINE SharedList(const SharedListType& other) -{ - - _Flat = other._Flat; - _Usage = other._Usage; - ++(*_Usage); - -} - - -/** \brief Copy Operator. Functions the same as Copy Constructor but deletes the set that this - may already have. - - \example - <code> - typedef SharedList<A> AList; - AList a; - AList b; - b = a; - </code> -*/ -BETAJAEN_CC_INLINE SharedListType& operator=(const SharedListType& other) -{ - - if (_Flat) - { - _Flat->_delete_range(_Flat->First, _Flat->Last); - delete _Flat; - } - - if (_Usage) - delete _Usage; - - _Flat = other._Flat; - _Usage = other._Usage; - ++(*_Usage); - - return *this; - -} - - -/** \brief Destructor. If this is the last of all SharedLists sharing the same set, - the set will be destroyed otherwise the Flat will be ignored and this SharedList - dies gracefully. -*/ -BETAJAEN_CC_INLINE ~SharedList() -{ - - if (--(*_Usage) == 0) - { - _Flat->_delete_range(_Flat->First, _Flat->Last); - delete _Flat; - delete _Usage; - } - -} - - -/** \brief Gets the pointer to the nth Type in the list. Alternate interface to operator[]. -*/ -BETAJAEN_CC_INLINE TypePtr Get(size_t pos) -{ - if (pos > Size()) - return NULL; - - return *(_Flat->First + pos); -} - - -/** \brief Gets the pointer to the nth TypePtr in the list. -*/ -BETAJAEN_CC_INLINE TypePtr operator[](size_t pos) -{ - if (pos > Size()) - return NULL; - - return *(_Flat->First + pos); -} - - -/** \brief Where is something in the list. -*/ -BETAJAEN_CC_INLINE unsigned int WhereIs(TypePtr ptr) -{ - - if (_Flat->_size() == 0) - return 0; - - unsigned int i=0; - for(Iterator begin = _Flat->First; begin != _Flat->Last; ++begin, ++i) - { - if (ptr == (*begin)) - return i; - } - - return 0; -} - -BETAJAEN_CC_INLINE bool Has(TypePtr ptr) -{ - - if (_Flat->_size() == 0) - return false; - - for(Iterator begin = _Flat->First; begin != _Flat->Last; ++begin) - { - if (ptr == (*begin)) - return true; - } - - return false; - -} - -/** \brief The size of the SharedList. -*/ -BETAJAEN_CC_INLINE unsigned Size() const -{ - return _Flat->_size(); -} - - -/** \brief Insert something into the list -*/ -BETAJAEN_CC_INLINE void Insert(const TypePtr& val) -{ - - if (_Flat->End <= _Flat->Last) - _Flat->_reserve( (1 + Size()) * 2); - - *_Flat->Last = val; - _Flat->Last++; - -} - - -/** \brief Resize the capacity of the list to size + n. -*/ -BETAJAEN_CC_INLINE void Clean(unsigned int n = 4) -{ - _Flat->_clip(_Flat->_size() + n); -} - - -/** \brief Destroy something nth position into the list. -*/ -BETAJAEN_CC_INLINE void Destroy(unsigned int n) -{ - if (n == 0) - return Destroy(First); - - if (n == Size()) - return Destroy(Last); - - delete *(_Flat->First + n); - - _Flat->_destroy(_Flat->First + n, _Flat->First + n + 1); - _Flat->_copy(_Flat->First + n + 1, _Flat->Last, _Flat->First + n); - _Flat->Last--; - -} - -// \brief Destroys everything -// -BETAJAEN_CC_INLINE void DestroyAll() -{ - if (Size() == 0) - return; - - _Flat->_delete_range(_Flat->First, _Flat->Last); - // Could be iffy. - _Flat->Last = _Flat->First; - -} - -/** \brief Destroys something in the list based on the pointer in the list. -*/ -BETAJAEN_CC_INLINE void Destroy(TypePtr val) { - unsigned int i = WhereIs(val); - Destroy(i); -} - -/** \brief Deletes something from the list based on AbsolutePosition -*/ -BETAJAEN_CC_INLINE void Destroy(AbsolutePosition position) -{ - - switch(position) { - - case First: - { - delete *_Flat->First; - _Flat->_copy(_Flat->First + 1, _Flat->Last + 1, _Flat->First); - _Flat->Last--; - } - break; - - case Last: - { - _Flat->Last--; - delete *_Flat->Last; - } - break; - - } - -} - - -/** \brief Removes something from the list based on numerical position. -*/ -BETAJAEN_CC_INLINE TypePtr Remove(unsigned int n) -{ - - if (n == 0) - return Remove(First); - - if (n == Size()) - return Remove(Last); - - TypePtr ptr = Get(n); - _Flat->_destroy(_Flat->First + n, _Flat->First + n + 1); - _Flat->_copy(_Flat->First + n + 1, _Flat->Last, _Flat->First + n); - _Flat->Last--; - - return ptr; -} - - -/** \brief Removes something from the list based on AbsolutePosition -*/ -BETAJAEN_CC_INLINE TypePtr Remove(AbsolutePosition position) -{ - - if (_Flat->_size() == 0) - return NULL; - - switch(position) { - - case First: - { - TypePtr t = *(_Flat->First); - _Flat->_copy(_Flat->First + 1, _Flat->Last + 1, _Flat->First); - _Flat->Last--; - return t; - } - - break; - - case Last: - { - _Flat->Last--; - return *(_Flat->Last); - } - break; - } - - return NULL; - -} - -// \brief Destroys everything -// -BETAJAEN_CC_INLINE void RemoveAll() -{ - if (Size() == 0) - return; - - _Flat->_deallocate(_Flat->First); - - // Could be iffy. - _Flat->Last = _Flat->First; - -} - - -/** \brief Places the Iterator at the beginning of the List -*/ -BETAJAEN_CC_INLINE TypePtr Begin() -{ - - if (_Flat->_size() == 0) - return NULL; - - _Iterator = _Flat->First; - return *_Iterator; - -} - - -/** \brief Advances the Iterator forward by one, and returns the value of the list or NULL - \returns The next item in the list, or NULL if it has reached the end of it. -*/ -BETAJAEN_CC_INLINE TypePtr Next() -{ - - if (_Flat->_size() == 0) - return NULL; - else if (_Iterator == _Flat->Last) - return NULL; - else - return (*_Iterator++); - -} - - -/** \brief Places the iterator at the end of the List -*/ -BETAJAEN_CC_INLINE TypePtr End() -{ - - if (_Flat->_size() == 0) - return NULL; - - _Iterator = _Flat->Last - 1; - return *_Iterator; - -} - - -/** \brief Advances the Iterator backwards by one, and returns the value of the list or NULL - \returns The previous item in the list, or NULL if it has reached the beginning of it. -*/ -BETAJAEN_CC_INLINE TypePtr Previous() -{ - - if (_Flat->_size() == 0) - return NULL; - else if (_Iterator == _Flat->First - 1) - return NULL; - else - return (*_Iterator--); - -} - -/** \brief For each item in the list call it's own method. -*/ -BETAJAEN_CC_INLINE void Each(void (Type::*MethodPtr)()) { - - if (_Flat->_size() == 0) - return; - - for(Iterator begin = _Flat->First; begin != _Flat->Last; ++begin) { - (*begin->*MethodPtr)(); - } - -} - - -/** \brief For each item in the list call it's own method, with one argument. -*/ -template <typename _A> -BETAJAEN_CC_INLINE void Each(void (Type::*MethodPtr)(_A), _A _1) { - - if (_Flat->_size() == 0) - return; - - for(Iterator begin = _Flat->First; begin != _Flat->Last; ++begin) { - (*begin->*MethodPtr)(_1); - } - -} - - -/** \brief For each item in the list call it's own method, with two arguments. -*/ -template <typename _A, typename _B> -BETAJAEN_CC_INLINE void Each(void (Type::*MethodPtr)(_A, _B), _A _1, _B _2) { - - if (_Flat->_size() == 0) - return; - - for(Iterator begin = _Flat->First; begin != _Flat->Last; ++begin) - (*begin->*MethodPtr)(_1, _2); - -} - - -/** \brief For each item in the list call it's own method, with three arguments. -*/ -template <typename _A, typename _B, typename _C> -BETAJAEN_CC_INLINE void Each(void (Type::*MethodPtr)(_A, _B, _C), _A _1, _B _2, _C _3) { - - if (_Flat->_size() == 0) - return; - - for(Iterator begin = _Flat->First; begin != _Flat->Last; ++begin) - (*begin->*MethodPtr)(_1, _2, _3); - -} - - -/** \brief For each item in the list call it's own method, with four arguments. -*/ -template <typename _A, typename _B, typename _C, typename _D> -BETAJAEN_CC_INLINE void Each(void (Type::*MethodPtr)(_A, _B, _C, _D), _A _1, _B _2, _C _3, _D _4) { - - if (_Flat->_size() == 0) - return; - - for(Iterator begin = _Flat->First; begin != _Flat->Last; ++begin) - (*begin->*MethodPtr)(_1, _2, _3, _4); - -} - - -/** \brief For each item in the list call it's own method, with five arguments. -*/ -template <typename _A, typename _B, typename _C, typename _D, typename _E> -BETAJAEN_CC_INLINE void Each(void (Type::*MethodPtr)(_A, _B, _C, _D), _A _1, _B _2, _C _3, _D _4, _E _5) { - - if (_Flat->_size() == 0) - return; - - for(Iterator begin = _Flat->First; begin != _Flat->Last; ++begin) - (*begin->*MethodPtr)(_1, _2, _3, _4, _5); - -} - - -/** \brief For each item in the list call it's own method, with six arguments. -*/ -template <typename _A, typename _B, typename _C, typename _D, typename _E, typename _F> -BETAJAEN_CC_INLINE void Each(void (Type::*MethodPtr)(_A, _B, _C, _D), _A _1, _B _2, _C _3, _D _4, _E _5, _F _6) { - - if (_Flat->_size() == 0) - return; - - for(Iterator begin = _Flat->First; begin != _Flat->Last; ++begin) - (*begin->*MethodPtr)(_1, _2, _3, _4, _5, _6); - -} - - -/** \brief For each item in the list call it's own method, with seven arguments. -*/ -template <typename _A, typename _B, typename _C, typename _D, typename _E, typename _F, typename _G> -BETAJAEN_CC_INLINE void Each(void (Type::*MethodPtr)(_A, _B, _C, _D), _A _1, _B _2, _C _3, _D _4, _E _5, _F _6, _G _7) { - - if (_Flat->_size() == 0) - return; - - for(Iterator begin = _Flat->First; begin != _Flat->Last; ++begin) - (*begin->*MethodPtr)(_1, _2, _3, _4, _5, _6, _7); - -} - - -/** \brief For each item in the list call it's own method, with eight arguments. -*/ -template <typename _A, typename _B, typename _C, typename _D, typename _E, typename _F, typename _G, typename _H> -BETAJAEN_CC_INLINE void Each(void (Type::*MethodPtr)(_A, _B, _C, _D), _A _1, _B _2, _C _3, _D _4, _E _5, _F _6, _G _7, _H _8) { - - if (_Flat->_size() == 0) - return; - - for(Iterator begin = _Flat->First; begin != _Flat->Last; ++begin) - (*begin->*MethodPtr)(_1, _2, _3, _4, _5, _6, _7, _8); - -} - -/** \brief Returns the pointer to the working set. -*/ -BETAJAEN_CC_INLINE FlatPtr getFlat() const { - return _Flat; -} - - -/** \brief Returns the number of SharedLists using this set. -*/ -BETAJAEN_CC_INLINE unsigned int getUsageCount() const { - return *_Usage; -} - - -private: unsigned int* _Usage; -private: FlatPtr _Flat; -private: Iterator _Iterator; - -}; // End of SharedList<Type, AllocatorType> Class. - -BETAJAEN_CC_NAMESPACE_END - -////////////////////////////////////////////////////////////////////////// - -BETAJAEN_CC_NAMESPACE_START - - -/** \brief Binary Tree with variable identifer and storage type. - -*/ -template <typename NodeIdentifier, class Type> -class BETAJAEN_CC_CLASS_EXPORT Tree -{ - // Much of this Tree was from the excellent tutorial by Julienne Walker - // http://eternallyconfuzzled.com/tuts/datastructures/jsw_tut_bst1.aspx - -public: - -class Node; -typedef Node* NodePtr; -typedef Type* TypePtr; - -/** \brief A tree is made up of nodes. -*/ -class BETAJAEN_CC_CLASS_EXPORT Node -{ - -public: - -Node(NodeIdentifier id, TypePtr val) : _ID(id), _Val(val) -{ - _Children[0] = NULL; - _Children[1] = NULL; -} - -void Replace(Node* n) -{ - _ID = n->_ID; - _Val = n->_Val; -} - -NodeIdentifier _ID; -TypePtr _Val; -NodePtr _Children[2]; - -}; - -class BETAJAEN_CC_CLASS_EXPORT NodeIterator -{ -public: - NodePtr _Up[50]; - NodePtr _It; - int _Top; -}; - -/** \brief Tree constructor -*/ -public: BETAJAEN_CC_INLINE Tree() : _Root(NULL) -{ -} - - -/** \brief Tree destructor. - \note Does not remove or destroy the contents of the tree. -*/ -public: BETAJAEN_CC_INLINE ~Tree() -{ -} - -public: BETAJAEN_CC_INLINE bool isEmpty() const { - return (_Root == 0); -} - -/** \brief Destroys all the nodes in the tree and deletes all of the values referenced in it. -*/ -public: BETAJAEN_CC_INLINE void DestroyAll() -{ - if (_Root == NULL) - return; - - NodePtr iterator = _Root; - NodePtr save = 0; - - while (iterator != NULL) - { - if (iterator->_Children[0] != NULL) - { - save = iterator->_Children[0]; - iterator->_Children[0] = save->_Children[1]; - save->_Children[1] = iterator; - } - else - { - save = iterator->_Children[1]; - delete iterator->_Val; - delete iterator; - } - - iterator = save; - } - - _Root = NULL; -} - - -/** \brief Destroys all the nodes in the tree, but not all of the values referenced in it. -*/ -public: BETAJAEN_CC_INLINE void RemoveAll() -{ - - if (_Root == NULL) - return; - - NodePtr iterator = _Root; - NodePtr save = 0; - - while (iterator != NULL) - { - if (iterator->_Children[0] != NULL) - { - save = iterator->_Children[0]; - iterator->_Children[0] = save->_Children[1]; - save->_Children[1] = iterator; - } - else - { - save = iterator->_Children[1]; - delete iterator; - iterator = NULL; - } - - iterator = save; - } - - _Root = NULL; - -} - - -/** \brief Remove a Node based of an identifier -*/ -public: BETAJAEN_CC_INLINE void Remove(NodeIdentifier id) -{ - - if (_Root == NULL) - return; - - Node head = {0}; - NodePtr iterator = &head; - NodePtr *f = 0, *p = 0; - int direction = 1; - - iterator->_Children[1] = _Root; - - //while (iterator = - -} - - - -/** \brief Removes a ranges of nodes based on max. and min. identifiers. - \note This operates based on the "operator <" of the TypeIdentifier the class, - which defines if the type is in the range or not. Types such as ints, or reals - aren't a problem but things like strings or complicated classes may produce - strange results. -*/ -public: BETAJAEN_CC_INLINE void RemoveRange(NodeIdentifier id_min, NodeIdentifier id_max) -{ - - -} - - -/** -*/ -public: BETAJAEN_CC_INLINE void Destroy(NodeIdentifier id) -{ - -} - - -/** -*/ -public: BETAJAEN_CC_INLINE void DestroyRange(NodeIdentifier id_min, NodeIdentifier id_max) -{ - -} - - -/** -*/ -public: BETAJAEN_CC_INLINE TypePtr Find(NodeIdentifier target) -{ - NodePtr iterator = _Root; - while (iterator != NULL) - { - if (iterator->_ID == target) - { - return iterator->_Val; - } - else - { - iterator = iterator->_Children[int(iterator->_ID < target)]; - } - } - - return 0; -} - -/** -*/ -public: BETAJAEN_CC_INLINE TypePtr First(NodeIterator* it) -{ - - it->_It = _Root; - it->_Top = 0; - - if (it->_It != 0) { - while (it->_It->_Children[0] != 0) { - it->_Up[it->_Top++] = it->_It; - it->_It = it->_It->_Children[0]; - } - } - - if (it->_It != 0) - return it->_It->_Val; - else - return 0; - -} - -/** -*/ -public: BETAJAEN_CC_INLINE TypePtr Next(NodeIterator* it) -{ - if (it->_It->_Children[1] != 0) { - it->_Up[it->_Top++] = it->_It; - it->_It = it->_It->_Children[1]; - - while (it->_It->_Children[0] != 0) { - it->_Up[it->_Top++] = it->_It; - it->_It = it->_It->_Children[0]; - } - - } - else { - NodePtr last; - - do { - - if (it->_Top == 0) { - it->_It = 0; - break; - } - - last = it->_It; - it->_It = it->_Up[--it->_Top]; - - } while (last == it->_It->_Children[1]); - - } - - if (it->_It != 0) - return it->_It->_Val; - else - return 0; - -} - -/** -*/ -public: BETAJAEN_CC_INLINE bool Insert(NodeIdentifier target, TypePtr val) -{ - Node* node = new Node(target, val); - - - if (_Root == NULL) - { - _Root = node; - return true; - } - else - { - Node* iterator = _Root; - unsigned int direction; - - for ( ; ; ) - { - direction = iterator->_ID < target; - - if (iterator->_ID == target) - { - delete node; - return false; - } - else if (iterator->_Children[direction] == NULL) - break; - - - iterator = iterator->_Children[direction]; - } - - iterator->_Children[direction] = node; - } - - return true; -} - - -private: NodePtr _Root; - -}; - -BETAJAEN_CC_NAMESPACE_END - -////////////////////////////////////////////////////////////////////////// - -BETAJAEN_CC_NAMESPACE_START - -template < - typename IdentifierType, - class Type, - class AllocatorType - > -class BETAJAEN_CC_CLASS_EXPORT SharedMap -{ - -public: - -typedef Type* TypePtr; -typedef Tree<IdentifierType, Type> TreeType; -typedef TreeType* TreePtr; - - -///////////////////////////////////////////////////////////// - -BETAJAEN_CC_INLINE SharedMap() -{ - _Tree = new TreeType(); -} - -///////////////////////////////////////////////////////////// - -BETAJAEN_CC_INLINE ~SharedMap() -{ - _Tree->DestroyAll(); - delete _Tree; -} - -///////////////////////////////////////////////////////////// - -BETAJAEN_CC_INLINE TypePtr Get(IdentifierType identifier) -{ - return _Tree->Find(identifier); -} - -///////////////////////////////////////////////////////////// - -BETAJAEN_CC_INLINE TypePtr operator[](IdentifierType identifier) -{ - return _Tree->Find(identifier); -} - -///////////////////////////////////////////////////////////// - -BETAJAEN_CC_INLINE void Insert(IdentifierType identifier, TypePtr ptr) -{ - _Tree->Insert(identifier, ptr); -} - -///////////////////////////////////////////////////////////// - -BETAJAEN_CC_INLINE void DestroyAll() -{ - _Tree->DestroyAll(); -} - -///////////////////////////////////////////////////////////// - -BETAJAEN_CC_INLINE void RemoveAll() { - _Tree->RemoveAll(); -} - -///////////////////////////////////////////////////////////// - -BETAJAEN_CC_INLINE void Destroy(IdentifierType); - -///////////////////////////////////////////////////////////// - -BETAJAEN_CC_INLINE void Remove(IdentifierType); - -///////////////////////////////////////////////////////////// - -BETAJAEN_CC_INLINE TypePtr Begin(); - -///////////////////////////////////////////////////////////// - -BETAJAEN_CC_INLINE TypePtr Next(); - -///////////////////////////////////////////////////////////// - -BETAJAEN_CC_INLINE TypePtr End(); - -///////////////////////////////////////////////////////////// - -BETAJAEN_CC_INLINE TypePtr Previous(); - -///////////////////////////////////////////////////////////// - -/** \brief For each item in the list call it's own method. -*/ -BETAJAEN_CC_INLINE void Each(void (Type::*MethodPtr)()) { - - if (_Tree->isEmpty()) - return; - - typename TreeType::NodeIterator iterator; - TypePtr ptr = _Tree->First(&iterator); - - while (ptr != 0) { - (ptr->*MethodPtr)(); - ptr = _Tree->Next(&iterator); - } -} - - -/** \brief For each item in the list call it's own method, with one argument. -*/ -template <typename _A> -BETAJAEN_CC_INLINE void Each(void (Type::*MethodPtr)(_A), _A _1) { - - if (_Tree->isEmpty()) - return; - - typename TreeType::NodeIterator iterator; - TypePtr ptr = _Tree->First(&iterator); - - while (ptr != 0) { - (ptr->*MethodPtr)(_1); - ptr = _Tree->Next(&iterator); - } -} -///////////////////////////////////////////////////////////// - -BETAJAEN_CC_INLINE TreePtr getTree() const -{ - return _Tree; -} - -///////////////////////////////////////////////////////////// - -BETAJAEN_CC_INLINE unsigned int getUsage() const -{ - return *_Usage; -} - -///////////////////////////////////////////////////////////// - -private: TreePtr _Tree; -private: unsigned int* _Usage; - -///////////////////////////////////////////////////////////// - -}; - -BETAJAEN_CC_NAMESPACE_END - -////////////////////////////////////////////////////////////////////////// - -BETAJAEN_CC_NAMESPACE_START - -/** \brief Vector with two rows. -*/ -template < - typename Type - > -class BETAJAEN_CC_CLASS_EXPORT Vector2 -{ - -public: - -typedef Vector2<Type> ThisType; - -/* \brief First */ -Type i; - -/* \brief Second */ -Type j; - -BETAJAEN_CC_INLINE Vector2() -{ -} - -BETAJAEN_CC_INLINE Vector2(Type _i, Type _j) -: i(_i), j(_j) -{ -} - -BETAJAEN_CC_INLINE void swap(ThisType& other) -{ - Type First = i, Second = j; - i = other.i; other.i = First; - j = other.j; other.j = Second; -} - -BETAJAEN_CC_INLINE ThisType& operator = (const ThisType& other) -{ - i = other.i; j = other.j; - return *this; -} - -BETAJAEN_CC_INLINE ThisType& operator = (const Type& other) -{ - i = other; j = other; - return *this; -} - -BETAJAEN_CC_INLINE ThisType& operator *= (const Type& other) -{ - i *= other; j *= other; -} - -BETAJAEN_CC_INLINE ThisType& operator *= (const ThisType& other) -{ - i *= other.i; j *= other.j; -} - -BETAJAEN_CC_INLINE bool operator == (const ThisType& other) const -{ - return (i == other.i && j == other.j); -} - -BETAJAEN_CC_INLINE bool operator != (const ThisType& other) const -{ - return (i != other.i || j != other.j); -} - -}; - -BETAJAEN_CC_NAMESPACE_END - -////////////////////////////////////////////////////////////////////////// - -BETAJAEN_CC_NAMESPACE_START - -/** \brief Vector with three rows. -*/ -template < - typename Type - > -class BETAJAEN_CC_CLASS_EXPORT Vector3 -{ - -public: - -typedef Vector3<Type> ThisType; - -/* \... [truncated message content] |
From: <and...@us...> - 2008-11-16 22:49:28
|
Revision: 794 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=794&view=rev Author: andy_miller Date: 2008-11-16 22:49:25 +0000 (Sun, 16 Nov 2008) Log Message: ----------- Linux build updates Modified Paths: -------------- trunk/python-ogre/code_generators/ogre/generate_code.py trunk/python-ogre/environment.py Modified: trunk/python-ogre/code_generators/ogre/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/ogre/generate_code.py 2008-11-15 01:16:12 UTC (rev 793) +++ trunk/python-ogre/code_generators/ogre/generate_code.py 2008-11-16 22:49:25 UTC (rev 794) @@ -831,7 +831,13 @@ ## handle a problem hashmap mb.member_function('::Ogre::Mesh::getSubMeshNameMap').exclude() stdex_ns = mb.global_ns.namespace("__gnu_cxx") - stdex_ns.class_('hash_map<std::string, unsigned short, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<unsigned short> >').exclude + stdex_ns.class_('hash_map<std::string, unsigned short, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<unsigned short> >').exclude + for f in mb.member_functions(): + if f.name == 'getChildIterator': + print "LINUX SPECIAL:", f + ###f.exclude() + #mb.member_function('::Ogre::Node::getChildIterator').exclude() + # mb.member_functions('::Ogre::Bone::getChildIterator').exclude() def Fix_NT ( mb ): @@ -1075,7 +1081,9 @@ undefine_symbols=[] if environment._USE_THREADS: defined_symbols.append('BOOST_HAS_THREADS') - defined_symbols.append('BOOST_HAS_WINTHREADS') + if environment.isWindows(): + defined_symbols.append('BOOST_HAS_WINTHREADS') + defined_symbols.append( 'OGRE_VERSION_' + environment.ogre.version ) print os.getcwd() Modified: trunk/python-ogre/environment.py =================================================================== --- trunk/python-ogre/environment.py 2008-11-15 01:16:12 UTC (rev 793) +++ trunk/python-ogre/environment.py 2008-11-16 22:49:25 UTC (rev 794) @@ -18,10 +18,6 @@ _LOGGING_ON = False _PreCompiled = True -## -## set this to True if you compiled Ogre with Threads enabled -## -_USE_THREADS = True def log ( instring ): if _LOGGING_ON: @@ -45,6 +41,14 @@ return True return False +## +## set this to True if you compiled Ogre with Threads enabled +## +if isWindows(): + _USE_THREADS = True +else: + _USE_THREADS = False + PythonOgreMajorVersion = "1" PythonOgreMinorVersion = "6" @@ -202,7 +206,7 @@ else: source_version = "20080901" source = [ - [cvs, " -d :pserver:an...@ww...:/cvsroot/GCC_XML co -D 01Sep2008 "+base, os.getcwd()] + [cvs, " -d :pserver:an...@ww...:/cvsroot/GCC_XML co "+base, os.getcwd()] ] if isLinux() or isMac(): buildCmds = [ @@ -373,7 +377,7 @@ if isLinux() or isMac(): base = 'FreeImage' source = [ - [wget, " http://prdownloads.sourceforge.net/freeimage/FreeImage3110.zip",downloadPath], + [wget, " http://downloads.sourceforge.net/freeimage/FreeImage3110.zip",downloadPath], ] if isLinux(): @@ -498,7 +502,7 @@ [0, sed_ + " 's/BJAM_CONFIG=\"\"/BJAM_CONFIG=release/' "+base+"/configure", '' ], [0, sed_ + " s/'BOOST_PYTHON_MAX_ARITY 15'/'BOOST_PYTHON_MAX_ARITY 19'/ "+base+"/boost/python/detail/preprocessor.hpp", ''], [0, sed_ + ' s/"# include <boost\/preprocessor\/cat.hpp>"/"\\n#define BOOST_PYTHON_NO_PY_SIGNATURES\\n# include <boost\/preprocessor\/cat.hpp>"/ '+base+'/boost/python/detail/preprocessor.hpp', '' ], - [0,"./configure --with-libraries=python --prefix=%s --without-icu --with-bjam=../root/usr/bin/bjam" % PREFIX, os.path.join(os.getcwd(), base )], + [0,"./configure --with-libraries=python,thread,date_time --prefix=%s --without-icu --with-bjam=../root/usr/bin/bjam" % PREFIX, os.path.join(os.getcwd(), base )], [0,'make', os.path.join(os.getcwd(), base )], [0,'make install', os.path.join(os.getcwd(), base )], ] @@ -563,7 +567,7 @@ pythonModule = True name='ogre' ModuleName='OGRE' - CCFLAGS = "" + CCFLAGS = " " cflags='' moduleParentLocation = "renderer" parent = "ogre/renderer" @@ -639,7 +643,8 @@ base = "ogre-v1-6-0" buildCmds = [ [0, tar + " jxf " + os.path.join(downloadPath,base)+".tar.bz2 --overwrite",os.getcwd() ], - [0, "patch -s -N -i ./python-ogre/patch/ogre_1.6.0.patch -p0 ", os.getcwd()], + [0, "patch -s -N -i ./python-ogre/patch/ogre_1.6.0.patch -p0 ", os.getcwd()], + [0, "sed --in-place -s 's|#define OGRE_THREAD_SUPPORT 1|#define OGRE_THREAD_SUPPORT 0|' OgreConfig.h",os.path.join(os.getcwd(),"ogre","OgreMain", "include")], [0, "aclocal", os.path.join(os.getcwd(), 'ogre')], [0, "./bootstrap", os.path.join(os.getcwd(), 'ogre')], [0, "./configure --prefix=%s --with-gui=Xt --disable-devil" % PREFIX, os.path.join(os.getcwd(), 'ogre')], @@ -650,8 +655,8 @@ libs.append ( boost_python_index.lib ) lib_dirs=[Config.LOCAL_LIB] include_dirs=[Config.PATH_Boost, Config.PATH_INCLUDE_Ogre] - CCFLAGS = ' -DBOOST_PYTHON_MAX_ARITY=19' - + CCFLAGS = ' -DBOOST_PYTHON_MAX_ARITY=19 -D__PYTHONOGRE_BUILD_CODE ' + source = [ [wget, "http://downloads.sourceforge.net/ogre/"+base+".tar.bz2",downloadPath], ] @@ -878,8 +883,9 @@ # [0, "patch -s -N -i ../python-ogre/patch/cegui.patch -p0", os.path.join(os.getcwd(),base)], [0, "echo 'EMPTY' >>./INSTALL", os.path.join(os.getcwd(),base)], [0, "echo 'EMPTY' >>./NEWS", os.path.join(os.getcwd(),base)], - [0, "aclocal", os.path.join(os.getcwd(),base)], - [0, "automake" ,os.path.join(os.getcwd(), base )], +# [0, "aclocal", os.path.join(os.getcwd(),base)], +#cl [0, "automake" ,os.path.join(os.getcwd(), base )], + [0, "./bootstrap" ,os.path.join(os.getcwd(), base )], [0,"./configure --prefix=%s --enable-freeimage=yes --with-default-xml-parser=TinyXMLParser --disable-samples --without-ogre-renderer --includedir=%s/include" %(PREFIX,PREFIX) ,os.path.join(os.getcwd(), base )], [0,'make', os.path.join(os.getcwd(), base )], [0,'make install', os.path.join(os.getcwd(), base )] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2008-11-18 07:52:57
|
Revision: 799 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=799&view=rev Author: andy_miller Date: 2008-11-18 07:52:54 +0000 (Tue, 18 Nov 2008) Log Message: ----------- OgreOde and Ode updates for Linux Modified Paths: -------------- trunk/python-ogre/PythonOgreConfig_posix.py trunk/python-ogre/code_generators/ode/generate_code.py trunk/python-ogre/code_generators/ode/return_pointee_value.hpp trunk/python-ogre/code_generators/ogre/return_pointee_value.hpp trunk/python-ogre/environment.py trunk/python-ogre/patch/ogreode.patch Modified: trunk/python-ogre/PythonOgreConfig_posix.py =================================================================== --- trunk/python-ogre/PythonOgreConfig_posix.py 2008-11-17 12:00:04 UTC (rev 798) +++ trunk/python-ogre/PythonOgreConfig_posix.py 2008-11-18 07:52:54 UTC (rev 799) @@ -47,7 +47,7 @@ PATH_OIS = os.path.join(BASE_DIR, 'ogre','Dependencies') PATH_Newton = os.path.join(BASE_DIR, 'newtonSDK','sdk') -PATH_ODE = os.path.join(BASE_DIR, 'ode-0.9') +PATH_ODE = os.path.join(BASE_DIR, 'ode-0.10.1') PATH_OGG = os.path.join(BASE_DIR, 'libogg-1.1.3') PATH_VORBIS= os.path.join(BASE_DIR, 'libvorbis-1.2.0') PATH_OPENAL= os.path.join(BASE_DIR, 'openal-soft-1.5.304') Modified: trunk/python-ogre/code_generators/ode/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/ode/generate_code.py 2008-11-17 12:00:04 UTC (rev 798) +++ trunk/python-ogre/code_generators/ode/generate_code.py 2008-11-18 07:52:54 UTC (rev 799) @@ -335,8 +335,11 @@ return_pointee_value_source_path \ = os.path.join ( os.path.dirname(code_repository.__file__), 'return_pointee_value.hpp') + if not os.path.exists(return_pointee_value_source_path): + return_pointee_value_source_path \ + = os.path.join ( os.getcwd(), + 'return_pointee_value.hpp') - print return_pointee_value_source_path return_pointee_value_target_path \ = os.path.join( environment.ode.generated_dir, 'return_pointee_value.hpp' ) Modified: trunk/python-ogre/code_generators/ode/return_pointee_value.hpp =================================================================== --- trunk/python-ogre/code_generators/ode/return_pointee_value.hpp 2008-11-17 12:00:04 UTC (rev 798) +++ trunk/python-ogre/code_generators/ode/return_pointee_value.hpp 2008-11-18 07:52:54 UTC (rev 799) @@ -1,3 +1,8 @@ +// Copyright 2004-2008 Roman Yakovenko. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + #ifndef RETURN_POINTEE_VALUE_9_11_2006 #define RETURN_POINTEE_VALUE_9_11_2006 @@ -25,7 +30,7 @@ }; template <class R> - struct reference_existing_object_requires_a_pointer_return_type + struct return_pointee_value_requires_a_pointer_return_type # if defined(__GNUC__) && __GNUC__ >= 3 || defined(__EDG__) {} # endif @@ -44,7 +49,7 @@ typedef typename mpl::if_c< ok , to_python_indirect<T, detail::make_value_holder> - , detail::reference_existing_object_requires_a_pointer_return_type<T> + , detail::return_pointee_value_requires_a_pointer_return_type<T> >::type type; }; }; Modified: trunk/python-ogre/code_generators/ogre/return_pointee_value.hpp =================================================================== --- trunk/python-ogre/code_generators/ogre/return_pointee_value.hpp 2008-11-17 12:00:04 UTC (rev 798) +++ trunk/python-ogre/code_generators/ogre/return_pointee_value.hpp 2008-11-18 07:52:54 UTC (rev 799) @@ -1,4 +1,4 @@ -// Copyright 2004 Roman Yakovenko. +// Copyright 2004-2008 Roman Yakovenko. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) Modified: trunk/python-ogre/environment.py =================================================================== --- trunk/python-ogre/environment.py 2008-11-17 12:00:04 UTC (rev 798) +++ trunk/python-ogre/environment.py 2008-11-18 07:52:54 UTC (rev 799) @@ -1047,7 +1047,7 @@ [0, "patch -s -N -i ../../python-ogre/patch/ogreode.patch -p0", baseDir], [0, "chmod +x autogen.sh", baseDir], [0, "./autogen.sh", baseDir], - [0, "./configure --prefix=%s" % PREFIX, baseDir], + [0, "./configure --without-samples --prefix=%s" % PREFIX, baseDir], [0, "make", baseDir], [0, "make install", baseDir], ] Modified: trunk/python-ogre/patch/ogreode.patch =================================================================== --- trunk/python-ogre/patch/ogreode.patch 2008-11-17 12:00:04 UTC (rev 798) +++ trunk/python-ogre/patch/ogreode.patch 2008-11-18 07:52:54 UTC (rev 799) @@ -1,245 +1,95 @@ -Index: include/OgreOdeEntityInformer.h -=================================================================== ---- include/OgreOdeEntityInformer.h (revision 2510) -+++ include/OgreOdeEntityInformer.h (working copy) -@@ -36,12 +36,12 @@ - const TriangleIndex* getIndices(); - unsigned int getIndexCount(); - -+ bool getBoneVertices(unsigned char bone,unsigned int &vertex_count, Ogre::Vector3* &vertices); - protected: - void addVertexData(const Ogre::VertexData *vertex_data, - const Ogre::VertexData *blended_data = 0, - const Ogre::Mesh::IndexMap *indexMap = 0); - void addIndexData(Ogre::IndexData *data, const unsigned int offset = 0); -- bool getBoneVertices(unsigned char bone,unsigned int &vertex_count, Ogre::Vector3* &vertices); - - Ogre::Entity* _entity; - Ogre::SceneNode* _node; -Index: src/OgreOdeTriangleMeshDataManager.cpp -=================================================================== ---- src/OgreOdeTriangleMeshDataManager.cpp (revision 2510) -+++ src/OgreOdeTriangleMeshDataManager.cpp (working copy) -@@ -1,106 +1,106 @@ --#include "OgreOdePrecompiledHeaders.h" -- --#include "OgreOdeTriangleMeshDataManager.h" -- -+#include "OgreOdePrecompiledHeaders.h" - -+#include "OgreOdeTriangleMeshDataManager.h" -+ -+ +Index: include/OgreOdeEntityInformer.h +=================================================================== +--- include/OgreOdeEntityInformer.h (revision 2510) ++++ include/OgreOdeEntityInformer.h (working copy) +@@ -36,12 +36,12 @@ + const TriangleIndex* getIndices(); + unsigned int getIndexCount(); + ++ bool getBoneVertices(unsigned char bone,unsigned int &vertex_count, Ogre::Vector3* &vertices); + protected: + void addVertexData(const Ogre::VertexData *vertex_data, + const Ogre::VertexData *blended_data = 0, + const Ogre::Mesh::IndexMap *indexMap = 0); + void addIndexData(Ogre::IndexData *data, const unsigned int offset = 0); +- bool getBoneVertices(unsigned char bone,unsigned int &vertex_count, Ogre::Vector3* &vertices); + + Ogre::Entity* _entity; + Ogre::SceneNode* _node; +Index: src/OgreOdeGeometry.cpp +=================================================================== +--- src/OgreOdeGeometry.cpp (revision 2510) ++++ src/OgreOdeGeometry.cpp (working copy) +@@ -924,7 +924,7 @@ + + _data = dGeomTriMeshDataCreate(); + +- dGeomTriMeshDataBuildSimple(_data,(const dReal*)_vertices, (int)vertex_count, _indices, (int) index_count); ++ dGeomTriMeshDataBuildSimple(_data,(const dReal*)_vertices, (int)vertex_count, /*(const int *)*/_indices, (int) index_count); + + _geom = dCreateTriMesh(getSpaceID(space),_data,0,0,0); + registerGeometry(); +Index: src/OgreOdeTriangleMeshDataManager.cpp +=================================================================== +--- src/OgreOdeTriangleMeshDataManager.cpp (revision 2510) ++++ src/OgreOdeTriangleMeshDataManager.cpp (working copy) +@@ -6,7 +6,7 @@ using namespace Ogre; --using namespace OgreOde; -- --template<> TriangleMeshDataManager *Ogre::Singleton<TriangleMeshDataManager>::ms_Singleton = 0; -- --namespace OgreOde --{ -- //----------------------------------------------------------------------- -- TriangleMeshDataManager::TriangleMeshDataManager() -- { -- } -- -- //----------------------------------------------------------------------- -- TriangleMeshDataManager::~TriangleMeshDataManager() -- { -- //mTriangleMeshDataMap.clear(); -- } -- -- //----------------------------------------------------------------------- -- TriangleMeshDataManager *TriangleMeshDataManager::getSingletonPtr () -- { -- return ms_Singleton; -- } -- -- //----------------------------------------------------------------------- -- TriangleMeshDataManager &TriangleMeshDataManager::getSingleton () -- { -- assert (ms_Singleton); -- return (*ms_Singleton); -- } -- -- -- //----------------------------------------------------------------------- -- void TriangleMeshDataManager::addTriangleMeshData(const String& name, TriangleMeshDataPtr shape, Vector3 scale) -- { -- -- mTriangleMeshDataMap[name][scale] = shape; -- -- // reduce count so when Ode::Geometry changes its dataPtr or is deleted we arn't -- // left with this one on a referance count of 1 -- unsigned int* count = shape.useCountPointer(); -- (*count)--; -- -- } -- -- -- //----------------------------------------------------------------------- -- void TriangleMeshDataManager::removeTriangleMeshData(const String& name, Vector3 scale) -- { -- -- TriangleMeshDataPtrMap::iterator itr = mTriangleMeshDataMap.find(name); -- if(itr != mTriangleMeshDataMap.end()) -- { -- -- std::map<Ogre::Vector3, OgreOde::TriangleMeshDataPtr,OgreOde::TriangleMeshDataManager::vectorLess>::iterator itr2; -- -- itr2 = itr->second.find(scale); -- -- if ( itr2 != itr->second.end() ) -- { -- //printf ("no TriangleMeshData for scale so erase it\n"); -- itr->second.erase(itr2); -- itr2->second.setNull(); -- } -- -- if (itr->second.size() == 0) -- { -- //printf ("have no TriangleMeshData for this mesh so erase it from map\n"); -- mTriangleMeshDataMap.erase(itr); -- } -- } -- -- } -- -- -- /** looks for mesh name then size or returns a NULL TriangleMeshDataPtr -- */ -- //----------------------------------------------------------------------- -- TriangleMeshDataPtr TriangleMeshDataManager::getTriangleMeshData(const String& name, Vector3 scale) -- { -- -- TriangleMeshDataPtrMap::iterator itr = mTriangleMeshDataMap.find(name); -- if(itr != mTriangleMeshDataMap.end()) -- { -- std::map<Ogre::Vector3, OgreOde::TriangleMeshDataPtr,OgreOde::TriangleMeshDataManager::vectorLess>::iterator itr2; -- -- itr2 = itr->second.find(scale); -- -- if ( itr2 != itr->second.end() ) -- { -- return itr2->second; -- } -- } -- -- //printf ("TriangleMeshDataManager::getTriangleMeshData not found\n"); -- -- return NULL; -- -- } -- --} -+using namespace OgreOde; -+ -+template<> OgreOde::TriangleMeshDataManager * Ogre::Singleton<OgreOde::TriangleMeshDataManager>::ms_Singleton = 0; -+ -+namespace OgreOde -+{ -+ //----------------------------------------------------------------------- -+ TriangleMeshDataManager::TriangleMeshDataManager() -+ { -+ } -+ -+ //----------------------------------------------------------------------- -+ TriangleMeshDataManager::~TriangleMeshDataManager() -+ { -+ //mTriangleMeshDataMap.clear(); -+ } -+ -+ //----------------------------------------------------------------------- -+ TriangleMeshDataManager *TriangleMeshDataManager::getSingletonPtr () -+ { -+ return ms_Singleton; -+ } -+ -+ //----------------------------------------------------------------------- -+ TriangleMeshDataManager &TriangleMeshDataManager::getSingleton () -+ { -+ assert (ms_Singleton); -+ return (*ms_Singleton); -+ } -+ -+ -+ //----------------------------------------------------------------------- -+ void TriangleMeshDataManager::addTriangleMeshData(const String& name, TriangleMeshDataPtr shape, Vector3 scale) -+ { -+ -+ mTriangleMeshDataMap[name][scale] = shape; -+ -+ // reduce count so when Ode::Geometry changes its dataPtr or is deleted we arn't -+ // left with this one on a referance count of 1 -+ unsigned int* count = shape.useCountPointer(); -+ (*count)--; -+ -+ } -+ -+ -+ //----------------------------------------------------------------------- -+ void TriangleMeshDataManager::removeTriangleMeshData(const String& name, Vector3 scale) -+ { -+ -+ TriangleMeshDataPtrMap::iterator itr = mTriangleMeshDataMap.find(name); -+ if(itr != mTriangleMeshDataMap.end()) -+ { -+ -+ std::map<Ogre::Vector3, OgreOde::TriangleMeshDataPtr,OgreOde::TriangleMeshDataManager::vectorLess>::iterator itr2; -+ -+ itr2 = itr->second.find(scale); -+ -+ if ( itr2 != itr->second.end() ) -+ { -+ //printf ("no TriangleMeshData for scale so erase it\n"); -+ itr->second.erase(itr2); -+ itr2->second.setNull(); -+ } -+ -+ if (itr->second.size() == 0) -+ { -+ //printf ("have no TriangleMeshData for this mesh so erase it from map\n"); -+ mTriangleMeshDataMap.erase(itr); -+ } -+ } -+ -+ } -+ -+ -+ /** looks for mesh name then size or returns a NULL TriangleMeshDataPtr -+ */ -+ //----------------------------------------------------------------------- -+ TriangleMeshDataPtr TriangleMeshDataManager::getTriangleMeshData(const String& name, Vector3 scale) -+ { -+ -+ TriangleMeshDataPtrMap::iterator itr = mTriangleMeshDataMap.find(name); -+ if(itr != mTriangleMeshDataMap.end()) -+ { -+ std::map<Ogre::Vector3, OgreOde::TriangleMeshDataPtr,OgreOde::TriangleMeshDataManager::vectorLess>::iterator itr2; -+ -+ itr2 = itr->second.find(scale); -+ -+ if ( itr2 != itr->second.end() ) -+ { -+ return itr2->second; -+ } -+ } -+ -+ //printf ("TriangleMeshDataManager::getTriangleMeshData not found\n"); -+ -+ return NULL; -+ -+ } -+ -+} -Index: prefab/src/OgreOdeRagdoll.cpp -=================================================================== ---- prefab/src/OgreOdeRagdoll.cpp (revision 2510) -+++ prefab/src/OgreOdeRagdoll.cpp (working copy) -@@ -10,6 +10,7 @@ + using namespace OgreOde; + +-template<> TriangleMeshDataManager *Ogre::Singleton<TriangleMeshDataManager>::ms_Singleton = 0; ++template<> OgreOde::TriangleMeshDataManager * Ogre::Singleton<OgreOde::TriangleMeshDataManager>::ms_Singleton = 0; + + namespace OgreOde + { +Index: prefab/src/OgreOdeRagdoll.cpp +=================================================================== +--- prefab/src/OgreOdeRagdoll.cpp (revision 2512) ++++ prefab/src/OgreOdeRagdoll.cpp (working copy) +@@ -10,6 +10,7 @@ #include "OgreOde_Prefab.h" #include "OgreOdeRagdoll.h" -+#include "OgreAlignedAllocator.h" ++#include "OgreAlignedAllocator.h" using namespace Ogre; using namespace OgreOde; +@@ -734,4 +735,4 @@ + void RagdollFactory::destroyInstance( MovableObject* obj) + { + delete obj; +-} +\ No newline at end of file ++} +Index: loader/include/OgreOdeDotLoader.h +=================================================================== +--- loader/include/OgreOdeDotLoader.h (revision 2510) ++++ loader/include/OgreOdeDotLoader.h (working copy) +@@ -15,8 +15,8 @@ + DotLoader(OgreOde::World * world = 0, OgreOde::Space * space = 0); + ~DotLoader(){}; + +- void setWorld(OgreOde::World * world) {_world = world;}; +- void setSpace(OgreOde::Space * space) {_space = space;}; ++ void setWorld(OgreOde::World * world);// {_world = world;}; ++ void setSpace(OgreOde::Space * space);// {_space = space;}; + + ObjectList *load(const Ogre::String &filename, const Ogre::StringVector &objects_names, const Ogre::StringVector &instance_names); + void save(const Ogre::String &filename, const Ogre::StringVector &objects_names, ObjectList *objects); +Index: loader/src/OgreOdeDotLoader.cpp +=================================================================== +--- loader/src/OgreOdeDotLoader.cpp (revision 2510) ++++ loader/src/OgreOdeDotLoader.cpp (working copy) +@@ -62,6 +62,12 @@ + { + + } ++ ++void DotLoader::setWorld(OgreOde::World * world) ++{_world = world;}; ++void DotLoader::setSpace(OgreOde::Space * space) ++{_space = space;}; ++ + //------------------------------------------------------------------------------------------------ + ObjectList *DotLoader::load(const String &filename, const StringVector &objects_names, const StringVector &instance_names) + { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2008-11-18 13:33:19
|
Revision: 800 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=800&view=rev Author: andy_miller Date: 2008-11-18 13:33:14 +0000 (Tue, 18 Nov 2008) Log Message: ----------- Fixes for Linux bullet and Hydrax Modified Paths: -------------- trunk/python-ogre/ThirdParty/Hydrax/Perlin.cpp trunk/python-ogre/code_generators/ogrebulletc/generate_code.py trunk/python-ogre/code_generators/ogrebulletd/generate_code.py trunk/python-ogre/demos/plugins.cfg trunk/python-ogre/environment.py trunk/python-ogre/packages_2.5/ogre/renderer/OGRE/sf_OIS.py trunk/python-ogre/scripts/00-PreReqs.sh Modified: trunk/python-ogre/ThirdParty/Hydrax/Perlin.cpp =================================================================== --- trunk/python-ogre/ThirdParty/Hydrax/Perlin.cpp 2008-11-18 07:52:54 UTC (rev 799) +++ trunk/python-ogre/ThirdParty/Hydrax/Perlin.cpp 2008-11-18 13:33:14 UTC (rev 800) @@ -133,7 +133,7 @@ // Create our perlin textures - Ogre::TexturePtr& mPerlinTexture0 + Ogre::TexturePtr mPerlinTexture0 = Ogre::TextureManager::getSingleton(). createManual("_Hydrax_Perlin_Noise0", HYDRAX_RESOURCE_GROUP, @@ -142,7 +142,7 @@ Ogre::PF_L16, Ogre::TU_DYNAMIC_WRITE_ONLY); - Ogre::TexturePtr& mPerlinTexture1 + Ogre::TexturePtr mPerlinTexture1 = Ogre::TextureManager::getSingleton(). createManual("_Hydrax_Perlin_Noise1", HYDRAX_RESOURCE_GROUP, @@ -590,4 +590,4 @@ return o >> (upsamplepower+upsamplepower); } -}} \ No newline at end of file +}} Modified: trunk/python-ogre/code_generators/ogrebulletc/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/ogrebulletc/generate_code.py 2008-11-18 07:52:54 UTC (rev 799) +++ trunk/python-ogre/code_generators/ogrebulletc/generate_code.py 2008-11-18 13:33:14 UTC (rev 800) @@ -214,7 +214,7 @@ if os.name == 'nt': defined_symbols = ["WIN32","NDEBUG","_WINDOWS", "_PRECOMP", 'OGRE_NONCLIENT_BUILD','__PYTHONOGRE_BUILD_CODE' ] else: - defined_symbols = ["NDEBUG", "_PRECOMP", 'OGRE_NONCLIENT_BUILD' ] + defined_symbols = ["NDEBUG", "_PRECOMP", 'OGRE_NONCLIENT_BUILD','__PYTHONOGRE_BUILD_CODE' ] defined_symbols.append( 'VERSION_' + environment.ogrebulletc.version ) if environment._USE_THREADS: defined_symbols.append('BOOST_HAS_THREADS') Modified: trunk/python-ogre/code_generators/ogrebulletd/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/ogrebulletd/generate_code.py 2008-11-18 07:52:54 UTC (rev 799) +++ trunk/python-ogre/code_generators/ogrebulletd/generate_code.py 2008-11-18 13:33:14 UTC (rev 800) @@ -202,7 +202,7 @@ if os.name == 'nt': defined_symbols = ["WIN32","NDEBUG","_WINDOWS", "_PRECOMP", 'OGRE_NONCLIENT_BUILD','__PYTHONOGRE_BUILD_CODE' ] else: - defined_symbols = ["NDEBUG", "_PRECOMP", 'OGRE_NONCLIENT_BUILD' ] + defined_symbols = ["NDEBUG", "_PRECOMP", 'OGRE_NONCLIENT_BUILD', '__PYTHONOGRE_BUILD_CODE' ] defined_symbols.append( 'VERSION_' + environment.ogrebulletd.version ) if environment._USE_THREADS: Modified: trunk/python-ogre/demos/plugins.cfg =================================================================== --- trunk/python-ogre/demos/plugins.cfg 2008-11-18 07:52:54 UTC (rev 799) +++ trunk/python-ogre/demos/plugins.cfg 2008-11-18 13:33:14 UTC (rev 800) @@ -1,23 +1,13 @@ # Defines plugins to load ## Use this for Windows -# Define plugin folder -PluginFolder=../../plugins -Plugin=RenderSystem_GL.dll -Plugin=RenderSystem_Direct3D9.dll -Plugin=Plugin_ParticleFX.dll -Plugin=Plugin_BSPSceneManager.dll -Plugin=Plugin_CgProgramManager.dll -Plugin=Plugin_PCZSceneManager.dll -Plugin=Plugin_OctreeZone.dll -Plugin=Plugin_OctreeSceneManager.dll ## ## NOTE use this for MacOS or Linux -#PluginFolder=/home/andy/development/root/usr/lib/OGRE -#Plugin=RenderSystem_GL -#Plugin=Plugin_ParticleFX -#Plugin=Plugin_BSPSceneManager -#Plugin=Plugin_OctreeSceneManager -#Plugin=Plugin_CgProgramManager +PluginFolder=/home/andy/development/root/usr/lib/OGRE +Plugin=RenderSystem_GL +Plugin=Plugin_ParticleFX +Plugin=Plugin_BSPSceneManager +Plugin=Plugin_OctreeSceneManager +Plugin=Plugin_CgProgramManager Modified: trunk/python-ogre/environment.py =================================================================== --- trunk/python-ogre/environment.py 2008-11-18 07:52:54 UTC (rev 799) +++ trunk/python-ogre/environment.py 2008-11-18 13:33:14 UTC (rev 800) @@ -815,8 +815,8 @@ [cvs, " -d :pserver:ano...@cv...:/cvsroot/ogre co -D 01052008 -P "+base, os.getcwd()] ] else: - source = [ ##to fix - [svn, " co :pserver:ano...@cv...:/cvsroot/ogre co -P "+base, os.getcwd()] + source = [ + [svn, " co https://ogreaddons.svn.sourceforge.net/svnroot/ogreaddons/trunk/ogrenewt " + base, os.getcwd()] ] baseDir = os.path.join(os.getcwd(), base ) buildCmds = [ @@ -1509,14 +1509,14 @@ base = "bullet-" + version baseDir = os.path.join(os.getcwd(), base) parent = "ogre/physics" - libs=[boost.lib, 'LibBulletCollision', 'LibBulletDynamics'] + libs=[boost.lib, 'libbulletcollision', 'libbulletdynamics'] if isWindows(): libs.append('libbulletmath') else: - libs.append('LibLinearMath') - libs.append('LibBulletSoftBody') - libs.append('LibBulletColladaConverter') - libs.append('LibBulletMultiThreaded') + libs.append('libbulletmath') + libs.append('libbulletsoftbody') + #libs.append('libbulletcolladaconverter') + libs.append('libbulletmultithreaded') lib_dirs = [ Config.PATH_LIB_Boost , Config.PATH_LIB_Bullet @@ -1530,9 +1530,14 @@ ] buildCmds = [ [0, "tar zxf " +os.path.join(downloadPath, base)+".tgz", ''], - [0, "cmake . -DCMAKE_INSTALL_PREFIX:PATH=%s" % PREFIX, baseDir], - [0, "make", baseDir], - [0, "find . -name *.a -execdir cp {} %s/lib \;" % PREFIX, baseDir] + [0, "./autogen.sh", baseDir], + [0, "./configure --prefix=%s " %(PREFIX), baseDir], +## [0, "cmake . -DCMAKE_INSTALL_PREFIX:PATH=%s" % PREFIX, baseDir], +## [0, "make", baseDir], + [0, "jam", baseDir], + [0, "jam install", baseDir] + +## [0, "find . -name *.a -execdir cp {} %s/lib \;" % PREFIX, baseDir] ] else: source=[ @@ -1554,12 +1559,12 @@ cflags = "" parent = "ogre/physics" libs = [boost.lib, 'OgreMain', - 'LibBulletCollision', 'LibBulletDynamics' + 'libbulletcollision', 'libbulletdynamics', 'libbulletmath' ] - if isWindows(): - libs.append('libbulletmath') - else: - libs.append('LibLinearMath') +# if isWindows(): +# libs.append('libbulletmath') +# else: +# libs.append('liblinearmath') include_dirs = [Config.PATH_Boost , Config.PATH_INCLUDE_Bullet , os.path.join(Config.PATH_OgreBullet, 'Collisions' ) @@ -1575,8 +1580,9 @@ else: CCFLAGS = ' -D_PRECOMP ' ModuleName = 'OgreBulletC' - CheckIncludes=['boost/python.hpp', 'Ogre.h'] + CheckIncludes=['boost/python.hpp', 'Ogre.h'] + class ogrebulletd: # active = True pythonModule = True @@ -1585,12 +1591,12 @@ cflags = "" parent = "ogre/physics" libs = [boost.lib, 'OgreMain', - 'LibBulletCollision', 'LibBulletDynamics' + 'libbulletcollision', 'libbulletdynamics', 'libbulletmath' ] - if isWindows(): - libs.append('libbulletmath') - else: - libs.append('LibLinearMath') +# if isWindows(): +# libs.append('libbulletmath') +# else: +# libs.append('liblinearmath') include_dirs = [Config.PATH_Boost , Config.PATH_INCLUDE_Bullet , os.path.join(Config.PATH_OgreBullet, 'Collisions' ) Modified: trunk/python-ogre/packages_2.5/ogre/renderer/OGRE/sf_OIS.py =================================================================== --- trunk/python-ogre/packages_2.5/ogre/renderer/OGRE/sf_OIS.py 2008-11-18 07:52:54 UTC (rev 799) +++ trunk/python-ogre/packages_2.5/ogre/renderer/OGRE/sf_OIS.py 2008-11-18 13:33:14 UTC (rev 800) @@ -118,7 +118,13 @@ def _setUp(self): """This sets up the ogre application, and returns false if the user hits "cancel" in the dialog box.""" - self.root = ogre.Root(getPluginPath()) + if self.unittest: + if os.path.isfile('ogre.cfg'): + self.root = ogre.Root(getPluginPath()) + else: + self.root = ogre.Root(getPluginPath(), '../ogre.cfg') + else: + self.root = ogre.Root(getPluginPath()) self.root.setFrameSmoothingPeriod (5.0) self._setUpResources() Modified: trunk/python-ogre/scripts/00-PreReqs.sh =================================================================== --- trunk/python-ogre/scripts/00-PreReqs.sh 2008-11-18 07:52:54 UTC (rev 799) +++ trunk/python-ogre/scripts/00-PreReqs.sh 2008-11-18 13:33:14 UTC (rev 800) @@ -22,5 +22,6 @@ python-dev \ python-celementtree \ libglew-dev \ + jam \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2008-11-19 10:38:22
|
Revision: 804 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=804&view=rev Author: andy_miller Date: 2008-11-19 10:38:17 +0000 (Wed, 19 Nov 2008) Log Message: ----------- Fix for OgreBulletc under Linux Modified Paths: -------------- trunk/python-ogre/ThirdParty/ogrebullet/Collisions/OgreBulletCollisionsRay.cpp trunk/python-ogre/ThirdParty/ogrebullet/Collisions/OgreBulletCollisionsRay.h trunk/python-ogre/environment.py Modified: trunk/python-ogre/ThirdParty/ogrebullet/Collisions/OgreBulletCollisionsRay.cpp =================================================================== --- trunk/python-ogre/ThirdParty/ogrebullet/Collisions/OgreBulletCollisionsRay.cpp 2008-11-18 23:15:10 UTC (rev 803) +++ trunk/python-ogre/ThirdParty/ogrebullet/Collisions/OgreBulletCollisionsRay.cpp 2008-11-19 10:38:17 UTC (rev 804) @@ -72,6 +72,11 @@ { return mRay.getPoint(mMaxDistance); } + // basic CollisionRay inline methods + const Ogre::Ray & CollisionRayResultCallback ::getRay() const + { + return mRay; + } // ------------------------------------------------------------------------- bool CollisionRayResultCallback::doesCollide() const { Modified: trunk/python-ogre/ThirdParty/ogrebullet/Collisions/OgreBulletCollisionsRay.h =================================================================== --- trunk/python-ogre/ThirdParty/ogrebullet/Collisions/OgreBulletCollisionsRay.h 2008-11-18 23:15:10 UTC (rev 803) +++ trunk/python-ogre/ThirdParty/ogrebullet/Collisions/OgreBulletCollisionsRay.h 2008-11-19 10:38:17 UTC (rev 804) @@ -48,7 +48,7 @@ void setWorld(CollisionsWorld *world); void setMaxDistance(Ogre::Real max_distance); - inline const Ogre::Ray &getRay() const; + const Ogre::Ray & getRay() const; inline Ogre::Vector3 getRayStartPoint() const; inline Ogre::Vector3 getRayEndPoint() const; @@ -61,11 +61,7 @@ }; // ------------------------------------------------------------------------- - // basic CollisionRay inline methods - inline const Ogre::Ray &CollisionRayResultCallback ::getRay() const - { - return mRay; - } + // ------------------------------------------------------------------------- // CollisionClosestRay class CollisionClosestRayResultCallback : public CollisionRayResultCallback Modified: trunk/python-ogre/environment.py =================================================================== --- trunk/python-ogre/environment.py 2008-11-18 23:15:10 UTC (rev 803) +++ trunk/python-ogre/environment.py 2008-11-19 10:38:17 UTC (rev 804) @@ -1600,7 +1600,7 @@ if isWindows(): CCFLAGS = ' -DWIN32 -DNDEBUG -D_WINDOWS -D_PRECOMP ' else: - CCFLAGS = ' -D_PRECOMP ' + CCFLAGS = ' -D_PRECOMP -fno-inline ' libs.append ( boost_python_index.lib ) ModuleName = 'OgreBulletC' CheckIncludes=['boost/python.hpp', 'Ogre.h'] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2008-11-21 02:26:06
|
Revision: 805 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=805&view=rev Author: andy_miller Date: 2008-11-21 02:25:55 +0000 (Fri, 21 Nov 2008) Log Message: ----------- Linux updates - Bullet 2.72 and OgreBulletC now OK Modified Paths: -------------- trunk/python-ogre/PythonOgreConfig_posix.py trunk/python-ogre/code_generators/bullet/generate_code.py trunk/python-ogre/code_generators/bullet/python_bullet_aliases.h trunk/python-ogre/code_generators/ogrebulletd/customization_data.py trunk/python-ogre/code_generators/ogrebulletd/generate_code.py trunk/python-ogre/code_generators/ogrebulletd/python_ogrebullet.h trunk/python-ogre/demos/ogrepcz/plugins.cfg trunk/python-ogre/environment.py Modified: trunk/python-ogre/PythonOgreConfig_posix.py =================================================================== --- trunk/python-ogre/PythonOgreConfig_posix.py 2008-11-19 10:38:17 UTC (rev 804) +++ trunk/python-ogre/PythonOgreConfig_posix.py 2008-11-21 02:25:55 UTC (rev 805) @@ -70,7 +70,7 @@ PATH_NxOgre= os.path.join(PATH_THIRDPARTY, 'nxogre') PATH_NxOgre_09= os.path.join(PATH_THIRDPARTY, 'nxogre_0.9') # PATH_NxOgre= os.path.join(BASE_DIR, 'nxogre/NxOgre') -PATH_Bullet= os.path.join(BASE_DIR, 'bullet-2.70') +PATH_Bullet= os.path.join(BASE_DIR, 'bullet-2.72') ###PATH_PhysX= os.path.join(BASE_DIR, 'Physx/v2.7.3/SDKs') PATH_Theora= os.path.join(PATH_OgreAddons,'videoplugin','TheoraVideo') PATH_ffmpeg= os.path.join(BASE_DIR, 'ffmpeg') Modified: trunk/python-ogre/code_generators/bullet/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/bullet/generate_code.py 2008-11-19 10:38:17 UTC (rev 804) +++ trunk/python-ogre/code_generators/bullet/generate_code.py 2008-11-21 02:25:55 UTC (rev 805) @@ -81,7 +81,7 @@ ,'::btCompoundShape::createAabbTreeFromChildren' ,'::btCollisionAlgorithm::getDispatcherId' ,'::btCollisionAlgorithmConstructionInfo::getDispatcherId' - ,'::btOptimizedBvh::walkRecursiveQuantizedTreeAgainstQuantizedTree' + ,'::btQuantizedBvh::walkRecursiveQuantizedTreeAgainstQuantizedTree' ,'::btCapsuleShape::calculateLocalInertia' ,'::btCapsuleShape::localGetSupportingVertexWithoutMargin' @@ -127,9 +127,9 @@ ,'btAlignedAllocator<btMultiSapBroadphase::btBridgeProxy*, 16u>' ,'btAlignedAllocator<btMultiSapBroadphase::btMultiSapProxy*, 16u>' # ,'btAlignedAllocator<btOdeContactJoint, 16u>' - ,'btAlignedAllocator<btOdeJoint*, 16u>' +# ,'btAlignedAllocator<btOdeJoint*, 16u>' # ,'btAlignedAllocator<btOdeSolverBody, 16u>' - ,'btAlignedAllocator<btOdeSolverBody*, 16u>' +# ,'btAlignedAllocator<btOdeSolverBody*, 16u>' # ,'btAlignedAllocator<btOdeTypedJoint, 16u>' ,'btAlignedAllocator<unsigned int, 16u>' ,'btAlignedAllocator<unsigned short, 16u>' @@ -150,8 +150,9 @@ # ,'btAlignedObjectArray<btQuantizedBvhNode>' # ,'btAlignedObjectArray<btOptimizedBvhNode>' # ,'btAlignedObjectArray<btCollisionObject*>' - ,'btDbvtBroadphase' - ,'btSorLcpSolver' + ,'btDbvtBroadphase' + ,'btContinuousDynamicsWorld' +# ,'btSorLcpSolver' ] for e in excludes: print "excluding class", e Modified: trunk/python-ogre/code_generators/bullet/python_bullet_aliases.h =================================================================== --- trunk/python-ogre/code_generators/bullet/python_bullet_aliases.h 2008-11-19 10:38:17 UTC (rev 804) +++ trunk/python-ogre/code_generators/bullet/python_bullet_aliases.h 2008-11-21 02:25:55 UTC (rev 805) @@ -32,11 +32,11 @@ typedef btAlignedAllocator<btDbvt::sStkNPS, 16u> AlignedAllocatorsStkNPS; // typedef btAlignedAllocator<btMultiSapBroadphase::btBridgeProxy*, 16u> AlignedAllocatorMultiSapBradBridge; // typedef btAlignedAllocator<btMultiSapBroadphase::btMultiSapProxy*, 16u> AlignedAllocatorMultiSapBroadMulti; -typedef btAlignedAllocator<btOdeContactJoint, 16u> AlignedAllocatorOdeContactJoint; -typedef btAlignedAllocator<btOdeJoint*, 16u> AlignedAllocatorOdeJointPtr; -typedef btAlignedAllocator<btOdeSolverBody, 16u> AlignedAllocatorOdeSolverBody; -typedef btAlignedAllocator<btOdeSolverBody*, 16u> AlignedAllocatorOdeSolverBodyPtr; -typedef btAlignedAllocator<btOdeTypedJoint, 16u> AlignedAllocatorOdeTypedJoint; +//typedef btAlignedAllocator<btOdeContactJoint, 16u> AlignedAllocatorOdeContactJoint; +//typedef btAlignedAllocator<btOdeJoint*, 16u> AlignedAllocatorOdeJointPtr; +//typedef btAlignedAllocator<btOdeSolverBody, 16u> AlignedAllocatorOdeSolverBody; +//typedef btAlignedAllocator<btOdeSolverBody*, 16u> AlignedAllocatorOdeSolverBodyPtr; +//typedef btAlignedAllocator<btOdeTypedJoint, 16u> AlignedAllocatorOdeTypedJoint; typedef btAlignedAllocator<short, 16u> AlignedAllocatorShort16; typedef btAlignedObjectArray<btDbvtNode const*> AlignedObjectArrayDbvtNode; typedef btAlignedObjectArray<btDbvt::sStkNN> AlignedObjectArrayDbvtsStkNN; @@ -44,11 +44,11 @@ typedef btAlignedObjectArray<btDbvt::sStkNPS> AlignedObjectArrayDbvtsStkNPS; // typedef btAlignedObjectArray<btMultiSapBroadphase::btBridgeProxy*> AlignedObjectArrayMultiSapBroadBridge; // typedef btAlignedObjectArray<btMultiSapBroadphase::btMultiSapProxy*> AlignedObjectArrayMultiSapBroadMulti; -typedef btAlignedObjectArray<btOdeContactJoint> AlignedObjectArrayOdeContactJoint; -typedef btAlignedObjectArray<btOdeJoint*> AlignedObjectArrayOdeJointPtr; -typedef btAlignedObjectArray<btOdeSolverBody> AlignedObjectArrayOdeSolverBody; -typedef btAlignedObjectArray<btOdeSolverBody*> AlignedObjectArrayOdeSolverBodyPtr; -typedef btAlignedObjectArray<btOdeTypedJoint> AlignedObjectArrayOdeTypedJoint; +//typedef btAlignedObjectArray<btOdeContactJoint> AlignedObjectArrayOdeContactJoint; +//typedef btAlignedObjectArray<btOdeJoint*> AlignedObjectArrayOdeJointPtr; +//typedef btAlignedObjectArray<btOdeSolverBody> AlignedObjectArrayOdeSolverBody; +//typedef btAlignedObjectArray<btOdeSolverBody*> AlignedObjectArrayOdeSolverBodyPtr; +//typedef btAlignedObjectArray<btOdeTypedJoint> AlignedObjectArrayOdeTypedJoint; Modified: trunk/python-ogre/code_generators/ogrebulletd/customization_data.py =================================================================== --- trunk/python-ogre/code_generators/ogrebulletd/customization_data.py 2008-11-19 10:38:17 UTC (rev 804) +++ trunk/python-ogre/code_generators/ogrebulletd/customization_data.py 2008-11-21 02:25:55 UTC (rev 805) @@ -1,7 +1,11 @@ def header_files( version ): - return [ 'OgreBulletDynamics.h'] + return [ 'OgreBulletDynamics.h' + ,"LinearMath/btStackAlloc.h" + ,"LinearMath/btPoolAllocator.h" + ,"BulletCollision/CollisionDispatch/btSimulationIslandManager.h" +] def huge_classes( version ): return [] - \ No newline at end of file + Modified: trunk/python-ogre/code_generators/ogrebulletd/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/ogrebulletd/generate_code.py 2008-11-19 10:38:17 UTC (rev 804) +++ trunk/python-ogre/code_generators/ogrebulletd/generate_code.py 2008-11-21 02:25:55 UTC (rev 805) @@ -58,6 +58,15 @@ main_ns = global_ns.namespace( MAIN_NAMESPACE ) else: main_ns = global_ns + excludes=['::btSimulationIslandManager' + ] + for e in excludes: + print "excluding class", e + global_ns.class_(e).exclude() + for c in global_ns.classes(): + #if not c.ignore: + print c + sys.exit(-1) ############################################################ ## Modified: trunk/python-ogre/code_generators/ogrebulletd/python_ogrebullet.h =================================================================== --- trunk/python-ogre/code_generators/ogrebulletd/python_ogrebullet.h 2008-11-19 10:38:17 UTC (rev 804) +++ trunk/python-ogre/code_generators/ogrebulletd/python_ogrebullet.h 2008-11-21 02:25:55 UTC (rev 805) @@ -1,5 +1,9 @@ -#include "OgreBulletDynamics.h" +#include "OgreBulletDynamics.h" +#include "LinearMath/btStackAlloc.h" +#include "LinearMath/btPoolAllocator.h" +#include "BulletCollision/CollisionDispatch/btSimulationIslandManager.h" + // First we create a magic namespace to hold all our aliases namespace pyplusplus { namespace aliases { Modified: trunk/python-ogre/demos/ogrepcz/plugins.cfg =================================================================== --- trunk/python-ogre/demos/ogrepcz/plugins.cfg 2008-11-19 10:38:17 UTC (rev 804) +++ trunk/python-ogre/demos/ogrepcz/plugins.cfg 2008-11-21 02:25:55 UTC (rev 805) @@ -2,22 +2,24 @@ ## Use this for Windows # Define plugin folder -PluginFolder=../../plugins -#home/andy/development/root/usr/lib/OGRE -Plugin=RenderSystem_GL.dll -Plugin=RenderSystem_Direct3D9.dll -Plugin=Plugin_ParticleFX.dll -Plugin=Plugin_BSPSceneManager.dll -Plugin=Plugin_CgProgramManager.dll -Plugin=Plugin_PCZSceneManager.dll -Plugin=Plugin_OctreeZone.dll -Plugin=Plugin_OctreeSceneManager.dll +#PluginFolder=../../plugins +#Plugin=RenderSystem_GL.dll +#Plugin=RenderSystem_Direct3D9.dll +#Plugin=Plugin_ParticleFX.dll +#Plugin=Plugin_BSPSceneManager.dll +#Plugin=Plugin_CgProgramManager.dll +#Plugin=Plugin_PCZSceneManager.dll +#Plugin=Plugin_OctreeZone.dll +#Plugin=Plugin_OctreeSceneManager.dll ## ## NOTE use this for MacOS or Linux -# Plugin=RenderSystem_GL -# Plugin=Plugin_ParticleFX -# Plugin=Plugin_BSPSceneManager -# Plugin=Plugin_OctreeSceneManager -# Plugin=Plugin_CgProgramManager +PluginFolder=/home/andy/development/root/usr/lib/OGRE +Plugin=RenderSystem_GL +Plugin=Plugin_ParticleFX +Plugin=Plugin_BSPSceneManager +Plugin=libPlugin_PCZSceneManager +#Plugin=Plugin_OctreeZone +Plugin=Plugin_OctreeSceneManager +#Plugin=Plugin_CgProgramManager Modified: trunk/python-ogre/environment.py =================================================================== --- trunk/python-ogre/environment.py 2008-11-19 10:38:17 UTC (rev 804) +++ trunk/python-ogre/environment.py 2008-11-21 02:25:55 UTC (rev 805) @@ -1525,19 +1525,20 @@ class bullet: active = True pythonModule = True - version= "2.70" + version= "2.72" name='bullet' base = "bullet-" + version baseDir = os.path.join(os.getcwd(), base) parent = "ogre/physics" - libs=[boost.lib, 'libbulletcollision', 'libbulletdynamics'] + libs=[boost.lib, 'LibBulletCollision', 'LibBulletDynamics','LibLinearMath'] if isWindows(): - libs.append('libbulletmath') + pass + #libs.append('libbulletMath') else: - libs.append('libbulletmath') - libs.append('libbulletsoftbody') + #libs.append('libbulletmath') + libs.append('LibBulletSoftBody') #libs.append('libbulletcolladaconverter') - libs.append('libbulletmultithreaded') + libs.append('LibBulletMultiThreaded') libs.append ( boost_python_index.lib ) lib_dirs = [ Config.PATH_LIB_Boost @@ -1552,14 +1553,15 @@ ] buildCmds = [ [0, "tar zxf " +os.path.join(downloadPath, base)+".tgz", ''], - [0, "./autogen.sh", baseDir], - [0, "./configure --prefix=%s " %(PREFIX), baseDir], -## [0, "cmake . -DCMAKE_INSTALL_PREFIX:PATH=%s" % PREFIX, baseDir], -## [0, "make", baseDir], - [0, "jam", baseDir], - [0, "jam install", baseDir] +# [0, "./autogen.sh", baseDir], +# [0, "./configure --prefix=%s " %(PREFIX), baseDir], + [0, "cmake . -DCMAKE_INSTALL_PREFIX:PATH=%s" % PREFIX, baseDir], + [0, "make", baseDir], +# [0, "make install", baseDir], +# [0, "jam", baseDir], +# [0, "jam install", baseDir] -## [0, "find . -name *.a -execdir cp {} %s/lib \;" % PREFIX, baseDir] + [0, "find . -name *.a -execdir cp {} %s/lib \;" % PREFIX, baseDir] ] else: source=[ @@ -1581,7 +1583,7 @@ cflags = "" parent = "ogre/physics" libs = [boost.lib, 'OgreMain', - 'libbulletcollision', 'libbulletdynamics', 'libbulletmath' + 'LibBulletCollision', 'LibBulletDynamics','LibBulletMultiThreaded','LibBulletSoftBody','LibLinearMath' ] # if isWindows(): # libs.append('libbulletmath') @@ -1614,7 +1616,7 @@ cflags = "" parent = "ogre/physics" libs = [boost.lib, 'OgreMain', - 'libbulletcollision', 'libbulletdynamics', 'libbulletmath' + 'LibBulletCollision', 'LibBulletDynamics','LibBulletMultiThreaded','LibBulletSoftBody','LibLinearMath' ] # if isWindows(): # libs.append('libbulletmath') @@ -1634,7 +1636,7 @@ if isWindows(): CCFLAGS = ' -DWIN32 -DNDEBUG -D_WINDOWS -D_PRECOMP ' else: - CCFLAGS = ' -D_PRECOMP ' + CCFLAGS = ' -D_PRECOMP -fno-inline ' libs.append ( boost_python_index.lib ) ModuleName = 'OgreBulletD' CheckIncludes=['boost/python.hpp', 'Ogre.h'] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2008-11-21 03:53:21
|
Revision: 806 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=806&view=rev Author: andy_miller Date: 2008-11-21 03:53:18 +0000 (Fri, 21 Nov 2008) Log Message: ----------- Fix for OgreOde in Linux -- files missing from make.. Modified Paths: -------------- trunk/python-ogre/ThirdParty/nxogre/BetajaenSL.h trunk/python-ogre/demos/ogreode/Demo_GranTurism.py trunk/python-ogre/environment.py trunk/python-ogre/patch/ogreode.patch Modified: trunk/python-ogre/ThirdParty/nxogre/BetajaenSL.h =================================================================== --- trunk/python-ogre/ThirdParty/nxogre/BetajaenSL.h 2008-11-21 02:25:55 UTC (rev 805) +++ trunk/python-ogre/ThirdParty/nxogre/BetajaenSL.h 2008-11-21 03:53:18 UTC (rev 806) @@ -40,12 +40,12 @@ /** \brief Export Class Macro, replace value with your export macro */ -#define BETAJAEN_SL_CLASS __declspec(dllexport) +#define BETAJAEN_SL_CLASS // __declspec(dllexport) #define BETAJAEN_SL_CLASS_FUNCTION #define BETAJAEN_SL_TEMPLATE_CLASS -#define BETAJAEN_SL_TEMPLATE_CLASS_FUNCTION __forceinline -#define BETAJAEN_SL_CLASS_EXPORT __declspec(dllexport) -#define BETAJAEN_SL_TEMPLATE_CLASS_EXPORT __forceinline +#define BETAJAEN_SL_TEMPLATE_CLASS_FUNCTION // __forceinline +#define BETAJAEN_SL_CLASS_EXPORT // __declspec(dllexport) +#define BETAJAEN_SL_TEMPLATE_CLASS_EXPORT // __forceinline // __declspec(dllexport) /** \brief Delete macro. Used if you have your own leak checker, etc. Modified: trunk/python-ogre/demos/ogreode/Demo_GranTurism.py =================================================================== --- trunk/python-ogre/demos/ogreode/Demo_GranTurism.py 2008-11-21 02:25:55 UTC (rev 805) +++ trunk/python-ogre/demos/ogreode/Demo_GranTurism.py 2008-11-21 03:53:18 UTC (rev 806) @@ -25,7 +25,6 @@ #------------------------------------------------------------------------------------------------ class GranTurismOgreFrameListener ( sf.FrameListener ): def __init__(self, win, cam,time_step,root,world) : - print "frame init" sf.FrameListener.__init__(self, win,cam) self.camera = cam self.vehicle = None @@ -129,7 +128,6 @@ #------------------------------------------------------------------------------------------------ def frameStarted( self, evt): - print "*** frameStarted" time = evt.timeSinceLastFrame ret = sf.FrameListener.frameStarted(self,evt) Modified: trunk/python-ogre/environment.py =================================================================== --- trunk/python-ogre/environment.py 2008-11-21 02:25:55 UTC (rev 805) +++ trunk/python-ogre/environment.py 2008-11-21 03:53:18 UTC (rev 806) @@ -1054,7 +1054,7 @@ [0, "patch -s -N -i ../../python-ogre/patch/ogreode.patch -p0", baseDir], [0, "chmod +x autogen.sh", baseDir], [0, "./autogen.sh", baseDir], - [0, "./configure --without-samples --prefix=%s" % PREFIX, baseDir], + [0, "./configure --without-SAMPLES --prefix=%s" % PREFIX, baseDir], [0, "make", baseDir], [0, "make install", baseDir], ] Modified: trunk/python-ogre/patch/ogreode.patch =================================================================== --- trunk/python-ogre/patch/ogreode.patch 2008-11-21 02:25:55 UTC (rev 805) +++ trunk/python-ogre/patch/ogreode.patch 2008-11-21 03:53:18 UTC (rev 806) @@ -1,6 +1,6 @@ Index: include/OgreOdeEntityInformer.h =================================================================== ---- include/OgreOdeEntityInformer.h (revision 2510) +--- include/OgreOdeEntityInformer.h (revision 2512) +++ include/OgreOdeEntityInformer.h (working copy) @@ -36,12 +36,12 @@ const TriangleIndex* getIndices(); @@ -18,7 +18,7 @@ Ogre::SceneNode* _node; Index: src/OgreOdeGeometry.cpp =================================================================== ---- src/OgreOdeGeometry.cpp (revision 2510) +--- src/OgreOdeGeometry.cpp (revision 2512) +++ src/OgreOdeGeometry.cpp (working copy) @@ -924,7 +924,7 @@ @@ -31,7 +31,7 @@ registerGeometry(); Index: src/OgreOdeTriangleMeshDataManager.cpp =================================================================== ---- src/OgreOdeTriangleMeshDataManager.cpp (revision 2510) +--- src/OgreOdeTriangleMeshDataManager.cpp (revision 2512) +++ src/OgreOdeTriangleMeshDataManager.cpp (working copy) @@ -6,7 +6,7 @@ using namespace Ogre; @@ -42,6 +42,19 @@ namespace OgreOde { +Index: src/Makefile.am +=================================================================== +--- src/Makefile.am (revision 2512) ++++ src/Makefile.am (working copy) +@@ -22,6 +22,8 @@ + OgreOdeSpace.cpp \ + OgreOdeStepper.cpp \ + OgreOdeUtility.cpp \ ++ OgreOdeTriangleMeshData.cpp \ ++ OgreOdeTriangleMeshDataManager.cpp \ + OgreOdeWorld.cpp + + libOgreOde_Core_la_LIBADD = \ Index: prefab/src/OgreOdeRagdoll.cpp =================================================================== --- prefab/src/OgreOdeRagdoll.cpp (revision 2512) @@ -63,7 +76,7 @@ +} Index: loader/include/OgreOdeDotLoader.h =================================================================== ---- loader/include/OgreOdeDotLoader.h (revision 2510) +--- loader/include/OgreOdeDotLoader.h (revision 2512) +++ loader/include/OgreOdeDotLoader.h (working copy) @@ -15,8 +15,8 @@ DotLoader(OgreOde::World * world = 0, OgreOde::Space * space = 0); @@ -78,7 +91,7 @@ void save(const Ogre::String &filename, const Ogre::StringVector &objects_names, ObjectList *objects); Index: loader/src/OgreOdeDotLoader.cpp =================================================================== ---- loader/src/OgreOdeDotLoader.cpp (revision 2510) +--- loader/src/OgreOdeDotLoader.cpp (revision 2512) +++ loader/src/OgreOdeDotLoader.cpp (working copy) @@ -62,6 +62,12 @@ { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2008-11-23 02:15:46
|
Revision: 809 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=809&view=rev Author: andy_miller Date: 2008-11-23 02:15:43 +0000 (Sun, 23 Nov 2008) Log Message: ----------- Physx update New overlay in demos Modified Paths: -------------- trunk/python-ogre/PythonOgreConfig_nt.py trunk/python-ogre/code_generators/physx/generate_code.py trunk/python-ogre/demos/hydrax/resources.cfg trunk/python-ogre/environment.py trunk/python-ogre/packages_2.5/ogre/renderer/OGRE/sf_OIS.py Added Paths: ----------- trunk/python-ogre/demos/media/overlays/PythonOgreDebugPanel trunk/python-ogre/demos/media/overlays/PythonOgreDebugPanel.material trunk/python-ogre/demos/media/overlays/PythonOgreDebugPanel.overlay trunk/python-ogre/demos/media/overlays/panel.png trunk/python-ogre/demos/media/overlays/popanel.png trunk/python-ogre/demos/media/overlays/pythonogretext.png Modified: trunk/python-ogre/PythonOgreConfig_nt.py =================================================================== --- trunk/python-ogre/PythonOgreConfig_nt.py 2008-11-21 04:45:57 UTC (rev 808) +++ trunk/python-ogre/PythonOgreConfig_nt.py 2008-11-23 02:15:43 UTC (rev 809) @@ -83,6 +83,7 @@ PATH_hydrax = os.path.join(PATH_THIRDPARTY, 'Hydrax') PATH_hikari = os.path.join(PATH_THIRDPARTY, 'Hikari' ) #BASE_DIR, 'hikari', 'hikari') +PATH_mygui = os.path.join(BASE_DIR, 'MyGUI_2.2.0_RC1_source' ) # it's time for the SDK version if SDK: @@ -130,8 +131,8 @@ PATH_LIB_opensteer = os.path.join(PATH_opensteer, 'win32','release') PATH_LIB_hikari = os.path.join(PATH_hikari ) # , 'lib') +PATH_LIB_mygui = os.path.join(PATH_mygui, 'MyGUIEngine','lib','Release') - PATH_INCLUDE_Ogre= os.path.join(PATH_Ogre,'OgreMain/include') PATH_INCLUDE_NEDMALLOC= os.path.join(PATH_Ogre,'OgreMain', 'src', 'nedmalloc') PATH_INCLUDE_Ogre_Dependencies = os.path.join( PATH_Ogre, 'Dependencies/include') @@ -181,6 +182,7 @@ PATH_INCLUDE_ogrepcz = os.path.join(PATH_ogrepcz,'include') PATH_INCLUDE_hydrax= PATH_hydrax PATH_INCLUDE_hikari = os.path.join(PATH_hikari ) #, 'include') +PATH_INCLUDE_mygui = os.path.join(PATH_mygui,'MyGUIEngine','include') PATH_INCLUDE_OggVorbisTheora = [ os.path.join(BASE_DIR,'ogg','include') ,os.path.join(BASE_DIR, 'vorbis', 'include') Modified: trunk/python-ogre/code_generators/physx/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/physx/generate_code.py 2008-11-21 04:45:57 UTC (rev 808) +++ trunk/python-ogre/code_generators/physx/generate_code.py 2008-11-23 02:15:43 UTC (rev 809) @@ -79,7 +79,7 @@ ] if os.name =='nt': - excludes.append('::NxArray<NxFluidEmitterDesc, NxAllocatorDefault>::deleteEntry') + excludes.append('::NxArray<NxFluidEmitterDesc, NxAllocatorDefault>::deleteEntry') for e in excludes: print "excluding function", e @@ -93,17 +93,19 @@ print "Excluding:", e global_ns.free_functions(e).exclude() - excludes = ['NxArray<NxShapeDesc*, NxAllocatorDefault>', ## doesn't have a defult constructor for ElemType - 'NxArray<NxForceFieldShapeDesc*, NxAllocatorDefault>', ## Elemtype issue - 'NxArray<NxForceFieldShapeGroup*, NxAllocatorDefault>', ## Elemtype issue + excludes = [ + #'NxArray<NxShapeDesc*, NxAllocatorDefault>', ## doesn't have a defult constructor for ElemType + #'NxArray<NxForceFieldShapeDesc*, NxAllocatorDefault>', ## Elemtype issue + #'NxArray<NxForceFieldShapeGroup*, NxAllocatorDefault>', ## Elemtype issue 'NxForceFieldShapeGroup' ## seems to have access issues.. ] # for c in global_ns.classes(): # print c - if os.name =='nt': - excludes.append('NxArray<NxFluidEmitterDesc, NxAllocatorDefault>') ## needs ElemType changed to NxFluidEmitterDesc - else: + if os.name =='nt': + pass +# excludes.append('NxArray<NxFluidEmitterDesc, NxAllocatorDefault>') ## needs ElemType changed to NxFluidEmitterDesc + else: excludes.append ( '::NxFluidUserNotify') for e in excludes: print "Excluding Class:", e @@ -141,13 +143,24 @@ ############################################################ def ManualFixes ( mb ): - global_ns = mb.global_ns - # this change was for 1.7 but also needed for 1.4 + global_ns = mb.global_ns + # this change was for 1.7 but also needed for 1.4 noncopy=[] ###'NxPhysicsSDK'] for c in noncopy: - global_ns.class_(c).noncopyable = True + global_ns.class_(c).noncopyable = True + for c in global_ns.constructors(): + for x in range ( len ( c.arguments ) ): + if c.arguments[x].default_value: + if "ElemType" in c.arguments[x].default_value: + c.arguments[x].default_value='' + for c in global_ns.mem_funs(): + for x in range ( len ( c.arguments ) ): + if c.arguments[x].default_value: + if "ElemType" in c.arguments[x].default_value: + c.arguments[x].default_value='' + # known = ['points', 'triangles'] # for c in global_ns.classes(): # if c.name.startswith ('Nx'): Modified: trunk/python-ogre/demos/hydrax/resources.cfg =================================================================== --- trunk/python-ogre/demos/hydrax/resources.cfg 2008-11-21 04:45:57 UTC (rev 808) +++ trunk/python-ogre/demos/hydrax/resources.cfg 2008-11-23 02:15:43 UTC (rev 809) @@ -3,7 +3,7 @@ # Resource locations to be added to the default path [General] - +FileSystem=../media/overlays FileSystem=./media FileSystem=./media/materials/programs FileSystem=./media/materials/scripts Added: trunk/python-ogre/demos/media/overlays/PythonOgreDebugPanel =================================================================== --- trunk/python-ogre/demos/media/overlays/PythonOgreDebugPanel (rev 0) +++ trunk/python-ogre/demos/media/overlays/PythonOgreDebugPanel 2008-11-23 02:15:43 UTC (rev 809) @@ -0,0 +1,154 @@ +// Ogre overlay scripts +POCore/DebugOverlay +{ + zorder 500 + // Stats block + container BorderPanel(POCore/StatPanel) + { + metrics_mode pixels + vert_align bottom + left 5 + top -107 + width 220 + height 102 + material Core/StatsBlockCenter + border_size 1 1 1 1 + border_material Core/StatsBlockBorder + border_topleft_uv 0.0000 1.0000 0.0039 0.9961 + border_top_uv 0.0039 1.0000 0.9961 0.9961 + border_topright_uv 0.9961 1.0000 1.0000 0.9961 + border_left_uv 0.0000 0.9961 0.0039 0.0039 + border_right_uv 0.9961 0.9961 1.0000 0.0039 + border_bottomleft_uv 0.0000 0.0039 0.0039 0.0000 + border_bottom_uv 0.0039 0.0039 0.9961 0.0000 + border_bottomright_uv 0.9961 0.0039 1.0000 0.0000 + + container Panel(POCore/BreakPanel) + { + metrics_mode pixels + left 5 + top 22 + width 210 + height 1 + material Core/StatsBreak + } + + element TextArea(POCore/CurrFps) + { + metrics_mode pixels + left 5 + top 5 + width 90 + height 30 + font_name BlueHighway + char_height 19 + caption Current FPS: + colour_top 1 1 0.7 + colour_bottom 1 1 0.7 + } + element TextArea(POCore/AverageFps) + { + metrics_mode pixels + left 5 + top 25 + width 90 + height 30 + font_name BlueHighway + char_height 16 + caption AVERAGE FPS: + colour_top 0.5 0.7 0.5 + colour_bottom 0.3 0.5 0.3 + } + element TextArea(POCore/WorstFps) + { + metrics_mode pixels + left 5 + top 40 + width 90 + height 30 + font_name BlueHighway + char_height 16 + caption WORST FPS: + colour_top 0.5 0.7 0.5 + colour_bottom 0.3 0.5 0.3 + } + element TextArea(POCore/BestFps) + { + metrics_mode pixels + left 5 + top 55 + width 90 + height 30 + font_name BlueHighway + char_height 16 + caption BEST FPS: + colour_top 0.5 0.7 0.5 + colour_bottom 0.3 0.5 0.3 + } + element TextArea(POCore/NumTris) + { + metrics_mode pixels + left 5 + top 70 + width 90 + height 30 + font_name BlueHighway + char_height 16 + caption Triangle Count: + colour_top 0.5 0.7 0.5 + colour_bottom 0.3 0.5 0.3 + } + element TextArea(POCore/NumBatches) + { + metrics_mode pixels + left 5 + top 85 + width 90 + height 30 + font_name BlueHighway + char_height 16 + caption Batch Count: + colour_top 0.5 0.7 0.5 + colour_bottom 0.3 0.5 0.3 + } + element TextArea(POCore/DebugText) + { + metrics_mode pixels + left 230 + top 70 + width 200 + height 30 + font_name BlueHighway + char_height 16 + colour_top 0.5 0.7 0.5 + colour_bottom 0.3 0.5 0.3 + } + + } + container Panel(POCore/LogoPanel) + { + metrics_mode pixels + horz_align right + vert_align bottom + top -75 + left -165 + width 150 + height 75 + material Core/OgreText + } +} + +// A silly example of how you would do a 3D cockpit +//Examples/KnotCockpit +//{ +// zorder 100 +// entity knot.mesh(hudKnot) +// { +// position 0 0 -50 +// rotation 0 0 0 0 +// } +// +//} + + + Added: trunk/python-ogre/demos/media/overlays/PythonOgreDebugPanel.material =================================================================== --- trunk/python-ogre/demos/media/overlays/PythonOgreDebugPanel.material (rev 0) +++ trunk/python-ogre/demos/media/overlays/PythonOgreDebugPanel.material 2008-11-23 02:15:43 UTC (rev 809) @@ -0,0 +1,52 @@ +material POCore/StatsBlockCenter +{ + technique + { + pass + { + lighting off + scene_blend alpha_blend + depth_check off + + texture_unit + { +// texture New_Ogre_Border_Center.png + texture popanel.png + } + } + } +} +material POCore/OgreText +{ + technique + { + pass + { + lighting off + scene_blend alpha_blend + depth_check off + + texture_unit + { + texture pythonogretext.png + } + } + } +} +material POCore/Panel +{ + technique + { + pass + { + lighting off + scene_blend alpha_blend + depth_check off + + texture_unit + { + texture popanel.png + } + } + } +} \ No newline at end of file Added: trunk/python-ogre/demos/media/overlays/PythonOgreDebugPanel.overlay =================================================================== --- trunk/python-ogre/demos/media/overlays/PythonOgreDebugPanel.overlay (rev 0) +++ trunk/python-ogre/demos/media/overlays/PythonOgreDebugPanel.overlay 2008-11-23 02:15:43 UTC (rev 809) @@ -0,0 +1,119 @@ +// Ogre overlay scripts +POCore/DebugOverlay +{ + zorder 500 + // Stats block + container BorderPanel(POCore/StatPanel1) + { + metrics_mode pixels + vert_align bottom + left 3 + top -92 + width 637 + height 90 + material POCore/StatsBlockCenter + + + element TextArea(POCore/CurrFps) + { + metrics_mode pixels + left 500 + top 15 + width 140 + height 20 + font_name BlueHighway + char_height 16 + caption FPS: + colour_top 0.4 0.4 0.2 + //1 1 0.7 + colour_bottom 0 0 0.0 + //1 1 0.7 + } + element TextArea(POCore/AverageFps) + { + metrics_mode pixels + left 500 + top 30 + width 90 + height 20 + font_name BlueHighway + char_height 16 + caption AVG FPS: + colour_top 0.4 0.4 0.2 + //0.5 0.7 0.5 + colour_bottom 0 0 0.0 + //0.3 0.5 0.3 + } + element TextArea(POCore/NumTris) + { + metrics_mode pixels + left 500 + top 45 + width 90 + height 20 + font_name BlueHighway + char_height 16 + caption Triangles: + colour_top 0.4 0.4 0.2 + //0.5 0.7 0.5 + colour_bottom 0 0 0.0 + //0.3 0.5 0.3 + } + element TextArea(POCore/NumBatches) + { + metrics_mode pixels + left 500 + top 60 + width 90 + height 20 + font_name BlueHighway + char_height 16 + caption Batches: + colour_top 0.4 0.4 0.2 + //0.5 0.7 0.5 + colour_bottom 0 0 0.0 + //0.3 0.5 0.3 + } + element TextArea(POCore/DebugText) + { + metrics_mode pixels + left 105 + top 73 + width 400 + height 30 + font_name BlueHighway + char_height 14 + colour_top 1 1 0.7 + // 0.5 0.7 0.5 + colour_bottom 1 1 0.7 + //0.3 0.5 0.3 + } + + } +// container Panel(POCore/LogoPanel) +// { +// metrics_mode pixels +// horz_align right +// vert_align bottom +// top -95 +// left -165 +// width 160 +// height 93 +// material POCore/OgreText +// } +//} + +// A silly example of how you would do a 3D cockpit +//Examples/KnotCockpit +//{ +// zorder 100 +// entity knot.mesh(hudKnot) +// { +// position 0 0 -50 +// rotation 0 0 0 0 +// } +// +//} + + + Added: trunk/python-ogre/demos/media/overlays/panel.png =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/media/overlays/panel.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/media/overlays/popanel.png =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/media/overlays/popanel.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/python-ogre/demos/media/overlays/pythonogretext.png =================================================================== (Binary files differ) Property changes on: trunk/python-ogre/demos/media/overlays/pythonogretext.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/python-ogre/environment.py =================================================================== --- trunk/python-ogre/environment.py 2008-11-21 04:45:57 UTC (rev 808) +++ trunk/python-ogre/environment.py 2008-11-23 02:15:43 UTC (rev 809) @@ -44,10 +44,10 @@ ## ## set this to True if you compiled Ogre with Threads enabled ## -if isWindows(): - _USE_THREADS = True -else: - _USE_THREADS = False +if isWindows(): + _USE_THREADS = True +else: + _USE_THREADS = False PythonOgreMajorVersion = "1" @@ -643,7 +643,7 @@ base = "ogre-v1-6-0" buildCmds = [ [0, tar + " jxf " + os.path.join(downloadPath,base)+".tar.bz2 --overwrite",os.getcwd() ], - [0, "patch -s -N -i ./python-ogre/patch/ogre_1.6.0.patch -p0 ", os.getcwd()], + [0, "patch -s -N -i ./python-ogre/patch/ogre_1.6.0.patch -p0 ", os.getcwd()], [0, "sed --in-place -s 's|#define OGRE_THREAD_SUPPORT 1|#define OGRE_THREAD_SUPPORT 0|' OgreConfig.h",os.path.join(os.getcwd(),"ogre","OgreMain", "include")], [0, "aclocal", os.path.join(os.getcwd(), 'ogre')], [0, "./bootstrap", os.path.join(os.getcwd(), 'ogre')], @@ -655,7 +655,7 @@ libs.append ( boost_python_index.lib ) lib_dirs=[Config.LOCAL_LIB] include_dirs=[Config.PATH_Boost, Config.PATH_INCLUDE_Ogre] - CCFLAGS = ' -DBOOST_PYTHON_MAX_ARITY=19 -D__PYTHONOGRE_BUILD_CODE ' + CCFLAGS = ' -DBOOST_PYTHON_MAX_ARITY=19 -D__PYTHONOGRE_BUILD_CODE ' source = [ [wget, "http://downloads.sourceforge.net/ogre/"+base+".tar.bz2",downloadPath], @@ -1811,6 +1811,29 @@ ModuleName="hikari" descText = "Use Flash controls within Ogre" descLink = "http://hikari-library.googlecode.com/" + +class mygui: + active = True + pythonModule = True + version="2.2.0RC1" + name='mygui' + parent="ogre/gui" + cflags = "" + include_dirs = [ Config.PATH_Boost, + Config.PATH_INCLUDE_mygui + , Config.PATH_INCLUDE_Ogre + ,Config.PATH_INCLUDE_Ogre_Dependencies + ] + lib_dirs = [Config.PATH_LIB_Boost + ,Config.PATH_LIB_Ogre_OgreMain + ,Config.PATH_LIB_mygui + + ] + CheckIncludes=[] + libs=[ boost.lib, 'OgreMain', 'MyGUI' ] ##, 'hikari' ] + ModuleName="mygui" + descText = "MyGUI Interface System" + descLink = "http://sourceforge.net/projects/my-gui/" ############################################################################################ @@ -1853,6 +1876,7 @@ , 'ogrepcz' : ogrepcz , 'hydrax' : hydrax , 'hikari' : hikari + , 'mygui' : mygui } # Modified: trunk/python-ogre/packages_2.5/ogre/renderer/OGRE/sf_OIS.py =================================================================== --- trunk/python-ogre/packages_2.5/ogre/renderer/OGRE/sf_OIS.py 2008-11-21 04:45:57 UTC (rev 808) +++ trunk/python-ogre/packages_2.5/ogre/renderer/OGRE/sf_OIS.py 2008-11-23 02:15:43 UTC (rev 809) @@ -443,9 +443,9 @@ def showDebugOverlay(self, show): """Turns the debug overlay (frame statistics) on or off.""" - overlay = ogre.OverlayManager.getSingleton().getByName('Core/DebugOverlay') + overlay = ogre.OverlayManager.getSingleton().getByName('POCore/DebugOverlay') if overlay is None: - raise ogre.Exception(111, "Could not find overlay Core/DebugOverlay", "SampleFramework.py") + raise ogre.Exception(111, "Could not find overlay POCore/DebugOverlay", "SampleFramework.py") if show: overlay.show() else: @@ -566,14 +566,16 @@ def _updateStatistics(self): statistics = self.renderWindow - self._setGuiCaption('Core/AverageFps', 'Average FPS: %f' % statistics.getAverageFPS()) - self._setGuiCaption('Core/CurrFps', 'Current FPS: %f' % statistics.getLastFPS()) - self._setGuiCaption('Core/BestFps', - 'Best FPS: %f %d ms' % (statistics.getBestFPS(), statistics.getBestFrameTime())) - self._setGuiCaption('Core/WorstFps', - 'Worst FPS: %f %d ms' % (statistics.getWorstFPS(), statistics.getWorstFrameTime())) - self._setGuiCaption('Core/NumTris', 'Triangle Count: %d' % statistics.getTriangleCount()) - self._setGuiCaption('Core/DebugText', Application.debugText) + self._setGuiCaption('POCore/AverageFps', 'Avg FPS: %u' % statistics.getAverageFPS()) + self._setGuiCaption('POCore/CurrFps', 'FPS: %u' % statistics.getLastFPS()) +# self._setGuiCaption('POCore/BestFps', +# 'Best FPS: %f %d ms' % (statistics.getBestFPS(), statistics.getBestFrameTime())) +# self._setGuiCaption('POCore/WorstFps', +# 'Worst FPS: %f %d ms' % (statistics.getWorstFPS(), statistics.getWorstFrameTime())) + self._setGuiCaption('POCore/NumTris', 'Trianges: %u' % statistics.getTriangleCount()) + self._setGuiCaption('POCore/NumBatches', 'Batches: %u' % statistics.batchCount) + + self._setGuiCaption('POCore/DebugText', Application.debugText) def _setGuiCaption(self, elementName, text): element = ogre.OverlayManager.getSingleton().getOverlayElement(elementName, False) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2008-11-26 04:04:18
|
Revision: 818 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=818&view=rev Author: andy_miller Date: 2008-11-26 04:04:08 +0000 (Wed, 26 Nov 2008) Log Message: ----------- Fix to is64 function as it only works on Linux (uses unam) and broken Windows operations Change to document string when aliasing functions to make it a little easier Updates to Bullet demos Removed tab characters from BuildModule (only want spaces..) Modified Paths: -------------- trunk/python-ogre/BuildModule.py trunk/python-ogre/code_generators/common_utils/__init__.py trunk/python-ogre/code_generators/physx/hand_made_wrappers.py trunk/python-ogre/demos/hydrax/Demo_Hydrax01.py trunk/python-ogre/demos/plugins.cfg trunk/python-ogre/environment.py Added Paths: ----------- trunk/python-ogre/demos/bullet/test01.py trunk/python-ogre/demos/bullet/test03.py Removed Paths: ------------- trunk/python-ogre/demos/bullet/test01.py Modified: trunk/python-ogre/BuildModule.py =================================================================== --- trunk/python-ogre/BuildModule.py 2008-11-24 00:08:28 UTC (rev 817) +++ trunk/python-ogre/BuildModule.py 2008-11-26 04:04:08 UTC (rev 818) @@ -97,7 +97,7 @@ env["LDFLAGS"]+="-Wl,-rpath='$$ORIGIN/../../lib' -Wl,-rpath='$$ORIGIN' -Wl,-z,origin" env["PYTHONPATH"]=PREFIX+"/lib/python"+environment.PythonVersionString+"/site-packages" if environment.is64(): - env["PYTHONPATH"]=PREFIX+"/lib64/python"+environment.PythonVersionString+"/site-packages" + env["PYTHONPATH"]=PREFIX+"/lib64/python"+environment.PythonVersionString+"/site-packages" env["ZZIPLIB_LIBS"]="-lzzip" env["PATH"]=PREFIX+"/bin:" + PATH @@ -264,10 +264,10 @@ exit("Was not able to copy the debian %s." % file) ret = spawnTask( "sed --in-place "+filepath+' ' + \ - ' -e"s|%%SHORTDATE%%|`date +%Y%m%d`|" ' + \ - ' -e"s|%%LONGDATE%%|`date +\'%a, %d %b %Y %H:%m:%S %z\'`|" ' + \ - ' -e"s|%%VERSION%%|'+module.source_version+'|"' - , srcdir) + ' -e"s|%%SHORTDATE%%|`date +%Y%m%d`|" ' + \ + ' -e"s|%%LONGDATE%%|`date +\'%a, %d %b %Y %H:%m:%S %z\'`|" ' + \ + ' -e"s|%%VERSION%%|'+module.source_version+'|"' + , srcdir) if ret != 0: exit("Was not able to update the debian %s." % file) @@ -280,7 +280,7 @@ ' -e "s|%%SHORTDATE%%|`date +%Y%m%d`|" ' + \ ' -e "s|%%LONGDATE%%|`date +\'%a, %d %b %Y %H:%m:%S %z\'`|" ' + \ ' -e "s^%%BUILDDEPS%%^`cat '+os.path.join(debiandir, "control")+' | grep Build-Depends:`^"' + \ - ' -e "s|%%VERSION%%|'+module.source_version+'|g"' + ' -e "s|%%VERSION%%|'+module.source_version+'|g"' , buildbase) # Do some cleanup Modified: trunk/python-ogre/code_generators/common_utils/__init__.py =================================================================== --- trunk/python-ogre/code_generators/common_utils/__init__.py 2008-11-24 00:08:28 UTC (rev 817) +++ trunk/python-ogre/code_generators/common_utils/__init__.py 2008-11-26 04:04:08 UTC (rev 818) @@ -335,6 +335,7 @@ aliases[keyname] = aliases[keyname] + 1 else: aliases[keyname] = 1 + desc = desc + "\\\nWARNING FUNCTION NAME CHANGE - from "+fun.name + " -- " + fun.decl_string +" to " + new_alias + " \\n" print "INFO: Adjusting Alias as multiple overlapping functions:", new_alias print "AUTOFT OK: Tranformed ", fun, "(",new_alias,")" Modified: trunk/python-ogre/code_generators/physx/hand_made_wrappers.py =================================================================== --- trunk/python-ogre/code_generators/physx/hand_made_wrappers.py 2008-11-24 00:08:28 UTC (rev 817) +++ trunk/python-ogre/code_generators/physx/hand_made_wrappers.py 2008-11-26 04:04:08 UTC (rev 818) @@ -240,4 +240,28 @@ # rt = mb.class_( 'NxImplicitScreenMesh' ) # rt.add_wrapper_code(WRAPPER_WRAPPER_DEF_NxImplicitScreenMesh) - \ No newline at end of file +# # virtual ::NxActiveTransform * getActiveTransforms( ::NxU32 & nbTransformsOut ) { +# # namespace bpl = boost::python; +# # if( bpl::override func_getActiveTransforms = this->get_override( "getActiveTransforms" ) ){ +# # bpl::object py_result = bpl::call<bpl::object>( func_getActiveTransforms.ptr(), nbTransformsOut ); +# # nbTransformsOut = boost::python::extract< unsigned int >( pyplus_conv::get_out_argument( py_result, "nbTransformsOut" ) ); +# # return bpl::extract< ::NxActiveTransform * >( pyplus_conv::get_out_argument( py_result, 0 ) ); +# # } +# # else{ +# # return NxScene::getActiveTransforms( nbTransformsOut ); +# # } +# # } +# # +# # static boost::python::tuple default_getActiveTransforms( ::NxScene & inst, unsigned int nbTransformsOut ){ +# # NxActiveTransform * result; +# # if( dynamic_cast< NxScene_wrapper * >( boost::addressof( inst ) ) ){ +# # result = inst.::NxScene::getActiveTransforms(nbTransformsOut); +# # } +# # else{ +# # result = inst.getActiveTransforms(nbTransformsOut); +# # } +# # typedef bp::return_value_policy< bp::reference_existing_object > call_policies_t; +# # return bp::make_tuple( pyplusplus::call_policies::make_object< call_policies_t, ::NxActiveTransform * >( result ) +# # , nbTransformsOut ); +# # } + \ No newline at end of file Deleted: trunk/python-ogre/demos/bullet/test01.py =================================================================== --- trunk/python-ogre/demos/bullet/test01.py 2008-11-24 00:08:28 UTC (rev 817) +++ trunk/python-ogre/demos/bullet/test01.py 2008-11-26 04:04:08 UTC (rev 818) @@ -1,78 +0,0 @@ -import sys -sys.path.insert(0,'..') -import PythonOgreConfig - -import ogre.renderer.OGRE as ogre -import ogre.physics.bullet as bullet -t = bullet.btTransform() -ms = bullet.btDefaultMotionState (t) -s = bullet.btBoxShape(bullet.btVector3(10,10,10)) -body = bullet.btRigidBody(1, ms, s) -print body - - -collisionConfiguration = bullet.btDefaultCollisionConfiguration() -dispatcher = bullet.btCollisionDispatcher (collisionConfiguration) - -worldAabbMin = bullet.btVector3(-1000,-1000,-1000) -worldAabbMax = bullet.btVector3(1000,1000,1000) -maxProxies = 32766 - -broadphase = bullet.btAxisSweep3(worldAabbMin, worldAabbMax, maxProxies) - -solver = bullet.btSequentialImpulseConstraintSolver() - -world = bullet.btDiscreteDynamicsWorld(dispatcher, broadphase , solver, collisionConfiguration) -world.getDispatchInfo().m_enableSPU = True -world.setGravity(bullet.btVector3(0,-10,0)) - -print world -print dir(world) -print solver -print broadphase -print dispatcher -print collisionConfiguration -for x in range (30): - world.stepSimulation( x * 1/30) - -world.stepSimulation(0) -world.stepSimulation(-0.333) - - -class OgreMotionState(bullet.btMotionState): - def __init__(self, initalPosition): - bullet.btMotionState.__init__(self) - self.Pos=initalPosition - self.Position=ogre.Vector3() - self.Quaternion=ogre.Quaternion() - - def getWorldTransform(self, WorldTrans): - print WorldTrans - print WorldTrans.Rotation.x(),WorldTrans.Rotation.y(),WorldTrans.Rotation.z() - print self.Pos.getOrigin() - WorldTrans.setOrigin(self.Pos.getOrigin()) - WorldTrans.setBasis(self.Pos.getBasis()) - - print WorldTrans.Rotation.x(),WorldTrans.Rotation.y(),WorldTrans.Rotation.z() - print WorldTrans - print "Pos", self.Pos - t=self.Pos - print "T", t - t.setOrigin(WorldTrans.getOrigin()) - print "T1", t - - - - - def setWorldTransform(WorldTrans): - print "setWorldTrans", WorldTrans - self.Position=ogre.Vector3(WorldTrans.getOrigin().x(),WorldTrans.getOrigin().y(),WorldTrans.getOrigin().z()) - self.Quaternion=ogre.Quaternion(WorldTrans.getRoation().w(),WorldTrans.getRoation().x(),WorldTrans.getRoation().y(),WorldTrans.getRoation().z()) - print "setWorldTrans", WorldTrans - -shape=bullet.btCapsuleShape(10, 20) -print "Creating motionState" -motionState=OgreMotionState(bullet.btTransform(bullet.btMatrix3x3(1.0,1.0,1.0,-1.0,-1.0,-1.0,2,-2,-1))) -Object=bullet.btRigidBody(10.0, motionState, shape) # ...this should work in my eyes - -#Object=bullet.btRigidBody(bullet.btRigidBodyConstructionInfo()) ...well obviously not in bullet 2.6.9 \ No newline at end of file Added: trunk/python-ogre/demos/bullet/test01.py =================================================================== --- trunk/python-ogre/demos/bullet/test01.py (rev 0) +++ trunk/python-ogre/demos/bullet/test01.py 2008-11-26 04:04:08 UTC (rev 818) @@ -0,0 +1,96 @@ +# +# Updated to calculate a falling sphere: +# http://www.bulletphysics.com/mediawiki-1.5.8/index.php?title=Hello_World +# + +import sys +sys.path.insert(0,'..') +import PythonOgreConfig + +import ogre.renderer.OGRE as ogre +import ogre.physics.bullet as bullet +t = bullet.btTransform() +ms = bullet.btDefaultMotionState (t) +s = bullet.btBoxShape(bullet.btVector3(10,10,10)) +body = bullet.btRigidBody(1, ms, s) +print body + + +collisionConfiguration = bullet.btDefaultCollisionConfiguration() +dispatcher = bullet.btCollisionDispatcher (collisionConfiguration) + +worldAabbMin = bullet.btVector3(-1000,-1000,-1000) +worldAabbMax = bullet.btVector3(1000,1000,1000) +maxProxies = 32766 + +broadphase = bullet.btAxisSweep3(worldAabbMin, worldAabbMax, maxProxies) + +solver = bullet.btSequentialImpulseConstraintSolver() + +world = bullet.btDiscreteDynamicsWorld(dispatcher, broadphase , solver, collisionConfiguration) +world.getDispatchInfo().m_enableSPU = True +world.setGravity(bullet.btVector3(0,-10,0)) + +print world +print dir(world) +print solver +print broadphase +print dispatcher +print collisionConfiguration +for x in range (30): + world.stepSimulation( x * 1/30) + +world.stepSimulation(0) +world.stepSimulation(-0.333) + + +class OgreMotionState(bullet.btMotionState): + def __init__(self, initalPosition): + bullet.btMotionState.__init__(self) + self.Pos=initalPosition + self.Position=ogre.Vector3() + self.Quaternion=ogre.Quaternion() + + def getWorldTransform(self, WorldTrans): + print WorldTrans + print WorldTrans.Rotation.x(),WorldTrans.Rotation.y(),WorldTrans.Rotation.z() + print self.Pos.getOrigin() + WorldTrans.setOrigin(self.Pos.getOrigin()) + WorldTrans.setBasis(self.Pos.getBasis()) + + print WorldTrans.Rotation.x(),WorldTrans.Rotation.y(),WorldTrans.Rotation.z() + print WorldTrans + print "Pos", self.Pos + t=self.Pos + print "T", t + t.setOrigin(WorldTrans.getOrigin()) + print "T1", t + + def setWorldTransform(self, WorldTrans): + #print "setWorldTrans", WorldTrans + self.Position=ogre.Vector3(WorldTrans.getOrigin().x(),WorldTrans.getOrigin().y(),WorldTrans.getOrigin().z()) + self.Quaternion=ogre.Quaternion(WorldTrans.getRotation().w(),WorldTrans.getRotation().x(),WorldTrans.getRotation().y(),WorldTrans.getRotation().z()) + #print "setWorldTrans", WorldTrans + + +mass = 10 +fallInertia = bullet.btVector3(0, 0, 0) +shape=bullet.btSphereShape(1) +shape.calculateLocalInertia(mass, fallInertia) +print "Creating motionState" +motionState=OgreMotionState(bullet.btTransform(bullet.btQuaternion(0, 0, 0, 1), bullet.btVector3(0, 50, 0))) +construct = bullet.btRigidBody.btRigidBodyConstructionInfo(mass, motionState, shape, fallInertia) +Object=bullet.btRigidBody(construct) # ...this should work in my eyes +world.addRigidBody(Object) + +for x in range (90): + world.stepSimulation( x * 1/30) + + pos = Object.getMotionState().Position + print x, "height: " + str(pos.y) + +# note we need to delete the world before the Object as there are issues with the destructor on Objects causing +# virtual functions being called errors +del world + + Copied: trunk/python-ogre/demos/bullet/test03.py (from rev 817, trunk/python-ogre/demos/bullet/test01.py) =================================================================== --- trunk/python-ogre/demos/bullet/test03.py (rev 0) +++ trunk/python-ogre/demos/bullet/test03.py 2008-11-26 04:04:08 UTC (rev 818) @@ -0,0 +1,78 @@ +import sys +sys.path.insert(0,'..') +import PythonOgreConfig + +import ogre.renderer.OGRE as ogre +import ogre.physics.bullet as bullet +t = bullet.btTransform() +ms = bullet.btDefaultMotionState (t) +s = bullet.btBoxShape(bullet.btVector3(10,10,10)) +body = bullet.btRigidBody(1, ms, s) +print body + + +collisionConfiguration = bullet.btDefaultCollisionConfiguration() +dispatcher = bullet.btCollisionDispatcher (collisionConfiguration) + +worldAabbMin = bullet.btVector3(-1000,-1000,-1000) +worldAabbMax = bullet.btVector3(1000,1000,1000) +maxProxies = 32766 + +broadphase = bullet.btAxisSweep3(worldAabbMin, worldAabbMax, maxProxies) + +solver = bullet.btSequentialImpulseConstraintSolver() + +world = bullet.btDiscreteDynamicsWorld(dispatcher, broadphase , solver, collisionConfiguration) +world.getDispatchInfo().m_enableSPU = True +world.setGravity(bullet.btVector3(0,-10,0)) + +print world +print dir(world) +print solver +print broadphase +print dispatcher +print collisionConfiguration +for x in range (30): + world.stepSimulation( x * 1/30) + +world.stepSimulation(0) +world.stepSimulation(-0.333) + + +class OgreMotionState(bullet.btMotionState): + def __init__(self, initalPosition): + bullet.btMotionState.__init__(self) + self.Pos=initalPosition + self.Position=ogre.Vector3() + self.Quaternion=ogre.Quaternion() + + def getWorldTransform(self, WorldTrans): + print WorldTrans + print WorldTrans.Rotation.x(),WorldTrans.Rotation.y(),WorldTrans.Rotation.z() + print self.Pos.getOrigin() + WorldTrans.setOrigin(self.Pos.getOrigin()) + WorldTrans.setBasis(self.Pos.getBasis()) + + print WorldTrans.Rotation.x(),WorldTrans.Rotation.y(),WorldTrans.Rotation.z() + print WorldTrans + print "Pos", self.Pos + t=self.Pos + print "T", t + t.setOrigin(WorldTrans.getOrigin()) + print "T1", t + + + + + def setWorldTransform(WorldTrans): + print "setWorldTrans", WorldTrans + self.Position=ogre.Vector3(WorldTrans.getOrigin().x(),WorldTrans.getOrigin().y(),WorldTrans.getOrigin().z()) + self.Quaternion=ogre.Quaternion(WorldTrans.getRoation().w(),WorldTrans.getRoation().x(),WorldTrans.getRoation().y(),WorldTrans.getRoation().z()) + print "setWorldTrans", WorldTrans + +shape=bullet.btCapsuleShape(10, 20) +print "Creating motionState" +motionState=OgreMotionState(bullet.btTransform(bullet.btMatrix3x3(1.0,1.0,1.0,-1.0,-1.0,-1.0,2,-2,-1))) +Object=bullet.btRigidBody(10.0, motionState, shape) # ...this should work in my eyes + +#Object=bullet.btRigidBody(bullet.btRigidBodyConstructionInfo()) ...well obviously not in bullet 2.6.9 \ No newline at end of file Modified: trunk/python-ogre/demos/hydrax/Demo_Hydrax01.py =================================================================== --- trunk/python-ogre/demos/hydrax/Demo_Hydrax01.py 2008-11-24 00:08:28 UTC (rev 817) +++ trunk/python-ogre/demos/hydrax/Demo_Hydrax01.py 2008-11-26 04:04:08 UTC (rev 818) @@ -179,14 +179,14 @@ # Create our projected grid module self.noise= Hydrax.Perlin() ## Default options (8, 0.085, 0.49, 1.4, 1.27f) self.Module = Hydrax.ProjectedGrid(# Hydrax parent pointer - self.hydrax, - # Noise module - self.noise, - # Base plane - ogre.Plane(ogre.Vector3(0,1,0), ogre.Vector3(0,0,0)), - Hydrax.MaterialManager.NM_VERTEX, - # Projected grid options (Can be updated each frame . setOptions(...)) - Hydrax.ProjectedGrid.Options(264 )) + self.hydrax, + # Noise module + self.noise, + # Base plane + ogre.Plane(ogre.Vector3(0,1,0), ogre.Vector3(0,0,0)), + Hydrax.MaterialManager.NM_VERTEX, + # Projected grid options (Can be updated each frame . setOptions(...)) + Hydrax.ProjectedGrid.Options(264 )) # Set our module self.hydrax.setModule(self.Module) Modified: trunk/python-ogre/demos/plugins.cfg =================================================================== --- trunk/python-ogre/demos/plugins.cfg 2008-11-24 00:08:28 UTC (rev 817) +++ trunk/python-ogre/demos/plugins.cfg 2008-11-26 04:04:08 UTC (rev 818) @@ -1,13 +1,19 @@ # Defines plugins to load ## Use this for Windows +# Define plugin folder +PluginFolder=../../plugins +Plugin=RenderSystem_GL.dll +Plugin=RenderSystem_Direct3D9.dll +Plugin=Plugin_ParticleFX.dll +Plugin=Plugin_BSPSceneManager.dll +Plugin=Plugin_OctreeSceneManager.dll +Plugin=Plugin_CgProgramManager.dll - ## ## NOTE use this for MacOS or Linux -PluginFolder=/home/andy/development/root/usr/lib/OGRE -Plugin=RenderSystem_GL -Plugin=Plugin_ParticleFX -Plugin=Plugin_BSPSceneManager -Plugin=Plugin_OctreeSceneManager -Plugin=Plugin_CgProgramManager +# Plugin=RenderSystem_GL +# Plugin=Plugin_ParticleFX +# Plugin=Plugin_BSPSceneManager +# Plugin=Plugin_OctreeSceneManager +# Plugin=Plugin_CgProgramManager Modified: trunk/python-ogre/environment.py =================================================================== --- trunk/python-ogre/environment.py 2008-11-24 00:08:28 UTC (rev 817) +++ trunk/python-ogre/environment.py 2008-11-26 04:04:08 UTC (rev 818) @@ -42,8 +42,9 @@ return False def is64(): - if os.uname()[4] == 'x86_64': - return True + if isLinux(): + if os.uname()[4] == 'x86_64': # TOFIX - can we use sys.platform for this as uname is linux specific.. + return True return False This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2008-11-26 06:01:37
|
Revision: 819 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=819&view=rev Author: andy_miller Date: 2008-11-26 06:01:27 +0000 (Wed, 26 Nov 2008) Log Message: ----------- Fixed sampleframework to look for platform specific plugin files It still defaults to plugins.cfg howeve rwill fall back to something more useful Modified Paths: -------------- trunk/python-ogre/demos/ogreode/resources.cfg trunk/python-ogre/packages_2.5/ogre/renderer/OGRE/sf_OIS.py Added Paths: ----------- trunk/python-ogre/demos/plugins.cfg.linux trunk/python-ogre/demos/plugins.cfg.nt Removed Paths: ------------- trunk/python-ogre/demos/plugins.cfg Modified: trunk/python-ogre/demos/ogreode/resources.cfg =================================================================== --- trunk/python-ogre/demos/ogreode/resources.cfg 2008-11-26 04:04:08 UTC (rev 818) +++ trunk/python-ogre/demos/ogreode/resources.cfg 2008-11-26 06:01:27 UTC (rev 819) @@ -11,7 +11,7 @@ FileSystem=../media/materials/scripts FileSystem=../media/materials/textures #FileSystem=../media/models -#FileSystem=../media/overlays +FileSystem=../media/overlays #FileSystem=../media/particle #FileSystem=../media/gui #Zip=../media/packs/cubemap.zip Deleted: trunk/python-ogre/demos/plugins.cfg =================================================================== --- trunk/python-ogre/demos/plugins.cfg 2008-11-26 04:04:08 UTC (rev 818) +++ trunk/python-ogre/demos/plugins.cfg 2008-11-26 06:01:27 UTC (rev 819) @@ -1,19 +0,0 @@ -# Defines plugins to load - -## Use this for Windows -# Define plugin folder -PluginFolder=../../plugins -Plugin=RenderSystem_GL.dll -Plugin=RenderSystem_Direct3D9.dll -Plugin=Plugin_ParticleFX.dll -Plugin=Plugin_BSPSceneManager.dll -Plugin=Plugin_OctreeSceneManager.dll -Plugin=Plugin_CgProgramManager.dll - -## -## NOTE use this for MacOS or Linux -# Plugin=RenderSystem_GL -# Plugin=Plugin_ParticleFX -# Plugin=Plugin_BSPSceneManager -# Plugin=Plugin_OctreeSceneManager -# Plugin=Plugin_CgProgramManager Added: trunk/python-ogre/demos/plugins.cfg.linux =================================================================== --- trunk/python-ogre/demos/plugins.cfg.linux (rev 0) +++ trunk/python-ogre/demos/plugins.cfg.linux 2008-11-26 06:01:27 UTC (rev 819) @@ -0,0 +1,13 @@ +# Defines plugins to load + +## Use this for Windows + + +## +## NOTE use this for MacOS or Linux +PluginFolder=/home/andy/development/root/usr/lib/OGRE +Plugin=RenderSystem_GL +Plugin=Plugin_ParticleFX +Plugin=Plugin_BSPSceneManager +Plugin=Plugin_OctreeSceneManager +Plugin=Plugin_CgProgramManager Added: trunk/python-ogre/demos/plugins.cfg.nt =================================================================== --- trunk/python-ogre/demos/plugins.cfg.nt (rev 0) +++ trunk/python-ogre/demos/plugins.cfg.nt 2008-11-26 06:01:27 UTC (rev 819) @@ -0,0 +1,13 @@ +# Defines plugins to load + +# Define plugin folder +PluginFolder=../../plugins + +# Define D3D rendering implementation plugin +Plugin=RenderSystem_GL.dll +Plugin=RenderSystem_Direct3D9.dll +Plugin=Plugin_ParticleFX.dll +Plugin=Plugin_BSPSceneManager.dll +Plugin=Plugin_OctreeSceneManager.dll +Plugin=Plugin_CgProgramManager.dll + Modified: trunk/python-ogre/packages_2.5/ogre/renderer/OGRE/sf_OIS.py =================================================================== --- trunk/python-ogre/packages_2.5/ogre/renderer/OGRE/sf_OIS.py 2008-11-26 04:04:08 UTC (rev 818) +++ trunk/python-ogre/packages_2.5/ogre/renderer/OGRE/sf_OIS.py 2008-11-26 06:01:27 UTC (rev 819) @@ -22,13 +22,16 @@ ###import OgreRefApp def getPluginPath(): - """Return the absolute path to a valid plugins.cfg file.""" + """ Return the absolute path to a valid plugins.cfg file. + look in the current directory for plugins.cfg followed by plugins.cfg.nt|linux + If not found look one directory up + """ paths = [os.path.join(os.getcwd(), 'plugins.cfg'), + os.path.join(os.getcwd(), 'plugins.cfg.'+os.name), os.path.join(os.getcwd(), '..','plugins.cfg'), - '/etc/OGRE/plugins.cfg', - os.path.join(os.path.dirname(os.path.abspath(__file__)), - 'plugins.cfg')] + os.path.join(os.getcwd(), '..','plugins.cfg.'+os.name), + ] for path in paths: if os.path.exists(path): return path @@ -37,7 +40,7 @@ "** Warning: Unable to locate a suitable plugins.cfg file.\n" "** Warning: Please check your ogre installation and copy a\n" "** Warning: working plugins.cfg file to the current directory.\n\n") - raise ogre.Exception(0, "can't locate the 'plugins.cfg' file", "") + raise ogre.Exception(0, "can't locate a suitable 'plugins' file", "") # def isUnitTest(): # """Looks for a magic file to determine if we want to do a unittest""" @@ -113,18 +116,18 @@ if not self.root.renderOneFrame(): break - - def _setUp(self): """This sets up the ogre application, and returns false if the user hits "cancel" in the dialog box.""" - if self.unittest: - if os.path.isfile('ogre.cfg'): - self.root = ogre.Root(getPluginPath()) - else: - self.root = ogre.Root(getPluginPath(), '../ogre.cfg') + + pluginFile = getPluginPath() ## option here to switch to manually loading file if it doesn't exist + if self.unittest: + if os.path.isfile('ogre.cfg'): + self.root = ogre.Root( pluginFile ) + else: + self.root = ogre.Root( pluginFile, '../ogre.cfg') else: - self.root = ogre.Root(getPluginPath()) + self.root = ogre.Root( pluginFile ) self.root.setFrameSmoothingPeriod (5.0) self._setUpResources() @@ -438,14 +441,17 @@ # return True def frameEnded(self, frameEvent): - self._updateStatistics() + if self.statisticsOn: + self._updateStatistics() return True def showDebugOverlay(self, show): """Turns the debug overlay (frame statistics) on or off.""" overlay = ogre.OverlayManager.getSingleton().getByName('POCore/DebugOverlay') if overlay is None: - raise ogre.Exception(111, "Could not find overlay POCore/DebugOverlay", "SampleFramework.py") + self.statisticsOn = False + ogre.LogManager.getSingleton().logMessage( "ERROR in sf_OIS.py: Could not find overlay POCore/DebugOverlay" ) + return if show: overlay.show() else: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2008-11-27 02:09:15
|
Revision: 820 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=820&view=rev Author: andy_miller Date: 2008-11-27 02:09:10 +0000 (Thu, 27 Nov 2008) Log Message: ----------- Fix for bullet libraries - working in both windows and linx Improvements to docstrings -- remove excess white space and wrap long lines Windows bullet now using 2.72 (same as Linux) Modified Paths: -------------- trunk/python-ogre/PythonOgreConfig_nt.py trunk/python-ogre/code_generators/bullet/generate_code.py trunk/python-ogre/code_generators/common_utils/extract_documentation.py trunk/python-ogre/code_generators/ogrebulletd/generate_code.py trunk/python-ogre/code_generators/ogrenewt/generate_code.py trunk/python-ogre/code_generators/physx/generate_code.py trunk/python-ogre/environment.py Modified: trunk/python-ogre/PythonOgreConfig_nt.py =================================================================== --- trunk/python-ogre/PythonOgreConfig_nt.py 2008-11-26 06:01:27 UTC (rev 819) +++ trunk/python-ogre/PythonOgreConfig_nt.py 2008-11-27 02:09:10 UTC (rev 820) @@ -72,7 +72,7 @@ PATH_opensteer = os.path.join(BASE_DIR, 'opensteer', 'trunk') PATH_ogrevideoffmpeg = os.path.join(PATH_THIRDPARTY,'ffmpeg') -PATH_Bullet= os.path.join(BASE_DIR, 'bullet-2.70') +PATH_Bullet= os.path.join(BASE_DIR, 'bullet-2.72') PATH_PhysX= "c:/program files/NVIDIA Corporation/NVIDIA Physx SDK/v2.8.1/SDKs" PATH_Theora= os.path.join(PATH_OgreAddons,'videoplugin','TheoraVideo') PATH_ffmpeg= os.path.join(PATH_THIRDPARTY,'extra') Modified: trunk/python-ogre/code_generators/bullet/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/bullet/generate_code.py 2008-11-26 06:01:27 UTC (rev 819) +++ trunk/python-ogre/code_generators/bullet/generate_code.py 2008-11-27 02:09:10 UTC (rev 820) @@ -81,7 +81,6 @@ ,'::btCompoundShape::createAabbTreeFromChildren' ,'::btCollisionAlgorithm::getDispatcherId' ,'::btCollisionAlgorithmConstructionInfo::getDispatcherId' - ,'::btQuantizedBvh::walkRecursiveQuantizedTreeAgainstQuantizedTree' ,'::btCapsuleShape::calculateLocalInertia' ,'::btCapsuleShape::localGetSupportingVertexWithoutMargin' @@ -99,9 +98,9 @@ ,'::btMultiSapBroadphase::createProxy' ,'::btMultiSapBroadphase::quicksort' ,'::btBvhTriangleMeshShape::setOptimizedBvh' # new in 2.70 + ,'::btQuantizedBvh::walkRecursiveQuantizedTreeAgainstQuantizedTree' # 2.72 + ] - - ] for e in excludes: print "excluding function", e global_ns.member_functions(e).exclude() @@ -126,11 +125,6 @@ # ,'btAlignedAllocator<btDbvt::sStkNPS, 16u>' ,'btAlignedAllocator<btMultiSapBroadphase::btBridgeProxy*, 16u>' ,'btAlignedAllocator<btMultiSapBroadphase::btMultiSapProxy*, 16u>' -# ,'btAlignedAllocator<btOdeContactJoint, 16u>' -# ,'btAlignedAllocator<btOdeJoint*, 16u>' -# ,'btAlignedAllocator<btOdeSolverBody, 16u>' -# ,'btAlignedAllocator<btOdeSolverBody*, 16u>' -# ,'btAlignedAllocator<btOdeTypedJoint, 16u>' ,'btAlignedAllocator<unsigned int, 16u>' ,'btAlignedAllocator<unsigned short, 16u>' # ,'btAlignedObjectArray<btDbvt::Node const*>' @@ -150,10 +144,18 @@ # ,'btAlignedObjectArray<btQuantizedBvhNode>' # ,'btAlignedObjectArray<btOptimizedBvhNode>' # ,'btAlignedObjectArray<btCollisionObject*>' - ,'btDbvtBroadphase' + ,'btDbvtBroadphase' ,'btContinuousDynamicsWorld' # ,'btSorLcpSolver' ] +# # if environment.isWindows(): +# # excludes.extend(['btAlignedAllocator<btOdeContactJoint, 16u>' +# # ,'btAlignedAllocator<btOdeJoint*, 16u>' +# # ,'btAlignedAllocator<btOdeSolverBody, 16u>' +# # ,'btAlignedAllocator<btOdeSolverBody*, 16u>' +# # ,'btAlignedAllocator<btOdeTypedJoint, 16u>' +# # ] ) + for e in excludes: print "excluding class", e global_ns.class_(e).exclude() Modified: trunk/python-ogre/code_generators/common_utils/extract_documentation.py =================================================================== --- trunk/python-ogre/code_generators/common_utils/extract_documentation.py 2008-11-26 06:01:27 UTC (rev 819) +++ trunk/python-ogre/code_generators/common_utils/extract_documentation.py 2008-11-27 02:09:10 UTC (rev 820) @@ -96,7 +96,9 @@ return "" ret ="" if doc_lines: - doc_lines = remove_leading_blanks ( doc_lines ) + doc_lines = removeBlankLines ( doc_lines ) + doc_lines = removeLeadingSpace ( doc_lines ) + doc_lines = wrapLines ( doc_lines ) #print "Extracted Doc String for:", declaration, "[", len(doc_lines),"]" ## we need to cope with strings longer than 2048 for MSVC ret = "\\\n".join(doc_lines) @@ -123,42 +125,89 @@ # # self.outfile.write("***============================*****\n" + declaration.decl_string + "\n") # # self.outfile.write( str(len(basedoc)) + " " + str(len(newret)) + "\n" ) # # self.outfile.write( newret ) + return '"' + basedoc + newret.lstrip() + '"' else: return "" -def remove_leading_blanks ( docin ): +#=============================================================== +def removeBlankLines ( docin ): """ - remove any initial lines that are '\n\' - """ - returnlist=[] - - if docin[0].strip() != "\\n": -# # print "** ", docin[0] - return docin # nothing to fix so return the original list.. + remove leading and trailing blank lines + """ + # first remove leading blank lines + x = 0 + while x < len ( docin ) - 1 : + if docin[x].strip() == "\\n" or docin[x].strip() == '': + del docin[x] + x = x - 1 + else: + break + x += 1 - fixed = False - for line in docin: - if not fixed: - if line.strip() != "\\n": - fixed = True - if fixed: - returnlist.append(line) - return returnlist - - -def get_generic_doc(declaration): + # now from the bottom up + x = len ( docin ) -1 + while x >= 0: + if docin[x].strip() == "\\n": + del docin[x] + else: + break + x = len ( docin )- 1 + + return docin + +#=============================================================== +def removeLeadingSpace ( docin ): """ - generate call information about function or method + remove leading spaces/tabs to bring minimize space usage """ - try: - return '"' + "Help on %s\n" % str(declaration) + '"' - except: - pass + import string as string + c = 0 + for x in range ( len (docin) ): + docin[x] = docin[x].expandtabs(3) # replace tab characters with 3 spaces - return '' - - - + remove = -1 # use to track number of leading spaces to remove. -1 indicates first time through + for x in range ( len (docin) ): + c = 0 + for y in range ( len ( docin[x]) ): # now lets count any leading spaces + if docin[x][y] in string.whitespace: + c +=1 + else: + break + if c > 0: # Ok so we found leading space + if remove < 0: # must be first time through + remove = c + else: + if c < remove: # ensure we get the lowest common value + remove = c + else: # Ok we found a line without any leading spaces so it's all off + remove = -1 + break + if remove > 0: # lets do it again and remove a set of leading spaces + for x in range ( len (docin) ): + docin[x] = docin[x][remove:] + return docin + +#=============================================================== +def wrapLines ( docin, maxlen = 100 ): + """ + Break line length to a max while retaining the leading spaces... + """ + import textwrap as textwrap + import string + docout = [] + for line in docin: + prefix=0 + for c in line: + if c in string.whitespace: + prefix += 1 + else: + break + for l in textwrap.wrap( line, maxlen ): + line = ' '*prefix + l.lstrip() + docout.append ( line ) + return docout + + def code(str): """ detect str is code? Modified: trunk/python-ogre/code_generators/ogrebulletd/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/ogrebulletd/generate_code.py 2008-11-26 06:01:27 UTC (rev 819) +++ trunk/python-ogre/code_generators/ogrebulletd/generate_code.py 2008-11-27 02:09:10 UTC (rev 820) @@ -57,16 +57,16 @@ if MAIN_NAMESPACE: main_ns = global_ns.namespace( MAIN_NAMESPACE ) else: - main_ns = global_ns - excludes=['::btSimulationIslandManager' - ] + main_ns = global_ns + excludes=[] + if environment.isLinux(): + excludes.append('::btSimulationIslandManager') for e in excludes: print "excluding class", e - global_ns.class_(e).exclude() - for c in global_ns.classes(): - #if not c.ignore: - print c - sys.exit(-1) + global_ns.class_(e).exclude() +# for c in global_ns.classes(): +# #if not c.ignore: +# print c ############################################################ ## Modified: trunk/python-ogre/code_generators/ogrenewt/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/ogrenewt/generate_code.py 2008-11-26 06:01:27 UTC (rev 819) +++ trunk/python-ogre/code_generators/ogrenewt/generate_code.py 2008-11-27 02:09:10 UTC (rev 820) @@ -6,7 +6,12 @@ # # -import os, sys, time +import os, sys, time, shutil +try: + import psyco + psyco.full() +except ImportError: + pass #add environment to the path sys.path.append( os.path.join( '..', '..' ) ) Modified: trunk/python-ogre/code_generators/physx/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/physx/generate_code.py 2008-11-26 06:01:27 UTC (rev 819) +++ trunk/python-ogre/code_generators/physx/generate_code.py 2008-11-27 02:09:10 UTC (rev 820) @@ -384,6 +384,7 @@ else: defined_symbols = ['LINUX','NX_DISABLE_FLUIDS'] defined_symbols.append( 'VERSION_' + environment.physx.version ) + defined_symbols.append ( '__PYTHONOGRE_BUILD_CODE' ) # # build the core Py++ system from the GCCXML created source Modified: trunk/python-ogre/environment.py =================================================================== --- trunk/python-ogre/environment.py 2008-11-26 06:01:27 UTC (rev 819) +++ trunk/python-ogre/environment.py 2008-11-27 02:09:10 UTC (rev 820) @@ -1327,6 +1327,14 @@ CheckIncludes=[] if isWindows(): libs=[ boost.lib, 'NxCharacter', 'NxCooking', 'PhysXLoader' ] + source = [ + [wget, "http://developer.download.nvidia.com/PhysX/2.8.1/PhysX_2.8.1_SDK_Core.msi", downloadPath] + ] + buildCmds = [ + [0, os.path.join(downloadPath, "PhysX_2.8.1_SDK_Core.msi"),'' ], + [0, 'sed -i s/"#ifdef WIN32"/"#if (defined WIN32) \&\& !(defined __PYTHONOGRE_BUILD_CODE)"/ NxMath.h', + 'c:\\program files\\NVIDIA Corporation\\NVIDIA PhysX SDK\\v2.8.1\\SDKs\\Foundation\\include'] + ] elif isLinux(): libs=[ boost.lib, 'NxCharacter', 'NxCooking', 'PhysXCore', 'PhysXLoader' ] libs.append ( boost_python_index.lib ) @@ -1542,15 +1550,14 @@ base = "bullet-" + version baseDir = os.path.join(os.getcwd(), base) parent = "ogre/physics" - libs=[boost.lib, 'LibBulletCollision', 'LibBulletDynamics','LibLinearMath'] + libs=[boost.lib, 'LibBulletCollision', 'LibBulletDynamics','LibBulletSoftBody','LibBulletMultiThreaded'] if isWindows(): - pass - #libs.append('libbulletMath') + libs.append('libbulletMath') else: - #libs.append('libbulletmath') - libs.append('LibBulletSoftBody') + libs.append('LibLinearMath') +# libs.append('LibBulletSoftBody') #libs.append('libbulletcolladaconverter') - libs.append('LibBulletMultiThreaded') +# libs.append('LibBulletMultiThreaded') libs.append ( boost_python_index.lib ) lib_dirs = [ Config.PATH_LIB_Boost @@ -1595,12 +1602,12 @@ cflags = "" parent = "ogre/physics" libs = [boost.lib, 'OgreMain', - 'LibBulletCollision', 'LibBulletDynamics','LibBulletMultiThreaded','LibBulletSoftBody','LibLinearMath' + 'LibBulletCollision', 'LibBulletDynamics','LibBulletMultiThreaded','LibBulletSoftBody' ] -# if isWindows(): -# libs.append('libbulletmath') -# else: -# libs.append('liblinearmath') + if isLinux(): + libs.append('LibLinearMath') + else: + libs.append('libbulletmath') include_dirs = [Config.PATH_Boost , Config.PATH_INCLUDE_Bullet , os.path.join(Config.PATH_OgreBullet, 'Collisions' ) @@ -1627,9 +1634,13 @@ name='ogrebulletd' cflags = "" parent = "ogre/physics" - libs = [boost.lib, 'OgreMain', - 'LibBulletCollision', 'LibBulletDynamics','LibBulletMultiThreaded','LibBulletSoftBody','LibLinearMath' - ] + + libs=[boost.lib, 'OgreMain', 'LibBulletCollision', 'LibBulletDynamics','LibBulletSoftBody','LibBulletMultiThreaded'] + if isWindows(): + libs.append('libbulletMath') + else: + libs.append('LibLinearMath') + # if isWindows(): # libs.append('libbulletmath') # else: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2008-11-27 05:46:28
|
Revision: 821 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=821&view=rev Author: andy_miller Date: 2008-11-27 05:46:23 +0000 (Thu, 27 Nov 2008) Log Message: ----------- Update ChangeLog Fix Ogre wrapper to exclude Mutex Vars that are not exposed (boost::recursive_mutex) Modified Paths: -------------- trunk/python-ogre/ChangeLog.txt trunk/python-ogre/code_generators/ogre/generate_code.py trunk/python-ogre/demos/ogre/Demo_Bezier.py Modified: trunk/python-ogre/ChangeLog.txt =================================================================== --- trunk/python-ogre/ChangeLog.txt 2008-11-27 02:09:10 UTC (rev 820) +++ trunk/python-ogre/ChangeLog.txt 2008-11-27 05:46:23 UTC (rev 821) @@ -1,3 +1,18 @@ +xxx : Release SVN +================= +Fix: Improved extract_document functions to improve pydoc stings - remove excess leading whitespace and wraps at 100 chars +Fix: PhysX library exposes various NxArray objects that previously were excluded due to compile issues +Fix: Ogre library excludes xxxMutex variables from a few classes (Pass etc) as these are not correctly exposed + +Update: PhysX can now be 'retrieved' and 'built' from windows (BuildModule.py -r -b physx) +Update: Extend the PhysX demo a little +Update: Update Bullet libraries to bullet 2.72 +Update: SampleFramework now uses a 'PythonOgre' overlay +Update: SampleFramework will now look for plugins.cfg or plugins.cfg.<platform name> ('nt' or 'linux') in the current and + parent directories -- this will allow a single demo tree to automatically work on any platform unstead of the + current suitation of having to manually edit the plugins file.. + + November 14 2008 : Release 1.6.0 ================================== Run "python ReportVersion.py" to get the module version information Modified: trunk/python-ogre/code_generators/ogre/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/ogre/generate_code.py 2008-11-27 02:09:10 UTC (rev 820) +++ trunk/python-ogre/code_generators/ogre/generate_code.py 2008-11-27 05:46:23 UTC (rev 821) @@ -304,7 +304,17 @@ cls.decl_string.startswith("::Ogre::CategorisedAllocPolicy") : print "Excluding Allocator class", cls cls.exclude() - + + # turns out there are some variables we didn't catch that are actually classes of boost::recursive_mutex + # which isn't exposed... May be related only to threading ?? + # could limit it to known classes however safer to handle everything +# ec = ['Pass', 'ResourceBackgroundQueue', 'SceneManager'] + for c in main_ns.classes(): + for v in c.variables( allow_empty=True): + if v.name.endswith('Mutex'): + print "Excluding possible Mutex Variable:", v + v.exclude() + ####################b######################################## ## ## And there are things that manually need to be INCLUDED @@ -831,11 +841,11 @@ ## handle a problem hashmap mb.member_function('::Ogre::Mesh::getSubMeshNameMap').exclude() stdex_ns = mb.global_ns.namespace("__gnu_cxx") - stdex_ns.class_('hash_map<std::string, unsigned short, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<unsigned short> >').exclude - for f in mb.member_functions(): - if f.name == 'getChildIterator': - print "LINUX SPECIAL:", f - ###f.exclude() + stdex_ns.class_('hash_map<std::string, unsigned short, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<unsigned short> >').exclude + for f in mb.member_functions(): + if f.name == 'getChildIterator': + print "LINUX SPECIAL:", f + ###f.exclude() #mb.member_function('::Ogre::Node::getChildIterator').exclude() # mb.member_functions('::Ogre::Bone::getChildIterator').exclude() @@ -1081,8 +1091,8 @@ undefine_symbols=[] if environment._USE_THREADS: defined_symbols.append('BOOST_HAS_THREADS') - if environment.isWindows(): - defined_symbols.append('BOOST_HAS_WINTHREADS') + if environment.isWindows(): + defined_symbols.append('BOOST_HAS_WINTHREADS') defined_symbols.append( 'OGRE_VERSION_' + environment.ogre.version ) Modified: trunk/python-ogre/demos/ogre/Demo_Bezier.py =================================================================== --- trunk/python-ogre/demos/ogre/Demo_Bezier.py 2008-11-27 02:09:10 UTC (rev 820) +++ trunk/python-ogre/demos/ogre/Demo_Bezier.py 2008-11-27 05:46:23 UTC (rev 821) @@ -231,6 +231,11 @@ pMat.getTechnique(0).getPass(0).createTextureUnitState( "BumpyMetal.jpg" ) patchEntity.setMaterialName("TextMat") patchPass = pMat.getTechnique(0).getPass(0) + + print patchPass + print dir(patchPass) + print patchPass.msDirtyHashListMutex + sys.exit() ## Attach the entity to the root of the scene This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2008-11-28 12:12:57
|
Revision: 824 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=824&view=rev Author: andy_miller Date: 2008-11-28 12:12:52 +0000 (Fri, 28 Nov 2008) Log Message: ----------- Improvements to ssgLoad function in plib wrapper Modified Paths: -------------- trunk/python-ogre/ChangeLog.txt trunk/python-ogre/code_generators/plib/generate_code.py trunk/python-ogre/code_generators/plib/hand_made_wrappers.py Modified: trunk/python-ogre/ChangeLog.txt =================================================================== --- trunk/python-ogre/ChangeLog.txt 2008-11-28 01:03:31 UTC (rev 823) +++ trunk/python-ogre/ChangeLog.txt 2008-11-28 12:12:52 UTC (rev 824) @@ -11,6 +11,7 @@ Update: SampleFramework will now look for plugins.cfg or plugins.cfg.<platform name> ('nt' or 'linux') in the current and parent directories -- this will allow a single demo tree to automatically work on any platform unstead of the current suitation of having to manually edit the plugins file.. +Update: Plib ssgLoaderOptions (ssgLoad) can now be subclassed and createBranch/createState used as callback functions November 14 2008 : Release 1.6.0 Modified: trunk/python-ogre/code_generators/plib/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/plib/generate_code.py 2008-11-28 01:03:31 UTC (rev 823) +++ trunk/python-ogre/code_generators/plib/generate_code.py 2008-11-28 12:12:52 UTC (rev 824) @@ -7,6 +7,11 @@ import os, sys, time, shutil +try: + import psyco + psyco.full() +except ImportError: + pass #add environment to the path sys.path.append( os.path.join( '..', '..' ) ) @@ -33,15 +38,10 @@ import common_utils.extract_documentation as exdoc import common_utils.var_checker as varchecker import common_utils.ogre_properties as ogre_properties +from common_utils import docit MAIN_NAMESPACE = '' -## small helper function -def docit ( general, i, o ): - docs = "Python-Ogre Modified Function Call\\n" + general +"\\n" - docs = docs + "Input: " + i + "\\n" - docs = docs + "Output: " + o + "\\n\\\n" - return '"'+docs+'"' ############################################################ ## @@ -88,15 +88,17 @@ ,'::ssgIndexArray::get' ,'::ssgSimpleList::raw_get' - ,'::ssgSimpleState::getTextureFilename' # char pointers - ,'::ssgStateSelector::getTextureFilename' - ,'::ssgTexture::getFilename' +# ,'::ssgSimpleState::getTextureFilename' # char pointers +# ,'::ssgStateSelector::getTextureFilename' +# ,'::ssgTexture::getFilename' ,'::ssgVtxArray::getIndex' ## returns a short ,'::ssgLoaderOptions::make_path' ,'::ssgBase::copy_from' ,'::ulLinkedList::unlinkNode' + ,'::ssgLoaderOptions::createBranch' # call back functions taking a char * which we need to hand wrap + ,'::ssgLoaderOptions::createState' ## ,'::ssgBase::getName' @@ -123,8 +125,10 @@ main_ns.free_functions(e).exclude() ## Classes - excludes = ['ssgEntityBinding','ssgHit', - 'ssgSimpleState','ssgSimpleStateArray' + excludes = [ 'ssgEntityBinding' + ,'ssgHit' + ,'ssgSimpleState' + ,'ssgSimpleStateArray' ,'ssgTextureArray' ] for e in excludes: @@ -184,7 +188,27 @@ def ManualFixes ( mb ): global_ns = mb.global_ns - + main_ns = global_ns + funcs = [ + '::ssgBranch::getByName' + ,'::ssgBranch::getByPath' + ,'::ssgEntity::getByName' + ,'::ssgEntity::getByPath' + ] +# for f in funcs: +# main_ns.member_functions(f).call_policies = call_policies.default_call_policies() + + # bug in Py++ where is uses the wrong call policies on a transformed function + for fun in main_ns.member_functions(allow_empty=True): + if fun.transformations: + if declarations.is_pointer(fun.return_type ) : + rawarg = declarations.remove_declarated( + declarations.remove_const( + declarations.remove_reference( + declarations.remove_pointer ( fun.return_type )))) + if not declarations.is_arithmetic (rawarg) and not declarations.is_void(rawarg): + fun.call_policies = call_policies.default_call_policies() + print "Changed call policies on ", fun ############################################################ ## @@ -243,36 +267,6 @@ ## Now for the AUTOMATIC stuff that should just work ## ############################################################################### - - -def AutoExclude( mb ): - """ Automaticaly exclude a range of things that don't convert well from C++ to Python - """ - global_ns = mb.global_ns - main_ns = global_ns - - # vars that are static consts but have their values set in the header file are bad - Remove_Static_Consts ( main_ns ) - - ## Exclude protected and private that are not pure virtual - query = declarations.access_type_matcher_t( 'private' ) \ - & ~declarations.virtuality_type_matcher_t( declarations.VIRTUALITY_TYPES.PURE_VIRTUAL ) - non_public_non_pure_virtual = main_ns.calldefs( query ) - non_public_non_pure_virtual.exclude() - - #Virtual functions that return reference could not be overriden from Python - query = declarations.virtuality_type_matcher_t( declarations.VIRTUALITY_TYPES.VIRTUAL ) \ - & declarations.custom_matcher_t( lambda decl: declarations.is_reference( decl.return_type ) ) - try: - main_ns.calldefs( query ).virtuality = declarations.VIRTUALITY_TYPES.NOT_VIRTUAL - except: - pass - - f=main_ns.free_function("ssgLoadAC") - print "\n\n",f,"\n\n" -# f.include() - print f.exportable, f.ignore - print "\n\n" def AutoInclude( mb ): main_ns = mb.global_ns ## doesn't have it's own namespace.. @@ -308,18 +302,17 @@ global_ns = mb.global_ns main_ns = global_ns - # arguments passed as refs but not const are not liked by boost - #Fix_Ref_Not_Const ( main_ns ) - # Functions that have void pointers in their argument list need to change to unsigned int's - Fix_Void_Ptr_Args ( main_ns ) - # and change functions that return a variety of pointers to instead return unsigned int's - Fix_Pointer_Returns ( main_ns ) +# pointee_types=['unsigned int','int', 'float', '::Ogre::Real', '::Ogre::uchar', '::Ogre::uint8', 'unsigned char', 'char'] +# ignore_names=[]## 'ptr', 'useCountPointer'] # these are function names we know it's cool to exclude + common_utils.Fix_Pointer_Returns ( main_ns ) ##, pointee_types, ignore_names ) # functions that need to have implicit conversions turned off - Fix_Implicit_Conversions ( main_ns) + ImplicitClasses=[] ##'Radian','Degree', 'TimeIndex', 'LiSPSMShadowCameraSetup' ] + common_utils.Fix_Implicit_Conversions ( main_ns, ImplicitClasses ) + if os.name =='nt': Fix_NT( mb ) elif os.name =='posix': @@ -346,132 +339,14 @@ """ -def Fix_Implicit_Conversions ( mb ): - """By default we disable explicit conversion, however sometimes it makes sense - """ - pass def Add_Auto_Conversions( mb ): pass -def Set_Call_Policies( mb ): - """ set the return call policies on classes that this hasn't already been done for. - Set the default policy to deal with pointer/reference return types to reference_existing object - """ - mem_funs = mb.calldefs () - mem_funs.create_with_signature = True #Generated code will not compile on - #MSVC 7.1 if function has throw modifier. - for mem_fun in mem_funs: - if mem_fun.call_policies: - continue - if not mem_fun.call_policies and \ - (declarations.is_reference (mem_fun.return_type) or declarations.is_pointer (mem_fun.return_type) ): - mem_fun.call_policies = call_policies.return_value_policy( - call_policies.reference_existing_object ) - - def Set_Exception(mb): pass - #~ """We don't exclude Exception, because it contains functionality, that could - #~ be useful to user. But, we will provide automatic exception translator - #~ """ - #~ Exception = mb.namespace( 'Ogre' ).class_( 'Exception' ) - #~ Exception.include() - #~ Exception.mem_fun('what').exclude() # declared with empty throw - #~ Exception.mem_fun('getNumber').exclude() # declared with empty throw - #~ Exception.translate_exception_to_string( 'PyExc_RuntimeError', 'exc.getFullDescription().c_str()' ) - -def _ReturnUnsignedInt( type_ ): - """helper to return an UnsignedInt call for tranformation functions - """ - return declarations.cpptypes.unsigned_int_t() - -def Fix_Void_Ptr_Args ( mb ): - """ we modify functions that take void *'s in their argument list to instead take - unsigned ints, which allows us to use CTypes buffers - """ - for fun in mb.member_functions(): - arg_position = 0 - for arg in fun.arguments: - if declarations.type_traits.is_void_pointer(arg.type) or arg.type.decl_string == "void const *": - fun.add_transformation( ft.modify_type(arg_position,_ReturnUnsignedInt ), alias=fun.name ) - fun.documentation = docit ("Modified Input Argument to work with CTypes", - "Argument "+arg.name+ "(pos:" + str(arg_position)\ - +") takes a CTypes.adddressof(xx)", "...") - print "Fixed Void Ptr", fun, arg_position - break - arg_position +=1 - - ## lets go and look for stuff that might be a problem - pointee_types=['unsigned int',' int ', ' float ', ' Real ', 'uchar', 'uint8', - 'unsigned char'] - - function_names=[] - for fun in mb.member_functions(): - if fun.documentation or fun.ignore: continue ## means it's been tweaked somewhere else - for n in function_names: - if n in fun.name: - print "CHECK :", fun - break - arg_position = 0 - for arg in fun.arguments: - if declarations.is_pointer(arg.type): ## and "const" not in arg.type.decl_string: - for i in pointee_types: - if i in arg.type.decl_string: - print '"',arg.type.decl_string, '"' - print "CHECK ", fun, str(arg_position) - fun.documentation=docit("SUSPECT - MAYBE BROKEN", "....", "...") - break - arg_position +=1 - -## NEED To do the same for constructors - for fun in mb.constructors(): - arg_position = 0 - for arg in fun.arguments: - if declarations.is_pointer(arg.type): ## and "const" not in arg.type.decl_string: - for i in pointee_types: - if i in arg.type.decl_string: - print '"',arg.type.decl_string, '"' - print "Excluding: ", fun - fun.exclude() - break - arg_position +=1 - -def Fix_Pointer_Returns ( mb ): - """ Change out functions that return a variety of pointer to base types and instead - have them return the address the pointer is pointing to (the pointer value) - This allow us to use CTypes to handle in memory buffers from Python - - Also - if documentation has been set then ignore the class/function as it means it's been tweaked else where - """ - pointee_types=['unsigned int','int', 'float', 'unsigned char'] - known_names=[] # these are function names we know it's cool to exclude - for fun in mb.member_functions(): - if declarations.is_pointer (fun.return_type) and not fun.documentation: - for i in pointee_types: - if fun.return_type.decl_string.startswith ( i ) and not fun.documentation: - if not fun.name in known_names: - print "Excluding (function):", fun, "as it returns (pointer)", i - fun.exclude() - for fun in mb.member_operators(allow_empty=True): - if declarations.is_pointer (fun.return_type) and not fun.documentation: - for i in pointee_types: - if fun.return_type.decl_string.startswith ( i ) and not fun.documentation: - print "Excluding (operator):", fun - fun.exclude() - - - -def query_containers_with_ptrs(decl): - if not isinstance( decl, declarations.class_types ): - return False - if not decl.indexing_suite: - return False - return declarations.is_pointer( decl.indexing_suite.element_type ) - - def Remove_Static_Consts ( mb ): """ linux users have compile problems with vars that are static consts AND have values set in the .h files we can simply leave these out """ @@ -554,43 +429,49 @@ AutoInclude ( mb ) - AutoExclude ( mb ) + common_utils.AutoExclude ( mb ) ManualExclude ( mb ) ManualInclude ( mb ) # here we fixup functions that expect to modifiy their 'passed' variables ManualTransformations ( mb ) AutoFixes ( mb ) + common_utils.Auto_Functional_Transformation ( main_ns ) ##, special_vars=['::Ogre::Real &','::Ogre::ushort &','size_t &'] ) ManualFixes ( mb ) # # We need to tell boost how to handle calling (and returning from) certain functions # - Set_Call_Policies ( mb.global_ns ) - + common_utils.Set_DefaultCall_Policies ( mb.global_ns ) + # # the manual stuff all done here !!! # hand_made_wrappers.apply( mb ) + f = global_ns.member_function('::ssgEntity::cull') + f.include() NoPropClasses = [""] for cls in main_ns.classes(): if cls.name not in NoPropClasses: cls.add_properties( recognizer=ogre_properties.ogre_property_recognizer_t() ) + + common_utils.Auto_Document( mb, MAIN_NAMESPACE ) + ## add additional version information to the module to help identify it correctly - common_utils.addDetailVersion ( mb, environment, environment.plib ) + common_utils.addDetailVersion ( mb, environment, environment.ogre ) + + common_utils.Find_Problem_Transformations ( main_ns ) - f = global_ns.member_function('::ssgEntity::cull') - f.include() ########################################################################################## # # Creating the code. After this step you should not modify/customize declarations. # ########################################################################################## - extractor = exdoc.doc_extractor("") # I'm excluding the UTFstring docs as lots about nothing - mb.build_code_creator (module_name='_plib_' ) ## no docs as issues here, doc_extractor= extractor ) + extractor = exdoc.doc_extractor("") + mb.build_code_creator (module_name='_plib_', doc_extractor= extractor ) ## no docs as issues here, doc_extractor= extractor ) for inc in environment.plib.include_dirs: mb.code_creator.user_defined_directories.append(inc ) Modified: trunk/python-ogre/code_generators/plib/hand_made_wrappers.py =================================================================== --- trunk/python-ogre/code_generators/plib/hand_made_wrappers.py 2008-11-28 01:03:31 UTC (rev 823) +++ trunk/python-ogre/code_generators/plib/hand_made_wrappers.py 2008-11-28 12:12:52 UTC (rev 824) @@ -317,6 +317,95 @@ bp::return_value_policy< bp::reference_existing_object, bp::default_call_policies >());""" ] +################################################################# +WRAPPER_DEFINITION_ssgLoaderOptions_wrapper = \ +""" +virtual ::ssgBranch * createBranch ( char * text ) const { + namespace bpl = boost::python; + // a little sanity to ensure stuff doesn't get broken + size_t len = strlen ( text ); + if ( len > 1024 ) len = 1024; + if ( len <= 0 ) return NULL; + + if( bpl::override func_createBranch = this->get_override( "createBranch" ) ){ +// return func_createBranch( boost::python::str(text, len ) ) ; //text ); + bpl::object py_result = bpl::call<bpl::object>( func_createBranch.ptr(), boost::python::str(text, len ) ); + return bpl::extract< ::ssgBranch * >( pyplus_conv::get_out_argument( py_result, 0 ) ); + } + else { + return this->ssgLoaderOptions::createBranch( text ); + } + } + + + ::ssgBranch * default_createBranch( char * text ) const { + return ssgLoaderOptions::createBranch( text ); + } + + +virtual ssgState * createState( char * text ) const { + namespace bpl = boost::python; + // a little sanity to ensure stuff doesn't get broken + size_t len = strlen ( text ); + if ( len > 1024 ) len = 1024; + if ( len <= 0 ) return NULL; + + if( bpl::override func_createState = this->get_override( "createState" ) ){ + bpl::object py_result = bpl::call<bpl::object>( func_createState.ptr(), boost::python::str(text, len ) ); + return bpl::extract< ::ssgState * >( pyplus_conv::get_out_argument( py_result, 0 ) ); + } + else { + return this->ssgLoaderOptions::createState( text ); + } + } + + ::ssgState * default_createState( char * text ) const { + return ssgLoaderOptions::createState( text ); + } + +""" + +WRAPPER_DEFINITION_ssgLoaderOptions_declaration = \ +""" +{ //::ssgLoaderOptions::createBranch + + typedef ::ssgBranch * ( ::ssgLoaderOptions::*createBranch_function_type )( char * ) const; + typedef ::ssgBranch * ( ssgLoaderOptions_wrapper::*default_createBranch_function_type )( char * ) const; + + ssgLoaderOptions_exposer.def( + "createBranch" + , createBranch_function_type(&::ssgLoaderOptions::createBranch) + , default_createBranch_function_type(&ssgLoaderOptions_wrapper::default_createBranch) + , ( bp::arg("text") ) + , bp::return_value_policy< bp::reference_existing_object >() ); + + } +{ //::ssgLoaderOptions::createState + + typedef ::ssgState * ( ::ssgLoaderOptions::*createState_function_type )( char * ) const; + typedef ::ssgState * ( ssgLoaderOptions_wrapper::*default_createState_function_type )( char * ) const; + + ssgLoaderOptions_exposer.def( + "createState" + , createState_function_type(&::ssgLoaderOptions::createState) + , default_createState_function_type(&ssgLoaderOptions_wrapper::default_createState) + , ( bp::arg("text") ) + , bp::return_value_policy< bp::reference_existing_object >() ); + + } + +""" + +WRAPPER_REGISTRATION_ssgLoaderOptions = [ + """def( "createBranch", &ssgLoaderOptions_wrapper::createBranch, + "Python-Ogre Helper Function: call back for ssgLoadXXX.", + bp::return_value_policy< bp::reference_existing_object, bp::default_call_policies >());""" + ,"""def( "createState", &ssgLoaderOptions_wrapper::createState, + "Python-Ogre Helper Function: call back for ssgLoadXXX.", + bp::return_value_policy< bp::reference_existing_object, bp::default_call_policies >());""" + ] + + ################################################################################################# ################################################################################################# @@ -350,11 +439,16 @@ rt = mb.class_( 'ssgBaseTransform' ) rt.add_wrapper_code( WRAPPER_DEFINITION_ssgBaseTransform_Wrapper ) -# rt = mb.class_( 'ssgTransform' ) -# rt = mb -# rt.add_declaration_code( WRAPPER_DEFINITION_ssgTransform ) -# apply_reg (rt, WRAPPER_REGISTRATION_ssgTransform ) + rt = mb.class_( 'ssgTransform' ) + rt.add_declaration_code( WRAPPER_DEFINITION_ssgTransform ) + apply_reg (rt, WRAPPER_REGISTRATION_ssgTransform ) + rt = mb.class_( 'ssgLoaderOptions' ) + rt.add_wrapper_code( WRAPPER_DEFINITION_ssgLoaderOptions_wrapper ) + rt.add_registration_code( WRAPPER_DEFINITION_ssgLoaderOptions_declaration, False ) + +# apply_reg (rt, WRAPPER_REGISTRATION_ssgLoaderOptions ) + # mb.add_declaration_code( WRAPPER_DEFINITION_Free ) # apply_reg (mb, WRAPPER_REGISTRATION_Free ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2008-12-04 13:12:16
|
Revision: 826 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=826&view=rev Author: andy_miller Date: 2008-12-04 13:12:10 +0000 (Thu, 04 Dec 2008) Log Message: ----------- Added MyGui to the code generators (not finished) Update to ogreode demo Modified Paths: -------------- trunk/python-ogre/PythonOgreConfig_posix.py trunk/python-ogre/demos/OgreNewt/Demo01_TheBasics.py trunk/python-ogre/demos/ogre/Demo_Bezier.py trunk/python-ogre/demos/ogre/tests/Test_OverlayCaption.py trunk/python-ogre/demos/ogreode/Demo_Scenes.py trunk/python-ogre/demos/ogreode/SimpleScenes_BoxStack.py trunk/python-ogre/environment.py Added Paths: ----------- trunk/python-ogre/code_generators/mygui/ trunk/python-ogre/code_generators/mygui/customization_data.py trunk/python-ogre/code_generators/mygui/generate_code.py trunk/python-ogre/code_generators/mygui/hand_made_wrappers.py trunk/python-ogre/code_generators/mygui/python_mygui.h trunk/python-ogre/code_generators/mygui/python_mygui_aliases.h trunk/python-ogre/code_generators/mygui/python_mygui_sizeof.h Modified: trunk/python-ogre/PythonOgreConfig_posix.py =================================================================== --- trunk/python-ogre/PythonOgreConfig_posix.py 2008-11-28 12:39:02 UTC (rev 825) +++ trunk/python-ogre/PythonOgreConfig_posix.py 2008-12-04 13:12:10 UTC (rev 826) @@ -81,6 +81,7 @@ PATH_ogrepcz = os.path.join(PATH_Ogre, 'PlugIns', 'PCZSceneManager' ) PATH_hydrax = os.path.join(PATH_THIRDPARTY, 'Hydrax') PATH_hikari = os.path.join(PATH_THIRDPARTY, 'Hikari' ) # BASE_DIR, 'hikari', 'hikari') +PATH_mygui = os.path.join(BASE_DIR, 'MyGUI_2.2.0_RC1_source' ) ### ### these paths assume you've left all the directory structure as standard @@ -120,6 +121,7 @@ PATH_LIB_particleuniverse = os.path.join(PATH_particleuniverse, 'bin', 'release') PATH_LIB_opensteer = os.path.join(LOCAL_LIB) PATH_LIB_hikari = os.path.join(PATH_hikari ) #, 'lib') +PATH_LIB_mygui = os.path.join(PATH_mygui, 'MyGUIEngine','lib','Release') PATH_INCLUDE_Ogre= os.path.join(LOCAL_INCLUDE,'OGRE') # os.path.join(PATH_Ogre,'OgreMain/include') PATH_INCLUDE_Ogre_Dependencies = PATH_INCLUDE_Ogre # os.path.join( PATH_Ogre, 'Dependencies/include') @@ -191,4 +193,5 @@ PATH_INCLUDE_ogrepcz = os.path.join(PATH_ogrepcz,'include') PATH_INCLUDE_hydrax= PATH_hydrax PATH_INCLUDE_hikari = os.path.join(PATH_hikari ) #, 'include') +PATH_INCLUDE_mygui = os.path.join(PATH_mygui,'MyGUIEngine','include') Added: trunk/python-ogre/code_generators/mygui/customization_data.py =================================================================== --- trunk/python-ogre/code_generators/mygui/customization_data.py (rev 0) +++ trunk/python-ogre/code_generators/mygui/customization_data.py 2008-12-04 13:12:10 UTC (rev 826) @@ -0,0 +1,13 @@ + +def header_files( version ): + return [ 'MyGUI.h' + ,'MYGUI_RenderItem.h' + ,'MYGUI_LayerItemKeeper.h' + ,'MYGUI_LayerKeeper.h' + ,'MYGUI_WidgetSkinInfo.h' + ] + + +def huge_classes( version ): + return [] + \ No newline at end of file Added: trunk/python-ogre/code_generators/mygui/generate_code.py =================================================================== --- trunk/python-ogre/code_generators/mygui/generate_code.py (rev 0) +++ trunk/python-ogre/code_generators/mygui/generate_code.py 2008-12-04 13:12:10 UTC (rev 826) @@ -0,0 +1,325 @@ +#!/usr/bin/env python +# ----------------------------------------------------------------------------- +# This source file is part of Python-Ogre and is covered by the LGPL +# For the latest info, see http://python-ogre.org/ +# +# ----------------------------------------------------------------------------- + +## STARTER TEMPLATE.. +## replace mygui with lowercase project name +## set MAIN_NAMESPACE +## rename and configure .h files + + +import os, sys, time, shutil +try: + import psyco + psyco.full() +except ImportError: + pass +#add environment to the path +sys.path.append( os.path.join( '..', '..' ) ) +#add common utils to the pass +sys.path.append( '..' ) +sys.path.append( '.' ) + +import environment +import common_utils +import customization_data +import hand_made_wrappers + + +from pygccxml import parser +from pygccxml import declarations +from pyplusplus import messages +from pyplusplus import module_builder +from pyplusplus import decl_wrappers + +from pyplusplus import function_transformers as ft +from pyplusplus.module_builder import call_policies +from pyplusplus.module_creator import sort_algorithms + +import common_utils.extract_documentation as exdoc +import common_utils.var_checker as varchecker +import common_utils.ogre_properties as ogre_properties +from common_utils import docit + +MAIN_NAMESPACE = 'MyGUI' + +############################################################ +## +## Here is where we manually exclude stuff +## +############################################################ + +def ManualExclude ( mb ): + global_ns = mb.global_ns + if MAIN_NAMESPACE: + main_ns = global_ns.namespace( MAIN_NAMESPACE ) + else: + main_ns = global_ns + e = ['::MyGUI::delegates::CDelegate3< MyGUI::Widget*, std::string const&, std::string const& >', + '::MyGUI::delegates::CDelegate2< MyGUI::Widget*, unsigned int >', + '::MyGUI::ControllerPosition' + ] + for c in e: + print "Excluding:",c + main_ns.class_(c).exclude() + + for c in main_ns.classes(): + if 'delegates' in c.decl_string: + print "Excuding asssign operator from:", c + c.operators('=').exclude() + c=['::MyGUI::Font', + '::MyGUI::FontManager' + ] + for e in c: + main_ns.class_(e).noncopyable=True + c=['::MyGUI::LogManager::LevelsName' + ] + for e in c: + main_ns.variable(e).exclude() + + c=['::MyGUI::utility::templates::split' + ,'::MyGUI::utility::templates::parseColour' + ,'::MyGUI::templates::get_vector_resource_path' + ,'::MyGUI::templates::get_resource_path' + ] + for e in c: + main_ns.free_functions(e).exclude() + +############################################################ +## +## And there are things that manually need to be INCLUDED +## +############################################################ + +def ManualInclude ( mb ): + global_ns = mb.global_ns + if MAIN_NAMESPACE: + main_ns = global_ns.namespace( MAIN_NAMESPACE ) + else: + main_ns = global_ns + +############################################################ +## +## And things that need manual fixes, but not necessarly hand wrapped +## +############################################################ +def ManualFixes ( mb ): + global_ns = mb.global_ns + if MAIN_NAMESPACE: + main_ns = global_ns.namespace( MAIN_NAMESPACE ) + else: + main_ns = global_ns + +############################################################ +## +## And things that need to have their argument and call values fixed. +## ie functions that pass pointers in the argument list and of course we need +## to read the updated values - so instead we pass them back +## as new values in a tuple (ETC ETC) +## +############################################################ + +def ManualTransformations ( mb ): + global_ns = mb.global_ns + if MAIN_NAMESPACE: + main_ns = global_ns.namespace( MAIN_NAMESPACE ) + else: + main_ns = global_ns + + def create_output( size ): + return [ ft.output( i ) for i in range( size ) ] + + +############################################################################### +## +## Now for the AUTOMATIC stuff that should just work +## +############################################################################### + +def AutoFixes ( mb, MAIN_NAMESPACE ): + """ now we fix a range of things automatically - typically by going through + the entire name space trying to guess stuff and fix it:) + """ + global_ns = mb.global_ns + if MAIN_NAMESPACE: + main_ns = global_ns.namespace( MAIN_NAMESPACE ) + else: + main_ns = global_ns + +# # # Functions that have void pointers in their argument list need to change to unsigned int's +# # pointee_types=[] +# # ignore_names=[] +# # common_utils.Fix_Void_Ptr_Args ( main_ns ) # , pointee_types, ignore_names ) + + # and change functions that return a variety of pointers to instead return unsigned int's + pointee_types=[] + ignore_names=[] # these are function names we know it's cool to exclude + common_utils.Fix_Pointer_Returns ( main_ns ) # , pointee_types, ignore_names ) + + # functions that need to have implicit conversions turned off + ImplicitClasses=[] + common_utils.Fix_Implicit_Conversions ( main_ns, ImplicitClasses ) + + if os.name =='nt': + Fix_NT( mb ) + elif os.name =='posix': + Fix_Posix( mb ) + + common_utils.Auto_Document( mb, MAIN_NAMESPACE ) + + +############################################################################### +## +## here are the helper functions that do much of the work +## +############################################################################### +def Fix_Posix ( mb ): + """ fixup for posix specific stuff -- note only expect to be called on a posix machine + """ + ## we could do more here if need be... + if sys.platform == 'darwin': + pass + elif sys.platform.startswith ('linux'): + pass + + +def Fix_NT ( mb ): + """ fixup for NT systems + """ + + +# +# the 'main'function +# +def generate_code(): + messages.disable( +# Warnings 1020 - 1031 are all about why Py++ generates wrapper for class X + messages.W1020 + , messages.W1021 + , messages.W1022 + , messages.W1023 + , messages.W1024 + , messages.W1025 + , messages.W1026 + , messages.W1027 + , messages.W1028 + , messages.W1029 + , messages.W1030 + , messages.W1031 + , messages.W1035 + , messages.W1040 + , messages.W1038 + , messages.W1041 + , messages.W1036 # pointer to Python immutable member + , messages.W1033 # unnamed variables + , messages.W1018 # expose unnamed classes + , messages.W1049 # returns reference to local variable + , messages.W1014 # unsupported '=' operator + ) + # + # Use GCCXML to create the controlling XML file. + # If the cache file (../cache/*.xml) doesn't exist it gets created, otherwise it just gets loaded + # NOTE: If you update the source library code you need to manually delete the cache .XML file + # + xml_cached_fc = parser.create_cached_source_fc( + os.path.join( environment.mygui.root_dir, "python_mygui.h" ) + , environment.mygui.cache_file ) + + defined_symbols = ['WIN32','OGRE_NONCLIENT_BUILD', 'OGRE_GCC_VISIBILITY', '__PYTHONOGRE_BUILD_CODE', 'MYGUI_NONCLIENT_BUILD' ] #MYGUI_NO_OIS + + defined_symbols.append( 'VERSION_' + environment.mygui.version ) + + if environment._USE_THREADS: + defined_symbols.append('BOOST_HAS_THREADS') + if environment.isWindows(): + defined_symbols.append('BOOST_HAS_WINTHREADS') + + # + # build the core Py++ system from the GCCXML created source + # + mb = module_builder.module_builder_t( [ xml_cached_fc ] + , gccxml_path=environment.gccxml_bin + , working_directory=environment.root_dir + , include_paths=environment.mygui.include_dirs + , define_symbols=defined_symbols + , indexing_suite_version=2 + , cflags=environment.mygui.cflags + ) + + # if this module depends on another set it here + mb.register_module_dependency ( environment.ogre.generated_dir ) + + # normally implicit conversions work OK, however they can cause strange things to happen so safer to leave off + mb.constructors().allow_implicit_conversion = False + + mb.BOOST_PYTHON_MAX_ARITY = 25 + mb.classes().always_expose_using_scope = True + + # + # We filter (both include and exclude) specific classes and functions that we want to wrap + # + global_ns = mb.global_ns + global_ns.exclude() + main_ns = global_ns.namespace( MAIN_NAMESPACE ) + main_ns.include() + + common_utils.AutoExclude ( mb, MAIN_NAMESPACE ) + ManualExclude ( mb ) + common_utils.AutoInclude ( mb, MAIN_NAMESPACE ) + ManualInclude ( mb ) + # here we fixup functions that expect to modifiy their 'passed' variables + ManualTransformations ( mb ) + AutoFixes ( mb, MAIN_NAMESPACE ) + ManualFixes ( mb ) + + common_utils.Auto_Functional_Transformation ( main_ns, special_vars=['::Ogre::Real &','::Ogre::ushort &','size_t &'] ) + + # + # We need to tell boost how to handle calling (and returning from) certain functions + # + common_utils.Set_DefaultCall_Policies ( mb.global_ns.namespace ( MAIN_NAMESPACE ) ) + + # + # the manual stuff all done here !!! + # + hand_made_wrappers.apply( mb ) + + NoPropClasses = [""] + for cls in main_ns.classes(): + if cls.name not in NoPropClasses: + cls.add_properties( recognizer=ogre_properties.ogre_property_recognizer_t() ) + + ## add additional version information to the module to help identify it correctly + common_utils.addDetailVersion ( mb, environment, environment.mygui ) + + ########################################################################################## + # + # Creating the code. After this step you should not modify/customize declarations. + # + ########################################################################################## + extractor = exdoc.doc_extractor() # I'm excluding the UTFstring docs as lots about nothing + mb.build_code_creator (module_name='_mygui_' , doc_extractor= extractor ) + + for inc in environment.mygui.include_dirs: + mb.code_creator.user_defined_directories.append(inc ) + mb.code_creator.user_defined_directories.append( environment.mygui.generated_dir ) + mb.code_creator.replace_included_headers( customization_data.header_files( environment.mygui.version ) ) + + huge_classes = map( mb.class_, customization_data.huge_classes( environment.mygui.version ) ) + + mb.split_module(environment.mygui.generated_dir, huge_classes, use_files_sum_repository=False) + + ## now we need to ensure a series of headers and additional source files are + ## copied to the generated directory.. + +# common_utils.copyTree ( sourcePath = environment.Config.PATH_INCLUDE_mygui, +# destPath = environment.mygui.generated_dir, +# recursive=False ) + +if __name__ == '__main__': + start_time = time.clock() + generate_code() + print 'Source code was updated( %f minutes ).' % ( ( time.clock() - start_time )/60 ) Added: trunk/python-ogre/code_generators/mygui/hand_made_wrappers.py =================================================================== --- trunk/python-ogre/code_generators/mygui/hand_made_wrappers.py (rev 0) +++ trunk/python-ogre/code_generators/mygui/hand_made_wrappers.py 2008-12-04 13:12:10 UTC (rev 826) @@ -0,0 +1,15 @@ +import os +import environment + + + +################################################################################################# +################################################################################################# + +def apply_reg ( class_, code ): + for c in code: + class_.add_registration_code ( c ) + +def apply( mb ): + pass + \ No newline at end of file Added: trunk/python-ogre/code_generators/mygui/python_mygui.h =================================================================== --- trunk/python-ogre/code_generators/mygui/python_mygui.h (rev 0) +++ trunk/python-ogre/code_generators/mygui/python_mygui.h 2008-12-04 13:12:10 UTC (rev 826) @@ -0,0 +1,19 @@ + +#include "MyGUI.h" + +// First we create a magic namespace to hold all our aliases +namespace pyplusplus { namespace aliases { + + #include "python_mygui_aliases.h" +} } + +// then we exposed everything needed (and more) to ensure GCCXML makes them visible to Py++ +// +namespace python_mygui{ namespace details{ +inline void instantiate(){ + using namespace MyGUI; + #include "python_mygui_sizeof.h" + +} } } + + Added: trunk/python-ogre/code_generators/mygui/python_mygui_aliases.h =================================================================== --- trunk/python-ogre/code_generators/mygui/python_mygui_aliases.h (rev 0) +++ trunk/python-ogre/code_generators/mygui/python_mygui_aliases.h 2008-12-04 13:12:10 UTC (rev 826) @@ -0,0 +1 @@ +// typedef name nicename; Added: trunk/python-ogre/code_generators/mygui/python_mygui_sizeof.h =================================================================== --- trunk/python-ogre/code_generators/mygui/python_mygui_sizeof.h (rev 0) +++ trunk/python-ogre/code_generators/mygui/python_mygui_sizeof.h 2008-12-04 13:12:10 UTC (rev 826) @@ -0,0 +1 @@ +// sizeof ( variable ); Modified: trunk/python-ogre/demos/OgreNewt/Demo01_TheBasics.py =================================================================== --- trunk/python-ogre/demos/OgreNewt/Demo01_TheBasics.py 2008-11-28 12:39:02 UTC (rev 825) +++ trunk/python-ogre/demos/OgreNewt/Demo01_TheBasics.py 2008-12-04 13:12:10 UTC (rev 826) @@ -81,6 +81,20 @@ light.setType( Ogre.Light.LT_POINT ) light.setPosition( Ogre.Vector3(0.0, 100.0, 100.0) ) + + shapes = OgreNewt.VectorofCollision() + print "shape", shapes + col = OgreNewt.Pyramid(self.World, Ogre.Vector3(5,5,5), Ogre.Quaternion(0, 0, 0), Ogre.Vector3(0,0,-20) ) + print "col", col + shapes.append(col) + print shapes + col2 = OgreNewt.Box(self.World, Ogre.Vector3(5,5,5) ) + print "col2", col2 + shapes.append(col2) + compound = OgreNewt.CompoundCollision(self.World, shapes) + + print "*****", compound + def _createFrameListener(self): ## this is a basic frame listener included with OgreNewt that does nothing but update the Modified: trunk/python-ogre/demos/ogre/Demo_Bezier.py =================================================================== --- trunk/python-ogre/demos/ogre/Demo_Bezier.py 2008-11-28 12:39:02 UTC (rev 825) +++ trunk/python-ogre/demos/ogre/Demo_Bezier.py 2008-12-04 13:12:10 UTC (rev 826) @@ -98,7 +98,7 @@ ## Set ambient light sceneManager.setAmbientLight( (0.2, 0.2, 0.2) ) - print "\n1" + ## Create a point light l = sceneManager.createLight("MainLight") l.setType(ogre.Light.LT_DIRECTIONAL) @@ -232,10 +232,10 @@ patchEntity.setMaterialName("TextMat") patchPass = pMat.getTechnique(0).getPass(0) - print patchPass - print dir(patchPass) - print patchPass.msDirtyHashListMutex - sys.exit() +# print patchPass +# print dir(patchPass) +# print patchPass.msDirtyHashListMutex +# sys.exit() ## Attach the entity to the root of the scene Modified: trunk/python-ogre/demos/ogre/tests/Test_OverlayCaption.py =================================================================== --- trunk/python-ogre/demos/ogre/tests/Test_OverlayCaption.py 2008-11-28 12:39:02 UTC (rev 825) +++ trunk/python-ogre/demos/ogre/tests/Test_OverlayCaption.py 2008-12-04 13:12:10 UTC (rev 826) @@ -1,5 +1,5 @@ # This code is in the Public Domain -import Ogre as ogre +import ogre.renderer.OGRE as ogre import SampleFramework as sf import ctypes, math,sys @@ -10,7 +10,7 @@ overman = ogre.OverlayManager.getSingleton() statspanel = overman.getOverlayElement('Core/StatPanel', False) print statspanel - print dir(statspanel) + statspanel.caption=ogre.UTFString("This does work") statspanel.setCaption(ogre.UTFString("as does this") ) Modified: trunk/python-ogre/demos/ogreode/Demo_Scenes.py =================================================================== --- trunk/python-ogre/demos/ogreode/Demo_Scenes.py 2008-11-28 12:39:02 UTC (rev 825) +++ trunk/python-ogre/demos/ogreode/Demo_Scenes.py 2008-12-04 13:12:10 UTC (rev 826) @@ -112,7 +112,7 @@ sceneManager.setShadowTextureSettings(512, 2) ## Add some default lighting to the scene - sceneManager.setAmbientLight( (.8, .8, .8) ) + sceneManager.setAmbientLight( (.25, .25, .25) ) light = sceneManager.createLight('MainLight') light.setPosition (0, 0, 1) light.CastShadows=True @@ -205,7 +205,7 @@ entity.setUserObject(self._plane) entity.setCastShadows(False) s.addEntity(entity, ogre.Vector3(x,0,z)) - + s.build() ## Load up our UI and display it pOver = ogre.OverlayManager.getSingleton().getByName("OgreOdeDemos/Overlay") pOver.show() Modified: trunk/python-ogre/demos/ogreode/SimpleScenes_BoxStack.py =================================================================== --- trunk/python-ogre/demos/ogreode/SimpleScenes_BoxStack.py 2008-11-28 12:39:02 UTC (rev 825) +++ trunk/python-ogre/demos/ogreode/SimpleScenes_BoxStack.py 2008-12-04 13:12:10 UTC (rev 826) @@ -28,17 +28,13 @@ return "Z - Sphere, X - Box, C - Capsule, G - Ragdoll, T - Trimesh" def frameEnded(self, time, keyinput, mouse): -# print "** Simpel Scenes BoxStack frameEnded" ## Do default processing SimpleScenes.frameEnded(self, time, keyinput, mouse) body = None ## Create random objects, that method will stop them being created too often if (keyinput.isKeyDown(OIS.KC_Z)): - print "Creating a body" body = self.createRandomObject(OgreOde.Geometry.Class_Sphere) - print body - print "OK" elif (keyinput.isKeyDown(OIS.KC_X)): body = self.createRandomObject(OgreOde.Geometry.Class_Box) elif (keyinput.isKeyDown(OIS.KC_C)): @@ -47,6 +43,5 @@ body = self.createRandomObject(OgreOde.Geometry.Class_Convex) #TriangleMesh) elif (keyinput.isKeyDown(OIS.KC_G)): self.createRagDoll() -# print "Returning from frameended" \ No newline at end of file Modified: trunk/python-ogre/environment.py =================================================================== --- trunk/python-ogre/environment.py 2008-11-28 12:39:02 UTC (rev 825) +++ trunk/python-ogre/environment.py 2008-12-04 13:12:10 UTC (rev 826) @@ -1835,28 +1835,33 @@ descText = "Use Flash controls within Ogre" descLink = "http://hikari-library.googlecode.com/" -# class mygui: -# active = False -# pythonModule = True -# version="2.2.0RC1" -# name='mygui' -# parent="ogre/gui" -# cflags = "" -# include_dirs = [ Config.PATH_Boost, -# Config.PATH_INCLUDE_mygui -# , Config.PATH_INCLUDE_Ogre -# ,Config.PATH_INCLUDE_Ogre_Dependencies -# ] -# lib_dirs = [Config.PATH_LIB_Boost -# ,Config.PATH_LIB_Ogre_OgreMain -# ,Config.PATH_LIB_mygui -# -# ] -# CheckIncludes=[] -# libs=[ boost.lib, 'OgreMain', 'MyGUI' ] ##, 'hikari' ] -# ModuleName="mygui" -# descText = "MyGUI Interface System" -# descLink = "http://sourceforge.net/projects/my-gui/" +class mygui: + active = False + pythonModule = True + version="2.2.0RC1" + name='mygui' + parent="ogre/gui" + cflags = "" + source =[ + ["wget", "http://downloads.sourceforge.net/my-gui/MyGUI_2.2.0_RC1_source.zip",downloadPath], + ] + buildCmds = [ + [0, unzip + os.path.join(downloadPath, "MyGUI_2.2.0_RC1_source.zip"), ''] + ] + include_dirs = [ Config.PATH_Boost, + Config.PATH_INCLUDE_mygui + , Config.PATH_INCLUDE_Ogre + ,Config.PATH_INCLUDE_Ogre_Dependencies + ] + lib_dirs = [Config.PATH_LIB_Boost + ,Config.PATH_LIB_Ogre_OgreMain + ,Config.PATH_LIB_mygui + ] + CheckIncludes=[] + libs=[ boost.lib, 'OgreMain', 'MyGUI' ] ##, 'hikari' ] + ModuleName="mygui" + descText = "MyGUI Interface System" + descLink = "http://sourceforge.net/projects/my-gui/" ############################################################################################ @@ -1899,7 +1904,7 @@ , 'ogrepcz' : ogrepcz , 'hydrax' : hydrax , 'hikari' : hikari -# , 'mygui' : mygui + , 'mygui' : mygui } # This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2008-12-05 07:18:32
|
Revision: 827 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=827&view=rev Author: andy_miller Date: 2008-12-05 07:18:28 +0000 (Fri, 05 Dec 2008) Log Message: ----------- Initial add of Canvas wrapper and update for mygui Modified Paths: -------------- trunk/python-ogre/PythonOgreConfig_nt.py trunk/python-ogre/PythonOgreConfig_posix.py trunk/python-ogre/ReportVersion.py trunk/python-ogre/environment.py trunk/python-ogre/setup.py Added Paths: ----------- trunk/python-ogre/ThirdParty/canvas/ trunk/python-ogre/ThirdParty/canvas/Atlas.cpp trunk/python-ogre/ThirdParty/canvas/Atlas.h trunk/python-ogre/ThirdParty/canvas/Canvas.cpp trunk/python-ogre/ThirdParty/canvas/Canvas.h trunk/python-ogre/packages_2.5/ogre/gui/canvas/ trunk/python-ogre/packages_2.5/ogre/gui/canvas/__init__.py trunk/python-ogre/packages_2.5/ogre/gui/mygui/ trunk/python-ogre/packages_2.5/ogre/gui/mygui/__init__.py Modified: trunk/python-ogre/PythonOgreConfig_nt.py =================================================================== --- trunk/python-ogre/PythonOgreConfig_nt.py 2008-12-04 13:12:10 UTC (rev 826) +++ trunk/python-ogre/PythonOgreConfig_nt.py 2008-12-05 07:18:28 UTC (rev 827) @@ -84,6 +84,7 @@ PATH_hydrax = os.path.join(PATH_THIRDPARTY, 'Hydrax') PATH_hikari = os.path.join(PATH_THIRDPARTY, 'Hikari' ) #BASE_DIR, 'hikari', 'hikari') PATH_mygui = os.path.join(BASE_DIR, 'MyGUI_2.2.0_RC1_source' ) +PATH_canvas = os.path.join(PATH_THIRDPARTY, 'canvas') # it's time for the SDK version if SDK: @@ -132,6 +133,7 @@ PATH_LIB_opensteer = os.path.join(PATH_opensteer, 'win32','release') PATH_LIB_hikari = os.path.join(PATH_hikari ) # , 'lib') PATH_LIB_mygui = os.path.join(PATH_mygui, 'MyGUIEngine','lib','Release') +PATH_LIB_canvas = os.path.join(PATH_canvas ) PATH_INCLUDE_Ogre= os.path.join(PATH_Ogre,'OgreMain/include') PATH_INCLUDE_NEDMALLOC= os.path.join(PATH_Ogre,'OgreMain', 'src', 'nedmalloc') @@ -183,6 +185,7 @@ PATH_INCLUDE_hydrax= PATH_hydrax PATH_INCLUDE_hikari = os.path.join(PATH_hikari ) #, 'include') PATH_INCLUDE_mygui = os.path.join(PATH_mygui,'MyGUIEngine','include') +PATH_INCLUDE_canvas= PATH_canvas PATH_INCLUDE_OggVorbisTheora = [ os.path.join(BASE_DIR,'ogg','include') ,os.path.join(BASE_DIR, 'vorbis', 'include') Modified: trunk/python-ogre/PythonOgreConfig_posix.py =================================================================== --- trunk/python-ogre/PythonOgreConfig_posix.py 2008-12-04 13:12:10 UTC (rev 826) +++ trunk/python-ogre/PythonOgreConfig_posix.py 2008-12-05 07:18:28 UTC (rev 827) @@ -82,6 +82,7 @@ PATH_hydrax = os.path.join(PATH_THIRDPARTY, 'Hydrax') PATH_hikari = os.path.join(PATH_THIRDPARTY, 'Hikari' ) # BASE_DIR, 'hikari', 'hikari') PATH_mygui = os.path.join(BASE_DIR, 'MyGUI_2.2.0_RC1_source' ) +PATH_canvas = os.path.join(PATH_THIRDPARTY, 'canvas') ### ### these paths assume you've left all the directory structure as standard @@ -122,6 +123,7 @@ PATH_LIB_opensteer = os.path.join(LOCAL_LIB) PATH_LIB_hikari = os.path.join(PATH_hikari ) #, 'lib') PATH_LIB_mygui = os.path.join(PATH_mygui, 'MyGUIEngine','lib','Release') +PATH_LIB_canvas = os.path.join(PATH_canvas ) PATH_INCLUDE_Ogre= os.path.join(LOCAL_INCLUDE,'OGRE') # os.path.join(PATH_Ogre,'OgreMain/include') PATH_INCLUDE_Ogre_Dependencies = PATH_INCLUDE_Ogre # os.path.join( PATH_Ogre, 'Dependencies/include') @@ -194,4 +196,5 @@ PATH_INCLUDE_hydrax= PATH_hydrax PATH_INCLUDE_hikari = os.path.join(PATH_hikari ) #, 'include') PATH_INCLUDE_mygui = os.path.join(PATH_mygui,'MyGUIEngine','include') +PATH_INCLUDE_canvas= PATH_canvas Modified: trunk/python-ogre/ReportVersion.py =================================================================== --- trunk/python-ogre/ReportVersion.py 2008-12-04 13:12:10 UTC (rev 826) +++ trunk/python-ogre/ReportVersion.py 2008-12-05 07:18:28 UTC (rev 827) @@ -28,7 +28,7 @@ 'ogre.addons.noise', 'ogre.addons.watermesh', 'ogre.addons.particleuniverse', 'ogre.addons.cadunetree', 'ogre.renderer.ogrepcz', 'ogre.addons.hydrax', - 'ogre.gui.hikari' ) + 'ogre.gui.hikari','ogre.gui.canvas','ogre.gui.mygui' ) # bm.setupLogging("version.info") # options.logfilename) # logger = logging.getLogger('PythonOgre.ReportVersionInfo') Added: trunk/python-ogre/ThirdParty/canvas/Atlas.cpp =================================================================== --- trunk/python-ogre/ThirdParty/canvas/Atlas.cpp (rev 0) +++ trunk/python-ogre/ThirdParty/canvas/Atlas.cpp 2008-12-05 07:18:28 UTC (rev 827) @@ -0,0 +1,515 @@ +/* + This file is part of Canvas, a fast, lightweight 2D graphics engine for Ogre3D. + + Copyright (C) 2008 Adam J. Simmons + ajs...@gm... + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "Atlas.h" +namespace CanvasNS +{ +/************************ +* TextureInfo +************************/ + +TextureInfo::TextureInfo() : isEmpty(true), width(0), height(0) +{ +} + +TextureInfo::TextureInfo(int atlasWidth, int atlasHeight, int x, int y, int width, int height) : isEmpty(false), width(width), height(height) +{ + texCoords.left = x / (float)atlasWidth; + texCoords.top = y / (float)atlasHeight; + texCoords.right = (x + width) / (float)atlasWidth; + texCoords.bottom = (y + height) / (float)atlasHeight; +} + +/************************ +* GlyphInfo +************************/ + +GlyphInfo::GlyphInfo() : bearingX(0), bearingY(0), advance(0) +{ +} + +GlyphInfo::GlyphInfo(Ogre::Real bearingX, Ogre::Real bearingY, Ogre::Real advance) + : bearingX(bearingX), bearingY(bearingY), advance(advance) +{ +} + +/************************ +* FontMetrics +************************/ + +FontMetrics::FontMetrics() : ascender(0), descender(0), height(0), maxAdvance(0) +{ +} + +FontMetrics::FontMetrics(Ogre::Real ascender, Ogre::Real descender, Ogre::Real height, Ogre::Real maxAdvance) + : ascender(ascender), descender(descender), height(height), maxAdvance(maxAdvance) +{ + +} + +/************************ +* CharCodeRange +************************/ + +const CharCodeRange CharCodeRange::BasicLatin = CharCodeRange(32, 166); +const CharCodeRange CharCodeRange::Latin1 = CharCodeRange(32, 255); +const CharCodeRange CharCodeRange::All = CharCodeRange(); + +CharCodeRange::CharCodeRange() +{ +} + +CharCodeRange::CharCodeRange(CharCode from, CharCode to) +{ + addRange(from, to); +} + +void CharCodeRange::addRange(CharCode from, CharCode to) +{ + ranges.push_back(std::pair<CharCode, CharCode>(from, to)); +} + +bool CharCodeRange::isWithinRange(CharCode code) const +{ + if(ranges.empty()) + return true; + + for(std::vector<std::pair<CharCode, CharCode> >::const_iterator i = ranges.begin(); i != ranges.end(); i++) + { + if(code >= i->first && code <= i->second) + return true; + } + + return false; +} + +/************************ +* ComputationRect +************************/ + +ComputationRect::ComputationRect(const Ogre::String& texFilename, const Ogre::String& resourceGroup) + : x(0), y(0), isPlaced(false), isFontGlyph(false), filename(texFilename) +{ + image.load(texFilename, resourceGroup); + width = (int)image.getWidth(); + height = (int)image.getHeight(); + area = width * height; +} + +ComputationRect::ComputationRect(const Ogre::String& texName, unsigned char* buffer, int width, int height) + : x(0), y(0), isPlaced(false), isFontGlyph(false), filename(texName) +{ + image.loadDynamicImage(buffer, width, height, 1, Ogre::PF_BYTE_BGRA, true); + this->width = (int)image.getWidth(); + this->height = (int)image.getHeight(); + area = this->width * this->height; +} + +ComputationRect::ComputationRect(const Ogre::String& fontFilename, Ogre::uint fontSize, CharCode charCode, unsigned char* buffer, int width, int height) + : x(0), y(0), isPlaced(false), isFontGlyph(true), filename(fontFilename), fontSize(fontSize), charCode(charCode) +{ + image.loadDynamicImage(buffer, width, height, 1, Ogre::PF_BYTE_LA, true); + this->width = (int)image.getWidth(); + this->height = (int)image.getHeight(); + area = this->width * this->height; +} + +/************************ +* FontFaceDefinition +************************/ + +FontFaceDefinition::FontFaceDefinition(const Ogre::String& filename, const CharCodeRange& codeRange, short renderType) : filename(filename), codeRange(codeRange), renderType(renderType) +{ +} + +void FontFaceDefinition::addSize(Ogre::uint fontSize) +{ + sizes.push_back(fontSize); +} + +/************************ +* FontFace +************************/ + +FontFace::FontFace() +{ +} + +FontFace::FontFace(const FontFaceDefinition& definition, const Ogre::String& resourceGroup, ComputationVector& renderContext) +{ + FT_Library library; + FT_Face face; + FT_Error error; + + error = FT_Init_FreeType(&library); + if(error) + OGRE_EXCEPT(Ogre::Exception::ERR_INTERNAL_ERROR, "Could not load FreeType library.", "FontFace::FontFace"); + + Ogre::DataStreamPtr dataStream = Ogre::ResourceGroupManager::getSingleton().openResource(definition.filename, resourceGroup); + Ogre::MemoryDataStream stream(dataStream); + + error = FT_New_Memory_Face(library, stream.getPtr(), (FT_Long)stream.size(), 0, &face); + if(error) + OGRE_EXCEPT(Ogre::Exception::ERR_INTERNAL_ERROR, "FreeType could not load a font-face.", "FontFace::FontFace"); + + + for(std::vector<Ogre::uint>::const_iterator i = definition.sizes.begin(); i != definition.sizes.end(); i++) + { + FT_ULong charCode = 0; + FT_UInt glyphIndex = 1; + + error = FT_Set_Pixel_Sizes(face, 0, (FT_UInt)*i); + if(error) + OGRE_EXCEPT(Ogre::Exception::ERR_INTERNAL_ERROR, "FreeType could not set a font-size.", "FontFace::FontFace"); + + fontMetrics[*i] = FontMetrics(face->size->metrics.ascender / 64.0f, face->size->metrics.descender / 64.0f, + face->size->metrics.height / 64.0f, face->size->metrics.max_advance / 64.0f); + + for(charCode = FT_Get_First_Char(face, &glyphIndex); glyphIndex != 0; charCode = FT_Get_Next_Char(face, charCode, &glyphIndex)) + { + if(!definition.codeRange.isWithinRange(charCode)) + continue; + + if(definition.renderType == FontFaceDefinition::BetterContrast) + { + error = FT_Load_Glyph(face, glyphIndex, FT_LOAD_DEFAULT); + if(error) + continue; + + error = FT_Render_Glyph(face->glyph, FT_RENDER_MODE_NORMAL); + if(error) + continue; + } + else + { + error = FT_Load_Glyph(face, glyphIndex, FT_LOAD_TARGET_LIGHT); + if(error) + continue; + + error = FT_Render_Glyph(face->glyph, FT_RENDER_MODE_LIGHT); + if(error) + continue; + } + + FT_Bitmap& bitmap = face->glyph->bitmap; + FT_Glyph_Metrics& metrics = face->glyph->metrics; + + if(!bitmap.buffer || (!bitmap.rows && !bitmap.width)) + continue; + + unsigned char* buffer = new unsigned char[bitmap.rows * bitmap.pitch * 2]; + + for(int idx = 0; idx < bitmap.rows * bitmap.pitch; idx++) + { + buffer[idx * 2] = 255; + buffer[idx * 2 + 1] = bitmap.buffer[idx]; + } + + fontSizes[*i][charCode] = GlyphInfo(metrics.horiBearingX / 64.0f, metrics.horiBearingY / 64.0f, metrics.horiAdvance / 64.0f); + + renderContext.push_back(new ComputationRect(definition.filename, (Ogre::uint)*i, charCode, buffer, bitmap.pitch, bitmap.rows)); + } + } +} + +/************************ +* Atlas +************************/ + +Atlas::Atlas(const std::vector<Ogre::String>& textureFilenames, const std::vector<FontFaceDefinition>& fonts, const Ogre::String& resourceGroup) +{ + Ogre::LogManager::getSingleton().logMessage("Loading an Atlas."); + Ogre::Timer timer; + + ComputationVector rectangles; + + for(std::vector<FontFaceDefinition>::const_iterator i = fonts.begin(); i != fonts.end(); i++) + { + fontFaces[i->filename] = FontFace(*i, resourceGroup, rectangles); + } + + for(std::vector<Ogre::String>::const_iterator i = textureFilenames.begin(); i != textureFilenames.end(); i++) + { + rectangles.push_back(new ComputationRect(*i, resourceGroup)); + } + + unsigned char* vcolBuffer = new unsigned char[16]; + memset(vcolBuffer, 255, 16); + + rectangles.push_back(new ComputationRect("VertexColor", vcolBuffer, 2, 2)); + + guessDimensions(rectangles); + pack(rectangles); + paint(rectangles); + + int glyphCount = 0; + int texCount = -1; // Subtract the default VertexColor texture + ComputationRect* rect; + + for(ComputationVector::iterator i = rectangles.begin(); i != rectangles.end(); i++) + { + rect = (*i); + + if(rect->isFontGlyph) + { + fontFaces[rect->filename].fontSizes[rect->fontSize][rect->charCode].texInfo = TextureInfo(dimensions.first, dimensions.second, rect->x, rect->y, rect->width, rect->height); + glyphCount++; + } + else + { + textures[rect->filename] = TextureInfo(dimensions.first, dimensions.second, rect->x, rect->y, rect->width, rect->height); + texCount++; + } + + delete rect; + } + + Ogre::LogManager::getSingleton().logMessage("Atlas loaded in " + Ogre::StringConverter::toString(timer.getMilliseconds() / 1000.0f) + + "s. Packed " + Ogre::StringConverter::toString(glyphCount) + " font glyphs and " + Ogre::StringConverter::toString(texCount) + + " textures into " + Ogre::StringConverter::toString(dimensions.first) + "x" + Ogre::StringConverter::toString(dimensions.second)); +} + +const std::pair<int, int>& Atlas::getDimensions() const +{ + return dimensions; +} + +const Ogre::String& Atlas::getMaterialName() const +{ + return materialName; +} + +const TextureInfo& Atlas::getTextureInfo(const Ogre::String& filename) const +{ + std::map<Ogre::String, TextureInfo>::const_iterator i = textures.find(filename); + static TextureInfo empty; + + if(i != textures.end()) + return i->second; + + return empty; +} + +const FontMetrics& Atlas::getFontMetrics(const Ogre::String& fontFilename, Ogre::uint fontSize) const +{ + std::map<Ogre::String, FontFace>::const_iterator font = fontFaces.find(fontFilename); + static FontMetrics empty; + + if(font == fontFaces.end()) + return empty; + + FontMetricsMap::const_iterator iter = font->second.fontMetrics.find(fontSize); + + if(iter == font->second.fontMetrics.end()) + return empty; + + return iter->second; +} + +const GlyphMap& Atlas::getGlyphMap(const Ogre::String& fontFilename, Ogre::uint fontSize) const +{ + std::map<Ogre::String, FontFace>::const_iterator font = fontFaces.find(fontFilename); + static GlyphMap empty; + + if(font == fontFaces.end()) + return empty; + + FontSizeMap::const_iterator size = font->second.fontSizes.find(fontSize); + + if(size == font->second.fontSizes.end()) + return empty; + + return size->second; +} + +const GlyphInfo& Atlas::getGlyphInfo(const Ogre::String& fontFilename, Ogre::uint fontSize, CharCode charCode) const +{ + std::map<Ogre::String, FontFace>::const_iterator font = fontFaces.find(fontFilename); + static GlyphInfo empty; + + if(font == fontFaces.end()) + return empty; + + FontSizeMap::const_iterator size = font->second.fontSizes.find(fontSize); + + if(size == font->second.fontSizes.end()) + return empty; + + GlyphMap::const_iterator glyph = size->second.find(charCode); + + if(glyph == size->second.end()) + return empty; + + return glyph->second; +} + +void Atlas::guessDimensions(const ComputationVector& rectangles) +{ + int totalArea = 0; + int maxWidth = 0; + int maxHeight = 0; + + for(ComputationVector::const_iterator i = rectangles.begin(); i != rectangles.end(); i++) + { + totalArea += (*i)->area; + maxWidth = std::max(maxWidth, (*i)->width); + maxHeight = std::max(maxHeight, (*i)->height); + } + + int squareRoot = (int)sqrt((double)totalArea); + + dimensions.first = Ogre::Bitwise::firstPO2From(std::max(squareRoot, maxWidth)); + dimensions.second = Ogre::Bitwise::firstPO2From(std::max(squareRoot, maxHeight)); +} + +void Atlas::pack(ComputationVector& rectangles) +{ + struct compare { bool operator()(ComputationRect* a, ComputationRect* b){ return(a->area > b->area); }}; + std::sort(rectangles.begin(), rectangles.end(), compare()); + + while(true) + { + for(ComputationVector::iterator i = rectangles.begin(); i != rectangles.end(); i++) + { + (*i)->isPlaced = false; + (*i)->x = -1; + (*i)->y = -1; + } + + int successCount = 0; + fill(rectangles, 0, 0, dimensions.first - 1, dimensions.second - 1, successCount); + + if(successCount == (int)rectangles.size()) + break; + + static bool toggle = false; + toggle = !toggle; + + if(toggle) + dimensions.first = Ogre::Bitwise::firstPO2From(dimensions.first + 1); + else + dimensions.second = Ogre::Bitwise::firstPO2From(dimensions.second + 1); + } +} + +void Atlas::fill(ComputationVector& rectangles, int x1, int y1, int x2, int y2, int& count) +{ + ComputationVector::iterator iter; + + for(iter = rectangles.begin(); iter != rectangles.end(); iter++) + { + if((!(*iter)->isPlaced) && (x2 - x1 + 1 >= (*iter)->width) && (y2 - y1 + 1 >= (*iter)->height)) + break; + } + + if(iter == rectangles.end()) + return; + + ComputationRect* rect = *iter; + + rect->x = x1; + rect->y = y1; + rect->isPlaced = true; + count++; + + int aRight = (x2 - x1 + 1 - rect->width) * rect->height; + int aDown = (y2 - y1 + 1 - rect->height) * rect->width; + if(aRight < aDown) + { + if(y1 + rect->height < y2) + fill(rectangles, x1, y1 + rect->height, x2, y2, count); + + if((x1 + rect->width < x2) && (y1 < y1 + rect->height - 1)) + fill(rectangles, x1 + rect->width, y1, x2, y1 + rect->height - 1, count); + } + else + { + if(x1 + rect->width < x2) + fill(rectangles, x1 + rect->width, y1, x2, y2, count); + + if((y1 + rect->height < y2) && (x1 < x1 + rect->width - 1)) + fill(rectangles, x1, y1 + rect->height, x1 + rect->width - 1, y2, count); + } +} + +void Atlas::paint(const ComputationVector& rectangles) +{ + static unsigned int count = 0; + Ogre::String texName = "AtlasTexture_" + Ogre::StringConverter::toString(count); + materialName = "AtlasMaterial_" + Ogre::StringConverter::toString(count); + + Ogre::TexturePtr texture = Ogre::TextureManager::getSingleton().createManual( + texName, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, + Ogre::TEX_TYPE_2D, dimensions.first, dimensions.second, 0, Ogre::PF_BYTE_BGRA, + Ogre::TU_STATIC_WRITE_ONLY); + + Ogre::HardwarePixelBufferSharedPtr pixelBuffer = texture->getBuffer(); + pixelBuffer->lock(Ogre::HardwareBuffer::HBL_DISCARD); + const Ogre::PixelBox& pixelBox = pixelBuffer->getCurrentLock(); + size_t dstBpp = Ogre::PixelUtil::getNumElemBytes(pixelBox.format); + size_t dstPitch = pixelBox.rowPitch * dstBpp; + + Ogre::uint8* dstData = static_cast<Ogre::uint8*>(pixelBox.data); + + for(ComputationVector::const_iterator i = rectangles.begin(); i != rectangles.end(); i++) + { + unsigned char* conversionBuf = 0; + Ogre::PixelBox srcPixels = (*i)->image.getPixelBox(); + + if((*i)->image.getFormat() != Ogre::PF_BYTE_BGRA) + { + conversionBuf = new unsigned char[(*i)->image.getWidth() * (*i)->image.getHeight() * dstBpp]; + Ogre::PixelBox convPixels(Ogre::Box(0, 0, (*i)->width, (*i)->height), Ogre::PF_BYTE_BGRA, conversionBuf); + Ogre::PixelUtil::bulkPixelConversion((*i)->image.getPixelBox(), convPixels); + srcPixels = convPixels; + } + + size_t srcPitch = srcPixels.rowPitch * dstBpp; + Ogre::uint8* srcData = static_cast<Ogre::uint8*>(srcPixels.data); + + for(size_t row = 0; row < (*i)->image.getHeight(); row++) + { + for(size_t col = 0; col < srcPitch; col++) + { + dstData[((row + (*i)->y) * dstPitch) + ((*i)->x * dstBpp) + col] = srcData[(row * srcPitch) + col]; + } + } + + if(conversionBuf) + delete[] conversionBuf; + } + + pixelBuffer->unlock(); + + Ogre::MaterialPtr material = Ogre::MaterialManager::getSingleton().create(materialName, + Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME); + Ogre::Pass* pass = material->getTechnique(0)->getPass(0); + pass->setDepthCheckEnabled(false); + pass->setDepthWriteEnabled(false); + pass->setLightingEnabled(false); + pass->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA); + + Ogre::TextureUnitState* texUnit = pass->createTextureUnitState(texName); + texUnit->setTextureFiltering(Ogre::FO_NONE, Ogre::FO_NONE, Ogre::FO_NONE); + + count++; +} +} // namespace Added: trunk/python-ogre/ThirdParty/canvas/Atlas.h =================================================================== --- trunk/python-ogre/ThirdParty/canvas/Atlas.h (rev 0) +++ trunk/python-ogre/ThirdParty/canvas/Atlas.h 2008-12-05 07:18:28 UTC (rev 827) @@ -0,0 +1,270 @@ +/* + This file is part of Canvas, a fast, lightweight 2D graphics engine for Ogre3D. + + Copyright (C) 2008 Adam J. Simmons + ajs...@gm... + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef __Atlas__ +#define __Atlas__ + +#include "Ogre.h" +#include "OgreBitwise.h" +#include <map> +#include <vector> +#include <algorithm> + +#include <ft2build.h> +#include FT_FREETYPE_H +#include FT_GLYPH_H + +namespace CanvasNS +{ +/** +* TextureInfo represents a texture within an Atlas instance. +* Contains the actual dimensions of a texture and its location within the atlas. +*/ +struct TextureInfo +{ + bool isEmpty; + Ogre::FloatRect texCoords; + int width, height; + + TextureInfo(); + TextureInfo(int atlasWidth, int atlasHeight, int x, int y, int width, int height); +}; + +/** +* GlyphInfo represents a glyph within an Atlas instance. +* Contains glyph metrics which can be used for text layout purposes. +* See: http://freetype.sourceforge.net/freetype2/docs/glyphs/glyphs-3.html +*/ +struct GlyphInfo +{ + Ogre::Real bearingX; + Ogre::Real bearingY; + Ogre::Real advance; + + TextureInfo texInfo; + + GlyphInfo(); + GlyphInfo(Ogre::Real bearingX, Ogre::Real bearingY, Ogre::Real advance); +}; + +/** +* FontMetrics represents the scaled global metrics for a certain font size. +* Contains font metrics which can be used for text layout purposes. +* +* <ul> +* <li>ascender - The typographic ascender of the face, expressed in Real pixels. +* <li>descender - The typographic descender of the face, expressed in Real pixels. +* <li>height - The height is the vertical distance between two consecutive baselines, expressed in Real pixels. +* <li>maxAdvance - The maximal advance width, in Real pixels, for all glyphs in this face. This can be used to make word wrapping computations faster. +* </ul> +*/ +struct FontMetrics +{ + Ogre::Real ascender; + Ogre::Real descender; + Ogre::Real height; + Ogre::Real maxAdvance; + + FontMetrics(); + FontMetrics(Ogre::Real ascender, Ogre::Real descender, Ogre::Real height, Ogre::Real maxAdvance); +}; + +typedef Ogre::uint32 CharCode; + +/** +* CharCodeRange is used to specify the ranges of characters that a font should load. +* For convenience, two common unicode ranges (BasicLatin & Latin1) have been already defined. +*/ +struct CharCodeRange +{ + std::vector<std::pair<CharCode, CharCode> > ranges; + + CharCodeRange(); + CharCodeRange(CharCode from, CharCode to); + + /** + * Add a range of characters to the definition. + * + * @param from The beginning of the range, inclusive. + * @param to The end of the range, inclusive. + */ + void addRange(CharCode from, CharCode to); + + /** + * Test if a character code is within this CharCodeRange. + * + * @return True if a character code is within any of the ranges, false otherwise. + */ + bool isWithinRange(CharCode code) const; + + static const CharCodeRange BasicLatin; + static const CharCodeRange Latin1; + static const CharCodeRange All; +}; + +/** +* Defines a font-face for Atlas initialization purposes. +*/ +struct FontFaceDefinition +{ + Ogre::String filename; + std::vector<Ogre::uint> sizes; + CharCodeRange codeRange; + short renderType; + + /** + * Specifies the type of rendering that this font should use. + * <ul> + * <li>BetterContrast - Sharper text, more like Windows' font rendering. + * <li>BetterShape - Smoother text, more like MacOSX's font rendering. + * </ul> + */ + enum RenderType + { + BetterContrast, + BetterShape + }; + + /** + * Constructs a FontFaceDefinition + * + * @param filename The filename of the font-face. + * @param codeRange The range of CharCode's to render for this font-face. + * @param renderType Optional; the type of rendering to use for this font-face. + */ + FontFaceDefinition(const Ogre::String& filename, const CharCodeRange& codeRange = CharCodeRange::BasicLatin, short renderType = FontFaceDefinition::BetterContrast); + + /** + * Adds a font-size (in px) to this font-face definition. + */ + void addSize(Ogre::uint fontSize); +}; + +struct ComputationRect +{ + int width, height; + int x, y; + int area; + bool isPlaced; + + Ogre::String filename; + bool isFontGlyph; + Ogre::uint fontSize; + CharCode charCode; + + Ogre::Image image; + + ComputationRect(const Ogre::String& texFilename, const Ogre::String& resourceGroup); + ComputationRect(const Ogre::String& texName, unsigned char* buffer, int width, int height); + ComputationRect(const Ogre::String& fontFilename, Ogre::uint fontSize, CharCode charCode, unsigned char* buffer, int width, int height); + +}; + +typedef std::vector<ComputationRect*> ComputationVector; + +typedef std::map<CharCode, GlyphInfo> GlyphMap; +typedef std::map<Ogre::uint, GlyphMap> FontSizeMap; +typedef std::map<Ogre::uint, FontMetrics> FontMetricsMap; + +struct FontFace +{ + FontSizeMap fontSizes; + FontMetricsMap fontMetrics; + + FontFace(); + + FontFace(const FontFaceDefinition& definition, const Ogre::String& resourceGroup, ComputationVector& renderContext); +}; + +/** +* The work-horse of Canvas; Atlas is a programmatic texture-atlas that can hold textures and font-glyphs. +*/ +class Atlas +{ + std::map<Ogre::String, FontFace> fontFaces; + std::map<Ogre::String, TextureInfo> textures; + std::pair<int, int> dimensions; + Ogre::String materialName; + + void guessDimensions(const ComputationVector& rectangles); + void pack(ComputationVector& rectangles); + void fill(ComputationVector& rectangles, int x1, int y1, int x2, int y2, int& count); + void paint(const ComputationVector& rectangles); + +public: + /** + * Constructs an Atlas. + * + * @param textureFilenames The filenames of the textures to load into this atlas. + * @param fonts The fonts to load into this atlas. + * @param resourceGroup The name of the resource group where the textures and fonts can be found. + */ + Atlas(const std::vector<Ogre::String>& textureFilenames, const std::vector<FontFaceDefinition>& fonts, const Ogre::String& resourceGroup); + + /** + * Retrieve the dimensions of this atlas, in pixels. + */ + const std::pair<int, int>& getDimensions() const; + + /** + * Retrieve the name of the internal material + */ + const Ogre::String& getMaterialName() const; + + /** + * Retrieve info about a certain texture within this atlas. + * + * @note If the filename is not found, the returned TextureInfo's member "isEmpty" will be true. + * + * @param filename The filename of the texture to look up. + */ + const TextureInfo& getTextureInfo(const Ogre::String& filename) const; + + /** + * Retrieve the metrics for a certain font size. + * + * @param fontFilename The filename of the font to look up. + * @param fontSize The font size to look up. + */ + const FontMetrics& getFontMetrics(const Ogre::String& fontFilename, Ogre::uint fontSize) const; + + /** + * Retrieve the GlyphMap for a certain font size. + * + * @param fontFilename The filename of the font to look up. + * @param fontSize The font size to look up. + */ + const GlyphMap& getGlyphMap(const Ogre::String& fontFilename, Ogre::uint fontSize) const; + + /** + * Retrieve info about a certain font glyph within this atlas. + * + * @param fontFilename The filename of the font-face. + * @param fontSize The size of the font. + * @param charCode The CharCode to look up. + * + * @note If the filename, size, or CharCode is not found, the returned GlyphInfo will contain a TextureInfo with + * the member "isEmpty" set to true. + */ + const GlyphInfo& getGlyphInfo(const Ogre::String& fontFilename, Ogre::uint fontSize, CharCode charCode) const; +}; +} //namespace +#endif Added: trunk/python-ogre/ThirdParty/canvas/Canvas.cpp =================================================================== --- trunk/python-ogre/ThirdParty/canvas/Canvas.cpp (rev 0) +++ trunk/python-ogre/ThirdParty/canvas/Canvas.cpp 2008-12-05 07:18:28 UTC (rev 827) @@ -0,0 +1,692 @@ +/* + This file is part of Canvas, a fast, lightweight 2D graphics engine for Ogre3D. + + Copyright (C) 2008 Adam J. Simmons + ajs...@gm... + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "Canvas.h" + +using namespace Ogre; + +namespace CanvasNS +{ +/************************ +* Fill +************************/ + +Fill::Fill() : isEmpty(true) +{ +} + +Fill::Fill(const Ogre::ColourValue& color) : isEmpty(false), atlasKey("VertexColor") +{ + coloring.colors.first = color; + coloring.hasGradient = false; +} + +Fill::Fill(const Ogre::ColourValue& gradientColor1, const Ogre::ColourValue& gradientColor2, short orientation) : isEmpty(false), atlasKey("VertexColor") +{ + coloring.colors.first = gradientColor1; + coloring.colors.second = gradientColor2; + coloring.hasGradient = true; + coloring.orientation = orientation; +} + +Fill::Fill(const Ogre::String& texture, const Ogre::ColourValue& color) : isEmpty(false), atlasKey(texture) +{ + coloring.colors.first = color; + coloring.hasGradient = false; +} + +Fill::Fill(const Ogre::String& texture, const Ogre::ColourValue& gradientColor1, const Ogre::ColourValue& gradientColor2, short orientation) : isEmpty(false), atlasKey(texture) +{ + coloring.colors.first = gradientColor1; + coloring.colors.second = gradientColor2; + coloring.hasGradient = true; + coloring.orientation = orientation; +} + +/************************ +* Border +************************/ + +Border::Border() : isEmpty(true) +{ +} + +Border::Border(int width, const Ogre::ColourValue& color) : widths(width, width, width, width), colors(color, color, color, color), isEmpty(false) +{ +} + +Border::Border(const WidthRect& widths, const ColorRect& colors) : widths(widths), colors(colors), isEmpty(false) +{ +} + +/************************ +* Canvas +************************/ + +Canvas::Canvas(Atlas* atlas, Ogre::Viewport* viewport) : atlas(atlas), viewport(viewport), vertexData(0), indexData(0), + bufferSize(100), renderQueueID(Ogre::RENDER_QUEUE_OVERLAY), isDirty(false), visibility(true) +{ + viewport->getTarget()->addListener(this); + material = Ogre::MaterialManager::getSingleton().getByName(atlas->getMaterialName()); + setUseIdentityProjection(true); + setUseIdentityView(true); + + resizeBuffers(); + clearClip(); +} + + +Canvas::~Canvas() +{ + destroyBuffers(); + viewport->getTarget()->removeListener(this); +} + +void Canvas::drawRectangle(int x, int y, int width, int height, const Fill& fill, const Border& border) +{ + PixelRect rect(x, y, x + width, y + height); + + if(border.isEmpty) + { + if(isOutsideClip(rect)) + return; + } + else + { + if(isOutsideClip(PixelRect(rect.left - border.widths.left, rect.top - border.widths.top, rect.right + border.widths.right, rect.bottom + border.widths.bottom))) + return; + } + + if(!fill.isEmpty) + { + TextureInfo texInfo = atlas->getTextureInfo(fill.atlasKey); + if(texInfo.isEmpty) + return; + + // Draw a simple rectangle with the normal texture-coordinates at each corner + if(fill.atlasKey == "VertexColor" || (width == texInfo.width && height == texInfo.height)) + { + drawQuad(rect, texInfo.texCoords, fill.coloring); + } + else // Draw a tiled rectangle, may contain multiple quads to give the illusion that the texture is "tiling" + { + Ogre::Real xMax = width / (double)texInfo.width; + Ogre::Real yMax = height / (double)texInfo.height; + + Ogre::Real right = 0; + Ogre::Real bottom = 0; + + for(Ogre::Real left = 0; left < Ogre::Math::Ceil(xMax); left++) + { + for(Ogre::Real top = 0; top < Ogre::Math::Ceil(yMax); top++) + { + if(left + 1 > xMax) + right = xMax; + else + right = left + 1; + + if(top + 1 > yMax) + bottom = yMax; + else + bottom = top + 1; + + PixelRect tile(x + (left * texInfo.width), y + (top * texInfo.height), x + (right * texInfo.width), y + (bottom * texInfo.height)); + + if(isOutsideClip(tile)) + continue; + + Ogre::FloatRect texCoords = texInfo.texCoords; + texCoords.right = texCoords.left + (right - left) * (texCoords.width()); + texCoords.bottom = texCoords.top + (bottom - top) * (texCoords.height()); + + Coloring coloring = fill.coloring; + if(coloring.hasGradient) + { + Ogre::Real amount1, amount2; + + if(coloring.orientation == Coloring::Vertical) + { + amount1 = top / yMax; + amount2 = bottom / yMax; + } + else + { + amount1 = left / xMax; + amount2 = right / xMax; + } + + coloring.colors.first = (fill.coloring.colors.first * (1 - amount1)) + (fill.coloring.colors.second * amount1); + coloring.colors.second = (fill.coloring.colors.first * (1 - amount2)) + (fill.coloring.colors.second * amount2); + } + + drawQuad(tile, texCoords, coloring); + } + } + } + } + + // Draw the four sides of the border, if present + if(!border.isEmpty) + { + Ogre::FloatRect vColCoords = atlas->getTextureInfo("VertexColor").texCoords; + Corners<Ogre::Vector2> corners; + + PixelRect bRect(rect.left - border.widths.left, rect.top - border.widths.top, rect.right + border.widths.right, rect.bottom + border.widths.bottom); + + // Left Border + if(!isOutsideClip(PixelRect(bRect.left, bRect.top, rect.left, bRect.bottom))) + { + corners.topLeft = Ogre::Vector2(bRect.left, bRect.top); + corners.bottomLeft = Ogre::Vector2(bRect.left, bRect.bottom); + corners.bottomRight = Ogre::Vector2(rect.left, rect.bottom); + corners.topRight = Ogre::Vector2(rect.left, rect.top); + + drawQuad(corners, vColCoords, border.colors.left); + } + + // Bottom Border + if(!isOutsideClip(PixelRect(bRect.left, rect.bottom, bRect.right, bRect.bottom))) + { + corners.topLeft = Ogre::Vector2(rect.left, rect.bottom); + corners.bottomLeft = Ogre::Vector2(bRect.left, bRect.bottom); + corners.bottomRight = Ogre::Vector2(bRect.right, bRect.bottom); + corners.topRight = Ogre::Vector2(rect.right, rect.bottom); + + drawQuad(corners, vColCoords, border.colors.bottom); + } + + // Right Border + if(!isOutsideClip(PixelRect(rect.right, bRect.top, bRect.right, bRect.bottom))) + { + corners.topLeft = Ogre::Vector2(rect.right, rect.top); + corners.bottomLeft = Ogre::Vector2(rect.right, rect.bottom); + corners.bottomRight = Ogre::Vector2(bRect.right, bRect.bottom); + corners.topRight = Ogre::Vector2(bRect.right, bRect.top); + + drawQuad(corners, vColCoords, border.colors.right); + } + + // Top Border + if(!isOutsideClip(PixelRect(bRect.left, bRect.top, bRect.right, rect.top))) + { + corners.topLeft = Ogre::Vector2(bRect.left, bRect.top); + corners.bottomLeft = Ogre::Vector2(rect.left, rect.top); + corners.bottomRight = Ogre::Vector2(rect.right, rect.top); + corners.topRight = Ogre::Vector2(bRect.right, bRect.top); + + drawQuad(corners, vColCoords, border.colors.top); + } + } +} + +void Canvas::drawGlyph(const GlyphInfo& glyph, int x, int y, int width, int height, const Ogre::ColourValue& color) +{ + if(glyph.texInfo.isEmpty) + return; + + PixelRect rect(x, y, x + width, y + height); + + if(isOutsideClip(rect)) + return; + + Coloring coloring; + coloring.colors.first = color; + coloring.hasGradient = false; + + drawQuad(rect, glyph.texInfo.texCoords, coloring); +} + +void Canvas::clear() +{ + quadList.clear(); + isDirty = true; +} + +void Canvas::setClip(int left, int top, int right, int bottom) +{ + clip.left = left; + clip.top = top; + clip.right = right; + clip.bottom = bottom; +} + +void Canvas::clearClip() +{ + clip.left = 0; + clip.top = 0; + clip.right = viewport->getActualWidth(); + clip.bottom = viewport->getActualHeight(); +} + +const Ogre::MaterialPtr& Canvas::getMaterial() const +{ + return material; +} + +void Canvas::getRenderOperation(Ogre::RenderOperation& op) +{ + op.operationType = Ogre::RenderOperation::OT_TRIANGLE_LIST; + + op.vertexData = vertexData; + op.vertexData->vertexStart = 0; + op.vertexData->vertexCount = quadList.size() * 4; + + op.useIndexes = true; + op.indexData = indexData; + op.indexData->indexStart = 0; + op.indexData->indexCount = quadList.size() * 6; +} + +void Canvas::getWorldTransforms(Ogre::Matrix4* xform) const +{ + xform[0] = this->_getParentNodeFullTransform(); +} + +const Ogre::Quaternion& Canvas::getWorldOrientation() const +{ + return this->getParentNode()->_getDerivedOrientation(); +} + +const Ogre::Vector3& Canvas::getWorldPosition() const +{ + return this->getParentNode()->_getDerivedPosition(); +} + +Ogre::Real Canvas::getSquaredViewDepth(const Ogre::Camera* cam) const +{ + Ogre::Node* node = this->getParentNode(); + assert(node); + return node->getSquaredViewDepth(cam); +} + +const Ogre::LightList& Canvas::getLights() const +{ + return this->queryLights(); +} + +const Ogre::String& Canvas::getMovableType() const +{ + static Ogre::String typeName("Canvas"); + + return typeName; +} + +const Ogre::AxisAlignedBox& Canvas::getBoundingBox() const +{ + static Ogre::AxisAlignedBox box; + box.setInfinite(); + + return box; +} + +Ogre::Real Canvas::getBoundingRadius() const +{ + return 2.0; +} + +void Canvas::_updateRenderQueue(Ogre::RenderQueue* queue) +{ + resizeBuffers(); + updateGeometry(); + + queue->addRenderable(this, renderQueueID); +} + +void Canvas::setVisible(bool visible) +{ + mVisible = visibility = visible; +} + +bool Canvas::isVisible() const +{ + if (!visibility || mBeyondFarDistance || mRenderingDisabled) + return false; + + SceneManager* sm = Root::getSingleton()._getCurrentSceneManager(); + if (sm && !(mVisibilityFlags & sm->_getCombinedVisibilityMask())) + return false; + + return true; +} + +void Canvas::preRenderTargetUpdate(const Ogre::RenderTargetEvent& evt) +{ +} + +void Canvas::postRenderTargetUpdate(const Ogre::RenderTargetEvent& evt) +{ +} + +void Canvas::preViewportUpdate(const Ogre::RenderTargetViewportEvent& evt) +{ + if(evt.source == viewport && mVisible) + visibility = true; +} + +void Canvas::postViewportUpdate(const Ogre::RenderTargetViewportEvent& evt) +{ + if(evt.source == viewport && mVisible) + visibility = false; +} + +void Canvas::viewportAdded(const Ogre::RenderTargetViewportEvent& evt) +{ +} + +void Canvas::viewportRemoved(const Ogre::RenderTargetViewportEvent& evt) +{ +} + +void Canvas::destroyBuffers() +{ + if(vertexData) + { + delete vertexData; + vertexData = 0; + + buffer.setNull(); + } + + if(indexData) + { + delete indexData; + indexData = 0; + } +} + +void Canvas::resizeBuffers() +{ + if(bufferSize < quadList.size()) + { + bufferSize = quadList.size() * 2; + destroyBuffers(); + } + + if(!vertexData) + { + vertexData = new Ogre::VertexData(); + vertexData->vertexStart = 0; + vertexData->vertexCount = bufferSize * 4; + + Ogre::VertexDeclaration* decl = vertexData->vertexDeclaration; + Ogre::VertexBufferBinding* binding = vertexData->vertexBufferBinding; + + size_t offset = 0; + decl->addElement(0, offset, Ogre::VET_FLOAT3, Ogre::VES_POSITION); + offset += Ogre::VertexElement::getTypeSize(Ogre::VET_FLOAT3); + decl->addElement(0, offset, Ogre::VET_COLOUR, Ogre::VES_DIFFUSE); + offset += Ogre::VertexElement::getTypeSize(Ogre::VET_COLOUR); + decl->addElement(0, offset, Ogre::VET_FLOAT2, Ogre::VES_TEXTURE_COORDINATES, 0); + + buffer = Ogre::HardwareBufferManager::getSingleton().createVertexBuffer( + decl->getVertexSize(0), vertexData->vertexCount, Ogre::HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE); + binding->setBinding(0, buffer); + } + + if(!indexData) + { + indexData = new Ogre::IndexData(); + indexData->indexStart = 0; + indexData->indexCount = bufferSize * 6; + + indexData->indexBuffer = Ogre::HardwareBufferManager::getSingleton().createIndexBuffer( + Ogre::HardwareIndexBuffer::IT_16BIT, indexData->indexCount, Ogre::HardwareBuffer::HBU_STATIC_WRITE_ONLY); + + unsigned short* indexBuffer = (unsigned short*)indexData->indexBuffer->lock(0, indexData->indexBuffer->getSizeInBytes(), Ogre::HardwareBuffer::HBL_DISCARD); + + // Indexes are generated here because we know that we will only be rendering quads + // This means that we only have to handle updating the vertex buffer in Canvas::updateGeometry + for(size_t indexIdx, vertexIdx, quadIdx = 0; quadIdx < bufferSize; quadIdx++) + { + indexIdx = quadIdx * 6; + vertexIdx = quadIdx * 4; + + indexBuffer[indexIdx++] = (unsigned short)(vertexIdx + 0); + indexBuffer[indexIdx++] = (unsigned short)(vertexIdx + 2); + indexBuffer[indexIdx++] = (unsigned short)(vertexIdx + 1); + indexBuffer[indexIdx++] = (unsigned short)(vertexIdx + 1); + indexBuffer[indexIdx++] = (unsigned short)(vertexIdx + 2); + indexBuffer[indexIdx++] = (unsigned short)(vertexIdx + 3); + } + + indexData->indexBuffer->unlock(); + } +} + +bool Canvas::isOutsideClip(const PixelRect& rect) +{ + if(rect.left > clip.right) + return true; + else if(rect.right < clip.left) + return true; + else if(rect.top > clip.bottom) + return true; + else if(rect.bottom < clip.top) + return true; + + return false; +} + +void Canvas::localize(Ogre::Vector2& vertex) +{ + Ogre::Real xTexel = Ogre::Root::getSingleton().getRenderSystem()->getHorizontalTexelOffset(); + Ogre::Real yTexel = Ogre::Root::getSingleton().getRenderSystem()->getVerticalTexelOffset(); + + vertex.x = ((vertex.x + xTexel) / (Ogre::Real)viewport->getActualWidth()) * 2 - 1; + vertex.y = ((vertex.y + yTexel) / (Ogre::Real)viewport->getActualHeight()) * -2 + 1; +} + +void Canvas::drawQuad(const PixelRect& rect, const Ogre::FloatRect& texCoords, const Coloring& coloring) +{ + PixelRect clipped; + Ogre::FloatRect clippedTexCoords(texCoords); + Coloring clippedColoring = coloring; + + if(rect.left > clip.left) + { + clipped.left = rect.left; + } + else + { + clipped.left = clip.left; + Ogre::Real delta = (clipped.left - rect.left) / (float)rect.width(); + clippedTexCoords.left += delta * texCoords.width(); + + if(coloring.hasGradient && coloring.orientation == Coloring::Horizontal) + clippedColoring.colors.first = (coloring.colors.first * (1 - delta)) + (coloring.colors.second * delta); + } + + if(rect.top > clip.top) + { + clipped.top = rect.top; + } + else + { + clipped.top = clip.top; + Ogre::Real delta = (clipped.top - rect.top) / (float)rect.height(); + clippedTexCoords.top += delta * texCoords.height(); + + if(coloring.hasGradient && coloring.orientation == Coloring::Vertical) + clippedColoring.colors.first = (coloring.colors.first * (1 - delta)) + (coloring.colors.second * delta); + } + + if(rect.right < clip.right) + { + clipped.right = rect.right; + } + else + { + clipped.right = clip.right; + Ogre::Real delta = (clipped.right - rect.right) / (float)rect.width(); + clippedTexCoords.right += delta * texCoords.width(); + + if(coloring.hasGradient && coloring.orientation == Coloring::Horizontal) + clippedColoring.colors.second = (coloring.colors.first * (-delta)) + (coloring.colors.second * (1 + delta)); + } + + if(rect.bottom < clip.bottom) + { + clipped.bottom = rect.bottom; + } + else + { + clipped.bottom = clip.bottom; + Ogre::Real delta = (clipped.bottom - rect.bottom) / (float)rect.height(); + clippedTexCoords.bottom += delta * texCoords.height(); + + if(coloring.hasGradient && coloring.orientation == Coloring::Vertical) + clippedColoring.colors.second = (coloring.colors.first * (-delta)) + (coloring.colors.second * (1 + delta)); + } + + Canvas::Quad quad; + quad.vertices = Corners<Ogre::Vector2>(Ogre::Vector2(clipped.left, clipped.top), Ogre::Vector2(clipped.left, clipped.bottom), + Ogre::Vector2(clipped.right, clipped.bottom), Ogre::Vector2(clipped.right, clipped.top)); + + localize(quad.vertices.topLeft); + localize(quad.vertices.bottomLeft); + localize(quad.vertices.bottomRight); + localize(quad.vertices.topRight); + + quad.texCoords.topLeft = Ogre::Vector2(clippedTexCoords.left, clippedTexCoords.top); + quad.texCoords.bottomLeft = Ogre::Vector2(clippedTexCoords.left, clippedTexCoords.bottom); + quad.texCoords.bottomRight = Ogre::Vector2(clippedTexCoords.right, clippedTexCoords.bottom); + quad.texCoords.topRight = Ogre::Vector2(clippedTexCoords.right, clippedTexCoords.top); + + if(clippedColoring.hasGradient) + { + if(clippedColoring.orientation == Coloring::Vertical) + quad.colors = Corners<Ogre::ColourValue>(clippedColoring.colors.first, clippedColoring.colors.second, clippedColoring.colors.second, clippedColoring.colors.first); + else + quad.colors = Corners<Ogre::ColourValue>(clippedColoring.colors.first, clippedColoring.colors.first, clippedColoring.colors.second, clippedColoring.colors.second); + } + else + { + quad.colors = Corners<Ogre::ColourValue>(clippedColoring.colors.first); + } + + quadList.push_back(quad); + isDirty = true; +} + +void Canvas::drawQuad(const Corners<Ogre::Vector2>& corners, const Ogre::FloatRect& texCoords, const Ogre::ColourValue& color) +{ + Corners<Ogre::Vector2> clippedCorners; + clippedCorners.topLeft.x = corners.topLeft.x > clip.left ? corners.topLeft.x : clip.left; + clippedCorners.topLeft.y = corners.topLeft.y > clip.top ? corners.topLeft.y : clip.top; + clippedCorners.bottomLeft.x = corners.bottomLeft.x > clip.left ? corners.bottomLeft.x : clip.left; + clippedCorners.bottomLeft.y = corners.bottomLeft.y < clip.bottom ? corners.bottomLeft.y : clip.bottom; + clippedCorners.bottomRight.x = corners.bottomRight.x < clip.right ? corners.bottomRight.x : clip.right; + clippedCorners.bottomRight.y = corners.bottomRight.y < clip.bottom ? corners.bottomRight.y : clip.bottom; + clippedCorners.topRight.x = corners.topRight.x < clip.right ? corners.topRight.x : clip.right; + clippedCorners.topRight.y = corners.topRight.y > clip.top ? corners.topRight.y : clip.top; + + Canvas::Quad quad; + quad.vertices = clippedCorners; + + localize(quad.vertices.topLeft); + localize(quad.vertices.bottomLeft); + localize(quad.vertices.bottomRight); + localize(quad.vertices.topRight); + + quad.texCoords.topLeft = Ogre::Vector2(texCoords.left, texCoords.top); + quad.texCoords.bottomLeft = Ogre::Vector2(texCoords.left, texCoords.bottom); + quad.texCoords.bottomRight = Ogre::Vector2(texCoords.right, texCoords.bottom); + quad.texCoords.topRight = Ogre::Vector2(texCoords.right, texCoords.top); + + quad.colors = Corners<Ogre::ColourValue>(color); + + quadList.push_back(quad); + isDirty = true; +} + +void Canvas::updateGeometry() +{ + if(!isDirty) + return; + + float* vBuffer = (float*)buffer->lock(0, quadList.size() * buffer->getVertexSize() * 4, Ogre::HardwareBuffer::HBL_DISCARD); + + Ogre::RGBA color; + Ogre::RGBA* vBufferCol = 0; + + for(std::vector<Canvas::Quad>::iterator i = quadList.begin(); i != quadList.end(); i++) + { + // Top-Left Vertex + *vBuffer++ = i->vertices.topLeft.x; + *vBuffer++ = i->vertices.topLeft.y; + *vBuffer++ = 0; + + vBufferCol = (Ogre::RGBA*)vBuffer; + Ogre::Root::getSingleton().convertColourValue(i->colors.topLeft, &color); + *vBufferCol++ = color; + + vBuffer = (float*)vBufferCol; + + *vBuffer++ = i->texCoords.topLeft.x; + *vBuffer++ = i->texCoords.topLeft.y; + + // Top-Right Vertex + *vBuffer++ = i->vertices.topRight.x; + *vBuffer++ = i->vertices.topRight.y; + *vBuffer++ = 0; + + vBufferCol = (Ogre::RGBA*)vBuffer; + Ogre::Root::getSingleton().convertColourValue(i->colors.topRight, &color); + *vBufferCol++ = color; + + vBuffer = (float*)vBufferCol; + + *vBuffer++ = i->texCoords.topRight.x; + *vBuffer++ = i->texCoords.topRight.y; + + // Bottom-Left Vertex + *vBuffer++ = i->vertices.bottomLeft.x; + *vBuffer++ = i->vertices.bottomLeft.y; + *vBuffer++ = 0; + + vBufferCol = (Ogre::RGBA*)vBuffer; + Ogre::Root::getSingleton().convertColourValue(i->colors.bottomLeft, &color); + *vBufferCol++ = color; + + vBuffer = (float*)vBufferCol; + + *vBuffer++ = i->texCoords.bottomLeft.x; + *vBuffer++ = i->texCoords.bottomLeft.y; + + // Bottom-Right Vertex + *vBuffer++ = i->vertices.bottomRight.x; + *vBuffer++ = i->vertices.bottomRight.y; + *vBuffer++ = 0; + + vBufferCol = (Ogre::RGBA*)vBuffer; + Ogre::Root::getSingleton().convertColourValue(i->colors.bottomRight, &color); + *vBufferCol++ = color; + + vBuffer = (float*)vBufferCol; + + *vBuffer++ = i->texCoords.bottomRight.x; + *vBuffer++ = i->texCoords.bottomRight.y; + } + + buffer->unlock(); + isDirty = false; +} +} // namespace Added: trunk/python-ogre/ThirdParty/canvas/Canvas.h =================================================================== --- trunk/python-ogre/ThirdParty/canvas/Canvas.h (rev 0) +++ trunk/python-ogre/ThirdParty/canvas/Canvas.h 2008-12-05 07:18:28 UTC (rev 827) @@ -0,0 +1,278 @@ +/* + This file is part of Canvas, a fast, lightweight 2D graphics engine for Ogre3D. + + Copyright (C) 2008 Adam J. Simmons + ajs...@gm... + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef __Canvas_H__ +#define __Canvas_H__ + +#include <vector> +#include "Atlas.h" + +namespace CanvasNS +{ +class Canvas; + +/** +* An internal templated helper class. +*/ +template<typename T> struct Corners +{ + T topLeft, bottomLeft, bottomRight, topRight; + + Corners() + { + } + + Corners(const T& all) : topLeft(all), bottomLeft(all), bottomRight(all), topRight(all) + { + } + + Corners(const T& topLeft, const T& bottomLeft, const T& bottomRight, const T& topRight) : + topLeft(topLeft), bottomLeft(bottomLeft), bottomRight(bottomRight), topRight(topRight) + { + } +}; + +/** +* Internal structure, used to define solid fill colors/gradients. +*/ +struct Coloring +{ + std::pair<Ogre::ColourValue, Ogre::ColourValue> colors; + bool hasGradient; + short orientation; + + enum GradientOrientation + { + Vertical, + Horizontal + }; +}; + +/** +* Defines the "fill" (color, texture, gradient) for a shape drawn with Canvas. +*/ +struct Fill +{ + bool isEmpty; + Ogre::String atlasKey; + Coloring coloring; + + /** + * Create an empty fill. + */ + Fill(); + + /** + * Create a pure-color fill. + */ + Fill(const Ogre::ColourValue& color); + + /** + * Create a gradient fill. + * + * @param gradientColor1 In a vertical gradient, the top color, and in a horizontal gradient, the left color. + * @param gradientColor2 In a vertical gradient, the bottom color, and in a horizontal gradient, the right color. + * @param orientation The orientation of the gradient, can be either Coloring::Vertical or Coloring::Horizontal. + */ + Fill(const Ogre::ColourValue& gradientColor1, const Ogre::ColourValue& gradientColor2, short orientation = CanvasNS::Coloring::Vertical); + + /** + * Create a texture fill (must be loaded in current atlas) with an optional multiplied color. + * + * @param texture The filename of the texture, should be loaded in the current atlas. + * @param color The optional color to multiply the texture with. + */ + Fill(const Ogre::String& texture, const Ogre::ColourValue& color = Ogre::ColourValue::White); + + /** + * Create a texture fill (must be loaded in current atlas) with a multiplied gradient. + * + * @param texture The filename of the texture, should be loaded in the current atlas. + * @param gradientColor1 In a vertical gradient, the top color, and in a horizontal gradient, the left color. + * @param gradientColor2 In a vertical gradient, the bottom color, and in a horizontal gradient, the right color. + * @param orientation The orientation of the gradient, can be either Coloring::Vertical or Coloring::Horizontal. + */ + Fill(const Ogre::String& texture, const Ogre::ColourValue& gradientColor1, const Ogre::ColourValue& gradientColor2, short orientation = CanvasNS::Coloring::Vertical); +}; + +typedef Ogre::TRect<int> WidthRect; +typedef Ogre::TRect<int> ClipRect; +typedef Ogre::TRect<int> PixelRect; +typedef Ogre::TRect<Ogre::ColourValue> ColorRect; + +/** +* Defines the "border" for a rectangle drawn with Canvas. +*/ +struct Border +{ + bool isEmpty; + WidthRect widths; + ColorRect colors; + + /** + * Create an empty border. + */ + Border(); + + /** + * Create a border with a uniform pixel width and uniform color + * + * @param width The width, in pixels, for every side of the border. + * @param color The color for every side of the border. + */ + Border(int width, const Ogre::ColourValue& color); + + /** + * Create a border with custom pixel widths and colors for each side. + * + * @param widths The widths, in pixels, to use for each side. + * @param colors The colors to use for each side. + */ + Border(const WidthRect& widths, const ColorRect& colors); +}; + +/** +* The Canvas. +*/ +class Canvas : public Ogre::Renderable, public Ogre::MovableObject, public Ogre::RenderTargetListener +{ + struct Quad + { + Corners<Ogre::Vector2> vertices; + Corners<Ogre::Vector2> texCoords; + Corners<Ogre::ColourValue> colors; + }; + + Atlas* atlas; + std::vector<Canvas::Quad> quadList; + Ogre::HardwareVertexBufferSharedPtr buffer; + Ogre::VertexData* vertexData; + Ogre::IndexData* indexData; + size_t bufferSize; + Ogre::MaterialPtr material; + Ogre::Viewport* viewport; + Ogre::uint8 renderQueueID; + ClipRect clip; + bool isDirty; + bool visibility; + +public: + /** + * Constructs the canvas. + * + * @param atlas The texture atlas to use for this canvas. + * @param viewport The viewport that this canvas will display in. + */ + Canvas(Atlas* atlas, Ogre::Viewport* viewport); + + /** + * Destroys the canvas. + */ + ~Canvas(); + + /** + * Draws a rectangle on the canvas. + * + * @param x The x-coordinate of the origin, in pixels. + * @param y The y-coordinate of the origin, in pixels. + * @param width The width of the rectangle, in pixels. + * @param height The height of the rectangle, in pixels. + * @param fill The fill to use. + * @param border The optional border. + */ + void drawRectangle(int x, int y, int width, int height, const Fill& fill, const Border& border = Border()); + + /** + * Draws a glyph on the canvas. + * + * @param glyph The GlyphInfo of the glyph to draw (obtained from Atlas). + * @param x The x-coordinate of the origin, in pixels. + * @param y The y-coordinate of the origin, in pixels. + * @param width The width of the rectangle, in pixels. + * @param height The height of the rectangle, in pixels. + * @param color The color of the glyph. + */ + void drawGlyph(const GlyphInfo& glyph, int x, int y, int width, int height, const Ogre::ColourValue& color); + + /** + * Clears the canvas. + */ + void clear(); + + /** + * Sets the current clipping boundaries to use for subsequent draw calls. + * + * @param left The left-boundary, in pixels. + * @param top The top-boundary, in pixels. + * @param right The right-boundary, in pixels. + * @param bottom The bottom-boundary, in pixels. + */ + void setClip(int left, int top, int right, int bottom); + + /** + * Resets the current clipping boundaries to the dimensions of the viewport. + */ + void clearClip(); + + // Inherited from Ogre::Renderable + const Ogre::MaterialPtr& getMaterial() const; + void getRenderOperation(Ogre::RenderOperation& op); + void getWorldTransforms(Ogre::Matrix4* xform) const; + const Ogre::Quaternion& getWorldOrientation() const; + const Ogre::Vector3& getWorldPosition() const; + Ogre::Real getSquaredViewDepth(const Ogre::Camera* cam) const; + const Ogre::LightList& getLights() const; + + // Inherited from Ogre::MovableObject + const Ogre::String& getMovableType() const; + const Ogre::AxisAlignedBox& getBoundingBox() const; + Ogre::Real getBoundingRadius() const; + void _updateRenderQueue(Ogre::RenderQueue* queue); + void setVisible(bool visible); + bool isVisible() const; + + // Inherited from Ogre::RenderTargetListener + void preRenderTargetUpdate(const Ogre::RenderTargetEvent& evt); + void postRenderTargetUpdate(const Ogre::RenderTargetEvent& evt); + void preViewportUpdate(const Ogre::RenderTargetViewportEvent& evt); + void postViewportUpdate(const Ogre::RenderTargetViewportEvent& evt); + void viewportAdded(const Ogre::RenderTargetViewportEvent& evt); + void viewportRemoved(const Ogre::RenderTargetViewportEvent& evt); + +protected: + + void destroyBuffers(); + + void resizeBuffers(); + + void localize(Ogre::Vector2& vertex); + + bool isOutsideClip(const PixelRect& rect); + + void drawQuad(const PixelRect& rect, const Ogre::FloatRect& texCoords, const Coloring& coloring); + + void drawQuad(const Corners<Ogre::Vector2>& corners, const Ogre::FloatRect& texCoords, const Ogre::ColourValue& color); + + void updateGeometry(); +}; + +} // namespace +#endif Modified: trunk/python-ogre/environment.py =================================================================== --- trunk/python-ogre/environment.py 2008-12-04 13:12:10 UTC (rev 826) +++ trunk/python-ogre/environment.py 2008-12-05 07:18:28 UTC (rev 827) @@ -1863,6 +1863,28 @@ descText = "MyGUI Interface System" descLink = "http://sourceforge.net/projects/my-gui/" +class canvas: + active = False + pythonModule = True + version="1.0" + name='canvas' + parent="ogre/gui" + cflags = "" + include_dirs = [ Config.PATH_Boost, + Config.PATH_INCLUDE_canvas + , Config.PATH_INCLUDE_Ogre + ,Config.PATH_INCLUDE_Ogre_Dependencies + ] + lib_dirs = [Config.PATH_LIB_Boost + ,Config.PATH_LIB_Ogre_OgreMain + , Config.PATH_LIB_Ogre_Dependencies + ] + CheckIncludes=[] + libs=[ boost.lib, 'OgreMain', 'freetype235'] + ModuleName="canvas" + descText = "Canvas GUI System" + descLink = "http://www.ogre3d.org/phpBB2/viewtopic.php?t=41365&postdays=0&postorder=asc&start=0&sid=6578000180a935734beb03d548b900a4" + #######################################################################... [truncated message content] |
From: <mi...@us...> - 2008-12-08 08:36:05
|
Revision: 829 http://python-ogre.svn.sourceforge.net/python-ogre/?rev=829&view=rev Author: mithro Date: 2008-12-08 08:36:02 +0000 (Mon, 08 Dec 2008) Log Message: ----------- Fix a bunch of deb building related problems. Modified Paths: -------------- trunk/python-ogre/BuildModule.py trunk/python-ogre/boost/debian/control trunk/python-ogre/debian/changelog trunk/python-ogre/debian/rules trunk/python-ogre/debs/pygccxml-debian/rules Modified: trunk/python-ogre/BuildModule.py =================================================================== --- trunk/python-ogre/BuildModule.py 2008-12-05 07:54:34 UTC (rev 828) +++ trunk/python-ogre/BuildModule.py 2008-12-08 08:36:02 UTC (rev 829) @@ -198,7 +198,7 @@ for file in os.listdir(debiandir): if not os.path.isfile(os.path.join(debiandir, file)): continue - ret = spawnTask( "sed --in-place "+os.path.join(debiandir,file)+" -e\"s|%%SHORTDATE%%|`date +%Y%m%d`|\" -e\"s|%%LONGDATE%%|`date +'%a, %d %b %Y %H:%m:%S %z'`|\" -e\"s|%%VERSION%%|"+module.source_version+"|\"", srcdir) + ret = spawnTask( "sed --in-place "+os.path.join(debiandir,file)+" -e\"s|%%SHORTDATE%%|`date +%Y%m%d`|g\" -e\"s|%%LONGDATE%%|`date +'%a, %d %b %Y %H:%m:%S %z'`|g\" -e\"s|%%VERSION%%|"+module.source_version+"|g\"", srcdir) if ret != 0: exit("Was not able to update the debian %s." % file) @@ -246,7 +246,7 @@ spawnTask("tar -zcvf %s.tar.gz %s" % (module.base, module.base), buildbase) # md5sum the package - spawnTask("md5sum %s.tar.gz | sed -e's/ .*//' > %s.md5sum" % (module.base, module.base), buildbase) + spawnTask("md5sum %s.tar.gz | sed -e's/ .*//g' > %s.md5sum" % (module.base, module.base), buildbase) debiandir = os.path.join(srcdir, "debian") if not os.path.exists(debiandir): @@ -263,10 +263,10 @@ if ret != 0: exit("Was not able to copy the debian %s." % file) - ret = spawnTask( "sed --in-place "+filepath+' ' + \ - ' -e"s|%%SHORTDATE%%|`date +%Y%m%d`|" ' + \ - ' -e"s|%%LONGDATE%%|`date +\'%a, %d %b %Y %H:%m:%S %z\'`|" ' + \ - ' -e"s|%%VERSION%%|'+module.source_version+'|"' + ret = spawnTask( "sed --in-place "+filepath+' ' + \ + ' -e"s|%%SHORTDATE%%|`date +%Y%m%d`|g" ' + \ + ' -e"s|%%LONGDATE%%|`date +\'%a, %d %b %Y %H:%m:%S %z\'`|g" ' + \ + ' -e"s|%%VERSION%%|'+module.source_version+'|g"' , srcdir) if ret != 0: exit("Was not able to update the debian %s." % file) @@ -275,11 +275,11 @@ dsc = os.path.join(buildbase, "%s.dsc" % module.base) spawnTask("cp -f %s %s" % (os.path.join(debiandir, "dsc"), dsc), os.getcwd()) spawnTask( "sed --in-place "+dsc+ \ - ' -e "s|%%MD5SUM%%|`cat '+module.base+'.md5sum`|" ' + \ - ' -e "s|%%SIZE%%|`du -b '+module.base+'.tar.gz | sed -e\'s/[\t ]/ /g\'`|" ' + \ - ' -e "s|%%SHORTDATE%%|`date +%Y%m%d`|" ' + \ - ' -e "s|%%LONGDATE%%|`date +\'%a, %d %b %Y %H:%m:%S %z\'`|" ' + \ - ' -e "s^%%BUILDDEPS%%^`cat '+os.path.join(debiandir, "control")+' | grep Build-Depends:`^"' + \ + ' -e "s|%%MD5SUM%%|`cat '+module.base+'.md5sum`|g" ' + \ + ' -e "s|%%SIZE%%|`du -b '+module.base+'.tar.gz | sed -e\'s/[\t ]/ /g\'`|g" ' + \ + ' -e "s|%%SHORTDATE%%|`date +%Y%m%d`|g" ' + \ + ' -e "s|%%LONGDATE%%|`date +\'%a, %d %b %Y %H:%m:%S %z\'`|g" ' + \ + ' -e "s^%%BUILDDEPS%%^`cat '+os.path.join(debiandir, "control")+' | grep Build-Depends:`^g"' + \ ' -e "s|%%VERSION%%|'+module.source_version+'|g"' , buildbase) Modified: trunk/python-ogre/boost/debian/control =================================================================== --- trunk/python-ogre/boost/debian/control 2008-12-05 07:54:34 UTC (rev 828) +++ trunk/python-ogre/boost/debian/control 2008-12-08 08:36:02 UTC (rev 829) @@ -1,7 +1,7 @@ Source: boost-python%%VERSION%%-index Priority: extra Maintainer: Tim Ansell <mi...@mi...> -Build-Depends: debhelper (>= 5), libboost-python-dev (>= %%VERSION%%), libstdc++6-4.1-dev | libstdc++6-4.2-dev, python-dev +Build-Depends: debhelper (>= 5), libboost-python-dev (>= %%VERSION%%) | libboost-python%%VERSION%%-dev (>= %%VERSION%%), libstdc++6-4.1-dev | libstdc++6-4.2-dev, python-dev Standards-Version: 3.7.2 Section: libs Modified: trunk/python-ogre/debian/changelog =================================================================== --- trunk/python-ogre/debian/changelog 2008-12-05 07:54:34 UTC (rev 828) +++ trunk/python-ogre/debian/changelog 2008-12-08 08:36:02 UTC (rev 829) @@ -1,3 +1,8 @@ +python-ogre (1.6.0-1) unstable; urgency=low + + * Initial version of Python-Ogre 1.6.0 + + -- Tim 'Mithro' Ansell <mi...@mi...> Mon, 08 Dec 2008 17:53:00 +1000 python-ogre (0.0.0-7) unstable; urgency=low * Lots of small updates. Modified: trunk/python-ogre/debian/rules =================================================================== --- trunk/python-ogre/debian/rules 2008-12-05 07:54:34 UTC (rev 828) +++ trunk/python-ogre/debian/rules 2008-12-08 08:36:02 UTC (rev 829) @@ -23,17 +23,17 @@ LD_PRELOAD='' python$* BuildModule.py ${BUILDFLAGS} cegui LD_PRELOAD='' python$* BuildModule.py ${BUILDFLAGS} ogre # Extra modules - LD_PRELOAD='' python$* BuildModule.py ${BUILDFLAGS} noise +# LD_PRELOAD='' python$* BuildModule.py ${BUILDFLAGS} noise # LD_PRELOAD='' python$* BuildModule.py ${BUILDFLAGS} ogreode - LD_PRELOAD='' python$* BuildModule.py ${BUILDFLAGS} betagui - LD_PRELOAD='' python$* BuildModule.py ${BUILDFLAGS} cadunetree +# LD_PRELOAD='' python$* BuildModule.py ${BUILDFLAGS} betagui +# LD_PRELOAD='' python$* BuildModule.py ${BUILDFLAGS} cadunetree # LD_PRELOAD='' python$* BuildModule.py ${BUILDFLAGS} caelum - LD_PRELOAD='' python$* BuildModule.py ${BUILDFLAGS} et - LD_PRELOAD='' python$* BuildModule.py ${BUILDFLAGS} plib - LD_PRELOAD='' python$* BuildModule.py ${BUILDFLAGS} ogreforests - LD_PRELOAD='' python$* BuildModule.py ${BUILDFLAGS} ogreal - LD_PRELOAD='' python$* BuildModule.py ${BUILDFLAGS} ogrevideoffmpeg - LD_PRELOAD='' python$* BuildModule.py ${BUILDFLAGS} watermesh +# LD_PRELOAD='' python$* BuildModule.py ${BUILDFLAGS} et +# LD_PRELOAD='' python$* BuildModule.py ${BUILDFLAGS} plib +# LD_PRELOAD='' python$* BuildModule.py ${BUILDFLAGS} ogreforests +# LD_PRELOAD='' python$* BuildModule.py ${BUILDFLAGS} ogreal +# LD_PRELOAD='' python$* BuildModule.py ${BUILDFLAGS} ogrevideoffmpeg +# LD_PRELOAD='' python$* BuildModule.py ${BUILDFLAGS} watermesh touch $@ build-python%: Modified: trunk/python-ogre/debs/pygccxml-debian/rules =================================================================== --- trunk/python-ogre/debs/pygccxml-debian/rules 2008-12-05 07:54:34 UTC (rev 828) +++ trunk/python-ogre/debs/pygccxml-debian/rules 2008-12-08 08:36:02 UTC (rev 829) @@ -34,6 +34,8 @@ dh_clean -k dh_installdirs python$* setup.py install --root=$(CURDIR)/debian/pygccxml + find $(CURDIR)/debian/pygccxml -name msvc + find $(CURDIR)/debian/pygccxml -name msvc | xargs rm -rf # Build architecture-independent files here. binary-indep: build install This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |