ack3d/ack_lib/ACKWRAP.C
Gered 865b466995 initial commit
sources taken from book CD:

ack_lib -> /ACK/WIN/ACK_LIB
fdemo -> /ACK/DOS/FDEMO/SOURCE (and /ACK/DOS/BORLAND as needed)
mall -> /ACK/DOS/MALL/SOURCE (and /ACK/DOS/BORLAND as needed)

some source files were missing for the demo projects and needed to be
copied from /ACK/DOS/BORLAND (as indicated above)
2019-11-02 13:17:24 -04:00

79 lines
1.6 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
#include <dos.h>
#include <mem.h>
#include <io.h>
#include <fcntl.h>
#include <time.h>
#include <string.h>
#include <sys\stat.h>
#include "ack3d.h"
#include "ackeng.h"
#include "ackext.h"
typedef struct {
int sel;
int off;
} SELOFF;
extern char AckKeyboardSetup;
extern SELOFF OldKeybdInt;
extern char AckTimerSetup;
extern SELOFF OldTimerInt;
void AckSetIntVector(int VecNum,int sel,int VecOff);
//±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
// Frees up buffers and closes any resource file that may be open.
// After calling this function, do NOT call AckBuildView() or
// AckDisplayScreen()
//±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
short AckWrapUp (ACKENG * ae)
{
AckFree (LongTanTable);
AckFree (LongInvTanTable);
AckFree (CosTable);
AckFree (SinTable);
AckFree (LongCosTable);
AckFree (xNextTable);
AckFree (yNextTable);
AckFree (ViewCosTable);
AckFree (AdjustTable);
if (ae->OverlayBuffer != NULL)
AckFree (ae->OverlayBuffer);
ae->OverlayBuffer = NULL;
if (ae->BkgdBuffer != NULL)
AckFree (ae->BkgdBuffer);
ae->BkgdBuffer = NULL;
if (ae->ScreenBuffer != NULL)
AckFree (ae->ScreenBuffer);
ae->ScreenBuffer = NULL;
if (rsHandle)
{
close (rsHandle);
rsHandle = 0;
}
if (AckKeyboardSetup)
{
AckSetIntVector(9,OldKeybdInt.sel,OldKeybdInt.off);
AckKeyboardSetup = 0;
}
if (AckTimerSetup)
{
AckSetIntVector(0x1C,OldTimerInt.sel,OldTimerInt.off);
AckTimerSetup = 0;
}
return (0);
}
// **** End of Source ****