Changeset 522 for trunk/src/ddraw/OS2SURFACE.CPP
- Timestamp:
- Aug 17, 1999, 2:44:46 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/ddraw/OS2SURFACE.CPP
r503 r522 13 13 #include "asmutil.h" 14 14 #include <winerror.h> 15 #include <odincrt.h>16 15 17 16 #ifndef __WATCOMC__ … … 994 993 pFillPos = pLine + dwPitchDB; 995 994 996 #ifndef USE_ASM997 ODIN_FS_BEGIN998 #endif999 995 for( y=0;y<FillHeight;y++,pFillPos+=dwPitchDB) 1000 996 { … … 1008 1004 #endif 1009 1005 } 1010 #ifndef USE_ASM1011 ODIN_FS_END1012 #endif1013 1006 1014 1007 return(DD_OK); … … 1234 1227 { 1235 1228 DDRectangle *pItem = (DDRectangle*) lpItem; 1236 ODIN_delete(pItem);1229 delete(pItem); 1237 1230 return 1; 1238 1231 } … … 1252 1245 OS2IDirectDrawSurface *AttachedSurface; 1253 1246 1254 ODIN_FS_BEGIN1255 1247 1256 1248 if(DDSurfaceDesc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) … … 1328 1320 1329 1321 lpDraw->Vtbl.Release(lpDraw); 1330 1331 ODIN_FS_END1332 1322 1333 1323 } … … 1420 1410 if(me->Referenced == 0) 1421 1411 { 1422 ODIN_delete( me);1412 delete( me); 1423 1413 #ifndef __WATCOMC__ 1424 1414 //_interrupt(3); … … 1482 1472 if(me->DDSurfaceDesc.ddsCaps.dwCaps & DDSCAPS_MIPMAP) 1483 1473 { 1484 ODIN_FS_BEGIN1485 1474 rc = DPA_InsertPtr( me->DPA_SurfaceMipMaps, 1486 1475 DPA_GetPtrCount(me->DPA_SurfaceMipMaps), 1487 1476 AttachedSurface); 1488 ODIN_FS_END1489 1477 1490 1478 if( rc>=0) … … 1513 1501 else 1514 1502 { 1515 ODIN_FS_BEGIN1516 1503 rc = DPA_InsertPtr( me->DPA_SurfaceAttached, 1517 1504 DPA_GetPtrCount(me->DPA_SurfaceAttached), 1518 1505 AttachedSurface); 1519 ODIN_FS_END1520 1506 1521 1507 if(rc>=0) … … 1711 1697 #endif 1712 1698 1713 ODIN_FS_BEGIN1714 1699 1715 1700 if (NULL!=lpDestRect) … … 1760 1745 WriteLog("Blt: Dest Surface partly locked\n"); 1761 1746 #endif 1762 {ODIN_FS_END1763 1747 return(DDERR_SURFACEBUSY); 1764 1748 } 1765 1749 } 1766 1767 ODIN_FS_END1768 1750 1769 1751 DestSurfaceDesc.dwSize = sizeof(DDSURFACEDESC2); … … 1853 1835 } 1854 1836 1855 ODIN_FS_BEGIN1856 1857 1837 if (NULL!=lpSrcRect) 1858 1838 { … … 1903 1883 WriteLog("Blt: Src Surface partly locked\n"); 1904 1884 #endif 1905 {ODIN_FS_END1906 1885 return(DDERR_SURFACEBUSY); 1907 1886 } 1908 1887 } 1909 1910 ODIN_FS_END1911 1888 1912 1889 if( ( (NULL==lpDestRect) && (NULL!=lpSrcRect) ) || … … 1991 1968 #else 1992 1969 // Solid Blit 1993 ODIN_FS_BEGIN1994 1970 while(1) 1995 1971 { … … 2000 1976 break; 2001 1977 } 2002 ODIN_FS_END2003 1978 #endif 2004 1979 } … … 2055 2030 #else 2056 2031 // Solid Blit 2057 ODIN_FS_BEGIN2058 2032 while(1) 2059 2033 { … … 2064 2038 break; 2065 2039 } 2066 ODIN_FS_END2067 2040 #endif 2068 2041 } … … 2128 2101 #else 2129 2102 // Solid Blit 2130 ODIN_FS_BEGIN2131 2103 while(1) 2132 2104 { … … 2137 2109 break; 2138 2110 } 2139 ODIN_FS_END2140 2111 #endif 2141 2112 } … … 2577 2548 } 2578 2549 2579 ODIN_FS_BEGIN2580 2581 2550 if (NULL!=lpSrcRect) 2582 2551 { … … 2879 2848 dest->lpVtbl->ChangeUniquenessValue(dest); 2880 2849 2881 ODIN_FS_END2882 2850 2883 2851 return(DD_OK); … … 3000 2968 } 3001 2969 3002 ODIN_FS_BEGIN3003 2970 3004 2971 if ( (!Found) && (AttachedSurface->DDSurfaceDesc.ddsCaps.dwCaps & DDSCAPS_MIPMAP ) ) … … 3040 3007 } 3041 3008 3042 ODIN_FS_END3043 3009 3044 3010 return(Found?DD_OK:DDERR_SURFACENOTATTACHED); … … 3076 3042 if(me->BackBuffer != NULL) 3077 3043 { 3078 ODIN_FS_BEGIN 3079 memcpy(&EnumDesc,&(me->DDSurfaceDesc),sizeof(DDSURFACEDESC2)); 3080 ODIN_FS_END 3044 memcpy(&EnumDesc,&(me->DDSurfaceDesc),sizeof(DDSURFACEDESC2)); 3081 3045 rc = lpCallBack((LPDIRECTDRAWSURFACE4)me->BackBuffer,&EnumDesc,lpContext); 3082 3046 } 3083 3047 3084 ODIN_FS_BEGIN 3085 count = DPA_GetPtrCount(me->DPA_SurfaceMipMaps); 3086 ODIN_FS_END 3048 count = DPA_GetPtrCount(me->DPA_SurfaceMipMaps); 3087 3049 3088 3050 if(count>0) … … 3091 3053 while( (DDENUMRET_OK == rc) && i<count ) 3092 3054 { 3093 ODIN_FS_BEGIN3094 3055 EnumSurface = (OS2IDirectDrawSurface*) DPA_FastGetPtr(me->DPA_SurfaceMipMaps,i); 3095 3056 memcpy( &EnumDesc, 3096 3057 &(EnumSurface->DDSurfaceDesc), 3097 3058 sizeof(DDSURFACEDESC2)); 3098 ODIN_FS_END3099 3059 // Calling back into WIN32 app so we had to reset FS 3100 3060 rc = lpCallBack((LPDIRECTDRAWSURFACE4)EnumSurface,&EnumDesc,lpContext); … … 3103 3063 } 3104 3064 3105 ODIN_FS_BEGIN 3106 count = DPA_GetPtrCount(me->DPA_SurfaceAttached); 3107 ODIN_FS_END 3065 count = DPA_GetPtrCount(me->DPA_SurfaceAttached); 3108 3066 3109 3067 if(count>0) … … 3112 3070 while( (DDENUMRET_OK == rc) && i<count ) 3113 3071 { 3114 ODIN_FS_BEGIN 3115 EnumSurface = (OS2IDirectDrawSurface*) DPA_FastGetPtr(me->DPA_SurfaceAttached,i); 3116 memcpy( &EnumDesc, 3117 &(EnumSurface->DDSurfaceDesc), 3118 sizeof(DDSURFACEDESC2)); 3119 ODIN_FS_END 3072 EnumSurface = (OS2IDirectDrawSurface*) DPA_FastGetPtr(me->DPA_SurfaceAttached,i); 3073 memcpy( &EnumDesc, 3074 &(EnumSurface->DDSurfaceDesc), 3075 sizeof(DDSURFACEDESC2)); 3120 3076 rc = lpCallBack((LPDIRECTDRAWSURFACE4)EnumSurface,&EnumDesc,lpContext); 3121 3077 i++; … … 3305 3261 } 3306 3262 3307 ODIN_FS_BEGIN3308 3263 3309 3264 rc = DD_OK; … … 3367 3322 } 3368 3323 3369 ODIN_FS_END3370 3324 3371 3325 return rc; … … 3410 3364 return(DDERR_INVALIDPARAMS); 3411 3365 3412 ODIN_FS_BEGIN 3413 memcpy(lpDDCaps, &(me->DDSurfaceDesc.ddsCaps), sizeof(DDSCAPS2) ); 3414 ODIN_FS_END 3366 memcpy(lpDDCaps, &(me->DDSurfaceDesc.ddsCaps), sizeof(DDSCAPS2) ); 3415 3367 3416 3368 return(DD_OK); … … 3455 3407 if(DDCKEY_SRCBLT & dwFlags) 3456 3408 { 3457 ODIN_FS_BEGIN 3458 memcpy(lpDDColKey,&(me->DDSurfaceDesc.ddckCKSrcBlt),sizeof(DDCOLORKEY) ); 3459 ODIN_FS_END 3409 memcpy(lpDDColKey,&(me->DDSurfaceDesc.ddckCKSrcBlt),sizeof(DDCOLORKEY) ); 3460 3410 } 3461 3411 else … … 3493 3443 return(DDERR_DCALREADYCREATED); 3494 3444 } 3495 3496 ODIN_FS_BEGIN3497 3445 3498 3446 rc = DD_OK; … … 3641 3589 } 3642 3590 3643 ODIN_FS_END3644 3645 3591 return rc; 3646 3592 } … … 3717 3663 return DDERR_INVALIDPARAMS; 3718 3664 3719 ODIN_FS_BEGIN 3720 memcpy( (char*)lpPixelFormat, 3721 (char*)&(me->DDSurfaceDesc.ddpfPixelFormat), 3722 sizeof(DDPIXELFORMAT)); 3723 ODIN_FS_END 3724 3665 memcpy( (char*)lpPixelFormat, 3666 (char*)&(me->DDSurfaceDesc.ddpfPixelFormat), 3667 sizeof(DDPIXELFORMAT)); 3725 3668 3726 3669 return(DD_OK); … … 3739 3682 return(DDERR_INVALIDPARAMS); 3740 3683 3741 ODIN_FS_BEGIN 3742 memcpy( (char *)lpSurface, 3743 (char *)&me->DDSurfaceDesc, 3744 sizeof(DDSURFACEDESC)); 3745 ODIN_FS_END 3684 memcpy( (char *)lpSurface, 3685 (char *)&me->DDSurfaceDesc, 3686 sizeof(DDSURFACEDESC)); 3746 3687 3747 3688 return(DD_OK); … … 3760 3701 return(DDERR_INVALIDPARAMS); 3761 3702 3762 ODIN_FS_BEGIN 3763 memcpy( (char *)lpSurface, 3764 (char *)&me->DDSurfaceDesc, 3765 sizeof(DDSURFACEDESC2)); 3766 ODIN_FS_END 3703 memcpy( (char *)lpSurface, 3704 (char *)&me->DDSurfaceDesc, 3705 sizeof(DDSURFACEDESC2)); 3767 3706 3768 3707 return(DD_OK); … … 3832 3771 if (DD_OK==rc) 3833 3772 { 3834 ODIN_FS_BEGIN 3835 memcpy( (char*)lpSurfaceDesc, 3836 (char*)&SurfaceDesc4, 3837 sizeof(DDSURFACEDESC) ); 3838 ODIN_FS_END 3773 memcpy( (char*)lpSurfaceDesc, 3774 (char*)&SurfaceDesc4, 3775 sizeof(DDSURFACEDESC) ); 3839 3776 } 3840 3777 … … 3869 3806 return DDERR_INVALIDPARAMS; 3870 3807 3871 ODIN_FS_BEGIN3872 3808 3873 3809 if (NULL!=lpRect) … … 3958 3894 } 3959 3895 3960 ODIN_FS_END3961 3896 3962 3897 return rc; … … 3980 3915 if(hdc != me->hdcImage) 3981 3916 return(DDERR_INVALIDOBJECT); 3982 3983 ODIN_FS_BEGIN3984 3917 3985 3918 //unselect our bitmap … … 4029 3962 me->dwLastDCUnique = me->dwUniqueValue; // Store this to see if the surface was locked after we released the DC 4030 3963 4031 ODIN_FS_END4032 4033 3964 return(DD_OK); 4034 3965 } … … 4097 4028 return(DDERR_UNSUPPORTED); 4098 4029 4099 ODIN_FS_BEGIN4100 4101 4030 if(DDCKEY_SRCBLT & dwFlags) 4102 4031 { … … 4118 4047 else 4119 4048 rc = DDERR_INVALIDPARAMS; // some other flags where set => error 4120 4121 ODIN_FS_END4122 4049 4123 4050 return rc; … … 4230 4157 return(DDERR_NOTLOCKED); 4231 4158 } 4232 4233 ODIN_FS_BEGIN4234 4159 4235 4160 #ifdef DEBUG … … 4377 4302 } 4378 4303 4379 ODIN_FS_END4380 4381 4304 return rc; 4382 4305 } … … 4411 4334 } 4412 4335 4413 ODIN_FS_BEGIN4414 4415 4336 if(NULL!=lpSurfaceRect) 4416 4337 { … … 4508 4429 } 4509 4430 4510 ODIN_FS_END4511 4512 4431 return rc; 4513 4432 } … … 4611 4530 return DDERR_INVALIDSURFACETYPE; // only work for system alloced surfaces 4612 4531 4613 ODIN_FS_BEGIN4614 4615 4532 if (!me->Updated) 4616 4533 { … … 4622 4539 me->lpVtbl->ChangeUniquenessValue(me); 4623 4540 memcpy((char *)&(me->DDSurfaceDesc), (char *)lpSurfDesc, sizeof(DDSURFACEDESC)); 4624 4625 ODIN_FS_END4626 4541 4627 4542 return DD_OK; … … 4646 4561 return DDERR_INVALIDSURFACETYPE; // only work for system alloced surfaces 4647 4562 4648 ODIN_FS_BEGIN4649 4650 4563 if (!me->Updated) 4651 4564 { … … 4657 4570 me->lpVtbl->ChangeUniquenessValue(me); 4658 4571 memcpy((char *)&(me->DDSurfaceDesc), (char *)lpSurfDesc, sizeof(DDSURFACEDESC2)); 4659 4660 ODIN_FS_END4661 4572 4662 4573 return DD_OK; … … 4686 4597 (dwFlags & ~(DDSPD_IUNKNOWNPOINTER|DDSPD_VOLATILE))) 4687 4598 return(DDERR_INVALIDPARAMS); 4688 4689 ODIN_FS_BEGIN4690 4599 4691 4600 // first check if the refGUID is stored as then the content will be updated … … 4849 4758 } 4850 4759 4851 ODIN_FS_END4852 4853 4760 return rc; 4854 4761 } … … 4873 4780 return(DDERR_INVALIDPARAMS); 4874 4781 4875 ODIN_FS_BEGIN4876 4877 4782 if(DPA_GetPtrCount(me->DPA_SurfacePrivateData)>0) 4878 4783 { … … 4913 4818 rc = DDERR_NOTFOUND; 4914 4819 4915 ODIN_FS_END4916 4820 4917 4821 return rc; … … 4932 4836 if(NULL==me) 4933 4837 return(DDERR_INVALIDOBJECT); 4934 4935 ODIN_FS_BEGIN4936 4838 4937 4839 if(DPA_GetPtrCount(me->DPA_SurfacePrivateData)>0) … … 4967 4869 } 4968 4870 4969 ODIN_FS_END4970 4971 4871 return (bFound?DD_OK:DDERR_NOTFOUND); 4972 4872 } … … 4993 4893 PSURFPRIVATEDATA pSData; 4994 4894 4995 ODIN_FS_BEGIN4996 4895 4997 4896 #ifdef DEBUG … … 5026 4925 } 5027 4926 5028 ODIN_FS_END5029 5030 4927 return (DD_OK); 5031 4928 } … … 5043 4940 int BlitWidth,BlitHeight; 5044 4941 static char Scanline[6400]; // sufficient for 1600 at 32 bit 5045 5046 ODIN_FS_BEGIN5047 4942 5048 4943 // Bridge, we may got a problem ;) … … 5107 5002 } 5108 5003 5109 ODIN_FS_END5110 5004 } 5111 5005
Note:
See TracChangeset
for help on using the changeset viewer.