mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-04-24 10:38:53 +00:00
Merged SWF fixes from vkDoom3
This commit is contained in:
parent
e5b3c697d2
commit
579de5008d
3 changed files with 12 additions and 14 deletions
|
@ -3,6 +3,7 @@
|
|||
|
||||
Doom 3 BFG Edition GPL Source Code
|
||||
Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 2016-2017 Dustin Land
|
||||
|
||||
This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code").
|
||||
|
||||
|
@ -89,14 +90,14 @@ idSWFScriptObject* idSWF::HitTest( idSWFSpriteInstance* spriteInstance, const sw
|
|||
else if( entry->type == SWF_DICT_SHAPE && ( parentObject != NULL ) )
|
||||
{
|
||||
idSWFShape* shape = entry->shape;
|
||||
for( int i = 0; i < shape->fillDraws.Num(); i++ )
|
||||
for( int j = 0; j < shape->fillDraws.Num(); j++ )
|
||||
{
|
||||
const idSWFShapeDrawFill& fill = shape->fillDraws[i];
|
||||
for( int j = 0; j < fill.indices.Num(); j += 3 )
|
||||
const idSWFShapeDrawFill& fill = shape->fillDraws[j];
|
||||
for( int k = 0; k < fill.indices.Num(); k += 3 )
|
||||
{
|
||||
idVec2 xy1 = renderState2.matrix.Transform( fill.startVerts[fill.indices[j + 0]] );
|
||||
idVec2 xy2 = renderState2.matrix.Transform( fill.startVerts[fill.indices[j + 1]] );
|
||||
idVec2 xy3 = renderState2.matrix.Transform( fill.startVerts[fill.indices[j + 2]] );
|
||||
idVec2 xy1 = renderState2.matrix.Transform( fill.startVerts[fill.indices[k + 0]] );
|
||||
idVec2 xy2 = renderState2.matrix.Transform( fill.startVerts[fill.indices[k + 1]] );
|
||||
idVec2 xy3 = renderState2.matrix.Transform( fill.startVerts[fill.indices[k + 2]] );
|
||||
|
||||
idMat3 edgeEquations;
|
||||
edgeEquations[0].Set( xy1.x + xOffset, xy1.y + yOffset, 1.0f );
|
||||
|
@ -162,9 +163,6 @@ idSWFScriptObject* idSWF::HitTest( idSWFSpriteInstance* spriteInstance, const sw
|
|||
idVec3 br;
|
||||
idVec3 bl;
|
||||
|
||||
float xOffset = spriteInstance->xOffset;
|
||||
float yOffset = spriteInstance->yOffset;
|
||||
|
||||
float topOffset = 0.0f;
|
||||
|
||||
if( text->align == SWF_ET_ALIGN_LEFT )
|
||||
|
@ -289,7 +287,7 @@ bool idSWF::HandleEvent( const sysEvent_t* event )
|
|||
return true;
|
||||
}
|
||||
|
||||
idSWFScriptVar var = hitObject->Get( "onDrag" );
|
||||
var = hitObject->Get( "onDrag" );
|
||||
if( var.IsFunction() )
|
||||
{
|
||||
idSWFParmList parms;
|
||||
|
|
|
@ -2316,7 +2316,7 @@ idStr idSWFScriptFunction_Script::ExportToScript( idSWFScriptObject* thisObject,
|
|||
}
|
||||
else
|
||||
{
|
||||
line = va( "function %s( ", functionName.c_str() );
|
||||
line = va( "function %s( ", functionName.c_str() );
|
||||
}
|
||||
|
||||
uint16 numParms = bitstream.ReadU16();
|
||||
|
@ -2392,7 +2392,7 @@ idStr idSWFScriptFunction_Script::ExportToScript( idSWFScriptObject* thisObject,
|
|||
}
|
||||
else
|
||||
{
|
||||
line = va( "function %s( ", functionName.c_str() );
|
||||
line = va( "function %s( ", functionName.c_str() );
|
||||
}
|
||||
|
||||
for( int i = 0; i < numParms; i++ )
|
||||
|
@ -2584,7 +2584,7 @@ idStr idSWFScriptFunction_Script::ExportToScript( idSWFScriptObject* thisObject,
|
|||
//actionScript += line;
|
||||
//line.Empty();
|
||||
|
||||
const idStr& member = stack.A().ToString();
|
||||
const idStr& member = stack.A().ToString();
|
||||
//if( stack.A().IsString() )
|
||||
//{
|
||||
// stack.B().SetResult( va( "%s[\"%s\"]", stack.B().ToString().c_str(), stack.A().ToString().c_str() ) );
|
||||
|
|
|
@ -453,7 +453,7 @@ void idSWFSprite::ReadJSON( rapidjson::Value& entry )
|
|||
|
||||
idFile_SWF file( new idFile_Memory() );
|
||||
|
||||
idBase64 base64( command["stream"].GetString() );
|
||||
idBase64 base64( command["stream"].GetString() );
|
||||
base64.Decode( file );
|
||||
|
||||
uint32 streamLength = file->Length() - 1; // skip trailing zero added by Decode()
|
||||
|
|
Loading…
Reference in a new issue