Skip to content

Commit

Permalink
Merge pull request #53 from IsakTheHacker/dev
Browse files Browse the repository at this point in the history
Merge pull request for release: Prealpha-0.1.3. Was merged on 28 January 2021.
  • Loading branch information
IsakTheHacker authored Jan 28, 2021
2 parents 2e707a5 + 7ae1c73 commit 7b89803
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1969,15 +1969,15 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:Panda Project"
"ProductCode" = "8:{9D704F80-0661-4011-8D3D-E15887FE46F0}"
"PackageCode" = "8:{0E6C31B4-AF27-4FAE-A8A9-89C898D417CF}"
"ProductCode" = "8:{BDD4D546-6FA3-480E-8610-C13161EAA230}"
"PackageCode" = "8:{91732098-5E38-46F2-9FE4-E305CD087091}"
"UpgradeCode" = "8:{85F4E197-8AE8-4284-85E5-9F8BC2D8CBC2}"
"AspNetVersion" = "8:2.0.50727.0"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:FALSE"
"InstallAllUsers" = "11:TRUE"
"ProductVersion" = "8:0.1.2"
"ProductVersion" = "8:0.1.3"
"Manufacturer" = "8:Isak_The_Hacker"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:https://github.com/IsakTheHacker/Panda-project"
Expand Down
1 change: 1 addition & 0 deletions Panda project/Panda project.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>C:\Users\Administrator\AppData\Local\Programs\Python\Python38\include;C:\Users\Administrator\Documents\Panda3d Build\panda3d-1.10.8\built_x64\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<LanguageStandard>Default</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand Down
1 change: 1 addition & 0 deletions Panda project/Panda project.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
<None Include="data\scripts\buildcounter.bat">
<Filter>Source Files</Filter>
</None>
<None Include="..\README.md" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\main.cpp">
Expand Down
2 changes: 1 addition & 1 deletion Panda project/data/scripts/numberofbuilds.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
308
315
4 changes: 2 additions & 2 deletions Panda project/src/cppExtension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ int pass() {
return 0;
}

char stoc(std::string input) {
char stoc(const std::string& input) {
char output = input[0];
return output;
}

namespace std {
string to_string(string input) {
string to_string(const string& input) {
return input;
}
}
29 changes: 29 additions & 0 deletions Panda project/src/header/constantVars.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,33 @@ namespace game {
const int wheel_down = 1;

const std::array<std::string, 2> allowed_parameters = {"-dev", "-vs"};

const std::array<std::string, 26> optionLines = {
"force_x=4",
"force_y=4",
"camera_x_speed=5",
"camera_y_speed=5",
"x_speed=0.2",
"y_speed=0.4",
"z_speed=0.2",
"hidden_cursor=1",
"close_console_without_input=1",
"lower_border=0",
"upper_border=none",
"startscript=scripts/standard_startscript.txt",
"console-title=The Panda Project",
"console-heading=The Panda Project",
"window-title=The Panda Project",
"model-format=egg",
"hide_fps=0",
"pitch-behavior_while_rotating=none",
"sneak-distance=0.5",
"fov=70",
"show_ray-collisions=0",
"show_block-collisions=0",
"enable_pstats=0",
"pstat-host=localhost",
"save_newly_created_chunks=1",
"player-name=Samurai"
};
}
4 changes: 2 additions & 2 deletions Panda project/src/header/cppExtension.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

int pass();

char stoc(std::string input);
char stoc(const std::string& input);

namespace std {
string to_string(string input);
string to_string(const string& input);
}
1 change: 1 addition & 0 deletions Panda project/src/header/gameObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ namespace game {
std::map<std::string, std::string> config;
NodePath collisionNodePath;
double hp = 1;
double temperature = 0;

object(WindowFramework*& window, PandaFramework& framework, std::string modelpath, bool collidable = true, bool shouldLogInConsole = true, bool shouldLogToFile = false);
object(WindowFramework*& window, PandaFramework& framework, std::vector<NodePath> subobjects, bool collidable = true, bool shouldLogInConsole = true, bool shouldLogToFile = false);
Expand Down
23 changes: 20 additions & 3 deletions Panda project/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
#include <map>
#include <string>

#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING //Experimental filesystem header
#include <experimental/filesystem>
namespace fs = std::experimental::filesystem;

int handInventoryIndex;
std::map<std::string, bool> keys;
std::map<std::string, std::string> universeOptions;
Expand Down Expand Up @@ -115,8 +119,21 @@ int main(int argc, char* argv[]) {
}

//Create folders and files
game::runPyScript("data/scripts/makeDirectories.py");
game::runPyScript("data/scripts/createOptionsFile.py");
fs::create_directory("data");
fs::create_directory("screenshots");
if (!game::fileExists("data/options.txt")) {
std::ofstream file("data/options.txt");
std::string newLine = "\n";
for (size_t i = 0; i < game::optionLines.size(); i++) {
if (i == game::optionLines.size() - 1) {
newLine = "";
}
file << game::optionLines[i] << newLine;
}
file.close();
}
/*game::runPyScript("data/scripts/makeDirectories.py");
game::runPyScript("data/scripts/createOptionsFile.py");*/

//Read options
std::map<std::string, std::string> options;
Expand All @@ -142,7 +159,7 @@ int main(int argc, char* argv[]) {
// Open a new window framework and set the title
PandaFramework framework;
framework.open_framework(argc, argv);
framework.set_window_title("The Panda Project: Prealpha 0.1.2");
framework.set_window_title("The Panda Project: Prealpha 0.1.3");

// Open the window
WindowFramework* window = framework.open_window();
Expand Down

0 comments on commit 7b89803

Please sign in to comment.