Shape.cpp 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. //
  2. // Copyright 2020 Electronic Arts Inc.
  3. //
  4. // TiberianDawn.DLL and RedAlert.dll and corresponding source code is free
  5. // software: you can redistribute it and/or modify it under the terms of
  6. // the GNU General Public License as published by the Free Software Foundation,
  7. // either version 3 of the License, or (at your option) any later version.
  8. // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed
  9. // in the hope that it will be useful, but with permitted additional restrictions
  10. // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
  11. // distributed with this program. You should have received a copy of the
  12. // GNU General Public License along with permitted additional restrictions
  13. // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
  14. /*
  15. **
  16. ** Replacement for Shape asm files
  17. **
  18. ** ST - 12/19/2018 10:15AM
  19. **
  20. **
  21. **
  22. */
  23. extern "C" unsigned char *_ShapeBuffer = 0;
  24. extern "C" long _ShapeBufferSize = 0;
  25. /*
  26. ;***************************************************************************
  27. ;* SET_SHAPE_BUFFER -- Sets the shape buffer to the given pointer *
  28. ;* *
  29. ;* This routine will set the shape buffer to the given value and make sure *
  30. ;* that the system does not try to compress any shapes that will be larger *
  31. ;* than the shape buffer. *
  32. ;* *
  33. ;* INPUT: void * - pointer to the shape buffer *
  34. ;* int - size of the buffer which has been passed in *
  35. ;* *
  36. ;* OUTPUT: none *
  37. ;* *
  38. ;* PROTO: VOID *Set_Shape_Bufer(void *buffer, int size); *
  39. ;* *
  40. ;* HISTORY: *
  41. ;* 10/26/1994 PWG : Created. *
  42. ;*=========================================================================*
  43. */
  44. extern "C" void __cdecl Set_Shape_Buffer(void const *buffer, int size)
  45. {
  46. _ShapeBuffer = (unsigned char *)buffer;
  47. _ShapeBufferSize = size;
  48. }
  49. #if (0)
  50. global C ShapeBuffer :dword
  51. global C ShapeBufferSize :dword
  52. global C _ShapeBuffer :dword
  53. global C _ShapeBufferSize :dword
  54. global C Set_Shape_Buffer :near
  55. DATASEG
  56. label ShapeBuffer dword
  57. _ShapeBuffer dd 0
  58. label ShapeBufferSize dword
  59. _ShapeBufferSize dd 0
  60. CODESEG
  61. ;***************************************************************************
  62. ;* SET_SHAPE_BUFFER -- Sets the shape buffer to the given pointer *
  63. ;* *
  64. ;* This routine will set the shape buffer to the given value and make sure *
  65. ;* that the system does not try to compress any shapes that will be larger *
  66. ;* than the shape buffer. *
  67. ;* *
  68. ;* INPUT: void * - pointer to the shape buffer *
  69. ;* int - size of the buffer which has been passed in *
  70. ;* *
  71. ;* OUTPUT: none *
  72. ;* *
  73. ;* PROTO: VOID *Set_Shape_Bufer(void *buffer, int size); *
  74. ;* *
  75. ;* HISTORY: *
  76. ;* 10/26/1994 PWG : Created. *
  77. ;*=========================================================================*
  78. GLOBAL C Set_Shape_Buffer:NEAR
  79. PROC Set_Shape_Buffer C near
  80. USES eax
  81. ARG buff:DWORD
  82. ARG size:DWORD
  83. mov eax,[size]
  84. mov [_ShapeBufferSize],eax
  85. mov eax,[buff]
  86. mov [_ShapeBuffer],eax
  87. ret
  88. ENDP Set_Shape_Buffer
  89. END
  90. #endif