Skip to content

Commit 7b89803

Browse files
Merge pull request #53 from IsakTheHacker/dev
Merge pull request for release: Prealpha-0.1.3. Was merged on 28 January 2021.
2 parents 2e707a5 + 7ae1c73 commit 7b89803

File tree

9 files changed

+60
-11
lines changed

9 files changed

+60
-11
lines changed

Panda Project MSI Installer/Panda Project MSI Installer.vdproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -1969,15 +1969,15 @@
19691969
{
19701970
"Name" = "8:Microsoft Visual Studio"
19711971
"ProductName" = "8:Panda Project"
1972-
"ProductCode" = "8:{9D704F80-0661-4011-8D3D-E15887FE46F0}"
1973-
"PackageCode" = "8:{0E6C31B4-AF27-4FAE-A8A9-89C898D417CF}"
1972+
"ProductCode" = "8:{BDD4D546-6FA3-480E-8610-C13161EAA230}"
1973+
"PackageCode" = "8:{91732098-5E38-46F2-9FE4-E305CD087091}"
19741974
"UpgradeCode" = "8:{85F4E197-8AE8-4284-85E5-9F8BC2D8CBC2}"
19751975
"AspNetVersion" = "8:2.0.50727.0"
19761976
"RestartWWWService" = "11:FALSE"
19771977
"RemovePreviousVersions" = "11:TRUE"
19781978
"DetectNewerInstalledVersion" = "11:FALSE"
19791979
"InstallAllUsers" = "11:TRUE"
1980-
"ProductVersion" = "8:0.1.2"
1980+
"ProductVersion" = "8:0.1.3"
19811981
"Manufacturer" = "8:Isak_The_Hacker"
19821982
"ARPHELPTELEPHONE" = "8:"
19831983
"ARPHELPLINK" = "8:https://github.com/IsakTheHacker/Panda-project"

Panda project/Panda project.vcxproj

+1
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@
249249
<ConformanceMode>true</ConformanceMode>
250250
<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>
251251
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
252+
<LanguageStandard>Default</LanguageStandard>
252253
</ClCompile>
253254
<Link>
254255
<SubSystem>Console</SubSystem>

Panda project/Panda project.vcxproj.filters

+1
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
<None Include="data\scripts\buildcounter.bat">
117117
<Filter>Source Files</Filter>
118118
</None>
119+
<None Include="..\README.md" />
119120
</ItemGroup>
120121
<ItemGroup>
121122
<ClCompile Include="src\main.cpp">
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
308
1+
315

Panda project/src/cppExtension.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ int pass() {
44
return 0;
55
}
66

7-
char stoc(std::string input) {
7+
char stoc(const std::string& input) {
88
char output = input[0];
99
return output;
1010
}
1111

1212
namespace std {
13-
string to_string(string input) {
13+
string to_string(const string& input) {
1414
return input;
1515
}
1616
}

Panda project/src/header/constantVars.h

+29
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,33 @@ namespace game {
2727
const int wheel_down = 1;
2828

2929
const std::array<std::string, 2> allowed_parameters = {"-dev", "-vs"};
30+
31+
const std::array<std::string, 26> optionLines = {
32+
"force_x=4",
33+
"force_y=4",
34+
"camera_x_speed=5",
35+
"camera_y_speed=5",
36+
"x_speed=0.2",
37+
"y_speed=0.4",
38+
"z_speed=0.2",
39+
"hidden_cursor=1",
40+
"close_console_without_input=1",
41+
"lower_border=0",
42+
"upper_border=none",
43+
"startscript=scripts/standard_startscript.txt",
44+
"console-title=The Panda Project",
45+
"console-heading=The Panda Project",
46+
"window-title=The Panda Project",
47+
"model-format=egg",
48+
"hide_fps=0",
49+
"pitch-behavior_while_rotating=none",
50+
"sneak-distance=0.5",
51+
"fov=70",
52+
"show_ray-collisions=0",
53+
"show_block-collisions=0",
54+
"enable_pstats=0",
55+
"pstat-host=localhost",
56+
"save_newly_created_chunks=1",
57+
"player-name=Samurai"
58+
};
3059
}

Panda project/src/header/cppExtension.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
int pass();
77

8-
char stoc(std::string input);
8+
char stoc(const std::string& input);
99

1010
namespace std {
11-
string to_string(string input);
11+
string to_string(const string& input);
1212
}

Panda project/src/header/gameObject.h

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ namespace game {
3333
std::map<std::string, std::string> config;
3434
NodePath collisionNodePath;
3535
double hp = 1;
36+
double temperature = 0;
3637

3738
object(WindowFramework*& window, PandaFramework& framework, std::string modelpath, bool collidable = true, bool shouldLogInConsole = true, bool shouldLogToFile = false);
3839
object(WindowFramework*& window, PandaFramework& framework, std::vector<NodePath> subobjects, bool collidable = true, bool shouldLogInConsole = true, bool shouldLogToFile = false);

Panda project/src/main.cpp

+20-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
#include <map>
1313
#include <string>
1414

15+
#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING //Experimental filesystem header
16+
#include <experimental/filesystem>
17+
namespace fs = std::experimental::filesystem;
18+
1519
int handInventoryIndex;
1620
std::map<std::string, bool> keys;
1721
std::map<std::string, std::string> universeOptions;
@@ -115,8 +119,21 @@ int main(int argc, char* argv[]) {
115119
}
116120

117121
//Create folders and files
118-
game::runPyScript("data/scripts/makeDirectories.py");
119-
game::runPyScript("data/scripts/createOptionsFile.py");
122+
fs::create_directory("data");
123+
fs::create_directory("screenshots");
124+
if (!game::fileExists("data/options.txt")) {
125+
std::ofstream file("data/options.txt");
126+
std::string newLine = "\n";
127+
for (size_t i = 0; i < game::optionLines.size(); i++) {
128+
if (i == game::optionLines.size() - 1) {
129+
newLine = "";
130+
}
131+
file << game::optionLines[i] << newLine;
132+
}
133+
file.close();
134+
}
135+
/*game::runPyScript("data/scripts/makeDirectories.py");
136+
game::runPyScript("data/scripts/createOptionsFile.py");*/
120137

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

147164
// Open the window
148165
WindowFramework* window = framework.open_window();

0 commit comments

Comments
 (0)