Skip to content

Commit

Permalink
Setup codebase hierarchy and submodules.
Browse files Browse the repository at this point in the history
  • Loading branch information
kornman00 committed Jan 12, 2020
0 parents commit 6fcf016
Show file tree
Hide file tree
Showing 14 changed files with 141 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[submodule "KSoft"]
path = KSoft
url = https://@github.com/KornnerStudios/KSoft.git
[submodule "Games/Blam"]
path = Games/Blam
url = https://github.com/KornnerStudios/KSoft.Blam.git
[submodule "Games/Phoenix"]
path = Games/Phoenix
url = https://github.com/KornnerStudios/KSoft.Phoenix.git
[submodule "Games/PhxStudio"]
path = Games/PhxStudio
url = https://github.com/KornnerStudios/PhxStudio.git
[submodule "Games/Wwise"]
path = Games/Wwise
url = https://github.com/KornnerStudios/KSoft.Wwise.git
1 change: 1 addition & 0 deletions Games/Blam
Submodule Blam added at 4c50d7
1 change: 1 addition & 0 deletions Games/Phoenix
Submodule Phoenix added at 32ab04
1 change: 1 addition & 0 deletions Games/PhxStudio
Submodule PhxStudio added at bca591
1 change: 1 addition & 0 deletions Games/Wwise
Submodule Wwise added at d7b9b2
1 change: 1 addition & 0 deletions KSoft
Submodule KSoft added at 7a4f6e
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2020 Kornner Studios

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
78 changes: 78 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# What is Vita?

Vita _was_ the codename for what are now just the KSoft libraries.

Vita is the logical amalgatmation of many related and dependent codebases, primarily written in C++ and C#.NET, which are produced and developed by Kornner Studios.

Vita began as a closed source project back in November of 2009 (so we predate the [PS Vita][WikiPSVita]). It wasn't until the beginning of 2014 when it was transitioned to an open source product.

As of 2020, we've switched to git. Previously, many of the projects were using Hg for source control. Since the move to git, we setup this monolithic repository to link together everything via the power of submodules!

Etymologically speaking, "Vita" is the Latin word for "life". If you're reading this, then it is very likely that coding is a part of your life, as it is to Vita's developers.

[WikiPSVita]: http:https://en.wikipedia.org/wiki/PlayStation_Vita#Post-announcement

# What is KSoft?
KSoft is the codename of the C#/.NET-centric part of the Vita codebase.

The [KSoft.BCL][KSoftBCL] (Base Class Libraries) embodies many generalized systems that we have developed to supplement our specialized projects (which are located in external repositories).

Some projects are open source (eg, [KSoft.Blam][KSoftBlam], for targeting the [Halo][WikiHaloFPS] engine), some closed (eg, KSoft.XDK, for targeting multi-generation [Xbox Development Kits][WikiXDK]).

[KSoftBCL]: https://github.com/KornnerStudios/KSoft
[KSoftBlam]: https://github.com/KornnerStudios/KSoft.Blam
[WikiHaloFPS]: http:https://en.wikipedia.org/wiki/Halo_%28series%29#Original_trilogy
[WikiXDK]: http:https://en.wikipedia.org/wiki/Xbox_Development_Kit

# License?
The default license of Vita projects is the [MIT License][LicenseMIT]

[LicenseMIT]: http:https://www.linfo.org/mitlicense.html

# KSoft.BCL Goals
The [KSoft Base Class Library][KSoftBCL] aims to provide a compartmentalized framework which provides functionality not present, or at least efficiently, in the .NET framework proper.

"Compartmentalized", in that non-critical systems like KSoft.Security are outside the actual root assembly, just named "KSoft".

Example functionality which you can't find in the .NET framework is a BitStream class. We also provide utilities for treating and using Enums as actual bit flags, in an optimized and complete manner.

We're also very, very reliant on using [T4 Text Templates][MsdnT4] to generate most code which would otherwise be copy and pasted to fit the context of like-wise types. For example, our static KSoft.Bits (located in KSoft's _Bitwise_ folder) class uses a single T4 template to generate the BitCount() method for the usual unsigned integer types (UInt32, etc)

[MsdnT4]: http:https://msdn.microsoft.com/en-us/library/bb126445.aspx

## Our BitStream
You will actually be hard pressed to find a decent, comprehensive BitStream class for .NET anywhere on The 'Net. The most comprehensive one that I know of is featured in [a CodeProject article][CodeProjectBitStream]. To compare the two:

* **They** require a complete, internal copy of the stream's bytes; **KSoft** supports actual streaming (using a BaseStream) and use a configurable (at compile time) cache 'word' (32 or 64 bits) where bits reside until being flushed to the BaseStream

* **They** were last updated in 2005 and have unpatched bugs; **KSoft** has a tried and tested class. Tested in both regular use and with Unit Tests to validate core operations. A patched version of the article is used in our Unit Testing to check compatibility

* **They** have a #region infested, monolithic .cs file; **KSoft** makes use of partial classes and code generation using T4 to keep the files _bite_-sized and copy&paste code to a minimum

[CodeProjectBitStream]: http:https://www.codeproject.com/Articles/12261/A-BitStream-Class-for-the-NET-Framework

## [Flags]Enum++
The .NET framework offers a [Enum.HasFlag()][EnumHasFlagMsdn] object method which you can use to test that an enum. Unfortunately, that method is [far from efficient][EnumHasFlagSO].

Using code generation (via Linq Expressions), we're able to address the inefficiencies found in .NET's Enum.HasFlag(). We don't perform any boxing and can operate on the underlying type (ie, integer) of the enum instead of using UInt64 as a catch-all.

We take this one step further still and provide functionality for Add, Remove, and Modify as methods. What's great about this is that you're able to add a new semantic level to bit flag operations in your code, instead of bleeding your enum values together with the normal bit-wise operators.

If we so desired (and we presently don't), we could even modify the code generator to add checks to **DEBUG** assemblies that validate the flags being used in bit operations (Test, Add, etc) have named members in the enum type.

If there are other .NET languages which don't (easily) offer bit flag operations on enum types, I'm sure our utilities would prove their use once again in adding such support.

[EnumHasFlagMsdn]: http:https://msdn.microsoft.com/en-us/library/system.enum.hasflag%28v=vs.110%29.aspx
[EnumHasFlagSO]: http:https://stackoverflow.com/questions/7368652/what-is-it-that-makes-enum-hasflag-so-slow

## Building
Before you try building any of the projects, first [read the requirements](https://bitbucket.org/KornnerStudios/ksoft/wiki/Requirements) you may need.

[KSoft.T4][KSoftT4] should always be the first thing that gets built. It's the meta assembly used by many of the T4 documents that are found in all the other assemblies. It's only needed when building projects, not at runtime.

**NOTE**: The BCL contains some C++/cli projects, which cause the 'Win32' Platform to be defined. The only projects that get built with this active platform are these C++/cli projects. Instead, you should opt for the 'x86' and 'x64' Platforms which will also build the .NET assemblies. Long story short, *don't* select 'Win32' for your active configuration.

However, at the time of this writing these C++/cli projects haven't been populated with meaningful code, so you're currently safe just building for 'Any CPU'

[KSoftT4]: https://github.com/KornnerStudios/KSoft/tree/master/KSoft.T4

1 change: 1 addition & 0 deletions _bin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Project binares like exes/dlls and their dependencies will be output here
1 change: 1 addition & 0 deletions _lib/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Project native (C++) libraries like libs/dlls and any dependencies will be output here
1 change: 1 addition & 0 deletions _obj/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Project intermediate files .obj files, etc will be output here
1 change: 1 addition & 0 deletions _test_results/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Project unit test results should be output here
17 changes: 17 additions & 0 deletions shared/external_libraries/ICSharpCode.SharpZipLib.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Copyright © 2000-2018 SharpZipLib Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
1 change: 1 addition & 0 deletions shared/external_libraries/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Commonly shared external libraries should be present here. Or, you know, I should get on the nuget train. Someday. Choo choo.

0 comments on commit 6fcf016

Please sign in to comment.