///////////////////////////////////////////////////////////////////////////
//    Copyright (C) 2014 Wizardry and Steamworks - License: GNU GPLv3    //
///////////////////////////////////////////////////////////////////////////
// Can be called after "update" (write or append) operations on the 
// PrimDrive™ in order to highlight the data-consumption and clustering 
// of sectors.
wasPrimDriveLED(integer head, integer tail) {
    // when tail overlaps head, we're done
    if(tail < head) return;
    string d = wasGetLinkDescription(tail);
    // indicate unformated blocks in red
    if(d == UNFORMATTED_MARKER) {
        llSetLinkPrimitiveParamsFast(tail, [
            PRIM_COLOR, 
            ALL_SIDES, 
            <1,0,0>, 
            1]
        );
        jump continue;
    }
    integer size = llStringLength(d);
    // GC
    d = "";
    llSetLinkPrimitiveParamsFast(tail, [
        PRIM_COLOR, 
        ALL_SIDES, 
        wasPercentToGradientBrighness(
            100*size/(float)BYTES_PER_SECTOR, 
            <1,1,1>, ZERO_VECTOR), 
        .17 + size/(float)BYTES_PER_SECTOR]
    );
@continue;
    // GC
    d = "";
    wasPrimDriveLED(head, --tail);
}

secondlife/primfs_and_primdrive/primdrive/led.txt · Last modified: 2017/02/22 18:30 (external edit)

Access website using Tor


For the copyright, license, warranty and privacy terms for the usage of this website please see the license and privacy pages.