⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 spritecollection.h

📁 Source code (C++) of the Icebloxx game for Symbian OS UIQ3.x
💻 H
字号:
/*
 * Copyright (C) 2002 Robert Ernst <robert.ernst@linux-solutions.at>
 *
 * This file may be distributed and/or modified under the terms of the
 * GNU General Public License version 2 as published by the Free Software
 * Foundation and appearing in the file LICENSE.GPL included in the
 * packaging of this file.
 *
 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 *
 * See COPYING for GPL licensing information.
 *
 */

#ifndef __SPRITECOLLECTION_HEADER__
#define __SPRITECOLLECTION_HEADER__
class QWidget;
#include <fbs.h>
#include <w32std.h>
class CEikonEnv;
class CIceBloxxView;
#ifdef UIQ3
const TInt KDividor = 1;
const TInt KMajorPart = 1;
const TInt KBlockWidth = 30;
#else
const TInt KDividor = 15;
const TInt KMajorPart = 13;
const TInt KBlockWidth = 26;
#endif
class QPixmap:public CWsBitmap
{
public:
	QPixmap(RWsSession &aWs);
	TInt height(){return SizeInPixels().iHeight;};
	TInt width(){return SizeInPixels().iWidth;};
};
//#include <qwidget.h>
//#include <qpixmap.h>
//#include <qpainter.h>
#include <e32base.h>

class QColor
{
public:
	QColor(TInt r,TInt g,TInt b);
	TRgb Color();
private:
	TInt iR;
	TInt iG;
	TInt iB;
};
enum 
{
	AlignLeft=1,
	AlignHCenter=2,
	AlignBottom = 4,
	AlignVCenter=8,
	AlignRight = 16

};
class QPainter:public CBase
{
public:
	QPainter(CBitmapContext* aGc);
	~QPainter();
	void drawPixmap(TInt aX,TInt aY,QPixmap* aBitmap);
	void drawPixmapMask(TInt aX,TInt aY,QPixmap* aBitmap,QPixmap* aMask);

	void fillRect(TInt aX,TInt aY,TInt aWidth,TInt aHeight,QColor aColor);
	void drawText(TInt aX,TInt aY,TInt aWidth,TInt aHeight,TInt aAlign,const char* aString);
	void drawLine(TInt aX,TInt aY,TInt aX2,TInt aY2);
	void setPen(QColor aColor);
	CBitmapContext* iGc;
	CEikonEnv* iEikEnv;
	CIceBloxxView* iView;
};

class SpriteCollection:public CBase
{
public:
    SpriteCollection();
	~SpriteCollection();
private:
    QPixmap* m_block[8];
    QPixmap* m_block_coin[8];
    QPixmap* m_coin[2];
    QPixmap* m_dead[8];
    QPixmap* m_flame[5][2];
    QPixmap* m_happy_penguin;
    QPixmap* m_intro;
    QPixmap* m_live;
    QPixmap* m_penguin;
    QPixmap* m_penguin_up[3];
    QPixmap* m_penguin_down[3];
    QPixmap* m_penguin_left[3];
    QPixmap* m_penguin_right[3];
    QPixmap* m_points[2][2];
    QPixmap* m_wall;
 //   QWidget *m_parent;

public:
    void drawBlock(QPainter &painter, int x, int y, int state);
    void drawBlockCoin(QPainter &painter, int x, int y, int state);
    void drawCoin(QPainter &painter, int x, int y);
    void drawDead(QPainter &painter, int x, int y, int state);
    void drawFlame(QPainter &painter, int x, int y, int state);
    void drawHappyPenguin(QPainter &painter, int x, int y, int state);
    void drawIntro(QPainter &painter, int x, int y);
    void drawLive(QPainter &painter, int x, int y);
    void drawPenguin(QPainter &painter, int x, int y);
    void drawPenguinUp(QPainter &painter, int x, int y, int state);
    void drawPenguinDown(QPainter &painter, int x, int y, int state);
    void drawPenguinLeft(QPainter &painter, int x, int y, int state);
    void drawPenguinRight(QPainter &painter, int x, int y, int state);
    void drawPoints(QPainter &painter, int x, int y, int state);
    void drawWall(QPainter &painter, int x, int y);
};

#endif // __SPRITECOLLECTION_HEADER__

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -