Commit Graph

44 Commits

Author SHA1 Message Date
Leon Friedrich
85f74c3ba3 Fix GetWorldViewbounds() and GetWorldViewport() (#5060)
* Fix GetWorldViewbounds() and GetWorldViewport()

* Remove some uses of `CurrentMap` and `CurrentEye`
2024-05-19 10:47:04 +10:00
Tayrtahn
1f2b38a6d1 Code cleanup: Purge calls to obsolete EntityCoordinates methods (#4983) 2024-03-23 13:07:33 +11:00
Tayrtahn
9bfe889c86 Code cleanup: Purge obsolete MapManager methods (#4981)
* GetGrid

* GridExists

* TryGetGrid
2024-03-21 16:31:33 +01:00
Leon Friedrich
cfb88b2e8e Arch related engine changes (#4806) 2024-01-04 12:18:03 +11:00
metalgearsloth
24b0165ec9 Revert Arch (#4613) 2023-11-27 21:41:01 +11:00
metalgearsloth
7dce51e2cf Arch PR two electric boogaloo (#4388)
Co-authored-by: DrSmugleaf <drsmugleaf@gmail.com>
Co-authored-by: ElectroJr <leonsfriedrich@gmail.com>
2023-11-23 14:29:37 +11:00
metalgearsloth
7d1ad527d9 Replace Robust Vector2 with System.Numerics (#4092) 2023-07-08 14:08:26 +10:00
metalgearsloth
895cd6e03e Bandaid grid placement (#3678) 2023-01-19 14:00:25 +11:00
metalgearsloth
9528d6dc8f Remove ISpriteComponent (#3692) 2023-01-15 13:38:46 +11:00
metalgearsloth
5e3a5a0d0c Merge MapGrid into MapGridComponent (#3468) 2022-11-22 13:04:51 +11:00
Leon Friedrich
e534fcd800 Unrevert "Remove obsolete GridId and all references to it" (#3279) 2022-10-10 08:41:58 +11:00
metalgearsloth
818ea1a629 Revert "Remove obsolete GridId and all references to it" (#3308) 2022-10-09 17:32:54 +11:00
SpaceManiac
ebaa8d9ac3 Remove obsolete GridId and all references to it (#3279) 2022-10-09 16:23:40 +11:00
metalgearsloth
33251222cd EntityLookup as a system (#2573) 2022-03-03 21:17:01 +11:00
Pieter-Jan Briers
de4d255841 Analyzer to enforce classes to be either [Virtual], abstract, or sealed. (#2469)
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-02-05 19:31:58 +01:00
Paul
7e59febb47 nukes more resolves 2021-12-08 19:38:59 +01:00
Vera Aguilera Puerto
26dcef4a11 Fix more useless resolves, makes entity system proxy "Deleted" not throw. 2021-12-08 11:10:11 +01:00
DrSmugleaf
163deff564 Fix 3000 errors 2021-12-05 18:13:33 +01:00
Vera Aguilera Puerto
7a06db60cf Inline UID 2021-12-03 15:53:10 +01:00
Vera Aguilera Puerto
94e6886a85 Inline Transform 2021-12-03 14:20:35 +01:00
Vera Aguilera Puerto
e93ae73e50 Inline TryGetComponent completely, for real 2021-12-03 14:17:01 +01:00
Vera Aguilera Puerto
69158de99b Inline Prototype 2021-12-03 11:13:58 +01:00
Paul Ritter
72071826a4 fix placement grid (#2072) 2021-10-09 15:19:06 +02:00
metalgearsloth
d72185933a Add support for grid chunk removals (#1941)
* Add support for grid chunk removals

Also allows grids to be removed when they have no more chunks remaining.

* No more crashing pog

* Slightly better

* Minor optimisations and fix bounds

* Avoid creating new chunks for anchoring

* chucky

* comment

* Tests

* Remove some logs

* Remove another log

* Review
2021-08-23 16:00:07 +10:00
Acruid
122acc5fd5 SnapGridComponent Removal (#1720)
* Removed SnapGridOffset, there is only center now.

* SnapGridComponent methods are now static.

* Removed SnapGridComponent.OnPositionChanged.

* Refactored static functions off SnapGridComponent to MapGrid.
Refactored away usages of SnapGridComponent.Position.

* Added Transform.Anchored for checking if an entity is a tile entity.
More refactoring for static MapGrid functions.

* Static snapgrid methods on MapGrid are no longer static.

* Removed IMapGrid.SnapSize, it is now always equal to the IMapGrid.TileSize.

* Add setter to ITransformComponent.Anchored.
Removed direct references to SnapGridComponent from content.

* Grid functions now deal with EntityUids instead of SnapGridComponents.
Began renaming public API functions from SnapGrid to Anchor.

* Add some unit tests.

* SnapGridComponent now anchors itself in startup, instead of Initialize (sending directed events in init is an error).
2021-04-28 10:24:11 -07:00
metalgearsloth
d8aad89c2f Split entity management from entity queries (#1665)
* Split entity lookups from entitymanager

* Helps if you subscribe dingus

* Handle map changes

* Stacks instead

* Make mapchanges use a queue because it's probably better

Moves likely only care about the latest position

* IoC what you did there

* IoC refactor

* Minor optimisations

* Apply feedback

* My IQ dropped 3 sizes that day

* Rest of acruid's feedback

* final_no_actual commit

* enlightenment?

* Liftoff

* final_commit_v2_actual

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
2021-04-06 13:29:48 +10:00
Acruid
2183cd7ca1 Massive Namespace Cleanup (#1544)
* Removed the Interfaces folder.
* All objects inside the GameObjects subfolders are now in the GameObjects namespace.
* Added a Resharper DotSettings file to mark the GameObjects subfolders as not providing namespaces.
* Simplified Robust.client.Graphics namespace.
* Automated remove redundant using statements.
2021-02-10 23:27:19 -08:00
Pieter-Jan Briers
362b7804d9 Fix issues with .NET 5. 2020-11-11 00:46:35 +01:00
Víctor Aguilera Puerto
04277feba6 AlignWithClosestGridTile extension for EntityCoordinates (#1386)
* AlignWithClosestGridTile extension for EntityCoordinates
- Fixes component exception when adding a timer component to a deleted entity.

* Address review

* actually...
2020-11-05 17:48:57 +01:00
Víctor Aguilera Puerto
47593307b6 Remove default grids (#1322)
* Remove default grids

* Fix test. Invalid grids don't "exist" anymore in map manager.

* Fix crashes

* Fix placement modes.

* Remove warning.
2020-10-21 15:12:02 +02:00
DrSmugleaf
0a67cecfa5 Replace every usage of GridCoordinates with EntityCoordinates (#1280)
* Added struct skeleton for EntityCoordinates.

* Polish EntityCoordinates, add tests, add EntityCoordinates to Transforms

* Doc cleanup

* Remove useless code

* Return offset 0 when you don't have a parent

* Test for making sure EntityCoordinates for entities without parents have offset 0

* Use parent transform's GridId for GetGridId.

* Adds various methods, checks and tests

* Replace GridCoordinates with EntityCoordinates

* EyeManager.WorldToScreen fix

* Address reviews

* Fix za buildo

* Fix one transform test

* Fix the remaining tests

* Remove duplicate

* Remove another merge duplicate

* Fix property

* Rename most usages of GridCoordinates to EntityCoordinates.

* Add WithEntityId method to EntityCoordinates.

* Fix EntityCoordinates usage in GetEntitiesInRange

* Remove cursed IMapGrid method, change naming.

* Makes GridTileLookupSystem use EntityCoordinates

Co-authored-by: Acruid <shatter66@gmail.com>
Co-authored-by: Víctor Aguilera Puerto <zddm@outlook.es>
2020-09-06 16:09:19 +02:00
Pieter-Jan Briers
b45ea725d7 Remove CannyFastMath. 2020-08-12 21:17:17 +02:00
Tyler Young
9cbdd1058c Use CannyFastMath & Update Some Packages (#1130)
update a bunch of packages and use JetBrains.Annotations as private asset as needed

mark some hot math methods agg inline to benefit from loop opts

use FMA for interp

use canny min/max/clamp

make Quaternion NormalizeAngle fixed time and faster

clean up YamlDotNet references
2020-06-18 02:25:36 +02:00
Pieter-Jan Briers
6674be3adc Client NRTs (#1121) 2020-06-12 12:57:39 +02:00
ComicIronic
d631048c1e Remove ScreenToWorld (#1114) 2020-06-08 00:41:59 +02:00
Acruid
a947a38f3c View Rotation (#1016)
* Adds a derived class from Nunit's Is test constraint class.
The game camera can now be rotated.

* Added the new `bind` command to the console, used to bind a key to a keybind.
Added two new keybinds for rotating the View camera left and right.
Added more info to the ""Component does not exist for state" exception.
Added Reduced() and FlipPositive() public functions to Angle.

* Fix a copy/paste bug.

* Adds missing code to bind/unbind CameraRotateLeft.
Camera snapping now actually uses the CameraSnapTolerance constant.
2020-03-25 02:22:18 +01:00
Acruid
4eb29a9e80 Removed GridCoordinates.ConvertToGrid because it is completely pointless.
Removed GridCoordinates.ToWorld in preparation for removing Map Default Grids.
2020-01-25 01:37:37 -08:00
Acruid
d9a411b260 Shared IMap/Map class removal (#904)
* Moved IMap from Shared/Interfaces/Map to Shared/Map namespace.

* Extracted Map class out of the MapManager class.

* Removed the Map class and interface.

* Fully removed the Map and IMap class.
2019-11-26 20:47:04 +01:00
Pieter-Jan Briers
6e32588be7 Adds new placement alignment mode to place lights correctly. 2019-08-13 12:05:08 +02:00
Pieter-Jan Briers
09c36b57cd Shift half of Clyde around to implement better outline rendering. (#830)
* Attempted Clyde cleanup, didn't get far.

* Add negation operator to Vector2i.

* Add RenderOrder to ISpriteComponent.

* Post process shaders.

Adds "post process" shaders to sprite component.
These are executed on the WHOLE sprite component (every layer)
in one draw.

This is necessary to implement functional outlines.
2019-07-06 19:17:33 +02:00
Acruid
c4fb96b5e8 Tile Placement Improvements (#808)
* Tile Placement box actually uses the mouse snapgrid, not the players.

* Placement box only snaps to grids if cursor is over grid.
First tile of new grid is centered on cursor, instead of bottom left on cursor.

* Place square now sticks to the edge of a grid.
Cannot place tiles that would touch two grid Bounds.
2019-05-11 15:58:28 +02:00
Acruid
1b3cc8aba6 Grid Bounds (#800)
* Added centered unit box static field to Box2.

* MapGrid is more testable.

* Added some unit tests for MapGrid.
Fixed bug in MapChunk.GridTileToLocal().
MapGrid.UpdateAABB() actually expands properly now.

* Moved IMapChunk to Robust.Shared.Map.
Moved Chunk class out of MapManager class.

* Added unit tests for MapChunk.

* Bounds reduce by 1, so almost working.

* Now bound shrinking works :D

* Moved MapGrid out of MapManager.
Moved IMapGrid into the Shared/Map folder.
Replaced all calls to IMapGrid.ParentMap.Index with IMapGrid.ParentMapId.

* Added more MapGrid unit tests.
Fixed a bug in TryGetTileRef.
2019-04-29 12:43:20 +02:00
Acruid
7053fb15f8 Map System Code Refactor (#796)
* Removed unused method TileRef.GetStep().
Removed unused property TileRef.TileSize.
Removed unused property TileRef.Tile, made the field public with the same name.
Made the TileRef struct readonly.
Removed property TileRef.TileDef.
Removed property TileRef.LocalPos.
Renamed GridTile to GridIndices.
Implemented IEquatable on TileRef.
Implemented Equality operators on TileRef.
Added PublicAPI attribute to TileRef.
Added doc comments to TileRef.

* Modified Tile:
Added the PublicApi annotation.
Made struct readonly.
Filled out doc comments.
Changed auto properties to readonly fields.
Renamed TileId to TypeId.
Added a static Empty tile to the struct.
Implemented IEquatable.

* Modified MapCoordinates:
Added PublicApi attribute.
Implemented IEquatable.
Filled out doc comments.
Removed Map property.

* Modified ScreenCoordinates:
Filled out doc comments.
Added the PublicApi attribute.
Implemented IEquatable.

* Modified GridCoordinates:
Removed method IsValidLocation.

* Removed property GridCoordinates.Grid.

* Removed GridCoordinates.Map.

* Removed GridCoordinates.MapId.

* Removed property GridCoordinates.IsWorld.
Removed constructors taking a MapId.

* Removed static IoCManager calls from GridCoordinates.

* Modified GridCoordinates:
Added attribute PublicApi.
Filled out doc comments.

* Filled out doc comments for MapGrid.
Filled out doc comments for MapIndices.
Misc refactors for both.

* added command to teleport grids.

* Added method Box2.Intersect.
Added method Box2.Union.
Placement manager now spawns new grids to place tiles not connected to an existing grid.
2019-04-20 20:37:37 +02:00
Silver
25926a17b7 Renames SS14.* to Robust.* (#793)
RobustToolbox projects should be named Robust.* 

This PR changes the RobustToolbox projects from SS14.* to Robust.*

Updates SS14.* prefixes/namespaces to Robust.*
Updates SpaceStation14.sln to RobustToolbox.sln
Updates MSBUILD/SS14.* to MSBUILD/Robust.*
Updates CSProject and MSBuild references for the above
Updates git_helper.py
Removes Runserver and Runclient as they are unusable
2019-04-15 20:24:59 -06:00