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);
}
- if(!ddrawResult)
+ if(!ddrawResult)
{
bool validFormat = true;
switch(backDesc.ddpfPixelFormat.dwRGBBitCount)
{
case 8: bitmap.pixelFormat = pixelFormat8; break;
case 15: bitmap.pixelFormat = pixelFormat555; break;
- case 16:
+ case 16:
if(backDesc.ddpfPixelFormat.dwGBitMask == 0x3E0)
bitmap.pixelFormat = pixelFormat555;
else
bitmap.pixelFormat = pixelFormat565;
break;
- case 32:
+ case 32:
bitmap.pixelFormat = pixelFormat888; break;
default:
validFormat = false;
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);
-
+
// *** Reserved Palette Handling ***
if(!palette)
{
{
ddrawDisplay.frontDesc.dwSize = ddrawDisplay.backDesc.dwSize = sizeof(DDSURFACEDESC);
- if(!IDirectDraw_SetCooperativeLevel( directDraw, display.window,
+ if(!IDirectDraw_SetCooperativeLevel( directDraw, display.window,
(display.displaySystem.flags.fullScreen) ? (DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN) : DDSCL_NORMAL))
{
ddrawDisplay.frontDesc.dwFlags = DDSD_CAPS;
#ifdef USE_GDI_FONT
DDrawDisplay ddrawDisplay = display.driverData;
COLORREF rgb;
-
+
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(!gdiFont.font)
{
- 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);
}
- ((subclass(DisplayDriver))class(LFBDisplayDriver)).TextFont(display, surface, gdiFont.font);
- }
+ ((subclass(DisplayDriver))class(LFBDisplayDriver)).TextFont(display, surface, gdiFont.font);
+ }
else */
SelectObject(ddrawDisplay.hdc, font);
#else
GDIFont gdiFont = (GDIFont)surface.font;
if(!gdiFont.font)
{
- 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);
}
if(surface.textOpacity)
{
if(width) *width = 0;
if(height) *height = 0;
}
- }
+ }
/*
HDC hdc = tmpDC;
SIZE space, size;
GetTextExtentPoint32(hdc,text,realLen,&size);
if(width) *width = size.cx + (len - realLen) * space.cx;
- if(height)
+ if(height)
{
if(realLen)
*height = size.cy;
/*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;
// UNICODE FIX: proper space computation
if(width) *width = size.cx + (wordCount - realLen) * space.cx;
- if(height)
+ if(height)
{
if(realLen)
*height = size.cy;
HDC hdc = ddrawDisplay.hdc;
SIZE space, size;
uint realLen;
-
+
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;
- if(height)
+ if(height)
{
if(realLen)
*height = size.cy;