Commit b437c019 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Consti'fy

parent 7be037b0
......@@ -200,7 +200,7 @@ AiSprite Ai::nextPosition(AiSprite sp,double mult)
return sp;
}
void Ai::nextPositions(AiSprite sp,QVector<AiSprite> *a,int frames)
void Ai::nextPositions(const AiSprite &sp,QVector<AiSprite> *a,int frames)
{
int i,num;
double fmult=cfg->gamespeed*frames;
......
......@@ -65,7 +65,7 @@ public:
bool layMine(){return mine;}
private:
AiSprite nextPosition(AiSprite sp,double mult);
void nextPositions(AiSprite sp,QVector<AiSprite> *a,int frames);
void nextPositions(const AiSprite &sp,QVector<AiSprite> *a,int frames);
Hit firstObject(AiSprite shot,int shotframes,int frames);
void shotScores();
void calculateNextPositions();
......
......@@ -318,7 +318,7 @@ void ConfigSetup::configSelected(int num)
}
}
void ConfigSetup::displayConfig(SConfig cfg)
void ConfigSetup::displayConfig(const SConfig &cfg)
{
setValue(EditSunEnergy,cfg.sunEnergy);
setValue(EditGravity,cfg.gravity);
......
......@@ -50,7 +50,7 @@ protected slots:
protected:
void valueChanged(int ednum,int val);
void valueChanged(int ednum,double val);
void displayConfig(SConfig cfg);
void displayConfig(const SConfig &cfg);
void setValue(int ednum,int val);
void setValue(int ednum,double val);
void setValue(int ednum,unsigned val);
......
......@@ -282,7 +282,7 @@ void MyMainView::writeConfig()
game.writeEntry("powerupEnergyAmount",customConfig.powerupEnergyAmount);
}
SConfig MyMainView::modifyConfig(SConfig conf)
SConfig MyMainView::modifyConfig(const SConfig &conf)
{
SConfig newConfig=conf;
newConfig.gamespeed*=Options::refreshTime()/33.0;
......
......@@ -73,7 +73,7 @@ protected:
void keyReleaseEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
void focusOutEvent (QFocusEvent * /*event*/) Q_DECL_OVERRIDE;
bool readSprites();
SConfig modifyConfig(SConfig conf);
SConfig modifyConfig(const SConfig &conf);
void moveShips();
void moveBullets();
void moveMines();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment