From 485dfcc51ea548a50eec57b003bc3cb31cfdf579 Mon Sep 17 00:00:00 2001 From: Syntriax Date: Mon, 22 Jan 2024 23:42:30 +0300 Subject: [PATCH] BREAKING CHANGE: Removed Engine.Graphics --- Engine.Graphics/.gitignore | 484 ------------------ Engine.Graphics/Engine.Graphics.csproj | 16 - Engine.Graphics/Engine.Graphics.sln | 25 - .../Abstract/IDisplayableSprite.cs | 20 - .../DisplayableSpriteBehaviour.cs | 116 ----- Engine.sln | 6 - 6 files changed, 667 deletions(-) delete mode 100644 Engine.Graphics/.gitignore delete mode 100644 Engine.Graphics/Engine.Graphics.csproj delete mode 100644 Engine.Graphics/Engine.Graphics.sln delete mode 100644 Engine.Graphics/TwoDimensional/Abstract/IDisplayableSprite.cs delete mode 100644 Engine.Graphics/TwoDimensional/DisplayableSpriteBehaviour.cs diff --git a/Engine.Graphics/.gitignore b/Engine.Graphics/.gitignore deleted file mode 100644 index 5e57f18..0000000 --- a/Engine.Graphics/.gitignore +++ /dev/null @@ -1,484 +0,0 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -## -## Get latest from `dotnet new gitignore` - -# dotenv files -.env - -# User-specific files -*.rsuser -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Mono auto generated files -mono_crash.* - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -[Ww][Ii][Nn]32/ -[Aa][Rr][Mm]/ -[Aa][Rr][Mm]64/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ -[Ll]ogs/ - -# Visual Studio 2015/2017 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# Visual Studio 2017 auto generated files -Generated\ Files/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUnit -*.VisualState.xml -TestResult.xml -nunit-*.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# Benchmark Results -BenchmarkDotNet.Artifacts/ - -# .NET -project.lock.json -project.fragment.lock.json -artifacts/ - -# Tye -.tye/ - -# ASP.NET Scaffolding -ScaffoldingReadMe.txt - -# StyleCop -StyleCopReport.xml - -# Files built by Visual Studio -*_i.c -*_p.c -*_h.h -*.ilk -*.meta -*.obj -*.iobj -*.pch -*.pdb -*.ipdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*_wpftmp.csproj -*.log -*.tlog -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# Visual Studio Trace Files -*.e2e - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# AxoCover is a Code Coverage Tool -.axoCover/* -!.axoCover/settings.json - -# Coverlet is a free, cross platform Code Coverage Tool -coverage*.json -coverage*.xml -coverage*.info - -# Visual Studio code coverage results -*.coverage -*.coveragexml - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# Note: Comment the next line if you want to checkin your web deploy settings, -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# NuGet Symbol Packages -*.snupkg -# The packages folder can be ignored because of Package Restore -**/[Pp]ackages/* -# except build/, which is used as an MSBuild target. -!**/[Pp]ackages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/[Pp]ackages/repositories.config -# NuGet v3's project.json files produces more ignorable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt -*.appx -*.appxbundle -*.appxupload - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!?*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -orleans.codegen.cs - -# Including strong name files can present a security risk -# (https://github.com/github/gitignore/pull/2483#issue-259490424) -#*.snk - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm -ServiceFabricBackup/ -*.rptproj.bak - -# SQL Server files -*.mdf -*.ldf -*.ndf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings -*.rptproj.rsuser -*- [Bb]ackup.rdl -*- [Bb]ackup ([0-9]).rdl -*- [Bb]ackup ([0-9][0-9]).rdl - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat -node_modules/ - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) -*.vbw - -# Visual Studio 6 auto-generated project file (contains which files were open etc.) -*.vbp - -# Visual Studio 6 workspace and project file (working project files containing files to include in project) -*.dsw -*.dsp - -# Visual Studio 6 technical files -*.ncb -*.aps - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# CodeRush personal settings -.cr/personal - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -# Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config - -# Tabs Studio -*.tss - -# Telerik's JustMock configuration file -*.jmconfig - -# BizTalk build output -*.btp.cs -*.btm.cs -*.odx.cs -*.xsd.cs - -# OpenCover UI analysis results -OpenCover/ - -# Azure Stream Analytics local run output -ASALocalRun/ - -# MSBuild Binary and Structured Log -*.binlog - -# NVidia Nsight GPU debugger configuration file -*.nvuser - -# MFractors (Xamarin productivity tool) working folder -.mfractor/ - -# Local History for Visual Studio -.localhistory/ - -# Visual Studio History (VSHistory) files -.vshistory/ - -# BeatPulse healthcheck temp database -healthchecksdb - -# Backup folder for Package Reference Convert tool in Visual Studio 2017 -MigrationBackup/ - -# Ionide (cross platform F# VS Code tools) working folder -.ionide/ - -# Fody - auto-generated XML schema -FodyWeavers.xsd - -# VS Code files for those working on multiple tools -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json -*.code-workspace - -# Local History for Visual Studio Code -.history/ - -# Windows Installer files from build outputs -*.cab -*.msi -*.msix -*.msm -*.msp - -# JetBrains Rider -*.sln.iml -.idea - -## -## Visual studio for Mac -## - - -# globs -Makefile.in -*.userprefs -*.usertasks -config.make -config.status -aclocal.m4 -install-sh -autom4te.cache/ -*.tar.gz -tarballs/ -test-results/ - -# Mac bundle stuff -*.dmg -*.app - -# content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore -# General -.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - -# content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore -# Windows thumbnail cache files -Thumbs.db -ehthumbs.db -ehthumbs_vista.db - -# Dump file -*.stackdump - -# Folder config file -[Dd]esktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msix -*.msm -*.msp - -# Windows shortcuts -*.lnk - -# Vim temporary swap files -*.swp diff --git a/Engine.Graphics/Engine.Graphics.csproj b/Engine.Graphics/Engine.Graphics.csproj deleted file mode 100644 index e713f5c..0000000 --- a/Engine.Graphics/Engine.Graphics.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - net8.0 - disable - enable - - - - - - - - - - diff --git a/Engine.Graphics/Engine.Graphics.sln b/Engine.Graphics/Engine.Graphics.sln deleted file mode 100644 index 72d2235..0000000 --- a/Engine.Graphics/Engine.Graphics.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.5.002.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Engine.Graphics", "Engine.Graphics.csproj", "{79D95F74-10BD-4E69-90ED-CDFC1FB4F449}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {79D95F74-10BD-4E69-90ED-CDFC1FB4F449}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {79D95F74-10BD-4E69-90ED-CDFC1FB4F449}.Debug|Any CPU.Build.0 = Debug|Any CPU - {79D95F74-10BD-4E69-90ED-CDFC1FB4F449}.Release|Any CPU.ActiveCfg = Release|Any CPU - {79D95F74-10BD-4E69-90ED-CDFC1FB4F449}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {67B7E3F7-18AE-4E39-B4C4-CFCD760729D5} - EndGlobalSection -EndGlobal diff --git a/Engine.Graphics/TwoDimensional/Abstract/IDisplayableSprite.cs b/Engine.Graphics/TwoDimensional/Abstract/IDisplayableSprite.cs deleted file mode 100644 index 79f5f1c..0000000 --- a/Engine.Graphics/TwoDimensional/Abstract/IDisplayableSprite.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; - -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Syntriax.Engine.Core; -using Syntriax.Engine.Core.Abstract; - -namespace Syntriax.Engine.Graphics.TwoDimensional.Abstract; -public interface IDisplayableSprite : IDisplayable, IAssignableSprite -{ - Action? OnSpriteEffectsChanged { get; set; } - Action? OnOriginChanged { get; set; } - Action? OnColorChanged { get; set; } - Action? OnDepthChanged { get; set; } - - SpriteEffects SpriteEffects { get; set; } - Vector2 Origin { get; set; } - Color Color { get; set; } - float Depth { get; set; } -} diff --git a/Engine.Graphics/TwoDimensional/DisplayableSpriteBehaviour.cs b/Engine.Graphics/TwoDimensional/DisplayableSpriteBehaviour.cs deleted file mode 100644 index 7dd0f58..0000000 --- a/Engine.Graphics/TwoDimensional/DisplayableSpriteBehaviour.cs +++ /dev/null @@ -1,116 +0,0 @@ -using System; - -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Syntriax.Engine.Core; -using Syntriax.Engine.Core.Abstract; -using Syntriax.Engine.Graphics.TwoDimensional.Abstract; - -namespace Syntriax.Engine.Graphics.TwoDimensional; - -public class DisplayableSpriteBehaviour : Behaviour, IDisplayableSprite, IAssignableSprite -{ - public Action? OnSpriteAssigned { get; set; } = null; - public Action? OnSpriteEffectsChanged { get; set; } = null; - public Action? OnOriginChanged { get; set; } = null; - public Action? OnColorChanged { get; set; } = null; - public Action? OnDepthChanged { get; set; } = null; - - private ISprite _sprite = null!; - private Color _color = Color.White; - private float _depth = 0f; - private SpriteEffects _spriteEffects = SpriteEffects.None; - private Vector2 _origin = Vector2.One * .5f; - - - public ISprite Sprite => _sprite; - - public SpriteEffects SpriteEffects - { - get => _spriteEffects; - set - { - if (_spriteEffects == value) - return; - - _spriteEffects = value; - OnSpriteEffectsChanged?.Invoke(this); - } - } - - public Vector2 Origin - { - get => _origin; - set - { - if (_origin == value) - return; - - _origin = value; - OnOriginChanged?.Invoke(this); - } - } - - public Color Color - { - get => _color; - set - { - if (_color == value) - return; - - _color = value; - OnColorChanged?.Invoke(this); - } - } - - public float Depth - { - get => _depth; - set - { - if (_depth == value) - return; - - _depth = value; - OnDepthChanged?.Invoke(this); - } - } - - public void Draw(SpriteBatch spriteBatch) - { - if (!BehaviourController.GameObject.StateEnable.Enabled || !StateEnable.Enabled) - return; - - ITransform transform = BehaviourController.GameObject.Transform; - Vector2 position = transform.Position; - Vector2 scale = transform.Scale; - - Rectangle rectangle = new Rectangle((int)position.X, -(int)position.Y, (int)(Sprite.Texture2D.Width * scale.X), (int)(Sprite.Texture2D.Height * scale.Y)); - - spriteBatch.Draw(Sprite.Texture2D, rectangle, null, Color, transform.Rotation, new Vector2(Sprite.Texture2D.Width, Sprite.Texture2D.Height) * Origin, SpriteEffects, Depth); - } - - public bool Assign(ISprite sprite) - { - _sprite = sprite; - OnSpriteAssigned?.Invoke(this); - return true; - } - - public DisplayableSpriteBehaviour() => OnUnassigned += OnUnassign; - public DisplayableSpriteBehaviour( - Color? color = null, - float? depth = null, - SpriteEffects? spriteEffects = null, - Vector2? origin = null) - { - OnUnassigned += OnUnassign; - - _color = color ?? _color; - _depth = depth ?? _depth; - _spriteEffects = spriteEffects ?? _spriteEffects; - _origin = origin ?? _origin; - } - private void OnUnassign(IAssignable assignable) => _sprite = null!; -} diff --git a/Engine.sln b/Engine.sln index c96f33b..35f3e6c 100644 --- a/Engine.sln +++ b/Engine.sln @@ -7,8 +7,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Engine.Core", "Engine.Core\ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Engine.Input", "Engine.Input\Engine.Input.csproj", "{12149E55-1EE8-45B4-A82E-15BA981B0C6A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Engine.Graphics", "Engine.Graphics\Engine.Graphics.csproj", "{F3CC78C2-A9A9-4C2F-8675-6A491B7D29E0}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -26,9 +24,5 @@ Global {12149E55-1EE8-45B4-A82E-15BA981B0C6A}.Debug|Any CPU.Build.0 = Debug|Any CPU {12149E55-1EE8-45B4-A82E-15BA981B0C6A}.Release|Any CPU.ActiveCfg = Release|Any CPU {12149E55-1EE8-45B4-A82E-15BA981B0C6A}.Release|Any CPU.Build.0 = Release|Any CPU - {F3CC78C2-A9A9-4C2F-8675-6A491B7D29E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F3CC78C2-A9A9-4C2F-8675-6A491B7D29E0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F3CC78C2-A9A9-4C2F-8675-6A491B7D29E0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F3CC78C2-A9A9-4C2F-8675-6A491B7D29E0}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal