Compare commits

...

268 Commits
0.0.3 ... 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
Pieter-Jan Briers
f0d6680977 Fix accidental integer division. (#349)
AnimatedSpriteComponent.AABB used integer division, fixed now.
2017-08-19 10:23:19 +02:00
Pieter-Jan Briers
49f7b987f5 Refactor entity initialization and fix doc comments. (#346)
Entities now initialize in a few stages. First all their components are added, then entity.PreInitialize() is called, then all components are initialized, then entity.Initialize() is called.

This multi-level initialization system should hopefully be more powerful and make things like prefetching components easier.

Also what the crap WAS the old init system even?
2017-08-19 10:19:22 +02:00
clusterfack
444d0847b6 Fixing the current placement system (#347)
* WIP: Fixing the current placement system

* Placement system sprites come back pls

* HE TURNED THE FREAKING SPRITES GAY

* TECHNICALLY THIS MAKES THE SPRITES NOT GAY

* Mostly Shows sprites correctly

* Finished this bulllllshit

* Rename some things
2017-08-19 08:59:57 +02:00
clusterfack
005bd9e95c Containers (#339)
* #Part 1

Created basic container dictionary and framework for transform parenting

##Work Left until completion

1. Registering containers through a container manager
2. Registering onmove events onto the parents event handler on insertion
3. Removing onmove events from the parent event handler on removal
4. An event called upon insertion and removal from storage objects
5. Redirecting transform getters to use the uppermost parents transform

* Part 2

Creates some basic code for removing entities generally from other entities
Creates code for creating containers
Adds some basic logic for parents overriding transform getters
Adds logic to prevent circular references
Makes Container an abstract class for things to create their own versions from

* Moves container classes to shared so they can be registered on server and client
Registers container classes on server and client
Makes ContainerManager get created properly by the component factory

* Adds missing } and finalizes csproj changes

* Add exception for double containers on one component

* Makes sure parents are attached and detached at the correct time

* Address some issues, cause others perhaps

* Rename Files
Changes Container Class Inheritance
Vague stuff

* Move Icontainer and Icontainermanagercomponent to ss14 server
Make servertransform interface for parents to be serverside only
Deregister containermanager from the client IOC

* Remove Icontainer And Icontainermanager from shared csproj

* Fix

* To get git to recognize this I have to delete them

* And then readd the files, fuck you git

* Be specific you daft cunt
2017-08-18 11:18:42 -06:00
Pieter-Jan Briers
dfcf0349ca Fix F2 on Unix, collision bug and join crash. (#348)
* Make F2 not crash on Unix, fix join crash.

* Fix collision when moving to the bottom or right.

The bug was caused by 1d5ca223de. Collision adds to the AABB's Left and Top properties to do offsets, but when moving to OpenTK, this stopped working, as Right and Bottom now had to be offset too. I missed this, and as such, your hitbox is smaller when moving to the bottom or right. This allows you to clip into walls, but when you're in you can't move the other direction, as your hitbox is also *larger* when moving to the top or left.
2017-08-18 13:07:51 +02:00
Matt Smith
45a7a809db Reduce code complexity (#345) 2017-08-18 10:54:35 +02:00
Acruid
48852c5ee8 Grid Placement Fix (#344)
* Physics works again.

* forgot some SFML stuff.

* Cluwnelib does not depend on 1.0m = 1 tile anymore.

* Fixed bug with tile placement in wrong spot.
Fixed blue box issue.
2017-08-17 15:42:44 -06:00
Acruid
60ac4a9e26 Collision Fix (#340)
* Physics works again.

* forgot some SFML stuff.
2017-08-17 23:20:12 +02:00
h3half
5351f581f1 Removes commented-out code (#343)
Removes most of the commented-out code from sonarqube. There's
definitely more hiding throughout the codebase, but this should be most
of it.
2017-08-17 11:58:37 +02:00
Pieter-Jan Briers
e719dd1440 Make the lighting toggle properly disable all lighting rendering. (#342) 2017-08-16 12:38:55 -06:00
Pieter-Jan Briers
1d5ca223de Replace SFML math types with OpenTK and custom ones. (#341)
* Attempt to messily convert the codebase to use OpenTK math.

* Vector2f is gone. It compiles!

* Fix unit tests.

* Goodbye FloatRect

* Goodbye IntRect, say hello to Box2i.
2017-08-16 11:22:48 -06:00
Silver
3170552b3d Rename LICENSE.TXT to LICENSE-CODE.TXT 2017-08-15 14:44:40 -06:00
dylanstrategie
18692e21a4 Fix issues with Menu Window (#336)
* Fix issues with Menu Window

* Requested changes
2017-08-15 14:17:57 -06:00
Acruid
ae0ccc72b4 Map Manager Refactor (#338)
* Merged Client and Server Map interfaces into a Shared version.
Merged Client and Server MapManager system into a shared version.

* Added some encapsulation to the map system.
Added doc comments to client and server classes.
It compiles, but it DOES NOT WORK.

* Now with 89% more encapsulation.
Added a MapGrid object to the MapManager.

STILL A BUGGY MESS!

* Rendering bugs were fixed.

* Fixed alignment bug with GetTilesIntersecting.

* Cleanup the interfaces a bit.

* Code update.

* Merged client/server MapNetworkManager into shared version.

* Nightly work. Compiles, does not run.

* Shared networking looks like it works.

* Cleanup and remove SFML.
2017-08-14 17:30:57 -06:00
Pieter-Jan Briers
f5eb8cd55b MSBuild MacOS handling. (#337)
* Makes MSBuild distinguish Linux and MacOS.

* Fix TargetOS

* Copy mac natives during build.

* Fix travis

* Fix typo.
2017-08-14 18:54:46 +02:00
Pieter-Jan Briers
db1c71994b Give content access to OpenTK Math and Color types. (#335) 2017-08-14 18:23:46 +02:00
Silver
96df096303 Revert "Gives content access to OpenTK math and color types. (#332)" (#334)
This reverts commit 9669221d37.
2017-08-13 21:34:56 +02:00
Pieter-Jan Briers
9669221d37 Gives content access to OpenTK math and color types. (#332) 2017-08-13 13:33:32 -06:00
Pieter-Jan Briers
480ed6d74c Fixing some compile warnings. (#331)
All the obsoletions from netmessages will be for another PR.
2017-08-13 11:30:23 -06:00
Dan
1d2614d75f Refactor align modes (#330)
* Refactor align modes

* Remove some unnessecary lines
2017-08-13 14:30:55 +02:00
Pieter-Jan Briers
1c5f540751 Remove component instantiation messages. (#324) 2017-08-13 00:46:00 +02:00
Pieter-Jan Briers
f4fe79346e Inverse entity queries. (#322)
* Inverse entity queries.

They now effectively behave like Func<IEntity, bool>.
The actual matching logic is now done on entity queries.

They've also been abstracted, as such there are now multiple entity
query types to pick from.

Also generic clean up.

* Fix doc comment on the exclude list.

* Use Predicate<> instead of Func<>

* Fix compile, Predictae<> doesn't work
2017-08-13 00:31:58 +02:00
Acruid
cb5bfbb3da Component Rework (#325)
* Cleans up base Component.

* Clean up PhysicsComponent.
Merge VelocityComponent with PhysicsComponent.

* Renamed HitBoxComponent to BoundingBoxComponent.
Cleaned up BoundingBoxComponent.
Added Box2 to the serializer and SfmlCompatibility.

* Serverside movement works.

* Removed DirectionComponent.
Everything is broke, time to sleep.

* Removed BasicMoverComponent and SlaveMoverComponent.
Added Parenting skeleton to TransformComponent.

* Move ClickAbleComponent to Input.
Fixed lights.

* More general cleanup.

* Move Physics system into Shared.

* Removed ColliderComponent.

* Fixed AnimatedSprite Rotation.

* Added Vector2i as a type.

* Fixes StackOverflow bug by just not using SFML.Vector2f.

* Should fix Build issues.

* Removed pointless server console resizing.
Fixed Unit tests working in VS.
Updated PrototypeManager_Test.cs tests.

* Adds SS14.Shared/Maths/VecMath.cs helper functions.

* Switched to Angle type.
2017-08-13 00:10:06 +02:00
Pieter-Jan Briers
f41050583e Bit of unit test stuff. (#326)
* Unit test for #294

* Remove empty warning tests.
2017-08-13 00:09:42 +02:00
clusterfack
85fa167e17 Fixes Exceptions on Rejoining (#327)
* Fix server crash on rejoin

* Makes it possible to rejoin without exception

* Proper fix by culling ALL the component lists when the entity manager shuts down
2017-08-12 10:25:33 +02:00
Pieter-Jan Briers
b9723b6504 Content repo can now define console commands. (#321) 2017-08-11 15:44:47 -06:00
Pieter-Jan Briers
2e64de57c6 Makes the main menu pretty. (#320)
>duct tape logo

INSTAMERGE
2017-08-11 14:37:31 -06:00
Pieter-Jan Briers
feaf4160e8 Load unatlassed images from disk as sprites (#319)
This'll allow content to add sprites.
2017-08-11 08:23:23 +02:00
Pieter-Jan Briers
93fd0014b4 Fix content entry invocations, whitelist types. (#317) 2017-08-09 21:50:45 -06:00
Pieter-Jan Briers
22f07e3649 Adds OS targeting to the build setup (#316)
* Adds OS targeting to the build setup

Will make cross platform builds (Linux -> Windows) easier.

* Rename Windows_NT to Windows and explicitly do Linux.
2017-08-10 00:04:31 +02:00
clusterfack
398a3917dc Returns runclient and runserver 2017-08-09 08:26:08 -05:00
Pieter-Jan Briers
04fa16902f Fix SFML memory leak. (#315) 2017-08-09 07:39:19 +02:00
Jordan Brown
b0e42ef650 Removes support for resource pack passwords (#314) 2017-08-08 21:36:53 +02:00
Pieter-Jan Briers
b0d7ee16c1 Deprecate resource pack temporarily. (#312)
* Deprecate resource pack temporarily.

Temporarily being until we actually need content downloading from server.
Resources now get copied to the output directories directly.

* Move prototypes around.
2017-08-08 14:48:15 +02:00
Pieter-Jan Briers
b9ece2888b Repo cleanup (#310)
* Reduce build size by removing redundant files.

22 MB of the build output was OpenTK.xml, the doc file for it.
This commit removes a lot of files like PDB files from the build output
on Release, cutting build size down to 13 MB.

Also deleted a ton of dead third party files in Third-Party, and the two
spare copies of CSFML...

* Remove more dead files.

* Even more!

* Generic repo cleanup. Removing dead files all over.

What the hell was filesystemeditor.exe supposed to be?
2017-08-08 12:47:31 +02:00
Pieter-Jan Briers
d1b29a6f94 Update NetSerializer, move to NuGet with it. (#311)
NetSerializer has been updated and moved to the latest version. This
means that the static nonsense it previously had is fixed and we can
properly use ISS14Serializer.
2017-08-08 12:47:18 +02:00
clusterfack
a43da12f9b Fixes a rare out of bounds exception (#313)
* Fixes a rare crash

Fixes a crash that occurs from the following
>return AngleDirections[(int)Math.Floor(angle/45f)];

System.IndexOutOfRangeException: 'Index was outside the bounds of the array.'

That occurs most likely due to a float rounding error

* Apparently this works fine
2017-08-08 11:51:38 +02:00
Pieter-Jan Briers
4607a106d0 Of course it works a lot different on the client. 2017-08-06 14:47:20 +02:00
Pieter-Jan Briers
de9fd0cbaf Fix resource pack on client, regression in #306 2017-08-06 12:56:12 +02:00
Acruid
2e3315cd39 CompState Cleanup (#308)
* Changed GameObjects.Component namespace back to GameObjects.Components namespace to prevent colliding with GameObjects.Component class.

* Changed IComponent.HandleComponentState to use polymorphism instead of dynamic keyword.
Cleaned up nesting in each implementation of IComponent.HandleComponentState.

* Moved all shared ComponentStates to the SS14.Shared.GameObjects namespace to be more in line with client & server components.
Made all ComponentStates immutable, as they should be.
2017-08-06 12:16:47 +02:00
Acruid
f7b1b9c4b6 Client Timing (#309)
* Appease lord Sonar.

* Client timing *should* work.
2017-08-05 17:15:33 -06:00
Pieter-Jan Briers
2572bc94c7 Increase default logging verbosity to DEBUG. (#307) 2017-08-05 23:32:57 +02:00
Pieter-Jan Briers
47f1aa6565 Unhardcode content pack locations. (#306)
* Unhardcode content pack locations.

The previous hardcoded path was causing problems for the content repo.
Now the content packs are loaded from the executable directory.
The build system copies the pack from the Resources/ folder now.

* Fix CI
2017-08-05 23:32:44 +02:00
Pieter-Jan Briers
fdde14b93e Makes client and server load shared assembly too. (#304)
Also fixes #303
2017-08-05 23:32:28 +02:00
Pieter-Jan Briers
975eea832d Clean up build targets and output dirs. (#302)
* Clean up build targets and output dirs.

All old Any CPU targets and mixed ones have been removed. They wouldn't have worked anyways due to SFML.

Cleaned up all the build output directories to be neat and clean.

* Fix Travis
2017-08-04 07:11:28 -06:00
1006 changed files with 48324 additions and 53515 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 -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" }
- cmd: py -3.5 Resources\buildResourcePack.py --resources-dir .\Resources --out .\Resources\ResourcePack.zip --atlas-tool .\Tools\AtlasTool.exe --no-animations --to-stderr
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

@@ -1,4 +0,0 @@
{
"phabricator.uri": "http://phab.nexisonline.net",
"project.name": "Space Station 14"
}

View File

@@ -7,5 +7,8 @@ indent_size = 4
trim_trailing_whitespace = true
charset = utf-8-bom
[*.{csproj,xml,yml,dll.config}]
[*.{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

15
.gitignore vendored
View File

@@ -75,4 +75,17 @@ project.lock.json
# Created by NUnit.
TestResult.xml
NetSerializerDebug.dll
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:
- "python3 ./Resources/buildResourcePack.py --resources-dir ./Resources --out ./Resources/ResourcePack.zip --no-atlas --no-animations --to-stderr"
- "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:
- "msbuild /p:Configuration=Release /p:HEADLESS=1 SpaceStation14.sln"
- "cd packages/NUnit.ConsoleRunner.3.6.1/tools"
- "mono --debug nunit3-console.exe ../../../SS14.UnitTesting/bin/Release/SS14.UnitTesting.dll"
- "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 +0,0 @@
call "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86
@echo on
call prebuild-2010.cmd
call msbuild SpaceStation14.sln /t:Build /p:Configuration=Release;Platform=x86

View File

@@ -1,10 +0,0 @@
#!/bin/bash
prebuild-nant.sh
nant
#nunit-console Bin/SS14.Test.dll -nodots -xml=NUnit.Results.xml
echo NUnit disabled.
#7za a SS14.7z Bin/*
echo Packaging disabled.

View File

@@ -1,2 +0,0 @@
cd bin\client
start SpaceStation14.exe

View File

@@ -1,2 +0,0 @@
cd bin\server
start SpaceStation14_Server.exe

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>..\bin\</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>..\bin\</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

@@ -1,4 +1,4 @@
using System;
using System;
using System.Text;
using System.Collections;
using System.Diagnostics;
@@ -70,7 +70,6 @@ namespace Lidgren.Network
if (i == mag.Length)
{
// sign = 0;
m_magnitude = ZeroMagnitude;
}
else
@@ -241,17 +240,6 @@ namespace Lidgren.Network
}
}
// Note: This is the previous (slower) algorithm
// while (index < value.Length)
// {
// char c = value[index];
// string s = c.ToString();
// int i = Int32.Parse(s, style);
//
// b = b.Multiply(r).Add(ValueOf(i));
// index++;
// }
m_magnitude = b.m_magnitude;
}
@@ -390,7 +378,6 @@ namespace Lidgren.Network
if (sign == 0)
{
//sign = 0;
m_magnitude = ZeroMagnitude;
}
else
@@ -727,7 +714,6 @@ namespace Lidgren.Network
int cBitLength = yBitLength;
if (shift > 0)
{
// iCount = ShiftLeft(One.magnitude, shift);
iCount = new int[(shift >> 5) + 1];
iCount[0] = 1 << (shift % 32);
@@ -758,8 +744,7 @@ namespace Lidgren.Network
if (++xStart == x.Length)
return count;
}
//xBitLength = calcBitLength(xStart, x);
xBitLength = 32 * (x.Length - xStart - 1) + BitLen(x[xStart]);
if (xBitLength <= yBitLength)
@@ -797,8 +782,7 @@ namespace Lidgren.Network
cBitLength -= shift;
iCount = ShiftRightInPlace(iCountStart, iCount, shift);
}
//cStart = c.Length - ((cBitLength + 31) / 32);
while (c[cStart] == 0)
{
++cStart;
@@ -1000,7 +984,6 @@ namespace Lidgren.Network
if (x.m_sign < 0)
{
x.m_sign = 1;
//x = m.Subtract(x);
x.m_magnitude = doSubBigLil(m.m_magnitude, x.m_magnitude);
}
@@ -1105,7 +1088,6 @@ namespace Lidgren.Network
{
if (m_magnitude.Length <= m.m_magnitude.Length)
{
//zAccum = new int[m.magnitude.Length * 2];
zVal = new int[m.m_magnitude.Length];
m_magnitude.CopyTo(zVal, zVal.Length - m_magnitude.Length);
}
@@ -1115,8 +1097,7 @@ namespace Lidgren.Network
// in normal practice we'll never see ..
//
NetBigInteger tmp = Remainder(m);
//zAccum = new int[m.magnitude.Length * 2];
zVal = new int[m.m_magnitude.Length];
tmp.m_magnitude.CopyTo(zVal, zVal.Length - tmp.m_magnitude.Length);
}
@@ -1225,10 +1206,6 @@ namespace Lidgren.Network
int[] w,
int[] x)
{
// Note: this method allows w to be only (2 * x.Length - 1) words if result will fit
// if (w.Length != 2 * x.Length)
// throw new ArgumentException("no I don't think so...");
ulong u1, u2, c;
int wBase = w.Length - 1;
@@ -1649,8 +1626,7 @@ namespace Lidgren.Network
if (++xStart == x.Length)
return x;
}
//xBitLength = calcBitLength(xStart, x);
xBitLength = 32 * (x.Length - xStart - 1) + BitLen(x[xStart]);
if (xBitLength <= yBitLength)
@@ -1686,8 +1662,7 @@ namespace Lidgren.Network
c = ShiftRightInPlace(cStart, c, shift);
cBitLength -= shift;
}
//cStart = c.Length - ((cBitLength + 31) / 32);
while (c[cStart] == 0)
{
++cStart;
@@ -1919,12 +1894,6 @@ namespace Lidgren.Network
if (n >= BitLength)
return (m_sign < 0 ? One.Negate() : Zero);
// int[] res = (int[]) magnitude.Clone();
//
// res = ShiftRightInPlace(0, res, n);
//
// return new BigInteger(sign, res, true);
int resultLength = (BitLength - n + 31) >> 5;
int[] res = new int[resultLength];
@@ -1980,8 +1949,7 @@ namespace Lidgren.Network
{
m = (x[--iT] & IMASK) - (y[--iV] & IMASK) + borrow;
x[iT] = (int)m;
// borrow = (m < 0) ? -1 : 0;
borrow = (int)(m >> 63);
}
while (iV > yStart);

View File

@@ -1,4 +1,4 @@
//#define UNSAFE
//#define UNSAFE
//#define BIGENDIAN
/* Copyright (c) 2010 Michael Lidgren
@@ -39,7 +39,7 @@ namespace Lidgren.Network
NetException.Assert(((numberOfBits > 0) && (numberOfBits < 9)), "Read() can only read between 1 and 8 bits");
int bytePtr = readBitOffset >> 3;
int startReadAtIndex = readBitOffset - (bytePtr * 8); // (readBitOffset % 8);
int startReadAtIndex = readBitOffset - (bytePtr * 8);
if (startReadAtIndex == 0 && numberOfBits == 8)
return fromBuffer[bytePtr];
@@ -70,7 +70,7 @@ namespace Lidgren.Network
public static void ReadBytes(byte[] fromBuffer, int numberOfBytes, int readBitOffset, byte[] destination, int destinationByteOffset)
{
int readPtr = readBitOffset >> 3;
int startReadAtIndex = readBitOffset - (readPtr * 8); // (readBitOffset % 8);
int startReadAtIndex = readBitOffset - (readPtr * 8);
if (startReadAtIndex == 0)
{

View File

@@ -1,4 +1,4 @@
/* Copyright (c) 2010 Michael Lidgren
/* Copyright (c) 2010 Michael Lidgren
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
@@ -181,7 +181,6 @@ namespace Lidgren.Network
public UInt32 PeekUInt32(int numberOfBits)
{
NetException.Assert((numberOfBits > 0 && numberOfBits <= 32), "ReadUInt() can only read between 1 and 32 bits");
//NetException.Assert(m_bitLength - m_readBitPtr >= numberOfBits, "tried to read past buffer size");
UInt32 retval = NetBitWriter.ReadUInt32(m_data, numberOfBits, m_readPosition);
return retval;

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
@@ -255,7 +255,6 @@ namespace Lidgren.Network
public UInt32 ReadUInt32(int numberOfBits)
{
NetException.Assert(numberOfBits > 0 && numberOfBits <= 32, "ReadUInt32(bits) can only read between 1 and 32 bits");
//NetException.Assert(m_bitLength - m_readBitPtr >= numberOfBits, "tried to read past buffer size");
UInt32 retval = NetBitWriter.ReadUInt32(m_data, numberOfBits, m_readPosition);
m_readPosition += numberOfBits;
@@ -470,9 +469,6 @@ namespace Lidgren.Network
int num2 = 0;
while (true)
{
//if (num2 == 0x23)
// throw new FormatException("Bad 7-bit encoded integer");
byte num3 = this.ReadByte();
num1 |= ((UInt64)num3 & 0x7f) << num2;
num2 += 7;

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Text;
@@ -94,8 +94,6 @@ namespace Lidgren.Network
{
m_peer.VerifyNetworkThread();
//m_peer.LogDebug("Executing disconnect");
// clear send queues
for (int i = 0; i < m_sendChannels.Length; i++)
{

View File

@@ -1,4 +1,4 @@
using System;
using System;
namespace Lidgren.Network
{
@@ -131,8 +131,6 @@ namespace Lidgren.Network
rchan.m_resendDelay = resendDelay;
}
// m_peer.LogVerbose("Timeout deadline pushed to " + m_timeoutDeadline);
// notify the application that average rtt changed
if (m_peer.m_configuration.IsMessageTypeEnabled(NetIncomingMessageType.ConnectionLatencyUpdated))
{

View File

@@ -1,4 +1,4 @@
using System;
using System;
namespace Lidgren.Network
{
@@ -74,13 +74,11 @@ namespace Lidgren.Network
{
// we've never encountered failure; expand by 25% each time
tryMTU = (int)((float)m_currentMTU * 1.25f);
//m_peer.LogDebug("Trying MTU " + tryMTU);
}
else
{
// we HAVE encountered failure; so try in between
tryMTU = (int)(((float)m_smallestFailedMTU + (float)m_largestSuccessfulMTU) / 2.0f);
//m_peer.LogDebug("Trying MTU " + m_smallestFailedMTU + " <-> " + m_largestSuccessfulMTU + " = " + tryMTU);
}
if (tryMTU > c_protocolMaxMTU)
@@ -88,7 +86,6 @@ namespace Lidgren.Network
if (tryMTU == m_largestSuccessfulMTU)
{
//m_peer.LogDebug("Found optimal MTU - exiting");
FinalizeMTU(m_largestSuccessfulMTU);
return;
}
@@ -107,8 +104,6 @@ namespace Lidgren.Network
bool ok = m_peer.SendMTUPacket(len, m_remoteEndPoint);
if (ok == false)
{
//m_peer.LogDebug("Send MTU failed for size " + size);
// failure
if (m_smallestFailedMTU == -1 || size < m_smallestFailedMTU)
{
@@ -149,9 +144,7 @@ namespace Lidgren.Network
int len = om.Encode(m_peer.m_sendBuffer, 0, 0);
bool connectionReset;
m_peer.SendPacket(len, m_remoteEndPoint, 1, out connectionReset);
// m_peer.LogDebug("Received MTU expand request for " + size + " bytes");
m_statistics.PacketSent(len, 1);
}
@@ -162,11 +155,9 @@ namespace Lidgren.Network
if (size < m_currentMTU)
{
//m_peer.LogDebug("Received low MTU expand success (size " + size + "); current mtu is " + m_currentMTU);
return;
}
//m_peer.LogDebug("Expanding MTU to " + size);
m_currentMTU = size;
ExpandMTU(now, true);

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Net;
using System.Threading;
using System.Diagnostics;
@@ -204,8 +204,6 @@ namespace Lidgren.Network
NetTuple<NetMessageType, int> tuple;
m_queuedOutgoingAcks.TryDequeue(out tuple);
//m_peer.LogVerbose("Sending ack for " + tuple.Item1 + "#" + tuple.Item2);
sendBuffer[m_sendBufferWritePtr++] = (byte)tuple.Item1;
sendBuffer[m_sendBufferWritePtr++] = (byte)tuple.Item2;
sendBuffer[m_sendBufferWritePtr++] = (byte)(tuple.Item2 >> 8);
@@ -228,7 +226,6 @@ namespace Lidgren.Network
NetTuple<NetMessageType, int> incAck;
while (m_queuedIncomingAcks.TryDequeue(out incAck))
{
//m_peer.LogVerbose("Received ack for " + acktp + "#" + seqNr);
NetSenderChannelBase chan = m_sendChannels[(int)incAck.Item1 - 1];
if (chan == null)
chan = CreateSenderChannel(incAck.Item1);

View File

@@ -1,4 +1,4 @@
/* Copyright (c) 2010 Michael Lidgren
/* Copyright (c) 2010 Michael Lidgren
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
@@ -91,8 +91,6 @@ namespace Lidgren.Network
/// </summary>
public int ResentMessages { get { return m_resentMessagesDueToHole + m_resentMessagesDueToDelay; } }
// public double LastSendRespondedTo { get { return m_connection.m_lastSendRespondedTo; } }
#if USE_RELEASE_STATISTICS
internal void PacketSent(int numBytes, int numMessages)
{
@@ -156,7 +154,6 @@ namespace Lidgren.Network
public override string ToString()
{
StringBuilder bdr = new StringBuilder();
//bdr.AppendLine("Average roundtrip time: " + NetTime.ToReadable(m_connection.m_averageRoundtripTime));
bdr.AppendLine("Sent " + m_sentBytes + " bytes in " + m_sentMessages + " messages in " + m_sentPackets + " packets");
bdr.AppendLine("Received " + m_receivedBytes + " bytes in " + m_receivedMessages + " messages in " + m_receivedPackets + " packets");

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Threading;
using System.Collections.Generic;
@@ -131,7 +131,6 @@ namespace Lidgren.Network
Buffer.BlockCopy(im.m_data, ptr, info.Data, offset, im.LengthBytes - ptr);
int cnt = info.ReceivedChunks.Count();
//LogVerbose("Found fragment #" + chunkNumber + " in group " + group + " offset " + offset + " of total bits " + totalBits + " (total chunks done " + cnt + ")");
LogVerbose("Received fragment " + chunkNumber + " of " + totalNumChunks + " (" + cnt + " chunks received)");

View File

@@ -1,4 +1,4 @@
#if !__ANDROID__ && !IOS
#if !__ANDROID__ && !IOS
#define IS_MAC_AVAILABLE
#endif
@@ -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
@@ -370,9 +381,6 @@ namespace Lidgren.Network
if (!m_socket.Poll(1000, SelectMode.SelectRead)) // wait up to 1 ms for data to arrive
return;
//if (m_socket == null || m_socket.Available < 1)
// return;
do
{
int bytesReceived = 0;
@@ -398,8 +406,6 @@ namespace Lidgren.Network
if (bytesReceived < NetConstants.HeaderByteSize)
return;
//LogVerbose("Received " + bytesReceived + " bytes");
IPEndPoint ipsender = (IPEndPoint)m_senderRemote;
if (ipsender.Port == 1900)
@@ -648,7 +654,6 @@ namespace Lidgren.Network
internal void AcceptConnection(NetConnection conn)
{
// LogDebug("Accepted connection " + conn);
conn.InitExpandMTU(NetTime.Now);
if (m_handshakes.Remove(conn.m_remoteEndPoint) == false)

View File

@@ -1,4 +1,4 @@
/* Copyright (c) 2010 Michael Lidgren
/* Copyright (c) 2010 Michael Lidgren
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
@@ -63,7 +63,6 @@ namespace Lidgren.Network
if (m == 0.0f && r == 0.0f)
{
// no latency simulation
// LogVerbose("Sending packet " + numBytes + " bytes");
bool wasSent = ActuallySendPacket(m_sendBuffer, numBytes, target, out connectionReset);
// TODO: handle wasSent == false?
return;
@@ -87,8 +86,6 @@ namespace Lidgren.Network
m_delayedPackets.Add(p);
}
// LogVerbose("Sending packet " + numBytes + " bytes - delayed " + NetTime.ToReadable(delay));
}
private void SendDelayedPackets()
@@ -142,8 +139,6 @@ namespace Lidgren.Network
int bytesSent = m_socket.SendTo(data, 0, numBytes, SocketFlags.None, target);
if (numBytes != bytesSent)
LogWarning("Failed to send the full " + numBytes + "; only " + bytesSent + " bytes sent in packet!");
// LogDebug("Sent " + numBytes + " bytes");
}
catch (SocketException sx)
{

View File

@@ -1,4 +1,4 @@
using System;
using System;
namespace Lidgren.Network
{
@@ -80,8 +80,6 @@ namespace Lidgren.Network
// mix some semi-random properties
int seed = (int)Environment.TickCount;
seed ^= forObject.GetHashCode();
//seed ^= (int)(Stopwatch.GetTimestamp());
//seed ^= (int)(Environment.WorkingSet); // will return 0 on mono
int extraSeed = System.Threading.Interlocked.Increment(ref s_extraSeed);
@@ -265,44 +263,6 @@ namespace Lidgren.Network
this.x = x; this.y = y; this.z = z; this.w = w;
}
// /// <summary>
// /// A version of NextBytes that uses a pointer to set 4 bytes of the byte buffer in one operation
// /// thus providing a nice speedup. The loop is also partially unrolled to allow out-of-order-execution,
// /// this results in about a x2 speedup on an AMD Athlon. Thus performance may vary wildly on different CPUs
// /// depending on the number of execution units available.
// ///
// /// Another significant speedup is obtained by setting the 4 bytes by indexing pDWord (e.g. pDWord[i++]=w)
// /// instead of adjusting it dereferencing it (e.g. *pDWord++=w).
// ///
// /// Note that this routine requires the unsafe compilation flag to be specified and so is commented out by default.
// /// </summary>
// /// <param name="buffer"></param>
// public unsafe void NextBytesUnsafe(byte[] buffer)
// {
// if(buffer.Length % 8 != 0)
// throw new ArgumentException("Buffer length must be divisible by 8", "buffer");
//
// uint x=this.x, y=this.y, z=this.z, w=this.w;
//
// fixed(byte* pByte0 = buffer)
// {
// uint* pDWord = (uint*)pByte0;
// for(int i=0, len=buffer.Length>>2; i < len; i+=2)
// {
// uint t=(x^(x<<11));
// x=y; y=z; z=w;
// pDWord[i] = w = (w^(w>>19))^(t^(t>>8));
//
// t=(x^(x<<11));
// x=y; y=z; z=w;
// pDWord[i+1] = w = (w^(w>>19))^(t^(t>>8));
// }
// }
//
// this.x=x; this.y=y; this.z=z; this.w=w;
// }
#endregion
#region Public Methods [Methods not present on System.Random]

View File

@@ -1,4 +1,4 @@
using System;
using System;
namespace Lidgren.Network
{
@@ -32,13 +32,6 @@ namespace Lidgren.Network
if (relate == 0)
{
// Log("Received message #" + message.SequenceNumber + " right on time");
//
// excellent, right on time
//
//m_peer.LogVerbose("Received RIGHT-ON-TIME " + message);
AdvanceWindow();
m_peer.ReleaseMessage(message);

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Threading;
namespace Lidgren.Network
@@ -85,8 +85,7 @@ namespace Lidgren.Network
startSlot = m_windowSize - 1;
seqNr--;
}
//m_connection.m_peer.LogVerbose("Resending due to delay #" + seqNr + " " + om.ToString());
m_connection.m_statistics.MessageResent(MessageResendReason.Delay);
m_connection.QueueSendMessage(om, seqNr);
@@ -156,15 +155,10 @@ namespace Lidgren.Network
int relate = NetUtility.RelativeSequenceNumber(seqNr, m_windowStart);
if (relate < 0)
{
//m_connection.m_peer.LogDebug("Received late/dupe ack for #" + seqNr);
return; // late/duplicate ack
}
if (relate == 0)
{
//m_connection.m_peer.LogDebug("Received right-on-time ack for #" + seqNr);
// ack arrived right on time
NetException.Assert(seqNr == m_windowStart);
@@ -175,13 +169,11 @@ namespace Lidgren.Network
// advance window if we already have early acks
while (m_receivedAcks.Get(m_windowStart))
{
//m_connection.m_peer.LogDebug("Using early ack for #" + m_windowStart + "...");
m_receivedAcks[m_windowStart] = false;
DestoreMessage(m_windowStart % m_windowSize);
NetException.Assert(m_storedMessages[m_windowStart % m_windowSize].Message == null); // should already be destored
m_windowStart = (m_windowStart + 1) % NetConstants.NumSequenceNumbers;
//m_connection.m_peer.LogDebug("Advancing window to #" + m_windowStart);
}
return;
@@ -194,8 +186,6 @@ namespace Lidgren.Network
// ... or the ack for that message was lost
//
//m_connection.m_peer.LogDebug("Received early ack for #" + seqNr);
int sendRelate = NetUtility.RelativeSequenceNumber(seqNr, m_sendStart);
if (sendRelate <= 0)
{
@@ -223,12 +213,8 @@ namespace Lidgren.Network
rnr--;
if (rnr < 0)
rnr = NetConstants.NumSequenceNumbers - 1;
if (m_receivedAcks[rnr])
{
// m_connection.m_peer.LogDebug("Not resending #" + rnr + " (since we got ack)");
}
else
if (!m_receivedAcks[rnr])
{
int slot = rnr % m_windowSize;
NetException.Assert(m_storedMessages[slot].Message != null);
@@ -236,7 +222,6 @@ namespace Lidgren.Network
{
// just sent once; resend immediately since we found gap in ack sequence
NetOutgoingMessage rmsg = m_storedMessages[slot].Message;
//m_connection.m_peer.LogVerbose("Resending #" + rnr + " (" + rmsg + ")");
if (now - m_storedMessages[slot].LastSent < (m_resendDelay * 0.35f))
{

View File

@@ -1,4 +1,4 @@
using System;
using System;
namespace Lidgren.Network
{
@@ -29,12 +29,6 @@ namespace Lidgren.Network
if (relate == 0)
{
// Log("Received message #" + message.SequenceNumber + " right on time");
//
// excellent, right on time
//
AdvanceWindow();
m_peer.ReleaseMessage(message);
return;

View File

@@ -1,4 +1,4 @@
using System;
using System;
namespace Lidgren.Network
{
@@ -30,13 +30,6 @@ namespace Lidgren.Network
if (relate == 0)
{
// Log("Received message #" + message.SequenceNumber + " right on time");
//
// excellent, right on time
//
//m_peer.LogVerbose("Received RIGHT-ON-TIME " + message);
AdvanceWindow();
m_peer.ReleaseMessage(message);
@@ -45,16 +38,6 @@ namespace Lidgren.Network
while (m_earlyReceived[nextSeqNr % m_windowSize])
{
//message = m_withheldMessages[nextSeqNr % m_windowSize];
//NetException.Assert(message != null);
// remove it from withheld messages
//m_withheldMessages[nextSeqNr % m_windowSize] = null;
//m_peer.LogVerbose("Releasing withheld message #" + message);
//m_peer.ReleaseMessage(message);
AdvanceWindow();
nextSeqNr++;
}
@@ -78,8 +61,6 @@ namespace Lidgren.Network
}
m_earlyReceived.Set(message.m_sequenceNumber % m_windowSize, true);
//m_peer.LogVerbose("Received " + message + " WITHHOLDING, waiting for " + m_windowStart);
//m_withheldMessages[message.m_sequenceNumber % m_windowSize] = message;
m_peer.ReleaseMessage(message);
}

View File

@@ -1,4 +1,4 @@
#define USE_SHA256
#define USE_SHA256
using System;
using System.Security.Cryptography;
@@ -75,8 +75,7 @@ namespace Lidgren.Network
byte[] total = new byte[innerHash.Length + salt.Length];
Buffer.BlockCopy(salt, 0, total, 0, salt.Length);
Buffer.BlockCopy(innerHash, 0, total, salt.Length, innerHash.Length);
// x ie. H(salt || H(username || ":" || password))
return new NetBigInteger(NetUtility.ToHexString(sha.ComputeHash(total)), 16).ToByteArrayUnsigned();
}
@@ -139,7 +138,7 @@ namespace Lidgren.Network
string one = NetUtility.ToHexString(clientPublicEphemeral);
string two = NetUtility.ToHexString(serverPublicEphemeral);
int len = 66; // Math.Max(one.Length, two.Length);
int len = 66;
string ccstr = one.PadLeft(len, '0') + two.PadLeft(len, '0');
byte[] cc = NetUtility.ToByteArray(ccstr);

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using System.Xml;
using System.Net;
@@ -40,9 +40,6 @@ namespace Lidgren.Network
peer.Socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, true);
peer.RawSend(arr, 0, arr.Length, new IPEndPoint(IPAddress.Broadcast, 1900));
peer.Socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, false);
// allow some extra time for router to respond
// System.Threading.Thread.Sleep(50);
}
internal void ExtractServiceUrl(string resp)

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Threading;
namespace Lidgren.Network
@@ -94,15 +94,10 @@ namespace Lidgren.Network
int relate = NetUtility.RelativeSequenceNumber(seqNr, m_windowStart);
if (relate < 0)
{
//m_connection.m_peer.LogDebug("Received late/dupe ack for #" + seqNr);
return; // late/duplicate ack
}
if (relate == 0)
{
//m_connection.m_peer.LogDebug("Received right-on-time ack for #" + seqNr);
// ack arrived right on time
NetException.Assert(seqNr == m_windowStart);

View File

@@ -1,4 +1,4 @@
/* Copyright (c) 2010 Michael Lidgren
/* Copyright (c) 2010 Michael Lidgren
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
@@ -107,7 +107,6 @@ namespace Lidgren.Network
{
if (ex.SocketErrorCode == SocketError.HostNotFound)
{
//LogWrite(string.Format(CultureInfo.InvariantCulture, "Failed to resolve host '{0}'.", ipOrHost));
callback(null);
return;
}
@@ -140,7 +139,6 @@ namespace Lidgren.Network
{
if (ex.SocketErrorCode == SocketError.HostNotFound)
{
//LogWrite(string.Format(CultureInfo.InvariantCulture, "Failed to resolve host '{0}'.", ipOrHost));
callback(null);
}
else
@@ -189,7 +187,6 @@ namespace Lidgren.Network
{
if (ex.SocketErrorCode == SocketError.HostNotFound)
{
//LogWrite(string.Format(CultureInfo.InvariantCulture, "Failed to resolve host '{0}'.", ipOrHost));
return null;
}
else
@@ -266,7 +263,7 @@ namespace Lidgren.Network
}
return new string(c);
}
/// <summary>
/// Gets the local broadcast address
/// </summary>
@@ -278,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++)
@@ -292,7 +289,7 @@ namespace Lidgren.Network
{
return IPAddress.Broadcast;
}
#endif
#endif
#if IS_FULL_NET_AVAILABLE
try
{
@@ -301,7 +298,7 @@ namespace Lidgren.Network
{
return null;
}
IPInterfaceProperties properties = ni.GetIPProperties();
foreach (UnicastIPAddressInformation unicastAddress in properties.UnicastAddresses)
{
@@ -310,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;
}
@@ -343,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)
@@ -486,12 +483,6 @@ namespace Lidgren.Network
internal static int RelativeSequenceNumber(int nr, int expected)
{
return (nr - expected + NetConstants.NumSequenceNumbers + (NetConstants.NumSequenceNumbers / 2)) % NetConstants.NumSequenceNumbers - (NetConstants.NumSequenceNumbers / 2);
// old impl:
//int retval = ((nr + NetConstants.NumSequenceNumbers) - expected) % NetConstants.NumSequenceNumbers;
//if (retval > (NetConstants.NumSequenceNumbers / 2))
// retval -= NetConstants.NumSequenceNumbers;
//return retval;
}
/// <summary>
@@ -586,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

@@ -0,0 +1,9 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
<Target Name="CopyResourcesFromShared">
<ItemGroup>
<_ResourceFiles Include="$(SolutionDir)bin\Shared\Resources\**\*.*" />
</ItemGroup>
<RemoveDir Directories="$(OutputPath)Resources" />
<Copy SourceFiles="@(_ResourceFiles)" DestinationFolder="$(OutputPath)Resources\%(RecursiveDir)" />
</Target>
</Project>

View File

@@ -0,0 +1,29 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
<!-- MSBuild hurts and I can't find a foolproof way to detect platform. -->
<PropertyGroup>
<OS Condition="'$(OS)' == ''">Windows_NT</OS>
</PropertyGroup>
<Choose>
<When Condition="'$(OS)' != 'Unix'">
<PropertyGroup>
<ActualOS>Windows</ActualOS>
</PropertyGroup>
</When>
<!-- Folders that *probably* only exist on MacOS and not Linux. -->
<When Condition="Exists('/Volumes') And Exists('/System') And Exists('/Library')" >
<PropertyGroup>
<ActualOS>MacOS</ActualOS>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<ActualOS>Linux</ActualOS>
</PropertyGroup>
</Otherwise>
</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>

View File

@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<DirectedGraph GraphDirection="LeftToRight" Layout="Sugiyama" xmlns="http://schemas.microsoft.com/vs/2009/dgml">
<Nodes>
<Node Id="Client" Category="Project" Label="Client" />
</Nodes>
<Links />
<Categories>
<Category Id="Project" />
</Categories>
<Properties>
<Property Id="GraphDirection" DataType="Microsoft.VisualStudio.Progression.Layout.GraphDirection" />
<Property Id="Label" Label="Label" Description="Displayable label of an Annotatable object" DataType="System.String" />
<Property Id="Layout" DataType="System.String" />
</Properties>
<Styles>
<Style TargetType="Node" GroupLabel="Project" ValueLabel="True">
<Condition Expression="HasCategory('Project')" />
<Setter Property="Background" Value="Blue" />
</Style>
</Styles>
</DirectedGraph>

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

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

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

@@ -0,0 +1,18 @@
- type: entity
id: __engine_worktop
name: "[engine] worktop"
components:
- type: Transform
- type: Clickable
- type: Sprite
texture: Objects/worktop_single.png
- type: Icon
texture: Objects/worktop_single.png
- type: BoundingBox
aabb: "-0.45,-1,0.95,1"
DebugColor: "#0000FF"
- type: Collidable

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

@@ -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;
}

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