home *** CD-ROM | disk | FTP | other *** search
- #include <exec/types.h>
- #include <exec/ports.h>
- #include <exec/memory.h>
- #include <intuition/intuition.h>
- #include <libraries/dos.h>
-
- #include <proto/intuition.h>
- #include <proto/graphics.h>
- #include <proto/exec.h>
-
- #include <iff/iff.h>
- #include <iff/iffpragmas.h>
-
- #include "hame_pragmas.h"
- #include "HameStruct.h"
- #include "HameProtos.h"
- #include "HameRev.h"
-
- #include "View_define.h"
- #include "ViewProtos.h"
-
- extern struct IntuitionBase *IntuitionBase;
- extern struct GfxBase *GfxBase;
- extern struct Library *HameBase;
- extern struct IFFBase *IFFBase;
- extern struct AslBase *AslBase;
-
-
- extern struct NewScreen newscreen;
- extern struct NewWindow newwindow;
- extern struct Screen *imageScreen;
- extern struct Window *imageWindow;
- extern struct Window *sw;
- extern struct Window *credwin;
- extern struct Window *gWindow;
- extern struct MsgPort *messagePort;
- extern struct ViewPort *frontViewPort;
- extern struct HamePort *hamePort;
-
- extern ULONG signalmask, signals;
-
- extern int width, height;
- extern int mode;
- extern struct TagItem sTag[];
-
- /* Open up all the graphics: screen, window, and construct a
- message port to be used by more than one window */
- VOID
- openGraphics()
- {
- int cookies=4;
-
- if(!IntuitionBase)
- IntuitionBase = (struct IntuitionBase *)
- OpenLibrary("intuition.library",INTUITION_REV);
- if(IntuitionBase == NULL)
- myExit("Intuition Library");
-
- if(!GfxBase)
- GfxBase = (struct GfxBase *)
- OpenLibrary("graphics.library",GRAPHICS_REV);
- if(GfxBase == NULL)
- myExit("Graphics Libarary");
-
- if(!AslBase)
- AslBase = (struct AslBase *)
- OpenLibrary("asl.library",36L);
- if(AslBase==NULL)
- myExit("asl.library");
-
- if(!HameBase)
- HameBase = (struct Library *)
- OpenLibrary("hame.library",1L);
-
- if(!IFFBase)
- IFFBase = (struct IFFBase *)
- OpenLibrary("iff.library",IFFVERSION);
- if(IFFBase == NULL)
- myExit("iff.library");
-
-
- /* if((HameBase!=NULL) && (gWindow==NULL) ) {
- newscreen.Width=HIRES_WIDTH;
- newscreen.Height=HEIGHT;
- newscreen.LeftEdge=S_LEFTEDGE;
- newscreen.TopEdge=S_TOPEDGE;
- newscreen.ViewModes=HIRES;
- newscreen.Depth = 4;
- mode = COLORS_LACE_16;
- }
- */
- imageScreen = OpenScreenTagList(&newscreen,sTag);
- if(imageScreen == NULL) myExit("OpenScreen()");
-
-
- newwindow.Screen = imageScreen;
-
- if(messagePort==NULL) messagePort = CreatePort(NULL,0);
-
- /* Adjust the sizes of the image window, considering the screen
- size */
- newwindow.Width = imageScreen->Width;
- newwindow.Height = imageScreen->Height;
-
- newwindow.Flags = SMART_REFRESH | NOCAREREFRESH | BACKDROP
- | BORDERLESS | RMBTRAP;
- newwindow.TopEdge = 0;
- newwindow.LeftEdge = 0;
-
- newwindow.Screen = imageScreen;
- imageWindow = OpenWindow(&newwindow);
- if(imageWindow == NULL) myExit("Open Window()");
- if(imageWindow->UserPort) DeletePort(imageWindow->UserPort);
- imageWindow->UserPort = messagePort;
- ModifyIDCMP(imageWindow,GADGETDOWN|MOUSEBUTTONS);
-
- frontViewPort = ViewPortAddress(imageWindow);
- ShowTitle(imageScreen,0L);
-
- if( (mode==HAME) || (mode==HAME_LACE) )
- {
- if(mode==HAME_LACE) cookies=8;
- hamePort = HAME_Init( imageScreen, imageScreen->Width,
- imageScreen->Height,
- imageScreen->Height,
- 0,
- 0,
- 4,
- imageScreen->Height-cookies);
- if(hamePort==NULL) myExit("HamePort");
- }
- setColors(mode);
-
-
- signalmask = 1L << messagePort->mp_SigBit;
-
- }
-
- VOID
- creditScreen(VOID)
- {
- APTR ifffile=NULL;
- int ret=0;
- UWORD colortable[128];
-
- /* if(HameBase)
- {
- ifffile = NewOpenIFF("HEtitle.iff",MEMF_PUBLIC);
- if(ifffile)
- {
- GetColorTab(ifffile,colortable);
- LoadRGB4(&(imageScreen->ViewPort),colortable,16);
- ret = DecodePic(ifffile,&imageScreen->BitMap);
- RemakeDisplay();
- CloseIFF(ifffile);
- }
- }
- else */
- {
- ifffile = NewOpenIFF("title.iff",MEMF_PUBLIC);
- if(ifffile)
- {
- GetColorTab(ifffile,colortable);
- LoadRGB4(&(imageScreen->ViewPort),colortable,32);
- ret = DecodePic(ifffile,&imageScreen->BitMap);
- RemakeDisplay();
- CloseIFF(ifffile);
- }
- }
- }
-