Ignore:
Timestamp:
Feb 3, 2000, 7:59:36 PM (26 years ago)
Author:
sandervl
Message:

Added MMX rgb conversion function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gdi32/blit.cpp

    r2602 r2614  
    1 /* $Id: blit.cpp,v 1.3 2000-02-03 10:23:24 dengert Exp $ */
     1/* $Id: blit.cpp,v 1.4 2000-02-03 18:59:04 sandervl Exp $ */
    22
    33/*
     
    1414#include <stdarg.h>
    1515#include <string.h>
     16#include <cpuhlp.h>
    1617#include "misc.h"
    1718#include "dibsect.h"
     19#include "rgbcvt.h"
    1820
    1921static ULONG QueryPaletteSize(BITMAPINFOHEADER *pBHdr);
     
    8688    INT result, imgsize, palsize, height, width;
    8789    char *ptr;
    88     ULONG compression = 0;
     90    ULONG compression = 0, iHeight;
    8991    WORD *newbits = 0;
    9092
     
    135137        ((BITMAPINFO *)info)->bmiHeader.biCompression = 0;
    136138        compression = BI_BITFIELDS;
    137         if(*(bitfields+1) == 0x3E0) {//RGB 555?
    138             extern void _Optlink RGB555to565 (WORD *dest, WORD *src, ULONG num);
    139 
     139        if(*(bitfields+1) == 0x3E0)
     140        {//RGB 555?
    140141                newbits = (WORD *)malloc(imgsize);
    141                 RGB555to565 (newbits, (WORD *)bits, imgsize/sizeof(WORD));
     142                if(CPUFeatures & CPUID_MMX) {
     143                        RGB555to565MMX(newbits, (WORD *)bits, imgsize/sizeof(WORD));
     144                }
     145                else    RGB555to565(newbits, (WORD *)bits, imgsize/sizeof(WORD));
    142146                bits = newbits;
    143147        }
    144148    }
    145149
    146     if(info->bmiHeader.biHeight < 0)
     150    iHeight = info->bmiHeader.biHeight;
     151    if(info->bmiHeader.biHeight < 0) {
    147152        ((BITMAPINFO *)info)->bmiHeader.biHeight = -info->bmiHeader.biHeight;
    148 
     153    }
    149154    result = O32_SetDIBitsToDevice(hdc, xDest, yDest, cx, cy, xSrc, ySrc, startscan, lines, (PVOID) bits, (PBITMAPINFO)info, coloruse);
    150155    //SvL: Wrong Open32 return value
     
    159164        if(newbits) free(newbits);
    160165    }
     166    ((BITMAPINFO *)info)->bmiHeader.biHeight = iHeight;
    161167    return result;
    162168
Note: See TracChangeset for help on using the changeset viewer.