Cavestory Mod API
SurfaceBitplane.h
Go to the documentation of this file.
1 /*
2  Cavestory Multiplayer API
3  Copyright (C) 2021 Johnny Ledger
4 
5  This software is provided 'as-is', without any express or implied
6  warranty. In no event will the authors be held liable for any damages
7  arising from the use of this software.
8 
9  Permission is granted to anyone to use this software for any purpose,
10  including commercial applications, and to alter it and redistribute it
11  freely, subject to the following restrictions:
12 
13  1. The origin of this software must not be misrepresented; you must not
14  claim that you wrote the original software. If you use this software
15  in a product, an acknowledgment in the product documentation would be
16  appreciated but is not required.
17  2. Altered source versions must be plainly marked as such, and must not be
18  misrepresented as being the original software.
19  3. This notice may not be removed or altered from any source distribution.
20 */
21 
26 #ifndef CAVESTORY_MOD_API_H_
27 #error "Please include CavestoryModAPI.h before including sub-classes."
28 #endif
29 
30 #include <CSMAPI_begincode.h>
31 
32 #pragma once
33 
34 
37 
41 {
44 
47 
49  SURF_BITPLANE_HAS_ALL = 0xFFFF
50 };
51 
55 {
59 
63 
67  unsigned int Flags;
68 
72 
77  char* Plane;
78 };
79 
84  SURFACE_BITPLANE* pPlane
85 );
86 
91  SURFACE_BITPLANE* pPlane
92 );
93 
105  Surface_Ids iSurfId,
106  GUI_RECT* pRect,
107  SURFACE_BITPLANE* pPlane,
108  unsigned int iFlags = SurfaceBitplaneFlags::SURF_BITPLANE_HAS_ALL,
109  unsigned char iAlphaThreshold = 10
110 );
111 
120  SURFACE_BITPLANE* pPlane,
121  int iX,
122  int iY
123 );
124 
127 
128 #include <CSMAPI_endcode.h>
Surface_Ids
List of surface IDs.
Definition: CSMAPI_enums.h:714
CAVESTORY_MOD_API void CSM_SurfaceBitplane_Free(SURFACE_BITPLANE *pPlane)
Free an allocated bitplane.
CAVESTORY_MOD_API BOOL CSM_SurfaceBitplane_IsPixelSolid(SURFACE_BITPLANE *pPlane, int iX, int iY)
Check to see if a pixel is collidable.
CAVESTORY_MOD_API void CSM_SurfaceBitplane_Init(SURFACE_BITPLANE *pPlane)
Initialize a bitplane object.
CAVESTORY_MOD_API BOOL CSM_SurfaceBitplane_Scan(Surface_Ids iSurfId, GUI_RECT *pRect, SURFACE_BITPLANE *pPlane, unsigned int iFlags=SurfaceBitplaneFlags::SURF_BITPLANE_HAS_ALL, unsigned char iAlphaThreshold=10)
Create a surface bitplane.
SurfaceBitplaneFlags
The flags responsible for identifying what information a bitplane object holds about a surface.
Definition: SurfaceBitplane.h:41
@ SURF_BITPLANE_HAS_BITPLANE
This bitplane contains a calculated collision bitplane.
Definition: SurfaceBitplane.h:46
@ SURF_BITPLANE_HAS_ALL
This bitplane contains everything listed above.
Definition: SurfaceBitplane.h:49
@ SURF_BITPLANE_HAS_BOUNDS
This bitplane contains a calculated bounding box.
Definition: SurfaceBitplane.h:43
#define CAVESTORY_MOD_API
Exports / imports Cavestory Mod API functions & classes.
Definition: CSMAPI_begincode.h:30
Definition: CSMAPI_types.h:842
A calculated collision bitplane for a surface.
Definition: SurfaceBitplane.h:55
Surface_Ids SurfId
The surface ID that this bitplane uses.
Definition: SurfaceBitplane.h:58
GUI_RECT Bounds
The calculated bounding box for this rect.
Definition: SurfaceBitplane.h:71
unsigned int Flags
The flags for this bitplane.
Definition: SurfaceBitplane.h:67
char * Plane
The calculated bitplane for this rect.
Definition: SurfaceBitplane.h:77
GUI_RECT SourceRect
The source rect that was used during the calculation of this bitplane.
Definition: SurfaceBitplane.h:62