After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 83532 - configureable size for playfield, number of colors, number of added balls
configureable size for playfield, number of colors, number of added balls
Status: RESOLVED FIXED
Product: gnome-games-superseded
Classification: Deprecated
Component: glines
2.0.x
Other Linux
: Normal enhancement
: ---
Assigned To: GNOME Games maintainers
Gregory Leblanc
Depends on:
Blocks:
 
 
Reported: 2002-05-30 13:34 UTC by Noèl Köthe
Modified: 2005-03-23 18:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Remove some hardcoded constants allowing rectangular fields. (13.84 KB, patch)
2004-12-10 08:45 UTC, Marco Colombo
committed Details | Review
B/W keyboard cursor coloring, protection against corrupt image files. (3.11 KB, patch)
2004-12-10 16:14 UTC, Richard Hoelscher
committed Details | Review
Screenshot of glines showing garble (49.75 KB, image/png)
2004-12-10 23:31 UTC, Marco Colombo
  Details
Remove some more hardcoded constants (3.31 KB, patch)
2004-12-19 12:07 UTC, Marco Colombo
committed Details | Review
Different sizes (field, colours, pieces added) (22.25 KB, patch)
2005-03-18 11:45 UTC, Marco Colombo
none Details | Review
Marco's patch against CVS HEAD (23.98 KB, patch)
2005-03-18 17:14 UTC, Richard Hoelscher
none Details | Review
Patch v2 (also scores dialog) (24.49 KB, patch)
2005-03-23 01:15 UTC, Marco Colombo
none Details | Review
Updated to HEAD (24.45 KB, patch)
2005-03-23 11:18 UTC, Marco Colombo
none Details | Review
Fixes a missing comma. (24.45 KB, patch)
2005-03-23 11:27 UTC, Marco Colombo
none Details | Review

Description Noèl Köthe 2002-05-30 13:34:35 UTC
http://bugs.debian.org/107392

"My sister likes playing a similar game under windows, which has a smaller
playfield, and just 2 balls are added each turn; maybe it also has a different
number of colors.

So it would be great if you could configure the size of the playfield, the
number of differen colors, and the number of balls added each turn.

Thanks a lot for your work."

thx
Comment 1 Samuel Stringham 2002-11-02 16:52:09 UTC
confirming request, when/if I get time:)
Comment 2 Callum McKenzie 2003-06-12 03:07:25 UTC
This is probably going to be done for 2.5. The drawing code was
recently revised and allowance was made for implementing this. However
it's too late for it to be done in time for 2.4.
Comment 3 Marco Colombo 2004-12-10 08:45:10 UTC
Created attachment 34685 [details] [review]
Remove some hardcoded constants allowing rectangular fields.

I have tested this patch in the last few days, and it works fine with
rectangular fields. 

I had to add the following change because there where some painting problems
when HFIELDSIZE>VFIELDSIZE. For example, if HF=15 and VF=9 some vertical lines
of squares would not be painted correctly when boxsize would be 38, 39, 41 or
some other dimensions.
Well, with this the problem does not occur anymore... (why?)

@@ -1690,8 +1691,8 @@ main (int argc, char *argv [])
			  G_CALLBACK (configure_event_callback), NULL);
	g_signal_connect (G_OBJECT (draw_area), "expose_event",
			  G_CALLBACK (field_expose_event), NULL);
-	gridframe = games_grid_frame_new (FIELDSIZE, FIELDSIZE);
-	games_grid_frame_set_padding (GAMES_GRID_FRAME(gridframe), 1, 1);
+	gridframe = games_grid_frame_new (HFIELDSIZE, VFIELDSIZE);
+	games_grid_frame_set_padding (GAMES_GRID_FRAME(gridframe), 1, 0);
	gtk_container_add (GTK_CONTAINER (gridframe), draw_area);
	gtk_table_attach_defaults (GTK_TABLE (table), gridframe, 0, 1, 1, 10);
Comment 4 Richard Hoelscher 2004-12-10 16:14:23 UTC
Created attachment 34704 [details] [review]
B/W keyboard cursor coloring, protection against corrupt image files.

(The patch above shouldn't conflict with Marco's, stuffing it here since I'm
typing anyway... Ultimately, of course, both don't fix Bug #83532.)

Marco:
I'm not seeing the behavior you describe, and it's definitely the wrong thing
to do... the bottom of the grid draws over the bottom part of the keyboard
cursor (when it's at the bottom) because the padding is lost. Screenshots may
help.
Comment 5 Marco Colombo 2004-12-10 23:31:53 UTC
Created attachment 34718 [details]
Screenshot of glines showing garble

That's the problem I was mentioning above. It happens only at particular sizes.
Comment 6 Callum McKenzie 2004-12-13 00:11:16 UTC
Just a quick note that I will be applying the patch tonight (didn't do anything
on gnome-games over the weekend because I needed to get my new laptop working
for work, I hate kernel bugs).
Comment 7 Callum McKenzie 2004-12-13 08:47:42 UTC
Both patches have now been applied, with the extra change from Marco's one
backed out.

I wasn't able to reproduce the corruption bug either. It looks like a rounding
error creeping in. I have fixed an obviously bad bit of arithmetic in the
drawing code which looked likely to cause problems. Marco, could you test the
latest CVS (once it updates in an hour or so) and tell me if it is fixed? If not
could you tell me exactly what processor you are using.

 
Comment 8 Marco Colombo 2004-12-19 12:07:10 UTC
Created attachment 34999 [details] [review]
Remove some more hardcoded constants

This patch uses NPIECES to define how many new pieces are added after any move.


It also uses in a couple of places the already existing NCOLORS, so that it's
possible to define how many colors are used in the game (up to 7).
Comment 9 Callum McKenzie 2004-12-20 06:16:53 UTC
Patch applied in CVS. Thanks a lot.
Comment 10 Marco Colombo 2005-03-18 11:45:58 UTC
Created attachment 38895 [details] [review]
Different sizes (field, colours, pieces added)

Ok, it's an working patch to fix part of this enhancement request.

What the patch does:
- Gives the user the choice between 3 different game sizes
- Each game size has its own field size (can be rectangular), number of
colours, and number of pieces added after each move

What it doesn't do:
- The preview is still limited to 3 pieces, while it should show all pieces
that will be added
- The scoretable doesn't take into account the game size
Comment 11 Richard Hoelscher 2005-03-18 17:14:50 UTC
Created attachment 38909 [details] [review]
Marco's patch against CVS HEAD

Marco: I made a few changes in CVS concerning image warnings and UI API prior
to your patch, and this update to your patch reflects it... only one chunk was
affected, which is a good sign.
---
The big level with 7 balls is a nice challenge, and definitely has the
"managing complexity" feel to it the longer you go. Since glines, same-gnome,
and gnomine uses "Small", "Medium", "Large" without an explicit reference to
difficulty, I don't see any problems there. 

Personally, I don't see a need for the command line option. I'll look at the
missing features this weekend.
Comment 12 Marco Colombo 2005-03-23 01:15:52 UTC
Created attachment 39106 [details] [review]
Patch v2 (also scores dialog)

This adds the scores dialog. For the rest, there is no other change (a part
from one obsolete comment removed).
Comment 13 Callum McKenzie 2005-03-23 10:26:56 UTC
We have several patches bearing on the same piece of code right now. Richard and
I discussed it this afternoon and there shouldn't be any real problems. I about
to apply some other HIG improvement patches. After that we can apply this patch.
Am I correct in thinking that patch 39106 is just 38909 with the scoring stuff
and the comment removed? (It is hard reading diffs of diffs.) If so, Richard do
you feel like applying it since you have most of it under control already? If my
assumption is wrong, then Richard, if you apply what you have in your
repository, I will fix up the scoring stuff from Marcos patch by hand.

I should also say that I think the scoring code is fine. There are a few things
that can go wrong, but they are easy enough to fix once we have synchronised the
code.
 
Comment 14 Marco Colombo 2005-03-23 10:42:34 UTC
Yes, attachment 39106 [details] [review] is the same as 38909 plus scores and comment.
Comment 15 Marco Colombo 2005-03-23 11:18:48 UTC
Created attachment 39127 [details] [review]
Updated to HEAD

This takes into account the HIG changes landed in CVS and adds mnemonics to the
size radiobuttons.
Comment 16 Marco Colombo 2005-03-23 11:27:30 UTC
Created attachment 39130 [details] [review]
Fixes a missing comma.
Comment 17 Richard Hoelscher 2005-03-23 18:19:36 UTC
Thanks... The patches have now been applied to CVS. Aside from the features 
already mentioned, games-grid-frame now supports alignment, glines now shows 
preview for more than 3 balls, and glines Makefile.am now supports 3 high score 
files.