Skip to content

Commit

Permalink
Flatten include trees
Browse files Browse the repository at this point in the history
  • Loading branch information
LBPHacker committed Apr 20, 2019
1 parent 711453a commit 0179cef
Show file tree
Hide file tree
Showing 400 changed files with 1,619 additions and 1,117 deletions.
5 changes: 3 additions & 2 deletions generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def generateElements(elementFiles, outputCpp, outputH):
#include <vector>
#include "simulation/Element.h"
#include "simulation/SimulationData.h"
#include "simulation/elements/Element.h"
"""
Expand Down Expand Up @@ -106,7 +106,8 @@ class {0}: public {1}
#endif
"""

elementContent = """#include "ElementClasses.h"
elementContent = """#include "simulation/ElementDefs.h"
#include "ElementClasses.h"
std::vector<Element> GetElements()
{
Expand Down
5 changes: 3 additions & 2 deletions src/Format.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#include "Format.h"

#include <ctime>
#include "common/String.h"
#include <stdexcept>
#include <iostream>
#include <iterator>
#include <cstring>
#include <zlib.h>
#include <cstdio>
#include "Format.h"

#include "graphics/Graphics.h"

ByteString format::URLEncode(ByteString source)
Expand Down
11 changes: 6 additions & 5 deletions src/Misc.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#include <cstdio>
#include <cstdlib>
#include "Misc.h"

#include "Config.h"
#include "icondoc.h"

#include <cstring>
#include <sys/types.h>
#include <cmath>
#include "Config.h"
#include "Misc.h"
#include "icondoc.h"

#include "common/tpt-minmax.h"

//Signum function
Expand Down
4 changes: 3 additions & 1 deletion src/Platform.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "Platform.h"

#include <cstdlib>
#include <cstring>
#include <cstdio>
Expand All @@ -15,7 +17,7 @@
#ifdef MACOSX
#include <mach-o/dyld.h>
#endif
#include "Platform.h"

#include "Misc.h"

namespace Platform
Expand Down
2 changes: 2 additions & 0 deletions src/PowderToy.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include "common/String.h"

void EngineProcess();
void ClipboardPush(ByteString text);
ByteString ClipboardPull();
Expand Down
5 changes: 3 additions & 2 deletions src/PowderToyRenderer.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#if defined(RENDERER)

#include "graphics/Graphics.h"
#include "graphics/Renderer.h"

#include <ctime>
#include <iostream>
#include <fstream>
Expand All @@ -9,8 +12,6 @@
#include "Config.h"
#include "Format.h"
#include "gui/interface/Engine.h"
#include "graphics/Graphics.h"
#include "graphics/Renderer.h"

#include "client/GameSave.h"
#include "simulation/Simulation.h"
Expand Down
11 changes: 5 additions & 6 deletions src/PowderToySDL.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#ifndef RENDERER

#include <map>
#include "common/String.h"
#include <ctime>
#include <climits>
#ifdef WIN
Expand All @@ -18,7 +17,6 @@

#include <iostream>
#include "Config.h"
#include "graphics/Graphics.h"
#if defined(LIN)
#include "icon.h"
#endif
Expand All @@ -34,22 +32,23 @@
#endif

#include "Format.h"
#include "Misc.h"

#include "graphics/Graphics.h"

#include "client/SaveInfo.h"
#include "client/GameSave.h"
#include "client/SaveFile.h"
#include "simulation/SaveRenderer.h"
#include "client/Client.h"
#include "Misc.h"

#include "gui/game/GameController.h"
#include "gui/game/GameView.h"

#include "gui/font/FontEditor.h"

#include "gui/dialogues/ErrorMessage.h"
#include "gui/dialogues/ConfirmPrompt.h"
#include "gui/interface/Keys.h"
#include "gui/Style.h"
#include "gui/interface/Engine.h"

using namespace std;

Expand Down
3 changes: 2 additions & 1 deletion src/Probability.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "Probability.h"

#include <numeric>
#include <cstdlib>
#include "Probability.h"
#include "common/tpt-rand.h"

namespace Probability
Expand Down
3 changes: 2 additions & 1 deletion src/Update.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "Update.h"

#include <cstdio>
#include <cstdlib>
#ifndef WIN
Expand All @@ -21,7 +23,6 @@
#include <errno.h>
#endif

#include "Update.h"
#include "Platform.h"

// returns 1 on failure, 0 on success
Expand Down
19 changes: 9 additions & 10 deletions src/client/Client.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#include "Client.h"

#include <cstdlib>
#include <iostream>
#include <vector>
#include <map>
#include <iostream>
#include <iomanip>
#include <ctime>
#include <cstdio>
#include <deque>
#include <fstream>
#include <dirent.h>

Expand All @@ -28,25 +29,23 @@
#include "common/String.h"
#include "Config.h"
#include "Format.h"
#include "Client.h"
#include "MD5.h"
#include "graphics/Graphics.h"
#include "Misc.h"
#include "Platform.h"
#include "Update.h"

#include "simulation/SaveRenderer.h"
#include "gui/interface/Point.h"
#include "ClientListener.h"

#include "graphics/Graphics.h"

#include "gui/preview/Comment.h"

#include "client/SaveInfo.h"
#include "client/SaveFile.h"
#include "client/GameSave.h"
#include "client/UserInfo.h"
#include "gui/preview/Comment.h"
#include "ClientListener.h"
#include "client/http/Request.h"
#include "client/http/RequestManager.h"

#include "json/json.h"

extern "C"
{
Expand Down
6 changes: 1 addition & 5 deletions src/client/Client.h
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
#ifndef CLIENT_H
#define CLIENT_H

#include <queue>
#include <vector>
#include <list>

#include "common/String.h"
#include "Config.h"
#include "common/Singleton.h"
#include "json/json.h"

#include "User.h"
#include "UserInfo.h"

#include "json/json.h"

class SaveInfo;
class SaveFile;
Expand Down
2 changes: 2 additions & 0 deletions src/client/ClientListener.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef CLIENTLISTENER_H_
#define CLIENTLISTENER_H_

#include "common/String.h"

class Client;
class ClientListener
{
Expand Down
28 changes: 23 additions & 5 deletions src/client/GameSave.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
#include "common/tpt-minmax.h"
#include "GameSave.h"

#include <iostream>
#include <cmath>
#include <climits>
#include <memory>
#include <vector>
#include <set>
#include <bzlib.h>
#include <cmath>

#include "Config.h"
#include "Format.h"
#include "GameSave.h"
#include "simulation/SimulationData.h"
#include "ElementClasses.h"
#include "hmap.h"

#include "simulation/Simulation.h"
#include "ElementClasses.h"

GameSave::GameSave(GameSave & save):
majorVersion(save.majorVersion),
waterEEnabled(save.waterEEnabled),
Expand Down Expand Up @@ -2785,3 +2787,19 @@ GameSave::~GameSave()
{
dealloc();
}

GameSave& GameSave::operator << (Particle &v)
{
if(particlesCount<NPART && v.type)
{
particles[particlesCount++] = v;
}
return *this;
}

GameSave& GameSave::operator << (sign &v)
{
if(signs.size()<MAXSIGNS && v.text.length())
signs.push_back(v);
return *this;
}
22 changes: 4 additions & 18 deletions src/client/GameSave.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@

#include "bson/BSON.h"
#include "json/json.h"
#include "simulation/Sign.h"
#include "simulation/Particle.h"

//using namespace std;
struct sign;
struct Particle;

struct ParseException: public std::exception {
enum ParseResult { OK = 0, Corrupt, WrongVersion, InvalidDimensions, InternalError, MissingElement };
Expand Down Expand Up @@ -134,21 +133,8 @@ class GameSave
static bool TypeInTmp(int type);
static bool TypeInTmp2(int type, int tmp2);

inline GameSave& operator << (Particle v)
{
if(particlesCount<NPART && v.type)
{
particles[particlesCount++] = v;
}
return *this;
}

inline GameSave& operator << (sign v)
{
if(signs.size()<MAXSIGNS && v.text.length())
signs.push_back(v);
return *this;
}
GameSave& operator << (Particle &v);
GameSave& operator << (sign &v);

private:
bool expanded;
Expand Down
1 change: 0 additions & 1 deletion src/client/SaveFile.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include "SaveFile.h"
#include "GameSave.h"
#include "Client.h"

SaveFile::SaveFile(SaveFile & save):
gameSave(NULL),
Expand Down
1 change: 0 additions & 1 deletion src/client/SaveInfo.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include "SaveInfo.h"
#include "GameSave.h"
#include "Client.h"

SaveInfo::SaveInfo(SaveInfo & save):
id(save.id),
Expand Down
3 changes: 0 additions & 3 deletions src/client/SaveInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
#define SAVE_H

#include <list>
#include <vector>
#include "common/String.h"
#include <cstdlib>
#include <iostream>

#ifdef GetUserName
# undef GetUserName // dammit windows
Expand Down
1 change: 1 addition & 0 deletions src/client/http/AvatarRequest.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "AvatarRequest.h"

#include "Config.h"

namespace http
Expand Down
1 change: 0 additions & 1 deletion src/client/http/AvatarRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define AVATARREQUEST2_H

#include "ImageRequest.h"
#include "common/String.h"

namespace http
{
Expand Down
3 changes: 3 additions & 0 deletions src/client/http/GetUserInfoRequest.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#include "GetUserInfoRequest.h"

#include "Config.h"
#include "client/UserInfo.h"

namespace http
{
GetUserInfoRequest::GetUserInfoRequest(ByteString username) :
Expand Down
7 changes: 1 addition & 6 deletions src/client/http/GetUserInfoRequest.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
#ifndef GETUSERINFOREQUEST2_H
#define GETUSERINFOREQUEST2_H

#include "Request.h"
#include "common/String.h"
#include "json/json.h"
#include "client/Client.h"
#include "APIRequest.h"

#include <memory>
#include <map>
class UserInfo;

namespace http
{
Expand Down
1 change: 1 addition & 0 deletions src/client/http/ImageRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <memory>

class VideoBuffer;

namespace http
{
class ImageRequest : public Request
Expand Down
Loading

0 comments on commit 0179cef

Please sign in to comment.