VSCALE.CPP 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 : Scott K. Bowen *
  27. * *
  28. * Start Date : April 14, 1994 *
  29. * *
  30. * Last Update : January 18, 1995 [PWG] *
  31. * *
  32. *-------------------------------------------------------------------------*
  33. */
  34. #include <mcgaprim.h>
  35. #include <gbuffer.h>
  36. #include <vbuffer.h>
  37. //VideoBufferClass SeenPage(640,480);
  38. //GraphicBufferClass HidBuff;
  39. //GraphicBufferClass BackBuff;
  40. int Vesa_Scale_To_Vesa ( void * scr, void * dst,
  41. int src_x , int src_y , int dst_x , int dst_y ,
  42. int src_wd , int src_hg , int dst_wd, int dst_hg,
  43. BOOL trans , char * remap )
  44. {
  45. int area ;
  46. int width , height ;
  47. char * temp ;
  48. VideoViewPortClass * scr1 = ( VideoViewPortClass * ) scr ;
  49. width = src_wd - src_x ;
  50. height = src_hg - src_y ;
  51. area = width * height ;
  52. temp = ( char * ) malloc ( area ) ;
  53. if ( ! temp ) return 0 ;
  54. scr1 -> To_Buffer ( 0, 0, width , height , temp, area );
  55. GraphicBufferClass tempbuffer ( area , width , height , temp ) ;
  56. tempbuffer . Scale ( * scr1 ,
  57. 0, 0, dst_x, dst_y,
  58. width, height , dst_wd, dst_hg ,
  59. trans , remap );
  60. free ( temp ) ;
  61. return 0 ;
  62. }