Advertisement
fastman92

GTA SA ScreenScale.txt

Dec 1st, 2011
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 1.28 KB | None | 0 0
  1. :GetXYSizeInScreen4x3ScaleBy640x480
  2. {
  3.  Description:
  4.     Uses 4:3 ratio and 640 x 480 scale and returns XY size according to user screen.
  5.  Type: PROPERTY
  6.  
  7.  Parameters:
  8.    Passed:
  9.      0@ - X size (0.0 to 640.0)
  10.      1@ - Y size (0.0 to 480.0)
  11.    Result:
  12.      none
  13.  
  14.  Example:
  15.   0AB1: call_scm_func @GetXYSizeInScreen4x3ScaleBy640x480 2 XSize 320.0 YSize 240.0 store_XSize 5@ store_YSize 6@
  16. }  
  17. 0AB1: call_scm_func @GetCurrentResolution 0 X_size 2@ Y_size 3@
  18. 0093: 2@ = integer 2@ to_float
  19. 0093: 3@ = integer 3@ to_float
  20.  
  21. 3@ *= 1.33333333    // 4/3
  22. 0073: 2@ /= 3@ // (float)
  23.  
  24. 0073: 0@ /= 2@ // (float)
  25. 1@ /= 1.07142857        // 480/448
  26. 0AB2: ret 2 XSize 0@ YSize 1@
  27.  
  28. :GetXYSizeInScreenScaleByUserResolution
  29. {
  30.  Description:
  31.     Uses 4:3 ratio and 640 x 480 scale and returns XY size according to user screen.
  32.  Type: PROPERTY
  33.  
  34.  Parameters:
  35.    Passed:
  36.      0@ - X size
  37.      1@ - Y size
  38.    Result:
  39.      none
  40.  
  41.  Example:
  42.   0AB1: call_scm_func @GetXYSizeInScreenScaleByUserResolution 2 XSizePixels 320.0 YSizePixels 240.0
  43. }
  44. 0AB1: call_scm_func @GetCurrentResolution 0 X_size 2@ Y_size 3@
  45. 0093: 2@ = integer 2@ to_float
  46. 0093: 3@ = integer 3@ to_float
  47.  
  48. 2@ /= 640.0
  49. 0073: 0@ /= 2@ // (float)
  50.  
  51. 3@ /= 448.0
  52. 0073: 1@ /= 3@ // (float)
  53. 0AB2: ret 2 XSize 0@ YSize 1@
  54.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement