-rw-r--r-- | noncore/games/zsame/StoneWidget.cpp | 12 | ||||
-rw-r--r-- | noncore/games/zsame/ZSameWidget.cpp | 13 |
2 files changed, 8 insertions, 17 deletions
diff --git a/noncore/games/zsame/StoneWidget.cpp b/noncore/games/zsame/StoneWidget.cpp index 5dd0252..f370714 100644 --- a/noncore/games/zsame/StoneWidget.cpp +++ b/noncore/games/zsame/StoneWidget.cpp @@ -9,50 +9,44 @@ * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * */ -#include <stdio.h> -#include <stdlib.h> +#include <opie2/oresource.h> - - -#include <qpe/resource.h> +#include <qbitmap.h> #include <time.h> #include <assert.h> #include "StoneWidget.h" struct StoneSlice { QPixmap stone; }; StoneWidget::StoneWidget( QWidget *parent, int x, int y ) : QWidget(parent,"StoneWidget"), stonefield(x,y) { -// setBackgroundPixmap(QPixmap(locate("wallpaper", "Time-For-Lunch-2.jpg"))); -// QPixmap stonemap(locate("appdata", "stones.png")); - - QPixmap stonemap = Resource::loadPixmap("zsame/stones" ); + QPixmap stonemap = Opie::Core::OResource::loadPixmap( "zsame/stones" ); assert(!stonemap.isNull()); slice=0; maxslices=30; maxcolors=4; sizex=x; sizey=y; stone_width=stonemap.width()/(maxslices+1); stone_height=stonemap.height()/maxcolors; diff --git a/noncore/games/zsame/ZSameWidget.cpp b/noncore/games/zsame/ZSameWidget.cpp index dee4a1c..7bcbee1 100644 --- a/noncore/games/zsame/ZSameWidget.cpp +++ b/noncore/games/zsame/ZSameWidget.cpp @@ -10,29 +10,26 @@ * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * */ -#include <stdio.h> - #include <opie2/oapplicationfactory.h> - -#include <qpe/resource.h> +#include <opie2/oresource.h> #include <qtoolbar.h> #include <qmenubar.h> #include <qapplication.h> #include <qaction.h> #include <qmessagebox.h> #include <kapplication.h> #include "ZSameWidget.h" static int default_colors=3; @@ -49,43 +46,43 @@ ZSameWidget::ZSameWidget( QWidget* parent, const char* name, WFlags fl ) : QMainWindow( parent, name, fl ) { setCaption(tr("ZSame")); setToolBarsMovable( false ); QToolBar* con = new QToolBar( this ); con->setHorizontalStretchable( true ); QMenuBar* mb = new QMenuBar( con ); QToolBar* tb = new QToolBar( this ); QPopupMenu* fileMenu = new QPopupMenu( this ); - QAction* a = new QAction(tr("New Game"), Resource::loadIconSet("new") , + QAction* a = new QAction(tr("New Game"), Opie::Core::OResource::loadPixmap( "new", Opie::Core::OResource::SmallIcon ), QString::null, 0, this, "new_icon"); a->addTo( fileMenu ); a->addTo( tb ); connect(a, SIGNAL(activated()), this, SLOT(m_new())); - a = new QAction(tr("Restart This Board"), Resource::loadIconSet("redo"), + a = new QAction(tr("Restart This Board"), Opie::Core::OResource::loadPixmap( "redo", Opie::Core::OResource::SmallIcon ), QString::null, 0, this, "restart_board" ); a->addTo( fileMenu ); connect( a, SIGNAL(activated()), this, SLOT(m_restart())); restart = a; - a = new QAction( tr("Undo"), Resource::loadIconSet("undo"), + a = new QAction( tr("Undo"), Opie::Core::OResource::loadPixmap( "undo", Opie::Core::OResource::SmallIcon ), QString::null, 0, this, "undo_action" ); a->addTo( fileMenu ); a->addTo( tb ); connect( a, SIGNAL(activated()), this, SLOT(m_undo())); - a = new QAction(tr("Quit"), Resource::loadIconSet("quit_icon"), + a = new QAction(tr("Quit"), Opie::Core::OResource::loadPixmap( "quit_icon", Opie::Core::OResource::SmallIcon ), QString::null, 0, this, "quit_action"); a->addTo( fileMenu ); a->addTo( tb ); connect(a, SIGNAL(activated()), this, SLOT(m_quit())); mb->insertItem(tr("Game" ), fileMenu ); int foo[2]; desktop_widget(foo); stone = new StoneWidget(this,foo[0],foo[1]); connect( stone, SIGNAL(s_gameover()), this, SLOT(gameover())); |