id int64 0 755k | file_name stringlengths 3 109 | file_path stringlengths 13 185 | content stringlengths 31 9.38M | size int64 31 9.38M | language stringclasses 1
value | extension stringclasses 11
values | total_lines int64 1 340k | avg_line_length float64 2.18 149k | max_line_length int64 7 2.22M | alphanum_fraction float64 0 1 | repo_name stringlengths 6 65 | repo_stars int64 100 47.3k | repo_forks int64 0 12k | repo_open_issues int64 0 3.4k | repo_license stringclasses 9
values | repo_extraction_date stringclasses 92
values | exact_duplicates_redpajama bool 2
classes | near_duplicates_redpajama bool 2
classes | exact_duplicates_githubcode bool 2
classes | exact_duplicates_stackv2 bool 1
class | exact_duplicates_stackv1 bool 2
classes | near_duplicates_githubcode bool 2
classes | near_duplicates_stackv1 bool 2
classes | near_duplicates_stackv2 bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
50,457 | PlainCommandInterface.cpp | The-Powder-Toy_The-Powder-Toy/src/lua/PlainCommandInterface.cpp | #include "CommandInterface.h"
CommandInterfacePtr CommandInterface::Create(GameController *newGameController, GameModel *newGameModel)
{
return CommandInterfacePtr(new CommandInterface(newGameController, newGameModel));
}
void CommandInterfaceDeleter::operator ()(CommandInterface *ptr) const
{
delete ptr;
}
void C... | 816 | C++ | .cpp | 34 | 22.558824 | 104 | 0.842173 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,459 | LuaProgressBar.cpp | The-Powder-Toy_The-Powder-Toy/src/lua/LuaProgressBar.cpp | #include "LuaProgressBar.h"
#include "LuaScriptInterface.h"
#include "gui/interface/ProgressBar.h"
const char LuaProgressBar::className[] = "progressBar";
#define method(class, name) {#name, &class::name}
Luna<LuaProgressBar>::RegType LuaProgressBar::methods[] = {
method(LuaProgressBar, position),
method(LuaProgres... | 1,376 | C++ | .cpp | 56 | 22.642857 | 98 | 0.728104 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | true | false |
50,460 | LuaLabel.cpp | The-Powder-Toy_The-Powder-Toy/src/lua/LuaLabel.cpp | #include "LuaScriptInterface.h"
#include "LuaLabel.h"
#include "gui/interface/Label.h"
const char LuaLabel::className[] = "label";
#define method(class, name) {#name, &class::name}
Luna<LuaLabel>::RegType LuaLabel::methods[] = {
method(LuaLabel, text),
method(LuaLabel, position),
method(LuaLabel, size),
method(Lu... | 951 | C++ | .cpp | 41 | 21.341463 | 77 | 0.690265 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | true | false |
50,461 | LuaSimulation.cpp | The-Powder-Toy_The-Powder-Toy/src/lua/LuaSimulation.cpp | #include "LuaScriptInterface.h"
#include "client/Client.h"
#include "client/GameSave.h"
#include "client/SaveFile.h"
#include "client/SaveInfo.h"
#include "Format.h"
#include "gui/game/GameController.h"
#include "gui/game/GameModel.h"
#include "gui/game/GameView.h"
#include "gui/game/Brush.h"
#include "gui/game/tool/To... | 52,009 | C++ | .cpp | 1,929 | 24.634526 | 146 | 0.66463 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,462 | LuaWindow.cpp | The-Powder-Toy_The-Powder-Toy/src/lua/LuaWindow.cpp | #include "LuaWindow.h"
#include "LuaScriptInterface.h"
#include "LuaButton.h"
#include "LuaLabel.h"
#include "LuaTextbox.h"
#include "LuaCheckbox.h"
#include "LuaSlider.h"
#include "LuaProgressBar.h"
#include "gui/interface/Window.h"
#include "gui/interface/Engine.h"
#include "graphics/Graphics.h"
const char LuaWindow... | 12,674 | C++ | .cpp | 447 | 26.04698 | 166 | 0.724146 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | true | false |
50,463 | LuaMisc.cpp | The-Powder-Toy_The-Powder-Toy/src/lua/LuaMisc.cpp | #include "LuaScriptInterface.h"
#include "client/http/Request.h"
#include "common/platform/Platform.h"
#include "compat.lua.h"
#include "Config.h"
#include "gui/dialogues/ErrorMessage.h"
#include "gui/dialogues/InformationMessage.h"
#include "gui/game/GameController.h"
#include "gui/game/GameModel.h"
#include "gui/game... | 7,350 | C++ | .cpp | 289 | 22.788927 | 130 | 0.685106 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,464 | LuaCheckbox.cpp | The-Powder-Toy_The-Powder-Toy/src/lua/LuaCheckbox.cpp | #include "LuaCheckbox.h"
#include "LuaScriptInterface.h"
#include "gui/interface/Checkbox.h"
const char LuaCheckbox::className[] = "checkbox";
#define method(class, name) {#name, &class::name}
Luna<LuaCheckbox>::RegType LuaCheckbox::methods[] = {
method(LuaCheckbox, action),
method(LuaCheckbox, text),
method(LuaCh... | 1,762 | C++ | .cpp | 74 | 21.810811 | 87 | 0.714711 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | true | false |
50,465 | LuaButton.cpp | The-Powder-Toy_The-Powder-Toy/src/lua/LuaButton.cpp | #include "LuaButton.h"
#include "LuaScriptInterface.h"
#include "gui/interface/Button.h"
const char LuaButton::className[] = "button";
#define method(class, name) {#name, &class::name}
Luna<LuaButton>::RegType LuaButton::methods[] = {
method(LuaButton, action),
method(LuaButton, text),
method(LuaButton, position),... | 1,743 | C++ | .cpp | 75 | 21.24 | 88 | 0.704039 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | true | false |
50,466 | LuaPlatform.cpp | The-Powder-Toy_The-Powder-Toy/src/lua/LuaPlatform.cpp | #include "LuaScriptInterface.h"
#include "common/platform/Platform.h"
#include "Config.h"
#include "PowderToySDL.h"
static int platform(lua_State *L)
{
tpt_lua_pushByteString(L, IDENT_PLATFORM);
return 1;
}
static int ident(lua_State *L)
{
tpt_lua_pushByteString(L, IDENT);
return 1;
}
static int releaseType(lua_... | 1,475 | C++ | .cpp | 71 | 18.957746 | 57 | 0.731183 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,467 | LuaFileSystem.cpp | The-Powder-Toy_The-Powder-Toy/src/lua/LuaFileSystem.cpp | #include "LuaScriptInterface.h"
#include "common/platform/Platform.h"
static int list(lua_State *L)
{
auto directoryName = tpt_lua_checkByteString(L, 1);
lua_newtable(L);
int index = 0;
for (auto &name : Platform::DirectorySearch(directoryName, "", {}))
{
if (name != "." && name != "..")
{
index += 1;
t... | 2,576 | C++ | .cpp | 106 | 22.339623 | 106 | 0.722426 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,468 | LuaBz2.cpp | The-Powder-Toy_The-Powder-Toy/src/lua/LuaBz2.cpp | #include "LuaScriptInterface.h"
#include "bzip2/bz2wrap.h"
static int compress(lua_State *L)
{
auto src = tpt_lua_checkByteString(L, 1);
auto maxSize = size_t(luaL_optinteger(L, 2, 0));
std::vector<char> dest;
auto result = BZ2WCompress(dest, src.data(), src.size(), maxSize);
#define RETURN_ERR(str) lua_pushnil(L)... | 2,062 | C++ | .cpp | 61 | 32.016393 | 106 | 0.73974 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,469 | LuaSlider.cpp | The-Powder-Toy_The-Powder-Toy/src/lua/LuaSlider.cpp | #include "LuaSlider.h"
#include "LuaScriptInterface.h"
#include "gui/interface/Slider.h"
const char LuaSlider::className[] = "slider";
#define method(class, name) {#name, &class::name}
Luna<LuaSlider>::RegType LuaSlider::methods[] = {
method(LuaSlider, onValueChanged),
method(LuaSlider, position),
method(LuaSlider... | 1,738 | C++ | .cpp | 74 | 21.486486 | 80 | 0.716012 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | true | false |
50,470 | TPTSTypes.cpp | The-Powder-Toy_The-Powder-Toy/src/lua/TPTSTypes.cpp | #include "TPTSTypes.h"
AnyType::AnyType(ValueType type_, ValueValue value_):
type(type_),
value(value_)
{
}
ValueType AnyType::GetType()
{
return type;
}
AnyType::operator NumberType()
{
if (type == TypeNumber)
return NumberType(std::get<int>(value));
else if (type == TypeFloat)
return NumberType(int(std::g... | 2,463 | C++ | .cpp | 105 | 21.457143 | 78 | 0.727545 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,471 | LuaSocket.cpp | The-Powder-Toy_The-Powder-Toy/src/lua/LuaSocket.cpp | #include "LuaScriptInterface.h"
#include "Misc.h"
int LuaSocket::GetTime(lua_State *L)
{
lua_pushnumber(L, LuaSocket::Now());
return 1;
}
int LuaSocket::Sleep(lua_State *L)
{
LuaSocket::Timeout(luaL_checknumber(L, 1));
return 0;
}
void LuaSocket::Open(lua_State *L)
{
static const luaL_Reg reg[] = {
{ "sleep",... | 491 | C++ | .cpp | 24 | 18.666667 | 44 | 0.69181 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,472 | CommandInterface.cpp | The-Powder-Toy_The-Powder-Toy/src/lua/CommandInterface.cpp | #include "CommandInterface.h"
#include "Misc.h"
#include "gui/game/GameModel.h"
#include "simulation/Particle.h"
#include "Format.h"
#include "simulation/Simulation.h"
#include "simulation/Air.h"
#include "simulation/ElementClasses.h"
#include "gui/game/GameController.h"
#include "gui/game/GameModel.h"
#include "gui/in... | 14,266 | C++ | .cpp | 553 | 23.173599 | 138 | 0.673309 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | true | false |
50,473 | LuaCompat.cpp | The-Powder-Toy_The-Powder-Toy/src/lua/LuaCompat.cpp | #include "LuaCompat.h"
extern "C"
{
#if LUA_VERSION_NUM >= 502
// Implement missing luaL_typerror function
int luaL_typerror(lua_State *L, int narg, const char *tname)
{
const char *msg = lua_pushfstring(L, "%s expected, got %s", tname, luaL_typename(L, narg));
return luaL_argerror(L, narg, msg);
}
void luaL_regist... | 708 | C++ | .cpp | 30 | 22.1 | 92 | 0.721893 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,474 | LuaGraphics.cpp | The-Powder-Toy_The-Powder-Toy/src/lua/LuaGraphics.cpp | #include "LuaScriptInterface.h"
#include "graphics/Graphics.h"
#include "graphics/Renderer.h"
static int32_t int32Truncate(double n)
{
if (n >= 0x1p31)
{
n -= 0x1p32;
}
return int32_t(n);
}
static int textSize(lua_State *L)
{
auto text = tpt_lua_optString(L, 1, "");
auto size = Graphics::TextSize(text);
lua_... | 6,978 | C++ | .cpp | 270 | 23.72963 | 97 | 0.596557 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,475 | LuaTools.cpp | The-Powder-Toy_The-Powder-Toy/src/lua/LuaTools.cpp | #include "LuaScriptInterface.h"
#include "gui/game/GameModel.h"
#include "simulation/SimTool.h"
#include "simulation/Simulation.h"
#include <type_traits>
static int allocate(lua_State *L)
{
luaL_checktype(L, 1, LUA_TSTRING);
luaL_checktype(L, 2, LUA_TSTRING);
auto group = tpt_lua_toByteString(L, 1).ToUpper();
auto... | 12,573 | C++ | .cpp | 392 | 29.32398 | 148 | 0.695956 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,476 | LuaInterface.cpp | The-Powder-Toy_The-Powder-Toy/src/lua/LuaInterface.cpp | #include "LuaScriptInterface.h"
#include "gui/dialogues/ConfirmPrompt.h"
#include "gui/dialogues/ErrorMessage.h"
#include "gui/dialogues/InformationMessage.h"
#include "gui/dialogues/TextPrompt.h"
#include "gui/game/Brush.h"
#include "gui/game/GameController.h"
#include "gui/game/GameModel.h"
#include "gui/game/GameVie... | 12,844 | C++ | .cpp | 487 | 24.10883 | 117 | 0.690105 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,477 | LuaScriptInterface.cpp | The-Powder-Toy_The-Powder-Toy/src/lua/LuaScriptInterface.cpp | #include "LuaScriptInterface.h"
#include "client/http/Request.h"
#include "common/platform/Platform.h"
#include "common/tpt-rand.h"
#include "compat.lua.h"
#include "gui/game/GameController.h"
#include "gui/game/GameModel.h"
#include "gui/game/GameView.h"
#include "gui/interface/Engine.h"
#include "gui/interface/Window... | 21,583 | C++ | .cpp | 805 | 23.762733 | 275 | 0.64993 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,478 | LuaSocketTCPHttp.cpp | The-Powder-Toy_The-Powder-Toy/src/lua/LuaSocketTCPHttp.cpp | #include "LuaScriptInterface.h"
#include "client/http/requestmanager/CurlError.h"
#include "client/http/requestmanager/RequestManager.h"
#include "Misc.h"
#include "common/String.h"
#include <curl/curl.h>
#include <vector>
#include <stdexcept>
#include <cstring>
#include <stdint.h>
#include <algorithm>
namespace LuaSo... | 16,190 | C++ | .cpp | 612 | 22.699346 | 100 | 0.647702 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
50,479 | String.cpp | The-Powder-Toy_The-Powder-Toy/src/common/String.cpp | #include <sstream>
#include <vector>
#include <locale>
#include <limits>
#include <stdexcept>
#include "String.h"
ByteString ConversionError::formatError(ByteString::value_type const *at, ByteString::value_type const *upto)
{
std::stringstream ss;
ss << "Could not convert sequence to UTF-8:";
for(int i = 0; i < 4 ... | 18,917 | C++ | .cpp | 648 | 26.978395 | 152 | 0.711727 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | true | false | true | true | true | false |
50,480 | tpt-rand.cpp | The-Powder-Toy_The-Powder-Toy/src/common/tpt-rand.cpp | #include "tpt-rand.h"
#include <cstdlib>
#include <ctime>
/* xoroshiro128+ by David Blackman and Sebastiano Vigna */
static inline uint64_t rotl(const uint64_t x, int k)
{
return (x << k) | (x >> (64 - k));
}
uint64_t RNG::next()
{
const uint64_t s0 = s[0];
uint64_t s1 = s[1];
const uint64_t result = s0 + s1;
... | 1,097 | C++ | .cpp | 52 | 19.442308 | 91 | 0.66376 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | true | false |
50,481 | Windows.cpp | The-Powder-Toy_The-Powder-Toy/src/common/clipboard/Windows.cpp | #include "Dynamic.h"
#include "Clipboard.h"
#include "client/GameSave.h"
#include "common/platform/Platform.h"
#include "PowderToySDL.h"
#include <SDL.h>
#include <SDL_syswm.h>
#include <iostream>
#include <windows.h>
namespace Clipboard
{
class WindowsClipboardImpl : public ClipboardImpl
{
UINT save... | 6,830 | C++ | .cpp | 216 | 26.351852 | 126 | 0.658111 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,482 | External.cpp | The-Powder-Toy_The-Powder-Toy/src/common/clipboard/External.cpp | #include "Dynamic.h"
#include "Clipboard.h"
#include "client/GameSave.h"
#include "prefs/GlobalPrefs.h"
#include "PowderToySDL.h"
#include <iostream>
#include <stdio.h>
#include <optional>
#include <algorithm>
#include <signal.h>
#include <map>
#include <SDL_syswm.h>
namespace Clipboard
{
struct Preset
{
ByteStrin... | 6,762 | C++ | .cpp | 250 | 22.968 | 124 | 0.647701 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,483 | Dynamic.cpp | The-Powder-Toy_The-Powder-Toy/src/common/clipboard/Dynamic.cpp | #include "Dynamic.h"
#include "Clipboard.h"
#include "client/GameSave.h"
#include "prefs/GlobalPrefs.h"
#include "PowderToySDL.h"
#include <SDL_syswm.h>
#include <iostream>
namespace Clipboard
{
#define CLIPBOARD_IMPLS_DECLARE
#include "ClipboardImpls.h"
#undef CLIPBOARD_IMPLS_DECLARE
struct ClipboardImplEntry
{
... | 2,988 | C++ | .cpp | 125 | 20.888 | 85 | 0.712882 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,484 | Null.cpp | The-Powder-Toy_The-Powder-Toy/src/common/clipboard/Null.cpp | #include "Clipboard.h"
#include "client/GameSave.h"
namespace Clipboard
{
void SetClipboardData(std::unique_ptr<GameSave> data)
{
}
const GameSave *GetClipboardData()
{
return nullptr;
}
void Init()
{
}
bool GetEnabled()
{
return false;
}
void SetEnabled(bool)
{
}
void RecreateWindow()
{
}
... | 388 | C++ | .cpp | 29 | 11.206897 | 54 | 0.727273 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,485 | Common.cpp | The-Powder-Toy_The-Powder-Toy/src/common/platform/Common.cpp | #include "Platform.h"
#include "resource.h"
#include "common/tpt-rand.h"
#include "Config.h"
#include <memory>
#include <cstring>
#include <fstream>
#include <iostream>
#include <sys/stat.h>
namespace Platform
{
std::string originalCwd;
std::string sharedCwd;
// Returns a list of all files in a directory matching a ... | 2,760 | C++ | .cpp | 101 | 24.881188 | 119 | 0.696226 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,486 | Darwin.cpp | The-Powder-Toy_The-Powder-Toy/src/common/platform/Darwin.cpp | #include "Platform.h"
#include <iostream>
#include <sys/time.h>
#include <cstdint>
#include <mach-o/dyld.h>
namespace Platform
{
void OpenURI(ByteString uri)
{
if (system(("open \"" + uri + "\"").c_str()))
{
fprintf(stderr, "cannot open URI: system(...) failed\n");
}
}
long unsigned int GetTime()
{
struct time... | 1,075 | C++ | .cpp | 49 | 19.857143 | 83 | 0.69902 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,487 | Windows.cpp | The-Powder-Toy_The-Powder-Toy/src/common/platform/Windows.cpp | #include "Platform.h"
#include "resource.h"
#include "Config.h"
#include <iostream>
#include <sys/stat.h>
#include <io.h>
#include <fcntl.h>
#include <shlobj.h>
#include <shlwapi.h>
#include <windows.h>
#include <crtdbg.h>
#include <memory>
namespace Platform
{
ByteString GetCwd()
{
ByteString cwd;
auto cwdPtr = std... | 10,281 | C++ | .cpp | 381 | 24.753281 | 162 | 0.69237 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,488 | MainCommon.cpp | The-Powder-Toy_The-Powder-Toy/src/common/platform/MainCommon.cpp | #include "Platform.h"
namespace Platform
{
int InvokeMain(int argc, char *argv[])
{
return Main(argc, argv);
}
void MarkPresentable()
{
}
}
| 143 | C++ | .cpp | 11 | 11.727273 | 38 | 0.753846 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,489 | Linux.cpp | The-Powder-Toy_The-Powder-Toy/src/common/platform/Linux.cpp | #include "Platform.h"
#include "icon_cps.png.h"
#include "icon_exe.png.h"
#include "save.xml.h"
#include "powder.desktop.h"
#include "Config.h"
#include <cstring>
#include <ctime>
#ifdef __FreeBSD__
# include <sys/sysctl.h>
#endif
namespace Platform
{
void OpenURI(ByteString uri)
{
if (system(("xdg-open \"" + uri + "... | 3,605 | C++ | .cpp | 131 | 25.083969 | 160 | 0.649841 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,490 | ExitCommon.cpp | The-Powder-Toy_The-Powder-Toy/src/common/platform/ExitCommon.cpp | #include "Platform.h"
#include <cstdlib>
#include <list>
namespace Platform
{
std::list<ExitFunc> exitFuncs;
void Atexit(ExitFunc exitFunc)
{
exitFuncs.push_front(exitFunc);
}
void Exit(int code)
{
for (auto exitFunc : exitFuncs)
{
exitFunc();
}
exit(code);
}
}
| 272 | C++ | .cpp | 19 | 12.789474 | 32 | 0.756 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,491 | DdirCommon.cpp | The-Powder-Toy_The-Powder-Toy/src/common/platform/DdirCommon.cpp | #include "Platform.h"
#include "common/String.h"
#include "Config.h"
#include <SDL.h>
#include <memory>
namespace Platform
{
ByteString DefaultDdir()
{
auto ddir = std::unique_ptr<char, decltype(&SDL_free)>(SDL_GetPrefPath(NULL, APPDATA), SDL_free);
return ddir.get();
}
}
| 276 | C++ | .cpp | 13 | 20 | 98 | 0.748092 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,492 | Android.cpp | The-Powder-Toy_The-Powder-Toy/src/common/platform/Android.cpp | #include "Platform.h"
#include "Android.h"
#include "common/Defer.h"
#include "Config.h"
#include <ctime>
#include <SDL.h>
#include <jni.h>
#include <android/log.h>
namespace Platform
{
void OpenURI(ByteString uri)
{
fprintf(stderr, "cannot open URI: not implemented\n");
}
long unsigned int GetTime()
{
struct times... | 2,725 | C++ | .cpp | 84 | 30.357143 | 121 | 0.727031 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,493 | PosixProc.cpp | The-Powder-Toy_The-Powder-Toy/src/common/platform/PosixProc.cpp | #include "Platform.h"
#include <iostream>
#include <memory>
#include <sys/stat.h>
#include <unistd.h>
#include <ctime>
#include <sys/time.h>
#include <dirent.h>
namespace Platform
{
void DoRestart()
{
ByteString exename = ExecutableName();
if (exename.length())
{
execl(exename.c_str(), exename.c_str(), NULL);
i... | 1,385 | C++ | .cpp | 68 | 18.397059 | 110 | 0.70291 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,494 | Emscripten.cpp | The-Powder-Toy_The-Powder-Toy/src/common/platform/Emscripten.cpp | #include "Platform.h"
#include <ctime>
#include <emscripten.h>
#include <emscripten/threading.h>
#include <atomic>
#include <iostream>
static std::atomic<bool> shouldSyncFs = false;
static bool syncFsInFlight = false;
EMSCRIPTEN_KEEPALIVE extern "C" void Platform_SyncFsDone()
{
syncFsInFlight = false;
}
namespace P... | 3,130 | C++ | .cpp | 154 | 17.857143 | 89 | 0.684157 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,495 | Null.cpp | The-Powder-Toy_The-Powder-Toy/src/common/platform/Null.cpp | #include "Platform.h"
namespace Platform
{
void OpenURI(ByteString uri)
{
fprintf(stderr, "cannot open URI: not implemented\n");
}
bool CanUpdate()
{
return false;
}
void SetupCrt()
{
}
}
| 193 | C++ | .cpp | 15 | 11.533333 | 55 | 0.765714 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,496 | Posix.cpp | The-Powder-Toy_The-Powder-Toy/src/common/platform/Posix.cpp | #include "Platform.h"
#include <iostream>
#include <memory>
#include <sys/stat.h>
#include <unistd.h>
#include <ctime>
#include <sys/time.h>
#include <dirent.h>
namespace Platform
{
ByteString GetCwd()
{
ByteString cwd;
char *cwdPtr = getcwd(NULL, 0);
if (cwdPtr)
{
cwd = cwdPtr;
}
free(cwdPtr);
return cwd;
}
... | 2,641 | C++ | .cpp | 141 | 16.702128 | 79 | 0.701367 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,497 | Windows.cpp | The-Powder-Toy_The-Powder-Toy/src/common/platform/stacktrace/Windows.cpp | #include "common/platform/Platform.h"
#include "common/Defer.h"
#include <windows.h>
#pragma pack(push, 8)
#include <dbghelp.h>
#pragma pack(pop)
#include <psapi.h>
#include <array>
#include <mutex>
#include <cstdint>
namespace Platform
{
struct SymbolInfo
{
String name;
uintptr_t displacement;
};
static std::option... | 3,776 | C++ | .cpp | 130 | 26.923077 | 121 | 0.71723 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,498 | Execinfo.cpp | The-Powder-Toy_The-Powder-Toy/src/common/platform/stacktrace/Execinfo.cpp | #include "common/platform/Platform.h"
#include "common/Defer.h"
#include <execinfo.h>
#include <cstdint>
#include <array>
#include <cxxabi.h>
#include <iostream>
namespace Platform
{
std::optional<std::vector<String>> StackTrace()
{
std::array<void *, 100> buf;
auto used = backtrace(buf.data(), buf.size());
auto *s... | 1,310 | C++ | .cpp | 52 | 21.865385 | 87 | 0.659507 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,499 | Null.cpp | The-Powder-Toy_The-Powder-Toy/src/common/platform/stacktrace/Null.cpp | #include "common/platform/Platform.h"
namespace Platform
{
std::optional<std::vector<String>> StackTrace()
{
return std::nullopt;
}
}
| 136 | C++ | .cpp | 8 | 15.75 | 47 | 0.779528 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,500 | bz2wrap.cpp | The-Powder-Toy_The-Powder-Toy/src/bzip2/bz2wrap.cpp | #include "bz2wrap.h"
#include "bzlib.h"
#include <memory>
#include <functional>
#include <vector>
#include <algorithm>
static size_t outputSizeIncrement = 0x100000U;
BZ2WCompressResult BZ2WCompress(std::vector<char> &dest, const char *srcData, size_t srcSize, size_t maxSize)
{
bz_stream stream;
stream.bzalloc = NUL... | 2,761 | C++ | .cpp | 111 | 22.162162 | 113 | 0.708286 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | true | false |
50,501 | DebugLines.cpp | The-Powder-Toy_The-Powder-Toy/src/debug/DebugLines.cpp | #include "DebugLines.h"
#include "gui/game/GameView.h"
#include "gui/game/GameController.h"
#include "graphics/Graphics.h"
#include "SimulationConfig.h"
DebugLines::DebugLines(unsigned int id, GameView * view, GameController * controller):
DebugInfo(id),
view(view),
controller(controller)
{
}
void DebugLines::Dra... | 1,997 | C++ | .cpp | 37 | 51.567568 | 181 | 0.719713 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,502 | DebugParts.cpp | The-Powder-Toy_The-Powder-Toy/src/debug/DebugParts.cpp | #include "DebugParts.h"
#include "gui/interface/Engine.h"
#include "simulation/Simulation.h"
#include "graphics/Graphics.h"
DebugParts::DebugParts(unsigned int id, Simulation * sim):
DebugInfo(id),
sim(sim)
{
}
void DebugParts::Draw()
{
Graphics * g = ui::Engine::Ref().g;
int x = 0, y = 0, lpx = 0, lpy = 0;
... | 1,408 | C++ | .cpp | 45 | 28.844444 | 153 | 0.639526 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | true | false |
50,503 | ElementPopulation.cpp | The-Powder-Toy_The-Powder-Toy/src/debug/ElementPopulation.cpp | #include "ElementPopulation.h"
#include "gui/interface/Engine.h"
#include "simulation/Simulation.h"
#include "simulation/SimulationData.h"
#include "graphics/Graphics.h"
ElementPopulationDebug::ElementPopulationDebug(unsigned int id, Simulation * sim):
DebugInfo(id),
sim(sim),
maxAverage(255.0f)
{
}
void ElementP... | 2,265 | C++ | .cpp | 70 | 29.371429 | 158 | 0.681818 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,504 | SurfaceNormals.cpp | The-Powder-Toy_The-Powder-Toy/src/debug/SurfaceNormals.cpp | #include "SurfaceNormals.h"
#include "gui/game/GameView.h"
#include "gui/game/GameController.h"
#include "gui/interface/Engine.h"
#include "simulation/Simulation.h"
#include "simulation/ElementClasses.h"
#include "graphics/Graphics.h"
SurfaceNormals::SurfaceNormals(unsigned int id, const Simulation *newSim, GameView *... | 1,694 | C++ | .cpp | 58 | 26.913793 | 130 | 0.619951 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,505 | ParticleDebug.cpp | The-Powder-Toy_The-Powder-Toy/src/debug/ParticleDebug.cpp | #include "ParticleDebug.h"
#include "gui/game/GameModel.h"
#include "simulation/Simulation.h"
ParticleDebug::ParticleDebug(unsigned int id, Simulation * sim, GameModel * model):
DebugInfo(id),
sim(sim),
model(model)
{
}
void ParticleDebug::Debug(int mode, int x, int y)
{
int i = 0;
String logmessage;
if (mo... | 2,152 | C++ | .cpp | 95 | 19.589474 | 120 | 0.624695 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,506 | Style.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/Style.cpp | #include "gui/Style.h"
namespace style {
ui::Colour Colour::InformationTitle = ui::Colour(140, 140, 255);
ui::Colour Colour::WarningTitle = ui::Colour(255, 216, 32);
ui::Colour Colour::ErrorTitle = ui::Colour(255, 64, 32);
ui::Colour Colour::ConfirmButton = ui::Colour(255, 255, 50);
ui::Colour Colour::ActiveBor... | 545 | C++ | .cpp | 11 | 47.454545 | 65 | 0.709434 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | true | false | true | true | true | false |
50,507 | TagsModel.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/tags/TagsModel.cpp | #include "TagsModel.h"
#include "TagsView.h"
#include "TagsModelException.h"
#include "client/Client.h"
#include "client/SaveInfo.h"
#include "client/http/AddTagRequest.h"
#include "client/http/RemoveTagRequest.h"
#include "gui/dialogues/ErrorMessage.h"
void TagsModel::SetSave(SaveInfo *newSave /* non-owning */)
{
qu... | 2,027 | C++ | .cpp | 96 | 18.6875 | 84 | 0.705821 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,508 | TagsView.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/tags/TagsView.cpp | #include "TagsView.h"
#include "TagsController.h"
#include "TagsModel.h"
#include "TagsModelException.h"
#include "client/Client.h"
#include "client/SaveInfo.h"
#include "graphics/Graphics.h"
#include "gui/dialogues/ErrorMessage.h"
#include "gui/interface/Button.h"
#include "gui/interface/Textbox.h"
#include "gui/i... | 3,976 | C++ | .cpp | 113 | 32.699115 | 215 | 0.715995 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | true | false |
50,509 | TagsController.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/tags/TagsController.cpp | #include "TagsController.h"
#include "TagsModel.h"
#include "TagsView.h"
#include "client/http/AddTagRequest.h"
#include "client/http/RemoveTagRequest.h"
#include "gui/interface/Engine.h"
#include "client/SaveInfo.h"
#include "Controller.h"
TagsController::TagsController(std::function<void ()> onDone_, SaveInfo * save... | 1,015 | C++ | .cpp | 47 | 19.957447 | 80 | 0.776385 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | true | false |
50,510 | ElementSearchActivity.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/elementsearch/ElementSearchActivity.cpp | #include "ElementSearchActivity.h"
#include <set>
#include <map>
#include <algorithm>
#include <SDL.h>
#include "gui/interface/Textbox.h"
#include "gui/interface/ScrollPanel.h"
#include "gui/interface/Label.h"
#include "gui/game/tool/Tool.h"
#include "gui/game/Menu.h"
#include "gui/Style.h"
#include "gui/game/Favorit... | 8,594 | C++ | .cpp | 272 | 29.073529 | 181 | 0.729841 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | true | false |
50,511 | ConsoleModel.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/console/ConsoleModel.cpp | #include "ConsoleModel.h"
#include "ConsoleView.h"
#include "prefs/GlobalPrefs.h"
ConsoleModel::ConsoleModel() {
std::vector<String> previousHistory = GlobalPrefs::Ref().Get("Console.History", std::vector<String>{});
for(std::vector<String>::reverse_iterator iter = previousHistory.rbegin(), end = previousHistory.ren... | 1,822 | C++ | .cpp | 63 | 27.063492 | 126 | 0.778857 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | true | false |
50,512 | ConsoleView.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/console/ConsoleView.cpp | #include "ConsoleView.h"
#include "ConsoleController.h"
#include "ConsoleModel.h"
#include "graphics/Graphics.h"
#include "ConsoleCommand.h"
#include "gui/interface/Label.h"
#include "gui/interface/Textbox.h"
#include "gui/interface/Engine.h"
#include "SimulationConfig.h"
#include <deque>
#include <SDL.h>
ConsoleView:... | 3,700 | C++ | .cpp | 121 | 28.31405 | 132 | 0.732698 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | true | false |
50,513 | ConsoleController.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/console/ConsoleController.cpp | #include "ConsoleController.h"
#include "Controller.h"
#include "ConsoleView.h"
#include "ConsoleModel.h"
#include "ConsoleCommand.h"
#include "lua/CommandInterface.h"
ConsoleController::ConsoleController(std::function<void ()> onDone_, CommandInterface * commandInterface):
HasDone(false)
{
consoleModel = new Cons... | 1,711 | C++ | .cpp | 65 | 24.492308 | 106 | 0.801592 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | true | false |
50,514 | ProfileActivity.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/profile/ProfileActivity.cpp | #include "ProfileActivity.h"
#include "client/Client.h"
#include "client/http/SaveUserInfoRequest.h"
#include "client/http/GetUserInfoRequest.h"
#include "common/platform/Platform.h"
#include "gui/Style.h"
#include "gui/interface/AvatarButton.h"
#include "gui/interface/Button.h"
#include "gui/dialogues/ErrorMessage.h"
... | 9,405 | C++ | .cpp | 228 | 38.741228 | 179 | 0.72421 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | true | false |
50,515 | ServerSaveActivity.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/save/ServerSaveActivity.cpp | #include "ServerSaveActivity.h"
#include "graphics/Graphics.h"
#include "graphics/VideoBuffer.h"
#include "gui/interface/Label.h"
#include "gui/interface/Textbox.h"
#include "gui/interface/Button.h"
#include "gui/interface/Checkbox.h"
#include "gui/dialogues/ErrorMessage.h"
#include "gui/dialogues/SaveIDMessage.h"
#inc... | 23,435 | C++ | .cpp | 376 | 59.662234 | 527 | 0.758862 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | true | false |
50,516 | LocalSaveActivity.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/save/LocalSaveActivity.cpp | #include "LocalSaveActivity.h"
#include "client/Client.h"
#include "client/GameSave.h"
#include "client/ThumbnailRendererTask.h"
#include "common/platform/Platform.h"
#include "graphics/Graphics.h"
#include "graphics/VideoBuffer.h"
#include "gui/Style.h"
#include "gui/dialogues/ConfirmPrompt.h"
#include "gui/dialogue... | 4,903 | C++ | .cpp | 142 | 32.323944 | 135 | 0.74447 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | true | false |
50,517 | FontEditor.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/font/FontEditor.cpp | #include "FontEditor.h"
#include "bzip2/bz2wrap.h"
#include "gui/interface/Textbox.h"
#include "gui/interface/Engine.h"
#include "gui/interface/Point.h"
#include "gui/interface/Button.h"
#include "gui/interface/ScrollPanel.h"
#include "graphics/Graphics.h"
#include "SimulationConfig.h"
#include <stdexcept>
#include <fs... | 18,808 | C++ | .cpp | 580 | 29.553448 | 199 | 0.674887 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | true | false |
50,518 | InformationMessage.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/dialogues/InformationMessage.cpp | #include "InformationMessage.h"
#include "gui/Style.h"
#include "gui/interface/Button.h"
#include "gui/interface/Engine.h"
#include "gui/interface/Label.h"
#include "gui/interface/ScrollPanel.h"
#include "graphics/Graphics.h"
InformationMessage::InformationMessage(String title, String message, bool large, DismissCal... | 2,962 | C++ | .cpp | 68 | 41.132353 | 108 | 0.742014 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | true | false |
50,519 | TextPrompt.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/dialogues/TextPrompt.cpp | #include "TextPrompt.h"
#include "gui/interface/Label.h"
#include "gui/interface/Button.h"
#include "gui/interface/Engine.h"
#include "gui/interface/Textbox.h"
#include "gui/Style.h"
#include "graphics/Graphics.h"
TextPrompt::TextPrompt(String title, String message, String text, String placeholder, bool multiline, ... | 2,890 | C++ | .cpp | 71 | 38.478873 | 140 | 0.751247 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | true | false |
50,520 | ErrorMessage.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/dialogues/ErrorMessage.cpp | #include "ErrorMessage.h"
#include "gui/Style.h"
#include "gui/interface/Button.h"
#include "gui/interface/Engine.h"
#include "gui/interface/Label.h"
#include "PowderToySDL.h"
#include "graphics/Graphics.h"
ErrorMessage::ErrorMessage(String title, String message, DismissCallback callback_):
ui::Window(ui::Point(-... | 1,836 | C++ | .cpp | 44 | 39.659091 | 101 | 0.749579 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | true | false |
50,521 | SaveIDMessage.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/dialogues/SaveIDMessage.cpp | #include "SaveIDMessage.h"
#include "gui/Style.h"
#include "graphics/Graphics.h"
#include "gui/interface/Button.h"
#include "gui/interface/CopyTextButton.h"
#include "gui/interface/Label.h"
#include "Format.h"
#include "SimulationConfig.h"
SaveIDMessage::SaveIDMessage(int id):
ui::Window(ui::Point((XRES-244)/2, (YRES... | 2,513 | C++ | .cpp | 54 | 44.648148 | 165 | 0.752245 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | true | false |
50,522 | ConfirmPrompt.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/dialogues/ConfirmPrompt.cpp | #include "ConfirmPrompt.h"
#include "gui/Style.h"
#include "gui/interface/Button.h"
#include "gui/interface/Engine.h"
#include "gui/interface/Label.h"
#include "gui/interface/ScrollPanel.h"
#include "PowderToySDL.h"
#include "graphics/Graphics.h"
ConfirmPrompt::ConfirmPrompt(String title, String message, ResultCal... | 2,708 | C++ | .cpp | 61 | 42.196721 | 106 | 0.7519 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | true | false |
50,523 | PreviewView.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/preview/PreviewView.cpp | #include "PreviewView.h"
#include "simulation/SaveRenderer.h"
#include "client/Client.h"
#include "client/SaveInfo.h"
#include "client/GameSave.h"
#include "client/http/AddCommentRequest.h"
#include "client/http/ReportSaveRequest.h"
#include "gui/dialogues/TextPrompt.h"
#include "gui/profile/ProfileActivity.h"
#incl... | 25,985 | C++ | .cpp | 734 | 32.628065 | 384 | 0.721509 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,524 | PreviewController.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/preview/PreviewController.cpp | #include "PreviewController.h"
#include "Controller.h"
#include "PreviewModel.h"
#include "PreviewView.h"
#include "client/Client.h"
#include "client/SaveInfo.h"
#include "client/GameSave.h"
#include "client/http/GetSaveRequest.h"
#include "client/http/GetSaveDataRequest.h"
#include "client/http/GetCommentsRequest.h"
#... | 3,722 | C++ | .cpp | 134 | 26.059701 | 168 | 0.79002 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,525 | PreviewModel.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/preview/PreviewModel.cpp | #include "PreviewModel.h"
#include "client/http/GetSaveDataRequest.h"
#include "client/http/GetSaveRequest.h"
#include "client/http/GetCommentsRequest.h"
#include "client/http/FavouriteSaveRequest.h"
#include "Format.h"
#include "Misc.h"
#include "client/Client.h"
#include "client/GameSave.h"
#include "client/SaveInfo.... | 6,580 | C++ | .cpp | 272 | 21.808824 | 134 | 0.744861 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,526 | ColourPickerActivity.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/colourpicker/ColourPickerActivity.cpp | #include "ColourPickerActivity.h"
#include "gui/interface/Textbox.h"
#include "gui/interface/Slider.h"
#include "gui/interface/Button.h"
#include "gui/interface/Label.h"
#include "gui/Style.h"
#include "graphics/Graphics.h"
#include "Misc.h"
#include <SDL.h>
ColourPickerActivity::ColourPickerActivity(ui::Colour in... | 8,547 | C++ | .cpp | 262 | 30.007634 | 120 | 0.698835 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
50,527 | LoginController.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/login/LoginController.cpp | #include "LoginController.h"
#include "client/Client.h"
#include "client/http/LoginRequest.h"
#include "client/http/LogoutRequest.h"
#include "LoginView.h"
#include "LoginModel.h"
#include "Controller.h"
LoginController::LoginController(std::function<void ()> onDone_):
HasExited(false)
{
loginView = new LoginView();... | 903 | C++ | .cpp | 41 | 20.390244 | 69 | 0.784291 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | true | false |
50,528 | LoginView.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/login/LoginView.cpp | #include "LoginView.h"
#include "Config.h"
#include "LoginModel.h"
#include "LoginController.h"
#include "graphics/Graphics.h"
#include "gui/interface/Button.h"
#include "gui/interface/Label.h"
#include "gui/interface/RichLabel.h"
#include "gui/interface/Textbox.h"
#include "gui/Style.h"
#include "client/Client.h"
#inc... | 4,415 | C++ | .cpp | 131 | 31.557252 | 136 | 0.741634 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,529 | LoginModel.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/login/LoginModel.cpp | #include "LoginModel.h"
#include "LoginView.h"
#include "Config.h"
#include "client/Client.h"
#include "client/http/LoginRequest.h"
#include "client/http/LogoutRequest.h"
void LoginModel::Login(ByteString username, ByteString password)
{
if (username.Contains("@"))
{
statusText = String::Build("Use your Powder Toy... | 2,168 | C++ | .cpp | 91 | 21.43956 | 176 | 0.724155 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,530 | LocalBrowserModel.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/localbrowser/LocalBrowserModel.cpp | #include "LocalBrowserModel.h"
#include "LocalBrowserView.h"
#include "client/Client.h"
#include "client/SaveFile.h"
#include "client/GameSave.h"
#include <algorithm>
constexpr auto pageSize = 20;
LocalBrowserModel::LocalBrowserModel()
{
stampIDs = Client::Ref().GetStamps();
}
std::vector<SaveFile *> LocalBrowserMo... | 2,953 | C++ | .cpp | 117 | 23.42735 | 106 | 0.748048 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,531 | LocalBrowserView.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/localbrowser/LocalBrowserView.cpp | #include "LocalBrowserView.h"
#include "LocalBrowserController.h"
#include "LocalBrowserModel.h"
#include "gui/interface/Button.h"
#include "gui/interface/Textbox.h"
#include "gui/interface/Label.h"
#include "gui/interface/SaveButton.h"
#include "PowderToySDL.h"
#include "client/SaveFile.h"
#include "graphics/Graphics.... | 6,986 | C++ | .cpp | 203 | 31.960591 | 116 | 0.721302 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | true | false |
50,532 | LocalBrowserController.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/localbrowser/LocalBrowserController.cpp | #include "LocalBrowserController.h"
#include "LocalBrowserModel.h"
#include "LocalBrowserView.h"
#include "client/Client.h"
#include "client/GameSave.h"
#include "client/SaveFile.h"
#include "gui/dialogues/ConfirmPrompt.h"
#include "gui/dialogues/TextPrompt.h"
#include "gui/dialogues/ErrorMessage.h"
#include "tasks/T... | 3,920 | C++ | .cpp | 139 | 26.143885 | 131 | 0.755396 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,533 | UpdateActivity.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/update/UpdateActivity.cpp | #include "UpdateActivity.h"
#include "client/http/Request.h"
#include "prefs/GlobalPrefs.h"
#include "common/platform/Platform.h"
#include "tasks/Task.h"
#include "tasks/TaskWindow.h"
#include "gui/dialogues/ConfirmPrompt.h"
#include "gui/interface/Engine.h"
#include "Config.h"
#include <bzlib.h>
#include <memory>
cla... | 3,851 | C++ | .cpp | 143 | 24.230769 | 141 | 0.706153 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,534 | FileBrowserActivity.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/filebrowser/FileBrowserActivity.cpp | #include "FileBrowserActivity.h"
#include "client/GameSave.h"
#include "client/SaveFile.h"
#include "common/platform/Platform.h"
#include "graphics/Graphics.h"
#include "gui/Style.h"
#include "tasks/Task.h"
#include "gui/dialogues/ConfirmPrompt.h"
#include "gui/dialogues/ErrorMessage.h"
#include "gui/dialogues/TextPr... | 8,116 | C++ | .cpp | 278 | 26.679856 | 125 | 0.718778 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,535 | QuickOptions.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/game/QuickOptions.cpp | #include "QuickOptions.h"
#include "GameModel.h"
#include "GameController.h"
#include "simulation/Simulation.h"
SandEffectOption::SandEffectOption(GameModel * m):
QuickOption("P", "Sand effect", m, Toggle)
{
}
bool SandEffectOption::GetToggle()
{
return m->GetSimulation()->pretty_powder;
}
void SandEffectOption::p... | 1,687 | C++ | .cpp | 77 | 20.441558 | 73 | 0.754253 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | true | false | false | true | true | false |
50,536 | Brush.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/game/Brush.cpp | #include "Brush.h"
#include "graphics/Graphics.h"
void Brush::InitBitmap()
{
bitmap = GenerateBitmap();
}
void Brush::InitOutline()
{
InitBitmap();
ui::Point bounds = GetSize();
outline = PlaneAdapter<std::vector<unsigned char>>(bounds);
for (int j = 0; j < bounds.Y; j++)
{
for (int i = 0; i < bounds.X; i++)
... | 2,759 | C++ | .cpp | 107 | 23.205607 | 104 | 0.630064 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,537 | GameModel.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/game/GameModel.cpp | #include "Config.h"
#include "GameModel.h"
#include "BitmapBrush.h"
#include "EllipseBrush.h"
#include "Favorite.h"
#include "Format.h"
#include "GameController.h"
#include "GameModelException.h"
#include "GameView.h"
#include "Menu.h"
#include "Notification.h"
#include "RectangleBrush.h"
#include "TriangleBrush.h"
#in... | 50,422 | C++ | .cpp | 1,631 | 28.885346 | 202 | 0.677689 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,538 | Menu.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/game/Menu.cpp | #include "Menu.h"
Menu::Menu(String::value_type icon_, String description_, int visible_):
icon(icon_),
description(description_),
tools(std::vector<Tool*>()),
visible(visible_ ? true : false)
{
}
Menu::~Menu()
{
tools.clear();
}
void Menu::AddTool(Tool * tool_)
{
tools.push_back(tool_);
}
void Menu::ClearTo... | 346 | C++ | .cpp | 20 | 15.7 | 72 | 0.694704 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | true | false |
50,539 | Favorite.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/game/Favorite.cpp | #include "Favorite.h"
#include "prefs/GlobalPrefs.h"
#include <json/json.h>
#include <algorithm>
Favorite::Favorite():
favoritesList(std::vector<ByteString>())
{}
std::vector<ByteString> Favorite::GetFavoritesList()
{
return favoritesList;
}
bool Favorite::IsFavorite(ByteString identifier)
{
return std::find(... | 1,045 | C++ | .cpp | 40 | 24.45 | 111 | 0.78012 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | true | false |
50,540 | ToolButton.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/game/ToolButton.cpp | #include "ToolButton.h"
#include "graphics/Graphics.h"
#include "graphics/VideoBuffer.h"
#include "Favorite.h"
#include <SDL.h>
ToolButton::ToolButton(ui::Point position, ui::Point size, String text, ByteString toolIdentifier, String toolTip):
ui::Button(position, size, text, toolTip),
toolIdentifier(toolIdentifier)... | 2,976 | C++ | .cpp | 107 | 25.635514 | 136 | 0.741947 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,541 | GameView.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/game/GameView.cpp | #include "GameView.h"
#include "Brush.h"
#include "tool/DecorationTool.h"
#include "tool/PropertyTool.h"
#include "Favorite.h"
#include "Format.h"
#include "GameController.h"
#include "GameModel.h"
#include "IntroText.h"
#include "Menu.h"
#include "MenuButton.h"
#include "Misc.h"
#include "Notification.h"
#include "To... | 75,545 | C++ | .cpp | 2,495 | 27.22004 | 210 | 0.700427 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | true | false |
50,542 | GameController.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/game/GameController.cpp | #include "GameController.h"
#include "Brush.h"
#include "Controller.h"
#include "Format.h"
#include "GameModel.h"
#include "GameModelException.h"
#include "GameView.h"
#include "Menu.h"
#include "Notification.h"
#include "QuickOptions.h"
#include "RenderPreset.h"
#include "tool/PropertyTool.h"
#include "tool/GOLTool.h... | 45,058 | C++ | .cpp | 1,558 | 26.436457 | 197 | 0.729191 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
50,543 | BitmapBrush.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/game/BitmapBrush.cpp | #include "BitmapBrush.h"
#include "Misc.h"
#include <algorithm>
#include <cmath>
BitmapBrush::BitmapBrush(ui::Point inputSize, unsigned char const *inputBitmap)
{
ui::Point newSize = inputSize;
//Ensure the rect has odd dimensions so we can pull an integer radius with a 1x1 centre
if (!(newSize.X % 2))
newSize.X... | 2,294 | C++ | .cpp | 60 | 35.35 | 110 | 0.690476 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,544 | SampleTool.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/game/tool/SampleTool.cpp | #include "SampleTool.h"
#include "PropertyTool.h"
#include "GOLTool.h"
#include "graphics/Graphics.h"
#include "graphics/Renderer.h"
#include "gui/game/GameModel.h"
#include "gui/game/GameView.h"
#include "gui/interface/Colour.h"
#include "simulation/Simulation.h"
#include "simulation/ElementClasses.h"
#include "gui/ga... | 2,268 | C++ | .cpp | 72 | 28.236111 | 230 | 0.697356 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,545 | GOLTool.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/game/tool/GOLTool.cpp | #include "GOLTool.h"
#include "prefs/GlobalPrefs.h"
#include "client/Client.h"
#include "common/tpt-rand.h"
#include "simulation/GOLString.h"
#include "simulation/SimulationData.h"
#include "gui/Style.h"
#include "gui/interface/Button.h"
#include "gui/interface/Label.h"
#include "gui/interface/Textbox.h"
#include "gui/... | 6,336 | C++ | .cpp | 179 | 33.150838 | 117 | 0.738344 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
50,546 | PropertyTool.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/game/tool/PropertyTool.cpp | #include "PropertyTool.h"
#include "prefs/GlobalPrefs.h"
#include "gui/Style.h"
#include "gui/game/Brush.h"
#include "gui/interface/Window.h"
#include "gui/interface/Button.h"
#include "gui/interface/Textbox.h"
#include "gui/interface/DropDown.h"
#include "simulation/Simulation.h"
#include "simulation/SimulationData.h"... | 7,501 | C++ | .cpp | 258 | 26.852713 | 121 | 0.711871 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,547 | DecorationTool.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/game/tool/DecorationTool.cpp | #include "DecorationTool.h"
#include "graphics/Renderer.h"
#include "simulation/SimulationData.h"
#include "simulation/Simulation.h"
#include "gui/game/GameView.h"
std::unique_ptr<VideoBuffer> DecorationTool::GetIcon(int ToolID, Vec2<int> size)
{
auto texture = std::make_unique<VideoBuffer>(size);
if (ToolID == DEC... | 2,574 | C++ | .cpp | 60 | 40.7 | 149 | 0.731045 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,548 | WallTool.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/game/tool/WallTool.cpp | #include "WallTool.h"
#include "simulation/Simulation.h"
#include "simulation/SimulationData.h"
void WallTool::Draw(Simulation * sim, Brush const &brush, ui::Point position) {
sim->CreateWalls(position.X, position.Y, 1, 1, ToolID, &brush);
}
void WallTool::DrawLine(Simulation * sim, Brush const &brush, ui::Point posi... | 1,434 | C++ | .cpp | 37 | 36.189189 | 120 | 0.694842 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,549 | Tool.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/game/tool/Tool.cpp | #include "Tool.h"
std::unique_ptr<VideoBuffer> Tool::GetTexture(Vec2<int> size)
{
return textureGen ? textureGen(ToolID, size) : nullptr;
}
void Tool::Click(Simulation * sim, Brush const &brush, ui::Point position) { }
void Tool::Draw(Simulation * sim, Brush const &brush, ui::Point position) {}
void Tool::DrawLine(S... | 601 | C++ | .cpp | 10 | 58.8 | 117 | 0.741935 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,550 | SignTool.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/game/tool/SignTool.cpp | #include "SignTool.h"
#include "simulation/Simulation.h"
#include "gui/Style.h"
#include "gui/interface/Window.h"
#include "gui/interface/Button.h"
#include "gui/interface/Label.h"
#include "gui/interface/Textbox.h"
#include "gui/interface/DropDown.h"
#include "gui/game/GameModel.h"
#include "graphics/Graphics.h"
clas... | 7,861 | C++ | .cpp | 226 | 32.261062 | 145 | 0.701918 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | true | false |
50,551 | ElementTool.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/game/tool/ElementTool.cpp | #include "ElementTool.h"
#include "simulation/Simulation.h"
#include "simulation/ElementCommon.h"
#include "gui/game/Brush.h"
void ElementTool::Draw(Simulation * sim, Brush const &brush, ui::Point position){
sim->CreateParts(position.X, position.Y, ToolID, brush);
}
void ElementTool::DrawLine(Simulation * sim, Brush ... | 1,731 | C++ | .cpp | 33 | 50.878788 | 127 | 0.752218 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,552 | OptionsController.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/options/OptionsController.cpp | #include "OptionsController.h"
#include "OptionsView.h"
#include "OptionsModel.h"
#include "Controller.h"
OptionsController::OptionsController(GameModel * gModel_, std::function<void ()> onDone_):
gModel(gModel_),
onDone(onDone_),
HasExited(false)
{
view = new OptionsView();
model = new OptionsModel(gModel);
m... | 3,460 | C++ | .cpp | 139 | 23.316547 | 90 | 0.841961 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
50,553 | OptionsModel.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/options/OptionsModel.cpp | #include "OptionsModel.h"
#include "OptionsView.h"
#include "simulation/Simulation.h"
#include "simulation/Air.h"
#include "simulation/gravity/Gravity.h"
#include "prefs/GlobalPrefs.h"
#include "common/clipboard/Clipboard.h"
#include "gui/interface/Engine.h"
#include "gui/game/GameModel.h"
OptionsModel::OptionsModel(G... | 7,496 | C++ | .cpp | 289 | 24.384083 | 73 | 0.805198 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | false | false |
50,554 | OptionsView.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/options/OptionsView.cpp | #include "OptionsView.h"
#include "Format.h"
#include "OptionsController.h"
#include "OptionsModel.h"
#include "common/clipboard/Clipboard.h"
#include "common/platform/Platform.h"
#include "graphics/Graphics.h"
#include "graphics/Renderer.h"
#include "gui/Style.h"
#include "simulation/ElementDefs.h"
#include "simulatio... | 18,288 | C++ | .cpp | 484 | 35.010331 | 262 | 0.719527 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,555 | RenderController.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/render/RenderController.cpp | #include "RenderController.h"
#include "RenderView.h"
#include "RenderModel.h"
#include "Controller.h"
RenderController::RenderController(Simulation *sim, Renderer * ren, RendererSettings *rendererSettings, std::function<void ()> onDone_):
HasExited(false)
{
renderView = new RenderView();
renderModel = new Render... | 1,437 | C++ | .cpp | 56 | 23.946429 | 136 | 0.816716 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
50,556 | RenderView.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/render/RenderView.cpp | #include "RenderView.h"
#include "simulation/ElementGraphics.h"
#include "simulation/SimulationData.h"
#include "simulation/Simulation.h"
#include "graphics/Graphics.h"
#include "graphics/Renderer.h"
#include "graphics/VideoBuffer.h"
#include "RenderController.h"
#include "RenderModel.h"
#include "gui/interface/Checkbo... | 9,778 | C++ | .cpp | 235 | 39.27234 | 188 | 0.7269 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | true | true | false |
50,557 | RenderModel.cpp | The-Powder-Toy_The-Powder-Toy/src/gui/render/RenderModel.cpp | #include "RenderModel.h"
#include "RenderView.h"
#include "gui/game/RenderPreset.h"
#include "gui/game/GameController.h"
#include "gui/game/GameView.h"
#include "graphics/Renderer.h"
void RenderModel::AddObserver(RenderView * observer)
{
observers.push_back(observer);
observer->NotifyRendererChanged(this);
observer... | 2,667 | C++ | .cpp | 114 | 21.72807 | 84 | 0.792423 | The-Powder-Toy/The-Powder-Toy | 4,543 | 764 | 52 | GPL-3.0 | 9/20/2024, 9:26:26 PM (Europe/Amsterdam) | false | false | false | false | false | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.