-
Notifications
You must be signed in to change notification settings - Fork 3
/
amal_object_bob.cpp
103 lines (85 loc) · 1.85 KB
/
amal_object_bob.cpp
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
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#ifdef __amigaos4__
#include <proto/dos.h>
#include <libraries/retroMode.h>
#include <proto/retroMode.h>
#include <amoskittens.h>
#endif
#ifdef __linux__
#include <stdint.h>
#include "os/linux/stuff.h"
#include <retromode.h>
#include <retromode_lib.h>
#define Printf printf
#endif
#include "AmalCompiler.h"
#include "channel.h"
extern std::vector<struct retroSpriteObject *> bobs;
static int getMax ( void )
{
unsigned int n=0;
for (n=0;n<bobs.size();n++) if (bobs[n]->id>n) n=bobs[n]-> id;
return (int) n;
}
extern struct retroSpriteObject *getBob(int id);
extern struct retroSpriteObject *getBob(unsigned int id);
extern int getBobImage(unsigned int id);
extern int getBobX(unsigned int id);
extern int getBobY(unsigned int id);
static void setImage (unsigned int object,int image)
{
struct retroScreen *s;
struct retroSpriteObject *bob;
if (bob = getBob( object ))
{
bob -> image = image;
s = instance.screens[ bob -> screen_id ];
if (s) s ->event_flags |= rs_bob_moved;
}
}
static void setX (unsigned int object,int x)
{
struct retroScreen *s;
struct retroSpriteObject *bob;
if (bob = getBob( object ))
{
bob -> x = x;
s = instance.screens[ bob -> screen_id ];
if (s) s ->event_flags |= rs_bob_moved;
}
}
static void setY (unsigned int object,int y)
{
struct retroScreen *s;
struct retroSpriteObject *bob;
if (bob = getBob( object ))
{
bob -> y = y;
s = instance.screens[ bob -> screen_id ];
if (s) s ->event_flags |= rs_bob_moved;
}
}
static struct retroScreen *getScreen(unsigned int object)
{
struct retroSpriteObject *bob;
if (bob = getBob( object ))
{
return instance.screens[ bob -> screen_id ];
}
return NULL;
}
struct channelAPI bob_api =
{
getMax,
getBobImage,
getBobX,
getBobY,
setImage,
setX,
setY,
getScreen
};