mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-10 04:31:34 -10:00
Sync with the right branch this time!
This commit is contained in:
1 parent
0fede5f475
commit
a3508be54a
28 files changed
+288
-1732
No files matched your search
+17
-8
@@ -8446,12 +8446,21 @@ ADE_FUNC(drawTargetingBrackets, l_Graphics, "object Object, [boolean draw=true,
|
||||
int x1,x2,y1,y2;
|
||||
int bound_rc, pof;
|
||||
int modelnum;
|
||||
bool entered_frame = false;
|
||||
if ( !(g3_in_frame( ) > 0 ) )
|
||||
{
|
||||
g3_start_frame( 0 );
|
||||
entered_frame = true;
|
||||
}
|
||||
|
||||
|
||||
switch ( targetp->type ) {
|
||||
case OBJ_SHIP:
|
||||
modelnum = Ship_info[Ships[targetp->instance].ship_info_index].model_num;
|
||||
bound_rc = model_find_2d_bound_min( modelnum, &targetp->orient, &targetp->pos,&x1,&y1,&x2,&y2 );
|
||||
if ( bound_rc != 0 ) {
|
||||
if ( entered_frame )
|
||||
g3_end_frame( );
|
||||
return ADE_RETURN_NIL;
|
||||
}
|
||||
break;
|
||||
@@ -8459,6 +8468,8 @@ ADE_FUNC(drawTargetingBrackets, l_Graphics, "object Object, [boolean draw=true,
|
||||
modelnum = Debris[targetp->instance].model_num;
|
||||
bound_rc = submodel_find_2d_bound_min( modelnum, Debris[targetp->instance].submodel_num, &targetp->orient, &targetp->pos,&x1,&y1,&x2,&y2 );
|
||||
if ( bound_rc != 0 ) {
|
||||
if ( entered_frame )
|
||||
g3_end_frame( );
|
||||
return ADE_RETURN_NIL;
|
||||
}
|
||||
break;
|
||||
@@ -8479,6 +8490,8 @@ ADE_FUNC(drawTargetingBrackets, l_Graphics, "object Object, [boolean draw=true,
|
||||
default:
|
||||
// should never happen
|
||||
Int3();
|
||||
if ( entered_frame )
|
||||
g3_end_frame( );
|
||||
return ADE_RETURN_NIL;
|
||||
}
|
||||
|
||||
@@ -8487,16 +8500,12 @@ ADE_FUNC(drawTargetingBrackets, l_Graphics, "object Object, [boolean draw=true,
|
||||
y1 -= padding;
|
||||
y2 += padding;
|
||||
if ( draw_box ) {
|
||||
if( !(g3_in_frame() > 0) ) {
|
||||
g3_start_frame(0);
|
||||
draw_brackets_square(x1, y1, x2, y2, false);
|
||||
g3_end_frame();
|
||||
}
|
||||
else {
|
||||
draw_brackets_square(x1, y1, x2, y2, false);
|
||||
}
|
||||
draw_brackets_square(x1, y1, x2, y2, false);
|
||||
}
|
||||
|
||||
if ( entered_frame )
|
||||
g3_end_frame( );
|
||||
|
||||
return ade_set_args(L, "iiii", x1, y1, x2, y2);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user