Commits

ascetic85 committed 0630c0b

modify: member variables begin with m_

Comments (0)

Files changed (27)

     Srcs/GEAudioMixer.cpp \
     Srcs/GEAudioBufferPlayInstance.cpp \
     Srcs/GEAudioBuffer.cpp \
-    Srcs/fileutils.cpp
+    Srcs/fileutils.cpp \
+    Srcs/view.cpp
 HEADERS += \
     Srcs/transitionscene.h \
     Srcs/textitem.h \
     Srcs/sequence.h \
     Srcs/scene.h \
     Srcs/node.h \
-    Srcs/myfastergraphicview.h \
     Srcs/menuitemlabel.h \
     Srcs/menuitemimage.h \
     Srcs/menuitem.h \
     Srcs/GEAudioMixer.h \
     Srcs/GEAudioBufferPlayInstance.h \
     Srcs/GEAudioBuffer.h \
-    Srcs/fileutils.h
+    Srcs/fileutils.h \
+    Srcs/view.h
 FORMS +=
 
 # Please do not modify the following two lines. Required for deployment.
 
 Action* Action::FuncCall(QObject* targeted,const char *slot) {
     Action *newAction = new Action;
-    newAction->slotCall = slot;
-    newAction->actionTypeV = actionTypeFuncCall;
-    newAction->target = targeted;
+    newAction->m_slotCall = slot;
+    newAction->m_actionTypeV = actionTypeFuncCall;
+    newAction->m_target = targeted;
     return newAction;
 }
 
 Action* Action::moveTo(float duration,qreal x,qreal y) {
     Action *newAction = new Action;
-    newAction->actionTypeV = actionTypeMoveTo;
-    newAction->endValue[0] = x;
-    newAction->endValue[1] = y;
-    newAction->animation.setDuration(1000*duration);
-    newAction->animation.setPropertyName("pos");
+    newAction->m_actionTypeV = actionTypeMoveTo;
+    newAction->m_endValue[0] = x;
+    newAction->m_endValue[1] = y;
+    newAction->m_animation.setDuration(1000*duration);
+    newAction->m_animation.setPropertyName("pos");
     return newAction;
 }
 
 Action* Action::moveBy(float duration,qreal x,qreal y) {
     Action *newAction = new Action;
-    newAction->actionTypeV = actionTypeMoveBy;
-    newAction->endValue[0] = x;
-    newAction->endValue[1] = y;
-    newAction->animation.setDuration(1000*duration);
-    newAction->animation.setPropertyName("pos");
+    newAction->m_actionTypeV = actionTypeMoveBy;
+    newAction->m_endValue[0] = x;
+    newAction->m_endValue[1] = y;
+    newAction->m_animation.setDuration(1000*duration);
+    newAction->m_animation.setPropertyName("pos");
     return newAction;
 
 }
 
 Action* Action::scaleTo(float duration,qreal scale) {
     Action *newAction = new Action;
-    newAction->actionTypeV = actionTypeScaleTo;
-    newAction->endValue[0] = scale;
-    newAction->animation.setDuration(1000*duration);
-    newAction->animation.setPropertyName("scale");
+    newAction->m_actionTypeV = actionTypeScaleTo;
+    newAction->m_endValue[0] = scale;
+    newAction->m_animation.setDuration(1000*duration);
+    newAction->m_animation.setPropertyName("scale");
     return newAction;
 
 }
 
 Action* Action::scaleBy(float duration,qreal scale) {
     Action *newAction = new Action;
-    newAction->actionTypeV = actionTypeScaleBy;
-    newAction->endValue[0] = scale;
-    newAction->animation.setDuration(1000*duration);
-    newAction->animation.setPropertyName("scale");
+    newAction->m_actionTypeV = actionTypeScaleBy;
+    newAction->m_endValue[0] = scale;
+    newAction->m_animation.setDuration(1000*duration);
+    newAction->m_animation.setPropertyName("scale");
     return newAction;
 
 }
 
 Action* Action::fadeTo(float duration,qreal value) {
     Action *newAction = new Action;
-    newAction->actionTypeV = actionTypeFadeTo;
-    newAction->endValue[0] = value;
-    newAction->animation.setDuration(1000*duration);
-    newAction->animation.setPropertyName("opacity");
+    newAction->m_actionTypeV = actionTypeFadeTo;
+    newAction->m_endValue[0] = value;
+    newAction->m_animation.setDuration(1000*duration);
+    newAction->m_animation.setPropertyName("opacity");
     return newAction;
 
 }
 
 Action* Action::fadeBy(float duration,qreal value) {
     Action *newAction = new Action;
-    newAction->actionTypeV = actionTypeFadeBy;
-    newAction->endValue[0] = value;
-    newAction->animation.setDuration(1000*duration);
-    newAction->animation.setPropertyName("opacity");
+    newAction->m_actionTypeV = actionTypeFadeBy;
+    newAction->m_endValue[0] = value;
+    newAction->m_animation.setDuration(1000*duration);
+    newAction->m_animation.setPropertyName("opacity");
     return newAction;
 
 }
 
 Action* Action::rotateTo(float duration,qreal angle) {
     Action *newAction = new Action;
-    newAction->actionTypeV = actionTypeRotateTo;
-    newAction->endValue[0] = angle;
-    newAction->animation.setDuration(1000*duration);
-    newAction->animation.setPropertyName("rotate");
+    newAction->m_actionTypeV = actionTypeRotateTo;
+    newAction->m_endValue[0] = angle;
+    newAction->m_animation.setDuration(1000*duration);
+    newAction->m_animation.setPropertyName("rotate");
     return newAction;
 
 }
 
 Action* Action::rotateBy(float duration,qreal angle) {
     Action *newAction = new Action;
-    newAction->actionTypeV = actionTypeRotateBy;
-    newAction->endValue[0] = angle;
-    newAction->animation.setDuration(1000*duration);
-    newAction->animation.setPropertyName("rotate");
+    newAction->m_actionTypeV = actionTypeRotateBy;
+    newAction->m_endValue[0] = angle;
+    newAction->m_animation.setDuration(1000*duration);
+    newAction->m_animation.setPropertyName("rotate");
     return newAction;
 
 }
         qDebug() << "GameEngine :: easing rate should have a range between 0 and 5, range has been set to 5 for you this time";
     }
     if (rate == 0)
-        withAction->animation.setEasingCurve(QEasingCurve::Linear);
+        withAction->m_animation.setEasingCurve(QEasingCurve::Linear);
     if (rate == 1)
-        withAction->animation.setEasingCurve(QEasingCurve::InQuad);
+        withAction->m_animation.setEasingCurve(QEasingCurve::InQuad);
     if (rate == 2)
-        withAction->animation.setEasingCurve(QEasingCurve::InCubic);
+        withAction->m_animation.setEasingCurve(QEasingCurve::InCubic);
     if (rate == 3)
-        withAction->animation.setEasingCurve(QEasingCurve::InQuart);
+        withAction->m_animation.setEasingCurve(QEasingCurve::InQuart);
     if (rate == 4)
-        withAction->animation.setEasingCurve(QEasingCurve::InCirc);
+        withAction->m_animation.setEasingCurve(QEasingCurve::InCirc);
     if (rate == 5)
-        withAction->animation.setEasingCurve(QEasingCurve::InBack);
+        withAction->m_animation.setEasingCurve(QEasingCurve::InBack);
 
     return withAction;
 }
         qDebug() << "GameEngine :: easing rate should have a range between 0 and 5, range has been set to 5 for you this time";
     }
     if (rate == 0)
-        withAction->animation.setEasingCurve(QEasingCurve::Linear);
+        withAction->m_animation.setEasingCurve(QEasingCurve::Linear);
     if (rate == 1)
-        withAction->animation.setEasingCurve(QEasingCurve::OutQuad);
+        withAction->m_animation.setEasingCurve(QEasingCurve::OutQuad);
     if (rate == 2)
-        withAction->animation.setEasingCurve(QEasingCurve::OutCubic);
+        withAction->m_animation.setEasingCurve(QEasingCurve::OutCubic);
     if (rate == 3)
-        withAction->animation.setEasingCurve(QEasingCurve::OutQuart);
+        withAction->m_animation.setEasingCurve(QEasingCurve::OutQuart);
     if (rate == 4)
-        withAction->animation.setEasingCurve(QEasingCurve::OutCirc);
+        withAction->m_animation.setEasingCurve(QEasingCurve::OutCirc);
     if (rate == 5)
-        withAction->animation.setEasingCurve(QEasingCurve::OutBack);
+        withAction->m_animation.setEasingCurve(QEasingCurve::OutBack);
     return withAction;
 }
 
         qDebug() << "GameEngine :: easing rate should have a range between 0 and 5, range has been set to 5 for you this time";
     }
     if (rate == 0)
-        withAction->animation.setEasingCurve(QEasingCurve::Linear);
+        withAction->m_animation.setEasingCurve(QEasingCurve::Linear);
     if (rate == 1)
-        withAction->animation.setEasingCurve(QEasingCurve::InOutQuad);
+        withAction->m_animation.setEasingCurve(QEasingCurve::InOutQuad);
     if (rate == 2)
-        withAction->animation.setEasingCurve(QEasingCurve::InOutCubic);
+        withAction->m_animation.setEasingCurve(QEasingCurve::InOutCubic);
     if (rate == 3)
-        withAction->animation.setEasingCurve(QEasingCurve::InOutQuart);
+        withAction->m_animation.setEasingCurve(QEasingCurve::InOutQuart);
     if (rate == 4)
-        withAction->animation.setEasingCurve(QEasingCurve::InOutCirc);
+        withAction->m_animation.setEasingCurve(QEasingCurve::InOutCirc);
     if (rate == 5)
-        withAction->animation.setEasingCurve(QEasingCurve::InOutBack);
+        withAction->m_animation.setEasingCurve(QEasingCurve::InOutBack);
     return withAction;
 }
 
 
 void Action::setTarget(Node *targeted) {
-    if (actionTypeV == actionTypeFuncCall) {
-        connect(this,SIGNAL(animationFinished(Action*)),target,slotCall);
+    if (m_actionTypeV == actionTypeFuncCall) {
+        connect(this,SIGNAL(animationFinished(Action*)),m_target,m_slotCall);
         delete_self();
     }
     else {
-    target = targeted;
+    m_target = targeted;
     qreal newY;
     qreal newX;
-    switch (actionTypeV) {
+    switch (m_actionTypeV) {
     case actionTypeMoveTo :
-        animation.setStartValue(targeted->pos());
+        m_animation.setStartValue(targeted->pos());
         //here we are setting the new position
-        animation.setEndValue(QPointF(endValue[0],endValue[1]));
+        m_animation.setEndValue(QPointF(m_endValue[0],m_endValue[1]));
         break;
     case actionTypeMoveBy :
-        animation.setStartValue(targeted->pos());
+        m_animation.setStartValue(targeted->pos());
         //here we'll calculate the new point as it's moveBy, we'll add the value to the original
-        newX = endValue[0] + targeted->pos().x();
-        newY = endValue[1] + targeted->pos().y();
-        animation.setEndValue(QPointF(newX,newY));
+        newX = m_endValue[0] + targeted->pos().x();
+        newY = m_endValue[1] + targeted->pos().y();
+        m_animation.setEndValue(QPointF(newX,newY));
         break;
     case actionTypeFadeTo :
-        animation.setStartValue(targeted->opacity());
+        m_animation.setStartValue(targeted->opacity());
         //here we'll set the new scale
-        animation.setEndValue(endValue[0]);
+        m_animation.setEndValue(m_endValue[0]);
         break;
     case actionTypeFadeBy :
-        animation.setStartValue(targeted->opacity());
+        m_animation.setStartValue(targeted->opacity());
         //here we'll calculate the new scale as it's multiplied by original scale
-        animation.setEndValue(endValue[0]+targeted->opacity());
+        m_animation.setEndValue(m_endValue[0]+targeted->opacity());
         break;
     case actionTypeScaleTo:
-        animation.setStartValue(targeted->scale());
+        m_animation.setStartValue(targeted->scale());
         //here we'll set the new scale
-        animation.setEndValue(endValue[0]);
+        m_animation.setEndValue(m_endValue[0]);
         break;
     case actionTypeScaleBy :
-        animation.setStartValue(targeted->scale());
+        m_animation.setStartValue(targeted->scale());
         //here we'll calculate the new scale as it's multiplied by original scale
-        animation.setEndValue(endValue[0]*targeted->scale());
+        m_animation.setEndValue(m_endValue[0]*targeted->scale());
         break;
     case actionTypeRotateTo :
-        animation.setStartValue(targeted->rotation());
+        m_animation.setStartValue(targeted->rotation());
         //here we'll set the new scale
-        animation.setEndValue(endValue[0]);
+        m_animation.setEndValue(m_endValue[0]);
         break;
     case actionTypeRotateBy :
-        animation.setStartValue(targeted->rotation());
+        m_animation.setStartValue(targeted->rotation());
         //here we'll calculate the new scale as it's multiplied by original scale
-        animation.setEndValue(endValue[0]+targeted->rotation());
+        m_animation.setEndValue(m_endValue[0]+targeted->rotation());
         break;
     default:
         emit animationFinished(this);
         break;
     }
-    animation.setTargetObject(target);
-    animation.start();
+    m_animation.setTargetObject(m_target);
+    m_animation.start();
     //here we are connecting it to delete itself slot, and emit done signal
-    connect(&animation,SIGNAL(finished()),this,SLOT(delete_self()));
+    connect(&m_animation,SIGNAL(finished()),this,SLOT(delete_self()));
 }
 
 }
 }
 
 void Action::stopAnimation() {
-    animation.stop();
+    m_animation.stop();
 }
 #ifndef ACTION_H
 #define ACTION_H
 #include <QPropertyAnimation>
-#include <QDebug>
 #include "node.h"
 
 class Node;
         actionTypeRotateBy,
         actionTypeFuncCall
     };
-    QObject *target;
+
     Action();
+
+    QObject *m_target;
     //this is the animation variable
-    QPropertyAnimation animation;
-    actionType actionTypeV;
-    qreal endValue[2];
-    const char* slotCall;
+    QPropertyAnimation m_animation;
+    actionType m_actionTypeV;
+    qreal m_endValue[2];
+    const char* m_slotCall;
 public slots:
     void delete_self();
 signals:

Srcs/audiomanager.h

     static void playSound(QString path);
     static void setUpAudioManager();
     static void enableSounds(bool);
+
 private:
     explicit AudioManager(QObject *parent = 0);
     static GE::AudioOut *m_audioOut;
 #ifdef Q_OS_SYMBIAN
     static QTimer m_audioPullTimer; // Used to tick the audio engine in symbian devices only
 #endif
-
-
-signals:
-
-public slots:
-
 };
 
 #endif // AUDIOMANAGER_H

Srcs/director.cpp

 #include "director.h"
 
-MyFasterGraphicView* Director::GraphicView = 0;
-Director* Director::director = 0;
-QMutex Director::mutex;
-QRect Director::desk;
-Scene* Director::currentscene = 0;
+View* Director::m_view = 0;
+Director* Director::m_director = 0;
+QMutex Director::m_mutex;
+QRect Director::m_desk;
+Scene* Director::m_currentscene = 0;
 
 #include <QGraphicsTextItem>
 #include "transitionscene.h"
 
 void Director::setupDirector() {
 
-    if (GraphicView == 0)
+    if (m_view == 0)
     {
         //save window size
-        desk.setWidth(QApplication::desktop()->screen()->width());
-        desk.setHeight(QApplication::desktop()->screen()->height());
+        m_desk.setWidth(QApplication::desktop()->screen()->width());
+        m_desk.setHeight(QApplication::desktop()->screen()->height());
 
         //uncomment this if condition and comment the one under it, if you would like a portraite mode
         //if (desk.height() < desk.width()) {
-        if (desk.height() > desk.width()) {
-            int prevH = desk.height();
-            desk.setHeight(desk.width());
-            desk.setWidth(prevH);
+        if (m_desk.height() > m_desk.width()) {
+            int prevH = m_desk.height();
+            m_desk.setHeight(m_desk.width());
+            m_desk.setWidth(prevH);
         }
         // if it's windows, simulator, check full screen variable, if on mobile phone, run full screen please
 #if defined(Q_OS_MAC) || defined(Q_OS_UNIX) || defined(Q_OS_WIN)
         GraphicView->showFullScreen();
     #else
         QSettings configs("config.ini",QSettings::IniFormat);
-        desk.setWidth(configs.value("width", 480).toInt());
-        desk.setHeight(configs.value("height", 320).toInt());
-        GraphicView = new MyFasterGraphicView(desk);
+        m_desk.setWidth(configs.value("width", 480).toInt());
+        m_desk.setHeight(configs.value("height", 320).toInt());
+        m_view = new View(m_desk);
     #endif // fullscreen end
 
 #else   //mobile phones will use full screen no matter
         GraphicView->showFullScreen();
 #endif // Q_OS_MAC ...... end
 
-        GraphicView->setStyleSheet("background-color: black");
-        GraphicView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
-        GraphicView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
-        GraphicView->setOptimizationFlag(QGraphicsView::DontSavePainterState,true);
+        m_view->setStyleSheet("background-color: black");
+        m_view->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+        m_view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+        m_view->setOptimizationFlag(QGraphicsView::DontSavePainterState,true);
         //setting Qt::WA_TranslucentBackground improves performance on mobile phones!!,it seems it doesn't help a lot!
-        GraphicView->setAttribute(Qt::WA_TranslucentBackground,false);
-        GraphicView->setFrameStyle(0);
+        m_view->setAttribute(Qt::WA_TranslucentBackground,false);
+        m_view->setFrameStyle(0);
         setOrientation(Director::ScreenOrientationLockLandscape);
 //        #ifdef Q_OS_SYMBIAN
         //do nothing, don't turn on advance graphics features
 //        #else   //symbian is slow so this will only apply for OSes other than symbian phones, also we don't need these on other devices, if needed, we'll just uncomment this code
 //        GraphicView->setRenderHints(QPainter::NonCosmeticDefaultPen | QPainter::Antialiasing | QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform | QPainter::HighQualityAntialiasing);
 //        #endif
-        GraphicView->setGeometry(desk);
-//        desk.setX(0);
-//        desk.setY(0);
+        m_view->setGeometry(m_desk);
+        m_desk.setX(0);
+        m_desk.setY(0);
         //set graphics view to screen size
-        scene = new GraphicsScene;
-        GraphicView->setScene(scene);
-        scene->setItemIndexMethod(QGraphicsScene::NoIndex);
-        scene->addRect(desk,Qt::NoPen,QColor(0,0,0,255))->setZValue(-1000);
+        m_scene = new GraphicsScene;
+        m_view->setScene(m_scene);
+        m_scene->setItemIndexMethod(QGraphicsScene::NoIndex);
+        m_scene->addRect(m_desk,Qt::NoPen,QColor(0,0,0,255))->setZValue(-1000);
 
         if (displyFrameRate) {
-            Director::sharedDirector()->frameRateText = scene->addText(QString().setNum(60));
-            frameRateText->setPlainText(QString().setNum(frameRate));
+            Director::sharedDirector()->m_frameRateText = m_scene->addText(QString().setNum(60));
+            m_frameRateText->setPlainText(QString().setNum(frameRate));
             QFont newfont("Ariel",16);
             newfont.setPixelSize(newfont.pointSize());
-            frameRateText->setFont(newfont);
-            Director::sharedDirector()->frameRateText->setZValue(10000);
-            Director::sharedDirector()->frameRateText->setDefaultTextColor(QColor(255,255,255,150));
-            frameRateText->setPos(0,desk.height()-(frameRateText->document()->size().height()));
+            m_frameRateText->setFont(newfont);
+            Director::sharedDirector()->m_frameRateText->setZValue(10000);
+            Director::sharedDirector()->m_frameRateText->setDefaultTextColor(QColor(255,255,255,150));
+            m_frameRateText->setPos(0,m_desk.height()-(m_frameRateText->document()->size().height()));
         }
-        GraphicView->setViewportUpdateMode(QGraphicsView::SmartViewportUpdate);
-        Director::sharedDirector()->delta.restart();
-        Director::sharedDirector()->frameSchedular.start((1.0/frameRate)*1000.0);
-        isRuning = true;
-        GraphicView->setSceneRect(desk);
-        qDebug() << "Game Engine :: Screen size : w: " << desk.width() << " x h: " << desk.height();
+        m_view->setViewportUpdateMode(QGraphicsView::SmartViewportUpdate);
+        Director::sharedDirector()->m_delta.restart();
+        Director::sharedDirector()->m_frameSchedular.start((1.0/frameRate)*1000.0);
+        m_isRuning = true;
+        m_view->setSceneRect(m_desk);
+        DEBUG_INFO("Game Engine :: Screen size : w: " << m_desk.width() << " x h: " << m_desk.height());
 
-        updateLessTimes = frameRate/3;
+        m_updateLessTimes = frameRate/3;
 
         #ifdef useOpenGL
 
 
             openGLwidget = new QGLWidget(format);
             openGLwidget->setGeometry(desk);
-            GraphicView->setViewport(openGLwidget);
+            m_view->setViewport(openGLwidget);
             openGLwidget->setStyleSheet("background-color: black");
-            qDebug() << "Game Engine :: OpenGL " <<format.majorVersion() << "." << format.minorVersion();
-            //            qDebug() << "Supported OpenGL are " << format.openGLVersionFlags();
+            DEBUG_INFO("Game Engine :: OpenGL " <<format.majorVersion() << "." << format.minorVersion());
+            //            DEBUG_INFO("Supported OpenGL are " << format.openGLVersionFlags());
         } else {
-            qDebug() << "Game Engine :: OpenGL not supported, performance might decrease significatly";
+            DEBUG_INFO("Game Engine :: OpenGL not supported, performance might decrease significatly");
             openGLwidget = 0;
         }
         #else
-        openGLwidget = 0;
+        m_openGLwidget = 0;
         #endif // useOpenGL end
         //end of opengl setting
 
 
 #if defined(Q_OS_MAC) || defined(Q_OS_UNIX) || defined(Q_OS_WIN)
-            QDesktopWidget w;
-            QRect rect = w.availableGeometry();
-            GraphicView->move((rect.width() - GraphicView->width()) / 2
-                              , (rect.height() - GraphicView->height()) / 2);
+            m_view->move((QApplication::desktop()->width() - m_view->width()) / 2
+                       , (QApplication::desktop()->height() - m_view->height()) / 2);
 #endif
-        if (openGLwidget == 0) {
+        if (m_openGLwidget == 0) {
 
-            GraphicView->show();
-            connect(&frameSchedular,SIGNAL(timeout()),Director::sharedDirector(),SLOT(updatedEveryFrameRate()));
+            m_view->show();
+            connect(&m_frameSchedular,SIGNAL(timeout()),Director::sharedDirector(),SLOT(updatedEveryFrameRate()));
         } else {
 #if defined(Q_OS_WIN)
     #ifndef fullScreen
-            GraphicView->showNormal();
+            m_view->showNormal();
     #endif
 #endif
-            connect(&frameSchedular,SIGNAL(timeout()),Director::sharedDirector(),SLOT(updatedEveryFrameRateOpenGL()));
+            connect(&m_frameSchedular,SIGNAL(timeout()),Director::sharedDirector(),SLOT(updatedEveryFrameRateOpenGL()));
         }
     }
 }
 
 void Director::startWithScene(Scene *scene) {
-    currentscene = scene;
+    m_currentscene = scene;
     scene->mainLayer->onEnterTransitionDidStart();
     continueView();
     scene->mainLayer->onEnterTransitionDidFinish();
 }
 
 void Director::replaceScene(Scene *scene) {
-    if (currentscene != 0 ) {
-        currentscene->mainLayer->onExitTransitionDidStart();
-        currentscene->mainLayer->onExitTransitionDidFinish();
-        delete currentscene;
+    if (m_currentscene != 0 ) {
+        m_currentscene->mainLayer->onExitTransitionDidStart();
+        m_currentscene->mainLayer->onExitTransitionDidFinish();
+        delete m_currentscene;
     }
     scene->mainLayer->onEnterTransitionDidStart();
     continueView();
-    currentscene = scene;
-    currentscene->mainLayer->onEnterTransitionDidFinish();
+    m_currentscene = scene;
+    m_currentscene->mainLayer->onEnterTransitionDidFinish();
 }
 
-void Director::replaceScene(transitionScene *traSce) {
-    traSce->setCurrScene(currentscene);
+void Director::replaceScene(TransitionScene *traSce) {
+    traSce->setCurrScene(m_currentscene);
     continueView();
 }
 void Director::transitionDone(Scene* scene) {
-    delete currentscene;
-    currentscene = scene;
+    delete m_currentscene;
+    m_currentscene = scene;
 }
 
 Director* Director::sharedDirector()
 {
-    if (!director)
+    if (!m_director)
     {
-        mutex.lock();
+        m_mutex.lock();
 
-        if (!director)
+        if (!m_director)
         {
 //            QThread *director_thread = new QThread;
-            director = new Director;
+            m_director = new Director;
 //            director->moveToThread(director_thread);
 //            director_thread->start();
-            director->setupDirector();
+            m_director->setupDirector();
         }
-        mutex.unlock();
+        m_mutex.unlock();
     }
 
-    return director;
+    return m_director;
 }
 
 QRect Director::winSizeInPixels() {
-    return desk;
+    return m_desk;
 }
 
 void Director::updatedEveryFrameRate() {
-    int elapsed = delta.elapsed();
+    int elapsed = m_delta.elapsed();
     emit update(elapsed/1000.0);
     if (displyFrameRate) {
         double rate = elapsed;
         rate = 1.0/rate;
         if (rate > frameRate + 10)
             rate = frameRate;
-        updateLessTimes++;
-        if (updateLessTimes > (frameRate/2)) {
-            updateLessTimes = 0;
-            frameRateText->setPlainText(QString().setNum(rate,'g',3));
+        m_updateLessTimes++;
+        if (m_updateLessTimes > (frameRate/2)) {
+            m_updateLessTimes = 0;
+            m_frameRateText->setPlainText(QString().setNum(rate,'g',3));
         }
     }
-    delta.start();
+    m_delta.start();
 //    GraphicView->update(desk);
 }
 void Director::updatedEveryFrameRateOpenGL() {
-    int elapsed = delta.elapsed();
+    int elapsed = m_delta.elapsed();
     emit update(elapsed/1000.0);
     if (displyFrameRate) {
         double rate = elapsed;
         rate = 1.0/rate;
         if (rate > frameRate + 10)
             rate = frameRate;
-        updateLessTimes++;
-        if (updateLessTimes > (frameRate/2)) {
-            updateLessTimes = 0;
-            frameRateText->setPlainText(QString().setNum(rate,'g',3));
+        m_updateLessTimes++;
+        if (m_updateLessTimes > (frameRate/2)) {
+            m_updateLessTimes = 0;
+            m_frameRateText->setPlainText(QString().setNum(rate,'g',3));
 
         }
     }
-    delta.start();
+    m_delta.start();
 //    openGLwidget->update(desk);
 }
 
 
 QGraphicsView * Director::sharedGraphicView() {
-    return GraphicView;
+    return m_view;
 }
 
 void Director::pauseView() {
-    if (isRuning) {
-        if (openGLwidget == 0) {
-            disconnect(&frameSchedular,SIGNAL(timeout()),Director::sharedDirector(),SLOT(updatedEveryFrameRate()));
+    if (m_isRuning) {
+        if (m_openGLwidget == 0) {
+            disconnect(&m_frameSchedular,SIGNAL(timeout()),Director::sharedDirector(),SLOT(updatedEveryFrameRate()));
         } else {
-            disconnect(&frameSchedular,SIGNAL(timeout()),Director::sharedDirector(),SLOT(updatedEveryFrameRateOpenGL()));
+            disconnect(&m_frameSchedular,SIGNAL(timeout()),Director::sharedDirector(),SLOT(updatedEveryFrameRateOpenGL()));
         }
-        isRuning = 0;
+        m_isRuning = 0;
     }
 }
 
 void Director::continueView() {
-    if (!isRuning) {
-        isRuning = 1;
-        if (openGLwidget == 0) {
-            connect(&frameSchedular,SIGNAL(timeout()),Director::sharedDirector(),SLOT(updatedEveryFrameRate()));
+    if (!m_isRuning) {
+        m_isRuning = 1;
+        if (m_openGLwidget == 0) {
+            connect(&m_frameSchedular,SIGNAL(timeout()),Director::sharedDirector(),SLOT(updatedEveryFrameRate()));
         } else {
-            connect(&frameSchedular,SIGNAL(timeout()),Director::sharedDirector(),SLOT(updatedEveryFrameRateOpenGL()));
+            connect(&m_frameSchedular,SIGNAL(timeout()),Director::sharedDirector(),SLOT(updatedEveryFrameRateOpenGL()));
         }
     }
 }
 
 GraphicsScene * Director::sharedGraphicScene() {
-    return scene;
+    return m_scene;
 }
 
 void Director::setOrientation(ScreenOrientation orientation)
         break;
 #endif // QT_VERSION < 0x040702
     };
-    GraphicView->setAttribute(attribute, true);
+    m_view->setAttribute(attribute, true);
 }
 
 QPointF Director::convertTouchPoint(QPointF oldPoint) {
     //we'll do convert the touch point
-    return QPointF(oldPoint.x(),desk.height() - oldPoint.y());
+    return QPointF(oldPoint.x(),m_desk.height() - oldPoint.y());
 }
 #include "graphicsscene.h"
 #include <QtOpenGL>
 #include "textitem.h"
-#include "myfastergraphicview.h"
+#include "view.h"
 
-class transitionScene;
+class TransitionScene;
 class Scene;
 
 class Director : public QObject
 {
     Q_OBJECT
 
-private:
-
-    Director();	// hide constructor
-    ~Director();	// hide destructor
-    Director(const Director &); // hide copy constructor
-    Director& operator=(const Director &); // hide assign op
-    static Scene *currentscene;
-    static Director *director;
-    static QMutex mutex;
-    static QRect desk;
-    QGraphicsTextItem *frameRateText;
-    QTime delta;
-    QTimer frameSchedular;
-    static MyFasterGraphicView *GraphicView;
-    bool isRuning;
-    GraphicsScene *scene;
-    QGLWidget* openGLwidget;
-    int updateLessTimes;
 public:
     void setupDirector();
     QGraphicsView* sharedGraphicView();
     GraphicsScene* sharedGraphicScene();
     static Director* sharedDirector();
     QRect winSizeInPixels();
-    void startWithScene(Scene *scene);
-    void replaceScene(Scene *scene);
-    void replaceScene(transitionScene *traSce);
+    void startWithScene(Scene *m_scene);
+    void replaceScene(Scene *m_scene);
+    void replaceScene(TransitionScene *traSce);
     void pauseView();
     void continueView();
 
 public slots:
     void updatedEveryFrameRate();
     void updatedEveryFrameRateOpenGL();
-    void transitionDone(Scene* scene);
+    void transitionDone(Scene* m_scene);
 signals:
     void update(double deltams);
-protected:
+
+private:
+    Director();	// hide constructor
+    ~Director();	// hide destructor
+    Director(const Director &); // hide copy constructor
+    Director& operator=(const Director &); // hide assign op
+
+    static Scene *m_currentscene;
+    static Director *m_director;
+    static QMutex m_mutex;
+    static QRect m_desk;
+
+    QGraphicsTextItem *m_frameRateText;
+    QTime m_delta;
+    QTimer m_frameSchedular;
+    static View *m_view;
+    bool m_isRuning;
+    GraphicsScene *m_scene;
+    QGLWidget* m_openGLwidget;
+    int m_updateLessTimes;
 
 };
 

Srcs/graphicsscene.cpp

 GraphicsScene::GraphicsScene(QObject *parent) :
     QGraphicsScene(parent)
 {
-    mouseDown = 0;
+    m_mouseDown = 0;
     setSceneRect(0,0,Director::sharedDirector()->winSizeInPixels().width(),Director::sharedDirector()->winSizeInPixels().height());
 }
 
 void GraphicsScene::mousePressEvent(QGraphicsSceneMouseEvent *event) {
     emit signaltouchpressed(event);
-    mouseDown = 1;
+    m_mouseDown = 1;
 }
 void GraphicsScene::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
-    if (mouseDown) emit signaltouchmoved(event);
+    if (m_mouseDown) emit signaltouchmoved(event);
 }
 void GraphicsScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) {
     emit signaltouchreleased(event);
-    mouseDown = 0;
+    m_mouseDown = 0;
 }

Srcs/graphicsscene.h

     void signaltouchmoved(QGraphicsSceneMouseEvent * mouseEvent);
     void signaltouchreleased(QGraphicsSceneMouseEvent * mouseEvent);
 private:
-    bool mouseDown;
+    bool m_mouseDown;
 };
 
 #endif // GRAPHICSSCENE_H
 public:
     static Menu* menuWithmenuItems(MenuItem* item,...);
     void setEnabled(bool);
+
 private:
     Menu() {}
     ~Menu() {}
     void addChild(Node *child, int tag = 0, int z = 0);
+
+private:
     QList <MenuItem*> items;
 };
 
     MenuItem();
     virtual void setEnabled(bool) = 0;
     void buttonClicked() { emit signalClicked(); }
+
+signals:
+    void signalClicked();
+
 private:
     QGraphicsScene* getSharedGraphicScene(){ return 0; }
     void setSharedGraphicScene(QGraphicsScene* graphicscene){ return; }
     void setGraphicsItem(QGraphicsItem* item) { return;}
     void setW(qreal w) {}
     void setH(qreal h) {}
-signals:
-    void signalClicked();
 };
 
 #endif // MENUITEM_H

Srcs/menuitemimage.h

     static MenuItemImage* itemWith(const char* image,const char* clicked_image = "",QObject* target = 0,const char* slot = 0);
     virtual void setEnabled(bool);
 
+public slots:
+    virtual void touchBegin(QGraphicsSceneMouseEvent *event);
+    virtual void touchMove(QGraphicsSceneMouseEvent *event);
+    virtual void touchEnd(QGraphicsSceneMouseEvent *event);
+
 private:
     MenuItemImage(const QString &filename,const QString &clickedfilename,QObject* target = 0,const char* slot = 0);
     SpriteItem* item;
     bool touchable;
     bool click;
     bool contains(QPointF point);
-public slots:
-    virtual void touchBegin(QGraphicsSceneMouseEvent *event);
-    virtual void touchMove(QGraphicsSceneMouseEvent *event);
-    virtual void touchEnd(QGraphicsSceneMouseEvent *event);
 };
 
 #endif // MENUITEMIMAGE_H

Srcs/menuitemlabel.h

 public:
     static MenuItemLabel* LabelWith(const char* text,QColor *color = 0,int fontSize = 16, QString font = "Times",QObject* target = 0,const char* slot = 0);
 
+public slots:
+    virtual void touchBegin(QGraphicsSceneMouseEvent *event);
+    virtual void touchMove(QGraphicsSceneMouseEvent *event);
+    virtual void touchEnd(QGraphicsSceneMouseEvent *event);
+
 private:
     MenuItemLabel(const QString &text,QColor *color = 0,int fontSize = 16,
                   QString font = "Times",QObject* target = 0,const char* slot = 0);
     bool click;
     bool contains(QPointF point);
     Action* currAction;
-public slots:
-    virtual void touchBegin(QGraphicsSceneMouseEvent *event);
-    virtual void touchMove(QGraphicsSceneMouseEvent *event);
-    virtual void touchEnd(QGraphicsSceneMouseEvent *event);
 };
 
 #endif // MENUITEMLABEL_H

Srcs/myfastergraphicview.h

-#ifndef MYFASTERGRAPHICVIEW_H
-#define MYFASTERGRAPHICVIEW_H
-
-#include <QGraphicsView>
-#include <QPaintEvent>
-
-class MyFasterGraphicView :public QGraphicsView
-{
-Q_OBJECT
-public:
-MyFasterGraphicView(QRect deskSize){
-    winSize = deskSize;
-}
-protected:
-void paintEvent ( QPaintEvent * /*event*/ ) {
-//    QPaintEvent *newEvent=new QPaintEvent(event->region().boundingRect());
-    QPaintEvent *newEvent=new QPaintEvent(winSize);
-    QGraphicsView::paintEvent(newEvent);
-    delete newEvent;
-    }
-private:
-    QRect winSize;
-};
-
-#endif // MYFASTERGRAPHICVIEW_H
 }
 
 
-int Node::global_max_z = 0;
-QGraphicsScene* Node::sharedGraphicScene = 0;
+int Node::m_global_max_z = 0;
+QGraphicsScene* Node::m_sharedGraphicScene = 0;
 
 Node::Node() {
-    parent = 0;
-    graphicsItem = 0;
-    center_x = 0;
-    center_y = 0;
-    scaleFactor = 1.0;
-    z_ = 0;
-    max_local_z = 0;
-    w = 0;
-    h = 0;
-    updatescheduled = 0;
-    rotaionAngle = 0;
-    opacityValue = 100;
-    isTouchEnabled = false;
+    m_parent = 0;
+    m_graphicsItem = 0;
+    m_centerX = 0;
+    m_centerY = 0;
+    m_scaleFactor = 1.0;
+    m_zOrder = 0;
+    m_max_local_z = 0;
+    m_width = 0;
+    m_height = 0;
+    m_updatescheduled = 0;
+    m_rotaionAngle = 0;
+    m_opacityValue = 100;
+    m_isTouchEnabled = false;
 }
 
 Node::~Node() {
     // before deleting the item, we'll stop all the actions running on that item!
     stopAllActions();
     // if our nodes includes a graphical item, then yes, we'll remove it from the scene it belongs to
-    if (graphicsItem != 0) {
+    if (m_graphicsItem != 0) {
         // we are checking if it's actually belongs to a scene
-        if (graphicsItem->scene() != 0) {
-            graphicsItem->scene()->removeItem(graphicsItem);
+        if (m_graphicsItem->scene() != 0) {
+            m_graphicsItem->scene()->removeItem(m_graphicsItem);
         }
         else {
             qDebug() << "GameEngine :: Warning : deleting an item, which actually doesn't belong to a scene";
         }
-        delete graphicsItem;
-        graphicsItem = 0;
+        delete m_graphicsItem;
+        m_graphicsItem = 0;
     }
     // we'll recursively delete the childs one by one
     Node* child;
-    while (!childs.isEmpty()) {
-        child = childs.takeFirst();
+    while (!m_children.isEmpty()) {
+        child = m_children.takeFirst();
         child->deleteLater();
     }
-    if (parent == 0) {
-        global_max_z = 0;
+    if (m_parent == 0) {
+        m_global_max_z = 0;
     }
 }
 
 qreal Node::opacity() const {
-    return opacityValue;
+    return m_opacityValue;
 }
 
 qreal Node::realTimeOpacity() const {
-    if (parent != 0) {
-        return (opacityValue/100.0) * parent->realTimeOpacity();
+    if (m_parent != 0) {
+        return (m_opacityValue/100.0) * m_parent->realTimeOpacity();
     }
-    return (opacityValue/100.0);
+    return (m_opacityValue/100.0);
 }
 
 void Node::setOpacity(qreal value) {
-    opacityValue = value;
-    if (graphicsItem != 0) {
-        graphicsItem->setOpacity(realTimeOpacity());
+    m_opacityValue = value;
+    if (m_graphicsItem != 0) {
+        m_graphicsItem->setOpacity(realTimeOpacity());
     }
     else {
         emit updateChildsOpacity();
 }
 
 void Node::setRotation(qreal rotationDegree) {
-    rotaionAngle = rotationDegree;
-    if (graphicsItem != 0) {
+    m_rotaionAngle = rotationDegree;
+    if (m_graphicsItem != 0) {
         //it's a graphics item not a layer nor a scene
-        graphicsItem->setRotation((-realTimeRotation()));
-        int realrotation = graphicsItem->rotation();
+        m_graphicsItem->setRotation((-realTimeRotation()));
+        int realrotation = m_graphicsItem->rotation();
         if (realrotation%90 == 0) {
             //disable antianalising
         }
 
 }
 qreal Node::rotation() {
-    return rotaionAngle;
+    return m_rotaionAngle;
 }
 qreal Node::realTimeRotation() const {
-    if (parent!=0)
-        return rotaionAngle + parent->realTimeRotation();
-    return rotaionAngle;
+    if (m_parent!=0)
+        return m_rotaionAngle + m_parent->realTimeRotation();
+    return m_rotaionAngle;
 }
 void Node::updateMyRotation() {
     setRotation(rotation());
 void Node::setPos(const QPointF &pos)
 {
     //here we are setting the position of our node according to it's parent, and it's parameter is the center point
-    center_x = pos.x();
-    center_y = pos.y();
-    if (graphicsItem != 0) {
+    m_centerX = pos.x();
+    m_centerY = pos.y();
+    if (m_graphicsItem != 0) {
         //it's a graphics item not a layer nor a scene we'll set that to the new position
-        graphicsItem->setPos(realTimePos());
+        m_graphicsItem->setPos(realTimePos());
     }
     else {
         emit updateChildsPos();
 
 void Node::setScale(qreal factor)
 {
-    scaleFactor = factor;
-    if (graphicsItem != 0) {
+    m_scaleFactor = factor;
+    if (m_graphicsItem != 0) {
         //it's a graphics item not a layer nor a scene
         qreal realScale = realTimeScale();
-        graphicsItem->setScale(realScale);
+        m_graphicsItem->setScale(realScale);
     }
     else {
         emit updateChildsScale();
 QPointF Node::realTimePos() const {
     qreal scalew = 0;
     qreal scaleh = 0;
-    qreal rotatedx = center_x;
-    qreal rotatedy = center_y;
+    qreal rotatedx = m_centerX;
+    qreal rotatedy = m_centerY;
     qreal moveByX = 0;
     qreal moveByY = 0;
     qreal distance = 0;
     qreal xangleOnCircle = 0;
-    if (parent != 0) {
+    if (m_parent != 0) {
         //find the rotated position
         if (rotatedx != 0 || rotatedy != 0) {
             distance = pointDistance(QPointF(0,0),QPointF(rotatedx,rotatedy));
             }
             xangleOnCircle = asin(xangleOnCircle);
             xangleOnCircle *= radtodeg;
-            xangleOnCircle += parent->realTimeRotation();
+            xangleOnCircle += m_parent->realTimeRotation();
             xangleOnCircle *= degtorad;
 
             // now we'll use this angle, and the distance, to find the point in out circle
 
     }
 
-    if (graphicsItem != 0) {
+    if (m_graphicsItem != 0) {
 
 
-        scalew=(w*graphicsItem->scale())/2;
-        scaleh=(h*graphicsItem->scale())/2;
+        scalew=(m_width*m_graphicsItem->scale())/2;
+        scaleh=(m_height*m_graphicsItem->scale())/2;
 
         //that was the new point for the layer, now we'll center the item iteself,so rotation is done around center
         distance = pointDistance(QPointF(0,0),QPointF(scalew,scaleh));
         // here, we already have the rotation of the item
-        xangleOnCircle = ((h*graphicsItem->scale())/2)/distance;
+        xangleOnCircle = ((m_height*m_graphicsItem->scale())/2)/distance;
         xangleOnCircle = asin(xangleOnCircle);
         //convert it
         xangleOnCircle *= radtodeg;
         xangleOnCircle = 180.0 - xangleOnCircle;
-        xangleOnCircle -= graphicsItem->rotation();
+        xangleOnCircle -= m_graphicsItem->rotation();
         xangleOnCircle *= degtorad;
 
         //now we just have to find the new diffrence
         moveByY = moveByY - scaleh;
 
     }
-    if (parent != 0) {
-        QPointF realtimePoint = parent->realTimePos();
-        qreal realscale = parent->realTimeScale();
+    if (m_parent != 0) {
+        QPointF realtimePoint = m_parent->realTimePos();
+        qreal realscale = m_parent->realTimeScale();
         return QPointF(realtimePoint.x() + ((rotatedx) * realscale) - scalew + moveByX ,realtimePoint.y() - (rotatedy* realscale) - scaleh - moveByY);
     }
     else {
-        return QPointF(center_x,center_y);
+        return QPointF(m_centerX,m_centerY);
     }
 }
 
 qreal Node::realTimeScale() const {
-    if (parent != 0)
-        return scaleFactor*parent->realTimeScale();
-    return scaleFactor;
+    if (m_parent != 0)
+        return m_scaleFactor*m_parent->realTimeScale();
+    return m_scaleFactor;
 }
 
 QPointF Node::pos() const {
-    return QPointF(center_x,center_y);
+    return QPointF(m_centerX,m_centerY);
 }
 
 qreal Node::scale() {
-    return scaleFactor;
+    return m_scaleFactor;
 }
 int Node::realTimeZ() const {
-    if (parent != 0) {
+    if (m_parent != 0) {
         //am not the grand parent
-        return parent->realTimeZ() + z_;
+        return m_parent->realTimeZ() + m_zOrder;
     }
     //here if am the grand parent, basically I'll return my Z level
-    return z_ + global_max_z;
+    return m_zOrder + m_global_max_z;
 }
 
 void Node::setZ(int zValue) {
-    z_ = zValue;
-    if (graphicsItem != 0) {
-        graphicsItem->setZValue(realTimeZ());
+    m_zOrder = zValue;
+    if (m_graphicsItem != 0) {
+        m_graphicsItem->setZValue(realTimeZ());
     }
     else {
         emit updateChildsZ();
 
 Action* Node::runAction(Action* actionPara) {
     actionPara->setTarget(this);
-    actions.append(actionPara);
+    m_actions.append(actionPara);
     return actionPara;
 }
 
 void Node::actionDone(Action* doneAction) {
     bool found = false;
-    for (int i=0;i<=actions.size()&&!found;i++) {
-        if(actions.at(i) == doneAction) {
+    for (int i=0;i<=m_actions.size()&&!found;i++) {
+        if(m_actions.at(i) == doneAction) {
             found = true;
-            actions.removeAt(i);
+            m_actions.removeAt(i);
             delete doneAction;
         }
     }
 
 void Node::stopAction(Action* stopAction) {
     bool found = false;
-    for (int i=0;i<actions.size()&&!found;i++) {
-        if(actions.at(i) == stopAction) {
+    for (int i=0;i<m_actions.size()&&!found;i++) {
+        if(m_actions.at(i) == stopAction) {
             found = true;
             stopAction->stopAnimation();
-            actions.removeAt(i);
+            m_actions.removeAt(i);
             delete stopAction;
         }
     }
 
 void Node::stopAllActions() {
     Action* tempaction;
-    while (!actions.isEmpty()) {
-        tempaction = actions.takeFirst();
+    while (!m_actions.isEmpty()) {
+        tempaction = m_actions.takeFirst();
         tempaction->stopAnimation();
         delete tempaction;
     }
 }
 
 QGraphicsScene * Node::getSharedGraphicScene() {
-    return sharedGraphicScene;
+    return m_sharedGraphicScene;
 }
 
 void Node::setSharedGraphicScene(QGraphicsScene *graphicscene) {
-    sharedGraphicScene = graphicscene;
+    m_sharedGraphicScene = graphicscene;
 }
 
 int Node::getGlobalMaxZ() {
-    return global_max_z;
+    return m_global_max_z;
 }
 
 void Node::setGraphicsItem(QGraphicsItem *item) {
-    graphicsItem = item;
+    m_graphicsItem = item;
 }
 
 QGraphicsItem * Node::getGraphicsItem() {
-    return graphicsItem;
+    return m_graphicsItem;
 }
 
 void Node::setW(qreal ww) {
-    w = ww;
+    m_width = ww;
 }
 
 void Node::setH(qreal hh) {
-    h = hh;
+    m_height = hh;
 }
 
 void Node::schedualUpdate() {
-    if (!updatescheduled) {
-        updatescheduled = 1;
+    if (!m_updatescheduled) {
+        m_updatescheduled = 1;
         connect(Director::sharedDirector(),SIGNAL(update(double)),this,SLOT(update(double)));
     }
     else {
 }
 
 void Node::unSchedualUpdate() {
-    if (updatescheduled) {
-        updatescheduled = 0;
+    if (m_updatescheduled) {
+        m_updatescheduled = 0;
         disconnect(Director::sharedDirector(),SIGNAL(update(double)),this,SLOT(update(double)));
     }
     else {
 }
 
 qreal Node::width() {
-    return w;
+    return m_width;
 }
 
 qreal Node::height() {
-    return h;
+    return m_height;
 }
 
 int Node::z() {
-    return z_;
+    return m_zOrder;
 }
 
 //child managment methodes
 
 void Node::addChild(Node *child, int tag, int z) {
     // I'm this child parent!!
-    child->parent = this;
+    child->m_parent = this;
     //I'll add this child to my childs list
-    this->childs.append(child);
+    this->m_children.append(child);
     //I'll also set it's tag
-    child->nodetag = tag;
+    child->m_nodetag = tag;
     // setting the Z
     child->setZ(child->z());
     child->setPos(child->pos());
     connect(this,SIGNAL(updateChildsZ()),child,SLOT(updateMyZ()));
     connect(this,SIGNAL( updateChildsRotation() ),child,SLOT( updateMyRotation() ) );
     connect(this,SIGNAL( updateChildsOpacity() ),child,SLOT( updateMyOpacity() ) );
-    if (child->graphicsItem != 0) {
+    if (child->m_graphicsItem != 0) {
         // if this is actually some item, ie, not a layer nor a scene, we'll add it to the view
-        sharedGraphicScene->addItem(child->graphicsItem);
+        m_sharedGraphicScene->addItem(child->m_graphicsItem);
     } else {
     }
 }
 Node* Node::getChildByTag(int tag) {
     bool found = false;
     Node *child = 0;
-    for (int i=0; !found && i<childs.size() ;i++) {
-        child = childs.at(i);
-        if(child->nodetag == tag) {
+    for (int i=0; !found && i<m_children.size() ;i++) {
+        child = m_children.at(i);
+        if(child->m_nodetag == tag) {
             found = true;
         }
     }
 void Node::removeChildByTag(int tag) {
     bool found = false;
     Node *child = 0;
-    for (int i=0; !found && i<childs.size() ;i++) {
-        child = childs.at(i);
-        if(child->nodetag == tag) {
+    for (int i=0; !found && i<m_children.size() ;i++) {
+        child = m_children.at(i);
+        if(child->m_nodetag == tag) {
             found = true;
-            childs.removeAt(i);
+            m_children.removeAt(i);
             child->deleteLater();
         }
     }
 void Node::removeChild(Node *child) {
     bool found = false;
     Node *c = 0;
-    for (int i=0; !found && i<childs.size() ;i++) {
-        c = childs.at(i);
+    for (int i=0; !found && i<m_children.size() ;i++) {
+        c = m_children.at(i);
         if(c == child) {
             found = true;
-            childs.removeAt(i);
+            m_children.removeAt(i);
             child->deleteLater();
         }
     }
 
 
 void Node::setTouchEnabled(bool enabled) {
-    if (!isTouchEnabled) {
+    if (!m_isTouchEnabled) {
         if (enabled) {
             //enable the touch, it was disabled and a request to enable it for this layer
-            isTouchEnabled = true;
+            m_isTouchEnabled = true;
             connect(Director::sharedDirector()->sharedGraphicScene(),SIGNAL(signaltouchmoved(QGraphicsSceneMouseEvent*)),this,SLOT(touchMove(QGraphicsSceneMouseEvent*)));
             connect(Director::sharedDirector()->sharedGraphicScene(),SIGNAL(signaltouchreleased(QGraphicsSceneMouseEvent*)),this,SLOT(touchEnd(QGraphicsSceneMouseEvent*)));
             connect(Director::sharedDirector()->sharedGraphicScene(),SIGNAL(signaltouchpressed(QGraphicsSceneMouseEvent*)),this,SLOT(touchBegin(QGraphicsSceneMouseEvent*)));
     } else {
         if (!enabled) {
             //disable the touch, and a request to disable it is sent
-            isTouchEnabled = false;
+            m_isTouchEnabled = false;
             disconnect(Director::sharedDirector()->sharedGraphicScene(),SIGNAL(signaltouchmoved(QGraphicsSceneMouseEvent*)),this,SLOT(touchMove(QGraphicsSceneMouseEvent*)));
             disconnect(Director::sharedDirector()->sharedGraphicScene(),SIGNAL(signaltouchreleased(QGraphicsSceneMouseEvent*)),this,SLOT(touchEnd(QGraphicsSceneMouseEvent*)));
             disconnect(Director::sharedDirector()->sharedGraphicScene(),SIGNAL(signaltouchpressed(QGraphicsSceneMouseEvent*)),this,SLOT(touchBegin(QGraphicsSceneMouseEvent*)));
 #include "QPointF"
 #include "QGraphicsScene"
 #include <QGraphicsItem>
-#include <QDebug>
 #include "sequence.h"
 #include "director.h"
+#include "trace.h"
 
 class Action;
 class Sequence;
     virtual void touchMove(QGraphicsSceneMouseEvent /**event*/) {}
     virtual void touchEnd(QGraphicsSceneMouseEvent /**event*/) {}
     void setTouchEnabled(bool enabled = true);
-protected:
-    // these functions are overloaded in base classes as private with no implementation, because they need to be protected
-    virtual QGraphicsScene* getSharedGraphicScene();
-    virtual void setSharedGraphicScene(QGraphicsScene* graphicscene);
-    virtual int getGlobalMaxZ();
-    virtual QGraphicsItem* getGraphicsItem();
-    virtual void setGraphicsItem(QGraphicsItem* item);
-    virtual void setW(qreal w);
-    virtual void setH(qreal h);
-    // end of protected members
-signals:
-    void updateChildsPos();
-    void updateChildsScale();
-    void updateChildsZ();
-    void updateChildsRotation();
-    void updateChildsOpacity();
 
 public slots:
     void actionDone(Action* doneAction);
     virtual void update(double delta);
+
 public slots:
     void updateMyPos();
     void updateMyScale();
     void updateMyRotation();
     void updateMyOpacity();
 
+signals:
+    void updateChildsPos();
+    void updateChildsScale();
+    void updateChildsZ();
+    void updateChildsRotation();
+    void updateChildsOpacity();
+
+protected:
+    // these functions are overloaded in base classes as private with no implementation, because they need to be protected
+    virtual QGraphicsScene* getSharedGraphicScene();
+    virtual void setSharedGraphicScene(QGraphicsScene* graphicscene);
+    virtual int getGlobalMaxZ();
+    virtual QGraphicsItem* getGraphicsItem();
+    virtual void setGraphicsItem(QGraphicsItem* item);
+    virtual void setW(qreal m_width);
+    virtual void setH(qreal m_height);
+    // end of protected members
+
 private:
-    bool updatescheduled;
-    static QGraphicsScene *sharedGraphicScene;
-    int z_;
-    static int global_max_z;
-    int max_local_z;
-    Node *parent;
-    QList <Node *> childs;
-    QList <Action *> actions;
-    QGraphicsItem *graphicsItem;
     QPointF     realTimePos() const;
     qreal     realTimeScale() const;
     int     realTimeZ() const;
     qreal     realTimeRotation() const;
     qreal     realTimeOpacity() const;
-    qreal center_x;
-    qreal center_y;
-    qreal scaleFactor;
-    qreal w;
-    qreal h;
-    qreal rotaionAngle;
-    qreal opacityValue;
-    int nodetag;
-    bool isTouchEnabled;
+
+private:
+    bool m_updatescheduled;
+    static QGraphicsScene *m_sharedGraphicScene;
+    int m_zOrder;
+    static int m_global_max_z;
+    int m_max_local_z;
+    Node *m_parent;
+    QList <Node *> m_children;
+    QList <Action *> m_actions;
+    QGraphicsItem *m_graphicsItem;
+
+    qreal m_centerX;
+    qreal m_centerY;
+    qreal m_scaleFactor;
+    qreal m_width;
+    qreal m_height;
+    qreal m_rotaionAngle;
+    qreal m_opacityValue;
+    int m_nodetag;
+    bool m_isTouchEnabled;
 
 };
 

Srcs/sequence.cpp

 
     if (actionItem != NULL) {
         Sequence* newSeq = new Sequence;
-        newSeq->actionList.append(actionItem);
+        newSeq->m_actionList.append(actionItem);
         Action* addAction;
         va_list list;
         va_start(list,actionItem);
         addAction = va_arg(list, Action*);
         while (addAction != NULL) {
-        newSeq->actionList.append(addAction);
+        newSeq->m_actionList.append(addAction);
         addAction = va_arg(list, Action*);
         }
         va_end(list);
 }
 
 void Sequence::setTarget(Node *target) {
-    targetNode = target;
+    m_targetNode = target;
     runNextAction();
 }
 
 }
 
 void Sequence::runNextAction() {
-    if (!actionList.isEmpty()) {
-        Action* nextAction = actionList.takeFirst();
+    if (!m_actionList.isEmpty()) {
+        Action* nextAction = m_actionList.takeFirst();
         connect(nextAction,SIGNAL(animationFinished(Action*)),this,SLOT(oneActionisDone()));
-        targetNode->runAction(nextAction);
+        m_targetNode->runAction(nextAction);
     }
     else {
         delete this;
     static Sequence* sequenceWithActions(Action* Action,...);
     void setTarget(Node *target);
 
-signals:
-
 public slots:
     void oneActionisDone();
+
 private:
     explicit Sequence();
-    QList <Action*> actionList;
-    Node *targetNode;
     void runNextAction();
 
+private:
+    QList <Action*> m_actionList;
+    Node *m_targetNode;
+
+
 };
 
 #endif // SEQUENCE_H
 public:
     static Sprite* spriteWithImage(const char* filename);
     ~Sprite();
+
 private:
     Sprite(const QString &filename);
     SpriteItem* item;
     void setGraphicsItem(QGraphicsItem* item) { return;}
     void setW(qreal w) {}
     void setH(qreal h) {}
-    QPointF transformPoint;
+
+private:
+    QPointF m_transformPoint;
 };
 
 #endif // SPRITE_H

Srcs/spriteitem.cpp

 #include <QTransform>
 
 SpriteItem::SpriteItem(const QString &filename,bool button,const QString &clickedFileName) {
-    bool load = QPixmapCache::find(filename,&normal);
+    bool load = QPixmapCache::find(filename,&m_normal);
     if (!load) {
-        load = normal.load(filename);
+        load = m_normal.load(filename);
         if (load) {
-            QPixmapCache::insert(filename,normal);
+            QPixmapCache::insert(filename,m_normal);
         } else {
             qDebug() << "Game Engine :: File \"" << filename << "\" is not successfuly loaded, make sure file exists";
         }
     if (button) {
         if (clickedFileName == "") {
             if (load) {
-                clicked.load(filename);
-                clicked.setMask(clicked.createMaskFromColor(QColor(0,0,0,100)));
+                m_clicked.load(filename);
+                m_clicked.setMask(m_clicked.createMaskFromColor(QColor(0,0,0,100)));
             }
         }
         else {
-            bool load = QPixmapCache::find(clickedFileName,&clicked);
+            bool load = QPixmapCache::find(clickedFileName,&m_clicked);
             if (!load) {
-                load = clicked.load(clickedFileName);
+                load = m_clicked.load(clickedFileName);
                 if (load) {
-                    QPixmapCache::insert(clickedFileName,clicked);
+                    QPixmapCache::insert(clickedFileName,m_clicked);
                 } else {
                     qDebug() << "Game Engine :: File \"" << clickedFileName << "\" is not successfuly loaded, make sure file exists";
                 }
             }
         }
     }
-    setPixmap(normal);
+    setPixmap(m_normal);
     setTransformationMode(Qt::SmoothTransformation);
-    parentMenuItem = 0;
+    m_parentMenuItem = 0;
     setFlag(QGraphicsItem::ItemSendsGeometryChanges,0);
     setFlag(QGraphicsItem::ItemIsMovable,0);
     setFlag(QGraphicsItem::ItemIsSelectable,0);
 
 
 void SpriteItem::setParent(MenuItem *parent) {
-    parentMenuItem = parent;
+    m_parentMenuItem = parent;
 }
 

Srcs/spriteitem.h

     ~SpriteItem();
     qreal width();
     qreal height();
-    void setClickedImage(){ setPixmap(clicked);}
-    void setNormalImage(){ setPixmap(normal); }
+    void setClickedImage(){ setPixmap(m_clicked);}
+    void setNormalImage(){ setPixmap(m_normal); }
     void setParent(MenuItem* parent);
-protected:
 
 private:
-    MenuItem *parentMenuItem;
-    QPixmap normal;
-    QPixmap clicked;
+    MenuItem *m_parentMenuItem;
+    QPixmap m_normal;
+    QPixmap m_clicked;
 
 };
 

Srcs/transitionscene.cpp

 #include "transitionscene.h"
 
 
-transitionScene::transitionScene() {
+TransitionScene::TransitionScene() {
 
 }
 
-transitionScene * transitionScene::FadeTransition(Scene *otherScene,float duration) {
-    transitionScene* newTrans = new transitionScene;
-    newTrans->nextScene = otherScene;
+TransitionScene * TransitionScene::FadeTransition(Scene *otherScene,float duration) {
+    TransitionScene* newTrans = new TransitionScene;
+    newTrans->m_nextScene = otherScene;
     otherScene->mainLayer->onEnterTransitionDidStart();
-    newTrans->dur = duration;
-    newTrans->origFade = newTrans->nextScene->opacity();
-    newTrans->nextScene->setOpacity(0);
+    newTrans->m_dur = duration;
+    newTrans->m_origFade = newTrans->m_nextScene->opacity();
+    newTrans->m_nextScene->setOpacity(0);
     connect(newTrans,SIGNAL(transitionDoneSignal(Scene*)),Director::sharedDirector(),SLOT(transitionDone(Scene*)));
     return newTrans;
 }
 
-void transitionScene::setCurrScene(Scene *scene) {
-    currScene = scene;
-    currScene->mainLayer->onExitTransitionDidStart();
-    Action* firststep = Action::fadeTo(dur/2,0);
+void TransitionScene::setCurrScene(Scene *scene) {
+    m_currScene = scene;
+    m_currScene->mainLayer->onExitTransitionDidStart();
+    Action* firststep = Action::fadeTo(m_dur/2,0);
     Action* gotostep2 = Action::FuncCall(this,SLOT(FadeTransition_half_done()));
     scene->runSequence(Sequence::sequenceWithActions(firststep,gotostep2,NULL));
 }
 
-void transitionScene::FadeTransition_half_done() {
-    Action* firststep = Action::fadeTo(dur/2,origFade);
+void TransitionScene::FadeTransition_half_done() {
+    Action* firststep = Action::fadeTo(m_dur/2,m_origFade);
     Action* gotostep3 = Action::FuncCall(this,SLOT(transition_done()));
-    nextScene->runSequence(Sequence::sequenceWithActions(firststep,gotostep3,NULL));
+    m_nextScene->runSequence(Sequence::sequenceWithActions(firststep,gotostep3,NULL));
 }
-void transitionScene::transition_done() {
-    currScene->mainLayer->onExitTransitionDidFinish();
-    nextScene->mainLayer->onEnterTransitionDidFinish();
-    emit transitionDoneSignal(nextScene);
+void TransitionScene::transition_done() {
+    m_currScene->mainLayer->onExitTransitionDidFinish();
+    m_nextScene->mainLayer->onEnterTransitionDidFinish();
+    emit transitionDoneSignal(m_nextScene);
     deleteLater();
 }

Srcs/transitionscene.h

 #include "action.h"
 #include "sequence.h"
 
-class transitionScene : public QObject
+class TransitionScene : public QObject
 {
     Q_OBJECT
 
 public:
-    static transitionScene* FadeTransition(Scene* otherScene,float duration);
+    static TransitionScene* FadeTransition(Scene* otherScene,float duration);
     void setCurrScene(Scene* scene);
-private:
-    transitionScene();
-    Scene* currScene;
-    Scene* nextScene;
-    float dur;
-    qreal origFade;
+
+signals:
+    void transitionDoneSignal(Scene* scene);
+
 public slots:
     void FadeTransition_half_done();
     void transition_done();
-signals:
-    void transitionDoneSignal(Scene* scene);
 
+private:
+    TransitionScene();
+
+private:
+    Scene* m_currScene;
+    Scene* m_nextScene;
+    float m_dur;
+    qreal m_origFade;
 };
 
 #endif // TRANSITIONSCENE_H
+#include "view.h"
+
+View::View(QRect deskSize)
+{
+    m_winSize = deskSize;
+}
+
+void View::paintEvent(QPaintEvent *)
+{
+//    QPaintEvent *newEvent=new QPaintEvent(event->region().boundingRect());
+    QPaintEvent *newEvent=new QPaintEvent(m_winSize);
+    QGraphicsView::paintEvent(newEvent);
+    delete newEvent;
+}
+#ifndef VIEW_H
+#define VIEW_H
+
+#include <QGraphicsView>
+#include <QPaintEvent>
+
+class View :public QGraphicsView
+{
+    Q_OBJECT
+public:
+    View(QRect deskSize);
+
+protected:
+    void paintEvent ( QPaintEvent * event );
+
+private:
+    QRect m_winSize;
+};
+
+#endif // VIEW_H
 
 int main(int argc, char *argv[])
 {
+#ifdef useOpenGL
+//    QApplication::setGraphicsSystem("opengl");
+#else
     QApplication::setGraphicsSystem("raster");
+#endif
     QApplication app(argc, argv);
 
     FileUtils::shareFileUtils()->setResourceDirectory("resource");
 
     //set up audio playback
     AudioManager::setUpAudioManager();
+
     //here is the second main_menu to change
     Director::sharedDirector()->startWithScene(MainMenu::scene());
+
     return app.exec();
 }
 {
     qDebug() << Q_FUNC_INFO;
     //taking screen size, saving it to variable called winSize
-    winSize = Director::sharedDirector()->winSizeInPixels();
+    m_winSize = Director::sharedDirector()->winSizeInPixels();
 
     //we'll start by adding a sprite that represents the background for the menu
-    background = Sprite::spriteWithImage("wallpaper.jpg");
-    background->setPos(winSize.width()/2,winSize.height()/2);
-    addChild(background);
+    m_background = Sprite::spriteWithImage("wallpaper.jpg");
+    m_background->setPos(m_winSize.width()/2,m_winSize.height()/2);
+    addChild(m_background);
     QString fileName;
     QString temp;
     Sprite *newCard;
         temp = QString().setNum(i);
         temp.append(fileName);
         newCard = Sprite::spriteWithImage(temp.toAscii());
-        cards.append(newCard);
+        m_cards.append(newCard);
         newCard->setPos(offset,offset);
         addChild(newCard);
     }
         temp = QString().setNum(i);
         temp.append(fileName);
         newCard = Sprite::spriteWithImage(temp.toAscii());
-        cards.append(newCard);
+        m_cards.append(newCard);
         newCard->setPos(offset,offset);
         addChild(newCard);
     }
         temp = QString().setNum(i);
         temp.append(fileName);
         newCard = Sprite::spriteWithImage(temp.toAscii());
-        cards.append(newCard);
+        m_cards.append(newCard);
         newCard->setPos(offset,offset);
         addChild(newCard);
     }
         temp = QString().setNum(i);
         temp.append(fileName);
         newCard = Sprite::spriteWithImage(temp.toAscii());
-        cards.append(newCard);
+        m_cards.append(newCard);
         newCard->setPos(offset,offset);
         addChild(newCard);
     }
-    counter = 0;
+    m_counter = 0;
     animation();
 }
 
 void MainMenu::animation() {
-    if (counter < cards.size()) {
-        cards.at(counter)->runSequence(Sequence::sequenceWithActions(Action::easeinout(Action::moveBy(0.5,300,200)),Action::FuncCall(this,SLOT(animation())),NULL));
-        cards.at(counter)->runAction(Action::easeinout(Action::rotateBy(0.5,360)));
+    if (m_counter < m_cards.size()) {
+        m_cards.at(m_counter)->runSequence(Sequence::sequenceWithActions(Action::easeinout(Action::moveBy(0.5,300,200)),Action::FuncCall(this,SLOT(animation())),NULL));
+        m_cards.at(m_counter)->runAction(Action::easeinout(Action::rotateBy(0.5,360)));
         AudioManager::playSound("alert.wav");
         AudioManager::playSound("play_card.wav");
-        counter++;
+        m_counter++;
     }
 }
 
     void onEnterTransitionDidFinish();
     void onExitTransitionDidStart();
     void onExitTransitionDidFinish();
-private:
-    QRect winSize;
-    qreal backGroundHeight;
-    Sprite *background;
-    QList<Sprite*> cards;
-    int counter;
+
 public slots:
     void update(double delta);
     void animation();
+
+private:
+    QRect m_winSize;
+    qreal m_backGroundHeight;
+    Sprite *m_background;
+    QList<Sprite*> m_cards;
+    int m_counter;
 };
 
 #endif // MAIN_MENU_H