From 5379511d95b311de81fa8967be9ae5733030dd4b Mon Sep 17 00:00:00 2001 From: Jonas Kulla Date: Wed, 4 Mar 2015 23:34:56 +0100 Subject: [PATCH 1/4] Bitmap: Fix vertical alignment for some letters with outline --- src/bitmap.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bitmap.cpp b/src/bitmap.cpp index 7f01b4a..2a51d6f 100644 --- a/src/bitmap.cpp +++ b/src/bitmap.cpp @@ -992,6 +992,8 @@ void Bitmap::drawText(const IntRect &rect, const char *str, int align) p->ensureFormat(txtSurf, SDL_PIXELFORMAT_ABGR8888); + int rawTxtSurfH = txtSurf->h; + if (p->font->getShadow()) applyShadow(txtSurf, *p->format, c); @@ -1040,7 +1042,7 @@ void Bitmap::drawText(const IntRect &rect, const char *str, int align) if (alignX < rect.x) alignX = rect.x; - int alignY = rect.y + (rect.h - txtSurf->h) / 2; + int alignY = rect.y + (rect.h - rawTxtSurfH) / 2; float squeeze = (float) rect.w / txtSurf->w; From 8d7166f3d25a3553e3ff35db053529e81990140d Mon Sep 17 00:00:00 2001 From: Jonas Kulla Date: Mon, 16 Mar 2015 08:36:29 +0100 Subject: [PATCH 2/4] MRI: Fix Font.name returning nil I wish I had tests.. --- binding-mri/font-binding.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/binding-mri/font-binding.cpp b/binding-mri/font-binding.cpp index ec6ae14..2a8856a 100644 --- a/binding-mri/font-binding.cpp +++ b/binding-mri/font-binding.cpp @@ -152,7 +152,7 @@ RB_METHOD(FontSetName) Font *f = getPrivateData(self); char result[256]; - fontSetNameHelper(self, argc, argv, "default_name", + fontSetNameHelper(self, argc, argv, "name", result, sizeof(result)); f->setName(result); From 7260c467b8a76033f176cf0a17f17df76260aa01 Mon Sep 17 00:00:00 2001 From: Jonas Kulla Date: Sun, 22 Mar 2015 08:42:43 +0100 Subject: [PATCH 3/4] AudioStream: Clarify thread-safe usage of stream flags --- src/audiostream.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/audiostream.h b/src/audiostream.h index d968af3..3f234a0 100644 --- a/src/audiostream.h +++ b/src/audiostream.h @@ -55,7 +55,10 @@ struct AudioStream /* Note that 'extPaused' and 'noResumeStop' are * effectively only used with the AudioStream - * instance representing the BGM */ + * instance representing the BGM. + * They are not AtomicFlags because they're regarded + * as part of the underlying stream state, and + * always accessed with the stream lock held */ /* Flag indicating that the MeWatch paused this * (BGM) stream because a ME started playing. From 794e86d0ab1b68d28f194efe345ea941eab435be Mon Sep 17 00:00:00 2001 From: Jonas Kulla Date: Sun, 22 Mar 2015 09:06:29 +0100 Subject: [PATCH 4/4] AudioStream: Prevent MeWatch from restarting fully faded out stream --- src/audiostream.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/audiostream.cpp b/src/audiostream.cpp index 75f7acd..ae572ef 100644 --- a/src/audiostream.cpp +++ b/src/audiostream.cpp @@ -179,6 +179,7 @@ void AudioStream::fadeOut(int duration) lockStream(); ALStream::State sState = stream.queryState(); + noResumeStop = true; if (fade.active) {