-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.c
executable file
·111 lines (105 loc) · 2.98 KB
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/*
** Main function
*/
#include "includes.h"
#include "globals.h"
const char *version = "$VER: "PROGNAME" "VERSION"."REVISION" (05.02.14)©2014,"DEVELOPER"\n\0";
int main( void )
{
ULONG result=0;
camera.z = 1.0;
camera.x = 0.0;
camera.y = 0.0;
delay = 0;
zwheel =0;
Clicked = FALSE;
LensFlag =TRUE;
Filter = TRUE;
steps = 0;
struct BitMap *lensb;
if((buffPort = IExec->AllocSysObjectTags(ASOT_PORT, TAG_DONE))&&(winPort =IExec->AllocSysObjectTags(ASOT_PORT, TAG_DONE)))
{
OpenLibs();
AppRegistering();
if((IDOS->Cli())== NULL)
{
IDOS->Printf("This program not to be run from Workbench\n");
CleanExit("JustExit");
}
result = LockScreens();
if(result ==0) CleanExit("JustExit");
if ((scr = IIntuition->OpenScreenTags(NULL,
SA_DisplayID,ID,
SA_Width,Resolution.Width,
SA_Height,Resolution.Height,
SA_LikeWorkbench,TRUE,
SA_ShowTitle, FALSE,
TAG_DONE)))
{
if ((doicon = IIcon->GetIconTags("Sys:Utilities/Multiview",
ICONGETA_Screen,scr,
ICONGETA_GenerateImageMasks,TRUE,
TAG_DONE)))
{
result =IIcon->IconControl(doicon,
ICONCTRLA_GetBitMap1,&lensb,
ICONCTRLA_GetImageMask1,&lensalpha,
ICONCTRLA_GetWidth,&ow,
ICONCTRLA_GetHeight,&oh,
ICONCTRLA_SetGlobalScreen,scr,
ICONCTRLA_SetGlobalPrecision,PRECISION_EXACT,
TAG_DONE);
if((lens = IGraphics->AllocBitMap(ow,oh,32,BMF_CLEAR | BMF_DISPLAYABLE,scr->RastPort.BitMap)))
{
IGraphics->BltBitMapTags(BLITA_Width, ow,
BLITA_Height, oh,
BLITA_Source, lensb,
BLITA_SrcType, BLITT_BITMAP,
BLITA_UseSrcAlpha, TRUE,
BLITA_Dest,lens,
BLITA_DestType, BLITT_BITMAP,
BLITA_MaskPlane,lensalpha,
TAG_DONE);
IIcon->FreeDiskObject(doicon);
}
}
SetDestinationOutside(scr);
if((win = IIntuition->OpenWindowTags (NULL,
WA_CustomScreen,scr,
WA_NoCareRefresh, TRUE,
WA_Activate, TRUE,
WA_Borderless, TRUE,
WA_ReportMouse, TRUE,
WA_Backdrop, TRUE,
WA_Backdrop,TRUE,
WA_Pointer,POINTERTYPE_NONE ,
WA_UserPort, winPort,
WA_Flags,WFLG_ACTIVATE,
WA_IDCMP,IDCMP_MOUSEBUTTONS| IDCMP_MOUSEMOVE |IDCMP_EXTENDEDMOUSE|IDCMP_RAWKEY,
TAG_END)))
{
if ( !( scbuf[ 0 ] = IIntuition->AllocScreenBuffer( scr, NULL, SB_SCREEN_BITMAP ) ) )
{
CleanExit( "Couldn't allocate ScreenBuffer 1" );
}
if ( !( scbuf[ 1 ] = IIntuition->AllocScreenBuffer( scr, NULL, SB_COPY_BITMAP ) ) )
{
CleanExit( "Couldn't allocate ScreenBuffer 2" );
}
scbuf[ 0 ]->sb_DBufInfo->dbi_UserData1 = ( APTR ) ( 0 );
scbuf[ 1 ]->sb_DBufInfo->dbi_UserData1 = ( APTR ) ( 1 );
status[ 0 ] = OK_REDRAW;
status[ 1 ] = OK_REDRAW;
IGraphics->InitRastPort( &rport[0] );
IGraphics->InitRastPort( &rport[1] );
rport[ 0 ].BitMap = scbuf[0]->sb_BitMap;
rport[ 1 ].BitMap = scbuf[1]->sb_BitMap;
buf_current = 0;
buf_nextdraw = 1;
buf_nextswap = 1;
Events();
}
}
}
CleanExit("JustExit");
}