Skip to content

Commit 89075cd

Browse files
committed
clang-formatting
1 parent e3655df commit 89075cd

21 files changed

+1505
-1505
lines changed

.clang-format

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
Language: Cpp
3+
BasedOnStyle: LLVM
4+
IndentWidth: 4
5+
SortIncludes: true
6+
AccessModifierOffset: -4
7+
AlwaysBreakTemplateDeclarations: true
8+
AllowShortFunctionsOnASingleLine: None
9+
#AllowAllArgumentsOnNextLine: true
10+
BinPackArguments: false
11+
BinPackParameters: false
12+
BreakBeforeBraces: Custom
13+
BraceWrapping:
14+
BeforeCatch: true
15+
BeforeElse: true
16+
17+
AlwaysBreakAfterReturnType: None
18+
PenaltyReturnTypeOnItsOwnLine: 1000000

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,10 @@ rym.exe
1010
rym.pro
1111
rym.pro.user
1212

13+
rym.cflags
14+
rym.config
15+
rym.creator
16+
rym.cxxflags
17+
rym.files
18+
rym.includes
19+
rym.creator.user

.settings/language.settings.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
66
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
77
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
8-
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1857985525194055588" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
8+
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="565444017656832857" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
99
<language-scope id="org.eclipse.cdt.core.gcc"/>
1010
<language-scope id="org.eclipse.cdt.core.g++"/>
1111
</provider>

broadphase.h

+9-10
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,21 @@
55
* Author: Mattias Larsson Sköld
66
*/
77

8-
98
#pragma once
10-
#include "vec.h"
119

1210
#include "graf.h"
11+
#include "vec.h"
12+
1313
using game::obj::Unit;
1414

1515
class BroadPhase {
1616
public:
1717
virtual ~BroadPhase() = default;
18-
virtual class Unit *getNearest(Vec &p, double limit, Unit *ignore) = 0;
19-
virtual class Unit *collision(Vec &p, Unit *ignore) = 0;
20-
virtual void add(Unit* u) = 0;
21-
virtual void update(double t) = 0;
22-
virtual void removeDead() = 0;
23-
virtual void draw() = 0;
24-
virtual void setCenter(Vec center) = 0;
18+
virtual class Unit *getNearest(Vec &p, double limit, Unit *ignore) = 0;
19+
virtual class Unit *collision(Vec &p, Unit *ignore) = 0;
20+
virtual void add(Unit *u) = 0;
21+
virtual void update(double t) = 0;
22+
virtual void removeDead() = 0;
23+
virtual void draw() = 0;
24+
virtual void setCenter(Vec center) = 0;
2525
};
26-

common.h

-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@
55
* Author: Mattias Larsson Sköld
66
*/
77

8-
98
#pragma once
109

1110
constexpr double pi = 3.1415926535897932384626433832795028841971693;
1211
constexpr double pi2 = pi * 2;
1312
constexpr float pif = static_cast<float>(pi);
1413
constexpr float pi2f = static_cast<float>(pi2);
15-

draw-gl1.cpp

+67-81
Original file line numberDiff line numberDiff line change
@@ -2,117 +2,103 @@
22
* draw-win.cpp
33
*
44
* Created on: 15 jan. 2016
5-
* Author: mattr
5+
* Author: Mattias Larsson SKöld
66
*/
77

8-
#include "draw.h"
98
#include "GL/gl.h"
9+
#include "draw.h"
10+
1011
#include <iostream>
1112

1213
constexpr double angularMultiplier = 180. / pi;
1314

14-
15-
1615
using namespace std;
1716

18-
void modelTransform(Vec p, double a, double scale) {
19-
17+
void modelTransform(Vec /*p*/, double /*a*/, double /*scale*/) {
2018
}
2119

2220
void resetTransform() {
23-
2421
}
2522
void setCam(Vec p, double a) {
26-
glMatrixMode(GL_PROJECTION);
27-
glLoadIdentity();
28-
glRotatef(-a * angularMultiplier, 0,0,1);
29-
glScalef(.05,.05,.05);
30-
glTranslatef(-p.x, -p.y, 0);
31-
glMatrixMode(GL_MODELVIEW);
32-
glLoadIdentity();
23+
glMatrixMode(GL_PROJECTION);
24+
glLoadIdentity();
25+
glRotated(-a * angularMultiplier, 0, 0, 1);
26+
glScaled(.05, .05, .05);
27+
glTranslated(-p.x, -p.y, 0);
28+
glMatrixMode(GL_MODELVIEW);
29+
glLoadIdentity();
3330
}
3431
void camTransform() {
35-
3632
}
3733

3834
void drawShip(Vec p, double a) {
39-
glPushMatrix();
40-
glTranslatef(p.x, p.y, 0);
41-
glRotatef(a * angularMultiplier, 0,0,1);
42-
glBegin(GL_TRIANGLES);
43-
glColor3f(1,1,1);
44-
glVertex2f(0.f, 1.f);
45-
glVertex2f(.5f, -1.f);
46-
glVertex2f(-.5f, -1.f);
47-
glEnd();
48-
glPopMatrix();
49-
35+
glPushMatrix();
36+
glTranslated(p.x, p.y, 0);
37+
glRotated(a * angularMultiplier, 0, 0, 1);
38+
glBegin(GL_TRIANGLES);
39+
glColor3f(1, 1, 1);
40+
glVertex2f(0.f, 1.f);
41+
glVertex2f(.5f, -1.f);
42+
glVertex2f(-.5f, -1.f);
43+
glEnd();
44+
glPopMatrix();
5045
}
51-
void drawStar(Vec p) {
52-
46+
void drawStar(Vec /*p*/) {
5347
}
5448

55-
56-
5749
void drawArea(Vec p, double a, double r) {
58-
glPushMatrix();
59-
glTranslatef(p.x, p.y, 0);
60-
glScalef(r, r, r);
61-
glRotatef(a, 0,0,1);
62-
glBegin(GL_LINE_LOOP);
63-
glColor3f(.8,.8, 1);
64-
glVertex2f(-1, -1);
65-
glVertex2f(-1, 1);
66-
glVertex2f(1, 1);
67-
glVertex2f(1, -1);
68-
glEnd();
69-
glPopMatrix();
50+
glPushMatrix();
51+
glTranslated(p.x, p.y, 0);
52+
glScaled(r, r, r);
53+
glRotated(a, 0, 0, 1);
54+
glBegin(GL_LINE_LOOP);
55+
glColor3f(.8f, .8f, 1);
56+
glVertex2f(-1, -1);
57+
glVertex2f(-1, 1);
58+
glVertex2f(1, 1);
59+
glVertex2f(1, -1);
60+
glEnd();
61+
glPopMatrix();
7062
}
7163

72-
7364
void drawComet(Vec p, double a, double r) {
74-
glPushMatrix();
75-
glTranslatef(p.x, p.y, 0);
76-
glScalef(r, r, r);
77-
glRotatef(a, 0,0,1);
78-
glBegin(GL_TRIANGLE_FAN);
79-
glColor3f(.8,.8, 1);
80-
glVertex2f(-1, -1);
81-
glVertex2f(-1, 1);
82-
glVertex2f(1, 1);
83-
glVertex2f(1, -1);
84-
glEnd();
85-
glPopMatrix();
65+
glPushMatrix();
66+
glTranslated(p.x, p.y, 0);
67+
glScaled(r, r, r);
68+
glRotated(a, 0, 0, 1);
69+
glBegin(GL_TRIANGLE_FAN);
70+
glColor3f(.8f, .8f, 1.f);
71+
glVertex2f(-1, -1);
72+
glVertex2f(-1, 1);
73+
glVertex2f(1, 1);
74+
glVertex2f(1, -1);
75+
glEnd();
76+
glPopMatrix();
8677
}
87-
void drawProjectile(Vec p, double a, double scale) {
88-
78+
void drawProjectile(Vec /*p*/, double /*a*/, double /*scale*/) {
8979
}
9080
void drawExplosion(Vec p, double size) {
91-
glPushMatrix();
92-
glTranslatef(p.x, p.y, 0);
93-
glScalef(size, size, size);
94-
glBegin(GL_TRIANGLE_FAN);
95-
glColor3f(.8,.8, 1);
96-
glVertex2f(-1, -1);
97-
glVertex2f(-1, 1);
98-
glVertex2f(1, 1);
99-
glVertex2f(1, -1);
100-
glEnd();
101-
glPopMatrix();
102-
81+
glPushMatrix();
82+
glTranslated(p.x, p.y, 0);
83+
glScaled(size, size, size);
84+
glBegin(GL_TRIANGLE_FAN);
85+
glColor3d(.8, .8, 1);
86+
glVertex2f(-1, -1);
87+
glVertex2f(-1, 1);
88+
glVertex2f(1, 1);
89+
glVertex2f(1, -1);
90+
glEnd();
91+
glPopMatrix();
10392
}
104-
void drawSmoke(Vec p1, Vec p2, double alpha1, double alpha2){
105-
glBegin(GL_LINES);
106-
glColor4f(1,1,1, alpha2);
107-
glVertex3dv(&p1.x);
108-
glVertex3dv(&p2.x);
109-
glEnd();
93+
void drawSmoke(Vec p1, Vec p2, double /*alpha1*/, double alpha2) {
94+
glBegin(GL_LINES);
95+
glColor4d(1, 1, 1, alpha2);
96+
glVertex3dv(&p1.x);
97+
glVertex3dv(&p2.x);
98+
glEnd();
11099
}
111-
bool initDrawModule(double perspective){
112-
100+
bool initDrawModule(double /*perspective*/) {
101+
return false;
113102
}
114-
void flushDraw(){
115-
103+
void flushDraw() {
116104
}
117-
118-

0 commit comments

Comments
 (0)