Renamed addons.?pp to addons_manager.?pp.

NOTE: make distclean is most likely necessary on linux!!!!


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@7138 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk
2010-12-22 06:00:58 +00:00
parent 47a7f77b33
commit 29e29c7bb7
10 changed files with 61 additions and 60 deletions

View File

@@ -12,6 +12,12 @@ supertuxkart_SOURCES = \
main.cpp \
main_loop.cpp \
main_loop.hpp \
addons/network.cpp \
addons/network.hpp \
addons/addons.cpp \
addons/addons.hpp \
addons/zip.cpp \
addons/zip.hpp \
animations/animation_base.hpp \
animations/animation_base.cpp \
animations/billboard_animation.cpp \
@@ -393,13 +399,7 @@ supertuxkart_SOURCES = \
utils/translation.cpp \
utils/translation.hpp \
utils/vec3.cpp \
utils/vec3.hpp \
addons/network.cpp \
addons/network.hpp \
addons/addons.cpp \
addons/addons.hpp \
addons/zip.cpp \
addons/zip.hpp
utils/vec3.hpp
# Link in the specific gcc 4.1 bug work around
supertuxkart_LDADD = \

View File

@@ -19,30 +19,31 @@
*/
#ifdef ADDONS_MANAGER
#include <string.h>
#include <map>
#include <vector>
#include <iostream>
#include "addons/addons.hpp"
#include "irrXML.h"
#include "addons/network.hpp"
#include "addons/zip.hpp"
#include "addons/addons_manager.hpp"
#include <fstream>
#include <iostream>
#include <map>
#include <sstream>
#include "io/file_manager.hpp"
#include <string.h>
#include <vector>
#include "irrXML.h"
#include "addons/network.hpp"
#include "addons/zip.hpp"
#include "io/file_manager.hpp"
#include "karts/kart_properties_manager.hpp"
#include "tracks/track_manager.hpp"
#include "states_screens/kart_selection.hpp"
#include "tracks/track_manager.hpp"
using namespace irr; /* irrXML which is used to read (not write) xml file,
is located in the namespace irr::io.*/
using namespace io;
Addons* addons_manager = 0;
AddonsManager* addons_manager = 0;
// ----------------------------------------------------------------------------
Addons::Addons()
AddonsManager::AddonsManager()
{
m_index = -1;
int download_state = 0;
@@ -116,12 +117,12 @@ Addons::Addons()
getInstalledAddons();
}
// ----------------------------------------------------------------------------
void Addons::resetIndex()
void AddonsManager::resetIndex()
{
m_index = -1;
}
// ----------------------------------------------------------------------------
void Addons::getInstalledAddons()
void AddonsManager::getInstalledAddons()
{
std::string attribute_name;
int old_index = m_index;
@@ -191,7 +192,7 @@ void Addons::getInstalledAddons()
// ----------------------------------------------------------------------------
bool Addons::next()
bool AddonsManager::next()
{
if(m_index + 1 < (int)m_addons_list.size())
{
@@ -203,7 +204,7 @@ bool Addons::next()
} // next
// ----------------------------------------------------------------------------
bool Addons::nextType(std::string type)
bool AddonsManager::nextType(std::string type)
{
while(next())
{
@@ -219,7 +220,7 @@ bool Addons::nextType(std::string type)
} // nextType
// ----------------------------------------------------------------------------
bool Addons::previous()
bool AddonsManager::previous()
{
if(m_index - 1 > 0)
{
@@ -231,7 +232,7 @@ bool Addons::previous()
} // previous
// ----------------------------------------------------------------------------
bool Addons::previousType(std::string type)
bool AddonsManager::previousType(std::string type)
{
while(previous())
{
@@ -247,7 +248,7 @@ bool Addons::previousType(std::string type)
} // previousType
// ----------------------------------------------------------------------------
bool Addons::select(std::string name)
bool AddonsManager::select(std::string name)
{
//the unsigned is to remove the compiler warnings, maybe it is a bad idea ?
for(unsigned int i = 0; i < m_addons_list.size(); i++)
@@ -262,7 +263,7 @@ bool Addons::select(std::string name)
} // select
// ----------------------------------------------------------------------------
bool Addons::selectId(std::string id)
bool AddonsManager::selectId(std::string id)
{
//the unsigned is to remove the compiler warnings, maybe it is a bad idea ?
for(unsigned int i = 0; i < m_addons_list.size(); i++)
@@ -278,13 +279,13 @@ bool Addons::selectId(std::string id)
// ----------------------------------------------------------------------------
/* FIXME : remove this function */
addons_prop Addons::getAddons()
addons_prop AddonsManager::getAddons()
{
return m_addons_list[m_index];
} // getAddons
// ----------------------------------------------------------------------------
std::string Addons::getVersionAsStr() const
std::string AddonsManager::getVersionAsStr() const
{
std::ostringstream os;
os << m_addons_list[m_index].version;
@@ -292,7 +293,7 @@ std::string Addons::getVersionAsStr() const
} // getVersionAsStr
// ----------------------------------------------------------------------------
std::string Addons::getIdAsStr() const
std::string AddonsManager::getIdAsStr() const
{
std::ostringstream os;
os << m_addons_list[m_index].id;
@@ -300,7 +301,7 @@ std::string Addons::getIdAsStr() const
} // getIdAsStr
// ----------------------------------------------------------------------------
int Addons::getInstalledVersion() const
int AddonsManager::getInstalledVersion() const
{
if(m_addons_list[m_index].installed)
return m_addons_list[m_index].installed_version;
@@ -308,7 +309,7 @@ int Addons::getInstalledVersion() const
} // getInstalledVersion
// ----------------------------------------------------------------------------
std::string Addons::getInstalledVersionAsStr() const
std::string AddonsManager::getInstalledVersionAsStr() const
{
if(m_addons_list[m_index].installed)
{
@@ -320,7 +321,7 @@ std::string Addons::getInstalledVersionAsStr() const
} // getInstalledVersionAsStr
// ----------------------------------------------------------------------------
void Addons::install()
void AddonsManager::install()
{
//download of the addons file
@@ -371,7 +372,7 @@ void Addons::install()
} // install
// ----------------------------------------------------------------------------
void Addons::saveInstalled()
void AddonsManager::saveInstalled()
{
//Put the addons in the xml file
//Manually because the irrlicht xml writer doesn't seem finished, FIXME ?
@@ -403,7 +404,7 @@ void Addons::saveInstalled()
} // saveInstalled
// ----------------------------------------------------------------------------
void Addons::uninstall()
void AddonsManager::uninstall()
{
std::cout << "[Addons] Uninstalling <" << m_addons_list[m_index].name << ">\n";
@@ -420,7 +421,7 @@ void Addons::uninstall()
} // uninstall
// ----------------------------------------------------------------------------
int Addons::getDownloadState()
int AddonsManager::getDownloadState()
{
pthread_mutex_lock(&download_mutex);
int value = m_download_state;
@@ -430,7 +431,7 @@ int Addons::getDownloadState()
// ----------------------------------------------------------------------------
std::string Addons::getDownloadStateAsStr() const
std::string AddonsManager::getDownloadStateAsStr() const
{
pthread_mutex_lock(&m_str_mutex);
std::string value = m_str_state;
@@ -440,7 +441,7 @@ std::string Addons::getDownloadStateAsStr() const
// ----------------------------------------------------------------------------
bool Addons::needUpdate() const
bool AddonsManager::needUpdate() const
{
return getInstalledVersion() < getVersion();
} // needUpdate

View File

@@ -1,5 +1,5 @@
// SuperTuxKart - a fun racing game with go-kart
// Copyright (C) 2010 Lucas Baudin
// Copyright (C) 2010 Lucas Baudin, Joerg Henrichs
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
@@ -17,8 +17,8 @@
#ifdef ADDONS_MANAGER
#ifndef HEADER_ADDONS_HPP
#define HEADER_ADDONS_HPP
#ifndef HEADER_ADDONS_MANAGER_HPP
#define HEADER_ADDONS_MANAGER_HPP
#include <string>
#include <map>
@@ -37,7 +37,7 @@ struct addons_prop
bool installed;
std::string type;
};
class Addons
class AddonsManager
{
private:
std::vector<addons_prop> m_addons_list;
@@ -50,7 +50,7 @@ class Addons
mutable pthread_mutex_t m_str_mutex;
std::string m_str_state;
public:
Addons();
AddonsManager();
/** Select the next addons in the addons list. */
bool next();
@@ -117,6 +117,6 @@ class Addons
std::string getDownloadStateAsStr() const;
};
extern Addons *addons_manager;
extern AddonsManager *addons_manager;
#endif
#endif

View File

@@ -1103,7 +1103,7 @@
Name="addons"
>
<File
RelativePath="..\..\addons\addons.cpp"
RelativePath="..\..\addons\addons_manager.cpp"
>
</File>
<File
@@ -2017,7 +2017,7 @@
Name="addons"
>
<File
RelativePath="..\..\addons\addons.hpp"
RelativePath="..\..\addons\addons_manager.hpp"
>
</File>
<File

View File

@@ -71,7 +71,7 @@
#ifdef ADDONS_MANAGER
#include "addons/network.hpp"
#include "addons/addons.hpp"
#include "addons/addons_manager.hpp"
#endif
void cmdLineHelp (char* invocation)
@@ -576,7 +576,7 @@ void initRest()
network_manager = new NetworkManager ();
#ifdef ADDONS_MANAGER
network_http = new NetworkHttp ();
addons_manager = new Addons ();
addons_manager = new AddonsManager ();
KartPropertiesManager::addKartSearchDir(file_manager->getAddonsDir() + "/data/karts/");
track_manager->addTrackSearchDir(file_manager->getAddonsDir() + "/data/tracks/");

View File

@@ -1,5 +1,5 @@
// SuperTuxKart - a fun racing game with go-kart
// Copyright (C) 2010 Lucas Baudin
// Copyright (C) 2010 Lucas Baudin, Joerg Henrichs
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
@@ -24,7 +24,7 @@
#include "irrlicht.h"
#include "addons/addons.hpp"
#include "addons/addons_manager.hpp"
#include "addons/network.hpp"
#include "guiengine/widget.hpp"
#include "guiengine/widgets/ribbon_widget.hpp"

View File

@@ -1,5 +1,5 @@
// SuperTuxKart - a fun racing game with go-kart
// Copyright (C) 2010 Lucas Baudin
// Copyright (C) 2010 Lucas Baudin, Joerg Henrichs
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
@@ -23,7 +23,7 @@
#include <pthread.h>
#include "irrlicht.h"
#include "addons/addons.hpp"
#include "addons/addons_manager.hpp"
#include "guiengine/screen.hpp"
#include "guiengine/widgets/label_widget.hpp"
#include "states_screens/dialogs/addons_loading.hpp"
@@ -43,7 +43,7 @@ class AddonsScreen : public GUIEngine::Screen,
friend class GUIEngine::ScreenSingleton<AddonsScreen>;
AddonsScreen();
Addons *m_addons;
AddonsManager *m_addons;
AddonsLoading *m_load;
void loadInformations();
/** For the addons list, a package when it is installed. */

View File

@@ -25,7 +25,7 @@
# include <sstream>
#include "addons/addons.hpp"
#include "addons/addons_manager.hpp"
#include "addons/network.hpp"
#include "guiengine/widget.hpp"
#include "guiengine/widgets/label_widget.hpp"

View File

@@ -1,5 +1,5 @@
// SuperTuxKart - a fun racing game with go-kart
// Copyright (C) 2009 Marianne Gagnon
// Copyright (C) 2009-2010 Marianne Gagnon, Joerg Henrichs
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
@@ -22,15 +22,15 @@
#include <pthread.h>
#include "addons/addons_manager.hpp"
#include "addons/network.hpp"
#include "guiengine/engine.hpp"
#include "guiengine/widgets.hpp"
#include "input/input_manager.hpp"
#include "utils/translation.hpp"
#include "addons/addons.hpp"
#include "addons/network.hpp"
#include "io/file_manager.hpp"
#include "states_screens/addons_screen.hpp"
#include "utils/string_utils.hpp"
#include "io/file_manager.hpp"
#include "utils/translation.hpp"
using namespace GUIEngine;
using namespace irr::gui;

View File

@@ -23,7 +23,7 @@
#include "guiengine/modaldialog.hpp"
#include "addons/addons.hpp"
#include "addons/addons_manager.hpp"
#include "guiengine/widgets.hpp"
#include <pthread.h>
class AddonsLoading : public GUIEngine::ModalDialog