diff options
author | chai <chaifix@163.com> | 2018-05-19 09:40:17 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-05-19 09:40:17 +0800 |
commit | 3ce3b10167a98f45614408a8042a10c686f3a9cc (patch) | |
tree | 136603c06ffaf2f36cf9d8f17b811316f8f65609 /src/libjin | |
parent | 6ed3819f1a859ffc350c4aaad132f164478f5d79 (diff) |
格式化代码
Diffstat (limited to 'src/libjin')
-rw-r--r-- | src/libjin/audio/source.h | 6 | ||||
-rw-r--r-- | src/libjin/render/color.h | 14 | ||||
-rw-r--r-- | src/libjin/render/font.cpp | 2 | ||||
-rw-r--r-- | src/libjin/render/image.cpp | 8 | ||||
-rw-r--r-- | src/libjin/render/jsl.h | 16 |
5 files changed, 23 insertions, 23 deletions
diff --git a/src/libjin/audio/source.h b/src/libjin/audio/source.h index ad9a8ba..a8e40fe 100644 --- a/src/libjin/audio/source.h +++ b/src/libjin/audio/source.h @@ -8,8 +8,8 @@ namespace jin namespace audio { - class Source - { + class Source + { public: void play(); void stop(); @@ -22,7 +22,7 @@ namespace audio void setPitch(float pitch); void setVolume(float volume); - }; + }; } } diff --git a/src/libjin/render/color.h b/src/libjin/render/color.h index 6f34b4a..856cd48 100644 --- a/src/libjin/render/color.h +++ b/src/libjin/render/color.h @@ -10,16 +10,16 @@ namespace jin namespace render { - union color { - struct { + union color { + struct { #if JIN_BYTEORDER == JIN_BIG_ENDIAN - unsigned char r, g, b, a; + unsigned char r, g, b, a; #else - unsigned char a, b, g, r; + unsigned char a, b, g, r; #endif - }rgba; - int word; - }; + }rgba; + int word; + }; } } diff --git a/src/libjin/render/font.cpp b/src/libjin/render/font.cpp index 287e0c0..8a96f25 100644 --- a/src/libjin/render/font.cpp +++ b/src/libjin/render/font.cpp @@ -165,7 +165,7 @@ namespace render int maxX = 0; float factor = fheight / (float)PIXEL_HEIGHT; - + for (int i = 0; i < len; ++i) { char c = str[i]; diff --git a/src/libjin/render/image.cpp b/src/libjin/render/image.cpp index 5de997a..583bd8d 100644 --- a/src/libjin/render/image.cpp +++ b/src/libjin/render/image.cpp @@ -26,10 +26,10 @@ namespace render color Image::getPixel(int x, int y) { - if (without(x, 0, width) || without(y, 0, height)) - { - return { 0 }; - } + if (without(x, 0, width) || without(y, 0, height)) + { + return { 0 }; + } return pixels[x + y * width]; } diff --git a/src/libjin/render/jsl.h b/src/libjin/render/jsl.h index aff7fea..35479d3 100644 --- a/src/libjin/render/jsl.h +++ b/src/libjin/render/jsl.h @@ -36,11 +36,11 @@ namespace render void sendFloat(const char* name, float number); void sendImage(const char* name, const Image* image); - void sendVec2(const char* name, float x, float y); - void sendVec3(const char* name, float x, float y, float z); - void sendVec4(const char* name, float x, float y, float z, float w); - void sendCanvas(const char* name, const Canvas* canvas); - void sendColor(const char* name, const color* col); + void sendVec2(const char* name, float x, float y); + void sendVec3(const char* name, float x, float y, float z); + void sendVec4(const char* name, float x, float y, float z, float w); + void sendCanvas(const char* name, const Canvas* canvas); + void sendColor(const char* name, const color* col); static inline JSLProgram* getCurrentJSL() { @@ -53,11 +53,11 @@ namespace render std::map<std::string, GLint> texturePool; - static JSLProgram* currentJSLProgram; + static JSLProgram* currentJSLProgram; static GLint currentTextureUnit; - static GLint maxTextureUnits; + static GLint maxTextureUnits; - GLint getTextureUnit(const std::string& name); + GLint getTextureUnit(const std::string& name); inline void initialize(const char* program); inline void destroy(); |