Compare commits

...

223 Commits
0.0.4 ... 0.0.7

Author SHA1 Message Date
Pieter-Jan Briers
0abdcbd1f8 Never forget to hit save. 2018-06-23 21:57:26 +02:00
Pieter-Jan Briers
c20848902e Update export preset. 2018-06-23 21:55:35 +02:00
Pieter-Jan Briers
f1d3d2c5ce Async Delay and Spawn helpers for Timer. (#607) 2018-06-11 20:29:41 +02:00
Pieter-Jan Briers
c6d941f0cf Detaches grids from maps. (#595)
Grid IDs are now globally unique.
This'll make moving grids between maps possible.

Also, LocalCoordinates has been renamed to GridLocalCoordinates.
2018-06-11 20:24:23 +02:00
Pieter-Jan Briers
11230fe98f Fix reconnecting with the client. 2018-06-09 16:03:24 +02:00
Pieter-Jan Briers
170e1ad5af Nice typo. 2018-06-09 15:47:59 +02:00
Pieter-Jan Briers
100d21196b Improve readmes.
Moved the intimidating all caps readme info out into its own file.
Deleted the linux file as it was horribly outdated.
2018-06-09 15:19:21 +02:00
Acruid
46ca2d2cc5 TileDefinitions can be loaded from prototypes now. (#594)
The server now uses the config file to figure out which map to load.
2018-06-08 19:32:14 +02:00
Pieter-Jan Briers
0563a5beb3 Fix build issue on Godot 3.0.x 2018-06-08 14:52:48 +02:00
Pieter-Jan Briers
6d35e339cb Fix caching of GodotSharp.dll on AppVeyor. 2018-06-07 23:30:27 +02:00
Pieter-Jan Briers
8a8ed75084 Fix typo. 2018-06-07 23:28:16 +02:00
Pieter-Jan Briers
fbeb10e8c2 Make download_godotsharp 522 proof. 2018-06-07 23:25:02 +02:00
Pieter-Jan Briers
be174cc027 Sprite per-layer color modulate. 2018-06-07 23:14:55 +02:00
Pieter-Jan Briers
d1cf753f22 Debug Coords Panel gets entity display. 2018-06-03 16:40:59 +02:00
Pieter-Jan Briers
6ede21aa14 Fix Overlay.ZIndex setter. 2018-06-03 16:11:18 +02:00
Pieter-Jan Briers
59a1cc899b Even einstein agrees. 2018-06-03 16:09:23 +02:00
Pieter-Jan Briers
ee7c5d9da1 It it quantum-physically impossible to get CI scripts right the first time. 2018-06-03 16:03:38 +02:00
Pieter-Jan Briers
88520e8db5 Coverage badge. 2018-06-03 16:01:38 +02:00
Pieter-Jan Briers
e73bcd57c0 Fix coverage reports. 2018-06-03 16:01:32 +02:00
Pieter-Jan Briers
cd376711bf Does this fix coverage. 2018-06-03 15:49:36 +02:00
Pieter-Jan Briers
ca0037a402 I'm a genius. 2018-06-03 15:35:29 +02:00
Pieter-Jan Briers
7aee21b689 Guess no multiline then. 2018-06-03 15:31:02 +02:00
Pieter-Jan Briers
348ca5b107 Shall coverage work first try? 2018-06-03 15:27:53 +02:00
Pieter-Jan Briers
136d306d1d Use after_test maybe? 2018-06-03 15:06:43 +02:00
Pieter-Jan Briers
3c14e1d1db Make Sonar import unit test results. 2018-06-03 14:59:50 +02:00
Pieter-Jan Briers
c058c2e3d4 Outlines & Custom non-entity drawing. (#592)
* Shader work WiP

* Probably implement basic shader param support.

* Really rough and hacky version

* Fix dumb exception.

* Custom fullscreen drawing API prototype.

* Significantly optimize debug colliders drawing.

* Fix drawdepths on clothing & overlays.

* Re-add license to outline shader.

* Update .editorconfig for .gdsl files.

* Fix unit tests.
2018-06-03 14:38:56 +02:00
Pieter-Jan Briers
1812e8743d Makes EntityUid IComparable. 2018-05-30 16:10:11 +02:00
Pieter-Jan Briers
036daa2ac8 ToString() for entities.
Intended for debugging mostly.
2018-05-30 16:09:47 +02:00
Pieter-Jan Briers
480a0b4a0a Can now change SS14Window titles. 2018-05-30 14:22:57 +02:00
Pieter-Jan Briers
693769cbd4 Improve sprite drawdepth ordering. 2018-05-30 14:07:21 +02:00
Pieter-Jan Briers
00fe03b61b Placement fixes. 2018-05-27 23:27:23 +02:00
Pieter-Jan Briers
b761d9a1eb Fixes directional icons not being used in placement previews. 2018-05-27 21:44:35 +02:00
Pieter-Jan Briers
3728c7eeee Some entity improvements to work on power code. (#591)
* Client-specific component network messages.

* Make entity serializer aware of color names.

* Fix input log spam.
2018-05-27 16:57:42 +02:00
Pieter-Jan Briers
dc80060757 Input Refactor (#590)
* *some* input work.

* Remove explicit numbers from Key enum.

* Hey, keybinds sorta work!

* Input almost works?

* It works.

* Fix networking issues.
2018-05-27 10:08:36 +02:00
Pieter-Jan Briers
909bb5936f Fixing issues sonar pointed out. (#589)
* Fixing issues sonar pointed out.

* Fix build.
2018-05-26 18:21:40 +02:00
Pieter-Jan Briers
0da7507c64 shhhhh. 2018-05-13 15:54:32 +02:00
Pieter-Jan Briers
0a195fe3c7 Game State Refactor (#586)
* Rename SS14.Server/GameState directory.

* Server now runs at 60 FPS.

* RegisterNetMessage<T> more generic!

Also started refactoring game states.

* HOLY SHIT I CAN MOVE AROUND.

* Dirty(); calls and improvements.

* Implement deletions + mark components as dirty initially.

* Remove bsdiff submodule.

* Remove Bsdiff.

* Fix System.ValueTuple reference.

* Server no longer crashes when the gun is used.

* Optimize player sync.

* Prevent constant dirtiness from player input mover.
2018-05-13 11:40:16 +02:00
Pieter-Jan Briers
64e22fc031 Fix GodotSignalSubscriber leakage. (#588)
Every signal subscriber was getting leaked because I didn't know how Godot's memory model works. This is fixed now.
2018-05-12 00:13:21 +02:00
Pieter-Jan Briers
1375da7f70 Rename IEntity.GetComponents to GetAllComponents. (#584)
This is to avoid confusion.
A single s to distinguish it from GetComponent() is quite hard to miss.
2018-05-10 18:52:17 +02:00
Pieter-Jan Briers
6b37906c85 Logging API cleanup. (#585)
Added versions of the log calls not doing formatting.
Moved the LogLevel argument for .Log() to be first.
2018-05-10 18:51:55 +02:00
Pieter-Jan Briers
6c7dff77c5 Fixing some crashes and errors. (#583)
Fixes #559 and resolves a ton of error spam & shutdown crashes.
2018-05-10 18:51:42 +02:00
Pieter-Jan Briers
86a432bdeb Debug monitor system & UI improvements. (#581)
Debug monitors like coord debug, FPS and the (now re-added)
have been amde into a more centralized system.

Networking debug is back! No chart though.

Bunch of improvements and fixes to the UI code to facilitate this.
2018-05-10 18:50:56 +02:00
Pieter-Jan Briers
cb469c4f86 Fixes description loading in prototypes 2018-05-09 17:12:56 +02:00
clusterfack
dd0be25ab6 Placement Systems (#580)
* Deactivate special placement mode after placement
Comments
Fix collision checks for placement manager
Remove unnecessary usings
Fix the alignment issues
Wow this commit has literally almost all the work done in it alone
time to test some sketchy shit, commit first

* Fix align similar
2018-05-09 16:33:50 +02:00
Pieter-Jan Briers
4471e0ccca The SpriteComponent refactor (#577)
* Adds Godot shader support.

* New sprite component with a layer system.

Supports per-layer shaders. Only texture and shader properties are implemented.

More TODO.

* Basic RSI loading.

* Direct textures for layers.

* Implement a scale layer parameter.

* RSI directions work now.

* Animation support.

* Make sprites appear again.

* Fix error message about shaders on the server.

* Implements directional sprite handling & rotation of transforms.

* Remove debug logs from ShaderSourceResource.Load

* Work on a public API & better handling of errors.

* Layer addition API coded but untested.

* Fix init crash.

* Add a client side API for SpriteComponent.

* Remove dead NetIDs.

* Fix bug where sometimes entities start flat on their face.

* Refactor IconComponent.

* Adds rotation property to layers.

* Expose scale and rotation APIs, sprite-global rotation.

* Adds visibility property.

* Netcode work.

* Server side prototype loading done.

* Netcode works.

Also adds a visibility layer option.
2018-05-02 21:24:59 +02:00
clusterfack
adece0e39b Description information on entity and loading from prototypes (#579) 2018-05-02 21:24:02 +02:00
clusterfack
9aed85b4c7 Click modifiers (#578)
Apparently @pjb3005 did almost all the work for this when he changed the system to godot but didn't say anything, adds a property to parse the clicktype on mousebuttoneventargs and passes it in the network message instead
2018-05-01 02:43:40 -05:00
clusterfack
3a78a26652 PJB will love this (#573)
* PJB will love this

Containers 2: The uncontained

* Yes
2018-04-23 01:57:18 +02:00
clusterfack
498349bbcf Companion PR (#574)
https://github.com/space-wizards/space-station-14-content/pull/61

Adds a keybind for opening the character menu and makes texture rect not die when setting texture to null
2018-04-22 19:59:04 +02:00
clusterfack
8b83362c61 Gridcontainer (#571)
* Gridcontainer Wrapper

* This is probably important too

* Oopsie daisy

* Creates the client and shared portions of the new inventory code
2018-04-21 01:36:03 -05:00
Pieter-Jan Briers
32caf088ef Adds a system to load tscn files from content. (#570) 2018-04-19 21:22:16 +02:00
Pieter-Jan Briers
a34006f8ff Make project files default to x64. (#568)
Also fixes Lidgren's output directory. Not like it mattered.
2018-04-19 21:16:26 +02:00
Pieter-Jan Briers
20b9fd3228 Sawmills! (#565)
* Sawmills

* They seem to work on the server now, sorta.

* They work.

* More shit that works.

* Shit works yo.

* File logging for the server.

* Adds some debug commands and finishing touches.

* Oh yeah change this default.

* Fix unit tests.
2018-04-19 20:19:40 +02:00
clusterfack
320aa3f9c0 Gridcontainer Wrapper (#564)
* Gridcontainer Wrapper

* This is probably important too
2018-04-18 21:44:30 +02:00
clusterfack
f445addcd5 These should have no distinction on the client (#563) 2018-04-17 02:25:09 -05:00
clusterfack
44b00a1fa7 Make handle message use optional arguments (#561)
* Make handle message use optional arguments

Instead of arbitrarily using object as the first argument and killing type safety

* Ohboy
2018-04-15 13:34:22 -05:00
Pieter-Jan Briers
909ba41890 Remove usage of PitchScale. (#562)
It was apparently a very new 3.1 feature,
so it doesn't work on Godot 3.0.x.
2018-04-15 13:34:08 -05:00
PJB3005
b5ca9095b0 Remove Bitstream 2018-04-13 01:08:08 +02:00
PJB3005
c22a199a5b Remove binaries 2018-04-13 00:40:09 +02:00
Pieter-Jan Briers
2395b456e2 Update all NuGet packages. (#556)
* Update all NuGet packages.

* What a way to waste one and a half hours of my life.

* fucking

* fuck everything.
2018-04-12 23:41:56 +02:00
Pieter-Jan Briers
d7414930ff RSI support (#552)
* RSI WiP

* More work but we're doing bsdiff now

* RSI loading seems to mostly work.

* Vector2u deserialization test.

* Add in packages again.

* This is the part where I realize I need a path manipulation library.

* The start of a path class but it's late so I'm going to bed.

* HIGHLY theoretical ResourcePath code.

Partially tested but not really.

* Allow x86 for unit tests I guess jesus christ.

Thanks Microsoft for still not shipping x64 VS in 2018.

* Resource paths work & are tested.

* I missed a doc spot.

* ResourcePaths implemented on the server.

* Client works with resource paths.

TIME FOR A REFACTOR.

* Some work but this might be a stupid idea so I migh throw it in the trash.

* Resources refactored completely.

They now only get the requested resourcepath.
They're in charge of opening files to load.

* RSI Loader WORKS.

* Update AudioResource for new loading support.

* Fix package references.

* Fix more references.

* Gonna work now?
2018-04-12 21:53:19 +02:00
Pieter-Jan Briers
796555fad5 Audio system! (#550)
Supports positional, entity-tracking and global audio.

Special thanks to Zumo on Discord,
for figuring out how to load audio files Godot.
2018-04-12 17:54:18 +02:00
Pieter-Jan Briers
1e749952db Unit test improvements. (#548)
* Unit test improvements.

Adds an ApproxEqualityConstraint and IApproxEquatable<T> for certain tests.
Gives [Parallelizable] to a bunch of tests.

* ParallelScope.All | ParallelScope.Fixtures
2018-04-12 17:53:10 +02:00
clusterfack
e191be3a75 Fix stored object clicking bug (#553)
Fixes a humorous bug where you click on things that are contained in another thing because the mousedown doesn't check if something is on the map or not
2018-04-12 11:23:04 +02:00
Pieter-Jan Briers
ba3bad68c8 New logo courtesy of @outbools. (#549) 2018-04-12 02:55:45 -05:00
Pieter-Jan Briers
2bc7e09f65 Stop building the resource pack on Travis and AppVeyor. (#551) 2018-04-12 02:55:25 -05:00
Pieter-Jan Briers
896ac87f04 Remove broken particle editor. (#547) 2018-04-11 10:47:38 -06:00
Pieter-Jan Briers
b5c0202647 Godot (#545)
* bsdiff submodule

* All the other stuff

* Upgrade to 0.2 of SS14.Shared.BSdiff

* Use streams. Even faster!

* All rendering refactors should start with the killing of the SFML submodule. Trust me I've done this before!

* And after that comes the removal of the references in the project files!

Of course, neither of these compile. Meh.

* IoC loads, now to port the entire client over.

* More work

* Trying to debug the null exception.

* More messy WiP code

* More WiP

* Transform components now make Node2Ds inside the scene tree.

* Work on the UI system.

* Redo project configurations to work better.

* More work on the Godot GUI binding.

Added BaseButton and Button bindings, including events for them.

More APIs on Controls like GetChild() and alike.

Ability to instance a Godot PackedScene and have it automatically be wrapped by the SS14 GUI wrapper, thus allowing the usage of Godot's GUI editor while maintaining the good C# API.

* Fix incorrect sRGB profile on bootsplash.png

* LineEdit API.

* Maybe commit the csproj too.

* Exit button works now!

* Change MainMenu root to a normal Control.

* Some stuff messing with window popups.

* Fix popup not scaling down again after housing large text.

* Make popup dialog helper.

* Auto wrap controls that spawn others when not instancing.

* Nice typo me.

* Work getting server connections working.

* Server didn't start anymore due to still trying to load removed zip packs.
* Made MainMenu dump UI elements in shutdown.

* We now successfully connect to the server.

* WE Ingame NOW!

* Basic map rendering works now!

* Camera & Input work.

Though I'm not sure whether the input issues are this piss poor laptop or actual bugs.

* Fix input issues.

KeyHeld() was firing KeyUp() into States, which broke everything.

* WiP Debug console.

UI Works, command processing doesn't.

* Remove some debug logs.

* Fixing focusing issues with the Debug Console.

* In which I copy paste in the DebugConsole code.

* More WiP DebugConsole work.

* Use RichTextLabel for DebugConsole.

* Disable DebugConsole test text.

Also disable context menu on the IP Box because of font size issues.

* ITextureSource for texture wrapping.

* Make resource loading not copy every build.

It now loads from repo root. Release builds are TODO.

* Bsdiff 0.3 for fixed targets.

* Fix iCCP sRGB errors.

* Give full texture paths to prototypes.

* Sprite component old API restored. *shudder*

* Finish sprite rendering.

By hitting delete on basically everything.

* Fixing camera delay with this one weird trick!

The input lag was because the camera lagged, not because the input lagged. I didn't have visualization.

* Use greyshirt as temporary human replacement.

* FPS Counter.

* Fix Windows, re-add space tile def.

Windows broke because Mono on Windows can't use System.IO.Compression.
The GZIP streams use by MsgFullState have been moved to
ICSharpCode.SharpZipLib.GZip. Works fine.

Also re-added the space tile def because everything blows up otherwise I
guess.

* Debug colliders works.

* Highly WiP varied Window code.

* Work on the quit button. Doesn't work yet. Needs state overhaul.

* Do a better job of freeing Godot objects correctly.

* Simplify game states.

States are no longer cached. They're GC'd after shut down. Their creation has been simplified too due to IoCManager.InjectDependencies().

This makes returning to main menu work GUI wise.

* Be less aggressive on resource freeing. Only dispose Mono handles now.

* More work getting quit to work.

* Grids get cleared upon disconnect correctly.

* Disable rendering of the filler space tile.

I'll leave a nice parallax background up to content.

* Oops forgot to stage these.

* Fix issues in the csproj file.

* Make controls have own namespace.

* Chatbox GUI, other stuff.

Compiles but doesn't quite work yet.

* Git fuck you

* Chat works.

* Clicking on a not-control removes focus now.

* Fix an exception.

* Update mono. Use enums instead of constants now!

* Fix window dragging

* Fix chat stealing focus from other LineEdits on MacOS I guess.

* Correctly handle client shutdown & server disconnect.

* Fix error spam on client shutdown probably.

* Tiny amount of lighting code to have access to it from other computers

* Lighting works mostly.

* Godot.Texture.Flags -> FlagsEnum

* More WiP lighting code

* Turns out you can't control custom layers with cameras eh.

* WiP lighting almost works

* Lighting WORKS!

* Lobby thing.

* Some options menu work. I'm gonna try something

* Options menu works.

* More improvements.

* In game options menu works.

* Remove a debug log.

* Fix Window Movement and Drag.

* Huh Godot edited these scenes.

* Forgot to commit projects

* It compiles.

* I never claimed that.

* Update sandbox csprojs a bit.

* Makes sandbox load.

Client goes ingame but dies due to broken map manager networking code.

* Fix grids.

* Fix relogging duplicating entities inside Godot.

* Eyes!

* How about removing the TODO entry.

* Auto fetch bsdiffwrap.

* Update TODO.

* Remove TODO list.

* Tilemaps get cleaned on disconnect now.

* Fix bsdiff submodule HOPEFULLY

* Highly WiP and not compiling or working placement.

Yes this is the best way for me to share code between my computers.

* Fix bsdiff with spaces in path names bloody MSBuild + cmd.

* PLACEMENT KINDA WORKS.

NO RENDERING OR TILES YET.

ALSO I NEED TO REBASE THIS.

* Kill EngineContentPack.zip

* Fix map code and remove sprite components from the server.

* Ok entity placement mostly works.

* Grid lines sorta work but SnapgridCenter is still broke.

* Fix Center Grid Rendering.

* Work getting tile spawns to work. Not quite there yet.

* Fix placement and remove tiledef networking.

It werks!

* Remove SolutionSpecific.targets

Didn't end up being needed.

* Kill off wearableanimatedsprite component states.

* Do not put binaries relative to the solution.

* Remove shaders, reorganize prototypes for content.

* Reimplement SpriteComponent color.

* Correctly set __engine_human DrawDepth.

* Round coordinates passed to Godot to pixels to prevent issues.

* Remove some GUI log spam.

* Resource cache now uses the VFS more-proper but still awfully.

* Fix color reading code on SpriteComponent.

See, e94bf4854b106da51c89eeeab9a609be369f9622 did work.
The problem was all the code it NEEDED to work was broken.

* Step one into trying to fix Travis and AppVeyor.

* Auto download GodotSharp on Travis.

* Let's not make dumb mistakes with the cache directories.

* 2018 and requests still isn't in the stdlib.

* This maybe?

* This maybe?

* AppVeyor time.

* How 'bout we don't download sonarqube at all outside master.

* Try to cache on AppVeyor.

* Fix mac builds maybe.

* Finishing up Godot: cleanup.

* Eh this works too for SS14Loader.

* Remove some dead files

* Make Omnisharp not choke on buildchecker.

* Controls for box containers.

* Remove debug port from project.godot.

* Control and drawing improvements.

Controls are now properly capable of overriding Godot virtuals.
Importantly minsize calculations and stuff like HasPoint.

There is now a system for doing direct drawing on controls.
This is done with a DrawingHandle system.

TextureSource has been renamed to Texture.

Also there's a wrapping for Godot's style boxes now.

* Yeah don't insult omnisharp.

* Stylebox fixes and margin API on controls.

* Hey it compiles!

* Fix things.

* Fix null godot texture conversion.

* Fix client transform parenting.

* Fix movement sticking to north.

* Some updates.

* Work on exports.

* Unstubs client/Godot timing code.

It's mostly implemented now.

* Client unit tests work.

Jesus Christ.

* Let's figure out why AppVeyor hates me.

* Does the remie.

* Update GodotSharp download URL.

* Export templates for the builds server.

* Remove mac export icon.

* TO THE BUILDS SERVER.

* Probably implement the effects system in Godot.

* Fix mouse handling everywhere.

* Fix some CollidableComponent exceptions.

* Effects system works + unshaded option for LAZORS.

* Let's not fuck with Angle yet.

* Make file/line numbers show up on Windows Godot.
2018-04-07 15:24:46 +02:00
clusterfack
5f5c5f13c9 Changes physics and collidables (#543)
This is for projectile weapons, adds some enhancements and modifiers for collision behavior which will help out
2018-04-06 00:34:24 +02:00
clusterfack
b13af4cd8d Adds getentititiesinarc (#544)
A bit of a shitty function that somewhat works, get entities in a range that intersects ours but also has a center point within an angular range that we specify
2018-04-05 19:27:17 +02:00
clusterfack
f64309ba6f Arbitrary Effects System (#537)
* Moves client entity system to be closer to IoC registration and before gamescreen initialization

* Gives the raycasting system an argument to ignore a particular entity when finding what entity it will intersect

* Adds an arbitrary effects system

By creating a message defining things such as position, spritename, rotation, size, and delta values, you can create a temporary effect on the client. Just create a new message, define all the values upon it, pass it to the serverside effects system to send to the clients.

* Effects csprojs stuff and adding a datatype for priorityqueue from a nuget package

* Modifies nuget to use $solutiondir

* Effectsystemstuff
2018-04-05 19:26:35 +02:00
Acruid
67ecfe7ddb BaseServer - Kick Players On Shutdown (#541) 2018-03-27 13:56:52 -06:00
Acruid
77f7efdf6e MapLoader now catches any errors when creating an entity and prints them to the console instead of crashing the program. (#540) 2018-03-25 14:17:52 +02:00
Acruid
7d681567d1 Serializer Improvements (#539)
* Added Data Get/Set functions for use with Properties.

* Able to serialize generic List and Dictionary.

* Can now actually serialize generic lists and Dictionaries.

* Manually set the newline string for StreamWriter so the tests pass in linux/mac.
2018-03-25 14:17:41 +02:00
Acruid
553a0aca53 GameLoop Refactor (#538)
* Added Unit Tests for GameTiming.

* Added GameLoop class.

* Removed TimeScale.

* Switched server to the new GameLoop.

* Client now uses GameLoop.

* Allowed friend assemblies in release builds, so TravisCI can run tests.
2018-03-25 14:15:47 +02:00
DamianX
556fcbf7bd GetAllPlayers() doesn't return nulls (#542) 2018-03-22 17:03:03 +01:00
Acruid
3a5ea35c0b Raycasting + Turret AI (#532)
* Ray -> Box intersection works.

* Turret AI finished.

* Turret Works :D

* Light masks can now be rotated.

* Shoddy angle MoveTowards works.

* Shoddy Vector2 MoveTowards works.

* And pretty broken Quaternion version..

* Slept on it, rotation works good enough now.

* Fixed nuget dependencies.

* Moved AimShootLifeProcessor.cs to content.
2018-03-09 21:48:34 +01:00
Pieter-Jan Briers
2fb6f27cd1 Fix Travis and code analysis compiler warnings on Unix. (#535)
* Fix Travis and code analysis compiler warnings on Unix.

* Actually let's just disable macOS builds.
2018-03-09 18:03:20 +01:00
clusterfack
f57196a481 Directional Placement Manager Fix (#533)
* Placement Manager rotation fix

* Makes sure the default nondirectional sprites work as well
2018-03-09 18:02:54 +01:00
clusterfack
c03569a4e8 Full interaction system (#534)
Raises an event on click, regardless of whether we clicked on something or not. Sends it to the server to be parsed in the content interaction system.
2018-03-09 17:30:30 +01:00
Acruid
c8aaab48ad InputSystem Messages (#531)
* Misc cleanup.

* Removed BoundKeyChangeEventArgs.

* Removed event IClickableComponent.OnClick.

* Nothing uses EntityEventArgs now.

* Input messages are now sent through the network as SystemMessages instead of ComponentMessages.
Fixed EntitySystemMessage namespace name colliding with the base class.
Removed some unused code from server.

* Ignored KeyBindingInputComponent in the client prototype system.
Removed useless update code from client InputManager.
2018-03-03 13:19:18 +01:00
Acruid
a850c722cc Color Merge (#530)
* Removed useless CLSComplientAttribute from math structs.
Removed Obsolete functions from math structs.
Minor code cleanup.

* Merged Color into Color4, then renamed Color4 back to Color.
2018-02-27 19:37:33 +01:00
Acruid
b9cadc4599 Minor Refactorings (#529)
* Moved GameStateManager functions out of BaseServer.

* Moved PlayerManager NetMsgs out of BaseServer.

* Moved MapManager NetMsg out of BaseServer.

* Moved TryLoadAssembly from BaseServer to AssemblyLoader.

* Removed some service locator calls.
2018-02-27 19:35:18 +01:00
Acruid
eb74c4227f Component Messaging Rework (#528)
* Sealed Entity class.
Removed Entity.Update().
Code cleanup.

* Component.Update() is now obsolete.

* Added skeleton of new Component Message system.

* Converted everything to use new `SendMessage(owner, message)`.

* Removed more of the old system.

* Changes `IEntity.AddComponent(IComponent)` to `IEntity.AddComponent<T>`.
Removes some initialization functions from IEntity.

* Pulled ComponentManager registration out of Component into Entity.
Removed unused OnShutdown events from Entity and Component.

* Converted Component.ReceiveMessage() to Component.HandleMessage().

* Killed component message params.

* Remove EntityNetworkMessage params.
2018-02-24 09:16:28 -08:00
Acruid
ba981a13e0 Can now save and load full IMaps. (#523)
Server concmds for save/load map.
2018-02-18 00:10:17 +01:00
Acruid
eee7b3c598 Transform Parenting Enhancement (#522)
* Nightly Progress.

* Getting closer...

* !!! IT FUCKING WORKS !!!

* Cleanup

* Relative Rotation works.

* SpriteComponents now rotate properly.
2018-02-18 00:07:45 +01:00
clusterfack
441bdf628a Fix placement dragging affecting entities (#521)
* Fix placement dragging affecting entities

It now only affects tile placement

* Tuturu

* Fix annoying defaultanimatedsprite bug as well
2018-02-06 21:34:53 -06:00
Acruid
309ef2cea2 Map Blueprint Save/Loading (#520)
* YAML deserializer is coming along.
Nightly work.

* Should be pretty much working now.

* Converted most of the server components over.

* Entity loading/saving works.

* Grid saving/loading works.

* Cleans up old code.

* Saving and Loading of blueprints works.

* Improved map commands a bit.

* MapLoader fixes grid and map IDs in blueprint.
Can now load blueprints from the VFS.

* Removed Entity.LoadData(YamlMappingNode).

* Updated the nuget 'YamlDotNet' package to 4.3.0.

* Fixed Sandbox entry point.
Unit tests pass again.
2018-02-06 18:56:58 -06:00
clusterfack
8b31da2e0a Adds the same event subscriber entity has to entitysystems (#518)
* Adds the same event subscriber entity has to entitysystems

* Add the other helpers because pjb asked
2018-02-05 12:52:24 -07:00
clusterfack
59f158b13a Fixes spawn entity bug (#508)
* Fixes spawn entity bug

Now transform is called before initialize is, yay.

Call it shitcode but unless there is a better way that I cant find, this is the fix, and if there is please tell me

* Fixes incorrect AABB
2018-02-02 15:19:56 -07:00
clusterfack
2301c8d6ee Prevents sprite exceptions (#507)
* Prevents sprite exceptions

Even though setsprite has a default value that it gets set to, unless you give basesprite a non-null value and call setsprite it will cause the animatedsprite components to have an exception without fail. This happens if you don't include it in the prototype for whatever reason.

* Unnecessary
2018-02-02 15:19:40 -07:00
clusterfack
0427fa1537 Makes mouseclicktype an enum (#506)
* Changes clicktype to an enum because why isn't it

* Oops

* Whatever sure lets call it "ClickType" instead of "Clicktype"
2018-02-02 15:19:27 -07:00
Pieter-Jan Briers
f5e5cca2aa Supposedly fix collisions. 2018-01-31 22:37:02 +01:00
Acruid
5c0537f008 CloseTK (#503)
* Added math types from OpenTK project.

* Removed OpenTK from SS14.Server.

* Removed most references to OpenTK from SS14.Shared.

* Removed OpenTK from SS14.UnitTesting.

* Fixed errors in SS14.Client.Graphics.

* Removed more references.

* Remove OpenK from SS14.Client.

* Fised the last compile errors.

* Deleted opentk config file.
2018-01-26 07:31:37 -07:00
Acruid
a2f37d2613 Placement Click-Drag (#502)
* Fixes placement again.

* Can now click-drag tile placement to place multiple tiles.
2018-01-24 20:45:53 +01:00
Jordan Brown
f532d90b78 Fixes appveyor clone (#501) 2018-01-21 00:24:28 +01:00
Pieter-Jan Briers
785d164d29 Make AppVeyor use non-shallow clones for Sonar blame. (#500) 2018-01-21 00:09:37 +01:00
Pieter-Jan Briers
15823b1cb4 Fix AppVeyor maybe 2018-01-20 23:59:04 +01:00
Acruid
d0c317c8b4 Content Build Targets (#499)
* Changed projects so that Sandbox content is built in its own folder, and then copied to ./Resources/Assemblies.

* Moved SS14.Sandbox.targets to the ./MSBuild/ folder.
2018-01-20 23:47:42 +01:00
Acruid
21ebda05c2 Appease Sonar (#495) 2018-01-20 13:24:14 -07:00
clusterfack
8d208dca16 Entity Getters 2 (#496)
* Location Getters 2

Oh my god I didn't even make them part of the interface last time
Fixed a bug with local coordinates not be converted to world coordinates before comparing to other entities world transform
Added some more getter overloads

* Changes entities getters more

Adds a get entities in range for entity and range overload
Changed getentitiesinrange to take into account the bounding boxes of objects instead of their absolute coordinates

* SQUARE
2018-01-20 15:09:18 +01:00
Acruid
03a06cead9 EntityUid Type (#498)
* Wraps Entity Uids in their own type.

* EntityId can't be serialized by entity params.
2018-01-20 15:07:38 +01:00
Acruid
a2278f8ef2 Move Component Initialize to the Entity class. (#497)
Allowed EntityManager to work with the Entity class instead of IEntity.
2018-01-19 20:20:15 -06:00
Acruid
494c5c3eb3 kick Command (#494)
* Added a NetManager.DisconnectChannel so that server/shared can disconnect clients.
Added listplayers command to list all connected session on the server.
Added kick command to forcefully disconnect a connected session.

* Part 2, everything works now.
2018-01-18 18:51:23 -07:00
Silver
594f53d275 update appveyor.yml 2018-01-18 14:00:39 -07:00
clusterfack
9fbb0e6705 Fix Compile (#493)
Some conflicts in Acruid's PRs caused compile to be broken
2018-01-18 11:17:33 -07:00
clusterfack
d1e4a526c0 Adds some Location Getters (#492)
There's probably a million more I could add to be honest
2018-01-18 11:17:20 -07:00
clusterfack
ac38588a56 Updates some obsolete UI vars (#491)
Components is meant to be obsolete now, and anywhere its used are the primary cause of most current UI bugs. I removed one usage of it here.
2018-01-18 10:03:36 -07:00
clusterfack
8690c7a3f5 Updates content compatibility (#490)
Changes way content loads instead of using config, attempts content then loads sandbox instead
Fixes some compiler warnings
Adds a field needed for content player mob
2018-01-18 09:59:34 -07:00
Acruid
cfddef484c Embrace NetMessages (#488)
* Lidgren removed from Client.
ScreenBlocker control removed.

* Lidgren removed from server.
Lidgren removed from UnitTesting.
Lidgren only referenced in SS14.Shared.Network.

* Removed useless traffic debug printing.
Fix a bug with Keybinds being sent to server.

* NetMessages enum is finally gone :D

* Add warning for receiving NetMsgs without a registered callback.

* Moved some of the RegisterNetMessage calls out of BaseServer.
Added 'netaudit' concmd to list NetMsg callbacks on the server.

* Fixed exceptions, it works now.
LocalCoordinates.IsValidLocation() added.

* Moved all objects out of the SS14.Shared root namespace.
2018-01-18 09:58:46 -07:00
Acruid
e804fd3d2a Sprite Offset Property (#489)
Like
2018-01-18 09:55:23 -07:00
Acruid
976f8d7f76 Light Rendering and Masks (#487)
* Remove IoC self-referencing in MapManager.

* Added Circle to the math library.
Made LocalCoordinates equatable.
MapManager refactoring.
Light refactoring.

* Removed LightArea.

* GetEntities* functions now check mapIds.
PlacementManager does not place things in null space.
Prop Edit window "works" again.

* Lightmasks work.
2018-01-17 14:36:03 +01:00
Silver
2eb3f234ea Add Acruid to Code Reviewers 2018-01-15 11:17:09 -07:00
Acruid
785025f23c Sandbox Gamemode (#486)
* Adds skeleton Sandbox Content projects to the solution.

* Change BuildChecker output type to Class Library so that Resharper stops complaining about the project not having a Main() function.

* Added basic player event hooks to BaseServer.
Moved Server run level from PlayerManager to BaseServer.
Added concmds to switch between run levels on server.

* Forgot to commit project file.

* Entry points got changed a bit.

* You can now join a game without a map loaded on the server.

* Moved map loading to Content.

* Adds 'tp' command.

* Added 'addmap' command. Client crashes when used.

* Teleporting between maps works.

* Added GridId and MapId types.
Removed Test concmd, it was useless.
Misc formatting/cleanup.

* Tile placement kinda works.

* Added OnPlayerStatusChanged event.

* Server now auto starts the round.

* HandlePlayerStatusChanged works better now.

* Removed PlayerJoined* events from BaseServer, PlayerStatusChanged event does the same thing.

* Changed default platform of Sandbox from AnyCPU to x86.
Added "content.dllprefix" ConVar so that the config file can specify which content dll to load.
Changed LoadContentAssembly name argument to contain the entire name of the dll being searched for.

* SS14.Shared now copies Lidgren to the output directory.
More project configuration changes to remove the AnyCPU nonsense.
2018-01-15 11:03:50 -07:00
wixoaGit
29d2320ca3 Add timers. (#485)
* Add Timer and TimerManager.

* Register ITimerManager in the unit tests.

* Replace the event with an action.
2018-01-11 22:10:44 +01:00
Acruid
c992ee4d75 Added a Configuration Directory location to the Resource manager. (#484)
Renamed FindFiles to ContentFindFiles.
2018-01-04 09:08:47 +01:00
Acruid
6247ff4eff Console Rework (#483)
* Extracted the logic from DebugConsole into a new ClientConsole class.

* ClientConsole moved to IoC system.
Verb system replaced with concmds.

* Shared Cleanup

* ClientChatConsole skeleton.

* DebugConsole and LobbyChat are now both subscribed to ClientChatConsole.

* Removed server chat commands.

* cleaned up server command sysyem.

* More chat handling, and aliasing.

* Nightly work on Say command.

* Fixes a bug in Maths.Angle.

* Chat channel colors moved to ClientChatConsole.

* Now Server commands are sent without opening DebugConsole.

* Emotes work.
Clientside chat formatting works.

* Fixed angle unit test.
2018-01-04 00:53:41 +01:00
Acruid
1570ed1242 ClientSession/BaseClient Rework (#482)
* Added BaseClient.
Moved connecting system into BaseClient.

* Added ConnectFailed event to ClientNetManager.
BaseClient properly handles failed connection attempts.

* Session Rework

* Client now knows about other clients that are connected to the server.

* Reconnecting with the client works now.

* Allow Dupe IP.

* Shared PlayerManager shell.

* More session work.

* TWO PEOPLE CAN ACTUALLY CONNECT.

* Added some event functions to BaseClient.

* Basic multiplayer works again.

* Fixed MsgPlayerList buffer overrun.

* Lobby Updates.
Simplified MsgPlayerList, and cleaned up some networking.

* Cleaned up misc dead code.
Added DocComments to IBaseClient and BaseClient.

* Fixes spelling issues and adds more Doc Comments.
2017-12-21 15:30:44 +01:00
Decappi
cc970df3ad removed a bunch of vulnerabilities (#481)
* removed a bunch of vulnerabilities

* removed a bunch of vulnerabilities

* uncommented the code

* reverted .gitignore to its previous state

* fixed the compilation bug

* and again

* Switched to autoproperties everywhere where I could. There are still 3 unsolved vulnerabilities though.
Fixed some defaults not being set.

* Re-added the default value for BlendMode.
2017-12-16 19:08:24 +01:00
Pieter-Jan Briers
b1e3885bbb Fix lighting on MacOS. (#480)
* Fix lighting on MacOS.

* Make ReRender work outside GameScreen.
2017-11-27 08:27:23 -07:00
Pieter-Jan Briers
0f2ab942e1 Fix window resizing. (#479)
Fixes #475
2017-11-17 19:28:42 +01:00
Pieter-Jan Briers
e32e23de5a Fixes bugs with the entity spawn panel. (#477)
ImageButton respects ForegroundColor again, fixing the erase button
color.
ListBox fixed to not crash reliably.

Fixes #476
2017-11-14 10:02:56 -07:00
Pieter-Jan Briers
f1eaf8a268 Re-add GetComponent methods on IUserInterfaceManager. (#473)
* Re-add GetComponent methods on IUserInterfaceManager.

* Add TryGet methods too
2017-11-13 19:28:02 +01:00
Acruid
13d9eacbb7 Removes UiDev testing code from main menu. (#472) 2017-11-05 11:32:20 -08:00
Acruid
da3a865a0a UI Rework (#463)
* Screen now controls children.

* Input works.

* Transitions work.

* Removed IState.cs.

* More MainMenu.cs cleanup.

* Cleaned up options menu code.

* Simple Image now aligns properly.

* Alignment on the main menu works.

* YOU'RE NOT PERFECT

* Oh Boy ListBoxes.

* Screens actually get laid out properly.

* Big Options.

* Done fixing for tonight.

* More Cleaning!

* More cleanup, documentation and moving things to the base Control class.

* Migrating everything to use parent class properties.

* Lobby menu is looking good!

* More State cleanup.

* Give namespaces proper names.

* More namespace work.

* The chatbox position struggle is finally finished!

* Windows kinda work now.

* Scrollable Container work.

* OH GOD the listbox finally works.

* Ingame MainWindow works.

* Move spawn panels into CustomControls.

* TileSpawnPanel pretty much lays out.

* EntitySpawnWindow layout works.

* DebugConsole shows up, but contents do not display.

* Minor cleanup.

* Scrollbars work.

* Focus system should be working now.
Removed old code.

* Focus system should work as you expect now.
GameScreen now controls KeyBindingManager, so you can block movement keys with the UI.

* Text alignment fixed.
OptionsMenu background fixed.

* Mouseover UI scrolling works again.
Listbox dropdown now shrinks to fit contents.
Minor text alignment issues in Textbox fixed.

* Chatbox input alignment fixed.

* ListPanel is a thing now.

* ChatBox work.

* RichTextPanel now wraps lines.

* RTP cleanup.

* Fixes DebugConsole, Tabs, and Chatbox.
2017-11-05 13:04:49 +01:00
Acruid
5e17f2b08f Fixes opening client console crashing server. (#470) 2017-11-02 19:39:50 +01:00
Acruid
c05a0d4d29 Wraps missing member of SFML's Font and Glyph types. (#471)
Wraps SFML.Graphics.Glyph struct, and adds the rest of the SFML.Graphics.Font functions to the existing wrapper.
2017-11-02 11:21:28 -07:00
Pieter-Jan Briers
54aa6f94dd Adds an update event for the content repo. (#469)
* Adds an update event for the content repo.

* Remove debug output
2017-10-29 19:59:54 +01:00
Pieter-Jan Briers
8ce4376a60 Make engine content more clearly separated. (#468)
All prototypes inside the engine are now clearly marked and prefixed with `__engine_`. Also renames all prototypes to be snake_case, and added [engine] to their name.

Also, the content repo can now select which prototype to spawn for humans.
2017-10-29 19:59:46 +01:00
Pieter-Jan Briers
b342d128d2 Move rendering to a proper view matrix system. (#467)
* Some work making the camera less painful.

* More work.

* Ok Views work!
2017-10-29 19:57:46 +01:00
Pieter-Jan Briers
7d94019722 Optimize PlacementManager startup.
This used to take 4% of the startup time.
2017-10-29 19:55:13 +01:00
Pieter-Jan Briers
a9e65b46b8 Improve lighting performance. (#462) 2017-10-24 19:02:03 -06:00
Pieter-Jan Briers
96e3a66e5c Adds an occluder component. Fixes #440 (#461) 2017-10-24 15:15:39 -06:00
nullarmo
bf75212034 Closes #449 (#460) 2017-10-24 17:22:53 +02:00
Matt Smith
f49a106f04 Catch port in use exception (#457)
* Catch port in use exception

Fixes #454

* Improve messaging of port inuse error
2017-10-23 15:41:35 -06:00
Pieter-Jan Briers
37bb98b1f8 Fix setting IsHardCollidable: take 2 (#455)
* Fix UpdateIsHardCollidable.

Probably should've tested that beforehand.

Also optimized collidable removal extremely to not be O(n), by reworking the way they were stored inside the collision manager.

Seriously why would you use a dictionary as a dumb list of key/value pairs. WHY

* band-aid buggy client code

* better idea

* Apparently I forgot to remove this.
2017-10-22 23:47:03 +02:00
Pieter-Jan Briers
3461766659 Allow IsHardCollidable to be set during bump events. (#453) 2017-10-22 20:48:41 +02:00
Pieter-Jan Briers
2e28361a06 Enables bumping (#452) 2017-10-22 19:28:50 +02:00
Pieter-Jan Briers
824d757771 Adds bump event and IsHardCollidable setter (#450)
* Adds bump event and IsHardCollidable setter

* Make ishardcollidable default to true again.

* Fix compile, rename event.
2017-10-22 18:00:15 +02:00
Pieter-Jan Briers
8dc25ed24d Fix crash when disconnecting from server. (#447)
* Fix crash when disconnecting from server.

For some reason the game screen sets all sprites to have a null texture. This caused Sprite's Texture setter to nullref.

* Implement spritebatch.dispose, remove gaussianblur.dispose
2017-10-22 14:05:42 +02:00
Pieter-Jan Briers
d4dfb1abe5 Improves spritecomponent rendering performance. (#444) 2017-10-22 00:13:28 +02:00
Pieter-Jan Briers
bae3141481 Hopefully fix light manager. (#445)
* Hopefully fix light manager.

* Remove debug logging
2017-10-21 22:59:52 +02:00
Pieter-Jan Briers
8a7ea5b6f0 Improves debug mode perf & look (#443)
* Improves debug mode perf & look

Debug mode no langer tanks FPS by caching the used rectangle and text shapes. The LINQ removal probably helped too.

Sprite AABB debug has been removed since sprite AABBs aren't used anymore.

Implemented text shadowing, which is now used by the debug text to make it more readable.

Implemented collidable debug color from prototypes.

* Remove stray comma.
2017-10-21 19:35:21 +02:00
Pieter-Jan Briers
65d74f53e5 Adds an FPS counter. (#438)
It can be toggled by typing "fps" into the console.
2017-10-20 11:40:53 -06:00
Pieter-Jan Briers
3c1bc4ce88 Ok let's not do that fix just yet 2017-10-20 17:11:57 +02:00
Pieter-Jan Briers
a9d06e7612 Sonar code cleanup. 2017-10-20 17:00:19 +02:00
Pieter-Jan Briers
78d5965ba5 Woo late night compiler fighting! 2017-10-20 16:54:00 +02:00
Pieter-Jan Briers
d113938736 Encapsulate SFML to reside completely inside SS14.Client.Graphics. (#437)
* WiP of making SFML encapsulate by Client.Graphics.

* Up to like 40 files changed already!

* My hands are writing words.

* More work.

* Render states

* Client Graphics compiles

* More work

* C# compiler might be bugged

* C# compiler might be bugged

* Rust has ruined me

* It works!
2017-10-20 16:49:00 +02:00
Serkket
92e9d6636d Just a Mesely Sonar Cleanup (#436)
* TODO: Do all the TODOs

Just a sonar "clean up"

* Update1
2017-10-16 22:25:23 +02:00
Acruid
7fb7838738 Lighting Performace Changes (#435)
* Flips the lighting texture in the Shader instead of on the CPU.

* Clearing a RenderImage twice is pointless.
2017-10-13 22:23:23 +02:00
Pieter-Jan Briers
a3a2210de3 Map loading basics. (#434)
* Map loading basics.

Moves the entity saving system into a map loader kinda deal. Doesn't
save grids, but it's a start.

* Fix unit tests
2017-10-09 18:48:25 +02:00
Pieter-Jan Briers
e200cab1fb Box2i additions (#433)
Size property and casts to/from OpenTK.Box2.
2017-10-09 18:41:43 +02:00
Pieter-Jan Briers
92d8ed539a IServerTransformComponent improvements. (#431)
* IServerTransformComponent improvements.

IServerTransformComponent now more closely represents the API in TransformComponent, which was lacking because ITransformComponent is client-side, and the client cannot move entities itself, for example.

* Fix compile error
2017-10-01 22:27:36 -06:00
Pieter-Jan Briers
cb9ca3cc3c Fix network replication on WearableAnimatedSprite (#430) 2017-09-30 16:56:44 +02:00
Ash Walker
1065df5efd Fix string null check (#429) 2017-09-30 16:29:20 +02:00
Pieter-Jan Briers
20012304bd Make VS not modify the sln for buildchecker. (#428)
It was fixing the config because buildchecker had no hints to what the targets were.
2017-09-30 11:59:24 +02:00
Pieter-Jan Briers
349b366143 Fix transform parenting network replication. (#427) 2017-09-30 11:59:18 +02:00
Pieter-Jan Briers
64ea01a960 Crude system for allowing content to override the default mob. (#426)
The HumanMob_Content mob is spawned instead if it's defined.
2017-09-29 18:27:53 +02:00
Pieter-Jan Briers
1ebf093713 Allows creating other components inside Initialize(). (#425) 2017-09-26 23:08:53 +02:00
Pieter-Jan Briers
34fd263625 Fix content netserializer on server (#424)
It was not being included on the server, and type mismatches here are BAD.
2017-09-26 21:56:09 +02:00
Pieter-Jan Briers
a7a8d25a17 Disable type check temporarily. (#423)
It slows down development and has issues that need solving, like solutions to System.Type.
2017-09-26 20:28:44 +02:00
Pieter-Jan Briers
7bf3f70e92 Add more whitelisted types. (#422) 2017-09-25 20:53:15 +02:00
Pieter-Jan Briers
d37cdaf78c Fix sprites fetching transform in OnAdd instead of Initialize. (#421)
This caused a crash race condition.
2017-09-23 22:09:16 +02:00
Pieter-Jan Briers
a88a1ef72d Refactor and clean up containers. (#420)
* Refactor and clean up containers.

Containers are no longer arbitrarily bound to a single component, they use string IDs instead.

The API to interact with containers has been documented with doc comments.

Container creation now uses a static method.

Containers are sealed instead of abstract. Custom logic doesn't go on containers.

Theoretically fixed various bugs:
* Makes container manager creation work, previously it'd nullref.
* Containers being deleted now correctly detaches contained entities.

Still needs unit tests before being merged, because this code is still 100% untested.

* Lots of fixes, unit tests.
2017-09-17 21:43:14 -06:00
Pieter-Jan Briers
7484fe8fba Fix git_helper.py on Python 3.5 (#419)
* Fix git_helper.py on Python 3.5

* Fix it harder

* If at first you don't succeed.
2017-09-16 12:43:46 +02:00
Pieter-Jan Briers
d5fdd9be1f x64 unit test platform target. (#418) 2017-09-15 13:44:43 -06:00
clusterfack
1bb0227ff0 Makes Coordinates more Structy (#417)
More readonly-ish and less write-ish
2017-09-14 17:38:46 -05:00
Pieter-Jan Briers
4c2632710c Fix solution file. (#416)
I n S t A m E r G e
2017-09-14 15:13:59 -06:00
Pieter-Jan Briers
518a366c7e Attempt to fix Python on Travis being too old. (#415)
* Attempt to fix Python on Travis being too old.

* Fix RUN_THIS.py too.

* Fix CI builds blocking.

* Fix BuildChecker.csproj Python versioning in Travis.
2017-09-14 14:47:00 -06:00
clusterfack
07878ad7a7 Multiple Map System (#414)
* The million error march

This commit replaces many of the vector2's with their appropriate version of either LocalCoordinates, WorldCoordinates, or ScreenCoordinates

* Change transforms to send back worldcoordinates for position instead

* Adds coordinate class file

* What the fuck is going onnnnnn

* What the fuck is goign onnnnnnnnnnnn

* Changes some shit to use multiple maps instead
Fixes the compile errors in shared first

* Compile errors mostly fixed, about to rebase

* Merge branch 'master-wizfederation' into multiplemaps

# Conflicts:
#	SS14.Client.Graphics/CluwneLib.cs
#	SS14.Client/GameObjects/ClientEntityManager.cs
#	SS14.Client/GameObjects/Components/Renderable/AnimatedSpriteComponent.cs
#	SS14.Client/GameObjects/Components/Renderable/ItemSpriteComponent.cs
#	SS14.Client/GameObjects/Components/Renderable/ParticleSystemComponent.cs
#	SS14.Client/GameObjects/Components/Renderable/SpriteComponent.cs
#	SS14.Client/GameObjects/Components/Transform/TransformComponent.cs
#	SS14.Client/Interfaces/GameObjects/IClickTargetComponent.cs
#	SS14.Client/Placement/Modes/AlignSimilar.cs
#	SS14.Client/Placement/Modes/AlignSnapgridBorder.cs
#	SS14.Client/Placement/Modes/AlignSnapgridCenter.cs
#	SS14.Client/Placement/Modes/AlignTileAny.cs
#	SS14.Client/Placement/Modes/AlignTileEmpty.cs
#	SS14.Client/Placement/Modes/AlignTileNonSolid.cs
#	SS14.Client/Placement/Modes/AlignTileSolid.cs
#	SS14.Client/Placement/Modes/AlignWall.cs
#	SS14.Client/Placement/PlacementManager.cs
#	SS14.Server/GameObjects/ServerEntityManager.cs
#	SS14.Server/Interfaces/Player/IPlayerManager.cs
#	SS14.Server/Player/PlayerManager.cs

* Whops

* Compiles, loads somewhat, lights nonfunctional, many TODOs left

* serializes states, fixes incorrect spawn

* Fix map sending to the client

* Makes things only render on the correct zlevel

* Makes entity manager wait to intiialize shit after the maps arrive

* Fixes placement net messages

* Improves some of the placement managers, others need a bit of testing and tidying up again

* Transform fix

* Polishing, make coordinates into structs

* Remove resolved comments

* Last commit before master merge

* Fix the rest of the conflicts

* Fixes super spooky bug

* Fixes cross zlevel collisions

* Fix the rendering system to render the tile system regardless of grid location
2017-09-14 07:37:31 -06:00
Acruid
a483c8c88a Sprite Clicking Rework (#413)
* Fixed AnimatedSpriteComponent clicking, SpriteComponent is still bugged.

* Added Box2.Scale helper function.
Cleaned up the WasClicked function in AnimatedSpriteComponent.

* Renamed AABB to LocalAABB in ISpriteComponent and IRenderableComponent, so it is clearer what the property contains.
Fixed more bugs in AnimatedSpriteComponent.WasClicked(), and added exceptions.

* Fixed SpriteComponent.WasClicked().
Fixed unrelated bug in EntityManager, so entities can be properly deleted again.

* Fixed issue with sprite sorting using TextRect instead of LocalAABB.
2017-09-13 07:18:35 -06:00
Dumplin
cd74d12812 Fixed Movement; Edited OSX error message; Fixed some Sonar complaints (#410)
* * CluwneLib.cs: Make _window a local variable

* BaseCollection.cs: Formatting issue

* BaseServer.cs: Removed unused parameter

* ChatManager.cs: Made public encapsulated fields

* BoundKeyEventArgs.cs: Public encapsulated parameters

* CVarFlags.cs: Explicit variable setting

* ComponentFactory.cs: unused variable

* * CluwneLib.cs: Make _window a local variable

* BaseCollection.cs: Formatting issue

* BaseServer.cs: Removed unused parameter

* ChatManager.cs: Made public encapsulated fields

* BoundKeyEventArgs.cs: Public encapsulated parameters

* CVarFlags.cs: Explicit variable setting

* ComponentFactory.cs: unused variable

* CVar fixes

* Edited the OSX error message to be a little more helpful. (You have to edit the .dylibs because they come broken).

* Fixing the sprite movement problem

* Reverted error message

* Revert Again
2017-09-11 09:43:21 -06:00
Pieter-Jan Briers
eda5ad606b Make Sonar only run on master. (#409) 2017-09-06 22:59:30 -06:00
Pieter-Jan Briers
ddefef65ae Add our own Vector2 type. (#407)
* Add our own Vector2 type.

* Fix Clamp() typo.

* I shouldn't code when tired.

* Some unit tests.
2017-09-05 17:12:14 -06:00
Pieter-Jan Briers
062db741bd Update Mac Natives error message. (#406)
Now looks for 2.4 instead of 2.2 and suggests simply copying files instead of doing complicated InstallNameGuiTool stuff.
2017-09-05 17:11:21 -06:00
Pieter-Jan Briers
d46c2da175 Adds x64 platform targets. (#405)
Note that these won't work on Windows as that's still x86 SFML natives.
2017-09-02 21:51:08 -06:00
Acruid
1c6200666f Texture Loading Performance (#404)
* ~20% speed increase for loading textures.

* clickmap was useless, it is completely removed.
2017-09-01 14:39:40 -06:00
Acruid
c9666413b2 CluwneLib Static Variables Removal (#403)
* Changed Cluwnelib.TileSize name to CluwneLib.PixelsPerMeter. I think its more descriptive of what the name is.
Removed the splash screen debug #ifdef's, and replaced with proper ConditionalAttributes.

* Window encapsulated.

* Add the RELEASE compilation symbol to Release builds of all SS14 projects.

* More CluwneLib cleanup.
2017-09-01 14:39:27 -06:00
Pieter-Jan Briers
2575786a6e Allow deletion of entities and components during iteration. (#401)
* Allow deletion of entities and components during iteration.

* Remove some cases of _entities.Values
2017-09-01 14:07:00 -06:00
Acruid
149a6280b0 Move Lighting to SS14.Client.Graphics (#400)
* Interface to Interfaces.

* Lighting moved to SS14.Client.Graphics.

* Remove more dead code.
2017-08-31 08:21:14 -06:00
clusterfack
340d75c350 Fixes Bounding/Clicking Bugs (#396)
* Fixes Bounding/Clicking Bugs

This fixes a number of bugs with the clicking system.

- Wearable animated components were fixed so that they properly report their AABB
- Wearable animated components were fixed so that they properly use their nonwornsprite or wornsprite for checkclicking
- Fixes the clicking system only choosing the player character
- Fixes the eraser only working within a 1.5 tile range

* Uses FloatMath.CloseTo()
2017-08-29 12:03:09 -06:00
clusterfack
8d9a0e5142 Creates a Snap Checking System (#389)
* Creates a Snap Checking System

Creates a system that attempts to sanitize placement of objects when attempting to spawn them on snapping grids. This checks whether an object is trying to spawn specifically on a snap grid, and if it is checks against a snapflag of the type to see if other exclusive snappable objects are on that snap grid point.

Separates the spawnentityat into tryspawnentityat which checks for snappables, and forcespawnentityat which completely ignores that.

* Fixes the yaml placement
Fixes exemption from tryspawnentityat which didn't use the bool
Snap placement managers show when canspawnat is preventing them from spawning

* Improve snap placement managers again
Fix using prototype.name instead of prototype.ID

* Nope nope

* I need to unify these two types after the next refactor

* Move to strings for snap flags.

* Check

* 「s h i t c o d e」

* Gracias appveyor now I have seen the light

* Uses FloatMath.CloseTo() to check float equality
2017-08-29 12:01:44 -06:00
clusterfack
22f0cbd8f7 Changes CloseTo again slightly (#399) 2017-08-29 07:33:17 -06:00
clusterfack
5d443b6452 Adds closeto function for checking floating point equality (#398) 2017-08-28 18:28:33 -06:00
Acruid
83f8f37dc1 Prototypes now use ResourceManager. (#394)
* "./Resources/" folder is now mounted instead of "./" in the ResourceManager.
Prototypes now use the ResourceManager.
Added FindFiles(string path) to recursively find files in the ResourceManager.
General FileHelper bug fixing and cleanup.

* Ran SS14.Shared/ContentPack* through the code cleanup again.

* Put PJB's comma back in.
2017-08-28 17:10:15 -06:00
UristMcDorf
cc886ab614 Add required registrations in whitelist for temperature, damageable, destructible. (#393) 2017-08-28 14:21:30 +02:00
clusterfack
4273266950 Adds rendering color parameter to sprite components (#388)
* Adds rendering color parameter to sprite components

* Forgot to remove this

* Sets default value to white

* Like this you mean?
2017-08-27 10:02:11 -06:00
Acruid
658a0aee7f Entity Component Shutdown Fix. (#387)
Moved various component cleanup code from OnRemove to Shutdown.
2017-08-27 09:58:04 -06:00
Acruid
9898c2cf49 Turns INetSerializableType into NetSerializableAttribute (#386)
Turns INetSerializableType into NetSerializableAttribute.
2017-08-26 22:16:27 -06:00
Acruid
ddb5d9f3a8 NetGrapher Cleanup (#385)
Fixed bug in NetManager.
2017-08-26 22:15:36 -06:00
clusterfack
f227b3abc0 Adds grid to snap grid placement manager (#384)
* Adds grid to snap grid placement manager
Fixes drawline

* Done
2017-08-26 19:21:02 +02:00
Acruid
3920da2d9f Fixes moonwalk bug and inverted up/down controls. (#380) 2017-08-26 19:20:56 +02:00
clusterfack
bfbb31aa58 Snapgrid placement (#377)
* Snapgrid placement

* REEEEEEEEEEEE world space
2017-08-26 09:33:41 +02:00
clusterfack
799be40018 Fixes scrollable containers (#381) 2017-08-26 09:33:33 +02:00
wixoaGit
152eb8dd19 Ignore outdated state update messages (#383) 2017-08-26 09:33:23 +02:00
wixoaGit
c168c0fde1 Move client GameState management (#375)
* Move client GameState management

* Remove unnecessary sequence sending

* Move resolves to dependencies, set CurrentState instead of finding it
2017-08-25 21:21:14 +02:00
clusterfack
af3c90e2a8 Removes bad shutdown (#376)
* Undoes this

* Move it to the entity manager shutdown
2017-08-25 21:20:32 +02:00
clusterfack
12e6ef88c3 Makes Walls Entities, removes tile walls (#373)
* Makes walls into entities

* Fix the align tile empty placement mode, holy shit collision bounds is fucked

* Make shadowcasting from walls work again

* Fix lights on tiles
2017-08-24 09:38:28 -06:00
clusterfack
28d74cec56 Shifts down the mobs bounding box by 0.6 tiles. (#374) 2017-08-24 14:40:28 +02:00
Pieter-Jan Briers
02efd0b41a Made the git hooks history tolerant. (#372)
If its python file doesn't exist the hooks don't run.
2017-08-23 17:13:43 -05:00
Pieter-Jan Briers
5bf337479f Fix UnknowPrototypeException typo. (#371) 2017-08-23 16:02:36 -05:00
clusterfack
3816cdb3e4 Tiles Helper Functions (#370)
* Creates a helper function for making tile indices into tile refs, and a function to get a tileref one step in any particular direction of another tileref.

* Gottem

* k
2017-08-23 11:08:42 +02:00
Pieter-Jan Briers
e54339bb5c Make null data nodes on prototypes not call LoadData() on spawned entities. (#368) 2017-08-23 07:53:31 +02:00
Pieter-Jan Briers
98d867393c Update NUnit package version. (#367)
* Update NUnit package version.

* Let's not have Travis blow up.

* And I still messed the HintPath up.
2017-08-23 07:53:16 +02:00
Pieter-Jan Briers
8dd9a3c097 Content prefixes for the reflection manager. (#369)
Allows doing class: Prototypes.DiscoBall instead of Content.Client.Prototypes.DiscoBall
2017-08-23 07:53:04 +02:00
Pieter-Jan Briers
61d30be6b3 Lighting API cleanup. (#366) 2017-08-22 07:59:13 -06:00
Pieter-Jan Briers
7aa85c0b0c ColorUtils extensions, fixes and tests. (#365)
* Color4 extensions for byte color parts, fix WithAlpha with byte.

* Unit tests and bug fix for FromHex.
2017-08-22 07:38:29 -06:00
Pieter-Jan Briers
3574395843 Fix the entity spawn panel throwing NotImplementedException, Color -> Color4 (#364)
* Fix the entity spawn panel throwing NotImplementedException.

* More rabbit hole Color conversions.
2017-08-22 07:37:04 -06:00
Pieter-Jan Briers
13b333dcf6 Fix entity initialization. (#363) 2017-08-21 15:37:04 -06:00
Pieter-Jan Briers
bead08fc7c Fix prototype class inheritance. (#362) 2017-08-21 15:36:34 -06:00
Pieter-Jan Briers
073fb20b66 Adds a per-frame virtual entity update method. (#361) 2017-08-20 19:39:42 -06:00
Pieter-Jan Briers
7adca8280c Remove some IComponent type bounds, component shutdown event. (#360)
* Remove some IComponent type bounds, component shutdown event.

Methods like GetComponent<T> don't require T to implement IComponent anymore.

Added an event to IComponent that is invoked whenever the component is shut down.

* Always at least compile your stuff kids.
2017-08-20 19:38:20 -06:00
Gilles Coremans
61183eaba3 Fixes a sonar bug. (#359) 2017-08-20 19:37:08 -06:00
wixoaGit
477b0460e8 Implement MsgEntity (#358)
* Implement MsgEntity

* Move MsgEntity registration to GameController

* Fix serializer usage
2017-08-20 19:36:33 -06:00
Pieter-Jan Briers
dd18105c92 Remove SFML from shared and server. (#355)
* Remove SFML from shared and server.

* Fix unit tests.
2017-08-20 11:07:35 -06:00
Silver
585f2467c2 Update Linux Readme (#357) 2017-08-19 23:13:12 -06:00
Pieter-Jan Briers
0c3e4ea495 Allows inputting the server port on the client. (#354) 2017-08-19 20:19:00 -06:00
Pieter-Jan Briers
afe0c95cea Fix a race condition in collidablecomponent.OnAdd (#353) 2017-08-19 20:17:11 -06:00
PJB3005
e84f072278 Update submodule to hopefully disable SFML Sonar. 2017-08-19 13:55:31 +02:00
PJB3005
ca0bbab8c0 Attempt two. 2017-08-19 13:43:46 +02:00
PJB3005
6530b8806c Attempt to ignore SFML on Sonar 2017-08-19 13:35:57 +02:00
Pieter-Jan Briers
294057e3a1 Fix resource copying on the client. (#352) 2017-08-19 11:10:55 +02:00
Pieter-Jan Briers
a57abb2ca7 Move to our own SFML.NET fork with a submodule. (#351)
* Remove SFML binaries in repo.

* Add SFML.NET submodule from our fork.

* Get build checker for submodule handling.

* Fix project references. Remove SFML from non-client.

* Make it work!

* Automatically fetch Windows CSFML natives.

* Fix project file now I'm done debugging.

* Fix project references.

* Fix CI

* Now if only I didn't typo...

* Fix Travis too

* Fix lighting.

* Move shaders over to new API.

* Fix some obsoletions.

* Improve SetUniformArray casts
2017-08-19 10:28:39 +02:00
865 changed files with 44387 additions and 42545 deletions

View File

@@ -10,19 +10,56 @@ pull_requests:
do_not_increment_build_number: true
image: Visual Studio 2017
clone_depth: 10
install:
- ps: if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER) { cinst msbuild-sonarqube-runner }
- ps: >
if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER -And $env:APPVEYOR_REPO_BRANCH -Eq "master")
{
cinst msbuild-sonarqube-runner;
cinst opencover.portable;
}
before_build:
- cmd: py -3.5 Resources\buildResourcePack.py --resources-dir .\Resources --out .\Resources\ResourcePack.zip --atlas-tool .\Tools\AtlasTool.exe --no-animations --to-stderr
- cmd: py -3.5 -m pip install --user requests
- cmd: py -3.5 Tools\download_godotsharp.py
- cmd: py -3.5 RUN_THIS.py --no-prompt
- cmd: nuget restore SpaceStation14.sln
- ps: if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER) { MSBuild.SonarQube.Runner.exe begin /k:"ss14" /d:"sonar.host.url=https://sonarqube.com" /d:"sonar.login=$env:sonarqubekey" /d:"sonar.organization=space-wizards" }
- ps: >
if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER -And $env:APPVEYOR_REPO_BRANCH -Eq "master")
{
SonarScanner.MSBuild.exe begin /k:"ss14" /d:"sonar.host.url=https://sonarqube.com" /d:"sonar.login=$env:sonarqubekey" /d:"sonar.organization=space-wizards" /d:"sonar.exclusions=SFML/**" /d:sonar.cs.nunit.reportsPaths="$(Get-Location)\nunitTestResult.xml" /d:sonar.cs.opencover.reportsPaths="$(Get-Location)\coverage_report.xml";
}
platform: x64
configuration: Debug
cache:
- packages -> **\packages.config
- Dependencies
- SS14.Client.Godot\.mono\assemblies\GodotSharp.dll
- SS14.Client.Godot\.mono\assemblies\LAST_MODIFIED
build:
project: SpaceStation14.sln
parallel: true
parallel: false
verbosity: minimal
after_build:
- ps: if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER) { MSBuild.SonarQube.Runner.exe end /d:"sonar.login=$env:sonarqubekey" }
build_script:
- ps: msbuild SpaceStation14.sln /verbosity:minimal /nologo /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /p:Platform=x64 /p:Configuration=Debug /p:AppVeyor=yes
test_script:
- ps: >
if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER -And $env:APPVEYOR_REPO_BRANCH -Eq "master")
{
OpenCover.Console.exe -register:user -target:"nunit3-console.exe" -targetargs:".\bin\UnitTesting\SS14.UnitTesting.dll --result:nunitTestResult.xml" -output:".\coverage_report.xml";
}
else
{
nunit3-console.exe .\bin\UnitTesting\SS14.UnitTesting.dll;
}
after_test:
- ps: >
if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER -And $env:APPVEYOR_REPO_BRANCH -Eq "master")
{
SonarScanner.MSBuild.exe end /d:"sonar.login=$env:sonarqubekey";
}

View File

@@ -9,3 +9,6 @@ charset = utf-8-bom
[*.{csproj,xml,yml,dll.config,targets}]
indent_size = 2
[*.gdsl]
indent_style = tab

2
.github/CODEOWNERS vendored
View File

@@ -3,7 +3,7 @@
# These owners will be the default owners for everything in the repo.
# * @defunkt
* @PJB3005 @Silvertorch5
* @Acruid @PJB3005 @Silvertorch5
# Order is important. The last matching pattern has the most precedence.
# So if a pull request only touches javascript files, only these owners

10
.gitignore vendored
View File

@@ -79,3 +79,13 @@ NetSerializerDebug.dll
# We're not gonna ship Mac extlibs with the repo due to size. (11 MB)
Third-Party/extlibs/Mac/
# Or the automatically-fetched Windows natives, for that matter.
Third-Party/extlibs/Windows/
# Actually I'll make this folder because SS14.Shared.Bsdiff isn't third-party is it?
Dependencies/
# Python stuff
__pycache__
.mypy_cache

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "SS14.Shared.Bsdiff"]
path = SS14.Shared.Bsdiff
url = https://github.com/space-wizards/ss14.shared.bsdiff.git

View File

@@ -5,17 +5,34 @@ sudo: false
os:
- linux
- osx
#- osx
before_install:
- if [ $TRAVIS_OS_NAME = osx ]; then brew update && brew install python3; fi
addons:
apt:
sources:
- deadsnakes
packages:
- python3.6
cache:
directories:
- packages/
- Dependencies/
- SS14.Client.Godot/.mono/assemblies/
#before_install:
# - if [ $TRAVIS_OS_NAME = osx ]; then brew update && brew upgrade python; fi
before_script:
- "if [ $TRAVIS_OS_NAME = linux ]; then pyenv shell 3.6; fi"
- "pip3 install --user requests"
- "nuget restore SpaceStation14.sln"
- "python3.6 RUN_THIS.py --no-prompt"
- "Tools/download_godotsharp.py"
script:
- "python3 ./Resources/buildResourcePack.py --resources-dir ./Resources --out ./Resources/ResourcePack.zip --no-atlas --no-animations --to-stderr"
- "msbuild /p:Configuration=Release /p:HEADLESS=1 /nologo /m /p:AllowMissingMacNatives=yes SpaceStation14.sln"
- "cd packages/NUnit.ConsoleRunner.3.6.1/tools"
- "msbuild /p:Configuration=Debug /p:Platform=x64 /p:HEADLESS=1 /nologo /m /p:AllowMissingMacNatives=yes SpaceStation14.sln /p:Python=python3.6"
- "cd packages/NUnit.ConsoleRunner.3.7.0/tools"
- "mono --debug nunit3-console.exe ../../../bin/UnitTesting/SS14.UnitTesting.dll"

1
BuildChecker/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
INSTALLED_HOOKS_VERSION

View File

@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This is a dummy .csproj file to check things like submodules.
Better this than other errors.
If you want to create this kind of file yourself, you have to create an empty .NET application,
Then strip it of everything until you have the <Project> tags.
VS refuses to load the project if you make a bare project file and use Add -> Existing Project... for some reason.
You want to handle the Build, Clean and Rebuild tasks to prevent missing task errors on build.
If you want to learn more about these kinds of things, check out Microsoft's official documentation about MSBuild:
https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild
-->
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Choose>
<When Condition="'$(Python)' == ''">
<PropertyGroup>
<Python>python3</Python>
<Python Condition="'$(OS)'=='Windows_NT' Or '$(OS)'=='Windows'">py -3</Python>
</PropertyGroup>
</When>
</Choose>
<PropertyGroup>
<ProjectGuid>{D0DA124B-5580-4345-A02B-9F051F78915F}</ProjectGuid>
<OutputType>Library</OutputType>
<TargetFrameworkMoniker>.NETFramework, Version=v4.6.1</TargetFrameworkMoniker>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' " />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' " />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' " />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' " />
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<Target Name="Build">
<Exec Command="$(Python) git_helper.py" CustomErrorRegularExpression="^Error" />
</Target>
<Target Name="Rebuild" DependsOnTargets="Build" />
<Target Name="Clean">
<Message Importance="low" Text="Ignoring 'Clean' target." />
</Target>
<Target Name="Compile" />
<Target Name="CoreCompile" />
</Project>

105
BuildChecker/git_helper.py Executable file
View File

@@ -0,0 +1,105 @@
#!/usr/bin/env python3
# Installs git hooks, updates them, updates submodules, that kind of thing.
import subprocess
import sys
import os
import shutil
from pathlib import Path
from typing import List
BUILD_CHECKER_PATH = Path(Path(__file__).resolve().parent)
SS14_ROOT_PATH = Path(BUILD_CHECKER_PATH.parent)
SOLUTION_PATH = Path(SS14_ROOT_PATH/"SpaceStation14.sln")
CURRENT_HOOKS_VERSION = "2" # If this doesn't match the saved version we overwrite them all.
QUIET = "--quiet" in sys.argv
NO_HOOKS = "--nohooks" in sys.argv
def run_command(command: List[str], capture: bool = False) -> subprocess.CompletedProcess:
"""
Runs a command with pretty output.
"""
text = ' '.join(command)
if not QUIET:
print("$ {}".format(text))
sys.stdout.flush()
completed = None
if capture:
completed = subprocess.run(command, cwd=str(SS14_ROOT_PATH), stdout=subprocess.PIPE)
else:
completed = subprocess.run(command, cwd=str(SS14_ROOT_PATH))
if completed.returncode != 0:
raise RuntimeError("Error: command exited with code {}!".format(completed.returncode))
return completed
def update_submodules():
"""
Updates all submodules.
"""
status = run_command(["git", "submodule", "update", "--init", "--recursive"], capture=True)
if status.stdout.decode().strip():
print("Git submodules changed. Reloading solution.")
reset_solution()
def install_hooks():
"""
Installs the necessary git hooks into .git/hooks.
"""
# Read version file.
hooks_version_file = BUILD_CHECKER_PATH/"INSTALLED_HOOKS_VERSION"
if os.path.isfile(str(hooks_version_file)):
with open(str(hooks_version_file), "r") as f:
if f.read() == CURRENT_HOOKS_VERSION:
if not QUIET:
print("No hooks change detected.")
return
with open(str(hooks_version_file), "w") as f:
f.write(CURRENT_HOOKS_VERSION)
print("Hooks need updating.")
hooks_target_dir = SS14_ROOT_PATH/".git"/"hooks"
hooks_source_dir = BUILD_CHECKER_PATH/"hooks"
if not os.path.exists(str(hooks_target_dir)):
os.makedirs(str(hooks_target_dir))
# Clear entire tree since we need to kill deleted files too.
for filename in os.listdir(str(hooks_target_dir)):
os.remove(str(hooks_target_dir/filename))
for filename in os.listdir(str(hooks_source_dir)):
print("Copying hook {}".format(filename))
shutil.copyfile(str(hooks_source_dir/filename), str(hooks_target_dir/filename))
def reset_solution():
"""
Force VS to think the solution has been changed to prompt the user to reload it,
thus fixing any load errors.
"""
with SOLUTION_PATH.open("r") as f:
content = f.read()
with SOLUTION_PATH.open("w") as f:
f.write(content)
def main():
if not NO_HOOKS:
install_hooks()
update_submodules()
if __name__ == '__main__':
main()

View File

@@ -0,0 +1,19 @@
#!/bin/bash
gitroot=`git rev-parse --show-toplevel`
cd "$gitroot/BuildChecker"
if [ -f "git_helper.py" ]
then
if [[ `uname` == MINGW* || `uname` == CYGWIN* ]]; then
# Windows
# Can't update hooks from here because we are a hook,
# and the file is read only while it's used.
# Thanks Windows.
py -3 git_helper.py --quiet --nohooks
else
# Not Windows, so probably some other Unix thing.
python3 git_helper.py --quiet
fi
fi

View File

@@ -0,0 +1,5 @@
#!/bin/bash
# Just call post-checkout since it does the same thing.
gitroot=`git rev-parse --show-toplevel`
bash "$gitroot/.git/hooks/post-checkout"

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
<PropertyGroup>
<ProjectType>Local</ProjectType>
@@ -6,72 +6,65 @@
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{59250BAF-0000-0000-0000-000000000000}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<ApplicationIcon>
</ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<Platform Condition=" '$(Platform)' == '' ">x64</Platform>
<ApplicationIcon />
<AssemblyKeyContainerName />
<AssemblyName>Lidgren.Network</AssemblyName>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<OutputType>Library</OutputType>
<AppDesignerFolder>
</AppDesignerFolder>
<AppDesignerFolder />
<RootNamespace>Lidgren.Network</RootNamespace>
<StartupObject>
</StartupObject>
<StartArguments>
</StartArguments>
<FileUpgradeFlags>
</FileUpgradeFlags>
<StartupObject />
<StartArguments />
<FileUpgradeFlags />
<ConfigurationOverrideFile />
<TargetFrameworkProfile />
<DocumentationFile />
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<FileAlignment>4096</FileAlignment>
<OutputPath>..\bin\Lidgren\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<NoStdLib>False</NoStdLib>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>False</Optimize>
<OutputPath>$(SolutionDir)bin\Lidgren\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoStdLib>False</NoStdLib>
<NoWarn>
</NoWarn>
<PlatformTarget>x86</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>False</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize>
<OutputPath>$(SolutionDir)bin\Lidgren\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoStdLib>False</NoStdLib>
<NoWarn>
</NoWarn>
<PlatformTarget>x86</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DebugSymbols>True</DebugSymbols>
<Optimize>False</Optimize>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
<DefineConstants>TRACE</DefineConstants>
<DebugSymbols>False</DebugSymbols>
<Optimize>True</Optimize>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugSymbols>False</DebugSymbols>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp">

View File

@@ -252,9 +252,20 @@ namespace Lidgren.Network
}
if (m_messageReceivedEvent != null)
{
m_messageReceivedEvent.Set();
m_messageReceivedEvent.Close();
m_messageReceivedEvent = null;
try
{
m_messageReceivedEvent.Set();
m_messageReceivedEvent.Close();
}
catch (ObjectDisposedException)
{
// For some reason, inside Godot this seems to throw ObjectDisposedExceptions on client shutdown.
// If it's already disposed then I guess this is fine?
}
finally
{
m_messageReceivedEvent = null;
}
}
}
finally

View File

@@ -263,7 +263,7 @@ namespace Lidgren.Network
}
return new string(c);
}
/// <summary>
/// Gets the local broadcast address
/// </summary>
@@ -275,7 +275,7 @@ namespace Lidgren.Network
if (wifi.IsWifiEnabled)
{
var dhcp = wifi.DhcpInfo;
int broadcast = (dhcp.IpAddress & dhcp.Netmask) | ~dhcp.Netmask;
byte[] quads = new byte[4];
for (int k = 0; k < 4; k++)
@@ -289,7 +289,7 @@ namespace Lidgren.Network
{
return IPAddress.Broadcast;
}
#endif
#endif
#if IS_FULL_NET_AVAILABLE
try
{
@@ -298,7 +298,7 @@ namespace Lidgren.Network
{
return null;
}
IPInterfaceProperties properties = ni.GetIPProperties();
foreach (UnicastIPAddressInformation unicastAddress in properties.UnicastAddresses)
{
@@ -307,24 +307,24 @@ namespace Lidgren.Network
var mask = unicastAddress.IPv4Mask;
byte[] ipAdressBytes = unicastAddress.Address.GetAddressBytes();
byte[] subnetMaskBytes = mask.GetAddressBytes();
if (ipAdressBytes.Length != subnetMaskBytes.Length)
throw new ArgumentException("Lengths of IP address and subnet mask do not match.");
byte[] broadcastAddress = new byte[ipAdressBytes.Length];
for (int i = 0; i < broadcastAddress.Length; i++)
{
broadcastAddress[i] = (byte)(ipAdressBytes[i] | (subnetMaskBytes[i] ^ 255));
}
return new IPAddress(broadcastAddress);
return new IPAddress(broadcastAddress);
}
}
}
catch // Catch any errors
catch // Catch any errors
{
return IPAddress.Broadcast;
}
#endif
#endif
return IPAddress.Broadcast;
}
@@ -340,21 +340,21 @@ namespace Lidgren.Network
Android.Net.Wifi.WifiManager wifi = (Android.Net.Wifi.WifiManager)Android.App.Application.Context.GetSystemService(Android.App.Activity.WifiService);
if (!wifi.IsWifiEnabled) return null;
var dhcp = wifi.DhcpInfo;
int addr = dhcp.IpAddress;
byte[] quads = new byte[4];
for (int k = 0; k < 4; k++)
{
quads[k] = (byte) ((addr >> k * 8) & 0xFF);
}
}
return new IPAddress(quads);
}
catch // Catch Access Denied errors
{
return null;
}
#endif
#endif
#if IS_FULL_NET_AVAILABLE
NetworkInterface ni = GetNetworkInterface();
if (ni == null)
@@ -577,4 +577,4 @@ namespace Lidgren.Network
return bdr.ToString();
}
}
}
}

View File

@@ -0,0 +1,20 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
<!-- Adds to the DefineConstants to provide things such as platform-specific defines. -->
<Choose>
<When Condition="'$(TargetOS)' == 'Windows'">
<PropertyGroup>
<DefineConstants>$(DefineConstants);WINDOWS</DefineConstants>
</PropertyGroup>
</When>
<When Condition="'$(TargetOS)' == 'MacOS'" >
<PropertyGroup>
<DefineConstants>$(DefineConstants);MACOS</DefineConstants>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<DefineConstants>$(DefineConstants);LINUX</DefineConstants>
</PropertyGroup>
</Otherwise>
</Choose>
</Project>

View File

@@ -23,5 +23,7 @@
</Choose>
<PropertyGroup>
<TargetOS Condition="'$(TargetOS)' == ''">$(ActualOS)</TargetOS>
<Python>python3</Python>
<Python Condition="'$(ActualOS)' == 'Windows'">py -3</Python>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,11 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Common target to copy content assemblies to the parent projects. -->
<Target Name="CopyContentAssemblies">
<Copy SourceFiles="@(ContentAssemblies)" DestinationFolder="$(ContentAssemblyTarget)" />
</Target>
<ItemDefinitionGroup>
<ContentAssemblies>
<Visible>False</Visible>
</ContentAssemblies>
</ItemDefinitionGroup>
</Project>

41
RUN_THIS.py Executable file
View File

@@ -0,0 +1,41 @@
#!/usr/bin/env python3
# Import future so people on py2 still get the clear error that they need to upgrade.
from __future__ import print_function
import os
import sys
import traceback
VERSION = sys.version_info
NO_PROMPT = "--no-prompt" in sys.argv
sane_input = raw_input if VERSION.major < 3 else input
def main():
if VERSION.major < 3 or (VERSION.major == 3 and VERSION.minor < 5):
print("ERROR: You need at least Python 3.5 to build SS14.")
# Need "press enter to exit" stuff because Windows just immediately closes conhost.
if not NO_PROMPT:
sane_input("Press enter to exit...")
exit(1)
# Import git_helper by modifying the path.
ss14_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(ss14_dir, "BuildChecker"))
try:
import git_helper
git_helper.main()
except Exception as e:
print("ERROR:")
traceback.print_exc()
print("This was NOT intentional. If the error is not immediately obvious, ask on Discord or IRC for help.")
if not NO_PROMPT:
sane_input("Press enter to exit...")
exit(1)
if __name__ == "__main__":
main()
if not NO_PROMPT:
sane_input("Success! Press enter to exit...")

File diff suppressed because it is too large Load Diff

View File

@@ -1,63 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ParticleSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Sprite>star1</Sprite>
<EmitterPosition>
<X>358</X>
<Y>385</Y>
</EmitterPosition>
<EmissionOffset>
<X>0</X>
<Y>0</Y>
</EmissionOffset>
<EmitRate>30</EmitRate>
<MaximumParticleCount>200</MaximumParticleCount>
<EmissionRadiusRange>
<X>5</X>
<Y>20</Y>
</EmissionRadiusRange>
<Velocity>
<X>0</X>
<Y>0</Y>
</Velocity>
<VelocityVariance>0</VelocityVariance>
<Acceleration>
<X>0</X>
<Y>1.5</Y>
</Acceleration>
<AccelerationVariance>0</AccelerationVariance>
<RadialVelocity>10</RadialVelocity>
<RadialVelocityVariance>0</RadialVelocityVariance>
<RadialAcceleration>-1.25</RadialAcceleration>
<RadialAccelerationVariance>0</RadialAccelerationVariance>
<TangentialVelocity>0</TangentialVelocity>
<TangentialVelocityVariance>0</TangentialVelocityVariance>
<TangentialAcceleration>0</TangentialAcceleration>
<TangentialAccelerationVariance>0</TangentialAccelerationVariance>
<Lifetime>10</Lifetime>
<LifetimeVariance>2</LifetimeVariance>
<SpinVelocity>
<X>0</X>
<Y>0</Y>
</SpinVelocity>
<SpinVelocityVariance>0</SpinVelocityVariance>
<SizeRange>
<X>0.1</X>
<Y>0.05</Y>
</SizeRange>
<SizeVariance>0.05</SizeVariance>
<ColorRange>
<Start>
<A>255</A>
<R>113</R>
<G>199</G>
<B>255</B>
</Start>
<End>
<A>80</A>
<R>103</R>
<G>180</G>
<B>255</B>
</End>
</ColorRange>
<ColorVariance>0</ColorVariance>
</ParticleSettings>

View File

@@ -1,63 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ParticleSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Sprite>star1</Sprite>
<EmitterPosition>
<X>358</X>
<Y>385</Y>
</EmitterPosition>
<EmissionOffset>
<X>0</X>
<Y>0</Y>
</EmissionOffset>
<EmitRate>30</EmitRate>
<MaximumParticleCount>200</MaximumParticleCount>
<EmissionRadiusRange>
<X>5</X>
<Y>20</Y>
</EmissionRadiusRange>
<Velocity>
<X>0</X>
<Y>0</Y>
</Velocity>
<VelocityVariance>0</VelocityVariance>
<Acceleration>
<X>0</X>
<Y>1.5</Y>
</Acceleration>
<AccelerationVariance>0</AccelerationVariance>
<RadialVelocity>10</RadialVelocity>
<RadialVelocityVariance>0</RadialVelocityVariance>
<RadialAcceleration>-1.25</RadialAcceleration>
<RadialAccelerationVariance>0</RadialAccelerationVariance>
<TangentialVelocity>0</TangentialVelocity>
<TangentialVelocityVariance>0</TangentialVelocityVariance>
<TangentialAcceleration>0</TangentialAcceleration>
<TangentialAccelerationVariance>0</TangentialAccelerationVariance>
<Lifetime>10</Lifetime>
<LifetimeVariance>2</LifetimeVariance>
<SpinVelocity>
<X>0</X>
<Y>0</Y>
</SpinVelocity>
<SpinVelocityVariance>0</SpinVelocityVariance>
<SizeRange>
<X>0.1</X>
<Y>0.05</Y>
</SizeRange>
<SizeVariance>0.05</SizeVariance>
<ColorRange>
<Start>
<A>255</A>
<R>228</R>
<G>26</G>
<B>199</B>
</Start>
<End>
<A>30</A>
<R>223</R>
<G>31</G>
<B>212</B>
</End>
</ColorRange>
<ColorVariance>0</ColorVariance>
</ParticleSettings>

View File

@@ -1,63 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ParticleSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Sprite>smoke</Sprite>
<EmitterPosition>
<X>358</X>
<Y>385</Y>
</EmitterPosition>
<EmissionOffset>
<X>0</X>
<Y>0</Y>
</EmissionOffset>
<EmitRate>11</EmitRate>
<MaximumParticleCount>200</MaximumParticleCount>
<EmissionRadiusRange>
<X>0</X>
<Y>0</Y>
</EmissionRadiusRange>
<Velocity>
<X>0</X>
<Y>-0</Y>
</Velocity>
<VelocityVariance>0</VelocityVariance>
<Acceleration>
<X>0</X>
<Y>-13</Y>
</Acceleration>
<AccelerationVariance>3</AccelerationVariance>
<RadialVelocity>0</RadialVelocity>
<RadialVelocityVariance>0</RadialVelocityVariance>
<RadialAcceleration>0</RadialAcceleration>
<RadialAccelerationVariance>0</RadialAccelerationVariance>
<TangentialVelocity>0</TangentialVelocity>
<TangentialVelocityVariance>0</TangentialVelocityVariance>
<TangentialAcceleration>0</TangentialAcceleration>
<TangentialAccelerationVariance>0</TangentialAccelerationVariance>
<Lifetime>3</Lifetime>
<LifetimeVariance>0</LifetimeVariance>
<SpinVelocity>
<X>0</X>
<Y>0</Y>
</SpinVelocity>
<SpinVelocityVariance>0.3</SpinVelocityVariance>
<SizeRange>
<X>0</X>
<Y>1</Y>
</SizeRange>
<SizeVariance>0</SizeVariance>
<ColorRange>
<Start>
<A>208</A>
<R>128</R>
<G>128</G>
<B>128</B>
</Start>
<End>
<A>0</A>
<R>48</R>
<G>48</G>
<B>48</B>
</End>
</ColorRange>
<ColorVariance>0</ColorVariance>
</ParticleSettings>

View File

@@ -1,63 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ParticleSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Sprite>star1</Sprite>
<EmitterPosition>
<X>358</X>
<Y>385</Y>
</EmitterPosition>
<EmissionOffset>
<X>0</X>
<Y>0</Y>
</EmissionOffset>
<EmitRate>40</EmitRate>
<MaximumParticleCount>200</MaximumParticleCount>
<EmissionRadiusRange>
<X>10</X>
<Y>170</Y>
</EmissionRadiusRange>
<Velocity>
<X>0</X>
<Y>-20</Y>
</Velocity>
<VelocityVariance>0</VelocityVariance>
<Acceleration>
<X>0</X>
<Y>-30</Y>
</Acceleration>
<AccelerationVariance>0</AccelerationVariance>
<RadialVelocity>0</RadialVelocity>
<RadialVelocityVariance>1</RadialVelocityVariance>
<RadialAcceleration>10</RadialAcceleration>
<RadialAccelerationVariance>0</RadialAccelerationVariance>
<TangentialVelocity>0</TangentialVelocity>
<TangentialVelocityVariance>1</TangentialVelocityVariance>
<TangentialAcceleration>0</TangentialAcceleration>
<TangentialAccelerationVariance>0.2</TangentialAccelerationVariance>
<Lifetime>3</Lifetime>
<LifetimeVariance>0</LifetimeVariance>
<SpinVelocity>
<X>0</X>
<Y>0</Y>
</SpinVelocity>
<SpinVelocityVariance>2</SpinVelocityVariance>
<SizeRange>
<X>1</X>
<Y>1</Y>
</SizeRange>
<SizeVariance>0</SizeVariance>
<ColorRange>
<Start>
<A>255</A>
<R>0</R>
<G>0</G>
<B>255</B>
</Start>
<End>
<A>255</A>
<R>0</R>
<G>0</G>
<B>0</B>
</End>
</ColorRange>
<ColorVariance>0</ColorVariance>
</ParticleSettings>

View File

@@ -0,0 +1,31 @@
- type: entity
id: __engine_janitor_suit
name: "[engine] Janitor Jumpsuit"
components:
- type: Transform
- type: Clickable
- type: Sprite
texture: Items/janitorsuit.png
- type: Icon
texture: Items/janitorsuit.png
- type: BoundingBox
- type: Physics
mass: 5
- type: entity
id: __engine_shoes
name: "[engine] shoes"
components:
- type: Transform
- type: Clickable
- type: Sprite
texture: Items/janitorsuit.png
- type: Icon
texture: Items/shoes.png
- type: BoundingBox
- type: Physics
mass: 5

View File

@@ -0,0 +1,15 @@
- type: entity
id: __engine_toolbox
name: "[engine] toolbox"
components:
- type: Transform
- type: Clickable
- type: Sprite
texture: Items/toolbox_r.png
- type: Icon
texture: Items/toolbox_r.png
- type: BoundingBox
- type: Physics
mass: 5

View File

@@ -0,0 +1,19 @@
- type: entity
id: __engine_door
name: "[engine] Real Fake Door"
components:
- type: Transform
- type: Clickable
- type: Sprite
drawdepth: Objects
texture: Objects/door_ew.png
- type: Icon
texture: Objects/door_ew.png
- type: BoundingBox
- type: Collidable
placement:
snap:
- Wall

View File

@@ -1,15 +1,14 @@
- type: entity
id: Mop
name: Mop
id: __engine_mop
name: "[engine] mop"
components:
- type: Transform
- type: Clickable
- type: WearableAnimatedSprite
sprite: player_toolbox
notWornSprite: mop
- type: Sprite
texture: Items/mop.png
- type: Icon
icon: mop
texture: Items/mop.png
- type: BoundingBox
- type: Physics

View File

@@ -0,0 +1,23 @@
- type: entity
id: __engine_wall_light
name: "[engine] Wall Light"
components:
- type: Transform
- type: Clickable
- type: Sprite
texture: Objects/wall_light.png
- type: Icon
texture: Objects/wall_light.png
- type: BoundingBox
- type: PointLight
radius: 8
energy: 1.2
offset: "0, -16"
color: "#DCDCC6"
placement:
snap:
- Wallmount

View File

@@ -0,0 +1,26 @@
- type: entity
id: __engine_human
name: "[engine] Urist McHuman"
save: false
components:
- type: Transform
- type: Clickable
- type: Sprite
sprite: Mob/greyshirt.rsi
state: greyshirt
scale: 2, 2
drawdepth: Mobs
- type: Icon
sprite: Mob/greyshirt.rsi
state: greyshirt
- type: BoundingBox
aabb: "0.15,-0.45,1.05,0.45"
- type: Physics
mass: 5
- type: Collidable
DebugColor: "#0000FF"

View File

@@ -1,21 +1,18 @@
- type: entity
id: Worktop
name: Worktop
id: __engine_worktop
name: "[engine] worktop"
components:
- type: Transform
- type: Clickable
- type: Sprite
sprites:
- worktop_single
drawdepth: Tables
texture: Objects/worktop_single.png
- type: Icon
icon: worktop_single
texture: Objects/worktop_single.png
- type: BoundingBox
sizeX: 2
sizeY: 1.4
offsetY: 0.25
aabb: "-0.45,-1,0.95,1"
DebugColor: "#0000FF"
- type: Collidable
DebugColor: "#0000FF"

View File

@@ -0,0 +1,60 @@
- type: entity
id: __engine_extinguisher
name: "[engine] Extinguisher Cabinet"
components:
- type: Transform
- type: Clickable
- type: Sprite
texture: Objects/fire_extinguisher.png
- type: Icon
texture: Objects/fire_extinguisher.png
placement:
mode: AlignWall
range: 200
nodes:
- 18
- 26
- 32
snap:
- Wallmount
- type: entity
id: __engine_fire_alarm
name: "[engine] Fire Alarm"
components:
- type: Transform
- type: Clickable
- type: Sprite
texture: Objects/fire_alarm_off.png
- type: Icon
texture: Objects/fire_alarm_off.png
placement:
mode: AlignWall
range: 180
nodes:
- 5
- 10
- 15
snap:
- Wallmount
- type: entity
id: __engine_med_cabinet
name: "[engine] Medical Cabinet"
components:
- type: Transform
- type: Clickable
- type: Sprite
texture: Objects/med_cabinet.png
- type: Icon
texture: Objects/med_cabinet.png
placement:
mode: AlignWall
snap:
- Wallmount

View File

@@ -0,0 +1,22 @@
- type: entity
id: __engine_wall
name: "[engine] Wall"
components:
- type: Transform
- type: Clickable
- type: Sprite
drawdepth: Walls
texture: Tiles/wall_texture.png
- type: Icon
texture: Tiles/wall_texture.png
- type: BoundingBox
- type: Collidable
- type: Occluder
sizeX: 32
sizeY: 32
placement:
snap:
- Wall

View File

@@ -1,33 +0,0 @@
- type: entity
id: Janitor_Suit
name: Janitor Jumpsuit
components:
- type: Transform
- type: Clickable
- type: WearableAnimatedSprite
sprite: player_jumpsuit_gray
notWornSprite: janitorsuit
- type: Icon
icon: janitorsuit
- type: BoundingBox
- type: Physics
mass: 5
- type: entity
id: Shoes
name: Shoes
components:
- type: Transform
- type: Clickable
- type: WearableAnimatedSprite
sprite: player_toolbox
notWornSprite: shoes
- type: Icon
icon: shoes
- type: BoundingBox
- type: Physics
mass: 5

View File

@@ -1,16 +0,0 @@
- type: entity
id: Toolbox
name: Toolbox
components:
- type: Transform
- type: Clickable
- type: WearableAnimatedSprite
sprite: player_toolbox
notWornSprite: toolbox_r
- type: Icon
icon: toolbox_r
- type: BoundingBox
- type: Physics
mass: 5

View File

@@ -1,17 +0,0 @@
- type: entity
id: Door
name: Door
components:
- type: Transform
- type: Clickable
- type: Sprite
drawdepth: FloorPlaceable
sprites:
- door_ew
- door_ewo
- type: Icon
icon: door_ew
- type: BoundingBox
- type: Collidable

View File

@@ -1,22 +0,0 @@
- type: entity
id: WallLight
name: Wall Light
components:
- type: Transform
- type: Clickable
- type: Sprite
sprites:
- wall_light
- type: Icon
icon: wall_light
- type: PointLight
lightoffsetx: 0
lightoffsety: 0
lightradius: 1024
lightColorR: 220
lightColorG: 220
lightColorB: 198
mask: whitemask
startState: On

View File

@@ -1,23 +0,0 @@
- type: entity
id: HumanMob
name: Urist McHuman
components:
- type: Transform
- type: Clickable
- type: AnimatedSprite
sprite: player
- type: Icon
icon: player
- type: BoundingBox
sizeX: 0.9
sizeY: 0.9
- type: ParticleSystem
- type: Physics
mass: 5
- type: Collidable
DebugColor: "#0000FF"

View File

@@ -1,54 +0,0 @@
- type: entity
id: Extinguisher
name: Extinguisher Cabinet
components:
- type: Transform
- type: Clickable
- type: Sprite
sprites:
- fire_extinguisher
placement:
mode: AlignWall
range: 200
modes:
- 18
- 26
- 32
- type: entity
id: FireAlarm
name: Fire Alarm
components:
- type: Transform
- type: Clickable
- type: Sprite
sprites:
- fire_alarm_off
- type: Icon
icon: fire_alarm_off
placement:
mode: AlignWall
range: 180
nodes:
- 5
- 10
- 15
- type: entity
id: MedCabinet
name: Medical Cabinet
components:
- type: Transform
- type: Clickable
- type: Sprite
sprites:
- med_cabinet
- type: Icon
icon: med_cabinet
placement:
mode: AlignWall

View File

@@ -0,0 +1,7 @@
- type: shader
id: selection_outline
kind: source
path: "/Shaders/outline.gdsl"
params:
outline_width: 1
outline_color: "#FF000055"

View File

@@ -0,0 +1,5 @@
# Generic canvas shader without light shading.
- type: shader
id: unshaded
kind: canvas
light_mode: unshaded

View File

@@ -1,6 +0,0 @@
#version 120
void main()
{
gl_FragColor = vec4(0,0,0,1);
}

View File

@@ -1,12 +0,0 @@
#version 120
void main()
{
// transform the vertex position
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
// transform the texture coordinates
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
// forward the vertex color
gl_FrontColor = gl_Color;
}

View File

@@ -1,69 +0,0 @@
#version 120
// Amount to blur.
float blurAmount = 0.0135;
// Our texture sampler.
uniform sampler2D sourceSampler;
// Function to perform the sampling for the blur.
vec4 psBlurSample(vec2 Tex , vec4 baseColor, float offX, float offY)
{
vec4 Color; // Output.
float scaler = 0; // Scale of the sample.
// Calculate sample.
scaler = (1 + (offY * offX));
Tex.x = Tex.x + offX;
Tex.y = Tex.y + offY;
Color = baseColor + texture2D(sourceSampler, Tex / scaler);
return Color;
}
vec4 Blur()
{
vec4 Color = vec4(0); // Output.
float Alpha = 0; // Alpha component.
float blurValue = 0; // Blur value.
blurValue = blurAmount / 1000.0f;
if (blurAmount < 0)
blurValue = 0;
if (blurAmount > 10)
blurValue = 0.01;
Color = texture2D(sourceSampler, gl_TexCoord[0].xy);
// Store the alpha for later, we don't want to blur that.
Alpha = Color.a;
// Sample eight directions + the center.
Color = psBlurSample(gl_TexCoord[0].xy, Color, -blurValue, -blurValue);
Color = psBlurSample(gl_TexCoord[0].xy, Color, 0, -blurValue);
Color = psBlurSample(gl_TexCoord[0].xy, Color, blurValue, -blurValue);
Color = psBlurSample(gl_TexCoord[0].xy, Color, -blurValue, blurValue);
Color = psBlurSample(gl_TexCoord[0].xy, Color, 0, blurValue);
Color = psBlurSample(gl_TexCoord[0].xy, Color, blurValue, blurValue);
Color = psBlurSample(gl_TexCoord[0].xy, Color, -blurValue, 0);
Color = psBlurSample(gl_TexCoord[0].xy, Color, blurValue, 0);
// Calculate final color.
Color.rgb = clamp((Color.rgb / 9) * vec3(.8,.8,.8),0,1);
// Restore and combine the alpha.
Color.a = Alpha * float(1);
return Color;
}
void main()
{
gl_FragColor = Blur();
}

View File

@@ -1,13 +0,0 @@
#version 120
void main()
{
// transform the vertex position
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
// transform the texture coordinates
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
// forward the vertex color
gl_FrontColor = gl_Color;
}

View File

@@ -1,56 +0,0 @@
#version 120
uniform sampler2D backgroundSampler;
uniform sampler2D spriteSampler;
vec2 spriteDimensions;
vec2 backbufferSize;
float cloakAmount = 0;
float refractionIndex = 1;
vec4 simplePS()
{
vec2 scaler = spriteDimensions/backbufferSize;
vec2 backPos = vec2(0,0);
vec4 spriteColor;
vec4 newColor;
spriteColor = texture2D(spriteSampler, gl_TexCoord[0].xy);
if (spriteColor.a > 0)
{
backPos = (gl_TexCoord[0].xy * scaler);
if ((spriteColor.r >= 0) && (spriteColor.r < 0.5))
backPos.x += (spriteColor.r * cloakAmount) * (scaler.x / refractionIndex);
else
backPos.x -= (spriteColor.r * cloakAmount) * (scaler.x / refractionIndex);
if ((spriteColor.g >= 0.0) && (spriteColor.g < 0.5))
backPos.y += (spriteColor.g * cloakAmount) * (scaler.y / refractionIndex);
else
backPos.y -= (spriteColor.g * cloakAmount) * (scaler.y / refractionIndex);
backPos.x += (spriteColor.b * cloakAmount) * (scaler.y / refractionIndex);
backPos.y += (spriteColor.b * cloakAmount) * (scaler.y / refractionIndex);
newColor = texture2D(backgroundSampler, backPos);
newColor = (newColor * (1 - (spriteColor.a - cloakAmount))) + (spriteColor * (spriteColor.a - cloakAmount));
newColor.a = spriteColor.a;
newColor *= vec4(.8,.8,.8,1);
}
return newColor;
}
void main()
{
gl_FragColor = simplePS();
}

View File

@@ -1,12 +0,0 @@
#version 120
void main()
{
// transform the vertex position
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
// transform the texture coordinates
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
// forward the vertex color
gl_FrontColor = gl_Color;
}

View File

@@ -1,25 +0,0 @@
#version 120
uniform sampler2D sceneSampler;
float duration;
vec3 color_offset = vec3(0.2, 0.4, 0.3);
int Iterations = 128;
vec2 Pan = vec2(0.3776610, -0.3435075);
float Zoom = 0.4;
float Aspect = 1;
vec2 JuliaSeed = vec2(-0.439, 0.576);
vec3 ColorScale = vec3(6, 5, 4);
vec4 DeathShaderPS()
{
vec4 c = texture2D(sceneSampler, gl_TexCoord[0].xy);
c.b = c.g = 0;
return c;
}
void main()
{
gl_FragColor = DeathShaderPS();
}

View File

@@ -1,12 +0,0 @@
#version 120
void main()
{
// transform the vertex position
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
// transform the texture coordinates
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
// forward the vertex color
gl_FrontColor = gl_Color;
}

View File

@@ -1,77 +0,0 @@
#version 120
#define RADIUS 11
#define KERNEL_SIZE (RADIUS * 2 + 1)
uniform vec2 weights_offsets[KERNEL_SIZE];
uniform vec2 weights_offsets0;
uniform vec2 weights_offsets1;
uniform vec2 weights_offsets2;
uniform vec2 weights_offsets3;
uniform vec2 weights_offsets4;
uniform vec2 weights_offsets5;
uniform vec2 weights_offsets6;
uniform vec2 weights_offsets7;
uniform vec2 weights_offsets8;
uniform vec2 weights_offsets9;
uniform vec2 weights_offsets10;
uniform vec2 weights_offsets11;
uniform vec2 weights_offsets12;
uniform vec2 weights_offsets13;
uniform vec2 weights_offsets14;
uniform vec2 weights_offsets15;
uniform vec2 weights_offsets16;
uniform vec2 weights_offsets17;
uniform vec2 weights_offsets18;
uniform vec2 weights_offsets19;
uniform vec2 weights_offsets20;
uniform vec2 weights_offsets21;
uniform vec2 weights_offsets22;
uniform sampler2D colorMapTexture;
vec4 GaussianBlurHorizontal()
{
vec4 color = vec4(0,0,0,0);
vec2 weights_offsets[KERNEL_SIZE] = vec2[KERNEL_SIZE]
(
weights_offsets0,
weights_offsets1,
weights_offsets2,
weights_offsets3,
weights_offsets4,
weights_offsets5,
weights_offsets6,
weights_offsets7,
weights_offsets8,
weights_offsets9,
weights_offsets10,
weights_offsets11,
weights_offsets12,
weights_offsets13,
weights_offsets14,
weights_offsets15,
weights_offsets16,
weights_offsets17,
weights_offsets18,
weights_offsets19,
weights_offsets20,
weights_offsets21,
weights_offsets22
);
for (int i = 0; i < KERNEL_SIZE; ++i)
{
color += texture2D(colorMapTexture, vec2(gl_TexCoord[0].x + weights_offsets[i].y, gl_TexCoord[0].y))* weights_offsets[i].x;
}
return color;
}
void main()
{
gl_FragColor = GaussianBlurHorizontal();
}

View File

@@ -1,12 +0,0 @@
#version 120
void main()
{
// transform the vertex position
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
// transform the texture coordinates
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
// forward the vertex color
gl_FrontColor = gl_Color;
}

View File

@@ -1,73 +0,0 @@
#version 120
#define RADIUS 11
#define KERNEL_SIZE (RADIUS * 2 + 1)
uniform vec2 weights_offsets[KERNEL_SIZE];
uniform vec2 weights_offsets0;
uniform vec2 weights_offsets1;
uniform vec2 weights_offsets2;
uniform vec2 weights_offsets3;
uniform vec2 weights_offsets4;
uniform vec2 weights_offsets5;
uniform vec2 weights_offsets6;
uniform vec2 weights_offsets7;
uniform vec2 weights_offsets8;
uniform vec2 weights_offsets9;
uniform vec2 weights_offsets10;
uniform vec2 weights_offsets11;
uniform vec2 weights_offsets12;
uniform vec2 weights_offsets13;
uniform vec2 weights_offsets14;
uniform vec2 weights_offsets15;
uniform vec2 weights_offsets16;
uniform vec2 weights_offsets17;
uniform vec2 weights_offsets18;
uniform vec2 weights_offsets19;
uniform vec2 weights_offsets20;
uniform vec2 weights_offsets21;
uniform vec2 weights_offsets22;
uniform sampler2D colorMapTexture;
vec4 GaussianBlurVertical()
{
vec2 weights_offsets[KERNEL_SIZE] = vec2[KERNEL_SIZE]
(
weights_offsets0,
weights_offsets1,
weights_offsets2,
weights_offsets3,
weights_offsets4,
weights_offsets5,
weights_offsets6,
weights_offsets7,
weights_offsets8,
weights_offsets9,
weights_offsets10,
weights_offsets11,
weights_offsets12,
weights_offsets13,
weights_offsets14,
weights_offsets15,
weights_offsets16,
weights_offsets17,
weights_offsets18,
weights_offsets19,
weights_offsets20,
weights_offsets21,
weights_offsets22
);
vec4 color = vec4(0,0,0,0);
for (int i = 0; i < KERNEL_SIZE; ++i)
{
color += texture2D(colorMapTexture, vec2(gl_TexCoord[0].x, gl_TexCoord[0].y + weights_offsets[i].y)) * weights_offsets[i].x; // M A G I K
}
return color;
}
void main()
{
gl_FragColor = GaussianBlurVertical();
}

View File

@@ -1,12 +0,0 @@
#version 120
void main()
{
// transform the vertex position
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
// transform the texture coordinates
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
// forward the vertex color
gl_FrontColor = gl_Color;
}

View File

@@ -1,40 +0,0 @@
#version 120
#define RADIUS 3
#define KERNEL_SIZE (RADIUS * 2 + 1)
uniform vec2 weights_offsets[KERNEL_SIZE];
uniform vec2 weights_offsets0;
uniform vec2 weights_offsets1;
uniform vec2 weights_offsets2;
uniform vec2 weights_offsets3;
uniform vec2 weights_offsets4;
uniform vec2 weights_offsets5;
uniform vec2 weights_offsets6;
uniform sampler2D colorMapTexture;
vec4 GaussianBlurHorizontal()
{
vec4 color = vec4(0,0,0,0);
vec2 weights_offsets[KERNEL_SIZE] = vec2[KERNEL_SIZE]
(
weights_offsets0,
weights_offsets1,
weights_offsets2,
weights_offsets3,
weights_offsets4,
weights_offsets5,
weights_offsets6
);
for (int i = 0; i < KERNEL_SIZE; ++i)
color += texture2D(colorMapTexture, vec2(gl_TexCoord[0].x + weights_offsets[i].y, gl_TexCoord[0].y)) * weights_offsets[i].x;
return color;
}
void main()
{
gl_FragColor = GaussianBlurHorizontal();
}

View File

@@ -1,12 +0,0 @@
#version 120
void main()
{
// transform the vertex position
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
// transform the texture coordinates
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
// forward the vertex color
gl_FrontColor = gl_Color;
}

View File

@@ -1,40 +0,0 @@
#version 120
#define RADIUS 3
#define KERNEL_SIZE (RADIUS * 2 + 1)
uniform vec2 weights_offsets[KERNEL_SIZE];
uniform vec2 weights_offsets0;
uniform vec2 weights_offsets1;
uniform vec2 weights_offsets2;
uniform vec2 weights_offsets3;
uniform vec2 weights_offsets4;
uniform vec2 weights_offsets5;
uniform vec2 weights_offsets6;
uniform sampler2D colorMapTexture;
vec4 GaussianBlurVertical()
{
vec4 color = vec4(0,0,0,0);
vec2 weights_offsets[KERNEL_SIZE] = vec2[KERNEL_SIZE]
(
weights_offsets0,
weights_offsets1,
weights_offsets2,
weights_offsets3,
weights_offsets4,
weights_offsets5,
weights_offsets6
);
for (int i = 0; i < KERNEL_SIZE; ++i)
color += texture2D(colorMapTexture, vec2(gl_TexCoord[0].x, gl_TexCoord[0].y + weights_offsets[i].y)) * weights_offsets[i].x;
return color;
}
void main()
{
gl_FragColor = GaussianBlurVertical();
}

View File

@@ -1,18 +0,0 @@
#version 120
attribute vec4 a_color;
attribute vec3 a_position;
attribute vec2 a_texCoord0;
varying vec2 TexCoord;
void main()
{
// transform the vertex position
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
// transform the texture coordinates
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
// forward the vertex color
gl_FrontColor = gl_Color;
}

View File

@@ -1,49 +0,0 @@
#version 120
#define RADIUS 5
#define KERNEL_SIZE (RADIUS * 2 + 1)
uniform vec2 weights_offsets[KERNEL_SIZE];
uniform vec2 weights_offsets0;
uniform vec2 weights_offsets1;
uniform vec2 weights_offsets2;
uniform vec2 weights_offsets3;
uniform vec2 weights_offsets4;
uniform vec2 weights_offsets5;
uniform vec2 weights_offsets6;
uniform vec2 weights_offsets7;
uniform vec2 weights_offsets8;
uniform vec2 weights_offsets9;
uniform vec2 weights_offsets10;
uniform sampler2D colorMapTexture;
vec4 GaussianBlurHorizontal()
{
vec4 color = vec4(0,0,0,0);
vec2 weights_offsets[KERNEL_SIZE] = vec2[KERNEL_SIZE]
(
weights_offsets0,
weights_offsets1,
weights_offsets2,
weights_offsets3,
weights_offsets4,
weights_offsets5,
weights_offsets6,
weights_offsets7,
weights_offsets8,
weights_offsets9,
weights_offsets10
);
for (int i = 0; i < KERNEL_SIZE; ++i)
color += texture2D(colorMapTexture, vec2(gl_TexCoord[0].x + weights_offsets[i].y, gl_TexCoord[0].y)) * weights_offsets[i].x;
return color;
}
void main()
{
gl_FragColor = GaussianBlurHorizontal();
}

View File

@@ -1,12 +0,0 @@
#version 120
void main()
{
// transform the vertex position
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
// transform the texture coordinates
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
// forward the vertex color
gl_FrontColor = gl_Color;
}

View File

@@ -1,50 +0,0 @@
#version 120
#define RADIUS 5
#define KERNEL_SIZE (RADIUS * 2 + 1)
uniform vec2 weights_offsets[KERNEL_SIZE];
uniform vec2 weights_offsets0;
uniform vec2 weights_offsets1;
uniform vec2 weights_offsets2;
uniform vec2 weights_offsets3;
uniform vec2 weights_offsets4;
uniform vec2 weights_offsets5;
uniform vec2 weights_offsets6;
uniform vec2 weights_offsets7;
uniform vec2 weights_offsets8;
uniform vec2 weights_offsets9;
uniform vec2 weights_offsets10;
uniform sampler2D colorMapTexture;
vec4 GaussianBlurVertical()
{
vec4 color = vec4(0,0,0,0);
vec2 weights_offsets[KERNEL_SIZE] = vec2[KERNEL_SIZE]
(
weights_offsets0,
weights_offsets1,
weights_offsets2,
weights_offsets3,
weights_offsets4,
weights_offsets5,
weights_offsets6,
weights_offsets7,
weights_offsets8,
weights_offsets9,
weights_offsets10
);
for (int i = 0; i < KERNEL_SIZE; ++i)
color += texture2D(colorMapTexture, vec2(gl_TexCoord[0].x, gl_TexCoord[0].y + weights_offsets[i].y)) * weights_offsets[i].x;
return color;
}
void main()
{
gl_FragColor = GaussianBlurVertical();
}

View File

@@ -1,12 +0,0 @@
#version 120
void main()
{
// transform the vertex position
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
// transform the texture coordinates
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
// forward the vertex color
gl_FrontColor = gl_Color;
}

View File

@@ -1,56 +0,0 @@
#version 120
#define RADIUS 7
#define KERNEL_SIZE (RADIUS * 2 + 1)
uniform vec2 weights_offsets[KERNEL_SIZE];
uniform vec2 weights_offsets0;
uniform vec2 weights_offsets1;
uniform vec2 weights_offsets2;
uniform vec2 weights_offsets3;
uniform vec2 weights_offsets4;
uniform vec2 weights_offsets5;
uniform vec2 weights_offsets6;
uniform vec2 weights_offsets7;
uniform vec2 weights_offsets8;
uniform vec2 weights_offsets9;
uniform vec2 weights_offsets10;
uniform vec2 weights_offsets11;
uniform vec2 weights_offsets12;
uniform vec2 weights_offsets13;
uniform vec2 weights_offsets14;
uniform sampler2D colorMapTexture;
vec4 GaussianBlurHorizontal()
{
vec4 color = vec4(0,0,0,0);
vec2 weights_offsets[KERNEL_SIZE] = vec2[KERNEL_SIZE]
(
weights_offsets0,
weights_offsets1,
weights_offsets2,
weights_offsets3,
weights_offsets4,
weights_offsets5,
weights_offsets6,
weights_offsets7,
weights_offsets8,
weights_offsets9,
weights_offsets10,
weights_offsets11,
weights_offsets12,
weights_offsets13,
weights_offsets14
);
for (int i = 0; i < KERNEL_SIZE; ++i)
color += texture2D(colorMapTexture, vec2(gl_TexCoord[0].x + weights_offsets[i].y, gl_TexCoord[0].y)) * weights_offsets[i].x;
return color;
}
void main()
{
gl_FragColor = GaussianBlurHorizontal();
}

View File

@@ -1,12 +0,0 @@
#version 120
void main()
{
// transform the vertex position
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
// transform the texture coordinates
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
// forward the vertex color
gl_FrontColor = gl_Color;
}

View File

@@ -1,57 +0,0 @@
#version 120
#define RADIUS 7
#define KERNEL_SIZE (RADIUS * 2 + 1)
uniform vec2 weights_offsets[KERNEL_SIZE];
uniform vec2 weights_offsets0;
uniform vec2 weights_offsets1;
uniform vec2 weights_offsets2;
uniform vec2 weights_offsets3;
uniform vec2 weights_offsets4;
uniform vec2 weights_offsets5;
uniform vec2 weights_offsets6;
uniform vec2 weights_offsets7;
uniform vec2 weights_offsets8;
uniform vec2 weights_offsets9;
uniform vec2 weights_offsets10;
uniform vec2 weights_offsets11;
uniform vec2 weights_offsets12;
uniform vec2 weights_offsets13;
uniform vec2 weights_offsets14;
uniform sampler2D colorMapTexture;
vec4 GaussianBlurVertical()
{
vec4 color = vec4(0,0,0,0);
vec2 weights_offsets[KERNEL_SIZE] = vec2[KERNEL_SIZE]
(
weights_offsets0,
weights_offsets1,
weights_offsets2,
weights_offsets3,
weights_offsets4,
weights_offsets5,
weights_offsets6,
weights_offsets7,
weights_offsets8,
weights_offsets9,
weights_offsets10,
weights_offsets11,
weights_offsets12,
weights_offsets13,
weights_offsets14
);
for (int i = 0; i < KERNEL_SIZE; ++i)
color += texture2D(colorMapTexture, vec2(gl_TexCoord[0].x, gl_TexCoord[0].y + weights_offsets[i].y)) * weights_offsets[i].x;
return color;
}
void main()
{
gl_FragColor = GaussianBlurVertical();
}

View File

@@ -1,12 +0,0 @@
#version 120
void main()
{
// transform the vertex position
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
// transform the texture coordinates
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
// forward the vertex color
gl_FrontColor = gl_Color;
}

View File

@@ -1,65 +0,0 @@
#version 120
#define RADIUS 9
#define KERNEL_SIZE (RADIUS * 2 + 1)
uniform vec2 weights_offsets[KERNEL_SIZE];
uniform vec2 weights_offsets0;
uniform vec2 weights_offsets1;
uniform vec2 weights_offsets2;
uniform vec2 weights_offsets3;
uniform vec2 weights_offsets4;
uniform vec2 weights_offsets5;
uniform vec2 weights_offsets6;
uniform vec2 weights_offsets7;
uniform vec2 weights_offsets8;
uniform vec2 weights_offsets9;
uniform vec2 weights_offsets10;
uniform vec2 weights_offsets11;
uniform vec2 weights_offsets12;
uniform vec2 weights_offsets13;
uniform vec2 weights_offsets14;
uniform vec2 weights_offsets15;
uniform vec2 weights_offsets16;
uniform vec2 weights_offsets17;
uniform vec2 weights_offsets18;
uniform sampler2D colorMapTexture;
vec4 GaussianBlurHorizontal()
{
vec4 color = vec4(0,0,0,0);
vec2 weights_offsets[KERNEL_SIZE] = vec2[KERNEL_SIZE]
(
weights_offsets0,
weights_offsets1,
weights_offsets2,
weights_offsets3,
weights_offsets4,
weights_offsets5,
weights_offsets6,
weights_offsets7,
weights_offsets8,
weights_offsets9,
weights_offsets10,
weights_offsets11,
weights_offsets12,
weights_offsets13,
weights_offsets14,
weights_offsets15,
weights_offsets16,
weights_offsets17,
weights_offsets18
);
for (int i = 0; i < KERNEL_SIZE; ++i)
color += texture2D(colorMapTexture, vec2(gl_TexCoord[0].x + weights_offsets[i].y, gl_TexCoord[0].y)) * weights_offsets[i].x;
return color;
}
void main()
{
gl_FragColor = GaussianBlurHorizontal();
}

View File

@@ -1,14 +0,0 @@
#version 120
void main()
{
// transform the vertex position
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
// transform the texture coordinates
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
// forward the vertex color
gl_FrontColor = gl_Color;
}

View File

@@ -1,66 +0,0 @@
#version 120
#define RADIUS 9
#define KERNEL_SIZE (RADIUS * 2 + 1)
uniform vec2 weights_offsets[KERNEL_SIZE];
uniform vec2 weights_offsets0;
uniform vec2 weights_offsets1;
uniform vec2 weights_offsets2;
uniform vec2 weights_offsets3;
uniform vec2 weights_offsets4;
uniform vec2 weights_offsets5;
uniform vec2 weights_offsets6;
uniform vec2 weights_offsets7;
uniform vec2 weights_offsets8;
uniform vec2 weights_offsets9;
uniform vec2 weights_offsets10;
uniform vec2 weights_offsets11;
uniform vec2 weights_offsets12;
uniform vec2 weights_offsets13;
uniform vec2 weights_offsets14;
uniform vec2 weights_offsets15;
uniform vec2 weights_offsets16;
uniform vec2 weights_offsets17;
uniform vec2 weights_offsets18;
uniform sampler2D colorMapTexture;
vec4 GaussianBlurVertical()
{
vec4 color = vec4(0,0,0,0);
vec2 weights_offsets[KERNEL_SIZE] = vec2[KERNEL_SIZE]
(
weights_offsets0,
weights_offsets1,
weights_offsets2,
weights_offsets3,
weights_offsets4,
weights_offsets5,
weights_offsets6,
weights_offsets7,
weights_offsets8,
weights_offsets9,
weights_offsets10,
weights_offsets11,
weights_offsets12,
weights_offsets13,
weights_offsets14,
weights_offsets15,
weights_offsets16,
weights_offsets17,
weights_offsets18
);
for (int i = 0; i < KERNEL_SIZE; ++i)
color += texture2D(colorMapTexture, vec2(gl_TexCoord[0].x, gl_TexCoord[0].y + weights_offsets[i].y)) * weights_offsets[i].x;
return color;
}
void main()
{
gl_FragColor = GaussianBlurVertical();
}

View File

@@ -1,12 +0,0 @@
#version 120
void main()
{
// transform the vertex position
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
// transform the texture coordinates
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
// forward the vertex color
gl_FrontColor = gl_Color;
}

View File

@@ -1,8 +0,0 @@
#version 120
uniform sampler2D TextureUnit0;
void main()
{
gl_FragColor = texture2D(TextureUnit0,gl_TexCoord[0].xy);
}

View File

@@ -1,12 +0,0 @@
#version 120
void main()
{
// transform the vertex position
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
// transform the texture coordinates
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
// forward the vertex color
gl_FrontColor = gl_Color;
}

View File

@@ -1,85 +0,0 @@
#version 120
#define NUM_LIGHTS 6
uniform vec4 LightPosData0;
uniform vec4 LightPosData1;
uniform vec4 LightPosData2;
uniform vec4 LightPosData3;
uniform vec4 LightPosData4;
uniform vec4 LightPosData5;
uniform vec4 LightPosData[NUM_LIGHTS];
uniform vec4 Colors[NUM_LIGHTS];
uniform vec4 Colors0;
uniform vec4 Colors1;
uniform vec4 Colors2;
uniform vec4 Colors3;
uniform vec4 Colors4;
uniform vec4 Colors5;
uniform sampler2D light0;
uniform sampler2D light1;
uniform sampler2D light2;
uniform sampler2D light3;
uniform sampler2D light4;
uniform sampler2D light5;
uniform sampler2D sceneTexture;
vec4 PreLightBlendPS()
{
vec4 Colors[NUM_LIGHTS] = vec4[NUM_LIGHTS]
(
Colors0,
Colors1,
Colors2,
Colors3,
Colors4,
Colors5
);
vec4 LightPosData[NUM_LIGHTS] = vec4[NUM_LIGHTS]
(
LightPosData0,
LightPosData1,
LightPosData2,
LightPosData3,
LightPosData4,
LightPosData5
);
vec4 l[NUM_LIGHTS];
vec2 ltc[NUM_LIGHTS];
for(int i = 0;i<NUM_LIGHTS;i++)
{
ltc[i] = vec2((gl_TexCoord[0].x - LightPosData[i].x) * LightPosData[i].z, (gl_TexCoord[0].y - LightPosData[i].y) * LightPosData[i].w);
}
l[0] = texture2D(light0, ltc[0]);
l[1] = texture2D(light1, ltc[1]);
l[2] = texture2D(light2, ltc[2]);
l[3] = texture2D(light3, ltc[3]);
l[4] = texture2D(light4, ltc[4]);
l[5] = texture2D(light5, ltc[5]);
l[0].rgb = l[0].rgb * Colors[0].rgb;
l[1].rgb = l[1].rgb * Colors[1].rgb;
l[2].rgb = l[2].rgb * Colors[2].rgb;
l[3].rgb = l[3].rgb * Colors[3].rgb;
l[4].rgb = l[4].rgb * Colors[4].rgb;
l[5].rgb = l[5].rgb * Colors[5].rgb;
vec4 s = texture2D(sceneTexture, gl_TexCoord[0].xy); // sample existing lights
//Add the lights together
float r = sqrt(pow(l[0].r, 2) + pow(l[1].r, 2) + pow(l[2].r, 2) + pow(l[3].r, 2) + pow(l[4].r, 2) + pow(l[5].r, 2) + pow(s.r, 2));
float g = sqrt(pow(l[0].g, 2) + pow(l[1].g, 2) + pow(l[2].g, 2) + pow(l[3].g, 2) + pow(l[4].g, 2) + pow(l[5].g, 2) + pow(s.g, 2));
float b = sqrt(pow(l[0].b, 2) + pow(l[1].b, 2) + pow(l[2].b, 2) + pow(l[3].b, 2) + pow(l[4].b, 2) + pow(l[5].b, 2) + pow(s.b, 2));
vec4 c = vec4(r,g,b, 1);
return c;
//Return the light color
return vec4(c.rgb,min(1, 1/max(c.r, max(c.g,c.b))));
}
void main()
{
gl_FragColor = PreLightBlendPS();
}

View File

@@ -1,12 +0,0 @@
#version 120
void main()
{
// transform the vertex position
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
// transform the texture coordinates
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
// forward the vertex color
gl_FrontColor = gl_Color;
}

View File

@@ -1,9 +0,0 @@
#version 120
uniform sampler2D TextureUnit0;
void main()
{
gl_FragColor = texture2D(TextureUnit0,gl_TexCoord[0].xy) + vec4(.5,0,0,0);
}

View File

@@ -1,12 +0,0 @@
#version 120
void main()
{
// transform the vertex position
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
// transform the texture coordinates
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
// forward the vertex color
gl_FrontColor = gl_Color;
}

View File

@@ -1,20 +0,0 @@
#version 120
uniform sampler2D playerViewSampler;
uniform sampler2D sceneSampler;
uniform sampler2D lightSampler;
vec4 DrawTilesInversePlayerViewPS(vec2 TexCoord)
{
vec4 pv = texture2D(playerViewSampler, TexCoord);
float v = 1 - min(length(pv.rgb),1);
vec4 s = texture2D(sceneSampler, TexCoord);
vec4 t = texture2D(lightSampler, TexCoord);
return vec4(t.rgb + s.rgb, v);
}
void main()
{
gl_FragColor = DrawTilesInversePlayerViewPS(gl_TexCoord[0].xy);
}

View File

@@ -1,12 +0,0 @@
#version 120
void main()
{
// transform the vertex position
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
// transform the texture coordinates
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
// forward the vertex color
gl_FrontColor = gl_Color;
}

View File

@@ -1,57 +0,0 @@
#version 120
uniform sampler2D LightTexture;
uniform sampler2D SceneTexture;
uniform sampler2D PlayerViewTexture;
uniform sampler2D OutOfViewTexture;
uniform vec4 AmbientLight;
uniform vec4 MaskProps;
vec4 LightBlendPS(vec2 TexCoord)
{
vec4 a = AmbientLight;
vec4 l = texture2D(LightTexture, TexCoord); //Sample light/shadows
l = max(l,a); // Set a minimum level of light
vec4 c = texture2D(SceneTexture, TexCoord); //Sample scene color
vec4 pv = texture2D(PlayerViewTexture, TexCoord); // Sample player view
vec2 masktc = TexCoord;
masktc.x = masktc.x * MaskProps.x * MaskProps.z;
masktc.y = masktc.y * MaskProps.y * MaskProps.w;
vec4 t = texture2D(OutOfViewTexture, masktc); // Sample mask
//Generate scuzz for occluded areas
/*float4 t;
float2 lines;
lines.x = 1 * (TexCoord.x * MaskProps.x + MaskProps.z);
lines.y = 1 * (TexCoord.y * MaskProps.y + MaskProps.w);
float s = (sin(lines.x + lines.y + lines.y) + sin(lines.x - lines.y));
t.rgb = 0;
if(s > 0.5)
{
t.rgb = 0.1;
}*/
t.a = 1;
//End generate scuzz
vec3 h; // calculate hard light
h.r = l.r <= 0.5 ? 2 * l.r * c.r : 1 - (2 * (1 - l.r) * (1 - c.r) );
h.g = l.g <= 0.5 ? 2 * l.g * c.g : 1 - (2 * (1 - l.g) * (1 - c.g) );
h.b = l.b <= 0.5 ? 2 * l.b * c.b : 1 - (2 * (1 - l.b) * (1 - c.b) );
vec4 result;
result = vec4(max(c.rgb*l.rgb, h.rgb), pv.r)* 1;
result = result + (t *( 1 - pv.r));
return result;
}
void main()
{
gl_FragColor = LightBlendPS(gl_TexCoord[0].xy);
}

View File

@@ -1,12 +0,0 @@
#version 120
void main()
{
// transform the vertex position
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
// transform the texture coordinates
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
// forward the vertex color
gl_FrontColor = gl_Color;
}

View File

@@ -1,40 +0,0 @@
#version 120
uniform sampler2D maskSampler;
uniform sampler2D lightSampler;
uniform vec4 MaskProps;
uniform vec4 DiffuseColor;
vec4 MaskLightPS(vec2 TexCoord)
{
vec4 p = MaskProps;
vec2 tc = TexCoord;
vec4 d = DiffuseColor;
float t;
if(p.x > 0) // x is rot 90 degrees
{ // We just flip the axes.
t = tc.x;
tc.x = tc.y;
tc.y = t;
}
if(p.y > 0) // y is flip horizontally
{
tc.x = 1 - tc.x;
}
if(p.z > 0) // z is flip vertically
{
tc.y = 1 - tc.y;
}
vec4 l = texture2D(lightSampler, TexCoord);
l = vec4(l.r * d.r, l.g * d.g, l.b * d.b, l.a);
vec4 m = texture2D(maskSampler, tc);
return vec4(l.rgb, m.r)* l.a;
}
void main()
{
gl_FragColor = MaskLightPS(gl_TexCoord[0].xy);
}

View File

@@ -1,12 +0,0 @@
#version 120
void main()
{
// transform the vertex position
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
// transform the texture coordinates
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
// forward the vertex color
gl_FrontColor = gl_Color;
}

View File

@@ -0,0 +1,59 @@
shader_type canvas_item;
uniform float outline_width = 2.0;
uniform vec4 outline_color: hint_color;
void fragment() {
// I, for some reason, cannot put this comment in the top of the file.
// Taken from the godot-demo-projects repo.
// GODOT ENGINE
// http://www.godotengine.org
//
// ************************************************************************
//
// Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur.
//
// 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.
//
//************************************************************************
vec4 col = texture(TEXTURE, UV);
vec2 ps = TEXTURE_PIXEL_SIZE;
float a;
float maxa = col.a;
float mina = col.a;
a = texture(TEXTURE, UV + vec2(0, -outline_width)*ps).a;
maxa = max(a, maxa);
mina = min(a, mina);
a = texture(TEXTURE, UV + vec2(0, outline_width)*ps).a;
maxa = max(a, maxa);
mina = min(a, mina);
a = texture(TEXTURE, UV + vec2(-outline_width,0)*ps).a;
maxa = max(a, maxa);
mina = min(a, mina);
a = texture(TEXTURE, UV + vec2(outline_width, 0)*ps).a;
maxa = max(a, maxa);
mina = min(a, mina);
COLOR = mix(col, outline_color, maxa-mina);
}

View File

@@ -1,14 +0,0 @@
#version 120
uniform sampler2D inputSampler;
vec4 CopyPS()
{
return texture2D(inputSampler, gl_TexCoord[0].xy);
}
void main()
{
gl_FragColor = CopyPS();
}

View File

@@ -1,12 +0,0 @@
#version 120
void main()
{
// transform the vertex position
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
// transform the texture coordinates
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
// forward the vertex color
gl_FrontColor = gl_Color;
}

View File

@@ -1,26 +0,0 @@
#version 120
uniform sampler2D texture;
uniform float TextureDimensions;
vec4 HorizontalReductionPS()
{
vec2 color = texture2D(texture, gl_TexCoord[0].xy).rg;
vec2 colorR;
// This modulus bullshit is because every texel in the source image is evaluated in GLSL
// If we don't check whether the texel is odd or even, we would end up
// incorrectly taking the max of the pixel to the right versus this one,
// making our horizontal reduction invalid.
if (mod(gl_TexCoord[0].x / TextureDimensions, 2) == 0)
colorR = texture2D(texture, gl_TexCoord[0].xy + vec2(TextureDimensions,0)).rg;
else
colorR = texture2D(texture, gl_TexCoord[0].xy - vec2(TextureDimensions,0)).rg;
vec2 result = min(color, colorR);
return vec4(result,0,1);
}
void main()
{
gl_FragColor = HorizontalReductionPS();
}

View File

@@ -1,12 +0,0 @@
#version 120
void main()
{
// transform the vertex position
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
// transform the texture coordinates
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
// forward the vertex color
gl_FrontColor = gl_Color;
}

View File

@@ -1,54 +0,0 @@
#version 120
uniform vec2 renderTargetSize;
uniform sampler2D inputSampler;
const float minBlur = 1.0;
const float maxBlur = 20.0;
const int g_cKernelSize = 13;
const vec2 weights_offsets0 = vec2( -6, 0.002216 );
const vec2 weights_offsets1 = vec2( -5, 0.008764 );
const vec2 weights_offsets2 = vec2( -4, 0.026995 );
const vec2 weights_offsets3 = vec2( -3, 0.064759 );
const vec2 weights_offsets4 = vec2( -2, 0.120985 );
const vec2 weights_offsets5 = vec2( -1, 0.176033 );
const vec2 weights_offsets6 = vec2( 0, 0.199471 );
const vec2 weights_offsets7 = vec2( 1, 0.176033 );
const vec2 weights_offsets8 = vec2( 2, 0.120985 );
const vec2 weights_offsets9 = vec2( 3, 0.064759 );
const vec2 weights_offsets10 = vec2( 4, 0.026995 );
const vec2 weights_offsets11 = vec2( 5, 0.008764 );
const vec2 weights_offsets12 = vec2( 6, 0.002216 );
uniform vec2 OffsetAndWeight[g_cKernelSize] = vec2[g_cKernelSize]
(
weights_offsets0,
weights_offsets1,
weights_offsets2,
weights_offsets3,
weights_offsets4,
weights_offsets5,
weights_offsets6,
weights_offsets7,
weights_offsets8,
weights_offsets9,
weights_offsets10,
weights_offsets11,
weights_offsets12
);
vec4 BlurHorizontallyPS()
{
float sum=0.;
float Distance = texture2D( inputSampler, gl_TexCoord[0].xy).b;
for (int i = 0; i < g_cKernelSize; i++)
{
sum += texture2D( inputSampler, gl_TexCoord[0].xy + OffsetAndWeight[i].x * mix(minBlur, maxBlur , Distance)/renderTargetSize.x * vec2(1,0) ).r * OffsetAndWeight[i].y;
}
return vec4(sum, sum, Distance, 1);
}
void main()
{
gl_FragColor = BlurHorizontallyPS();
}

View File

@@ -1,12 +0,0 @@
#version 120
void main()
{
// transform the vertex position
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
// transform the texture coordinates
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
// forward the vertex color
gl_FrontColor = gl_Color;
}

View File

@@ -1,57 +0,0 @@
#version 120
uniform vec2 renderTargetSize;
uniform sampler2D inputSampler;
const float minBlur = 1.0;
const float maxBlur = 20.0;
const int g_cKernelSize = 13;
const vec2 weights_offsets0 = vec2( -6, 0.002216 );
const vec2 weights_offsets1 = vec2( -5, 0.008764 );
const vec2 weights_offsets2 = vec2( -4, 0.026995 );
const vec2 weights_offsets3 = vec2( -3, 0.064759 );
const vec2 weights_offsets4 = vec2( -2, 0.120985 );
const vec2 weights_offsets5 = vec2( -1, 0.176033 );
const vec2 weights_offsets6 = vec2( 0, 0.199471 );
const vec2 weights_offsets7 = vec2( 1, 0.176033 );
const vec2 weights_offsets8 = vec2( 2, 0.120985 );
const vec2 weights_offsets9 = vec2( 3, 0.064759 );
const vec2 weights_offsets10 = vec2( 4, 0.026995 );
const vec2 weights_offsets11 = vec2( 5, 0.008764 );
const vec2 weights_offsets12 = vec2( 6, 0.002216 );
uniform vec2 OffsetAndWeight[g_cKernelSize] = vec2[g_cKernelSize]
(
weights_offsets0,
weights_offsets1,
weights_offsets2,
weights_offsets3,
weights_offsets4,
weights_offsets5,
weights_offsets6,
weights_offsets7,
weights_offsets8,
weights_offsets9,
weights_offsets10,
weights_offsets11,
weights_offsets12
);
vec4 BlurVerticallyPS()
{
float sum=0;
float Distance = texture2D( inputSampler, gl_TexCoord[0].xy).b;
for (int i = 0; i < g_cKernelSize; i++)
{
sum += texture2D( inputSampler, gl_TexCoord[0].xy + OffsetAndWeight[i].x * mix(minBlur, maxBlur , Distance)/renderTargetSize.x * vec2(0,1) ).r * OffsetAndWeight[i].y;
}
float d = 2 * length(gl_TexCoord[0].xy - 0.5f);
float attenuation = pow(clamp(1.0f - d,0,1),1.0f);
return vec4(vec3(sum * attenuation), 1);
}
void main()
{
gl_FragColor = BlurVerticallyPS();
}

View File

@@ -1,12 +0,0 @@
#version 120
void main()
{
// transform the vertex position
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
// transform the texture coordinates
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
// forward the vertex color
gl_FrontColor = gl_Color;
}

View File

@@ -1,23 +0,0 @@
#version 120
uniform sampler2D sourceSampler;
uniform vec2 renderTargetSize;
vec4 ComputeDistancesPS()
{
vec4 color = texture2D(sourceSampler,gl_TexCoord[0].xy);
float Distance;
if (color.a > .3)
Distance = length(gl_TexCoord[0].xy - .5);
else
Distance = 1.0;
return vec4 (Distance, Distance,Distance,1);
}
void main()
{
gl_FragColor = ComputeDistancesPS();
}

View File

@@ -1,12 +0,0 @@
#version 120
void main()
{
// transform the vertex position
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
// transform the texture coordinates
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
// forward the vertex color
gl_FrontColor = gl_Color;
}

View File

@@ -1,29 +0,0 @@
#version 120
uniform sampler2D inputSampler;
vec4 DistortPS()
{
//translate u and v into [-1 , 1] domain
float u0 = gl_TexCoord[0].x * 2 - 1;
float v0 = gl_TexCoord[0].y * 2 - 1;
//then, as u0 approaches 0 (the center), v should also approach 0
v0 = v0 * abs(u0);
//convert back from [-1,1] domain to [0,1] domain
v0 = (v0 + 1) / 2;
//we now have the coordinates for reading from the initial image
vec2 newCoords = vec2(gl_TexCoord[0].x, v0);
//read for both horizontal and vertical direction and store them in separate channels
float horizontal = texture2D(inputSampler, newCoords).r;
float vertical = texture2D(inputSampler, newCoords.yx).r;
return vec4(horizontal,vertical ,0,1);
}
void main()
{
gl_FragColor = DistortPS();
}

View File

@@ -1,12 +0,0 @@
#version 120
void main()
{
// transform the vertex position
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
// transform the texture coordinates
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
// forward the vertex color
gl_FrontColor = gl_Color;
}

View File

@@ -1,113 +0,0 @@
#version 120
uniform vec4 MaskProps;
uniform vec4 DiffuseColor;
uniform vec2 renderTargetSize;
uniform float AttenuateShadows;
uniform sampler2D inputSampler;
uniform sampler2D shadowMapSampler;
varying vec2 TexCoord;
float GetShadowDistanceH(vec2 TexCoord,float displacementV)
{
float u = TexCoord.x;
float v = TexCoord.y;
u = abs(u-0.5) * 2;
v = v * 2 - 1;
float v0 = v/u;
v0+=displacementV;
v0 = (v0 + 1) / 2;
vec2 newCoords = vec2(TexCoord.x,v0);
//horizontal info was stored in the Red component
return texture2D(shadowMapSampler, newCoords).r;
}
float GetShadowDistanceV(vec2 TexCoord, float displacementV)
{
float u = TexCoord.y;
float v = TexCoord.x;
u = abs(u-0.5) * 2;
v = v * 2 - 1;
float v0 = v/u;
v0+=displacementV;
v0 = (v0 + 1) / 2;
vec2 newCoords = vec2(TexCoord.y,v0);
//vertical info was stored in the Green component
return texture2D(shadowMapSampler, newCoords).g;
}
vec4 MaskLight(vec4 inColor, vec2 TexCoord)
{
vec4 p = MaskProps;
vec2 tc = TexCoord;
vec4 d = DiffuseColor;
float t;
if(p.x > 0) // x is rot 90 degrees
{ // We just flip the axes.
t = tc.x;
tc.x = tc.y;
tc.y = t;
}
if(p.y > 0) // y is flip horizontally
{
tc.x = 1 - tc.x;
}
if(p.z > 0) // z is flip vertically
{
tc.y = 1 - tc.y;
}
vec4 l = inColor;
l = vec4(l.r * d.r, l.g * d.g, l.b * d.b, l.a);
vec4 m = texture2D(inputSampler, tc);
return vec4((l.rgb * m.r), l.a);
}
vec4 DrawShadowsPS()
{
// distance of this pixel from the center
float Distance = length(gl_TexCoord[0].xy - 0.5);
//Distance *= renderTargetSize.x;
//apply a 2-pixel bias
//Distance -=2;
//distance stored in the shadow map
float shadowMapDistance;
//coords in [-1,1]
float nY = 2.0*( gl_TexCoord[0].y - 0.5);
float nX = 2.0*( gl_TexCoord[0].x - 0.5);
//we use these to determine which quadrant we are in
if(abs(nY)<abs(nX))
{
shadowMapDistance = GetShadowDistanceH(gl_TexCoord[0].xy,0);
}
else
{
shadowMapDistance = GetShadowDistanceV(gl_TexCoord[0].xy,0);
}
//if distance to this pixel is lower than distance from shadowMap,
//then we are not in shadow
float light = Distance <= shadowMapDistance ? 1:0;
float d = 2 * length(gl_TexCoord[0].xy - 0.5);
float attenuation = max(pow(clamp(1 - d, 0,1),1), AttenuateShadows); //If AttenuateShadows is true, attenuation
vec4 result = vec4(1 - (light * attenuation) / 2);
result = MaskLight(result, gl_TexCoord[0].xy);
return result;
}
void main()
{
gl_FragColor = DrawShadowsPS();
}

View File

@@ -1,12 +0,0 @@
#version 120
void main()
{
// transform the vertex position
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
// transform the texture coordinates
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
// forward the vertex color
gl_FrontColor = gl_Color;
}

View File

@@ -1,21 +0,0 @@
#!/usr/bin/env python3
# Used for debugging BuildResourcePack.py without needing to be on Windows.
# Writes a single dummy png to the output dir.
# Doesn't work on Windows due to lack of shebangs. RIP.
# Well at least not directly from buildResourcePack.py
# NOTE: Requires Pillow
from PIL import Image
import os
print("*** Running dummy sprite renderer! ***")
image = Image.new("RGB", (32, 32), "#FF0000")
if not os.path.exists("output"):
os.mkdir("output")
image.save(os.path.join("output", "test.png"))
with open(os.path.join("output", "test.xml"), "w"):
# Create empty file.
pass

View File

@@ -1 +0,0 @@
Pillow==4.1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Some files were not shown because too many files have changed in this diff Show More