[Scummvm-cvs-logs] scummvm master -> 51d7405a7b741b8028b83e1548b3b8260230c5a1
zeldin
marcus at mc.pp.se
Fri Jan 10 16:24:36 CET 2014
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
62828f86a1 DC: Workaround for usleep prototype mismatch
66ad9e76ee DC: Silenced some stupid warnings
51d7405a7b GRAPHICS: Fix computation of addA in darkenFill()
Commit: 62828f86a14994b1be503abc141f5eb73857530c
https://github.com/scummvm/scummvm/commit/62828f86a14994b1be503abc141f5eb73857530c
Author: Marcus Comstedt (marcus at mc.pp.se)
Date: 2014-01-10T06:56:51-08:00
Commit Message:
DC: Workaround for usleep prototype mismatch
Changed paths:
backends/platform/dc/dc-fs.cpp
diff --git a/backends/platform/dc/dc-fs.cpp b/backends/platform/dc/dc-fs.cpp
index 36f5a14..f850c9d 100644
--- a/backends/platform/dc/dc-fs.cpp
+++ b/backends/platform/dc/dc-fs.cpp
@@ -27,7 +27,9 @@
#include <ronin/cdfs.h>
#include <stdio.h>
+#define usleep usleep_unistd
#include <unistd.h>
+#undef usleep
/**
* Implementation of the ScummVM file system API based on Ronin.
Commit: 66ad9e76eeda77f2ca4d10db82cfd31dba38d127
https://github.com/scummvm/scummvm/commit/66ad9e76eeda77f2ca4d10db82cfd31dba38d127
Author: Marcus Comstedt (marcus at mc.pp.se)
Date: 2014-01-10T06:56:52-08:00
Commit Message:
DC: Silenced some stupid warnings
Changed paths:
backends/platform/dc/dc.h
backends/platform/dc/dcmain.cpp
backends/platform/dc/icon.cpp
backends/platform/dc/input.cpp
backends/platform/dc/softkbd.h
diff --git a/backends/platform/dc/dc.h b/backends/platform/dc/dc.h
index d62ced0..ba60c77 100644
--- a/backends/platform/dc/dc.h
+++ b/backends/platform/dc/dc.h
@@ -43,7 +43,9 @@ class Interactive
public:
virtual int key(int k, byte &shiftFlags) = 0;
virtual void mouse(int x, int y) = 0;
+ virtual ~Interactive() = 0;
};
+inline Interactive::~Interactive() { }
#include "softkbd.h"
diff --git a/backends/platform/dc/dcmain.cpp b/backends/platform/dc/dcmain.cpp
index bec1fda..36a22c4 100644
--- a/backends/platform/dc/dcmain.cpp
+++ b/backends/platform/dc/dcmain.cpp
@@ -79,13 +79,14 @@ static bool find_track(int track, int &first_sec, int &last_sec)
if (first < 1 || last > 99 || first > last)
return false;
for (i=first; i<=last; i++)
- if (!(TOC_CTRL(toc->entry[i-1])&4))
+ if (!(TOC_CTRL(toc->entry[i-1])&4)) {
if (track==1) {
first_sec = TOC_LBA(toc->entry[i-1]);
last_sec = TOC_LBA(toc->entry[i]);
return true;
} else
--track;
+ }
return false;
}
@@ -281,7 +282,7 @@ namespace DC_Flash {
if((r = syscall_read_flash(info[0] + (bmb++ << 6), bm, 64))<0)
return r;
}
- if(!(bm[(b>>3)&63] & (0x80>>(b&7))))
+ if(!(bm[(b>>3)&63] & (0x80>>(b&7)))) {
if((r = syscall_read_flash(info[0] + ((b+1) << 6), buf, 64))<0)
return r;
else if((s=*(unsigned short *)(buf+0)) == sec &&
@@ -289,6 +290,7 @@ namespace DC_Flash {
memcpy(dst+(s-sec)*60, buf+2, 60);
got=1;
}
+ }
}
return got;
}
diff --git a/backends/platform/dc/icon.cpp b/backends/platform/dc/icon.cpp
index cf7afc8..28edf27 100644
--- a/backends/platform/dc/icon.cpp
+++ b/backends/platform/dc/icon.cpp
@@ -47,8 +47,8 @@ void Icon::create_vmicon(void *buffer)
void Icon::create_texture()
{
- static char tt[16] = { 0, 1, 4, 5, 16, 17, 20, 21,
- 64, 65, 68, 69, 80, 81, 84, 85 };
+ static unsigned char tt[16] = { 0, 1, 4, 5, 16, 17, 20, 21,
+ 64, 65, 68, 69, 80, 81, 84, 85 };
unsigned short *tex = (unsigned short *)ta_txalloc(512);
unsigned short *linebase;
unsigned char *src = bitmap+sizeof(bitmap)-17;
diff --git a/backends/platform/dc/input.cpp b/backends/platform/dc/input.cpp
index 7b21c76..5c6adf6 100644
--- a/backends/platform/dc/input.cpp
+++ b/backends/platform/dc/input.cpp
@@ -50,10 +50,10 @@ int handleInput(struct mapledev *pad, int &mouse_x, int &mouse_y,
else if (!(buttons & 512)) newkey = ' ';
else if (!(buttons & 1024)) newkey = numpadmap[(buttons>>4)&15];
- if (!(buttons & 128)) if (inter) newkey = 1001; else mouse_x++;
- if (!(buttons & 64)) if (inter) newkey = 1002; else mouse_x--;
- if (!(buttons & 32)) if (inter) newkey = 1003; else mouse_y++;
- if (!(buttons & 16)) if (inter) newkey = 1004; else mouse_y--;
+ if (!(buttons & 128)) { if (inter) newkey = 1001; else mouse_x++; }
+ if (!(buttons & 64)) { if (inter) newkey = 1002; else mouse_x--; }
+ if (!(buttons & 32)) { if (inter) newkey = 1003; else mouse_y++; }
+ if (!(buttons & 16)) { if (inter) newkey = 1004; else mouse_y--; }
mouse_x += ((int)pad->cond.controller.joyx-128)>>4;
mouse_y += ((int)pad->cond.controller.joyy-128)>>4;
@@ -157,7 +157,7 @@ int handleInput(struct mapledev *pad, int &mouse_x, int &mouse_y,
return -Common::EVENT_RBUTTONUP;
}
- if (mouse_wheel != lastwheel)
+ if (mouse_wheel != lastwheel) {
if (((int8)(mouse_wheel - lastwheel)) > 0) {
lastwheel++;
return -Common::EVENT_WHEELDOWN;
@@ -165,6 +165,7 @@ int handleInput(struct mapledev *pad, int &mouse_x, int &mouse_y,
--lastwheel;
return -Common::EVENT_WHEELUP;
}
+ }
if (newkey && inter && newkey != lastkey) {
int transkey = inter->key(newkey, shiftFlags);
diff --git a/backends/platform/dc/softkbd.h b/backends/platform/dc/softkbd.h
index 8f87d12..27826c2 100644
--- a/backends/platform/dc/softkbd.h
+++ b/backends/platform/dc/softkbd.h
@@ -40,6 +40,7 @@ class SoftKeyboard : public Interactive
public:
SoftKeyboard(const OSystem_Dreamcast *os);
+ virtual ~SoftKeyboard() {}
void draw(float x, float y, int transp = 0);
int key(int k, byte &shiftFlags);
Commit: 51d7405a7b741b8028b83e1548b3b8260230c5a1
https://github.com/scummvm/scummvm/commit/51d7405a7b741b8028b83e1548b3b8260230c5a1
Author: Marcus Comstedt (marcus at mc.pp.se)
Date: 2014-01-10T06:56:53-08:00
Commit Message:
GRAPHICS: Fix computation of addA in darkenFill()
The old computation had rounding issues, causing alpha to leak into
the red (usually) component. There's a much easier way to compute it
that does not lead to such problems: What should really happen is that
the two top bits of the A component should be set to 1 (thus adding
75% alpha). So compute it that way for speed and precision.
Changed paths:
graphics/VectorRendererSpec.cpp
diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp
index ce04db8..de249e8 100644
--- a/graphics/VectorRendererSpec.cpp
+++ b/graphics/VectorRendererSpec.cpp
@@ -691,8 +691,7 @@ darkenFill(PixelType *ptr, PixelType *end) {
// assuming at least 3 alpha bits
mask |= 3 << _format.aShift;
- PixelType addA = (PixelType)(255 >> _format.aLoss) << _format.aShift;
- addA -= (addA >> 2);
+ PixelType addA = (PixelType)(3 << (_format.aShift + 6 - _format.aLoss));
while (ptr != end) {
// Darken the colour, and increase the alpha
More information about the Scummvm-git-logs
mailing list