| !SpecialFX.!Load

Set SFXRes$Dir <Obey$Dir>

| We must ensure that the three support modules required for
| vector anti-aliasing are loaded:

| Try loading the modules from CCShared first (if present):
If "<CCShared$Dir>"="" Then Run "<SFXRes$Dir>.IfExists" System:!CCShared.!Boot Then Obey System:!CCShared.!Boot
RMEnsure GDraw 0.00 Run "<SFXRes$Dir>.IfExists" <CCShared$Dir>.RMStore.GDraw Then RMLoad <CCShared$Dir>.RMStore.GDraw
RMEnsure DitherExtend 0.00 Run "<SFXRes$Dir>.IfExists" <CCShared$Dir>.RMStore.DitherExt Then RMLoad <CCShared$Dir>.RMStore.DitherExt
RMEnsure GSpriteExtend 0.00 Run "<SFXRes$Dir>.IfExists" <CCShared$Dir>.RMStore.SpriteExt Then RMLoad <CCShared$Dir>.RMStore.SpriteExt

| If CCShared is not present, try loading the modules from AWViewer:
RMEnsure GDraw 0.00 Run "<SFXRes$Dir>.IfExists" ArtWorksModules:GDraw Then RMLoad ArtWorksModules:GDraw
RMEnsure DitherExtend 0.00 Run "<SFXRes$Dir>.IfExists" ArtWorksModules:DitherExt Then RMLoad ArtWorksModules:DitherExt
RMEnsure GSpriteExtend 0.00 Run "<SFXRes$Dir>.IfExists" ArtWorksModules:SpriteExt Then RMLoad ArtWorksModules:SpriteExt

| If the modules still haven't been loaded, issue an error:
RMEnsure GDraw 0.00 Error "GDraw support module cannot be found for use with SpecialFX"
RMEnsure DitherExtend 0.00 Error "DitherExtend support module cannot be found for use with SpecialFX"
| Note: GSpriteExtend is *not* essential for the use of SpecialFX,
| and may not be present on all systems, so we don't raise an error
| if it can't be loaded. (It may aid performance if available.)

| Ensure that the SpecialFX module itself is loaded:
RMEnsure SpecialFX 1.01 RMLoad <SFXRes$Dir>.SpecialFX

| Now obey the commands in any choices file
| which has been saved by the SFX Setup application:
Run "<SFXRes$Dir>.IfExists" <Choices$Dir>.SpecialFX Then Obey <Choices$Dir>.SpecialFX