-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathbflib_mspointer.hpp
74 lines (69 loc) · 2.52 KB
/
bflib_mspointer.hpp
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
/******************************************************************************/
// Bullfrog Engine Emulation Library - for use to remake classic games like
// Syndicate Wars, Magic Carpet or Dungeon Keeper.
/******************************************************************************/
/** @file bflib_mspointer.hpp
* Header file for bflib_mspointer.cpp.
* @par Purpose:
* Graphics drawing support sdk class.
* @par Comment:
* Just a header file - #defines, typedefs, function prototypes etc.
* @author Tomasz Lis
* @date 16 Nov 2008 - 21 Nov 2009
* @par Copying and copyrights:
* 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
* (at your option) any later version.
*/
/******************************************************************************/
#ifndef BFLIB_MSPOINTER_H
#define BFLIB_MSPOINTER_H
#include "bflib_basics.h"
#include "bflib_semphr.hpp"
#include "bflib_planar.h"
#include "bflib_vidsurface.h"
#include "bflib_video.h"
/******************************************************************************/
#define CURSOR_SCALING_XSTEPS MAX_SUPPORTED_SCREEN_WIDTH/10
#define CURSOR_SCALING_YSTEPS MAX_SUPPORTED_SCREEN_HEIGHT/10
extern long cursor_xsteps_array[2*CURSOR_SCALING_XSTEPS];
extern long cursor_ysteps_array[2*CURSOR_SCALING_YSTEPS];
/******************************************************************************/
// Exported class
class LbI_PointerHandler {
public:
LbI_PointerHandler(void);
~LbI_PointerHandler(void);
void SetHotspot(long x, long y);
void Initialise(struct TbSprite *spr, struct TbPoint *, struct TbPoint *);
void Release(void);
void NewMousePos(void);
bool OnMove(void);
void OnBeginPartialUpdate(void);
void OnEndPartialUpdate(void);
void OnBeginSwap(void);
void OnEndSwap(void);
void OnBeginFlip(void);
void OnEndFlip(void);
protected:
void ClipHotspot(void);
void Draw(bool);
void Undraw(bool);
void Backup(bool);
// Properties
struct SSurface surf1;
struct SSurface surf2;
//unsigned char sprite_data[4096];
struct TbPoint *position;
struct TbPoint *spr_offset;
struct TbRect rect_1038;
long draw_pos_x;
long draw_pos_y;
bool field_1050;
bool field_1054;
struct TbSprite *sprite;
LbSemaphore sema_rel;
};
/******************************************************************************/
#endif