Speed is slow on LGVX6000 | developer.brewmp.com Speed is slow on LGVX6000 | developer.brewmp.com

Developer

Speed is slow on LGVX6000

Forums:

Hi,
This query is regarding Game Application. This Game is running very slow on LG VX 6000, I've tested same game app on other devices also like AudioVOX 8900 and Motorola T720 its relatively fast on other devices. In this game I am following Dirty Rectangle approch and using ConvertBitmap(..) one time and after that every where I am using IImage.
Can anyone suggest me How I can improve game speed ?

Regards,
adsac

If you are trying to maximize your display performance, your best bet is to write directly to the display buffer.
1. Get the device bitmap using IDISPLAY_GetDeviceBitmap()
2. Get the IDIB using IDISPLAY_QueryInterface(...,AEECLSID_DIB,...)
3. Write pixel values directly to the pixel buffer.

If you are trying to maximize your display performance, your best bet is to write directly to the display buffer.
1. Get the device bitmap using IDISPLAY_GetDeviceBitmap()
2. Get the IDIB using IDISPLAY_QueryInterface(...,AEECLSID_DIB,...)
3. Write pixel values directly to the pixel buffer.

The vx6000 is a dog-slow handset so in general there's not a lot you can do. Optimize your drawing, don't use any of the BREW API calls to do your blitting. Do it yourself and you should see somewhat of an improvement but you'll never get even close to the performance of the cdm-8900

The vx6000 is a dog-slow handset so in general there's not a lot you can do. Optimize your drawing, don't use any of the BREW API calls to do your blitting. Do it yourself and you should see somewhat of an improvement but you'll never get even close to the performance of the cdm-8900

What should be the TIMER VALUE for game?
Right now I am using 50 ms timer. Can I reduce it ?

What should be the TIMER VALUE for game?
Right now I am using 50 ms timer. Can I reduce it ?

No, you shouldn't. Your not even seeing the phone handle the 50ms properly as it is evidently too slow, and cranking up your timer rate will only lead to instability and mysterious handset crashes.
It doesnt' help to crank up the timer rate if the handset is not able to handle the data throughput fast enough. On a different phone you could fire your timer faster but not on the vx6000. As a matter of fact I would probably adjust it to something around 60-70 ms or so for that particular handset.

No, you shouldn't. Your not even seeing the phone handle the 50ms properly as it is evidently too slow, and cranking up your timer rate will only lead to instability and mysterious handset crashes.
It doesnt' help to crank up the timer rate if the handset is not able to handle the data throughput fast enough. On a different phone you could fire your timer faster but not on the vx6000. As a matter of fact I would probably adjust it to something around 60-70 ms or so for that particular handset.

I am having the same speed problem on LGVX6000. Could you be more specific about how to write the bilting myself? Thanks!

I am having the same speed problem on LGVX6000. Could you be more specific about how to write the bilting myself? Thanks!

Hello gdw,
here i am posting the code that some one in this group given me when started my brew programming a year back.
static boolean DB_LoadBMPFromBMPFileDDB(CDisplayBmpApp*pApp)
{
IDIB * pDib;
int cnt =0;
uint16 w= 48;
uint16 h= 48;
byte * pDataBytes;
int nSize = 0;
int nSize1 = 1;
IFile * pIFile = NULL;
IFileMgr * pIFileMgr = NULL;
FileInfo * pFileInfo = NULL;
char pImageFile[]="\\Image\\test_pic.raw";
IBitmap *pbmDev, *pbmDst;
DB_Reset(pApp);
pFileInfo = (FileInfo*)MALLOC(sizeof(FileInfo));
ISHELL_CreateInstance(pApp->a.m_pIShell, AEECLSID_FILEMGR,(void **)&pIFileMgr);
pIFile = IFILEMGR_OpenFile(pIFileMgr, pImageFile, _OFM_READ);
if (!pIFile)
{
IFILEMGR_Release(pIFileMgr);
FREE(pFileInfo);
return FALSE;
}
IFILE_GetInfo(pIFile, pFileInfo);
nSize = pFileInfo->dwSize;
FREE(pFileInfo);
pDataBytes = (byte*)MALLOC(nSize);
IFILE_Seek(pIFile, _SEEK_START, 0);
IFILE_Read(pIFile, pDataBytes, nSize);
IFILE_Release(pIFile);
IFILEMGR_Release(pIFileMgr);
IDISPLAY_GetDeviceBitmap(pApp->a.m_pIDisplay,&pbmDev);
IBITMAP_CreateCompatibleBitmap(pbmDev,&pbmDst,w,h);
IBITMAP_QueryInterface(pbmDst,AEECLSID_DIB,&pDib);
Convert24to16(pDataBytes, (uint16 *)pDib->pBmp,48 ,48);
IDISPLAY_BitBlt(pApp->a.m_pIDisplay, 0, 0, pApp->m_nScreenRect.dx, pApp->m_nScreenRect.dy, pbmDst, 0,0, AEE_RO_COPY);
IDISPLAY_Update(pApp->a.m_pIDisplay);
IDIB_Release(pDib);
IBITMAP_Release(pbmDst);
IBITMAP_Release(pbmDev);
FREE(pDataBytes);
return SUCCESS;
}
Best of luck

Hello gdw,
here i am posting the code that some one in this group given me when started my brew programming a year back.
static boolean DB_LoadBMPFromBMPFileDDB(CDisplayBmpApp*pApp)
{
IDIB * pDib;
int cnt =0;
uint16 w= 48;
uint16 h= 48;
byte * pDataBytes;
int nSize = 0;
int nSize1 = 1;
IFile * pIFile = NULL;
IFileMgr * pIFileMgr = NULL;
FileInfo * pFileInfo = NULL;
char pImageFile[]="\\Image\\test_pic.raw";
IBitmap *pbmDev, *pbmDst;
DB_Reset(pApp);
pFileInfo = (FileInfo*)MALLOC(sizeof(FileInfo));
ISHELL_CreateInstance(pApp->a.m_pIShell, AEECLSID_FILEMGR,(void **)&pIFileMgr);
pIFile = IFILEMGR_OpenFile(pIFileMgr, pImageFile, _OFM_READ);
if (!pIFile)
{
IFILEMGR_Release(pIFileMgr);
FREE(pFileInfo);
return FALSE;
}
IFILE_GetInfo(pIFile, pFileInfo);
nSize = pFileInfo->dwSize;
FREE(pFileInfo);
pDataBytes = (byte*)MALLOC(nSize);
IFILE_Seek(pIFile, _SEEK_START, 0);
IFILE_Read(pIFile, pDataBytes, nSize);
IFILE_Release(pIFile);
IFILEMGR_Release(pIFileMgr);
IDISPLAY_GetDeviceBitmap(pApp->a.m_pIDisplay,&pbmDev);
IBITMAP_CreateCompatibleBitmap(pbmDev,&pbmDst,w,h);
IBITMAP_QueryInterface(pbmDst,AEECLSID_DIB,&pDib);
Convert24to16(pDataBytes, (uint16 *)pDib->pBmp,48 ,48);
IDISPLAY_BitBlt(pApp->a.m_pIDisplay, 0, 0, pApp->m_nScreenRect.dx, pApp->m_nScreenRect.dy, pbmDst, 0,0, AEE_RO_COPY);
IDISPLAY_Update(pApp->a.m_pIDisplay);
IDIB_Release(pDib);
IBITMAP_Release(pbmDst);
IBITMAP_Release(pbmDev);
FREE(pDataBytes);
return SUCCESS;
}
Best of luck

Hello,
Here is the answers for the above qustions ....
1. In the Code the Device independent method is followed.
2. Yes it is possiable.
3. As i read a 24bit file so i havce to convert it to 16bit (it is the format that vx6000 supports) this function does this converstion.
Best of luck.

Hello,
Here is the answers for the above qustions ....
1. In the Code the Device independent method is followed.
2. Yes it is possiable.
3. As i read a 24bit file so i havce to convert it to 16bit (it is the format that vx6000 supports) this function does this converstion.
Best of luck.