aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2017-09-26 22:37:52 -0400
committerClyne Sullivan <tullivan99@gmail.com>2017-09-26 22:37:52 -0400
commit8be1f74e878950cbbac3f05451341fc18892518b (patch)
tree8301f06ee0da2b27fb93b149736c6f7d2ace68ca
parent19b2b1dde25885ada99deefe79266c2e22376e85 (diff)
windows 64-bit build
-rw-r--r--.gitignore1
-rw-r--r--Makefile2
-rw-r--r--README.md47
-rw-r--r--include/bmpimage.hpp4
-rw-r--r--include/quest.hpp7
-rw-r--r--include/thread.hpp5
-rw-r--r--include/ui_quest.hpp22
-rw-r--r--src/fileio.cpp4
-rw-r--r--src/particle.cpp2
9 files changed, 50 insertions, 44 deletions
diff --git a/.gitignore b/.gitignore
index a554d64..33f78e0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
main
+main.exe
doc/**
storyXML/*.dat
xml/*.dat
diff --git a/Makefile b/Makefile
index 8b3bd5e..b48a4ac 100644
--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,7 @@ ifeq ($(TARGET_OS),linux)
-lSDL2 -lSDL2_image -lSDL2_mixer -lSDL2main
endif
ifeq ($(TARGET_OS),win32)
- LIBS = -lopengl32 -lglew32 -lmingw32 \
+ LIBS = -lgif -Llib -lentityx -lopengl32 -lglew32 -lmingw32 \
-lSDL2main -lSDL2 -lSDL2_image -lSDL2_mixer -lfreetype
endif
diff --git a/README.md b/README.md
index fa6350a..f6b12c8 100644
--- a/README.md
+++ b/README.md
@@ -1,23 +1,22 @@
gamedev
=======
-gamedev is a high school project between drumsetmonkey and tcsullivan written in C++ and using SDL2/OpenGL. The goal of this project is to have a completed commercial-grade video game available to Linux and Windows users. We plan on profiting off of the game once we finish it, so once the game reaches its final stages it may become closed source (however, what was uploaded will stay for others to use as a resource).
-
-NOTE!!!!
-We're always working on this project. Some commits may contain broken code, or some bugs may be undocumented. Try older commits if the latest one doesn't work.
+gamedev was started as a high school project between drumsetmonkey and tcsullivan, written in C++ and using SDL2/OpenGL. The goal of this project was to have a completed commercial-grade video game available for Linux and Windows users; the plan was to profit off the game once it and the engine were finished. Through the first year and a half of development we quickly learned that the game's engine would need the most focus, as we were starting from complete scratch. Due to this, there is no playable, plot-based game.
+However, the engine is still growing. Development has now slowed to a crawl with the start of our college lives, but changes will still be made every now and then. Maybe a true video game will eventually come out of this, but the engine will most likely always remain open source.
Build Requirements
------------------
-The 'gamedev' project can be build on both Linux-based and Windows operating systems. The game has been verified to work on Debian, Arch Linux, Fedora, FreeBSD, and Windows 7 (maybe 8 and 10, too). The following libraries are required to build 'gamedev':
+The 'gamedev' project can be built on both Linux-based and Windows operating systems. The game has been verified (at some point) to work on Debian, Arch Linux, FreeBSD, and Windows 7 through 10. The following programs and libraries are required to build 'gamedev':
+* make
+* g++
* SDL2, including SDL2_image and SDL2_mixer
-* FreeType (2? libfreetype6? who knows...)
+* FreeType 2
* GLEW
+* libgif if not on 64-bit linux
-Windows builds were done with MinGW. The compiler must support at least C++14.
-
-The Makefile makes calls to g++, echo and rm.
+Windows builds are done with msys2, 64-bit. The compiler must support C++17. libgif for amd64 linux is currently included in the lib/ folder, so any other build set-up must supply their own copy, and change the Makefile accordingly (see what is done for win32 builds, for example).
Build Preparation
-----------------
@@ -28,7 +27,7 @@ TARGET_OS = # either win32 or linux
TARGET_BITS = # either 32 or 64
```
-A settings file must also exist. To take the sample one:
+A settings file must also exist. Take the sample one to start:
```
(from the root directory)
cp config/settings.xml.example config/settings.xml
@@ -41,6 +40,15 @@ mkdir out
Building
--------
+
+EntityX needs to be built only once before building the rest of gamedev, a library file will be outputted that the main Makefile uses for the main build.
+```
+cd entityx
+make
+cd ..
+```
+
+To build the engine:
```
make
```
@@ -57,29 +65,28 @@ To run on Windows:
main.exe
```
-The executable may take the following arguments:
+The executable takes the following arguments:
-* -r, which will reset XML and player data
-* -d, which will kill the game once initialization has been done
-* -x, specify which XML file to load. Looks in the XML folder, defined in config/setting.xml
+* -r, which will reset XML data and delete player data
+* -d, which will initialize the engine, and then exit
+* -x, tells the engine which XML file to load. Looks in the XML folder defined in config/setting.xml
--d is mainly used in conjunction with -r, to reset the XML files and then exit the game before they can be overwritten.
--x might be buggy, or not work.
+-d is mainly used in conjunction with -r, to reset the XML files and then exit the game before they can be rewritten.
Controls
--------
-The following are the controls for the game. Any extra controls can be found in ```src/ui.cpp```
-Controls can kinda be adjusted using the in-game control menu.
+The following are the controls for the game. Any extra controls can be found somewhere in ```src/ui.cpp``` or ```src/player.cpp```
+Some controls can be adjusted using the in-game control menu.
Movement:
* 'a' and 'd' move the player left and right
* 'w' enters buildings
* 'e' opens the inventory
-* 'space' make the player jump if he obtains the jumping skill
+* 'space' makes the player jump if he obtains the jumping skill
* 'L-Shift' sprints if the player obtains the running skill
* 'L-Ctrl' decreases the player's speed
-* 'h' opens a quest menu
+* 'h' opens a current quest menu
Other:
* 'f3' for debug information
diff --git a/include/bmpimage.hpp b/include/bmpimage.hpp
index 5e056fe..69b78ac 100644
--- a/include/bmpimage.hpp
+++ b/include/bmpimage.hpp
@@ -1,5 +1,3 @@
-#ifndef __WIN32__
-
#ifndef BMP_IMAGE_HPP
#define BMP_IMAGE_HPP
@@ -34,5 +32,3 @@ typedef struct {
} __attribute__((packed)) BITMAPINFOHEADER;
#endif // BMP_IMAGE_HPP
-
-#endif // __WIN32__ \ No newline at end of file
diff --git a/include/quest.hpp b/include/quest.hpp
index be9755f..3358d8f 100644
--- a/include/quest.hpp
+++ b/include/quest.hpp
@@ -71,6 +71,13 @@ public:
* @return if the quest is active.
*/
static bool hasQuest(std::string title);
+
+ static inline auto getQuestTitles(void) {
+ std::forward_list<std::string> titles;
+ for (const auto& q : current)
+ titles.emplace_front(q.name);
+ return titles;
+ }
};
#endif // QUEST_HPP_
diff --git a/include/thread.hpp b/include/thread.hpp
index 0dd20f9..63e441a 100644
--- a/include/thread.hpp
+++ b/include/thread.hpp
@@ -1,12 +1,7 @@
#ifndef THREAD_HPP_
#define THREAD_HPP_
-#ifndef __WIN32__
#include <thread>
-#else
-#include <win32thread.hpp>
-#endif // __WIN32__
-
#include <atomic>
#include <entityx/entityx.h>
diff --git a/include/ui_quest.hpp b/include/ui_quest.hpp
index d9d1708..e06570a 100644
--- a/include/ui_quest.hpp
+++ b/include/ui_quest.hpp
@@ -5,6 +5,7 @@
#ifndef UI_QUEST_HPP_
#define UI_QUEST_HPP_
+#include <quest.hpp>
#include <ui.hpp>
#include <vector2.hpp>
@@ -27,13 +28,9 @@ namespace ui {
* Draws the quest UI to the screen, if enabled.
*/
void draw(void) {
-// static unsigned int textWrap = 40;
-
if (!_toggle)
return;
-
-// std::swap(textWrap, ui::textWrapLimit);
-
+
float top_y = offset.y + 200;
ui::drawNiceBox(vec2 {offset.x - 200, top_y },
vec2 {offset.x + 200, offset.y - 200 },
@@ -41,16 +38,15 @@ namespace ui {
UISystem::putStringCentered(vec2(offset.x, top_y - 40), "Current Quests:");
- /*auto y = top_y - 100;
+ const auto& titles = QuestSystem::getQuestTitles();
+ auto y = top_y - 100;
const auto x = offset.x - 180;
- for (const auto &q : player->qh.current) {
- ui::putText(x, y, q.title.c_str());
+ for (const auto t : titles) {
+ UISystem::putString(vec2(x, y), t);
y -= 20;
- ui::putText(x + 40, y, q.desc.c_str());
- y -= 40;
- }*/
-
-// std::swap(textWrap, ui::textWrapLimit);
+ //ui::putText(x + 40, y, q.desc.c_str());
+ //y -= 40;
+ }
}
}
}
diff --git a/src/fileio.cpp b/src/fileio.cpp
index 28e0c17..210207f 100644
--- a/src/fileio.cpp
+++ b/src/fileio.cpp
@@ -10,6 +10,10 @@
#include <dirent.h>
#include <errno.h>
+#else
+
+#include <windows.h>
+
#endif // __WIN32__
int getdir(std::string dir, std::list<std::string>& files)
diff --git a/src/particle.cpp b/src/particle.cpp
index f2604a6..3303027 100644
--- a/src/particle.cpp
+++ b/src/particle.cpp
@@ -72,7 +72,7 @@ void ParticleSystem::render(void)
};
//glBufferSubData(GL_ARRAY_BUFFER, offset, entrySize, coords);
- std::memcpy((void *)((unsigned long)vbobuf + offset), coords, entrySize);
+ std::memcpy(reinterpret_cast<void*>(reinterpret_cast<unsigned long long>(vbobuf) + offset), coords, entrySize);
}
UserAssert(glUnmapBuffer(GL_ARRAY_BUFFER) == GL_TRUE, "Failed to unmap the particle VBO");