gnome-games r8394 - trunk/gnometris
- From: jclinton svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-games r8394 - trunk/gnometris
- Date: Mon, 5 Jan 2009 06:17:12 +0000 (UTC)
Author: jclinton
Date: Mon Jan 5 06:17:12 2009
New Revision: 8394
URL: http://svn.gnome.org/viewvc/gnome-games?rev=8394&view=rev
Log:
Squeltch the last of the whitespace errors giving me grief from git svn
Modified:
trunk/gnometris/block-cache.h
trunk/gnometris/blockops.cpp
trunk/gnometris/blocks.cpp
trunk/gnometris/field-noclutter.cpp
trunk/gnometris/field.cpp
trunk/gnometris/main.cpp
trunk/gnometris/preview-noclutter.cpp
trunk/gnometris/preview.cpp
trunk/gnometris/renderer-noclutter.cpp
trunk/gnometris/renderer-noclutter.h
trunk/gnometris/renderer.cpp
trunk/gnometris/renderer.h
trunk/gnometris/scoreframe.cpp
trunk/gnometris/tetris.cpp
Modified: trunk/gnometris/block-cache.h
==============================================================================
--- trunk/gnometris/block-cache.h (original)
+++ trunk/gnometris/block-cache.h Mon Jan 5 06:17:12 2009
@@ -30,13 +30,13 @@
class GnometrisBlockCache
{
public:
- GnometrisBlockCache (int);
+ GnometrisBlockCache (int);
~GnometrisBlockCache ();
CoglHandle get_block_by_id (int);
CoglHandle get_block_by_color (int);
private:
int slots;
-
+
};
#endif //__blockcache_h__
Modified: trunk/gnometris/blockops.cpp
==============================================================================
--- trunk/gnometris/blockops.cpp (original)
+++ trunk/gnometris/blockops.cpp Mon Jan 5 06:17:12 2009
@@ -38,7 +38,7 @@
color (0)
{
field = new Block*[COLUMNS];
-
+
posx = COLUMNS / 2;
posy = 0;
@@ -52,11 +52,11 @@
{
for (int i = 0; i < COLUMNS; ++i)
delete[] field[i];
-
+
delete[] field;
}
-bool
+bool
BlockOps::blockOkHere(int x, int y, int b, int r)
{
x -= 2;
@@ -76,14 +76,14 @@
}
}
- return true;
+ return true;
}
int
BlockOps::getLinesToBottom()
{
int lines = LINES;
-
+
for (int x = 0; x < 4; ++x)
{
for (int y = 3; y >= 0; --y)
@@ -105,7 +105,7 @@
return lines;
}
-bool
+bool
BlockOps::moveBlockLeft()
{
bool moved = false;
@@ -117,11 +117,11 @@
putBlockInField(false);
moved = true;
}
-
+
return moved;
}
-bool
+bool
BlockOps::moveBlockRight()
{
bool moved = false;
@@ -133,7 +133,7 @@
putBlockInField(false);
moved = true;
}
-
+
return moved;
}
@@ -141,9 +141,9 @@
BlockOps::rotateBlock(bool rotateCCW)
{
bool moved = false;
-
+
int r = rot;
-
+
if ( rotateCCW )
{
if (--r < 0) r = 3;
@@ -152,7 +152,7 @@
{
if (++r >= 4) r = 0;
}
-
+
if (blockOkHere(posx, posy, blocknr, r))
{
putBlockInField(true);
@@ -160,11 +160,11 @@
putBlockInField(false);
moved = true;
}
-
+
return moved;
}
-bool
+bool
BlockOps::moveBlockDown()
{
bool fallen = false;
@@ -178,11 +178,11 @@
++posy;
putBlockInField(false);
}
-
+
return fallen;
}
-void
+void
BlockOps::clearTarget ()
{
for (int x = 0; x < COLUMNS; ++x)
@@ -202,7 +202,7 @@
clearTarget ();
// FIXME: Check that this is actually guaranteed
- // to terminate (i.e. posx, posy, blocknr and rot
+ // to terminate (i.e. posx, posy, blocknr and rot
// are guaranteed to be valid).
int n = 0;
do {
@@ -214,7 +214,7 @@
putBlockInField (posx, posy + n, blocknr, rot, TARGET);
}
-void
+void
BlockOps::setUseTarget (bool use)
{
useTarget = use;
@@ -306,12 +306,12 @@
int cn = random_block_colors ? g_random_int_range(0, NCOLOURS) :
blocknr % NCOLOURS;
color = color_next == -1 ? cn : color_next;
-
+
blocknr_next = g_random_int_range(0, tableSize);
rot_next = g_random_int_range(0, 4);
color_next = random_block_colors ? g_random_int_range(0, NCOLOURS) :
blocknr_next % NCOLOURS;
-
+
if (!blockOkHere(posx, posy, blocknr, rot))
return false;
@@ -331,12 +331,12 @@
for (int x = 0; x < COLUMNS; ++x)
{
field[x][y].what = EMPTY;
- field[x][y].color = 0;
+ field[x][y].color = 0;
if ((y>=(LINES - filled_lines)) && (x != blank) &&
- ((g_random_int_range(0, 10)) < fill_prob)) {
+ ((g_random_int_range(0, 10)) < fill_prob)) {
field[x][y].what = LAYING;
- field[x][y].color =
+ field[x][y].color =
g_random_int_range(0, NCOLOURS);
}
}
@@ -362,7 +362,7 @@
int i = bx - 2 + x;
int j = y + by;
- if ((fill == TARGET) &&
+ if ((fill == TARGET) &&
(field[i][j].what != EMPTY))
return;
Modified: trunk/gnometris/blocks.cpp
==============================================================================
--- trunk/gnometris/blocks.cpp (original)
+++ trunk/gnometris/blocks.cpp Mon Jan 5 06:17:12 2009
@@ -259,10 +259,10 @@
{2, 2},
},
};
-
+
int sizeTSize = sizeof(sizeTable)/sizeof(sizeTable[0]);
-int offsetTable[][4][2] =
+int offsetTable[][4][2] =
{
{
{0, 1},
Modified: trunk/gnometris/field-noclutter.cpp
==============================================================================
--- trunk/gnometris/field-noclutter.cpp (original)
+++ trunk/gnometris/field-noclutter.cpp Mon Jan 5 06:17:12 2009
@@ -141,11 +141,11 @@
cairo_t *cr;
cr = gdk_cairo_create (w->window);
-
+
cairo_set_source_surface (cr, buffer, 0, 0);
cairo_rectangle (cr, x, y, wd, ht);
cairo_fill (cr);
-
+
cairo_destroy (cr);
}
@@ -187,7 +187,7 @@
pango_layout_get_size(dummy_layout, &lw, &lh);
g_object_unref(dummy_layout);
- // desired height : lh = widget width * 0.9 : lw
+ // desired height : lh = widget width * 0.9 : lw
pango_font_description_set_absolute_size(desc, ((float) lh / lw) * PANGO_SCALE * width * 0.8);
pango_layout_set_font_description(layout, desc);
pango_font_description_free(desc);
@@ -221,7 +221,7 @@
if (renderer)
delete renderer;
- renderer = rendererFactory (themeID, buffer, background, field,
+ renderer = rendererFactory (themeID, buffer, background, field,
COLUMNS, LINES, width, height);
rendererTheme = themeID;
} else {
@@ -303,7 +303,7 @@
redraw();
}
-void
+void
Field::setTheme (gint id)
{
themeID = id;
Modified: trunk/gnometris/field.cpp
==============================================================================
--- trunk/gnometris/field.cpp (original)
+++ trunk/gnometris/field.cpp Mon Jan 5 06:17:12 2009
@@ -123,7 +123,7 @@
field->rescaleBackground ();
field->rescaleBlockCache ();
-
+
return TRUE;
}
@@ -133,11 +133,11 @@
cairo_t *cr;
cr = gdk_cairo_create (w->window);
-
+
cairo_set_source_surface (cr, buffer, 0, 0);
cairo_rectangle (cr, x, y, wd, ht);
cairo_fill (cr);
-
+
cairo_destroy (cr);
}
@@ -170,7 +170,7 @@
pango_layout_get_size(dummy_layout, &lw, &lh);
g_object_unref(dummy_layout);
- // desired height : lh = widget width * 0.9 : lw
+ // desired height : lh = widget width * 0.9 : lw
pango_font_description_set_absolute_size(desc, ((float) lh / lw) * PANGO_SCALE * width * 0.8);
pango_layout_set_font_description(layout, desc);
pango_font_description_free(desc);
@@ -194,7 +194,7 @@
Field::redraw()
{
cairo_t *cr;
-
+
g_return_if_fail(buffer);
generateTarget ();
@@ -204,7 +204,7 @@
if (renderer)
delete renderer;
- renderer = rendererFactory (themeID, buffer, background, field,
+ renderer = rendererFactory (themeID, buffer, background, field,
COLUMNS, LINES, width, height);
rendererTheme = themeID;
} else {
@@ -286,7 +286,7 @@
redraw();
}
-void
+void
Field::setTheme (gint id)
{
themeID = id;
Modified: trunk/gnometris/main.cpp
==============================================================================
--- trunk/gnometris/main.cpp (original)
+++ trunk/gnometris/main.cpp Mon Jan 5 06:17:12 2009
@@ -46,12 +46,12 @@
setgid_io_init ();
bindtextdomain (GETTEXT_PACKAGE, games_runtime_get_directory (GAMES_RUNTIME_LOCALE_DIRECTORY));
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain(GETTEXT_PACKAGE);
int cmdlineLevel = 0;
- const GOptionEntry options[] =
+ const GOptionEntry options[] =
{
{"level", 'l', 0, G_OPTION_ARG_INT, &cmdlineLevel, N_("Set starting level (1 or greater)"), N_("LEVEL")},
{NULL}
Modified: trunk/gnometris/preview-noclutter.cpp
==============================================================================
--- trunk/gnometris/preview-noclutter.cpp (original)
+++ trunk/gnometris/preview-noclutter.cpp Mon Jan 5 06:17:12 2009
@@ -52,9 +52,9 @@
g_signal_connect (w, "configure_event", G_CALLBACK (configure), this);
/* FIXME: We should scale with the rest of the UI, but that requires
- * changes to the widget layout - i.e. wrap the preview in an
+ * changes to the widget layout - i.e. wrap the preview in an
* fixed-aspect box. */
- gtk_widget_set_size_request (w, PREVIEW_SIZE * 20,
+ gtk_widget_set_size_request (w, PREVIEW_SIZE * 20,
PREVIEW_SIZE * 20);
gtk_widget_show (w);
@@ -92,7 +92,7 @@
for (x = 1; x < PREVIEW_WIDTH - 1; x++) {
for (y = 1; y < PREVIEW_HEIGHT - 1; y++) {
- if ((blocknr != -1) &&
+ if ((blocknr != -1) &&
blockTable[blocknr][blockrot][x-1][y-1]) {
blocks[x][y].what = LAYING;
blocks[x][y].color = blockcolor;
@@ -117,12 +117,12 @@
if (preview->background)
cairo_surface_destroy (preview->background);
- preview->background =
+ preview->background =
cairo_surface_create_similar (cairo_get_target (cr),
CAIRO_CONTENT_COLOR,
event->width,
event->height);
-
+
cairo_destroy (cr);
cr = cairo_create (preview->background);
@@ -160,13 +160,13 @@
cairo_stroke (cr);
}
- else
+ else
{
cairo_surface_t *dst;
-
+
dst = cairo_get_target (cr);
- r = rendererFactory (preview->themeID, dst,
+ r = rendererFactory (preview->themeID, dst,
preview->background, preview->blocks,
PREVIEW_WIDTH, PREVIEW_HEIGHT,
preview->width, preview->height);
Modified: trunk/gnometris/preview.cpp
==============================================================================
--- trunk/gnometris/preview.cpp (original)
+++ trunk/gnometris/preview.cpp Mon Jan 5 06:17:12 2009
@@ -51,9 +51,9 @@
g_signal_connect (w, "configure_event", G_CALLBACK (configure), this);
/* FIXME: We should scale with the rest of the UI, but that requires
- * changes to the widget layout - i.e. wrap the preview in an
+ * changes to the widget layout - i.e. wrap the preview in an
* fixed-aspect box. */
- gtk_widget_set_size_request (w, PREVIEW_SIZE * 20,
+ gtk_widget_set_size_request (w, PREVIEW_SIZE * 20,
PREVIEW_SIZE * 20);
gtk_widget_show (w);
@@ -91,7 +91,7 @@
for (x = 1; x < PREVIEW_WIDTH - 1; x++) {
for (y = 1; y < PREVIEW_HEIGHT - 1; y++) {
- if ((blocknr != -1) &&
+ if ((blocknr != -1) &&
blockTable[blocknr][blockrot][x-1][y-1]) {
blocks[x][y].what = LAYING;
blocks[x][y].color = blockcolor;
@@ -116,12 +116,12 @@
if (preview->background)
cairo_surface_destroy (preview->background);
- preview->background =
+ preview->background =
cairo_surface_create_similar (cairo_get_target (cr),
CAIRO_CONTENT_COLOR,
event->width,
event->height);
-
+
cairo_destroy (cr);
cr = cairo_create (preview->background);
Modified: trunk/gnometris/renderer-noclutter.cpp
==============================================================================
--- trunk/gnometris/renderer-noclutter.cpp (original)
+++ trunk/gnometris/renderer-noclutter.cpp Mon Jan 5 06:17:12 2009
@@ -51,8 +51,8 @@
return 0;
}
-Renderer * rendererFactory (gint id, cairo_surface_t *dst,
- cairo_surface_t *bg, Block **src, int w,
+Renderer * rendererFactory (gint id, cairo_surface_t *dst,
+ cairo_surface_t *bg, Block **src, int w,
int h, int pxw, int pxh)
{
switch (id) {
@@ -82,7 +82,7 @@
for the preview widget and possibly the theme previewer, so make no
assumptions. */
-Renderer::Renderer (cairo_surface_t *dst, cairo_surface_t *bg, Block **src,
+Renderer::Renderer (cairo_surface_t *dst, cairo_surface_t *bg, Block **src,
int w, int h, int pxw, int pxh)
{
target = cairo_surface_reference (dst);
@@ -132,12 +132,12 @@
i = data[x][y].color;
i = CLAMP (i, 0, 6);
- cairo_set_source_rgb(cr, colours[i][0],
- colours[i][1],
+ cairo_set_source_rgb(cr, colours[i][0],
+ colours[i][1],
colours[i][2]);
}
- cairo_rectangle(cr, x+0.05, y+0.05,
+ cairo_rectangle(cr, x+0.05, y+0.05,
0.9, 0.9);
cairo_fill (cr);
}
@@ -259,8 +259,8 @@
if (data[x][y].what == TARGET) {
cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0);
} else {
- cairo_set_source_rgb (cr, colours[i][0],
- colours[i][1],
+ cairo_set_source_rgb (cr, colours[i][0],
+ colours[i][1],
colours[i][2]);
}
cairo_rectangle (cr, -0.025, -0.025, 1.025, 1.025);
@@ -275,7 +275,7 @@
if ((m < 0) || (n < 0) || (m >= width) || (n >= height))
neighbours[i] = 0;
else
- neighbours[i] = ((data[m][n].what != EMPTY) &&
+ neighbours[i] = ((data[m][n].what != EMPTY) &&
(data[m][n].color == c)) ? 1 : 0;
}
@@ -377,32 +377,32 @@
cairo_pattern_t *pat = NULL;
/* the following garbage is derived from the official tango style guide */
const gdouble colours[8][3][3] = {
- {{0.93725490196078431, 0.16078431372549021, 0.16078431372549021},
- {0.8, 0.0, 0.0},
+ {{0.93725490196078431, 0.16078431372549021, 0.16078431372549021},
+ {0.8, 0.0, 0.0},
{0.64313725490196083, 0.0, 0.0}}, /* red */
- {{0.54117647058823526, 0.88627450980392153, 0.20392156862745098},
- {0.45098039215686275, 0.82352941176470584, 0.086274509803921567},
+ {{0.54117647058823526, 0.88627450980392153, 0.20392156862745098},
+ {0.45098039215686275, 0.82352941176470584, 0.086274509803921567},
{0.30588235294117649, 0.60392156862745094, 0.023529411764705882}}, /* green */
- {{0.44705882352941179, 0.62352941176470589, 0.81176470588235294},
- {0.20392156862745098, 0.396078431372549, 0.64313725490196083},
+ {{0.44705882352941179, 0.62352941176470589, 0.81176470588235294},
+ {0.20392156862745098, 0.396078431372549, 0.64313725490196083},
{0.12549019607843137, 0.29019607843137257, 0.52941176470588236}}, /* blue */
- {{0.93333333333333335, 0.93333333333333335, 0.92549019607843142},
- {0.82745098039215681, 0.84313725490196079, 0.81176470588235294},
+ {{0.93333333333333335, 0.93333333333333335, 0.92549019607843142},
+ {0.82745098039215681, 0.84313725490196079, 0.81176470588235294},
{0.72941176470588232, 0.74117647058823533, 0.71372549019607845}}, /* white */
- {{0.9882352941176471, 0.9137254901960784, 0.30980392156862746},
- {0.92941176470588238, 0.83137254901960789, 0.0},
+ {{0.9882352941176471, 0.9137254901960784, 0.30980392156862746},
+ {0.92941176470588238, 0.83137254901960789, 0.0},
{0.7686274509803922, 0.62745098039215685, 0.0}}, /* yellow */
- {{0.67843137254901964, 0.49803921568627452, 0.6588235294117647},
- {0.45882352941176469, 0.31372549019607843, 0.4823529411764706},
+ {{0.67843137254901964, 0.49803921568627452, 0.6588235294117647},
+ {0.45882352941176469, 0.31372549019607843, 0.4823529411764706},
{0.36078431372549019, 0.20784313725490197, 0.4}}, /* purple */
- {{0.9882352941176471, 0.68627450980392157, 0.24313725490196078},
- {0.96078431372549022, 0.47450980392156861, 0.0},
+ {{0.9882352941176471, 0.68627450980392157, 0.24313725490196078},
+ {0.96078431372549022, 0.47450980392156861, 0.0},
{0.80784313725490198, 0.36078431372549019, 0.0}}, /* orange (replacing cyan) */
{{0.33, 0.34, 0.32},
@@ -439,7 +439,7 @@
cairo_fill_preserve (cr); /* fill with shaded gradient */
- if (usegrads)
+ if (usegrads)
cairo_pattern_destroy(pat);
cairo_set_source_rgb(cr, colours[i][2][0],
colours[i][2][1],
@@ -449,7 +449,7 @@
cairo_stroke (cr); /* add darker outline */
drawRoundedRectangle (cr, x+0.15, y+0.15, 0.7, 0.7, 0.08);
- if (data[x][y].what != TARGET) {
+ if (data[x][y].what != TARGET) {
if (usegrads) {
pat = cairo_pattern_create_linear (x-0.3, y-0.3, x+0.8, y+0.8);
switch (i) { /* yellow and white blocks need a brighter highlight */
@@ -490,7 +490,7 @@
}
cairo_stroke (cr); /* add inner edge highlight */
- if (usegrads && (data[x][y].what != TARGET))
+ if (usegrads && (data[x][y].what != TARGET))
cairo_pattern_destroy (pat);
}
Modified: trunk/gnometris/renderer-noclutter.h
==============================================================================
--- trunk/gnometris/renderer-noclutter.h (original)
+++ trunk/gnometris/renderer-noclutter.h Mon Jan 5 06:17:12 2009
@@ -92,7 +92,7 @@
gboolean usegrads;
private:
- void drawRoundedRectangle (cairo_t * cr, gdouble x, gdouble y, gdouble w, gdouble h, gdouble r);
+ void drawRoundedRectangle (cairo_t * cr, gdouble x, gdouble y, gdouble w, gdouble h, gdouble r);
};
#endif // __renderer_h__
Modified: trunk/gnometris/renderer.cpp
==============================================================================
--- trunk/gnometris/renderer.cpp (original)
+++ trunk/gnometris/renderer.cpp Mon Jan 5 06:17:12 2009
@@ -51,8 +51,8 @@
return 0;
}
-Renderer * rendererFactory (gint id, cairo_surface_t *dst,
- cairo_surface_t *bg, Block **src, int w,
+Renderer * rendererFactory (gint id, cairo_surface_t *dst,
+ cairo_surface_t *bg, Block **src, int w,
int h, int pxw, int pxh)
{
switch (id) {
@@ -82,7 +82,7 @@
for the preview widget and possibly the theme previewer, so make no
assumptions. */
-Renderer::Renderer (cairo_surface_t *dst, cairo_surface_t *bg, Block **src,
+Renderer::Renderer (cairo_surface_t *dst, cairo_surface_t *bg, Block **src,
int w, int h, int pxw, int pxh)
{
target = cairo_surface_reference (dst);
@@ -133,12 +133,12 @@
i = data[x][y].color;
i = CLAMP (i, 0, 6);
- cairo_set_source_rgb(cr, colours[i][0],
- colours[i][1],
+ cairo_set_source_rgb(cr, colours[i][0],
+ colours[i][1],
colours[i][2]);
}
- cairo_rectangle(cr, x+0.05, y+0.05,
+ cairo_rectangle(cr, x+0.05, y+0.05,
0.9, 0.9);
cairo_fill (cr);
}
@@ -260,8 +260,8 @@
if (data[x][y].what == TARGET) {
cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0);
} else {
- cairo_set_source_rgb (cr, colours[i][0],
- colours[i][1],
+ cairo_set_source_rgb (cr, colours[i][0],
+ colours[i][1],
colours[i][2]);
}
cairo_rectangle (cr, -0.025, -0.025, 1.025, 1.025);
@@ -276,7 +276,7 @@
if ((m < 0) || (n < 0) || (m >= width) || (n >= height))
neighbours[i] = 0;
else
- neighbours[i] = ((data[m][n].what != EMPTY) &&
+ neighbours[i] = ((data[m][n].what != EMPTY) &&
(data[m][n].color == c)) ? 1 : 0;
}
@@ -378,32 +378,32 @@
cairo_pattern_t *pat = NULL;
/* the following garbage is derived from the official tango style guide */
const gdouble colours[8][3][3] = {
- {{0.93725490196078431, 0.16078431372549021, 0.16078431372549021},
- {0.8, 0.0, 0.0},
+ {{0.93725490196078431, 0.16078431372549021, 0.16078431372549021},
+ {0.8, 0.0, 0.0},
{0.64313725490196083, 0.0, 0.0}}, /* red */
- {{0.54117647058823526, 0.88627450980392153, 0.20392156862745098},
- {0.45098039215686275, 0.82352941176470584, 0.086274509803921567},
+ {{0.54117647058823526, 0.88627450980392153, 0.20392156862745098},
+ {0.45098039215686275, 0.82352941176470584, 0.086274509803921567},
{0.30588235294117649, 0.60392156862745094, 0.023529411764705882}}, /* green */
- {{0.44705882352941179, 0.62352941176470589, 0.81176470588235294},
- {0.20392156862745098, 0.396078431372549, 0.64313725490196083},
+ {{0.44705882352941179, 0.62352941176470589, 0.81176470588235294},
+ {0.20392156862745098, 0.396078431372549, 0.64313725490196083},
{0.12549019607843137, 0.29019607843137257, 0.52941176470588236}}, /* blue */
- {{0.93333333333333335, 0.93333333333333335, 0.92549019607843142},
- {0.82745098039215681, 0.84313725490196079, 0.81176470588235294},
+ {{0.93333333333333335, 0.93333333333333335, 0.92549019607843142},
+ {0.82745098039215681, 0.84313725490196079, 0.81176470588235294},
{0.72941176470588232, 0.74117647058823533, 0.71372549019607845}}, /* white */
- {{0.9882352941176471, 0.9137254901960784, 0.30980392156862746},
- {0.92941176470588238, 0.83137254901960789, 0.0},
+ {{0.9882352941176471, 0.9137254901960784, 0.30980392156862746},
+ {0.92941176470588238, 0.83137254901960789, 0.0},
{0.7686274509803922, 0.62745098039215685, 0.0}}, /* yellow */
- {{0.67843137254901964, 0.49803921568627452, 0.6588235294117647},
- {0.45882352941176469, 0.31372549019607843, 0.4823529411764706},
+ {{0.67843137254901964, 0.49803921568627452, 0.6588235294117647},
+ {0.45882352941176469, 0.31372549019607843, 0.4823529411764706},
{0.36078431372549019, 0.20784313725490197, 0.4}}, /* purple */
- {{0.9882352941176471, 0.68627450980392157, 0.24313725490196078},
- {0.96078431372549022, 0.47450980392156861, 0.0},
+ {{0.9882352941176471, 0.68627450980392157, 0.24313725490196078},
+ {0.96078431372549022, 0.47450980392156861, 0.0},
{0.80784313725490198, 0.36078431372549019, 0.0}}, /* orange (replacing cyan) */
{{0.33, 0.34, 0.32},
@@ -440,7 +440,7 @@
cairo_fill_preserve (cr); /* fill with shaded gradient */
- if (usegrads)
+ if (usegrads)
cairo_pattern_destroy(pat);
cairo_set_source_rgb(cr, colours[i][2][0],
colours[i][2][1],
@@ -450,7 +450,7 @@
cairo_stroke (cr); /* add darker outline */
drawRoundedRectangle (cr, x+0.15, y+0.15, 0.7, 0.7, 0.08);
- if (data[x][y].what != TARGET) {
+ if (data[x][y].what != TARGET) {
if (usegrads) {
pat = cairo_pattern_create_linear (x-0.3, y-0.3, x+0.8, y+0.8);
switch (i) { /* yellow and white blocks need a brighter highlight */
@@ -491,7 +491,7 @@
}
cairo_stroke (cr); /* add inner edge highlight */
- if (usegrads && (data[x][y].what != TARGET))
+ if (usegrads && (data[x][y].what != TARGET))
cairo_pattern_destroy (pat);
}
Modified: trunk/gnometris/renderer.h
==============================================================================
--- trunk/gnometris/renderer.h (original)
+++ trunk/gnometris/renderer.h Mon Jan 5 06:17:12 2009
@@ -93,7 +93,7 @@
gboolean usegrads;
private:
- void drawRoundedRectangle (cairo_t * cr, gdouble x, gdouble y, gdouble w, gdouble h, gdouble r);
+ void drawRoundedRectangle (cairo_t * cr, gdouble x, gdouble y, gdouble w, gdouble h, gdouble r);
};
#endif // __renderer_h__
Modified: trunk/gnometris/scoreframe.cpp
==============================================================================
--- trunk/gnometris/scoreframe.cpp (original)
+++ trunk/gnometris/scoreframe.cpp Mon Jan 5 06:17:12 2009
@@ -31,7 +31,7 @@
ScoreFrame::ScoreFrame(int cmdlLevel)
: score(0), lines(0)
{
- if (cmdlLevel)
+ if (cmdlLevel)
startingLevel = cmdlLevel;
else {
startingLevel = games_conf_get_integer (KEY_OPTIONS_GROUP,
@@ -41,7 +41,7 @@
startingLevel = CLAMP (startingLevel, 1, 20);
level = startingLevel;
-
+
w = gtk_table_new (3, 2, FALSE);
scoreLabel = gtk_label_new (_("Score:"));
@@ -83,11 +83,11 @@
gtk_widget_show_all (w);
}
-void
+void
ScoreFrame::setScore(int s)
{
score = s;
-
+
sprintf(b, "%7d", score);
gtk_label_set_text(GTK_LABEL(scorew), b);
}
@@ -98,8 +98,8 @@
setScore (score + s);
}
-// The bonus for clearing everything.
-void
+// The bonus for clearing everything.
+void
ScoreFrame::scoreLastLineBonus ()
{
incScore (10000*level);
@@ -143,7 +143,7 @@
return level;
}
-void
+void
ScoreFrame::setLevel(int l)
{
level = l;
@@ -151,7 +151,7 @@
gtk_label_set_text(GTK_LABEL(levelw), b);
}
-void
+void
ScoreFrame::setLines(int l)
{
lines = l;
Modified: trunk/gnometris/tetris.cpp
==============================================================================
--- trunk/gnometris/tetris.cpp (original)
+++ trunk/gnometris/tetris.cpp Mon Jan 5 06:17:12 2009
@@ -83,17 +83,17 @@
};
-Tetris::Tetris(int cmdlLevel):
+Tetris::Tetris(int cmdlLevel):
themeno (0),
field(0),
- paused(false),
- timeoutId(0),
- onePause(false),
+ paused(false),
+ timeoutId(0),
+ onePause(false),
inPlay(false),
useTarget(false),
bgimage(0),
- setupdialog(0),
- cmdlineLevel(cmdlLevel),
+ setupdialog(0),
+ cmdlineLevel(cmdlLevel),
fastFall(false),
dropBlock(false)
{
@@ -107,7 +107,7 @@
gchar *outdir;
const char *dname;
- const GtkTargetEntry targets[] = {{(gchar*) "text/uri-list", 0, URI_LIST},
+ const GtkTargetEntry targets[] = {{(gchar*) "text/uri-list", 0, URI_LIST},
{(gchar*) "property/bgimage", 0, URI_LIST},
{(gchar*) "text/plain", 0, TEXT_PLAIN},
{(gchar*) "STRING", 0, TEXT_PLAIN},
@@ -151,7 +151,7 @@
" </menu>"
" </menubar>"
"</ui>";
-
+
/* Locate our background image. */
@@ -167,15 +167,15 @@
defaultPixmap = g_build_filename (dname, "gnometris.svg", NULL);
default_bgimage = true;
}
-
+
w = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (w), _("Gnometris"));
g_signal_connect (w, "delete_event", G_CALLBACK (gameQuit), this);
- gtk_drag_dest_set (w, GTK_DEST_DEFAULT_ALL, targets,
- G_N_ELEMENTS(targets),
+ gtk_drag_dest_set (w, GTK_DEST_DEFAULT_ALL, targets,
+ G_N_ELEMENTS(targets),
GDK_ACTION_MOVE);
- g_signal_connect (G_OBJECT (w), "drag_data_received",
+ g_signal_connect (G_OBJECT (w), "drag_data_received",
G_CALLBACK (dragDrop), this);
g_signal_connect (G_OBJECT (w), "focus_out_event",
G_CALLBACK (focusOut), this);
@@ -225,7 +225,7 @@
gtk_frame_set_shadow_type (GTK_FRAME (aspect_frame), GTK_SHADOW_NONE);
gtk_container_add (GTK_CONTAINER (aspect_frame), field->getWidget());
- gtk_widget_set_events(w, gtk_widget_get_events(w) |
+ gtk_widget_set_events(w, gtk_widget_get_events(w) |
GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK);
GtkWidget *vb1 = gtk_vbox_new(FALSE, 0);
@@ -241,18 +241,18 @@
GtkWidget *vb2 = gtk_vbox_new(FALSE, 0);
gtk_container_set_border_width(GTK_CONTAINER(vb2), 10);
gtk_box_pack_end(GTK_BOX(hb), vb2, 0, 0, 0);
-
+
gtk_box_pack_start(GTK_BOX(vb2), preview->getWidget(), FALSE, FALSE, 0);
-
+
scoreFrame = new ScoreFrame(cmdlineLevel);
-
+
gtk_box_pack_end(GTK_BOX(vb2), scoreFrame->getWidget(), TRUE, FALSE, 0);
high_scores = new HighScores ();
setOptions ();
themeList = NULL;
-
+
gtk_widget_show(vbox);
gtk_widget_show(hb);
gtk_widget_show(vb1);
@@ -290,7 +290,7 @@
g_signal_handler_disconnect (games_conf_get_default (), confNotifyID);
}
-void
+void
Tetris::setupdialogDestroy(GtkWidget *widget, void *d)
{
Tetris *t = (Tetris*) d;
@@ -317,11 +317,11 @@
if (!usebg)
bgimage = NULL;
else {
- if (g_file_test (bgPixmap, G_FILE_TEST_EXISTS))
+ if (g_file_test (bgPixmap, G_FILE_TEST_EXISTS))
bgimage = gdk_pixbuf_new_from_file (bgPixmap, NULL);
- else if (g_file_test (defaultPixmap, G_FILE_TEST_EXISTS))
+ else if (g_file_test (defaultPixmap, G_FILE_TEST_EXISTS))
bgimage = gdk_pixbuf_new_from_file (defaultPixmap, NULL);
- else
+ else
bgimage = NULL;
}
@@ -330,7 +330,7 @@
if (bgimage && !default_bgimage) {
int width, height;
int bgwidth, bgheight;
-
+
bgwidth = COLUMNS*BLOCK_SIZE;
bgheight = LINES*BLOCK_SIZE;
@@ -345,10 +345,10 @@
((width == height) && (width < bgwidth))) {
GdkPixbuf * temp;
int i, j;
-
- temp = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8,
- bgwidth, bgheight);
-
+
+ temp = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8,
+ bgwidth, bgheight);
+
for (i=0; i<=bgwidth/width; i++) {
for (j=0; j<=bgheight/height; j++) {
int x, y, ww, hh;
@@ -375,7 +375,7 @@
else
field->setBackground (&bgcolour);
}
-
+
if (preview)
{
/* FIXME: We should do an update once the preview actually
@@ -432,9 +432,9 @@
preview->setTheme (themeno);
startingLevel = confGetInt (KEY_OPTIONS_GROUP, KEY_STARTING_LEVEL, 1);
- if (startingLevel < 1)
+ if (startingLevel < 1)
startingLevel = 1;
- if (startingLevel > 20)
+ if (startingLevel > 20)
startingLevel = 20;
games_sound_enable (confGetBoolean (KEY_OPTIONS_GROUP, KEY_SOUND, TRUE));
@@ -442,7 +442,7 @@
useTarget = confGetBoolean (KEY_OPTIONS_GROUP, KEY_USE_TARGET, FALSE);
do_preview = confGetBoolean (KEY_OPTIONS_GROUP, KEY_DO_PREVIEW, TRUE);
-
+
if (preview) {
preview->enable(do_preview);
}
@@ -507,21 +507,21 @@
GTK_TOGGLE_BUTTON (widget)->active);
}
-void
+void
Tetris::setSelectionPreview(GtkWidget *widget, void *d)
{
games_conf_set_boolean (KEY_OPTIONS_GROUP, KEY_DO_PREVIEW,
GTK_TOGGLE_BUTTON (widget)->active);
}
-void
+void
Tetris::setSelectionBlocks(GtkWidget *widget, void *d)
{
games_conf_set_boolean (KEY_OPTIONS_GROUP, KEY_RANDOM_BLOCK_COLORS,
GTK_TOGGLE_BUTTON (widget)->active);
}
-void
+void
Tetris::setRotateCounterClockWise(GtkWidget *widget, void *d)
{
games_conf_set_boolean (KEY_OPTIONS_GROUP, KEY_ROTATE_COUNTER_CLOCKWISE,
@@ -540,16 +540,16 @@
ThemeTable[t->themeno].id);
}
-void
+void
Tetris::setTarget (GtkWidget *widget, void *data)
{
Tetris *t;
-
+
t = (Tetris *)data;
t->useTarget = GTK_TOGGLE_BUTTON (widget)->active;
- games_conf_set_boolean (KEY_OPTIONS_GROUP, KEY_USE_TARGET,
+ games_conf_set_boolean (KEY_OPTIONS_GROUP, KEY_USE_TARGET,
t->useTarget);
}
@@ -574,7 +574,7 @@
games_conf_set_integer (KEY_OPTIONS_GROUP, KEY_STARTING_LEVEL, value);
}
-int
+int
Tetris::gameProperties(GtkAction *action, void *d)
{
GtkWidget *notebook;
@@ -587,7 +587,7 @@
GtkWidget *controls_list;
Tetris *t = (Tetris*) d;
-
+
if (t->setupdialog) {
gtk_window_present (GTK_WINDOW(t->setupdialog));
return FALSE;
@@ -595,7 +595,7 @@
/* create the dialog */
t->setupdialog =
- gtk_dialog_new_with_buttons(_("Gnometris Preferences"),
+ gtk_dialog_new_with_buttons(_("Gnometris Preferences"),
GTK_WINDOW (t->w),
(GtkDialogFlags)0,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
@@ -628,7 +628,7 @@
label = gtk_label_new_with_mnemonic (_("_Number of pre-filled rows:"));
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1,
- (GtkAttachOptions) GTK_FILL,
+ (GtkAttachOptions) GTK_FILL,
(GtkAttachOptions) 0,
0, 0);
@@ -636,7 +636,7 @@
t->fill_height_spinner = gtk_spin_button_new (GTK_ADJUSTMENT (adj), 10, 0);
gtk_spin_button_set_update_policy
(GTK_SPIN_BUTTON (t->fill_height_spinner), GTK_UPDATE_ALWAYS);
- gtk_spin_button_set_snap_to_ticks
+ gtk_spin_button_set_snap_to_ticks
(GTK_SPIN_BUTTON (t->fill_height_spinner), TRUE);
g_signal_connect (t->fill_height_spinner, "value_changed",
G_CALLBACK (lineFillHeightChanged), t);
@@ -647,14 +647,14 @@
label = gtk_label_new_with_mnemonic (_("_Density of blocks in a pre-filled row:"));
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2,
- (GtkAttachOptions) GTK_FILL,
+ (GtkAttachOptions) GTK_FILL,
(GtkAttachOptions) 0,
0, 0);
adj = gtk_adjustment_new (t->line_fill_prob, 0, 10, 1, 5, 0);
t->fill_prob_spinner = gtk_spin_button_new (GTK_ADJUSTMENT (adj), 10, 0);
gtk_spin_button_set_update_policy (GTK_SPIN_BUTTON (t->fill_prob_spinner),
- GTK_UPDATE_ALWAYS);
+ GTK_UPDATE_ALWAYS);
gtk_spin_button_set_snap_to_ticks
(GTK_SPIN_BUTTON (t->fill_prob_spinner), TRUE);
g_signal_connect (t->fill_prob_spinner, "value_changed",
@@ -666,7 +666,7 @@
label = gtk_label_new_with_mnemonic (_("_Starting level:"));
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3,
- (GtkAttachOptions) GTK_FILL,
+ (GtkAttachOptions) GTK_FILL,
(GtkAttachOptions) 0,
0, 0);
@@ -681,7 +681,7 @@
gtk_label_set_mnemonic_widget (GTK_LABEL (label), t->sentry);
gtk_container_add (GTK_CONTAINER (frame), table);
- gtk_box_pack_start (GTK_BOX (vbox), frame,
+ gtk_box_pack_start (GTK_BOX (vbox), frame,
FALSE, FALSE, 0);
frame = games_frame_new (_("Operation"));
@@ -695,7 +695,7 @@
g_signal_connect (t->sound_toggle, "clicked",
G_CALLBACK (setSound), d);
gtk_box_pack_start (GTK_BOX (fvbox), t->sound_toggle, 0, 0, 0);
-
+
/* preview next block */
t->do_preview_toggle =
gtk_check_button_new_with_mnemonic (_("_Preview next block"));
@@ -728,7 +728,7 @@
0, 0, 0);
t->useTargetToggle = gtk_check_button_new_with_mnemonic (_("Show _where the block will land"));
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (t->useTargetToggle),
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (t->useTargetToggle),
t->useTarget);
g_signal_connect (t->useTargetToggle, "clicked",
G_CALLBACK (setTarget), d);
@@ -736,7 +736,7 @@
0, 0, 0);
gtk_container_add (GTK_CONTAINER (frame), fvbox);
- gtk_box_pack_start (GTK_BOX (vbox), frame,
+ gtk_box_pack_start (GTK_BOX (vbox), frame,
FALSE, FALSE, 0);
frame = games_frame_new (_("Theme"));
@@ -803,7 +803,7 @@
return TRUE;
}
-int
+int
Tetris::focusOut(GtkWidget *widget, GdkEvent *e, Tetris *t)
{
if (t->inPlay && !t->paused)
@@ -859,7 +859,7 @@
int intv = (int) round (1000.0 * pow (0.8, level - 1));
if (intv <= 10)
intv = 10;
-
+
timeoutId = g_timeout_add (intv, timeoutHandler, this);
}
@@ -872,11 +872,11 @@
int levelBefore = scoreFrame->getLevel();
int levelAfter = scoreFrame->scoreLines (field->checkFullLines());
- if (levelAfter != levelBefore)
+ if (levelAfter != levelBefore)
games_sound_play ("gnometris");
if ((levelBefore != levelAfter) || fastFall)
generateTimer(levelAfter);
-
+
if (field->isFieldEmpty ())
scoreFrame->scoreLastLineBonus ();
@@ -887,7 +887,7 @@
Tetris::timeoutHandler(void *d)
{
Tetris *t = (Tetris*) d;
-
+
if (t->paused)
return TRUE;
@@ -911,7 +911,7 @@
}
}
- return TRUE;
+ return TRUE;
}
gboolean
@@ -977,7 +977,7 @@
if (t->timeoutId == 0)
return FALSE;
-
+
if (t->paused)
return FALSE;
@@ -1032,7 +1032,7 @@
t->saveBgOptions ();
}
-char *
+char *
Tetris::decodeDropData(gchar * data, gint type)
{
gchar *start, *end;
@@ -1071,7 +1071,7 @@
void
Tetris::dragDrop(GtkWidget *widget, GdkDragContext *context,
- gint x, gint y, GtkSelectionData *data, guint info,
+ gint x, gint y, GtkSelectionData *data, guint info,
guint time, Tetris * t)
{
const char *fileuri;
@@ -1093,7 +1093,7 @@
/* Accept a dropped filename and try and load it as the
background image. In the event of any kind of failure we
silently ignore it. */
-
+
/* FIXME: We don't handle colour gradients (e.g. from the gimp) */
/* FIXME: Dropped URLs from mozilla don't work (see below). */
@@ -1106,7 +1106,7 @@
gtk_drag_finish (context, TRUE, FALSE, time);
if (info == COLOUR) {
- if (data->length == 8)
+ if (data->length == 8)
decodeColour ((guint16 *)data->data, t);
return;
}
@@ -1121,9 +1121,9 @@
if (fileuri == NULL)
goto error_exit;
- /* Now that we have a URI we load it and test it to see if it is
+ /* Now that we have a URI we load it and test it to see if it is
* an image file. */
-
+
file = g_file_new_for_uri (fileuri);
istream = g_file_read (file, NULL, &error);
@@ -1140,7 +1140,7 @@
buffer = (guchar *)g_malloc (filesize);
if (buffer == NULL)
goto error_exit_handle;
-
+
bytesread = g_input_stream_read (G_INPUT_STREAM (istream), buffer, filesize, NULL, &error);
/* FIXME: We should reread if not enough was read. */
@@ -1225,7 +1225,7 @@
g_source_remove(timeoutId);
timeoutId = 0;
blocknr_next = -1;
-
+
endOfGame();
}
}
@@ -1248,7 +1248,7 @@
games_sound_play ("gameover");
inPlay = false;
- if (scoreFrame->getScore() > 0)
+ if (scoreFrame->getScore() > 0)
{
int pos = high_scores->add (scoreFrame->getScore());
high_scores->show (GTK_WINDOW (w), pos);
@@ -1262,7 +1262,7 @@
{
Tetris *t = (Tetris*) d;
- if (t->timeoutId)
+ if (t->timeoutId)
{
g_source_remove(t->timeoutId);
t->timeoutId = 0;
@@ -1278,7 +1278,7 @@
int level = t->cmdlineLevel ? t->cmdlineLevel : t->startingLevel;
t->fastFall = false;
-
+
t->scoreFrame->setLevel(level);
t->scoreFrame->setStartingLevel(level);
@@ -1289,7 +1289,7 @@
t->scoreFrame->resetScore();
t->paused = false;
-
+
t->field->generateFallingBlock();
t->field->redraw();
t->preview->previewBlock(blocknr_next, rot_next, color_next);
@@ -1340,7 +1340,7 @@
"license", license,
"website-label", _("GNOME Games web site"),
"authors", authors,
- "documenters", documenters,
+ "documenters", documenters,
"translator-credits", _("translator-credits"),
"logo-icon-name", "gnome-gnometris",
"website", "http://www.gnome.org/projects/gnome-games/",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]