Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. //
  2. // void ALStorage::YieldTime()
  3. //
  4. // ARGUMENTS:
  5. //
  6. // None.
  7. //
  8. // RETURNS
  9. //
  10. // Nothing.
  11. //
  12. // DESCRIPTION
  13. //
  14. // This function has two important things to do. It gets called
  15. // at a few different points in the process of reading or writing data
  16. // from storage objects. During normal reading and writing, it
  17. // will get called every time the buffer is loaded or flushed.
  18. //
  19. // If we are in Windows mode, we execute a PeekMessage() loop. This
  20. // makes sure that we aren't hogging the CPU. By doing it this way,
  21. // the programmer can be ensure that he/she is being a good citizen
  22. // without any significant effort.
  23. //
  24. // The second important function is that of calling the monitor function.
  25. // The user interface elements need to be updated regularly, and this
  26. // is done via this call.
  27. //
  28. // REVISION HISTORY
  29. //
  30. // May 26, 1994 1.0A : First release
  31. //
  32.  
  33. void AL_PROTO ALStorage::YieldTime()
  34. {
  35. if ( mpMonitor )
  36. mpMonitor->Progress( Tell(), *this );
  37. /*
  38. * For right now I am going to put the PeekMessage loop in the load
  39. * buffer routine by default. Most Windows applications are going
  40. * to want to use this, right?
  41. */
  42. #if defined( AL_WINDOWS_GUI )
  43. MSG msg;
  44.  
  45. while ( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) ) {
  46. TranslateMessage( &msg );
  47. DispatchMessage(&msg);
  48. }
  49. #endif
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement