Skip to content

Commit

Permalink
some improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
RicoRodriges committed Jan 26, 2020
1 parent 3afe951 commit 7c660cf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
8 changes: 6 additions & 2 deletions Build_Release/openclaw.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
<html lang="en">
<head>
<meta charset="UTF-8">

<title>OpenClaw</title>
<meta name="description" content="Reimplementation of Captain Claw (1997) platformer">

<meta property="og:title" content="OpenClaw project">
<meta property="og:description" content="OpenClaw open source project">
<!--<meta property="og:image" content="preview.png">-->
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<style>
#console {
width: 100%;
Expand All @@ -19,14 +22,15 @@
border: none;
font-size: 0.8em;
}

div {
margin: 0.7em 0;
}

button {
padding: 0.5em 2em;
}
</style>
<title>OpenClaw</title>
</head>
<body>
<div>
Expand Down
12 changes: 1 addition & 11 deletions OpenClaw/Engine/Scene/ActorSceneNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ void SDL2ActorSceneNode::VRender(Scene* pScene)
shared_ptr<Image> actorImage = MakeStrongPtr(arc->GetCurrentImage());
if (!actorImage)
{
LOG_WARNING("Trying to render actor without active image. ActorId: " + ToStr(m_Properties.GetActorId()));
return;
}

Expand Down Expand Up @@ -77,14 +78,3 @@ void SDL2ActorSceneNode::VRender(Scene* pScene)
SDL_RenderCopyEx(renderer, actorImage->GetTexture(), NULL, &renderRect, 0, NULL,
arc->IsMirrored() ? SDL_FLIP_HORIZONTAL : SDL_FLIP_NONE);
}

bool SDL2ActorSceneNode::VIsVisible(Scene *pScene) const {
if (!m_pRenderComponent) {
return false;
}

// SDL2ActorSceneNode::VRender should calculate actor position/size once and
// check intersection with camera at the same time.
// It lets decrease CPU usage every frame.
return true;
}
3 changes: 1 addition & 2 deletions OpenClaw/Engine/Scene/ActorSceneNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ class SDL2ActorSceneNode : public SceneNode
virtual ~SDL2ActorSceneNode();

// Interface overrides
void VRender(Scene* pScene) override;
bool VIsVisible(Scene *pScene) const override;
virtual void VRender(Scene* pScene);

protected:
};
Expand Down

0 comments on commit 7c660cf

Please sign in to comment.