home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD1.bin
/
new
/
gfx
/
edit
/
tsmorph
/
src
/
tsmorph.h
< prev
next >
Wrap
C/C++ Source or Header
|
1994-02-25
|
29KB
|
1,064 lines
// TSMorph - Amiga Morphing program
// Copyright (C) © 1993 Topicsave Limited
// 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 2 of the License, or
// 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, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
// mpaddock@cix.compulink.co.uk
#ifndef TSMORPH_H
#define TSMORPH_H
/* All the Amiga stuff */
#define INTUI_V36_NAMES_ONLY
#define INTUITION_IOBSOLETE_H
#include <exec/types.h>
#include <exec/memory.h>
#include <exec/execbase.h>
#include <intuition/intuition.h>
#include <intuition/intuitionbase.h>
#include <intuition/classes.h>
#include <intuition/classusr.h>
#include <intuition/gadgetclass.h>
#include <intuition/imageclass.h>
#include <intuition/icclass.h>
#include <devices/input.h>
#include <workbench/workbench.h>
#include <workbench/startup.h>
#include <libraries/gadtools.h>
#include <graphics/scale.h>
#include <libraries/asl.h>
#include <libraries/amigaguide.h>
#include <libraries/reqtools.h>
#include <libraries/dctv.h>
/* Various stuff is not defined in 2.02 headers */
#ifndef PGA_NewLook
#define PGA_NewLook (PGA_Dummy + 0x000A)
#endif
#ifndef GTMN_FullMenu
#define GTMN_FullMenu GT_TagBase+62
#endif
#ifndef WA_MenuHelp
#define WA_MenuHelp (WA_Dummy + 0x2F)
#endif
#ifndef WA_NewLookMenus
#define WA_NewLookMenus (WA_Dummy + 0x30)
#endif
#ifndef GTMN_NewLookMenus
#define GTMN_NewLookMenus GT_TagBase+67
#endif
#ifndef STRINGA_ExitHelp
#define STRINGA_ExitHelp (STRINGA_Dummy + 0x0013)
#endif
#ifndef GT_Underscore
#define GT_Underscore GT_TagBase+64
#endif
#ifndef IDCMP_GADGETHELP
#define IDCMP_GADGETHELP 0x04000000
#endif
#if INCLUDE_VERSION < 39
void HelpControl(struct Window *w,ULONG flags);
#pragma libcall IntuitionBase HelpControl 33C 0802
void SetRGB32( struct ViewPort *vp, unsigned long n, unsigned long r, unsigned long g,unsigned long b);
#pragma libcall GfxBase SetRGB32 354 3210805
void GetRGB32( struct ColorMap *cm, unsigned long firstcolor,unsigned long ncolors, ULONG *table);
#pragma libcall GfxBase GetRGB32 384 910804
#endif
#ifndef HC_GADGETHELP
#define HC_GADGETHELP 1
#endif
#ifndef SA_Interleaved
#define SA_Interleaved (SA_Dummy + 0x0022)
#endif
/* prototypes */
#include <clib/exec_protos.h>
#include <clib/dos_protos.h>
#include <clib/layers_protos.h>
#include <clib/graphics_protos.h>
#include <clib/intuition_protos.h>
#include <clib/input_protos.h>
#include <clib/gadtools_protos.h>
#include <clib/asl_protos.h>
#include <clib/utility_protos.h>
#include <clib/diskfont_protos.h>
#include <clib/icon_protos.h>
#include <clib/amigaguide_protos.h>
#define LIBRARIES_MATHFFP_H // Do not include other math stuff
#include <clib/alib_protos.h>
#include <clib/reqtools_protos.h>
#include <clib/dctv_protos.h>
/* Pragmas */
#include <pragmas/exec_pragmas.h>
#include <pragmas/dos_pragmas.h>
#include <pragmas/layers_pragmas.h>
#include <pragmas/graphics_pragmas.h>
#include <pragmas/intuition_pragmas.h>
#include <pragmas/input_pragmas.h>
#include <pragmas/gadtools_pragmas.h>
#include <pragmas/asl_pragmas.h>
#include <pragmas/utility_pragmas.h>
#include <pragmas/diskfont_pragmas.h>
#include <pragmas/icon_pragmas.h>
#include <pragmas/amigaguide_pragmas.h>
#include <pragmas/reqtools.h>
#include <pragmas/dctv_pragmas.h>
#include <rexx/errors.h>
#include <pragmas/rexxsyslib_pragmas.h>
#include <clib/rexxsyslib_protos.h>
/* 2.02 Icon headers */
#if INCLUDE_VERSION < 37
BOOL DeleteDiskObject(UBYTE *name);
#pragma libcall IconBase DeleteDiskObject 8A 801
#endif
/* Below is not in the 2.02 version of clib/utility_protos.h
pragmas/utility_pragmas.h */
#if INCLUDE_VERSION < 37
LONG Stricmp(UBYTE *string1,UBYTE *string2);
#pragma libcall UtilityBase Stricmp A2 9802
#endif
/* Standard headers */
#include <stddef.h>
#include <string.h>
#include <stdio.h>
#include <math.h>
/* OpalVision */
#include <opal/opallib.h>
/* EGS */
#include <egs/clib/egs_protos.h>
#include <egs/pragmas/egs_pragmas.h>
#include <egs/clib/egsintui_protos.h>
#include <egs/pragmas/egsintui_pragmas.h>
#include <egs/clib/egsgfx_protos.h>
#include <egs/pragmas/egsgfx_pragmas.h>
#include <egs/clib/egsrequest_protos.h>
#include <egs/pragmas/egsrequest_pragmas.h>
#include <egs/egsintui.h>
extern struct Library *EGSIntuiBase;
extern struct Library *EGSGfxBase;
extern struct Library *EGSBase;
extern struct Library *EGSRequestBase;
/* define max if not already defined */
#ifndef max
#define max(a,b) ((a)>(b)?(a):(b))
#endif
/* IFF stuff */
#include "iffp/ILBMapp.h"
/* GUI stuff from GadTools */
#include "gui.h"
/* Message keys */
#include "Messages.h"
/* defines for the IDs of the gadgets in the control window */
#define ONEGADGET 1
#define TWOGADGET 2
#define RELGADGET 3
#define ADDGADGET 4
#define DELGADGET 5
#define LINKGADGET 6
#define UNLINKGADGET 7
#define NONEGADGET 8
#define STGADGET 9
#define PREVGADGET 10
#define GOTOGADGET 11
#define NEXTGADGET 12
#define LASTGADGET 13
/* Defined externally */
extern struct DosLibrary *DOSBase;
extern struct ExecBase *SysBase;
/* Structure definitions */
/* Picture structure
* This holds all information for a picture displayed in a window
*/
struct Picture { // Structure used for each picture
struct Screen *Screen; // Screen to display on
struct Window *Win; // Window
struct EI_Window *EGS_Win; // EGS Window
struct E_EBitMap *EGS_BitMap;// EGS Bitmap
struct DrawInfo *DRI; // Draw Info
struct Gadget *BotGad; // Bottom slider gadget
struct Gadget *SideGad; // Side slider gadget
struct Gadget *Lgad; // Left arrow gadget
struct Gadget *Rgad; // Right arrow gadget
struct Gadget *Ugad; // Up arrow gadget
struct Gadget *Dgad; // Down arrow gadget
struct Image *Limage; // Left arrow
struct Image *Rimage; // Right arrow
struct Image *Uimage; // Up arrow
struct Image *Dimage; // Down arrow
UWORD Left; // Left edge
UWORD Top; // Top edge
UWORD XLeft; // Old left edge
UWORD XTop; // Old top edge
UWORD ALeft; // Left movement 10% of window
UWORD ATop; // down movement 10% of window
UWORD MLeft; // Max left edge
UWORD MTop; // Max top edge
struct ILBMInfo *ilbm; // ILBM info for iff read
UWORD currentg; // Current gadgetID
char *filename; // For Window title
ULONG JustSeconds;// Time window was activated - to ignore first click
struct BitMap BitMap; // The zoomed image bitmap
struct BitScaleArgs BitScaleArgs; // For zooming image
BOOL Opal; // Set if opened by OpalLoad
struct {
WORD Left; // Window Zoom tags - nothing to do with Zoom
WORD Top;
WORD Width;
WORD Height;
} Zoom;
UWORD width; // both only valid when EGS
UWORD height;
};
#define MAX_LINKS 16
/* Point structure
* Holds all information for each point
*/
struct MyPoint {
struct MinNode MyNode; // Node to link in a list
WORD x,y; // Coordinates in the 1st image
WORD x1,y1; // Coordinates in the 2nd image
WORD NumLinks; // Number of links on this point
struct MyPoint *p[MAX_LINKS]; // Pointers to up to MAX_LINKS linked points
};
/* Structure for size of system gadgets
* based on Screen resolution
* This enables windows to open with correct
* gadgets on lo-res screens
*/
struct gadgetsizing {
ULONG sysisize; // tag for SYSISIZE_???RES
int sizeimagew;
int sizeimageh;
int leftimagew;
int leftimageh;
int downimagew;
int downimageh;
int rightimagew;
int rightimageh;
int upimagew;
int upimageh;
int closeimagew;
int zoomimagew;
int depthimagew;
int vscrollw;
int vscrolll;
};
/* Macro for finding gadget */
#define PointInBox(x,y,mx,my,MX,MY) ((x>=mx)&&(y>=my)&&(x<=MX)&