Up

Scol 5.0 updates
Last update: 2007/09/27 - Version 5.01 - Build 0xc6e7d47c.
Latest updates are described as *NEW*.

List of source code modifications can be found in '_blg.txt' files in root directories of APIs.
To find precise source code modifications, edit code files and look for functions, key names or:
- $BLG : code from A.Fombaron
- $MF : code from M.Faleh.
- $LB : code from L.Berthelot, especially upgrade from v4.0 to v4.5, and SerialIO API.
- $JI : new ftoa5d( ) and similar functions originally developped by A.Tahir


New safe version

Kernel
  • _versionname( ) now Returns: 5.01.
  • _version( ) now Returns: 2008.
  • The return code of LaunchMachine( ) in web pages is of course: 2008.
  • Since v4.5, the name of the main program is scol.exe, no more usmwin.exe.


  • Fixes

    Kernel
  • *NEW*  Scol console & log: Fixed GDI memory flow.
  • *NEW*  _appendpack( ): "Fixed" "cannot write file" error.
  • _loadS( ): The function is no more based on temporary files at all.
  • nth_char( ): Fixed returned value.
  • zip( ): Fixed a buffer overflow problem.
  • unzip( ): Fixed a buffer overflow problem.

  • 2D
  • _CRfont( ): Fixed font rotation as well as missing requested font.
  • _SHOWwindow( ): Fixed some vanishing Flags bug.
  • _FILEbitmap( ): Fixed some memory offset corruption.
  • _DLGOpenDir( ): Fixed the management of the root directory and the returned directory.

  • 2D Graphic
  • _SETcontainerName( ): Fixed some vanishing Flags bug.
  • _SETcompText( ): Fixed shadowing.
  • _ADDcompText( ): Fixed shadowing.

  • 3D
  • *NEW*  M3loadString( ): Fixed the "not accepted special characters in names" bug.
  • *NEW*  M3filter( ): Fixed a remaining data alignment bug that could bring to crash.
  • *NEW*  M3listOfMaterials( ) & M3recListOfMaterials( ): Fixed a "dupplicating first material" bug.
  • M3blitTexture16( ): Fixed an offset bug (texture shift on precise cases).
  • M3filter( ): Now filters 100% of the filtered bitmap. Fixed the filters too.
  • Surface2Bitmap( ): Fixed a pixel offset bug.
  • M3shiftTextureXY( ): The function now accepts Parameters with value of -1. Do NOT use nil parameters, use Zeros instead.

  • Serial Port Communication
  • _writeSIO( ): Fixed binary content management.
  • _openSIO( ): Data loss due to heavy CPU use fixed.

  • MultiMedia
  • *NEW*  wmpCreateEx( ): Fixed the blocking "Could not render file of the filter graph" bug.

  • Web integration
  • Web integration works again. Version 4.5 problem fixed.


  • Updated functions

    Kernel
  • *NEW*  Scol console & log: Size of messages that can be written is now 32KB, instead of 16KB.
  • *NEW*  Server functionality: Number of possibly concurrently running sites increased from 50 to 1000.
  • _starttimer( ): Minimum period on client can be set to 1ms (cf new Kernel functions below for details).
    General note regarding Timers: Their precision, evaluation and reliability have been greatly improved.

  • 2D
  • *NEW*  Windows: Windows can now react to middle mouse button (wheel). For Click/Unclick/DblClick, this button has a value of 16.
  • *NEW*  Windows: Windows can now react to System Keys (like F10) which were not recognized for example by KeyDown events.
  • *NEW*  _CRwindow( ): New WN_TOPMOST flag (Always on Top).
  • _CRwindow( ): New WN_NOSCOL flag that removes the "(Scol)" word in windows titles.
  • _SETwindowName( ): The function is compatible with the new WN_NOSCOL flag.
  • _BlendBitmap2Surface[ObjSurface I I ObjBitmap I I I I I I I] ObjSurface:
    A new parameter (the one just before the last one) has been added to allow background color transparency customization (0 to 255).
    Note: The transparency color uses BGR format.
    This supersedes the description in the "New functions" chapter (v4.6a1).
  • _BlendSurface2Surface[ObjSurface I I ObjBitmap I I I I I I I] ObjSurface:
    A new parameter (the one just before the last one) has been added to allow background color transparency customization (0 to 255).
    Note: The transparency color uses BGR format.
    This supersedes the description in the "New functions" chapter (v4.6a1).
  • _DLGOpenDir[Chn ObjWin S S] OpenDirBox: The new 4th parameter lets you choose/localize the selection box's message.

  • 2D Graphic
  • *NEW*  Containers: Containers can now react to middle mouse button (wheel) clicks. For Click/Unclick/DblClick, this button has a value of 16 (MBUTTON).
  • *NEW*  Containers: Containers can now react to System Keys (like F10) which were not recognized for example by KeyDown events.
  • *NEW*  _CRcontainerFromObjWin( ) & _CRcontainerFromObjCont( ): New CO_TOPMOST (always on top) flag.
  • *NEW*  _SETcontainerCursor( ): The function now accepts a nil parameter which restores the system arrow cursor.
  • _CRcontainerFromObjWin( ): New CO_NOSCOL flag that removes the "(Scol)" word in containers titles.
  • _SETcontainerName( ): The function is compatible with the new CO_NOSCOL flag.

  • 3D
  • M3blitTexture16( ):
    - Accepted texture dimensions that require no stretching are: 64, 128, 256, 512 and 1024.
    - Optimized stretching and pure blitting: up to 25% performance saving.
  • _MX3renderEx( ) and all other rendering functions:
    These functions are now able to detect Sprites. Returned data, when possible, include Mesh, Material and Integer distance between Sprite and Camera (not the z data as described in Rendering documentation).
    Note: Have a look at the New Functions for Sprite detection.
  • M3textureGetType( ), M3textureSetType( ), M3textureSetGeneralDefaultType( ), M3textureGetGeneralDefaultType( ) and M3createTexture( ):
    All these functions now accept texture distance filtering Parameters ranging from 0 to 3 (instead of values 0 - in fact 1 - or 2).
    Note: For upward compatibility, open the Dms/3d/C3d3/C3d3EngineExtension and modify the '0' parameter of the first function to '1'.
    Note: M3filter( ), which is applied on Bitmaps, hasn't been updated regarding this kind of OpenGL hardware filter.
    Note: Basic texture filtering, i.e. M3createTexture( ), accepts a new additional 'On' filter, with n ranging from 0 to3 being the OpenGL texture distance filtering.
  • For VM developers only: I introduced a ZBLG_ObjSpr class and modified many functions to implement clickable Sprites. Have a look at the _blg.txt file related to the ZooEngine (3D) API.
  • _Surface2Surface( ): Optimized. 10% performance saving.

  • MultiMedia
  • *NEW*  Windows Media Player API: 15bits functions turned to 24bits.


  • New functions

    Kernel
  • *NEW*  Implementation of UPnP API:
    General notes:
    - This API allows you to discover UPnP compliant Internet Gateway Devices (Routers/Boxes) on the network and dynamically manage their ports.
    - Requirements:
       - Windows XP or above.
       - UPnP compliant Internet Gateway Device.
       - TCP port 2869 or UDP port 1900 being opened on Firewall if any.
    - Note: All functions are synchronous and wait response from the device. During that time, the application is frozen.
      _UPNP_Connect is the worst freezing function (3-5 seconds), the others work much faster if the device responds immediately (which is not always the case). - API functions:
    _UPNP_Connect [Chn] I:   Tries to find a UPnP compliant device on network (precisely an Internet Gateway Device) and connects to it.
    This function should be called once before using any other one.
    It will freeze the application during a few seconds (3-5).
    Parameters: Chn Channel, usually _channel.
    Returns: 1 or nil if it fails (or doesn't find anything).
    _UPNP_Disconnect [ ] I:   Closes the link with the Internet Gateway Device.
    Parameters: -
    Returns: 1.
    _UPNP_OpenPort [S S I I I] I:   Opens a port on the Internet Gateway Device.
    Parameters:
        S Name, like Application Name.
        S IP address of the PC to which messages should be routed. Ex: _hostIP().
        I Port number (0-65535, ports categories: 0-1023:WellKnown, 1024-49151:Registered, 49152-65535:Dynamic&Private).
        I Protocol, should be either UPNP_TCP or UPNP_UDP.
        I Mode, should be either UPNP_SAFE or UPNP_FORCE. The second one will overwrite any existing similar port mapping (Port+Protocol).
    Returns: Port number if successful, nil if it fails.
    _UPNP_ClosePort [I I] I:   Removes a port on the Internet Gateway Device.
    Parameters:
        I Port number.
        I Protocol.
    Returns: Port number if successful, nil if it fails.
    _UPNP_IsPortUsed [I I] I:   Checks if a port is already used on the Internet Gateway Device.
    Parameters:
        I Port number.
        I Protocol.
    Returns: 1 if port is already defined, 0 if it's free to use.
    _UPNP_GetExternalIP [ ] S:   Returns the external IP address of the Internet Gateway Device.
    Parameters: -
    Returns: S External IP address.
  • *NEW*  _versiondate [ ] I: Returns the Build number of the VM, in fact the compilation date of its last code update.
  • *NEW*  _trimmemory [ ] I: Performs a Windows GC for your current application / scol.exe process. Returns 0 or nil if a problem occured.
  • Implementation of Windows Registry Access API:
    General notes:
    - Registry access is limited to HKEY_LOCAL_MACHINE\SOFTWARE\Scol-Technologies\ and below.
    - All access paths are relative to this registry key.
    - Note that management of Values is accepted directly at the above Scol root Key (relative path coded as "").
    But we recommend you to create your own personal/application SubKeys and to work with your own Values in these SubKeys.
    - For Windows compatibility issues, we recommend to limit the size of Key or Value names to 255 characters, and the content of Values to 2048 characters. This last limit is hardcoded. As explained in MSDN, bigger content should be stored in files and the file names stored in the registry.
    - Most new functions return a I value: 0 if the action was successful, NIL otherwise.
    _winreg_createkey [S] I:
    Parameters: Key name
    Example: _winreg_createkey "Kyrien\\Scol-Voyager\\Infos\\ToDel\\SubKey";
    _winreg_deletekey [S] I:
    Parameters: Key name
    Example: _winreg_deletekey "Kyrien\\Scol-Voyager\\Infos\\ToDel";
    _winreg_setvalue [S S I S] I:
    Parameters: Key name, Value name and then Value content (I or S, other one set to NIL)
    Example: _winreg_setvalue "Kyrien\\Scol-Voyager\\Infos" "INT" 0xffff00 nil;
    Example: _winreg_setvalue "Kyrien\\Scol-Voyager\\Infos" "STR" nil "0xffffff";
    _winreg_getvalue [S S] [I S]:
    Parameters: Key name, Value name
    Returns: Tuple if successful, NIL otherwise. The tuple contains the content of the Value (I or S, other tuple member set to NIL)
    Example: let _winreg_getvalue "Kyrien\\Scol-Voyager\\Infos" "INT" -> val in     let val -> [int str] in     ...
    _winreg_delvalue [S S] I:
    Parameters: Key name, Value name
    Example: _winreg_delvalue "Kyrien\\Scol-Voyager\\Infos" "STR";
  • _isCacheActivated [ ] I: Returns 1 if Cache is activated, 0 if not.
  • _gettimerscapabilities [ ] [I I]: Retrieves the minimum and maximum periods accepted by the client system.
  • _settimerperiod [Timer I] I: Dynamically updates a Timer's period. Returns 0 or NIL if problem occured.
  • ftoa5d [F] S, ftoa4d [F] S, ftoa3d [F] S, ftoa2d [F] S and ftoa1d [F] S:
    As ftoa( ) but with chosen precision (number of digits behind '.') and no rounding up for last digit.
  • _fooId [I] S: As _fooI( ) but with decimal output. The output is limited to 9 characters (not including '-' sign) as for other _foo( ) functions.

  • 2D
  • *NEW*  Mouse: Buttons are now named (MB_LBUTTON, MB_RBUTTON & MB_MBUTTON).
    Note: Per conveniency, you may prefer to use the names from the 2D Graphic API (LBUTTON, RBUTTON & MBUTTON) which are fully compatible.
  • *NEW*  Implementation of Remote Control API:
    General notes:
    - This API allows you to simulate and trigger mouse moves and clicks, as well as keydown events.
    - Requirements:
       - Windows XP or above.
    - API functions:
    _RMTCTRL_MouseMove fun [I I I] I:   Simulates a mouse move.
    Parameters:
    I    Delta_x: x-axis displacement (in pixels)
    I    Delta_y: y-axis displacement (in pixels)
    I    Mode: should be RMTCTRL_RELATIVEMOVE (default) or RMTCTRL_ABSOLUTEMOVE
                    RMTCTRL_RELATIVEMOVE: delta values are from last cursor position
                    RMTCTRL_ABSOLUTEMOVE: delta values are from upper-left corner of screen
    Returns: 0.
    _RMTCTRL_MouseClick fun [I] I:   Simulates a mouse click.
    Parameters: I Mouse button.
    Returns: 0 or NIL if problem occured.
    Note: You're responsible for handling the related UnClick.
    _RMTCTRL_MouseUnClick fun [I] I:   Simulates a mouse unclick.
    Parameters: I Mouse button.
    Returns: 0 or NIL if problem occured.
    _RMTCTRL_MouseDClick fun [I] I:   Simulates a mouse double click.
    Parameters: I Mouse button.
    Returns: 0 or NIL if problem occured.
    Note: You're responsible for handling the related UnClick.
    _RMTCTRL_KeybdKeyDown fun [I] I:   Simulates a keydown event.
    Parameters: I char (ascii code, per as nth_char() Scol function).
    Returns: 0 or NIL if problem occured.
  • *NEW*  _GETbitmapFromObjWin [ObjBitmap ObjWin] ObjBitmap: Retrieves the graphic content of a Window (the part of the screen corresponding to window's client area).
  • *NEW*  _TOPMOSTwindow [ObjWin I I] ObjWin: Sets the display level of a window.
    Parameters:
    - ObjWin
    - I: Display level
        - 0: Bottom Window is moved to background
        - 1: NoTopMost Window loses its TopMost status
        - 2: Top Window is brought to top
        - 3: TopMost TopMost (Always on top) status
    - I: Focus
        - 0: Window doesn't get the focus
        - 1: Window gets the focus (except in Bottom status)
  • _joystickExt [I] [I I I I I]: This function, compatible with old (3 axis) joysticks, lets you retrieve the values for X,Y,Z and R axis (recent 4 axis joysticks, pads...). Last returned value is the buttons' status. Parameter of the function is the joystick number (usually 0).

  • 2D Graphic
       
  • *NEW*  _CRcontainer: A few undocumented functions have been uncovered for virtual containers (aka offscreen containers) which are created through this function.
    These functions, when called, trigger the corresponding classic callbacks. You can thus simulate mouse or keyboard actions (for example) on the virtual containers.
    Most of these functions use the parameters that are received by the callbacks, so they are not re-explained there.
    The following table lists the "new" functions, their prototypes, their related callbacks and parameters' exceptions if any:
     Function   Proto   Callback   Parameter exception 
     _METHODcontainerPreDestroy   fun [ObjContainer] ObjContainer   _CBcontainerPreDestroy      
     _METHODcontainerDestroy   fun [ObjContainer] ObjContainer   _CBcontainerDestroy      
     _METHODcontainerPaint   fun [ObjContainer] ObjContainer   _CBcontainerPaint      
     _METHODcontainerSize   fun [ObjContainer I I] ObjContainer   _CBcontainerSize     'state' (minimized/maximized/restored) logically doesn't have to be specified, so, only 3 parameters. 
     _METHODcontainerMove   fun [ObjContainer I I] ObjContainer   _CBcontainerMove      
     _METHODcontainerFocus   fun [ObjContainer] ObjContainer   _CBcontainerFocus      
     _METHODcontainerKillFocus   fun [ObjContainer] ObjContainer   _CBcontainerKillFocus      
     _METHODcontainerKeyDown   fun [ObjContainer I I] ObjContainer   _CBcontainerKeyDown      
     _METHODcontainerKeyUp   fun [ObjContainer I] ObjContainer   _CBcontainerKeyUp      
     _METHODcontainerClick   fun [ObjContainer I I I] ObjContainer   _CBcontainerClick     'mask' doesn't have to be specified. however, it's provided in realtime through your actions. 
     _METHODcontainerUnClick   fun [ObjContainer I I I] ObjContainer   _CBcontainerUnClick     'mask' doesn't have to be specified. however, it's provided in realtime through your actions. 
     _METHODcontainerDblClick   fun [ObjContainer I I I] ObjContainer   _CBcontainerDblClick     'mask' doesn't have to be specified. however, it's provided in realtime through your actions. 
     _METHODcontainerMouseHover   fun [ObjContainer] ObjContainer   _CBcontainerCursorHover      
     _METHODcontainerMouseLeave   fun [ObjContainer] ObjContainer   _CBcontainerCursorLeave      
     _METHODcontainerMouseWheel   fun [ObjContainer I I I I] ObjContainer   _CBcontainerMouseWheel     
     _METHODcontainerMouseMove   fun [ObjContainer I I I] ObjContainer   _CBcontainerCursorMove   Third supplemental parameter is simulated 'mask' (cf Clicks callbacks) 
  •  
  • *NEW*  _TOPMOSTcontainer [ObjContainer I I] ObjContainer: Allows control of containers' display level.
    Parameters:
    - ObjContainer
    - I: Display level
       - 0: Bottom - Container is moved to background
       - 1: NoTopMost - Container loses its TopMost status
       - 2: Top - Container is brought to top
       - 3: TopMost - TopMost (Always on top) status
    - I: Focus
       - 0: Container doesn't get the focus
       - 1: Container gets the focus (except in Bottom status)
  • *NEW*  _CBcompTextClick [CompText fun[CompText u0 I I I I] u1] u0] CompText: Classic CompClick callback definition.
    Works only for CT_LABEL CompTexts (without CT_SELECT).
  • *NEW*  _CBcompTextCursorMoveIn [CompText fun[CompText u0 I I I] u1] u0] CompText: Classic CompMoveIn callback definition.
    Works only for CT_LABEL CompTexts (without CT_SELECT).
  • *NEW*  _CBcompTextCursorMoveOut [CompText fun[CompText u0 I I I] u1] u0] CompText: Classic CompMoveOut callback definition.
    Works only for CT_LABEL CompTexts (without CT_SELECT).
  • *NEW*  _FORCEcompCheckROverDisplay [CompCheck I I] I: Forces RollOver aspect display for a CompCheck.
    - Parameters:
       - CompCheck
       - Aspect: Normal (CHK_DSPL_RO_NO) or RollOver (CHK_DSPL_RO_YES)
       - Protect RollOver aspect (CHK_DSPL_RO_FRC) or not (CHK_DSPL_RO_NO): Protected RO aspect, lets this aspect displayed when a mouse cursor leaves the CompCheck. The protected aspect has to be removed manually.
    - Returns: 0, or nil if error.
    - Examples:
       - Forcing normal aspect & removing protection:
           _FORCEcompCheckROverDisplay cchkCChk CHK_DSPL_RO_NO CHK_DSPL_RO_NO;
       - Forcing rollover aspect:
           _FORCEcompCheckROverDisplay cchkCChk CHK_DSPL_RO_YES CHK_DSPL_RO_NO;
       - Forcing & protecting rollover aspect:
           _FORCEcompCheckROverDisplay cchkCChk CHK_DSPL_RO_YES CHK_DSPL_RO_FRC;

  • 3D
  • *NEW*  M3shiftTextureBisXY [S3d H3d HMat3d I I] I: Same as M3shiftTextureXY.
  • *NEW*  M3shiftTextureBisXYF [S3d H3d HMat3d F F] I: Same as M3shiftTextureXYF.
  • M3setSpriteClickability [S3d H3d I] I: Sets Sprite clickability: 0 if not clickable (default status), 1 (or any other value different from 0) if clickable.
  • M3getSpriteClickability [S3d H3d] I: Returns 0 if the Sprite isn't clickable, 1 if it is.
  • M3isExtensionSupported [S] I: Allows you to check if an OpenGL Extension is available or not on client. Returns 0 or 1 if the extension is available.
  • M3getTextureSize [S3d HTx3d] [I I]: Returns the dimensions of a stored texture (not the ones from the original bitmap).
  • _BlendBitmap2Surface [ObjSurface I I ObjBitmap I I I I I I] ObjSurface: As _Bitmap2Surface, but a transparency factor (Last and added parameter: 0-255) is applied to the blitted bitmap. Note: The "former" (100%) transparency color parameter is applied too.
  • _BlendSurface2Surface [ObjSurface I I ObjSurface I I I I I I] ObjSurface: As _Surface2Surface, but a transparency factor (Last and added parameter: 0-255) is applied to the blitted surface. Note: The "former" (100%) transparency color parameter is applied too.
  • M3blitSurface2Texture [S3d HTx3d ObjSurface] I: As _Surface2Bitmap( ) followed by M3blitTexture16( ). Performance saving isn't really significant.
  • _CRforcedSurface [Chn I I] ObjSurface: As _CRsurface but without control for existing fullscreen surface.
  • _CRforcedFullscreenSurface [Chn I I] ObjSurface: As _CRfullscreenSurface but without control for existing windowed surfaces.
  • Note: These two functions were adapted for specific and concurrent use, for Example with _BlendSurface2Surface( ) in fullscreen mode. Both of them can only be used in hardware rendering mode. However, this seems to bring some rendering problems on different configurations. To use with care or on tested PCs.

    SQL
  • *NEW*  SqlCreateEx [Chn S] SqlDB: As SqlCreate(), but database access Parameters are provided in a single parameter, allowing to enter more than the 3 originals (DSN, Login & Password).