Index: head/games/gtkpool/Makefile =================================================================== --- head/games/gtkpool/Makefile (revision 477557) +++ head/games/gtkpool/Makefile (revision 477558) @@ -1,30 +1,33 @@ # Created by: Alexey Dokuchaev # $FreeBSD$ PORTNAME= gtkpool PORTVERSION= 0.5.0 -PORTREVISION= 11 +PORTREVISION= 12 CATEGORIES= games MASTER_SITES= ftp://ftp.seul.org/pub/gtkpool/ \ http://www.sourcefiles.org/Games/Sports/Pool/ MAINTAINER= ports@FreeBSD.org COMMENT= 2D pool game using the GTK+ toolkit -USES= autoreconf gmake perl5 pkgconfig +LICENSE= GPLv2+ +LICENSE_FILE= ${WRKSRC}/COPYING + +USES= autoreconf compiler:c++11-lang gmake perl5 pkgconfig +USE_CXXSTD= c++11 USE_GNOME= gtk20 USE_PERL5= build GNU_CONFIGURE= yes -USE_GCC= any PLIST_FILES= bin/gtkpool \ share/icons/gtkpool.png PORTDATA= * post-patch: .for file in application.cpp options.cpp @${REINPLACE_CMD} -e 's|/usr/local/share/gtkpool|${DATADIR}|' \ ${WRKSRC}/gtkpool/${file} .endfor .include Index: head/games/gtkpool/files/patch-gtkpool_application.cpp =================================================================== --- head/games/gtkpool/files/patch-gtkpool_application.cpp (revision 477557) +++ head/games/gtkpool/files/patch-gtkpool_application.cpp (revision 477558) @@ -1,50 +1,59 @@ ---- gtkpool/application.cpp.orig 2002-08-06 13:02:45.000000000 +0900 -+++ gtkpool/application.cpp 2011-08-19 04:36:56.000000000 +0900 -@@ -67,11 +67,11 @@ +--- gtkpool/application.cpp.orig 2002-08-06 04:02:45 UTC ++++ gtkpool/application.cpp +@@ -67,11 +67,11 @@ Application::Application(){ message_colours[14] = new GdkColor; buf_pixmap = NULL; - table_pixmaps = new (GdkPixmap *)[4]; - balls_pixmaps = new (GdkPixmap *)[NUM_BALLS]; - balls_pixmap_masks = new (GdkBitmap *)[NUM_BALLS]; - balls_big_pixmaps = new (GdkPixmap *)[NUM_BALLS]; - balls_big_pixmap_masks = new (GdkBitmap *)[NUM_BALLS]; + table_pixmaps = new GdkPixmap *[4]; + balls_pixmaps = new GdkPixmap *[NUM_BALLS]; + balls_pixmap_masks = new GdkBitmap *[NUM_BALLS]; + balls_big_pixmaps = new GdkPixmap *[NUM_BALLS]; + balls_big_pixmap_masks = new GdkBitmap *[NUM_BALLS]; running = true; placing_cue = false; sunk_tf = collide_tf = bounce_tf = false; connected = false; -@@ -530,7 +530,7 @@ +@@ -234,7 +234,7 @@ reiterated until there are no more collisions left in + } + + update_rack(); +- balls.erase(std::vector::iterator(bnc)); // get rid of it ++ balls.erase(std::remove_if(balls.begin(), balls.end(), [bnc](Ball const &b) { return &b == bnc; }), balls.end()); // get rid of it + sunk_tf = true; + } + else // otherwise bounce it off the bumper +@@ -530,7 +530,7 @@ void Application::mouse_down (double x, double y) { bb = find_if(balls.begin(), balls.end(), pointer_selects( x, y, hit_moving)); if(bb != balls.end()) { -#if _CPP_CSTDLIB == 1 +#if 1 // _CPP_CSTDLIB == 1 // FIXME: horrible, non-portable, converting a vector iterator // to a pointer using g++ 3.0 private interface :-( // -- Philip Martin -@@ -815,12 +815,18 @@ +@@ -815,12 +815,18 @@ void Application::init_sound() load_sounds(); } -void Application::print_message(const char *message, int colour = 0) +void Application::print_message(const char *message, int colour) { + GtkTextBuffer *chat_textbuf; + GtkTextIter chat_textiter; + if (colour > 4) colour = 14; if (colour < 0) colour = 14; - gtk_text_insert(GTK_TEXT(chat_text), NULL, message_colours[colour], NULL, "\n", -1); - gtk_text_insert(GTK_TEXT(chat_text), NULL, message_colours[colour], NULL, message, -1); + + chat_textbuf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(chat_text)); + gtk_text_buffer_get_iter_at_offset(chat_textbuf, &chat_textiter, 0); + gtk_text_buffer_insert(chat_textbuf, &chat_textiter, "\n", -1); + gtk_text_buffer_insert(chat_textbuf, &chat_textiter, message, -1); }