This commit is contained in:
Juan Linietsky 2014-02-13 18:06:53 -03:00
commit b607687a31
9 changed files with 65 additions and 9 deletions

27
README.md Normal file
View File

@ -0,0 +1,27 @@
![GODOT](/logo.png)
### The Engine
Godot is a fully featured, open source, MIT licensed, game engine. It focuses on having great tools, and a visual oriented workflow that can export to PC, Mobile and Web platforms with no hassle.
The editor, language and APIs are feature rich, yet simple to learn, allowing you to become productive in a matter of hours.
### About
Godot has been developed by Juan Linietsky and Ariel Manzur for several years, and was born as an in-house engine, used to publish several work-for-hire titles.
Development is sponsored by OKAM Studio (http://www.okamstudio.com).
### Godot is BETA. Collaborate!!
Having been developed as in-house means that the user experience may still not be ideal for everyone. The features needed to make a great game are there, but we really need your help to fix all the rough edges and improve usability (via feedback and/or code contributions).
We know we are close to having an awesome, open source, game engine with nothing to envy from the best commercial offerings, but we can't do this alone. This is why Godot is now open source, so everyone can help us reach this goal.
### Binary Downloads, Documentation, Community, etc.
Binary downloads, documentation, community, etc. can be found in Godot homepage:
http://www.godotengine.org
### Compiling from Source
Compilation instructions for every platform can be found in the Wiki:
http://www.godotengine.org/wiki/doku.php?id=advanced

View File

@ -136,7 +136,7 @@ public:
static int b;
#if defined(_MSC_VER)
#if defined(_MSC_VER) && _MSC_VER < 1800
__asm fld a
__asm fistp b
/*#elif defined( __GNUC__ ) && ( defined( __i386__ ) || defined( __x86_64__ ) )
@ -148,7 +148,7 @@ public:
: "=m" (b)
: "m" (a));*/
#else
b=lrintf(a); //assuming everything but msvc has lrint
b=lrintf(a); //assuming everything but msvc 2012 or earlier has lrint
#endif
return b;
}

BIN
logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -378,8 +378,8 @@ static int button_mask=0;
prev_mouse_y=mouse_y;
const NSRect contentRect = [OS_OSX::singleton->window_view frame];
const NSPoint p = [event locationInWindow];
mouse_x = p.x;
mouse_y = contentRect.size.height - p.y;
mouse_x = p.x * [[event window] backingScaleFactor];
mouse_y = (contentRect.size.height - p.y) * [[event window] backingScaleFactor];
ev.mouse_motion.x=mouse_x;
ev.mouse_motion.y=mouse_y;
ev.mouse_motion.global_x=mouse_x;

View File

@ -84,6 +84,7 @@ def configure(env):
env.Append(CCFLAGS=['/O2'])
env.Append(LINKFLAGS=['/SUBSYSTEM:WINDOWS'])
env.Append(LINKFLAGS=['/ENTRY:mainCRTStartup'])
elif (env["target"]=="test"):
@ -92,8 +93,9 @@ def configure(env):
elif (env["target"]=="debug"):
env.Append(CCFLAGS=['/Zi','/DDEBUG_ENABLED','/DD3D_DEBUG_INFO','/O1'])
env.Append(CCFLAGS=['/Zi','/DDEBUG_ENABLED','/DD3D_DEBUG_INFO','/O1'])
env.Append(LINKFLAGS=['/SUBSYSTEM:CONSOLE'])
env.Append(LINKFLAGS=['/DEBUG'])
elif (env["target"]=="profile"):
@ -113,8 +115,7 @@ def configure(env):
env.Append(CCFLAGS=['/DGLES1_ENABLED'])
env.Append(CCFLAGS=['/DGLEW_ENABLED'])
env.Append(LIBS=['winmm','opengl32','dsound','kernel32','ole32','user32','gdi32','wsock32'])
env.Append(LINKFLAGS=['/DEBUG'])
env.Append(LIBPATH=[os.getenv("WindowsSdkDir")+"/Lib"])
if (os.getenv("DXSDK_DIR")):
DIRECTX_PATH=os.getenv("DXSDK_DIR")

View File

@ -134,6 +134,11 @@ Matrix32 Camera2D::get_camera_transform() {
Point2 screen_offset = (centered ? (screen_size * 0.5 * zoom) : Point2());;
screen_offset+=offset;
float angle = get_global_transform().get_rotation();
if(rotating){
screen_offset = screen_offset.rotated(angle);
}
Rect2 screen_rect(-screen_offset+ret_camera_pos,screen_size);
if (screen_rect.pos.x + screen_rect.size.x > limit[MARGIN_RIGHT])
screen_rect.pos.x = limit[MARGIN_RIGHT] - screen_rect.size.x;
@ -151,6 +156,9 @@ Matrix32 Camera2D::get_camera_transform() {
camera_screen_center=screen_rect.pos+screen_rect.size*0.5;
Matrix32 xform;
if(rotating){
xform.set_rotation(angle);
}
xform.scale_basis(zoom);
xform.set_origin(screen_rect.pos/*.floor()*/);
@ -251,6 +259,17 @@ bool Camera2D::is_centered() const {
return centered;
}
void Camera2D::set_rotating(bool p_rotating){
rotating=p_rotating;
_update_scroll();
}
bool Camera2D::is_rotating() const {
return rotating;
}
void Camera2D::_make_current(Object *p_which) {
@ -394,6 +413,9 @@ void Camera2D::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_centered","centered"),&Camera2D::set_centered);
ObjectTypeDB::bind_method(_MD("is_centered"),&Camera2D::is_centered);
ObjectTypeDB::bind_method(_MD("set_rotating","rotating"),&Camera2D::set_rotating);
ObjectTypeDB::bind_method(_MD("is_rotating"),&Camera2D::is_rotating);
ObjectTypeDB::bind_method(_MD("make_current"),&Camera2D::make_current);
ObjectTypeDB::bind_method(_MD("_make_current"),&Camera2D::_make_current);
@ -436,6 +458,7 @@ void Camera2D::_bind_methods() {
ADD_PROPERTYNZ( PropertyInfo(Variant::VECTOR2,"offset"),_SCS("set_offset"),_SCS("get_offset"));
ADD_PROPERTY( PropertyInfo(Variant::BOOL,"centered"),_SCS("set_centered"),_SCS("is_centered"));
ADD_PROPERTY( PropertyInfo(Variant::BOOL,"rotating"),_SCS("set_rotating"),_SCS("is_rotating"));
ADD_PROPERTY( PropertyInfo(Variant::BOOL,"current"),_SCS("_set_current"),_SCS("is_current"));
ADD_PROPERTY( PropertyInfo(Variant::REAL,"smoothing"),_SCS("set_follow_smoothing"),_SCS("get_follow_smoothing") );
ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"zoom"),_SCS("set_zoom"),_SCS("get_zoom") );
@ -462,6 +485,7 @@ Camera2D::Camera2D() {
centered=true;
rotating=false;
current=false;
limit[MARGIN_LEFT]=-10000000;
limit[MARGIN_TOP]=-10000000;

View File

@ -50,6 +50,7 @@ protected:
Vector2 offset;
Vector2 zoom;
bool centered;
bool rotating;
bool current;
float smoothing;
int limit[4];
@ -79,6 +80,9 @@ public:
void set_centered(bool p_centered);
bool is_centered() const;
void set_rotating(bool p_rotating);
bool is_rotating() const;
void set_limit(Margin p_margin,int p_limit);
int get_limit(Margin p_margin) const;

View File

@ -1575,7 +1575,7 @@ int Tree::propagate_mouse_event(const Point2i &p_pos,int x_ofs,int y_ofs,bool p_
} else {
editor_text=String::num( p_item->cells[col].val, Math::decimals( p_item->cells[col].step ) );
bring_up_value_editor=true;
bring_up_value_editor=false;
if (select_mode==SELECT_MULTI && get_scene()->get_last_event_id() == focus_in_id)
bring_up_editor=false;

View File

@ -439,7 +439,7 @@ class EditorFontImportDialog : public ConfirmationDialog {
}
if (dest->get_line_edit()->get_text()=="") {
error_dialog->set_text("No tatget font resource!");
error_dialog->set_text("No target font resource!");
error_dialog->popup_centered(Size2(200,100));
return;
}