* better drawBox (tnx sam_k)

* more params allowed for soundKludge opcode (8 instead of 16) will perhaps fix bugs.

svn-id: r3523
This commit is contained in:
Ludvig Strigeus 2001-12-04 10:44:33 +00:00
parent aa16d39198
commit 761fe5d7bd
7 changed files with 25 additions and 15 deletions

View file

@ -472,7 +472,7 @@ int Scumm::readSoundResource(int type, int index) {
#if defined(SAMNMAX) || defined(FULL_THROTTLE)
if (basetag == MKID('MIDI')) {
fileSeek(_fileHandle, -8, SEEK_CUR);
fileRead(_fileHandle,createResource(type, index, size+8), size+8);
fileRead(_fileHandle,createResource(type, index, total_size+8), total_size+8);
return 1;
}
#else

View file

@ -380,7 +380,7 @@ void Scumm::setResult(int value) {
void Scumm::drawBox(int x, int y, int x2, int y2, int color) {
int top,bottom,count;
VirtScreen *vs;
byte *backbuff;
byte *backbuff, *bgbuff;
if ((vs=findVirtScreen(y)) == NULL)
return;
@ -407,6 +407,12 @@ void Scumm::drawBox(int x, int y, int x2, int y2, int color) {
backbuff = getResourceAddress(rtBuffer, vs->number+1) + vs->xstart + (y-top)*320 + x;
if (color==-1) {
if(vs->number!=0)
error("can only copy bg to main window");
bgbuff = getResourceAddress(rtBuffer, vs->number+5) + vs->xstart + (y-top)*320 + x;
blit(backbuff, bgbuff, x2 - x, y2 - y);
} else {
count = y2 - y;
while (count) {
memset(backbuff, color, x2 - x);
@ -414,6 +420,7 @@ void Scumm::drawBox(int x, int y, int x2, int y2, int color) {
count--;
}
}
}
void Scumm::stopObjectCode() {

View file

@ -1830,7 +1830,7 @@ void Scumm::o6_getActorAnimCounter1() {
}
void Scumm::o6_soundKludge() {
int16 list[8];
int16 list[16];
getStackList(list,sizeof(list)/sizeof(list[0]));
soundKludge(list);
}

View file

@ -570,7 +570,7 @@ struct CharsetRenderer {
byte *_backbuff_ptr, *_bgbak_ptr;
byte *_mask_ptr;
byte *_bg_ptr2;
byte *_dest_ptr;
byte _colorMap[16];
byte _buffer[256];

View file

@ -103,7 +103,7 @@ SOURCE=.\sound\gmidi.cpp
# End Source File
# Begin Source File
SOURCE=.\imuse.cpp
SOURCE=.\sound\imuse.cpp
# End Source File
# End Group
# Begin Source File

View file

@ -117,8 +117,11 @@ void AdlibSoundDriver::init(SoundEngine *eng) {
_se = eng;
for(i=0,mc=_midi_channels; i!=ARRAYSIZE(_midi_channels);i++,mc++)
for(i=0,mc=_midi_channels; i!=ARRAYSIZE(_midi_channels);i++,mc++) {
mc->_channel = i;
mc->_s11a.s10 = &mc->_s10b;
mc->_s11b.s10 = &mc->_s10a;
}
_adlib_reg_cache = (byte*)calloc(256,1);
_opl = OPLCreate(OPL_TYPE_YM3812,3579545,22050);

View file

@ -723,7 +723,7 @@ void CharsetRenderer::printChar(int chr) {
_hasMask = true;
#endif
_bg_ptr2 = _backbuff_ptr = _vm->getResourceAddress(rtBuffer, vs->number+1)
_dest_ptr = _backbuff_ptr = _vm->getResourceAddress(rtBuffer, vs->number+1)
+ vs->xstart + _drawTop * 320 + _left;
#if !defined(OLD)
@ -731,7 +731,7 @@ void CharsetRenderer::printChar(int chr) {
#else
if (1) {
#endif
_bg_ptr2 = _bgbak_ptr = _vm->getResourceAddress(rtBuffer, vs->number+5)
_dest_ptr = _bgbak_ptr = _vm->getResourceAddress(rtBuffer, vs->number+5)
+ vs->xstart + _drawTop * 320 + _left;
}
@ -774,7 +774,7 @@ void CharsetRenderer::drawBits() {
bits = *_charPtr++;
numbits = 8;
dst = _bg_ptr2;
dst = _dest_ptr;
mask = _mask_ptr;
y = 0;
@ -801,7 +801,7 @@ void CharsetRenderer::drawBits() {
maskpos++;
}
}
dst = (_bg_ptr2 += 320);
dst = (_dest_ptr += 320);
mask += 40;
y++;
}