From: Digital X. <dig...@us...> - 2007-03-30 19:47:53
|
Update of /cvsroot/openrpg/openrpg1/orpg/mapper In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13928/orpg/mapper Modified Files: fog.py fog_handler.py Log Message: Fixed issue with saving maps then reloading them and the fog not showing Index: fog.py =================================================================== RCS file: /cvsroot/openrpg/openrpg1/orpg/mapper/fog.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** fog.py 10 Mar 2007 04:06:20 -0000 1.32 --- fog.py 30 Mar 2007 19:47:51 -0000 1.33 *************** *** 123,127 **** self.color = wx.Color(128,128,128) if "__WXGTK__" not in wx.PlatformInfo: ! self.color = wx.Color(0,0,0, 128) self.fogregion = wx.Region() self.fogregion.Clear() --- 123,127 ---- self.color = wx.Color(128,128,128) if "__WXGTK__" not in wx.PlatformInfo: ! self.color = wx.Color(128,128,128, 128) self.fogregion = wx.Region() self.fogregion.Clear() *************** *** 229,232 **** --- 229,233 ---- if "__WXGTK__" not in wx.PlatformInfo: + self.canvas.PrepareDC(dc) gc = wx.GraphicsContext.Create(dc) gc.SetBrush(wx.Brush(wx.BLACK)) *************** *** 373,380 **** while ri.HaveRects(): ! x1 = ri.GetX() ! x2 = x1+ri.GetW()-1 ! y1 = ri.GetY() ! y2 = y1+ri.GetH()-1 poly = FogArea(str(x1) + "," + str(y1) + ";" + str(x2) + "," + str(y1) + ";" + --- 374,381 ---- while ri.HaveRects(): ! x1 = ri.GetX()/COURSE ! x2 = x1+(ri.GetW()/COURSE)-1 ! y1 = ri.GetY()/COURSE ! y2 = y1+(ri.GetH()/COURSE)-1 poly = FogArea(str(x1) + "," + str(y1) + ";" + str(x2) + "," + str(y1) + ";" + Index: fog_handler.py =================================================================== RCS file: /cvsroot/openrpg/openrpg1/orpg/mapper/fog_handler.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** fog_handler.py 9 Mar 2007 14:11:55 -0000 1.14 --- fog_handler.py 30 Mar 2007 19:47:51 -0000 1.15 *************** *** 141,147 **** def on_motion(self, evt): scale = self.canvas.layers['grid'].mapscale ! dc = wx.ClientDC( self.canvas ) ! self.canvas.PrepareDC( dc ) ! dc.SetUserScale(scale,scale) pos = evt.GetLogicalPosition(dc) pos.x /= COURSE --- 141,147 ---- def on_motion(self, evt): scale = self.canvas.layers['grid'].mapscale ! dc = wx.ClientDC(self.canvas) ! dc.SetUserScale(scale, scale) ! self.canvas.PrepareDC(dc) pos = evt.GetLogicalPosition(dc) pos.x /= COURSE *************** *** 151,162 **** if not self.drawing: self.line = [] ! self.line.append(IPoint().make(pos.x,pos.y)) ! elif pos.x!=self.last.x or pos.y!=self.last.y: pen= wx.Pen(self.pencolor) pen.SetWidth(COURSE/2+1) dc.SetPen(pen) ! dc.DrawLine(self.last.x*COURSE,self.last.y*COURSE,pos.x*COURSE,pos.y*COURSE) dc.SetPen(wx.NullPen) ! self.line.append(IPoint().make(pos.x,pos.y)) self.last = pos self.drawing = True --- 151,162 ---- if not self.drawing: self.line = [] ! self.line.append(IPoint().make(pos.x, pos.y)) ! elif pos.x != self.last.x or pos.y != self.last.y: pen= wx.Pen(self.pencolor) pen.SetWidth(COURSE/2+1) dc.SetPen(pen) ! dc.DrawLine(self.last.x*COURSE, self.last.y*COURSE, pos.x*COURSE, pos.y*COURSE) dc.SetPen(wx.NullPen) ! self.line.append(IPoint().make(pos.x, pos.y)) self.last = pos self.drawing = True *************** *** 175,180 **** showmode = 'del' scale = self.canvas.layers['grid'].mapscale ! dc = wx.ClientDC( self.canvas ) ! self.canvas.PrepareDC( dc ) dc.SetUserScale(scale,scale) pen= wx.Pen(self.pencolor) --- 175,180 ---- showmode = 'del' scale = self.canvas.layers['grid'].mapscale ! dc = wx.ClientDC(self.canvas) ! self.canvas.PrepareDC(dc) dc.SetUserScale(scale,scale) pen= wx.Pen(self.pencolor) |