You can subscribe to this list here.
2007 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
(64) |
Jul
(77) |
Aug
(21) |
Sep
(15) |
Oct
(3) |
Nov
(4) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(1) |
Feb
|
Mar
(12) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(3) |
Dec
|
From: <ror...@us...> - 2007-06-27 15:57:49
|
Revision: 33 http://roreditor.svn.sourceforge.net/roreditor/?rev=33&view=rev Author: rorthomas Date: 2007-06-27 08:57:43 -0700 (Wed, 27 Jun 2007) Log Message: ----------- * first window close fixtures Modified Paths: -------------- trunk/lib/ror/starter.py trunk/lib/rortruckeditor/MainFrame.py trunk/lib/rortruckeditor/RoRTruckOgreWindow.py trunk/lib/rortruckeditor/UVFrame.py trunk/lib/wxogre/OgreManager.py trunk/lib/wxogre/wxOgreWindow.py Modified: trunk/lib/ror/starter.py =================================================================== --- trunk/lib/ror/starter.py 2007-06-26 01:22:44 UTC (rev 32) +++ trunk/lib/ror/starter.py 2007-06-27 15:57:43 UTC (rev 33) @@ -58,7 +58,9 @@ def OnStartRoR(self, event=None): - p = Popen(os.path.join(self.rordir, "RoR.exe"), shell=True, cwd=self.rordir) + #escape spaces! + path = newpath.replace(" ", "\ ") + p = Popen(os.path.join(path, "RoR.exe"), shell=True, cwd=self.rordir) #sts = os.waitpid(p.pid, 0) def OnTruckEditor(self, event=None): @@ -85,12 +87,12 @@ pass def checkRoRDir(self, fn): - withoutspaces = (fn.find(" ") == -1) - if not withoutspaces: - dlg = wx.MessageDialog(self, "Your RoR installation directory contains spaces. Rename/move it to a directory with no spaces.\nFor example c:\\ror", "Error", wx.OK | wx.ICON_INFORMATION) - dlg.ShowModal() - dlg.Destroy() - return False + # withoutspaces = (fn.find(" ") == -1) + # if not withoutspaces: + # dlg = wx.MessageDialog(self, "Your RoR installation directory contains spaces. Rename/move it to a directory with no spaces.\nFor example c:\\ror", "Error", wx.OK | wx.ICON_INFORMATION) + # dlg.ShowModal() + # dlg.Destroy() + # return False exists = os.path.isfile(os.path.join(fn,"RoR.exe")) if not exists: @@ -108,7 +110,9 @@ newpath = dialog.GetPath() if not self.checkRoRDir(newpath): return - + + # no need to escape here! + #newpath = newpath.replace(" ", "\ ") self.rordir = newpath self.lblRoRDir.SetLabel(newpath) getSettings().setRoRDir(newpath) Modified: trunk/lib/rortruckeditor/MainFrame.py =================================================================== --- trunk/lib/rortruckeditor/MainFrame.py 2007-06-26 01:22:44 UTC (rev 32) +++ trunk/lib/rortruckeditor/MainFrame.py 2007-06-27 15:57:43 UTC (rev 33) @@ -275,7 +275,7 @@ dialog = wx.FileDialog(self, "Open Terrain", default, "", "Trucks or Loads (*.truck, *.load)|*.truck;*.load", wx.FD_OPEN | wx.FD_FILE_MUST_EXIST) res = dialog.ShowModal() if res == wx.ID_OK: - self.fileopenmenu.Enable(False) + #self.fileopenmenu.Enable(False) filename = dialog.GetPath() print filename self.truckOgreWin.LoadTruck(filename) Modified: trunk/lib/rortruckeditor/RoRTruckOgreWindow.py =================================================================== --- trunk/lib/rortruckeditor/RoRTruckOgreWindow.py 2007-06-26 01:22:44 UTC (rev 32) +++ trunk/lib/rortruckeditor/RoRTruckOgreWindow.py 2007-06-27 15:57:43 UTC (rev 33) @@ -45,8 +45,10 @@ self.sceneManager.destroyEntity(e) except: pass - if not self.uvFrame is None: + try: self.uvFrame.Close() + except: + pass self.nodes = {} self.beams = {} self.shocks = {} Modified: trunk/lib/rortruckeditor/UVFrame.py =================================================================== --- trunk/lib/rortruckeditor/UVFrame.py 2007-06-26 01:22:44 UTC (rev 32) +++ trunk/lib/rortruckeditor/UVFrame.py 2007-06-27 15:57:43 UTC (rev 33) @@ -5,13 +5,16 @@ from ror.rorcommon import * from RoRUVOgreWindow import * +ID_CLOSEWINDOW = 100 + class UVFrame(wx.Frame): rordir = None def __init__(self, *args, **kwds): kwds["style"] = wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX | wx.RESIZE_BORDER | wx.SYSTEM_MENU | wx.CAPTION | wx.CLIP_CHILDREN | wx.CLOSE_BOX wx.Frame.__init__(self, *args, **kwds) - + self.Bind(wx.EVT_CLOSE, self.OnClose, self) + #main splitter self.splitter = wx.SplitterWindow(self, wx.ID_ANY, style=wx.SP_PERMIT_UNSPLIT|wx.SP_3DSASH) self.splitterleft = wx.Panel(self.splitter, wx.ID_ANY) @@ -23,7 +26,7 @@ self.rordir = getSettings().getRoRDir() #ogre windows - self.truckOgreWin = RoRUVOgreWindow(self.splitterleft, wx.ID_ANY) + self.uvOgreWin = RoRUVOgreWindow(self.splitterleft, wx.ID_ANY) #some labels #self.helptext = wx.StaticText(self.splitterleft, wx.ID_ANY, "short help: right click = rotate; ctrl + right click, AWSD, mouse wheel = move") @@ -40,23 +43,23 @@ self.__do_layout() def setTree(self,tree): - self.truckOgreWin.setTree(tree) + self.uvOgreWin.setTree(tree) self.trucktree = tree - def OnExit(self, event): - self.Close(True) - sys.exit(0) - + def OnClose(self, event = None): + print "onClose" + self.uvOgreWin.close() + self.Destroy() def __set_properties(self): self.SetTitle("UV Editor") - self.truckOgreWin.SetMinSize((640,480)) + self.uvOgreWin.SetMinSize((640,480)) def __do_layout(self): sizer_main = wx.BoxSizer(wx.HORIZONTAL) sizer_left = wx.BoxSizer(wx.VERTICAL) - sizer_left.Add(self.truckOgreWin, 2, wx.EXPAND, 0) + sizer_left.Add(self.uvOgreWin, 2, wx.EXPAND, 0) self.splitterleft.SetSizer(sizer_left) self.splitter.SplitVertically(self.splitterleft, self.splitterright) Modified: trunk/lib/wxogre/OgreManager.py =================================================================== --- trunk/lib/wxogre/OgreManager.py 2007-06-26 01:22:44 UTC (rev 32) +++ trunk/lib/wxogre/OgreManager.py 2007-06-27 15:57:43 UTC (rev 33) @@ -60,6 +60,11 @@ self.renderWindows[wxOgrewin] = renderWindow return renderWindow + def removeRenderWindow(self, wxOgrewin): + print "removing render target" + self.ogreRoot.detachRenderTarget(self.renderWindows[wxOgrewin]) + del self.renderWindows[wxOgrewin] + def RenderAll(self): for ogrewin in self.renderWindows.keys(): try: @@ -82,3 +87,7 @@ def createSceneManager(self, type): return self.ogreRoot.createSceneManager(type, "SceneManager" + str(len(self.renderWindows))) + + def destroySceneManager(self, sm): + return self.ogreRoot.destroySceneManager(sm) + \ No newline at end of file Modified: trunk/lib/wxogre/wxOgreWindow.py =================================================================== --- trunk/lib/wxogre/wxOgreWindow.py 2007-06-26 01:22:44 UTC (rev 32) +++ trunk/lib/wxogre/wxOgreWindow.py 2007-06-27 15:57:43 UTC (rev 33) @@ -26,19 +26,31 @@ # create a new RenderWindow self.renderWindow = getOgreManager().createRenderWindow(self, "wxPythonWxOgreRenderWindow", size[0], size[1], False, self.GetHandle()) self.renderWindow.active = True + self.sceneManager = None self.SceneInitialisation() self.SetFocus() + + def __del__(self): + self.close() + def close(self): + getOgreManager().removeRenderWindow(self) + if not self.sceneManager is None: + getOgreManager().destroySceneManager(self.sceneManager) + def _OnSize(self, event): """ Is called when the ogre Window is getting resized @param event: the sizing event @return: none """ - if getattr(self, 'ogreRoot', None): - self.renderWindow.windowMovedOrResized() - event.Skip() + try: + if getattr(self, 'ogreRoot', None): + self.renderWindow.windowMovedOrResized() + event.Skip() + except: + pass def _OnEraseBackground(self, event): """ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-06-26 01:22:46
|
Revision: 32 http://roreditor.svn.sourceforge.net/roreditor/?rev=32&view=rev Author: rorthomas Date: 2007-06-25 18:22:44 -0700 (Mon, 25 Jun 2007) Log Message: ----------- updated terraineditor Modified Paths: -------------- trunk/lib/rorterraineditor/MainFrame.py trunk/lib/rorterraineditor/RoRTerrainOgreWindow.py trunk/lib/rorterraineditor/RoRTerrainSelectedObjectOgreWindow.py trunk/lib/rorterraineditor/RoRTerrainSelectedObjectTopOgreWindow.py trunk/media/materials/mysimple.material Modified: trunk/lib/rorterraineditor/MainFrame.py =================================================================== --- trunk/lib/rorterraineditor/MainFrame.py 2007-06-25 22:19:55 UTC (rev 31) +++ trunk/lib/rorterraineditor/MainFrame.py 2007-06-26 01:22:44 UTC (rev 32) @@ -73,9 +73,9 @@ self.ogreTimer.Start(25) #create statusbar - self.statusbar = self.CreateStatusBar(3, 0, wx.ID_ANY, "mainstatusbar") - self.statusbar.SetStatusWidths([-1, 80, 80]) - self.statusbar.SetStatusText("-", 1) + self.statusbar = self.CreateStatusBar(4, 0, wx.ID_ANY, "mainstatusbar") + self.statusbar.SetStatusWidths([-1, 300, 300, 80]) + #self.statusbar.SetStatusText("", 1) #create toolbar #self.toolbar = wx.ToolBar(self, wx.ID_ANY, style = wx.TB_HORZ_TEXT) @@ -94,7 +94,7 @@ self.waterlevelctrl.max = 300 self.Bind(wx.EVT_SCROLL, self.OnChangeWaterLevel, self.waterlevelctrl) - self.CurrEntName = wx.StaticText(self, wx.ID_ANY, "\n\n\n") + #self.CurrEntName = wx.StaticText(self, wx.ID_ANY, "\n\n\n") #self.PosText = wx.StaticText(self, wx.ID_ANY, "Position: x,y,z") #self.terrPosX = wx.TextCtrl(self, wx.ID_ANY) #self.terrPosY = wx.TextCtrl(self, wx.ID_ANY) @@ -208,9 +208,20 @@ def updateObjPosRot(self, event=None): if self.terrainOgreWin.mSelected is None: + self.statusbar.SetStatusText("", 1) return - n = self.terrainOgreWin.mSelected.getParentNode() - self.CurrEntName.Label = "selected Object:\n%s" % n.getName() + n = self.terrainOgreWin.mSelected.getParentNode() + comment = self.terrainOgreWin.getCommentsForObject(n.getName()).lstrip('/') + if comment.strip() != "": + txt = "%s / %s" % (n.getName(), comment) + else: + txt = "%s" % n.getName() + self.statusbar.SetStatusText(txt, 1) + + posx, posy, posz, rotx, roty, rotz = self.terrainOgreWin.getSelectionPositionRotation() + txt = "%0.2f, %0.2f, %0.2f / %0.2f, %0.2f, %0.2f" % (posx, posy, posz, rotx, roty, rotz) + self.statusbar.SetStatusText(txt, 2) + #pos = n.getPosition() #self.terrPosX.SetValue(str(round(pos.x,2))) #self.terrPosY.SetValue(str(round(pos.y,2))) @@ -220,8 +231,8 @@ #self.terrRotY.SetValue(str(round(ogre.Radian(rot.getYaw(False)).valueDegrees(),2))) #self.terrRotZ.SetValue(str(round(ogre.Radian(rot.getRoll(False)).valueDegrees(),2))) - def OnChangeObjPosRot(self, event=None): - pass + #def OnChangeObjPosRot(self, event=None): + # pass def OnChangeTerrainNameChange(self, event=None): self.terrainOgreWin.TerrainName = self.terrainNamectrl.GetValue() @@ -311,7 +322,7 @@ def OnTimer(self, event): #fill labels with some information, all windows have the same FPS! txt = "%0.2f FPS" % (self.terrainOgreWin.renderWindow.getStatistics().lastFPS) - self.statusbar.SetStatusText(txt, 2) + self.statusbar.SetStatusText(txt, 3) self.updateObjPosRot() def OnExit(self, event): @@ -363,7 +374,7 @@ sizer_settings.Add(self.terrainName, 0, wx.EXPAND, 0) sizer_settings.Add(self.terrainNamectrl, 0, wx.EXPAND, 0) - sizer_settings.Add(self.CurrEntName, 0, wx.EXPAND, 0) + #sizer_settings.Add(self.CurrEntName, 0, wx.EXPAND, 0) #sizer_settings.Add(self.PosText, 0, wx.EXPAND, 0) #sizer_terrPos = wx.BoxSizer(wx.HORIZONTAL) #sizer_terrPos.Add(self.terrPosX, 0, wx.EXPAND, 0) Modified: trunk/lib/rorterraineditor/RoRTerrainOgreWindow.py =================================================================== --- trunk/lib/rorterraineditor/RoRTerrainOgreWindow.py 2007-06-25 22:19:55 UTC (rev 31) +++ trunk/lib/rorterraineditor/RoRTerrainOgreWindow.py 2007-06-26 01:22:44 UTC (rev 32) @@ -4,7 +4,6 @@ from ror.truckparser import * from wxogre.OgreManager import * from wxogre.wxOgreWindow import * - from random import random ADDEDBY = "//added by the terrrain editor:\n" @@ -35,11 +34,24 @@ self.meshes = {} self.moveVector = None self.moveForce = 0 + self.selectionMaterial = None + self.selectionMaterialAnimState = 0 wxOgreWindow.__init__(self, self.parent, self.ID, size = self.size, **self.kwargs) + + def animateSelection(self): + if not self.selectionMaterial is None: + self.selectionMaterialAnimState += 0.01 + if self.selectionMaterialAnimState >= 0.4: + self.selectionMaterialAnimState = - 0.4 + val = 0.6 + abs(self.selectionMaterialAnimState) + #print val + self.selectionMaterial.setDiffuse(1, 0.3, 0, val) + self.selectionMaterial.setSpecular(1, 0.3, 0, val) + def OnFrameStarted(self): self.cameraLandCollision() - self.arrowScale = 0.1 + self.animateSelection() if not self.TranslateNode is None: if self.mSelected: if self.TranslationRotationMode: @@ -123,34 +135,6 @@ #create objects self.populateScene() - - - def populateScene(self): - self.sceneManager.AmbientLight = 0.5, 0.5, 0.5 - - l = self.sceneManager.createLight("MainLight" + self.rand) - l.setPosition(20,80,50) - fadeColour = (0.93, 0.86, 0.76) - self.sceneManager.setFog(ogre.FOG_LINEAR, fadeColour, 0.001, 5000.0, 10000.0) - self.renderWindow.getViewport(0).BackgroundColour = fadeColour - - self.sceneManager.setWorldGeometry('media/terrain.cfg') - plane = ogre.Plane() - plane.d = 5000 - plane.normal = -ogre.Vector3.UNIT_Y - - self.sceneManager.AmbientLight = ogre.ColourValue(0.7, 0.7, 0.7 ) - self.sceneManager.setShadowTechnique(ogre.ShadowTechnique.SHADOWTYPE_STENCIL_ADDITIVE); - self.sceneManager.setSkyDome(True, 'Examples/CloudySky', 4.0, 8.0) - - self.MainLight = self.sceneManager.createLight('MainLight') - self.MainLight.setPosition (ogre.Vector3(20, 80, 130)) - - #create the camera Axes object - self.camAxesNode = self.sceneManager.getRootSceneNode().createChildSceneNode("camaxes" + self.rand) - self.camAxesEnt = self.sceneManager.createEntity('camAxesEnt' + self.rand, 'axes.mesh') - self.camAxesNode.attachObject(self.camAxesEnt) - def loadOdef(self, objname): try: f=open(self.rordir+"\\data\\objects\\%s.odef" % (objname), 'r') @@ -263,7 +247,7 @@ objname = (arr[6]).strip().split(" ") #print objname if objname[0][0:5] == "truck" and len(objname) > 1: - print "#############loading truck..." + print "loading truck..." fn = self.rordir + "\\data\\trucks\\"+objname[-1].strip() n, entname = self.createTruckMesh(fn) self.comments[entname] = comm @@ -275,7 +259,7 @@ n.setPosition(x, y, z) continue if objname[0][0:4] == "load" and len(objname) > 1: - print "#################loading load...." + print "loading load...." fn = self.rordir + "\\data\\trucks\\"+objname[-1].strip() n, entname = self.createTruckMesh(fn) self.comments[entname] = comm @@ -330,6 +314,33 @@ def formatFloat(self, fl): return "%12s" % ("%0.6f" % (float(fl))) + + def getCommentsForObject(self, entname): + if entname in self.comments.keys(): + #print self.comments[entname] + return self.comments[entname]; + else: + return "" + + def getSelectionPositionRotation(self): + if not self.mSelected is None: + return self.getPositionRotation(self.mSelected.getParentNode()) + + def getPositionRotation(self, obj): + scale = obj.getScale() + obj.setScale(1, 1, 1) + obj.rotate(ogre.Vector3.UNIT_X, ogre.Degree(90),relativeTo=ogre.Node.TransformSpace.TS_WORLD) + pos = obj.getPosition() + rot = obj.getOrientation() + rot.normalise() + obj.rotate(ogre.Vector3.UNIT_X, ogre.Degree(-90),relativeTo=ogre.Node.TransformSpace.TS_WORLD) + obj.setScale(scale) + + rotx = ogre.Radian(rot.getPitch(False)).valueDegrees() + roty = ogre.Radian(rot.getRoll(False)).valueDegrees() + rotz = -ogre.Radian(rot.getYaw(False)).valueDegrees() + return pos.x, pos.y, pos.z, rotx, roty, rotz + def SaveTerrnFile(self, fn = None): if fn is None: fn = self.terrnfile @@ -367,17 +378,8 @@ for c in self.comments[k]: lines.append(c) - - truck = self.trucks[k] - scale = truck.getScale() - truck.setScale(1, 1, 1) - pos = truck.getPosition() - rot = truck.getOrientation() - truck.setScale(scale) + posx, posy, posz, rotx, roty, rotz = self.getPositionRotation(self.trucks[k]) - rotx = ogre.Radian(rot.getPitch(False)).valueDegrees() - rotz = ogre.Radian(rot.getRoll(False)).valueDegrees() - roty = - ogre.Radian(rot.getYaw(False)).valueDegrees() if rotx != 0: rotx -= 180 if roty != 0: @@ -385,9 +387,9 @@ if rotz != 0: rotz -= 180 truckstring = k.split(".")[-1] + "\t " + k - ar = [self.formatFloat(pos.x), - self.formatFloat(pos.y), - self.formatFloat(pos.z), + ar = [self.formatFloat(posx), + self.formatFloat(posy), + self.formatFloat(posz), self.formatFloat(rotx), self.formatFloat(roty), self.formatFloat(rotz), @@ -402,24 +404,11 @@ for c in self.comments[k]: lines.append(c) - - meshe = self.meshes[k] - scale = meshe.getScale() - meshe.setScale(1, 1, 1) - meshe.rotate(ogre.Vector3.UNIT_X, ogre.Degree(90),relativeTo=ogre.Node.TransformSpace.TS_WORLD) - pos = meshe.getPosition() - rot = meshe.getOrientation() - rot.normalise() - meshe.rotate(ogre.Vector3.UNIT_X, ogre.Degree(-90),relativeTo=ogre.Node.TransformSpace.TS_WORLD) - meshe.setScale(scale) - - rotx = ogre.Radian(rot.getPitch(False)).valueDegrees() - roty = ogre.Radian(rot.getRoll(False)).valueDegrees() - rotz = - ogre.Radian(rot.getYaw(False)).valueDegrees() + posx, posy, posz, rotx, roty, rotz = self.getPositionRotation(self.meshes[k]) meshstring = k.split("_")[-1] - ar = [self.formatFloat(pos.x), - self.formatFloat(pos.y), - self.formatFloat(pos.z), + ar = [self.formatFloat(posx), + self.formatFloat(posy), + self.formatFloat(posz), self.formatFloat(rotx), self.formatFloat(roty), self.formatFloat(rotz), @@ -522,14 +511,17 @@ if not mat is None: mat.copyDetailsTo(selectedmat) newmat = ogre.MaterialManager.getSingleton().getByName(newmatname) - newmat.setSelfIllumination(0,1,1) - newmat.setDiffuse(0,1,1,1) - newmat.setAmbient(0,1,1) - newmat.setSpecular(0,1,1,1) + newmat.setSceneBlending(ogre.SceneBlendFactor.SBF_SOURCE_ALPHA, ogre.SceneBlendFactor.SBF_DEST_ALPHA ) + newmat.setSelfIllumination(1, 0.3, 0) + newmat.setDiffuse(1, 0.3, 0, 0.5) + newmat.setAmbient(1, 0.3, 0) + newmat.setSpecular(1, 0.3, 0, 0.5) + self.selectionMaterial = newmat #self.mSelected.getSubEntity(0).setMaterialName(snewmatname) self.mSelected.setMaterialName(newmatname) self.mSelected.getParentSceneNode().showBoundingBox(True) self.reattachArrows(self.mSelected) + self.arrowScale = self.mSelected.getBoundingRadius() / 100 def LoadTerrnFile(self, filename): @@ -540,14 +532,17 @@ self.processTerrnFile(content) def populateScene(self): - self.sceneManager.AmbientLight = 0.5, 0.5, 0.5 + self.sceneManager.AmbientLight = ogre.ColourValue(0.7, 0.7, 0.7 ) - l = self.sceneManager.createLight("MainLight") - l.setPosition(20,80,50) - fadeColour = (0.93, 0.86, 0.76) + fadeColour = (0.8, 0.8, 0.8) self.sceneManager.setFog(ogre.FOG_LINEAR, fadeColour, 0.001, 5000.0, 10000.0) self.renderWindow.getViewport(0).BackgroundColour = fadeColour + l = self.sceneManager.createLight("MainLight") + l.setPosition(20,80,50) + + + #create the camera Axes object self.camAxesNode = None self.camAxesEnt = None @@ -628,6 +623,10 @@ def ObjectResetRotation(self): if self.mSelected: self.mSelected.getParentNode().resetOrientation() + self.mSelected.getParentNode().rotate(ogre.Vector3.UNIT_X, ogre.Degree(-90),relativeTo=ogre.Node.TransformSpace.TS_WORLD) + self.RotateNode.resetOrientation() + self.RotateNode.rotate(ogre.Vector3.UNIT_X, ogre.Degree(-90),relativeTo=ogre.Node.TransformSpace.TS_WORLD) + def selectarrow(self, arrow): if self.SelectedArrow.getSubEntity(0).getMaterialName()[-3:] != "sel": @@ -669,7 +668,7 @@ continue if not self.mSelected is None and self.mSelected.getName() == r.movable.getName(): continue - print r.movable.getMovableType(), r.movable.getName() + #print r.movable.getMovableType(), r.movable.getName() if not self.SelectedArrow is None: self.deselectarrow(self.SelectedArrow) self.SelectedArrow = None @@ -941,9 +940,9 @@ return #print event.m_keyCode - d = 5 + d = 2 if event.ShiftDown(): - d = 30 + d = 15 if event.m_keyCode == 65: # A, wx.WXK_LEFT: self.moveVector = ogre.Vector3(-1,0,0) self.moveForce = d Modified: trunk/lib/rorterraineditor/RoRTerrainSelectedObjectOgreWindow.py =================================================================== --- trunk/lib/rorterraineditor/RoRTerrainSelectedObjectOgreWindow.py 2007-06-25 22:19:55 UTC (rev 31) +++ trunk/lib/rorterraineditor/RoRTerrainSelectedObjectOgreWindow.py 2007-06-26 01:22:44 UTC (rev 32) @@ -35,9 +35,11 @@ def OnFrameStarted(self): # sync with main if not self.mainWindow.mSelected is None: + self.radius = self.mainWindow.mSelected.getBoundingRadius() * 2 + height = self.mainWindow.mSelected.getBoundingBox().getMaximum().y n = self.mainWindow.mSelected.getParentNode() - pos = n.getPosition() - self.camera.lookAt(pos) + pos = n.getPosition() + ogre.Vector3(0, height*0.4, 0) + self.camera.lookAt(pos + ogre.Vector3(0, height/2, 0)) dx = math.cos(self.camalpha) * self.radius dy = math.sin(self.camalpha) * self.radius self.camera.setPosition(pos - ogre.Vector3(dx, -5, dy)) Modified: trunk/lib/rorterraineditor/RoRTerrainSelectedObjectTopOgreWindow.py =================================================================== --- trunk/lib/rorterraineditor/RoRTerrainSelectedObjectTopOgreWindow.py 2007-06-25 22:19:55 UTC (rev 31) +++ trunk/lib/rorterraineditor/RoRTerrainSelectedObjectTopOgreWindow.py 2007-06-26 01:22:44 UTC (rev 32) @@ -41,6 +41,8 @@ pos = n.getPosition() terrainHeight = self.getTerrainHeight(pos) camHeight = self.distance + self.camera.setNearClipDistance(camHeight) + self.camera.setFarClipDistance(camHeight * 10) self.camera.setPosition(pos + ogre.Vector3(0.1, camHeight, 0.1)) self.camera.lookAt(pos) wxOgreWindow.OnFrameStarted(self) @@ -48,10 +50,12 @@ def SceneInitialisation(self): # create a camera self.camera = self.sceneManager.createCamera('SharedCamera' + self.rand) - self.camera.lookAt(ogre.Vector3(0, 0, 0)) - self.camera.setPosition(ogre.Vector3(0, 0, 100)) - self.camera.nearClipDistance = 0.1 - self.camera.setAutoAspectRatio(True) + + self.camera.setProjectionType(ogre.ProjectionType.PT_ORTHOGRAPHIC) + self.camera.setNearClipDistance(5) + self.camera.setPosition(ogre.Vector3(0.1,-100,0)) + self.camera.lookAt(ogre.Vector3(0,0,0)) + #self.camera.setAutoAspectRatio(True) # create the Viewport" self.viewport = self.renderWindow.addViewport(self.camera, 0, 0.0, 0.0, 1.0, 1.0) Modified: trunk/media/materials/mysimple.material =================================================================== --- trunk/media/materials/mysimple.material 2007-06-25 22:19:55 UTC (rev 31) +++ trunk/media/materials/mysimple.material 2007-06-26 01:22:44 UTC (rev 32) @@ -10,7 +10,7 @@ { texture water.jpg scroll_anim 0.01 0.01 - alpha_op_ex source1 src_manual src_current 0.9 + alpha_op_ex source1 src_manual src_current 0.75 } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-06-25 22:19:59
|
Revision: 31 http://roreditor.svn.sourceforge.net/roreditor/?rev=31&view=rev Author: rorthomas Date: 2007-06-25 15:19:55 -0700 (Mon, 25 Jun 2007) Log Message: ----------- * new camera movement in terrain editor * added check for spaces in ror direcotory name Modified Paths: -------------- trunk/lib/ror/starter.py trunk/lib/rorterraineditor/RoRTerrainOgreWindow.py trunk/lib/rortruckeditor/RoRTruckOgreWindow.py Modified: trunk/lib/ror/starter.py =================================================================== --- trunk/lib/ror/starter.py 2007-06-25 21:53:15 UTC (rev 30) +++ trunk/lib/ror/starter.py 2007-06-25 22:19:55 UTC (rev 31) @@ -85,17 +85,28 @@ pass def checkRoRDir(self, fn): - return os.path.isfile(os.path.join(fn,"RoR.exe")) + withoutspaces = (fn.find(" ") == -1) + if not withoutspaces: + dlg = wx.MessageDialog(self, "Your RoR installation directory contains spaces. Rename/move it to a directory with no spaces.\nFor example c:\\ror", "Error", wx.OK | wx.ICON_INFORMATION) + dlg.ShowModal() + dlg.Destroy() + return False + + exists = os.path.isfile(os.path.join(fn,"RoR.exe")) + if not exists: + dlg = wx.MessageDialog(self, "RoR.exe not found in the selected directory!\nPlease select a new directory!", "Error", wx.OK | wx.ICON_INFORMATION) + dlg.ShowModal() + dlg.Destroy() + return False + return True + def OnSelectRoRDir(self, event=None): dialog = wx.DirDialog(self, "Choose RoR Directory", "") res = dialog.ShowModal() if res == wx.ID_OK: newpath = dialog.GetPath() if not self.checkRoRDir(newpath): - dlg = wx.MessageDialog(self, "RoR.exe not found in that directory!", "Error", wx.OK | wx.ICON_INFORMATION) - dlg.ShowModal() - dlg.Destroy() return self.rordir = newpath Modified: trunk/lib/rorterraineditor/RoRTerrainOgreWindow.py =================================================================== --- trunk/lib/rorterraineditor/RoRTerrainOgreWindow.py 2007-06-25 21:53:15 UTC (rev 30) +++ trunk/lib/rorterraineditor/RoRTerrainOgreWindow.py 2007-06-25 22:19:55 UTC (rev 31) @@ -33,6 +33,8 @@ self.trucks = {} self.comments = {} self.meshes = {} + self.moveVector = None + self.moveForce = 0 wxOgreWindow.__init__(self, self.parent, self.ID, size = self.size, **self.kwargs) def OnFrameStarted(self): @@ -56,6 +58,13 @@ else: self.TerrainSelectNode.setScale(0,0,0) + + #move cam a bit + if not self.moveVector is None and self.moveForce > 0: + self.camera.moveRelative(self.moveVector * self.moveForce) + self.moveForce *= 0.75 + if self.moveForce < 0.000: + self.moveForce = 0 def OnFrameEnded(self): pass @@ -935,21 +944,26 @@ d = 5 if event.ShiftDown(): d = 30 - if event.m_keyCode == 65: # A, wx.WXK_LEFT: - self.camera.moveRelative(ogre.Vector3(-d,0,0)) + self.moveVector = ogre.Vector3(-1,0,0) + self.moveForce = d elif event.m_keyCode == 68: # D, wx.WXK_RIGHT: - self.camera.moveRelative(ogre.Vector3(d,0,0)) + self.moveVector = ogre.Vector3(1,0,0) + self.moveForce = d elif event.m_keyCode == 87: # W ,wx.WXK_UP: - self.camera.moveRelative(ogre.Vector3(0,0,-d)) - elif event.m_keyCode == 81: # Q, wx.WXK_LEFT: - self.toggleTranslationRotationMode() + self.moveVector = ogre.Vector3(0,0,-1) + self.moveForce = d elif event.m_keyCode == 83: # S, wx.WXK_DOWN: - self.camera.moveRelative(ogre.Vector3(0,0,d)) + self.moveVector = ogre.Vector3(0,0,1) + self.moveForce = d elif event.m_keyCode == wx.WXK_PAGEUP: - self.camera.moveRelative(ogre.Vector3(0,d,0)) + self.moveVector = ogre.Vector3(0,1,0) + self.moveForce = d elif event.m_keyCode == wx.WXK_PAGEDOWN: - self.camera.moveRelative(ogre.Vector3(0,-d,0)) + self.moveVector = ogre.Vector3(0,-1,0) + self.moveForce = d + elif event.m_keyCode == 81: # Q, wx.WXK_LEFT: + self.toggleTranslationRotationMode() elif event.m_keyCode == 84: # 84 = T if self.filtering == ogre.TFO_BILINEAR: self.filtering = ogre.TFO_TRILINEAR Modified: trunk/lib/rortruckeditor/RoRTruckOgreWindow.py =================================================================== --- trunk/lib/rortruckeditor/RoRTruckOgreWindow.py 2007-06-25 21:53:15 UTC (rev 30) +++ trunk/lib/rortruckeditor/RoRTruckOgreWindow.py 2007-06-25 22:19:55 UTC (rev 31) @@ -296,7 +296,7 @@ #print tree['globals'][0]['data'][2] matname = tree['globals'][0]['data'][2] - print matname + #print matname idstr = str(smgid) sm = self.sceneManager.createManualObject("manualsmg"+idstr) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-06-25 21:53:16
|
Revision: 30 http://roreditor.svn.sourceforge.net/roreditor/?rev=30&view=rev Author: rorthomas Date: 2007-06-25 14:53:15 -0700 (Mon, 25 Jun 2007) Log Message: ----------- small bugfix of some material bug Modified Paths: -------------- trunk/lib/rortruckeditor/RoRTruckOgreWindow.py Modified: trunk/lib/rortruckeditor/RoRTruckOgreWindow.py =================================================================== --- trunk/lib/rortruckeditor/RoRTruckOgreWindow.py 2007-06-25 20:33:06 UTC (rev 29) +++ trunk/lib/rortruckeditor/RoRTruckOgreWindow.py 2007-06-25 21:53:15 UTC (rev 30) @@ -296,6 +296,7 @@ #print tree['globals'][0]['data'][2] matname = tree['globals'][0]['data'][2] + print matname idstr = str(smgid) sm = self.sceneManager.createManualObject("manualsmg"+idstr) @@ -317,7 +318,8 @@ # set culling mode for that material mat = ogre.MaterialManager.getSingleton().getByName(matname) - mat.setCullingMode(Ogre.CullingMode.CULL_NONE) + if not mat is None: + mat.setCullingMode(Ogre.CullingMode.CULL_NONE) smnode = self.sceneManager.getRootSceneNode().createChildSceneNode() smnode.attachObject(sm) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-06-25 20:33:28
|
Revision: 29 http://roreditor.svn.sourceforge.net/roreditor/?rev=29&view=rev Author: rorthomas Date: 2007-06-25 13:33:06 -0700 (Mon, 25 Jun 2007) Log Message: ----------- little bugfix Modified Paths: -------------- trunk/lib/rortruckeditor/MainFrame.py Modified: trunk/lib/rortruckeditor/MainFrame.py =================================================================== --- trunk/lib/rortruckeditor/MainFrame.py 2007-06-25 20:17:24 UTC (rev 28) +++ trunk/lib/rortruckeditor/MainFrame.py 2007-06-25 20:33:06 UTC (rev 29) @@ -246,9 +246,6 @@ self.viewnormalnodes.Check(value) self.OnViewNormalNodes() - - - def OnViewAllBeams(self, event=None): value = self.viewallbeams.IsChecked() @@ -278,6 +275,7 @@ dialog = wx.FileDialog(self, "Open Terrain", default, "", "Trucks or Loads (*.truck, *.load)|*.truck;*.load", wx.FD_OPEN | wx.FD_FILE_MUST_EXIST) res = dialog.ShowModal() if res == wx.ID_OK: + self.fileopenmenu.Enable(False) filename = dialog.GetPath() print filename self.truckOgreWin.LoadTruck(filename) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-06-25 20:17:26
|
Revision: 28 http://roreditor.svn.sourceforge.net/roreditor/?rev=28&view=rev Author: rorthomas Date: 2007-06-25 13:17:24 -0700 (Mon, 25 Jun 2007) Log Message: ----------- * added tuusita's systemdrive fix to .bat files * removed some senseless controls from terraineditor * terraineditor now imports objects rather than meshs * fixed truck rotation Modified Paths: -------------- trunk/lib/ror/rorsettings.py trunk/lib/rorterraineditor/MainFrame.py trunk/lib/rorterraineditor/RoRTerrainOgreWindow.py trunk/rortoolkit.bat trunk/terraineditor.bat trunk/truckeditor.bat Modified: trunk/lib/ror/rorsettings.py =================================================================== --- trunk/lib/ror/rorsettings.py 2007-06-25 18:04:46 UTC (rev 27) +++ trunk/lib/ror/rorsettings.py 2007-06-25 20:17:24 UTC (rev 28) @@ -24,8 +24,9 @@ def LoadRoRDir(self): try: f = open(self.configfilename,'r') - self.rordir = f.read() + self.rordir = os.path.abspath(f.read()) f.close() + print "Loaded RoR Directory: %s" % self.rordir except: print "error while loading rordir: %s" % self.configfilename Modified: trunk/lib/rorterraineditor/MainFrame.py =================================================================== --- trunk/lib/rorterraineditor/MainFrame.py 2007-06-25 18:04:46 UTC (rev 27) +++ trunk/lib/rorterraineditor/MainFrame.py 2007-06-25 20:17:24 UTC (rev 28) @@ -78,8 +78,8 @@ self.statusbar.SetStatusText("-", 1) #create toolbar - self.toolbar = wx.ToolBar(self, wx.ID_ANY, style = wx.TB_HORZ_TEXT) - self.SetToolBar(self.toolbar ) + #self.toolbar = wx.ToolBar(self, wx.ID_ANY, style = wx.TB_HORZ_TEXT) + #self.SetToolBar(self.toolbar ) #bitmap = wx.Bitmap("media/gui/OpenFile.gif", wx.BITMAP_TYPE_GIF) #self.toolbar.DoAddTool(0, "Open Terrain", bitmap, bitmap, wx.ITEM_NORMAL, "Open Terrain", "Opens a new terrain for edit") @@ -94,21 +94,21 @@ self.waterlevelctrl.max = 300 self.Bind(wx.EVT_SCROLL, self.OnChangeWaterLevel, self.waterlevelctrl) - self.CurrEntName = wx.StaticText(self, wx.ID_ANY, "") - self.PosText = wx.StaticText(self, wx.ID_ANY, "Position: x,y,z") - self.terrPosX = wx.TextCtrl(self, wx.ID_ANY) - self.terrPosY = wx.TextCtrl(self, wx.ID_ANY) - self.terrPosZ = wx.TextCtrl(self, wx.ID_ANY) - self.RotText = wx.StaticText(self, wx.ID_ANY, "Rotation: x,y,z") - self.terrRotX = wx.TextCtrl(self, wx.ID_ANY) - self.terrRotY = wx.TextCtrl(self, wx.ID_ANY) - self.terrRotZ = wx.TextCtrl(self, wx.ID_ANY) - self.Bind(wx.EVT_TEXT, self.OnChangeObjPosRot, self.terrPosX) - self.Bind(wx.EVT_TEXT, self.OnChangeObjPosRot, self.terrPosY) - self.Bind(wx.EVT_TEXT, self.OnChangeObjPosRot, self.terrPosZ) - self.Bind(wx.EVT_TEXT, self.OnChangeObjPosRot, self.terrRotX) - self.Bind(wx.EVT_TEXT, self.OnChangeObjPosRot, self.terrRotY) - self.Bind(wx.EVT_TEXT, self.OnChangeObjPosRot, self.terrRotZ) + self.CurrEntName = wx.StaticText(self, wx.ID_ANY, "\n\n\n") + #self.PosText = wx.StaticText(self, wx.ID_ANY, "Position: x,y,z") + #self.terrPosX = wx.TextCtrl(self, wx.ID_ANY) + #self.terrPosY = wx.TextCtrl(self, wx.ID_ANY) + #self.terrPosZ = wx.TextCtrl(self, wx.ID_ANY) + #self.RotText = wx.StaticText(self, wx.ID_ANY, "Rotation: x,y,z") + #self.terrRotX = wx.TextCtrl(self, wx.ID_ANY) + #self.terrRotY = wx.TextCtrl(self, wx.ID_ANY) + #self.terrRotZ = wx.TextCtrl(self, wx.ID_ANY) + #self.Bind(wx.EVT_TEXT, self.OnChangeObjPosRot, self.terrPosX) + #self.Bind(wx.EVT_TEXT, self.OnChangeObjPosRot, self.terrPosY) + #self.Bind(wx.EVT_TEXT, self.OnChangeObjPosRot, self.terrPosZ) + #self.Bind(wx.EVT_TEXT, self.OnChangeObjPosRot, self.terrRotX) + #self.Bind(wx.EVT_TEXT, self.OnChangeObjPosRot, self.terrRotY) + #self.Bind(wx.EVT_TEXT, self.OnChangeObjPosRot, self.terrRotZ) self.btnResetRotation = wx.Button(self, wx.ID_ANY, "Reset Rotation") self.Bind(wx.EVT_BUTTON, self.OnBtnResetRotation, self.btnResetRotation) @@ -139,7 +139,7 @@ add_menu = wx.Menu() add_menu.Append(ID_ADDTRUCK, "&Truck/Load", "add a Truck or a Load to the terrain") self.Bind(wx.EVT_MENU, self.OnAddTruck, id=ID_ADDTRUCK) - add_menu.Append(ID_ADDMESH, "&Mesh", "add a static Mesh to the terrain") + add_menu.Append(ID_ADDMESH, "&Object", "add a static Object to the terrain") self.Bind(wx.EVT_MENU, self.OnAddMesh, id=ID_ADDMESH) menuBar.Append(add_menu, "&Add"); @@ -180,17 +180,25 @@ dialog = wx.FileDialog(self, "Add Truck", default, "", "Truck and Load Files (*.truck,*.load)|*.truck;*.load", wx.FD_OPEN | wx.FD_FILE_MUST_EXIST) res = dialog.ShowModal() if res == wx.ID_OK: - self.terrainOgreWin.addTruckToTerrain(dialog.GetPath()) + if not self.terrainOgreWin.addTruckToTerrain(dialog.GetPath()): + dlg = wx.MessageDialog(self, "You must select a position on the ground first!", "error", wx.OK | wx.ICON_INFORMATION) + dlg.ShowModal() + dlg.Destroy() def OnAddMesh(self, event=None): default = "" if self.rordir: default = os.path.join(self.rordir, OBJECTDIR) print default - dialog = wx.FileDialog(self, "Add Mesh", default, "", "Ogre Meshs (*.mesh)|*.mesh", wx.FD_OPEN | wx.FD_FILE_MUST_EXIST) + dialog = wx.FileDialog(self, "Add Object", default, "", "RoR Object Definitions (*.odef)|*.odef", wx.FD_OPEN | wx.FD_FILE_MUST_EXIST) res = dialog.ShowModal() if res == wx.ID_OK: - self.terrainOgreWin.addMeshToTerrain(dialog.GetPath()) + print dialog.GetPath() + if not self.terrainOgreWin.addMeshToTerrain(dialog.GetPath()): + dlg = wx.MessageDialog(self, "You must select a position on the ground first!", "error", wx.OK | wx.ICON_INFORMATION) + dlg.ShowModal() + dlg.Destroy() + def OnBtnResetRotation(self, event=None): self.terrainOgreWin.ObjectResetRotation() @@ -202,18 +210,18 @@ if self.terrainOgreWin.mSelected is None: return n = self.terrainOgreWin.mSelected.getParentNode() - self.CurrEntName.Label = n.getName() - pos = n.getPosition() - self.terrPosX.SetValue(str(round(pos.x,2))) - self.terrPosY.SetValue(str(round(pos.y,2))) - self.terrPosZ.SetValue(str(round(pos.z,2))) - rot = n.getOrientation() - self.terrRotX.SetValue(str(round(ogre.Radian(rot.getPitch(False)+90).valueDegrees(),2))) - self.terrRotY.SetValue(str(round(ogre.Radian(rot.getYaw(False)).valueDegrees(),2))) - self.terrRotZ.SetValue(str(round(ogre.Radian(rot.getRoll(False)).valueDegrees(),2))) + self.CurrEntName.Label = "selected Object:\n%s" % n.getName() + #pos = n.getPosition() + #self.terrPosX.SetValue(str(round(pos.x,2))) + #self.terrPosY.SetValue(str(round(pos.y,2))) + #self.terrPosZ.SetValue(str(round(pos.z,2))) + #rot = n.getOrientation() + #self.terrRotX.SetValue(str(round(ogre.Radian(rot.getPitch(False)+90).valueDegrees(),2))) + #self.terrRotY.SetValue(str(round(ogre.Radian(rot.getYaw(False)).valueDegrees(),2))) + #self.terrRotZ.SetValue(str(round(ogre.Radian(rot.getRoll(False)).valueDegrees(),2))) def OnChangeObjPosRot(self, event=None): - self.terrainOgreWin.TerrainName = self.terrainNamectrl.GetValue() + pass def OnChangeTerrainNameChange(self, event=None): self.terrainOgreWin.TerrainName = self.terrainNamectrl.GetValue() @@ -264,7 +272,7 @@ dialog = wx.FileDialog(self, "Open Terrain", default, "", "Terrain Files (*.terrn)|*.terrn", wx.FD_OPEN | wx.FD_FILE_MUST_EXIST) res = dialog.ShowModal() if res == wx.ID_OK: - #self.fileopenmenu.Enable(False) + self.fileopenmenu.Enable(False) self.filesavemenu.Enable(True) self.filesaveasmenu.Enable(True) filename = dialog.GetPath() @@ -309,7 +317,7 @@ def OnExit(self, event): self.Close(True) del self - #sys.exit(0) + sys.exit(0) def __set_properties(self): self.SetTitle("RoREditor version 0.0.4") @@ -356,19 +364,19 @@ sizer_settings.Add(self.terrainNamectrl, 0, wx.EXPAND, 0) sizer_settings.Add(self.CurrEntName, 0, wx.EXPAND, 0) - sizer_settings.Add(self.PosText, 0, wx.EXPAND, 0) - sizer_terrPos = wx.BoxSizer(wx.HORIZONTAL) - sizer_terrPos.Add(self.terrPosX, 0, wx.EXPAND, 0) - sizer_terrPos.Add(self.terrPosY, 0, wx.EXPAND, 0) - sizer_terrPos.Add(self.terrPosZ, 0, wx.EXPAND, 0) - sizer_settings.Add(sizer_terrPos, 0, wx.EXPAND, 0) + #sizer_settings.Add(self.PosText, 0, wx.EXPAND, 0) + #sizer_terrPos = wx.BoxSizer(wx.HORIZONTAL) + #sizer_terrPos.Add(self.terrPosX, 0, wx.EXPAND, 0) + #sizer_terrPos.Add(self.terrPosY, 0, wx.EXPAND, 0) + #sizer_terrPos.Add(self.terrPosZ, 0, wx.EXPAND, 0) + #sizer_settings.Add(sizer_terrPos, 0, wx.EXPAND, 0) - sizer_settings.Add(self.RotText, 0, wx.EXPAND, 0) - sizer_terrRot = wx.BoxSizer(wx.HORIZONTAL) - sizer_terrRot.Add(self.terrRotX, 0, wx.EXPAND, 0) - sizer_terrRot.Add(self.terrRotY, 0, wx.EXPAND, 0) - sizer_terrRot.Add(self.terrRotZ, 0, wx.EXPAND, 0) - sizer_settings.Add(sizer_terrRot, 0, wx.EXPAND, 0) + #sizer_settings.Add(self.RotText, 0, wx.EXPAND, 0) + #sizer_terrRot = wx.BoxSizer(wx.HORIZONTAL) + #sizer_terrRot.Add(self.terrRotX, 0, wx.EXPAND, 0) + #sizer_terrRot.Add(self.terrRotY, 0, wx.EXPAND, 0) + #sizer_terrRot.Add(self.terrRotZ, 0, wx.EXPAND, 0) + #sizer_settings.Add(sizer_terrRot, 0, wx.EXPAND, 0) sizer_settings.Add(self.btnResetRotation, 0, wx.EXPAND, 0) sizer_settings.Add(self.btnStickToGround, 0, wx.EXPAND, 0) Modified: trunk/lib/rorterraineditor/RoRTerrainOgreWindow.py =================================================================== --- trunk/lib/rorterraineditor/RoRTerrainOgreWindow.py 2007-06-25 18:04:46 UTC (rev 27) +++ trunk/lib/rorterraineditor/RoRTerrainOgreWindow.py 2007-06-25 20:17:24 UTC (rev 28) @@ -7,6 +7,8 @@ from random import random +ADDEDBY = "//added by the terrrain editor:\n" + class RoRTerrainOgreWindow(wxOgreWindow): #myObjects = {} @@ -145,6 +147,7 @@ f=open(self.rordir+"\\data\\objects\\%s.odef" % (objname), 'r') content = f.readlines() f.close() + meshname = content[0].strip() scalearr = content[1].split(",") self.myODefs[objname] = [] if len(content) > 2: @@ -153,9 +156,9 @@ if line.lower().strip() == "end": break self.myODefs[objname].append(line.split(",")) - return (float(scalearr[0]), float(scalearr[1]), float(scalearr[2])) + return (meshname, float(scalearr[0]), float(scalearr[1]), float(scalearr[2])) else: - return (1, 1, 1) + return (meshname, 1, 1, 1) except Exception, err: print "error while processing odef file of %s" % objname print str(err) @@ -275,17 +278,19 @@ n.setPosition(x, y, z) continue firstobjname = objname[0] - n = self.sceneManager.getRootSceneNode().createChildSceneNode("object" + str(i)+ firstobjname) - entname = "objent" + str(i)+"_"+firstobjname - e = self.sceneManager.createEntity(entname, firstobjname+".mesh") - n.attachObject(e) try: - (sx, sy, sz) = self.loadOdef(firstobjname) + (meshname, sx, sy, sz) = self.loadOdef(firstobjname) except Exception, inst: print inst print "########## error loading odef of %s" % firstobjname sx = None + + n = self.sceneManager.getRootSceneNode().createChildSceneNode("object" + str(i)+ firstobjname) + entname = "objent" + str(i)+"_"+firstobjname + e = self.sceneManager.createEntity(entname, meshname) + n.attachObject(e) + #print "position: ", x,", ", y,", ", z #print "rotation: ", rx,", ", ry,", ", rz #print "scale: ", sx,", ", sy,", ", sz @@ -361,9 +366,15 @@ rot = truck.getOrientation() truck.setScale(scale) - rotx = ogre.Radian(rot.getPitch(False)).valueDegrees() - 180 - rotz = ogre.Radian(rot.getRoll(False)).valueDegrees() - 180 - roty = - ogre.Radian(rot.getYaw(False)).valueDegrees() -180 + rotx = ogre.Radian(rot.getPitch(False)).valueDegrees() + rotz = ogre.Radian(rot.getRoll(False)).valueDegrees() + roty = - ogre.Radian(rot.getYaw(False)).valueDegrees() + if rotx != 0: + rotx -= 180 + if roty != 0: + roty -= 180 + if rotz != 0: + rotz -= 180 truckstring = k.split(".")[-1] + "\t " + k ar = [self.formatFloat(pos.x), self.formatFloat(pos.y), @@ -721,25 +732,44 @@ def addMeshToTerrain(self, fn): if self.selectedCoords is None: - return + return False + self.randomcounter += 1 - n = self.sceneManager.getRootSceneNode().createChildSceneNode("objectnode" + str(fn) + str(self.randomcounter)) - entname = "objent" + str(i)+str(self.randomcounter)+"_"+objname - e = self.sceneManager.createEntity(entname, objname+".mesh") + meshname = os.path.basename(fn) + (firstobjname, fileExtension) = os.path.splitext(meshname) + + try: + (meshname, sx, sy, sz) = self.loadOdef(firstobjname) + except Exception, inst: + print inst + print "########## error loading odef of %s" % firstobjname + sx = None + self.randomcounter +=1 + n = self.sceneManager.getRootSceneNode().createChildSceneNode("object" + str(self.randomcounter)+ firstobjname) + entname = "objent" + str(self.randomcounter)+"_"+firstobjname + e = self.sceneManager.createEntity(entname, meshname) n.attachObject(e) + n.setPosition(self.selectedCoords) n.rotate(ogre.Vector3.UNIT_X, ogre.Degree(-90),relativeTo=ogre.Node.TransformSpace.TS_WORLD) + if not sx is None: + n.setScale(sx, sy, sz) self.meshes[entname] = n + self.comments[entname] = [ADDEDBY] + self.meshesorder.append(entname) + return True + def addTruckToTerrain(self, fn): if self.selectedCoords is None: - return - n = self.createTruckMesh(fn) + return False + n, entname = self.createTruckMesh(fn) n.setPosition(self.selectedCoords) + return True def createTruckMesh(self, fn): if not os.path.isfile(fn): - print "truck file not found: "+fn + print "truck file not found: " + fn return p = rorparser() p.parse(fn) Modified: trunk/rortoolkit.bat =================================================================== --- trunk/rortoolkit.bat 2007-06-25 18:04:46 UTC (rev 27) +++ trunk/rortoolkit.bat 2007-06-25 20:17:24 UTC (rev 28) @@ -1 +1 @@ -C:\python25\python.exe rortoolkit.py %1 %2 %3 %4 %5 %6 %7 %8 %9 +%systemdrive%\python25\python.exe rortoolkit.py %1 %2 %3 %4 %5 %6 %7 %8 %9 Modified: trunk/terraineditor.bat =================================================================== --- trunk/terraineditor.bat 2007-06-25 18:04:46 UTC (rev 27) +++ trunk/terraineditor.bat 2007-06-25 20:17:24 UTC (rev 28) @@ -1 +1 @@ -C:\python25\python.exe terraineditor.py %1 %2 %3 %4 %5 %6 %7 %8 %9 +%systemdrive%\python25\python.exe terraineditor.py %1 %2 %3 %4 %5 %6 %7 %8 %9 Modified: trunk/truckeditor.bat =================================================================== --- trunk/truckeditor.bat 2007-06-25 18:04:46 UTC (rev 27) +++ trunk/truckeditor.bat 2007-06-25 20:17:24 UTC (rev 28) @@ -1 +1 @@ -C:\python25\python.exe truckeditor.py %1 %2 %3 %4 %5 %6 %7 %8 %9 +%systemdrive%\python25\python.exe truckeditor.py %1 %2 %3 %4 %5 %6 %7 %8 %9 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-06-25 18:04:51
|
Revision: 27 http://roreditor.svn.sourceforge.net/roreditor/?rev=27&view=rev Author: rorthomas Date: 2007-06-25 11:04:46 -0700 (Mon, 25 Jun 2007) Log Message: ----------- *updated setup: ** directx is now installed automatically ** pywin is now installed automatically * updated setup splash screen Modified Paths: -------------- trunk/setup.nsi trunk/splash.bmp Modified: trunk/setup.nsi =================================================================== --- trunk/setup.nsi 2007-06-25 17:46:49 UTC (rev 26) +++ trunk/setup.nsi 2007-06-25 18:04:46 UTC (rev 27) @@ -143,20 +143,20 @@ Function InstallDirectX InitPluginsDir - File /oname=$PLUGINSDIR\dxwebsetup.exe "tools/dxwebsetup.exe" + File /oname=$PLUGINSDIR\dxwebsetup.exe "tools\dxwebsetup.exe" Banner::show /NOUNLOAD "Installing lastest DirectX ..." - ExecWait '"dxwebsetup.exe /Q"' + ExecWait '"$PLUGINSDIR\dxwebsetup.exe /Q"' Delete $PLUGINSDIR\dxwebsetup.exe Banner::destroy FunctionEnd -Function InstallDirectX +Function InstallPyWin32 InitPluginsDir - File /oname=$PLUGINSDIR\pywin32.exe "tools/pywin32-210.win32-py2.5.exe" + File /oname=$PLUGINSDIR\pywin32-setup.exe "tools\pywin32-setup.exe" Banner::show /NOUNLOAD "Installing Python for Windows ..." - ExecWait '"pywin32.exe /Q"' - Delete $PLUGINSDIR\dxwebsetup.exe + ExecWait '"$PLUGINSDIR\pywin32-setup.exe"' + Delete $PLUGINSDIR\pywin32-setup.exe Banner::destroy FunctionEnd @@ -178,7 +178,11 @@ Call InstallDirectX SectionEnd -Section "Full Installation" SEC03 +Section "Install PyWin32" SEC03 + Call InstallPyWin32 +SectionEnd + +Section "Full Installation" SEC04 SetOutPath "$INSTDIR" SetOverwrite try File "ogre.cfg" @@ -201,6 +205,7 @@ SetOverwrite try File "/r" "lib" File "/r" "media" + File "/r" "tools" SectionEnd Section -AdditionalIcons Modified: trunk/splash.bmp =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-06-25 17:46:50
|
Revision: 26 http://roreditor.svn.sourceforge.net/roreditor/?rev=26&view=rev Author: rorthomas Date: 2007-06-25 10:46:49 -0700 (Mon, 25 Jun 2007) Log Message: ----------- updated version number 0.0.4 Modified Paths: -------------- trunk/lib/rorterraineditor/MainFrame.py Modified: trunk/lib/rorterraineditor/MainFrame.py =================================================================== --- trunk/lib/rorterraineditor/MainFrame.py 2007-06-25 17:41:13 UTC (rev 25) +++ trunk/lib/rorterraineditor/MainFrame.py 2007-06-25 17:46:49 UTC (rev 26) @@ -312,7 +312,7 @@ #sys.exit(0) def __set_properties(self): - self.SetTitle("RoREditor version 0.0.3") + self.SetTitle("RoREditor version 0.0.4") self.terrainOgreWin.SetMinSize((640,480)) def __do_layout(self): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-06-25 17:41:14
|
Revision: 25 http://roreditor.svn.sourceforge.net/roreditor/?rev=25&view=rev Author: rorthomas Date: 2007-06-25 10:41:13 -0700 (Mon, 25 Jun 2007) Log Message: ----------- * fixed truck rotation on save Modified Paths: -------------- trunk/lib/rorterraineditor/RoRTerrainOgreWindow.py Modified: trunk/lib/rorterraineditor/RoRTerrainOgreWindow.py =================================================================== --- trunk/lib/rorterraineditor/RoRTerrainOgreWindow.py 2007-06-25 17:25:01 UTC (rev 24) +++ trunk/lib/rorterraineditor/RoRTerrainOgreWindow.py 2007-06-25 17:41:13 UTC (rev 25) @@ -361,9 +361,9 @@ rot = truck.getOrientation() truck.setScale(scale) - rotx = ogre.Radian(rot.getPitch(False)).valueDegrees() - roty = ogre.Radian(rot.getRoll(False)).valueDegrees() - rotz = - ogre.Radian(rot.getYaw(False)).valueDegrees() + rotx = ogre.Radian(rot.getPitch(False)).valueDegrees() - 180 + rotz = ogre.Radian(rot.getRoll(False)).valueDegrees() - 180 + roty = - ogre.Radian(rot.getYaw(False)).valueDegrees() -180 truckstring = k.split(".")[-1] + "\t " + k ar = [self.formatFloat(pos.x), self.formatFloat(pos.y), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-06-25 17:25:07
|
Revision: 24 http://roreditor.svn.sourceforge.net/roreditor/?rev=24&view=rev Author: rorthomas Date: 2007-06-25 10:25:01 -0700 (Mon, 25 Jun 2007) Log Message: ----------- *terraineditor: **added save terrains as menu entry **save is now working for meshes, trucks are wrong rotated Modified Paths: -------------- trunk/lib/rorterraineditor/MainFrame.py trunk/lib/rorterraineditor/RoRTerrainOgreWindow.py Modified: trunk/lib/rorterraineditor/MainFrame.py =================================================================== --- trunk/lib/rorterraineditor/MainFrame.py 2007-06-25 01:15:41 UTC (rev 23) +++ trunk/lib/rorterraineditor/MainFrame.py 2007-06-25 17:25:01 UTC (rev 24) @@ -16,6 +16,7 @@ ID_ADDTRUCK = 107 ID_ADDMESH = 108 ID_CHECKUPDATE = 109 +ID_SAVEFILEAS = 110 ID_EXIT = 199 DATADIR = "data" @@ -120,7 +121,10 @@ file_menu = wx.Menu() self.fileopenmenu = file_menu.Append(ID_OPENFILE, "&Open", "Open Terrain") self.filesavemenu = file_menu.Append(ID_SAVEFILE, "&Save", "Save Terrain") + self.filesaveasmenu = file_menu.Append(ID_SAVEFILEAS, "&Save as", "Save Terrain as") + self.filesavemenu.Enable(False) + self.filesaveasmenu.Enable(False) file_menu.AppendSeparator() file_menu.Append(ID_EXIT, "E&xit", "Terminate the program") menuBar.Append(file_menu, "&File"); @@ -152,6 +156,7 @@ self.Bind(wx.EVT_MENU, self.OnExit, id=ID_EXIT) self.Bind(wx.EVT_MENU, self.OnFileOpen, id=ID_OPENFILE) self.Bind(wx.EVT_MENU, self.OnFileSave, id=ID_SAVEFILE) + self.Bind(wx.EVT_MENU, self.OnFileSaveAs, id=ID_SAVEFILEAS) self.Bind(wx.EVT_MENU, self.OnAbout, id=ID_ABOUT) self.Bind(wx.EVT_MENU, self.onViewObjectDetails, id=ID_VIEWOBJ) self.Bind(wx.EVT_MENU, self.OnChangeOgreSettings, id=ID_OGRESET) @@ -234,18 +239,34 @@ dlg.ShowModal() dlg.Destroy() + def OnFileSaveAs(self, event): + default = "" + if self.rordir: + default = os.path.join(self.rordir, TERRAINDIR) + dialog = wx.FileDialog(self, "Save Terrain as", default, "", "Terrain Files (*.terrn)|*.terrn", wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT) + res = dialog.ShowModal() + if res == wx.ID_OK: + if self.terrainOgreWin.SaveTerrnFile(dialog.GetPath()): + dlg = wx.MessageDialog(self, "saved","info", wx.OK | wx.ICON_INFORMATION) + dlg.ShowModal() + dlg.Destroy() + else: + dlg = wx.MessageDialog(self, "error while saving as another file, see console!\n","error", wx.OK | wx.ICON_INFORMATION) + dlg.ShowModal() + dlg.Destroy() def OnFileOpen(self, event=None): default = "" if self.rordir: default = os.path.join(self.rordir, TERRAINDIR) - print default + #print default dialog = wx.FileDialog(self, "Open Terrain", default, "", "Terrain Files (*.terrn)|*.terrn", wx.FD_OPEN | wx.FD_FILE_MUST_EXIST) res = dialog.ShowModal() if res == wx.ID_OK: #self.fileopenmenu.Enable(False) self.filesavemenu.Enable(True) + self.filesaveasmenu.Enable(True) filename = dialog.GetPath() print filename Modified: trunk/lib/rorterraineditor/RoRTerrainOgreWindow.py =================================================================== --- trunk/lib/rorterraineditor/RoRTerrainOgreWindow.py 2007-06-25 01:15:41 UTC (rev 23) +++ trunk/lib/rorterraineditor/RoRTerrainOgreWindow.py 2007-06-25 17:25:01 UTC (rev 24) @@ -24,8 +24,12 @@ self.ID = ID self.mSelected = None self.selectedCoords = None + self.meshesorder = [] + self.additionaloptions = {} + self.trucksorder = [] self.myODefs = {} self.trucks = {} + self.comments = {} self.meshes = {} wxOgreWindow.__init__(self, self.parent, self.ID, size = self.size, **self.kwargs) @@ -143,12 +147,15 @@ f.close() scalearr = content[1].split(",") self.myODefs[objname] = [] - for i in range(1,len(content)): - line = content[i] - if line.lower().strip() == "end": - break - self.myODefs[objname].append(line.split(",")) - return (float(scalearr[0]), float(scalearr[1]), float(scalearr[2])) + if len(content) > 2: + for i in range(1,len(content)): + line = content[i] + if line.lower().strip() == "end": + break + self.myODefs[objname].append(line.split(",")) + return (float(scalearr[0]), float(scalearr[1]), float(scalearr[2])) + else: + return (1, 1, 1) except Exception, err: print "error while processing odef file of %s" % objname print str(err) @@ -180,10 +187,13 @@ linecounter = 0 self.UsingCaelum = False self.WaterHeight = None + comm = [] for i in range(0, len(content)): if content[i].strip() == "": + comm.append(content[i]) continue if content[i].strip()[0:2] == "//": + comm.append(content[i]) continue if content[i].strip().lower() == "end": continue @@ -229,67 +239,73 @@ continue arr = content[i].split(",") + #try: + x = float(arr[0]) + y = float(arr[1]) + z = float(arr[2]) + rx = float(arr[3]) + ry = float(arr[4]) + rz = float(arr[5]) + objname = (arr[6]).strip().split("\t") + if len(objname) == 1: + objname = (arr[6]).strip().split(" ") + #print objname + if objname[0][0:5] == "truck" and len(objname) > 1: + print "#############loading truck..." + fn = self.rordir + "\\data\\trucks\\"+objname[-1].strip() + n, entname = self.createTruckMesh(fn) + self.comments[entname] = comm + comm = [] + if not n is None: + n.rotate(ogre.Vector3.UNIT_X, ogre.Degree(rx).valueRadians(), relativeTo=ogre.Node.TransformSpace.TS_WORLD) + n.rotate(ogre.Vector3.UNIT_Y, ogre.Degree(ry).valueRadians(), relativeTo=ogre.Node.TransformSpace.TS_WORLD) + n.rotate(ogre.Vector3.UNIT_Z, ogre.Degree(-rz).valueRadians(), relativeTo=ogre.Node.TransformSpace.TS_WORLD) + n.setPosition(x, y, z) + continue + if objname[0][0:4] == "load" and len(objname) > 1: + print "#################loading load...." + fn = self.rordir + "\\data\\trucks\\"+objname[-1].strip() + n, entname = self.createTruckMesh(fn) + self.comments[entname] = comm + comm = [] + if not n is None: + n.rotate(ogre.Vector3.UNIT_X, ogre.Degree(rx).valueRadians(), relativeTo=ogre.Node.TransformSpace.TS_WORLD) + n.rotate(ogre.Vector3.UNIT_Y, ogre.Degree(ry).valueRadians(), relativeTo=ogre.Node.TransformSpace.TS_WORLD) + n.rotate(ogre.Vector3.UNIT_Z, ogre.Degree(-rz).valueRadians(), relativeTo=ogre.Node.TransformSpace.TS_WORLD) + n.setPosition(x, y, z) + continue + firstobjname = objname[0] + n = self.sceneManager.getRootSceneNode().createChildSceneNode("object" + str(i)+ firstobjname) + entname = "objent" + str(i)+"_"+firstobjname + e = self.sceneManager.createEntity(entname, firstobjname+".mesh") + n.attachObject(e) + try: - x = float(arr[0]) - y = float(arr[1]) - z = float(arr[2]) - rx = float(arr[3]) - ry = float(arr[4]) - rz = float(arr[5]) - objname = (arr[6]).strip().split("\t") - if len(objname) == 1: - objname = (arr[6]).strip().split(" ") - #print objname - if objname[0][0:5] == "truck" and len(objname) > 1: - print "#############loading truck..." - fn = self.rordir + "\\data\\trucks\\"+objname[1].strip() - n = self.createTruckMesh(fn) - if not n is None: - n.rotate(ogre.Vector3.UNIT_X, ogre.Degree(rx).valueRadians(), relativeTo=ogre.Node.TransformSpace.TS_WORLD) - n.rotate(ogre.Vector3.UNIT_Y, ogre.Degree(ry).valueRadians(), relativeTo=ogre.Node.TransformSpace.TS_WORLD) - n.rotate(ogre.Vector3.UNIT_Z, ogre.Degree(-rz).valueRadians(), relativeTo=ogre.Node.TransformSpace.TS_WORLD) - n.setPosition(x, y, z) - continue - if objname[0][0:4] == "load" and len(objname) > 1: - print "#################loading load...." - fn = self.rordir + "\\data\\trucks\\"+objname[1].strip() - n = self.createTruckMesh(fn) - if not n is None: - n.rotate(ogre.Vector3.UNIT_X, ogre.Degree(rx).valueRadians(), relativeTo=ogre.Node.TransformSpace.TS_WORLD) - n.rotate(ogre.Vector3.UNIT_Y, ogre.Degree(ry).valueRadians(), relativeTo=ogre.Node.TransformSpace.TS_WORLD) - n.rotate(ogre.Vector3.UNIT_Z, ogre.Degree(-rz).valueRadians(), relativeTo=ogre.Node.TransformSpace.TS_WORLD) - n.setPosition(x, y, z) - continue - objname = objname[0] - n = self.sceneManager.getRootSceneNode().createChildSceneNode("object" + str(i)+ objname) - entname = "objent" + str(i)+"_"+objname - e = self.sceneManager.createEntity(entname, objname+".mesh") - n.attachObject(e) - #ae = self.sceneManager.createEntity("axes" + str(i)+ objname, "axes.mesh") - #n.attachObject(ae); + (sx, sy, sz) = self.loadOdef(firstobjname) + except Exception, inst: + print inst + print "########## error loading odef of %s" % firstobjname + sx = None + #print "position: ", x,", ", y,", ", z + #print "rotation: ", rx,", ", ry,", ", rz + #print "scale: ", sx,", ", sy,", ", sz + n.setPosition(x, y, z) + n.rotate(ogre.Vector3.UNIT_X, ogre.Degree(-90),relativeTo=ogre.Node.TransformSpace.TS_WORLD) + n.rotate(ogre.Vector3.UNIT_Z, ogre.Degree(rz),relativeTo=ogre.Node.TransformSpace.TS_PARENT) + n.rotate(ogre.Vector3.UNIT_Y, ogre.Degree(ry),relativeTo=ogre.Node.TransformSpace.TS_PARENT) + n.rotate(ogre.Vector3.UNIT_X, ogre.Degree(rx),relativeTo=ogre.Node.TransformSpace.TS_PARENT) + if not sx is None: + n.setScale(sx, sy, sz) + self.comments[entname] = comm + comm = [] + self.meshesorder.append(entname) + if len(objname) > 1: + self.additionaloptions[entname] = objname[1:] + self.meshes[entname] = n - #self.myObjects["object" + str(i)+ objname] = n - #self.parent.cbObjects.Append("object" + str(i)+ objname) - - try: - (sx, sy, sz) = self.loadOdef(objname) - except: - print "########## error loading odef of %s" % objname - sx = None - #print "position: ", x,", ", y,", ", z - #print "rotation: ", rx,", ", ry,", ", rz - #print "scale: ", sx,", ", sy,", ", sz - n.setPosition(x, y, z) - n.rotate(ogre.Vector3.UNIT_X, ogre.Degree(-90),relativeTo=ogre.Node.TransformSpace.TS_WORLD) - n.rotate(ogre.Vector3.UNIT_Z, ogre.Degree(rz),relativeTo=ogre.Node.TransformSpace.TS_PARENT) - n.rotate(ogre.Vector3.UNIT_Y, ogre.Degree(ry),relativeTo=ogre.Node.TransformSpace.TS_PARENT) - n.rotate(ogre.Vector3.UNIT_X, ogre.Degree(rx),relativeTo=ogre.Node.TransformSpace.TS_PARENT) - if not sx is None: - n.setScale(sx, sy, sz) - self.meshes[entname] = n - - except: - print "error parsing line %s" % content[i] + #except Exception, inst: + # print inst + # print "error parsing line %s" % content[i] self.createWaterPlane() self.createArrows() if not self.CharacterStartPosition is None: @@ -297,8 +313,12 @@ else: self.camera.setPosition(self.CameraStartPosition) + def formatFloat(self, fl): + return "%12s" % ("%0.6f" % (float(fl))) - def SaveTerrnFile(self): + def SaveTerrnFile(self, fn = None): + if fn is None: + fn = self.terrnfile # quick and dirty ;) #try: lines = [] @@ -308,7 +328,7 @@ lines.append("w "+str(self.WaterHeight)+"\n") if self.UsingCaelum: lines.append("caelum\n") - lines.append(self.SkyColorLine+"\n") + lines.append(self.SkyColorLine.strip()+"\n") ar = [] ar.append(str(self.TruckStartPosition.x)) @@ -327,33 +347,74 @@ #save trucks and loads: - for k in self.trucks.keys(): + for k in self.trucksorder: + + if k in self.comments.keys(): + for c in self.comments[k]: + lines.append(c) + + truck = self.trucks[k] + scale = truck.getScale() + truck.setScale(1, 1, 1) pos = truck.getPosition() rot = truck.getOrientation() - rotx = str(round(ogre.Radian(rot.getPitch()).valueDegrees(),2)) - roty = str(round(ogre.Radian(rot.getYaw()).valueDegrees(),2)) - rotz = str(round(ogre.Radian(rot.getRoll()).valueDegrees(),2)) - truckstring = k.split(".")[-1] + " " + k - ar = [str(pos.x), str(pos.y), str(pos.z), rotx, roty, rotz, truckstring] - line = ", ".join(ar)+"\n" - lines.append(line) + truck.setScale(scale) + + rotx = ogre.Radian(rot.getPitch(False)).valueDegrees() + roty = ogre.Radian(rot.getRoll(False)).valueDegrees() + rotz = - ogre.Radian(rot.getYaw(False)).valueDegrees() + truckstring = k.split(".")[-1] + "\t " + k + ar = [self.formatFloat(pos.x), + self.formatFloat(pos.y), + self.formatFloat(pos.z), + self.formatFloat(rotx), + self.formatFloat(roty), + self.formatFloat(rotz), + truckstring] + line = ", ".join(ar) + lines.append(line.strip()+"\n") - for k in self.meshes.keys(): + # save meshs + for k in self.meshesorder: + + if k in self.comments.keys(): + for c in self.comments[k]: + lines.append(c) + + meshe = self.meshes[k] + scale = meshe.getScale() + meshe.setScale(1, 1, 1) + meshe.rotate(ogre.Vector3.UNIT_X, ogre.Degree(90),relativeTo=ogre.Node.TransformSpace.TS_WORLD) pos = meshe.getPosition() rot = meshe.getOrientation() - rotx = str(round(ogre.Radian(rot.getYaw()).valueDegrees(),2)) - roty = str(round(ogre.Radian(rot.getPitch()).valueDegrees(),2)) - rotz = str(round(ogre.Radian(rot.getRoll()).valueDegrees(),2)) + rot.normalise() + meshe.rotate(ogre.Vector3.UNIT_X, ogre.Degree(-90),relativeTo=ogre.Node.TransformSpace.TS_WORLD) + meshe.setScale(scale) + + rotx = ogre.Radian(rot.getPitch(False)).valueDegrees() + roty = ogre.Radian(rot.getRoll(False)).valueDegrees() + rotz = - ogre.Radian(rot.getYaw(False)).valueDegrees() meshstring = k.split("_")[-1] - ar = [str(pos.x), str(pos.y), str(pos.z), rotx, roty, rotz, meshstring] - line = ", ".join(ar)+"\n" - lines.append(line) + ar = [self.formatFloat(pos.x), + self.formatFloat(pos.y), + self.formatFloat(pos.z), + self.formatFloat(rotx), + self.formatFloat(roty), + self.formatFloat(rotz), + meshstring] + line = ", ".join(ar) + + if k in self.additionaloptions.keys(): + for ao in self.additionaloptions[k]: + line += " " + ao.strip() + lines.append(line.strip()+"\n") + lines.append("end\n") - f=open(self.terrnfile, 'w') + f=open(fn, 'w') f.writelines(lines) f.close() return True @@ -734,11 +795,12 @@ continue cab = cabobj['data'] #print "########face" - try: - myManualObject.triangle(int(cab[0]),int(cab[1]),int(cab[2])) - except: - print "error with cab: " + str(cab) - pass + if cab != []: + try: + myManualObject.triangle(int(cab[0]),int(cab[1]),int(cab[2])) + except: + print "error with cab: " + str(cab) + pass myManualObject.end() mesh = myManualObject.convertToMesh("manual"+fn+str(self.randomcounter)) entity = self.sceneManager.createEntity("manualtruckent"+fn+str(self.randomcounter), @@ -750,8 +812,9 @@ myManualObjectNode.attachObject(myManualObject) truckname = os.path.basename(fn) + self.trucksorder.append(truckname) self.trucks[truckname] = myManualObjectNode - return myManualObjectNode + return myManualObjectNode, truckname #except: # print "error creating truck: " + truckname # return None This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-06-25 01:15:45
|
Revision: 23 http://roreditor.svn.sourceforge.net/roreditor/?rev=23&view=rev Author: rorthomas Date: 2007-06-24 18:15:41 -0700 (Sun, 24 Jun 2007) Log Message: ----------- * removed psyco because of socket problems * bug submitting is now working Modified Paths: -------------- trunk/lib/ror/bugreport.py trunk/rortoolkit.py Modified: trunk/lib/ror/bugreport.py =================================================================== --- trunk/lib/ror/bugreport.py 2007-06-24 14:21:24 UTC (rev 22) +++ trunk/lib/ror/bugreport.py 2007-06-25 01:15:41 UTC (rev 23) @@ -54,7 +54,7 @@ outfile.close() def readFile(self, filename): - outfile = open(filename, 'r', encoding = 'utf-8') + outfile = open(filename, 'r') t = outfile.read() outfile.close() return t @@ -220,8 +220,62 @@ self.TextCtrl.LoadFile(BUGREPORT_FILENAME) def onSubmit(self, event=None): + import base64 + import socket + + #combine files + self.TextCtrl.SaveFile(BUGREPORT_FILENAME) + hwinfos = self.readFile(BUGREPORT_FILENAME) + + self.TextCtrlOwn.SaveFile(BUGREPORT_FILENAME) + owninfos = self.readFile(BUGREPORT_FILENAME) + + txt = owninfos + "\r\n" + hwinfos + + bugreport = base64.b64encode(txt) + txt = "action=bugreport&bugreport=%s" % bugreport + msg = """POST /index.php HTTP/1.0\r +Host: repository.rigsofrods.com\r +Content-Type: application/x-www-form-urlencoded\r +Content-Length: %d\r + +%s""" % (len(txt), txt) + + + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + s.connect(('repository.rigsofrods.com', 80)) + #print "sending: %s" % msg + s.send(msg) + data = s.recv(9046) + s.close() + if data.find("successfully submitted") >= 0: + dlg = wx.MessageDialog(self, "Bugreport successfully submitted! Thanks for reporting!", "successfull", wx.OK | wx.ICON_INFORMATION) + dlg.ShowModal() + dlg.Destroy() + else: + dlg = wx.MessageDialog(self, "Erro while submitting Bugreport! Please use the Forums to report the bug!", "error", wx.OK | wx.ICON_INFORMATION) + dlg.ShowModal() + dlg.Destroy() + #print 'Received', repr(data) self.Close() + return + #s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + #s.connect(('repository.rigsofrods.com', 443)) + #ssl_sock = socket.ssl(s) + #print repr(ssl_sock.server()) + #print repr(ssl_sock.issuer()) + # Set a simple HTTP request -- use httplib in actual code. + #ssl_sock.write(msg) + + # Read a chunk of data. Will not necessarily + # read all the data returned by the server. + #print ssl_sock.read() + + # Note that you need to close the underlying socket, not the SSL object. + #del ssl_sock + #s.close() + def onExit(self, event=None): self.Close() Modified: trunk/rortoolkit.py =================================================================== --- trunk/rortoolkit.py 2007-06-24 14:21:24 UTC (rev 22) +++ trunk/rortoolkit.py 2007-06-25 01:15:41 UTC (rev 23) @@ -12,7 +12,7 @@ # Import Psyco if available try: import psyco - psyco.full() + #psyco.full() #psyco.log() #psyco.profile() except ImportError: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-06-24 14:21:25
|
Revision: 22 http://roreditor.svn.sourceforge.net/roreditor/?rev=22&view=rev Author: rorthomas Date: 2007-06-24 07:21:24 -0700 (Sun, 24 Jun 2007) Log Message: ----------- * corrected typos in bugreport.py Modified Paths: -------------- trunk/lib/ror/bugreport.py Modified: trunk/lib/ror/bugreport.py =================================================================== --- trunk/lib/ror/bugreport.py 2007-06-24 10:34:52 UTC (rev 21) +++ trunk/lib/ror/bugreport.py 2007-06-24 14:21:24 UTC (rev 22) @@ -177,39 +177,39 @@ except: pass try: - txt += "Motherboard Vendor: %s\n" % hw.motherboard.vendor + txt += "Motherboard Vendor: %s\n" % hw.motherboard.vendor except: pass try: - txt += "CPU: %s\n" % hw.cpu.product + txt += "CPU: %s\n" % hw.cpu.product except: pass try: - txt += "Motherboard Vendor: %s\n" % hw.cpu.vendor + txt += "CPU Vendor: %s\n" % hw.cpu.vendor except: pass try: - txt += "CPU Speed: %s\n" % hw.cpu.frequency + txt += "CPU Speed: %s\n" % hw.cpu.frequency except: pass try: - txt += "Video memory: %.2f MB\n" % (float(hw.video_board.memory) / 1024 / 1024) + txt += "Video memory: %.2f MB\n" % (float(hw.video_board.memory) / 1024 / 1024) except: pass try: - txt += "HW Memory: %.2f MB\n" % (float(hw.memory.size) / 1024) + txt += "HW Memory: %.2f MB\n" % (float(hw.memory.size) / 1024) except: pass try: - txt += "GFX card: %s\n" % hw.video_board.product + txt += "GFX card: %s\n" % hw.video_board.product except: pass try: - txt += "Resolution: %s@%d\n" % (hw.video_board.resolution, int(hw.video_board.width)) + txt += "Resolution: %s@%d\n" % (hw.video_board.resolution, int(hw.video_board.width)) except: pass try: - txt += "Sound card: %s\n" % hw.sound_board.product + txt += "Sound card: %s\n" % hw.sound_board.product except: pass This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-06-24 10:34:54
|
Revision: 21 http://roreditor.svn.sourceforge.net/roreditor/?rev=21&view=rev Author: rorthomas Date: 2007-06-24 03:34:52 -0700 (Sun, 24 Jun 2007) Log Message: ----------- unicode fix Modified Paths: -------------- trunk/lib/ror/bugreport.py Modified: trunk/lib/ror/bugreport.py =================================================================== --- trunk/lib/ror/bugreport.py 2007-06-24 10:17:29 UTC (rev 20) +++ trunk/lib/ror/bugreport.py 2007-06-24 10:34:52 UTC (rev 21) @@ -54,10 +54,11 @@ outfile.close() def readFile(self, filename): - outfile = open(filename, 'r') + outfile = open(filename, 'r', encoding = 'utf-8') t = outfile.read() outfile.close() return t + # not working # def installPyWin(self): # dlg = wx.MessageDialog(self, "Python Windows extensions are required for this to work. I will try install them now in the Registry.\n", "Error", wx.OK | wx.ICON_INFORMATION) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-06-24 10:17:31
|
Revision: 20 http://roreditor.svn.sourceforge.net/roreditor/?rev=20&view=rev Author: rorthomas Date: 2007-06-24 03:17:29 -0700 (Sun, 24 Jun 2007) Log Message: ----------- removed unused file updated bugreport Modified Paths: -------------- trunk/lib/ror/bugreport.py Removed Paths: ------------- trunk/editor.cfg Deleted: trunk/editor.cfg =================================================================== --- trunk/editor.cfg 2007-06-24 10:03:23 UTC (rev 19) +++ trunk/editor.cfg 2007-06-24 10:17:29 UTC (rev 20) @@ -1 +0,0 @@ -C:\games\RoR-0.31a_\RoR.exe \ No newline at end of file Modified: trunk/lib/ror/bugreport.py =================================================================== --- trunk/lib/ror/bugreport.py 2007-06-24 10:03:23 UTC (rev 19) +++ trunk/lib/ror/bugreport.py 2007-06-24 10:17:29 UTC (rev 20) @@ -5,7 +5,7 @@ class BugReportFrame(wx.Frame): def __init__(self, *args, **kwds): - kwds["style"] = wx.CLOSE_BOX | wx.MINIMIZE_BOX | wx.SYSTEM_MENU | wx.CAPTION | wx.CLIP_CHILDREN + kwds["style"] = wx.CLOSE_BOX | wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX | wx.RESIZE_BORDER | wx.SYSTEM_MENU | wx.CAPTION | wx.CLIP_CHILDREN wx.Frame.__init__(self, *args, **kwds) self.panel = wx.Panel(self, wx.ID_ANY) @@ -30,7 +30,9 @@ def generateSysinfo(self): import platform - txt = "" + txt = "==========================\n" + txt += "Platform/Software Information:\n" + txt += "==========================\n" txt += "Platform: %s, %s\n" % (platform.platform(), platform.version()) txt += "Architecture: " + ", ".join(platform.architecture()) + "\n" txt += "Python version:" + "".join(platform.python_version()) + "\n" @@ -39,6 +41,11 @@ if hwinfo == "": return txt += hwinfo + txt += self.getLogs() + + txt += "\n==========================\n" + txt += "==========================\n" + self.writeFile(BUGREPORT_FILENAME, txt) def writeFile(self, filename, content): @@ -59,6 +66,87 @@ # import pywin32_postinstall # pywin32_postinstall.install() + def getLogs(self): + txt = "" + try: + txt += "==========================\n" + txt += "RoR Ogre.log following\n" + txt += "==========================\n" + ogrelogfn = rorsettings.getSettings().getRoRDir() + txt += self.readFile(os.path.join(ogrelogfn,"Ogre.log")) + except: + txt += "RoR Ogre.log ERROR\n" + pass + try: + txt += "==========================\n" + txt += "RoR ogre.cfg following\n" + txt += "==========================\n" + ogrelogfn = rorsettings.getSettings().getRoRDir() + txt += self.readFile(os.path.join(ogrelogfn,"ogre.cfg")) + except: + txt += "RoR ogre.cfg ERROR\n" + pass + + try: + txt += "==========================\n" + txt += "RoR plugins.cfg following\n" + txt += "==========================\n" + ogrelogfn = rorsettings.getSettings().getRoRDir() + txt += self.readFile(os.path.join(ogrelogfn,"plugins.cfg")) + except: + txt += "RoR plugins.cfg ERROR\n" + pass + + try: + txt += "==========================\n" + txt += "RoR.cfg following\n" + txt += "==========================\n" + ogrelogfn = rorsettings.getSettings().getRoRDir() + txt += self.readFile(os.path.join(ogrelogfn,"RoR.cfg")) + except: + txt += "RoR.cfg ERROR\n" + pass + + try: + txt += "==========================\n" + txt += "RoR resources.cfg following\n" + txt += "==========================\n" + ogrelogfn = rorsettings.getSettings().getRoRDir() + txt += self.readFile(os.path.join(ogrelogfn,"resources.cfg")) + except: + txt += "RoR resources.cfg ERROR\n" + pass + + try: + txt += "==========================\n" + txt += "RoRToolkit Ogre.log following\n" + txt += "==========================\n" + ogrelogfn = rorsettings.getSettings().getRoRDir() + txt += self.readFile("Ogre.log") + except: + txt += "RoRToolkit Ogre.log ERROR\n" + pass + + try: + txt += "==========================\n" + txt += "RoRToolkit ogre.cfg following\n" + txt += "==========================\n" + ogrelogfn = rorsettings.getSettings().getRoRDir() + txt += self.readFile("ogre.cfg") + except: + txt += "RoRToolkit ogre.cfg ERROR\n" + pass + + try: + txt += "==========================\n" + txt += "RoRToolkit plugins.cfg following\n" + txt += "==========================\n" + ogrelogfn = rorsettings.getSettings().getRoRDir() + txt += self.readFile("plugins.cfg") + except: + txt += "RoRToolkit plugins.cfg ERROR\n" + pass + return txt def getHWInfos(self): @@ -71,7 +159,8 @@ self.Close() return "" - txt = "Hardware Information:\n" + txt = "==========================\n" + txt += "Hardware Information:\n" txt += "==========================\n" try: dlg = wx.MessageDialog(self, "This program will now try to figure out some Hardware Information. That can take a minute or so.", "Notice", wx.OK | wx.ICON_INFORMATION) @@ -122,57 +211,7 @@ txt += "Sound card: %s\n" % hw.sound_board.product except: pass - - try: - txt += "==========================\n" - txt += "Ogre.log following\n" - txt += "==========================\n" - ogrelogfn = rorsettings.getSettings().getRoRDir() - txt += self.readFile(os.path.join(ogrelogfn,"Ogre.log")) - except: - txt += "Ogre.log ERROR\n" - pass - - try: - txt += "==========================\n" - txt += "ogre.cfg following\n" - txt += "==========================\n" - ogrelogfn = rorsettings.getSettings().getRoRDir() - txt += self.readFile(os.path.join(ogrelogfn,"ogre.cfg")) - except: - txt += "ogre.cfg ERROR\n" - pass - - try: - txt += "==========================\n" - txt += "plugins.cfg following\n" - txt += "==========================\n" - ogrelogfn = rorsettings.getSettings().getRoRDir() - txt += self.readFile(os.path.join(ogrelogfn,"plugins.cfg")) - except: - txt += "plugins.cfg ERROR\n" - pass - - try: - txt += "==========================\n" - txt += "RoR.cfg following\n" - txt += "==========================\n" - ogrelogfn = rorsettings.getSettings().getRoRDir() - txt += self.readFile(os.path.join(ogrelogfn,"RoR.cfg")) - except: - txt += "RoR.cfg ERROR\n" - pass - - try: - txt += "==========================\n" - txt += "resources.cfg following\n" - txt += "==========================\n" - ogrelogfn = rorsettings.getSettings().getRoRDir() - txt += self.readFile(os.path.join(ogrelogfn,"resources.cfg")) - except: - txt += "resources.cfg ERROR\n" - pass - + return txt def LoadHWFile(self): @@ -188,9 +227,9 @@ def __do_layout(self): sizer_panel = wx.BoxSizer(wx.VERTICAL) sizer_panel.Add(self.lblText1, 0, wx.EXPAND, 0) - sizer_panel.Add(self.TextCtrlOwn, 0, wx.EXPAND, 0) + sizer_panel.Add(self.TextCtrlOwn, -1, wx.EXPAND, 0) sizer_panel.Add(self.lblText2, 0, wx.EXPAND, 0) - sizer_panel.Add(self.TextCtrl, 0, wx.EXPAND, 0) + sizer_panel.Add(self.TextCtrl, -1, wx.EXPAND, 0) sizer_panel.Add(self.btnSubmit, 0, wx.EXPAND, 0) sizer_panel.Add(self.btnCancel, 0, wx.EXPAND, 0) self.panel.SetSizer(sizer_panel) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-06-24 10:03:25
|
Revision: 19 http://roreditor.svn.sourceforge.net/roreditor/?rev=19&view=rev Author: rorthomas Date: 2007-06-24 03:03:23 -0700 (Sun, 24 Jun 2007) Log Message: ----------- * removed old gui stuff * improved bugreport to include the ror logs Modified Paths: -------------- trunk/lib/ror/bugreport.py Removed Paths: ------------- trunk/lib/ror/SettingsFrame.py Deleted: trunk/lib/ror/SettingsFrame.py =================================================================== --- trunk/lib/ror/SettingsFrame.py 2007-06-24 09:43:41 UTC (rev 18) +++ trunk/lib/ror/SettingsFrame.py 2007-06-24 10:03:23 UTC (rev 19) @@ -1,232 +0,0 @@ -#Thomas Fischer 31/05/2007, th...@th... -from wxogre.OgreManager import * -from ror.RoROgreWindow import * -from ror.rorsettings import * -from ror.rorcommon import * -from RoRTerrainOgreWindow import * -from RoRTerrainSelectedObjectOgreWindow import * -from RoRTerrainSelectedObjectTopOgreWindow import * - -# -*- coding: iso-8859-1 -*- -# Don't modify comment - -import wx -#[inc]add your include files here - -#[inc]end your include - -class MyDlg(wx.Dialog): - def __init__(self,parent,id = -1,title = '',pos = wx.Point(0,0),size = wx.Size(440,375),style = wx.DEFAULT_DIALOG_STYLE,name = 'dialogBox'): - pre=wx.PreDialog() - self.OnPreCreate() - pre.Create(parent,id,title,pos,size,wx.CAPTION|wx.RESIZE_BORDER|wx.SYSTEM_MENU|wx.CLOSE_BOX|wx.DIALOG_NO_PARENT|wx.MINIMIZE_BOX|wx.MAXIMIZE_BOX,name) - self.PostCreate(pre) - self.initBefore() - self.VwXinit() - self.initAfter() - - def __del__(self): - self.Ddel() - return - - - def VwXinit(self): - self.fileImgBuf=[None] * 1 - self.fileImgBuf[0] = wx.Bitmap("D:/projects/old/rorterraineditor_0_0_3/splash.bmp",wx.BITMAP_TYPE_BMP) - self.panelBitmapImg0=self.fileImgBuf[0]; - self.panelBitmap = wx.Panel(self,-1,wx.Point(3,3),wx.Size(428,125)) - self.panelBitmap.Bind(wx.EVT_ERASE_BACKGROUND,self.VwXpanelBitmap_VwXEvOnEraseBackground) - self.txtRoRDir = wx.TextCtrl(self,-1,"",wx.Point(6,137),wx.Size(100,21)) - self.btnSelectRoRDir = wx.Button(self,-1,"",wx.Point(353,137),wx.Size(75,21)) - self.btnSelectRoRDir.SetLabel("SelectRoR") - self.wxnb11c = wx.Notebook(self,-1,wx.Point(3,167),wx.Size(20,20)) - self.pn12c = wx.Panel(self.wxnb11c,-1,wx.Point(4,22),wx.Size(420,103)) - self.wxnb11c.AddPage(self.pn12c,'General Settings',0) - self.lblFPS = wx.StaticText(self.pn12c,-1,"",wx.Point(6,6),wx.Size(50,13),wx.ST_NO_AUTORESIZE) - self.lblFPS.SetLabel("FPS: 30") - self.sbFPS = wx.ScrollBar(self.pn12c,-1,wx.Point(62,6),wx.Size(20,20),wx.SB_HORIZONTAL) - self.Bind(wx.EVT_SCROLL,self.sbFPS_VwXEvOnScrollValue,self.sbFPS) - self.lblWaterTrans = wx.StaticText(self.pn12c,-1,"",wx.Point(6,38),wx.Size(145,20),wx.ST_NO_AUTORESIZE) - self.lblWaterTrans.SetLabel("Water Transparency: 10%") - self.sbWaterTrans = wx.ScrollBar(self.pn12c,-1,wx.Point(157,38),wx.Size(20,20),wx.SB_HORIZONTAL) - self.Bind(wx.EVT_SCROLL,self.sbWaterTrans_VwXEvOnScrollValue,self.sbWaterTrans) - self.pn21c = wx.Panel(self.wxnb11c,-1,wx.Point(0,0),wx.Size(20,20)) - self.wxnb11c.AddPage(self.pn21c,'Updates: 1',0) - self.btnCheckUpdates = wx.Button(self.pn21c,-1,"",wx.Point(3,3),wx.Size(412,25)) - self.btnCheckUpdates.SetLabel("Check for Updates!") - self.Bind(wx.EVT_BUTTON,self.btnCheckUpdates_VwXEvOnButtonClick,self.btnCheckUpdates) - self.lblUpdates = wx.StaticText(self.pn21c,-1,"",wx.Point(3,34),wx.Size(412,18),wx.ST_NO_AUTORESIZE) - self.btnStartTerrain = wx.Panel(self,-1,wx.Point(3,302),wx.Size(428,45)) - self.btnStartRoR = wx.Button(self.btnStartTerrain,-1,"",wx.Point(3,3),wx.Size(20,20)) - self.btnStartRoR.SetLabel("Start RoR") - self.Bind(wx.EVT_BUTTON,self.btnStartRoR_VwXEvOnButtonClick,self.btnStartRoR) - self.btnTerrainEditor = wx.Button(self.btnStartTerrain,-1,"",wx.Point(88,3),wx.Size(20,20)) - self.btnTerrainEditor.SetLabel("Terrain Editor") - self.Bind(wx.EVT_BUTTON,self.btnTerrainEditor_VwXEvOnButtonClick,self.btnTerrainEditor) - self.btnTruckEditor = wx.Button(self.btnStartTerrain,-1,"",wx.Point(173,3),wx.Size(20,20)) - self.btnTruckEditor.Enable(False) - self.btnTruckEditor.SetLabel("Truck Editor") - self.Bind(wx.EVT_BUTTON,self.btnTruckEditor_VwXEvOnButtonClick,self.btnTruckEditor) - self.btnExit = wx.Button(self.btnStartTerrain,-1,"",wx.Point(343,3),wx.Size(20,20)) - self.btnExit.SetLabel("Exit") - self.Bind(wx.EVT_BUTTON,self.btnExit_VwXEvOnButtonClick,self.btnExit) - self.btnTruckChecker = wx.Button(self.btnStartTerrain,-1,"",wx.Point(258,3),wx.Size(20,20)) - self.btnTruckChecker.SetLabel("Truck Checker") - self.Bind(wx.EVT_BUTTON,self.btnTruckChecker_VwXEvOnButtonClick,self.btnTruckChecker) - self.sz4s = wx.BoxSizer(wx.VERTICAL) - self.sz6s = wx.BoxSizer(wx.HORIZONTAL) - self.sz13s = wx.BoxSizer(wx.VERTICAL) - self.sz15s = wx.BoxSizer(wx.HORIZONTAL) - self.sz18s = wx.BoxSizer(wx.HORIZONTAL) - self.sz22s = wx.BoxSizer(wx.VERTICAL) - self.sz26s = wx.BoxSizer(wx.HORIZONTAL) - self.sz4s.Add(self.panelBitmap,0,wx.TOP|wx.LEFT|wx.BOTTOM|wx.RIGHT|wx.EXPAND|wx.FIXED_MINSIZE,3) - self.sz4s.Add(self.sz6s,0,wx.TOP|wx.LEFT|wx.BOTTOM|wx.RIGHT|wx.EXPAND|wx.FIXED_MINSIZE,3) - self.sz4s.Add(self.wxnb11c,1,wx.TOP|wx.LEFT|wx.BOTTOM|wx.RIGHT|wx.EXPAND|wx.FIXED_MINSIZE,3) - self.sz4s.Add(self.btnStartTerrain,0,wx.TOP|wx.LEFT|wx.BOTTOM|wx.RIGHT|wx.EXPAND|wx.FIXED_MINSIZE,3) - self.sz6s.Add(self.txtRoRDir,1,wx.TOP|wx.LEFT|wx.BOTTOM|wx.RIGHT|wx.EXPAND|wx.FIXED_MINSIZE,3) - self.sz6s.Add(self.btnSelectRoRDir,0,wx.TOP|wx.LEFT|wx.BOTTOM|wx.RIGHT|wx.EXPAND|wx.FIXED_MINSIZE,3) - self.sz13s.Add(self.sz15s,0,wx.TOP|wx.LEFT|wx.BOTTOM|wx.RIGHT|wx.EXPAND|wx.FIXED_MINSIZE,3) - self.sz13s.Add(self.sz18s,0,wx.TOP|wx.LEFT|wx.BOTTOM|wx.RIGHT|wx.EXPAND|wx.FIXED_MINSIZE,3) - self.sz15s.Add(self.lblFPS,0,wx.TOP|wx.LEFT|wx.BOTTOM|wx.RIGHT|wx.EXPAND|wx.FIXED_MINSIZE,3) - self.sz15s.Add(self.sbFPS,1,wx.TOP|wx.LEFT|wx.BOTTOM|wx.RIGHT|wx.EXPAND|wx.FIXED_MINSIZE,3) - self.sz18s.Add(self.lblWaterTrans,0,wx.TOP|wx.LEFT|wx.BOTTOM|wx.RIGHT|wx.EXPAND|wx.FIXED_MINSIZE,3) - self.sz18s.Add(self.sbWaterTrans,1,wx.TOP|wx.LEFT|wx.BOTTOM|wx.RIGHT|wx.EXPAND|wx.FIXED_MINSIZE,3) - self.sz22s.Add(self.btnCheckUpdates,0,wx.TOP|wx.LEFT|wx.BOTTOM|wx.RIGHT|wx.EXPAND|wx.FIXED_MINSIZE,3) - self.sz22s.Add(self.lblUpdates,1,wx.TOP|wx.LEFT|wx.BOTTOM|wx.RIGHT|wx.EXPAND|wx.FIXED_MINSIZE,3) - self.sz26s.Add(self.btnStartRoR,1,wx.TOP|wx.LEFT|wx.BOTTOM|wx.RIGHT|wx.EXPAND|wx.FIXED_MINSIZE,3) - self.sz26s.Add(self.btnTerrainEditor,1,wx.TOP|wx.LEFT|wx.BOTTOM|wx.RIGHT|wx.EXPAND|wx.FIXED_MINSIZE,3) - self.sz26s.Add(self.btnTruckEditor,1,wx.TOP|wx.LEFT|wx.BOTTOM|wx.RIGHT|wx.EXPAND|wx.FIXED_MINSIZE,3) - self.sz26s.Add(self.btnTruckChecker,1,wx.TOP|wx.LEFT|wx.BOTTOM|wx.RIGHT|wx.EXPAND|wx.FIXED_MINSIZE,3) - self.sz26s.Add(self.btnExit,1,wx.TOP|wx.LEFT|wx.BOTTOM|wx.RIGHT|wx.EXPAND|wx.FIXED_MINSIZE,3) - self.SetSizer(self.sz4s);self.SetAutoLayout(1);self.Layout(); - self.pn12c.SetSizer(self.sz13s);self.pn12c.SetAutoLayout(1);self.pn12c.Layout(); - self.pn21c.SetSizer(self.sz22s);self.pn21c.SetAutoLayout(1);self.pn21c.Layout(); - self.btnStartTerrain.SetSizer(self.sz26s);self.btnStartTerrain.SetAutoLayout(1);self.btnStartTerrain.Layout(); - self.Refresh() - return - def VwXDrawBackImg(self,event,win,bitMap,opz): - if (event.GetDC()): - dc=event.GetDC() - else: dc = wx.ClientDC(win) - dc.SetBackground(wx.Brush(win.GetBackgroundColour(),wx.SOLID)) - dc.Clear() - if (opz==0): - dc.DrawBitmap(bitMap,0, 0, 0) - if (opz==1): - rec=wx.Rect() - rec=win.GetClientRect() - rec.SetLeft((rec.GetWidth()-bitMap.GetWidth()) / 2) - rec.SetTop ((rec.GetHeight()-bitMap.GetHeight()) / 2) - dc.DrawBitmap(bitMap,rec.GetLeft(),rec.GetTop(),0) - if (opz==2): - rec=wx.Rect() - rec=win.GetClientRect() - for y in range(0,rec.GetHeight(),bitMap.GetHeight()): - for x in range(0,rec.GetWidth(),bitMap.GetWidth()): - dc.DrawBitmap(bitMap,x,y,0) - - def VwXDelComp(self): - return - def VwXpanelBitmap_VwXEvOnEraseBackground(self,event): - self.VwXDrawBackImg(event,self.panelBitmap,self.panelBitmapImg0,0) - self.panelBitmap_VwXEvOnEraseBackground(event) - event.Skip(False) - - return - -#[win]add your code here - def sbWaterTrans_VwXEvOnScrollValue(self,event): #init function - #[190]Code event VwX...Don't modify[190]# - #add your code here - - return #end function - - def sbFPS_VwXEvOnScrollValue(self,event): #init function - #[18f]Code event VwX...Don't modify[18f]# - #add your code here - - return #end function - - def btnTruckEditor_VwXEvOnButtonClick(self,event): #init function - #[194]Code event VwX...Don't modify[194]# - #add your code here - - return #end function - - def btnTruckChecker_VwXEvOnButtonClick(self,event): #init function - #[196]Code event VwX...Don't modify[196]# - #add your code here - - return #end function - - def btnTerrainEditor_VwXEvOnButtonClick(self,event): #init function - #[193]Code event VwX...Don't modify[193]# - #add your code here - - return #end function - - def btnStartRoR_VwXEvOnButtonClick(self,event): #init function - #[192]Code event VwX...Don't modify[192]# - #add your code here - - return #end function - - def btnExit_VwXEvOnButtonClick(self,event): #init function - #[195]Code event VwX...Don't modify[195]# - #add your code here - - return #end function - - def btnCheckUpdates_VwXEvOnButtonClick(self,event): #init function - #[191]Code event VwX...Don't modify[191]# - #add your code here - - return #end function - - - def panelBitmap_VwXEvOnEraseBackground(self,event): #init function - #[504]Code event VwX...Don't modify[504]# - #add your code here - event.Skip() - - return #end function - - - def initBefore(self): - #add your code here - - return - - def initAfter(self): - #add your code here - self.Centre() - return - - def OnPreCreate(self): - #add your code here - - return - - def Ddel(self): #init function - #[158]Code VwX...Don't modify[157]# - #add your code here - - return #end function - -#[win]end your code - - -class App(wx.App): - def OnInit(self): - wx.InitAllImageHandlers() - self.main = MyDlg.MyDlg(None,-1,'') - self.main.ShowModal() - return 0 - -def main(): - application = App(0) - application.MainLoop() - -if __name__ == '__main__': - main() Modified: trunk/lib/ror/bugreport.py =================================================================== --- trunk/lib/ror/bugreport.py 2007-06-24 09:43:41 UTC (rev 18) +++ trunk/lib/ror/bugreport.py 2007-06-24 10:03:23 UTC (rev 19) @@ -1,10 +1,11 @@ import wx, os, os.path +import rorsettings BUGREPORT_FILENAME = "hwinfo.txt" class BugReportFrame(wx.Frame): def __init__(self, *args, **kwds): - kwds["style"] = wx.CLOSE_BOX | wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX | wx.RESIZE_BORDER | wx.SYSTEM_MENU | wx.CAPTION | wx.CLIP_CHILDREN + kwds["style"] = wx.CLOSE_BOX | wx.MINIMIZE_BOX | wx.SYSTEM_MENU | wx.CAPTION | wx.CLIP_CHILDREN wx.Frame.__init__(self, *args, **kwds) self.panel = wx.Panel(self, wx.ID_ANY) @@ -14,9 +15,11 @@ * it is good to take screenshots of errors, glitches and so on. you can insert imageshack.us or equivalent URLs below.""" self.lblText1 = wx.StaticText(self.panel, wx.ID_ANY, desc) - self.TextCtrlOwn = wx.TextCtrl(self.panel, wx.ID_ANY, style=wx.TE_RICH2|wx.TE_AUTO_URL|wx.TE_MULTILINE|wx.TE_READONLY,size=wx.Size(400,200)) - self.lblText2 = wx.StaticText(self.panel, wx.ID_ANY, "The gathered system information, that will be send along the description:") - self.TextCtrl = wx.TextCtrl(self.panel, wx.ID_ANY, style=wx.TE_RICH2|wx.TE_AUTO_URL|wx.TE_MULTILINE|wx.TE_READONLY,size=wx.Size(400,200)) + self.TextCtrlOwn = wx.TextCtrl(self.panel, wx.ID_ANY, style=wx.TE_RICH2|wx.TE_AUTO_URL|wx.TE_MULTILINE,size=wx.Size(400,200)) + desc2 = """The gathered system information, that will be send along the description: +* you may want to correct it and/or remove details you dont want to share with us.""" + self.lblText2 = wx.StaticText(self.panel, wx.ID_ANY, desc2) + self.TextCtrl = wx.TextCtrl(self.panel, wx.ID_ANY, style=wx.TE_RICH2|wx.TE_AUTO_URL|wx.TE_MULTILINE,size=wx.Size(400,200)) self.btnSubmit = wx.Button(self.panel, wx.ID_ANY, "Submit") self.btnCancel = wx.Button(self.panel, wx.ID_ANY, "Cancel") self.Bind(wx.EVT_BUTTON, self.onSubmit, self.btnSubmit) @@ -43,6 +46,11 @@ outfile.write(content) outfile.close() + def readFile(self, filename): + outfile = open(filename, 'r') + t = outfile.read() + outfile.close() + return t # not working # def installPyWin(self): # dlg = wx.MessageDialog(self, "Python Windows extensions are required for this to work. I will try install them now in the Registry.\n", "Error", wx.OK | wx.ICON_INFORMATION) @@ -63,7 +71,8 @@ self.Close() return "" - txt = "" + txt = "Hardware Information:\n" + txt += "==========================\n" try: dlg = wx.MessageDialog(self, "This program will now try to figure out some Hardware Information. That can take a minute or so.", "Notice", wx.OK | wx.ICON_INFORMATION) dlg.ShowModal() @@ -113,6 +122,57 @@ txt += "Sound card: %s\n" % hw.sound_board.product except: pass + + try: + txt += "==========================\n" + txt += "Ogre.log following\n" + txt += "==========================\n" + ogrelogfn = rorsettings.getSettings().getRoRDir() + txt += self.readFile(os.path.join(ogrelogfn,"Ogre.log")) + except: + txt += "Ogre.log ERROR\n" + pass + + try: + txt += "==========================\n" + txt += "ogre.cfg following\n" + txt += "==========================\n" + ogrelogfn = rorsettings.getSettings().getRoRDir() + txt += self.readFile(os.path.join(ogrelogfn,"ogre.cfg")) + except: + txt += "ogre.cfg ERROR\n" + pass + + try: + txt += "==========================\n" + txt += "plugins.cfg following\n" + txt += "==========================\n" + ogrelogfn = rorsettings.getSettings().getRoRDir() + txt += self.readFile(os.path.join(ogrelogfn,"plugins.cfg")) + except: + txt += "plugins.cfg ERROR\n" + pass + + try: + txt += "==========================\n" + txt += "RoR.cfg following\n" + txt += "==========================\n" + ogrelogfn = rorsettings.getSettings().getRoRDir() + txt += self.readFile(os.path.join(ogrelogfn,"RoR.cfg")) + except: + txt += "RoR.cfg ERROR\n" + pass + + try: + txt += "==========================\n" + txt += "resources.cfg following\n" + txt += "==========================\n" + ogrelogfn = rorsettings.getSettings().getRoRDir() + txt += self.readFile(os.path.join(ogrelogfn,"resources.cfg")) + except: + txt += "resources.cfg ERROR\n" + pass + return txt def LoadHWFile(self): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-06-24 09:43:55
|
Revision: 18 http://roreditor.svn.sourceforge.net/roreditor/?rev=18&view=rev Author: rorthomas Date: 2007-06-24 02:43:41 -0700 (Sun, 24 Jun 2007) Log Message: ----------- improved bugreport Modified Paths: -------------- trunk/lib/ror/bugreport.py trunk/rortoolkit.py Added Paths: ----------- trunk/tools/pywin32-setup.exe Removed Paths: ------------- trunk/tools/pywin32-210.win32-py2.5.exe Modified: trunk/lib/ror/bugreport.py =================================================================== --- trunk/lib/ror/bugreport.py 2007-06-24 01:14:22 UTC (rev 17) +++ trunk/lib/ror/bugreport.py 2007-06-24 09:43:41 UTC (rev 18) @@ -5,10 +5,20 @@ class BugReportFrame(wx.Frame): def __init__(self, *args, **kwds): kwds["style"] = wx.CLOSE_BOX | wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX | wx.RESIZE_BORDER | wx.SYSTEM_MENU | wx.CAPTION | wx.CLIP_CHILDREN - wx.Frame.__init__(self, *args, **kwds) - self.TextCtrl = wx.TextCtrl(self, wx.ID_ANY, style=wx.TE_RICH2|wx.TE_AUTO_URL|wx.TE_MULTILINE|wx.TE_READONLY,size=wx.Size(500,400)) - self.btnSubmit = wx.Button(self, wx.ID_ANY, "Submit") - self.btnCancel = wx.Button(self, wx.ID_ANY, "Cancel") + wx.Frame.__init__(self, *args, **kwds) + + self.panel = wx.Panel(self, wx.ID_ANY) + desc = """Please describe the Bug below: +some tips: +* if you give us an email in the text, we can answer you, otherwise not. +* it is good to take screenshots of errors, glitches and so on. + you can insert imageshack.us or equivalent URLs below.""" + self.lblText1 = wx.StaticText(self.panel, wx.ID_ANY, desc) + self.TextCtrlOwn = wx.TextCtrl(self.panel, wx.ID_ANY, style=wx.TE_RICH2|wx.TE_AUTO_URL|wx.TE_MULTILINE|wx.TE_READONLY,size=wx.Size(400,200)) + self.lblText2 = wx.StaticText(self.panel, wx.ID_ANY, "The gathered system information, that will be send along the description:") + self.TextCtrl = wx.TextCtrl(self.panel, wx.ID_ANY, style=wx.TE_RICH2|wx.TE_AUTO_URL|wx.TE_MULTILINE|wx.TE_READONLY,size=wx.Size(400,200)) + self.btnSubmit = wx.Button(self.panel, wx.ID_ANY, "Submit") + self.btnCancel = wx.Button(self.panel, wx.ID_ANY, "Cancel") self.Bind(wx.EVT_BUTTON, self.onSubmit, self.btnSubmit) self.Bind(wx.EVT_BUTTON, self.onExit, self.btnCancel) self.__do_layout() @@ -18,13 +28,14 @@ def generateSysinfo(self): import platform txt = "" - txt += "Platform: " + ", ".join(platform.uname()) + "\n" + txt += "Platform: %s, %s\n" % (platform.platform(), platform.version()) txt += "Architecture: " + ", ".join(platform.architecture()) + "\n" - txt += "Platform: " + platform.platform() + "\n" - txt += "Version: " + platform.version() + "\n" + txt += "Python version:" + "".join(platform.python_version()) + "\n" txt += "Python build: " + ", ".join(platform.python_build()) + "\n" - txt += "Python version:" + ", ".join(platform.python_version()) + "\n" - txt += self.getHWInfos() + hwinfo = self.getHWInfos() + if hwinfo == "": + return + txt += hwinfo self.writeFile(BUGREPORT_FILENAME, txt) def writeFile(self, filename, content): @@ -32,10 +43,32 @@ outfile.write(content) outfile.close() + # not working + # def installPyWin(self): + # dlg = wx.MessageDialog(self, "Python Windows extensions are required for this to work. I will try install them now in the Registry.\n", "Error", wx.OK | wx.ICON_INFORMATION) + # dlg.ShowModal() + # dlg.Destroy() + # import pywin32_postinstall + # pywin32_postinstall.install() + + def getHWInfos(self): - import sysinfo + + try: + import sysinfo + except: + dlg = wx.MessageDialog(self, "You must install pywin32 first.\nYou can find the setup in INSTALLDIR/tools/pywin32-setup.exe\nPLease note that you must restart this program after the pywin installation.", "Error", wx.OK | wx.ICON_INFORMATION) + dlg.ShowModal() + dlg.Destroy() + self.Close() + return "" + txt = "" try: + dlg = wx.MessageDialog(self, "This program will now try to figure out some Hardware Information. That can take a minute or so.", "Notice", wx.OK | wx.ICON_INFORMATION) + dlg.ShowModal() + dlg.Destroy() + hw = sysinfo.hardware() except: pass @@ -61,7 +94,7 @@ except: pass try: - txt += "Video memory: %.2fMB\n" % (float(hw.video_board.memory) / 1024 / 1024) + txt += "Video memory: %.2f MB\n" % (float(hw.video_board.memory) / 1024 / 1024) except: pass try: @@ -93,12 +126,18 @@ self.Close() def __do_layout(self): - sizer_main = wx.BoxSizer(wx.VERTICAL) - sizer_2 = wx.BoxSizer(wx.HORIZONTAL) - sizer_2.Add(self.TextCtrl, -1, wx.EXPAND, 0) - sizer_main.Add(sizer_2, -1, wx.EXPAND, 0) - sizer_main.Add(self.btnSubmit, 0, wx.EXPAND, 0) + sizer_panel = wx.BoxSizer(wx.VERTICAL) + sizer_panel.Add(self.lblText1, 0, wx.EXPAND, 0) + sizer_panel.Add(self.TextCtrlOwn, 0, wx.EXPAND, 0) + sizer_panel.Add(self.lblText2, 0, wx.EXPAND, 0) + sizer_panel.Add(self.TextCtrl, 0, wx.EXPAND, 0) + sizer_panel.Add(self.btnSubmit, 0, wx.EXPAND, 0) + sizer_panel.Add(self.btnCancel, 0, wx.EXPAND, 0) + self.panel.SetSizer(sizer_panel) + sizer_main = wx.BoxSizer(wx.VERTICAL) + sizer_main.Add(self.panel, 0, wx.EXPAND, 0) + self.SetAutoLayout(True) self.SetSizer(sizer_main) sizer_main.Fit(self) Modified: trunk/rortoolkit.py =================================================================== --- trunk/rortoolkit.py 2007-06-24 01:14:22 UTC (rev 17) +++ trunk/rortoolkit.py 2007-06-24 09:43:41 UTC (rev 18) @@ -7,7 +7,7 @@ """ sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "lib")) - sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "lib_win")) + sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "lib\pywin32")) # Import Psyco if available try: Deleted: trunk/tools/pywin32-210.win32-py2.5.exe =================================================================== (Binary files differ) Copied: trunk/tools/pywin32-setup.exe (from rev 17, trunk/tools/pywin32-210.win32-py2.5.exe) =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-06-24 01:14:27
|
Revision: 17 http://roreditor.svn.sourceforge.net/roreditor/?rev=17&view=rev Author: rorthomas Date: 2007-06-23 18:14:22 -0700 (Sat, 23 Jun 2007) Log Message: ----------- * updated bugreport * added sysinfo tools * moved binaries to tools path Modified Paths: -------------- trunk/lib/ror/bugreport.py trunk/lib/ror/starter.py trunk/rortoolkit.py trunk/setup.nsi Added Paths: ----------- trunk/lib/sysinfo/ trunk/lib/sysinfo/README trunk/lib/sysinfo/__init__.py trunk/lib/sysinfo/common.py trunk/lib/sysinfo/linux/ trunk/lib/sysinfo/linux/__init__.py trunk/lib/sysinfo/linux/apt.py trunk/lib/sysinfo/linux/hardware.py trunk/lib/sysinfo/linux/misc.py trunk/lib/sysinfo/linux/my_rpm.py trunk/lib/sysinfo/linux/network.py trunk/lib/sysinfo/linux/services.py trunk/lib/sysinfo/sysinfo-example.py trunk/lib/sysinfo/win32/ trunk/lib/sysinfo/win32/__init__.py trunk/lib/sysinfo/win32/hardware.py trunk/lib/sysinfo/win32/misc.py trunk/lib/sysinfo/win32/services.py trunk/lib/sysinfo/win32/software.py trunk/tools/ trunk/tools/dxwebsetup.exe trunk/tools/pywin32-210.win32-py2.5.exe Removed Paths: ------------- trunk/dxwebsetup.exe Deleted: trunk/dxwebsetup.exe =================================================================== (Binary files differ) Modified: trunk/lib/ror/bugreport.py =================================================================== --- trunk/lib/ror/bugreport.py 2007-06-23 14:41:59 UTC (rev 16) +++ trunk/lib/ror/bugreport.py 2007-06-24 01:14:22 UTC (rev 17) @@ -1,5 +1,7 @@ import wx, os, os.path +BUGREPORT_FILENAME = "hwinfo.txt" + class BugReportFrame(wx.Frame): def __init__(self, *args, **kwds): kwds["style"] = wx.CLOSE_BOX | wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX | wx.RESIZE_BORDER | wx.SYSTEM_MENU | wx.CAPTION | wx.CLIP_CHILDREN @@ -10,23 +12,79 @@ self.Bind(wx.EVT_BUTTON, self.onSubmit, self.btnSubmit) self.Bind(wx.EVT_BUTTON, self.onExit, self.btnCancel) self.__do_layout() - self.filename = "readme.txt" - self.LoadHelp() + self.generateSysinfo() + self.LoadHWFile() - def generateSsysinfo(self): + def generateSysinfo(self): import platform txt = "" - txt += ", ".join(platform.uname()) + "\n" - txt += ", ".join(platform.architecture()) + "\n" - txt += ", ".join(platform.platform()) + "\n" - txt += ", ".join(platform.version()) + "\n" - txt += ", ".join(platform.python_build()) + "\n" - txt += ", ".join(platform.python_version()) + "\n" + txt += "Platform: " + ", ".join(platform.uname()) + "\n" + txt += "Architecture: " + ", ".join(platform.architecture()) + "\n" + txt += "Platform: " + platform.platform() + "\n" + txt += "Version: " + platform.version() + "\n" + txt += "Python build: " + ", ".join(platform.python_build()) + "\n" + txt += "Python version:" + ", ".join(platform.python_version()) + "\n" + txt += self.getHWInfos() + self.writeFile(BUGREPORT_FILENAME, txt) + + def writeFile(self, filename, content): + outfile = open(filename, 'w') + outfile.write(content) + outfile.close() + + def getHWInfos(self): + import sysinfo + txt = "" + try: + hw = sysinfo.hardware() + except: + pass + try: + txt += "Motherboard: %s\n" % hw.motherboard.product + except: + pass + try: + txt += "Motherboard Vendor: %s\n" % hw.motherboard.vendor + except: + pass + try: + txt += "CPU: %s\n" % hw.cpu.product + except: + pass + try: + txt += "Motherboard Vendor: %s\n" % hw.cpu.vendor + except: + pass + try: + txt += "CPU Speed: %s\n" % hw.cpu.frequency + except: + pass + try: + txt += "Video memory: %.2fMB\n" % (float(hw.video_board.memory) / 1024 / 1024) + except: + pass + try: + txt += "HW Memory: %.2f MB\n" % (float(hw.memory.size) / 1024) + except: + pass + try: + txt += "GFX card: %s\n" % hw.video_board.product + except: + pass + try: + txt += "Resolution: %s@%d\n" % (hw.video_board.resolution, int(hw.video_board.width)) + except: + pass + try: + txt += "Sound card: %s\n" % hw.sound_board.product + except: + pass + return txt - def LoadHelp(self): - if os.path.isfile(self.filename): - self.TextCtrl.LoadFile(self.filename) + def LoadHWFile(self): + if os.path.isfile(BUGREPORT_FILENAME): + self.TextCtrl.LoadFile(BUGREPORT_FILENAME) def onSubmit(self, event=None): self.Close() @@ -39,7 +97,7 @@ sizer_2 = wx.BoxSizer(wx.HORIZONTAL) sizer_2.Add(self.TextCtrl, -1, wx.EXPAND, 0) sizer_main.Add(sizer_2, -1, wx.EXPAND, 0) - sizer_main.Add(self.btnExit, 0, wx.EXPAND, 0) + sizer_main.Add(self.btnSubmit, 0, wx.EXPAND, 0) self.SetAutoLayout(True) self.SetSizer(sizer_main) Modified: trunk/lib/ror/starter.py =================================================================== --- trunk/lib/ror/starter.py 2007-06-23 14:41:59 UTC (rev 16) +++ trunk/lib/ror/starter.py 2007-06-24 01:14:22 UTC (rev 17) @@ -27,6 +27,9 @@ self.btnStartTruckEditor = wx.Button(self.panel, wx.ID_ANY, "Start Truck Editor") self.Bind(wx.EVT_BUTTON, self.OnTruckEditor, self.btnStartTruckEditor) + self.btnBugReport = wx.Button(self.panel, wx.ID_ANY, "Report a Bug") + self.Bind(wx.EVT_BUTTON, self.OnBugReport, self.btnBugReport) + self.btnExit = wx.Button(self.panel, wx.ID_ANY, "Exit") self.Bind(wx.EVT_BUTTON, self.OnExit, self.btnExit) @@ -66,6 +69,13 @@ except: pass + def OnBugReport(self, event=None): + import ror.bugreport + #try: + ror.bugreport.showBugReportFrame() + #except: + # pass + def OnTerrainEditor(self, event=None): import rorterraineditor.MainFrame try: @@ -109,6 +119,7 @@ sizer_panel.Add(self.btnStartRoR, 0, wx.EXPAND, 0) sizer_panel.Add(self.btnStartTerrainEditor, 0, wx.EXPAND, 0) sizer_panel.Add(self.btnStartTruckEditor, 0, wx.EXPAND, 0) + sizer_panel.Add(self.btnBugReport, 0, wx.EXPAND, 0) sizer_panel.Add(self.btnExit, 0, wx.EXPAND, 0) self.panel.SetSizer(sizer_panel) Added: trunk/lib/sysinfo/README =================================================================== --- trunk/lib/sysinfo/README (rev 0) +++ trunk/lib/sysinfo/README 2007-06-24 01:14:22 UTC (rev 17) @@ -0,0 +1,21 @@ +== Python-sysinfo == +==================== + +Python-sysinfo provides an abstraction layer to system information for +hardware, software and services in the local computer. + +The GNU/Linux version uses lshw to collect hardware info and the other +data come from config files, /proc and such. + +Python-sysinfo is a component of NWU. + +See http://cetico.org/nwu + +For sample code of python-sysinfo in action, see doc/sysinfo-sample.py + + +Authors: +Yves Junqueira (nictuku) <yv...@ce...> +José Júnior (coredump) <jos...@gm...> + + Added: trunk/lib/sysinfo/__init__.py =================================================================== --- trunk/lib/sysinfo/__init__.py (rev 0) +++ trunk/lib/sysinfo/__init__.py 2007-06-24 01:14:22 UTC (rev 17) @@ -0,0 +1,80 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (C) 2006 José de Paula Eufrásio Junior (jos...@gm...) AND +# Yves Junqueira (yve...@gm...) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""Provides methods for collecting system information in +a portable way, for both Linux and Windows. +""" + +# The current structure will be replaced by the following: +# +# sysinfo.network().dnsdomains = list +# sysinfo.network().default_gateway = str +# sysinfo.network().interfaces = list +# sysinfo.network().interface() = method +# sysinfo.network().interface('eth0').ip_addresses = list +# sysinfo.network().interface('eth0').mac_address = str +# sysinfo.network().interface('eth0').product = str +# sysinfo.network().interface('eth0').vendor = str +# sysinfo.services.smb.workgroup = str +# sysinfo.services.smb.winsservers = list +# sysinfo.hardware.motherboard.product +# sysinfo.hardware.motherboard.vendor +# sysinfo.hardware.videoboard.product +# sysinfo.hardware.videoboard.vendor +# sysinfo.software.installed = list +# +# All data must be populated, even with empty values. +# +# Planned modules strucuture: +# +# sysinfo/ +# __init__.py +# linux/ +# __init__.py +# network.py network class +# services.py services class +# hardware.py provides hardware class +# +# + +import sys +import logging +import os + +logger = logging.getLogger("sysinfo") + +if sys.platform == 'linux2': + logger.info("Loading sysinfo for Linux") + from linux.network import network + from linux.hardware import hardware + from linux import services + from linux import misc + if os.path.isfile('/etc/debian_version'): + from linux import apt as software + elif os.path.isfile('/etc/redhat-release'): + from linux import my_rpm as software + +elif sys.platform == 'win32': + logger.info("Loading sysinfo for win32") + #from win32.network import network + from win32.hardware import hardware + from win32 import services + from win32 import software + from win32 import misc Added: trunk/lib/sysinfo/common.py =================================================================== --- trunk/lib/sysinfo/common.py (rev 0) +++ trunk/lib/sysinfo/common.py 2007-06-24 01:14:22 UTC (rev 17) @@ -0,0 +1,101 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (C) 2006 José de Paula Eufrásio Junior (jos...@gm...) AND +# Yves Junqueira (yve...@gm...) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# from http://www.voidspace.org.uk/python/pathutils.html (BSD License) + +def formatbytes(sizeint, configdict=None, **configs): + """ + Given a file size as an integer, return a nicely formatted string that + represents the size. Has various options to control it's output. + + You can pass in a dictionary of arguments or keyword arguments. Keyword + arguments override the dictionary and there are sensible defaults for options + you don't set. + + Options and defaults are as follows : + + * ``forcekb = False`` - If set this forces the output to be in terms + of kilobytes and bytes only. + + * ``largestonly = True`` - If set, instead of outputting + ``1 Mbytes, 307 Kbytes, 478 bytes`` it outputs using only the largest + denominator - e.g. ``1.3 Mbytes`` or ``17.2 Kbytes`` + + * ``kiloname = 'Kbytes'`` - The string to use for kilobytes + + * ``meganame = 'Mbytes'`` - The string to use for Megabytes + + * ``bytename = 'bytes'`` - The string to use for bytes + + * ``nospace = True`` - If set it outputs ``1Mbytes, 307Kbytes``, + notice there is no space. + + Example outputs : :: + + 19Mbytes, 75Kbytes, 255bytes + 2Kbytes, 0bytes + 23.8Mbytes + + .. note:: + + It currently uses the plural form even for singular. + """ + defaultconfigs = { 'forcekb' : False, + 'largestonly' : True, + 'kiloname' : 'Kbytes', + 'meganame' : 'Mbytes', + 'bytename' : 'bytes', + 'nospace' : True} + if configdict is None: + configdict = {} + for entry in configs: + # keyword parameters override the dictionary passed in + configdict[entry] = configs[entry] + # + for keyword in defaultconfigs: + if not configdict.has_key(keyword): + configdict[keyword] = defaultconfigs[keyword] + # + if configdict['nospace']: + space = '' + else: + space = ' ' + # + mb, kb, rb = bytedivider(sizeint) + if configdict['largestonly']: + if mb and not configdict['forcekb']: + return stringround(mb, kb)+ space + configdict['meganame'] + elif kb or configdict['forcekb']: + if mb and configdict['forcekb']: + kb += 1024*mb + return stringround(kb, rb) + space+ configdict['kiloname'] + else: + return str(rb) + space + configdict['bytename'] + else: + outstr = '' + if mb and not configdict['forcekb']: + outstr = str(mb) + space + configdict['meganame'] +', ' + if kb or configdict['forcekb'] or mb: + if configdict['forcekb']: + kb += 1024*mb + outstr += str(kb) + space + configdict['kiloname'] +', ' + return outstr + str(rb) + space + configdict['bytename'] + + Added: trunk/lib/sysinfo/linux/__init__.py =================================================================== --- trunk/lib/sysinfo/linux/__init__.py (rev 0) +++ trunk/lib/sysinfo/linux/__init__.py 2007-06-24 01:14:22 UTC (rev 17) @@ -0,0 +1,25 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (C) 2006 José de Paula Eufrásio Junior (jos...@gm...) AND +# Yves Junqueira (yve...@gm...) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +import logging +import sys + +logger = logging.getLogger("sysinfo.hardware.linux.init") + Added: trunk/lib/sysinfo/linux/apt.py =================================================================== --- trunk/lib/sysinfo/linux/apt.py (rev 0) +++ trunk/lib/sysinfo/linux/apt.py 2007-06-24 01:14:22 UTC (rev 17) @@ -0,0 +1,122 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (C) 2006 José de Paula Eufrásio Junior (jos...@gm...) +# AND# Yves Junqueira (yve...@gm...) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""Provides package management system information using APT +""" + +# thanks to http://users.sarai.net/shehjar/download/py-apt-tut.txt + +import apt_pkg +import os +import sys +import commands +import re +import logging + +logger = logging.getLogger("sysinfo.linux.apt") + +class packages: + + installed = [] + installed_ver = {} + update_candidates = {} + + def __init__(self): + # FIXME: These works, but isn't it ugly? + #os.close(1) + #os.close(2) + c = cache() + self.installed = c.installed_packages.keys() + self.installed.sort() + self.update_candidates = c.update_candidates + + for software in self.installed: + self.installed_ver[software] = c.installed_packages[software].VerStr + + +class cache: + + installed_packages = {} + update_candidates = {} + cache = '' + + def __init__(self): + + apt_pkg.init() + self.cache = apt_pkg.GetCache() + self.installed_packages = self._get_installed_packages() + self.update_candidates = self._get_update_candidates() + + + def _get_update_candidates(self): + + update_pkgs = {} + + try: + depcache = apt_pkg.GetDepCache(self.cache) + + except AttributeError: + # We are using an old version of libapt (like sarge's) + aptget = commands.getstatusoutput("export LANGUAGE=C; /usr/bin/env aptitude search '~U' -F '%p## %V##' 2> /dev/null") + if aptget[0] != 0: + logger.error("Error while trying to run apt-get upgrade") + logger.error("ERROR:" + str(aptget[1])) + return False + + get = aptget[1].split('\n') + for line in get: + h = re.compile('^(?P<pk_name>[\S]+)\s+(?P<pk_ver>[\S]+)') + p = h.search(line) + try: + if not (p.group('pk_name') and p.group('pk_ver')): + continue + except AttributeError: + continue + else: + update_pkgs[p.group('pk_name')] = p.group('pk_ver') + + else: + # Ok, new version of apt. This is the pretty way to do it :-) + depcache.ReadPinFile() + depcache.Init() + depcache.Upgrade() + + for pkg in self.cache.Packages: + if depcache.MarkedInstall(pkg) or depcache.MarkedUpgrade(pkg): + if depcache.GetCandidateVer(pkg) != pkg.CurrentVer: + update_pkgs[pkg.Name] = \ + depcache.GetCandidateVer(pkg).VerStr + return update_pkgs + + + def _get_installed_packages(self): + inst_pkgs = {} + + for pkg in self.cache.Packages: + if pkg.CurrentVer: + inst_pkgs[pkg.Name] = pkg.CurrentVer + return inst_pkgs + +if __name__ == '__main__': + s = packages() + #print "instalados", s.installed + #print "instalados_versao", s.installed_ver + print "update", s.update_candidates + Added: trunk/lib/sysinfo/linux/hardware.py =================================================================== --- trunk/lib/sysinfo/linux/hardware.py (rev 0) +++ trunk/lib/sysinfo/linux/hardware.py 2007-06-24 01:14:22 UTC (rev 17) @@ -0,0 +1,392 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (C) 2006 José de Paula Eufrásio Junior (jos...@gm...) AND +# Yves Junqueira (yve...@gm...) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +from xml.sax import ContentHandler +from xml.sax import make_parser +from xml.sax import parseString + +import StringIO +import xml.sax + +import commands +import logging +import string +import sys +import os + +logger = logging.getLogger("sysinfo.linux.hardware") + +# FIXME: teste feito em MDS500 mostrou que lshw às vezes gera um XML com +# caracteres estranhos, como ^E^D^D^C + +class lshw_run_error(Exception): + pass + +class lshw_data_parser(ContentHandler): + """Parse a XML file that was created using 'lshw -xml'. You need another + function to parse it and copy the contents of "HardWare". The class + "HardWare" below does that. + """ + + def __init__(self): + logger.debug("Created new instance for the 'lshw_data_parser' class") + # List of dicts containing Nodes data + self.Nodes = [] + # Dict containing current tag data. + self.CurrentTag = [{}] + + # String with the current tag represented unit, if available. + self.CurrentTagUnits = '' + # Dict containing relevant machine data. + # Every item should support multiple values + self.HardWare = {} + + def startElement(self, tag, attrs): + + self.CurrentTag.append({'name' : tag }) + # If it has a representation unit, set it. + # FIXME: this is returning the WRONG unit + # Disabled it temporarily until needed + #try: + # unit = attrs.get('units') + #except: + # self.CurrentTagUnits = '' + #else: + # if unit: + # self.CurrentTagUnits = unit + + if tag == 'node': + + self.Nodes.append({'name' : 'node' }) + + # Fill node attributes information + try: + nodeclass = attrs.get('class','') + except: + pass + else: + self.Nodes[-1]['class'] = nodeclass + + try: + nodehandle = attrs.get('handle','') + except: + pass + else: + self.Nodes[-1]['handle'] = nodehandle + + + def endElement(self, tag): + + # sanity test + if self.CurrentTag[-1]['name'] != tag: + sys.exit(1) + + else: + self.CurrentTag.pop() + if tag == 'node': + # Node closing. We should get all that and store somewhere, then + # pop it + # from the self.Nodes list. + node = self.Nodes[-1] + + if node.has_key('physid') and node.has_key('description'): + + self.setHardWare(node) + + else: + #print "Strange. Node lacks physid and/or description" + pass + + if len(self.Nodes) > 1: + # print "closing", tag + self.Nodes.pop() + + def characters(self, ch): + + # This will populate self.Nodes[-1] with relevant data. + # Not that it would only work for unique data (like physid) + for x in ['description', 'physid', 'product', 'vendor', 'version', + 'size', 'slot', 'width', 'serial']: + + if self.CurrentTag[-1]['name'] == x: + + if self.Nodes[-1].has_key(x): + self.Nodes[-1][x] += ch + else: + self.Nodes[-1][x] = ch + + def setHardWare(self, node): + """Argh. This is ugly. + """ + # FIXME: hmm what's the string for CD reader? + for element in ['CPU', 'BIOS', 'System Memory', 'System memory', + 'Motherboard', 'VGA compatible controller', + 'Multimedia audio controller', 'DVD-RAM writer', 'DVD reader', + 'Modem' ,'Mouse', 'Ethernet interface']: + + if node['description'] == element: + if not self.HardWare.has_key(element): + self.HardWare[element] = [] + + self.HardWare[element].append({}) + + for info in ['product', 'vendor', 'size','version', 'slot', + 'width', 'serial']: + if node.has_key(info): + set = node[info] + if info == 'size' and len(self.CurrentTagUnits) > 1: + unit = self.CurrentTagUnits + set += ' ' + unit + + self.HardWare[element][-1][info] = set + # In some cases (why?) 'System Memory' appears with + # a minor 'm'. + if element == 'System memory': + self.HardWare['System Memory'] = self.HardWare[element] + + +class get_hardware: + + def __init__(self): + parser = make_parser() + handler = lshw_data_parser() + parser.setContentHandler(handler) + logger.info("Calling lshw.") + + id = str(os.getuid()) + + if id != '0': + logger.error("In the current version, sysinfo hardware collection \ +requires root. Current uid: " + id) + print "Sysinfo must be run as root." + sys.exit(1) + + lshwxml = commands.getstatusoutput( + "export LANGUAGE=C; /usr/bin/env lshw -xml 2>&1|grep -v WARNING") + logger.info("lshw execution finished.") + + if lshwxml[0] != 0 or len(lshwxml[1]) < 1: + # This would kill this module instance. + # Should we handle it instead? + # 16/03/06: Die!! + logger.error("Could not run lshw") + raise lshw_run_error, "could not run lshw" + else: + xmldata = lshwxml[1] + + sane_data = '' + for char in xmldata: + if char in string.printable: + sane_data += char + + input = StringIO.StringIO(sane_data) + parser.parse(input) + self.data = handler.HardWare + +class keyboard: + """Get keyboard info from /proc/bus/input/devices + """ + + def __init__(self): + logger.debug("Getting keyboard data") + + try: + devices_file = open('/proc/bus/input/devices', 'r') + except: + pass + else: + + input = devices_file.readlines() + + for line in input: + if 'keyboard' in line: + k1 = line.replace('N: Name=','') + k2 = k1.replace('"','') + self.model = k2 + + +class motherboard: + + product = '' + vendor = '' + + def __init__(self, hw, index=0): + if hw.data.has_key('Motherboard'): + self.product = hw.data['Motherboard'][index].get('product', '') + self.vendor = hw.data['Motherboard'][index].get('vendor', '') + + +class memory: + + size = '' + + def __init__(self, hw): + if hw.data.has_key('System Memory'): + self.size = hw.data['System Memory'][0].get('size', '').replace(' bytes','') + +class mouse: + + product = '' + vendor = '' + + def __init__(self, hw, index=0): + if hw.data.has_key('Mouse'): + self.product = hw.data['Mouse'][index].get('product', '') + self.vendor = hw.data['Mouse'][index].get('vendor', '') + + +class modem: + + product = '' + vendor = '' + + def __init__(self, hw, index=0): + if hw.data.has_key('Modem'): + self.product = hw.data['Modem'][index].get('product', '') + self.vendor = hw.data['Modem'][index].get('vendor', '') + +class dvd_reader: + + product = '' + + def __init__(self, hw, index=0): + if hw.data.has_key('DVD reader'): + self.product = hw.data['DVD reader'][index].get('product', '') + +class dvd_ram_writer: + + product = '' + serial = '' + vendor = '' + + + def __init__(self, hw, index=0): + if hw.data.has_key('DVD-RAM writer'): + self.product = hw.data['DVD-RAM writer'][index].get('product', '') + self.serial = hw.data['DVD-RAM writer'][index].get('serial', '') + self.version = hw.data['DVD-RAM writer'][index].get('version', '') + +class bios: + + product = '' + size = '' + vendor = '' + + def __init__(self, hw): + if hw.data.has_key('BIOS'): + self.product = hw.data['BIOS'][0].get('product', '') + self.vendor = hw.data['BIOS'][0].get('vendor', '') + self.version = hw.data['BIOS'][0].get('version', '') + + + +class video_board: + + product = '' + size = '' + width = '' + vendor = '' + + def __init__(self, hw, index=0): + if hw.data.has_key('VGA compatible controller'): + self.product = \ + hw.data['VGA compatible controller'][index].get('product') + self.memory = \ + hw.data['VGA compatible controller'][index].get('size').replace(' bytes','') + self.width = \ + hw.data['VGA compatible controller'][index].get('width') + self.vendor = \ + hw.data['VGA compatible controller'][index].get('vendor') + +class sound_board: + + product = '' + + def __init__(self, hw, index=0): + if hw.data.has_key('Multimedia audio controller'): + self.product = \ + hw.data['Multimedia audio controller'][index].get('product') + +class ethernet_board: + + product = '' + size = '' + vendor = '' + width = '' + vendor = '' + serial = '' + + def __init__(self, hw, index=0): + + if hw.data.has_key('Ethernet interface'): + self.product = \ + hw.data['Ethernet interface'][index].get('product', '') + self.width = \ + hw.data['Ethernet interface'][index].get('width', '') + self.vendor = \ + hw.data['Ethernet interface'][index].get('vendor', '') + self.version = \ + hw.data['Ethernet interface'][index].get('version', '') + self.serial = \ + hw.data['Ethernet interface'][index].get('serial', '') + +class cpu: + + product = '' + size = '' + vendor = '' + + def __init__(self, hw, index=0): + if hw.data.has_key('CPU'): + self.product = hw.data['CPU'][index].get('product', '') + self.vendor = hw.data['CPU'][index].get('vendor', '') + self.frequency = hw.data['CPU'][index].get('size', '') + +class hardware: + """This is the interfaced accessed by the user. It provides + hardware data collected through get_hardware. + """ + # FIXME: motherboard, cpu, etc need support to multiple values. Currently + # uses index=0 + + def __init__(self): + logger.debug("Created new instance for the 'hardware' class") + self.hw = get_hardware() + self.motherboard = motherboard(self.hw, 0) + self.cpu = cpu(self.hw, 0) + self.ethernet_board = ethernet_board(self.hw, 0) + self.video_board = video_board(self.hw, 0) + self.sound_board = sound_board(self.hw, 0) + self.bios = bios(self.hw) # BIOS is always index=0 + self.dvd_reader = dvd_reader(self.hw, 0) + self.dvd_ram_writer = dvd_ram_writer(self.hw, 0) + self.modem = modem(self.hw, 0) + self.mouse = mouse(self.hw, 0) + self.memory = memory(self.hw) + self.keyboard = keyboard() + +if __name__ == '__main__': +# a = get_hardware() +# print a.data + x = hardware() + y = x.motherboard + print "h", x.motherboard.vendor, x.ethernet_board.product, \ + x.video_board.product, x.video_board.vendor,\ + x.dvd_reader.product, x.memory.size Added: trunk/lib/sysinfo/linux/misc.py =================================================================== --- trunk/lib/sysinfo/linux/misc.py (rev 0) +++ trunk/lib/sysinfo/linux/misc.py 2007-06-24 01:14:22 UTC (rev 17) @@ -0,0 +1,95 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (C) 2006 José de Paula Eufrásio Junior (jos...@gm...) +# AND# Yves Junqueira (yve...@gm...) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""Provides miscelaneous information like enviroment variables and local +partitions. +""" + +import os +import logging + + +logger = logging.getLogger("sysinfo.linux.misc") + +class env: + variables = {} + + def __init__(self): + + self.variables = os.environ + +class disks: + partitions = {} + + def __init__(self): + + self.partitions = self._get_partitions() + + def _get_partitions(self, show_remote=0,show_dummy=0): + """Get mounted partitions + Get mounted partitions. If show_remote=0, show only local partitions. + """ + + # + #From coreutils mountlist.c: + # + # /* A file system is `remote' if its Fs_name contains a `:' + # or if (it is of type smbfs and its Fs_name starts with `//'). */ + # + # + parts = [] + mtab = open('/etc/mtab', 'r') + for part in mtab.readlines(): + [fsname, mountp, fstype, options, dump, ppass ] = part.split() + # mtab brings octal escaped special strings + mountp = mountp.decode('string_escape') + if show_remote == 0: + if fsname.find(':') >= 0 : continue + if fstype == 'smbfs' and \ + fsname.startswith('//'): continue + + if show_dummy == 0: + # another possibility is to check /proc/filesystems and exclude any + # that has 'nodev' + if fstype == 'tmpfs' or fstype == 'proc' \ + or fstype == 'sysfs' or fstype == 'devpts' \ + or fstype == 'none' \ + or not fsname.startswith('/'): continue + + partstat = os.statvfs(mountp) + part_dict = { + 'fsname' : fsname, + 'mountpoint' : mountp, + 'fstype' : fstype, + 'fssize' : partstat[1] * partstat[2], + # bytes available for non-root + 'fsfree' : partstat[1] * partstat[4], + } + + parts.append(part_dict) + + mtab.close() + return parts + +if __name__ == '__main__': + e = env() +# print e.variables + d = disks() + print d.partitions[0]['fssize'] /(1024 * 1024) + print d.partitions[0]['fsfree'] / (1024 * 1024) Added: trunk/lib/sysinfo/linux/my_rpm.py =================================================================== --- trunk/lib/sysinfo/linux/my_rpm.py (rev 0) +++ trunk/lib/sysinfo/linux/my_rpm.py 2007-06-24 01:14:22 UTC (rev 17) @@ -0,0 +1,56 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (C) 2006 José de Paula Eufrásio Junior (jos...@gm...) +# AND# Yves Junqueira (yve...@gm...) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""Provides package management system information using RPM +""" + +# thanks to http://users.sarai.net/shehjar/download/py-apt-tut.txt + +import rpm +import logging + +logger = logging.getLogger("sysinfo.linux.rpm") + +class packages: + + installed = [] + installed_ver = {} + update_candidates = {} + + def __init__(self): + self.installed = self._get_installed() + self.installed.sort() + + def _get_installed(self): + """Gets installed packages information using RPM. + """ + ins_pkgs = [] + ts = rpm.TransactionSet() + mi = ts.dbMatch() # all installed packages + for h in mi: + ins_pkgs.append(h['name']) + return ins_pkgs + +if __name__ == '__main__': + s = packages() + print "instalados", s.installed + #print "instalados_versao", s.installed_ver + print "update", s.update_candidates + Added: trunk/lib/sysinfo/linux/network.py =================================================================== --- trunk/lib/sysinfo/linux/network.py (rev 0) +++ trunk/lib/sysinfo/linux/network.py 2007-06-24 01:14:22 UTC (rev 17) @@ -0,0 +1,416 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (C) 2006 José de Paula Eufrásio Junior (jos...@gm...) AND +# Yves Junqueira (yve...@gm...) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""Provides network information for linux systems +""" + +import commands +import logging +import re +import socket +import struct +import sys + +logger = logging.getLogger("sysinfo.linux.network") + +# auxiliary functions +def hex2dec(s): + """Returns the integer value of a hexadecimal string s + """ + return int(s, 16) +# Functions based on: +# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66517 +# which is licensed under the BSD license. + +def dottedQuadToNum(ip): + """convert decimal dotted quad string to long integer""" + return struct.unpack('L',socket.inet_aton(ip))[0] + +def numToDottedQuad(n): + """Convert long int to dotted quad string + """ + return socket.inet_ntoa(struct.pack('L',n)) + +def convert_ip_to_net_and_host(ip, maskstring): + """Returns tuple (network, host) dotted-quad addresses given IP and mask""" + # (by Greg Jorgensen) + + n = dottedQuadToNum(ip) + m = dottedQuadToNum(maskstring) + + host = n & m + net = n - host + + return numToDottedQuad(net), numToDottedQuad(host) + + +class ifconfig: + """Gets information from /sbin/ifconfig + and populates interf_dict + """ + + interf_dict = {} + + def __init__(self): + logger.info("Reading ifconfig data") + # Sets 'ifconfig' + ifconfig = commands.getstatusoutput("export LANGUAGE=C; ifconfig") + if ifconfig[0] != 0: + # This would kill this module instance. + logger.error("Could not run ifconfig") + raise IfconfigError, "could not run ifconfig" + else: + i = ifconfig[1] + sp = re.compile('([ae]th[\d]+|lo) ') + interf_list = sp.split(i) + interf_list.pop(0) + i = 1 + # Assemble a dict using 1 as key, 2 as value; 3 as key, 4 as value... + for x in interf_list: + if i % 2 == 0: # Even + self.interf_dict[ interf_list[i - 2] ] = x + i += 1 + + + +class resolv: + """Gets resolver information from /etc/resolv.conf + and populates resolvconf, dns_domain and dns_resolvers + """ + + resolvconf = '' + dns_domain = '' + dns_resolvers = '' + + def __init__(self): + # Return empty resolvconf. Do not raise error. + + self.resolvconf = self._get_resolvconf() + self.dns_domain = self._get_dns_domain() + self.dns_resolvers = self._get_dnsresolvers() + + def _get_resolvconf(self): + logger.debug("Getting DNS resolvers data") + try: + r = open('/etc/resolv.conf','r') + except: + logger.error("Error while reading /etc/resolv.conf") + return '' + else: + return r.read() + r.close() + + def _get_dns_domain(self): + + h = re.compile( r'(domain|search)\s+(?P<domain>.*)\s*', + re.I) + w = h.search(self.resolvconf) + if w: + domain = w.group('domain') + if domain: + return domain + + return '' + + def _get_dnsresolvers(self): + + r = re.compile( r'([\W]nameserver)\s+(?P<resolver>\S+)\s*' + r'((nameserver)\s+(?P<resolver2>\S+)\s*)?', + re.I) + + x = r.search(self.resolvconf) + #Resolvers must return at least two empty values + resolvers = ['',''] + if x: + resolver = x.group('resolver') + if resolver: + resolvers[0]= resolver + + resolver2 = x.group('resolver2') + + if resolver2: + resolvers[1] = resolver2 + + if resolvers is not None: + return resolvers + else: + return [] + +class misc: + """Gets miscelaneous information from the system. + """ + + hostname = '' + default_gateway = '' + interfaces = [] + + def __init__(self, ifc): + self.hostname = socket.gethostname() + self.default_gateway = self._get_default_gateway() + self.interfaces = ifc.interf_dict.keys() + + def _get_default_gateway(self): + t1 = self._get_default_gateway_from_proc() + if not t1: + t1 = self._get_default_gateway_from_bin_route() + if not t1: + return None + return t1 + + def _get_default_gateway_from_proc(self): + """"Returns the current default gateway, reading that from /proc' + """ + logger.debug("Reading default gateway information from /proc") + try: + f = open('/proc/net/route','r') + route = f.read() + except: + logger.error("Failed to read def gateway from /proc") + return None + else: + h = re.compile('\n(?P<interface>\w+)\s+00000000\s+(?P<def_gateway>[\w]+)\s+') + w = h.search(route) + if w: + if w.group('def_gateway'): + return numToDottedQuad(hex2dec(w.group('def_gateway'))) + else: + logger.error("Could not find def gateway info in /proc") + return None + else: + logger.error("Could not find def gateway info in /proc") + return None + + + def _get_default_gateway_from_bin_route(self): + """Get Default Gateway from '/sbin/route -n + Called by get_default_gateway and is only used if could not get that from /proc + """ + logger.debug("Reading default gateway information from route binary") + routebin = commands.getstatusoutput("export LANGUAGE=C; /usr/bin/env route -n") + + if routebin[0] != 0: + logger.error("Error while trying to run route") + return false + h = re.compile('\n0.0.0.0\s+(?P<def_gateway>[\w.]+)\s+') + w = h.search(routebin[1]) + if w: + def_gateway = w.group('def_gateway') + + if def_gateway: + return def_gateway + + logger.error("Could not find default gateway by running route") + return '' + +class interface: + """Retrieves interface specific information + """ + + ip_addresses = [] + mac_address = '' + netmask = '' + ip_network = '' + + def __init__(self, ifc, interf=None): + self.interf_dict = ifc.interf_dict + + if interf: + self.ip_addresses = self._get_ip_addresses(interf) + self.mac_address = self._get_mac_address(interf) + self.netmask = self._get_netmask(interf) + self.ip_network = self._get_network(self.ip_addresses[0], + self.netmask) + self.status = self._get_status(interf) + self.dhcp_server = self._get_dhcp_server(interf) + + def _get_ip_addresses(self, interf=None): + """Shows the interface's respective IP addresses + """ + # FIXME: get_address currently returns a singleton list. + + h = re.compile(r'inet add?r:(?P<ip_addr>[\w.]+)', re.I) + try: + w = h.search(self.interf_dict[interf]) + except KeyError: + logger.error("Could not find " + str(interf) + " in the list of \ +active network interfaces. Please review your configuration.") + sys.exit(1) + + ip_addrs = [] + if w: + ip_addrs.append(w.group('ip_addr')) + return ip_addrs + + + def _get_mac_address(self,interf=None): + """Gives network interfaces hardware address + """ + mac = '' + if interf: + h = re.compile(r'HW(addr)? (?P<mac>[\w:]+) ', re.I) + w = h.search(self.interf_dict[interf]) + if w: + mac = w.group('mac') + return mac + + def _get_network(self,ip=None,netmask=None): + + network = '' + + if ip and netmask: + (host, network) = convert_ip_to_net_and_host(ip, netmask) + return network + + def _get_netmask(self,interf=None): + """Shows the interface's respective IP netmask + """ + netmask = '' + + if interf: + h = re.compile(r'Mask:(?P<netmask>[\w.]+)', re.I) + w = h.search(self.interf_dict[interf]) + if w: + netmask = w.group('netmask') + return netmask + + def _get_status(self,interf=None): + """Shows interface status + """ + + if interf: + h = re.compile('UP',re.I) + w = h.search(self.interf_dict[interf]) + if w: + return 'UP' + else: + return 'DOWN' + else: + return '' + + def _get_dhcp_server(self,interf=None): + """Return the current DHCP Server for the 'interf' interface, by parsing the dhclient.leases file. + It will try to define if the IP was indeed setup using DHCP by trying to find dhclient in the + current running process list. + In case there are many leases stored, it should consider the last one for the given interface. + """ + + if interf == None: + return '' + + # FIXME if there is a better way to define if a machine is using DHCP + # besides checking dhclient? + + dh = commands.getstatusoutput('ps aux|grep dhclient') + + if dh[0] != 0: + logger.error("Error finding a running dhclient") + return '' + else: + i = dh[1] + sp = re.compile('-lf\s+(?P<leases_file>\S+)\s+.*(?P<interface>[ae]th[\d]+|lo)') + m = sp.search(dh[1]) + if m: + leases_file = m.group('leases_file') + else: + #FIXME: this should work for other distros and dhclient versions + leases_file = '/var/lib/dhcp3/dhclient.leases' + try: + f = open(leases_file) + except: + logger.error("Could not open leases_file (tried from " + \ + leases_file + " )") + return '' + dhcp = f.read() + f.close() + + sp = re.compile('(lease)\s*{') + leases_list = sp.split(dhcp) + + test_int = re.compile('interface\s*"'+ interf) + + # Removing leases unrelated to 'interf' + for x in leases_list: + m = test_int.search(x) + if not m: + leases_list.remove(x) + if len(leases_list) == 0: + return '' + lease = leases_list.pop() + + o = re.compile('option\s+dhcp-server-identifier\s+(?P<dhcp_server>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\s*;') + k = o.search(lease) + + if k: + server = k.group('dhcp_server') + else: + server = '' + + # Shows the last lease + return server + +class last_logon: + + last_user = '' + + def __init__(self): + self.last_user = self._get_last_user() + + def _get_last_user(self): + logger.debug("Getting last logon") + l = commands.getstatusoutput('export LANGUAGE=C; last') + if l[0] != 0: + logger.error("Error while running 'last'") + return '' + else: + last_f = l[1].split()[0] + return last_f + +class network(resolv, ifconfig, misc, last_logon): + """This is the stuff users will access. It inherits data from other 'os' + classes so users can access information like network.dns_domain. + """ + + def __init__(self): + self._ifc = ifconfig() + resolv.__init__(self) + misc.__init__(self, self._ifc) + last_logon.__init__(self) + self.interface = self.interface_wrapper + + def interface_wrapper(self, interf): + i = interface(self._ifc, interf) + return i + +if __name__ == '__main__': +# Log para stdout + format = "%(asctime)s %(levelname)s %(message)s" + logger.setLevel(logging.DEBUG) + ch = logging.StreamHandler() + ch.setLevel(logging.DEBUG) + formatter = logging.Formatter(format) + ch.setFormatter(formatter) + logger.addHandler(ch) + + g = network() + + #print i.interf_dict + #print d.dns_domain, d.dns_resolvers + b = g.interface(g.interfaces[1]) + print "teste", g.interfaces, b.ip_addresses, g.last_user, b.dhcp_server Added: trunk/lib/sysinfo/linux/services.py =================================================================== --- trunk/lib/sysinfo/linux/services.py (rev 0) +++ trunk/lib/sysinfo/linux/services.py 2007-06-24 01:14:22 UTC (rev 17) @@ -0,0 +1,153 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (C) 2006 José de Paula Eufrásio Junior (jos...@gm...) AND +# Yves Junqueira (yve...@gm...) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +"""Provides specific services information +""" + +import re +import logging + +logger = logging.getLogger("sysinfo.linux.services") + +class smb: + """Provides information from the SMB service using information from + the smb.conf file. + That may not be an exact science, but it's the best method available. + """ + + def __init__(self): + + conf = self._get_smbconf() + self.workgroup = self._get_workgroup(conf) + self.wins_servers = self._get_wins_servers(conf) + self.smb_shares = self._get_smb_shares(conf) + + def _get_smbconf(self): + try: + # In Debian-like distros + f = open('/etc/samba/smb.conf','r') + except: + try: + f = open('/etc/smb/smb.conf','r') + except: + logger.error("Error while opening smb.conf") + return '' + + smbconf = f.read() + f.close() + if not smbconf: + logger.error("Empty smb.conf") + return '' + else: + return smbconf + + + + def _get_workgroup(self, smbconf): + """Gets the workgroup from which the machine is a member + """ + + m = re.compile(r'^\s*workgroup\s*=\s*(?P<workgroup>.*)',re.I|re.M) + + p = m.search(smbconf) + + workgroup = '' + try: + workgroup = p.group('workgroup') + except: + pass + + return workgroup + + + def _get_smb_shares(self, smbconf): + """Gets the SMB shares in the config file + """ + conf = smbconf.split('\n') + + exclude = [ 'global' ] + share_search = re.compile(r'^\s*\[(?P<share>[^\]]+)\][\s]*(#.*)?$') + comment_search = re.compile(r'^\s*comment\s*=\s*(?P<comment>.*)$') + # list of dicts: + shares = [] + cur_share = '' + for line in conf: + share_match = share_search.search(line) + try: + share = share_match.group('share') + except: + pass + else: + if share not in exclude: + shares.append({'name': share}) + if share in ['printers', 'print$']: + # printer share + shares[-1]['type'] = 'printer' + else: + shares[-1]['type'] = 'directory' + cur_share = share + continue + else: + # beggining a new conf section + cur_share = '' + continue + + # we are only interested if we have a valid share + if cur_share: + comment_match = comment_search.search(line) + try: + comment = comment_match.group('comment') + except: + pass + else: + shares[-1]['comment'] = comment + + return shares + + def _get_wins_servers(self, smbconf): + """Gets the WINS servers in use by the machine + """ + + m = re.compile(r'^\s*wins server\s*=\s*(?P<wins>.*)',re.I|re.M) + + p = m.search(smbconf) + wins = [] + + try: + wins_string = p.group('wins') + except: + logger.error("Could not find WINS server setting") + else: + if wins_string: + wins = wins_string.split(' ') + else: + logger.error("Could not find WINS server setting") + + return wins + +if __name__ == '__main__': + + s = smb() + + #print i.interf_dict + #print d.dnsdomain, d.dnsresolvers + print "teste", s.workgroup,s.wins_servers,s.smb_shares + + Added: trunk/lib/sysinfo/sysinfo-example.py =================================================================== --- trunk/lib/sysinfo/sysinfo-example.py (rev 0) +++ trunk/lib/sysinfo/sysinfo-example.py 2007-06-24 01:14:22 UTC (rev 17) @@ -0,0 +1,64 @@ +#!/usr/bin/python + +#Sample python-sysinfo usage + +import sysinfo +import logging + +format = "%(asctime)s %(levelname)s %(message)s" +sysinfo_log = logging.getLogger("sysinfo") +sysinfo_log.setLevel(logging.DEBUG) +ch = logging.StreamHandler() +ch.setLevel(logging.DEBUG) +formatter = logging.Formatter(format) +ch.setFormatter(formatter) +sysinfo_log.addHandler(ch) + + +net = sysinfo.network() +interf = net.interface('eth0') +last_user = net.last_user + +hw = sysinfo.hardware() + +smb = sysinfo.services.smb() + +pkgs = sysinfo.software.packages() + +env = sysinfo.misc.env() + +print hw.motherboard.product +print hw.motherboard.vendor +print hw.cpu.product +print hw.cpu.vendor +print hw.cpu.frequency +print hw.video_board.memory +print hw.memory.size +print hw.video_board.product +print hw.sound_board.product +print hw.keyboard.model +print hw.bios.vendor +print hw.bios.version +print hw.dvd_reader.product +print hw.modem.vendor +print hw.modem.product +print hw.mouse.product +print hw.mouse.vendor +print hw.ethernet_board.vendor +print hw.ethernet_board.product + + +print net.hostname +print net.default_gateway +print net.dnsresolvers +print net.dnsdomain + + +print interf.dhcp_server +print interf.mac_address +print interf.ip_network +print interf.ip_addresses[0] + +print smb.smb_shares +print smb.wins_servers +print smb.workgroup Added: trunk/lib/sysinfo/win32/__init__.py =================================================================== Added: trunk/lib/sysinfo/win32/hardware.py =================================================================== --- trunk/lib/sysinfo/win32/hardware.py (rev 0) +++ trunk/lib/sysinfo/win32/hardware.py 2007-06-24 01:14:22 UTC (rev 17) @@ -0,0 +1,243 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (C) 2006 José de Paula Eufrásio Junior (jos...@gm...) AND +# Yves Junqueira (yve...@gm...) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +import win32com.client +import logging + +class get_hardware: + """Uses win32com to get hardware information. Script sampled from Microsoft. + """ + + data = {} + + def __init__(self): + target_list = [ + 'Win32_ComputerSystem', + 'Win32_BIOS', + #'Win32_Net... [truncated message content] |
From: <ror...@us...> - 2007-06-23 14:42:03
|
Revision: 16 http://roreditor.svn.sourceforge.net/roreditor/?rev=16&view=rev Author: rorthomas Date: 2007-06-23 07:41:59 -0700 (Sat, 23 Jun 2007) Log Message: ----------- * added psyco to libs. * using psyco on startup * added documentation basics Modified Paths: -------------- trunk/lib/ror/starter.py trunk/lib/wxogre/wxOgreWindow.py trunk/ogre.cfg trunk/rortoolkit.py trunk/terraineditor.py trunk/truckeditor.py Added Paths: ----------- trunk/doc/ trunk/doc/createdoc.bat trunk/doc/createdoc.py trunk/doc/epydoc.conf trunk/lib/psyco/ trunk/lib/psyco/__init__.py trunk/lib/psyco/__init__.pyo trunk/lib/psyco/_psyco.pyd trunk/lib/psyco/classes.py trunk/lib/psyco/classes.pyo trunk/lib/psyco/core.py trunk/lib/psyco/core.pyo trunk/lib/psyco/kdictproxy.py trunk/lib/psyco/kdictproxy.pyo trunk/lib/psyco/logger.py trunk/lib/psyco/logger.pyo trunk/lib/psyco/profiler.py trunk/lib/psyco/profiler.pyo trunk/lib/psyco/support.py trunk/lib/psyco/support.pyo Added: trunk/doc/createdoc.bat =================================================================== --- trunk/doc/createdoc.bat (rev 0) +++ trunk/doc/createdoc.bat 2007-06-23 14:41:59 UTC (rev 16) @@ -0,0 +1 @@ +c:\python25\python.exe createdoc.py -vv --name RoRToolkit --url http://wiki.rigsofrods.com/index.php?title=Main_Page --debug psyco ogre ror rorterraineditor rortruckeditor wx wxogre \ No newline at end of file Added: trunk/doc/createdoc.py =================================================================== --- trunk/doc/createdoc.py (rev 0) +++ trunk/doc/createdoc.py 2007-06-23 14:41:59 UTC (rev 16) @@ -0,0 +1,25 @@ +#Thomas Fischer 31/05/2007, th...@th... +import sys, os, os.path + +def main(): + """ + main method + """ + + sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..\lib")) + + # Import Psyco if available + try: + import psyco + psyco.full() + #psyco.log() + #psyco.profile() + except ImportError: + pass + + import epydoc.cli + epydoc.cli.cli() + + +if __name__=="__main__": + main() \ No newline at end of file Added: trunk/doc/epydoc.conf =================================================================== --- trunk/doc/epydoc.conf (rev 0) +++ trunk/doc/epydoc.conf 2007-06-23 14:41:59 UTC (rev 16) @@ -0,0 +1,148 @@ +[epydoc] + +# The list of objects to document. Objects can be named using +# dotted names, module filenames, or package directory names. +# Alases for this option include "objects" and "values". +modules: psyco + +# The type of output that should be generated. Should be one +# of: html, text, latex, dvi, ps, pdf. +output: html + +# The path to the output directory. May be relative or absolute. +target: html/ + +# An integer indicating how verbose epydoc should be. The default +# value is 0; negative values will supress warnings and errors; +# positive values will give more verbose output. +verbosity: 3 + +# A boolean value indicating that Epydoc should show a tracaback +# in case of unexpected error. By default don't show tracebacks +debug: 1 + +# If True, don't try to use colors or cursor control when doing +# textual output. The default False assumes a rich text prompt +simple-term: 0 + + +### Generation options + +# The default markup language for docstrings, for modules that do +# not define __docformat__. Defaults to epytext. +docformat: epytext + +# Whether or not parsing should be used to examine objects. +parse: yes + +# Whether or not introspection should be used to examine objects. +introspect: yes + +# Don't examine in any way the modules whose dotted name match this +# regular expression pattern. +#exclude + +# Don't perform introspection on the modules whose dotted name match this +# regular expression pattern. +#exclude-introspect + +# Don't perform parsing on the modules whose dotted name match this +# regular expression pattern. +#exclude-parse + +# The format for showing inheritance objects. +# It should be one of: 'grouped', 'listed', 'included'. +inheritance: listed + +# Whether or not to inclue private variables. (Even if included, +# private variables will be hidden by default.) +private: yes + +# Whether or not to list each module's imports. +imports: no + +# Whether or not to include syntax highlighted source code in +# the output (HTML only). +sourcecode: yes + +# Whether or not to includea a page with Epydoc log, containing +# effective option at the time of generation and the reported logs. +include-log: yes + + +### Output options + +# The documented project's name. +name: RoRToolkit + +# The CSS stylesheet for HTML output. Can be the name of a builtin +# stylesheet, or the name of a file. +css: white + +# The documented project's URL. +url: http://wiki.rigsofrods.com/index.php?title=Main_Page + +# HTML code for the project link in the navigation bar. If left +# unspecified, the project link will be generated based on the +# project's name and URL. +#link: <a href="somewhere">My Cool Project</a> + +# The "top" page for the documentation. Can be a URL, the name +# of a module or class, or one of the special names "trees.html", +# "indices.html", or "help.html" +#top: os.path + +# An alternative help file. The named file should contain the +# body of an HTML file; navigation bars will be added to it. +#help: my_helpfile.html + +# Whether or not to include a frames-based table of contents. +frames: yes + +# Whether each class should be listed in its own section when +# generating LaTeX or PDF output. +separate-classes: no + + +### API linking options + +# Define a new API document. A new interpreted text role +# will be created +#external-api: epydoc + +# Use the records in this file to resolve objects in the API named NAME. +#external-api-file: epydoc:api-objects.txt + +# Use this URL prefix to configure the string returned for external API. +#external-api-root: epydoc:http://epydoc.sourceforge.net/api + + +### Graph options + +# The list of graph types that should be automatically included +# in the output. Graphs are generated using the Graphviz "dot" +# executable. Graph types include: "classtree", "callgraph", +# "umlclass". Use "all" to include all graph types +graph: all + +# The path to the Graphviz "dot" executable, used to generate +# graphs. +dotpath: C:\Programme\ATT\Graphviz\bin\dot.exe + +# The name of one or more pstat files (generated by the profile +# or hotshot module). These are used to generate call graphs. +pstat: profile.out + +# Specify the font used to generate Graphviz graphs. +# (e.g., helvetica or times). +graph-font: Helvetica + +# Specify the font size used to generate Graphviz graphs. +graph-font-size: 10 + + +### Return value options + +# The condition upon which Epydoc should exit with a non-zero +# exit status. Possible values are error, warning, docstring_warning +#fail-on: error Added: trunk/lib/psyco/__init__.py =================================================================== --- trunk/lib/psyco/__init__.py (rev 0) +++ trunk/lib/psyco/__init__.py 2007-06-23 14:41:59 UTC (rev 16) @@ -0,0 +1,58 @@ +########################################################################### +# +# Psyco top-level file of the Psyco package. +# Copyright (C) 2001-2002 Armin Rigo et.al. + +"""Psyco -- the Python Specializing Compiler. + +Typical usage: add the following lines to your application's main module, +preferably after the other imports: + +try: + import psyco + psyco.full() +except ImportError: + print 'Psyco not installed, the program will just run slower' +""" +########################################################################### + + +# +# This module is present to make 'psyco' a package and to +# publish the main functions and variables. +# +# More documentation can be found in core.py. +# + + +# Try to import the dynamic-loading _psyco and report errors +try: + import _psyco +except ImportError, e: + extramsg = '' + import sys, imp + try: + file, filename, (suffix, mode, type) = imp.find_module('_psyco', __path__) + except ImportError: + ext = [suffix for suffix, mode, type in imp.get_suffixes() + if type == imp.C_EXTENSION] + if ext: + extramsg = (" (cannot locate the compiled extension '_psyco%s' " + "in the package path '%s')" % (ext[0], '; '.join(__path__))) + else: + extramsg = (" (check that the compiled extension '%s' is for " + "the correct Python version; this is Python %s)" % + (filename, sys.version.split()[0])) + raise ImportError, str(e) + extramsg + +# Publish important data by importing them in the package +from support import __version__, error, warning, _getrealframe, _getemulframe +from support import version_info, __version__ as hexversion +from core import full, profile, background, runonly, stop, cannotcompile +from core import log, bind, unbind, proxy, unproxy, dumpcodebuf +from _psyco import setfilter + +try: + from _psyco import compact, compacttype # Python 2.2 and above only +except ImportError: + pass Added: trunk/lib/psyco/__init__.pyo =================================================================== (Binary files differ) Property changes on: trunk/lib/psyco/__init__.pyo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib/psyco/_psyco.pyd =================================================================== (Binary files differ) Property changes on: trunk/lib/psyco/_psyco.pyd ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib/psyco/classes.py =================================================================== --- trunk/lib/psyco/classes.py (rev 0) +++ trunk/lib/psyco/classes.py 2007-06-23 14:41:59 UTC (rev 16) @@ -0,0 +1,53 @@ +########################################################################### +# +# Psyco class support module. +# Copyright (C) 2001-2002 Armin Rigo et.al. + +"""Psyco class support module. + +'psyco.classes.psyobj' is an alternate Psyco-optimized root for classes. +Any class inheriting from it or using the metaclass '__metaclass__' might +get optimized specifically for Psyco. It is equivalent to call +psyco.bind() on the class object after its creation. + +Note that this module has no effect with Python version 2.1 or earlier. + +Importing everything from psyco.classes in a module will import the +'__metaclass__' name, so all classes defined after a + + from psyco.classes import * + +will automatically use the Psyco-optimized metaclass. +""" +########################################################################### + +__all__ = ['psyobj', 'psymetaclass', '__metaclass__'] + + +# Python version check +try: + from _psyco import compacttype +except ImportError: + class psyobj: # compatilibity + pass + psymetaclass = None +else: + # version >= 2.2 only + + import core + from types import FunctionType + + class psymetaclass(compacttype): + "Psyco-optimized meta-class. Turns all methods into Psyco proxies." + + def __new__(cls, name, bases, dict): + bindlist = dict.get('__psyco__bind__') + if bindlist is None: + bindlist = [key for key, value in dict.items() + if isinstance(value, FunctionType)] + for attr in bindlist: + dict[attr] = core.proxy(dict[attr]) + return super(psymetaclass, cls).__new__(cls, name, bases, dict) + + psyobj = psymetaclass("psyobj", (), {}) +__metaclass__ = psymetaclass Added: trunk/lib/psyco/classes.pyo =================================================================== (Binary files differ) Property changes on: trunk/lib/psyco/classes.pyo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib/psyco/core.py =================================================================== --- trunk/lib/psyco/core.py (rev 0) +++ trunk/lib/psyco/core.py 2007-06-23 14:41:59 UTC (rev 16) @@ -0,0 +1,232 @@ +########################################################################### +# +# Psyco main functions. +# Copyright (C) 2001-2002 Armin Rigo et.al. + +"""Psyco main functions. + +Here are the routines that you can use from your applications. +These are mostly interfaces to the C core, but they depend on +the Python version. + +You can use these functions from the 'psyco' module instead of +'psyco.core', e.g. + + import psyco + psyco.log('/tmp/psyco.log') + psyco.profile() +""" +########################################################################### + +import _psyco +import types, new +from support import * + + +# Default charge profiler values +default_watermark = 0.09 # between 0.0 (0%) and 1.0 (100%) +default_halflife = 0.5 # seconds +default_pollfreq_profile = 20 # Hz +default_pollfreq_background = 100 # Hz -- a maximum for sleep's resolution +default_parentframe = 0.25 # should not be more than 0.5 (50%) + + +def full(memory=None, time=None, memorymax=None, timemax=None): + """Compile as much as possible. + +Typical use is for small scripts performing intensive computations +or string handling.""" + import profiler + if PYTHON_SUPPORT: + p = profiler.FullCompiler() + else: + p = profiler.ActiveProfiler(0.0, 0.5) + p.run(memory, time, memorymax, timemax) + + +def profile(watermark = default_watermark, + halflife = default_halflife, + pollfreq = default_pollfreq_profile, + parentframe = default_parentframe, + memory=None, time=None, memorymax=None, timemax=None): + """Turn on profiling. + +The 'watermark' parameter controls how easily running functions will +be compiled. The smaller the value, the more functions are compiled.""" + import profiler + p = profiler.ActivePassiveProfiler(watermark, halflife, + pollfreq, parentframe) + p.run(memory, time, memorymax, timemax) + + +def background(watermark = default_watermark, + halflife = default_halflife, + pollfreq = default_pollfreq_background, + parentframe = default_parentframe, + memory=None, time=None, memorymax=None, timemax=None): + """Turn on passive profiling. + +This is a very lightweight mode in which only intensively computing +functions can be detected. The smaller the 'watermark', the more functions +are compiled.""" + import profiler + p = profiler.PassiveProfiler(watermark, halflife, pollfreq, parentframe) + p.run(memory, time, memorymax, timemax) + + +def runonly(memory=None, time=None, memorymax=None, timemax=None): + """Nonprofiler. + +XXX check if this is useful and document.""" + if PYTHON_SUPPORT: + import profiler + p = profiler.RunOnly() + p.run(memory, time, memorymax, timemax) + + +def stop(): + """Turn off all automatic compilation. bind() calls remain in effect.""" + import profiler + profiler.go([]) + + +def log(logfile='', mode='w', top=10): + """Enable logging to the given file. + +If the file name is unspecified, a default name is built by appending +a 'log-psyco' extension to the main script name. + +Mode is 'a' to append to a possibly existing file or 'w' to overwrite +an existing file. Note that the log file may grow quickly in 'a' mode.""" + import profiler, logger + if not logfile: + import os + logfile, dummy = os.path.splitext(sys.argv[0]) + if os.path.basename(logfile): + logfile += '.' + logfile += 'log-psyco' + if hasattr(_psyco, 'VERBOSE_LEVEL'): + print >> sys.stderr, 'psyco: logging to', logfile + # logger.current should be a real file object; subtle problems + # will show up if its write() and flush() methods are written + # in Python, as Psyco will invoke them while compiling. + logger.current = open(logfile, mode) + logger.print_charges = top + profiler.logger = logger + logger.writedate('Logging started') + cannotcompile(logger.psycowrite) + _psyco.statwrite(logger=logger.psycowrite) + + +def bind(x, rec=None): + """Enable compilation of the given function, method, or class object. + +If C is a class (or anything with a '__dict__' attribute), bind(C) will +rebind all functions and methods found in C.__dict__ (which means, for +classes, all methods defined in the class but not in its parents). + +The optional second argument specifies the number of recursive +compilation levels: all functions called by func are compiled +up to the given depth of indirection.""" + if isinstance(x, types.MethodType): + x = x.im_func + if isinstance(x, types.FunctionType): + if rec is None: + x.func_code = _psyco.proxycode(x) + else: + x.func_code = _psyco.proxycode(x, rec) + return + if hasattr(x, '__dict__'): + funcs = [o for o in x.__dict__.values() + if isinstance(o, types.MethodType) + or isinstance(o, types.FunctionType)] + if not funcs: + raise error, ("nothing bindable found in %s object" % + type(x).__name__) + for o in funcs: + bind(o, rec) + return + raise TypeError, "cannot bind %s objects" % type(x).__name__ + + +def unbind(x): + """Reverse of bind().""" + if isinstance(x, types.MethodType): + x = x.im_func + if isinstance(x, types.FunctionType): + try: + f = _psyco.unproxycode(x.func_code) + except error: + pass + else: + x.func_code = f.func_code + return + if hasattr(x, '__dict__'): + for o in x.__dict__.values(): + if (isinstance(o, types.MethodType) + or isinstance(o, types.FunctionType)): + unbind(o) + return + raise TypeError, "cannot unbind %s objects" % type(x).__name__ + + +def proxy(x, rec=None): + """Return a Psyco-enabled copy of the function. + +The original function is still available for non-compiled calls. +The optional second argument specifies the number of recursive +compilation levels: all functions called by func are compiled +up to the given depth of indirection.""" + if isinstance(x, types.FunctionType): + if rec is None: + code = _psyco.proxycode(x) + else: + code = _psyco.proxycode(x, rec) + return new.function(code, x.func_globals, x.func_name) + if isinstance(x, types.MethodType): + p = proxy(x.im_func, rec) + return new.instancemethod(p, x.im_self, x.im_class) + raise TypeError, "cannot proxy %s objects" % type(x).__name__ + + +def unproxy(proxy): + """Return a new copy of the original function of method behind a proxy. +The result behaves like the original function in that calling it +does not trigger compilation nor execution of any compiled code.""" + if isinstance(proxy, types.FunctionType): + return _psyco.unproxycode(proxy.func_code) + if isinstance(proxy, types.MethodType): + f = unproxy(proxy.im_func) + return new.instancemethod(f, proxy.im_self, proxy.im_class) + raise TypeError, "%s objects cannot be proxies" % type(proxy).__name__ + + +def cannotcompile(x): + """Instruct Psyco never to compile the given function, method +or code object.""" + if isinstance(x, types.MethodType): + x = x.im_func + if isinstance(x, types.FunctionType): + x = x.func_code + if isinstance(x, types.CodeType): + _psyco.cannotcompile(x) + else: + raise TypeError, "unexpected %s object" % type(x).__name__ + + +def dumpcodebuf(): + """Write in file psyco.dump a copy of the emitted machine code, +provided Psyco was compiled with a non-zero CODE_DUMP. +See py-utils/httpxam.py to examine psyco.dump.""" + if hasattr(_psyco, 'dumpcodebuf'): + _psyco.dumpcodebuf() + + +########################################################################### +# Psyco variables +# error * the error raised by Psyco +# warning * the warning raised by Psyco +# __in_psyco__ * a new built-in variable which is always zero, but which +# Psyco special-cases by returning 1 instead. So +# __in_psyco__ can be used in a function to know if +# that function is being executed by Psyco or not. Added: trunk/lib/psyco/core.pyo =================================================================== (Binary files differ) Property changes on: trunk/lib/psyco/core.pyo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib/psyco/kdictproxy.py =================================================================== --- trunk/lib/psyco/kdictproxy.py (rev 0) +++ trunk/lib/psyco/kdictproxy.py 2007-06-23 14:41:59 UTC (rev 16) @@ -0,0 +1,133 @@ +########################################################################### +# +# Support code for the 'psyco.compact' type. + +from __future__ import generators + +try: + from UserDict import DictMixin +except ImportError: + + # backported from Python 2.3 to Python 2.2 + class DictMixin: + # Mixin defining all dictionary methods for classes that already have + # a minimum dictionary interface including getitem, setitem, delitem, + # and keys. Without knowledge of the subclass constructor, the mixin + # does not define __init__() or copy(). In addition to the four base + # methods, progressively more efficiency comes with defining + # __contains__(), __iter__(), and iteritems(). + + # second level definitions support higher levels + def __iter__(self): + for k in self.keys(): + yield k + def has_key(self, key): + try: + value = self[key] + except KeyError: + return False + return True + def __contains__(self, key): + return self.has_key(key) + + # third level takes advantage of second level definitions + def iteritems(self): + for k in self: + yield (k, self[k]) + def iterkeys(self): + return self.__iter__() + + # fourth level uses definitions from lower levels + def itervalues(self): + for _, v in self.iteritems(): + yield v + def values(self): + return [v for _, v in self.iteritems()] + def items(self): + return list(self.iteritems()) + def clear(self): + for key in self.keys(): + del self[key] + def setdefault(self, key, default): + try: + return self[key] + except KeyError: + self[key] = default + return default + def pop(self, key, *args): + if len(args) > 1: + raise TypeError, "pop expected at most 2 arguments, got "\ + + repr(1 + len(args)) + try: + value = self[key] + except KeyError: + if args: + return args[0] + raise + del self[key] + return value + def popitem(self): + try: + k, v = self.iteritems().next() + except StopIteration: + raise KeyError, 'container is empty' + del self[k] + return (k, v) + def update(self, other): + # Make progressively weaker assumptions about "other" + if hasattr(other, 'iteritems'): # iteritems saves memory and lookups + for k, v in other.iteritems(): + self[k] = v + elif hasattr(other, '__iter__'): # iter saves memory + for k in other: + self[k] = other[k] + else: + for k in other.keys(): + self[k] = other[k] + def get(self, key, default=None): + try: + return self[key] + except KeyError: + return default + def __repr__(self): + return repr(dict(self.iteritems())) + def __cmp__(self, other): + if other is None: + return 1 + if isinstance(other, DictMixin): + other = dict(other.iteritems()) + return cmp(dict(self.iteritems()), other) + def __len__(self): + return len(self.keys()) + +########################################################################### + +from _psyco import compact # Python 2.2 and above only + + +class compactdictproxy(DictMixin): + + def __init__(self, ko): + self._ko = ko # compact object of which 'self' is the dict + + def __getitem__(self, key): + return compact.__getslot__(self._ko, key) + + def __setitem__(self, key, value): + compact.__setslot__(self._ko, key, value) + + def __delitem__(self, key): + compact.__delslot__(self._ko, key) + + def keys(self): + return compact.__members__.__get__(self._ko) + + def clear(self): + keys = self.keys() + keys.reverse() + for key in keys: + del self[key] + + def __repr__(self): + keys = ', '.join(self.keys()) + return '<compactdictproxy object {%s}>' % (keys,) Added: trunk/lib/psyco/kdictproxy.pyo =================================================================== (Binary files differ) Property changes on: trunk/lib/psyco/kdictproxy.pyo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib/psyco/logger.py =================================================================== --- trunk/lib/psyco/logger.py (rev 0) +++ trunk/lib/psyco/logger.py 2007-06-23 14:41:59 UTC (rev 16) @@ -0,0 +1,96 @@ +########################################################################### +# +# Psyco logger. +# Copyright (C) 2001-2002 Armin Rigo et.al. + +"""Psyco logger. + +See log() in core.py. +""" +########################################################################### + + +import _psyco +from time import time, localtime, strftime + + +current = None +print_charges = 10 +dump_delay = 0.2 +dump_last = 0.0 + +def write(s, level): + t = time() + f = t-int(t) + try: + current.write("%s.%02d %-*s%s\n" % ( + strftime("%X", localtime(int(t))), + int(f*100.0), 63-level, s, + "%"*level)) + current.flush() + except (OSError, IOError): + pass + +def psycowrite(s): + t = time() + f = t-int(t) + try: + current.write("%s.%02d %-*s%s\n" % ( + strftime("%X", localtime(int(t))), + int(f*100.0), 60, s.strip(), + "% %")) + current.flush() + except (OSError, IOError): + pass + +##def writelines(lines, level=0): +## if lines: +## t = time() +## f = t-int(t) +## timedesc = strftime("%x %X", localtime(int(t))) +## print >> current, "%s.%03d %-*s %s" % ( +## timedesc, int(f*1000), +## 50-level, lines[0], +## "+"*level) +## timedesc = " " * (len(timedesc)+5) +## for line in lines[1:]: +## print >> current, timedesc, line + +def writememory(): + write("memory usage: %d+ kb" % _psyco.memory(), 1) + +def dumpcharges(): + global dump_last + if print_charges: + t = time() + if not (dump_last <= t < dump_last+dump_delay): + if t <= dump_last+1.5*dump_delay: + dump_last += dump_delay + else: + dump_last = t + #write("%s: charges:" % who, 0) + lst = _psyco.stattop(print_charges) + if lst: + f = t-int(t) + lines = ["%s.%02d ______\n" % ( + strftime("%X", localtime(int(t))), + int(f*100.0))] + i = 1 + for co, charge in lst: + detail = co.co_filename + if len(detail) > 19: + detail = '...' + detail[-17:] + lines.append(" #%-3d |%4.1f %%| %-26s%20s:%d\n" % + (i, charge*100.0, co.co_name, detail, + co.co_firstlineno)) + i += 1 + current.writelines(lines) + current.flush() + +def writefinalstats(): + dumpcharges() + writememory() + writedate("program exit") + +def writedate(msg): + write('%s, %s' % (msg, strftime("%x")), 20) Added: trunk/lib/psyco/logger.pyo =================================================================== (Binary files differ) Property changes on: trunk/lib/psyco/logger.pyo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib/psyco/profiler.py =================================================================== --- trunk/lib/psyco/profiler.py (rev 0) +++ trunk/lib/psyco/profiler.py 2007-06-23 14:41:59 UTC (rev 16) @@ -0,0 +1,388 @@ +########################################################################### +# +# Psyco profiler (Python part). +# Copyright (C) 2001-2002 Armin Rigo et.al. + +"""Psyco profiler (Python part). + +The implementation of the non-time-critical parts of the profiler. +See profile() and full() in core.py for the easy interface. +""" +########################################################################### + +import _psyco +from support import * +import math, time, types, atexit +now = time.time +try: + import thread +except ImportError: + import dummy_thread as thread + + +# current profiler instance +current = None + +# enabled profilers, in order of priority +profilers = [] + +# logger module (when enabled by core.log()) +logger = None + +# a lock for a thread-safe go() +go_lock = thread.allocate_lock() + +def go(stop=0): + # run the highest-priority profiler in 'profilers' + global current + go_lock.acquire() + try: + prev = current + if stop: + del profilers[:] + if prev: + if profilers and profilers[0] is prev: + return # best profiler already running + prev.stop() + current = None + for p in profilers[:]: + if p.start(): + current = p + if logger: # and p is not prev: + logger.write("%s: starting" % p.__class__.__name__, 5) + return + finally: + go_lock.release() + # no profiler is running now + if stop: + if logger: + logger.writefinalstats() + else: + tag2bind() + +atexit.register(go, 1) + + +def buildfncache(globals, cache): + if hasattr(types.IntType, '__dict__'): + clstypes = (types.ClassType, types.TypeType) + else: + clstypes = types.ClassType + for x in globals.values(): + if isinstance(x, types.MethodType): + x = x.im_func + if isinstance(x, types.FunctionType): + cache[x.func_code] = x, '' + elif isinstance(x, clstypes): + for y in x.__dict__.values(): + if isinstance(y, types.MethodType): + y = y.im_func + if isinstance(y, types.FunctionType): + cache[y.func_code] = y, x.__name__ + +# code-to-function mapping (cache) +function_cache = {} + +def trytobind(co, globals, log=1): + try: + f, clsname = function_cache[co] + except KeyError: + buildfncache(globals, function_cache) + try: + f, clsname = function_cache[co] + except KeyError: + if logger: + logger.write('warning: cannot find function %s in %s' % + (co.co_name, globals.get('__name__', '?')), 3) + return # give up + if logger and log: + modulename = globals.get('__name__', '?') + if clsname: + modulename += '.' + clsname + logger.write('bind function: %s.%s' % (modulename, co.co_name), 1) + f.func_code = _psyco.proxycode(f) + + +if PYTHON_SUPPORT: + # the list of code objects that have been tagged + tagged_codes = [] + + def tag(co, globals): + if logger: + try: + f, clsname = function_cache[co] + except KeyError: + buildfncache(globals, function_cache) + try: + f, clsname = function_cache[co] + except KeyError: + clsname = '' # give up + modulename = globals.get('__name__', '?') + if clsname: + modulename += '.' + clsname + logger.write('tag function: %s.%s' % (modulename, co.co_name), 1) + tagged_codes.append((co, globals)) + _psyco.turbo_frame(co) + _psyco.turbo_code(co) + + def tag2bind(): + if tagged_codes: + if logger: + logger.write('profiling stopped, binding %d functions' % + len(tagged_codes), 2) + for co, globals in tagged_codes: + trytobind(co, globals, 0) + function_cache.clear() + del tagged_codes[:] + +else: + # tagging is impossible, always bind + tag = trytobind + def tag2bind(): + pass + + + +class Profiler: + MemoryTimerResolution = 0.103 + + def run(self, memory, time, memorymax, timemax): + self.memory = memory + self.memorymax = memorymax + self.time = time + if timemax is None: + self.endtime = None + else: + self.endtime = now() + timemax + self.alarms = [] + profilers.append(self) + go() + + def start(self): + curmem = _psyco.memory() + memlimits = [] + if self.memorymax is not None: + if curmem >= self.memorymax: + if logger: + logger.writememory() + return self.limitreached('memorymax') + memlimits.append(self.memorymax) + if self.memory is not None: + if self.memory <= 0: + if logger: + logger.writememory() + return self.limitreached('memory') + memlimits.append(curmem + self.memory) + self.memory_at_start = curmem + + curtime = now() + timelimits = [] + if self.endtime is not None: + if curtime >= self.endtime: + return self.limitreached('timemax') + timelimits.append(self.endtime - curtime) + if self.time is not None: + if self.time <= 0.0: + return self.limitreached('time') + timelimits.append(self.time) + self.time_at_start = curtime + + try: + self.do_start() + except error, e: + if logger: + logger.write('%s: disabled by psyco.error:' % ( + self.__class__.__name__), 4) + logger.write(' %s' % str(e), 3) + return 0 + + if memlimits: + self.memlimits_args = (time.sleep, (self.MemoryTimerResolution,), + self.check_memory, (min(memlimits),)) + self.alarms.append(_psyco.alarm(*self.memlimits_args)) + if timelimits: + self.alarms.append(_psyco.alarm(time.sleep, (min(timelimits),), + self.time_out)) + return 1 + + def stop(self): + for alarm in self.alarms: + alarm.stop(0) + for alarm in self.alarms: + alarm.stop(1) # wait for parallel threads to stop + del self.alarms[:] + if self.time is not None: + self.time -= now() - self.time_at_start + if self.memory is not None: + self.memory -= _psyco.memory() - self.memory_at_start + + try: + self.do_stop() + except error: + return 0 + return 1 + + def check_memory(self, limit): + if _psyco.memory() < limit: + return self.memlimits_args + go() + + def time_out(self): + self.time = 0.0 + go() + + def limitreached(self, limitname): + try: + profilers.remove(self) + except ValueError: + pass + if logger: + logger.write('%s: disabled (%s limit reached)' % ( + self.__class__.__name__, limitname), 4) + return 0 + + +class FullCompiler(Profiler): + + def do_start(self): + _psyco.profiling('f') + + def do_stop(self): + _psyco.profiling('.') + + +class RunOnly(Profiler): + + def do_start(self): + _psyco.profiling('n') + + def do_stop(self): + _psyco.profiling('.') + + +class ChargeProfiler(Profiler): + + def __init__(self, watermark, parentframe): + self.watermark = watermark + self.parent2 = parentframe * 2.0 + self.lock = thread.allocate_lock() + + def init_charges(self): + _psyco.statwrite(watermark = self.watermark, + parent2 = self.parent2) + + def do_stop(self): + _psyco.profiling('.') + _psyco.statwrite(callback = None) + + +class ActiveProfiler(ChargeProfiler): + + def active_start(self): + _psyco.profiling('p') + + def do_start(self): + self.init_charges() + self.active_start() + _psyco.statwrite(callback = self.charge_callback) + + def charge_callback(self, frame, charge): + tag(frame.f_code, frame.f_globals) + + +class PassiveProfiler(ChargeProfiler): + + initial_charge_unit = _psyco.statread('unit') + reset_stats_after = 120 # half-lives (maximum 200!) + reset_limit = initial_charge_unit * (2.0 ** reset_stats_after) + + def __init__(self, watermark, halflife, pollfreq, parentframe): + ChargeProfiler.__init__(self, watermark, parentframe) + self.pollfreq = pollfreq + # self.progress is slightly more than 1.0, and computed so that + # do_profile() will double the change_unit every 'halflife' seconds. + self.progress = 2.0 ** (1.0 / (halflife * pollfreq)) + + def reset(self): + _psyco.statwrite(unit = self.initial_charge_unit, callback = None) + _psyco.statreset() + if logger: + logger.write("%s: resetting stats" % self.__class__.__name__, 1) + + def passive_start(self): + self.passivealarm_args = (time.sleep, (1.0 / self.pollfreq,), + self.do_profile) + self.alarms.append(_psyco.alarm(*self.passivealarm_args)) + + def do_start(self): + tag2bind() + self.init_charges() + self.passive_start() + + def do_profile(self): + _psyco.statcollect() + if logger: + logger.dumpcharges() + nunit = _psyco.statread('unit') * self.progress + if nunit > self.reset_limit: + self.reset() + else: + _psyco.statwrite(unit = nunit, callback = self.charge_callback) + return self.passivealarm_args + + def charge_callback(self, frame, charge): + trytobind(frame.f_code, frame.f_globals) + + +class ActivePassiveProfiler(PassiveProfiler, ActiveProfiler): + + def do_start(self): + self.init_charges() + self.active_start() + self.passive_start() + + def charge_callback(self, frame, charge): + tag(frame.f_code, frame.f_globals) + + + +# +# we register our own version of sys.settrace(), sys.setprofile() +# and thread.start_new_thread(). +# + +def psyco_settrace(*args, **kw): + "This is the Psyco-aware version of sys.settrace()." + result = original_settrace(*args, **kw) + go() + return result + +def psyco_setprofile(*args, **kw): + "This is the Psyco-aware version of sys.setprofile()." + result = original_setprofile(*args, **kw) + go() + return result + +def psyco_thread_stub(callable, args, kw): + _psyco.statcollect() + if kw is None: + return callable(*args) + else: + return callable(*args, **kw) + +def psyco_start_new_thread(callable, args, kw=None): + "This is the Psyco-aware version of thread.start_new_thread()." + return original_start_new_thread(psyco_thread_stub, (callable, args, kw)) + +original_settrace = sys.settrace +original_setprofile = sys.setprofile +original_start_new_thread = thread.start_new_thread +sys.settrace = psyco_settrace +sys.setprofile = psyco_setprofile +if PYTHON_SUPPORT: + thread.start_new_thread = psyco_start_new_thread + # hack to patch threading._start_new_thread if the module is + # already loaded + if (sys.modules.has_key('threading') and + hasattr(sys.modules['threading'], '_start_new_thread')): + sys.modules['threading']._start_new_thread = psyco_start_new_thread Added: trunk/lib/psyco/profiler.pyo =================================================================== (Binary files differ) Property changes on: trunk/lib/psyco/profiler.pyo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib/psyco/support.py =================================================================== --- trunk/lib/psyco/support.py (rev 0) +++ trunk/lib/psyco/support.py 2007-06-23 14:41:59 UTC (rev 16) @@ -0,0 +1,196 @@ +########################################################################### +# +# Psyco general support module. +# Copyright (C) 2001-2002 Armin Rigo et.al. + +"""Psyco general support module. + +For internal use. +""" +########################################################################### + +import sys, _psyco, __builtin__ + +error = _psyco.error +class warning(Warning): + pass + +_psyco.NoLocalsWarning = warning + +def warn(msg): + from warnings import warn + warn(msg, warning, stacklevel=2) + +# +# Version checks +# +__version__ = 0x010502f0 +if _psyco.PSYVER != __version__: + raise error, "version mismatch between Psyco parts, reinstall it" + +version_info = (__version__ >> 24, + (__version__ >> 16) & 0xff, + (__version__ >> 8) & 0xff, + {0xa0: 'alpha', + 0xb0: 'beta', + 0xc0: 'candidate', + 0xf0: 'final'}[__version__ & 0xf0], + __version__ & 0xf) + + +VERSION_LIMITS = [0x02010000, # 2.1 + 0x02020000, # 2.2 + 0x02020200, # 2.2.2 + 0x02030000, # 2.3 + 0x02040000] # 2.4 + +if ([v for v in VERSION_LIMITS if v <= sys.hexversion] != + [v for v in VERSION_LIMITS if v <= _psyco.PYVER ]): + if sys.hexversion < VERSION_LIMITS[0]: + warn("Psyco requires Python version 2.1 or later") + else: + warn("Psyco version does not match Python version. " + "Psyco must be updated or recompiled") + +PYTHON_SUPPORT = hasattr(_psyco, 'turbo_code') + + +if hasattr(_psyco, 'ALL_CHECKS') and hasattr(_psyco, 'VERBOSE_LEVEL'): + print >> sys.stderr, ('psyco: running in debugging mode on %s' % + _psyco.PROCESSOR) + + +########################################################################### +# sys._getframe() gives strange results on a mixed Psyco- and Python-style +# stack frame. Psyco provides a replacement that partially emulates Python +# frames from Psyco frames. The new sys._getframe() may return objects of +# a custom "Psyco frame" type, which with Python >=2.2 is a subtype of the +# normal frame type. +# +# The same problems require some other built-in functions to be replaced +# as well. Note that the local variables are not available in any +# dictionary with Psyco. + + +class Frame: + pass + + +class PythonFrame(Frame): + + def __init__(self, frame): + self.__dict__.update({ + '_frame': frame, + }) + + def __getattr__(self, attr): + if attr == 'f_back': + try: + result = embedframe(_psyco.getframe(self._frame)) + except ValueError: + result = None + except error: + warn("f_back is skipping dead Psyco frames") + result = self._frame.f_back + self.__dict__['f_back'] = result + return result + else: + return getattr(self._frame, attr) + + def __setattr__(self, attr, value): + setattr(self._frame, attr, value) + + def __delattr__(self, attr): + delattr(self._frame, attr) + + +class PsycoFrame(Frame): + + def __init__(self, tag): + self.__dict__.update({ + '_tag' : tag, + 'f_code' : tag[0], + 'f_globals': tag[1], + }) + + def __getattr__(self, attr): + if attr == 'f_back': + try: + result = embedframe(_psyco.getframe(self._tag)) + except ValueError: + result = None + elif attr == 'f_lineno': + result = self.f_code.co_firstlineno # better than nothing + elif attr == 'f_builtins': + result = self.f_globals['__builtins__'] + elif attr == 'f_restricted': + result = self.f_builtins is not __builtins__ + elif attr == 'f_locals': + raise AttributeError, ("local variables of functions run by Psyco " + "cannot be accessed in any way, sorry") + else: + raise AttributeError, ("emulated Psyco frames have " + "no '%s' attribute" % attr) + self.__dict__[attr] = result + return result + + def __setattr__(self, attr, value): + raise AttributeError, "Psyco frame objects are read-only" + + def __delattr__(self, attr): + if attr == 'f_trace': + # for bdb which relies on CPython frames exhibiting a slightly + # buggy behavior: you can 'del f.f_trace' as often as you like + # even without having set it previously. + return + raise AttributeError, "Psyco frame objects are read-only" + + +def embedframe(result): + if type(result) is type(()): + return PsycoFrame(result) + else: + return PythonFrame(result) + +def _getframe(depth=0): + """Return a frame object from the call stack. This is a replacement for +sys._getframe() which is aware of Psyco frames. + +The returned objects are instances of either PythonFrame or PsycoFrame +instead of being real Python-level frame object, so that they can emulate +the common attributes of frame objects. + +The original sys._getframe() ignoring Psyco frames altogether is stored in +psyco._getrealframe(). See also psyco._getemulframe().""" + # 'depth+1' to account for this _getframe() Python function + return embedframe(_psyco.getframe(depth+1)) + +def _getemulframe(depth=0): + """As _getframe(), but the returned objects are real Python frame objects +emulating Psyco frames. Some of their attributes can be wrong or missing, +however.""" + # 'depth+1' to account for this _getemulframe() Python function + return _psyco.getframe(depth+1, 1) + +def patch(name, module=__builtin__): + f = getattr(_psyco, name) + org = getattr(module, name) + if org is not f: + setattr(module, name, f) + setattr(_psyco, 'original_' + name, org) + +_getrealframe = sys._getframe +sys._getframe = _getframe +patch('globals') +patch('eval') +patch('execfile') +patch('locals') +patch('vars') +patch('dir') +patch('input') +_psyco.original_raw_input = raw_input +__builtin__.__in_psyco__ = 0==1 # False + +if hasattr(_psyco, 'compact'): + import kdictproxy + _psyco.compactdictproxy = kdictproxy.compactdictproxy Added: trunk/lib/psyco/support.pyo =================================================================== (Binary files differ) Property changes on: trunk/lib/psyco/support.pyo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/lib/ror/starter.py =================================================================== --- trunk/lib/ror/starter.py 2007-06-23 11:34:40 UTC (rev 15) +++ trunk/lib/ror/starter.py 2007-06-23 14:41:59 UTC (rev 16) @@ -127,6 +127,6 @@ myFrame = SettingsDialog(None, -1, "") MainApp.SetTopWindow(myFrame) - myFrame.Show() - - MainApp.MainLoop() \ No newline at end of file + myFrame.Show() + + MainApp.MainLoop() Modified: trunk/lib/wxogre/wxOgreWindow.py =================================================================== --- trunk/lib/wxogre/wxOgreWindow.py 2007-06-23 11:34:40 UTC (rev 15) +++ trunk/lib/wxogre/wxOgreWindow.py 2007-06-23 14:41:59 UTC (rev 16) @@ -3,12 +3,14 @@ import ogre.renderer.OGRE as ogre from wxogre.OgreManager import * -class Struct: - "simple dummy class to regroup scene entities in a single parameter" - pass - class wxOgreWindow(wx.PyWindow): def __init__(self, parent, ID, size = wx.Size(200,200), **kwargs): + """ + @param parent: The parent wx Window + @param size: the minimal window size + @param kwargs: any other wx arguments + @return: none + """ wx.PyWindow.__init__(self, parent, ID, size = size, **kwargs) self.parent = parent @@ -29,25 +31,55 @@ self.SetFocus() def _OnSize(self, event): + """ + Is called when the ogre Window is getting resized + @param event: the sizing event + @return: none + """ if getattr(self, 'ogreRoot', None): self.renderWindow.windowMovedOrResized() event.Skip() def _OnEraseBackground(self, event): + """ + overwrite standart background drawing routing with empty one + @param event: the draw event + @return: none + """ # Do nothing, to avoid flashing on MSW. pass def _OnCloseWindow(self, event): + """ + called when the ogre window gets closed + @param event: the closing event + @return: none + """ self.Destroy() def AcceptsFocus(self): + """ + this window may accept keyboard focus + """ return True def SceneInitialisation(self): + """ + default, base function, that has to be overwritten in the inherited class. It gets called after create the window, and should select a scenemanger. + @return: none + """ pass def OnFrameStarted(self): + """ + default, base function, that has to be overwritten in the inherited class. gets called before rendering a frame. + @return: none + """ return def OnFrameEnded(self): + """ + default, base function, that has to be overwritten in the inherited class. gets called after rendering a frame. + @return: none + """ return Modified: trunk/ogre.cfg =================================================================== --- trunk/ogre.cfg 2007-06-23 11:34:40 UTC (rev 15) +++ trunk/ogre.cfg 2007-06-23 14:41:59 UTC (rev 16) @@ -1,4 +1,4 @@ -Render System=Direct3D9 Rendering Subsystem +Render System=OpenGL Rendering Subsystem [OpenGL Rendering Subsystem] Colour Depth=32 Modified: trunk/rortoolkit.py =================================================================== --- trunk/rortoolkit.py 2007-06-23 11:34:40 UTC (rev 15) +++ trunk/rortoolkit.py 2007-06-23 14:41:59 UTC (rev 16) @@ -1,7 +1,25 @@ #Thomas Fischer 31/05/2007, th...@th... import sys, os, os.path -if __name__=="__main__": +def main(): + """ + main method + """ + sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "lib")) + + # Import Psyco if available + try: + import psyco + psyco.full() + #psyco.log() + #psyco.profile() + except ImportError: + pass + import ror.starter ror.starter.startApp() + + +if __name__=="__main__": + main() \ No newline at end of file Modified: trunk/terraineditor.py =================================================================== --- trunk/terraineditor.py 2007-06-23 11:34:40 UTC (rev 15) +++ trunk/terraineditor.py 2007-06-23 14:41:59 UTC (rev 16) @@ -1,17 +1,23 @@ #Thomas Fischer 31/05/2007, th...@th... import sys, os, os.path -if __name__=="__main__": +def main(): + """ + main method + """ + + sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "lib")) + # Import Psyco if available try: import psyco psyco.full() - #psyco.log() - #psyco.profile() except ImportError: pass - sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "lib")) import rorterraineditor.MainFrame rorterraineditor.MainFrame.startApp() + +if __name__=="__main__": + main() \ No newline at end of file Modified: trunk/truckeditor.py =================================================================== --- trunk/truckeditor.py 2007-06-23 11:34:40 UTC (rev 15) +++ trunk/truckeditor.py 2007-06-23 14:41:59 UTC (rev 16) @@ -1,7 +1,23 @@ #Thomas Fischer 31/05/2007, th...@th... import sys, os, os.path -if __name__=="__main__": +def main(): + """ + main method + """ + sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "lib")) + + # Import Psyco if available + try: + import psyco + psyco.full() + except ImportError: + pass + import rortruckeditor.MainFrame rortruckeditor.MainFrame.startApp() + + +if __name__=="__main__": + main() \ 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: <ror...@us...> - 2007-06-23 11:34:41
|
Revision: 15 http://roreditor.svn.sourceforge.net/roreditor/?rev=15&view=rev Author: rorthomas Date: 2007-06-23 04:34:40 -0700 (Sat, 23 Jun 2007) Log Message: ----------- updated bugrepot Modified Paths: -------------- trunk/lib/ror/bugreport.py Modified: trunk/lib/ror/bugreport.py =================================================================== --- trunk/lib/ror/bugreport.py 2007-06-23 11:34:18 UTC (rev 14) +++ trunk/lib/ror/bugreport.py 2007-06-23 11:34:40 UTC (rev 15) @@ -13,6 +13,17 @@ self.filename = "readme.txt" self.LoadHelp() + def generateSsysinfo(self): + import platform + txt = "" + txt += ", ".join(platform.uname()) + "\n" + txt += ", ".join(platform.architecture()) + "\n" + txt += ", ".join(platform.platform()) + "\n" + txt += ", ".join(platform.version()) + "\n" + txt += ", ".join(platform.python_build()) + "\n" + txt += ", ".join(platform.python_version()) + "\n" + + def LoadHelp(self): if os.path.isfile(self.filename): self.TextCtrl.LoadFile(self.filename) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-06-23 11:34:19
|
Revision: 14 http://roreditor.svn.sourceforge.net/roreditor/?rev=14&view=rev Author: rorthomas Date: 2007-06-23 04:34:18 -0700 (Sat, 23 Jun 2007) Log Message: ----------- * added basic bugreport dialog (not working yet) Added Paths: ----------- trunk/lib/ror/bugreport.py Added: trunk/lib/ror/bugreport.py =================================================================== --- trunk/lib/ror/bugreport.py (rev 0) +++ trunk/lib/ror/bugreport.py 2007-06-23 11:34:18 UTC (rev 14) @@ -0,0 +1,41 @@ +import wx, os, os.path + +class BugReportFrame(wx.Frame): + def __init__(self, *args, **kwds): + kwds["style"] = wx.CLOSE_BOX | wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX | wx.RESIZE_BORDER | wx.SYSTEM_MENU | wx.CAPTION | wx.CLIP_CHILDREN + wx.Frame.__init__(self, *args, **kwds) + self.TextCtrl = wx.TextCtrl(self, wx.ID_ANY, style=wx.TE_RICH2|wx.TE_AUTO_URL|wx.TE_MULTILINE|wx.TE_READONLY,size=wx.Size(500,400)) + self.btnSubmit = wx.Button(self, wx.ID_ANY, "Submit") + self.btnCancel = wx.Button(self, wx.ID_ANY, "Cancel") + self.Bind(wx.EVT_BUTTON, self.onSubmit, self.btnSubmit) + self.Bind(wx.EVT_BUTTON, self.onExit, self.btnCancel) + self.__do_layout() + self.filename = "readme.txt" + self.LoadHelp() + + def LoadHelp(self): + if os.path.isfile(self.filename): + self.TextCtrl.LoadFile(self.filename) + + def onSubmit(self, event=None): + self.Close() + + def onExit(self, event=None): + self.Close() + + def __do_layout(self): + sizer_main = wx.BoxSizer(wx.VERTICAL) + sizer_2 = wx.BoxSizer(wx.HORIZONTAL) + sizer_2.Add(self.TextCtrl, -1, wx.EXPAND, 0) + sizer_main.Add(sizer_2, -1, wx.EXPAND, 0) + sizer_main.Add(self.btnExit, 0, wx.EXPAND, 0) + + self.SetAutoLayout(True) + self.SetSizer(sizer_main) + sizer_main.Fit(self) + sizer_main.SetSizeHints(self) + self.Layout() + +def showBugReportFrame(): + myFrame = BugReportFrame(None, wx.ID_ANY, "BugReport") + myFrame.Show() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-06-23 00:37:37
|
Revision: 13 http://roreditor.svn.sourceforge.net/roreditor/?rev=13&view=rev Author: rorthomas Date: 2007-06-22 17:37:32 -0700 (Fri, 22 Jun 2007) Log Message: ----------- removed keycode debug logging Modified Paths: -------------- trunk/lib/rortruckeditor/RoRTruckOgreWindow.py Modified: trunk/lib/rortruckeditor/RoRTruckOgreWindow.py =================================================================== --- trunk/lib/rortruckeditor/RoRTruckOgreWindow.py 2007-06-22 23:53:11 UTC (rev 12) +++ trunk/lib/rortruckeditor/RoRTruckOgreWindow.py 2007-06-23 00:37:32 UTC (rev 13) @@ -665,7 +665,7 @@ self.camMode = mode def onKeyDown(self,event): - print event.m_keyCode + #print event.m_keyCode d = 0.05 if event.ShiftDown(): d = 0.5 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-06-22 23:53:12
|
Revision: 12 http://roreditor.svn.sourceforge.net/roreditor/?rev=12&view=rev Author: rorthomas Date: 2007-06-22 16:53:11 -0700 (Fri, 22 Jun 2007) Log Message: ----------- * modified splash image for starter (not shown atm) * modified starter to have 'normal' background * removed deprecated rendersystem argument from terraineditor Modified Paths: -------------- trunk/lib/ror/splash.bmp trunk/lib/ror/starter.py trunk/lib/rorterraineditor/RoRTerrainOgreWindow.py trunk/lib/rorterraineditor/RoRTerrainSelectedObjectOgreWindow.py trunk/lib/rorterraineditor/RoRTerrainSelectedObjectTopOgreWindow.py Modified: trunk/lib/ror/splash.bmp =================================================================== (Binary files differ) Modified: trunk/lib/ror/starter.py =================================================================== --- trunk/lib/ror/starter.py 2007-06-22 23:32:23 UTC (rev 11) +++ trunk/lib/ror/starter.py 2007-06-22 23:53:11 UTC (rev 12) @@ -12,20 +12,22 @@ kwds["style"] = wx.SYSTEM_MENU | wx.CAPTION | wx.CLIP_CHILDREN | wx.CLOSE_BOX wx.Frame.__init__(self, *args, **kwds) - self.lblRoRDir = wx.StaticText(self, wx.ID_ANY, "Please select Rigs of Rods Directory!") - self.btnSelectRoRDir = wx.Button(self, wx.ID_ANY, "Select RoR Directory") + self.panel = wx.Panel(self, wx.ID_ANY) + + self.lblRoRDir = wx.StaticText(self.panel, wx.ID_ANY, "Please select Rigs of Rods Directory!") + self.btnSelectRoRDir = wx.Button(self.panel, wx.ID_ANY, "Select RoR Directory") self.Bind(wx.EVT_BUTTON, self.OnSelectRoRDir, self.btnSelectRoRDir) - self.btnStartRoR = wx.Button(self, wx.ID_ANY, "Start RoR") + self.btnStartRoR = wx.Button(self.panel, wx.ID_ANY, "Start RoR") self.Bind(wx.EVT_BUTTON, self.OnStartRoR, self.btnStartRoR) - self.btnStartTerrainEditor = wx.Button(self, wx.ID_ANY, "Start Terrain Editor") + self.btnStartTerrainEditor = wx.Button(self.panel, wx.ID_ANY, "Start Terrain Editor") self.Bind(wx.EVT_BUTTON, self.OnTerrainEditor, self.btnStartTerrainEditor) - self.btnStartTruckEditor = wx.Button(self, wx.ID_ANY, "Start Truck Editor") + self.btnStartTruckEditor = wx.Button(self.panel, wx.ID_ANY, "Start Truck Editor") self.Bind(wx.EVT_BUTTON, self.OnTruckEditor, self.btnStartTruckEditor) - self.btnExit = wx.Button(self, wx.ID_ANY, "Exit") + self.btnExit = wx.Button(self.panel, wx.ID_ANY, "Exit") self.Bind(wx.EVT_BUTTON, self.OnExit, self.btnExit) self.rordir = getSettings().getRoRDir() @@ -54,7 +56,7 @@ def OnStartRoR(self, event=None): p = Popen(os.path.join(self.rordir, "RoR.exe"), shell=True, cwd=self.rordir) - sts = os.waitpid(p.pid, 0) + #sts = os.waitpid(p.pid, 0) def OnTruckEditor(self, event=None): import rortruckeditor.MainFrame @@ -100,15 +102,19 @@ self.SetTitle("RoR Toolkit starter") def __do_layout(self): + + sizer_panel = wx.BoxSizer(wx.VERTICAL) + sizer_panel.Add(self.lblRoRDir, 0, wx.EXPAND, 0) + sizer_panel.Add(self.btnSelectRoRDir, 0, wx.EXPAND, 0) + sizer_panel.Add(self.btnStartRoR, 0, wx.EXPAND, 0) + sizer_panel.Add(self.btnStartTerrainEditor, 0, wx.EXPAND, 0) + sizer_panel.Add(self.btnStartTruckEditor, 0, wx.EXPAND, 0) + sizer_panel.Add(self.btnExit, 0, wx.EXPAND, 0) + self.panel.SetSizer(sizer_panel) + sizer_main = wx.BoxSizer(wx.VERTICAL) + sizer_main.Add(self.panel, 0, wx.EXPAND, 0) - sizer_main.Add(self.lblRoRDir, 0, wx.EXPAND, 0) - sizer_main.Add(self.btnSelectRoRDir, 0, wx.EXPAND, 0) - sizer_main.Add(self.btnStartRoR, 0, wx.EXPAND, 0) - sizer_main.Add(self.btnStartTerrainEditor, 0, wx.EXPAND, 0) - sizer_main.Add(self.btnStartTruckEditor, 0, wx.EXPAND, 0) - sizer_main.Add(self.btnExit, 0, wx.EXPAND, 0) - self.SetAutoLayout(True) self.SetSizer(sizer_main) sizer_main.Fit(self) Modified: trunk/lib/rorterraineditor/RoRTerrainOgreWindow.py =================================================================== --- trunk/lib/rorterraineditor/RoRTerrainOgreWindow.py 2007-06-22 23:32:23 UTC (rev 11) +++ trunk/lib/rorterraineditor/RoRTerrainOgreWindow.py 2007-06-22 23:53:11 UTC (rev 12) @@ -12,7 +12,7 @@ #myObjects = {} myODefs = {} - def __init__(self, parent, ID, size = wx.Size(200,200), renderSystem = "OpenGL", rordir = "", **kwargs): + def __init__(self, parent, ID, size = wx.Size(200,200), rordir = "", **kwargs): self.rordir = rordir self.rand = str(random()) self.TerrainLoaded = False @@ -20,7 +20,6 @@ self.rand = str(random()) self.parent = parent self.size = size - self.renderSystem =renderSystem self.kwargs = kwargs self.ID = ID self.mSelected = None @@ -28,7 +27,7 @@ self.myODefs = {} self.trucks = {} self.meshes = {} - wxOgreWindow.__init__(self, self.parent, self.ID, size = self.size, renderSystem = self.renderSystem, **self.kwargs) + wxOgreWindow.__init__(self, self.parent, self.ID, size = self.size, **self.kwargs) def OnFrameStarted(self): self.cameraLandCollision() Modified: trunk/lib/rorterraineditor/RoRTerrainSelectedObjectOgreWindow.py =================================================================== --- trunk/lib/rorterraineditor/RoRTerrainSelectedObjectOgreWindow.py 2007-06-22 23:32:23 UTC (rev 11) +++ trunk/lib/rorterraineditor/RoRTerrainSelectedObjectOgreWindow.py 2007-06-22 23:53:11 UTC (rev 12) @@ -8,11 +8,11 @@ from random import random class RoRTerrainSelectedObjectOgreWindow(wxOgreWindow): - def __init__(self, parent, ID, RoRTerrainOgreWindow, size = wx.Size(200,200), renderSystem = "OpenGL", **kwargs): + def __init__(self, parent, ID, RoRTerrainOgreWindow, size = wx.Size(200,200), **kwargs): self.sceneManager = RoRTerrainOgreWindow.sceneManager self.mainWindow = RoRTerrainOgreWindow self.rand = str(random()) - wxOgreWindow.__init__(self, parent, ID, size = size, renderSystem = renderSystem, **kwargs) + wxOgreWindow.__init__(self, parent, ID, size = size, **kwargs) self.parent = parent self.camalpha = 0 self.radius = 40 Modified: trunk/lib/rorterraineditor/RoRTerrainSelectedObjectTopOgreWindow.py =================================================================== --- trunk/lib/rorterraineditor/RoRTerrainSelectedObjectTopOgreWindow.py 2007-06-22 23:32:23 UTC (rev 11) +++ trunk/lib/rorterraineditor/RoRTerrainSelectedObjectTopOgreWindow.py 2007-06-22 23:53:11 UTC (rev 12) @@ -8,11 +8,11 @@ from random import random class RoRTerrainSelectedObjectTopOgreWindow(wxOgreWindow): - def __init__(self, parent, ID, RoRTerrainOgreWindow, size = wx.Size(200,200), renderSystem = "OpenGL", **kwargs): + def __init__(self, parent, ID, RoRTerrainOgreWindow, size = wx.Size(200,200), **kwargs): self.sceneManager = RoRTerrainOgreWindow.sceneManager self.mainWindow = RoRTerrainOgreWindow self.rand = str(random()) - wxOgreWindow.__init__(self, parent, ID, size = size, renderSystem = renderSystem, **kwargs) + wxOgreWindow.__init__(self, parent, ID, size = size, **kwargs) self.parent = parent self.distance = 50 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ror...@us...> - 2007-06-22 23:32:28
|
Revision: 11 http://roreditor.svn.sourceforge.net/roreditor/?rev=11&view=rev Author: rorthomas Date: 2007-06-22 16:32:23 -0700 (Fri, 22 Jun 2007) Log Message: ----------- * added original code by pricorde * removed visualwx stuff - too buggy * modified starter to use manual created gui * removed editor cfg, so you must select your ror dir first Modified Paths: -------------- trunk/lib/ror/starter.py trunk/rortoolkit.py Added Paths: ----------- trunk/devtools/originalcode/ trunk/devtools/originalcode/FlexMesh.h trunk/devtools/originalcode/FlexObj.h trunk/devtools/originalcode/random snippets.h Removed Paths: ------------- trunk/devtools/RoRSettingsDialog/ trunk/lib/ror/editor.cfg trunk/lib/ror/settingsdialog.py Added: trunk/devtools/originalcode/FlexMesh.h =================================================================== --- trunk/devtools/originalcode/FlexMesh.h (rev 0) +++ trunk/devtools/originalcode/FlexMesh.h 2007-06-22 23:32:23 UTC (rev 11) @@ -0,0 +1,400 @@ +#ifndef __FlexMesh_H__ +#define __FlexMesh_H__ + +//wheels only! + +#include "Ogre.h" +//#include "Beam.h" + +using namespace Ogre; + + +//class Beam; + +class FlexMesh +{ +private: +typedef struct +{ + Vector3 vertex; + Vector3 normal; +// Vector3 color; + Vector2 texcoord; +} CoVertice_t; + +typedef struct +{ + Vector3 vertex; +} posVertice_t; + +typedef struct +{ + Vector3 normal; +// Vector3 color; + Vector2 texcoord; +} norVertice_t; + + Ogre::MeshPtr msh; + SubMesh* subface; + SubMesh* subband; + VertexDeclaration* decl; + HardwareVertexBufferSharedPtr vbuf; + + size_t nVertices; + size_t vbufCount; + //shadow + union + { + float *shadowposvertices; + posVertice_t *coshadowposvertices; + }; + union + { + float *shadownorvertices; + norVertice_t *coshadownorvertices; + }; + union + { + float *vertices; + CoVertice_t *covertices; + }; + //nodes + int *nodeIDs; + + size_t ibufCount; + unsigned short *facefaces; + unsigned short *bandfaces; + node_t *nodes; + int nbrays; + SceneManager *smanager; + +public: + + + FlexMesh(SceneManager *manager, char* name, node_t *nds, int n1, int n2, int nstart, int nrays, char* texface, char* texband) + { + smanager=manager; + nbrays=nrays; + nodes=nds; + /// Create the mesh via the MeshManager + msh = MeshManager::getSingleton().createManual(name, "General"); + + /// Create submeshes + subface = msh->createSubMesh(); + subband = msh->createSubMesh(); + + //materials + subface->setMaterialName(texface); + subband->setMaterialName(texband); + + /// Define the vertices (8 vertices, each consisting of 3 groups of 3 floats + nVertices = 4*nrays+2; + vbufCount = (2*3+2)*nVertices; + vertices=(float*)malloc(vbufCount*sizeof(float)); + //shadow + shadownorvertices=(float*)malloc(nVertices*(3+2)*sizeof(float)); + shadowposvertices=(float*)malloc(nVertices*3*2*sizeof(float)); + nodeIDs=(int*)malloc(nVertices*sizeof(int)); + + //define node ids + nodeIDs[0]=n1; + nodeIDs[1]=n2; + int i; + for (i=0; i<nrays; i++) + { + nodeIDs[2+i*2]=nstart+i*2; + nodeIDs[2+i*2+1]=nstart+i*2+1; + nodeIDs[2+2*nrays+i*2]=nstart+i*2; + nodeIDs[2+2*nrays+i*2+1]=nstart+i*2+1; + } + //color fix to remove +// for (i=0; i<(int)nVertices; i++) +// { +// covertices[i].color=Vector3(0.0, 0.0, 0.0); +// }; + //textures coordinates + covertices[0].texcoord=Vector2(0.5, 0.5); + covertices[1].texcoord=Vector2(0.5, 0.5); + for (i=0; i<nrays; i++) + { + //face + covertices[2+i*2].texcoord=Vector2(0.5+0.5*sin(i*2.0*3.14159/nrays), 0.5+0.5*cos(i*2.0*3.14159/nrays)); + covertices[2+i*2+1].texcoord=covertices[2+i*2].texcoord; + //band + covertices[2+2*nrays+(i/2)*4].texcoord=Vector2(0.0, 0.0); + covertices[2+2*nrays+(i/2)*4+1].texcoord=Vector2(0.0, 1.0); + covertices[2+2*nrays+(i/2)*4+2].texcoord=Vector2(1.0, 0.0); + covertices[2+2*nrays+(i/2)*4+3].texcoord=Vector2(1.0, 1.0); + } + + /// Define triangles + /// The values in this table refer to vertices in the above table + ibufCount = 3*2*nrays; + facefaces=(unsigned short*)malloc(ibufCount*sizeof(unsigned short)); + bandfaces=(unsigned short*)malloc(ibufCount*sizeof(unsigned short)); + for (i=0; i<nrays; i++) + { + //wheel sides + facefaces[3*(i*2)]=0; facefaces[3*(i*2)+1]=2+i*2; facefaces[3*(i*2)+2]=2+((i+1)%nrays)*2; + facefaces[3*(i*2+1)]=1; facefaces[3*(i*2+1)+2]=2+i*2+1; facefaces[3*(i*2+1)+1]=2+((i+1)%nrays)*2+1; + //wheel band + bandfaces[3*(i*2)]=2+2*nrays+i*2; bandfaces[3*(i*2)+1]=2+2*nrays+i*2+1; bandfaces[3*(i*2)+2]=2+2*nrays+((i+1)%nrays)*2+1; + bandfaces[3*(i*2+1)]=2+2*nrays+((i+1)%nrays)*2+1; bandfaces[3*(i*2+1)+2]=2+2*nrays+i*2; bandfaces[3*(i*2+1)+1]=2+2*nrays+((i+1)%nrays)*2; + } + + //update coords + updateVertices(); + + + + /// Create vertex data structure for 8 vertices shared between submeshes + msh->sharedVertexData = new VertexData(); + msh->sharedVertexData->vertexCount = nVertices; + + /// Create declaration (memory format) of vertex data + decl = msh->sharedVertexData->vertexDeclaration; + size_t offset = 0; + decl->addElement(0, offset, VET_FLOAT3, VES_POSITION); + offset += VertexElement::getTypeSize(VET_FLOAT3); + decl->addElement(0, offset, VET_FLOAT3, VES_NORMAL); + offset += VertexElement::getTypeSize(VET_FLOAT3); +// decl->addElement(0, offset, VET_FLOAT3, VES_DIFFUSE); +// offset += VertexElement::getTypeSize(VET_FLOAT3); + decl->addElement(0, offset, VET_FLOAT2, VES_TEXTURE_COORDINATES, 0); + offset += VertexElement::getTypeSize(VET_FLOAT2); + + /// Allocate vertex buffer of the requested number of vertices (vertexCount) + /// and bytes per vertex (offset) + vbuf = + HardwareBufferManager::getSingleton().createVertexBuffer( + offset, msh->sharedVertexData->vertexCount, HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE); + + /// Upload the vertex data to the card + vbuf->writeData(0, vbuf->getSizeInBytes(), vertices, true); + + /// Set vertex buffer binding so buffer 0 is bound to our vertex buffer + VertexBufferBinding* bind = msh->sharedVertexData->vertexBufferBinding; + bind->setBinding(0, vbuf); + + //for the face + /// Allocate index buffer of the requested number of vertices (ibufCount) + HardwareIndexBufferSharedPtr faceibuf = HardwareBufferManager::getSingleton(). + createIndexBuffer( + HardwareIndexBuffer::IT_16BIT, + ibufCount, + HardwareBuffer::HBU_STATIC_WRITE_ONLY); + + /// Upload the index data to the card + faceibuf->writeData(0, faceibuf->getSizeInBytes(), facefaces, true); + + /// Set parameters of the submesh + subface->useSharedVertices = true; + subface->indexData->indexBuffer = faceibuf; + subface->indexData->indexCount = ibufCount; + subface->indexData->indexStart = 0; + + //for the band + /// Allocate index buffer of the requested number of vertices (ibufCount) + HardwareIndexBufferSharedPtr bandibuf = HardwareBufferManager::getSingleton(). + createIndexBuffer( + HardwareIndexBuffer::IT_16BIT, + ibufCount, + HardwareBuffer::HBU_STATIC_WRITE_ONLY); + + /// Upload the index data to the card + bandibuf->writeData(0, bandibuf->getSizeInBytes(), bandfaces, true); + + /// Set parameters of the submesh + subband->useSharedVertices = true; + subband->indexData->indexBuffer = bandibuf; + subband->indexData->indexCount = ibufCount; + subband->indexData->indexStart = 0; + + /// Set bounding information (for culling) + msh->_setBounds(AxisAlignedBox(-1,-1,0,1,1,0)); + msh->_setBoundingSphereRadius(Math::Sqrt(1*1+1*1)); + + /// Notify Mesh object that it has been loaded +msh->buildEdgeList(); +//msh->buildTangentVectors(); +/*unsigned short src, dest; +if (!msh->suggestTangentVectorBuildParams(src, dest)) +{ + msh->buildTangentVectors(src, dest); +} +*/ + +msh->load(); +//msh->touch(); +// msh->load(); + + //msh->buildEdgeList(); + } + + +Vector3 updateVertices() +{ + int i; + Vector3 center; + center=(nodes[nodeIDs[0]].Position+nodes[nodeIDs[1]].Position)/2.0; + //optimization possible here : just copy bands on face + covertices[0].vertex=nodes[nodeIDs[0]].Position-center; + //normals + covertices[0].normal=nodes[nodeIDs[0]].Position-nodes[nodeIDs[1]].Position; + covertices[0].normal.normalise(); + + covertices[1].vertex=nodes[nodeIDs[1]].Position-center; + //normals + covertices[1].normal=-covertices[0].normal; +// covertices[1].normal.normalise(); + for (i=0; i<nbrays*2; i++) + { + covertices[2+i].vertex=nodes[nodeIDs[2+i]].Position-center; + //normals + if ((i%2)==0) + { + covertices[2+i].normal=nodes[nodeIDs[2+i]].Position-nodes[nodeIDs[2+i+1]].Position; + covertices[2+i].normal.normalise(); + } else covertices[2+i].normal=-covertices[2+i-1].normal; + //bands + covertices[2+2*nbrays+i].vertex=covertices[2+i].vertex; + covertices[2+2*nbrays+i].normal=covertices[2+i].vertex; + covertices[2+2*nbrays+i].normal.normalise(); + } + return center; +} + + +Vector3 updateShadowVertices() +{ + int i; + Vector3 center; +//msh->buildEdgeList(); + center=(nodes[nodeIDs[0]].Position+nodes[nodeIDs[1]].Position)/2.0; + + coshadowposvertices[0].vertex=nodes[nodeIDs[0]].Position-center; + //normals + coshadownorvertices[0].normal=nodes[nodeIDs[0]].Position-nodes[nodeIDs[1]].Position; +// coshadownorvertices[0].normal=nodes[nodeIDs[0]].Position-center; + coshadownorvertices[0].normal.normalise(); + + coshadowposvertices[1].vertex=nodes[nodeIDs[1]].Position-center; + //normals + coshadownorvertices[1].normal=-coshadownorvertices[0].normal; +// coshadownorvertices[1].normal=nodes[nodeIDs[1]].Position-center; +// coshadownorvertices[1].normal.normalise(); + + for (i=0; i<nbrays*2; i++) + { + coshadowposvertices[2+i].vertex=nodes[nodeIDs[2+i]].Position-center; + + coshadownorvertices[2+i].normal=nodes[nodeIDs[2+i]].Position-center; + coshadownorvertices[2+i].normal.normalise(); + //normals + if ((i%2)==0) + { + coshadownorvertices[2+i].normal=nodes[nodeIDs[2+i]].Position-nodes[nodeIDs[2+i+1]].Position; + coshadownorvertices[2+i].normal.normalise(); + } else + { + coshadownorvertices[2+i].normal=-coshadownorvertices[2+i-1].normal; + } + //bands + coshadowposvertices[2+2*nbrays+i].vertex=coshadowposvertices[2+i].vertex; + if ((i%2)==0) + { + coshadownorvertices[2+2*nbrays+i].normal=nodes[nodeIDs[2+i]].Position-nodes[nodeIDs[0]].Position; + } else + { + coshadownorvertices[2+2*nbrays+i].normal=nodes[nodeIDs[2+i]].Position-nodes[nodeIDs[1]].Position; + }; +// coshadownorvertices[2+2*nbrays+i].normal=coshadowposvertices[2+i].vertex; + coshadownorvertices[2+2*nbrays+i].normal.normalise(); + + } + + for (i=0; i<2+nbrays*4; i++) + { + coshadowposvertices[i+2+nbrays*4].vertex=coshadowposvertices[i].vertex; + coshadownorvertices[i].texcoord=covertices[i].texcoord; + } +//msh->touch(); + return center; +} + +/* +Vector3 updateShadowVertices() +{ + int i; + Vector3 center; + center=(nodes[nodeIDs[0]].Position+nodes[nodeIDs[1]].Position)/2.0; + + coshadowposvertices[0].vertex=nodes[nodeIDs[0]].Position-center; + //normals + coshadownorvertices[0].normal=coshadowposvertices[0].vertex; + coshadownorvertices[0].normal.normalise(); + + coshadowposvertices[1].vertex=nodes[nodeIDs[1]].Position-center; + //normals + coshadownorvertices[1].normal=coshadowposvertices[1].vertex; + coshadownorvertices[1].normal.normalise(); + //texcoords + coshadownorvertices[0].texcoord=covertices[0].texcoord; + coshadownorvertices[1].texcoord=covertices[1].texcoord; + for (i=0; i<nbrays*2; i++) + { + coshadowposvertices[2+i].vertex=nodes[nodeIDs[2+i]].Position-center; + //normals + coshadownorvertices[2+i].normal=coshadowposvertices[2+i].vertex; + coshadownorvertices[2+i].normal.normalise(); + //optimization + coshadowposvertices[2+2*nbrays+i].vertex=coshadowposvertices[2+i].vertex; + coshadownorvertices[2+2*nbrays+i].normal=coshadownorvertices[2+i].normal; + + //texcoords + coshadownorvertices[2+i].texcoord=covertices[2+i].texcoord; + coshadownorvertices[2+2*nbrays+i].texcoord=covertices[2+2*nbrays+i].texcoord; + } + return center; +} +*/ + +Vector3 flexit() +{ + Vector3 center; + if (smanager->getShadowTechnique()==SHADOWTYPE_STENCIL_MODULATIVE || smanager->getShadowTechnique()==SHADOWTYPE_STENCIL_ADDITIVE) + { + center=updateShadowVertices(); + //find the binding + unsigned posbinding=msh->sharedVertexData->vertexDeclaration->findElementBySemantic(VES_POSITION)->getSource(); + HardwareVertexBufferSharedPtr pbuf=msh->sharedVertexData->vertexBufferBinding->getBuffer(posbinding); + pbuf->lock(HardwareBuffer::HBL_DISCARD); + pbuf->writeData(0, pbuf->getSizeInBytes(), shadowposvertices, true); + pbuf->unlock(); + //find the binding + unsigned norbinding=msh->sharedVertexData->vertexDeclaration->findElementBySemantic(VES_NORMAL)->getSource(); + HardwareVertexBufferSharedPtr nbuf=msh->sharedVertexData->vertexBufferBinding->getBuffer(norbinding); + nbuf->lock(HardwareBuffer::HBL_DISCARD); + nbuf->writeData(0, nbuf->getSizeInBytes(), shadownorvertices, true); + nbuf->unlock(); + + EdgeData * ed=msh->getEdgeList(); + ed->updateFaceNormals(0, pbuf); + } + else + { + center=updateVertices(); + vbuf->lock(HardwareBuffer::HBL_DISCARD); + vbuf->writeData(0, vbuf->getSizeInBytes(), vertices, true); + vbuf->unlock(); + //msh->sharedVertexData->vertexBufferBinding->getBuffer(0)->writeData(0, vbuf->getSizeInBytes(), vertices, true); + } + return center; +} + + +}; + + + +#endif Added: trunk/devtools/originalcode/FlexObj.h =================================================================== --- trunk/devtools/originalcode/FlexObj.h (rev 0) +++ trunk/devtools/originalcode/FlexObj.h 2007-06-22 23:32:23 UTC (rev 11) @@ -0,0 +1,416 @@ +#ifndef __FlexObj_H__ +#define __FlexObj_H__ + +//body + +#include "Ogre.h" +//#include "Beam.h" + +using namespace Ogre; + + +//class Beam; + +class FlexObj +{ +private: +typedef struct +{ + Vector3 vertex; + Vector3 normal; +// Vector3 color; + Vector2 texcoord; +} CoVertice_t; + +typedef struct +{ + Vector3 vertex; +} posVertice_t; + +typedef struct +{ + Vector3 normal; +// Vector3 color; + Vector2 texcoord; +} norVertice_t; + + Ogre::MeshPtr msh; + SubMesh** subs; + VertexDeclaration* decl; + HardwareVertexBufferSharedPtr vbuf; + + size_t nVertices; + size_t vbufCount; + //shadow + union + { + float *shadowposvertices; + posVertice_t *coshadowposvertices; + }; + union + { + float *shadownorvertices; + norVertice_t *coshadownorvertices; + }; + + union + { + float *vertices; + CoVertice_t *covertices; + }; + //nodes + int *nodeIDs; + + size_t ibufCount; + unsigned short *faces; + node_t *nodes; + int nbrays; + SceneManager *smanager; + + float *sref; + +public: + + + FlexObj(SceneManager *manager, node_t *nds, int numtexcoords, Vector3* texcoords, int numtriangles, int* triangles, int numsubmeshes, int* subtexindex, int* subtriindex, char* texname, char* name, int* subisback, char* backtexname, char* transtexname) + { + unsigned int i; + int j; + /* + //okay, we munch a bit the data to optimize submesh count + Vector3* texcoords=(Vector3*)malloc(sizeof(Vector3)*numtexcoords); + int* triangles=(int*)malloc(sizeof(int)*3*numtriangles); + int numsubmeshes=3; + int subtexindex[4]; + int subtriindex[4]; + int subisback[3]={0,1,2}; + int numtex[3]={0,0,0}; + int numtri[3]={0,0,0}; + int postex[3]={0,0,0}; + int postri[3]={0,0,0}; + for (j=0; j<onumsubmeshes; j++) + { + int type=0; + if (j<numsubmeshes-1) + { + type=osubisback[j+1]; + } + numtex[type]+=osubtexindex[j+1]-osubtexindex[j]; + numtri[type]+=osubtriindex[j+1]-osubtriindex[j]; + } + postex[0]=0; postex[1]=numtex[0]; postex[2]=numtex[0]+numtex[1]; + subtexindex[0]=0; subtexindex[1]=numtex[0]; subtexindex[2]=numtex[0]+numtex[1]; subtexindex[3]=numtex[0]+numtex[1]+numtex[2]; + postri[0]=0; postri[1]=numtri[0]; postri[2]=numtri[0]+numtri[1]; + subtriindex[0]=0; subtriindex[1]=numtri[0]; subtriindex[2]=numtri[0]+numtri[1]; subtriindex[3]=numtri[0]+numtri[1]+numtri[2]; + for (j=0; j<onumsubmeshes; j++) + { + int type=0; + if (j<numsubmeshes-1) + { + type=osubisback[j+1]; + } + for (i=0; i<osubtexindex[j+1]-osubtexindex[j]; i++) + { + texcoords[postex[type]]=otexcoords[osubtexindex[j]+i]; + } + postex[type]+=osubtexindex[j+1]-osubtexindex[j]; + for (i=0; i<osubtriindex[j+1]-osubtriindex[j]; i++) + { + int k; + for (k=0; k<3; k++) + triangles[postri[type]*3+k]=otriangles[(osubtriindex[j]+i)*3+k]; + } + postri[type]+=osubtriindex[j+1]-osubtriindex[j]; + } +*/ + //finished munching + smanager=manager; + nodes=nds; + /// Create the mesh via the MeshManager + msh = MeshManager::getSingleton().createManual(name, "General"); + + /// Create submeshes + subs=(SubMesh**)malloc(numsubmeshes*sizeof(SubMesh*)); + for (j=0; j<numsubmeshes; j++) + { + subs[j] = msh->createSubMesh(); + //materials + if (j<numsubmeshes-1) + { + if (subisback[j+1]==0) subs[j]->setMaterialName(texname); + if (subisback[j+1]==1) subs[j]->setMaterialName(backtexname); + if (subisback[j+1]==2) subs[j]->setMaterialName(transtexname); + } + else + subs[j]->setMaterialName(texname); + }; + + /// Define the vertices (8 vertices, each consisting of 3 groups of 3 floats + nVertices = numtexcoords; + vbufCount = (2*3+2)*nVertices; + vertices=(float*)malloc(vbufCount*sizeof(float)); + //shadow + shadownorvertices=(float*)malloc(nVertices*(3+2)*sizeof(float)); + shadowposvertices=(float*)malloc(nVertices*3*2*sizeof(float)); + nodeIDs=(int*)malloc(nVertices*sizeof(int)); + + //define node ids + for (i=0; i<nVertices; i++) + { + nodeIDs[i]=(int)(texcoords[i].x); + } + + //textures coordinates + for (i=0; i<nVertices; i++) + { + covertices[i].texcoord=Vector2(texcoords[i].y,texcoords[i].z); + } + + /// Define triangles + /// The values in this table refer to vertices in the above table + ibufCount = 3*numtriangles; + faces=(unsigned short*)malloc(ibufCount*sizeof(unsigned short)); + for (i=0; i<ibufCount; i++) + { + faces[i]=findID(i/3, triangles[i], numsubmeshes, subtexindex, subtriindex); + } + + sref=(float*)malloc(numtriangles*sizeof(float)); + + for (i=0; i<(unsigned int)numtriangles;i++) + { + Vector3 v1, v2; + v1=nodes[nodeIDs[faces[i*3+1]]].Position-nodes[nodeIDs[faces[i*3]]].Position; + v2=nodes[nodeIDs[faces[i*3+2]]].Position-nodes[nodeIDs[faces[i*3]]].Position; + v1=v1.crossProduct(v2); + sref[i]=v1.length()*2.0; + } + + + //update coords + updateVertices(); + + + + /// Create vertex data structure for vertices shared between submeshes + msh->sharedVertexData = new VertexData(); + msh->sharedVertexData->vertexCount = nVertices; + + + /// Create declaration (memory format) of vertex data + decl = msh->sharedVertexData->vertexDeclaration; + size_t offset = 0; + decl->addElement(0, offset, VET_FLOAT3, VES_POSITION); + offset += VertexElement::getTypeSize(VET_FLOAT3); + decl->addElement(0, offset, VET_FLOAT3, VES_NORMAL); + offset += VertexElement::getTypeSize(VET_FLOAT3); +// decl->addElement(0, offset, VET_FLOAT3, VES_DIFFUSE); +// offset += VertexElement::getTypeSize(VET_FLOAT3); + decl->addElement(0, offset, VET_FLOAT2, VES_TEXTURE_COORDINATES, 0); + offset += VertexElement::getTypeSize(VET_FLOAT2); + + + /// Allocate vertex buffer of the requested number of vertices (vertexCount) + /// and bytes per vertex (offset) + vbuf = + HardwareBufferManager::getSingleton().createVertexBuffer( + offset, msh->sharedVertexData->vertexCount, HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE); + + /// Upload the vertex data to the card + vbuf->writeData(0, vbuf->getSizeInBytes(), vertices, true); + + + /// Set vertex buffer binding so buffer 0 is bound to our vertex buffer + VertexBufferBinding* bind = msh->sharedVertexData->vertexBufferBinding; + bind->setBinding(0, vbuf); + + + + + /// Set parameters of the submeshes + for (j=0; j<numsubmeshes; j++) + { + int smcount=3*(subtriindex[j+1]-subtriindex[j]); + subs[j]->useSharedVertices = true; + /// Allocate index buffer of the requested number of vertices (ibufCount) + HardwareIndexBufferSharedPtr ibuf = HardwareBufferManager::getSingleton(). + createIndexBuffer( + HardwareIndexBuffer::IT_16BIT, + smcount, + HardwareBuffer::HBU_STATIC_WRITE_ONLY); + + /// Upload the index data to the card + ibuf->writeData(0, ibuf->getSizeInBytes(), &faces[subtriindex[j]*3], true); + subs[j]->indexData->indexBuffer = ibuf; + subs[j]->indexData->indexCount = smcount; + subs[j]->indexData->indexStart = 0; + } + + + /// Set bounding information (for culling) + msh->_setBounds(AxisAlignedBox(-100,-100,-100,100,100,100)); + msh->_setBoundingSphereRadius(100); + + + /// Notify Mesh object that it has been loaded + msh->load(); + msh->buildEdgeList(); + + } + +//find the zeroed id of the node v in the context of the tidx triangle +int findID(int tidx, int v, int numsubmeshes, int* subtexindex, int* subtriindex) +{ + int j; + //first: find the context from the triangle index tidx + int context; + for (context=0; context<numsubmeshes+1; context++) if (tidx<subtriindex[context]) {context--;break;}; + //okay, now search in the vertice block corresponding to the context + for (j=subtexindex[context]; j<subtexindex[context+1]; j++) if (nodeIDs[j]==v) return j; + return 0; +} + +/*Vector3 updateVertices() +{ + unsigned int i; + Vector3 center; + center=(nodes[nodeIDs[0]].Position+nodes[nodeIDs[1]].Position)/2.0; + for (i=0; i<nVertices; i++) + { + covertices[i].vertex=nodes[nodeIDs[i]].Position-center; + //normals + covertices[i].normal=covertices[i].vertex; + covertices[i].normal.normalise(); + } + + return center; +} +*/ + +//with normals +Vector3 updateVertices() +{ + unsigned int i; + Vector3 center; + center=(nodes[nodeIDs[0]].Position+nodes[nodeIDs[1]].Position)/2.0; + for (i=0; i<nVertices; i++) + { + //set position + covertices[i].vertex=nodes[nodeIDs[i]].Position-center; + //reset normals + covertices[i].normal=Vector3::ZERO; + } + //accumulate normals per triangle + for (i=0; i<ibufCount/3; i++) + { + Vector3 v1, v2; + v1=nodes[nodeIDs[faces[i*3+1]]].Position-nodes[nodeIDs[faces[i*3]]].Position; + v2=nodes[nodeIDs[faces[i*3+2]]].Position-nodes[nodeIDs[faces[i*3]]].Position; + v1=v1.crossProduct(v2); + float s=v1.length(); + //avoid large tris + if (s>sref[i]) + { + covertices[faces[i*3+1]].vertex=covertices[faces[i*3]].vertex+Vector3(0.1,0,0); + covertices[faces[i*3+2]].vertex=covertices[faces[i*3]].vertex+Vector3(0,0,0.1); + } + //v1.normalise(); + v1=v1/s; + covertices[faces[i*3]].normal+=v1; + covertices[faces[i*3+1]].normal+=v1; + covertices[faces[i*3+2]].normal+=v1; + } + //normalize + for (i=0; i<nVertices; i++) + { + covertices[i].normal.normalise(); + } + + return center; +} + +//with normals +Vector3 updateShadowVertices() +{ + unsigned int i; + Vector3 center; + center=(nodes[nodeIDs[0]].Position+nodes[nodeIDs[1]].Position)/2.0; + for (i=0; i<nVertices; i++) + { + //set position + coshadowposvertices[i].vertex=nodes[nodeIDs[i]].Position-center; + coshadowposvertices[i+nVertices].vertex=nodes[nodeIDs[i]].Position-center; + //reset normals + coshadownorvertices[i].normal=Vector3::ZERO; + } + //accumulate normals per triangle + for (i=0; i<ibufCount/3; i++) + { + Vector3 v1, v2; + v1=nodes[nodeIDs[faces[i*3+1]]].Position-nodes[nodeIDs[faces[i*3]]].Position; + v2=nodes[nodeIDs[faces[i*3+2]]].Position-nodes[nodeIDs[faces[i*3]]].Position; + v1=v1.crossProduct(v2); + float s=v1.length(); + //avoid large tris + if (s>sref[i]) + { + coshadowposvertices[faces[i*3+1]].vertex=coshadowposvertices[faces[i*3]].vertex+Vector3(0.1,0,0); + coshadowposvertices[faces[i*3+2]].vertex=coshadowposvertices[faces[i*3]].vertex+Vector3(0,0,0.1); + coshadowposvertices[faces[i*3+1]+nVertices].vertex=coshadowposvertices[faces[i*3+1]].vertex; + coshadowposvertices[faces[i*3+2]+nVertices].vertex=coshadowposvertices[faces[i*3+2]].vertex; + } + //v1.normalise(); + v1=v1/s; + + coshadownorvertices[faces[i*3]].normal+=v1; + coshadownorvertices[faces[i*3+1]].normal+=v1; + coshadownorvertices[faces[i*3+2]].normal+=v1; + } + //normalize + for (i=0; i<nVertices; i++) + { + coshadownorvertices[i].normal.normalise(); + //texcoords + coshadownorvertices[i].texcoord=covertices[i].texcoord; + } + + return center; +} + +Vector3 flexit() +{ + Vector3 center; + if (smanager->getShadowTechnique()==SHADOWTYPE_STENCIL_MODULATIVE || smanager->getShadowTechnique()==SHADOWTYPE_STENCIL_ADDITIVE) + { + center=updateShadowVertices(); + //find the binding + unsigned posbinding=msh->sharedVertexData->vertexDeclaration->findElementBySemantic(VES_POSITION)->getSource(); + HardwareVertexBufferSharedPtr pbuf=msh->sharedVertexData->vertexBufferBinding->getBuffer(posbinding); + pbuf->lock(HardwareBuffer::HBL_DISCARD); + pbuf->writeData(0, pbuf->getSizeInBytes(), shadowposvertices, true); + pbuf->unlock(); + //find the binding + unsigned norbinding=msh->sharedVertexData->vertexDeclaration->findElementBySemantic(VES_NORMAL)->getSource(); + HardwareVertexBufferSharedPtr nbuf=msh->sharedVertexData->vertexBufferBinding->getBuffer(norbinding); + nbuf->lock(HardwareBuffer::HBL_DISCARD); + nbuf->writeData(0, nbuf->getSizeInBytes(), shadownorvertices, true); + nbuf->unlock(); + msh->getEdgeList()->updateFaceNormals(0, pbuf); + + } + else + { + center=updateVertices(); + vbuf->lock(HardwareBuffer::HBL_DISCARD); + vbuf->writeData(0, vbuf->getSizeInBytes(), vertices, true); + vbuf->unlock(); + //msh->sharedVertexData->vertexBufferBinding->getBuffer(0)->writeData(0, vbuf->getSizeInBytes(), vertices, true); + } + return center; +} + +}; + + + +#endif Added: trunk/devtools/originalcode/random snippets.h =================================================================== --- trunk/devtools/originalcode/random snippets.h (rev 0) +++ trunk/devtools/originalcode/random snippets.h 2007-06-22 23:32:23 UTC (rev 11) @@ -0,0 +1,1657 @@ +#define MAX_NODES 1000 +#define MAX_BEAMS 4000 +#define MAX_CONTACTERS 200 +#define MAX_HYDROS 40 +#define MAX_WHEELS 16 +#define MAX_SUBMESHES 500 +#define MAX_TEXCOORDS 2000 +#define MAX_CABS 2000 +#define MAX_SHOCKS 20 +#define MAX_ROPES 10 +#define MAX_ROPABLES 20 +#define MAX_TIES 10 +#define MAX_FLARES 20 +#define MAX_PROPS 40 + +#define MAX_CAMERAS 10 + +#define MAX_TURBOPROPS 8 + +#define MAX_SCREWPROPS 8 + +#define DEFAULT_SPRING 9000000.0 +//should be 60000 +#define DEFAULT_DAMP 12000.0 +//#define DEFAULT_DAMP 60000.0 +//mars +//#define DEFAULT_GRAVITY -3.8 +//earth +#define DEFAULT_GRAVITY -9.8 +#define DEFAULT_DRAG 0.05 +#define DEFAULT_BEAM_DIAMETER 0.05 +#define MAX_SPEED 140.0 + +#define DEFAULT_WATERDRAG 10.0 +//buoyancy force per node in Newton +//#define DEFAULT_BUOYANCY 700.0 + + +#define IRON_DENSITY 7874.0 +#define BEAM_BREAK 1000000.0 +#define BEAM_DEFORM 400000.0 +#define BEAM_CREAK 100000.0 +#define WHEEL_FRICTION_COEF 2.0 +#define CHASSIS_FRICTION_COEF 0.05 +#define SPEED_STOP 0.2 + +#define STAB_RATE 0.1 + +#define BEAM_NORMAL 0 +#define BEAM_HYDRO 1 +#define BEAM_VIRTUAL 2 +#define BEAM_MARKED 3 +#define BEAM_INVISIBLE 4 +#define BEAM_INVISIBLE_HYDRO 5 + +#define NODE_NORMAL 0 +#define NODE_LOADED 1 + +//leading truck +#define ACTIVATED 0 +//not leading but active +#define DESACTIVATED 1 +//static +#define SLEEPING 2 +//network +#define NETWORKED 3 + +#define MAX_TRUCKS 64 + +#define MAX_WINGS 20 + +#define UNLOCKED 0 +#define PRELOCK 1 +#define LOCKED 2 + +#define NOT_DRIVEABLE 0 +#define TRUCK 1 +#define AIRPLANE 2 +#define BOAT 3 + +#define DRY 0 +#define DRIPPING 1 +#define WET 2 + + +typedef struct _node +{ + Real mass; + Vector3 iPosition; + Vector3 Position; + Vector3 Velocity; + Vector3 Forces; + int locked; + int iswheel; + int masstype; + int contactless; + int contacted; + Real friction; + Real buoyancy; + Vector3 lastdrag; + Vector3 gravimass; + int lockednode; + Vector3 lockedPosition; + Vector3 lockedVelocity; + Vector3 lockedForces; + int wetstate; + float wettime; + bool isHot; + Vector3 buoyanceForce; +} node_t; + +typedef struct _beam +{ + node_t *p1; + node_t *p2; + Real k; //tensile spring + Real d; //damping factor + Real L; //length + Real refL; //reference length + Real Lhydro;//hydro reference len + Real hydroRatio;//hydro rotation ratio + bool hydroSpeed; + SceneNode *mSceneNode; //visual + Entity *mEntity; //visual + int type; + int broken; + int bounded; + Real shortbound; + Real longbound; + Real commandRatio; + Real commandShort; + Real commandLong; + Real stress; + Real maxposstress; + Real maxnegstress; + Real strength; + Vector3 lastforce; + bool isrope; + int disabled; + float minendmass; +} beam_t; + +typedef struct _wheel +{ + int nbnodes; + node_t* nodes[50]; + int braked; + int propulsed; + node_t* arm; + node_t* near_attach; + node_t* refnode0; + node_t* refnode1; + Real radius; + Real speed; +} wheel_t; + + + + void calc_masses2(Real total) + { + int i; + Real len=0.0; + //reset + for (i=0; i<free_node; i++) + { + if (!nodes[i].iswheel) + { + if (!nodes[i].masstype==NODE_LOADED) nodes[i].mass=0; + else nodes[i].mass=loadmass/(float)masscount; + } + } + //average linear density + for (i=0; i<free_beam; i++) + { + if (beams[i].type!=BEAM_VIRTUAL) + { + Real newlen=beams[i].L; + if (!(beams[i].p1->iswheel)) len+=newlen/2.0; + if (!(beams[i].p2->iswheel)) len+=newlen/2.0; + }; + } + for (i=0; i<free_beam; i++) + { + if (beams[i].type!=BEAM_VIRTUAL) + { + Real mass=beams[i].L*total/len; + if (!(beams[i].p1->iswheel)) beams[i].p1->mass+=mass/2; + if (!(beams[i].p2->iswheel)) beams[i].p2->mass+=mass/2; + }; + } + //fix rope masses + for (i=0; i<free_rope; i++) + { + ropes[i].beam->p2->mass=100.0; + } + //fix camera mass + for (i=0; i<freecinecamera; i++) nodes[cinecameranodepos[i]].mass=20; + + //hooks must be heavy + if (hookId!=-1) nodes[hookId].mass=500.0; + + //update gravimass + for (i=0; i<free_node; i++) + { + //LogManager::getSingleton().logMessage("Nodemass "+StringConverter::toString(i)+"-"+StringConverter::toString(nodes[i].mass)); + //for stability + if (!nodes[i].iswheel && nodes[i].mass<50.0) nodes[i].mass=50.0; + nodes[i].gravimass=Vector3(0,DEFAULT_GRAVITY*nodes[i].mass,0); + } + //update minendmass + for (i=0; i<free_beam; i++) + { + beams[i].minendmass=beams[i].p1->mass; + if (beams[i].p2->mass<beams[i].minendmass) beams[i].minendmass=beams[i].p2->mass; + } + } + + //to load a truck file + void loadTruck(char* fname, SceneManager *manager, SceneNode *parent, Real px, Real py, Real pz, Real ry, bool postload) + { + //FILE *fd; + char line[1024]; + int mode=0; + int hasfixes=0; + int wingstart=-1; + float wingarea=0.0; + //convert ry + ry=ry*3.14159/180.0; + LogManager::getSingleton().logMessage("BEAM: Start of truck loading"); + ResourceGroupManager& rgm = ResourceGroupManager::getSingleton(); + DataStreamPtr ds=rgm.openResource(fname, "General"); + + +// fd=fopen(fname, "r"); +// if (!fd) { +// LogManager::getSingleton().logMessage("Can't open truck file '"+String(fname)+"'"); +// exit(1); +// }; + LogManager::getSingleton().logMessage("Parsing '"+String(fname)+"'"); + //skip first line +// fscanf(fd," %[^\n\r]",line); + ds->readLine(line, 1023); + +// while (!feof(fd)) + while (!ds->eof()) + { + size_t ll=ds->readLine(line, 1023); +// fscanf(fd," %[^\n\r]",line); + //LogManager::getSingleton().logMessage(line); + // printf("Mode %i Line:'%s'\n",mode, line); + if (line[0]==';' || ll==0) + { + // printf("%s\n", line+1); + continue; + }; + if (!strcmp("end",line)) + { + LogManager::getSingleton().logMessage("BEAM: End of truck loading"); + loading_finished=1;break; + }; + if (!strcmp("nodes",line)) {mode=1;continue;}; + if (!strcmp("beams",line)) {mode=2;continue;}; + if (!strcmp("fixes",line)) {mode=3;continue;}; + if (!strcmp("shocks",line)) {mode=4;continue;}; + if (!strcmp("hydros",line)) {mode=5;continue;}; + if (!strcmp("wheels",line)) {mode=6;continue;}; + if (!strcmp("globals",line)) {mode=7;continue;}; + if (!strcmp("cameras",line)) {mode=8;continue;}; + if (!strcmp("engine",line)) {mode=9;continue;}; + if (!strcmp("texcoords",line)) {mode=10;continue;}; + if (!strcmp("cab",line)) {mode=11;continue;}; + if (!strcmp("commands",line)) {mode=12;continue;}; + if (!strcmp("forwardcommands",line)) {forwardcommands=1;continue;}; + if (!strcmp("importcommands",line)) {importcommands=1;continue;}; + if (!strcmp("rollon",line)) {wheel_contact_requested=true;continue;}; + if (!strcmp("rescuer",line)) {rescuer=true;continue;}; + if (!strcmp("contacters",line)) {mode=13;continue;}; + if (!strcmp("ropes",line)) {mode=14;continue;}; + if (!strcmp("ropables",line)) {mode=15;continue;}; + if (!strcmp("ties",line)) {mode=16;continue;}; + if (!strcmp("help",line)) {mode=17;continue;}; + if (!strcmp("cinecam",line)) {mode=18;continue;}; + if (!strcmp("flares",line)) {mode=19;continue;}; + if (!strcmp("props",line)) {mode=20;continue;}; + if (!strcmp("globeams",line)) {mode=21;continue;}; + if (!strcmp("wings",line)) {mode=22;continue;}; + if (!strcmp("turboprops",line)) {mode=23;continue;}; + if (!strcmp("fusedrag",line)) {mode=24;continue;}; + if (!strcmp("engoption",line)) {mode=25;continue;}; + if (!strcmp("brakes",line)) {mode=26;continue;}; + if (!strcmp("rotators",line)) {mode=27;continue;}; + if (!strcmp("screwprops",line)) {mode=28;continue;}; + if (!strncmp("set_beam_defaults", line, 17)) + { + sscanf(line,"set_beam_defaults %f, %f, %f, %f, %f, %s", &default_spring, &default_damp, &default_deform,&default_break,&default_beam_diameter, default_beam_material); + if (default_spring<0) default_spring=DEFAULT_SPRING; + if (default_damp<0) default_damp=DEFAULT_DAMP; + if (default_deform<0) default_deform=BEAM_DEFORM; + if (default_break<0) default_break=BEAM_BREAK; + if (default_beam_diameter<0) default_beam_diameter=DEFAULT_BEAM_DIAMETER; + continue; + } + if (!strcmp("backmesh",line)) + { + //close the current mesh + subtexcoords[free_sub]=free_texcoord; + subcabs[free_sub]=free_cab; + //make it normal + subisback[free_sub]=0; + free_sub++; + + //add an extra front mesh + int i; + int start; + //texcoords + if (free_sub==1) start=0; else start=subtexcoords[free_sub-2]; + for (i=start; i<subtexcoords[free_sub-1]; i++) + { + texcoords[free_texcoord]=texcoords[i];; + free_texcoord++; + } + //cab + if (free_sub==1) start=0; else start=subcabs[free_sub-2]; + for (i=start; i<subcabs[free_sub-1]; i++) + { + cabs[free_cab*3]=cabs[i*3]; + cabs[free_cab*3+1]=cabs[i*3+1]; + cabs[free_cab*3+2]=cabs[i*3+2]; + free_cab++; + } + //finish it, this is a window + subisback[free_sub]=2; + //close the current mesh + subtexcoords[free_sub]=free_texcoord; + subcabs[free_sub]=free_cab; + //make is transparent + free_sub++; + + + //add an extra back mesh + //texcoords + if (free_sub==1) start=0; else start=subtexcoords[free_sub-2]; + for (i=start; i<subtexcoords[free_sub-1]; i++) + { + texcoords[free_texcoord]=texcoords[i];; + free_texcoord++; + } + //cab + if (free_sub==1) start=0; else start=subcabs[free_sub-2]; + for (i=start; i<subcabs[free_sub-1]; i++) + { + cabs[free_cab*3]=cabs[i*3+1]; + cabs[free_cab*3+1]=cabs[i*3]; + cabs[free_cab*3+2]=cabs[i*3+2]; + free_cab++; + } + //we don't finish, there will be a submesh statement later + subisback[free_sub]=1; + continue; + }; + if (!strcmp("submesh",line)) + { + subtexcoords[free_sub]=free_texcoord; + subcabs[free_sub]=free_cab; + free_sub++; + //initialize the next + subisback[free_sub]=0; + continue; + }; + if (mode==1) + { + //parse nodes + int id; + float x,y,z; + char load='n'; + int type=NODE_NORMAL; + sscanf(line,"%i, %f, %f, %f, %c",&id,&x,&y,&z,&load); + if (load=='l') type=NODE_LOADED; + // printf("node %i : %f %f %f\n", id, x,y,z); + if (id!=free_node) + { + LogManager::getSingleton().logMessage("Error: lost sync in nodes numbers after node " + +StringConverter::toString(free_node)+"(got "+StringConverter::toString(id)+"instead)"); + exit(2); + }; + init_node(id, px+x*cos(ry)+z*sin(ry), py+y , pz+x*cos(ry+3.14159/2.0)+z*sin(ry+3.14159/2.0),type); + //friction + if (load=='f') nodes[id].friction=100.0; + //exhaust + if (load=='x' && !disable_smoke) + { + smokeId=id; + smokeNode = parent->createChildSceneNode(); + //ParticleSystemManager *pSysM=ParticleSystemManager::getSingletonPtr(); + char wname[256]; + sprintf(wname, "exhaust-%s",truckname); + //if (pSysM) smoker=pSysM->createSystem(wname, "tracks/Smoke"); + smoker=manager->createParticleSystem(wname, "tracks/Smoke"); + // ParticleSystem* pSys = ParticleSystemManager::getSingleton().createSystem("exhaust", "tracks/Smoke"); + if (smoker) + { + smokeNode->attachObject(smoker); + smokeNode->setPosition(nodes[smokeId].Position); + } + nodes[id].isHot=true; + } + //exhaust reference + if (load=='y' && !disable_smoke) + { + smokeRef=id; + nodes[id].isHot=true; + } + //contactless + if (load=='c') nodes[id].contactless=1; + //hook + if (load=='h') hookId=id; + //editor + if (load=='e') editorId=id; + //buoy + if (load=='b') nodes[id].buoyancy=10000.0; + free_node++; + } + if (mode==2) + { + //parse beams + int id1, id2; + char visible='v'; + int type=BEAM_NORMAL; + sscanf(line,"%i, %i, %c",&id1,&id2,&visible); + if (visible=='i') type=BEAM_INVISIBLE; + if (id1>=free_node || id2>=free_node) + { + LogManager::getSingleton().logMessage("Error: unknown node number in beams section (" + +StringConverter::toString(id1)+","+StringConverter::toString(id2)+")"); + exit(3); + }; + //skip if a beam already exists + int i; + for (i=0; i<free_beam; i++) + { + if ((beams[i].p1==&nodes[id1] && beams[i].p2==&nodes[id2]) || (beams[i].p1==&nodes[id2] && beams[i].p2==&nodes[id1])) + { + LogManager::getSingleton().logMessage("Skipping duplicate beam"); + continue; + } + } + // printf("beam : %i %i\n", id1, id2); + /* + if (visible=='r') + { + //this is a rope, add extra nodes + int numropeseg=5; + int i; + int lastid=id1; + int lastlastid=-1; + for (i=0; i<numropeseg-1; i++) + { + //insert a node + Vector3 nodep=nodes[id1].Position+(float)(i+1)*(nodes[id2].Position-nodes[id1].Position)/(float)numropeseg; + init_node(free_node, nodep.x, nodep.y, nodep.z,NODE_NORMAL); + init_beam(free_beam , &nodes[lastid], &nodes[free_node], manager, parent, type, BEAM_BREAK); + //beams[free_beam].isrope=true; + beams[free_beam].k/=100.0; + beams[free_beam].d/=100.0; + free_beam++; + //if (lastlastid!=-1) + //{ + //extra reinforcement beams + // init_beam(free_beam , &nodes[lastlastid], &nodes[free_node], manager, parent, BEAM_INVISIBLE, BEAM_BREAK); + //beams[free_beam].isrope=true; + // beams[free_beam].k/=100.0; + // beams[free_beam].d/=100.0; + // free_beam++; + //} + lastlastid=lastid; + lastid=free_node; + free_node++; + } + //last segment + init_beam(free_beam , &nodes[lastid], &nodes[id2], manager, parent, type, BEAM_BREAK); + //beams[free_beam].isrope=true; + beams[free_beam].k/=100.0; + beams[free_beam].d/=100.0; + free_beam++; + //init_beam(free_beam , &nodes[lastlastid], &nodes[id2], manager, parent, BEAM_INVISIBLE, BEAM_BREAK); + //beams[free_beam].isrope=true; + //beams[free_beam].k/=100.0; + //beams[free_beam].d/=100.0; + //free_beam++; + } + else + { + init_beam(free_beam , &nodes[id1], &nodes[id2], manager, parent, type, BEAM_BREAK); + free_beam++; + } + */ + init_beam(free_beam , &nodes[id1], &nodes[id2], manager, parent, type, default_break, default_spring, default_damp); + beams[free_beam].isrope=(visible=='r'); + free_beam++; + } + if (mode==4) + { + //parse shocks + int id1, id2; + float s, d, sbound,lbound,precomp; + char type='n'; + sscanf(line,"%i, %i, %f, %f, %f, %f, %f, %c",&id1,&id2, &s, &d, &sbound, &lbound,&precomp,&type); + if (id1>=free_node || id2>=free_node) + { + LogManager::getSingleton().logMessage("Error: unknown node number in shocks section (" + +StringConverter::toString(id1)+","+StringConverter::toString(id2)+")"); + exit(4); + }; + // printf("beam : %i %i\n", id1, id2); + //bounded beam + int htype=BEAM_HYDRO; + if (type=='i') htype=BEAM_INVISIBLE_HYDRO; + + init_beam(free_beam , &nodes[id1], &nodes[id2], manager, parent, htype, default_break*4.0, s, d, -1.0, sbound, lbound,precomp); + if (type!='n' && type!='i') + { + active_shocks[free_active_shock]=free_beam; + free_active_shock++; + }; + free_beam++; + } + if (mode==3) + { + //parse fixes + int id; + sscanf(line,"%i",&id); + if (id>=free_node) + { + LogManager::getSingleton().logMessage("Error: unknown node number in fixes section (" + +StringConverter::toString(id)+")"); + exit(5); + }; + nodes[id].locked=1; + hasfixes=1; + } + if (mode==5) + { + //parse hydros + int id1, id2; + float ratio; + char option='n'; + sscanf(line,"%i, %i, %f, %c",&id1,&id2,&ratio, &option); + int htype=BEAM_HYDRO; + if (option=='i') htype=BEAM_INVISIBLE_HYDRO; + if (id1>=free_node || id2>=free_node) + { + LogManager::getSingleton().logMessage("Error: unknown node number in hydros section (" + +StringConverter::toString(id1)+","+StringConverter::toString(id2)+")"); + exit(6); + }; + // printf("beam : %i %i\n", id1, id2); + init_beam(free_beam , &nodes[id1], &nodes[id2], manager, parent, htype, default_break, default_spring, default_damp); + hydro[free_hydro]=free_beam;free_hydro++; + beams[free_beam].Lhydro=beams[free_beam].L; + beams[free_beam].hydroRatio=ratio; + beams[free_beam].hydroSpeed=(option=='s'); + free_beam++; + } + if (mode==6) + { + //parse wheels + float radius, width, mass, spring, damp; + int rays, node1, node2, snode, braked, propulsed, torquenode; + sscanf(line,"%f, %f, %i, %i, %i, %i, %i, %i, %i, %f, %f, %f, %s %s",&radius,&width,&rays,&node1,&node2,&snode,&braked,&propulsed,&torquenode,&mass,&spring,&damp, texf, texb); + addWheel(manager, parent, radius,width,rays,node1,node2,snode,braked,propulsed, torquenode, mass, spring, damp, texf, texb); + } + if (mode==7) + { + //parse globals + sscanf(line,"%f, %f, %s",&truckmass, &loadmass, texname); + // + LogManager::getSingleton().logMessage("BEAM: line: '"+String(line)+"'"); + LogManager::getSingleton().logMessage("BEAM: texname: '"+String(texname)+"'"); + + //we clone the material + char clonetex[256]; + sprintf(clonetex, "%s-%s",texname,truckname); + MaterialPtr mat=(MaterialPtr)(MaterialManager::getSingleton().getByName(texname)); + mat->clone(clonetex); + strcpy(texname, clonetex); + } + if (mode==8) + { + //parse cameras + int nodepos, nodedir, dir; + sscanf(line,"%i, %i, %i",&nodepos,&nodedir,&dir); + addCamera(nodepos, nodedir, dir); + } + if (mode==9) + { + //parse engine + float minrpm, maxrpm, torque, dratio, rear; + float gears[16]; + int numgears; + driveable=TRUCK; + sscanf(line,"%f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f", &minrpm, &maxrpm, &torque, &dratio, &rear, &gears[0],&gears[1],&gears[2],&gears[3],&gears[4],&gears[5],&gears[6],&gears[7],&gears[8],&gears[9],&gears[10],&gears[11],&gears[12],&gears[13],&gears[14],&gears[15]); + for (numgears=0; numgears<16; numgears++) if (gears[numgears]==-1.0) break; + if (audio) audio->setupEngine(); + engine=new BeamEngine(minrpm, maxrpm, torque, rear, numgears, gears, dratio, audio); + //engine->start(); + } + + if (mode==10) + { + //parse texcoords + int id; + float x, y; + sscanf(line,"%i, %f, %f", &id, &x, &y); + texcoords[free_texcoord]=Vector3(id, x, y); + free_texcoord++; + } + + if (mode==11) + { + //parse cab + char type='n'; + int id1, id2, id3; + sscanf(line,"%i, %i, %i, %c", &id1, &id2, &id3,&type); + cabs[free_cab*3]=id1; + cabs[free_cab*3+1]=id2; + cabs[free_cab*3+2]=id3; + if (type=='c') {collcabs[free_collcab]=free_cab; free_collcab++;}; + if (type=='b') {buoycabs[free_buoycab]=free_cab; free_buoycab++; if (!buoyance) buoyance=new Buoyance(water, splashp, ripplep);}; + if (type=='D') + { + collcabs[free_collcab]=free_cab; free_collcab++; + buoycabs[free_buoycab]=free_cab; free_buoycab++; if (!buoyance) buoyance=new Buoyance(water, splashp, ripplep); + } + free_cab++; + } + + if (mode==12) + { + //parse commands + int id1, id2,keys,keyl; + float rate, shortl, longl; + char option='n'; + hascommands=1; + sscanf(line,"%i, %i, %f, %f, %f, %i, %i, %c", &id1, &id2, &rate, &shortl, &longl, &keys, &keyl,&option); + int htype=BEAM_HYDRO; + if (option=='i') htype=BEAM_INVISIBLE_HYDRO; + init_beam(free_beam , &nodes[id1], &nodes[id2], manager, parent, htype, default_break, default_spring, default_damp); + if (option=='r') beams[free_beam].isrope=true; + beams[free_beam].Lhydro=beams[free_beam].L; + //add short key + commandkey[keys].beams[commandkey[keys].bfree]=-free_beam; + commandkey[keys].bfree++; + //add long key + commandkey[keyl].beams[commandkey[keyl].bfree]=free_beam; + commandkey[keyl].bfree++; + beams[free_beam].commandRatio=rate; + beams[free_beam].commandShort=shortl; + beams[free_beam].commandLong=longl; + free_beam++; + + } + + if (mode==13) + { + //parse contacters + int id1; + sscanf(line,"%i", &id1); + contacters[free_contacter].nodeid=id1; + contacters[free_contacter].contacted=0; + contacters[free_contacter].opticontact=0; + free_contacter++;; + } + if (mode==14) + { + //parse ropes + int id1, id2; + sscanf(line,"%i, %i", &id1, &id2); + //add beam + if (id1>=free_node || id2>=free_node) + { + LogManager::getSingleton().logMessage("Error: unknown node number in ropes section (" + +StringConverter::toString(id1)+","+StringConverter::toString(id2)+")"); + exit(7); + }; + init_beam(free_beam , &nodes[id1], &nodes[id2], manager, parent, BEAM_NORMAL, default_break, default_spring, default_damp); + beams[free_beam].isrope=1; + //register rope + ropes[free_rope].beam=&beams[free_beam]; + ropes[free_rope].lockedto=0; + free_beam++; + free_rope++; + } + if (mode==15) + { + //parse ropables + int id1; + sscanf(line,"%i", &id1); + ropables[free_ropable]=id1; + free_ropable++;; + } + if (mode==16) + { + //parse ties + int id1; + float maxl, rate, shortl, longl; + char option='n'; + hascommands=1; + sscanf(line,"%i, %f, %f, %f, %f, %c", &id1, &maxl, &rate, &shortl, &longl, &option); + int htype=BEAM_HYDRO; + if (option=='i') htype=BEAM_INVISIBLE_HYDRO; + init_beam(free_beam , &nodes[id1], &nodes[0], manager, parent, htype, default_break, default_spring, default_damp); + beams[free_beam].L=maxl; + beams[free_beam].refL=maxl; + beams[free_beam].Lhydro=maxl; + beams[free_beam].isrope=1; + beams[free_beam].disabled=1; + beams[free_beam].mSceneNode->detachAllObjects(); + //add short key + commandkey[0].beams[commandkey[0].bfree]=-free_beam; + commandkey[0].bfree++; + //add long key + // commandkey[keyl].beams[commandkey[keyl].bfree]=free_beam; + // commandkey[keyl].bfree++; + beams[free_beam].commandRatio=rate; + beams[free_beam].commandShort=shortl; + beams[free_beam].commandLong=longl; + //register tie + ties[free_tie]=free_beam; + free_tie++; + free_beam++; + + } + + if (mode==17) + { + //help material + strcpy(helpmat,line); + hashelp=1; + } + if (mode==18) + { + //cinecam + float x,y,z; + int n1, n2, n3, n4, n5, n6, n7, n8; + sscanf(line,"%f, %f, %f, %i, %i, %i, %i, %i, %i, %i, %i", &x,&y,&z,&n1,&n2,&n3,&n4,&n5,&n6,&n7,&n8); + //add node + cinecameranodepos[freecinecamera]=free_node; + init_node(cinecameranodepos[freecinecamera], px+x*cos(ry)+z*sin(ry), py+y , pz+x*cos(ry+3.14159/2.0)+z*sin(ry+3.14159/2.0)); + free_node++; + //add beams + float spring=8000.0; + float damp=800.0; + init_beam(free_beam , &nodes[cinecameranodepos[freecinecamera]], &nodes[n1], manager, parent, BEAM_INVISIBLE, default_break, spring, damp); + free_beam++; + init_beam(free_beam , &nodes[cinecameranodepos[freecinecamera]], &nodes[n2], manager, parent, BEAM_INVISIBLE, default_break, spring, damp); + free_beam++; + init_beam(free_beam , &nodes[cinecameranodepos[freecinecamera]], &nodes[n3], manager, parent, BEAM_INVISIBLE, default_break, spring, damp); + free_beam++; + init_beam(free_beam , &nodes[cinecameranodepos[freecinecamera]], &nodes[n4], manager, parent, BEAM_INVISIBLE, default_break, spring, damp); + free_beam++; + init_beam(free_beam , &nodes[cinecameranodepos[freecinecamera]], &nodes[n5], manager, parent, BEAM_INVISIBLE, default_break, spring, damp); + free_beam++; + init_beam(free_beam , &nodes[cinecameranodepos[freecinecamera]], &nodes[n6], manager, parent, BEAM_INVISIBLE, default_break, spring, damp); + free_beam++; + init_beam(free_beam , &nodes[cinecameranodepos[freecinecamera]], &nodes[n7], manager, parent, BEAM_INVISIBLE, default_break, spring, damp); + free_beam++; + init_beam(free_beam , &nodes[cinecameranodepos[freecinecamera]], &nodes[n8], manager, parent, BEAM_INVISIBLE, default_break, spring, damp); + free_beam++; + freecinecamera++; + } + + if (mode==19) + { + //parse flares + int ref, nx, ny; + float ox, oy; + sscanf(line,"%i, %i, %i, %f, %f", &ref,&nx,&ny, &ox, &oy); + flares[free_flare].noderef=ref; + flares[free_flare].nodex=nx; + flares[free_flare].nodey=ny; + flares[free_flare].offsetx=ox; + flares[free_flare].offsety=oy; + flares[free_flare].snode = manager->getRootSceneNode()->createChildSceneNode(); + char flarename[256]; + sprintf(flarename, "flare-%s-%i", truckname, free_flare); + flares[free_flare].bbs=manager->createBillboardSet(flarename,1); + flares[free_flare].bbs->createBillboard(0,0,0); + flares[free_flare].bbs->setMaterialName("tracks/flare"); + flares[free_flare].snode->attachObject(flares[free_flare].bbs); + + flares[free_flare].light=manager->createLight(flarename); + flares[free_flare].light->setType(Light::LT_SPOTLIGHT); + flares[free_flare].light->setDiffuseColour( ColourValue(1.0, 1.0, 0.8)); + flares[free_flare].light->setSpecularColour( ColourValue(1.0, 1.0, 1.0)); + flares[free_flare].light->setAttenuation(500.0, 1.0, 0.1, 0.0); + flares[free_flare].light->setSpotlightRange( Degree(35), Degree(45) ); + //flares[free_flare].lnode->attachObject(flares[free_flare].light); + flares[free_flare].light->setCastShadows(false); + free_flare++; + } + if (mode==20) + { + //parse props + int ref, nx, ny; + float ox, oy, oz; + float rx, ry, rz; + char meshname[256]; + sscanf(line,"%i, %i, %i, %f, %f, %f, %f, %f, %f, %s", &ref,&nx,&ny, &ox, &oy, &oz, &rx, &ry, &rz, meshname); + props[free_prop].noderef=ref; + props[free_prop].nodex=nx; + props[free_prop].nodey=ny; + props[free_prop].offsetx=ox; + props[free_prop].offsety=oy; + props[free_prop].offsetz=oz; + props[free_prop].rot=Quaternion(Degree(rz), Vector3::UNIT_Z); + props[free_prop].rot=props[free_prop].rot*Quaternion(Degree(ry), Vector3::UNIT_Y); + props[free_prop].rot=props[free_prop].rot*Quaternion(Degree(rx), Vector3::UNIT_X); + props[free_prop].wheel=0; + props[free_prop].mirror=0; + props[free_prop].pale=0; + props[free_prop].spinner=0; + if (!strncmp("leftmirror", meshname, 10)) props[free_prop].mirror=1; + if (!strncmp("rightmirror", meshname, 11)) props[free_prop].mirror=-1; + if (!strncmp("dashboard", meshname, 9)) + { + //create a wheel + char propname[256]; + sprintf(propname, "prop-%s-%i-wheel", truckname, free_prop); + Entity *te = manager->createEntity(propname, "dirwheel.mesh"); + props[free_prop].wheel=manager->getRootSceneNode()->createChildSceneNode(); + props[free_prop].wheel->attachObject(te); + props[free_prop].wheelpos=Vector3(-0.67, -0.61,0.24); + if (!strncmp("dashboard-rh", meshname, 12)) props[free_prop].wheelpos=Vector3(0.67, -0.61,0.24); + } + char propname[256]; + sprintf(propname, "prop-%s-%i", truckname, free_prop); + Entity *te = manager->createEntity(propname, meshname); + props[free_prop].snode=manager->getRootSceneNode()->createChildSceneNode(); + props[free_prop].snode->attachObject(te); + //hack for the spinprops + if (!strncmp("spinprop", meshname, 8)) + { + props[free_prop].spinner=1; + props[free_prop].snode->getAttachedObject(0)->setCastShadows(false); + props[free_prop].snode->setVisible(false); + } + if (!strncmp("pale", meshname, 4)) + { + props[free_prop].pale=1; + } + //hack for the translucent drivers seat + if (!strncmp("seat", meshname, 4) && !driversseatfound) {driversseatfound=true; te->setMaterialName("driversseat");}; + props[free_prop].beacontype='n'; + if (!strncmp("beacon", meshname, 6)) + { + props[free_prop].bpos[0]=2.0*3.14*((Real)rand()/(Real)RAND_MAX); + props[free_prop].brate[0]=4.0*3.14+((Real)rand()/(Real)RAND_MAX)-0.5; + props[free_prop].beacontype='b'; + props[free_prop].bbs[0]=0; + //the light + props[free_prop].light[0]=manager->createLight(propname); + props[free_prop].light[0]->setType(Light::LT_SPOTLIGHT); + props[free_prop].light[0]->setDiffuseColour( ColourValue(1.0, 0.5, 0.0)); + props[free_prop].light[0]->setSpecularColour( ColourValue(1.0, 0.5, 0.0)); + props[free_prop].light[0]->setAttenuation(50.0, 1.0, 0.3, 0.0); + props[free_prop].light[0]->setSpotlightRange( Degree(35), Degree(45) ); + props[free_prop].light[0]->setCastShadows(false); + props[free_prop].light[0]->setVisible(false); + //the flare billboard + props[free_prop].bbsnode[0] = manager->getRootSceneNode()->createChildSceneNode(); + props[free_prop].bbs[0]=manager->createBillboardSet(propname,1); + props[free_prop].bbs[0]->createBillboard(0,0,0); + props[free_prop].bbs[0]->setMaterialName("tracks/beaconflare"); + props[free_prop].bbsnode[0]->attachObject(props[free_prop].bbs[0]); + props[free_prop].bbsnode[0]->setVisible(false); + } + if (!strncmp("redbeacon", meshname, 9)) + { + props[free_prop].bpos[0]=0.0; + props[free_prop].brate[0]=1.0; + props[free_prop].beacontype='r'; + props[free_prop].bbs[0]=0; + //the light + props[free_prop].light[0]=manager->createLight(propname); + props[free_prop].light[0]->setType(Light::LT_POINT); + props[free_prop].light[0]->setDiffuseColour( ColourValue(1.0, 0.0, 0.0)); + props[free_prop].light[0]->setSpecularColour( ColourValue(1.0, 0.0, 0.0)); + props[free_prop].light[0]->setAttenuation(50.0, 1.0, 0.3, 0.0); + props[free_prop].light[0]->setCastShadows(false); + props[free_prop].light[0]->setVisible(false); + //the flare billboard + props[free_prop].bbsnode[0] = manager->getRootSceneNode()->createChildSceneNode(); + props[free_prop].bbs[0]=manager->createBillboardSet(propname,1); + props[free_prop].bbs[0]->createBillboard(0,0,0); + props[free_prop].bbs[0]->setMaterialName("tracks/redbeaconflare"); + props[free_prop].bbsnode[0]->attachObject(props[free_prop].bbs[0]); + props[free_prop].bbsnode[0]->setVisible(false); + props[free_prop].bbs[0]->setDefaultDimensions(1.0, 1.0); + } + if (!strncmp("lightbar", meshname, 6)) + { + int k; + ispolice=true; + props[free_prop].beacontype='p'; + for (k=0; k<4; k++) + { + props[free_prop].bpos[k]=2.0*3.14*((Real)rand()/(Real)RAND_MAX); + props[free_prop].brate[k]=4.0*3.14+((Real)rand()/(Real)RAND_MAX)-0.5; + props[free_prop].bbs[k]=0; + //the light + char rpname[256]; + sprintf(rpname,"%s-%i", propname, k); + props[free_prop].light[k]=manager->createLight(rpname); + props[free_prop].light[k]->setType(Light::LT_SPOTLIGHT); + if (k>1) + { + props[free_prop].light[k]->setDiffuseColour( ColourValue(1.0, 0.0, 0.0)); + props[free_prop].light[k]->setSpecularColour( ColourValue(1.0, 0.0, 0.0)); + } + else + { + props[free_prop].light[k]->setDiffuseColour( ColourValue(0.0, 0.5, 1.0)); + props[free_prop].light[k]->setSpecularColour( ColourValue(0.0, 0.5, 1.0)); + } + props[free_prop].light[k]->setAttenuation(50.0, 1.0, 0.3, 0.0); + props[free_prop].light[k]->setSpotlightRange( Degree(35), Degree(45) ); + props[free_prop].light[k]->setCastShadows(false); + props[free_prop].light[k]->setVisible(false); + //the flare billboard + props[free_prop].bbsnode[k] = manager->getRootSceneNode()->createChildSceneNode(); + props[free_prop].bbs[k]=manager->createBillboardSet(rpname,1); + props[free_prop].bbs[k]->createBillboard(0,0,0); + if (k>1) + props[free_prop].bbs[k]->setMaterialName("tracks/brightredflare"); + else + props[free_prop].bbs[k]->setMaterialName("tracks/brightblueflare"); + props[free_prop].bbsnode[k]->attachObject(props[free_prop].bbs[k]); + props[free_prop].bbsnode[k]->setVisible(false); + } + } + + free_prop++; + } + if (mode==21) + { + //parse globeams + sscanf(line,"%f, %f, %f, %s", &default_deform,&default_break,&default_beam_diameter, default_beam_material); + fadeDist=1000.0; + } + if (mode==22) + { + //parse wings + int nds[8]; + float txes[8]; + char type; + float cratio, mind, maxd; + char afname[256]; + sscanf(line,"%i, %i, %i, %i, %i, %i, %i, %i, %f, %f, %f, %f, %f, %f, %f, %f, %c, %f, %f, %f, %s", + &nds[0], + &nds[1], + &nds[2], + &nds[3], + &nds[4], + &nds[5], + &nds[6], + &nds[7], + &txes[0], + &txes[1], + &txes[2], + &txes[3], + &txes[4], + &txes[5], + &txes[6], + &txes[7], + &type, + &cratio, + &mind, + &maxd, + afname + ); + //visuals + char wname[256]; + sprintf(wname, "wing-%s-%i",truckname, free_wing); + char wnamei[256]; + sprintf(wnamei, "wingobj-%s-%i",truckname, free_wing); + wings[free_wing].fa=new FlexAirfoil(manager, wname, nodes, nds[0], nds[1], nds[2], nds[3], nds[4], nds[5], nds[6], nds[7], texname, Vector2(txes[0], txes[1]), Vector2(txes[2], txes[3]), Vector2(txes[4], txes[5]), Vector2(txes[6], txes[7]), type, cratio, mind, maxd, afname, turboprops ); + Entity *ec = manager->createEntity(wnamei, wname); + wings[free_wing].cnode = manager->getRootSceneNode()->createChildSceneNode(); + wings[free_wing].cnode->attachObject(ec); + //induced drag + if (wingstart==-1) {wingstart=free_wing;wingarea=warea(nodes[wings[free_wing].fa->nfld].Position, nodes[wings[free_wing].fa->nfrd].Position, nodes[wings[free_wing].fa->nbld].Position, nodes[wings[free_wing].fa->nbrd].Position);} + else + { + if (nds[1]!=wings[free_wing-1].fa->nfld) + { + //discontinuity + //inform ... [truncated message content] |
From: <ror...@us...> - 2007-06-22 22:56:18
|
Revision: 10 http://roreditor.svn.sourceforge.net/roreditor/?rev=10&view=rev Author: rorthomas Date: 2007-06-22 15:55:30 -0700 (Fri, 22 Jun 2007) Log Message: ----------- * added visualwx project for starter gui * removed truckchecker button from starter gui Modified Paths: -------------- trunk/lib/ror/settingsdialog.py Added Paths: ----------- trunk/devtools/ trunk/devtools/RoRSettingsDialog/ trunk/devtools/RoRSettingsDialog/App.py trunk/devtools/RoRSettingsDialog/MyDlg.pfr trunk/devtools/RoRSettingsDialog/MyDlg.pfr.bak trunk/devtools/RoRSettingsDialog/MyDlg.py trunk/devtools/RoRSettingsDialog/PrjScript/ trunk/devtools/RoRSettingsDialog/Project.pbc trunk/devtools/RoRSettingsDialog/Project.pbc.bak trunk/devtools/RoRSettingsDialog/VwXComponent.py Added: trunk/devtools/RoRSettingsDialog/App.py =================================================================== --- trunk/devtools/RoRSettingsDialog/App.py (rev 0) +++ trunk/devtools/RoRSettingsDialog/App.py 2007-06-22 22:55:30 UTC (rev 10) @@ -0,0 +1,21 @@ +# -*- coding: iso-8859-1 -*- +import wx + +provider = wx.SimpleHelpProvider() +wx.HelpProvider_Set(provider) + +import MyDlg + +class App(wx.App): + def OnInit(self): + wx.InitAllImageHandlers() + self.main = MyDlg.MyDlg(None,-1,'') + self.main.ShowModal() + return 0 + +def main(): + application = App(0) + application.MainLoop() + +if __name__ == '__main__': + main() Added: trunk/devtools/RoRSettingsDialog/MyDlg.pfr =================================================================== --- trunk/devtools/RoRSettingsDialog/MyDlg.pfr (rev 0) +++ trunk/devtools/RoRSettingsDialog/MyDlg.pfr 2007-06-22 22:55:30 UTC (rev 10) @@ -0,0 +1,1801 @@ +[InitFile] +init=134324 +[ProgettoDati] +l_ProtettoDesigne=0 +l_ReadOnly=0 +l_compilare=0 +l_linkare=0 +l_tipoCompilatore=1 +l_RigeneraSempre=0 +l_syncCompil= +l_objDir= +b_salvato=1 +s_tipoFile=15 +ClsparentCompTipo=0 +l_framTipo=0 +VisualWxVersion=0.87.6.0 +VisualWxIdent=8725 +l_hasAutoSize=1 +strTree=00it=4 01it=5 01it=6 02it=7 02it=8 01it=11 02it=12 03it=13 04it=15 05it=16 05it=17 04it=18 05it=19 05it=20 02it=21 03it=22 04it=23 04it=24 01it=25 02it=26 03it=27 03it=28 03it=29 03it=30 +[Controlli] +n=18 +[Form] +n=1 +ws_name=MyDlg.pfr +ws_dir=.\\ +i_id=31 +s_tipoFile=15 +s_tipoComp=0 +wx_WindowFileADD=-1163005939 +1=15 +[Windows1] +style=wxCAPTION|wxSYSTEM_MENU|wxDIALOG_NO_PARENT|wxDEFAULT_DIALOG_STYLE +Estyle= +i_stylePN=27 +idIncCmpFilCmp=1002 +i_tipoComp=15 +isContenitor=1 +validator= +s_name=MyDlg +subClassName= +i_index=-1 +i_left=0 +i_top=0 +i_height=600 +i_width=500 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_Title=RoR Toolkit +s_tipoWxClasse=wxDialog +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=0 +b_nocreate=0 +ClsMtr= +ClsTypF=*crt* +npaint=0 +idIdentCmp=10001 +s_idIdentCmp=ID_CMP_1 +t_idIdentCmp=1 +i_idPArent=0 +i_id=2 +parCompID=0 +i_sizeGrow=0 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=33008 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=0 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +[Windows1/imageName] +4=D:/projects/old/rorterraineditor_0_0_3/ror.ico +[Windows1/imageFlag] +4=0 +[Windows1/imageTipo] +4=1 +[Windows1/style] +17=1 +19=1 +24=1 +25=1 +[Windows1/Estyle] +4=1 +[Windows1/i_width] +[Windows1/i_width/Windows1] +Theme=0 +[Windows1/funcCode] +InitSource=0txt### -*- coding: iso-8859-1 -*-0txt##F1txt##1txt##F2txt##2txt##F3txt##3txt##F4txt##4txt##F +EnableCtor=enable +FocusComp=0 +enableHeaders=enable +[Windows1/funcCode/listEventAll] +count=0 +[Windows1/sizerProp] +0=1 +1=1 +2=1 +3=1 +13=1 +[StatusBar] +ver=1 +count=0 +numCol=3 +enableStBar=false +enableStyle=1 +[Windows2] +style= +Estyle= +i_stylePN=16 +idIncCmpFilCmp=0 +i_tipoComp=700500 +isContenitor=1 +validator= +s_name=panelBitmap +subClassName= +i_index=-1 +i_left=3 +i_top=3 +i_height=223 +i_width=500 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_Title=RoR Toolkit +s_tipoWxClasse=wxPanel +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=0 +b_nocreate=0 +ClsMtr=*win**panel* +ClsTypF= +npaint=0 +idIdentCmp=10003 +s_idIdentCmp=ID_CMP_3 +t_idIdentCmp=1 +i_idPArent=4 +i_id=5 +parCompID=0 +i_sizeGrow=1 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=1 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=12 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +IndexOfS=0 +[Windows2/event] +3=2 +[Windows2/imageName] +0=D:/projects/old/rorterraineditor_0_0_3/splash.bmp +[Windows2/imageFlag] +0=1 +[Windows2/imageTipo] +0=0 +[Windows2/i_width] +[Windows2/i_width/Windows2] +Theme=0 +[Windows2/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[Windows3] +style= +Estyle= +i_stylePN=30 +idIncCmpFilCmp=0 +i_tipoComp=600052 +isContenitor=0 +validator= +s_name=txtRoRDir +subClassName= +i_index=-1 +i_left=6 +i_top=137 +i_height=21 +i_width=100 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_tipoWxClasse=wxTextCtrl +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=0 +b_nocreate=0 +ClsMtr=*crt* +ClsTypF= +npaint=0 +idIdentCmp=10004 +s_idIdentCmp=ID_CMP_4 +t_idIdentCmp=1 +i_idPArent=6 +i_id=7 +parCompID=0 +i_sizeGrow=1 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=16 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +IndexOfS=0 +[Windows3/i_width] +[Windows3/i_width/Windows3] +Theme=0 +[Windows3/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[Windows4] +style= +Estyle= +i_stylePN=21 +idIncCmpFilCmp=0 +i_tipoComp=600060 +isContenitor=0 +validator= +s_name=btnSelectRoRDir +subClassName= +i_index=-1 +i_left=353 +i_top=137 +i_height=21 +i_width=75 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_tipoWxClasse=wxButton +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=0 +b_nocreate=0 +ClsMtr=*crt* +ClsTypF= +npaint=0 +idIdentCmp=10005 +s_idIdentCmp=ID_CMP_5 +t_idIdentCmp=1 +i_idPArent=6 +i_id=8 +parCompID=0 +i_sizeGrow=0 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=16 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +IndexOfS=1 +[Windows4/i_width] +[Windows4/i_width/Windows4] +Theme=0 +[Windows4/i_propN] +0=SelectRoR +[Windows4/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[Windows5] +style= +Estyle= +i_stylePN=23 +idIncCmpFilCmp=0 +i_tipoComp=700506 +isContenitor=1 +validator= +s_name=wxnb11c +subClassName= +i_index=-1 +i_left=3 +i_top=281 +i_height=20 +i_width=20 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_tipoWxClasse=wxNotebook +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=3 +b_NOparentDesComp=0 +b_nocreate=0 +ClsMtr=*win* +ClsTypF= +npaint=0 +idIdentCmp=10008 +s_idIdentCmp=ID_CMP_8 +t_idIdentCmp=1 +i_idPArent=4 +i_id=11 +parCompID=0 +i_sizeGrow=1 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=28 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +IndexOfS=2 +[Windows5/i_width] +[Windows5/i_width/Windows5] +Theme=0 +[Windows5/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[Windows6] +style= +Estyle= +i_stylePN=16 +idIncCmpFilCmp=0 +i_tipoComp=700500 +isContenitor=1 +validator= +s_name=pn12c +subClassName= +i_index=-1 +i_left=4 +i_top=22 +i_height=103 +i_width=420 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_tipoWxClasse=wxPanel +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=3 +b_nocreate=0 +ClsMtr=*win**panel* +ClsTypF= +npaint=0 +idIdentCmp=10009 +s_idIdentCmp=ID_CMP_9 +t_idIdentCmp=1 +i_idPArent=0 +i_id=12 +parCompID=11 +i_sizeGrow=0 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=12 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +[Windows6/i_width] +[Windows6/i_width/Windows6] +Theme=0 +[Windows6/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[Windows7] +style=wxST_NO_AUTORESIZE +Estyle= +i_stylePN=20 +idIncCmpFilCmp=0 +i_tipoComp=600051 +isContenitor=0 +validator= +s_name=lblFPS +subClassName= +i_index=-1 +i_left=6 +i_top=6 +i_height=13 +i_width=50 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_tipoWxClasse=wxStaticText +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=0 +b_nocreate=0 +ClsMtr=*crt* +ClsTypF= +npaint=0 +idIdentCmp=10011 +s_idIdentCmp=ID_CMP_11 +t_idIdentCmp=1 +i_idPArent=15 +i_id=16 +parCompID=12 +i_sizeGrow=0 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=16 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +IndexOfS=0 +[Windows7/style] +20=1 +[Windows7/i_width] +[Windows7/i_width/Windows7] +Theme=0 +[Windows7/i_propN] +0=FPS: 30 +[Windows7/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[Windows8] +style= +Estyle= +i_stylePN=16 +idIncCmpFilCmp=0 +i_tipoComp=600066 +isContenitor=0 +validator= +s_name=sbFPS +subClassName= +i_index=-1 +i_left=62 +i_top=6 +i_height=20 +i_width=20 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_tipoWxClasse=wxScrollBar +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=0 +b_nocreate=0 +ClsMtr=*crt* +ClsTypF= +npaint=0 +idIdentCmp=10012 +s_idIdentCmp=ID_CMP_12 +t_idIdentCmp=1 +i_idPArent=15 +i_id=17 +parCompID=12 +i_sizeGrow=1 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=16 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +IndexOfS=1 +[Windows8/event] +29=1 +[Windows8/i_width] +[Windows8/i_width/Windows8] +Theme=0 +[Windows8/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[Windows9] +style=wxST_NO_AUTORESIZE +Estyle= +i_stylePN=20 +idIncCmpFilCmp=0 +i_tipoComp=600051 +isContenitor=0 +validator= +s_name=lblWaterTrans +subClassName= +i_index=-1 +i_left=6 +i_top=38 +i_height=20 +i_width=145 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_tipoWxClasse=wxStaticText +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=0 +b_nocreate=0 +ClsMtr=*crt* +ClsTypF= +npaint=0 +idIdentCmp=10013 +s_idIdentCmp=ID_CMP_13 +t_idIdentCmp=1 +i_idPArent=18 +i_id=19 +parCompID=12 +i_sizeGrow=0 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=16 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +IndexOfS=0 +[Windows9/style] +20=1 +[Windows9/i_width] +[Windows9/i_width/Windows9] +Theme=0 +[Windows9/i_propN] +0=Water Transparency: 10% +[Windows9/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[Windows10] +style= +Estyle= +i_stylePN=16 +idIncCmpFilCmp=0 +i_tipoComp=600066 +isContenitor=0 +validator= +s_name=sbWaterTrans +subClassName= +i_index=-1 +i_left=157 +i_top=38 +i_height=20 +i_width=20 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_tipoWxClasse=wxScrollBar +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=0 +b_nocreate=0 +ClsMtr=*crt* +ClsTypF= +npaint=0 +idIdentCmp=10014 +s_idIdentCmp=ID_CMP_14 +t_idIdentCmp=1 +i_idPArent=18 +i_id=20 +parCompID=12 +i_sizeGrow=1 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=16 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +IndexOfS=1 +[Windows10/event] +29=1 +[Windows10/i_width] +[Windows10/i_width/Windows10] +Theme=0 +[Windows10/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[Windows11] +style= +Estyle= +i_stylePN=16 +idIncCmpFilCmp=0 +i_tipoComp=700500 +isContenitor=1 +validator= +s_name=pn21c +subClassName= +i_index=-1 +i_left=0 +i_top=0 +i_height=20 +i_width=20 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_tipoWxClasse=wxPanel +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=3 +b_nocreate=0 +ClsMtr=*win**panel* +ClsTypF= +npaint=0 +idIdentCmp=10015 +s_idIdentCmp=ID_CMP_15 +t_idIdentCmp=1 +i_idPArent=0 +i_id=21 +parCompID=11 +i_sizeGrow=0 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=12 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +[Windows11/i_width] +[Windows11/i_width/Windows11] +Theme=0 +[Windows11/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[Windows12] +style= +Estyle= +i_stylePN=21 +idIncCmpFilCmp=0 +i_tipoComp=600060 +isContenitor=0 +validator= +s_name=btnCheckUpdates +subClassName= +i_index=-1 +i_left=3 +i_top=3 +i_height=25 +i_width=412 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_tipoWxClasse=wxButton +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=0 +b_nocreate=0 +ClsMtr=*crt* +ClsTypF= +npaint=0 +idIdentCmp=10016 +s_idIdentCmp=ID_CMP_16 +t_idIdentCmp=1 +i_idPArent=22 +i_id=23 +parCompID=21 +i_sizeGrow=0 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=16 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +IndexOfS=0 +[Windows12/event] +29=1 +[Windows12/i_width] +[Windows12/i_width/Windows12] +Theme=0 +[Windows12/i_propN] +0=Check for Updates! +[Windows12/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[Windows13] +style=wxST_NO_AUTORESIZE +Estyle= +i_stylePN=20 +idIncCmpFilCmp=0 +i_tipoComp=600051 +isContenitor=0 +validator= +s_name=lblUpdates +subClassName= +i_index=-1 +i_left=3 +i_top=34 +i_height=18 +i_width=412 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_tipoWxClasse=wxStaticText +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=0 +b_nocreate=0 +ClsMtr=*crt* +ClsTypF= +npaint=0 +idIdentCmp=10017 +s_idIdentCmp=ID_CMP_17 +t_idIdentCmp=1 +i_idPArent=22 +i_id=24 +parCompID=21 +i_sizeGrow=1 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=16 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +IndexOfS=1 +[Windows13/style] +20=1 +[Windows13/i_width] +[Windows13/i_width/Windows13] +Theme=0 +[Windows13/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[Windows14] +style= +Estyle= +i_stylePN=16 +idIncCmpFilCmp=0 +i_tipoComp=700500 +isContenitor=1 +validator= +s_name=btnStartTerrain +subClassName= +i_index=-1 +i_left=3 +i_top=302 +i_height=45 +i_width=428 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_tipoWxClasse=wxPanel +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=0 +b_nocreate=0 +ClsMtr=*win**panel* +ClsTypF= +npaint=0 +idIdentCmp=10018 +s_idIdentCmp=ID_CMP_18 +t_idIdentCmp=1 +i_idPArent=4 +i_id=25 +parCompID=0 +i_sizeGrow=0 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=12 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +IndexOfS=3 +[Windows14/i_width] +[Windows14/i_width/Windows14] +Theme=0 +[Windows14/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[Windows15] +style= +Estyle= +i_stylePN=21 +idIncCmpFilCmp=0 +i_tipoComp=600060 +isContenitor=0 +validator= +s_name=btnStartRoR +subClassName= +i_index=-1 +i_left=3 +i_top=3 +i_height=20 +i_width=20 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_tipoWxClasse=wxButton +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=0 +b_nocreate=0 +ClsMtr=*crt* +ClsTypF= +npaint=0 +idIdentCmp=10019 +s_idIdentCmp=ID_CMP_19 +t_idIdentCmp=1 +i_idPArent=26 +i_id=27 +parCompID=25 +i_sizeGrow=1 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=16 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +IndexOfS=0 +[Windows15/event] +29=1 +[Windows15/i_width] +[Windows15/i_width/Windows15] +Theme=0 +[Windows15/i_propN] +0=Start RoR +[Windows15/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[Windows16] +style= +Estyle= +i_stylePN=21 +idIncCmpFilCmp=0 +i_tipoComp=600060 +isContenitor=0 +validator= +s_name=btnTerrainEditor +subClassName= +i_index=-1 +i_left=88 +i_top=3 +i_height=20 +i_width=20 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_tipoWxClasse=wxButton +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=0 +b_nocreate=0 +ClsMtr=*crt* +ClsTypF= +npaint=0 +idIdentCmp=10020 +s_idIdentCmp=ID_CMP_20 +t_idIdentCmp=1 +i_idPArent=26 +i_id=28 +parCompID=25 +i_sizeGrow=1 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=16 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +IndexOfS=1 +[Windows16/event] +29=1 +[Windows16/i_width] +[Windows16/i_width/Windows16] +Theme=0 +[Windows16/i_propN] +0=Terrain Editor +[Windows16/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[Windows17] +style= +Estyle= +i_stylePN=21 +idIncCmpFilCmp=0 +i_tipoComp=600060 +isContenitor=0 +validator= +s_name=btnTruckEditor +subClassName= +i_index=-1 +i_left=173 +i_top=3 +i_height=20 +i_width=20 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=false +s_tipoWxClasse=wxButton +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=0 +b_nocreate=0 +ClsMtr=*crt* +ClsTypF= +npaint=0 +idIdentCmp=10021 +s_idIdentCmp=ID_CMP_21 +t_idIdentCmp=1 +i_idPArent=26 +i_id=29 +parCompID=25 +i_sizeGrow=1 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=16 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +IndexOfS=2 +[Windows17/event] +29=1 +[Windows17/i_width] +[Windows17/i_width/Windows17] +Theme=0 +[Windows17/i_propN] +0=Truck Editor +[Windows17/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[Windows18] +style= +Estyle= +i_stylePN=21 +idIncCmpFilCmp=0 +i_tipoComp=600060 +isContenitor=0 +validator= +s_name=btnExit +subClassName= +i_index=-1 +i_left=343 +i_top=3 +i_height=20 +i_width=20 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_tipoWxClasse=wxButton +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=0 +b_nocreate=0 +ClsMtr=*crt* +ClsTypF= +npaint=0 +idIdentCmp=10022 +s_idIdentCmp=ID_CMP_22 +t_idIdentCmp=1 +i_idPArent=26 +i_id=30 +parCompID=25 +i_sizeGrow=1 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=16 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +IndexOfS=3 +[Windows18/event] +29=1 +[Windows18/i_width] +[Windows18/i_width/Windows18] +Theme=0 +[Windows18/i_propN] +0=Exit +[Windows18/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[sizer] +nSiz=7 +[sizerWin1] +i_Col=2 +i_SpCol=0 +i_Row=2 +i_SpRow=0 +s_text= +s_name=sz4s +subClassName= +i_tipoComp=600002 +b_sizeMinAb=0 +i_minSizeH=0 +i_minSizeW=0 +l_nComInSiz=4 +i_idPArent=0 +i_id=4 +i_sizeGrow=0 +i_border=3 +is_parent=1 +is_siz=1 +s_tipoWxClasse=wxBoxSizer +isfuncClsName=0 +funcClsName= +is_parentId=2 +ClsMtr=*siz* +ClsTypF= +npaint=0 +l_sizAutoLayout=1 +i_left=0 +i_top=0 +i_height=10 +i_width=10 +s_info= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +SizeSpaceW=10 +SizeSpaceH=20 +idIncCmpFilCmp=1009 +siz_style=41200 +childSiz=5:6:11:25 +[sizerWin1/id] +0=5 +1=6 +2=11 +3=25 +[sizerWin1/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[sizerWin2] +i_Col=2 +i_SpCol=0 +i_Row=2 +i_SpRow=0 +s_text= +s_name=sz6s +subClassName= +i_tipoComp=600003 +b_sizeMinAb=0 +i_minSizeH=0 +i_minSizeW=0 +l_nComInSiz=2 +i_idPArent=4 +i_id=6 +i_sizeGrow=0 +i_border=3 +is_parent=0 +is_siz=1 +s_tipoWxClasse=wxBoxSizer +isfuncClsName=0 +funcClsName= +is_parentId=2 +ClsMtr=*siz* +ClsTypF= +npaint=0 +l_sizAutoLayout=0 +i_left=0 +i_top=0 +i_height=10 +i_width=10 +s_info= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +SizeSpaceW=10 +SizeSpaceH=20 +idIncCmpFilCmp=1011 +IndexOfS=1 +siz_style=41200 +childSiz=7:8 +[sizerWin2/id] +0=7 +1=8 +[sizerWin2/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[sizerWin3] +i_Col=2 +i_SpCol=0 +i_Row=2 +i_SpRow=0 +s_text= +s_name=sz13s +subClassName= +i_tipoComp=600002 +b_sizeMinAb=0 +i_minSizeH=0 +i_minSizeW=0 +l_nComInSiz=2 +i_idPArent=0 +i_id=13 +i_sizeGrow=0 +i_border=3 +is_parent=1 +is_siz=1 +s_tipoWxClasse=wxBoxSizer +isfuncClsName=0 +funcClsName= +is_parentId=12 +ClsMtr=*siz* +ClsTypF= +npaint=0 +l_sizAutoLayout=1 +i_left=0 +i_top=0 +i_height=10 +i_width=10 +s_info= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +SizeSpaceW=10 +SizeSpaceH=20 +idIncCmpFilCmp=1018 +siz_style=41200 +childSiz=15:18 +[sizerWin3/id] +0=15 +1=18 +[sizerWin3/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[sizerWin4] +i_Col=2 +i_SpCol=0 +i_Row=2 +i_SpRow=0 +s_text= +s_name=sz15s +subClassName= +i_tipoComp=600003 +b_sizeMinAb=0 +i_minSizeH=0 +i_minSizeW=0 +l_nComInSiz=2 +i_idPArent=13 +i_id=15 +i_sizeGrow=0 +i_border=3 +is_parent=0 +is_siz=1 +s_tipoWxClasse=wxBoxSizer +isfuncClsName=0 +funcClsName= +is_parentId=12 +ClsMtr=*siz* +ClsTypF= +npaint=0 +l_sizAutoLayout=0 +i_left=0 +i_top=0 +i_height=10 +i_width=10 +s_info= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +SizeSpaceW=10 +SizeSpaceH=20 +idIncCmpFilCmp=1020 +IndexOfS=0 +siz_style=41200 +childSiz=16:17 +[sizerWin4/id] +0=16 +1=17 +[sizerWin4/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[sizerWin5] +i_Col=2 +i_SpCol=0 +i_Row=2 +i_SpRow=0 +s_text= +s_name=sz18s +subClassName= +i_tipoComp=600003 +b_sizeMinAb=0 +i_minSizeH=0 +i_minSizeW=0 +l_nComInSiz=2 +i_idPArent=13 +i_id=18 +i_sizeGrow=0 +i_border=3 +is_parent=0 +is_siz=1 +s_tipoWxClasse=wxBoxSizer +isfuncClsName=0 +funcClsName= +is_parentId=12 +ClsMtr=*siz* +ClsTypF= +npaint=0 +l_sizAutoLayout=0 +i_left=0 +i_top=0 +i_height=10 +i_width=10 +s_info= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +SizeSpaceW=10 +SizeSpaceH=20 +idIncCmpFilCmp=1023 +IndexOfS=1 +siz_style=41200 +childSiz=19:20 +[sizerWin5/id] +0=19 +1=20 +[sizerWin5/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[sizerWin6] +i_Col=2 +i_SpCol=0 +i_Row=2 +i_SpRow=0 +s_text= +s_name=sz22s +subClassName= +i_tipoComp=600002 +b_sizeMinAb=0 +i_minSizeH=0 +i_minSizeW=0 +l_nComInSiz=2 +i_idPArent=0 +i_id=22 +i_sizeGrow=0 +i_border=3 +is_parent=1 +is_siz=1 +s_tipoWxClasse=wxBoxSizer +isfuncClsName=0 +funcClsName= +is_parentId=21 +ClsMtr=*siz* +ClsTypF= +npaint=0 +l_sizAutoLayout=1 +i_left=0 +i_top=0 +i_height=10 +i_width=10 +s_info= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +SizeSpaceW=10 +SizeSpaceH=20 +idIncCmpFilCmp=1027 +siz_style=41200 +childSiz=23:24 +[sizerWin6/id] +0=23 +1=24 +[sizerWin6/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[sizerWin7] +i_Col=2 +i_SpCol=0 +i_Row=2 +i_SpRow=0 +s_text= +s_name=sz26s +subClassName= +i_tipoComp=600003 +b_sizeMinAb=0 +i_minSizeH=0 +i_minSizeW=0 +l_nComInSiz=4 +i_idPArent=0 +i_id=26 +i_sizeGrow=0 +i_border=3 +is_parent=1 +is_siz=1 +s_tipoWxClasse=wxBoxSizer +isfuncClsName=0 +funcClsName= +is_parentId=25 +ClsMtr=*siz* +ClsTypF= +npaint=0 +l_sizAutoLayout=1 +i_left=0 +i_top=0 +i_height=10 +i_width=10 +s_info= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +SizeSpaceW=10 +SizeSpaceH=20 +idIncCmpFilCmp=1031 +siz_style=41200 +childSiz=27:28:29:30 +[sizerWin7/id] +0=27 +1=28 +2=29 +3=30 +[sizerWin7/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[menu] +[menu/numero] +n=0 +[EndFile] +end=134324 Added: trunk/devtools/RoRSettingsDialog/MyDlg.pfr.bak =================================================================== --- trunk/devtools/RoRSettingsDialog/MyDlg.pfr.bak (rev 0) +++ trunk/devtools/RoRSettingsDialog/MyDlg.pfr.bak 2007-06-22 22:55:30 UTC (rev 10) @@ -0,0 +1,1880 @@ +[InitFile] +init=134324 +[ProgettoDati] +l_ProtettoDesigne=0 +l_ReadOnly=0 +l_compilare=0 +l_linkare=0 +l_tipoCompilatore=1 +l_RigeneraSempre=0 +l_syncCompil= +l_objDir= +b_salvato=1 +s_tipoFile=15 +ClsparentCompTipo=0 +l_framTipo=0 +VisualWxVersion=0.87.6.0 +VisualWxIdent=8725 +l_hasAutoSize=1 +strTree=00it=4 01it=5 01it=6 02it=7 02it=8 01it=11 02it=12 03it=13 04it=15 05it=16 05it=17 04it=18 05it=19 05it=20 02it=21 03it=22 04it=23 04it=24 01it=25 02it=26 03it=27 03it=28 03it=29 03it=31 03it=30 +[Controlli] +n=19 +[Form] +n=1 +ws_name=MyDlg.pfr +ws_dir=.\\ +i_id=31 +s_tipoFile=15 +s_tipoComp=0 +wx_WindowFileADD=-1163005939 +1=15 +[Windows1] +style=wxCAPTION|wxSYSTEM_MENU|wxDIALOG_NO_PARENT|wxDEFAULT_DIALOG_STYLE +Estyle= +i_stylePN=27 +idIncCmpFilCmp=1002 +i_tipoComp=15 +isContenitor=1 +validator= +s_name=MyDlg +subClassName= +i_index=-1 +i_left=0 +i_top=0 +i_height=600 +i_width=500 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_Title=RoR Toolkit +s_tipoWxClasse=wxDialog +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=0 +b_nocreate=0 +ClsMtr= +ClsTypF=*crt* +npaint=0 +idIdentCmp=10001 +s_idIdentCmp=ID_CMP_1 +t_idIdentCmp=1 +i_idPArent=0 +i_id=2 +parCompID=0 +i_sizeGrow=0 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=33008 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=0 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +[Windows1/imageName] +4=D:/projects/old/rorterraineditor_0_0_3/ror.ico +[Windows1/imageFlag] +4=0 +[Windows1/imageTipo] +4=1 +[Windows1/style] +17=1 +19=1 +24=1 +25=1 +[Windows1/Estyle] +4=1 +[Windows1/i_width] +[Windows1/i_width/Windows1] +Theme=0 +[Windows1/funcCode] +InitSource=0txt### -*- coding: iso-8859-1 -*-0txt##F1txt##1txt##F2txt##2txt##F3txt##3txt##F4txt##4txt##F +EnableCtor=enable +FocusComp=0 +enableHeaders=enable +[Windows1/funcCode/listEventAll] +count=0 +[Windows1/sizerProp] +0=1 +1=1 +2=1 +3=1 +13=1 +[StatusBar] +ver=1 +count=0 +numCol=3 +enableStBar=false +enableStyle=1 +[Windows2] +style= +Estyle= +i_stylePN=16 +idIncCmpFilCmp=1010 +i_tipoComp=700500 +isContenitor=1 +validator= +s_name=panelBitmap +subClassName= +i_index=-1 +i_left=3 +i_top=3 +i_height=223 +i_width=500 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_Title=RoR Toolkit +s_tipoWxClasse=wxPanel +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=0 +b_nocreate=0 +ClsMtr=*win**panel* +ClsTypF= +npaint=0 +idIdentCmp=10003 +s_idIdentCmp=ID_CMP_3 +t_idIdentCmp=1 +i_idPArent=4 +i_id=5 +parCompID=0 +i_sizeGrow=1 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=1 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=12 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +IndexOfS=0 +[Windows2/event] +3=2 +[Windows2/imageName] +0=D:/projects/old/rorterraineditor_0_0_3/splash.bmp +[Windows2/imageFlag] +0=1 +[Windows2/imageTipo] +0=0 +[Windows2/i_width] +[Windows2/i_width/Windows2] +Theme=0 +[Windows2/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[Windows3] +style= +Estyle= +i_stylePN=30 +idIncCmpFilCmp=1012 +i_tipoComp=600052 +isContenitor=0 +validator= +s_name=txtRoRDir +subClassName= +i_index=-1 +i_left=6 +i_top=137 +i_height=21 +i_width=100 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_tipoWxClasse=wxTextCtrl +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=0 +b_nocreate=0 +ClsMtr=*crt* +ClsTypF= +npaint=0 +idIdentCmp=10004 +s_idIdentCmp=ID_CMP_4 +t_idIdentCmp=1 +i_idPArent=6 +i_id=7 +parCompID=0 +i_sizeGrow=1 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=16 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +IndexOfS=0 +[Windows3/i_width] +[Windows3/i_width/Windows3] +Theme=0 +[Windows3/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[Windows4] +style= +Estyle= +i_stylePN=21 +idIncCmpFilCmp=1013 +i_tipoComp=600060 +isContenitor=0 +validator= +s_name=btnSelectRoRDir +subClassName= +i_index=-1 +i_left=353 +i_top=137 +i_height=21 +i_width=75 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_tipoWxClasse=wxButton +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=0 +b_nocreate=0 +ClsMtr=*crt* +ClsTypF= +npaint=0 +idIdentCmp=10005 +s_idIdentCmp=ID_CMP_5 +t_idIdentCmp=1 +i_idPArent=6 +i_id=8 +parCompID=0 +i_sizeGrow=0 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=16 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +IndexOfS=1 +[Windows4/i_width] +[Windows4/i_width/Windows4] +Theme=0 +[Windows4/i_propN] +0=SelectRoR +[Windows4/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[Windows5] +style= +Estyle= +i_stylePN=23 +idIncCmpFilCmp=1016 +i_tipoComp=700506 +isContenitor=1 +validator= +s_name=wxnb11c +subClassName= +i_index=-1 +i_left=3 +i_top=281 +i_height=20 +i_width=20 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_tipoWxClasse=wxNotebook +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=3 +b_NOparentDesComp=0 +b_nocreate=0 +ClsMtr=*win* +ClsTypF= +npaint=0 +idIdentCmp=10008 +s_idIdentCmp=ID_CMP_8 +t_idIdentCmp=1 +i_idPArent=4 +i_id=11 +parCompID=0 +i_sizeGrow=1 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=28 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +IndexOfS=2 +[Windows5/i_width] +[Windows5/i_width/Windows5] +Theme=0 +[Windows5/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[Windows6] +style= +Estyle= +i_stylePN=16 +idIncCmpFilCmp=1017 +i_tipoComp=700500 +isContenitor=1 +validator= +s_name=pn12c +subClassName= +i_index=-1 +i_left=4 +i_top=22 +i_height=103 +i_width=420 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_tipoWxClasse=wxPanel +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=3 +b_nocreate=0 +ClsMtr=*win**panel* +ClsTypF= +npaint=0 +idIdentCmp=10009 +s_idIdentCmp=ID_CMP_9 +t_idIdentCmp=1 +i_idPArent=0 +i_id=12 +parCompID=11 +i_sizeGrow=0 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=12 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +[Windows6/i_width] +[Windows6/i_width/Windows6] +Theme=0 +[Windows6/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[Windows7] +style=wxST_NO_AUTORESIZE +Estyle= +i_stylePN=20 +idIncCmpFilCmp=1021 +i_tipoComp=600051 +isContenitor=0 +validator= +s_name=lblFPS +subClassName= +i_index=-1 +i_left=6 +i_top=6 +i_height=13 +i_width=50 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_tipoWxClasse=wxStaticText +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=0 +b_nocreate=0 +ClsMtr=*crt* +ClsTypF= +npaint=0 +idIdentCmp=10011 +s_idIdentCmp=ID_CMP_11 +t_idIdentCmp=1 +i_idPArent=15 +i_id=16 +parCompID=12 +i_sizeGrow=0 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=16 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +IndexOfS=0 +[Windows7/style] +20=1 +[Windows7/i_width] +[Windows7/i_width/Windows7] +Theme=0 +[Windows7/i_propN] +0=FPS: 30 +[Windows7/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[Windows8] +style= +Estyle= +i_stylePN=16 +idIncCmpFilCmp=1022 +i_tipoComp=600066 +isContenitor=0 +validator= +s_name=sbFPS +subClassName= +i_index=-1 +i_left=62 +i_top=6 +i_height=20 +i_width=20 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_tipoWxClasse=wxScrollBar +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=0 +b_nocreate=0 +ClsMtr=*crt* +ClsTypF= +npaint=0 +idIdentCmp=10012 +s_idIdentCmp=ID_CMP_12 +t_idIdentCmp=1 +i_idPArent=15 +i_id=17 +parCompID=12 +i_sizeGrow=1 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=16 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +IndexOfS=1 +[Windows8/event] +29=1 +[Windows8/i_width] +[Windows8/i_width/Windows8] +Theme=0 +[Windows8/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[Windows9] +style=wxST_NO_AUTORESIZE +Estyle= +i_stylePN=20 +idIncCmpFilCmp=1024 +i_tipoComp=600051 +isContenitor=0 +validator= +s_name=lblWaterTrans +subClassName= +i_index=-1 +i_left=6 +i_top=38 +i_height=20 +i_width=145 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_tipoWxClasse=wxStaticText +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=0 +b_nocreate=0 +ClsMtr=*crt* +ClsTypF= +npaint=0 +idIdentCmp=10013 +s_idIdentCmp=ID_CMP_13 +t_idIdentCmp=1 +i_idPArent=18 +i_id=19 +parCompID=12 +i_sizeGrow=0 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=16 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +IndexOfS=0 +[Windows9/style] +20=1 +[Windows9/i_width] +[Windows9/i_width/Windows9] +Theme=0 +[Windows9/i_propN] +0=Water Transparency: 10% +[Windows9/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[Windows10] +style= +Estyle= +i_stylePN=16 +idIncCmpFilCmp=1025 +i_tipoComp=600066 +isContenitor=0 +validator= +s_name=sbWaterTrans +subClassName= +i_index=-1 +i_left=157 +i_top=38 +i_height=20 +i_width=20 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_tipoWxClasse=wxScrollBar +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=0 +b_nocreate=0 +ClsMtr=*crt* +ClsTypF= +npaint=0 +idIdentCmp=10014 +s_idIdentCmp=ID_CMP_14 +t_idIdentCmp=1 +i_idPArent=18 +i_id=20 +parCompID=12 +i_sizeGrow=1 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=16 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +IndexOfS=1 +[Windows10/event] +29=1 +[Windows10/i_width] +[Windows10/i_width/Windows10] +Theme=0 +[Windows10/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[Windows11] +style= +Estyle= +i_stylePN=16 +idIncCmpFilCmp=1026 +i_tipoComp=700500 +isContenitor=1 +validator= +s_name=pn21c +subClassName= +i_index=-1 +i_left=0 +i_top=0 +i_height=20 +i_width=20 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_tipoWxClasse=wxPanel +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=3 +b_nocreate=0 +ClsMtr=*win**panel* +ClsTypF= +npaint=0 +idIdentCmp=10015 +s_idIdentCmp=ID_CMP_15 +t_idIdentCmp=1 +i_idPArent=0 +i_id=21 +parCompID=11 +i_sizeGrow=0 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=12 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +[Windows11/i_width] +[Windows11/i_width/Windows11] +Theme=0 +[Windows11/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[Windows12] +style= +Estyle= +i_stylePN=21 +idIncCmpFilCmp=1028 +i_tipoComp=600060 +isContenitor=0 +validator= +s_name=btnCheckUpdates +subClassName= +i_index=-1 +i_left=3 +i_top=3 +i_height=25 +i_width=412 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_tipoWxClasse=wxButton +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=0 +b_nocreate=0 +ClsMtr=*crt* +ClsTypF= +npaint=0 +idIdentCmp=10016 +s_idIdentCmp=ID_CMP_16 +t_idIdentCmp=1 +i_idPArent=22 +i_id=23 +parCompID=21 +i_sizeGrow=0 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=16 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +IndexOfS=0 +[Windows12/event] +29=1 +[Windows12/i_width] +[Windows12/i_width/Windows12] +Theme=0 +[Windows12/i_propN] +0=Check for Updates! +[Windows12/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[Windows13] +style=wxST_NO_AUTORESIZE +Estyle= +i_stylePN=20 +idIncCmpFilCmp=1029 +i_tipoComp=600051 +isContenitor=0 +validator= +s_name=lblUpdates +subClassName= +i_index=-1 +i_left=3 +i_top=34 +i_height=18 +i_width=412 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_tipoWxClasse=wxStaticText +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=0 +b_nocreate=0 +ClsMtr=*crt* +ClsTypF= +npaint=0 +idIdentCmp=10017 +s_idIdentCmp=ID_CMP_17 +t_idIdentCmp=1 +i_idPArent=22 +i_id=24 +parCompID=21 +i_sizeGrow=1 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=16 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +IndexOfS=1 +[Windows13/style] +20=1 +[Windows13/i_width] +[Windows13/i_width/Windows13] +Theme=0 +[Windows13/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[Windows14] +style= +Estyle= +i_stylePN=16 +idIncCmpFilCmp=1030 +i_tipoComp=700500 +isContenitor=1 +validator= +s_name=btnStartTerrain +subClassName= +i_index=-1 +i_left=3 +i_top=302 +i_height=45 +i_width=428 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_tipoWxClasse=wxPanel +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=0 +b_nocreate=0 +ClsMtr=*win**panel* +ClsTypF= +npaint=0 +idIdentCmp=10018 +s_idIdentCmp=ID_CMP_18 +t_idIdentCmp=1 +i_idPArent=4 +i_id=25 +parCompID=0 +i_sizeGrow=0 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=12 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +IndexOfS=3 +[Windows14/i_width] +[Windows14/i_width/Windows14] +Theme=0 +[Windows14/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[Windows15] +style= +Estyle= +i_stylePN=21 +idIncCmpFilCmp=1032 +i_tipoComp=600060 +isContenitor=0 +validator= +s_name=btnStartRoR +subClassName= +i_index=-1 +i_left=3 +i_top=3 +i_height=20 +i_width=20 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_tipoWxClasse=wxButton +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=0 +b_nocreate=0 +ClsMtr=*crt* +ClsTypF= +npaint=0 +idIdentCmp=10019 +s_idIdentCmp=ID_CMP_19 +t_idIdentCmp=1 +i_idPArent=26 +i_id=27 +parCompID=25 +i_sizeGrow=1 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=16 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +IndexOfS=0 +[Windows15/event] +29=1 +[Windows15/i_width] +[Windows15/i_width/Windows15] +Theme=0 +[Windows15/i_propN] +0=Start RoR +[Windows15/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[Windows16] +style= +Estyle= +i_stylePN=21 +idIncCmpFilCmp=1033 +i_tipoComp=600060 +isContenitor=0 +validator= +s_name=btnTerrainEditor +subClassName= +i_index=-1 +i_left=88 +i_top=3 +i_height=20 +i_width=20 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_tipoWxClasse=wxButton +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=0 +b_nocreate=0 +ClsMtr=*crt* +ClsTypF= +npaint=0 +idIdentCmp=10020 +s_idIdentCmp=ID_CMP_20 +t_idIdentCmp=1 +i_idPArent=26 +i_id=28 +parCompID=25 +i_sizeGrow=1 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=16 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +IndexOfS=1 +[Windows16/event] +29=1 +[Windows16/i_width] +[Windows16/i_width/Windows16] +Theme=0 +[Windows16/i_propN] +0=Terrain Editor +[Windows16/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[Windows17] +style= +Estyle= +i_stylePN=21 +idIncCmpFilCmp=1034 +i_tipoComp=600060 +isContenitor=0 +validator= +s_name=btnTruckEditor +subClassName= +i_index=-1 +i_left=173 +i_top=3 +i_height=20 +i_width=20 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=false +s_tipoWxClasse=wxButton +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=0 +b_nocreate=0 +ClsMtr=*crt* +ClsTypF= +npaint=0 +idIdentCmp=10021 +s_idIdentCmp=ID_CMP_21 +t_idIdentCmp=1 +i_idPArent=26 +i_id=29 +parCompID=25 +i_sizeGrow=1 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=16 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +IndexOfS=2 +[Windows17/event] +29=1 +[Windows17/i_width] +[Windows17/i_width/Windows17] +Theme=0 +[Windows17/i_propN] +0=Truck Editor +[Windows17/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[Windows18] +style= +Estyle= +i_stylePN=21 +idIncCmpFilCmp=1035 +i_tipoComp=600060 +isContenitor=0 +validator= +s_name=btnExit +subClassName= +i_index=-1 +i_left=343 +i_top=3 +i_height=20 +i_width=20 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_tipoWxClasse=wxButton +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=0 +b_nocreate=0 +ClsMtr=*crt* +ClsTypF= +npaint=0 +idIdentCmp=10022 +s_idIdentCmp=ID_CMP_22 +t_idIdentCmp=1 +i_idPArent=26 +i_id=30 +parCompID=25 +i_sizeGrow=1 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=16 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +IndexOfS=4 +[Windows18/event] +29=1 +[Windows18/i_width] +[Windows18/i_width/Windows18] +Theme=0 +[Windows18/i_propN] +0=Exit +[Windows18/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[Windows19] +style= +Estyle= +i_stylePN=21 +idIncCmpFilCmp=1036 +i_tipoComp=600060 +isContenitor=0 +validator= +s_name=btnTruckChecker +subClassName= +i_index=-1 +i_left=258 +i_top=3 +i_height=20 +i_width=20 +l_backColor= +l_foreColor= +l_backColorSys= +l_foreColorSys= +b_show=true +b_showD=true +b_Enable=true +s_tipoWxClasse=wxButton +isfuncClsName=0 +funcClsName= +i_massindex= +idSTR= +isVirtual=0 +id=0 +TabOrderEn=0 +TabOrderId=0 +b_NOparentDes=0 +b_NOparentDesComp=0 +b_nocreate=0 +ClsMtr=*crt* +ClsTypF= +npaint=0 +idIdentCmp=10023 +s_idIdentCmp=ID_CMP_23 +t_idIdentCmp=1 +i_idPArent=26 +i_id=31 +parCompID=25 +i_sizeGrow=1 +i_border=3 +is_parent=0 +is_siz=0 +siz_style=41200 +l_enWinSizeMin=0 +b_ItmsizeMinAb=0 +i_ItminSizeH=10 +i_ItminSizeW=20 +iconNum=16 +s_info= +s_funcPrima= +s_funcDopo= +s_funcNewCtor= +s_includeNewCtor= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +dataObj\\panelfitInsS=0 +IndexOfS=3 +[Windows19/event] +29=1 +[Windows19/i_width] +[Windows19/i_width/Windows19] +Theme=0 +[Windows19/i_propN] +0=Truck Checker +[Windows19/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[sizer] +nSiz=7 +[sizerWin1] +i_Col=2 +i_SpCol=0 +i_Row=2 +i_SpRow=0 +s_text= +s_name=sz4s +subClassName= +i_tipoComp=600002 +b_sizeMinAb=0 +i_minSizeH=0 +i_minSizeW=0 +l_nComInSiz=4 +i_idPArent=0 +i_id=4 +i_sizeGrow=0 +i_border=3 +is_parent=1 +is_siz=1 +s_tipoWxClasse=wxBoxSizer +isfuncClsName=0 +funcClsName= +is_parentId=2 +ClsMtr=*siz* +ClsTypF= +npaint=0 +l_sizAutoLayout=1 +i_left=0 +i_top=0 +i_height=10 +i_width=10 +s_info= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +SizeSpaceW=10 +SizeSpaceH=20 +idIncCmpFilCmp=1009 +siz_style=41200 +childSiz=5:6:11:25 +[sizerWin1/id] +0=5 +1=6 +2=11 +3=25 +[sizerWin1/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[sizerWin2] +i_Col=2 +i_SpCol=0 +i_Row=2 +i_SpRow=0 +s_text= +s_name=sz6s +subClassName= +i_tipoComp=600003 +b_sizeMinAb=0 +i_minSizeH=0 +i_minSizeW=0 +l_nComInSiz=2 +i_idPArent=4 +i_id=6 +i_sizeGrow=0 +i_border=3 +is_parent=0 +is_siz=1 +s_tipoWxClasse=wxBoxSizer +isfuncClsName=0 +funcClsName= +is_parentId=2 +ClsMtr=*siz* +ClsTypF= +npaint=0 +l_sizAutoLayout=0 +i_left=0 +i_top=0 +i_height=10 +i_width=10 +s_info= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +SizeSpaceW=10 +SizeSpaceH=20 +idIncCmpFilCmp=1011 +IndexOfS=1 +siz_style=41200 +childSiz=7:8 +[sizerWin2/id] +0=7 +1=8 +[sizerWin2/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[sizerWin3] +i_Col=2 +i_SpCol=0 +i_Row=2 +i_SpRow=0 +s_text= +s_name=sz13s +subClassName= +i_tipoComp=600002 +b_sizeMinAb=0 +i_minSizeH=0 +i_minSizeW=0 +l_nComInSiz=2 +i_idPArent=0 +i_id=13 +i_sizeGrow=0 +i_border=3 +is_parent=1 +is_siz=1 +s_tipoWxClasse=wxBoxSizer +isfuncClsName=0 +funcClsName= +is_parentId=12 +ClsMtr=*siz* +ClsTypF= +npaint=0 +l_sizAutoLayout=1 +i_left=0 +i_top=0 +i_height=10 +i_width=10 +s_info= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +SizeSpaceW=10 +SizeSpaceH=20 +idIncCmpFilCmp=1018 +siz_style=41200 +childSiz=15:18 +[sizerWin3/id] +0=15 +1=18 +[sizerWin3/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[sizerWin4] +i_Col=2 +i_SpCol=0 +i_Row=2 +i_SpRow=0 +s_text= +s_name=sz15s +subClassName= +i_tipoComp=600003 +b_sizeMinAb=0 +i_minSizeH=0 +i_minSizeW=0 +l_nComInSiz=2 +i_idPArent=13 +i_id=15 +i_sizeGrow=0 +i_border=3 +is_parent=0 +is_siz=1 +s_tipoWxClasse=wxBoxSizer +isfuncClsName=0 +funcClsName= +is_parentId=12 +ClsMtr=*siz* +ClsTypF= +npaint=0 +l_sizAutoLayout=0 +i_left=0 +i_top=0 +i_height=10 +i_width=10 +s_info= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +SizeSpaceW=10 +SizeSpaceH=20 +idIncCmpFilCmp=1020 +IndexOfS=0 +siz_style=41200 +childSiz=16:17 +[sizerWin4/id] +0=16 +1=17 +[sizerWin4/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[sizerWin5] +i_Col=2 +i_SpCol=0 +i_Row=2 +i_SpRow=0 +s_text= +s_name=sz18s +subClassName= +i_tipoComp=600003 +b_sizeMinAb=0 +i_minSizeH=0 +i_minSizeW=0 +l_nComInSiz=2 +i_idPArent=13 +i_id=18 +i_sizeGrow=0 +i_border=3 +is_parent=0 +is_siz=1 +s_tipoWxClasse=wxBoxSizer +isfuncClsName=0 +funcClsName= +is_parentId=12 +ClsMtr=*siz* +ClsTypF= +npaint=0 +l_sizAutoLayout=0 +i_left=0 +i_top=0 +i_height=10 +i_width=10 +s_info= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +SizeSpaceW=10 +SizeSpaceH=20 +idIncCmpFilCmp=1023 +IndexOfS=1 +siz_style=41200 +childSiz=19:20 +[sizerWin5/id] +0=19 +1=20 +[sizerWin5/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[sizerWin6] +i_Col=2 +i_SpCol=0 +i_Row=2 +i_SpRow=0 +s_text= +s_name=sz22s +subClassName= +i_tipoComp=600002 +b_sizeMinAb=0 +i_minSizeH=0 +i_minSizeW=0 +l_nComInSiz=2 +i_idPArent=0 +i_id=22 +i_sizeGrow=0 +i_border=3 +is_parent=1 +is_siz=1 +s_tipoWxClasse=wxBoxSizer +isfuncClsName=0 +funcClsName= +is_parentId=21 +ClsMtr=*siz* +ClsTypF= +npaint=0 +l_sizAutoLayout=1 +i_left=0 +i_top=0 +i_height=10 +i_width=10 +s_info= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +SizeSpaceW=10 +SizeSpaceH=20 +idIncCmpFilCmp=1027 +siz_style=41200 +childSiz=23:24 +[sizerWin6/id] +0=23 +1=24 +[sizerWin6/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[sizerWin7] +i_Col=2 +i_SpCol=0 +i_Row=2 +i_SpRow=0 +s_text= +s_name=sz26s +subClassName= +i_tipoComp=600003 +b_sizeMinAb=0 +i_minSizeH=0 +i_minSizeW=0 +l_nComInSiz=5 +i_idPArent=0 +i_id=26 +i_sizeGrow=0 +i_border=3 +is_parent=1 +is_siz=1 +s_tipoWxClasse=wxBoxSizer +isfuncClsName=0 +funcClsName= +is_parentId=25 +ClsMtr=*siz* +ClsTypF= +npaint=0 +l_sizAutoLayout=1 +i_left=0 +i_top=0 +i_height=10 +i_width=10 +s_info= +dataObj\\SizRowSpan=1 +dataObj\\SizColSpan=1 +dataObj\\SizRowPos=0 +dataObj\\SizColPos=0 +SizeSpaceW=10 +SizeSpaceH=20 +idIncCmpFilCmp=1031 +siz_style=41200 +childSiz=27:28:29:31:30 +[sizerWin7/id] +0=27 +1=28 +2=29 +3=31 +4=30 +[sizerWin7/sizerProp] +0=1 +1=1 +2=1 +3=1 +5=1 +13=1 +[menu] +[menu/numero] +n=0 +[EndFile] +end=134324 Added: trunk/devtools/RoRSettingsDialog/MyDlg.py =================================================================== --- trunk/devtools/RoRSettingsDialog/MyDlg.py (rev 0) +++ trunk/devtools/RoRSettingsDialog/MyDlg.py 2007-06-22 22:55:30 UTC (rev 10) @@ -0,0 +1,203 @@ +# -*- coding: iso-8859-1 -*- +# Don't modify comment + +import wx +#[inc]add your include files here + +#[inc]end your include + +class MyDlg(wx.Dialog): + def __init__(self,parent,id = -1,title = '',pos = wx.Point(0,0),size = wx.Size(500,600),style = wx.DEFAULT_DIALOG_STYLE,name = 'dialogBox'): + pre=wx.PreDialog() + self.OnPreCreate() + pre.Create(parent,id,title,pos,size,wx.CAPTION|wx.SYSTEM_MENU|wx.DIALOG_NO_PARENT|wx.DEFAULT_DIALOG_STYLE,name) + self.PostCreate(pre) + self.initBefore() + self.VwXinit() + self.initAfter() + + def __del__(self): + self.Ddel() + return + + + def VwXinit(self): + self.fileImgBuf=[None] * 1 + self.fileImgBuf[0] = wx.Bitmap("D:/projects/old/rorterraineditor_0_0_3/splash.bmp",wx.BITMAP_TYPE_BMP) + self.panelBitmapImg0=self.fileImgBuf[0]; + self.SetIcon(wx.Icon("D:/projects/old/rorterraineditor_0_0_3/ror.ico",wx.BITMAP_TYPE_ICO)); + self.SetTitle('RoR Toolkit') + self.panelBitmap = wx.Panel(self,-1,wx.Point(3,3),wx.Size(500,223)) + self.panelBitmap.SetLabel('RoR Toolkit') + self.panelBitmap.Bind(wx.EVT_ERASE_BACKGROUND,self.VwXpanelBitmap_VwXEvOnEraseBackground) + self.txtRoRDir = wx.TextCtrl(self,-1,"",wx.Point(6,137),wx.Size(100,21)) + self.btnSelectRoRDir = wx.Button(self,-1,"",wx.Point(353,137),wx.Size(75,21)) + self.btnSelectRoRDir.SetLabel("SelectRoR") + self.wxnb11c = wx.Notebook(self,-1,wx.Point(3,281),wx.Size(20,20)) + self.pn12c = wx.Panel(self.wxnb11c,-1,wx.Point(4,22),wx.Size(420,103)) + self.wxnb11c.AddPage(self.pn12c,'tab n\xB0: 0',0) + self.lblFPS = wx.StaticText(self.pn12c,-1,"",wx.Point(6,6),wx.Size(50,13),wx.ST_NO_AUTORESIZE) + self.lblFPS.SetLabel("FPS: 30") + self.sbFPS = wx.ScrollBar(self.pn12c,-1,wx.Point(62,6),wx.Size(20,20),wx.SB_HORIZONTAL) + self.Bind(wx.EVT_SCROLL,self.sbFPS_VwXEvOnScrollValue,self.sbFPS) + self.lblWaterTrans = wx.StaticText(self.pn12c,-1,"",wx.Point(6,38),wx.Size(145,20),wx.ST_NO_AUTORESIZE) + self.lblWaterTrans.SetLabel("Water Transparency: 10%") + self.sbWaterTrans = wx.ScrollBar(self.pn12c,-1,wx.Point(157,38),wx.Size(20,20),wx.SB_HORIZONTAL) + self.Bind(wx.EVT_SCROLL,self.sbWaterTrans_VwXEvOnScrollValue,self.sbWaterTrans) + self.pn21c = wx.Panel(self.wxnb11c,-1,wx.Point(0,0),wx.Size(20,20)) + self.wxnb11c.AddPage(self.pn21c,'tab n\xB0: 1',0) + self.btnCheckUpdates = wx.Button(self.pn21c,-1,"",wx.Point(3,3),wx.Size(412,25)) + self.btnCheckUpdates.SetLabel("Check for Updates!") + self.Bind(wx.EVT_BUTTON,self.btnCheckUpdates_VwXEvOnButtonClick,self.btnCheckUpdates) + self.lblUpdates = wx.StaticText(self.pn21c,-1,"",wx.Point(3,34),wx.Size(412,18),wx.ST_NO_AUTORESIZE) + self.btnStartTerrain = wx.Panel(self,-1,wx.Point(3,302),wx.Size(428,45)) + self.btnStartRoR = wx.Button(self.btnStartTerrain,-1,"",wx.Point(3,3),wx.Size(20,20)) + self.btnStartRoR.SetLabel("Start RoR") + self.Bind(wx.EVT_BUTTON,self.btnStartRoR_VwXEvOnButtonClick,self.btnStartRoR) + self.btnTerrainEditor = wx.Button(self.btnStartTerrain,-1,"",wx.Point(88,3),wx.Size(20,20)) + self.btnTerrainEditor.SetLabel("Terrain Editor") + self.Bind(wx.EVT_BUTTON,self.btnTerrainEditor_VwXEvOnButtonClick,self.btnTerrainEditor) + self.btnTruckEditor = wx.Button(self.btnStartTerrain,-1,"",wx.Point(173,3),wx.Size(20,20)) + self.btnTruckEditor.Enable(False) + self.btnTruckEditor.SetLabel("Truck Editor") + self.Bind(wx.EVT_BUTTON,self.btnTruckEditor_VwXEvOnButtonClick,self.btnTruckEditor) + self.btnExit = wx.Button(self.btnStartTerrain,-1,"",wx.Point(343,3),wx.Size(20,20)) + self.btnExit.SetLabel("Exit") + self.Bind(wx.EVT_BUTTON,self.btnExit_VwXEvOnButtonClick,self.btnExit) + self.sz4s = wx.BoxSizer(wx.VERTICAL) + self.sz6s = wx.BoxSizer(wx.HORIZONTAL) + self.sz13s = wx.BoxSizer(wx.VERTICAL) + self.sz15s = wx.BoxSizer(wx.HORIZONTAL) + self.sz18s = wx.BoxSizer(wx.HORIZONTAL) + self.sz22s = wx.BoxSizer(wx.VERTICAL) + self.sz26s = wx.BoxSizer(wx.HORIZONTAL) + self.sz4s.Add(self.panelBitmap,1,wx.TOP|wx.LEFT|wx.BOTTOM|wx.RIGHT|wx.EXPAND|wx.FIXED_MINSIZE,3) + self.sz4s.SetItemMinSize(self.panelBitmap,20,10) + self.sz4s.Add(self.sz6s,0,wx.TOP|wx.LEFT|wx.BOTTOM|wx.RIGHT|wx.EXPAND|wx.FIXED_MINSIZE,3) + self.sz4s.Add(self.wxnb11c,1,wx.TOP|wx.LEFT|wx.BOTTOM|wx.RIGHT|wx.EXPAND|wx.FIXED_MINSIZE,3) + self.sz4s.Add(self.btnStartTerrain,0,wx.TOP|wx.LEFT|wx.BOTTOM|wx.RIGHT|wx.EXPAND|wx.FIXED_MINSIZE,3) + self.sz6s.Add(self.txtRoRDir,1,wx.TOP|wx.LEFT|wx.BOTTOM|wx.RIGHT|wx.EXPAND|wx.FIXED_MINSIZE,3) + self.sz6s.Add(self.btnSelectRoRDir,0,wx.TOP|wx.LEFT|wx.BOTTOM|wx.RIGHT|wx.EXPAND|wx.... [truncated message content] |
From: <ror...@us...> - 2007-06-22 22:33:41
|
Revision: 9 http://roreditor.svn.sourceforge.net/roreditor/?rev=9&view=rev Author: rorthomas Date: 2007-06-22 15:33:39 -0700 (Fri, 22 Jun 2007) Log Message: ----------- removed senseless stuff Removed Paths: ------------- trunk/lib/ror/SharedTestOgreWindow.py trunk/lib/rorterraineditor/TerrainOgreWindow.py_ trunk/lib/testapp/ Deleted: trunk/lib/ror/SharedTestOgreWindow.py =================================================================== --- trunk/lib/ror/SharedTestOgreWindow.py 2007-06-22 22:12:29 UTC (rev 8) +++ trunk/lib/ror/SharedTestOgreWindow.py 2007-06-22 22:33:39 UTC (rev 9) @@ -1,62 +0,0 @@ -#Thomas Fischer 31/05/2007, th...@th... -import sys -import wx -import ogre.renderer.OGRE as ogre -from wxogre.OgreManager import * -from wxogre.wxOgreWindow import * -from random import random - -class SharedTestOgreWindow(wxOgreWindow): - def __init__(self, parent, ID, sceneManager, size = wx.Size(200,200), renderSystem = "OpenGL", **kwargs): - self.sceneManager = sceneManager - self.rand = str(random()) - wxOgreWindow.__init__(self, parent, ID, size = size, renderSystem = renderSystem, **kwargs) - self.parent = parent - - def SceneInitialisation(self): - # create a camera - self.camera = self.sceneManager.createCamera('SharedCamera' + self.rand) - self.camera.lookAt(ogre.Vector3(0, 0, 0)) - self.camera.setPosition(ogre.Vector3(0, 0, 100)) - self.camera.nearClipDistance = 1 - self.camera.setAutoAspectRatio(True) - - # create the Viewport" - self.viewport = self.renderWindow.addViewport(self.camera, 0, 0.0, 0.0, 1.0, 1.0) - self.viewport.backgroundColour = ogre.ColourValue(0, 0, 0) - - # bind mouse and keyboard - d=10.0 #displacement for key strokes - self.ControlKeyDict={wx.WXK_LEFT:ogre.Vector3(-d,0.0,0.0), - wx.WXK_RIGHT:ogre.Vector3(d,0.0,0.0), - wx.WXK_UP:ogre.Vector3(0.0,0.0,-d), - wx.WXK_DOWN:ogre.Vector3(0.0,0.0,d), - wx.WXK_PAGEUP:ogre.Vector3(0.0,d,0.0), - wx.WXK_PAGEDOWN:ogre.Vector3(0.0,-d,0.0)} - self.Bind(wx.EVT_KEY_DOWN, self.onKeyDown) - self.Bind(wx.EVT_MOUSE_EVENTS, self.onMouseEvent) - - def onKeyDown(self,event): - validMove = self.ControlKeyDict.get(event.m_keyCode, False) - if validMove: - pos = self.camera.getPosition() - pos += validMove - self.camera.setPosition(pos) - event.Skip() - - def onMouseEvent(self, event): - self.SetFocus() #Gives Keyboard focus to the window - - if event.RightDown(): #Precedes dragging - self.StartDragX, self.StartDragY = event.GetPosition() #saves position of initial click - - if event.Dragging() and event.RightIsDown(): #Dragging with RMB - x,y = event.GetPosition() - dx = self.StartDragX - x - dy = self.StartDragY - y - self.StartDragX, self.StartDragY = x, y - - self.camera.yaw(ogre.Degree(dx/3.0)) - self.camera.pitch(ogre.Degree(dy/3.0)) - event.Skip() - \ No newline at end of file Deleted: trunk/lib/rorterraineditor/TerrainOgreWindow.py_ =================================================================== --- trunk/lib/rorterraineditor/TerrainOgreWindow.py_ 2007-06-22 22:12:29 UTC (rev 8) +++ trunk/lib/rorterraineditor/TerrainOgreWindow.py_ 2007-06-22 22:33:39 UTC (rev 9) @@ -1,181 +0,0 @@ -#Thomas Fischer 31/05/2007, th...@th... -import wx -import ogre.renderer.OGRE as ogre -from wxogre.OgreManager import * -from wxogre.wxOgreWindow import * -from random import random - -class TerrainOgreWindow(wxOgreWindow): - def __init__(self, parent, ID, size = wx.Size(200,200), renderSystem = "OpenGL", **kwargs): - self.rand = str(random()) - wxOgreWindow.__init__(self, parent, ID, size = size, renderSystem = renderSystem, **kwargs) - self.parent = parent - - def OnFrameStarted(self): - if not self.camAxesNode is None: - self.camAxesNode.setPosition(self.camera.getPosition()) - self.camAxesNode.setOrientation(self.camera.getOrientation()) - #self.camAxesEnt.setVisible(False) - - return - - - def OnFrameEnded(self): - #self.camAxesEnt.setVisible(True) - return - - def SceneInitialisation(self, add = None): - # only init things in the main window, not in shared ones! - # setup resources - if not add is None: - for r in add: - ogre.ResourceGroupManager.getSingleton().addResourceLocation(r, "FileSystem", "General", False) - - ogre.ResourceGroupManager.getSingleton().addResourceLocation("media/packs/OgreCore.zip", "Zip", "Bootstrap", False) - ogre.ResourceGroupManager.getSingleton().addResourceLocation("media", "FileSystem", "General", False) - ogre.ResourceGroupManager.getSingleton().addResourceLocation("media/materials", "FileSystem", "General", False) - ogre.ResourceGroupManager.getSingleton().addResourceLocation("media/models", "FileSystem", "General", False) - ogre.ResourceGroupManager.getSingleton().initialiseAllResourceGroups() - - #get the scenemanager - self.sceneManager = getOgreManager().createSceneManager(ogre.ST_EXTERIOR_CLOSE) - - # create a camera - self.camera = self.sceneManager.createCamera('Camera' + self.rand) - self.camera.lookAt(ogre.Vector3(0, 0, 0)) - self.camera.setPosition(ogre.Vector3(0, 0, 100)) - self.camera.nearClipDistance = 0.1 - self.camera.setAutoAspectRatio(True) - - # create the Viewport" - self.viewport = self.renderWindow.addViewport(self.camera, 0, 0.0, 0.0, 1.0, 1.0) - self.viewport.backgroundColour = ogre.ColourValue(0, 0, 0) - - #set some default values - self.sceneDetailIndex = 0 - self.filtering = ogre.TFO_BILINEAR - - # bind mouse and keyboard - self.Bind(wx.EVT_KEY_DOWN, self.onKeyDown) - self.Bind(wx.EVT_MOUSE_EVENTS, self.onMouseEvent) - - #create objects - self.populateScene() - - self.showDebugOverlay(False) - - def showDebugOverlay(self, show): - """Turns the debug overlay (frame statistics) on or off.""" - overlay = ogre.OverlayManager.getSingleton().getByName('Core/DebugOverlay') - try: - if overlay is None: - pass - if show: - overlay.show() - else: - overlay.hide() - except: - pass - - def populateScene(self): - self.sceneManager.AmbientLight = 0.5, 0.5, 0.5 - - l = self.sceneManager.createLight("MainLight" + self.rand) - l.setPosition(20,80,50) - fadeColour = (0.93, 0.86, 0.76) - self.sceneManager.setFog(ogre.FOG_LINEAR, fadeColour, 0.001, 5000.0, 10000.0) - self.renderWindow.getViewport(0).BackgroundColour = fadeColour - - self.sceneManager.setWorldGeometry('media/terrain.cfg') - plane = ogre.Plane() - plane.d = 5000 - plane.normal = -ogre.Vector3.UNIT_Y - - self.sceneManager.AmbientLight = ogre.ColourValue(0.7, 0.7, 0.7 ) - self.sceneManager.setShadowTechnique(ogre.ShadowTechnique.SHADOWTYPE_STENCIL_ADDITIVE); - self.sceneManager.setSkyDome(True, 'Examples/CloudySky', 4.0, 8.0) - - self.MainLight = self.sceneManager.createLight('MainLight') - self.MainLight.setPosition (ogre.Vector3(20, 80, 130)) - - #create the camera Axes object - self.camAxesNode = self.sceneManager.getRootSceneNode().createChildSceneNode("camaxes" + self.rand) - self.camAxesEnt = self.sceneManager.createEntity('camAxesEnt' + self.rand, 'axes.mesh') - self.camAxesNode.attachObject(self.camAxesEnt) - - - - def onKeyDown(self,event): - #print event.m_keyCode - d = 5 - if event.ShiftDown(): - d = 30 - - if event.m_keyCode == 65: # A, wx.WXK_LEFT: - self.camera.moveRelative(ogre.Vector3(-d,0,0)) - elif event.m_keyCode == 68: # D, wx.WXK_RIGHT: - self.camera.moveRelative(ogre.Vector3(d,0,0)) - elif event.m_keyCode == 87: # W ,wx.WXK_UP: - self.camera.moveRelative(ogre.Vector3(0,0,-d)) - elif event.m_keyCode == 83: # S, wx.WXK_DOWN: - self.camera.moveRelative(ogre.Vector3(0,0,d)) - elif event.m_keyCode == wx.WXK_PAGEUP: - self.camera.moveRelative(ogre.Vector3(0,d,0)) - elif event.m_keyCode == wx.WXK_PAGEDOWN: - self.camera.moveRelative(ogre.Vector3(0,-d,0)) - elif event.m_keyCode == 84: # 84 = T - if self.filtering == ogre.TFO_BILINEAR: - self.filtering = ogre.TFO_TRILINEAR - self.Aniso = 1 - elif self.filtering == ogre.TFO_TRILINEAR: - self.filtering = ogre.TFO_ANISOTROPIC - self.Aniso = 8 - else: - self.filtering = ogre.TFO_BILINEAR - self.Aniso = 1 - ogre.MaterialManager.getSingleton().setDefaultTextureFiltering(self.filtering) - ogre.MaterialManager.getSingleton().setDefaultAnisotropy(self.Aniso) - elif event.m_keyCode == 82: # 82 = R - detailsLevel = [ ogre.PM_SOLID, - ogre.PM_WIREFRAME, - ogre.PM_POINTS ] - self.sceneDetailIndex = (self.sceneDetailIndex + 1) % len(detailsLevel) - self.camera.polygonMode=detailsLevel[self.sceneDetailIndex] - elif event.m_keyCode == 80: # 80 = P - pos = self.camera.getDerivedPosition() - o = self.camera.getDerivedOrientation() - print "P: %.3f %.3f %.3f O: %.3f %.3f %.3f %.3f" % (pos.x,pos.y,pos.z, o.w,o.x,o.y,o.z) - - event.Skip() - - def onMouseEvent(self, event): - self.SetFocus() #Gives Keyboard focus to the window - - - if event.RightDown(): #Precedes dragging - self.StartDragX, self.StartDragY = event.GetPosition() #saves position of initial click - if event.GetWheelRotation() != 0: - zfactor = 0.1 - if event.ShiftDown(): - zfactor = 5 - zoom = zfactor * -event.GetWheelRotation() - self.camera.moveRelative(ogre.Vector3(0,0, zoom)) - if event.Dragging() and event.RightIsDown() and event.ControlDown(): - x,y = event.GetPosition() - dx = self.StartDragX - x - dy = self.StartDragY - y - self.StartDragX, self.StartDragY = x, y - if event.ShiftDown(): - dx = float(dx) / 10 - dy = float(dy) / 10 - self.camera.moveRelative(ogre.Vector3(dx,-dy,0)) - elif event.Dragging() and event.RightIsDown(): #Dragging with RMB - x,y = event.GetPosition() - dx = self.StartDragX - x - dy = self.StartDragY - y - self.StartDragX, self.StartDragY = x, y - - self.camera.yaw(ogre.Degree(dx/3.0)) - self.camera.pitch(ogre.Degree(dy/3.0)) - event.Skip() - \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |