コード例 #1
0
ファイル: chunks.py プロジェクト: gamingrobot/second-sunrise
 def run(self):
     while True:
         while not _chunkQueue.isEmpty():
             popq = _chunkQueue.pop()
             popq['class'].generateChunk(popq['chunkcords'], popq['parentnode'], popq['chunks'])
             Thread.sleep(0.04)
         Thread.sleep(0.04)
コード例 #2
0
ファイル: chunks.py プロジェクト: PlumpMath/second-sunrise
 def run(self):
     while True:
         while not _chunkQueue.isEmpty():
             popq = _chunkQueue.pop()
             popq['class'].generateChunk(popq['chunkcords'],
                                         popq['parentnode'], popq['chunks'])
             Thread.sleep(0.04)
         Thread.sleep(0.04)
コード例 #3
0
    def downloadDescFile(self, http):
        """ Downloads the desc file for this particular package,
        synchronously, and then reads it.  Returns true on success,
        false on failure. """

        for token in self.downloadDescFileGenerator(http):
            if token != self.stepContinue:
                break
            Thread.considerYield()

        return (token == self.stepComplete)
コード例 #4
0
ファイル: PackageInfo.py プロジェクト: jeraldamo/Mayhem
    def downloadDescFile(self, http):
        """ Downloads the desc file for this particular package,
        synchronously, and then reads it.  Returns true on success,
        false on failure. """

        for token in self.downloadDescFileGenerator(http):
            if token != self.stepContinue:
                break
            Thread.considerYield()

        return (token == self.stepComplete)
コード例 #5
0
ファイル: Messenger.pyc.py プロジェクト: MasterLoopyBM/c0d3
    def __getLock(self):
        self.notify.info('Acquiring Panda lock for the first time.')
        from pandac.PandaModules import Thread, Mutex
        self.__dict__.setdefault('lock', Mutex('Messenger'))
        self.lock.acquire()
        self.acquire = self.lock.acquire
        self.notify.info('Waiting for cheesy lock to be released.')
        while self.locked:
            Thread.forceYield()

        self.notify.info('Got cheesy lock.')
コード例 #6
0
    def downloadPackage(self, http):
        """ Downloads the package file, synchronously, then
        uncompresses and unpacks it.  Returns true on success, false
        on failure.

        This assumes that self.installPlans has already been filled
        in, which will have been done by self.__readDescFile().
        """

        for token in self.downloadPackageGenerator(http):
            if token != self.stepContinue:
                break
            Thread.considerYield()

        return (token == self.stepComplete)
コード例 #7
0
ファイル: PackageInfo.py プロジェクト: jeraldamo/Mayhem
    def downloadPackage(self, http):
        """ Downloads the package file, synchronously, then
        uncompresses and unpacks it.  Returns true on success, false
        on failure.

        This assumes that self.installPlans has already been filled
        in, which will have been done by self.__readDescFile().
        """

        for token in self.downloadPackageGenerator(http):
            if token != self.stepContinue:
                break
            Thread.considerYield()

        return (token == self.stepComplete)
コード例 #8
0
        def __getLock(self):
            # Now that we've started Panda, it's safe to import the Mutex
            # class, which becomes our actual lock.
            # From now on, this lock will be used.

            self.notify.info("Acquiring Panda lock for the first time.")

            from pandac.PandaModules import Thread, Mutex
            self.__dict__.setdefault('lock', Mutex('Messenger'))
            self.lock.acquire()

            self.acquire = self.lock.acquire

            # Wait for the cheesy lock to be released before we return.
            self.notify.info("Waiting for cheesy lock to be released.")
            while self.locked:
                Thread.forceYield()
            self.notify.info("Got cheesy lock.")
コード例 #9
0
ファイル: Messenger.py プロジェクト: Ed-von-Schleck/panda3d
        def __getLock(self):
            # Now that we've started Panda, it's safe to import the Mutex
            # class, which becomes our actual lock.
            # From now on, this lock will be used.

            self.notify.info("Acquiring Panda lock for the first time.")

            from pandac.PandaModules import Thread, Mutex
            self.__dict__.setdefault('lock', Mutex('Messenger'))
            self.lock.acquire()

            self.acquire = self.lock.acquire

            # Wait for the cheesy lock to be released before we return.
            self.notify.info("Waiting for cheesy lock to be released.")
            while self.locked:
                Thread.forceYield()
            self.notify.info("Got cheesy lock.")
コード例 #10
0
ファイル: heightfield.py プロジェクト: borgified/Hockfire
	def updateWithNewImage(self):
		posX = base.camera.getX()  + MAPSIZE/2
		posY = base.camera.getY()  + MAPSIZE/2
		if self.terrain2.getRoot().isHidden():
			self.terrain2.setHeightfield(self.myImage)
			self.terrain2.setFocalPoint(posX, posY)
			if Thread.isThreadingSupported():
				thread.start_new_thread(self.updateWithNewImageThread,(self.terrain2,1))
			else:
				self.updateWithNewImageThread(self.terrain2)
			self.terrain1.getRoot().hide()
			self.terrain2.getRoot().show()
			print "done"
		else:
			self.terrain1.setHeightfield(self.myImage)
			self.terrain1.setFocalPoint(posX, posY)
			if Thread.isThreadingSupported():
				thread.start_new_thread(self.updateWithNewImageThread,(self.terrain1,1))
			else:
				self.updateWithNewImageThread(self.terrain1)
			self.terrain2.getRoot().hide()
			self.terrain1.getRoot().show()
			print "done2"
コード例 #11
0
ファイル: whole_subnet.py プロジェクト: dgou/gibson
    def objectClicked(self):
        mpos = base.mouseWatcherNode.getMouse()
        self.pickerRay.setFromLens(base.camNode, mpos.getX(), mpos.getY())
 
        self.myTraverser.traverse(render)
        # Assume for simplicity's sake that myHandler is a CollisionHandlerQueue.
        if self.myHandler.getNumEntries() > 0:
            for i in range(self.myHandler.getNumEntries()):
                entry = self.myHandler.getEntry(i)
            self.myHandler.sortEntries()
            pickedObj = self.myHandler.getEntry(0).getIntoNodePath()
            pickedObj = pickedObj.findNetTag('myObjectTag')
            parent = pickedObj.getParent(Thread.getCurrentThread())
            if parent.getNetTag('state') == "in":
                self.AnimateOut(parent)
            elif parent.getNetTag('state') == "out":
                self.AnimateIn(parent)