Skip to content
This repository was archived by the owner on Sep 7, 2021. It is now read-only.

Commit 605803b

Browse files
committed
Merge branch 'release-6.0.2'
2 parents 2788772 + 8c145a8 commit 605803b

8 files changed

Lines changed: 47 additions & 29 deletions

File tree

engine/src/cmds.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,9 +1179,9 @@ Exec_stat MCQuit::exec(MCExecPoint &ep)
11791179
default:
11801180
return ES_NORMAL;
11811181
}
1182-
#ifndef TARGET_SUBPLATFORM_ANDROID
1182+
// IM-2013-05-01: [[ BZ 10586 ]] remove #ifdefs so this message is sent
1183+
// here on Android in the same place as (almost) everything else
11831184
MCdefaultstackptr->getcard()->message(MCM_shut_down);
1184-
#endif
11851185
#endif
11861186
if (retcode != NULL && retcode->eval(ep) == ES_NORMAL
11871187
&& ep.ton() == ES_NORMAL)

engine/src/cmdsf.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,12 @@ Exec_stat MCExport::exec(MCExecPoint &ep)
823823
return ES_ERROR;
824824
}
825825
}
826-
826+
827+
// MW-2013-05-20: [[ Bug 10897 ]] Object snapshot returns a premultipled
828+
// bitmap, which needs to be processed before compression. This flag
829+
// indicates to do this processing later on in the method.
830+
bool t_needs_unpremultiply;
831+
t_needs_unpremultiply = false;
827832
if (sformat == EX_SNAPSHOT)
828833
{
829834
char *srect = NULL;
@@ -921,6 +926,10 @@ Exec_stat MCExport::exec(MCExecPoint &ep)
921926
MCeerror -> add(EE_EXPORT_EMPTYRECT, line, pos);
922927
return ES_ERROR;
923928
}
929+
930+
// MW-2013-05-20: [[ Bug 10897 ]] The 'snapshot' command produces a premultiplied bitmap
931+
// so mark it to be unpremultiplied for later on.
932+
t_needs_unpremultiply = true;
924933
}
925934
else
926935
{
@@ -1011,6 +1020,9 @@ Exec_stat MCExport::exec(MCExecPoint &ep)
10111020
else
10121021
{
10131022
/* UNCHECKED */ MCImageBitmapCreateWithOldBitmap(t_img, t_bitmap);
1023+
// MW-2013-05-20: [[ Bug 10897 ]] Make sure we unpremultiply if needed.
1024+
if (t_needs_unpremultiply)
1025+
MCImageBitmapUnpremultiply(t_bitmap);
10141026
MCImageBitmapCheckTransparency(t_bitmap);
10151027
MCscreen->destroyimage(t_img);
10161028
t_dither = !MCtemplateimage->getflag(F_DONT_DITHER);

engine/src/fieldhtml.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ static const char *s_export_html_tag_strings[] =
114114
"b",
115115
"strike",
116116
"u",
117-
"super",
117+
"sup",
118118
"sub",
119119
"condensed",
120120
"expanded",

engine/src/mblandroiddc.cpp

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,10 @@ static void *mobile_main(void *arg)
960960
{
961961
MCLog("X_init failed", 0);
962962

963+
// IM-2013-05-01: [[ BZ 10586 ]] signal java ui thread to exit
964+
// finish LiveCodeActivity
965+
MCAndroidEngineRemoteCall("finishActivity", "v", nil);
966+
963967
// Yield for now as we don't detect error states correctly.
964968
co_yield_to_android();
965969

@@ -1001,16 +1005,17 @@ static void *mobile_main(void *arg)
10011005
}
10021006

10031007
MCLog("Shutting down project", 0);
1004-
MCexitall = False;
1005-
MCdefaultstackptr->getcard()->message(MCM_shut_down);
1006-
MCQuit();
1007-
1008-
while(s_engine_running)
1009-
X_main_loop_iteration();
1010-
1008+
10111009
MCLog("Calling X_close", 0);
10121010
X_close();
10131011

1012+
// IM-2013-05-01: [[ BZ 10586 ]] signal java ui thread
1013+
// and wait for it to exit
1014+
MCAndroidEngineRemoteCall("finishActivity", "v", nil);
1015+
1016+
while (s_engine_running)
1017+
co_yield_to_android();
1018+
10141019
// Free argument.
10151020
MCCStringFree(t_args[0]);
10161021

@@ -1555,11 +1560,10 @@ JNIEXPORT void JNICALL Java_com_runrev_android_Engine_doDestroy(JNIEnv *env, job
15551560

15561561
s_engine_running = false;
15571562

1558-
// Set the global exit vars appropriately and yield to the engine thread
1559-
// which should heed them and exit.
1563+
// IM-2013-05-01: [[ BZ 10586 ]] we should now only be called when the
1564+
// engine thread is about to exit, so set s_engine_running to false & yield
1565+
// so it can finish terminating
15601566
MCLog("Yielding to engine thread to perform finalization phase", 0);
1561-
MCquit = True;
1562-
MCexitall = True;
15631567
co_yield_to_engine();
15641568

15651569
// Finalize bitmap mutex

engine/src/mblandroidmisc.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,17 @@ extern int32_t g_android_keyboard_type;
5252

5353
void MCQuit(void)
5454
{
55+
// IM-2013-05-01: [[ BZ 10586 ]] send shutdown message when closing due
56+
// to unhandled backKey message
57+
if (MCdefaultstackptr != nil)
58+
MCdefaultstackptr->getcard()->message(MCM_shut_down);
5559
MCquit = True;
5660
MCexitall = True;
5761
MCtracestackptr = NULL;
5862
MCtraceabort = True;
5963
MCtracereturn = True;
60-
61-
// finish LiveCodeActivity
62-
MCLog("finishActivity() called", nil);
63-
MCAndroidEngineRemoteCall("finishActivity", "v", nil);
64+
// IM-2013-05-01: [[ BZ 10586 ]] No longer call finishActivity from here,
65+
// instead wait for main loop to terminate in mobile_main()
6466
}
6567

6668
class MCMessageEvent : public MCCustomEvent

engine/src/object.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3923,7 +3923,8 @@ static void compute_objectshape_mask(MCObject *p_object, MCObjectShape& p_shape,
39233923
// What we setup depends on whether the mask is depth 1 or 8 and the threshold.
39243924
// If the threshold is not 1, we use soft bits if they are available.
39253925
r_mask . fill = compute_objectshapescanline_soft;
3926-
r_mask . bits = p_shape . mask . bits -> data + t_obj_rect . y * p_shape . mask . bits -> stride + t_obj_rect . x;
3926+
// IM-2013-05-10: fix wrong bit pointer offset due to adding stride (in bytes) to data (4-byte word pointer)
3927+
r_mask . bits = (uint8_t*)p_shape . mask . bits -> data + t_obj_rect . y * p_shape . mask . bits -> stride + t_obj_rect . x * sizeof(uint32_t);
39273928
r_mask . stride = p_shape . mask . bits -> stride;
39283929
r_mask . offset = 0;
39293930

@@ -4043,7 +4044,8 @@ bool MCObject::intersects(MCObject *p_other, uint32_t p_threshold)
40434044

40444045
// Now check for overlap!
40454046
t_intersects = false;
4046-
for(int32_t y = 0; y < t_rect . height; y++)
4047+
// IM-2013-05-10: optimize - exit from outer loop if intersect found
4048+
for(int32_t y = 0; !t_intersects && y < t_rect . height; y++)
40474049
{
40484050
// Fill the scanline for this.
40494051
if (t_this_mask . fill != nil)
@@ -4060,12 +4062,8 @@ bool MCObject::intersects(MCObject *p_other, uint32_t p_threshold)
40604062
}
40614063

40624064
// Check to see if they intersect.
4063-
for(int32_t x = 0; x < t_scanline_width; x++)
4064-
if ((t_this_scanline[x] & t_other_scanline[x]) != 0)
4065-
{
4066-
t_intersects = true;
4067-
break;
4068-
}
4065+
for(int32_t x = 0; !t_intersects && x < t_scanline_width; x++)
4066+
t_intersects = (t_this_scanline[x] & t_other_scanline[x]) != 0;
40694067
}
40704068

40714069
// Scanlines aren't needed anymore.

engine/src/paragraf.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,9 @@ void MCParagraph::draw(MCDC *dc, int2 x, int2 y, uint2 fixeda,
10851085

10861086
// MW-2012-02-10: [[ FixedTable ]] If we have reached the final tab in fixed
10871087
// table mode, we are done.
1088-
if (ct == nt - 2 && t[nt - 2] == t[nt - 1])
1088+
// MW-2013-05-20: [[ Bug 10878 ]] Tweaked conditions to work for min two tabStops
1089+
// rather than 3.
1090+
if (ct >= nt - 2 && t[nt - 2] == t[nt - 1])
10891091
break;
10901092
}
10911093
}

ide

Submodule ide updated from 23c4ea2 to 116999b

0 commit comments

Comments
 (0)