From 7abecb48babe6a6f09bf6692ba55076546cfced9 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Mon, 1 Dec 2008 17:39:58 -0600 Subject: Second Life viewer sources 1.22.0-RC --- linden/indra/lscript/lscript_execute.h | 57 +++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 22 deletions(-) (limited to 'linden/indra/lscript/lscript_execute.h') diff --git a/linden/indra/lscript/lscript_execute.h b/linden/indra/lscript/lscript_execute.h index ac23ff3..77e9c21 100644 --- a/linden/indra/lscript/lscript_execute.h +++ b/linden/indra/lscript/lscript_execute.h @@ -370,7 +370,7 @@ public: LLScriptExecute(); virtual ~LLScriptExecute() {;} - virtual S32 getVersion() = 0; + virtual S32 getVersion() const = 0; virtual void deleteAllEvents() = 0; virtual void addEvent(LLScriptDataCollection* event) = 0; virtual U32 getEventCount() = 0; @@ -384,12 +384,12 @@ public: virtual void setSleep(F32 value) = 0; virtual F32 getEnergy() const = 0; virtual void setEnergy(F32 value) = 0; - virtual U64 getCurrentEvents(S32 version) = 0; - virtual void setCurrentEvents(U64 value, S32 version) = 0; - virtual U64 getEventHandlers(S32 version) = 0; - virtual void setEventHandlers(U64 value, S32 version) = 0; - virtual U64 getCurrentHandler(S32 version) = 0; - virtual void setCurrentHandler(U64 value, S32 version) = 0; + virtual U64 getCurrentEvents() = 0; + virtual void setCurrentEvents(U64 value) = 0; + virtual U64 getEventHandlers() = 0; + virtual void setEventHandlers(U64 value) = 0; + virtual U64 getCurrentHandler() = 0; + virtual void setCurrentHandler(U64 value) = 0; virtual BOOL isFinished() const = 0; virtual BOOL isStateChangePending() const = 0; virtual S32 writeState(U8 **dest, U32 header_size, U32 footer_size) = 0; // Allocate memory for header, state and footer return size of state. @@ -409,17 +409,17 @@ public: // Run handler for event for a maximum of time_slice seconds. // Updates current handler and current events registers. - virtual void callEventHandler(LSCRIPTStateEventType event, S32 major_version, const LLUUID &id, F32 time_slice) = 0;; + virtual void callEventHandler(LSCRIPTStateEventType event, const LLUUID &id, F32 time_slice) = 0;; // Run handler for next queued event for maximum of time_slice seconds. // Updates current handler and current events registers. // Removes processed event from queue. - virtual void callNextQueuedEventHandler(U64 event_register, S32 major_version, const LLUUID &id, F32 time_slice) = 0; + virtual void callNextQueuedEventHandler(U64 event_register, const LLUUID &id, F32 time_slice) = 0; // Run handler for event for a maximum of time_slice seconds. // Updates current handler and current events registers. // Removes processed event from queue. - virtual void callQueuedEventHandler(LSCRIPTStateEventType event, S32 major_version, const LLUUID &id, F32 time_slice) = 0; + virtual void callQueuedEventHandler(LSCRIPTStateEventType event, const LLUUID &id, F32 time_slice) = 0; // Switch to next state. // Returns new set of handled events. @@ -428,14 +428,14 @@ public: // Returns time taken. virtual F32 runQuanta(BOOL b_print, const LLUUID &id, const char **errorstr, - BOOL &state_transition, F32 quanta, + F32 quanta, U32& events_processed, LLTimer& timer); // Run smallest possible amount of code: an instruction for LSL2, a segment // between save tests for Mono void runInstructions(BOOL b_print, const LLUUID &id, const char **errorstr, - BOOL &state_transition, U32& events_processed, + U32& events_processed, F32 quanta); bool isYieldDue() const; @@ -443,6 +443,12 @@ public: void setReset(BOOL b) {mReset = b;} BOOL getReset() const { return mReset; } + // Called when the script is scheduled to be run from newsim/LLScriptData + virtual void startRunning() = 0; + + // Called when the script is scheduled to be stopped from newsim/LLScriptData + virtual void stopRunning() = 0; + private: BOOL mReset; @@ -455,7 +461,7 @@ public: LLScriptExecuteLSL2(const U8* bytecode, U32 bytecode_size); virtual ~LLScriptExecuteLSL2(); - virtual S32 getVersion() {return get_register(mBuffer, LREG_VN);} + virtual S32 getVersion() const {return get_register(mBuffer, LREG_VN);} virtual void deleteAllEvents() {mEventData.mEventDataList.deleteAllData();} virtual void addEvent(LLScriptDataCollection* event); virtual U32 getEventCount() {return mEventData.mEventDataList.getLength();} @@ -469,12 +475,12 @@ public: virtual void setSleep(F32 value); virtual F32 getEnergy() const; virtual void setEnergy(F32 value); - virtual U64 getCurrentEvents(S32 version) {return get_event_register(mBuffer, LREG_CE, version);} - virtual void setCurrentEvents(U64 value, S32 version) {return set_event_register(mBuffer, LREG_CE, value, version);} - virtual U64 getEventHandlers(S32 version) {return get_event_register(mBuffer, LREG_ER, version);} - virtual void setEventHandlers(U64 value, S32 version) {set_event_register(mBuffer, LREG_ER, value, version);} - virtual U64 getCurrentHandler(S32 version); - virtual void setCurrentHandler(U64 value, S32 version) {return set_event_register(mBuffer, LREG_IE, value, version);} + virtual U64 getCurrentEvents() {return get_event_register(mBuffer, LREG_CE, getMajorVersion());} + virtual void setCurrentEvents(U64 value) {return set_event_register(mBuffer, LREG_CE, value, getMajorVersion());} + virtual U64 getEventHandlers() {return get_event_register(mBuffer, LREG_ER, getMajorVersion());} + virtual void setEventHandlers(U64 value) {set_event_register(mBuffer, LREG_ER, value, getMajorVersion());} + virtual U64 getCurrentHandler(); + virtual void setCurrentHandler(U64 value) {return set_event_register(mBuffer, LREG_IE, value, getMajorVersion());} virtual BOOL isFinished() const {return get_register(mBuffer, LREG_IP) == 0;} virtual BOOL isStateChangePending() const {return get_register(mBuffer, LREG_CS) != get_register(mBuffer, LREG_NS);} virtual S32 writeState(U8 **dest, U32 header_size, U32 footer_size); // Not including Events. @@ -494,17 +500,17 @@ public: // Run handler for event for a maximum of time_slice seconds. // Updates current handler and current events registers. - virtual void callEventHandler(LSCRIPTStateEventType event, S32 major_version, const LLUUID &id, F32 time_slice); + virtual void callEventHandler(LSCRIPTStateEventType event, const LLUUID &id, F32 time_slice); // Run handler for next queued event for maximum of time_slice seconds. // Updates current handler and current events registers. // Removes processed event from queue. - virtual void callNextQueuedEventHandler(U64 event_register, S32 major_version, const LLUUID &id, F32 time_slice); + virtual void callNextQueuedEventHandler(U64 event_register, const LLUUID &id, F32 time_slice); // Run handler for event for a maximum of time_slice seconds. // Updates current handler and current events registers. // Removes processed event from queue. - virtual void callQueuedEventHandler(LSCRIPTStateEventType event, S32 major_version, const LLUUID &id, F32 time_slice); + virtual void callQueuedEventHandler(LSCRIPTStateEventType event, const LLUUID &id, F32 time_slice); // Switch to next state. // Returns new set of handled events. @@ -521,8 +527,15 @@ public: U32 mBytecodeSize; private: + S32 getMajorVersion() const; void recordBoundaryError( const LLUUID &id ); void setStateEventOpcoodeStartSafely( S32 state, LSCRIPTStateEventType event, const LLUUID &id ); + + // Called when the script is scheduled to be run from newsim/LLScriptData + virtual void startRunning(); + + // Called when the script is scheduled to be stopped from newsim/LLScriptData + virtual void stopRunning(); }; #endif -- cgit v1.1 From a87e38229921b48c32187c672a942516722f1b52 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Sun, 11 Jan 2009 16:10:39 -0600 Subject: Second Life viewer sources 1.22.5-RC --- linden/indra/lscript/lscript_execute.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linden/indra/lscript/lscript_execute.h') diff --git a/linden/indra/lscript/lscript_execute.h b/linden/indra/lscript/lscript_execute.h index 77e9c21..cfea328 100644 --- a/linden/indra/lscript/lscript_execute.h +++ b/linden/indra/lscript/lscript_execute.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2002&license=viewergpl$ * - * Copyright (c) 2002-2008, Linden Research, Inc. + * Copyright (c) 2002-2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab -- cgit v1.1