Fixed most of the speed issues of insane
svn-id: r3833
This commit is contained in:
parent
13bf453232
commit
71be0400dc
5 changed files with 38 additions and 12 deletions
3
Makefile
3
Makefile
|
@ -15,7 +15,8 @@ OBJS = actor.o boxes.o costume.o gfx.o object.o resource.o \
|
||||||
saveload.o script.o scummvm.o sound.o string.o \
|
saveload.o script.o scummvm.o sound.o string.o \
|
||||||
sys.o verbs.o sdl.o script_v1.o script_v2.o debug.o gui.o \
|
sys.o verbs.o sdl.o script_v1.o script_v2.o debug.o gui.o \
|
||||||
sound/imuse.o sound/fmopl.o sound/adlib.o sound/gmidi.o debugrl.o \
|
sound/imuse.o sound/fmopl.o sound/adlib.o sound/gmidi.o debugrl.o \
|
||||||
akos.o vars.o insane.o gameDetector.o init.o v3/resource_v3.o v4/resource_v4.o
|
akos.o vars.o insane.o gameDetector.o init.o \
|
||||||
|
v3/resource_v3.o v4/resource_v4.o
|
||||||
|
|
||||||
DISTFILES=$(OBJS:.o=.cpp) Makefile scumm.h scummsys.h stdafx.h stdafx.cpp \
|
DISTFILES=$(OBJS:.o=.cpp) Makefile scumm.h scummsys.h stdafx.h stdafx.cpp \
|
||||||
windows.cpp debugrl.h whatsnew.txt readme.txt copying.txt \
|
windows.cpp debugrl.h whatsnew.txt readme.txt copying.txt \
|
||||||
|
|
32
insane.cpp
32
insane.cpp
|
@ -33,6 +33,8 @@ void invalidblock(uint32 tag) {
|
||||||
error("Encountered invalid block %c%c%c%c", tag>>24, tag>>16, tag>>8, tag);
|
error("Encountered invalid block %c%c%c%c", tag>>24, tag>>16, tag>>8, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int _frameChanged;
|
||||||
|
|
||||||
uint32 SmushPlayer::nextBE32() {
|
uint32 SmushPlayer::nextBE32() {
|
||||||
uint32 a = *((uint32*)_cur);
|
uint32 a = *((uint32*)_cur);
|
||||||
_cur += sizeof(uint32);
|
_cur += sizeof(uint32);
|
||||||
|
@ -354,13 +356,15 @@ void codec37_maketable(PersistentCodecData37 *pcd, int pitch, byte idx) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void codec37(CodecData *cd, PersistentCodecData37 *pcd) {
|
int codec37(CodecData *cd, PersistentCodecData37 *pcd) {
|
||||||
int width_in_blocks, height_in_blocks;
|
int width_in_blocks, height_in_blocks;
|
||||||
int src_pitch;
|
int src_pitch;
|
||||||
byte *curbuf;
|
byte *curbuf;
|
||||||
uint size;
|
uint size;
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
|
_frameChanged=1;
|
||||||
|
|
||||||
width_in_blocks = (cd->w + 3) >> 2;
|
width_in_blocks = (cd->w + 3) >> 2;
|
||||||
height_in_blocks = (cd->h + 3) >> 2;
|
height_in_blocks = (cd->h + 3) >> 2;
|
||||||
src_pitch = width_in_blocks * 4;
|
src_pitch = width_in_blocks * 4;
|
||||||
|
@ -383,7 +387,7 @@ void codec37(CodecData *cd, PersistentCodecData37 *pcd) {
|
||||||
if(size==64000)
|
if(size==64000)
|
||||||
codec37_bompdepack(curbuf, cd->src+16, size);
|
codec37_bompdepack(curbuf, cd->src+16, size);
|
||||||
else
|
else
|
||||||
return;
|
return(1);
|
||||||
|
|
||||||
memset(pcd->deltaBuf, 0, curbuf - pcd->deltaBuf);
|
memset(pcd->deltaBuf, 0, curbuf - pcd->deltaBuf);
|
||||||
memset(curbuf + size, 0, pcd->deltaBuf + pcd->deltaSize - curbuf - size);
|
memset(curbuf + size, 0, pcd->deltaBuf + pcd->deltaSize - curbuf - size);
|
||||||
|
@ -397,6 +401,7 @@ void codec37(CodecData *cd, PersistentCodecData37 *pcd) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (number&1 && cd->src[12]&1 && cd->flags&0x10) {
|
if (number&1 && cd->src[12]&1 && cd->flags&0x10) {
|
||||||
|
_frameChanged = 0;
|
||||||
result=true;
|
result=true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -415,7 +420,7 @@ void codec37(CodecData *cd, PersistentCodecData37 *pcd) {
|
||||||
case 1:
|
case 1:
|
||||||
case 4:
|
case 4:
|
||||||
warning("code %d", cd->src[0]);
|
warning("code %d", cd->src[0]);
|
||||||
return;
|
return(1);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error("codec37 default case");
|
error("codec37 default case");
|
||||||
|
@ -428,6 +433,8 @@ void codec37(CodecData *cd, PersistentCodecData37 *pcd) {
|
||||||
} else {
|
} else {
|
||||||
memcpy(cd->out, pcd->deltaBufs[pcd->curtable], 320*200);
|
memcpy(cd->out, pcd->deltaBufs[pcd->curtable], 320*200);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return(_frameChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
void codec37_init(PersistentCodecData37 *pcd, int width, int height) {
|
void codec37_init(PersistentCodecData37 *pcd, int width, int height) {
|
||||||
|
@ -461,7 +468,7 @@ void SmushPlayer::parseFOBJ() {
|
||||||
codec1(&cd);
|
codec1(&cd);
|
||||||
break;
|
break;
|
||||||
case 37:
|
case 37:
|
||||||
codec37(&cd, &pcd37);
|
_frameChanged = codec37(&cd, &pcd37);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
error("invalid codec %d", codec);
|
error("invalid codec %d", codec);
|
||||||
|
@ -599,7 +606,11 @@ void SmushPlayer::startVideo(short int arg, byte* videoFile)
|
||||||
sm->videoFinished = 0;
|
sm->videoFinished = 0;
|
||||||
sm->_insaneState = 1;
|
sm->_insaneState = 1;
|
||||||
|
|
||||||
|
sm->delta = 5;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
_frameChanged = 1;
|
||||||
|
|
||||||
if(ftell(_in)>=fileSize )
|
if(ftell(_in)>=fileSize )
|
||||||
return;
|
return;
|
||||||
#ifdef INSANE_DEBUG
|
#ifdef INSANE_DEBUG
|
||||||
|
@ -615,16 +626,23 @@ void SmushPlayer::startVideo(short int arg, byte* videoFile)
|
||||||
sm->setDirtyColors(0, 255);
|
sm->setDirtyColors(0, 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
blitToScreen(sm,sm->_videoBuffer, 0, 0, 320 ,200);
|
if ( _frameChanged)
|
||||||
updateScreen(sm);
|
{
|
||||||
|
blitToScreen(sm,sm->_videoBuffer, 0, 0, 320 ,200);
|
||||||
|
updateScreen(sm);
|
||||||
|
|
||||||
sm->delta = sm->_system->waitTick(sm->delta);
|
sm->delta = sm->_system->waitTick(sm->delta);
|
||||||
|
}
|
||||||
|
|
||||||
sm->processKbd();
|
sm->processKbd();
|
||||||
|
|
||||||
} while (!sm->videoFinished);
|
} while (!sm->videoFinished);
|
||||||
|
|
||||||
sm->_insaneState = 0;
|
sm->_insaneState = 0;
|
||||||
|
|
||||||
|
// if (sm->_lastKeyHit==sm->_vars[sm->VAR_CUTSCENEEXIT_KEY])
|
||||||
|
sm->exitCutscene();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
11
sdl.cpp
11
sdl.cpp
|
@ -953,6 +953,7 @@ int main(int argc, char* argv[]) {
|
||||||
scumm->_features = detector._features;
|
scumm->_features = detector._features;
|
||||||
scumm->_soundCardType = detector._soundCardType;
|
scumm->_soundCardType = detector._soundCardType;
|
||||||
|
|
||||||
|
scumm->delta=6;
|
||||||
|
|
||||||
scumm->_gui = &gui;
|
scumm->_gui = &gui;
|
||||||
// gui.init(scumm);
|
// gui.init(scumm);
|
||||||
|
@ -961,11 +962,9 @@ int main(int argc, char* argv[]) {
|
||||||
scumm->delta=0;
|
scumm->delta=0;
|
||||||
scumm->_system = &_system;
|
scumm->_system = &_system;
|
||||||
|
|
||||||
_system.last_time = SDL_GetTicks();
|
_system.last_time=0;
|
||||||
|
|
||||||
scumm->launch();
|
|
||||||
|
|
||||||
_system.last_time = SDL_GetTicks();
|
scumm->launch();
|
||||||
|
|
||||||
// scumm->runScript(1,0,0,&scumm->_bootParam);
|
// scumm->runScript(1,0,0,&scumm->_bootParam);
|
||||||
|
|
||||||
|
@ -2010,3 +2009,7 @@ int OSystem::waitTick(int delta)
|
||||||
|
|
||||||
return(delta);
|
return(delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OSystem::OSystem(){
|
||||||
|
last_time = SDL_GetTicks();
|
||||||
|
}
|
||||||
|
|
2
smush.h
2
smush.h
|
@ -74,4 +74,6 @@ struct SmushPlayer {
|
||||||
|
|
||||||
Scumm *sm;
|
Scumm *sm;
|
||||||
|
|
||||||
|
int _frameChanged;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
2
system.h
2
system.h
|
@ -4,4 +4,6 @@ class OSystem
|
||||||
int waitTick(int delta);
|
int waitTick(int delta);
|
||||||
int last_time;
|
int last_time;
|
||||||
int new_time;
|
int new_time;
|
||||||
|
|
||||||
|
OSystem();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue