Someone can help me to translate this script from blender 2.49 to 2.53, im trying here to take a look on the errors on the console window but i coldnt make the changes properly.
import GameLogic as G
import BGL
import Rasterizer as Rscene = G.getCurrentScene()
cont = G.getCurrentController()
objList = scene.objects
own = cont.ownerviewport = BGL.Buffer(BGL.GL_INT, 4)
BGL.glGetIntegerv(BGL.GL_VIEWPORT, viewport);width = R.getWindowWidth()
height = R.getWindowHeight()x = viewport[0] + width/2
y = viewport[1] + height/2x1 = viewport[0] + width/3
y1 = viewport[1] + height/3x2 = viewport[0] + width/3
y2 = viewport[1] + height/2x3 = viewport[0] + width/2
y3 = viewport[1] + height/2x4 = viewport[0] + width/2
y4 = viewport[1] + height/3pixels = BGL.Buffer(BGL.GL_FLOAT, [1])
pixels1 = BGL.Buffer(BGL.GL_FLOAT, [1])
pixels2 = BGL.Buffer(BGL.GL_FLOAT, [1])
pixels3 = BGL.Buffer(BGL.GL_FLOAT, [1])
pixels4 = BGL.Buffer(BGL.GL_FLOAT, [1])BGL.glReadPixels(x, y, 1, 1, BGL.GL_LUMINANCE, BGL.GL_FLOAT, pixels)
BGL.glReadPixels(x1, y1, 1, 1, BGL.GL_LUMINANCE, BGL.GL_FLOAT, pixels1)
BGL.glReadPixels(x2, y2, 1, 1, BGL.GL_LUMINANCE, BGL.GL_FLOAT, pixels2)
BGL.glReadPixels(x3, y3, 1, 1, BGL.GL_LUMINANCE, BGL.GL_FLOAT, pixels3)
BGL.glReadPixels(x4, y4, 1, 1, BGL.GL_LUMINANCE, BGL.GL_FLOAT, pixels4)avgPixels = (pixels[0]+pixels1[0]+pixels2[0]+pixels3[0]+pixels4[0])/5.0
#Slow adaptation
own.avgL = (own.avgL0.98 + avgPixels0.02)avgPixels = own.avgL
I really need this script working soon as possible, sorry for ask you guys sutch a begginer question, but i really need it working.