Remove pointless IntSwap function from utils.h
Originally committed to SVN as r4560.
This commit is contained in:
parent
e5eb91a269
commit
fe9aa56d10
2 changed files with 8 additions and 36 deletions
|
@ -37,9 +37,6 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
///////////
|
|
||||||
// Headers
|
|
||||||
#ifndef AGI_PRE
|
#ifndef AGI_PRE
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
@ -50,13 +47,9 @@
|
||||||
#include <wx/menuitem.h>
|
#include <wx/menuitem.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/// DOCME
|
/// DOCME
|
||||||
typedef std::vector<std::pair<int,int> > IntPairVector;
|
typedef std::vector<std::pair<int,int> > IntPairVector;
|
||||||
|
|
||||||
|
|
||||||
///////////////////////
|
|
||||||
// Function prototypes
|
|
||||||
#ifndef __LINUX__
|
#ifndef __LINUX__
|
||||||
int64_t abs64(int64_t input);
|
int64_t abs64(int64_t input);
|
||||||
#endif
|
#endif
|
||||||
|
@ -76,24 +69,15 @@ int AegiStringToFix(const wxString &str,size_t decimalPlaces,int start=0,int end
|
||||||
wxIcon BitmapToIcon(wxBitmap bmp);
|
wxIcon BitmapToIcon(wxBitmap bmp);
|
||||||
void RestartAegisub();
|
void RestartAegisub();
|
||||||
|
|
||||||
|
|
||||||
//////////
|
|
||||||
// Macros
|
|
||||||
#ifndef MIN
|
#ifndef MIN
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
#define MIN(a,b) ((a)<(b))?(a):(b)
|
#define MIN(a,b) ((a)<(b))?(a):(b)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef MAX
|
#ifndef MAX
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
#define MAX(a,b) ((a)>(b))?(a):(b)
|
#define MAX(a,b) ((a)>(b))?(a):(b)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef MID
|
#ifndef MID
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
#define MID(a,b,c) MAX((a),MIN((b),(c)))
|
#define MID(a,b,c) MAX((a),MIN((b),(c)))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -110,20 +94,6 @@ void RestartAegisub();
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// @brief Inlines
|
|
||||||
/// @param a
|
|
||||||
/// @param b
|
|
||||||
///
|
|
||||||
static inline void IntSwap(int &a,int &b) {
|
|
||||||
int c = a;
|
|
||||||
a = b;
|
|
||||||
b = c;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// @brief Code taken from http://bob.allegronetwork.com/prog/tricks.html#clamp Clamp integer to range
|
/// @brief Code taken from http://bob.allegronetwork.com/prog/tricks.html#clamp Clamp integer to range
|
||||||
/// @param x
|
/// @param x
|
||||||
/// @param min
|
/// @param min
|
||||||
|
@ -138,5 +108,3 @@ static FORCEINLINE int ClampSignedInteger32(int x,int min,int max) {
|
||||||
x += max;
|
x += max;
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,10 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#ifndef AGI_PRE
|
||||||
|
#include <utility>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "ass_dialogue.h"
|
#include "ass_dialogue.h"
|
||||||
#include "ass_file.h"
|
#include "ass_file.h"
|
||||||
#include "subs_edit_box.h"
|
#include "subs_edit_box.h"
|
||||||
|
@ -112,8 +116,8 @@ void VisualToolClip::UpdateHold() {
|
||||||
curY2 = video.y;
|
curY2 = video.y;
|
||||||
|
|
||||||
// Make sure 1 is smaller than 2
|
// Make sure 1 is smaller than 2
|
||||||
if (curX1 > curX2) IntSwap(curX1,curX2);
|
if (curX1 > curX2) std::swap(curX1,curX2);
|
||||||
if (curY1 > curY2) IntSwap(curY1,curY2);
|
if (curY1 > curY2) std::swap(curY1,curY2);
|
||||||
|
|
||||||
// Limit to video area
|
// Limit to video area
|
||||||
curX1 = MID(0,curX1,video.w);
|
curX1 = MID(0,curX1,video.w);
|
||||||
|
@ -202,8 +206,8 @@ void VisualToolClip::UpdateDrag(ClipCorner* feature) {
|
||||||
curY2 = features[3].y;
|
curY2 = features[3].y;
|
||||||
|
|
||||||
// Make sure p1 < p2
|
// Make sure p1 < p2
|
||||||
if (curX1 > curX2) IntSwap(curX1,curX2);
|
if (curX1 > curX2) std::swap(curX1,curX2);
|
||||||
if (curY1 > curY2) IntSwap(curY1,curY2);
|
if (curY1 > curY2) std::swap(curY1,curY2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @brief Done dragging
|
/// @brief Done dragging
|
||||||
|
|
Loading…
Reference in a new issue