VVETOSCL.CPP 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. ** Command & Conquer Red Alert(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /***************************************************************************
  19. ** C O N F I D E N T I A L --- W E S T W O O D A S S O C I A T E S **
  20. ***************************************************************************
  21. * *
  22. * Project Name : Testing memory. *
  23. * *
  24. * File Name : TEST.CPP *
  25. * *
  26. * Programmer : Julio Jerez *
  27. * *
  28. * Start Date : Feb 13, 1995 *
  29. * *
  30. * *
  31. *-------------------------------------------------------------------------*
  32. */
  33. #include <mcgaprim.h>
  34. #include <gbuffer.h>
  35. #include <vbuffer.h>
  36. int Vesa_Scale_To_Linear ( void * scr, void * dst,
  37. int src_x , int src_y , int dst_x , int dst_y ,
  38. int src_wd , int src_hg , int dst_wd, int dst_hg,
  39. BOOL trans , char * remap )
  40. {
  41. int area ;
  42. int width , height ;
  43. char * temp ;
  44. VideoViewPortClass * scr1 = ( VideoViewPortClass * ) scr ;
  45. width = src_wd - src_x ;
  46. height = src_hg - src_y ;
  47. area = width * height ;
  48. temp = ( char * ) malloc ( area ) ;
  49. if ( ! temp ) return 0 ;
  50. scr1 -> To_Buffer ( 0, 0, width , height , temp, area );
  51. GraphicBufferClass tempbuffer ( area , width , height , temp ) ;
  52. Linear_Scale_To_Linear ( & tempbuffer , dst ,
  53. 0 , 0 , dst_x , dst_y ,
  54. width , height , dst_wd , dst_hg ,
  55. trans , remap ) ;
  56. free ( temp ) ;
  57. return 0 ;
  58. }