gnome-games r7391 - in trunk/glchess: . src/lib src/lib/gtkui src/lib/scene/opengl
- From: rancell svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-games r7391 - in trunk/glchess: . src/lib src/lib/gtkui src/lib/scene/opengl
- Date: Tue, 19 Feb 2008 10:41:22 +0000 (GMT)
Author: rancell
Date: Tue Feb 19 10:41:22 2008
New Revision: 7391
URL: http://svn.gnome.org/viewvc/gnome-games?rev=7391&view=rev
Log:
Remove unused translation strings (Bug #517320)
Modified:
trunk/glchess/ChangeLog
trunk/glchess/src/lib/game.py
trunk/glchess/src/lib/gtkui/network.py
trunk/glchess/src/lib/scene/opengl/opengl.py
trunk/glchess/src/lib/scene/opengl/texture.py
Modified: trunk/glchess/src/lib/game.py
==============================================================================
--- trunk/glchess/src/lib/game.py (original)
+++ trunk/glchess/src/lib/game.py Tue Feb 19 10:41:22 2008
@@ -417,7 +417,7 @@
self.__currentPlayer._setReadyToMove(True)
self.endLock()
-
+
def getSquareOwner(self, coord):
"""TODO
"""
Modified: trunk/glchess/src/lib/gtkui/network.py
==============================================================================
--- trunk/glchess/src/lib/gtkui/network.py (original)
+++ trunk/glchess/src/lib/gtkui/network.py Tue Feb 19 10:41:22 2008
@@ -48,7 +48,7 @@
view = self.__gui.get_widget('room_list')
view.set_model(self.roomModel)
cell = gtk.CellRendererText()
- column = gtk.TreeViewColumn(_('#'), cell)
+ column = gtk.TreeViewColumn('', cell)
column.add_attribute(cell, 'text', 3)
view.append_column(column)
cell = gtk.CellRendererPixbuf()
@@ -56,13 +56,13 @@
column.add_attribute(cell, 'icon-name', 7)
view.append_column(column)
cell = gtk.CellRendererText()
- column = gtk.TreeViewColumn(_('Room'), cell)
+ column = gtk.TreeViewColumn('', cell)
column.add_attribute(cell, 'text', 2)
column.add_attribute(cell, 'weight', 5)
column.add_attribute(cell, 'style', 6)
view.append_column(column)
cell = gtk.CellRendererText()
- column = gtk.TreeViewColumn(_('Description'), cell)
+ column = gtk.TreeViewColumn('', cell)
column.add_attribute(cell, 'text', 4)
#view.append_column(column)
view.connect('row-activated', self._on_room_changed)
@@ -76,7 +76,7 @@
column.add_attribute(cell, 'icon-name', 2)
view.append_column(column)
cell = gtk.CellRendererText()
- column = gtk.TreeViewColumn(_('Player'), cell)
+ column = gtk.TreeViewColumn('', cell)
column.add_attribute(cell, 'text', 1)
view.append_column(column)
Modified: trunk/glchess/src/lib/scene/opengl/opengl.py
==============================================================================
--- trunk/glchess/src/lib/scene/opengl/opengl.py (original)
+++ trunk/glchess/src/lib/scene/opengl/opengl.py Tue Feb 19 10:41:22 2008
@@ -196,12 +196,12 @@
self.chessSets = {'white': builtin_models.WhiteBuiltinSet(), 'black': builtin_models.BlackBuiltinSet()}
self.whiteTexture = texture.Texture(os.path.join(TEXTURE_DIR, 'board.png'),
- ambient = BOARD_AMBIENT, diffuse = BOARD_DIFFUSE,
- specular = BOARD_SPECULAR, shininess = BOARD_SHININESS)
+ ambient = BOARD_AMBIENT, diffuse = BOARD_DIFFUSE,
+ specular = BOARD_SPECULAR, shininess = BOARD_SHININESS)
self.blackTexture = texture.Texture(os.path.join(TEXTURE_DIR, 'board.png'),
- ambient = BOARD_AMBIENT, diffuse = BOARD_DIFFUSE,
- specular = BOARD_SPECULAR, shininess = BOARD_SHININESS)
-
+ ambient = BOARD_AMBIENT, diffuse = BOARD_DIFFUSE,
+ specular = BOARD_SPECULAR, shininess = BOARD_SHININESS)
+
def onRedraw(self):
"""This method is called when the scene needs redrawing"""
pass
@@ -285,7 +285,36 @@
"""Render the scene.
This requires an OpenGL context.
- """
+ """
+ import cairo
+ surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, 32, 32)
+ context = cairo.Context(surface)
+ context.set_source_rgb(1.0, 1.0, 0.0)
+ context.rectangle(0, 0, 32, 32)
+ context.fill()
+
+ context.move_to(2, 2)
+ context.line_to(30, 16)
+ context.line_to(2, 30)
+ context.close_path()
+ context.set_source_rgb(0.0, 0.0, 1.0)
+ context.fill()
+ context.set_source_rgb(0.0, 1.0, 0.0)
+ context.set_line_width(4)
+ context.stroke()
+
+ t = glGenTextures(1)
+ glBindTexture(GL_TEXTURE_2D, t)
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1)
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT)
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT)
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)
+ data = surface.get_data()
+ gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, 32, 32, GL_BGRA, GL_UNSIGNED_BYTE, str(data))
+
+ self.whiteTexture.setT(t)
+
glClearColor(*BACKGROUND_COLOUR)
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
@@ -324,6 +353,9 @@
self.drawThrobber()
else:
self.drawPieces()
+
+ import time
+ print time.time()
def getSquare(self, x, y):
"""Find the chess square at a given 2D location.
Modified: trunk/glchess/src/lib/scene/opengl/texture.py
==============================================================================
--- trunk/glchess/src/lib/scene/opengl/texture.py (original)
+++ trunk/glchess/src/lib/scene/opengl/texture.py Tue Feb 19 10:41:22 2008
@@ -122,6 +122,9 @@
self.__data)
return texture
+
+ def setT(self, t):
+ self.__texture = t
def bind(self):
"""Bind this texture to the current surface.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]