Skip to content
This repository has been archived by the owner on Feb 15, 2023. It is now read-only.

Commit

Permalink
Fixup for public release, add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik McClure committed Feb 8, 2018
1 parent b075d0d commit 25ad607
Show file tree
Hide file tree
Showing 46 changed files with 118 additions and 46 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Magnesium Changelog

## 0.1.0
- Initial release
Binary file modified Magnesium/Magnesium.rc
Binary file not shown.
2 changes: 1 addition & 1 deletion Magnesium/SCML.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright ©2017 Black Sphere Studios
// Copyright ©2018 Black Sphere Studios
// For conditions of distribution and use, see copyright notice in Magnesium.h

#ifndef __SCML_H__MG__
Expand Down
2 changes: 1 addition & 1 deletion Magnesium/mgBox2D.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright ©2017 Black Sphere Studios
// Copyright ©2018 Black Sphere Studios
// For conditions of distribution and use, see copyright notice in Magnesium.h

#include "mgBox2D.h"
Expand Down
2 changes: 1 addition & 1 deletion Magnesium/mgComponent.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright ©2017 Black Sphere Studios
// Copyright ©2018 Black Sphere Studios
// For conditions of distribution and use, see copyright notice in Magnesium.h

#include "mgComponent.h"
Expand Down
2 changes: 1 addition & 1 deletion Magnesium/mgConsole.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright ©2017 Black Sphere Studios
// Copyright ©2018 Black Sphere Studios

#include "mgConsole.h"
#include "feathergui/fgElement.h"
Expand Down
2 changes: 1 addition & 1 deletion Magnesium/mgControlMap.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright ©2017 Black Sphere Studios
// Copyright ©2018 Black Sphere Studios
// For conditions of distribution and use, see copyright notice in Magnesium.h

#include "mgControlMap.h"
Expand Down
2 changes: 1 addition & 1 deletion Magnesium/mgEngine.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright ©2017 Black Sphere Studios
// Copyright ©2018 Black Sphere Studios
// For conditions of distribution and use, see copyright notice in Magnesium.h

#include "mgEngine.h"
Expand Down
2 changes: 1 addition & 1 deletion Magnesium/mgEntity.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright ©2017 Black Sphere Studios
// Copyright ©2018 Black Sphere Studios
// For conditions of distribution and use, see copyright notice in Magnesium.h

#include "mgComponent.h"
Expand Down
2 changes: 1 addition & 1 deletion Magnesium/mgJoinPSB2.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright ©2017 Black Sphere Studios
// Copyright ©2018 Black Sphere Studios
// For conditions of distribution and use, see copyright notice in Magnesium.h

#include "mgJoinPSB2.h"
Expand Down
2 changes: 1 addition & 1 deletion Magnesium/mgLogic.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright ©2017 Black Sphere Studios
// Copyright ©2018 Black Sphere Studios
// For conditions of distribution and use, see copyright notice in Magnesium.h

#include "mgLogic.h"
Expand Down
2 changes: 1 addition & 1 deletion Magnesium/mgLua.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright ©2017 Black Sphere Studios
// Copyright ©2018 Black Sphere Studios

#include "mgLua.h"
#include "mgEngine.h"
Expand Down
2 changes: 1 addition & 1 deletion Magnesium/mgPlaneshader.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright ©2017 Black Sphere Studios
// Copyright ©2018 Black Sphere Studios
// For conditions of distribution and use, see copyright notice in Magnesium.h

#include "mgPlaneshader.h"
Expand Down
2 changes: 1 addition & 1 deletion Magnesium/mgRefCounter.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright ©2017 Black Sphere Studios
// Copyright ©2018 Black Sphere Studios
// For conditions of distribution and use, see copyright notice in Magnesium.h

#include "mgRefCounter.h"
Expand Down
2 changes: 1 addition & 1 deletion Magnesium/mgSystem.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright ©2017 Black Sphere Studios
// Copyright ©2018 Black Sphere Studios
// For conditions of distribution and use, see copyright notice in Magnesium.h

#include "mgSystemManager.h"
Expand Down
2 changes: 1 addition & 1 deletion Magnesium/mgSystemManager.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright ©2017 Black Sphere Studios
// Copyright ©2018 Black Sphere Studios
// For conditions of distribution and use, see copyright notice in Magnesium.h

#include "mgSystemManager.h"
Expand Down
2 changes: 1 addition & 1 deletion Magnesium/mgTinyOAL.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright ©2017 Black Sphere Studios
// Copyright ©2018 Black Sphere Studios
// For conditions of distribution and use, see copyright notice in Magnesium.h

#include "mgTinyOAL.h"
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Magnesium

Magnesium is a modular, Component Entity System based game engine you can use with any libraries you build wrappers for. It comes with support for [PlaneShader](https://github.com/Black-Sphere-Studios/planeshader), [Box2D](https://github.com/Black-Sphere-Studios/Box2D), [LuaJIT](http://luajit.org/), and [TinyOAL](https://github.com/Black-Sphere-Studios/tinyoal).

## Compiling

Because Magnesium has so many dependencies, a [vcpkg port](https://github.com/Black-Sphere-Studios/vcpkg/tree/master/ports/magnesium) is provided to automatically acquire and build all necessary components. Simply clone the [Black Sphere Studios vcpkg fork](https://github.com/Black-Sphere-Studios/vcpkg) (or merge its changes into your own vcpkg fork), run `.\bootstrap-vcpkg.bat` and then `.\vcpkg.exe install magnesium:x64-windows` (or `magnesium:x86-windows` for the 32-bit versions). Magnesium will then be ready to be used by any `vcpkg` enabled Visual Studio game project. For more information on vcpkg, [check it's readme](https://github.com/Black-Sphere-Studios/vcpkg/blob/master/README.md).

If you would like to build and test the examples, you will need to [download the SDK](https://github.com/Black-Sphere-Studios/magnesium/releases) that has the example media files. You can either install the vcpkg version of magnesium and let the Visual Studio project override it, or you can install only magnesium's dependencies: `.\vcpkg.exe install bss-util:x64-windows, planeshader:x64-windows, tinyoal:x64-windows, box2d-bss:x64-windows, luajit:x64-windows, enet:x64-windows`. Once these dependencies are installed, the SDK project file will automatically link to them, provided you've enabled [vcpkg Visual Studio integration](https://github.com/Microsoft/vcpkg/blob/master/README.md#quick-start).

©2018 Erik McClure
Binary file removed examples/LD34/LD34.rc
Binary file not shown.
8 changes: 4 additions & 4 deletions examples/LD34/LD34.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>../../lib</AdditionalLibraryDirectories>
<AdditionalDependencies>magnesium32_d.lib;bss-util32_d.lib;planeshader32_d.lib;tinyoal32_d.lib;feathergui32_d.lib;Box2D.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>magnesium32_d.lib;bss-util32_d.lib;planeshader32_d.lib;tinyoal32_d.lib;feathergui32_d.lib;Box2D.lib;lua51.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
Expand Down Expand Up @@ -150,7 +150,7 @@
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>../../lib</AdditionalLibraryDirectories>
<AdditionalDependencies>magnesium32.lib;bss-util32.lib;planeshader32.lib;tinyoal32.lib;feathergui32.lib;Box2D.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>magnesium32.lib;bss-util32.lib;planeshader32.lib;tinyoal32.lib;feathergui32.lib;Box2D.lib;lua51.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
Expand Down Expand Up @@ -183,10 +183,10 @@
<ClCompile Include="main.cpp" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="LD34.rc" />
<ClInclude Include="ld34.h" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="ld34.h" />
<ResourceCompile Include="..\blank.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
10 changes: 5 additions & 5 deletions examples/LD34/LD34.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="LD34.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="ld34.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\blank.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion examples/LD34/ld34.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright ©2016 Black Sphere Studios
// Copyright ©2018 Black Sphere Studios
// For conditions of distribution and use, see copyright notice in Magnesium.h

#ifndef __DEC_H__LD__
Expand Down
3 changes: 2 additions & 1 deletion examples/LD34/main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* LD34
*
* Copyright ©2016 Black Sphere Studios
* Copyright ©2018 Black Sphere Studios
* For conditions of distribution and use, see copyright notice in Magnesium.h
*/

#include "Magnesium.h"
Expand Down
3 changes: 3 additions & 0 deletions examples/Testbed/Testbed.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,9 @@
<ItemGroup>
<ClCompile Include="testbed.cpp" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\blank.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down
5 changes: 5 additions & 0 deletions examples/Testbed/Testbed.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,9 @@
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\blank.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>
3 changes: 2 additions & 1 deletion examples/Testbed/testbed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
* This example runs a series of tests to ensure Magnesium is
* working correctly
*
* Copyright ©2016 Black Sphere Studios
* Copyright ©2018 Black Sphere Studios
* For conditions of distribution and use, see copyright notice in Magnesium.h
*/

#include "magnesium/mgEngine.h"
Expand Down
1 change: 1 addition & 0 deletions examples/blank.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
101 ICON "..\\magnesium.ico"
Binary file added examples/magnesium.ico
Binary file not shown.
14 changes: 12 additions & 2 deletions include/magnesium/Magnesium.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
/* Magnesium Game Engine
Copyright ©2017 Black Sphere Studios
Copyright ©2018 Black Sphere Studios
Proprietary license. This code may not be distributed or modified in any way.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#ifndef __MAGNESIUM_H__MG__
Expand Down
2 changes: 1 addition & 1 deletion include/magnesium/mgBox2D.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright ©2017 Black Sphere Studios
// Copyright ©2018 Black Sphere Studios
// For conditions of distribution and use, see copyright notice in Magnesium.h

#ifndef __BOX2D_H__MG__
Expand Down
10 changes: 8 additions & 2 deletions include/magnesium/mgComponent.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright ©2017 Black Sphere Studios
// Copyright ©2018 Black Sphere Studios
// For conditions of distribution and use, see copyright notice in Magnesium.h

#ifndef __COMPONENT_H__MG__
Expand Down Expand Up @@ -37,7 +37,13 @@ namespace magnesium {
inline void deallocate(T* p, size_t sz = 0) noexcept { mgComponentStoreBase::dllfree(p); }
};

struct EntityIterator : public std::iterator<std::bidirectional_iterator_tag, mgEntity*> {
struct EntityIterator {
using iterator_category = std::bidirectional_iterator_tag;
using value_type = mgEntity*;
using difference_type = ptrdiff_t;
using pointer = mgEntity*;
using reference = mgEntity*;

inline EntityIterator(void* p_, size_t len_, size_t type_) : p(reinterpret_cast<uint8_t*>(p_)), end(reinterpret_cast<uint8_t*>(p_) + (len_*type_)), type(type_) {}
inline mgEntity* operator*() const { return *reinterpret_cast<mgEntity**>(p); }
inline EntityIterator& operator++() { p += type; return *this; } //prefix
Expand Down
2 changes: 1 addition & 1 deletion include/magnesium/mgConsole.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright ©2017 Black Sphere Studios
// Copyright ©2018 Black Sphere Studios
// For conditions of distribution and use, see copyright notice in Magnesium.h

#ifndef __CONSOLE_H__MG__
Expand Down
2 changes: 1 addition & 1 deletion include/magnesium/mgControlMap.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright ©2017 Black Sphere Studios
// Copyright ©2018 Black Sphere Studios
// For conditions of distribution and use, see copyright notice in Magnesium.h

#ifndef __CONTROL_MAP_H__MG__
Expand Down
2 changes: 1 addition & 1 deletion include/magnesium/mgEngine.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright ©2017 Black Sphere Studios
// Copyright ©2018 Black Sphere Studios
// For conditions of distribution and use, see copyright notice in Magnesium.h

#ifndef __ENGINE_H__MG__
Expand Down
2 changes: 1 addition & 1 deletion include/magnesium/mgEntity.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright ©2017 Black Sphere Studios
// Copyright ©2018 Black Sphere Studios
// For conditions of distribution and use, see copyright notice in Magnesium.h

#ifndef __ENTITY_H__MG__
Expand Down
2 changes: 1 addition & 1 deletion include/magnesium/mgJoinPSB2.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright ©2017 Black Sphere Studios
// Copyright ©2018 Black Sphere Studios
// For conditions of distribution and use, see copyright notice in Magnesium.h

#ifndef __JOIN_PS_B2_H__MG__
Expand Down
2 changes: 1 addition & 1 deletion include/magnesium/mgLogic.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright ©2017 Black Sphere Studios
// Copyright ©2018 Black Sphere Studios
// For conditions of distribution and use, see copyright notice in Magnesium.h

#ifndef __LOGIC_H__MG__
Expand Down
2 changes: 1 addition & 1 deletion include/magnesium/mgLua.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright ©2017 Black Sphere Studios
// Copyright ©2018 Black Sphere Studios
// For conditions of distribution and use, see copyright notice in Magnesium.h

#ifndef __LUA_H__MG__
Expand Down
2 changes: 1 addition & 1 deletion include/magnesium/mgPlaneshader.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright ©2017 Black Sphere Studios
// Copyright ©2018 Black Sphere Studios
// For conditions of distribution and use, see copyright notice in Magnesium.h

#ifndef __PLANESHADER_H__MG__
Expand Down
2 changes: 1 addition & 1 deletion include/magnesium/mgRefCounter.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright ©2017 Black Sphere Studios
// Copyright ©2018 Black Sphere Studios
// For conditions of distribution and use, see copyright notice in Magnesium.h

#ifndef __REF_COUNTER_H__MG__
Expand Down
2 changes: 1 addition & 1 deletion include/magnesium/mgSystem.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright ©2017 Black Sphere Studios
// Copyright ©2018 Black Sphere Studios
// For conditions of distribution and use, see copyright notice in Magnesium.h

#ifndef __SYSTEM_H__MG__
Expand Down
2 changes: 1 addition & 1 deletion include/magnesium/mgSystemManager.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright ©2017 Black Sphere Studios
// Copyright ©2018 Black Sphere Studios
// For conditions of distribution and use, see copyright notice in Magnesium.h

#ifndef __SYSTEM_MANAGER_H__MG__
Expand Down
2 changes: 1 addition & 1 deletion include/magnesium/mgTimeline.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright ©2017 Black Sphere Studios
// Copyright ©2018 Black Sphere Studios
// For conditions of distribution and use, see copyright notice in Magnesium.h

#ifndef __TIMELINE_H__MG__
Expand Down
2 changes: 1 addition & 1 deletion include/magnesium/mgTinyOAL.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright ©2017 Black Sphere Studios
// Copyright ©2018 Black Sphere Studios
// For conditions of distribution and use, see copyright notice in Magnesium.h

#ifndef __TINYOAL_H__MG__
Expand Down
2 changes: 1 addition & 1 deletion include/magnesium/mg_dec.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright ©2017 Black Sphere Studios
// Copyright ©2018 Black Sphere Studios
// For conditions of distribution and use, see copyright notice in Magnesium.h

#ifndef __DEC_H__MG__
Expand Down
30 changes: 30 additions & 0 deletions pack.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
@ECHO OFF
md "..\Packages\Magnesium"

RMDIR /S /Q ".\Debug\"
RMDIR /S /Q ".\Release\"
RMDIR /S /Q ".\x64\"
RMDIR /S /Q ".\Win32\"
RMDIR /S /Q ".\examples\x64\"
RMDIR /S /Q ".\examples\Win32\"
RMDIR /S /Q ".\examples\LD34\x64\"
RMDIR /S /Q ".\examples\LD34\Win32\"
RMDIR /S /Q ".\examples\Testbed\x64\"
RMDIR /S /Q ".\examples\Testbed\Win32\"
RMDIR /S /Q ".\Magnesium\x64\"
RMDIR /S /Q ".\Magnesium\Win32\"
DEL /F /S /Q *.log *.exp *.idb *.ilk *.iobj *.ipdb *.metagen *.pch
DEL /F /Q ".\bin\Testbed*.lib"
DEL /F /Q ".\bin32\Testbed*.lib"
DEL /F /Q ".\bin\Testbed*.pdb"
DEL /F /Q ".\bin32\Testbed*.pdb"
DEL /F /Q ".\bin\LD34*.lib"
DEL /F /Q ".\bin32\LD34*.lib"
DEL /F /Q ".\bin\LD34*.pdb"
DEL /F /Q ".\bin32\LD34*.pdb"
XCOPY *.* "..\Packages\Magnesium" /S /C /I /R /Y
DEL /F /Q "..\Packages\Magnesium\bin\D3D*.dll"
DEL /F /Q "..\Packages\Magnesium\bin\D3D*.pdb"
DEL /F /Q "..\Packages\Magnesium\bin32\D3D*.dll"
DEL /F /Q "..\Packages\Magnesium\bin32\D3D*.pdb"
DEL /F /S /Q "..\Packages\Magnesium\*.zip"

0 comments on commit 25ad607

Please sign in to comment.