Skip to content

Commit

Permalink
Merge latest master changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinob committed Aug 8, 2016
1 parent 1410e6e commit fea36cb
Show file tree
Hide file tree
Showing 111 changed files with 2,473 additions and 1,322 deletions.
85 changes: 56 additions & 29 deletions Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,38 @@ This guide is for developers who wish to contribute to the Dolphin codebase. It

Following this guide and formatting your code as detailed will likely get your pull request merged much faster than if you don't (assuming the written code has no mistakes in itself).

This project uses clang-format (stable branch) to check for common style issues. In case of conflicts between this guide and clang-format rules, the latter should be followed instead of this guide.


### Checking and fixing formatting issues

In most cases, clang-format can and **should** be used to automatically reformat code and solve most formatting issues.

- To run clang-format on all staged files:
```
git diff --cached --name-only | egrep '[.](cpp|h|mm)$' | xargs clang-format -i
```

- Formatting issues can be checked for before committing with a lint script that is included with the codebase. To enable it as a pre-commit hook (assuming you are in the repository root):
```
ln -s ../../Tools/lint.sh .git/hooks/pre-commit
```

- Alternatively, a custom git filter driver can be used to automatically and transparently reformat any changes:
```
git config filter.clang_format.smudge 'cat'
git config filter.clang_format.clean 'clang-format %f'
echo '/Source/Core/**/*.cpp filter=clang_format' >> .git/info/attributes
echo '/Source/Core/**/*.h filter=clang_format' >> .git/info/attributes
echo '/Source/Core/**/*.mm filter=clang_format' >> .git/info/attributes
```

## Styling and formatting

### General
- Try to limit lines of code to a maximum of 100 characters.
- Note that this does not mean you should try and use all 100 characters every time you have the chance. Typically with well formatted code, you normally shouldn't hit a line count of anything over 80 or 90 characters.
- The indentation style we use is tabs for initial indentation and then, if vertical alignment is needed, spaces are to be used.
- The indentation style we use is 1 tab per level.
- The opening brace for namespaces, classes, functions, enums, structs, unions, conditionals, and loops go on the next line.
- With array initializer lists and lambda expressions it is OK to keep the brace on the same line.
- References and pointers have the ampersand or asterisk against the type name, not the variable name. Example: `int* var`, not `int *var`.
Expand All @@ -39,10 +65,10 @@ Following this guide and formatting your code as detailed will likely get your p

```c++
if (condition)
return 0;
return 0;

while (var != 0)
var--;
var--;
```
- No:

Expand Down Expand Up @@ -73,30 +99,30 @@ Following this guide and formatting your code as detailed will likely get your p
```c++
if (condition)
{
// code
// code
}
else
{
// code
// code
}
```
- Acceptable:

```c++
if (condition)
// code line
// code line
else
// code line
// code line
```
- No:

```c++
if (condition)
{
// code
// code
}
else
// code line
// code line
```


Expand All @@ -111,18 +137,18 @@ Following this guide and formatting your code as detailed will likely get your p
class ExampleClass : public SomeParent
{
public:
ExampleClass(int x, int y);
ExampleClass(int x, int y);

int GetX() const;
int GetY() const;
int GetX() const;
int GetY() const;

protected:
virtual void SomeProtectedFunction() = 0;
static float s_some_variable;
virtual void SomeProtectedFunction() = 0;
static float s_some_variable;

private:
int m_x;
int m_y;
int m_x;
int m_y;
};
```
Expand All @@ -143,9 +169,10 @@ private:
- If a header is not necessary in a certain source file, remove them.
- If you find duplicate includes of a certain header, remove it.
- When declaring includes in a source file, make sure they follow the given pattern:
- The header for the source file
- Standard library headers
- System-specific headers (these should also likely be in an `#ifdef` block unless the source file itself is system-specific).
- Dolphin source file headers
- Other Dolphin source file headers
- Each of the above header sections should also be in alphabetical order
- Project source file headers should be included in a way that is relative to the `[Dolphin Root]/Source/Core` directory.
- This project uses `#pragma once` as header guards.
Expand All @@ -172,10 +199,10 @@ private:
template<class T>
inline void Clamp(T& val, const T& min, const T& max)
{
if (val < min)
val = min;
else if (val > max)
val = max;
if (val < min)
val = min;
else if (val > max)
val = max;
}
```

Expand All @@ -187,10 +214,10 @@ private:
template<class T>
inline void Clamp(T* val, const T& min, const T& max)
{
if (*val < min)
*val = min;
else if (*val > max)
*val = max;
if (*val < min)
*val = min;
else if (*val > max)
*val = max;
}
```

Expand All @@ -202,7 +229,7 @@ private:
class ClassName : ParentClass
{
public:
void Update() final;
void Update() final;
};
```
Expand All @@ -212,7 +239,7 @@ private:
class ClassName : ParentClass
{
public:
void Update() override;
void Update() override;
};
```

Expand All @@ -222,10 +249,10 @@ private:
```c++
class ClassName final : ParentClass
{
// Class definitions
// Class definitions
};
```
## Java
The Android project is currently written in Java. If you are using Android Studio to contribute, you can import the project's code style from `code-style-java.jar`, located in `[Dolphin Root]/Source/Android`. Please organize imports before committing.
The Android project is currently written in Java. If you are using Android Studio to contribute, you can import the project's code style from `code-style-java.jar`, located in `[Dolphin Root]/Source/Android`. Please organize imports before committing.
31 changes: 13 additions & 18 deletions Data/Sys/GameSettings/GALE01r2.ini
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ C21BFA20 00000003
04261B1C 60000000
04261B30 60000000
041A55EC 4E800020

C208D600 00000009
8A830678 3DC08000
61CE45D4 1EB40008
Expand All @@ -188,7 +187,6 @@ C208D600 00000009
62523DA4 1EB40E90
7E52AA14 92720000
3880FFFF 00000000

C208D6A4 00000009
8A830678 3DC08000
61CE45D4 1EB40008
Expand All @@ -199,7 +197,6 @@ C208D6A4 00000009
62523DA4 1EB40E90
7E52AA14 92720000
EC010024 00000000

04040BBC 60000000
20C61DB8 16200D20
06C61DB8 00000014
Expand All @@ -208,8 +205,6 @@ EC010024 00000000
1A210300 00000000
020045D0 000F0000
E2000001 00000000

#Stage Strike
C2259C40 0000001F
39600000 3D408045
614AC388 38600000
Expand Down Expand Up @@ -242,8 +237,6 @@ C2259C40 0000001F
4182000C 38630001
4BFFFF4C 800DB604
28000000 00000000

#Neutral Spawn Points
C216E2DC 00000017
3C608000 60633300
3C80804D 88846CAE
Expand Down Expand Up @@ -299,9 +292,7 @@ C216E468 00000003
0000001c 00030102
00010302 ffffffff
00010203 00010203

0416B480 60000000

C21A4160 00000008
39C00000 3DE08046
61EFB108 820F0000
Expand All @@ -316,16 +307,11 @@ C21A4160 00000008
04452F5C 42000000
04452F60 40200000
04452F64 47000000

0406AE90 38000000
040300A4 38000000
0422D638 38000006
043FA25B 01000000

#Leaving debug menu goes to CSS
041b0a14 38600002

#Toggle frozen stages
224d6c94 00000000
04c8ee24 00000000
04c8ea04 99b3b3ff
Expand Down Expand Up @@ -382,8 +368,6 @@ C2259C48 0000000A
6A940001 9A930000
3A80001E 9A8DB60E
886DB60E 00000000

#Increase input timing accuracy
C21A4DA0 00000003
901C0000 3D808001
618C95FC 7D8903A6
Expand All @@ -392,8 +376,8 @@ C21A4DA0 00000003
20020004 00000000
04019860 4bfffd9d

$Netplay Safe Kill Music [JMC47]
024D3886 00000000
$Netplay Safe Kill Music [Dan Salvato, Summate]
040249a4 38600001

$Unlock All Characters and Stages [Datel]
*Also Unlocks All Star Mode, Sound Test, and Vs. Mode Additions
Expand Down Expand Up @@ -422,6 +406,17 @@ $Boot to Character Select Screen [Dan Salvato, Achilles]
$Debug Menu Replaces Tournament Mode [Magus, donny2112]
0422D638 38000006

$Increase Input Timing Accuracy [Dan Salvato]
*Reorganizes input polls to remove drift that causes occasional input lag.
*Also doubles the controller's poll rate.
C21A4DA0 00000003
901C0000 3D808001
618C95FC 7D8903A6
4E800421 00000000
08402cc4 004e0400
20020004 00000000
04019860 4bfffd9d
$Disable Name Tag Reset After Closing Character Port [Ato]
04261B1C 60000000
04261B30 60000000
Expand Down
Binary file modified Data/Sys/Resources/toolbar_add_breakpoint.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Data/Sys/Resources/toolbar_add_memorycheck.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Data/Sys/Resources/toolbar_debugger_delete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Data/Sys/Resources/toolbar_debugger_goto_pc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Data/Sys/Resources/toolbar_debugger_set_pc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Data/Sys/Resources/toolbar_debugger_skip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Data/Sys/Resources/toolbar_debugger_step.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Data/Sys/Resources/toolbar_debugger_step_out.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Data/Sys/Resources/toolbar_debugger_step_over.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,17 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
public void onViewCreated(View view, Bundle savedInstanceState)
{
Button doneButton = (Button) view.findViewById(R.id.done_control_config);
doneButton.setOnClickListener(new View.OnClickListener()
if (doneButton != null)
{
@Override
public void onClick(View v)
doneButton.setOnClickListener(new View.OnClickListener()
{
stopConfiguringControls();
}
});
@Override
public void onClick(View v)
{
stopConfiguringControls();
}
});
}
}

@Override
Expand Down
Loading

0 comments on commit fea36cb

Please sign in to comment.