Skip to content

Commit

Permalink
( ) -> () in neo/swf/
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertBeckebans committed Oct 19, 2024
1 parent e5a9bd1 commit 0480cd9
Show file tree
Hide file tree
Showing 13 changed files with 220 additions and 220 deletions.
158 changes: 79 additions & 79 deletions neo/swf/SWF_Abc.cpp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion neo/swf/SWF_Bitstream.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class idSWFBitStream
T result = 0;
for( int i = 0; i < 5; i++ )
{
byte b = ReadU8( );
byte b = ReadU8();
result |= ( b & 0x7F ) << ( 7 * i );
if( ( b & 0x80 ) == 0 )
{
Expand Down
2 changes: 1 addition & 1 deletion neo/swf/SWF_Dictionary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ idSWFDictionaryEntry::idSWFDictionaryEntry() :
imageSize( 0, 0 ),
imageAtlasOffset( 0, 0 ),
channelScale( 1.0f, 1.0f, 1.0f, 1.0f ),
scriptClass( ),
scriptClass(),
resolved( false ),
name( NULL )
{
Expand Down
10 changes: 5 additions & 5 deletions neo/swf/SWF_EventDispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ SWF_EVENTDISPATCHER_NATIVE_VAR_DEFINE_GET( MouseEvent )
static idSWFScriptObject* mouseEventObj = nullptr;
if( mouseEventObj == nullptr )
{
mouseEventObj = idSWFScriptObject::Alloc( );
idSWFScriptObject* eventParms = idSWFScriptObject::Alloc( );
mouseEventObj = idSWFScriptObject::Alloc();
idSWFScriptObject* eventParms = idSWFScriptObject::Alloc();

eventParms->Set( "type", "MouseEvent" );
mouseEventObj->Set( "[MouseEvent]", eventParms );
Expand Down Expand Up @@ -95,8 +95,8 @@ SWF_EVENTDISPATCHER_NATIVE_VAR_DEFINE_GET( Event )
static idSWFScriptObject* eventObj = nullptr;
if( eventObj == nullptr )
{
eventObj = idSWFScriptObject::Alloc( );
idSWFScriptObject* eventParms = idSWFScriptObject::Alloc( );
eventObj = idSWFScriptObject::Alloc();
idSWFScriptObject* eventParms = idSWFScriptObject::Alloc();

eventParms->Set( "type", "Event" );
eventObj->Set( "[Event]", eventParms );
Expand Down Expand Up @@ -176,7 +176,7 @@ SWF_EVENTDISPATCHER_FUNCTION_DEFINE( addEventListener )
dispatcher->value.GetObject()->Set( parms[0].ToString(), parms[1] );
common->DPrintf( "{%s} AddEventListener(%s,%s)\n", thisObject->GetSprite()->name.c_str(), parms[0].ToString().c_str(), parms[1].ToString().c_str() );
//add listener
return idSWFScriptVar( );
return idSWFScriptVar();
}


2 changes: 1 addition & 1 deletion neo/swf/SWF_EventDispatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ If you have questions concerning this license or the applicable additional terms
class idSWFScriptObject_EventDispatcherPrototype : public idSWFScriptObject
{
public:
idSWFScriptObject_EventDispatcherPrototype( );
idSWFScriptObject_EventDispatcherPrototype();
#define SWF_EVENTDISPATCHER_FUNCTION_DECLARE( x ) \
class idSWFScriptFunction_##x : public idSWFScriptFunction { \
public: \
Expand Down
110 changes: 55 additions & 55 deletions neo/swf/SWF_Events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ idSWFScriptObject* GetMouseEventDispatcher( idSWFScriptObject* object )
idSWFScriptObject* dispatcher = nullptr;
if( object->HasValidProperty( "__eventDispatcher__" ) )
{
dispatcher = object->Get( "__eventDispatcher__" ).GetObject( );
dispatcher = object->Get( "__eventDispatcher__" ).GetObject();
if( dispatcher->HasValidProperty( "click" )
|| dispatcher->HasValidProperty( "contextMenu" )
|| dispatcher->HasValidProperty( "doubleClick" )
Expand Down Expand Up @@ -327,34 +327,34 @@ bool idSWF::HandleEvent( const sysEvent_t* event )

if( !eventDispatcher.IsUndefined() && !var.IsFunction() )
{
var = eventDispatcher.GetObject( )->Get( "click" );
if( !var.IsFunction( ) )
var = eventDispatcher.GetObject()->Get( "click" );
if( !var.IsFunction() )
{
var = eventDispatcher.GetObject( )->Get( "mouseDown" );
var = eventDispatcher.GetObject()->Get( "mouseDown" );
}
}
if( var.IsFunction( ) )
if( var.IsFunction() )
{
idSWFScriptVar eventArg;
auto* eventObj = globals->Get( "EventDispatcher" ).GetObject( )
->Get( "MouseEvent" ).GetObject( )
->Get( "[MouseEvent]" ).GetObject( );
eventArg.SetObject( idSWFScriptObject::Alloc( ) );
eventArg.GetObject( )->DeepCopy( eventObj );
auto* eventObj = globals->Get( "EventDispatcher" ).GetObject()
->Get( "MouseEvent" ).GetObject()
->Get( "[MouseEvent]" ).GetObject();
eventArg.SetObject( idSWFScriptObject::Alloc() );
eventArg.GetObject()->DeepCopy( eventObj );
idSWFParmList parms;
parms.Append( eventArg );
parms.Append( event->inputDevice );
if( !( ( idSWFScriptFunction_Script* ) var.GetFunction( ) )->GetScope( )->Num( ) )
if( !( ( idSWFScriptFunction_Script* ) var.GetFunction() )->GetScope()->Num() )
{
( ( idSWFScriptFunction_Script* ) var.GetFunction( ) )->GetScope( )->Append( globals );
( ( idSWFScriptFunction_Script* ) var.GetFunction() )->GetScope()->Append( globals );
}
var.GetFunction( )->Call( hitObject, parms );
parms.Clear( );
var.GetFunction()->Call( hitObject, parms );
parms.Clear();
return true;
}

var = hitObject->Get( "onPress" );
if( var.IsFunction( ) )
if( var.IsFunction() )
{
idSWFParmList parms;
parms.Append( event->inputDevice );
Expand Down Expand Up @@ -387,27 +387,27 @@ bool idSWF::HandleEvent( const sysEvent_t* event )
{
eventDispatcher = mouseObject->Get( "__eventDispatcher__" );

if( !eventDispatcher.IsUndefined( ) && !var.IsFunction( ) )
if( !eventDispatcher.IsUndefined() && !var.IsFunction() )
{
var = eventDispatcher.GetObject( )->Get( "mouseUp" );
var = eventDispatcher.GetObject()->Get( "mouseUp" );
}
if( var.IsFunction( ) )
if( var.IsFunction() )
{
idSWFScriptVar eventArg;
auto* eventObj = globals->Get( "EventDispatcher" ).GetObject( )
->Get( "MouseEvent" ).GetObject( )
->Get( "[MouseEvent]" ).GetObject( );
eventArg.SetObject( idSWFScriptObject::Alloc( ) );
eventArg.GetObject( )->DeepCopy( eventObj );
auto* eventObj = globals->Get( "EventDispatcher" ).GetObject()
->Get( "MouseEvent" ).GetObject()
->Get( "[MouseEvent]" ).GetObject();
eventArg.SetObject( idSWFScriptObject::Alloc() );
eventArg.GetObject()->DeepCopy( eventObj );
idSWFParmList parms;
parms.Append( eventArg );
if( !( ( idSWFScriptFunction_Script* ) var.GetFunction( ) )->GetScope( )->Num( ) )
if( !( ( idSWFScriptFunction_Script* ) var.GetFunction() )->GetScope()->Num() )
{
( ( idSWFScriptFunction_Script* ) var.GetFunction( ) )->GetScope( )->Append( globals );
( ( idSWFScriptFunction_Script* ) var.GetFunction() )->GetScope()->Append( globals );
}
var.GetFunction( )->Call( mouseObject, parms );
parms.Clear( );
mouseObject->Release( );
var.GetFunction()->Call( mouseObject, parms );
parms.Clear();
mouseObject->Release();
mouseObject = NULL;
return true;
}
Expand Down Expand Up @@ -608,31 +608,31 @@ bool idSWF::HandleEvent( const sysEvent_t* event )
idSWFScriptVar var = hoverObject->Get( "onRollOut" );

eventDispatcher = hoverObject->Get( "__eventDispatcher__" );
if( !eventDispatcher.IsUndefined( ) && !var.IsFunction( ) )
if( !eventDispatcher.IsUndefined() && !var.IsFunction() )
{
var = eventDispatcher.GetObject( )->Get( "mouseOut" );
if( var.IsFunction( ) )
var = eventDispatcher.GetObject()->Get( "mouseOut" );
if( var.IsFunction() )
{
idSWFScriptVar eventArg;
auto* eventObj = globals->Get( "EventDispatcher" ).GetObject( )
->Get( "MouseEvent" ).GetObject( )
->Get( "[MouseEvent]" ).GetObject( );
eventArg.SetObject( idSWFScriptObject::Alloc( ) );
eventArg.GetObject( )->DeepCopy( eventObj );
auto* eventObj = globals->Get( "EventDispatcher" ).GetObject()
->Get( "MouseEvent" ).GetObject()
->Get( "[MouseEvent]" ).GetObject();
eventArg.SetObject( idSWFScriptObject::Alloc() );
eventArg.GetObject()->DeepCopy( eventObj );
idSWFParmList parms;
parms.Append( eventArg );
if( !( ( idSWFScriptFunction_Script* ) var.GetFunction( ) )->GetScope( )->Num( ) )
if( !( ( idSWFScriptFunction_Script* ) var.GetFunction() )->GetScope()->Num() )
{
( ( idSWFScriptFunction_Script* ) var.GetFunction( ) )->GetScope( )->Append( globals );
( ( idSWFScriptFunction_Script* ) var.GetFunction() )->GetScope()->Append( globals );
}
var.GetFunction( )->Call( hoverObject, parms );
parms.Clear( );
var.GetFunction()->Call( hoverObject, parms );
parms.Clear();
retVal = true;
}
}
else if( var.IsFunction( ) )
else if( var.IsFunction() )
{
var.GetFunction( )->Call( hoverObject, idSWFParmList( ) );
var.GetFunction()->Call( hoverObject, idSWFParmList() );
retVal = true;
}
hoverObject->Release();
Expand All @@ -646,31 +646,31 @@ bool idSWF::HandleEvent( const sysEvent_t* event )
idSWFScriptVar var = hitObject->Get( "onRollOver" );

eventDispatcher = hoverObject->Get( "__eventDispatcher__" );
if( !eventDispatcher.IsUndefined( ) && !var.IsFunction( ) )
if( !eventDispatcher.IsUndefined() && !var.IsFunction() )
{
var = eventDispatcher.GetObject( )->Get( "mouseOver" );
var = eventDispatcher.GetObject()->Get( "mouseOver" );
if( var.IsFunction() )
{
idSWFScriptVar eventArg;
auto* eventObj = globals->Get( "EventDispatcher" ).GetObject( )
->Get( "MouseEvent" ).GetObject( )
->Get( "[MouseEvent]" ).GetObject( );
eventArg.SetObject( idSWFScriptObject::Alloc( ) );
eventArg.GetObject( )->DeepCopy( eventObj );
auto* eventObj = globals->Get( "EventDispatcher" ).GetObject()
->Get( "MouseEvent" ).GetObject()
->Get( "[MouseEvent]" ).GetObject();
eventArg.SetObject( idSWFScriptObject::Alloc() );
eventArg.GetObject()->DeepCopy( eventObj );
idSWFParmList parms;
parms.Append( eventArg );
if( !( ( idSWFScriptFunction_Script* ) var.GetFunction( ) )->GetScope( )->Num( ) )
if( !( ( idSWFScriptFunction_Script* ) var.GetFunction() )->GetScope()->Num() )
{
( ( idSWFScriptFunction_Script* ) var.GetFunction( ) )->GetScope( )->Append( globals );
( ( idSWFScriptFunction_Script* ) var.GetFunction() )->GetScope()->Append( globals );
}
var.GetFunction( )->Call( hoverObject, parms );
parms.Clear( );
var.GetFunction()->Call( hoverObject, parms );
parms.Clear();
retVal = true;
}
}
else if( var.IsFunction( ) )
else if( var.IsFunction() )
{
var.GetFunction( )->Call( hitObject, idSWFParmList( ) );
var.GetFunction()->Call( hitObject, idSWFParmList() );
retVal = true;
}
}
Expand Down
Loading

0 comments on commit 0480cd9

Please sign in to comment.