2
0
Fork 0

Style: Format code with clang-format 6.0.1

2.1
Rémi Verschelde 2018-07-18 17:56:12 +07:00
parent 792a0cdb53
commit bb13fa896e
36 changed files with 57 additions and 65 deletions

@ -256,6 +256,4 @@ bool Face3::intersects_aabb2(const AABB &p_aabb) const {
return true;
}
//this sucks...
#endif // FACE3_H

@ -50,7 +50,7 @@ public:
MOUSE_MODE_CAPTURED
};
#undef CursorShape
#undef CursorShape
enum CursorShape {
CURSOR_ARROW,
CURSOR_IBEAM,

@ -30,9 +30,9 @@
#include "register_core_types.h"
#include "bind/core_bind.h"
#include "color.h"
#include "compressed_translation.h"
#include "core/io/xml_parser.h"
#include "color.h"
#include "core_string_names.h"
#include "func_ref.h"
#include "geometry.h"

@ -77,7 +77,7 @@ T *_nullptr() {
#define OFFSET_OF(st, m) \
((size_t)((char *)&(_nullptr<st>()->m) - (char *)0))
/**
/**
* Some platforms (devices) not define NULL
*/
@ -85,7 +85,7 @@ T *_nullptr() {
#define NULL 0
#endif
/**
/**
* Windows defines a lot of badly stuff we'll never ever use. undefine it.
*/
@ -107,7 +107,7 @@ T *_nullptr() {
#include "int_types.h"
/** Generic ABS function, for math uses please use Math::abs */
/** Generic ABS function, for math uses please use Math::abs */
#ifndef ABS
#define ABS(m_v) ((m_v < 0) ? (-(m_v)) : (m_v))

@ -418,7 +418,8 @@ String ShaderCompilerGLES2::dump_node_code(SL::Node *p_node, int p_level, bool p
code+="vec4( "+dump_node_code(onode->arguments[i],p_level)+(i==4?",1.0)":",0.0)");
}
} else*/ if (callfunc == "tex") {
} else*/
if (callfunc == "tex") {
code = "texture2D( " + dump_node_code(onode->arguments[1], p_level) + "," + dump_node_code(onode->arguments[2], p_level) + ")";
break;

@ -46,8 +46,15 @@ class CMMNotificationClient : public IMMNotificationClient {
IMMDeviceEnumerator *_pEnumerator;
public:
CMMNotificationClient() : _cRef(1), _pEnumerator(NULL) { }
~CMMNotificationClient() { if ((_pEnumerator) != NULL) { (_pEnumerator)->Release(); (_pEnumerator) = NULL; } }
CMMNotificationClient() :
_cRef(1),
_pEnumerator(NULL) {}
~CMMNotificationClient() {
if ((_pEnumerator) != NULL) {
(_pEnumerator)->Release();
(_pEnumerator) = NULL;
}
}
ULONG STDMETHODCALLTYPE AddRef() {
return InterlockedIncrement(&_cRef);
@ -64,10 +71,10 @@ public:
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, VOID **ppvInterface) {
if (IID_IUnknown == riid) {
AddRef();
*ppvInterface = (IUnknown*)this;
*ppvInterface = (IUnknown *)this;
} else if (__uuidof(IMMNotificationClient) == riid) {
AddRef();
*ppvInterface = (IMMNotificationClient*)this;
*ppvInterface = (IMMNotificationClient *)this;
} else {
*ppvInterface = NULL;
return E_NOINTERFACE;

@ -2167,9 +2167,9 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones
}
}
/*********************************************************************************/
/*************************************** SCENE ***********************************/
/*********************************************************************************/
/*********************************************************************************/
/*************************************** SCENE ***********************************/
/*********************************************************************************/
#define DEBUG_ANIMATION

@ -500,7 +500,7 @@ void InputDefault::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_sh
custom_cursors[p_shape] = p_cursor;
OS::get_singleton()->set_custom_mouse_cursor(p_cursor, (OS::CursorShape) p_shape, p_hotspot);
OS::get_singleton()->set_custom_mouse_cursor(p_cursor, (OS::CursorShape)p_shape, p_hotspot);
}
// from github.com/gabomdq/SDL_GameControllerDB

@ -771,7 +771,7 @@ int GDCompiler::_parse_expression(CodeGen &codegen, const GDParser::Node *p_expr
ERR_FAIL_COND_V(on->arguments.size() != 2, -1);
if (on->arguments[0]->type == GDParser::Node::TYPE_OPERATOR && (static_cast<GDParser::OperatorNode *>(on->arguments[0])->op == GDParser::OperatorNode::OP_INDEX || static_cast<GDParser::OperatorNode *>(on->arguments[0])->op == GDParser::OperatorNode::OP_INDEX_NAMED)) {
//SET (chained) MODE!!
//SET (chained) MODE!!
#ifdef DEBUG_ENABLED
if (static_cast<GDParser::OperatorNode *>(on->arguments[0])->op == GDParser::OperatorNode::OP_INDEX_NAMED) {

@ -3022,7 +3022,8 @@ void GDParser::_parse_class(ClassNode *p_class) {
member._export.type=Variant::DICTIONARY;
} else*/ {
} else*/
{
if (subexpr->type != Node::TYPE_CONSTANT) {

@ -1026,7 +1026,7 @@ void GDTokenizerText::advance(int p_amount) {
_advance();
}
//////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////
#define BYTECODE_VERSION 10

@ -241,11 +241,11 @@ ResourceFormatPVR::ResourceFormatPVR() {
Image::_image_compress_pvrtc2_func = _compress_pvrtc4;
}
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
//PVRTC decompressor, Based on PVRTC decompressor by IMGTEC.
//PVRTC decompressor, Based on PVRTC decompressor by IMGTEC.
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
#define PT_INDEX 2
#define BLK_Y_SIZE 4

@ -661,7 +661,7 @@ void VideoStreamPlaybackTheora::update(float p_delta) {
}
}
//print_line("no theora: "+itos(no_theora)+" theora eos: "+itos(theora_eos)+" frame done "+itos(frame_done));
//print_line("no theora: "+itos(no_theora)+" theora eos: "+itos(theora_eos)+" frame done "+itos(frame_done));
#ifdef THEORA_USE_THREAD_STREAMING
if (file && thread_eof && no_theora && theora_eos && ring_buffer.data_left() == 0) {

@ -47,7 +47,7 @@ size_t AudioStreamPlaybackOGGVorbis::_ov_read_func(void *p_dst, size_t p_data, s
int AudioStreamPlaybackOGGVorbis::_ov_seek_func(void *_f, ogg_int64_t offs, int whence) {
//printf("seek to %p, offs %i, whence %i\n",_f,(int)offs,whence);
//printf("seek to %p, offs %i, whence %i\n",_f,(int)offs,whence);
#ifdef SEEK_SET
//printf("seek set defined\n");
@ -106,7 +106,7 @@ int AudioStreamPlaybackOGGVorbis::mix(int16_t *p_bufer, int p_frames) {
break;
}
//printf("to mix %i - mix me %i bytes\n",to_mix,to_mix*stream_channels*sizeof(int16_t));
//printf("to mix %i - mix me %i bytes\n",to_mix,to_mix*stream_channels*sizeof(int16_t));
#ifdef BIG_ENDIAN_ENABLED
long ret = ov_read(&vf, (char *)p_bufer, todo * stream_channels * sizeof(int16_t), 1, 2, 1, &current_section);

@ -72,7 +72,8 @@ class AudioDriverOpenSL : public AudioDriverSW {
/* SLuint32 eventFlags,
const void * pBuffer,
SLuint32 bufferSize,
SLuint32 dataUsed*/);
SLuint32 dataUsed*/
);
static void _buffer_callbacks(
SLAndroidSimpleBufferQueueItf queueItf,

@ -78,4 +78,3 @@ public class Dictionary extends HashMap<String, Object> {
keys_cache = null;
};
};

@ -410,7 +410,7 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
_self = this;
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
mClipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
mClipboard = (ClipboardManager)getSystemService(Context.CLIPBOARD_SERVICE);
if (true) {
boolean md5mismatch = false;
@ -583,8 +583,8 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
String copiedText = "";
if (mClipboard.getPrimaryClip() != null) {
ClipData.Item item = mClipboard.getPrimaryClip().getItemAt(0);
copiedText = item.getText().toString();
ClipData.Item item = mClipboard.getPrimaryClip().getItemAt(0);
copiedText = item.getText().toString();
}
return copiedText;
@ -646,10 +646,10 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
float[] adjustedValues = new float[3];
final int axisSwap[][] = {
{ 1, -1, 0, 1 }, // ROTATION_0
{ 1, -1, 0, 1 }, // ROTATION_0
{ -1, -1, 1, 0 }, // ROTATION_90
{ -1, 1, 0, 1 }, // ROTATION_180
{ 1, 1, 1, 0 } // ROTATION_270
{ -1, 1, 0, 1 }, // ROTATION_180
{ 1, 1, 1, 0 } // ROTATION_270
};
final int[] as = axisSwap[displayRotation];

@ -436,7 +436,6 @@ public class GodotIO {
Log.v(TAG, "Problem stopping audio thread: " + e);
}
mAudioThread = null;
}
if (mAudioTrack != null) {
@ -515,7 +514,6 @@ public class GodotIO {
public void showKeyboard(String p_existing_text) {
if (edit != null)
edit.showKeyboard(p_existing_text);
};
public void hideKeyboard() {

@ -61,7 +61,6 @@ abstract public class ConsumeTask {
}
final String token = _token;
new AsyncTask<String, String, String>() {
@Override
protected String doInBackground(String... params) {
try {
@ -83,7 +82,6 @@ abstract public class ConsumeTask {
error(param);
}
}
}
.execute();
}

@ -308,14 +308,12 @@ public class PaymentsManager {
public void processPurchaseResponse(int resultCode, Intent data) {
HandlePurchaseTask handlePurchaseTask = new HandlePurchaseTask(activity) {
@Override
protected void success(final String sku, final String signature, final String ticket) {
godotPaymentV3.callbackSuccess(ticket, signature, sku);
if (auto_consume) {
new ConsumeTask(mService, activity) {
@Override
protected void success(String ticket) {
}
@ -346,12 +344,10 @@ public class PaymentsManager {
public void validatePurchase(String purchaseToken, final String sku) {
new ValidateTask(activity, godotPaymentV3) {
@Override
protected void success() {
new ConsumeTask(mService, activity) {
@Override
protected void success(String ticket) {
godotPaymentV3.callbackSuccess(ticket, null, sku);
@ -384,7 +380,6 @@ public class PaymentsManager {
public void consume(final String sku) {
new ConsumeTask(mService, activity) {
@Override
protected void success(String ticket) {
godotPaymentV3.callbackSuccessProductMassConsumed(ticket, "", sku);
@ -527,7 +522,8 @@ public class PaymentsManager {
}
godotPaymentV3.completeSkuDetail();
}
})).start();
}))
.start();
}
public void setBaseSingleton(GodotPaymentV3 godotPaymentV3) {

@ -84,7 +84,6 @@ abstract public class ReleaseAllConsumablesTask {
String token = inappPurchaseData.getString("purchaseToken");
String signature = mySignatures.get(i);
new GenericConsumeTask(context, mService, sku, receipt, signature, token) {
@Override
public void onSuccess(String sku, String receipt, String signature, String token) {
ReleaseAllConsumablesTask.this.success(sku, receipt, signature, token);

@ -62,7 +62,6 @@ abstract public class ValidateTask {
public void validatePurchase(final String sku) {
new AsyncTask<String, String, String>() {
private ProgressDialog dialog;
@Override
@ -107,7 +106,6 @@ abstract public class ValidateTask {
error(e.getMessage());
}
}
}
.execute();
}

@ -284,7 +284,7 @@ void OSBB10::set_cursor_shape(CursorShape p_shape) {
//android really really really has no mouse.. how amazing..
}
void OSBB10::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) {
void OSBB10::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) {
// Since BlackBerry 10 has no mouse, we do not need to change its texture (how amazing !)
}

@ -235,7 +235,7 @@ void OS_Haiku::set_cursor_shape(CursorShape p_shape) {
//ERR_PRINT("set_cursor_shape() NOT IMPLEMENTED");
}
void OS_Haiku::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) {
void OS_Haiku::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) {
// TODO: implement set_custom_mouse_cursor()
}

@ -99,7 +99,7 @@ public:
virtual int get_mouse_button_state() const;
virtual void set_cursor_shape(CursorShape p_shape);
virtual void set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot);
virtual int get_screen_count() const;
virtual int get_current_screen() const;
virtual void set_current_screen(int p_screen);

@ -153,7 +153,6 @@ Error GameCenter::award_achievement(Variant p_params) {
[GKAchievement reportAchievements:@[ achievement ]
withCompletionHandler:^(NSError *error) {
Dictionary ret;
ret["type"] = "award_achievement";
if (error == nil) {
@ -172,7 +171,6 @@ Error GameCenter::award_achievement(Variant p_params) {
void GameCenter::request_achievement_descriptions() {
[GKAchievementDescription loadAchievementDescriptionsWithCompletionHandler:^(NSArray *descriptions, NSError *error) {
Dictionary ret;
ret["type"] = "achievement_descriptions";
if (error == nil) {
@ -228,7 +226,6 @@ void GameCenter::request_achievement_descriptions() {
void GameCenter::request_achievements() {
[GKAchievement loadAchievementsWithCompletionHandler:^(NSArray *achievements, NSError *error) {
Dictionary ret;
ret["type"] = "achievements";
if (error == nil) {

@ -478,7 +478,7 @@ void OSIPhone::set_cursor_shape(CursorShape p_shape){
};
void OSIPhone::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) {
void OSIPhone::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot){
};

@ -686,7 +686,6 @@ void OS_JavaScript::set_cursor_shape(CursorShape p_shape) {
}
void OS_JavaScript::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) {
}
void OS_JavaScript::main_loop_begin() {

@ -48,8 +48,8 @@
#include "servers/visual/rasterizer.h"
#include "servers/visual/visual_server_wrap_mt.h"
#include "servers/visual_server.h"
#include <ApplicationServices/ApplicationServices.h>
#include <AppKit/NSCursor.h>
#include <ApplicationServices/ApplicationServices.h>
//bitch
#undef CursorShape

@ -1259,7 +1259,7 @@ void OS_OSX::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, c
uint8_t alpha = (color >> 24) & 0xFF;
pixels[i * 4 + 0] = ((color >> 16) & 0xFF) * alpha / 255;
pixels[i * 4 + 1] = ((color >> 8) & 0xFF) * alpha / 255;
pixels[i * 4 + 2] = ((color) & 0xFF) * alpha / 255;
pixels[i * 4 + 2] = ((color)&0xFF) * alpha / 255;
pixels[i * 4 + 3] = alpha;
}

@ -175,8 +175,8 @@ int _main() {
}
int main(int _argc, char **_argv) {
// _argc and _argv are ignored
// we are going to use the WideChar version of them instead
// _argc and _argv are ignored
// we are going to use the WideChar version of them instead
#ifdef CRASH_HANDLER_EXCEPTION
__try {

@ -39,10 +39,10 @@
#include "os/memory_pool_dynamic_static.h"
#include "os_windows.h"
#include "scene/resources/texture.h"
#include "servers/audio/audio_server_sw.h"
#include "servers/visual/visual_server_raster.h"
#include "servers/visual/visual_server_wrap_mt.h"
#include "scene/resources/texture.h"
#include "globals.h"
#include "io/marshalls.h"
@ -466,7 +466,8 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_MBUTTONDBLCLK:
case WM_RBUTTONDBLCLK:
/*case WM_XBUTTONDOWN:
case WM_XBUTTONUP: */ {
case WM_XBUTTONUP: */
{
/*
LPARAM extra = GetMessageExtraInfo();

@ -488,7 +488,6 @@ void OSWinrt::ManagedType::update_clipboard() {
if (data->Contains(StandardDataFormats::Text)) {
create_task(data->GetTextAsync()).then([this](Platform::String ^ clipboard_content) {
this->clipboard = clipboard_content;
});
}
@ -771,7 +770,7 @@ void OSWinrt::set_cursor_shape(CursorShape p_shape) {
cursor_shape = p_shape;
}
void OSWinrt::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) {
void OSWinrt::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) {
// FIXME:
// Not implemented, some work needs to be done for this one

@ -598,7 +598,7 @@ Sprite3D::Sprite3D() {
hframes = 1;
}
////////////////////////////////////////
////////////////////////////////////////
#if 0

@ -201,7 +201,7 @@ void Node::_propagate_enter_tree() {
void Node::_propagate_exit_tree() {
//block while removing children
//block while removing children
#ifdef DEBUG_ENABLED

@ -825,7 +825,7 @@ bool Penetration(const ShapeSW *shape0,
return (false);
}
/* Symbols cleanup */
/* Symbols cleanup */
#undef GJK_MAX_ITERATIONS
#undef GJK_ACCURARY