Closed AdamsLair closed 9 years ago
In theory, everything except plugin loading could be moved into a platform plugin. Maybe loading an Assembly from file could be done using a delegate, which the launcher provides. Since the launcher needs to be platform-specific anyway, that could be a good place for this.
On second thought, the platform backend stuff could also be provided by the launcher itself - as an alternative to providing it via plugin. Maybe not a great idea, tying those two.
Progress:
Immediate ToDo:
Progress:
Immediate ToDo:
TypeInfo
rather than Type
.System.Drawing
To verify each step and ToDo, check the .Net Portability analyzer VS extension for reference. (Edit: Maybe just create a second .csproj with the portable config until it compiles?)
Getting rid of System.Drawing
has one problem: Former Pixmap.Layer
/ PixelData
uses Bitmap internally for compressing image data using PNG. This needs to be replaced by something else.
System.Drawing.Bitmap
Maybe DevIL might help? http://openil.sourceforge.net/
Maybe DevIL might help? http://openil.sourceforge.net/
Unfortunately, since the overarching goal of this is portability, I can only use .Net libraries that are portable as well - written in 100% managed code and without native DllImport
. DevIL would require a native library in the backend, which is not an option in this case. :(
By now, I have also asked on StackOverflow on this particular matter and it looks like that PngCs library might actually be an option.
Ah, missed that part.. my bad
Progress:
System.Drawing.Bitmap
, the culprit being DeflateStream
.ImageCodec
for the internally used image compression. They all get an ID, so deserialized PixelData can choose the appropriate one. Serializing PixelData could just choose a PNG codec by priority.Progress:
Rect
and MathF
to the Primitives project.Point2
struct as a non-math int
version of Vector2
and replaced System.Drawing.Point
core usages with it.StreamWrapper
classes are now PCL-compatible.ResourceManager
. It's also more concise and half-automated now.Immediate ToDo:
ResourceManager
with an embedded / manifest resource stream variant.
EditorHintImage
attribute, as well as its editor resolver.TypeInfo
rather than Type
.System.Drawing
Progress:
Immediate ToDo:
TypeInfo
rather than Type
.
System.Drawing
Progress:
Immediate ToDo:
TypeInfo
rather than Type
.
System.Drawing
Progress:
Immediate ToDo:
TypeInfo
rather than Type
.
FormatterServices.GetUninitializedObject
is unavailable. This needs to be replaced with a more sophisticated object creation algorithm in ReflectionHelper.CreateInstanceOf
in order to assure serialization and cloning to work.Activator
class for creating a default one? Investigate if there's a faster way using Expressions. Also, see here.Activator
method.ReflectionHelper.cs
to the point where intellisense doesn't report errors in the PCL dummy project.System.Drawing
Progress:
CreateInstanceOf
to make sure not to screw things up.ObjectCreator
class, tidying up ReflectionHelper a bit more.FormatterServices.GetUninitializedObject
with some more sophisticated code for object creation that attempts to use all available constructors (sorted from trivial to complex) until it finds one that works.
default(T)
on each argument.Immediate ToDo:
MemberInfoEquals
. Write unit tests and change its implementation not to use MetadataTokens, as PCL MemberInfo
s do not have them.ConsoleLogOutput
to the launcher, also open the logfile there and pass the stream to the core.
ISystemBackend
API. Leave it empty first and gradually add things.System.Drawing
Progress:
MemberInfoEquals
.MemberInfoEquals
from ReflectionHelper
to ExtMethodsMemberInfo.IsEquivalent
.MetadataToken
.Immediate ToDo:
ConsoleLogOutput
to the launcher, also open the logfile there and pass the stream to the core.
ISystemBackend
API. Leave it empty first and gradually add things.System.Drawing
Progress:
ConsoleLogOutput
to the launcher.System.Drawing.Bitmap
as a target.Immediate ToDo:
ISystemBackend
API. Leave it empty first and gradually add things.System.Drawing
Progress:
ImageCodec
Abstraction layer.System.Drawing
stuff from Pixmap
and PixelData
.System.Drawing.Bitmap
-based image codec, directly in the core for now.Pixmap
and PixelData
are now PCL-compatible!Immediate ToDo:
ISystemBackend
API. Leave it empty first and gradually add things.BitmapImageCodec
into that plugin.System.Drawing
Progress:
BitmapImageCodec
into that plugin.Immediate ToDo:
ISystemBackend
API. Leave it empty first and gradually add things.System.Drawing
Progress:
XmlSerializer
was upgraded to allow writing primitive value type arrays as comma-separated lists, which significantly shrinks Font Resources in XML, as they contain a lot of int[]
of kerning sample data.Immediate ToDo:
ISystemBackend
API. Leave it empty first and gradually add things.System.Drawing
Progress:
Immediate ToDo:
ISystemBackend
API. Leave it empty first and gradually add things.System.Drawing
Progress:
Immediate ToDo:
ISystemBackend
API. Leave it empty first and gradually add things.System.Drawing
Progress:
System.Drawing
is no longer a dependency of the Duality core.Immediate ToDo:
ISystemBackend
API. Leave it empty first and gradually add things.Progress:
pcl_wip
branch back into master
due to the increasingly high amount of bugfixes and tweaks in there. Also, the branch has reached a quite usable state with the only WiP part being a single experimental project file for the core.Immediate ToDo:
ISystemBackend
API. Leave it empty first and gradually add things.Progress:
IPluginLoader
abstraction, which is used by the (portable) core to pull in all plugins, including the actual backend. An implementation of this is provided via DualityApp.Init
.IPluginLoader
implementation.Immediate ToDo:
Path
replacement class (PathOp
?) and move it to a Duality.IO
namespace, together with those streaming classes and other IO-related stuff.
System.IO.Path
wherever possible.ISystemBackend
API. Leave it empty first and gradually add things.ISystemBackend
API.Progress:
PathStr
class to Duality.IO
that mirrors System.IO.Path
functionality in a (mostly) platform-agnostic way. Used it instead of Path
in the Duality core. Added thorough unit tests for it.AbstractShader
and AudioData
no longer expose (uncritical) file path IO functionality to comply with PCL subset.Immediate ToDo:
ISystemBackend
API. Leave it empty first and gradually add things.ISystemBackend
API. Consider wrapping it in a separate IFileSystem
interface, so ISystemBackend
doesn't enter godmode.Type
/ TypeInfo
conversion errors.
TypeInfo
instead of Type
, as most operations require deep knowledge anyway.TypeInfo
. Their surrogate and explicit API needs to be adjusted.ObjectCreator
needs to be adjusted.ReflectionHelper
should be considered for adjustment.Progress:
PathStr
to PathOp
due to future API considerations.Type
/ TypeInfo
compiler errors.Immediate ToDo:
ISystemBackend
API. Leave it empty first and gradually add things.ISystemBackend
API. Consider wrapping it in a separate IFileSystem
interface, so ISystemBackend
doesn't enter godmode.Type
/ TypeInfo
conversion errors.
TypeInfo
instead of Type
, as most operations require deep knowledge anyway.TypeInfo
.ReflectionHelper
should be considered for adjustment.Progress:
Type
/ TypeInfo
compiler errors.Immediate ToDo:
ISystemBackend
API. Leave it empty first and gradually add things.ISystemBackend
API. Consider wrapping it in a separate IFileSystem
interface, so ISystemBackend
doesn't enter godmode.Progress:
ISystemBackend
and IFileSystem
interfaces, and an implementation for both in the DotNetFramework backend plugin. There is also a dummy implementation directly in the core, which acts as a fallback.DirectoryOp
and FileOp
classes, which internally use the currently active ISystemBackend
for file system access.System.IO
file system access in the core with their new Duality equivalents.Immediate ToDo:
Progress:
Closing this.
In preparation for later cross-platform ports, Duality might need to lose some dependencies:
OpenTK, Farseer, NVorbis)As an alternative, Duality could use the Bait-And-Switch method to provide a pseudo PCL layer and provide different core binaries for different platforms. If achievable, however, it would be preferable if the Duality core was an actual PCL and all platform-specifics could be moved to a plugin.