Skip to content

Commit 5bc3f62

Browse files
committed
HUGE ENGINE CLEANUP
1 parent a69767b commit 5bc3f62

File tree

721 files changed

+3465
-8076
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

721 files changed

+3465
-8076
lines changed

.gitattributes

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,63 @@
1-
# Auto detect text files and perform LF normalization
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
24
* text=auto
5+
6+
###############################################################################
7+
# Set default behavior for command prompt diff.
8+
#
9+
# This is need for earlier builds of msysgit that does not have it on by
10+
# default for csharp files.
11+
# Note: This is only used by command line
12+
###############################################################################
13+
#*.cs diff=csharp
14+
15+
###############################################################################
16+
# Set the merge driver for project and solution files
17+
#
18+
# Merging from the command prompt will add diff markers to the files if there
19+
# are conflicts (Merging from VS is not affected by the settings below, in VS
20+
# the diff markers are never inserted). Diff markers may cause the following
21+
# file extensions to fail to load in VS. An alternative would be to treat
22+
# these files as binary and thus will always conflict and require user
23+
# intervention with every merge. To do so, just uncomment the entries below
24+
###############################################################################
25+
#*.sln merge=binary
26+
#*.csproj merge=binary
27+
#*.vbproj merge=binary
28+
#*.vcxproj merge=binary
29+
#*.vcproj merge=binary
30+
#*.dbproj merge=binary
31+
#*.fsproj merge=binary
32+
#*.lsproj merge=binary
33+
#*.wixproj merge=binary
34+
#*.modelproj merge=binary
35+
#*.sqlproj merge=binary
36+
#*.wwaproj merge=binary
37+
38+
###############################################################################
39+
# behavior for image files
40+
#
41+
# image files are treated as binary by default.
42+
###############################################################################
43+
#*.jpg binary
44+
#*.png binary
45+
#*.gif binary
46+
47+
###############################################################################
48+
# diff behavior for common document formats
49+
#
50+
# Convert binary document formats to text before diffing them. This feature
51+
# is only available from the command line. Turn it on by uncommenting the
52+
# entries below.
53+
###############################################################################
54+
#*.doc diff=astextplain
55+
#*.DOC diff=astextplain
56+
#*.docx diff=astextplain
57+
#*.DOCX diff=astextplain
58+
#*.dot diff=astextplain
59+
#*.DOT diff=astextplain
60+
#*.pdf diff=astextplain
61+
#*.PDF diff=astextplain
62+
#*.rtf diff=astextplain
63+
#*.RTF diff=astextplain

.gitignore

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
##
44
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
55

6-
# Project-specific files
7-
VEngine/VEngine.exe
8-
96
# User-specific files
107
*.rsuser
118
*.suo
@@ -26,11 +23,13 @@ mono_crash.*
2623
[Rr]eleases/
2724
x64/
2825
x86/
26+
[Ww][Ii][Nn]32/
2927
[Aa][Rr][Mm]/
3028
[Aa][Rr][Mm]64/
3129
bld/
3230
[Bb]in/
3331
[Oo]bj/
32+
[Oo]ut/
3433
[Ll]og/
3534
[Ll]ogs/
3635

@@ -64,6 +63,9 @@ project.lock.json
6463
project.fragment.lock.json
6564
artifacts/
6665

66+
# ASP.NET Scaffolding
67+
ScaffoldingReadMe.txt
68+
6769
# StyleCop
6870
StyleCopReport.xml
6971

@@ -130,9 +132,6 @@ _ReSharper*/
130132
*.[Rr]e[Ss]harper
131133
*.DotSettings.user
132134

133-
# JustCode is a .NET coding add-in
134-
.JustCode
135-
136135
# TeamCity is a build add-in
137136
_TeamCity*
138137

@@ -143,6 +142,11 @@ _TeamCity*
143142
.axoCover/*
144143
!.axoCover/settings.json
145144

145+
# Coverlet is a free, cross platform Code Coverage Tool
146+
coverage*.json
147+
coverage*.xml
148+
coverage*.info
149+
146150
# Visual Studio code coverage results
147151
*.coverage
148152
*.coveragexml
@@ -354,3 +358,6 @@ MigrationBackup/
354358

355359
# Ionide (cross platform F# VS Code tools) working folder
356360
.ionide/
361+
362+
# Fody - auto-generated XML schema
363+
FodyWeavers.xsd

Readme.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

VEngine.sln

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.30413.136
4+
VisualStudioVersion = 16.0.31515.178
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VEngine", "VEngine\VEngine.vcxproj", "{27EB75A1-0D97-4081-A4C9-E890C753E0E4}"
6+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VEngine", "VEngine\VEngine.vcxproj", "{06F17222-BBAD-453D-B1B8-096E2C5F7501}"
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1010
Debug|x64 = Debug|x64
1111
Release|x64 = Release|x64
1212
EndGlobalSection
1313
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{27EB75A1-0D97-4081-A4C9-E890C753E0E4}.Debug|x64.ActiveCfg = Debug|x64
15-
{27EB75A1-0D97-4081-A4C9-E890C753E0E4}.Debug|x64.Build.0 = Debug|x64
16-
{27EB75A1-0D97-4081-A4C9-E890C753E0E4}.Release|x64.ActiveCfg = Release|x64
17-
{27EB75A1-0D97-4081-A4C9-E890C753E0E4}.Release|x64.Build.0 = Release|x64
14+
{06F17222-BBAD-453D-B1B8-096E2C5F7501}.Debug|x64.ActiveCfg = Debug|x64
15+
{06F17222-BBAD-453D-B1B8-096E2C5F7501}.Debug|x64.Build.0 = Debug|x64
16+
{06F17222-BBAD-453D-B1B8-096E2C5F7501}.Release|x64.ActiveCfg = Release|x64
17+
{06F17222-BBAD-453D-B1B8-096E2C5F7501}.Release|x64.Build.0 = Release|x64
1818
EndGlobalSection
1919
GlobalSection(SolutionProperties) = preSolution
2020
HideSolutionNode = FALSE
2121
EndGlobalSection
2222
GlobalSection(ExtensibilityGlobals) = postSolution
23-
SolutionGuid = {6C1DEF92-2E7F-4F83-B779-C83E8DE6062A}
23+
SolutionGuid = {BE999B6B-A144-4746-B909-5D0706B90FC4}
2424
EndGlobalSection
2525
EndGlobal

VEngine/Audio/note.wav

-101 KB
Binary file not shown.

VEngine/Code/Actors/Actor.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#pragma once
2+
#include <DirectXCollision.h>
3+
#include "Transform.h"
4+
#include "Components/MeshComponent.h"
5+
6+
using namespace DirectX;
7+
8+
struct Actor
9+
{
10+
Transform transform;
11+
12+
BoundingOrientedBox boundingBox;
13+
BoundingSphere boundingSphere;
14+
15+
MeshComponent* mesh = MeshComponent::system.Add();
16+
17+
Actor()
18+
{
19+
mesh->filename = "Meshes/cube.fbx";
20+
}
21+
22+
void PushTransformToMesh()
23+
{
24+
mesh->transform = transform;
25+
}
26+
};

VEngine/Code/Actors/ActorSystem.h

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#pragma once
2+
#include <vector>
3+
#include <memory>
4+
#include "IActorSystem.h"
5+
#include "Actor.h"
6+
#include "ActorSystemCache.h"
7+
8+
template <typename T>
9+
struct ActorSystem : IActorSystem
10+
{
11+
std::vector<T> actors;
12+
13+
ActorSystem()
14+
{
15+
ActorSystemCache::Add(typeid(T), this);
16+
}
17+
18+
T* Add()
19+
{
20+
actors.push_back(T());
21+
return &actors.back();
22+
}
23+
24+
virtual void GetActors(std::vector<Actor*>& outActors) override
25+
{
26+
for (T& actor : actors)
27+
{
28+
outActors.push_back(&actor);
29+
}
30+
}
31+
};
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#pragma once
2+
#include <unordered_map>
3+
#include <typeinfo>
4+
#include <typeindex>
5+
#include <optional>
6+
#include "IActorSystem.h"
7+
8+
namespace ActorSystemCache
9+
{
10+
std::unordered_map<std::optional<std::type_index>, IActorSystem*>* actorSystemMap = nullptr;
11+
12+
void Add(std::type_index type, IActorSystem* actorSystem)
13+
{
14+
if (actorSystemMap == nullptr)
15+
{
16+
actorSystemMap = new std::unordered_map<std::optional<std::type_index>, IActorSystem*>();
17+
}
18+
19+
actorSystemMap->insert(std::make_pair(type, actorSystem));
20+
}
21+
};

VEngine/Code/Actors/IActorSystem.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#pragma once
2+
#include <vector>
3+
4+
struct Actor;
5+
6+
struct IActorSystem
7+
{
8+
virtual void GetActors(std::vector<Actor*>& outActors) = 0;
9+
};

VEngine/Source/AudioSystem.cpp renamed to VEngine/Code/Audio/AudioSystem.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
#include "AudioSystem.h"
2-
#include "Audio.h"
32
#include "Debug.h"
43

5-
//Little-Endian (Docs say that XBOX uses big endian)
64
#define fourccRIFF 'FFIR'
75
#define fourccDATA 'atad'
86
#define fourccFMT ' tmf'
97
#define fourccWAVE 'EVAW'
108
#define fourccXWMA 'AMWX'
119
#define fourccDPDS 'sdpd'
1210

13-
AudioSystem gAudioSystem;
14-
1511
void AudioSystem::Init()
1612
{
1713
HR(XAudio2Create(&audioEngine));
@@ -100,7 +96,7 @@ HRESULT AudioSystem::ReadChunkData(HANDLE file, void* buffer, DWORD bufferSize,
10096

10197
HRESULT AudioSystem::LoadWAV(const char* filename, WAVEFORMATEXTENSIBLE& waveFormat, XAUDIO2_BUFFER& buffer)
10298
{
103-
HANDLE file = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
99+
HANDLE file = CreateFileA(filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
104100

105101
if (INVALID_HANDLE_VALUE == file) {
106102
return HRESULT_FROM_WIN32(GetLastError());

0 commit comments

Comments
 (0)