author | drw <drw> | 2005-05-20 20:53:54 (UTC) |
---|---|---|
committer | drw <drw> | 2005-05-20 20:53:54 (UTC) |
commit | a83cdcaac26fafa7bc0e816e19ee6127c0103195 (patch) (unidiff) | |
tree | 58afb6daaf27cf37828b3121bf9be325ad5f3629 | |
parent | 5df741465e0b9ed9e226a103f135e2a6cfa1c8ce (diff) | |
download | opie-a83cdcaac26fafa7bc0e816e19ee6127c0103195.zip opie-a83cdcaac26fafa7bc0e816e19ee6127c0103195.tar.gz opie-a83cdcaac26fafa7bc0e816e19ee6127c0103195.tar.bz2 |
Resource -> OResource
-rw-r--r-- | noncore/games/kbill/MCursor.cc | 12 | ||||
-rw-r--r-- | noncore/games/kbill/Picture.cc | 16 |
2 files changed, 11 insertions, 17 deletions
diff --git a/noncore/games/kbill/MCursor.cc b/noncore/games/kbill/MCursor.cc index 93dd559..ec22d41 100644 --- a/noncore/games/kbill/MCursor.cc +++ b/noncore/games/kbill/MCursor.cc | |||
@@ -1,65 +1,67 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | MCursor.cc - description | 2 | MCursor.cc - description |
3 | ------------------- | 3 | ------------------- |
4 | begin : Thu Dec 30 1999 | 4 | begin : Thu Dec 30 1999 |
5 | copyright : (C) 1999 by Jurrien Loonstra | 5 | copyright : (C) 1999 by Jurrien Loonstra |
6 | email : j.h.loonstra@st.hanze.nl | 6 | email : j.h.loonstra@st.hanze.nl |
7 | ***************************************************************************/ | 7 | ***************************************************************************/ |
8 | 8 | ||
9 | /*************************************************************************** | 9 | /*************************************************************************** |
10 | * * | 10 | * * |
11 | * This program is free software; you can redistribute it and/or modify * | 11 | * This program is free software; you can redistribute it and/or modify * |
12 | * it under the terms of the GNU General Public License as published by * | 12 | * it under the terms of the GNU General Public License as published by * |
13 | * the Free Software Foundation; either version 2 of the License, or * | 13 | * the Free Software Foundation; either version 2 of the License, or * |
14 | * (at your option) any later version. * | 14 | * (at your option) any later version. * |
15 | * * | 15 | * * |
16 | ***************************************************************************/ | 16 | ***************************************************************************/ |
17 | #include "MCursor.h" | 17 | #include "MCursor.h" |
18 | 18 | ||
19 | #ifdef KDEVER | 19 | #ifdef KDEVER |
20 | #include <kapp.h> | 20 | #include <kapp.h> |
21 | #include <kstandarddirs.h> | 21 | #include <kstandarddirs.h> |
22 | #endif | 22 | #endif |
23 | #include <opie2/odebug.h> | 23 | #include <opie2/odebug.h> |
24 | using namespace Opie::Core; | 24 | #include <opie2/oresource.h> |
25 | #include <qpe/resource.h> | 25 | |
26 | #include <qbitmap.h> | ||
27 | |||
26 | MCursor::~MCursor() { | 28 | MCursor::~MCursor() { |
27 | delete cursor; | 29 | delete cursor; |
28 | } | 30 | } |
29 | 31 | ||
30 | void MCursor::load(const char *name, int masked) { | 32 | void MCursor::load(const char *name, int masked) { |
31 | 33 | ||
32 | #ifdef KDEVER | 34 | #ifdef KDEVER |
33 | QString file, mfile; | 35 | QString file, mfile; |
34 | KStandardDirs dirs; | 36 | KStandardDirs dirs; |
35 | 37 | ||
36 | 38 | ||
37 | file = dirs.findResource("data","kbill/bitmaps/" + QString::fromLocal8Bit(name) + ".xbm"); | 39 | file = dirs.findResource("data","kbill/bitmaps/" + QString::fromLocal8Bit(name) + ".xbm"); |
38 | 40 | ||
39 | QBitmap bitmap, mask; | 41 | QBitmap bitmap, mask; |
40 | if (bitmap.load(file) == FALSE) { | 42 | if (bitmap.load(file) == FALSE) { |
41 | oerr << "cannot open " << file << oendl; | 43 | oerr << "cannot open " << file << oendl; |
42 | exit(1); | 44 | exit(1); |
43 | } | 45 | } |
44 | if (masked == SEP_MASK) { | 46 | if (masked == SEP_MASK) { |
45 | // mfile.sprintf ("%sbitmaps/%s_mask.xbm", (const char*)dir, name); | 47 | // mfile.sprintf ("%sbitmaps/%s_mask.xbm", (const char*)dir, name); |
46 | mfile = file = dirs.findResource("data","kbill/bitmaps/" + QString::fromLocal8Bit(name) + "_mask.xbm"); | 48 | mfile = file = dirs.findResource("data","kbill/bitmaps/" + QString::fromLocal8Bit(name) + "_mask.xbm"); |
47 | if (mask.load(mfile) == FALSE) { | 49 | if (mask.load(mfile) == FALSE) { |
48 | oerr << "cannot open " << file << oendl; | 50 | oerr << "cannot open " << file << oendl; |
49 | exit(1); | 51 | exit(1); |
50 | } | 52 | } |
51 | } | 53 | } |
52 | else | 54 | else |
53 | mask = bitmap; | 55 | mask = bitmap; |
54 | #endif | 56 | #endif |
55 | 57 | ||
56 | QBitmap bitmap, mask; | 58 | QBitmap bitmap, mask; |
57 | bitmap = Resource::loadBitmap("kbill/bitmaps/" + QString::fromLocal8Bit(name)); | 59 | bitmap = Opie::Core::OResource::loadPixmap( "kbill/bitmaps/" + QString::fromLocal8Bit( name ) ); |
58 | 60 | ||
59 | if (masked == SEP_MASK) | 61 | if (masked == SEP_MASK) |
60 | mask = bitmap = Resource::loadBitmap("kbill/bitmaps/" + QString::fromLocal8Bit(name) + "_mask.xbm"); | 62 | mask = bitmap = Opie::Core::OResource::loadPixmap( "kbill/bitmaps/" + QString::fromLocal8Bit(name) + "_mask.xbm" ); |
61 | else | 63 | else |
62 | mask = bitmap; | 64 | mask = bitmap; |
63 | cursor = new QCursor(bitmap, mask, bitmap.width() / 2, bitmap.height() / 2); | 65 | cursor = new QCursor(bitmap, mask, bitmap.width() / 2, bitmap.height() / 2); |
64 | } | 66 | } |
65 | 67 | ||
diff --git a/noncore/games/kbill/Picture.cc b/noncore/games/kbill/Picture.cc index cf96ddf..9659667 100644 --- a/noncore/games/kbill/Picture.cc +++ b/noncore/games/kbill/Picture.cc | |||
@@ -1,70 +1,62 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | Picture.cc - description | 2 | Picture.cc - description |
3 | ------------------- | 3 | ------------------- |
4 | begin : Thu Dec 30 1999 | 4 | begin : Thu Dec 30 1999 |
5 | copyright : (C) 1999 by Jurrien Loonstra | 5 | copyright : (C) 1999 by Jurrien Loonstra |
6 | email : j.h.loonstra@st.hanze.nl | 6 | email : j.h.loonstra@st.hanze.nl |
7 | ***************************************************************************/ | 7 | ***************************************************************************/ |
8 | 8 | ||
9 | /*************************************************************************** | 9 | /*************************************************************************** |
10 | * * | 10 | * * |
11 | * This program is free software; you can redistribute it and/or modify * | 11 | * This program is free software; you can redistribute it and/or modify * |
12 | * it under the terms of the GNU General Public License as published by * | 12 | * it under the terms of the GNU General Public License as published by * |
13 | * the Free Software Foundation; either version 2 of the License, or * | 13 | * the Free Software Foundation; either version 2 of the License, or * |
14 | * (at your option) any later version. * | 14 | * (at your option) any later version. * |
15 | * * | 15 | * * |
16 | ***************************************************************************/ | 16 | ***************************************************************************/ |
17 | #include "Picture.h" | 17 | #include "Picture.h" |
18 | 18 | ||
19 | #include <opie2/odebug.h> | 19 | #include <opie2/odebug.h> |
20 | using namespace Opie::Core; | 20 | #include <opie2/oresource.h> |
21 | #include <qpe/resource.h> | ||
22 | #ifdef KDEVER | 21 | #ifdef KDEVER |
23 | #include <kapp.h> | 22 | #include <kapp.h> |
24 | #include <kstandarddirs.h> | 23 | #include <kstandarddirs.h> |
25 | #include <kdebug.h> | 24 | #include <kdebug.h> |
26 | #endif | 25 | #endif |
27 | void Picture::load(const char *name, int index) { | 26 | void Picture::load(const char *name, int index) { |
28 | //QString dir = KApplication::kde_datadir(), file; | ||
29 | // QString dir = locate("data",""),file; | ||
30 | // dir += "/kbill/"; | ||
31 | // if (index>=0) | ||
32 | // file.sprintf ("%spixmaps/%s_%d.xpm", (const char *)dir, name, index); | ||
33 | // else | ||
34 | // file.sprintf("%spixmaps/%s.xpm", (const char *)dir, name); | ||
35 | #ifdef KDEVER | 27 | #ifdef KDEVER |
36 | KStandardDirs dirs; | 28 | KStandardDirs dirs; |
37 | QString file; | 29 | QString file; |
38 | 30 | ||
39 | if (index>=0) { | 31 | if (index>=0) { |
40 | //kdDebug() << "Here"; | 32 | //kdDebug() << "Here"; |
41 | QString sindex; | 33 | QString sindex; |
42 | sindex.setNum(index); | 34 | sindex.setNum(index); |
43 | // kdDebug() << "kbill/pixmaps/" + QString::fromLocal8Bit(name) + "_" + sindex + ".xpm"; | 35 | // kdDebug() << "kbill/pixmaps/" + QString::fromLocal8Bit(name) + "_" + sindex + ".xpm"; |
44 | file = dirs.findResource("data","kbill/pixmaps/" + QString::fromLocal8Bit(name) + "_" + sindex + ".xpm"); | 36 | file = dirs.findResource("data","kbill/pixmaps/" + QString::fromLocal8Bit(name) + "_" + sindex + ".xpm"); |
45 | } else { | 37 | } else { |
46 | file = dirs.findResource("data","kbill/pixmaps/" + QString::fromLocal8Bit(name) + ".xpm"); | 38 | file = dirs.findResource("data","kbill/pixmaps/" + QString::fromLocal8Bit(name) + ".xpm"); |
47 | } | 39 | } |
48 | kdDebug() << file << std::endl; | 40 | kdDebug() << file << std::endl; |
49 | pix = new QPixmap(); | 41 | pix = new QPixmap(); |
50 | if (pix->load(file) == FALSE) | 42 | if (pix->load(file) == FALSE) |
51 | oerr << "cannot open " << file << oendl; | 43 | oerr << "cannot open " << file << oendl; |
52 | width = pix->width(); | 44 | width = pix->width(); |
53 | height = pix->height(); | 45 | height = pix->height(); |
54 | #endif | 46 | #endif |
55 | QString sindex; | 47 | QString sindex; |
56 | pix = new QPixmap(); | 48 | //pix = new QPixmap(); |
57 | sindex.setNum(index); | 49 | sindex.setNum(index); |
58 | if (index>=0) | 50 | if (index>=0) |
59 | pix->load(Resource::findPixmap("kbill/pixmaps/" + QString::fromLocal8Bit(name) +"_"+ sindex)); | 51 | pix = new QPixmap( Opie::Core::OResource::loadPixmap( "kbill/pixmaps/" + QString::fromLocal8Bit(name) +"_"+ sindex ) ); |
60 | else | 52 | else |
61 | pix->load(Resource::findPixmap("kbill/pixmaps/" + QString::fromLocal8Bit(name))); | 53 | pix = new QPixmap( Opie::Core::OResource::loadPixmap( "kbill/pixmaps/" + QString::fromLocal8Bit(name) ) ); |
62 | 54 | ||
63 | width = pix->width(); | 55 | width = pix->width(); |
64 | height = pix->height(); | 56 | height = pix->height(); |
65 | 57 | ||
66 | } | 58 | } |
67 | 59 | ||
68 | QPixmap* Picture::getPixmap() { | 60 | QPixmap* Picture::getPixmap() { |
69 | return pix; | 61 | return pix; |
70 | } | 62 | } |