Social cocos2d-x javascript
Oficial forum: http://discuss.cocos2d-x.org/c/cocos2d-x/javascript
#Origin | |
$ git clone <origin repo> | |
$ cd <origin directory> | |
$ git remote rm origin | |
$ git filter-branch --subdirectory-filter ./ -- --all | |
$ git add . | |
$ git commit | |
$ pwd | |
#Target |
function toUTF8Array(str) { | |
var utf8 = []; | |
for (var i=0; i < str.length; i++) { | |
var charcode = str.charCodeAt(i); | |
if (charcode < 0x80) utf8.push(charcode); | |
else if (charcode < 0x800) { | |
utf8.push(0xc0 | (charcode >> 6), | |
0x80 | (charcode & 0x3f)); | |
} | |
else if (charcode < 0xd800 || charcode >= 0xe000) { |
#include "SDL.h" | |
#include <OpenGLES/ES2/gl.h> | |
#include <OpenGLES/ES2/glext.h> | |
#include <iostream> | |
#include <string> | |
#include <memory> | |
using namespace std; | |
GLuint programObject; | |
class Graphics |
#ifndef GL_VERTEX_ATTRIB_POINTER_HPP | |
#define GL_VERTEX_ATTRIB_POINTER_HPP | |
// Copyright Oh-Hyun Kwon 2014. | |
// Distributed under the Boost Software License, Version 1.0. | |
// (See accompanying file LICENSE_1_0.txt or copy at | |
// http://www.boost.org/LICENSE_1_0.txt) | |
/* |
cmake_minimum_required(VERSION 2.8) | |
project(testoptargsandescape) | |
macro(testmacro testarg1 testarg2) | |
message(STATUS "testarg1 = \"${testarg1}\"") | |
message(STATUS "testarg2 = \"${testarg2}\"") | |
message(STATUS "Optional arg = \"${ARGV2}\"") |
#include "Model.hpp" | |
bool core::ModelLoader::loadModel(const char* fp, Model* m) | |
{ | |
core::log("Loading " + (std::string)fp, core::green); | |
Assimp::Importer importer; // used to import the model | |
const aiScene* scene = importer.ReadFile(fp, | |
aiProcess_Triangulate | |
#include <exception> | |
#include <functional> | |
#ifdef __EMSCRIPTEN__ | |
#include <emscripten.h> | |
#include <SDL.h> | |
#include <SDL_image.h> | |
#include <SDL_ttf.h> |
/* | |
* The MIT License (MIT) | |
* | |
* Copyright (c) 2016 Mario Badr | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
C++ code style written in markdown.
Astyle code automatic formatting settings
You can use clang-format too.
Use tools like vera++