Main screen update

This commit is contained in:
yvt 2013-11-23 22:13:04 +09:00
parent 8ba4628b32
commit 2e78b346a0
8 changed files with 461 additions and 40 deletions

View File

@ -240,6 +240,9 @@
E8F74CE5183F86AE0085AA54 /* View.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E8F74CE3183F86AE0085AA54 /* View.cpp */; };
E8F74CE9183F8B9D0085AA54 /* Runner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E8F74CE7183F8B9D0085AA54 /* Runner.cpp */; };
E8F74CEB183F92DA0085AA54 /* SDLmain.m in Sources */ = {isa = PBXBuildFile; fileRef = E8F74CEA183F92DA0085AA54 /* SDLmain.m */; };
E8F74CEF183FBA9C0085AA54 /* MainScreenHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E8F74CED183FBA9C0085AA54 /* MainScreenHelper.cpp */; };
E8F74CF2183FBB070085AA54 /* MainScreenHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E8F74CF0183FBB070085AA54 /* MainScreenHelper.cpp */; };
E8F74CF51840D4CC0085AA54 /* Config.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E8F74CF31840D4CC0085AA54 /* Config.cpp */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
@ -754,6 +757,10 @@
E8F74CE8183F8B9D0085AA54 /* Runner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Runner.h; sourceTree = "<group>"; };
E8F74CEA183F92DA0085AA54 /* SDLmain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLmain.m; sourceTree = "<group>"; };
E8F74CEC183F931F0085AA54 /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLMain.h; sourceTree = "<group>"; };
E8F74CED183FBA9C0085AA54 /* MainScreenHelper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MainScreenHelper.cpp; sourceTree = "<group>"; };
E8F74CEE183FBA9C0085AA54 /* MainScreenHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainScreenHelper.h; sourceTree = "<group>"; };
E8F74CF0183FBB070085AA54 /* MainScreenHelper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MainScreenHelper.cpp; sourceTree = "<group>"; };
E8F74CF31840D4CC0085AA54 /* Config.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Config.cpp; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -1178,6 +1185,8 @@
E8B6B74717EA12E100E35523 /* IWeaponSkin.cpp */,
E8B6B74817EA12E500E35523 /* IWeaponSkin.h */,
E81CE4A4183F7A3000F22685 /* IFont.cpp */,
E8F74CF0183FBB070085AA54 /* MainScreenHelper.cpp */,
E8F74CF31840D4CC0085AA54 /* Config.cpp */,
);
name = ScriptBindings;
path = Sources/ScriptBindings;
@ -1294,6 +1303,8 @@
E80B28D417B1100D0056179E /* AboutText.html */,
E81CE4A7183F7F2000F22685 /* MainScreen.cpp */,
E81CE4A8183F7F2000F22685 /* MainScreen.h */,
E8F74CED183FBA9C0085AA54 /* MainScreenHelper.cpp */,
E8F74CEE183FBA9C0085AA54 /* MainScreenHelper.h */,
E8F74CE3183F86AE0085AA54 /* View.cpp */,
E8F74CE4183F86AE0085AA54 /* View.h */,
E8F74CE7183F8B9D0085AA54 /* Runner.cpp */,
@ -1764,6 +1775,7 @@
E834F56517951B1C004EBE88 /* MemoryStream.cpp in Sources */,
E834F56817979F5A004EBE88 /* Quake3Font.cpp in Sources */,
E834F56B17979FD7004EBE88 /* IFont.cpp in Sources */,
E8F74CEF183FBA9C0085AA54 /* MainScreenHelper.cpp in Sources */,
E834F56F1797D934004EBE88 /* ChatWindow.cpp in Sources */,
E8E0AF8A1798278000C6B5A9 /* GLImageRenderer.cpp in Sources */,
E8E0AF94179942DB00C6B5A9 /* Corpse.cpp in Sources */,
@ -1772,6 +1784,7 @@
E8E0AF9D179A5BC200C6B5A9 /* GLFlatMapRenderer.cpp in Sources */,
E8E0AFA0179A698800C6B5A9 /* MapView.cpp in Sources */,
E8E0AFA3179A8F1100C6B5A9 /* ScoreboardView.cpp in Sources */,
E8F74CF2183FBB070085AA54 /* MainScreenHelper.cpp in Sources */,
E8F74CE9183F8B9D0085AA54 /* Runner.cpp in Sources */,
E8E0AFA6179AA31C00C6B5A9 /* LimboView.cpp in Sources */,
E8E0AFA9179ACDDE00C6B5A9 /* GLSpriteRenderer.cpp in Sources */,
@ -1807,6 +1820,7 @@
E80B288217A516D70056179E /* advancing_front.cc in Sources */,
E80B288317A516D70056179E /* cdt.cc in Sources */,
E80B288417A516D70056179E /* sweep.cc in Sources */,
E8F74CF51840D4CC0085AA54 /* Config.cpp in Sources */,
E80B288517A516D70056179E /* sweep_context.cc in Sources */,
E80B288817A52AB70056179E /* BitmapAtlasGenerator.cpp in Sources */,
E80B288D17A5FFB50056179E /* ThreadLocalStorage.cpp in Sources */,

View File

@ -20,4 +20,5 @@
#include "UIFramework.as"
#include "UIControls.as"
#include "MessageBox.as"
#include "MainScreen.as"

View File

@ -19,17 +19,21 @@
*/
namespace spades {
class MainScreenUI {
private Renderer@ renderer;
private AudioDevice@ audioDevice;
private Font@ font;
private MainScreenHelper@ helper;
private spades::ui::UIManager@ manager;
spades::ui::UIManager@ manager;
private bool shouldExit = false;
MainScreenMainMenu@ mainMenu;
private float time = 0.f;
bool shouldExit = false;
private float time = -1.f;
MainScreenUI(Renderer@ renderer, AudioDevice@ audioDevice, Font@ font, MainScreenHelper@ helper) {
@this.renderer = renderer;
@ -37,18 +41,22 @@ namespace spades {
@this.font = font;
@this.helper = helper;
// load map
@renderer.GameMap = GameMap("Maps/mesa.vxl");
renderer.FogColor = Vector3(0.11f, 0.10f, 0.2f);
renderer.FogDistance = 128.f;
SetupRenderer();
@manager = spades::ui::UIManager(renderer, audioDevice);
@manager.RootElement.Font = font;
spades::ui::Button button(manager);
button.Caption = "Not implemented! Sorry!";
button.Bounds = AABB2(200.f, 200.f, 120.f, 32.f);
manager.RootElement.AddChild(button);
@mainMenu = MainScreenMainMenu(this);
mainMenu.Bounds = manager.RootElement.Bounds;
manager.RootElement.AddChild(mainMenu);
}
private void SetupRenderer() {
// load map
@renderer.GameMap = GameMap("Maps/Title.vxl");
renderer.FogColor = Vector3(0.1f, 0.10f, 0.1f);
renderer.FogDistance = 128.f;
}
void MouseEvent(float x, float y) {
@ -56,10 +64,6 @@ namespace spades {
}
void KeyEvent(string key, bool down) {
if(key == "Escape") {
shouldExit = true;
return;
}
manager.KeyEvent(key, down);
}
@ -82,24 +86,48 @@ namespace spades {
}
void RunFrame(float dt) {
if(time < 0.f) {
time = 0.f;
}
SceneDefinition sceneDef;
float cameraX = time;
cameraX -= floor(cameraX / 512.f) * 512.f;
cameraX = 512.f - cameraX;
sceneDef = SetupCamera(sceneDef,
Vector3(256.f, 256.f, 1.f), Vector3(256.f, 257.f, 2.f), Vector3(0.f, 0.f, -1.f),
80.f);
sceneDef.zNear = 1.f;
sceneDef.zFar = 200.f;
Vector3(cameraX, 256.f, 12.f), Vector3(cameraX + .1f, 257.f, 12.5f), Vector3(0.f, 0.f, -1.f),
30.f);
sceneDef.zNear = 0.1f;
sceneDef.zFar = 222.f;
sceneDef.time = int(time * 1000.f);
sceneDef.viewportWidth = int(renderer.ScreenWidth);
sceneDef.viewportHeight = int(renderer.ScreenHeight);
sceneDef.denyCameraBlur = true;
sceneDef.depthOfFieldNearRange = 100.f;
sceneDef.skipWorld = false;
renderer.StartScene(sceneDef);
renderer.EndScene();
// fade the map
float fade = Clamp((time - 1.f) / 2.2f, 0.f, 1.f);
if(fade < 1.f) {
renderer.Color = Vector4(0.f, 0.f, 0.f, 1.f - fade);
renderer.DrawImage(renderer.RegisterImage("Gfx/White.tga"),
AABB2(0.f, 0.f, renderer.ScreenWidth, renderer.ScreenHeight));
}
// draw title logo
Image@ img = renderer.RegisterImage("Gfx/Title/Logo.png");
renderer.Color = Vector4(1.f, 1.f, 1.f, 1.f);
renderer.DrawImage(img, Vector2((renderer.ScreenWidth - img.Width) * 0.5f, 64.f));
manager.RunFrame(dt);
manager.Render();
renderer.FrameDone();
renderer.Flip();
time += dt;
time += Min(dt, 0.05f);
}
void Closing() {
@ -111,6 +139,124 @@ namespace spades {
}
}
class ServerListItem: spades::ui::ButtonBase {
string Text;
ServerListItem(spades::ui::UIManager@ manager){
super(manager);
}
void OnActivated() {
ButtonBase::OnActivated();
}
void Render() {
Renderer@ renderer = Manager.Renderer;
Vector2 pos = ScreenPosition;
Vector2 size = Size;
Image@ img = renderer.RegisterImage("Gfx/White.tga");
if(Pressed && Hover) {
renderer.Color = Vector4(1.f, 1.f, 1.f, 0.3f);
} else if(Hover) {
renderer.Color = Vector4(1.f, 1.f, 1.f, 0.15f);
} else {
renderer.Color = Vector4(1.f, 1.f, 1.f, 0.0f);
}
renderer.DrawImage(img, AABB2(pos.x, pos.y, size.x, size.y));
Font.Draw(Text, ScreenPosition + Vector2(2.f, 2.f), 1.f, Vector4(1,1,1,1));
Font.Draw("TODO", ScreenPosition + Vector2(100.f, 2.f), 1.f, Vector4(1,1,1,1));
Font.Draw("Blahblah", ScreenPosition + Vector2(200.f, 2.f), 1.f, Vector4(1,1,1,1));
}
}
class ServerListModel: spades::ui::ListViewModel {
spades::ui::UIManager@ manager;
ServerListModel(spades::ui::UIManager@ manager) {
@this.manager = manager;
}
int NumRows { get { return 100; } }
spades::ui::UIElement@ CreateElement(int row) {
ServerListItem i(manager);
// TODO: implement
i.Text = "Row " + ToString(row);
return i;
}
void RecycleElement(spades::ui::UIElement@ elem) {}
}
class MainScreenMainMenu: spades::ui::UIElement {
MainScreenUI@ ui;
spades::ui::Field@ addressField;
spades::ui::ListView@ serverList;
private ConfigItem cg_lastQuickConnectHost("cg_lastQuickConnectHost");
MainScreenMainMenu(MainScreenUI@ ui) {
super(ui.manager);
@this.ui = ui;
float contentsWidth = 600.f;
float contentsLeft = (Manager.Renderer.ScreenWidth - contentsWidth) * 0.5f;
float footerPos = Manager.Renderer.ScreenHeight - 40.f;
{
spades::ui::Button button(Manager);
button.Caption = "Connect";
button.Bounds = AABB2(contentsLeft + contentsWidth - 150.f, 200.f, 150.f, 30.f);
button.Activated = EventHandler(this.OnConnectPressed);
AddChild(button);
}
{
@addressField = spades::ui::Field(Manager);
addressField.Bounds = AABB2(contentsLeft, 200, contentsWidth - 160.f, 30.f);
addressField.Placeholder = "Quick Connect";
addressField.Text = cg_lastQuickConnectHost.StringValue;
addressField.Changed = spades::ui::EventHandler(this.OnAddressChanged);
AddChild(addressField);
}
{
@serverList = spades::ui::ListView(Manager);
serverList.Bounds = AABB2(contentsLeft, 240.f, contentsWidth, footerPos - 250.f);
AddChild(serverList);
@serverList.Model = ServerListModel(Manager);
}
}
private void OnAddressChanged(spades::ui::UIElement@ sender) {
cg_lastQuickConnectHost = addressField.Text;
}
private void Connect() {
string text = "This feature is not implemented.";
text += text;
text += text;
text += text;
text += text;
text += text;
text += text;
AlertScreen al(this, text);
al.Run();
}
private void OnConnectPressed(spades::ui::UIElement@ sender) {
Connect();
}
void HotKey(string key) {
if(IsEnabled and key == "Enter") {
Connect();
} else if(IsEnabled and key == "Escape") {
ui.shouldExit = true;
} else {
UIElement::HotKey(key);
}
}
}
MainScreenUI@ CreateMainScreenUI(Renderer@ renderer, AudioDevice@ audioDevice,
Font@ font, MainScreenHelper@ helper) {
return MainScreenUI(renderer, audioDevice, font, helper);

View File

@ -23,12 +23,15 @@
#include <Core/Exception.h>
#include <Client/Quake3Font.h>
#include <Client/FontData.h>
#include <ScriptBindings/ScriptFunction.h>
#include "MainScreenHelper.h"
namespace spades {
namespace gui {
MainScreen::MainScreen(client::IRenderer *r, client::IAudioDevice *a) :
renderer(r),
audioDevice(a){
SPADES_MARK_FUNCTION();
if(r == NULL)
SPInvalidArgument("r");
if(a == NULL)
@ -36,66 +39,168 @@ namespace spades {
font = new client::Quake3Font(renderer,
renderer->RegisterImage("Gfx/Fonts/UbuntuCondensed.tga"),
(const int*)UbuntuCondensedMap,
renderer->RegisterImage("Gfx/Fonts/SquareFontModified.png"),
(const int*)SquareFontMap,
24,
4);
SPLog("Font 'Ubuntu Condensed' Loaded");
shouldBeClosed = false;
helper = new MainScreenHelper(this);
// first call to RunFrame tends to have larger dt value.
// so this value is set in the first call.
timeToStartInitialization = 1000.f;
}
MainScreen::~MainScreen(){
SPADES_MARK_FUNCTION();
helper->MainScreenDestroyed();
}
void MainScreen::MouseEvent(float x, float y) {
SPADES_MARK_FUNCTION();
if(subview){
subview->MouseEvent(x, y);
return;
}
if(!ui){
return;
}
static ScriptFunction func("MainScreenUI", "void MouseEvent(float, float)");
ScriptContextHandle c = func.Prepare();
c->SetObject(&*ui);
c->SetArgFloat(0, x);
c->SetArgFloat(1, y);
c.ExecuteChecked();
}
void MainScreen::KeyEvent(const std::string & key, bool down) {
SPADES_MARK_FUNCTION();
if(subview){
subview->KeyEvent(key, down);
return;
}
if(key == "Escape"){
shouldBeClosed = true;
if(!ui){
return;
}
static ScriptFunction func("MainScreenUI", "void KeyEvent(string, bool)");
ScriptContextHandle c = func.Prepare();
std::string k = key;
c->SetObject(&*ui);
c->SetArgObject(0, reinterpret_cast<void*>(&k));
c->SetArgByte(1, down ? 1 : 0);
c.ExecuteChecked();
}
void MainScreen::CharEvent(const std::string &ch) {
SPADES_MARK_FUNCTION();
if(subview){
subview->CharEvent(ch);
return;
}
}
void MainScreen::RunFrame(float dt) {
if(subview){
subview->RunFrame(dt);
if(!ui){
return;
}
float w = renderer->ScreenWidth();
float h = renderer->ScreenHeight();
static ScriptFunction func("MainScreenUI", "void CharEvent(string)");
ScriptContextHandle c = func.Prepare();
std::string k = ch;
c->SetObject(&*ui);
c->SetArgObject(0, reinterpret_cast<void*>(&k));
c.ExecuteChecked();
}
bool MainScreen::WantsToBeClosed() {
SPADES_MARK_FUNCTION();
if(!ui){
return false;
}
static ScriptFunction func("MainScreenUI", "bool WantsToBeClosed()");
ScriptContextHandle c = func.Prepare();
c->SetObject(&*ui);
c.ExecuteChecked();
return c->GetReturnByte() != 0;
}
void MainScreen::DrawStartupScreen() {
SPADES_MARK_FUNCTION();
Handle<client::IImage> img;
Vector2 scrSize = {renderer->ScreenWidth(),
renderer->ScreenHeight()};
Handle<client::IImage> img = renderer->RegisterImage("Gfx/White.tga");
renderer->SetColor(MakeVector4(0.f, 0.f, 0.f, 1.f));
renderer->DrawImage(img, AABB2(0.f, 0.f, w, h));
font->Draw("Not Implemented", MakeVector2(20.f, 20.f),
1.f, MakeVector4(1.f, 1.f, 1.f, 1.f));
renderer->SetColor(MakeVector4(0, 0, 0, 1.));
img = renderer->RegisterImage("Gfx/White.tga");
renderer->DrawImage(img, AABB2(0, 0,
scrSize.x, scrSize.y));
std::string str = "NOW LOADING";
Vector2 size = font->Measure(str);
Vector2 pos = MakeVector2(scrSize.x - 16.f, scrSize.y - 16.f);
pos -= size;
font->DrawShadow(str, pos, 1.f, MakeVector4(1,1,1,1), MakeVector4(0,0,0,0.5));
renderer->FrameDone();
renderer->Flip();
}
void MainScreen::RunFrame(float dt) {
SPADES_MARK_FUNCTION();
if(subview){
subview->RunFrame(dt);
return;
}
if(timeToStartInitialization > 100.f){
timeToStartInitialization = 0.2f;
}
if(timeToStartInitialization > 0.f){
DrawStartupScreen();
timeToStartInitialization -= dt;
if(timeToStartInitialization <= 0.f){
// do init
DoInit();
}
return;
}
static ScriptFunction func("MainScreenUI", "void RunFrame(float)");
ScriptContextHandle c = func.Prepare();
c->SetObject(&*ui);
c->SetArgFloat(0, dt);
c.ExecuteChecked();
}
void MainScreen::DoInit() {
SPADES_MARK_FUNCTION();
renderer->Init();
static ScriptFunction uiFactory("MainScreenUI@ CreateMainScreenUI(Renderer@, AudioDevice@, Font@, MainScreenHelper@)");
{
ScriptContextHandle ctx = uiFactory.Prepare();
ctx->SetArgObject(0, renderer);
ctx->SetArgObject(1, audioDevice);
ctx->SetArgObject(2, font);
ctx->SetArgObject(3, &*helper);
ctx.ExecuteChecked();
ui = reinterpret_cast<asIScriptObject *>(ctx->GetReturnObject());
}
}
void MainScreen::Closing() {
SPADES_MARK_FUNCTION();
if(subview){
subview->Closing();
subview = NULL;
}
if(!ui){
return;
}
static ScriptFunction func("MainScreenUI", "void Closing()");
ScriptContextHandle c = func.Prepare();
c->SetObject(&*ui);
c.ExecuteChecked();
}
}
}

View File

@ -24,18 +24,27 @@
#include <Client/IRenderer.h>
#include <Client/IAudioDevice.h>
#include "View.h"
#include <ScriptBindings/ScriptManager.h>
namespace spades {
namespace client {
class IFont;
}
namespace gui {
class MainScreenHelper;
class MainScreen: public View {
friend class MainScreenHelper;
Handle<client::IRenderer> renderer;
Handle<client::IAudioDevice> audioDevice;
Handle<View> subview;
Handle<client::IFont> font;
bool shouldBeClosed;
float timeToStartInitialization;
Handle<MainScreenHelper> helper;
Handle<asIScriptObject> ui;
void DrawStartupScreen();
void DoInit();
protected:
virtual ~MainScreen();
public:
@ -53,7 +62,7 @@ namespace spades {
virtual void Closing();
virtual bool WantsToBeClosed() { return shouldBeClosed; }
virtual bool WantsToBeClosed();
};;
}
}

View File

@ -0,0 +1,39 @@
/*
Copyright (c) 2013 yvt
This file is part of OpenSpades.
OpenSpades 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 3 of the License, or
(at your option) any later version.
OpenSpades is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenSpades. If not, see <http://www.gnu.org/licenses/>.
*/
#include "MainScreenHelper.h"
namespace spades {
namespace gui {
MainScreenHelper::MainScreenHelper(MainScreen *scr):
mainScreen(scr) {
}
MainScreenHelper::~MainScreenHelper() {
}
void MainScreenHelper::MainScreenDestroyed() {
mainScreen = NULL;
}
}
}

View File

@ -0,0 +1,38 @@
/*
Copyright (c) 2013 yvt
This file is part of OpenSpades.
OpenSpades 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 3 of the License, or
(at your option) any later version.
OpenSpades is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenSpades. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <Core/RefCountedObject.h>
namespace spades {
namespace gui {
class MainScreen;
class MainScreenHelper: public RefCountedObject {
MainScreen *mainScreen;
protected:
virtual ~MainScreenHelper();
public:
MainScreenHelper(MainScreen *scr);
void MainScreenDestroyed();
};
}
}

View File

@ -0,0 +1,69 @@
/*
Copyright (c) 2013 yvt
This file is part of OpenSpades.
OpenSpades 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 3 of the License, or
(at your option) any later version.
OpenSpades is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenSpades. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ScriptManager.h"
#include <Gui/MainScreenHelper.h>
namespace spades {
class MainScreenHelperRegistrar: public ScriptObjectRegistrar {
public:
MainScreenHelperRegistrar():
ScriptObjectRegistrar("MainScreenHelper") {}
virtual void Register(ScriptManager *manager, Phase phase) {
asIScriptEngine *eng = manager->GetEngine();
int r;
eng->SetDefaultNamespace("spades");
switch(phase){
case PhaseObjectType:
r = eng->RegisterObjectType("MainScreenHelper",
0, asOBJ_REF);
manager->CheckError(r);
break;
case PhaseObjectMember:
r = eng->RegisterObjectBehaviour("MainScreenHelper",
asBEHAVE_ADDREF,
"void f()",
asMETHOD(gui::MainScreenHelper, AddRef),
asCALL_THISCALL);
manager->CheckError(r);
r = eng->RegisterObjectBehaviour("MainScreenHelper",
asBEHAVE_RELEASE,
"void f()",
asMETHOD(gui::MainScreenHelper, Release),
asCALL_THISCALL);
manager->CheckError(r);/*
r = eng->RegisterObjectMethod("Font",
"Vector2 Measure(const string& in)",
asMETHOD(client::IFont, Measure),
asCALL_THISCALL);
manager->CheckError(r);*/
break;
default:
break;
}
}
};
static MainScreenHelperRegistrar registrar;
}