Commit 4ec80524 authored by Gerhard Stein's avatar Gerhard Stein

Merge branch 'master' into testing

parents c8c43e1a e2c5ae36
......@@ -293,8 +293,9 @@ How to compile it under Fedora:
older):
dnf install -y \
SDL2-devel boost-devel libogg-devel gcc-c++ cmake libvorbis-devel \
SDL2_image-devel mesa-libGL-devel libcurl-devel cmake-data
SDL2-devel cmake cmake-data gcc-c++ python3-devel \
boost-devel mesa-libGL-devel libogg-devel libvorbis-devel libcurl-devel \
SDL2_image-devel SDL2_mixer-devel
* Extract my source code into the "CGeniusSrc" directory.
* cd CGeniusSrc
......
......@@ -22,35 +22,30 @@ void CGameLauncher::verifyGameStore()
std::vector< std::string > missingList;
// Try to download the catalogue file
gameDownloader.downloadCatalogue();
// First try
gameDownloader.checkForMissingGames( missingList );
if(!gameDownloader.hasCatalog())
{
// Try to download the catalogue file
if(gameDownloader.downloadCatalogue())
{
gameDownloader.checkForMissingGames( missingList );
}
if(!gameDownloader.hasCatalog())
{
std::stringstream ss;
const auto cataFile = gameDownloader.catalogFName();
const auto searchPath = GetFirstSearchPath();
ss << "You seem not to have a game catalog.\n";
ss << "The file is called " << "\"" << cataFile << "\" \n";
ss << "You might want to download \n";
ss << "and copy one into:\n";
ss << "\"" << searchPath << "\".\n";
ss << "\"+ More\" button is disabled...\n";
std::string msg(ss.str());
showMessageBox(msg);
}
{
std::stringstream ss;
const auto cataFile = gameDownloader.catalogFName();
const auto searchPath = GetFirstSearchPath();
ss << "You seem not to have a game catalog.\n";
ss << "The file is called " << "\"" << cataFile << "\" \n";
ss << "You might want to download \n";
ss << "and copy one into:\n";
ss << "\"" << searchPath << "\".\n";
ss << "\"+ More\" button is disabled...\n";
std::string msg(ss.str());
showMessageBox(msg);
}
......
......@@ -7,7 +7,6 @@
#include <cstdio>
#include <curl/curl.h>
#include <SDL_image.h>
#include <fileio/KeenFiles.h>
#include <boost/property_tree/ptree.hpp>
......@@ -180,7 +179,6 @@ int downloadFile(const std::string &filename, int &progress,
}
bool GameDownloader::readGamesNode(boost::property_tree::ptree &pt)
{
try
......@@ -265,6 +263,9 @@ bool GameDownloader::readLegacyCatalogue(boost::property_tree::ptree &pt)
return true;
}
bool GameDownloader::loadCatalogue(const std::string &catalogueFile)
{
// Create an empty property tree object
......@@ -310,7 +311,7 @@ bool GameDownloader::downloadCatalogue()
}
bool GameDownloader::checkForMissingGames( std::vector< std::string > &missingList )
{
{
// Load game catalogue
if( !loadCatalogue(mCatalogFName) )
{
......@@ -358,7 +359,6 @@ bool GameDownloader::checkForMissingGames( std::vector< std::string > &missingLi
mCataFound = true;
}
if(!mCataFound)
{
gLogging.ftextOut("Sorry, the catalogue file \"%s\" was not found <br>", mCatalogFName.c_str() );
......
......@@ -2487,7 +2487,13 @@ void CPlayerLevel::processShootWhileStanding()
{
if( getActionNumber(A_KEEN_SHOOT) && !getActionStatus(A_KEEN_SHOOT) )
{
const int newx = getXPosition();
int newx = getXPosition();
if(xDirection > 0)
newx = getXRightPos();
else
newx = getXLeftPos()-(1<<CSF);
const int newy = getYPosition()+(6<<STC);
const Vector2D<int> newVec(newx, newy);
tryToShoot(newVec, xDirection, yDirection);
......
......@@ -17,7 +17,7 @@ const int A_WORMMOUTH_LOOK = 1;
const int A_WORMMOUTH_EAT = 9;
const int A_WORMMOUTH_STUNNED = 14;
const int DIST_TO_EAT_X = (1<<CSF)/2;
const int DIST_TO_EAT_X = (2<<CSF);
const int DIST_TO_EAT_Y = 2<<CSF;
const int LOOK_TIMER = 10;
......@@ -80,24 +80,24 @@ bool CWormmouth::isNearby(CSpriteObject &theObject)
const int wormmouthY = getYMidPos();
if( getActionNumber(A_WORMMOUTH_LOOK) )
{
if( playerX < wormmouthX && xDirection != LEFT )
mTurnAround = true;
else if( playerX > wormmouthX && xDirection != RIGHT )
mTurnAround = true;
}
{
if( playerX < wormmouthX && xDirection != LEFT )
mTurnAround = true;
else if( playerX > wormmouthX && xDirection != RIGHT )
mTurnAround = true;
}
const int diffX = playerX - wormmouthX;
const int diffY = playerY - wormmouthY;
if( abs(diffX) < DIST_TO_EAT_X &&
abs(diffY) < DIST_TO_EAT_Y &&
!getActionNumber(A_WORMMOUTH_EAT) )
{
setAction(A_WORMMOUTH_EAT);
playSound( SOUND_WORMOUTH_STRIKE );
}
abs(diffY) < DIST_TO_EAT_Y &&
!getActionNumber(A_WORMMOUTH_EAT) )
{
setAction(A_WORMMOUTH_EAT);
playSound( SOUND_WORMOUTH_STRIKE );
}
}
}
return true;
}
......@@ -107,33 +107,35 @@ bool CWormmouth::isNearby(CSpriteObject &theObject)
void CWormmouth::getTouchedBy(CSpriteObject &theObject)
{
if(mIsDead || theObject.mIsDead )
return;
CStunnable::getTouchedBy(theObject);
// Was it a bullet? Than make it stunned.
if( dynamic_cast<CBullet*>(&theObject) )
if(mIsDead || theObject.mIsDead )
return;
CStunnable::getTouchedBy(theObject);
// Was it a bullet? Than make it stunned.
if( dynamic_cast<CBullet*>(&theObject) )
{
setAction( A_WORMMOUTH_STUNNED );
mIsDead = true;
theObject.mIsDead = true;
if(!processActionRoutine())
exists = false;
performCollisions();
processGettingStunned();
setAction( A_WORMMOUTH_STUNNED );
mIsDead = true;
theObject.mIsDead = true;
if(!processActionRoutine())
exists = false;
performCollisions();
processGettingStunned();
}
if( !getActionNumber(A_WORMMOUTH_EAT) )
return;
if( CPlayerBase *player = dynamic_cast<CPlayerBase*>(&theObject) )
if( !getActionNumber(A_WORMMOUTH_EAT) )
return;
if( CPlayerBase *player = dynamic_cast<CPlayerBase*>(&theObject) )
{
player->kill();
player->kill();
}
}
......
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