Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

August - December motherlode #265

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open

Conversation

cppctamber
Copy link
Contributor

@cppctamber cppctamber commented Aug 12, 2018

build

  • Updated webpack package version
  • Updated all babel package versions
  • Updated gl-matrix package version
  • Updated eslint package versions
  • Replaced Uglifyjs with Terser so es6 code can be minified
  • Added .babelrc and removed babel settings from webpack.config.js
  • Added .browserslistrc and included initial list of browsers which seem to support ccpwgl (Some further testing is required to finalize this list)
  • Updated webpack.config.js so it behaves the same as it did previously (currently only using 'production' mode)

transpiler features

  • Added support for decorators
  • Added support for class parameters
  • Added support for linting on newer babel features
  • Added support for extending Error

structure

  • Optimised imports/ exports for global objects
  • Moved all singly instantiated classes and objects to src/global
  • All singly instantiated Tw2 global classes moved from src/core/global into src/global/engine
  • Singly instantiated Tw2 global classes are no longer exported
  • Separated util functions into their own files
  • Added new type utility functions which now replace all typeof checks
  • Added new static class property partialImplementation so classes that are partially implemented can be identified by hoomans and code
  • Removed deprecated classes along with the /core/deprecated folder
  • Moved EveStarfield from src/eve/object to src/eve/effect
  • Added EveChildCloud partial implementation
  • Moved Tw2ParticleElementDeclaration to it's own file
  • Moved some static class properties from outside their class to inside their class

Demos

  • Added post.html demo which contains an example of a custom post effect
  • Updated index.html demo to include post effect demo
  • Added Vanilla Toasts https://github.com/AlexKvazos/Toasts for error and warning messages so users can see them without using the console
  • Added a basic check to ensure the same errors and/or warnings don't get spammed to the user
  • Fixed camera.focus so that it actually works (ccpwgl.js, sof.html, typeids.html)
  • Stopped camera focus from changing the camera's distance when you haven't changed hulls
  • Added autoPlane to camera.focus to fix visual issues where the target object is too big
  • Updated ccpwgl.js to use new planet callback
  • Updated ccpwgl.js to use new post classes
  • Updated ccpwgl.setResourcePath to use store.RegisterPath
  • Beautified code

Tw2Error

  • Added Tw2Error base class and other custom errors in preparation for future Promise support and simplified logging
  • Replaced all generic logs with Tw2 errors
  • All custom errors begin with Err so that it is clear that they aren't object constructors
  • Errors can be passed directly to the default logger to create event logs

Tw2Device

  • Tw2Device is now an event emitter so you can listen to it's events
  • Added resize event which is fired when the canvas is resized
  • Added context event which is fired when context is created
  • Added tick event which is fired per tick
  • Added RM_DISTORTION so that distortion effects can be accumulated
  • Removed onResized callbacks and properties, as you can not listen to an event
  • Renamed ST3C extension name to be more specific

Tw2ResMan

  • Tw2ResMan is now an event emitter so you can listen to it's events
  • Added error event which is fired on any resource error
  • Added warning event which is fired on resource warnings
  • Added requested event which is fired when a resource is requested
  • Added reloading event which is fired when a resource is reloaded
  • Added loaded event which is fired when a resource is loaded
  • Added prepared event which is fired when a resource is prepared
  • Added unloaded event which is fired when a resource is unloaded
  • Added purged event which is fired when a resource is purged
  • Added debug event which is fired when a resource is debugging
  • Added OnResError method which is fired on resource errors
  • Errors on resources that can't be loaded are now caught properly
  • Added OnResEvent method which is fired on resource events
  • Replaced logs with errors in preparation for Promises
  • Added Try/Catch blocks in preparation for Promises
  • Simplified the resMan prepareLoop
  • Errors are now handled correctly in the resMan prepareLoop
  • Added onRejected callback to GetObject so developers can catch errors
// Fires on resource errors
function onRejected(err){

    throw Array.isArray(err) ? err[0] : err;
};

// Fires when the resource is resolved
function onResolved(obj)
{
    console.log(`Loaded ${obj.name ? obj.name : 'Some object'}`);
}

// Get an object
resMan.GetObject('res:/some/resource/file.red', onResolved, onRejected);

Tw2MotherLode

  • Added HasErrors function which checks a path for errors
  • Updated PurgeInactive function so that it uses new resource methods
  • Updated Tw2MotherLode.AddError so that standard errors get data.path resource values

Tw2Resource

  • Replaced logs with errors in preparation for Promises
  • Added GetErrors function which returns any resource errors
  • Added HasErrors function which checks if a resource has errors
  • Added OnError which is fired on errors
  • Added OnResError for notifications error handling
  • Added OnUnloaded which is fired when resources are purged or unloaded
  • Added OnDebug which is fired when debugging
  • Added OnWarning which is fired on warnings
  • Replaced LoadStarted with OnRequested
  • Replaced LoadFinished with OnError and OnLoaded
  • Replaced PrepareFinished with OnError and OnPrepared
  • Added onRejected callback to Tw2LoadingObject so you can catch errors
  • Stopped Tw2TextureRes that have textures attached from being able to be reloaded

Tw2Store

  • Tw2Store is now an event emitter so you can listen to it's events
  • Replaced logs with events
  • Paths registered without a trailing '/' are now allowed
  • dynamic and rgba are now restricted prefixes
  • Trying to register a restricted prefix now emits an error
  • Some red files use trinity constructor names still and fail as they usually don't exist. The store will now look for the Tr2 and Tri named constructor first, and if that fails will try to get a Tw2 variant instead
  • Renamed Has/Get/Register Constructor methods to be Class instead
  • Added registered event which fires when a new store value is registered
  • Added missing event which fires when a store value has been requested that doesn't exist
  • Added partial event which fires when a partially implemented class has been used
  • Added substitute event which fires when a Tw2 constructor is used when a Tr2 constructor was requested but not found
  • Added error events when stuff(tm) breaks

Tw2Logger

  • Simplified Tw2Logger
  • Removed most direct references in preparation for user defined loggers
  • Tw2Logger now emits log types as event names
  • Errors can now be passed as a log, and will return an event log

EveSOF

  • Updated EveSOF so it doesn't throw errors when trying to bind unsupported elements, now a warning log is posted instead
  • Updated EveSOF so it doesn't throw errors when setting up children who are empty objects or are missing respaths, now a warning log is posted instead

Tw2ObjectReader

  • Replaced logs with errors
  • Fixed Tw2ObjectReader.DEBUG_ENABLED mode so it actually works

Tw2RawData/ Tw2VertexDeclarations

  • Simplified raw vertex and per object data declarations
  • Replaced all raw per object data per line declarations with a single declaration from a static object
  • Replaced all raw vertex data per line declarations with a single declaration from a static object
  • It is now much easier to read and share raw data
  • Fixed issue in Tw2RawData when a standard array was passed as a default value it would throw an error as Array's don't support subarray
  • Changed Tw2RawData.DeclareFromObject to take either an array of arrays or an array of objects. (Declarations need to be in arrays to ensure they're declared in the right order)
  • Updated all EveChild classes perObject data
  • Updated all EveSet classes perObject and vertex data
  • Updated all EveObject classes perObject data
  • Updated EveSpaceScene per frame data

Tw2Shader

  • Added Tw2Shader.HasConstant which checks to see if a shader has support for a constant
  • Added Tw2Shader.HasTexture which checks to see if a shader has support for a texture
  • Added Tw2Shader.HasSampler which checks to see if a shader has support for a sampler

Tw2TextureParameter

  • Tw2TextureParameter's no longer apply samplers when overrides are allowed but UpdateOverrides has not been triggered
  • Tw2TextureParameter's can now take RGBA values instead of resource paths using rgba:/0,0,0,0 format
  • Fixed error which happened when adding attachments with SetTextureRes
// Create a solid red texture parameter
const texture = new Tw2TextureParameter('Red', 'rgba:/255,0,0,1');

EvePlanet

  • Added optional onload callback which is fired when all planet parts have loaded
  • Updated EvePlanet.Create so that it can now take an optional onload callback
  • Updated ccpwgl.loadPlanet so that it can now take an optional onload callback
  • Updated planet demo to include onload callbacks

Tw2PostEffect

  • Create new classes so users can create their own post effects
  • Custom post effects can now be created with objects/json
  • Added new class Tw2PostEffectManager which manages post effects
  • Added new class Tw2PostEffect
  • Added new class Tw2PostEffectStep
  • Updated ccpwgl.js to use new classes
  • Tw2PostProcess partially implemented to stop errors when trying to load post .red files, but not used anywhere yet

Tw2Effect

  • Added Tw2Effect.AutoParameter which automatically creates shader parameters if they don't already exist
  • Updated Tw2Effect.IsGood so that it also keeps resources alive so that it is in line with other methods of the same name
  • Added Tw2Effect.KeepAlive which keeps all effect resources alive

Misc

  • Added initial support for DDS textures
  • Added jointMat to EveMissile perobjectData so that missile's engine sprites work
  • Added Tw2BatchAccumulator.length which returns the current batch count
  • Removed Tw2EventEmitter constructor options so it can be used with Object.assign(Constructor.prototype, Tw2EventEmitter.prototype)
  • Fixed order of Tw2VertexDeclaration.Declare array parameter and added a default gl type
  • Ran beautification rules (not sure why these aren't running on build anymore)
  • Added template to utils
  • Added isError to utils
  • Fixed error in Tw2ParticleElement
  • Fixed error in EveMissile
  • Fixed minor eslint errors

- Added support for decorators
- Added support for extending Error
- Added support for class parameters
- Added support for linting on newer babel features
- Added `Tw2Error` base class in preparation for future Promise support
- Moved all singly instantiated classes and objects to `/global`
- All singly instantiated `Tw2` files moved into `/global/engine`
- All singly instantiated `Tw2` classes are no longer exported
- Removed `Tw2EventEmitter` constructor options so it can be used with
  `Object.assign(Constructor.prototype, Tw2EventEmitter.prototype`
- Separated util functions into their own files
- Added new type utility functions which now replace all typeof checks
- Removed deprecated classes and the `/core/deprecated` folder
- Moved `EveStarField` from `/eve/object` to `/eve/effect`
- Fixed minor eslint errors
- Fixed order of `Tw2VertexDeclaration` Declare function and added
  default gl type
- Added new error classes which will be used for future Promises support
- Ran beautification rules
- Reduced library size by a teeeeeny tiny bit :3
- Updated `EvePlanet.Create` so that it can now take an optional onload callback
- Updated `ccpwgl.loadPlanet` so that it can now take an optional onload callback
- Updated planet demo to include onload callbacks
Demos
===
- Added Vanilla Toasts https://github.com/AlexKvazos/Toasts
- Added toasts for error and warning messages so users can see them without using the console
- Fixed `camera.focus` so that it actually works (`ccpwgl.js`, `sof.html`, `typeids.html`)
- Stopped camera focus from changing the camera's distance when you haven't changed hulls
- Added `autoPlane` to `camera.focus` to fix visual issues where the target object is too big
- Beautified code

Tw2Device
===
- `Tw2Device` is now an event emitter so you can listen to events
- Added `resize` event which is fired when the canvas is resized
- Added `context` event which is fired when context is created
- Added `tick` event which is fired per tick

Tw2ResMan
===
- `Tw2ResMan` is now an event emitter so you can listen to events
- Added `OnResError` which is fired on resource errors
- Added `OnResEvent` which is fired on resource events
- Replaced logs with errors in preparation for Promises
- Added `Try/Catch` blocks in preparation for Promises
- Added `onRejected` callback to `GetObject` so you can catch errors
- Errors are now handled correctly in the resMan per frame update
- Simplified per frame updates

Tw2MotherLode
===
- Added `HasErrors` function which checks a path for errors
- Updated `PurgeInactive` function so that it uses new resource methods
- Updated `Tw2MotherLode` to normalize error data

Tw2Resource
===
- Replaced logs with errors in preparation for Promises
- Added `GetErrors` function which returns any resource errors
- Added `HasErrors` function which checks if a resource has errors
- Added `OnError` which is fired on errors
- Added `OnResError` for notifications error handling
- Added `OnUnloaded` which is fired when resources are purged or unloaded
- Replaced `LoadStarted` with `OnRequested`
- Replaced `LoadFinished` with `OnError` and `OnLoaded`
- Replaced `PrepareFinished` with `OnError` and `OnPrepared`
- Added `onRejected` callback to `Tw2LoadingObject` so you can catch errors

Tw2Store
===
- `Tw2Store` is now an event emitter so you can listen to events
- Replaced logs with events

Tw2Logger
===
- Simplified `Tw2Logger`
- Removed most direct references in preparation for user defined loggers

EveSOF
===
- Updated `EveSOF` so it doesn't throw errors when trying to bind unsupported elements
- Updated `EveSOF` to log a warning when an unsupported element cannot be bound

Tw2ObjectReader
===
- Replaced logs with errors
- Fixed `Tw2ObjectReader.DEBUG_ENABLED` mode so it actually works

Misc
===
- Added `template` to utils and `Tw2Error`
- Added `isError` to utils
- Fixed error in `Tw2ParticleElement`
- Fixed error in `EveMissile`
- Beautified code
- Replaced all raw per object data per line declarations with a single declaration from a static object
- Replaced all raw vertex data per line declarations with a single declaration from a static object
- It is now much easier to read and share raw data
- Fixed issue in `Tw2RawData` when a standard array was passed as a default value it would throw an error as Array's don't support `subarray`
- Changed `Tw2RawData.DeclareFromObject` to take either an array of arrays or an array of objects. (Declarations need to be in arrays to ensure they're declared in the right order)
- Moved some static class properties from outside their class to inside their class
Tw2TextureParameter
---
- `Tw2TextureParameter`'s no longer apply samplers when overrides are allowed but `UpdateOverrides` has not been triggered
- `Tw2TextureParameter`'s can now take rgba values instead of resource paths using `rgba:/0,0,0,0` format

```
// Create a solid red texture parameter
const texture = new Tw2TextureParameter('Red', 'rgba:/255,0,0,1');
```

Tw2Store
---
- Paths registered without a trailing '/' are now allowed
- `dynamic` and `rgba` are now restricted prefixes
- Trying to register a restricted prefix now emits an error

Tw2Effect
---
- Added `AutoParameter` which automatically adds a shader's parameters

utils
---
- Corrected the `template` utility regex
- Added `Tw2Shader.HasConstant` which checks to see if a shader has support for a constant
- Added `Tw2Shader.HasTexture` which checks to see if a shader has support for a texture
- Added `Tw2Shader.HasSampler` which checks to see if a shader has support for a sampler
- Added `EveChildCloud` to stop errors when loading certain red files
- Added `length` to `Tw2BatchAccumulator` which returns the current batch length
- Added `partialImplementation` constructor flag to classes which haven't been fully implemented
- Renamed `Tw2Store` constructor related functions to `class`
- Added `Tw2Store` warning event which lets you know when a partially implemented class has been loaded
- Stopped `Tw2TextureRes` which have been attached from being able to be reloaded
- Added `Tw2PostProcess.IsGood` so you can check when this post process is good
- Added `display` option to `Tw2PostProcess` so you can disable the effect
- Changed `Tw2PostProcess.Render` to return a boolean like other render functions
- Added `_id` and `name` properties to `Tw2PostProcess` so it will be inline with soon to be pushed `Tw2PostEffect` and `Tw2PostEffectStep` classes for custom post effects
- Updated `ccpwgl.js` to use changes to `Tw2PostProcess`
- Updated `ccpwgl.js` so that when `Tw2PostProcess` doesn't render anything the back buffer alpha channel is cleared
- Added `Tw2Device.RM_DISTORTION` so that distortion effects can be accumulated
- Moved `Tw2ParticleElementDeclaration` to it's own file
@cppctamber cppctamber changed the title Added support for new transpiler features and preparation for others August/ September motherlode Sep 18, 2018
- Custom post effects can now be created with json
- Added new class `Tw2PostEffectManager`
- Added new class `Tw2PostEffect`
- Added new class `Tw2PostEffectStep`
- Added `ccpwgl.post` instantiation of `Tw2PostEffectManager`
- Updated `ccpwgl.js` to use new classes
- Added `post.html` demo
- Updated `index.html` demo to include post effect demo
- Fixed typo in perObjectData
- Added JointMat data to perObjectData so that missile engine sprites work
- Not currently implemented in the post manager, but will allow post red objects to be loaded
- Some red files use trinity constructors `Tr2` which don't exist
- The store will first look for the `Tr2` constructor and use it if found
- The store will then look for a `Tw2` constructor and use that if found
- If a substitution occurs a warning log is created
- If a substitution occures a `substitution` event is emitted, with the details
@cppctamber cppctamber changed the title August/ September motherlode August - December motherlode Dec 11, 2018
- Preparation for decorators and private class properties
- Prefixed all custom errors with "Err" so they've obviously not object contructors
- Added "emitOn" to `Tw2Error` so you can emit errors on a target emitter
- Cleaned up `OnResEvent` error handling so its the same as other events
- Changed the default logger to accept errors directly (returns an event log)
- Added check in the sof for missing children to stop certain sof objects from failing
- Added optional throttling to logger to stop excessive log outputs
- Simplified log inputs
- Fixed `EveStarfield` name
- Added `logger` and `resMan` options to `store.Register`
- Added `isDna` type util
- Increased library version
- Added optional throttling to logger to stop excessive log outputs
- Simplified log inputs
- Fixed `EveStarfield` name
- Added `logger` and `resMan` options to `store.Register`
- Added `isDna` type util
- Increased library version
- D3D
- CCP
- GL
- DDS
- Browser vendor enums
- Added DDS support (Cube maps not yet supported)
- Renamed new constants to be inline with existing ones
- Fixed minor error in `Tw2TextureParameter` when adding a texture res
- Added `OnDebug` method to `Tw2Resource`
- Added `ErrResourceFormat` error which is thrown on resource format errors
- Added missing property `magFilter` to `Tw2SamplerState`
- Replaced static objects in `Tw2SamplerOverride` with constants
- Removed unnecessary `_onResize` property in `Tw2Device`
- Renamed `CompressedTexture` to `CompressedTextureS3TC` in `Tw2Device`
- Updated webpack
- Updated all babel packages
- Updated gl-matrix package
- Updated eslint packages
- Replaced `Uglifyjs` with `Terser` so es6 code can be minified
- Added `.babelrc` and removed babel settings from `webpack.config.js`
- Added `.browserslistrc` and included initial list of browsers which seem to support `ccpwgl` (requires some testing)
- Updated `webpack.config.js` so it behaves the same as previously (currently only using 'production' mode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant