uint ddrawResult = IDirectDrawSurface_Lock(back, null, &backDesc, DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR, null);
if(ddrawResult == DDERR_SURFACELOST) // !display.full_screen
{
uint ddrawResult = IDirectDrawSurface_Lock(back, null, &backDesc, DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR, null);
if(ddrawResult == DDERR_SURFACELOST) // !display.full_screen
{
IDirectDrawSurface_Restore(back);
ddrawResult = IDirectDrawSurface_Lock(back, null, &backDesc, DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR, null);
}
IDirectDrawSurface_Restore(back);
ddrawResult = IDirectDrawSurface_Lock(back, null, &backDesc, DDLOCK_WAIT | DDLOCK_SURFACEMEMORYPTR, null);
}
{
bool validFormat = true;
switch(backDesc.ddpfPixelFormat.dwRGBBitCount)
{
case 8: bitmap.pixelFormat = pixelFormat8; break;
case 15: bitmap.pixelFormat = pixelFormat555; break;
{
bool validFormat = true;
switch(backDesc.ddpfPixelFormat.dwRGBBitCount)
{
case 8: bitmap.pixelFormat = pixelFormat8; break;
case 15: bitmap.pixelFormat = pixelFormat555; break;
if(backDesc.ddpfPixelFormat.dwGBitMask == 0x3E0)
bitmap.pixelFormat = pixelFormat555;
else
bitmap.pixelFormat = pixelFormat565;
break;
if(backDesc.ddpfPixelFormat.dwGBitMask == 0x3E0)
bitmap.pixelFormat = pixelFormat555;
else
bitmap.pixelFormat = pixelFormat565;
break;
for(c=0; c<256; c++)
realPalette[c] = ColorAlpha { 255, { realPalette[c].color.b, realPalette[c].color.g, realPalette[c].color.r } };
ReleaseDC(display.window,hdc);
for(c=0; c<256; c++)
realPalette[c] = ColorAlpha { 255, { realPalette[c].color.b, realPalette[c].color.g, realPalette[c].color.r } };
ReleaseDC(display.window,hdc);
(display.displaySystem.flags.fullScreen) ? (DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN) : DDSCL_NORMAL))
{
ddrawDisplay.frontDesc.dwFlags = DDSD_CAPS;
(display.displaySystem.flags.fullScreen) ? (DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN) : DDSCL_NORMAL))
{
ddrawDisplay.frontDesc.dwFlags = DDSD_CAPS;
if(ddrawDisplay.bitmap.pixelFormat == pixelFormat8)
color = ddrawDisplay.bitmap.palette[ddrawDisplay.rgbLookup[(uint16)(Color555) color]];
rgb = RGB(color.color.r, color.color.g, color.color.b);
if(ddrawDisplay.bitmap.pixelFormat == pixelFormat8)
color = ddrawDisplay.bitmap.palette[ddrawDisplay.rgbLookup[(uint16)(Color555) color]];
rgb = RGB(color.color.r, color.color.g, color.color.b);
- gdiFont.font = ((subclass(DisplayDriver))class(LFBDisplayDriver)).LoadFont(display.displaySystem,
- gdiFont.faceName, gdiFont.size, gdiFont.flags);
+ gdiFont.font = ((subclass(DisplayDriver))class(LFBDisplayDriver)).LoadFont(display.displaySystem,
+ gdiFont.faceName, gdiFont.size, gdiFont.flags);
- gdiFont.font = ((subclass(DisplayDriver))class(LFBDisplayDriver)).LoadFont(display.displaySystem,
- gdiFont.faceName, gdiFont.size, gdiFont.flags);
+ gdiFont.font = ((subclass(DisplayDriver))class(LFBDisplayDriver)).LoadFont(display.displaySystem,
+ gdiFont.faceName, gdiFont.size, gdiFont.flags);
GetTextExtentPoint32(hdc,text,realLen,&size);
if(width) *width = size.cx + (len - realLen) * space.cx;
GetTextExtentPoint32(hdc,text,realLen,&size);
if(width) *width = size.cx + (len - realLen) * space.cx;
/*if(display && display.alphaBlend)
((subclass(DisplayDriver))class(LFBDisplayDriver)).TextExtent(display, surface, text, len, width, height);
else*/
/*if(display && display.alphaBlend)
((subclass(DisplayDriver))class(LFBDisplayDriver)).TextExtent(display, surface, text, len, width, height);
else*/
{
DDrawDisplay ddrawDisplay = display ? display.driverData : null;
HDC hdc = ddrawDisplay ? ddrawDisplay.hdc : tmpDC;
{
DDrawDisplay ddrawDisplay = display ? display.driverData : null;
HDC hdc = ddrawDisplay ? ddrawDisplay.hdc : tmpDC;
// UNICODE FIX: proper space computation
if(width) *width = size.cx + (wordCount - realLen) * space.cx;
// UNICODE FIX: proper space computation
if(width) *width = size.cx + (wordCount - realLen) * space.cx;
for(realLen = 0; realLen<len && text[realLen]; realLen++);
GetTextExtentPoint32(hdc," ",1,&space);
GetTextExtentPoint32(hdc,text,realLen,&size);
if(width) *width = size.cx + (len - realLen) * space.cx;
for(realLen = 0; realLen<len && text[realLen]; realLen++);
GetTextExtentPoint32(hdc," ",1,&space);
GetTextExtentPoint32(hdc,text,realLen,&size);
if(width) *width = size.cx + (len - realLen) * space.cx;