Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F622676
Visibility.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
Visibility.h
View Options
//
// Created by Ido Mozes on 23/06/2019.
//
#ifndef SDL2_GAME_VISIBILITY_H
#define SDL2_GAME_VISIBILITY_H
#include
<fstream>
#include
<optional>
#include
"SDL.h"
#include
"SDL_image.h"
#include
"../Component.h"
class
Visibility
:
public
Component
{
SDL_Surface
*
surface
=
nullptr
;
SDL_Texture
*
texture
=
nullptr
;
std
::
optional
<
SDL_Rect
>
dstRect
;
public
:
float
angle
=
0
;
bool
hidden
=
false
;
static
constexpr
ComponentType
type
=
ComponentType
::
VISIBILITY
;
Visibility
(
SDL_Texture
*
newTexture
,
SDL_Surface
*
newSurface
,
std
::
optional
<
SDL_Rect
>
dstR
=
std
::
nullopt
,
float
angle
=
0
,
bool
hidden
=
false
)
:
dstRect
(
dstR
),
angle
(
angle
),
hidden
(
hidden
),
texture
(
newTexture
),
surface
(
newSurface
)
{
reloadTexture
();
}
SDL_Texture
*
getTexture
()
{
return
texture
;
}
SDL_Rect
*
getDstRect
()
{
return
dstRect
?
&
dstRect
.
value
()
:
nullptr
;
}
void
setDstRect
(
SDL_Rect
newDstRect
)
{
dstRect
.
value
()
=
newDstRect
;
}
void
setPosition
(
int
x
,
int
y
);
void
reloadTexture
(
SDL_Texture
*
newTexture
=
nullptr
,
SDL_Surface
*
newSurface
=
nullptr
);
};
#endif
//SDL2_GAME_VISIBILITY_H
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Sat, Nov 14, 8:25 PM (42 m, 49 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
139618
Default Alt Text
Visibility.h (1 KB)
Attached To
Mode
R74 BloonsTD
Attached
Detach File
Event Timeline