Initial commit of Command & Conquer Red Alert source code.
This commit is contained in:
parent
b685cea758
commit
5e733d5dcc
2082 changed files with 797727 additions and 0 deletions
342
WIN32LIB/TILE/ICONSET.CPP
Normal file
342
WIN32LIB/TILE/ICONSET.CPP
Normal file
|
@ -0,0 +1,342 @@
|
|||
/*
|
||||
** Command & Conquer Red Alert(tm)
|
||||
** Copyright 2025 Electronic Arts Inc.
|
||||
**
|
||||
** This program is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/***************************************************************************
|
||||
** 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 **
|
||||
***************************************************************************
|
||||
* *
|
||||
* Project Name : Library *
|
||||
* *
|
||||
* File Name : ICONSET.C *
|
||||
* *
|
||||
* Programmer : Joe L. Bostic *
|
||||
* *
|
||||
* Start Date : June 9, 1991 *
|
||||
* *
|
||||
* Last Update : September 15, 1993 [JLB] *
|
||||
* *
|
||||
*-------------------------------------------------------------------------*
|
||||
* Functions: *
|
||||
* Load_Icon_Set -- Loads an icons set and initializes it. *
|
||||
* Free_Icon_Set -- Frees allocations made by Load_Icon_Set(). *
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
||||
|
||||
//#include "function.h"
|
||||
|
||||
#define _WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
|
||||
#include <dos.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <mem.h>
|
||||
#include <wwstd.h>
|
||||
#include <file.h>
|
||||
#include "tile.h"
|
||||
#include <iff.h>
|
||||
|
||||
|
||||
|
||||
extern int Misc;
|
||||
|
||||
void * Load_Icon_Set(char const *filename, void *iconsetptr, long buffsize);
|
||||
void Free_Icon_Set(void const *iconset);
|
||||
long Get_Icon_Set_Size(void const *iconset);
|
||||
int Get_Icon_Set_Width(void const *iconset);
|
||||
int Get_Icon_Set_Height(void const *iconset);
|
||||
void * Get_Icon_Set_Icondata(void const *iconset);
|
||||
void * Get_Icon_Set_Trans(void const *iconset);
|
||||
void * Get_Icon_Set_Remapdata(void const *iconset);
|
||||
void * Get_Icon_Set_Palettedata(void const *iconset);
|
||||
int Get_Icon_Set_Count(void const *iconset);
|
||||
void * Get_Icon_Set_Map(void const *iconset);
|
||||
|
||||
|
||||
//#define ICON_PALETTE_BYTES 16
|
||||
//#define ICON_MAX 256
|
||||
|
||||
/***************************************************************************
|
||||
** The terrain is rendered by using icons. These are the buffers that hold
|
||||
** the icon data, remap tables, and remap index arrays.
|
||||
*/
|
||||
//PRIVATE char *IconPalette = NULL; // MCGA only.
|
||||
//PRIVATE char *IconRemap = NULL; // MCGA only.
|
||||
|
||||
#define FORM_RPAL MAKE_ID('R','P','A','L')
|
||||
#define FORM_RTBL MAKE_ID('R','T','B','L')
|
||||
#define FORM_SSET MAKE_ID('S','S','E','T')
|
||||
#define FORM_SINF MAKE_ID('S','I','N','F')
|
||||
#define FORM_ICON MAKE_ID('I','C','O','N')
|
||||
#define FORM_TRNS MAKE_ID('T','R','N','S')
|
||||
#define FORM_MAP MAKE_ID('M','A','P',' ')
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* LOAD_ICON_SET -- Loads an icons set and initializes it. *
|
||||
* *
|
||||
* This routine will load an IFF icon set from disk. It handles all *
|
||||
* of the necessary allocations. *
|
||||
* *
|
||||
* INPUT: filename -- Name of the icon file. *
|
||||
* *
|
||||
* buffer -- Pointer to paragraph aligned buffer to hold data. *
|
||||
* *
|
||||
* size -- Size of the buffer (in bytes). *
|
||||
* *
|
||||
* OUTPUT: none *
|
||||
* *
|
||||
* WARNINGS: In EEGA mode the iconset buffer will be free because the *
|
||||
* icons will have been transferred to card ram. *
|
||||
* *
|
||||
* HISTORY: *
|
||||
* 06/21/1991 JLB : Created. *
|
||||
* 07/01/1991 JLB : Determines icon size from file. *
|
||||
* 07/15/1991 JLB : Load and uncompress onto the same buffer. *
|
||||
* 09/15/1993 JLB : Added EMS support. *
|
||||
*=========================================================================*/
|
||||
void * Load_Icon_Set(char const *filename, void *iconsetptr, long buffsize)
|
||||
{
|
||||
int fh; // File handle of iconset.
|
||||
int bytespericon; // The number of bytes per icon.
|
||||
unsigned long icons=0; // Number of icons loaded.
|
||||
unsigned long size; // Size of the icon chunk (raw).
|
||||
|
||||
unsigned long transsize;
|
||||
void *transptr=NULL;
|
||||
|
||||
unsigned long mapsize; // Icon map chunk size.
|
||||
void *mapptr=NULL; // Icon map pointer.
|
||||
void *returnptr=NULL; // Iconset pointer returned by routine.
|
||||
BOOL allocated=FALSE; // Was the iconset block allocated?
|
||||
IControl_Type *idata=NULL; // Icon data loaded.
|
||||
long id; // ID of file openned.
|
||||
struct {
|
||||
char Width; // Width of icon in bytes.
|
||||
char Height; // Height of icon in bytes.
|
||||
char Format; // Graphic mode.
|
||||
//lint -esym(754,Format)
|
||||
char Bitplanes; // Number of bitplanes per icon.
|
||||
} sinf;
|
||||
|
||||
/*
|
||||
** Open the icon set for loading. If it is not a legal icon set
|
||||
** data file, then abort.
|
||||
*/
|
||||
fh = Open_Iff_File(filename);
|
||||
if (fh != WW_ERROR) {
|
||||
Read_File(fh, &id, sizeof(long));
|
||||
if (id == FORM_ICON) {
|
||||
|
||||
/*
|
||||
** Determine the size of the icons and set up the graphic
|
||||
** system accordingly. Also get the sizes of the various
|
||||
** data blocks that have to be loaded.
|
||||
*/
|
||||
Read_Iff_Chunk(fh, FORM_SINF, &sinf, sizeof(sinf));
|
||||
bytespericon = ((((int)sinf.Width)<<3)*(((int)sinf.Height)<<3)*(int)sinf.Bitplanes)>>3;
|
||||
|
||||
size = Get_Iff_Chunk_Size(fh,FORM_SSET);
|
||||
transsize = Get_Iff_Chunk_Size(fh, FORM_TRNS);
|
||||
mapsize = Get_Iff_Chunk_Size(fh, FORM_MAP);
|
||||
|
||||
/*
|
||||
** Allocate the icon buffer if one isn't provided. First try EMS and
|
||||
** then try conventional RAM.
|
||||
*/
|
||||
allocated = FALSE;
|
||||
if (!iconsetptr) {
|
||||
buffsize = size + transsize + mapsize + sizeof(IControl_Type);
|
||||
|
||||
Misc = buffsize;
|
||||
iconsetptr = Alloc(buffsize, MEM_NORMAL);
|
||||
allocated = (iconsetptr != NULL);
|
||||
}
|
||||
|
||||
if (iconsetptr && (size+transsize+mapsize+sizeof(IControl_Type)) <= buffsize) {
|
||||
|
||||
idata = (IControl_Type *)iconsetptr;
|
||||
|
||||
memset(idata, 0, sizeof(IControl_Type));
|
||||
|
||||
/*
|
||||
** Initialize the iconset header structure.
|
||||
*/
|
||||
idata->Width = (short)(((short)sinf.Width)<<3);
|
||||
idata->Height = (short)(((short)sinf.Height)<<3);
|
||||
idata->Allocated = (short)allocated;
|
||||
idata->Icons = (long)iconsetptr + sizeof(IControl_Type);
|
||||
idata->Map = idata->Icons + size;
|
||||
idata->TransFlag = sizeof(IControl_Type) + size + mapsize;
|
||||
idata->Size = buffsize;
|
||||
|
||||
{
|
||||
long val;
|
||||
|
||||
val = Read_Iff_Chunk(fh, FORM_SSET, Add_Long_To_Pointer(iconsetptr, sizeof(IControl_Type)), size);
|
||||
icons = (int)(val/(long)bytespericon);
|
||||
idata = (IControl_Type *)iconsetptr;
|
||||
}
|
||||
|
||||
if (mapsize) {
|
||||
icons = mapsize;
|
||||
}
|
||||
idata->Count = (short)icons;
|
||||
|
||||
/*
|
||||
** Limit buffer to only the size needed. This is done AFTER loading of the
|
||||
** raw icon data because it might have been compressed and thus need any
|
||||
** extra space to perform an overlapped decompression.
|
||||
*/
|
||||
if (buffsize > size + transsize + mapsize + sizeof(IControl_Type)) {
|
||||
buffsize = size + transsize + mapsize + sizeof(IControl_Type);
|
||||
}
|
||||
|
||||
transptr = Add_Long_To_Pointer(iconsetptr, idata->TransFlag);
|
||||
Read_Iff_Chunk(fh, FORM_TRNS, transptr, transsize);
|
||||
idata = (IControl_Type *)iconsetptr;
|
||||
|
||||
mapptr = (void*)idata->Map;
|
||||
Read_Iff_Chunk(fh, FORM_MAP, mapptr, mapsize);
|
||||
|
||||
/*
|
||||
** Let the graphic overlay know of the icon data. This could involve
|
||||
** translation and other data manipulations.
|
||||
*/
|
||||
//Init_Stamps(iconsetptr);
|
||||
|
||||
returnptr = iconsetptr;
|
||||
}
|
||||
}
|
||||
Close_Iff_File(fh);
|
||||
}
|
||||
|
||||
return (returnptr); // Return with icon pointer.
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* FREE_ICON_SET -- Frees allocations made by Load_Icon_Set(). *
|
||||
* *
|
||||
* This routine is used to free up any allocations by Load_Icon_Set(). *
|
||||
* Use this routine when a new icon set is to be loaded. *
|
||||
* *
|
||||
* INPUT: none *
|
||||
* *
|
||||
* OUTPUT: none *
|
||||
* *
|
||||
* WARNINGS: none *
|
||||
* *
|
||||
* HISTORY: *
|
||||
* 06/21/1991 JLB : Created. *
|
||||
*=========================================================================*/
|
||||
void Free_Icon_Set(void const *iconset)
|
||||
{
|
||||
IControl_Type *icontrol;
|
||||
|
||||
icontrol = (IControl_Type *)iconset;
|
||||
if (icontrol) {
|
||||
if (icontrol->Allocated) {
|
||||
Free((void *)iconset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
long Get_Icon_Set_Size(void const *iconset)
|
||||
{
|
||||
IControl_Type *icontrol;
|
||||
long size=0;
|
||||
|
||||
icontrol = (IControl_Type *)iconset;
|
||||
if (icontrol) {
|
||||
size = icontrol->Size;
|
||||
}
|
||||
return(size);
|
||||
}
|
||||
|
||||
|
||||
int Get_Icon_Set_Width(void const *iconset)
|
||||
{
|
||||
IControl_Type *icontrol;
|
||||
int width=0;
|
||||
|
||||
icontrol = (IControl_Type *)iconset;
|
||||
if (icontrol) {
|
||||
width = icontrol->Width;
|
||||
}
|
||||
return(width);
|
||||
}
|
||||
|
||||
|
||||
int Get_Icon_Set_Height(void const *iconset)
|
||||
{
|
||||
IControl_Type *icontrol;
|
||||
int height=0;
|
||||
|
||||
icontrol = (IControl_Type *)iconset;
|
||||
if (icontrol) {
|
||||
height = icontrol->Height;
|
||||
}
|
||||
return(height);
|
||||
}
|
||||
|
||||
|
||||
void * Get_Icon_Set_Icondata(void const *iconset)
|
||||
{
|
||||
IControl_Type *icontrol;
|
||||
icontrol = (IControl_Type *)iconset;
|
||||
if (icontrol)
|
||||
return(Add_Long_To_Pointer(iconset, (LONG)icontrol->Icons));
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
void * Get_Icon_Set_Trans(void const *iconset)
|
||||
{
|
||||
IControl_Type *icontrol;
|
||||
void *ptr=NULL;
|
||||
|
||||
icontrol = (IControl_Type *)iconset;
|
||||
if (icontrol) {
|
||||
ptr = Add_Long_To_Pointer((void *)iconset, icontrol->TransFlag);
|
||||
}
|
||||
return(ptr);
|
||||
}
|
||||
|
||||
|
||||
int Get_Icon_Set_Count(void const *iconset)
|
||||
{
|
||||
IControl_Type *icontrol;
|
||||
int count;
|
||||
|
||||
icontrol = (IControl_Type *)iconset;
|
||||
if (icontrol) {
|
||||
count = icontrol->Count;
|
||||
}
|
||||
return(count);
|
||||
}
|
||||
|
||||
|
||||
void * Get_Icon_Set_Map(void const *iconset)
|
||||
{
|
||||
IControl_Type *icontrol;
|
||||
icontrol = (IControl_Type *)iconset;
|
||||
if (icontrol)
|
||||
return(Add_Long_To_Pointer(iconset, (LONG)icontrol->Map));
|
||||
return(NULL);
|
||||
}
|
191
WIN32LIB/TILE/MAKEFILE
Normal file
191
WIN32LIB/TILE/MAKEFILE
Normal file
|
@ -0,0 +1,191 @@
|
|||
#
|
||||
# Command & Conquer Red Alert(tm)
|
||||
# Copyright 2025 Electronic Arts Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
#***************************************************************************
|
||||
#** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S **
|
||||
#***************************************************************************
|
||||
#* *
|
||||
#* Project Name : Westwood Library .LIB makefile *
|
||||
#* *
|
||||
#* File Name : MAKEFILE *
|
||||
#* *
|
||||
#* Programmer : Julio R. Jerez *
|
||||
#* *
|
||||
#* Start Date : Jan 26, 1995 *
|
||||
#* *
|
||||
#* *
|
||||
#*-------------------------------------------------------------------------*
|
||||
#* *
|
||||
#* Required environment variables: *
|
||||
#* WIN32LIB = your root WIN32LIB path *
|
||||
#* WIN32VCS = root directory for wwlib version control archive *
|
||||
#* COMPILER = your Watcom installation path *
|
||||
#* *
|
||||
#* Required changes to makefile: *
|
||||
#* PROJ_NAME = name of the library you're building *
|
||||
#* OBJECTS = list of objects in your library *
|
||||
#* *
|
||||
#* Optional changes to makefile: *
|
||||
#* PROJ_DIR = full pathname of your working directory *
|
||||
#* .path.xxx = full pathname where various file types live *
|
||||
#* *
|
||||
#***************************************************************************
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Verify user's environment
|
||||
#---------------------------------------------------------------------------
|
||||
!ifndef %WIN32LIB
|
||||
!error WIN32LIB Environment var not configured.
|
||||
!endif
|
||||
|
||||
!ifndef %WIN32VCS
|
||||
!error WIN32VCS Environment var not configured.
|
||||
!endif
|
||||
|
||||
!ifndef %WATCOM
|
||||
!error WATCOM Environment var not configured.
|
||||
!endif
|
||||
|
||||
|
||||
#===========================================================================
|
||||
# User-defined section: the user should tailor this section for each project
|
||||
#===========================================================================
|
||||
|
||||
PROJ_NAME = tile
|
||||
PROJ_DIR = $(%WIN32LIB)\$(PROJ_NAME)
|
||||
LIB_DIR = $(%WIN32LIB)\lib
|
||||
|
||||
!include $(%WIN32LIB)\project.cfg
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Project-dependent variables
|
||||
#---------------------------------------------------------------------------
|
||||
OBJECTS = &
|
||||
iconset.obj
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Path macros: one path for each file type.
|
||||
# These paths are used to tell make where to find/put each file type.
|
||||
#---------------------------------------------------------------------------
|
||||
.asm: $(PROJ_DIR)
|
||||
.c: $(PROJ_DIR)
|
||||
.cpp: $(PROJ_DIR)
|
||||
.h: $(PROJ_DIR)
|
||||
.obj: $(PROJ_DIR)
|
||||
.lib: $(%WIN32LIB)\lib
|
||||
.exe: $(PROJ_DIR)
|
||||
|
||||
#===========================================================================
|
||||
# Pre-defined section: there should be little need to modify this section.
|
||||
#===========================================================================
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Tools/commands
|
||||
#---------------------------------------------------------------------------
|
||||
C_CMD = wcc386
|
||||
CPP_CMD = wpp386
|
||||
LIB_CMD = wlib
|
||||
LINK_CMD = wlink
|
||||
ASM_CMD = tasm
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Include & library paths
|
||||
# If LIB & INCLUDE are already defined, they are used in addition to the
|
||||
# WWLIB32 lib & include; otherwise, they're constructed from
|
||||
# BCDIR & TNTDIR
|
||||
#---------------------------------------------------------------------------
|
||||
LIBPATH = $(%WIN32LIB)\LIB;$(%WATCOM)\LIB
|
||||
INCLUDEPATH = $(%WIN32LIB)\INCLUDE;$(%WATCOM)\H
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Implicit rules
|
||||
# Compiler:
|
||||
# ($< = full dependent with path)
|
||||
# Assembler:
|
||||
# output obj's are constructed from .obj: & the $& macro
|
||||
# ($< = full dependent with path)
|
||||
# tasm's cfg file is not invoked as a response file.
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
.c.obj: $(%WIN32LIB)\project.cfg .AUTODEPEND
|
||||
*$(C_CMD) $(CC_CFG) $<
|
||||
|
||||
.cpp.obj: $(%WIN32LIB)\project.cfg .AUTODEPEND
|
||||
*$(CPP_CMD) $(CC_CFG) $(PROJ_DIR)\$^*.cpp
|
||||
|
||||
.asm.obj: $(%WIN32LIB)\project.cfg
|
||||
$(ASM_CMD) $(ASM_CFG) $<
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Default target: configuration files & library (in that order)
|
||||
#---------------------------------------------------------------------------
|
||||
all: $(LIB_DIR)\$(PROJ_NAME).lib .SYMBOLIC
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Build the library
|
||||
# The original library is deleted by the librarian
|
||||
# Lib objects & -+ commands are constructed by substituting within the
|
||||
# $^@ macro (which expands to all target dependents, separated with
|
||||
# spaces)
|
||||
# Tlib's cfg file is not invoked as a response file.
|
||||
# All headers & source files are copied into WIN32LIB\SRCDEBUG, for debugging
|
||||
#---------------------------------------------------------------------------
|
||||
$(LIB_DIR)\$(PROJ_NAME).lib: $(OBJECTS) objects.lbc
|
||||
copy *.h $(%WIN32LIB)\include
|
||||
copy *.inc $(%WIN32LIB)\include
|
||||
copy *.cpp $(%WIN32LIB)\srcdebug
|
||||
copy *.asm $(%WIN32LIB)\srcdebug
|
||||
$(LIB_CMD) $(LIB_CFG) $^@ @objects.lbc
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Objects now have a link file which is NOT generated everytime. Instead
|
||||
# it just has its own dependacy rule.
|
||||
#---------------------------------------------------------------------------
|
||||
objects.lbc : $(OBJECTS)
|
||||
%create $^@
|
||||
for %index in ($(OBJECTS)) do %append $^@ +%index
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Create the test directory and make it.
|
||||
#---------------------------------------------------------------------------
|
||||
test:
|
||||
mkdir test
|
||||
cd test
|
||||
copy $(%WWVCS)\$(PROJ_NAME)\test\vcs.cfg
|
||||
update
|
||||
mkdir run
|
||||
cd run
|
||||
copy $(%WWVCS)\$(PROJ_NAME)\test\run\vcs.cfg
|
||||
update
|
||||
cd..
|
||||
mkdir art
|
||||
cd art
|
||||
copy $(%WWVCS)\$(PROJ_NAME)\test\art\vcs.cfg
|
||||
update
|
||||
cd..
|
||||
wmake
|
||||
cd ..
|
||||
|
||||
|
||||
#**************************** End of makefile ******************************
|
||||
|
||||
|
169
WIN32LIB/TILE/MAKEFILE.BOR
Normal file
169
WIN32LIB/TILE/MAKEFILE.BOR
Normal file
|
@ -0,0 +1,169 @@
|
|||
#
|
||||
# Command & Conquer Red Alert(tm)
|
||||
# Copyright 2025 Electronic Arts Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
#***************************************************************************
|
||||
#** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S **
|
||||
#***************************************************************************
|
||||
#* *
|
||||
#* Project Name : Westwood Library .LIB makefile *
|
||||
#* *
|
||||
#* File Name : MAKEFILE *
|
||||
#* *
|
||||
#* Programmer : Julio R. Jerez *
|
||||
#* *
|
||||
#* Start Date : Jan 26, 1995 *
|
||||
#* *
|
||||
#* *
|
||||
#*-------------------------------------------------------------------------*
|
||||
#* *
|
||||
#* Required environment variables: *
|
||||
#* WIN32LIB = your root WWFLAT path *
|
||||
#* WIN32VCS = root directory for wwlib version control archive *
|
||||
#* COMPILER = your Watcom installation path *
|
||||
#* *
|
||||
#* Required changes to makefile: *
|
||||
#* PROJ_NAME = name of the library you're building *
|
||||
#* OBJECTS = list of objects in your library *
|
||||
#* *
|
||||
#* Optional changes to makefile: *
|
||||
#* PROJ_DIR = full pathname of your working directory *
|
||||
#* .path.xxx = full pathname where various file types live *
|
||||
#* *
|
||||
#***************************************************************************
|
||||
|
||||
.AUTODEPEND
|
||||
#---------------------------------------------------------------------------
|
||||
# Verify user's environment
|
||||
#---------------------------------------------------------------------------
|
||||
!ifndef WIN32LIB
|
||||
!error WIN32LIB Environment var not configured.
|
||||
!endif
|
||||
|
||||
!ifndef WIN32VCS
|
||||
!error WIN32VCS Environment var not configured.
|
||||
!endif
|
||||
|
||||
!ifndef COMPILER
|
||||
!error COMPILER Environment var not configured.
|
||||
!endif
|
||||
|
||||
#===========================================================================
|
||||
# User-defined section: the user should tailor this section for each project
|
||||
#===========================================================================
|
||||
|
||||
PROJ_NAME = tile
|
||||
PROJ_DIR = $(WIN32LIB)\$(PROJ_NAME)
|
||||
LIB_DIR = $(WIN32LIB)\lib
|
||||
|
||||
!include $(WIN32LIB)\\project.cfg
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Project-dependent variables
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
OBJECTS = \
|
||||
iconset.obj
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Path macros: one path for each file type.
|
||||
# These paths are used to tell make where to find/put each file type.
|
||||
#---------------------------------------------------------------------------
|
||||
.path.asm = $(PROJ_DIR)
|
||||
.path.c = $(PROJ_DIR)
|
||||
.path.cpp = $(PROJ_DIR)
|
||||
.path.h = $(PROJ_DIR)
|
||||
.path.obj = $(PROJ_DIR)
|
||||
.path.lib = $(WIN32LIB)\lib
|
||||
.path.exe = $(PROJ_DIR)
|
||||
|
||||
#===========================================================================
|
||||
# Pre-defined section: there should be little need to modify this section.
|
||||
#===========================================================================
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Tools/commands
|
||||
#---------------------------------------------------------------------------
|
||||
C_CMD = bcc32
|
||||
CPP_CMD = bcc32
|
||||
LIB_CMD = tlib
|
||||
LINK_CMD = tlink32
|
||||
ASM_CMD = tasm32
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Include & library paths
|
||||
# If LIB & INCLUDE are already defined, they are used in addition to the
|
||||
# WWLIB32 lib & include; otherwise, they're constructed from
|
||||
# BCDIR & TNTDIR
|
||||
#---------------------------------------------------------------------------
|
||||
LIBPATH = $(WIN32LIB)\LIB;$(COMPILER)\LIB
|
||||
INCLUDEPATH = $(WIN32LIB)\INCLUDE;$(COMPILER)\INCLUDE
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Implicit rules
|
||||
# Compiler:
|
||||
# ($< = full dependent with path)
|
||||
# Assembler:
|
||||
# output obj's are constructed from .obj: & the $& macro
|
||||
# ($< = full dependent with path)
|
||||
# tasm's cfg file is not invoked as a response file.
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
.c.obj:
|
||||
$(C_CMD) $(CC_CFG) $<
|
||||
|
||||
.cpp.obj:
|
||||
$(CPP_CMD) $(CC_CFG) $<
|
||||
|
||||
.asm.obj:
|
||||
$(ASM_CMD) $(ASM_CFG) $<
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Default target: configuration files & library (in that order)
|
||||
#---------------------------------------------------------------------------
|
||||
all: $(LIB_DIR)\$(PROJ_NAME).lib
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Build the library
|
||||
# The original library is deleted by the librarian
|
||||
# Lib objects & -+ commands are constructed by substituting within the
|
||||
# $^@ macro (which expands to all target dependents, separated with
|
||||
# spaces)
|
||||
# Tlib's cfg file is not invoked as a response file.
|
||||
# All headers & source files are copied into WIN32LIB\SRCDEBUG, for debugging
|
||||
#---------------------------------------------------------------------------
|
||||
$(LIB_DIR)\\$(PROJ_NAME).lib: $(OBJECTS)
|
||||
copy *.h $(WIN32LIB)\\include
|
||||
copy *.inc $(WIN32LIB)\\include
|
||||
copy *.cpp $(WIN32LIB)\\srcdebug
|
||||
copy *.asm $(WIN32LIB)\\srcdebug
|
||||
$(LIB_CMD) $< $(LIB_CFG) @&&|
|
||||
-+iconset.obj
|
||||
|
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Create the test directory and make it.
|
||||
#---------------------------------------------------------------------------
|
||||
test:
|
||||
mkdir test
|
||||
cd test
|
||||
copy $(WWVCS)\\$(PROJ_NAME)\test\vcs.cfg
|
||||
update
|
||||
wmake
|
||||
cd ..
|
||||
|
191
WIN32LIB/TILE/MAKEFILE.WAT
Normal file
191
WIN32LIB/TILE/MAKEFILE.WAT
Normal file
|
@ -0,0 +1,191 @@
|
|||
#
|
||||
# Command & Conquer Red Alert(tm)
|
||||
# Copyright 2025 Electronic Arts Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
#***************************************************************************
|
||||
#** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S **
|
||||
#***************************************************************************
|
||||
#* *
|
||||
#* Project Name : Westwood Library .LIB makefile *
|
||||
#* *
|
||||
#* File Name : MAKEFILE *
|
||||
#* *
|
||||
#* Programmer : Julio R. Jerez *
|
||||
#* *
|
||||
#* Start Date : Jan 26, 1995 *
|
||||
#* *
|
||||
#* *
|
||||
#*-------------------------------------------------------------------------*
|
||||
#* *
|
||||
#* Required environment variables: *
|
||||
#* WIN32LIB = your root WIN32LIB path *
|
||||
#* WIN32VCS = root directory for wwlib version control archive *
|
||||
#* COMPILER = your Watcom installation path *
|
||||
#* *
|
||||
#* Required changes to makefile: *
|
||||
#* PROJ_NAME = name of the library you're building *
|
||||
#* OBJECTS = list of objects in your library *
|
||||
#* *
|
||||
#* Optional changes to makefile: *
|
||||
#* PROJ_DIR = full pathname of your working directory *
|
||||
#* .path.xxx = full pathname where various file types live *
|
||||
#* *
|
||||
#***************************************************************************
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Verify user's environment
|
||||
#---------------------------------------------------------------------------
|
||||
!ifndef %WIN32LIB
|
||||
!error WIN32LIB Environment var not configured.
|
||||
!endif
|
||||
|
||||
!ifndef %WIN32VCS
|
||||
!error WIN32VCS Environment var not configured.
|
||||
!endif
|
||||
|
||||
!ifndef %WATCOM
|
||||
!error WATCOM Environment var not configured.
|
||||
!endif
|
||||
|
||||
|
||||
#===========================================================================
|
||||
# User-defined section: the user should tailor this section for each project
|
||||
#===========================================================================
|
||||
|
||||
PROJ_NAME = tile
|
||||
PROJ_DIR = $(%WIN32LIB)\$(PROJ_NAME)
|
||||
LIB_DIR = $(%WIN32LIB)\lib
|
||||
|
||||
!include $(%WIN32LIB)\project.cfg
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Project-dependent variables
|
||||
#---------------------------------------------------------------------------
|
||||
OBJECTS = &
|
||||
iconset.obj
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Path macros: one path for each file type.
|
||||
# These paths are used to tell make where to find/put each file type.
|
||||
#---------------------------------------------------------------------------
|
||||
.asm: $(PROJ_DIR)
|
||||
.c: $(PROJ_DIR)
|
||||
.cpp: $(PROJ_DIR)
|
||||
.h: $(PROJ_DIR)
|
||||
.obj: $(PROJ_DIR)
|
||||
.lib: $(%WIN32LIB)\lib
|
||||
.exe: $(PROJ_DIR)
|
||||
|
||||
#===========================================================================
|
||||
# Pre-defined section: there should be little need to modify this section.
|
||||
#===========================================================================
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Tools/commands
|
||||
#---------------------------------------------------------------------------
|
||||
C_CMD = wcc386
|
||||
CPP_CMD = wpp386
|
||||
LIB_CMD = wlib
|
||||
LINK_CMD = wlink
|
||||
ASM_CMD = tasm32
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Include & library paths
|
||||
# If LIB & INCLUDE are already defined, they are used in addition to the
|
||||
# WWLIB32 lib & include; otherwise, they're constructed from
|
||||
# BCDIR & TNTDIR
|
||||
#---------------------------------------------------------------------------
|
||||
LIBPATH = $(%WIN32LIB)\LIB;$(%WATCOM)\LIB
|
||||
INCLUDEPATH = $(%WIN32LIB)\INCLUDE;$(%WATCOM)\H
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Implicit rules
|
||||
# Compiler:
|
||||
# ($< = full dependent with path)
|
||||
# Assembler:
|
||||
# output obj's are constructed from .obj: & the $& macro
|
||||
# ($< = full dependent with path)
|
||||
# tasm's cfg file is not invoked as a response file.
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
.c.obj: $(%WIN32LIB)\project.cfg .AUTODEPEND
|
||||
$(C_CMD) $(CC_CFG) $<
|
||||
|
||||
.cpp.obj: $(%WIN32LIB)\project.cfg .AUTODEPEND
|
||||
$(CPP_CMD) $(CC_CFG) $<
|
||||
|
||||
.asm.obj: $(%WIN32LIB)\project.cfg
|
||||
$(ASM_CMD) $(ASM_CFG) $<
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Default target: configuration files & library (in that order)
|
||||
#---------------------------------------------------------------------------
|
||||
all: $(LIB_DIR)\$(PROJ_NAME).lib .SYMBOLIC
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Build the library
|
||||
# The original library is deleted by the librarian
|
||||
# Lib objects & -+ commands are constructed by substituting within the
|
||||
# $^@ macro (which expands to all target dependents, separated with
|
||||
# spaces)
|
||||
# Tlib's cfg file is not invoked as a response file.
|
||||
# All headers & source files are copied into WIN32LIB\SRCDEBUG, for debugging
|
||||
#---------------------------------------------------------------------------
|
||||
$(LIB_DIR)\$(PROJ_NAME).lib: $(OBJECTS) objects.lbc
|
||||
copy *.h $(%WIN32LIB)\include
|
||||
copy *.inc $(%WIN32LIB)\include
|
||||
copy *.cpp $(%WIN32LIB)\srcdebug
|
||||
copy *.asm $(%WIN32LIB)\srcdebug
|
||||
$(LIB_CMD) $(LIB_CFG) $^@ @objects.lbc
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Objects now have a link file which is NOT generated everytime. Instead
|
||||
# it just has its own dependacy rule.
|
||||
#---------------------------------------------------------------------------
|
||||
objects.lbc : $(OBJECTS)
|
||||
%create $^@
|
||||
for %index in ($(OBJECTS)) do %append $^@ +%index
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Create the test directory and make it.
|
||||
#---------------------------------------------------------------------------
|
||||
test:
|
||||
mkdir test
|
||||
cd test
|
||||
copy $(%WWVCS)\$(PROJ_NAME)\test\vcs.cfg
|
||||
update
|
||||
mkdir run
|
||||
cd run
|
||||
copy $(%WWVCS)\$(PROJ_NAME)\test\run\vcs.cfg
|
||||
update
|
||||
cd..
|
||||
mkdir art
|
||||
cd art
|
||||
copy $(%WWVCS)\$(PROJ_NAME)\test\art\vcs.cfg
|
||||
update
|
||||
cd..
|
||||
wmake
|
||||
cd ..
|
||||
|
||||
|
||||
#**************************** End of makefile ******************************
|
||||
|
||||
|
94
WIN32LIB/TILE/TILE.H
Normal file
94
WIN32LIB/TILE/TILE.H
Normal file
|
@ -0,0 +1,94 @@
|
|||
/*
|
||||
** Command & Conquer Red Alert(tm)
|
||||
** Copyright 2025 Electronic Arts Inc.
|
||||
**
|
||||
** This program is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** This program is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/***************************************************************************
|
||||
** 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 **
|
||||
***************************************************************************
|
||||
* *
|
||||
* Project Name : Part of the TILE Library *
|
||||
* *
|
||||
* File Name : TILE.H *
|
||||
* *
|
||||
* Programmer : Barry W. Green *
|
||||
* *
|
||||
* Start Date : February 2, 1995 *
|
||||
* *
|
||||
* Last Update : February 2, 1995 [BWG] *
|
||||
* *
|
||||
*-------------------------------------------------------------------------*
|
||||
* Functions: *
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
||||
|
||||
#ifndef TILE_H
|
||||
#define TILE_H
|
||||
|
||||
/*=========================================================================*/
|
||||
/* The following prototypes are for the file: ICONSET.CPP */
|
||||
/*=========================================================================*/
|
||||
void * Load_Icon_Set(char const *filename, void *iconsetptr, long buffsize);
|
||||
void Free_Icon_Set(void const *iconset);
|
||||
long Get_Icon_Set_Size(void const *iconset);
|
||||
int Get_Icon_Set_Width(void const *iconset);
|
||||
int Get_Icon_Set_Height(void const *iconset);
|
||||
void * Get_Icon_Set_Icondata(void const *iconset);
|
||||
void * Get_Icon_Set_Trans(void const *iconset);
|
||||
void * Get_Icon_Set_Remapdata(void const *iconset);
|
||||
void * Get_Icon_Set_Palettedata(void const *iconset);
|
||||
int Get_Icon_Set_Count(void const *iconset);
|
||||
void * Get_Icon_Set_Map(void const *iconset);
|
||||
#if (0)
|
||||
/*
|
||||
** This is the control structure at the start of a loaded icon set. It must match
|
||||
** the structure in WWLIB.I! This structure MUST be a multiple of 16 bytes long.
|
||||
*/
|
||||
typedef struct {
|
||||
short Width; // Width of icons (pixels).
|
||||
short Height; // Height of icons (pixels).
|
||||
short Count; // Number of (logical) icons in this set.
|
||||
// BOOL Allocated; // Was this iconset allocated?
|
||||
short Allocated; // Was this iconset allocated?
|
||||
long Size; // Size of entire iconset memory block.
|
||||
unsigned char *Icons; // Offset from buffer start to icon data.
|
||||
long Palettes; // Offset from buffer start to palette data.
|
||||
long Remaps; // Offset from buffer start to remap index data.
|
||||
long TransFlag; // Offset for transparency flag table.
|
||||
unsigned char *Map; // Icon map offset (if present).
|
||||
} IControl_Type;
|
||||
#endif //(0)
|
||||
|
||||
typedef struct {
|
||||
short Width; // Width of icons (pixels).
|
||||
short Height; // Height of icons (pixels).
|
||||
short Count; // Number of (logical) icons in this set.
|
||||
short Allocated; // Was this iconset allocated?
|
||||
short MapWidth; // Width of map (in icons).
|
||||
short MapHeight; // Height of map (in icons).
|
||||
long Size; // Size of entire iconset memory block.
|
||||
long Icons; // Offset from buffer start to icon data.
|
||||
// unsigned char * Icons; // Offset from buffer start to icon data.
|
||||
long Palettes; // Offset from buffer start to palette data.
|
||||
long Remaps; // Offset from buffer start to remap index data.
|
||||
long TransFlag; // Offset for transparency flag table.
|
||||
long ColorMap; // Offset for color control value table.
|
||||
long Map; // Icon map offset (if present).
|
||||
// unsigned char * Map; // Icon map offset (if present).
|
||||
} IControl_Type;
|
||||
|
||||
|
||||
#endif //TILE_H
|
||||
|
Reference in a new issue