Commit c276c5c6 authored by Boris Mühmer's avatar Boris Mühmer
Browse files

splitted main

parent a4641847
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
#include "main.h"

struct IntuiText DText=
  {
  GREENPEN,BLACKPEN,
+1 −84
Original line number Diff line number Diff line
#include <functions.h>
#include <graphics/gfxbase.h>
#include <graphics/rastport.h>
#include <intuition/intuitionbase.h>
#include <stdio.h>
#include <ctype.h>
#include "defs.h"

#define ABOX(x1,y1,x2,y2) SetAPen(ConPort,GREENPEN);RectFill(ConPort,(long) 10*x1,(long) 5*y1+5,(long) 10*x2+9,(long) 5*y2+9)
#define EBOX(x1,y1,x2,y2) SetAPen(ConPort,BLACKPEN);RectFill(ConPort,(long) 10*x1,(long) 5*y1+5,(long) 10*x2+9,(long) 5*y2+9)
#include "main.h"

struct NewScreen NScreen =
  {
@@ -452,78 +443,4 @@ struct NShip ship[SHIPNO]=
    }
  };

main()
  {
  /* Opening Libs */
  IntuitionBase = (struct IntuitionBase *) OpenLibrary("intuition.library",LIBRARY_VERSION);
  if(IntuitionBase==NULL) cleanup("Unable to open intuition.library");
  GfxBase = (struct GfxBase *) OpenLibrary("graphics.library",LIBRARY_VERSION);
  if (GfxBase==NULL) cleanup("Unable to open graphics.library");
  /* Opening Screen */
  ConScreen=(struct Screen *) OpenScreen(&NScreen);
  if (ConScreen==NULL) cleanup("Unable to open conscreen");
  ScreenToFront(ConScreen);
  ShowTitle(ConScreen,FALSE);
  SetRGB4(&(ConScreen->ViewPort),BLACKPEN, 0L, 0L, 0L);    /* Black  */
  SetRGB4(&(ConScreen->ViewPort),WHITEPEN,15L,15L,15L);    /* White  */
  SetRGB4(&(ConScreen->ViewPort),GREENPEN, 5L,13L, 0L);    /* Green  */
  SetRGB4(&(ConScreen->ViewPort),OTHERPEN,15L,12L, 0L);    /* Orange */
  SetRGB4(&(ConScreen->ViewPort),PLAYERPEN(0),15L, 2L, 0L);/* Red    */
  SetRGB4(&(ConScreen->ViewPort),PLAYERPEN(1), 7L, 9L,15L);/* Blue   */
  SetRGB4(&(ConScreen->ViewPort),PLAYERPEN(2),15L,15L, 2L);/* Yellow */
  SetRGB4(&(ConScreen->ViewPort),PLAYERPEN(3), 0L,15L, 2L);/* Full Green */
  SetRGB4(&(ConScreen->ViewPort),SPRITEPEN(0), 0L, 0L, 0L);/* Black  */
  SetRGB4(&(ConScreen->ViewPort),SPRITEPEN(1), 5L,13L, 0L);/* Green  */
  SetRGB4(&(ConScreen->ViewPort),SPRITEPEN(2),15L,15L,15L);/* White  */
  SetRGB4(&(ConScreen->ViewPort),SPRITEPEN(3),15L,12L, 0L);/* Orange */
  NWindow.Screen=ConScreen;
  ConWindow=(struct Window *) OpenWindow(&NWindow);
  if(ConWindow==NULL) cleanup("Unable to open ConWindow");
  SetPointer(ConWindow,CrossPointer,9L,9L,-5L,-5L);
  ConPort=ConWindow->RPort;
  title();
  conquest();
  cleanup("OK.");
  }
cleanup(str)
char *str;
  {
  puts(str);
  if (file!=-1) close(file);
  if (ConWindow) CloseWindow(ConWindow);
  if (ConScreen) CloseScreen(ConScreen);
  if (GfxBase) CloseLibrary(GfxBase);
  if (IntuitionBase) CloseLibrary(IntuitionBase);
  exit(1);
  }
title()
  {
  Move(ConPort,232L,10L);
  Text(ConPort,"by",2L);
  ABOX( 8, 0,15,15);
  EBOX(10, 2,15,13);
  ABOX(18, 8,25,15);
  EBOX(20,10,23,13);
  ABOX(24,16,25,16);
  ABOX(28, 7,29,15);
  ABOX(30, 8,33, 9);
  ABOX(36, 2,37,15);
  ABOX(38,14,39,15);
  ABOX( 0,20, 7,35);
  EBOX( 2,22, 7,33);
  ABOX( 2,26, 5,27);
  ABOX(10,28,17,35);
  EBOX(12,30,15,33);
  ABOX(16,22,17,27);
  ABOX(20,27,21,27);
  ABOX(20,28,29,35);
  EBOX(22,30,23,35);
  EBOX(26,30,27,35);
  ABOX(32,28,39,35);
  EBOX(34,30,37,33);
  ABOX(38,36,39,36);
  ABOX(42,28,47,35);
  EBOX(44,30,45,35);
  ABOX(42,27,43,27);
  }
#include "human.c"

amiga/main.h

0 → 100644
+11 −0
Original line number Diff line number Diff line
#include <functions.h>
#include <graphics/gfxbase.h>
#include <graphics/rastport.h>
#include <intuition/intuitionbase.h>
#include <stdio.h>
#include <ctype.h>
#include "defs.h"

#define ABOX(x1,y1,x2,y2) SetAPen(ConPort,GREENPEN);RectFill(ConPort,(long) 10*x1,(long) 5*y1+5,(long) 10*x2+9,(long) 5*y2+9)
#define EBOX(x1,y1,x2,y2) SetAPen(ConPort,BLACKPEN);RectFill(ConPort,(long) 10*x1,(long) 5*y1+5,(long) 10*x2+9,(long) 5*y2+9)

amiga/main_cleanup.c

0 → 100644
+13 −0
Original line number Diff line number Diff line
#include "main.h"

cleanup(str)
char *str;
  {
  puts(str);
  if (file!=-1) close(file);
  if (ConWindow) CloseWindow(ConWindow);
  if (ConScreen) CloseScreen(ConScreen);
  if (GfxBase) CloseLibrary(GfxBase);
  if (IntuitionBase) CloseLibrary(IntuitionBase);
  exit(1);
  }

amiga/main_main.c

0 → 100644
+35 −0
Original line number Diff line number Diff line
#include "main.h"

main()
  {
  /* Opening Libs */
  IntuitionBase = (struct IntuitionBase *) OpenLibrary("intuition.library",LIBRARY_VERSION);
  if(IntuitionBase==NULL) cleanup("Unable to open intuition.library");
  GfxBase = (struct GfxBase *) OpenLibrary("graphics.library",LIBRARY_VERSION);
  if (GfxBase==NULL) cleanup("Unable to open graphics.library");
  /* Opening Screen */
  ConScreen=(struct Screen *) OpenScreen(&NScreen);
  if (ConScreen==NULL) cleanup("Unable to open conscreen");
  ScreenToFront(ConScreen);
  ShowTitle(ConScreen,FALSE);
  SetRGB4(&(ConScreen->ViewPort),BLACKPEN, 0L, 0L, 0L);    /* Black  */
  SetRGB4(&(ConScreen->ViewPort),WHITEPEN,15L,15L,15L);    /* White  */
  SetRGB4(&(ConScreen->ViewPort),GREENPEN, 5L,13L, 0L);    /* Green  */
  SetRGB4(&(ConScreen->ViewPort),OTHERPEN,15L,12L, 0L);    /* Orange */
  SetRGB4(&(ConScreen->ViewPort),PLAYERPEN(0),15L, 2L, 0L);/* Red    */
  SetRGB4(&(ConScreen->ViewPort),PLAYERPEN(1), 7L, 9L,15L);/* Blue   */
  SetRGB4(&(ConScreen->ViewPort),PLAYERPEN(2),15L,15L, 2L);/* Yellow */
  SetRGB4(&(ConScreen->ViewPort),PLAYERPEN(3), 0L,15L, 2L);/* Full Green */
  SetRGB4(&(ConScreen->ViewPort),SPRITEPEN(0), 0L, 0L, 0L);/* Black  */
  SetRGB4(&(ConScreen->ViewPort),SPRITEPEN(1), 5L,13L, 0L);/* Green  */
  SetRGB4(&(ConScreen->ViewPort),SPRITEPEN(2),15L,15L,15L);/* White  */
  SetRGB4(&(ConScreen->ViewPort),SPRITEPEN(3),15L,12L, 0L);/* Orange */
  NWindow.Screen=ConScreen;
  ConWindow=(struct Window *) OpenWindow(&NWindow);
  if(ConWindow==NULL) cleanup("Unable to open ConWindow");
  SetPointer(ConWindow,CrossPointer,9L,9L,-5L,-5L);
  ConPort=ConWindow->RPort;
  title();
  conquest();
  cleanup("OK.");
  }
Loading