author | drw <drw> | 2005-05-20 21:23:29 (UTC) |
---|---|---|
committer | drw <drw> | 2005-05-20 21:23:29 (UTC) |
commit | dfdc651b989550e30f2b72f535ce0cd3431fc9f4 (patch) (side-by-side diff) | |
tree | 1f5e64509fe2ef75a14c1909a8f981779b7b5acb /noncore/games/zsame/StoneWidget.cpp | |
parent | 5e7bbe42671f565bef961b44862ddbf68beed774 (diff) | |
download | opie-dfdc651b989550e30f2b72f535ce0cd3431fc9f4.zip opie-dfdc651b989550e30f2b72f535ce0cd3431fc9f4.tar.gz opie-dfdc651b989550e30f2b72f535ce0cd3431fc9f4.tar.bz2 |
Resource -> OResource, remove some unnecessary includes
Diffstat (limited to 'noncore/games/zsame/StoneWidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/zsame/StoneWidget.cpp | 12 |
1 files changed, 3 insertions, 9 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 @@ -1,94 +1,88 @@ /* * ksame 0.4 - simple Game * Copyright (C) 1997,1998 Marcus Kreutzberger * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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; map = new StoneSlice*[maxcolors]; QBitmap mask; for (int c = 0; c < maxcolors; c++) { map[c] = new StoneSlice[maxslices]; for (int s = 0; s < maxslices; s++) { map[c][s].stone.resize(stone_width, stone_height); assert(!map[c][s].stone.isNull()); bitBlt(&map[c][s].stone, 0, 0, &stonemap, stone_width * s, c*stone_height, stone_width,stone_height,CopyROP,false); QImage im = map[c][s].stone.convertToImage(); mask = im.createHeuristicMask(); map[c][s].stone.setMask(mask); } } field_height=stone_height*sizey; field_width=stone_width*sizex; setMouseTracking(true); // QColor c(115,115,115); // setBackgroundColor(c); // emit s_sizechanged(); startTimer( 100 ); history.setAutoDelete(true); } StoneWidget::~StoneWidget() { for (int c = 0; c < maxcolors; c++) { delete [] map[c]; } delete [] map; |