Changeset - d6c48d2d3bd6
[Not reviewed]
default
0 1 0
drewp - 22 years ago 2002-07-13 03:09:26

shrunk the useful range of the slider so there won't be any noise at the ends
1 file changed with 6 insertions and 1 deletions:
0 comments (0 inline, 0 general)
light8/ExternalInput.py
Show inline comments
 
@@ -7,7 +7,12 @@ currentlevels = [0,0,0,0]
 
class NetSliderHandler(SocketServer.StreamRequestHandler):
 
    def handle(self):
 
        data = self.rfile.readline(1000)
 
        currentlevels[:] = [float(x)/255 for x in list(data.split())]
 
        currentlevels[:] = [round(self.bounds(float(x)/255),3) for x in list(data.split())]
 
    def bounds(self,x):
 
        # the last .1 both ways shall not do anything
 
        x=x*1.1-.05
 
        x=min(1,max(0,x))
 
        return x
 

	
 
def start_server(levelstorage=0):
 
    server = SocketServer.TCPServer(
0 comments (0 inline, 0 general)