[Python-ogre-commit] SF.net SVN: python-ogre:[739] trunk/python-ogre
Brought to you by:
andy_miller,
roman_yakovenko
|
From: <and...@us...> - 2008-09-07 12:10:14
|
Revision: 739
http://python-ogre.svn.sourceforge.net/python-ogre/?rev=739&view=rev
Author: andy_miller
Date: 2008-09-07 12:10:22 +0000 (Sun, 07 Sep 2008)
Log Message:
-----------
Updates for 1.6 - OgreAL cleanups, Additional Ogre tests, cleanup for various demos
Modified Paths:
--------------
trunk/python-ogre/PythonOgreInstallCreator.iss
trunk/python-ogre/ThirdParty/ogreal/OgreALListener.h
trunk/python-ogre/ThirdParty/ogreal/OgreALSound.h
trunk/python-ogre/demos/theora/demo_video.py
trunk/python-ogre/environment.py
trunk/python-ogre/scripts/MakeRelease.bat
Added Paths:
-----------
trunk/python-ogre/demos/ogre/tests/Test_GPU.py
trunk/python-ogre/demos/ogre/tests/Test_Vector3.py
Modified: trunk/python-ogre/PythonOgreInstallCreator.iss
===================================================================
--- trunk/python-ogre/PythonOgreInstallCreator.iss 2008-09-07 11:44:46 UTC (rev 738)
+++ trunk/python-ogre/PythonOgreInstallCreator.iss 2008-09-07 12:10:22 UTC (rev 739)
@@ -20,7 +20,7 @@
Compression=lzma
InfoBeforeFile=InstallWarning.rtf
InfoAfterFile=postinstall.rtf
-SolidCompression=true
+SolidCompression=yes
AppCopyright=LPGL
VersionInfoCompany=OpenSource (Andy and Team)
VersionInfoTextVersion=1.6.0
@@ -44,11 +44,12 @@
; I'm going to install here anyway to make updates easier...
Source: packages_2.5\*; DestDir: {app}\packages_2.5; Flags: recursesubdirs
+
+Source: ThirdParty\dxwebsetup.exe; DestDir: {app}\ThirdParty
+Source: ThirdParty\vcredist_x86.exe; DestDir: {app}\ThirdParty
;
; we need to remove the .pyc files when we uninstall
;
-Source: ThirdParty\dxwebsetup.exe; DestDir: {app}\ThirdParty
-Source: ThirdParty\vcredist_x86.exe; DestDir: {app}\ThirdParty
[UninstallDelete]
Type: filesandordirs; Name: {code:GetPythonSiteDir}\ogre\*.pyc
@@ -307,14 +308,14 @@
I: Integer;
begin
Result := False;
- msgbox ('Checking Supported Versions ' + Param + ' ' + IntToStr(GetArrayLength(SupportedVersions) ), mbInformation, MB_OK);
+ ;msgbox ('Checking Supported Versions ' + Param + ' ' + IntToStr(GetArrayLength(SupportedVersions) ), mbInformation, MB_OK);
for I:=0 to GetArrayLength(SupportedVersions)-1 do begin
if Param = SupportedVersions[i] then begin
Result := True;
- msgbox ( 'Is a supported version ' + Param + ' (' + SupportedVersions[i] + ') ' + Param , mbInformation, MB_OK);
+ ;msgbox ( 'Is a supported version ' + Param + ' (' + SupportedVersions[i] + ') ' + Param , mbInformation, MB_OK);
end else begin
- msgbox ( 'Not a supported version ' + Param + ' (' +SupportedVersions[i] + ') ', mbInformation, MB_OK);
+ ;msgbox ( 'Not a supported version ' + Param + ' (' +SupportedVersions[i] + ') ', mbInformation, MB_OK);
end;
end;
end;
@@ -331,14 +332,14 @@
var
i, count: Integer;
p: string;
- Result1 : array of String;
+ Result1, Result2 : array of String;
tempv, templ : array of String;
begin
tempv := ['',''];
templ := ['',''];
count := 0;
RegGetSubkeyNames(HKEY_LOCAL_MACHINE, 'SOFTWARE\Python\PythonCore', Result1);
- msgbox ( 'LOCAL MACHINE ' + InttoStr(GetArrayLength(Result1)) , mbInformation, MB_OK);
+ ;msgbox ( 'LOCAL MACHINE ' + InttoStr(GetArrayLength(Result1)) , mbInformation, MB_OK);
// if we have versions here process them
for i:=0 to GetArrayLength(Result1)-1 do
if IsSupportedVersion ( Result1[i] ) then begin // make sure we support it..
@@ -354,15 +355,14 @@
if count < 2 then begin // we've only found zero, or one version so far..
// OK so we should now have all the valid versions listed in LOCAL_MACHINE
- Result1 = ['']
- RegGetSubkeyNames(HKEY_CURRENT_USER, 'SOFTWARE\Python\PythonCore', Result1);
- msgbox ( 'LOCAL MACHINE ' + InttoStr(GetArrayLength(Result1)) , mbInformation, MB_OK);
- for i:=0 to GetArrayLength(Result1)-1 do
- if not FoundPythonIn ( Result1[i], tempv ) then // check we don't already know about this version
- if IsSupportedVersion (Result1[i]) then begin
- if RegQueryStringValue(HKEY_CURRENT_USER, 'SOFTWARE\Python\PythonCore\' + Result1[i] + '\InstallPath', '', p) then begin
+ RegGetSubkeyNames(HKEY_CURRENT_USER, 'SOFTWARE\Python\PythonCore', Result2);
+ ;msgbox ( 'CURRENT_USER ' + InttoStr(GetArrayLength(Result2)) , mbInformation, MB_OK);
+ for i:=0 to GetArrayLength(Result2)-1 do
+ if not FoundPythonIn ( Result2[i], tempv ) then // check we don't already know about this version
+ if IsSupportedVersion (Result2[i]) then begin
+ if RegQueryStringValue(HKEY_CURRENT_USER, 'SOFTWARE\Python\PythonCore\' + Result2[i] + '\InstallPath', '', p) then begin
if FileExists ( p + '\python.exe' ) then begin
- tempv[count] := Result1[i];
+ tempv[count] := Result2[i];
templ[count] := p;
count := count + 1;
end;
@@ -465,7 +465,7 @@
PythonVersion := '';
SupportedVersions := [ '2.5'];
- Debug := True;
+ Debug := False;
NumPythonVersions := GetInstalledPythonVersions();
if Debug then
Modified: trunk/python-ogre/ThirdParty/ogreal/OgreALListener.h
===================================================================
--- trunk/python-ogre/ThirdParty/ogreal/OgreALListener.h 2008-09-07 11:44:46 UTC (rev 738)
+++ trunk/python-ogre/ThirdParty/ogreal/OgreALListener.h 2008-09-07 12:10:22 UTC (rev 739)
@@ -140,7 +140,9 @@
void _updateRenderQueue(Ogre::RenderQueue* queue);
/** Overridden from MovableObject */
void _notifyAttached(Ogre::Node* parent, bool isTagPoint = false);
- #if OGRE_VERSION_MAJOR == 1 && ((OGRE_VERSION_MINOR == 5) || (OGRE_VERSION_MINOR == 7))
+ #if OGRE_VERSION_MAJOR == 1 && OGRE_VERSION_MINOR == 4
+ // nothing here...
+ #else
/** Overridden from MovableObject */
virtual void visitRenderables(Ogre::Renderable::Visitor* visitor, bool debugRenderables = false){}
#endif
Modified: trunk/python-ogre/ThirdParty/ogreal/OgreALSound.h
===================================================================
--- trunk/python-ogre/ThirdParty/ogreal/OgreALSound.h 2008-09-07 11:44:46 UTC (rev 738)
+++ trunk/python-ogre/ThirdParty/ogreal/OgreALSound.h 2008-09-07 12:10:22 UTC (rev 739)
@@ -307,7 +307,9 @@
void _updateRenderQueue(Ogre::RenderQueue* queue);
/** Notifies the sound when it is attached to a node */
void _notifyAttached(Ogre::Node *parent, bool isTagPoint = false);
- #if(OGRE_VERSION_MAJOR == 1 && (OGRE_VERSION_MINOR == 5) || (OGRE_VERSION_MINOR == 7))
+ #if(OGRE_VERSION_MAJOR == 1 && OGRE_VERSION_MINOR == 4)
+ // nothing here
+ #else
/** Overridden from MovableObject */
virtual void visitRenderables(Ogre::Renderable::Visitor* visitor, bool debugRenderables = false){}
#endif
Added: trunk/python-ogre/demos/ogre/tests/Test_GPU.py
===================================================================
--- trunk/python-ogre/demos/ogre/tests/Test_GPU.py (rev 0)
+++ trunk/python-ogre/demos/ogre/tests/Test_GPU.py 2008-09-07 12:10:22 UTC (rev 739)
@@ -0,0 +1,105 @@
+import os,sys
+if sys.platform == 'win32':
+ os.environ['PATH'] += ';' + __file__[0]
+
+import ogre.renderer.OGRE as ogre
+import SampleFramework
+import math
+
+import ctypes
+
+
+class TutorialApplication(SampleFramework.Application):
+ def _createScene(self):
+ sm = self.sceneManager
+ cam = self.camera
+ rw = self.renderWindow
+
+ # create head entity (left)
+ self.headNode = sm.getRootSceneNode().createChildSceneNode('head1')
+ self.headNode.position=-70,0,0
+ self.entity = sm.createEntity('head', 'ogrehead.mesh')
+ self.headNode.attachObject(self.entity)
+
+
+ for r in self.root.getAvailableRenderers():
+ print "Renderer: ",r.getName()
+ cap = r.getCapabilities()
+ if cap: ## Note only the active renderer has capabilities
+ print "Device Name: ", cap.DeviceName
+ print "Driver Version/release: ", cap.DriverVersion.build, cap.DriverVersion.release
+
+ fragmentProgramName = "OceanCg" #"OceanHLSL_GLSL"
+ mat = ogre.MaterialManager.getSingleton().getByName(fragmentProgramName)
+
+ # In case the material is not found
+ if (mat == None):
+ print "Material not found: ",fragmentProgramName
+ sys.exit()
+
+ validkeys = []
+ if (mat.getTechnique(0).getPass(0).hasFragmentProgram()):
+ print "\n\nHAS FRAGMENT"
+ params = mat.getTechnique(0).getPass(0).getFragmentProgramParameters()
+ if (params.hasNamedParameters()):
+ it = params.getConstantDefinitionIterator()
+# while it.hasMoreElements():
+# key = it.peekNextKey()
+# value = it.peekNextValue()
+# print key, value
+# index = value.physicalIndex
+# size = value.elementSize
+# p = ctypes.c_float * size
+# print p
+# params._readRawConstants (index, size, ctypes.addressof(p) )
+# print p
+# print index, size
+# it.moveNext()
+ while it.hasMoreElements():
+ key = it.peekNextKey()
+ if not '[' in key: # seem to get double key's ??
+ value = it.peekNextValue()
+ index = value.physicalIndex
+ size = value.elementSize
+
+ if value.isFloat():
+ storageclass = ctypes.c_float * size
+ p =storageclass(1.1)
+ params._readRawConstantsFloat (index, size, ctypes.addressof(p) )
+ else:
+ storageclass = ctypes.c_int * size
+ p =storageclass(1)
+ params._readRawConstantsInt (index, size, ctypes.addressof(p) )
+ print key, index, size, p[0], p[1], p[2]
+ it.moveNext()
+ print value
+ print dir(value)
+ print p
+ print dir(p)
+
+
+# while (True):
+# # Get the key
+# key = it.peekNextKey()
+# print "KEY: ",key
+# # And the corresponding value
+# value = it.peekNextValue()
+# index = value.physicalIndex
+# size = value.elementSize
+# p = ctypes.c_float * size
+# result = 0
+# print p
+# # params._readRawConstants (index, size, ctypes.addressof(p) )
+# # print "VALUE: ",p
+# # if (key.isalpha() and params._findNamedConstantDefinition(key)):
+# # validkeys.append(key)
+# it.moveNext()
+# if (not it.hasMoreElements()):
+# break
+ else:
+ print "\n\nNo fragment programs found"
+ sys.exit()
+
+if __name__ == '__main__':
+ ta = TutorialApplication()
+ ta.go()
Added: trunk/python-ogre/demos/ogre/tests/Test_Vector3.py
===================================================================
--- trunk/python-ogre/demos/ogre/tests/Test_Vector3.py (rev 0)
+++ trunk/python-ogre/demos/ogre/tests/Test_Vector3.py 2008-09-07 12:10:22 UTC (rev 739)
@@ -0,0 +1,41 @@
+import exceptions as e
+import ogre.renderer.OGRE as ogre
+
+class NewVector3 ( ogre.Vector3 ):
+
+ def __init__( self, value ):
+ ogre.Vector3.__init__( self, *value )
+
+ def __getitem__ ( self, index ):
+ if not type ( index ) == type ( 1 ):
+ raise e.TypeError
+ if index < 0 or index > 3:
+ raise e.IndexError
+ return ogre.Vector3.__getitem__( self, index )
+
+ def __getslice__ ( self, start, end ):
+ if not type ( start ) == type ( end ) == type ( 1 ) :
+ raise e.TypeError
+ if (start < 0 or start > 3) or ( end < 0 ):
+ raise e.IndexError
+ if end > 3: end = 3
+ retValues=[]
+ for x in range ( end - start ):
+ retValues.append ( ogre.Vector3.__getitem__( self, start + x ) )
+ return retValues
+
+TestValues=[1.223,5.676,98.43]
+
+v = NewVector3( TestValues )
+print v
+print v.x, v.y, v.z
+print v[0], v[1], v[2]
+print v[0:1]
+print v[1:2]
+print v[1:1]
+print v[:]
+print v[0:3]
+
+
+
+
\ No newline at end of file
Modified: trunk/python-ogre/demos/theora/demo_video.py
===================================================================
--- trunk/python-ogre/demos/theora/demo_video.py 2008-09-07 11:44:46 UTC (rev 738)
+++ trunk/python-ogre/demos/theora/demo_video.py 2008-09-07 12:10:22 UTC (rev 739)
@@ -42,7 +42,7 @@
if not self.Control:
print "\n\nClip not found\n"
sys.exit()
- self.Control.setInputName( '../media_extra/fish1.ogg') #konqi_ad1_nl.avi.ogg') ##fish.ogg' )
+ self.Control.setInputName( 'konqi_ad1_nl.avi.ogg' ) #../media_extra/fish1.ogg')
self.Control.setPlayMode(ogre.TextureEffectPause )
self.Control.setTextureTecPassStateLevel( 0, 0, 0 )
Modified: trunk/python-ogre/environment.py
===================================================================
--- trunk/python-ogre/environment.py 2008-09-07 11:44:46 UTC (rev 738)
+++ trunk/python-ogre/environment.py 2008-09-07 12:10:22 UTC (rev 739)
@@ -1323,11 +1323,15 @@
,os.path.join(Config.PATH_OPENAL, 'libs','Win32')
,Config.PATH_LIB_OgreAL
]
- CCFLAGS = ' -DWIN32 -DNDEBUG -D_LIB -D_WIN32 -D_WINDOWS -DVORBIS_IEEE_FLOAT32 -D_USE_NON_INTEL_COMPILER '
+ CCFLAGS = ' -DWIN32 -DNDEBUG -D_LIB -D_WIN32 -D_WINDOWS ' #-DVORBIS_IEEE_FLOAT32 -D_USE_NON_INTEL_COMPILER '
libs=[boost.lib, 'OgreMain',
'ogg_static',
- 'vorbis_static','vorbisfile_static','vorbisenc_static',
- 'OpenAL32', 'EFX-Util'] # -- going to compile OgreAL ourselves
+ 'vorbis_static','vorbisfile_static',
+ #'vorbisenc_static',
+ 'OpenAL32',
+ #'EFX-Util'
+
+ ] # -- going to compile OgreAL ourselves
source = [
["wget", "http://connect.creativelabs.com/openal/Downloads/OpenAL11CoreSDK.zip",downloadPath],
["wget", "http://downloads.xiph.org/releases/ogg/libogg-1.1.3.zip",downloadPath],
Modified: trunk/python-ogre/scripts/MakeRelease.bat
===================================================================
--- trunk/python-ogre/scripts/MakeRelease.bat 2008-09-07 11:44:46 UTC (rev 738)
+++ trunk/python-ogre/scripts/MakeRelease.bat 2008-09-07 12:10:22 UTC (rev 739)
@@ -19,6 +19,8 @@
xcopy ..\tools ..\..\PythonOgreRelease\tools
copy ..\ThirdParty ..\..\PythonOgreRelease\ThirdParty
copy ..\*.rtf ..\..\PythonOgreRelease
+copy ..\ReportVersion.py ..\..\PythonOgreRelease
+copy ..\Setup.py ..\..\PythonOgreRelease
copy ..\COPYING ..\..\PythonOgreRelease
copy ..\*.gpl ..\..\PythonOgreRelease
copy ..\changelog.txt ..\..\PythonOgreRelease
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|