diff --git a/.gitignore b/.gitignore index 6fa8661..034fda7 100755 --- a/.gitignore +++ b/.gitignore @@ -1,23 +1,14 @@ -# Created by https://www.gitignore.io/api/monodevelop - -### MonoDevelop ### -#User Specific -*.userprefs -*.usertasks - -#Mono Project Files -*.pidb -*.resources -test-results/ - -# End of https://www.gitignore.io/api/monodevelop +# Created by https://www.gitignore.io/api/csharp,visualstudiocode +# Edit at https://www.gitignore.io/?templates=csharp,visualstudiocode +### Csharp ### ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore # User-specific files +*.rsuser *.suo *.user *.userosscache @@ -26,6 +17,9 @@ test-results/ # User-specific files (MonoDevelop/Xamarin Studio) *.userprefs +# Mono auto generated files +mono_crash.* + # Build results [Dd]ebug/ [Dd]ebugPublic/ @@ -33,6 +27,8 @@ test-results/ [Rr]eleases/ x64/ x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ bld/ [Bb]in/ [Oo]bj/ @@ -90,6 +86,7 @@ StyleCopReport.xml *.tlh *.tmp *.tmp_proj +*_wpftmp.csproj *.log *.vspscc *.vssscc @@ -216,12 +213,14 @@ 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/ +!?*.[Cc]ache/ # Others ClientBin/ @@ -265,6 +264,7 @@ ServiceFabricBackup/ *.bim.layout *.bim_*.settings *.rptproj.rsuser +*- Backup*.rdl # Microsoft Fakes FakesAssemblies/ @@ -300,12 +300,8 @@ paket-files/ # FAKE - F# Make .fake/ -# JetBrains Rider -.idea/ -*.sln.iml - -# CodeRush -.cr/ +# CodeRush personal settings +.cr/personal # Python Tools for Visual Studio (PTVS) __pycache__/ @@ -343,4 +339,23 @@ ASALocalRun/ .mfractor/ # Local History for Visual Studio -.localhistory/ \ No newline at end of file +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history + +# End of https://www.gitignore.io/api/csharp,visualstudiocode \ No newline at end of file diff --git a/References/RecrownedAthenaeum.Pipeline.dll b/References/RecrownedAthenaeum.Pipeline.dll index c9d9e39..06f8b9f 100644 Binary files a/References/RecrownedAthenaeum.Pipeline.dll and b/References/RecrownedAthenaeum.Pipeline.dll differ diff --git a/References/RecrownedAthenaeum.Pipeline.xml b/References/RecrownedAthenaeum.Pipeline.xml new file mode 100644 index 0000000..7fa04bb --- /dev/null +++ b/References/RecrownedAthenaeum.Pipeline.xml @@ -0,0 +1,8 @@ + + + + RecrownedAthenaeum.Pipeline + + + + diff --git a/References/RecrownedAthenaeum.dll b/References/RecrownedAthenaeum.dll index ceb0517..c842423 100644 Binary files a/References/RecrownedAthenaeum.dll and b/References/RecrownedAthenaeum.dll differ diff --git a/References/RecrownedAthenaeum.xml b/References/RecrownedAthenaeum.xml index 71e4236..dc70488 100644 --- a/References/RecrownedAthenaeum.xml +++ b/References/RecrownedAthenaeum.xml @@ -4,51 +4,215 @@ RecrownedAthenaeum - + - The settings the sprite batch should use. + A generic camera. Functions in 3D. - + - Defines sprites sort mode. + The scale for the world. - + - The blend state to use. + Current position in the world. - + - Sampler state to use. + The place the 3D camera is looking at. - + - The depth stencil state to use. + The direction up is for the camera. - + - The rasterizer state to use. + The transform matrix representing the world (rotation and translations of the original world). - + - The effect to use. + The view matrix that describes where the camera looks. - + - The transformation matrix to use. + The projection matrix. - + - Begins the given sprite batch with the current set of settings. + A basic effect that will be updated with the correct matrice information everytime is called. Can be null and thus will not be used. - Begins the spritebatch with the given settings. + + + + Constructs 3D camera with an orthographic projection matrix with dimensions of graphics devices viewport. All changes to matrices should have apply called after changes. + + A basic effect that will be updated with the correct matrice information everytime is called. Can be null and thus will not be used. + + + + Applies the changes to the fields and properties of the camera. + + + + + Moves camera by the given amount. + + A that contains how much in each direction to move. + + + + A simple utility object that will start and end a scissor setup given a to work with. + + + + + Initializes the basic scissor. + + + + + Begins the with scissoring in mind. + + The rectangle to use to outline the scissor. + The consistent sprite batch to use for this process. + + + + Ends the scissor state of the spritebatch. + + + + + A that keeps it's settings through begin and end unless manually changed either by the or through changing the fields. Note that changing the fields while the batch has begun will not take effect until the next time the batch is started. + Casting this as a will not persist the configuration and will call the normal . + + + + + How to blend the colors. Uses 's default if not set before or during call. + Changes will only take effect on call. + + + + + The state of sampler to use for the spritebatch. Uses 's default if not set before or during call. + Changes will only take effect on call. + + + + + The state of the depth-stencil buffer. Uses 's defaultdefault if not set before or during call. + Changes will only take effect on call. + + + + + The state of rasterizer to use. Uses 's default if not set before or during call. + Changes will only take effect on call. + + + + + An effect to apply to the batch. Uses 's default if not set before or during call. + Changes will only take effect on call. + + + + + A matrix to be applied to transform the sprites geometry. An identity matrix is used if not provided before or during call. + Changes will only take effect on call. + + + + + Creates a consistent sprite batch with default values. + + The graphics device to use to create a . + + + + Begins the consistent sprite batch. The configuration passed to this function is saved for later begin calls. + + Defines the spritebatch's method of sorting the items in each batch. Uses 's default. + How to blend the colors. Uses 's default if not set and field is also not set. + The state of sampler to use for the spritebatch. Uses 's default if not set and field is also not set. + What type of rasterization to use. Uses 's default if not set and field is also not set. + What type of rasterization to use. Uses 's default if not set and field is also not set. + An effect to apply to the batch. Uses 's default if not set and field is also not set. + A matrix to be applied to transform the sprites geometry. Uses 's default if not set and field is also not set. + + + + Begins the consistent sprite batch without saving the configuration. Useful for one time changes to one portion of the configuration. + + Defines the spritebatch's method of sorting the items in each batch. Uses 's default. + How to blend the colors. Uses 's default if not set and field is also not set. + The state of sampler to use for the spritebatch. Uses 's default if not set and field is also not set. + What type of rasterization to use. Uses 's default if not set and field is also not set. + What type of rasterization to use. Uses 's default if not set and field is also not set. + An effect to apply to the batch. Uses 's default if not set and field is also not set. + A matrix to be applied to transform the sprites geometry. Uses 's default if not set and field is also not set. + + + + A virtual 2D camera that wraps the normal . Default projection is orthographic. + + + + + The width of the view of the camera. + + + + + The height of the view of the camera. + + + + + The 2D position. + + + + + Places camera in the center given the corner position. + + + + + A 2D camera from the generic . + + Width of camera view. + Height of camera view. + A basic effect that will be updated with the correct matrice information everytime is called. Can be null and thus will not be used. + + + + Applies for 2D. + Sets where the camera is looking for the view matrix to the position of the camera. + + + + + Lerps to the given position. + + The multiplier for difference in distance. + The target position to lerp to. + Time between this frame and the previous frame. + + + + Moves the camera. + Apply needs to be called. + + Magnitude of how much to move per axis. @@ -60,12 +224,11 @@ The used. Needs to be disposed. - + Creates a rectangle renderer with the given . - Camera to use for . Default will use . - Graphics device to use. Default will use . + Graphics device to use. @@ -117,19 +280,19 @@ Amount of primitives. - + Creates a batch used to draw primitives. - The current camera being used. Will use default set in if left null. - The graphics device used to draw the primitives. Will be using 's graphics device from graphics device manager if null. Default is null. + The graphics device used to draw the primitives. The amount of vertices every batch can hold before flushing. Default is 450. Should be changed to be the most optimal number if possible to prevent unnecessary resizing. Especially if using strip primitive types. - + Starts the batch. Batch cannot be started twice. The type of primitive this batch would be drawing. + Effect to use to render the primitives. Default will use a with parameters set up during creation. @@ -165,115 +328,6 @@ Destructor. - - - A generic 3D camera. - - - - - Current position in the world. - - - - - The place the 3D camera is looking at. - - - - - The direction up is for the 3D camera. - - - - - The transform matrix representing the world (rotation and translations of the original world). - - - - - The view matrix that describes where the camera looks. - - - - - The projection matrix. - - - - - The graphics device used - - - - - The basic effect that contains the transformations. - - - - - Constructs 3D camera with an orthographic projection matrix with dimensions of graphics devices viewport. All changes to matrices should have apply called after changes. - - The graphics device to use. Will use graphics device from 's graphics device manager if this is null which it is by default. - - - - Applies the changes to the fields and properties of the camera. - - - - - Moves camera by the given amount. - - A that contains how much in each direction to move. - - - - A virtual 2D camera that wraps the normal . Default projection is orthographic. - - - - - The zoom of the camera. - - - - - The 2D position. - - - - - Places camera in the center given the corner position. - - - - - A 2D camera from the generic . - - The graphics device to use if not using the one in . - - - - Applies for 2D. - Sets where the camera is looking for the view matrix to the position of the camera. - - - - - Lerps to the given position. - - The multiplier for difference in distance. - The target position to lerp to. - Time between this frame and the previous frame. - - - - Moves the camera. - Apply needs to be called. - - Magnitude of how much to move per axis. - Wrapper for the content manager that helps with controlling it by adding automated multithreaded content loading. @@ -367,32 +421,12 @@ The path to modify. - - - All variables here should be for RecrownedAthenaeum to use when needed and thus eliminates unessecary passing. - - - - - The graphics device that will be used by default. - - - - - 2D camera to be used by default. - - - - - The begin sprite batch to use for custom begins and consistency. - - A wrapper that makes sure anything implementing can be drawn with options. - + Should draw whatever implements this. @@ -423,19 +457,16 @@ Top side. The dimensions and potentially the coordinates of the rectangle on an atlas. If left to default of null, will only be set to texture bounds. - + Draws the ninepatch. Batch to use. - Where to the patch. The color of the patch. - The sprite batch settings to use to begin the batch in after drawing the ninepatch. + Where to the patch. - + - Draw with more options. - Uses the default for the spritebatch settings. Spritebatch to use. The destination to draw the patch. @@ -510,7 +541,7 @@ The texture representing the overall atlas. - + Draw the region given by a string in the atlas onto a destination rectangle. @@ -526,7 +557,7 @@ Creates or obtains a previously created texture of a region. Name of region. - graphics device to be used. Default is null and will resort to using graphics device from 's graphics device manager. + graphics device to be used to generate the texture. The texture from the region. @@ -581,7 +612,7 @@ A definition for the region. The texture that holds the image data for the atlas. - + Draws the region. If ninepatch, rotation and origin are ignored. @@ -595,16 +626,9 @@ Create or obtains a previously created texture of this region. - The graphics device to use to create the texture. Will use graphics device from 's graphics device manager if left to null. + The graphics device to use to create the texture. The texture of the region. - - - Compares this region to another in terms of name. - - The other region to compare to in terms of name. - Less than one if precedes, greater than one if after, 0 if same. - Call this to dispose. @@ -947,7 +971,7 @@ Whether or not this transition is waiting on something. Usually the . If this returns true, then it is considered that this transition is complete. - + Called once every frame while transition is active. Meant to draw transition. @@ -985,7 +1009,7 @@ The window dimensions. - + Draws the transition. @@ -1039,7 +1063,7 @@ - Whether or not to continue rendering this screen onto a buffer for the benifit of the next screen to use as a transition. + Whether or not to continue rendering this screen onto a buffer for the benefit of the next screen to use as a transition. @@ -1052,19 +1076,14 @@ The next screen to be displayed after exit transition finishes. May be null, leading to transition to previous screen or loading screen. - + - The current window size. + The current window dimensions. - + - Whether or not screen have been initiated. - - - - - The 2D camera to be used for the screen. + The current window dimensions. @@ -1078,10 +1097,12 @@ True to start in entering transition state. - + - Called only once after initialization to give required parameters. + Called when screen size is set. + The width of the screen. + The height of the screen. @@ -1089,7 +1110,7 @@ Game time information. - + Called to draw this screen. @@ -1131,7 +1152,7 @@ The previous screen's render buffer. - + Called when the first screen is being shown. @@ -1142,12 +1163,12 @@ A manager for screens. Helps with transitions and updating screens as well as resizes. - + Called when the first loading screen is done, and needs to show the landing screen. - + The settings this manager will use to begin a sprite batch. @@ -1157,13 +1178,11 @@ Currently displayed screen. - + - Creates a screen manager that helps manage multiple screens and their transitions. + Creates a screen manager that helps update, draw, and manage multiple screens and their transitions. Uses its own . - The camera to be used to perform the correct translations and transformations. Will use default set in if left null. - The graphics device manager to be used. Will use default set in if left null. - The settings to begin spritebatch with. Will use the built-in one in screen manager if not provided. + The graphics device manager to be used. @@ -1172,11 +1191,12 @@ Contains the time that has passed from the last frame. Whether or not there is something a transition should be waiting for. Usually used to wait for assets to complete loading. - + Renders screen into window. + Starts and ends the given . - Uses this batch to render. + The consistent sprite batch to use. Needs to be consistent as changing render targets requires ending and beginning the sprite batch. @@ -1211,23 +1231,36 @@ Contains the pages. - + + + The camera to use to change between pages. + + + Creates a book. that holds the assets that are to be used in the pages for this book during initialization. The skin that will be passed to pages during their initialization. + Camera to move to change pages. - + Should be called whenever a valid camera and dimensions for the book exist. Initializes book with given parameters. - Generally used with a and called in the function. + Generally used with a and called in the function. - Camera game is currently using. + Camera to move to change pages. Dimensions of the book and the dimensions the pages will use. - + + + Applies the size if the book's pages. + + The width of one page. + The height of one page. + + Draws the pages. @@ -1312,12 +1345,13 @@ New width. New Height - + Called only once after a page is added to a . Generally used to instantiate the modules of the page. The assets to be used during initialization passed by the book this page belongs to. The skin the book containing this page is given that can be used by this page. + The scissor box to use for cropping. @@ -1355,13 +1389,13 @@ Texture to use. - + Draws the image with default values. The batch to use. - + Draws the image with more options. @@ -1420,7 +1454,7 @@ The skin the definition is defined in. The definition itself. - + Draws the button. @@ -1490,7 +1524,7 @@ Snapshot of information about time for game. - + Called whenever game wants to render this button. @@ -1544,7 +1578,7 @@ The game time. - + Draws the text. @@ -1617,7 +1651,7 @@ Game time information. - + Called every frame to draw this module. Anything that needs to be drawn should go here. @@ -1671,24 +1705,16 @@ Contains a group of modules and has its own relative coordinate system. - + - Camera used by the module for cropping. + Set this to crop anything that flows out of the boundaries of this group. Will not crop if this is null. - + - Creates a module group. + Draws this group of modules. If scissoring, will use the matrix and effect designated in the to begin the batch normally again. - Whether or not to crop out of bounds. Default is false. - What camera to use for cropping. Default is null and will use 's camera if crop is enabled. - The settings to be used that begins the batch. - - - - Draws this group of modules. - - Batch used to draw the group. + Batch used to draw the group. @@ -1796,7 +1822,7 @@ The texture for the cursor. - + Draws a region from the texture atlas. @@ -1868,7 +1894,7 @@ Name of defined color. Will use "default" if null. Default value is null. The defined color based on the name given. - + Draws a region from the texture atlas. @@ -1976,7 +2002,7 @@ - The user loaded skin. Set by the skin loaded by calling . + The user loaded skin resulted from asynchronous . @@ -2001,13 +2027,12 @@ the path to load from. A that holds all the information and some metadata for the loaded skin. - + loads a skin asynchronously to the . - Graphics device to use for texture creation. Uses graphics device from by default. - The data to generate from. The path pointing to the file with the extension "". + Graphics device to use for texture creation. diff --git a/RhythmBullet.code-workspace b/RhythmBullet.code-workspace new file mode 100644 index 0000000..a87d18c --- /dev/null +++ b/RhythmBullet.code-workspace @@ -0,0 +1,7 @@ +{ + "folders": [ + { + "path": "RhythmBullet" + } + ] +} \ No newline at end of file diff --git a/RhythmBullet.sln b/RhythmBullet.sln deleted file mode 100644 index f8a44a5..0000000 --- a/RhythmBullet.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28010.2019 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RhythmBullet", "RhythmBullet\RhythmBullet.csproj", "{4242553D-40F9-40F0-9AE6-CB6771DD9CF9}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4242553D-40F9-40F0-9AE6-CB6771DD9CF9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4242553D-40F9-40F0-9AE6-CB6771DD9CF9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4242553D-40F9-40F0-9AE6-CB6771DD9CF9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4242553D-40F9-40F0-9AE6-CB6771DD9CF9}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {C7334E35-D9AE-4FF0-A8AE-DC3A1ED7CB86} - EndGlobalSection -EndGlobal diff --git a/RhythmBullet/.vscode/launch.json b/RhythmBullet/.vscode/launch.json new file mode 100644 index 0000000..22f336a --- /dev/null +++ b/RhythmBullet/.vscode/launch.json @@ -0,0 +1,27 @@ +{ + // Use IntelliSense to find out which attributes exist for C# debugging + // Use hover for the description of the existing attributes + // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md + "version": "0.2.0", + "configurations": [ + { + "name": ".NET Core Launch (console)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + // If you have changed target frameworks, make sure to update the program path. + "program": "${workspaceFolder}/bin/Debug/netcoreapp2.0/RhythmBullet.dll", + "args": [], + "cwd": "${workspaceFolder}", + // For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window + "console": "internalConsole", + "stopAtEntry": false + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach", + "processId": "${command:pickProcess}" + } + ] +} \ No newline at end of file diff --git a/RhythmBullet/.vscode/tasks.json b/RhythmBullet/.vscode/tasks.json new file mode 100644 index 0000000..2662bc8 --- /dev/null +++ b/RhythmBullet/.vscode/tasks.json @@ -0,0 +1,36 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/RhythmBullet.csproj" + ], + "problemMatcher": "$tsc" + }, + { + "label": "publish", + "command": "dotnet", + "type": "process", + "args": [ + "publish", + "${workspaceFolder}/RhythmBullet.csproj" + ], + "problemMatcher": "$tsc" + }, + { + "label": "watch", + "command": "dotnet", + "type": "process", + "args": [ + "watch", + "run", + "${workspaceFolder}/RhythmBullet.csproj" + ], + "problemMatcher": "$tsc" + } + ] +} \ No newline at end of file diff --git a/RhythmBullet/Audio/Visualizer/ReflectedHorizontalVisualizer.cs b/RhythmBullet/Audio/Visualizer/ReflectedHorizontalVisualizer.cs index b2c7cfc..63a1aab 100644 --- a/RhythmBullet/Audio/Visualizer/ReflectedHorizontalVisualizer.cs +++ b/RhythmBullet/Audio/Visualizer/ReflectedHorizontalVisualizer.cs @@ -1,6 +1,5 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using RecrownedAthenaeum.Camera; using RecrownedAthenaeum.Render; using RecrownedAthenaeum.UI.Modular; using System; @@ -28,7 +27,7 @@ namespace RhythmBullet.Audio.Visualizer binsPerBar = tsp.GetCurrentSpectrum().Length / BAR_COUNT; barValue = new int[BAR_COUNT]; - rectangleRenderer = new RectangleRenderer(); + rectangleRenderer = new RectangleRenderer(graphicsDevice); } public override void Update(GameTime gameTime) @@ -39,7 +38,7 @@ namespace RhythmBullet.Audio.Visualizer base.Update(gameTime); } - public override void Draw(SpriteBatch batch) + public override void Draw(ConsistentSpriteBatch batch) { if (disposed) throw new ObjectDisposedException(GetType().Name); rectangleRenderer.Begin(true); diff --git a/RhythmBullet/Content-texture.png b/RhythmBullet/Content-texture.png new file mode 100644 index 0000000..0b80c74 Binary files /dev/null and b/RhythmBullet/Content-texture.png differ diff --git a/RhythmBullet/Content.tatlas b/RhythmBullet/Content.tatlas new file mode 100644 index 0000000..d28328c --- /dev/null +++ b/RhythmBullet/Content.tatlas @@ -0,0 +1,79 @@ +{ + "regions": [ + { + "name": "rectangle-button-disabled", + "bounds": { + "X": 0, + "Y": 0, + "Width": 16, + "Height": 16 + }, + "ninePatchData": { + "textureName": null, + "left": 4, + "right": 4, + "bottom": 4, + "top": 4 + } + }, + { + "name": "rectangle-button-down", + "bounds": { + "X": 0, + "Y": 16, + "Width": 16, + "Height": 16 + }, + "ninePatchData": { + "textureName": null, + "left": 4, + "right": 4, + "bottom": 4, + "top": 4 + } + }, + { + "name": "rectangle-button-highlighted", + "bounds": { + "X": 0, + "Y": 32, + "Width": 16, + "Height": 16 + }, + "ninePatchData": { + "textureName": null, + "left": 4, + "right": 4, + "bottom": 4, + "top": 4 + } + }, + { + "name": "rectangle-button", + "bounds": { + "X": 0, + "Y": 48, + "Width": 16, + "Height": 16 + }, + "ninePatchData": { + "textureName": null, + "left": 4, + "right": 4, + "bottom": 4, + "top": 4 + } + }, + { + "name": "ScrollBar", + "bounds": { + "X": 16, + "Y": 0, + "Width": 16, + "Height": 16 + }, + "ninePatchData": null + } + ], + "textureName": "Content-texture.png" +} \ No newline at end of file diff --git a/RhythmBullet/Content/Content.mgcb b/RhythmBullet/Content/Content.mgcb index 00d95fd..b4208da 100644 --- a/RhythmBullet/Content/Content.mgcb +++ b/RhythmBullet/Content/Content.mgcb @@ -760,3 +760,15 @@ /processor:TextureAtlasProcessor /build:UI.tatlas +#begin UI-texture.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:UI-texture.png + diff --git a/RhythmBullet/Content/UI-texture.png b/RhythmBullet/Content/UI-texture.png new file mode 100644 index 0000000..0b80c74 Binary files /dev/null and b/RhythmBullet/Content/UI-texture.png differ diff --git a/RhythmBullet/Content/UI.png b/RhythmBullet/Content/UI.png deleted file mode 100644 index 3c33f7c..0000000 Binary files a/RhythmBullet/Content/UI.png and /dev/null differ diff --git a/RhythmBullet/Content/UI.tatlas b/RhythmBullet/Content/UI.tatlas index 179b971..7e87ffb 100644 --- a/RhythmBullet/Content/UI.tatlas +++ b/RhythmBullet/Content/UI.tatlas @@ -9,7 +9,7 @@ "Height": 16 }, "ninePatchData": { - "textureName": "rectangle-button-disabled.png", + "textureName": null, "left": 4, "right": 4, "bottom": 4, @@ -25,7 +25,7 @@ "Height": 16 }, "ninePatchData": { - "textureName": "rectangle-button-down.png", + "textureName": null, "left": 4, "right": 4, "bottom": 4, @@ -41,7 +41,7 @@ "Height": 16 }, "ninePatchData": { - "textureName": "rectangle-button-highlighted.png", + "textureName": null, "left": 4, "right": 4, "bottom": 4, @@ -49,15 +49,25 @@ } }, { - "name": "rectangle-button", + "name": "rectangle-button-texture", "bounds": { "X": 0, "Y": 48, "Width": 16, "Height": 16 }, + "ninePatchData": null + }, + { + "name": "ScrollBar", + "bounds": { + "X": 16, + "Y": 0, + "Width": 16, + "Height": 16 + }, "ninePatchData": { - "textureName": "rectangle-button.png", + "textureName": null, "left": 4, "right": 4, "bottom": 4, @@ -65,5 +75,5 @@ } } ], - "textureName": "UI.png" + "textureName": "UI-texture.png" } \ No newline at end of file diff --git a/RhythmBullet/Content/UI/-texture.png b/RhythmBullet/Content/UI/-texture.png new file mode 100644 index 0000000..06e44b7 Binary files /dev/null and b/RhythmBullet/Content/UI/-texture.png differ diff --git a/RhythmBullet/Content/UI/.tatlas b/RhythmBullet/Content/UI/.tatlas new file mode 100644 index 0000000..ce80ce1 --- /dev/null +++ b/RhythmBullet/Content/UI/.tatlas @@ -0,0 +1,69 @@ +{ + "regions": [ + { + "name": "rectangle-button-disabled", + "bounds": { + "X": 0, + "Y": 0, + "Width": 16, + "Height": 16 + }, + "ninePatchData": { + "textureName": null, + "left": 4, + "right": 4, + "bottom": 4, + "top": 4 + } + }, + { + "name": "rectangle-button-down", + "bounds": { + "X": 0, + "Y": 16, + "Width": 16, + "Height": 16 + }, + "ninePatchData": { + "textureName": null, + "left": 4, + "right": 4, + "bottom": 4, + "top": 4 + } + }, + { + "name": "rectangle-button-highlighted", + "bounds": { + "X": 0, + "Y": 32, + "Width": 16, + "Height": 16 + }, + "ninePatchData": { + "textureName": null, + "left": 4, + "right": 4, + "bottom": 4, + "top": 4 + } + }, + { + "name": "rectangle-button", + "bounds": { + "X": 0, + "Y": 48, + "Width": 16, + "Height": 16 + }, + "ninePatchData": { + "textureName": null, + "left": 4, + "right": 4, + "bottom": 4, + "top": 4 + } + } + ], + "textureName": "-texture.png" +} \ No newline at end of file diff --git a/RhythmBullet/Properties/AssemblyInfo.cs b/RhythmBullet/Properties/AssemblyInfo.cs deleted file mode 100644 index c6783d3..0000000 --- a/RhythmBullet/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("RhythmBullet")] -[assembly: AssemblyProduct("RhythmBullet")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyCopyright("Copyright © 2018")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("78eb6f5c-0f37-458a-9928-0fd0799c93a5")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/RhythmBullet/RhythmBullet.csproj b/RhythmBullet/RhythmBullet.csproj index e67074d..f4ad11b 100644 --- a/RhythmBullet/RhythmBullet.csproj +++ b/RhythmBullet/RhythmBullet.csproj @@ -1,160 +1,17 @@ - - - + - Debug - AnyCPU - 8.0.30703 - 2.0 - {4242553D-40F9-40F0-9AE6-CB6771DD9CF9} WinExe - Properties - RhythmBullet - RhythmBullet - 512 - DesktopGL - v4.5 - - - - - true - bin\$(MonoGamePlatform)\$(Platform)\$(Configuration)\ - DEBUG;TRACE;LINUX - full - AnyCPU - prompt - false - 4 - - - bin\$(MonoGamePlatform)\$(Platform)\$(Configuration)\ - TRACE;LINUX - true - pdbonly - AnyCPU - prompt - false - 4 - - - - - - - app.manifest - - - true - - - - + netcoreapp2.0 - - - - - - - - - - - - - - - + - - ..\packages\BulletSharp.0.11.1\lib\net40-client\BulletSharp.dll + + + + + ../References/RecrownedAthenaeum.dll - - ..\packages\MonoGame.Framework.DesktopGL.3.7.1.189\lib\net45\MonoGame.Framework.dll - - - ..\packages\NAudio.1.9.0-preview2\lib\net35\NAudio.dll - - - False - ..\References\RecrownedAthenaeum.dll - - - - - - - - - - - x86\SDL2.dll - PreserveNewest - - - x64\SDL2.dll - PreserveNewest - - - x86\soft_oal.dll - PreserveNewest - - - x64\soft_oal.dll - PreserveNewest - - - x86\libSDL2-2.0.so.0 - PreserveNewest - - - x64\libSDL2-2.0.so.0 - PreserveNewest - - - x86\libopenal.so.1 - PreserveNewest - - - x64\libopenal.so.1 - PreserveNewest - - - libSDL2-2.0.0.dylib - PreserveNewest - - - libopenal.1.dylib - PreserveNewest - - - MonoGame.Framework.dll.config - PreserveNewest - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - \ No newline at end of file diff --git a/RhythmBullet/RhythmBulletGame.cs b/RhythmBullet/RhythmBulletGame.cs index 7e14e41..a54fdaf 100644 --- a/RhythmBullet/RhythmBulletGame.cs +++ b/RhythmBullet/RhythmBulletGame.cs @@ -1,9 +1,8 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; -using RecrownedAthenaeum.Camera; +using RecrownedAthenaeum.Render; using RecrownedAthenaeum.ContentSystem; -using RecrownedAthenaeum.Data; using RecrownedAthenaeum.Input; using RecrownedAthenaeum.Persistence; using RecrownedAthenaeum.ScreenSystem; @@ -30,13 +29,15 @@ namespace RhythmBullet public static int pixels_per_WU; GraphicsDeviceManager graphics; - SpriteBatch spriteBatch; + ConsistentSpriteBatch spriteBatch; public readonly ContentManagerController assets; readonly ResolutionContentResolver resolutionContentResolver; public PreferencesManager preferencesManager; private ScreenManager screenManager; public Camera2D Camera { get; private set; } + public BasicEffect cameraEffect; + private bool resizing; private bool initialLoadComplete; private MainScreen mainScreen; @@ -63,7 +64,6 @@ namespace RhythmBullet Resolution resolution = preferencesManager.GetPreferences().Resolution; graphics.PreferredBackBufferWidth = resolution.Width; graphics.PreferredBackBufferHeight = resolution.Height; - RecrownedAthenaeum.Configuration.GraphicsDeviceManager = graphics; } /// @@ -82,8 +82,14 @@ namespace RhythmBullet musicController.musicList.StartSearch(); if ((general.skinName ) != null) { - skinManager.LoadSkin(skinManager.ReadSkinData(general.skinDirectory + general.skinName), general.skinDirectory + general.skinName); + skinManager.LoadSkin(Path.Combine(general.skinDirectory, general.skinName), graphics.GraphicsDevice); } + + Debug.WriteLine("Initial resolution: " + resolution); + cameraEffect = new BasicEffect(graphics.GraphicsDevice); + cameraEffect.TextureEnabled = true; + cameraEffect.VertexColorEnabled = true; + Camera = new Camera2D(resolution.Width, resolution.Height, cameraEffect); Debug.WriteLine("Initial setup complete."); base.Initialize(); } @@ -95,14 +101,10 @@ namespace RhythmBullet protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. - spriteBatch = new SpriteBatch(GraphicsDevice); + spriteBatch = new ConsistentSpriteBatch(GraphicsDevice); - RecrownedAthenaeum.Configuration.Camera2D = new Camera2D(); - Camera = RecrownedAthenaeum.Configuration.Camera2D; - - screenManager = new ScreenManager(); - RecrownedAthenaeum.Configuration.spriteBatchSettings = screenManager.batchSettings; - screenManager.ShowFirstScreenEvent += ShowFirstScreen; + screenManager = new ScreenManager(graphics); + screenManager.NeedNextScreen += ShowFirstScreen; QueueContent(); screenManager.Screen = new LoadingScreen(this, Content.Load("RhythmBullet"), 0.7f); } @@ -140,7 +142,7 @@ namespace RhythmBullet { assets.Update(); } - screenManager.UpdateCurrentScreen(gameTime, CheckReadyForInitiate()); + screenManager.UpdateCurrentScreen(gameTime, !CheckReadyForInitiate()); InputUtilities.Update(); base.Update(gameTime); @@ -152,7 +154,8 @@ namespace RhythmBullet /// Provides a snapshot of timing values. protected override void Draw(GameTime gameTime) { - screenManager.DrawCurrentScreen(spriteBatch); + spriteBatch.effect = cameraEffect; + screenManager.DrawScreen(spriteBatch); base.Draw(gameTime); } @@ -216,12 +219,13 @@ namespace RhythmBullet SetUpDefaultSkin(); UpdateCursor(); - mainScreen = new MainScreen(assets, Skin); + mainScreen = new MainScreen(assets, Skin, Camera); initialLoadComplete = true; } private void UpdateCursor() { + SpriteBatch spriteBatch = this.spriteBatch; Texture2D texture = Skin.CursorTexture; int cursorSize = (int)(0.07f * graphics.PreferredBackBufferHeight); Debug.WriteLine("Cursor size length: " + cursorSize); diff --git a/RhythmBullet/Screens/MainMenu/MainPage.cs b/RhythmBullet/Screens/MainMenu/MainPage.cs index afee31f..6dc07c5 100644 --- a/RhythmBullet/Screens/MainMenu/MainPage.cs +++ b/RhythmBullet/Screens/MainMenu/MainPage.cs @@ -1,13 +1,10 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Graphics; using RecrownedAthenaeum.ContentSystem; using RecrownedAthenaeum.Render; using RecrownedAthenaeum.UI.BookSystem; using RecrownedAthenaeum.UI.Modular.Modules; using RecrownedAthenaeum.UI.Modular.Modules.Interactive; using RecrownedAthenaeum.UI.SkinSystem; -using RecrownedAthenaeum.UI.SkinSystem.Definitions; -using System; namespace RhythmBullet.Screens.MainMenu { @@ -21,7 +18,7 @@ namespace RhythmBullet.Screens.MainMenu { } - protected override void Initialize(ContentManagerController assets, ISkin skin) + protected override void Initialize(ContentManagerController assets, ISkin skin, BasicScissor scissorBox) { title = new Image(assets.Get("title")); AddModule(title); @@ -33,6 +30,8 @@ namespace RhythmBullet.Screens.MainMenu quitButton = new TextButton("Quit", font, skin); AddModule(quitButton); + + base.Initialize(assets, skin, scissorBox); } public override void ApplySize(int width, int height) @@ -56,9 +55,11 @@ namespace RhythmBullet.Screens.MainMenu quitButton.CenterHorizontally(); quitButton.situation.Y = (int)quitButton.origin.Y + playButton.Boundaries.Y + playButton.Boundaries.Height + 15; + + base.ApplySize(width, height); } - public override void Draw(SpriteBatch batch) + public override void Draw(ConsistentSpriteBatch batch) { base.Draw(batch); } diff --git a/RhythmBullet/Screens/MainMenu/MainScreen.cs b/RhythmBullet/Screens/MainMenu/MainScreen.cs index 847d4b5..b8f771c 100644 --- a/RhythmBullet/Screens/MainMenu/MainScreen.cs +++ b/RhythmBullet/Screens/MainMenu/MainScreen.cs @@ -1,8 +1,8 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using RecrownedAthenaeum.Camera; using RecrownedAthenaeum.ContentSystem; using RecrownedAthenaeum.Input; +using RecrownedAthenaeum.Render; using RecrownedAthenaeum.ScreenSystem; using RecrownedAthenaeum.UI.BookSystem; using RecrownedAthenaeum.UI.SkinSystem; @@ -17,22 +17,25 @@ namespace RhythmBullet.Screens.MainMenu readonly Texture2D background; readonly Book book; readonly MainPage mainPage; + Rectangle screenSize; - public MainScreen(ContentManagerController assets, ISkin skin) : base(true) + public MainScreen(ContentManagerController assets, ISkin skin, Camera2D camera) : base(true) { this.assets = assets; background = assets.Get("backgrounds/mainBG"); fat = new FadeAwayTransition(1.5f); - book = new Book(assets, skin); + book = new Book(assets, skin, camera); mainPage = new MainPage(); book.AddPages(mainPage); InputUtilities.InputListeners.Add(book); } - public override void Initiate(Rectangle screenSize, Camera2D camera) + public override void ApplySize(int width, int height) { - book.Initiate(camera, screenSize); - base.Initiate(screenSize, camera); + screenSize.Width = width; + screenSize.Height = height; + book.ApplySize(width, height); + base.ApplySize(width, height); } public override void Show() @@ -41,9 +44,9 @@ namespace RhythmBullet.Screens.MainMenu base.Show(); } - public override void Draw(SpriteBatch spriteBatch) + public override void Draw(ConsistentSpriteBatch spriteBatch) { - spriteBatch.Draw(background, ScreenSize, Color.White); + spriteBatch.Draw(background, screenSize, Color.White); book.Draw(spriteBatch); base.Draw(spriteBatch); } diff --git a/RhythmBullet/Screens/Transitions/FadeAwayTransition.cs b/RhythmBullet/Screens/Transitions/FadeAwayTransition.cs index 2f13e8f..366e5bb 100644 --- a/RhythmBullet/Screens/Transitions/FadeAwayTransition.cs +++ b/RhythmBullet/Screens/Transitions/FadeAwayTransition.cs @@ -1,5 +1,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using RecrownedAthenaeum.Render; using RecrownedAthenaeum.ScreenSystem; using System; @@ -55,7 +56,7 @@ namespace RhythmBullet.Screens.Transitions return true; } - public void DrawTransition(SpriteBatch batch) + public void DrawTransition(ConsistentSpriteBatch batch) { if (curtain != null) { diff --git a/RhythmBullet/packages.config b/RhythmBullet/packages.config deleted file mode 100644 index 2595680..0000000 --- a/RhythmBullet/packages.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file