]> code.bitgloo.com Git - clyne/gamedev.git/commitdiff
windows 64-bit build
authorClyne Sullivan <tullivan99@gmail.com>
Wed, 27 Sep 2017 02:37:52 +0000 (22:37 -0400)
committerClyne Sullivan <tullivan99@gmail.com>
Wed, 27 Sep 2017 02:37:52 +0000 (22:37 -0400)
.gitignore
Makefile
README.md
include/bmpimage.hpp
include/quest.hpp
include/thread.hpp
include/ui_quest.hpp
src/fileio.cpp
src/particle.cpp

index a554d64b6ad0e0618e73af65fada9296f803f1f3..33f78e0dd885002693c5d53d91ea188097a48bdf 100644 (file)
@@ -1,4 +1,5 @@
 main\r
+main.exe\r
 doc/**\r
 storyXML/*.dat\r
 xml/*.dat\r
index 8b3bd5e92af34ee4c10728f90057b1fa029fa385..b48a4acbd4148506cc0bfcfe91d4e122ae143b42 100644 (file)
--- 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
 
index fa6350ae83266573c8442498ec55d5abff9e88db..f6b12c8082f072290ca854993b6d501d0e31c6dd 100644 (file)
--- 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
index 5e056fe8d555c2efda6c126dc45b6076bfdb65b2..69b78ac39b6ea78bd8e41b1381152e07b9f198af 100644 (file)
@@ -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
index be9755f72ac18b078561ffc6c321be3f4fff8bd2..3358d8f8489230de75551fd5d04070fefb88eae7 100644 (file)
@@ -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;\r
+       }
 };
 
 #endif // QUEST_HPP_
index 0dd20f9473810b72d0f4c0e587bafc1f7c9b806b..63e441a513141c76bd90bf63105327ea2b7adcc9 100644 (file)
@@ -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>
 
index d9d17082f924d6c1ee9333a51172d11198aaaa75..e06570aeafa1cd82025011736f0b1241a972960b 100644 (file)
@@ -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; 
+                       }
                }
        }
 }
index 28e0c17a1e0253521de72350004ded2da12ddd52..210207f017a726c61bb7b1495621600fb9450f1a 100644 (file)
 #include <dirent.h>
 #include <errno.h>
 
+#else
+       
+#include <windows.h>
+
 #endif // __WIN32__
 
 int getdir(std::string dir, std::list<std::string>& files)
index f2604a6fe4df81c8dd54167f8aed9a2d6662674d..33030276d57e28a6c44377378cfb617c07ec52ca 100644 (file)
@@ -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");