home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / iffconverter / windowscreenmaintenace.c < prev    next >
C/C++ Source or Header  |  1997-01-07  |  21KB  |  548 lines

  1. /*
  2. **     $VER: WindowScreenMaintenace.c V0.03 (21-06-95)
  3. **
  4. **     Author:  Gerben Venekamp
  5. **     Updates: 14-06-95  Version 0.01     Initial module
  6. **              21-06-95  Version 0.02     CloseThisScreen and CloseThisWindow
  7. **                                         have been added. Also CloseWindows
  8. **                                         uses CloseThisWindow now.
  9. **              21-06-95  Version 0.03     FadeColours has been moved to a
  10. **                                         new module called PaletteMaintenance.c
  11. **
  12. **  WindowScreenMaintenace.c contains the function to maintain
  13. **  screens and windows of IFFConverter.
  14. **
  15. */
  16.  
  17. #include <datatypes/pictureclass.h>
  18. #include <exec/memory.h>
  19. #include <graphics/modeid.h>
  20. #include <graphics/videocontrol.h>
  21. #include <intuition/intuition.h>
  22. #include <proto/dos.h>
  23. #include <proto/exec.h>
  24. #include <proto/gadtools.h>
  25. #include <proto/graphics.h>
  26. #include <proto/intuition.h>
  27.  
  28. #include "IFFConverter.h"
  29.  
  30.  
  31. // Define variables
  32. APTR VisualInfo = NULL;
  33.  
  34. struct Screen *ViewScreen  = NULL;
  35. struct Screen *PanelScreen = NULL;
  36. struct Window *ViewWindow  = NULL;
  37. struct Window *PanelWindow = NULL;
  38. struct Window *InfoWindow  = NULL;
  39.  
  40. char ViewScreenTitle[]  = "The View";
  41. char PanelScreenTitle[] = "The Window";
  42.  
  43. WORD PubScreenWidth;
  44. WORD PubScreenHeight;
  45.  
  46. // Tags for VideoControl
  47. ULONG VCTags[] = {
  48.    VTAG_BORDERSPRITE_SET, FALSE,
  49.    TAG_DONE
  50. };
  51.  
  52.  
  53. // Define prototypes
  54. BOOL  BuildPicture(struct Screen *, struct BitMapHeader *, APTR);
  55. void  CloseScreens(void);
  56. void  CloseThisScreen(struct Screen **);
  57. void  CloseThisWindow(struct Window **);
  58. void  CloseWindows(void);
  59. void  __asm DecompressPic(register __a0 APTR,
  60.                           register __a1 APTR,
  61.                           register __a2 APTR,
  62.                           register __a3 APTR);
  63. ULONG DisplayInfo(void);
  64. void  OpenScreens(void);
  65. void  OpenWindows(void);
  66. void  PositionScreen(struct Screen *, WORD, WORD);
  67. enum  RVSError RebuildViewScreen(struct BitMapHeader *, ULONG, APTR, APTR);
  68.  
  69.  
  70.  
  71. /*
  72. **  OpenScreens()
  73. **
  74. **     Opens two screen for you. One screen, called `The Panel', is used
  75. **     to display a panel from which you can preform all operation in
  76. **     IFFConverter. The second screen, called `The Display', is used to
  77. **     display your picture and your clipping operations. Also
  78. **     GetVisualInfo is called for `The Panel' Screen, so be sure to
  79. **     free it!
  80. **
  81. **  pre:  None.
  82. **  post: None.
  83. **
  84. */
  85. void OpenScreens()
  86. {
  87.    struct Screen *PubScreen = NULL;
  88.  
  89.    if(!(PubScreen=LockPubScreen(NULL)))  // Lock the Public Screen (Workbench).
  90.       ErrorHandler( IFFerror_NoLock, "PubScreen" );
  91.  
  92.    PubScreenWidth  = PubScreen->Width;
  93.    PubScreenHeight = PubScreen->Height;
  94.  
  95.    *((UWORD *) ColourMap) = 2;
  96.  
  97.    if(!(ViewScreen=OpenScreenTags(NULL, SA_Top, 256,
  98.                                         SA_Left, 0,
  99.                                         SA_Width, 320,
  100.                                         SA_Height, 256,
  101.                                         SA_Depth, 1,
  102.                                         SA_Title, &ViewScreenTitle,
  103.                                         SA_FullPalette, TRUE,
  104.                                         SA_Quiet, TRUE,
  105.                                         SA_AutoScroll, TRUE,
  106.                                         SA_ShowTitle, FALSE,
  107.                                         SA_Type, CUSTOMSCREEN,
  108.                                         SA_Colors32, ColourMap,
  109.                                         SA_Interleaved, TRUE,
  110.                                         SA_VideoControl, &VCTags,
  111.                                         TAG_DONE)))
  112.       ErrorHandler( IFFerror_OpenErr, "View Screen" );
  113.  
  114.    PositionScreen(ViewScreen, 0, 12);
  115.  
  116.    if(!(PanelScreen=OpenScreenTags(NULL, SA_Left, 0,
  117.                                          SA_Top, PubScreenHeight,
  118.                                          SA_Width, 640,
  119.                                          SA_Depth,2,
  120.                                          SA_Font, &System_8,
  121.                                          SA_Title, &PanelScreenTitle,
  122. //                                         SA_DetailPen,0,
  123. //                                         SA_BlockPen,1,
  124. //                                         SA_ShowTitle, FALSE,
  125.                                          SA_AutoScroll, FALSE,
  126.                                          SA_Quiet, FALSE,
  127.                                          SA_LikeWorkbench, TRUE,
  128.                                          SA_Parent, ViewScreen,
  129.                                          TAG_DONE)))
  130.       ErrorHandler( IFFerror_OpenErr, " Panel Screen" );
  131.  
  132.    PositionScreen(PanelScreen, PubScreenHeight-PanelHeight, 12);
  133.  
  134.    if(!( VisualInfo = GetVisualInfo(PanelScreen, TAG_DONE) ))
  135.       ErrorHandler( IFFerror_NoVisIErr, NULL);
  136.  
  137.    UnlockPubScreen(NULL, PubScreen);  // Free the Public Screen.
  138. }
  139.  
  140.  
  141. /*
  142. **  CloseScreens()
  143. **
  144. **     Closes all open screens and frees the VisualInfo for the
  145. **     'PanelScreen'.
  146. **     NOTE: 'CloseScreen' could use 'CloseThisScreen'. The reason why
  147. **     this is not the case, is as follows. Both screens, 'ViewScreen'
  148. **     and 'PanelScreen' needs to be scrolled down. To do so, a test
  149. **     to see whether the screens are available needs to be done.
  150. **     'CloseThisScreen' prefroms the same test. So, it's a bit silly
  151. **     to do the same test twice! 'CloseThisScreen' sets the pointer to
  152. **     a screen to NULL. Since 'CloseScreen' should only be called when
  153. **     quiting, there's no benefit to set a pointer to NULL. This pointer
  154. **     will never be used again!
  155. **
  156. **  pre:  None.
  157. **  post: None.
  158. **
  159. */
  160. void CloseScreens()
  161. {
  162.    if(VisualInfo)  FreeVisualInfo(VisualInfo);
  163.  
  164.    if(PanelScreen)
  165.    {
  166.       PositionScreen(PanelScreen, PubScreenHeight, 12);
  167.       CloseScreen(PanelScreen);
  168.    }
  169.  
  170.    if(ViewScreen)
  171.    {
  172.       PositionScreen(ViewScreen, PubScreenHeight, 12);
  173.       CloseScreen(ViewScreen);
  174.    }
  175. }
  176.  
  177.  
  178. /*
  179. **  CloseThisScreen(ScreenToClose)
  180. **
  181. **     Closes 'ScreenToClose' and marks 'ScreenToClose' as invalid (NULL).
  182. **
  183. **  pre:  ScreenToClose - Screen to be closed.
  184. **  post: ScreenToClose - NULL;
  185. **
  186. */
  187. void CloseThisScreen(struct Screen **ScreenToClose)
  188. {
  189.    if(*ScreenToClose)   //  Points 'ScreenToClose' to a screen structure?
  190.    {
  191.       CloseScreen(*ScreenToClose);   // Yes, close screen.
  192.       *ScreenToClose = NULL;         // Mark pointer as invalid.
  193.    }
  194. }
  195.  
  196.  
  197. /*
  198. **  OpenWindows()
  199. **
  200. **     Opens two windows for you. Both windows are backdrop windows.
  201. **     One window for each screen. 'ViewScreen' and 'PanelScreen' that is.
  202. **
  203. **  pre:  None.
  204. **  post: None.
  205. **
  206. */
  207. void OpenWindows()
  208. {
  209.    if(!(ViewWindow=OpenWindowTags(NULL, WA_Top, 0,
  210.                                         WA_Left, 0,
  211.                                         WA_InnerWidth, 320,
  212.                                         WA_InnerHeight, 256,
  213.                                         WA_PubScreen, ViewScreen,
  214.                                         WA_Borderless, TRUE,
  215.                                         WA_Backdrop, TRUE,
  216.                                         WA_Flags, WFLG_RMBTRAP | WFLG_REPORTMOUSE,
  217.                                         WA_IDCMP, IDCMP_MOUSEBUTTONS | IDCMP_MOUSEMOVE,
  218.                                         TAG_DONE)))
  219.       ErrorHandler( IFFerror_OpenErr, "View Window" );
  220.  
  221.    if(!(PanelWindow=OpenWindowTags(NULL, WA_Top, 0,
  222.                                          WA_Left, 0,
  223.                                          WA_InnerHeight, PanelHeight,
  224.                                          WA_InnerWidth, 640,
  225.                                          WA_PubScreen, PanelScreen,
  226.                                          WA_Title, "PanelWindow",
  227.                                          WA_Backdrop, TRUE,
  228.                                          WA_Borderless, TRUE,
  229.                                          WA_Activate, TRUE,
  230.                                          WA_Flags, WFLG_RMBTRAP | WFLG_REPORTMOUSE | WFLG_NOCAREREFRESH,
  231.                                          WA_IDCMP, BUTTONIDCMP | MXIDCMP | INTEGERIDCMP | IDCMP_MOUSEBUTTONS | IDCMP_MOUSEMOVE,
  232.                                          WA_ScreenTitle, &PanelScreenTitle,
  233.                                          WA_Gadgets, FirstGadget,
  234.                                          TAG_DONE)))
  235.       ErrorHandler( IFFerror_OpenErr, "Panel Window" );
  236.  
  237.    GT_RefreshWindow(PanelWindow, NULL);
  238. }
  239.  
  240.  
  241. /*
  242. **  CloseWindows()
  243. **
  244. **     Closes all open windows.
  245. **
  246. **  pre:  None.
  247. **  post: None.
  248. **
  249. */
  250. void CloseWindows()
  251. {
  252.    CloseThisWindow(&ViewWindow);
  253.    CloseThisWindow(&PanelWindow);
  254.    CloseThisWindow(&InfoWindow);
  255. }
  256.  
  257.  
  258. /*
  259. **  CloseThisWindow(WindowToClose)
  260. **
  261. **     Closes 'WindowToClose' and marks 'WindowToClose' as invalid (NULL).
  262. **
  263. **  pre:  WindowToClose - Window to be closed.
  264. **  post: WindowToClose - NULL;
  265. **
  266. */
  267. void CloseThisWindow(struct Window **WindowToClose)
  268. {
  269.    if(*WindowToClose)
  270.    {
  271.       CloseWindow(*WindowToClose);
  272.       *WindowToClose = NULL;
  273.    }
  274. }
  275.  
  276.  
  277. /*
  278. **  Result = RebuildViewScreen(BitMapHdr, DisplayMode, CMapData, BodyData)
  279. **
  280. **     Rebuilds your 'ViewScreen' from scratch. The way this is done,
  281. **     is as follows: As the 'PanelScreen' should be blocking all other
  282. **     screens, the 'ViewScreen' will be closed. Then a new 'ViewScreen'
  283. **     will be opend according to 'BitMapHdr', 'DisplayMode' and
  284. **     'CMapData'. The 'BodyData' will be drawn onto the 'ViewScreen'
  285. **     and the 'PanelScreen' will be moved back into its pre-defined
  286. **     position.
  287. **
  288. **  pre:  BitMapHdr - BitMapHeader structure.
  289. **        DisplayMode - ModeID
  290. **        CMapData - ILBM CMAP Chunk
  291. **        BodyData - ILBM BODY Chunk
  292. **  post: Result - RVS_Okay           if function succeeds.
  293. **                 RVS_PictureFailure if no picture could be created.
  294. **                 RVS_NoWindow       if no window could be opened.
  295. **                 RVS_BlackScreen    if no screen could be opened, but
  296. **                                    a black screen could be opened.
  297. **                 RVS_NoScreen       if no screen could be opened at all.
  298. **                 RVS_NoColourMap    if no colour map could be created.
  299. **
  300. */
  301. enum RVSError RebuildViewScreen(BitMapHdr, DisplayMode, CMapData, BodyData)
  302. struct BitMapHeader *BitMapHdr;
  303. ULONG DisplayMode;
  304. APTR CMapData, BodyData;
  305.  
  306. {
  307.    if( GetNewColourMap(CMapData, BitMapHdr->bmh_Depth) )
  308.    {
  309.       ULONG OpenScreenFailure;
  310.       ULONG DisplayModeID;
  311.       
  312.       CloseThisWindow(&ViewWindow);
  313.       CloseThisScreen(&ViewScreen);
  314.       
  315.       DisplayModeID = BestModeID(BIDTAG_SourceID, DisplayMode,
  316.                                  BIDTAG_DesiredWidth, BitMapHdr->bmh_Width,
  317.                                  BIDTAG_DesiredHeight, BitMapHdr->bmh_Height,
  318.                                  BIDTAG_Depth, BitMapHdr->bmh_Depth,
  319.                                  TAG_DONE);
  320.       
  321.       if( !(DisplayModeID == INVALID_ID) )
  322.          if( ViewScreen = OpenScreenTags(NULL, SA_Width, BitMapHdr->bmh_Width,
  323.                                                SA_Height, BitMapHdr->bmh_Height,
  324.                                                SA_Left, (BitMapHdr->bmh_PageWidth - BitMapHdr->bmh_Width) / 2,
  325.                                                SA_Depth, BitMapHdr->bmh_Depth,
  326.                                                SA_FrontChild, PanelScreen,
  327.                                                SA_DisplayID, DisplayModeID,
  328.                                                SA_Title, &ViewScreenTitle,
  329.                                                SA_ShowTitle, FALSE,
  330.                                                SA_Type, CUSTOMSCREEN,
  331.                                                SA_AutoScroll, TRUE,
  332.                                                SA_FullPalette, TRUE,
  333.                                                SA_Colors32, ColourMap,
  334.                                                SA_Interleaved, TRUE,
  335.                                                SA_VideoControl, &VCTags,
  336.                                                SA_Quiet, TRUE,
  337.                                                SA_LikeWorkbench, TRUE,
  338.                                                SA_ErrorCode, &OpenScreenFailure,
  339.                                                TAG_DONE) )
  340.                                                
  341.             if( ViewWindow = OpenWindowTags(NULL, WA_Top, 0,
  342.                                                   WA_Left, 0,
  343.                                                   WA_InnerWidth, BitMapHdr->bmh_Width,
  344.                                                   WA_InnerHeight, BitMapHdr->bmh_Height,
  345.                                                   WA_PubScreen, ViewScreen,
  346.                                                   WA_Backdrop, TRUE,
  347.                                                   WA_Borderless, TRUE,
  348.                                                   WA_Activate, TRUE,
  349.                                                   WA_Flags, WFLG_RMBTRAP | WFLG_REPORTMOUSE,
  350.                                                   WA_IDCMP, IDCMP_MOUSEBUTTONS |IDCMP_MOUSEMOVE,
  351.                                                   TAG_DONE) )
  352.                                                   
  353.                if( BuildPicture(ViewScreen, BitMapHdr, BodyData) )
  354.                   // Picture has succesfully been drawn
  355.                   return(RVS_Okay);
  356.                else
  357.                   // Some error has occoured during image drawing
  358.                   return(RVS_PictureFailure);
  359.             else
  360.                // A proper screen was opened, but a backdrop window
  361.                // could not be opened. No serious problem though.
  362.                // All we need to to is not to display the picture.
  363.                if( BuildPicture(ViewScreen, BitMapHdr, BodyData) )
  364.                   // Picture has succesfully been drawn.
  365.                   return(RVS_NoWindow_PictureOkay);
  366.                else
  367.                   // Some Error has occoured during image drawing
  368.                   return(RVS_NoWindow_PictureFailure);
  369.          else
  370.             if( !(ViewScreen = OpenScreenTags(NULL, SA_Top, 256,
  371.                                                     SA_Left, 0,
  372.                                                     SA_Width, 320,
  373.                                                     SA_Height, 256,
  374.                                                     SA_Depth, 1,
  375.                                                     SA_Title, &ViewScreenTitle,
  376.                                                     SA_FullPalette, TRUE,
  377.                                                     SA_Quiet, TRUE,
  378.                                                     SA_AutoScroll, TRUE,
  379.                                                     SA_ShowTitle, FALSE,
  380.                                                     SA_Type, CUSTOMSCREEN,
  381.                                                     SA_Colors32, ColourMap,
  382.                                                     SA_Interleaved, TRUE,
  383.                                                     SA_VideoControl, &VCTags,
  384.                                                     TAG_DONE)) )
  385.                
  386.                // Normal screen creation has failed, but a black screen
  387.                // could be opened.
  388.                return(RVS_BlackScreen);
  389.             else
  390.                // No screen could be opened. This means that the Workbench
  391.                // and/or other screens/windows become visable to the user
  392.                // when the 'PanelScreen' is moved back to its pre-defined
  393.                // position.
  394.                return(RVS_NoScreen);
  395.       else
  396.          // 'ModeID' could not be calculated. This means that it's
  397.          // impossible to open a screen which matches 'DisplayMode'.
  398.          return(RVS_NoScreen);
  399.    }
  400.    else
  401.    // No memory for a colour map could be allocated. Which means, even
  402.    // if you were able to open a screen and window, you have no palette.
  403.    // therefor it makes little sence to display a picture on such a screen.
  404.       return(RVS_NoColourMap);
  405.    
  406. }
  407.  
  408.  
  409. /*
  410. **  succes = BuildPicture(PicScreen, BitMapHdr, BodyData)
  411. **
  412. **     Draws a picture to 'Screen'
  413. **
  414. **  pre:  PicScreen - A pointer to a Screen structure on which the
  415. **                    picture has to appear.
  416. **        BitMapHdr - A pointer to a BitMapHeader structure.
  417. **        BodyData - Pointer to a ILBM BODY chunck
  418. **  post: succes - TRUE  if image has succesfully been drawn,
  419. **                 FALSE if image creation went wrong.
  420. **
  421. */
  422. BOOL BuildPicture(PicScreen, BitMapHdr, BodyData)
  423.    struct Screen *PicScreen;
  424.    struct BitMapHeader *BitMapHdr;
  425.    APTR BodyData;
  426. {
  427.    FreeThisMem(&PlanePtrs, PlanePtrsSize);
  428.    
  429.    PlanePtrsSize = (PicScreen->ViewPort.RasInfo->BitMap->Depth)<<2;
  430.    
  431.    // Allocate some memory which 'DecompressPic' can use to store
  432.    // bitplane addresses.
  433.    if( AllocThisMem(&PlanePtrs, PlanePtrsSize, MEMF_CLEAR) )
  434.    {
  435.       DecompressPic(BodyData, BitMapHdr, ViewScreen, PlanePtrs);
  436.       return TRUE;
  437.    }
  438.    else
  439.       return(FALSE);
  440. }
  441.  
  442.  
  443. /*
  444. **  PositionScreen(ScreenToMove, FinalPos, Steps):
  445. **
  446. **     Positions a screen for you.
  447. **
  448. **  pre:  ScreenToMove - Pointer to a Screen structure.
  449. **        FinalPos - Final position of the screen.
  450. **        Steps - Number of steps in which the FinalPos is reached.
  451. **  post: None.
  452. **
  453. */
  454. void PositionScreen(ScreenToMove, FinalPos, Steps)
  455.    struct Screen *ScreenToMove;
  456.    WORD FinalPos, Steps;
  457.  
  458. {
  459.    WORD NewPos, DeltaMove, i;
  460.  
  461.    DeltaMove = FinalPos - (ScreenToMove->TopEdge);
  462.  
  463.    for(i=Steps-1; i>=0; i--)
  464.    {
  465.       NewPos = (WORD) FinalPos - (DeltaMove * i / Steps);
  466.       ScreenPosition(ScreenToMove, SPOS_ABSOLUTE, 0, NewPos, 0, 0);
  467.       Delay(0);
  468.    }
  469. }
  470.  
  471.  
  472. /*
  473. **  DisplayInfo()
  474. **
  475. **     Displays a window containing information on the current picture.
  476. **     When display window is activated, it will automaticly remove itself.
  477. **
  478. **  pre:  None.
  479. **  post: None.
  480. **
  481. */
  482. ULONG DisplayInfo()
  483. {
  484.    UBYTE APen;
  485.    static struct NameInfo buffer;
  486.    ULONG DisplayModeID;
  487.    
  488.    static struct IntuiText window_IText[] = {   
  489.       {2, 0, JAM2, 108,  0, NULL, "IFF ILBM Converter",        &window_IText[ 1]},
  490.       {1, 0, JAM2,  80, 12, NULL, "© 1995 by Gerben Venekamp", &window_IText[ 2]},
  491.       {1, 0, JAM2,   0, 36, NULL, "Picture Name:",             &window_IText[ 3]},
  492.       {1, 0, JAM2, 112, 36, NULL, "No Picture Loaded",         &window_IText[ 4]},
  493.       {1, 0, JAM2,   0, 48, NULL, "Picture Dimensions:",       &window_IText[ 5]},
  494.       {1, 0, JAM2, 160, 48, NULL, "---- × ---- × -",           &window_IText[ 6]},
  495.       {1, 0, JAM2,   0, 60, NULL, "Screen Mode:",              &window_IText[ 7]},
  496.       {1, 0, JAM2, 104, 60, NULL, "Default",                   &window_IText[ 8]},
  497.       {1, 0, JAM2,   0, 72, NULL, "Colours:",                  &window_IText[ 9]},
  498.       {1, 0, JAM2,  72, 72, NULL, "---",                       &window_IText[10]},
  499.       {1, 0, JAM2,   0, 84, NULL, "Chip:",                     &window_IText[11]},
  500.       {1, 0, JAM2,  48, 84, NULL, "1234567",                   NULL}
  501.    };
  502.    
  503. //   static char *No_ViewInfo = "Not determened";
  504.    static char *GetDisFail = "GetDisplayInfo failed";
  505.    static char *GetVPFail = "GetVPModeID failed";
  506.    
  507.    MakeDecimal(AvailMem(MEMF_CHIP), window_IText[11].IText, 7);
  508.    
  509.    if( !InfoWindow )  // See if Info Window is already opened.
  510.    {
  511.       if( !(InfoWindow = OpenWindowTags(NULL, WA_Left, 140,
  512.                                               WA_Top, 18,
  513.                                               WA_Width, 360,
  514.                                               WA_Height, 108,
  515.                                               WA_IDCMP, IDCMP_ACTIVEWINDOW,
  516.                                               WA_PubScreen, PanelScreen,
  517.                                               TAG_DONE)) )
  518.       {
  519.          ErrorHandler( IFFerror_NotOpen, "Info Window" );
  520.          return(0);
  521.       }
  522.       
  523.       if( (DisplayModeID = GetVPModeID( &ViewScreen->ViewPort )) != INVALID_ID )
  524.          if( GetDisplayInfoData(NULL, (UBYTE *)&buffer, sizeof(buffer), DTAG_NAME, DisplayModeID & ~(0x800 | 0x80)) )
  525.             window_IText[7].IText = buffer.Name;
  526.          else
  527.             window_IText[7].IText = GetDisFail;
  528.       else
  529.          window_IText[7].IText = GetVPFail;
  530.  
  531.       APen = GetAPen(InfoWindow->RPort);
  532.       
  533.       SetAPen(InfoWindow->RPort, 2);
  534.       Move(InfoWindow->RPort,  10, 34);
  535.       Draw(InfoWindow->RPort, 350, 34);
  536.       SetAPen(InfoWindow->RPort, 1);
  537.       Move(InfoWindow->RPort,  11, 35);
  538.       Draw(InfoWindow->RPort, 351, 35);
  539.    
  540.       SetAPen(InfoWindow->RPort, APen);
  541.  
  542.    }
  543.       
  544.    PrintIText(InfoWindow->RPort, &window_IText[0], 12, 8);
  545.  
  546.    return( (ULONG)(1L << InfoWindow->UserPort->mp_SigBit) );
  547. }
  548.