CnC_Remastered_Collection

Command and Conquer: Red Alert
Log | Files | Refs | README | LICENSE

Shape.cpp (4162B)


      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 
      9 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed 
     10 // in the hope that it will be useful, but with permitted additional restrictions 
     11 // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT 
     12 // distributed with this program. You should have received a copy of the 
     13 // GNU General Public License along with permitted additional restrictions 
     14 // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
     15 
     16 
     17 /*
     18 ** 
     19 **  Replacement for Shape asm files
     20 ** 
     21 **  ST - 12/19/2018 10:15AM
     22 ** 
     23 ** 
     24 ** 
     25 */
     26 
     27 
     28 extern "C" unsigned char *_ShapeBuffer = 0;
     29 extern "C" long _ShapeBufferSize = 0;
     30 
     31 		
     32 
     33 /*
     34 ;***************************************************************************
     35 ;* SET_SHAPE_BUFFER -- Sets the shape buffer to the given pointer          *
     36 ;*                                                                         *
     37 ;* This routine will set the shape buffer to the given value and make sure *
     38 ;* that the system does not try to compress any shapes that will be larger *
     39 ;* than the shape buffer.						   *
     40 ;*                                                                         *
     41 ;* INPUT:	void * - pointer to the shape buffer                       *
     42 ;*		int    - size of the buffer which has been passed in	   *
     43 ;*                                                                         *
     44 ;* OUTPUT:      none                                                       *
     45 ;*                                                                         *
     46 ;* PROTO:       VOID *Set_Shape_Bufer(void *buffer, int size);		   *
     47 ;*                                                                         *
     48 ;* HISTORY:                                                                *
     49 ;*   10/26/1994 PWG : Created.                                             *
     50 ;*=========================================================================*
     51 */ 
     52 extern "C" void __cdecl Set_Shape_Buffer(void const *buffer, int size)
     53 {
     54 	_ShapeBuffer = (unsigned char *)buffer;
     55 	_ShapeBufferSize = size;
     56 }
     57 
     58 
     59 
     60 #if (0)
     61 global	C ShapeBuffer		:dword
     62 global	C ShapeBufferSize	:dword
     63 global	C _ShapeBuffer		:dword
     64 global	C _ShapeBufferSize	:dword
     65 global	C Set_Shape_Buffer	:near
     66 
     67 DATASEG
     68 label	ShapeBuffer	dword
     69 _ShapeBuffer		dd	0
     70 
     71 label	ShapeBufferSize	dword
     72 _ShapeBufferSize	dd	0
     73 
     74 CODESEG
     75 
     76 ;***************************************************************************
     77 ;* SET_SHAPE_BUFFER -- Sets the shape buffer to the given pointer          *
     78 ;*                                                                         *
     79 ;* This routine will set the shape buffer to the given value and make sure *
     80 ;* that the system does not try to compress any shapes that will be larger *
     81 ;* than the shape buffer.						   *
     82 ;*                                                                         *
     83 ;* INPUT:	void * - pointer to the shape buffer                       *
     84 ;*		int    - size of the buffer which has been passed in	   *
     85 ;*                                                                         *
     86 ;* OUTPUT:      none                                                       *
     87 ;*                                                                         *
     88 ;* PROTO:       VOID *Set_Shape_Bufer(void *buffer, int size);		   *
     89 ;*                                                                         *
     90 ;* HISTORY:                                                                *
     91 ;*   10/26/1994 PWG : Created.                                             *
     92 ;*=========================================================================*
     93 GLOBAL	C Set_Shape_Buffer:NEAR
     94 
     95 PROC	Set_Shape_Buffer C near
     96 	USES	eax
     97 
     98 	ARG	buff:DWORD
     99 	ARG	size:DWORD
    100 
    101 	mov	eax,[size]
    102 	mov	[_ShapeBufferSize],eax
    103 
    104 	mov	eax,[buff]
    105 	mov	[_ShapeBuffer],eax
    106 	ret
    107 
    108 	ENDP	Set_Shape_Buffer
    109 END
    110 
    111 #endif