Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / darkvideo avi ImageColorKey support?

Author
Message
ffd21
1
Years of Service
User Offline
Joined: 4th Dec 2015
Location:
Posted: 10th Dec 2015 03:45
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 30 );
dbSetWindowLayout(0,0,0);
dbSetWindowPosition( 0,0 );
dbSetDisplayMode(768, 768, 32);

DarkVideoInitialize();
dbAutoCamOff();
dbBackdropOff();

dbColorBackdrop( dbRGB( 0, 0, 0 ) );
dbSetImageColorKey ( 0, 0, 0 ); <----------------------------not support?
int movieId = DarkVideoOpen( "s.dvf" );
int movieWidth = DarkVideoGetWidth( movieId );
int movieHeight = DarkVideoGetHeight( movieId );

DarkVideoSetVolume( movieId, 255 );
dbLoadImage ("startback.jpg", 100 );
dbSprite ( 100, 0, 0, 100 );
dbSetSpritePriority ( 100, 1 );

int memBlockId = 32;
int imageId = 32;

dbMakeMemblock( memBlockId, movieWidth * movieHeight * 4 + 12 );
dbWriteMemblockDword( memBlockId, 0, movieWidth );
dbWriteMemblockDword( memBlockId, 4, movieHeight );
dbWriteMemblockDword( memBlockId, 8, 32 );
dbMakeImageFromMemblock( imageId, memBlockId );
// dbMakeBitmapFromMemblock(imageId, memBlockId ); <---------------------------- error?
dbDeleteMemblock( memBlockId );

int ux[8] = {0,200,400,600,0,200,400,600};
int AP[8] = {10,50,100, 128, 150,180,200,230};
for ( int p = 1; p <= 8; p++ )
{
if(p > 4){
dbSprite(p, 330, ux[p-1], imageId);
dbSetSprite(p, 1, 1);
}else{
dbSprite(p, 00, ux[p-1], imageId);
dbSetSprite(p, 0, 1);
}
dbScaleSprite ( p, 50 );
dbSetSpriteAlpha(p, AP[p-1]);
dbSetSpritePriority ( p, p+10 );
}

dbSetObjectLight( 1, 0 );
dbPositionCamera( 0, 0, -700 );
dbRotateCamera( 0, 0, 0 );
float a = 0.0f;
DarkVideoPlay( movieId, imageId, true, dbGetImagePointer );

while ( LoopGDK ( ) )
{
dbCLS(RGB(0,0,0));
dbSync ( );
}

// stop and shutdown DarkVIDEO movie.
DarkVideoStop( movieId );
DarkVideoClose( movieId );

// shutdown DarkVIDEO.
DarkVideoShutdown();

// and now everything is ready to return back to Windows.
return;
}
Morcilla
14
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 11th Dec 2015 12:43
Try using other file format like .bmp instead of .jpg to see if that solves the problem.

Also note that PNG, TGA and DDS images will only use transparency alpha information from the image itself and cannot be overridden with setting colorkey.

Login to post a reply

Server time is: 2017-11-24 22:08:05
Your offset time is: 2017-11-24 22:08:05