- Timestamp:
- Feb 10, 2000, 1:36:11 AM (26 years ago)
- Location:
- trunk/src/gdi32
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/dibitmap.cpp
r2600 r2718 1 /* $Id: dibitmap.cpp,v 1. 2 2000-02-02 23:45:06sandervl Exp $ */1 /* $Id: dibitmap.cpp,v 1.3 2000-02-10 00:36:10 sandervl Exp $ */ 2 2 3 3 /* … … 85 85 86 86 dprintf(("GDI32: CreateDIBSection %x %x %x %x %d", hdc, iUsage, ppvBits, hSection, dwOffset)); 87 if(hSection)88 {89 dprintf(("GDI32: CreateDIBSection, hSection != NULL, not supported!"));90 return NULL;91 }92 87 93 88 //SvL: 13-9-98: StarCraft uses bitmap with negative height … … 111 106 { 112 107 char PalSize; 113 DIBSection *dsect = new DIBSection((BITMAPINFOHEADER_W *)&pbmi->bmiHeader, (char *)&pbmi->bmiColors, iUsage, (DWORD)res, fFlip); 108 DIBSection *dsect; 109 110 dsect = new DIBSection((BITMAPINFOHEADER_W *)&pbmi->bmiHeader, (char *)&pbmi->bmiColors, iUsage, hSection, dwOffset, (DWORD)res, fFlip); 114 111 115 112 if(dsect != NULL) -
trunk/src/gdi32/dibsect.cpp
r2706 r2718 1 /* $Id: dibsect.cpp,v 1.1 6 2000-02-09 23:34:30 sandervl Exp $ */1 /* $Id: dibsect.cpp,v 1.17 2000-02-10 00:36:10 sandervl Exp $ */ 2 2 3 3 /* … … 8 8 * 9 9 * Project Odin Software License can be found in LICENSE.TXT 10 * 11 * NOTE: 12 * This is not a complete solution for CreateDIBSection, but enough for Quake 2! 10 13 * 11 14 */ … … 21 24 #include <vmutex.h> 22 25 #include <winconst.h> 23 26 #include <win32wnd.h> 27 #include "oslibgpi.h" 28 29 //Win32 apis used: 24 30 HWND WIN32API WindowFromDC(HDC hdc); 25 HWND Win32ToOS2Handle(HWND hwnd); 26 27 BOOL APIENTRY _GpiEnableYInversion (HPS hps, LONG lHeight); 28 29 inline BOOL APIENTRY GpiEnableYInversion (HPS hps, LONG lHeight) 30 { 31 BOOL yyrc; 32 USHORT sel = RestoreOS2FS(); 33 34 yyrc = _GpiEnableYInversion(hps, lHeight); 35 SetFS(sel); 36 37 return yyrc; 38 } 31 BOOL WINAPI UnmapViewOfFile(LPVOID addr); 32 LPVOID WINAPI MapViewOfFile(HANDLE mapping, DWORD access, DWORD offset_high, 33 DWORD offset_low, DWORD count); 39 34 40 35 static VMutex dibMutex; 41 36 42 //NOTE: 43 //This is not a complete solution for CreateDIBSection, but enough for Quake 2! 44 //****************************************************************************** 45 //****************************************************************************** 46 DIBSection::DIBSection(BITMAPINFOHEADER_W *pbmi, char *pColors, DWORD iUsage, DWORD handle, int fFlip) 37 //****************************************************************************** 38 //****************************************************************************** 39 DIBSection::DIBSection(BITMAPINFOHEADER_W *pbmi, char *pColors, DWORD iUsage, DWORD hSection, DWORD dwOffset, DWORD handle, int fFlip) 47 40 : bmpBits(NULL), pOS2bmp(NULL), next(NULL) 48 41 { … … 82 75 } 83 76 84 bmpBits = (char *)malloc(bmpsize*pbmi->biHeight); 77 this->hSection = hSection; 78 if(hSection) { 79 bmpBits = (char *)MapViewOfFile(hSection, FILE_MAP_ALL_ACCESS_W, 0, dwOffset, bmpsize*pbmi->biHeight); 80 if(!bmpBits) { 81 dprintf(("Dibsection: mapViewOfFile %x failed!", hSection)); 82 DebugInt3(); 83 } 84 } 85 if(!bmpBits) { 86 DosAllocMem((PPVOID)&bmpBits, bmpsize*pbmi->biHeight, PAG_READ|PAG_WRITE|PAG_COMMIT); 87 } 85 88 memset(bmpBits, 0, bmpsize*pbmi->biHeight); 86 89 87 pOS2bmp 90 pOS2bmp = (BITMAPINFO2 *)malloc(os2bmpsize); 88 91 89 92 memset(pOS2bmp, /* set header + palette entries to zero */ … … 164 167 { 165 168 dprintf(("Delete DIBSection %x", handle)); 169 170 if(hSection) { 171 UnmapViewOfFile(bmpBits); 172 } 173 else 166 174 if(bmpBits) 167 free(bmpBits); 175 DosFreeMem(bmpBits); 176 168 177 if(pOS2bmp) 169 178 free(pOS2bmp); -
trunk/src/gdi32/dibsect.h
r2600 r2718 1 /* $Id: dibsect.h,v 1.1 1 2000-02-02 23:45:06sandervl Exp $ */1 /* $Id: dibsect.h,v 1.12 2000-02-10 00:36:10 sandervl Exp $ */ 2 2 3 3 /* … … 63 63 { 64 64 public: 65 DIBSection(BITMAPINFOHEADER_W *pbmi, char *pColors, DWORD iUsage, DWORD h andle, int fFlip);65 DIBSection(BITMAPINFOHEADER_W *pbmi, char *pColors, DWORD iUsage, DWORD hSection, DWORD dwOffset, DWORD handle, int fFlip); 66 66 ~DIBSection(); 67 67 … … 96 96 private: 97 97 DWORD handle, iUsage; 98 DWORD hSection; 98 99 HWND hwndParent; 99 100 HDC hdc; -
trunk/src/gdi32/gdi32.cpp
r2600 r2718 1 /* $Id: gdi32.cpp,v 1.3 8 2000-02-02 23:45:06sandervl Exp $ */1 /* $Id: gdi32.cpp,v 1.39 2000-02-10 00:36:10 sandervl Exp $ */ 2 2 3 3 /* … … 479 479 //****************************************************************************** 480 480 //****************************************************************************** 481 HDC WIN32API CreateICA( LPCSTR arg1, LPCSTR arg2, LPCSTR arg3, const DEVMODEA * arg4) 482 { 481 HDC WIN32API CreateICA(LPCSTR lpszDriver, LPCSTR lpszDevice, LPCSTR lpszOutput, 482 const DEVMODEA *lpdvmInit) 483 { 484 static char *szDisplay = "DISPLAY"; 485 483 486 dprintf(("GDI32: CreateICA")); 484 return O32_CreateIC(arg1, arg2, arg3, arg4); 487 //SvL: Open32 tests for "DISPLAY" 488 if(lpszDriver && !strcmp(lpszDriver, "display")) { 489 lpszDriver = szDisplay; 490 } 491 return O32_CreateIC(lpszDriver, lpszDevice, lpszOutput, lpdvmInit); 485 492 } 486 493 //****************************************************************************** … … 540 547 devmode.dmReserved2 = arg4->dmReserved2; 541 548 542 rc = O32_CreateIC(astring1,astring2,astring3,&devmode);549 rc = CreateICA(astring1,astring2,astring3,&devmode); 543 550 } 544 551 else 545 rc = O32_CreateIC(astring1,astring2,astring3, NULL);552 rc = CreateICA(astring1,astring2,astring3, NULL); 546 553 547 554 FreeAsciiString(astring1); -
trunk/src/gdi32/oslibgpi.h
r2484 r2718 1 /* $Id: oslibgpi.h,v 1. 3 2000-01-20 21:39:36sandervl Exp $ */1 /* $Id: oslibgpi.h,v 1.4 2000-02-10 00:36:11 sandervl Exp $ */ 2 2 3 3 /* … … 29 29 30 30 return yyrc; 31 } 32 33 BOOL APIENTRYOS2 _GpiEnableYInversion(ULONG hps, LONG lHeight); 34 35 inline BOOL GpiEnableYInversion(ULONG hps, LONG lHeight) 36 { 37 BOOL yyrc; 38 USHORT sel = RestoreOS2FS(); 39 40 yyrc = _GpiEnableYInversion(hps, lHeight); 41 SetFS(sel); 42 43 return yyrc; 31 44 } 32 45
Note:
See TracChangeset
for help on using the changeset viewer.