Reformat all the things. Have fun with merge conflicts.
This commit is contained in:
parent
2115e8a4a6
commit
3570c7f03a
|
@ -11,313 +11,93 @@
|
|||
|
||||
namespace ButtonManager
|
||||
{
|
||||
const std::string touchScreenKey = "Touchscreen";
|
||||
std::unordered_map<std::string, InputDevice*> m_controllers;
|
||||
std::vector<std::string> configStrings = {
|
||||
const std::string touchScreenKey = "Touchscreen";
|
||||
std::unordered_map<std::string, InputDevice*> m_controllers;
|
||||
std::vector<std::string> configStrings = {
|
||||
// GC
|
||||
"InputA",
|
||||
"InputB",
|
||||
"InputStart",
|
||||
"InputX",
|
||||
"InputY",
|
||||
"InputZ",
|
||||
"DPadUp",
|
||||
"DPadDown",
|
||||
"DPadLeft",
|
||||
"DPadRight",
|
||||
"MainUp",
|
||||
"MainDown",
|
||||
"MainLeft",
|
||||
"MainRight",
|
||||
"CStickUp",
|
||||
"CStickDown",
|
||||
"CStickLeft",
|
||||
"CStickRight",
|
||||
"InputL",
|
||||
"InputR",
|
||||
"InputA", "InputB", "InputStart", "InputX", "InputY", "InputZ", "DPadUp", "DPadDown",
|
||||
"DPadLeft", "DPadRight", "MainUp", "MainDown", "MainLeft", "MainRight", "CStickUp",
|
||||
"CStickDown", "CStickLeft", "CStickRight", "InputL", "InputR",
|
||||
// Wiimote
|
||||
"WiimoteA",
|
||||
"WiimoteB",
|
||||
"WiimoteMinus",
|
||||
"WiimotePlus",
|
||||
"WiimoteHome",
|
||||
"Wiimote1",
|
||||
"Wiimote2",
|
||||
"WiimoteUp",
|
||||
"WiimoteDown",
|
||||
"WiimoteLeft",
|
||||
"WiimoteRight",
|
||||
"IRUp",
|
||||
"IRDown",
|
||||
"IRLeft",
|
||||
"IRRight",
|
||||
"IRForward",
|
||||
"IRBackward",
|
||||
"IRHide",
|
||||
"SwingUp",
|
||||
"SwingDown",
|
||||
"SwingLeft",
|
||||
"SwingRight",
|
||||
"SwingForward",
|
||||
"SwingBackward",
|
||||
"TiltForward",
|
||||
"TiltBackward",
|
||||
"TiltLeft",
|
||||
"TiltRight",
|
||||
"TiltModifier"
|
||||
"WiimoteA", "WiimoteB", "WiimoteMinus", "WiimotePlus", "WiimoteHome", "Wiimote1", "Wiimote2",
|
||||
"WiimoteUp", "WiimoteDown", "WiimoteLeft", "WiimoteRight", "IRUp", "IRDown", "IRLeft",
|
||||
"IRRight", "IRForward", "IRBackward", "IRHide", "SwingUp", "SwingDown", "SwingLeft",
|
||||
"SwingRight", "SwingForward", "SwingBackward", "TiltForward", "TiltBackward", "TiltLeft",
|
||||
"TiltRight", "TiltModifier"
|
||||
"ShakeX",
|
||||
"ShakeY",
|
||||
"ShakeZ",
|
||||
"ShakeY", "ShakeZ",
|
||||
// Nunchuk
|
||||
"NunchukC",
|
||||
"NunchukZ",
|
||||
"NunchukUp",
|
||||
"NunchukDown",
|
||||
"NunchukLeft",
|
||||
"NunchukRight",
|
||||
"NunchukSwingUp",
|
||||
"NunchukSwingDown",
|
||||
"NunchukSwingLeft",
|
||||
"NunchukSwingRight",
|
||||
"NunchukSwingForward",
|
||||
"NunchukSwingBackward",
|
||||
"NunchukTiltForward",
|
||||
"NunchukTiltBackward",
|
||||
"NunchukTiltLeft",
|
||||
"NunchukTiltRight",
|
||||
"NunchukTiltModifier",
|
||||
"NunchukShakeX",
|
||||
"NunchukShakeY",
|
||||
"NunchukC", "NunchukZ", "NunchukUp", "NunchukDown", "NunchukLeft", "NunchukRight",
|
||||
"NunchukSwingUp", "NunchukSwingDown", "NunchukSwingLeft", "NunchukSwingRight",
|
||||
"NunchukSwingForward", "NunchukSwingBackward", "NunchukTiltForward", "NunchukTiltBackward",
|
||||
"NunchukTiltLeft", "NunchukTiltRight", "NunchukTiltModifier", "NunchukShakeX", "NunchukShakeY",
|
||||
"NunchukShakeZ",
|
||||
// Classic
|
||||
"ClassicA",
|
||||
"ClassicB",
|
||||
"ClassicX",
|
||||
"ClassicY",
|
||||
"ClassicMinus",
|
||||
"ClassicPlus",
|
||||
"ClassicHome",
|
||||
"ClassicZL",
|
||||
"ClassicZR",
|
||||
"ClassicUp",
|
||||
"ClassicDown",
|
||||
"ClassicLeft",
|
||||
"ClassicRight",
|
||||
"ClassicLeftStickUp",
|
||||
"ClassicLeftStickDown",
|
||||
"ClassicLeftStickLeft",
|
||||
"ClassicLeftStickRight",
|
||||
"ClassicRightStickUp",
|
||||
"ClassicRightStickDown",
|
||||
"ClassicRightStickLeft",
|
||||
"ClassicRightStickRight",
|
||||
"ClassicTriggerL",
|
||||
"ClassicTriggerR",
|
||||
"ClassicA", "ClassicB", "ClassicX", "ClassicY", "ClassicMinus", "ClassicPlus", "ClassicHome",
|
||||
"ClassicZL", "ClassicZR", "ClassicUp", "ClassicDown", "ClassicLeft", "ClassicRight",
|
||||
"ClassicLeftStickUp", "ClassicLeftStickDown", "ClassicLeftStickLeft", "ClassicLeftStickRight",
|
||||
"ClassicRightStickUp", "ClassicRightStickDown", "ClassicRightStickLeft",
|
||||
"ClassicRightStickRight", "ClassicTriggerL", "ClassicTriggerR",
|
||||
// Guitar
|
||||
"GuitarMinus",
|
||||
"GuitarPlus",
|
||||
"GuitarGreen",
|
||||
"GuitarRed",
|
||||
"GuitarYellow",
|
||||
"GuitarBue",
|
||||
"GuitarOrange",
|
||||
"GuitarStrumUp",
|
||||
"GuitarStrumDown",
|
||||
"GuitarUp",
|
||||
"GuitarDown",
|
||||
"GuitarLeft",
|
||||
"GuitarRight",
|
||||
"GuitarWhammy",
|
||||
"GuitarMinus", "GuitarPlus", "GuitarGreen", "GuitarRed", "GuitarYellow", "GuitarBue",
|
||||
"GuitarOrange", "GuitarStrumUp", "GuitarStrumDown", "GuitarUp", "GuitarDown", "GuitarLeft",
|
||||
"GuitarRight", "GuitarWhammy",
|
||||
// Drums
|
||||
"DrumsMinus",
|
||||
"DrumsPlus",
|
||||
"DrumsRed",
|
||||
"DrumsYellow",
|
||||
"DrumsBlue",
|
||||
"DrumsGreen",
|
||||
"DrumsOrange",
|
||||
"DrumsBass",
|
||||
"DrumsUp",
|
||||
"DrumsDown",
|
||||
"DrumsLeft",
|
||||
"DrumsRight",
|
||||
"DrumsMinus", "DrumsPlus", "DrumsRed", "DrumsYellow", "DrumsBlue", "DrumsGreen", "DrumsOrange",
|
||||
"DrumsBass", "DrumsUp", "DrumsDown", "DrumsLeft", "DrumsRight",
|
||||
// Turntable
|
||||
"TurntableGreenLeft",
|
||||
"TurntableRedLeft",
|
||||
"TurntableBlueLeft",
|
||||
"TurntableGreenRight",
|
||||
"TurntableRedRight",
|
||||
"TurntableBlueRight",
|
||||
"TurntableMinus",
|
||||
"TurntablePlus",
|
||||
"TurntableHome",
|
||||
"TurntableEuphoria",
|
||||
"TurntableLeftTLeft",
|
||||
"TurntableLeftTRight",
|
||||
"TurntableRightTLeft",
|
||||
"TurntableRightTRight",
|
||||
"TurntableUp",
|
||||
"TurntableDown",
|
||||
"TurntableLeft",
|
||||
"TurntableRight",
|
||||
"TurntableEffDial",
|
||||
"TurntableCrossLeft",
|
||||
"TurntableCrossRight",
|
||||
};
|
||||
std::vector<ButtonType> configTypes = {
|
||||
"TurntableGreenLeft", "TurntableRedLeft", "TurntableBlueLeft", "TurntableGreenRight",
|
||||
"TurntableRedRight", "TurntableBlueRight", "TurntableMinus", "TurntablePlus", "TurntableHome",
|
||||
"TurntableEuphoria", "TurntableLeftTLeft", "TurntableLeftTRight", "TurntableRightTLeft",
|
||||
"TurntableRightTRight", "TurntableUp", "TurntableDown", "TurntableLeft", "TurntableRight",
|
||||
"TurntableEffDial", "TurntableCrossLeft", "TurntableCrossRight",
|
||||
};
|
||||
std::vector<ButtonType> configTypes = {
|
||||
// GC
|
||||
BUTTON_A,
|
||||
BUTTON_B,
|
||||
BUTTON_START,
|
||||
BUTTON_X,
|
||||
BUTTON_Y,
|
||||
BUTTON_Z,
|
||||
BUTTON_UP,
|
||||
BUTTON_DOWN,
|
||||
BUTTON_LEFT,
|
||||
BUTTON_RIGHT,
|
||||
STICK_MAIN_UP,
|
||||
STICK_MAIN_DOWN,
|
||||
STICK_MAIN_LEFT,
|
||||
STICK_MAIN_RIGHT,
|
||||
STICK_C_UP,
|
||||
STICK_C_DOWN,
|
||||
STICK_C_LEFT,
|
||||
STICK_C_RIGHT,
|
||||
TRIGGER_L,
|
||||
TRIGGER_R,
|
||||
BUTTON_A, BUTTON_B, BUTTON_START, BUTTON_X, BUTTON_Y, BUTTON_Z, BUTTON_UP, BUTTON_DOWN,
|
||||
BUTTON_LEFT, BUTTON_RIGHT, STICK_MAIN_UP, STICK_MAIN_DOWN, STICK_MAIN_LEFT, STICK_MAIN_RIGHT,
|
||||
STICK_C_UP, STICK_C_DOWN, STICK_C_LEFT, STICK_C_RIGHT, TRIGGER_L, TRIGGER_R,
|
||||
// Wiimote
|
||||
WIIMOTE_BUTTON_A,
|
||||
WIIMOTE_BUTTON_B,
|
||||
WIIMOTE_BUTTON_MINUS,
|
||||
WIIMOTE_BUTTON_PLUS,
|
||||
WIIMOTE_BUTTON_HOME,
|
||||
WIIMOTE_BUTTON_1,
|
||||
WIIMOTE_BUTTON_2,
|
||||
WIIMOTE_UP,
|
||||
WIIMOTE_DOWN,
|
||||
WIIMOTE_LEFT,
|
||||
WIIMOTE_RIGHT,
|
||||
WIIMOTE_IR_UP,
|
||||
WIIMOTE_IR_DOWN,
|
||||
WIIMOTE_IR_LEFT,
|
||||
WIIMOTE_IR_RIGHT,
|
||||
WIIMOTE_IR_FORWARD,
|
||||
WIIMOTE_IR_BACKWARD,
|
||||
WIIMOTE_IR_HIDE,
|
||||
WIIMOTE_SWING_UP,
|
||||
WIIMOTE_SWING_DOWN,
|
||||
WIIMOTE_SWING_LEFT,
|
||||
WIIMOTE_SWING_RIGHT,
|
||||
WIIMOTE_SWING_FORWARD,
|
||||
WIIMOTE_SWING_BACKWARD,
|
||||
WIIMOTE_TILT_FORWARD,
|
||||
WIIMOTE_TILT_BACKWARD,
|
||||
WIIMOTE_TILT_LEFT,
|
||||
WIIMOTE_TILT_RIGHT,
|
||||
WIIMOTE_TILT_MODIFIER,
|
||||
WIIMOTE_SHAKE_X,
|
||||
WIIMOTE_SHAKE_Y,
|
||||
WIIMOTE_SHAKE_Z,
|
||||
WIIMOTE_BUTTON_A, WIIMOTE_BUTTON_B, WIIMOTE_BUTTON_MINUS, WIIMOTE_BUTTON_PLUS,
|
||||
WIIMOTE_BUTTON_HOME, WIIMOTE_BUTTON_1, WIIMOTE_BUTTON_2, WIIMOTE_UP, WIIMOTE_DOWN, WIIMOTE_LEFT,
|
||||
WIIMOTE_RIGHT, WIIMOTE_IR_UP, WIIMOTE_IR_DOWN, WIIMOTE_IR_LEFT, WIIMOTE_IR_RIGHT,
|
||||
WIIMOTE_IR_FORWARD, WIIMOTE_IR_BACKWARD, WIIMOTE_IR_HIDE, WIIMOTE_SWING_UP, WIIMOTE_SWING_DOWN,
|
||||
WIIMOTE_SWING_LEFT, WIIMOTE_SWING_RIGHT, WIIMOTE_SWING_FORWARD, WIIMOTE_SWING_BACKWARD,
|
||||
WIIMOTE_TILT_FORWARD, WIIMOTE_TILT_BACKWARD, WIIMOTE_TILT_LEFT, WIIMOTE_TILT_RIGHT,
|
||||
WIIMOTE_TILT_MODIFIER, WIIMOTE_SHAKE_X, WIIMOTE_SHAKE_Y, WIIMOTE_SHAKE_Z,
|
||||
// Nunchuk
|
||||
NUNCHUK_BUTTON_C,
|
||||
NUNCHUK_BUTTON_Z,
|
||||
NUNCHUK_STICK_UP,
|
||||
NUNCHUK_STICK_DOWN,
|
||||
NUNCHUK_STICK_LEFT,
|
||||
NUNCHUK_STICK_RIGHT,
|
||||
NUNCHUK_SWING_UP,
|
||||
NUNCHUK_SWING_DOWN,
|
||||
NUNCHUK_SWING_LEFT,
|
||||
NUNCHUK_SWING_RIGHT,
|
||||
NUNCHUK_SWING_FORWARD,
|
||||
NUNCHUK_SWING_BACKWARD,
|
||||
NUNCHUK_TILT_FORWARD,
|
||||
NUNCHUK_TILT_BACKWARD,
|
||||
NUNCHUK_TILT_LEFT,
|
||||
NUNCHUK_TILT_RIGHT,
|
||||
NUNCHUK_TILT_MODIFIER,
|
||||
NUNCHUK_SHAKE_X,
|
||||
NUNCHUK_SHAKE_Y,
|
||||
NUNCHUK_SHAKE_Z,
|
||||
NUNCHUK_BUTTON_C, NUNCHUK_BUTTON_Z, NUNCHUK_STICK_UP, NUNCHUK_STICK_DOWN, NUNCHUK_STICK_LEFT,
|
||||
NUNCHUK_STICK_RIGHT, NUNCHUK_SWING_UP, NUNCHUK_SWING_DOWN, NUNCHUK_SWING_LEFT,
|
||||
NUNCHUK_SWING_RIGHT, NUNCHUK_SWING_FORWARD, NUNCHUK_SWING_BACKWARD, NUNCHUK_TILT_FORWARD,
|
||||
NUNCHUK_TILT_BACKWARD, NUNCHUK_TILT_LEFT, NUNCHUK_TILT_RIGHT, NUNCHUK_TILT_MODIFIER,
|
||||
NUNCHUK_SHAKE_X, NUNCHUK_SHAKE_Y, NUNCHUK_SHAKE_Z,
|
||||
// Classic
|
||||
CLASSIC_BUTTON_A,
|
||||
CLASSIC_BUTTON_B,
|
||||
CLASSIC_BUTTON_X,
|
||||
CLASSIC_BUTTON_Y,
|
||||
CLASSIC_BUTTON_MINUS,
|
||||
CLASSIC_BUTTON_PLUS,
|
||||
CLASSIC_BUTTON_HOME,
|
||||
CLASSIC_BUTTON_ZL,
|
||||
CLASSIC_BUTTON_ZR,
|
||||
CLASSIC_DPAD_UP,
|
||||
CLASSIC_DPAD_DOWN,
|
||||
CLASSIC_DPAD_LEFT,
|
||||
CLASSIC_DPAD_RIGHT,
|
||||
CLASSIC_STICK_LEFT_UP,
|
||||
CLASSIC_STICK_LEFT_DOWN,
|
||||
CLASSIC_STICK_LEFT_LEFT,
|
||||
CLASSIC_STICK_LEFT_RIGHT,
|
||||
CLASSIC_STICK_RIGHT_UP,
|
||||
CLASSIC_STICK_RIGHT_DOWN,
|
||||
CLASSIC_STICK_RIGHT_LEFT,
|
||||
CLASSIC_STICK_RIGHT_RIGHT,
|
||||
CLASSIC_TRIGGER_L,
|
||||
CLASSIC_TRIGGER_R,
|
||||
CLASSIC_BUTTON_A, CLASSIC_BUTTON_B, CLASSIC_BUTTON_X, CLASSIC_BUTTON_Y, CLASSIC_BUTTON_MINUS,
|
||||
CLASSIC_BUTTON_PLUS, CLASSIC_BUTTON_HOME, CLASSIC_BUTTON_ZL, CLASSIC_BUTTON_ZR, CLASSIC_DPAD_UP,
|
||||
CLASSIC_DPAD_DOWN, CLASSIC_DPAD_LEFT, CLASSIC_DPAD_RIGHT, CLASSIC_STICK_LEFT_UP,
|
||||
CLASSIC_STICK_LEFT_DOWN, CLASSIC_STICK_LEFT_LEFT, CLASSIC_STICK_LEFT_RIGHT,
|
||||
CLASSIC_STICK_RIGHT_UP, CLASSIC_STICK_RIGHT_DOWN, CLASSIC_STICK_RIGHT_LEFT,
|
||||
CLASSIC_STICK_RIGHT_RIGHT, CLASSIC_TRIGGER_L, CLASSIC_TRIGGER_R,
|
||||
// Guitar
|
||||
GUITAR_BUTTON_MINUS,
|
||||
GUITAR_BUTTON_PLUS,
|
||||
GUITAR_FRET_GREEN,
|
||||
GUITAR_FRET_RED,
|
||||
GUITAR_FRET_YELLOW,
|
||||
GUITAR_FRET_BLUE,
|
||||
GUITAR_FRET_ORANGE,
|
||||
GUITAR_STRUM_UP,
|
||||
GUITAR_STRUM_DOWN,
|
||||
GUITAR_STICK_UP,
|
||||
GUITAR_STICK_DOWN,
|
||||
GUITAR_STICK_LEFT,
|
||||
GUITAR_STICK_RIGHT,
|
||||
GUITAR_WHAMMY_BAR,
|
||||
GUITAR_BUTTON_MINUS, GUITAR_BUTTON_PLUS, GUITAR_FRET_GREEN, GUITAR_FRET_RED, GUITAR_FRET_YELLOW,
|
||||
GUITAR_FRET_BLUE, GUITAR_FRET_ORANGE, GUITAR_STRUM_UP, GUITAR_STRUM_DOWN, GUITAR_STICK_UP,
|
||||
GUITAR_STICK_DOWN, GUITAR_STICK_LEFT, GUITAR_STICK_RIGHT, GUITAR_WHAMMY_BAR,
|
||||
// Drums
|
||||
DRUMS_BUTTON_MINUS,
|
||||
DRUMS_BUTTON_PLUS,
|
||||
DRUMS_PAD_RED,
|
||||
DRUMS_PAD_YELLOW,
|
||||
DRUMS_PAD_BLUE,
|
||||
DRUMS_PAD_GREEN,
|
||||
DRUMS_PAD_ORANGE,
|
||||
DRUMS_PAD_BASS,
|
||||
DRUMS_STICK_UP,
|
||||
DRUMS_STICK_DOWN,
|
||||
DRUMS_STICK_LEFT,
|
||||
DRUMS_STICK_RIGHT,
|
||||
DRUMS_BUTTON_MINUS, DRUMS_BUTTON_PLUS, DRUMS_PAD_RED, DRUMS_PAD_YELLOW, DRUMS_PAD_BLUE,
|
||||
DRUMS_PAD_GREEN, DRUMS_PAD_ORANGE, DRUMS_PAD_BASS, DRUMS_STICK_UP, DRUMS_STICK_DOWN,
|
||||
DRUMS_STICK_LEFT, DRUMS_STICK_RIGHT,
|
||||
// Turntable
|
||||
TURNTABLE_BUTTON_GREEN_LEFT,
|
||||
TURNTABLE_BUTTON_RED_LEFT,
|
||||
TURNTABLE_BUTTON_BLUE_LEFT,
|
||||
TURNTABLE_BUTTON_GREEN_RIGHT,
|
||||
TURNTABLE_BUTTON_RED_RIGHT,
|
||||
TURNTABLE_BUTTON_BLUE_RIGHT,
|
||||
TURNTABLE_BUTTON_MINUS,
|
||||
TURNTABLE_BUTTON_PLUS,
|
||||
TURNTABLE_BUTTON_HOME,
|
||||
TURNTABLE_BUTTON_EUPHORIA,
|
||||
TURNTABLE_TABLE_LEFT_LEFT,
|
||||
TURNTABLE_TABLE_LEFT_RIGHT,
|
||||
TURNTABLE_TABLE_RIGHT_LEFT,
|
||||
TURNTABLE_TABLE_RIGHT_RIGHT,
|
||||
TURNTABLE_STICK_UP,
|
||||
TURNTABLE_STICK_DOWN,
|
||||
TURNTABLE_STICK_LEFT,
|
||||
TURNTABLE_STICK_RIGHT,
|
||||
TURNTABLE_EFFECT_DIAL,
|
||||
TURNTABLE_CROSSFADE_LEFT,
|
||||
TURNTABLE_BUTTON_GREEN_LEFT, TURNTABLE_BUTTON_RED_LEFT, TURNTABLE_BUTTON_BLUE_LEFT,
|
||||
TURNTABLE_BUTTON_GREEN_RIGHT, TURNTABLE_BUTTON_RED_RIGHT, TURNTABLE_BUTTON_BLUE_RIGHT,
|
||||
TURNTABLE_BUTTON_MINUS, TURNTABLE_BUTTON_PLUS, TURNTABLE_BUTTON_HOME, TURNTABLE_BUTTON_EUPHORIA,
|
||||
TURNTABLE_TABLE_LEFT_LEFT, TURNTABLE_TABLE_LEFT_RIGHT, TURNTABLE_TABLE_RIGHT_LEFT,
|
||||
TURNTABLE_TABLE_RIGHT_RIGHT, TURNTABLE_STICK_UP, TURNTABLE_STICK_DOWN, TURNTABLE_STICK_LEFT,
|
||||
TURNTABLE_STICK_RIGHT, TURNTABLE_EFFECT_DIAL, TURNTABLE_CROSSFADE_LEFT,
|
||||
TURNTABLE_CROSSFADE_RIGHT,
|
||||
};
|
||||
};
|
||||
|
||||
static void AddBind(const std::string& dev, sBind *bind)
|
||||
{
|
||||
static void AddBind(const std::string& dev, sBind* bind)
|
||||
{
|
||||
auto it = m_controllers.find(dev);
|
||||
if (it != m_controllers.end())
|
||||
{
|
||||
|
@ -326,10 +106,10 @@ namespace ButtonManager
|
|||
}
|
||||
m_controllers[dev] = new InputDevice(dev);
|
||||
m_controllers[dev]->AddBind(bind);
|
||||
}
|
||||
}
|
||||
|
||||
void Init()
|
||||
{
|
||||
void Init()
|
||||
{
|
||||
// Initialize our touchScreenKey buttons
|
||||
for (int a = 0; a < 8; ++a)
|
||||
{
|
||||
|
@ -359,9 +139,12 @@ namespace ButtonManager
|
|||
// Wiimote
|
||||
AddBind(touchScreenKey, new sBind(a, WIIMOTE_BUTTON_A, BIND_BUTTON, WIIMOTE_BUTTON_A, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, WIIMOTE_BUTTON_B, BIND_BUTTON, WIIMOTE_BUTTON_B, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, WIIMOTE_BUTTON_MINUS, BIND_BUTTON, WIIMOTE_BUTTON_MINUS, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, WIIMOTE_BUTTON_PLUS, BIND_BUTTON, WIIMOTE_BUTTON_PLUS, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, WIIMOTE_BUTTON_HOME, BIND_BUTTON, WIIMOTE_BUTTON_HOME, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, WIIMOTE_BUTTON_MINUS, BIND_BUTTON, WIIMOTE_BUTTON_MINUS, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, WIIMOTE_BUTTON_PLUS, BIND_BUTTON, WIIMOTE_BUTTON_PLUS, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, WIIMOTE_BUTTON_HOME, BIND_BUTTON, WIIMOTE_BUTTON_HOME, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, WIIMOTE_BUTTON_1, BIND_BUTTON, WIIMOTE_BUTTON_1, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, WIIMOTE_BUTTON_2, BIND_BUTTON, WIIMOTE_BUTTON_2, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, WIIMOTE_UP, BIND_BUTTON, WIIMOTE_UP, 1.0f));
|
||||
|
@ -369,7 +152,8 @@ namespace ButtonManager
|
|||
AddBind(touchScreenKey, new sBind(a, WIIMOTE_LEFT, BIND_BUTTON, WIIMOTE_LEFT, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, WIIMOTE_RIGHT, BIND_BUTTON, WIIMOTE_RIGHT, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, WIIMOTE_IR_HIDE, BIND_BUTTON, WIIMOTE_IR_HIDE, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, WIIMOTE_TILT_MODIFIER, BIND_BUTTON, WIIMOTE_TILT_MODIFIER, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, WIIMOTE_TILT_MODIFIER, BIND_BUTTON, WIIMOTE_TILT_MODIFIER, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, WIIMOTE_SHAKE_X, BIND_BUTTON, WIIMOTE_SHAKE_X, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, WIIMOTE_SHAKE_Y, BIND_BUTTON, WIIMOTE_SHAKE_Y, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, WIIMOTE_SHAKE_Z, BIND_BUTTON, WIIMOTE_SHAKE_Z, 1.0f));
|
||||
|
@ -379,22 +163,29 @@ namespace ButtonManager
|
|||
AddBind(touchScreenKey, new sBind(a, WIIMOTE_IR_LEFT, BIND_AXIS, WIIMOTE_IR_LEFT, -1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, WIIMOTE_IR_RIGHT, BIND_AXIS, WIIMOTE_IR_RIGHT, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, WIIMOTE_IR_FORWARD, BIND_AXIS, WIIMOTE_IR_FORWARD, -1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, WIIMOTE_IR_BACKWARD, BIND_AXIS, WIIMOTE_IR_BACKWARD, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, WIIMOTE_IR_BACKWARD, BIND_AXIS, WIIMOTE_IR_BACKWARD, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, WIIMOTE_SWING_UP, BIND_AXIS, WIIMOTE_SWING_UP, -1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, WIIMOTE_SWING_DOWN, BIND_AXIS, WIIMOTE_SWING_DOWN, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, WIIMOTE_SWING_LEFT, BIND_AXIS, WIIMOTE_SWING_LEFT, -1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, WIIMOTE_SWING_RIGHT, BIND_AXIS, WIIMOTE_SWING_RIGHT, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, WIIMOTE_SWING_FORWARD, BIND_AXIS, WIIMOTE_SWING_FORWARD, -1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, WIIMOTE_SWING_BACKWARD, BIND_AXIS, WIIMOTE_SWING_BACKWARD, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, WIIMOTE_TILT_FORWARD, BIND_AXIS, WIIMOTE_TILT_FORWARD, -1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, WIIMOTE_TILT_BACKWARD, BIND_AXIS, WIIMOTE_TILT_BACKWARD, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, WIIMOTE_SWING_RIGHT, BIND_AXIS, WIIMOTE_SWING_RIGHT, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, WIIMOTE_SWING_FORWARD, BIND_AXIS, WIIMOTE_SWING_FORWARD, -1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, WIIMOTE_SWING_BACKWARD, BIND_AXIS, WIIMOTE_SWING_BACKWARD, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, WIIMOTE_TILT_FORWARD, BIND_AXIS, WIIMOTE_TILT_FORWARD, -1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, WIIMOTE_TILT_BACKWARD, BIND_AXIS, WIIMOTE_TILT_BACKWARD, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, WIIMOTE_TILT_LEFT, BIND_AXIS, WIIMOTE_TILT_LEFT, -1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, WIIMOTE_TILT_RIGHT, BIND_AXIS, WIIMOTE_TILT_RIGHT, 1.0f));
|
||||
|
||||
// Wii: Nunchuk
|
||||
AddBind(touchScreenKey, new sBind(a, NUNCHUK_BUTTON_C, BIND_BUTTON, NUNCHUK_BUTTON_C, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, NUNCHUK_BUTTON_Z, BIND_BUTTON, NUNCHUK_BUTTON_Z, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, NUNCHUK_TILT_MODIFIER, BIND_BUTTON, NUNCHUK_TILT_MODIFIER, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, NUNCHUK_TILT_MODIFIER, BIND_BUTTON, NUNCHUK_TILT_MODIFIER, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, NUNCHUK_SHAKE_X, BIND_BUTTON, NUNCHUK_SHAKE_X, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, NUNCHUK_SHAKE_Y, BIND_BUTTON, NUNCHUK_SHAKE_Y, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, NUNCHUK_SHAKE_Z, BIND_BUTTON, NUNCHUK_SHAKE_Z, 1.0f));
|
||||
|
@ -402,52 +193,74 @@ namespace ButtonManager
|
|||
AddBind(touchScreenKey, new sBind(a, NUNCHUK_SWING_UP, BIND_AXIS, NUNCHUK_SWING_UP, -1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, NUNCHUK_SWING_DOWN, BIND_AXIS, NUNCHUK_SWING_DOWN, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, NUNCHUK_SWING_LEFT, BIND_AXIS, NUNCHUK_SWING_LEFT, -1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, NUNCHUK_SWING_RIGHT, BIND_AXIS, NUNCHUK_SWING_RIGHT, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, NUNCHUK_SWING_FORWARD, BIND_AXIS, NUNCHUK_SWING_FORWARD, -1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, NUNCHUK_SWING_BACKWARD, BIND_BUTTON, NUNCHUK_SWING_BACKWARD, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, NUNCHUK_TILT_FORWARD, BIND_AXIS, NUNCHUK_TILT_FORWARD, -1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, NUNCHUK_TILT_BACKWARD, BIND_AXIS, NUNCHUK_TILT_BACKWARD, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, NUNCHUK_SWING_RIGHT, BIND_AXIS, NUNCHUK_SWING_RIGHT, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, NUNCHUK_SWING_FORWARD, BIND_AXIS, NUNCHUK_SWING_FORWARD, -1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, NUNCHUK_SWING_BACKWARD, BIND_BUTTON, NUNCHUK_SWING_BACKWARD, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, NUNCHUK_TILT_FORWARD, BIND_AXIS, NUNCHUK_TILT_FORWARD, -1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, NUNCHUK_TILT_BACKWARD, BIND_AXIS, NUNCHUK_TILT_BACKWARD, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, NUNCHUK_TILT_LEFT, BIND_AXIS, NUNCHUK_TILT_LEFT, -1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, NUNCHUK_TILT_RIGHT, BIND_AXIS, NUNCHUK_TILT_RIGHT, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, NUNCHUK_STICK_UP, BIND_AXIS, NUNCHUK_STICK_UP, -1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, NUNCHUK_STICK_DOWN, BIND_AXIS, NUNCHUK_STICK_DOWN, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, NUNCHUK_STICK_LEFT, BIND_AXIS, NUNCHUK_STICK_LEFT, -1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, NUNCHUK_STICK_RIGHT, BIND_AXIS, NUNCHUK_STICK_RIGHT, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, NUNCHUK_STICK_RIGHT, BIND_AXIS, NUNCHUK_STICK_RIGHT, 1.0f));
|
||||
|
||||
// Wii: Classic
|
||||
AddBind(touchScreenKey, new sBind(a, CLASSIC_BUTTON_A, BIND_BUTTON, CLASSIC_BUTTON_A, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, CLASSIC_BUTTON_B, BIND_BUTTON, CLASSIC_BUTTON_B, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, CLASSIC_BUTTON_X, BIND_BUTTON, CLASSIC_BUTTON_X, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, CLASSIC_BUTTON_Y, BIND_BUTTON, CLASSIC_BUTTON_Y, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, CLASSIC_BUTTON_MINUS, BIND_BUTTON, CLASSIC_BUTTON_MINUS, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, CLASSIC_BUTTON_PLUS, BIND_BUTTON, CLASSIC_BUTTON_PLUS, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, CLASSIC_BUTTON_HOME, BIND_BUTTON, CLASSIC_BUTTON_HOME, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, CLASSIC_BUTTON_MINUS, BIND_BUTTON, CLASSIC_BUTTON_MINUS, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, CLASSIC_BUTTON_PLUS, BIND_BUTTON, CLASSIC_BUTTON_PLUS, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, CLASSIC_BUTTON_HOME, BIND_BUTTON, CLASSIC_BUTTON_HOME, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, CLASSIC_BUTTON_ZL, BIND_BUTTON, CLASSIC_BUTTON_ZL, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, CLASSIC_BUTTON_ZR, BIND_BUTTON, CLASSIC_BUTTON_ZR, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, CLASSIC_DPAD_UP, BIND_BUTTON, CLASSIC_DPAD_UP, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, CLASSIC_DPAD_DOWN, BIND_BUTTON, CLASSIC_DPAD_DOWN, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, CLASSIC_DPAD_LEFT, BIND_BUTTON, CLASSIC_DPAD_LEFT, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, CLASSIC_DPAD_RIGHT, BIND_BUTTON, CLASSIC_DPAD_RIGHT, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, CLASSIC_DPAD_RIGHT, BIND_BUTTON, CLASSIC_DPAD_RIGHT, 1.0f));
|
||||
|
||||
AddBind(touchScreenKey, new sBind(a, CLASSIC_STICK_LEFT_UP, BIND_AXIS, CLASSIC_STICK_LEFT_UP, -1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, CLASSIC_STICK_LEFT_DOWN, BIND_AXIS, CLASSIC_STICK_LEFT_DOWN, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, CLASSIC_STICK_LEFT_LEFT, BIND_AXIS, CLASSIC_STICK_LEFT_LEFT, -1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, CLASSIC_STICK_LEFT_RIGHT, BIND_AXIS, CLASSIC_STICK_LEFT_RIGHT, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, CLASSIC_STICK_RIGHT_UP, BIND_AXIS, CLASSIC_STICK_RIGHT_UP, -1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, CLASSIC_STICK_RIGHT_DOWN, BIND_AXIS, CLASSIC_STICK_RIGHT_DOWN, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, CLASSIC_STICK_RIGHT_LEFT, BIND_AXIS, CLASSIC_STICK_RIGHT_LEFT, -1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, CLASSIC_STICK_RIGHT_RIGHT, BIND_AXIS, CLASSIC_STICK_RIGHT_RIGHT, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, CLASSIC_STICK_LEFT_UP, BIND_AXIS, CLASSIC_STICK_LEFT_UP, -1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, CLASSIC_STICK_LEFT_DOWN, BIND_AXIS, CLASSIC_STICK_LEFT_DOWN, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, CLASSIC_STICK_LEFT_LEFT, BIND_AXIS, CLASSIC_STICK_LEFT_LEFT, -1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, CLASSIC_STICK_LEFT_RIGHT, BIND_AXIS, CLASSIC_STICK_LEFT_RIGHT, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, CLASSIC_STICK_RIGHT_UP, BIND_AXIS, CLASSIC_STICK_RIGHT_UP, -1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, CLASSIC_STICK_RIGHT_DOWN, BIND_AXIS, CLASSIC_STICK_RIGHT_DOWN, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, CLASSIC_STICK_RIGHT_LEFT, BIND_AXIS, CLASSIC_STICK_RIGHT_LEFT, -1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, CLASSIC_STICK_RIGHT_RIGHT, BIND_AXIS, CLASSIC_STICK_RIGHT_RIGHT, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, CLASSIC_TRIGGER_L, BIND_AXIS, CLASSIC_TRIGGER_L, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, CLASSIC_TRIGGER_R, BIND_AXIS, CLASSIC_TRIGGER_R, 1.0f));
|
||||
|
||||
// Wii: Guitar
|
||||
AddBind(touchScreenKey, new sBind(a, GUITAR_BUTTON_MINUS, BIND_BUTTON, GUITAR_BUTTON_MINUS, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, GUITAR_BUTTON_PLUS, BIND_BUTTON, GUITAR_BUTTON_PLUS, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, GUITAR_BUTTON_MINUS, BIND_BUTTON, GUITAR_BUTTON_MINUS, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, GUITAR_BUTTON_PLUS, BIND_BUTTON, GUITAR_BUTTON_PLUS, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, GUITAR_FRET_GREEN, BIND_BUTTON, GUITAR_FRET_GREEN, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, GUITAR_FRET_RED, BIND_BUTTON, GUITAR_FRET_RED, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, GUITAR_FRET_YELLOW, BIND_BUTTON, GUITAR_FRET_YELLOW, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, GUITAR_FRET_YELLOW, BIND_BUTTON, GUITAR_FRET_YELLOW, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, GUITAR_FRET_BLUE, BIND_BUTTON, GUITAR_FRET_BLUE, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, GUITAR_FRET_ORANGE, BIND_BUTTON, GUITAR_FRET_ORANGE, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, GUITAR_FRET_ORANGE, BIND_BUTTON, GUITAR_FRET_ORANGE, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, GUITAR_STRUM_UP, BIND_BUTTON, GUITAR_STRUM_UP, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, GUITAR_STRUM_DOWN, BIND_BUTTON, GUITAR_STRUM_DOWN, 1.0f));
|
||||
|
||||
|
@ -458,7 +271,8 @@ namespace ButtonManager
|
|||
AddBind(touchScreenKey, new sBind(a, GUITAR_WHAMMY_BAR, BIND_AXIS, GUITAR_WHAMMY_BAR, 1.0f));
|
||||
|
||||
// Wii: Drums
|
||||
AddBind(touchScreenKey, new sBind(a, DRUMS_BUTTON_MINUS, BIND_BUTTON, DRUMS_BUTTON_MINUS, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, DRUMS_BUTTON_MINUS, BIND_BUTTON, DRUMS_BUTTON_MINUS, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, DRUMS_BUTTON_PLUS, BIND_BUTTON, DRUMS_BUTTON_PLUS, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, DRUMS_PAD_RED, BIND_BUTTON, DRUMS_PAD_RED, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, DRUMS_PAD_YELLOW, BIND_BUTTON, DRUMS_PAD_YELLOW, 1.0f));
|
||||
|
@ -473,28 +287,48 @@ namespace ButtonManager
|
|||
AddBind(touchScreenKey, new sBind(a, DRUMS_STICK_RIGHT, BIND_AXIS, DRUMS_STICK_RIGHT, 1.0f));
|
||||
|
||||
// Wii: Turntable
|
||||
AddBind(touchScreenKey, new sBind(a, TURNTABLE_BUTTON_GREEN_LEFT, BIND_BUTTON, TURNTABLE_BUTTON_GREEN_LEFT, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, TURNTABLE_BUTTON_RED_LEFT, BIND_BUTTON, TURNTABLE_BUTTON_RED_LEFT, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, TURNTABLE_BUTTON_BLUE_LEFT, BIND_BUTTON, TURNTABLE_BUTTON_BLUE_LEFT, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, TURNTABLE_BUTTON_GREEN_RIGHT, BIND_BUTTON, TURNTABLE_BUTTON_GREEN_RIGHT, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, TURNTABLE_BUTTON_RED_RIGHT, BIND_BUTTON, TURNTABLE_BUTTON_RED_RIGHT, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, TURNTABLE_BUTTON_BLUE_RIGHT, BIND_BUTTON, TURNTABLE_BUTTON_BLUE_RIGHT, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, TURNTABLE_BUTTON_MINUS, BIND_BUTTON, TURNTABLE_BUTTON_MINUS, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, TURNTABLE_BUTTON_PLUS, BIND_BUTTON, TURNTABLE_BUTTON_PLUS, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, TURNTABLE_BUTTON_HOME, BIND_BUTTON, TURNTABLE_BUTTON_HOME, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, TURNTABLE_BUTTON_EUPHORIA, BIND_BUTTON, TURNTABLE_BUTTON_EUPHORIA, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, TURNTABLE_BUTTON_GREEN_LEFT, BIND_BUTTON,
|
||||
TURNTABLE_BUTTON_GREEN_LEFT, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, TURNTABLE_BUTTON_RED_LEFT, BIND_BUTTON, TURNTABLE_BUTTON_RED_LEFT, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, TURNTABLE_BUTTON_BLUE_LEFT, BIND_BUTTON,
|
||||
TURNTABLE_BUTTON_BLUE_LEFT, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, TURNTABLE_BUTTON_GREEN_RIGHT, BIND_BUTTON,
|
||||
TURNTABLE_BUTTON_GREEN_RIGHT, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, TURNTABLE_BUTTON_RED_RIGHT, BIND_BUTTON,
|
||||
TURNTABLE_BUTTON_RED_RIGHT, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, TURNTABLE_BUTTON_BLUE_RIGHT, BIND_BUTTON,
|
||||
TURNTABLE_BUTTON_BLUE_RIGHT, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, TURNTABLE_BUTTON_MINUS, BIND_BUTTON, TURNTABLE_BUTTON_MINUS, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, TURNTABLE_BUTTON_PLUS, BIND_BUTTON, TURNTABLE_BUTTON_PLUS, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, TURNTABLE_BUTTON_HOME, BIND_BUTTON, TURNTABLE_BUTTON_HOME, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, TURNTABLE_BUTTON_EUPHORIA, BIND_BUTTON, TURNTABLE_BUTTON_EUPHORIA, 1.0f));
|
||||
|
||||
AddBind(touchScreenKey, new sBind(a, TURNTABLE_TABLE_LEFT_LEFT, BIND_AXIS, TURNTABLE_TABLE_LEFT_LEFT, -1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, TURNTABLE_TABLE_LEFT_RIGHT, BIND_AXIS, TURNTABLE_TABLE_LEFT_RIGHT, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, TURNTABLE_TABLE_RIGHT_LEFT, BIND_AXIS, TURNTABLE_TABLE_RIGHT_LEFT, -1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, TURNTABLE_TABLE_RIGHT_RIGHT, BIND_AXIS, TURNTABLE_TABLE_RIGHT_RIGHT, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, TURNTABLE_TABLE_LEFT_LEFT, BIND_AXIS, TURNTABLE_TABLE_LEFT_LEFT, -1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, TURNTABLE_TABLE_LEFT_RIGHT, BIND_AXIS, TURNTABLE_TABLE_LEFT_RIGHT, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, TURNTABLE_TABLE_RIGHT_LEFT, BIND_AXIS, TURNTABLE_TABLE_RIGHT_LEFT, -1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, TURNTABLE_TABLE_RIGHT_RIGHT, BIND_AXIS,
|
||||
TURNTABLE_TABLE_RIGHT_RIGHT, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, TURNTABLE_STICK_UP, BIND_AXIS, TURNTABLE_STICK_UP, -1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, TURNTABLE_STICK_DOWN, BIND_AXIS, TURNTABLE_STICK_DOWN, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, TURNTABLE_STICK_LEFT, BIND_AXIS, TURNTABLE_STICK_LEFT, -1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, TURNTABLE_STICK_RIGHT, BIND_AXIS, TURNTABLE_STICK_RIGHT, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, TURNTABLE_EFFECT_DIAL, BIND_AXIS, TURNTABLE_EFFECT_DIAL, 1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, TURNTABLE_CROSSFADE_LEFT, BIND_AXIS, TURNTABLE_CROSSFADE_LEFT, -1.0f));
|
||||
AddBind(touchScreenKey, new sBind(a, TURNTABLE_CROSSFADE_RIGHT, BIND_AXIS, TURNTABLE_CROSSFADE_RIGHT, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, TURNTABLE_STICK_DOWN, BIND_AXIS, TURNTABLE_STICK_DOWN, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, TURNTABLE_STICK_LEFT, BIND_AXIS, TURNTABLE_STICK_LEFT, -1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, TURNTABLE_STICK_RIGHT, BIND_AXIS, TURNTABLE_STICK_RIGHT, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, TURNTABLE_EFFECT_DIAL, BIND_AXIS, TURNTABLE_EFFECT_DIAL, 1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, TURNTABLE_CROSSFADE_LEFT, BIND_AXIS, TURNTABLE_CROSSFADE_LEFT, -1.0f));
|
||||
AddBind(touchScreenKey,
|
||||
new sBind(a, TURNTABLE_CROSSFADE_RIGHT, BIND_AXIS, TURNTABLE_CROSSFADE_RIGHT, 1.0f));
|
||||
}
|
||||
// Init our controller bindings
|
||||
IniFile ini;
|
||||
|
@ -527,22 +361,22 @@ namespace ButtonManager
|
|||
sscanf(value.c_str(), "Device '%127[^\']'-Button %d", dev, &bindnum);
|
||||
}
|
||||
if (hasbind)
|
||||
AddBind(std::string(dev), new sBind(padID, configTypes[a], type, bindnum, modifier == '-' ? -1.0f : 1.0f));
|
||||
AddBind(std::string(dev),
|
||||
new sBind(padID, configTypes[a], type, bindnum, modifier == '-' ? -1.0f : 1.0f));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
bool GetButtonPressed(int padID, ButtonType button)
|
||||
{
|
||||
}
|
||||
bool GetButtonPressed(int padID, ButtonType button)
|
||||
{
|
||||
bool pressed = m_controllers[touchScreenKey]->ButtonValue(padID, button);
|
||||
|
||||
for (const auto& ctrl : m_controllers)
|
||||
pressed |= ctrl.second->ButtonValue(padID, button);
|
||||
|
||||
return pressed;
|
||||
}
|
||||
float GetAxisValue(int padID, ButtonType axis)
|
||||
{
|
||||
}
|
||||
float GetAxisValue(int padID, ButtonType axis)
|
||||
{
|
||||
float value = m_controllers[touchScreenKey]->AxisValue(padID, axis);
|
||||
if (value == 0.0f)
|
||||
{
|
||||
|
@ -554,30 +388,30 @@ namespace ButtonManager
|
|||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
bool GamepadEvent(const std::string& dev, int button, int action)
|
||||
{
|
||||
}
|
||||
bool GamepadEvent(const std::string& dev, int button, int action)
|
||||
{
|
||||
auto it = m_controllers.find(dev);
|
||||
if (it != m_controllers.end())
|
||||
return it->second->PressEvent(button, action);
|
||||
return false;
|
||||
}
|
||||
void GamepadAxisEvent(const std::string& dev, int axis, float value)
|
||||
{
|
||||
}
|
||||
void GamepadAxisEvent(const std::string& dev, int axis, float value)
|
||||
{
|
||||
auto it = m_controllers.find(dev);
|
||||
if (it != m_controllers.end())
|
||||
it->second->AxisEvent(axis, value);
|
||||
}
|
||||
void Shutdown()
|
||||
{
|
||||
}
|
||||
void Shutdown()
|
||||
{
|
||||
for (const auto& controller : m_controllers)
|
||||
delete controller.second;
|
||||
m_controllers.clear();
|
||||
}
|
||||
}
|
||||
|
||||
// InputDevice
|
||||
bool InputDevice::PressEvent(int button, int action)
|
||||
{
|
||||
// InputDevice
|
||||
bool InputDevice::PressEvent(int button, int action)
|
||||
{
|
||||
bool handled = false;
|
||||
for (const auto& binding : _inputbinds)
|
||||
{
|
||||
|
@ -591,9 +425,9 @@ namespace ButtonManager
|
|||
}
|
||||
}
|
||||
return handled;
|
||||
}
|
||||
void InputDevice::AxisEvent(int axis, float value)
|
||||
{
|
||||
}
|
||||
void InputDevice::AxisEvent(int axis, float value)
|
||||
{
|
||||
for (const auto& binding : _inputbinds)
|
||||
{
|
||||
if (binding.second->_bind == axis)
|
||||
|
@ -604,9 +438,9 @@ namespace ButtonManager
|
|||
_buttons[binding.second->_buttontype] = value > 0.5f ? true : false;
|
||||
}
|
||||
}
|
||||
}
|
||||
bool InputDevice::ButtonValue(int padID, ButtonType button)
|
||||
{
|
||||
}
|
||||
bool InputDevice::ButtonValue(int padID, ButtonType button)
|
||||
{
|
||||
const auto& binding = _inputbinds.find(std::make_pair(padID, button));
|
||||
if (binding == _inputbinds.end())
|
||||
return false;
|
||||
|
@ -615,9 +449,9 @@ namespace ButtonManager
|
|||
return _buttons[binding->second->_buttontype];
|
||||
else
|
||||
return (_axises[binding->second->_buttontype] * binding->second->_neg) > 0.5f;
|
||||
}
|
||||
float InputDevice::AxisValue(int padID, ButtonType axis)
|
||||
{
|
||||
}
|
||||
float InputDevice::AxisValue(int padID, ButtonType axis)
|
||||
{
|
||||
const auto& binding = _inputbinds.find(std::make_pair(padID, axis));
|
||||
if (binding == _inputbinds.end())
|
||||
return 0.0f;
|
||||
|
@ -626,5 +460,5 @@ namespace ButtonManager
|
|||
return _axises[binding->second->_buttontype] * binding->second->_neg;
|
||||
else
|
||||
return _buttons[binding->second->_buttontype] == BUTTON_PRESSED ? 1.0f : 0.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
|
||||
namespace ButtonManager
|
||||
{
|
||||
enum ButtonType
|
||||
{
|
||||
enum ButtonType
|
||||
{
|
||||
// GC
|
||||
BUTTON_A = 0,
|
||||
BUTTON_B = 1,
|
||||
|
@ -70,7 +70,7 @@ namespace ButtonManager
|
|||
WIIMOTE_SHAKE_X = 132,
|
||||
WIIMOTE_SHAKE_Y = 133,
|
||||
WIIMOTE_SHAKE_Z = 134,
|
||||
//Nunchuk
|
||||
// Nunchuk
|
||||
NUNCHUK_BUTTON_C = 200,
|
||||
NUNCHUK_BUTTON_Z = 201,
|
||||
NUNCHUK_STICK = 202, // To Be Used on Java Side
|
||||
|
@ -94,7 +94,7 @@ namespace ButtonManager
|
|||
NUNCHUK_SHAKE_X = 220,
|
||||
NUNCHUK_SHAKE_Y = 221,
|
||||
NUNCHUK_SHAKE_Z = 222,
|
||||
//Classic
|
||||
// Classic
|
||||
CLASSIC_BUTTON_A = 300,
|
||||
CLASSIC_BUTTON_B = 301,
|
||||
CLASSIC_BUTTON_X = 302,
|
||||
|
@ -120,7 +120,7 @@ namespace ButtonManager
|
|||
CLASSIC_STICK_RIGHT_RIGHT = 322,
|
||||
CLASSIC_TRIGGER_L = 323,
|
||||
CLASSIC_TRIGGER_R = 324,
|
||||
//Guitar
|
||||
// Guitar
|
||||
GUITAR_BUTTON_MINUS = 400,
|
||||
GUITAR_BUTTON_PLUS = 401,
|
||||
GUITAR_FRET_GREEN = 402,
|
||||
|
@ -136,7 +136,7 @@ namespace ButtonManager
|
|||
GUITAR_STICK_LEFT = 412,
|
||||
GUITAR_STICK_RIGHT = 413,
|
||||
GUITAR_WHAMMY_BAR = 414,
|
||||
//Drums
|
||||
// Drums
|
||||
DRUMS_BUTTON_MINUS = 500,
|
||||
DRUMS_BUTTON_PLUS = 501,
|
||||
DRUMS_PAD_RED = 502,
|
||||
|
@ -150,7 +150,7 @@ namespace ButtonManager
|
|||
DRUMS_STICK_DOWN = 510,
|
||||
DRUMS_STICK_LEFT = 511,
|
||||
DRUMS_STICK_RIGHT = 512,
|
||||
//Turntable
|
||||
// Turntable
|
||||
TURNTABLE_BUTTON_GREEN_LEFT = 600,
|
||||
TURNTABLE_BUTTON_RED_LEFT = 601,
|
||||
TURNTABLE_BUTTON_BLUE_LEFT = 602,
|
||||
|
@ -176,42 +176,42 @@ namespace ButtonManager
|
|||
TURNTABLE_CROSSFADE = 622, // To Be Used on Java Side
|
||||
TURNTABLE_CROSSFADE_LEFT = 623,
|
||||
TURNTABLE_CROSSFADE_RIGHT = 624,
|
||||
};
|
||||
enum ButtonState
|
||||
{
|
||||
};
|
||||
enum ButtonState
|
||||
{
|
||||
BUTTON_RELEASED = 0,
|
||||
BUTTON_PRESSED = 1
|
||||
};
|
||||
enum BindType
|
||||
{
|
||||
};
|
||||
enum BindType
|
||||
{
|
||||
BIND_BUTTON = 0,
|
||||
BIND_AXIS
|
||||
};
|
||||
class Button
|
||||
{
|
||||
private:
|
||||
};
|
||||
class Button
|
||||
{
|
||||
private:
|
||||
ButtonState m_state;
|
||||
public:
|
||||
|
||||
public:
|
||||
Button() : m_state(BUTTON_RELEASED) {}
|
||||
void SetState(ButtonState state) { m_state = state; }
|
||||
bool Pressed() { return m_state == BUTTON_PRESSED; }
|
||||
|
||||
~Button() {}
|
||||
};
|
||||
class Axis
|
||||
{
|
||||
private:
|
||||
};
|
||||
class Axis
|
||||
{
|
||||
private:
|
||||
float m_value;
|
||||
public:
|
||||
|
||||
public:
|
||||
Axis() : m_value(0.0f) {}
|
||||
void SetValue(float value) { m_value = value; }
|
||||
float AxisValue() { return m_value; }
|
||||
|
||||
~Axis() {}
|
||||
};
|
||||
};
|
||||
|
||||
struct sBind
|
||||
{
|
||||
struct sBind
|
||||
{
|
||||
const int _padID;
|
||||
const ButtonType _buttontype;
|
||||
const BindType _bindtype;
|
||||
|
@ -219,22 +219,22 @@ namespace ButtonManager
|
|||
const float _neg;
|
||||
sBind(int padID, ButtonType buttontype, BindType bindtype, int bind, float neg)
|
||||
: _padID(padID), _buttontype(buttontype), _bindtype(bindtype), _bind(bind), _neg(neg)
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
class InputDevice
|
||||
{
|
||||
private:
|
||||
}
|
||||
};
|
||||
|
||||
class InputDevice
|
||||
{
|
||||
private:
|
||||
const std::string _dev;
|
||||
std::map<ButtonType, bool> _buttons;
|
||||
std::map<ButtonType, float> _axises;
|
||||
|
||||
// Key is padID and ButtonType
|
||||
std::map<std::pair<int, ButtonType>, sBind*> _inputbinds;
|
||||
public:
|
||||
InputDevice(std::string dev)
|
||||
: _dev(dev) {}
|
||||
|
||||
public:
|
||||
InputDevice(std::string dev) : _dev(dev) {}
|
||||
~InputDevice()
|
||||
{
|
||||
for (const auto& bind : _inputbinds)
|
||||
|
@ -246,12 +246,12 @@ namespace ButtonManager
|
|||
void AxisEvent(int axis, float value);
|
||||
bool ButtonValue(int padID, ButtonType button);
|
||||
float AxisValue(int padID, ButtonType axis);
|
||||
};
|
||||
};
|
||||
|
||||
void Init();
|
||||
bool GetButtonPressed(int padID, ButtonType button);
|
||||
float GetAxisValue(int padID, ButtonType axis);
|
||||
bool GamepadEvent(const std::string& dev, int button, int action);
|
||||
void GamepadAxisEvent(const std::string& dev, int axis, float value);
|
||||
void Shutdown();
|
||||
void Init();
|
||||
bool GetButtonPressed(int padID, ButtonType button);
|
||||
float GetAxisValue(int padID, ButtonType axis);
|
||||
bool GamepadEvent(const std::string& dev, int button, int action);
|
||||
void GamepadAxisEvent(const std::string& dev, int axis, float value);
|
||||
void Shutdown();
|
||||
}
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <EGL/egl.h>
|
||||
#include <android/log.h>
|
||||
#include <android/native_window_jni.h>
|
||||
#include <cinttypes>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
|
@ -9,15 +12,12 @@
|
|||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
#include <android/log.h>
|
||||
#include <android/native_window_jni.h>
|
||||
#include <EGL/egl.h>
|
||||
|
||||
#include "ButtonManager.h"
|
||||
|
||||
#include "Common/CPUDetect.h"
|
||||
#include "Common/CommonPaths.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/CPUDetect.h"
|
||||
#include "Common/Event.h"
|
||||
#include "Common/FileUtil.h"
|
||||
#include "Common/GL/GLInterfaceBase.h"
|
||||
|
@ -26,12 +26,12 @@
|
|||
#include "Core/BootManager.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/Host.h"
|
||||
#include "Core/State.h"
|
||||
#include "Core/HW/Wiimote.h"
|
||||
#include "Core/HW/WiimoteReal/WiimoteReal.h"
|
||||
#include "Core/Host.h"
|
||||
#include "Core/PowerPC/JitInterface.h"
|
||||
#include "Core/PowerPC/Profiler.h"
|
||||
#include "Core/State.h"
|
||||
|
||||
#include "DiscIO/Volume.h"
|
||||
#include "DiscIO/VolumeCreator.h"
|
||||
|
@ -63,8 +63,12 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved)
|
|||
return JNI_VERSION_1_6;
|
||||
}
|
||||
|
||||
void Host_NotifyMapLoaded() {}
|
||||
void Host_RefreshDSPDebuggerWindow() {}
|
||||
void Host_NotifyMapLoaded()
|
||||
{
|
||||
}
|
||||
void Host_RefreshDSPDebuggerWindow()
|
||||
{
|
||||
}
|
||||
|
||||
// The Core only supports using a single Host thread.
|
||||
// If multiple threads want to call host functions then they need to queue
|
||||
|
@ -96,15 +100,21 @@ void Host_UpdateTitle(const std::string& title)
|
|||
__android_log_write(ANDROID_LOG_INFO, DOLPHIN_TAG, title.c_str());
|
||||
}
|
||||
|
||||
void Host_UpdateDisasmDialog(){}
|
||||
void Host_UpdateDisasmDialog()
|
||||
{
|
||||
}
|
||||
|
||||
void Host_UpdateMainFrame()
|
||||
{
|
||||
}
|
||||
|
||||
void Host_RequestRenderWindowSize(int width, int height) {}
|
||||
void Host_RequestRenderWindowSize(int width, int height)
|
||||
{
|
||||
}
|
||||
|
||||
void Host_RequestFullscreen(bool enable_fullscreen) {}
|
||||
void Host_RequestFullscreen(bool enable_fullscreen)
|
||||
{
|
||||
}
|
||||
|
||||
void Host_SetStartupDebuggingParameters()
|
||||
{
|
||||
|
@ -125,11 +135,17 @@ bool Host_RendererIsFullscreen()
|
|||
return false;
|
||||
}
|
||||
|
||||
void Host_ConnectWiimote(int wm_idx, bool connect) {}
|
||||
void Host_ConnectWiimote(int wm_idx, bool connect)
|
||||
{
|
||||
}
|
||||
|
||||
void Host_SetWiiMoteConnectionState(int _State) {}
|
||||
void Host_SetWiiMoteConnectionState(int _State)
|
||||
{
|
||||
}
|
||||
|
||||
void Host_ShowVideoConfig(void*, const std::string&, const std::string&) {}
|
||||
void Host_ShowVideoConfig(void*, const std::string&, const std::string&)
|
||||
{
|
||||
}
|
||||
|
||||
static bool MsgAlert(const char* caption, const char* text, bool yes_no, int /*Style*/)
|
||||
{
|
||||
|
@ -151,18 +167,22 @@ static bool MsgAlert(const char* caption, const char* text, bool yes_no, int /*S
|
|||
#define DVD_BANNER_WIDTH 96
|
||||
#define DVD_BANNER_HEIGHT 32
|
||||
|
||||
static inline u32 Average32(u32 a, u32 b) {
|
||||
static inline u32 Average32(u32 a, u32 b)
|
||||
{
|
||||
return ((a >> 1) & 0x7f7f7f7f) + ((b >> 1) & 0x7f7f7f7f);
|
||||
}
|
||||
|
||||
static inline u32 GetPixel(u32 *buffer, unsigned int x, unsigned int y) {
|
||||
static inline u32 GetPixel(u32* buffer, unsigned int x, unsigned int y)
|
||||
{
|
||||
// thanks to unsignedness, these also check for <0 automatically.
|
||||
if (x > 191) return 0;
|
||||
if (y > 63) return 0;
|
||||
if (x > 191)
|
||||
return 0;
|
||||
if (y > 63)
|
||||
return 0;
|
||||
return buffer[y * 192 + x];
|
||||
}
|
||||
|
||||
static bool LoadBanner(std::string filename, u32 *Banner)
|
||||
static bool LoadBanner(std::string filename, u32* Banner)
|
||||
{
|
||||
std::unique_ptr<DiscIO::IVolume> pVolume(DiscIO::CreateVolumeFromFilename(filename));
|
||||
|
||||
|
@ -183,9 +203,9 @@ static bool LoadBanner(std::string filename, u32 *Banner)
|
|||
{
|
||||
// simplified plus-shaped "gaussian"
|
||||
u32 surround = Average32(
|
||||
Average32(GetPixel(Buffer, x*2 - 1, y*2), GetPixel(Buffer, x*2 + 1, y*2)),
|
||||
Average32(GetPixel(Buffer, x*2, y*2 - 1), GetPixel(Buffer, x*2, y*2 + 1)));
|
||||
Banner[y * 96 + x] = Average32(GetPixel(Buffer, x*2, y*2), surround);
|
||||
Average32(GetPixel(Buffer, x * 2 - 1, y * 2), GetPixel(Buffer, x * 2 + 1, y * 2)),
|
||||
Average32(GetPixel(Buffer, x * 2, y * 2 - 1), GetPixel(Buffer, x * 2, y * 2 + 1)));
|
||||
Banner[y * 96 + x] = Average32(GetPixel(Buffer, x * 2, y * 2), surround);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -242,12 +262,14 @@ static int GetPlatform(std::string filename)
|
|||
|
||||
static std::string GetTitle(std::string filename)
|
||||
{
|
||||
__android_log_print(ANDROID_LOG_WARN, DOLPHIN_TAG, "Getting Title for file: %s", filename.c_str());
|
||||
__android_log_print(ANDROID_LOG_WARN, DOLPHIN_TAG, "Getting Title for file: %s",
|
||||
filename.c_str());
|
||||
|
||||
std::unique_ptr<DiscIO::IVolume> pVolume(DiscIO::CreateVolumeFromFilename(filename));
|
||||
|
||||
if (pVolume != nullptr) {
|
||||
std::map <DiscIO::IVolume::ELanguage, std::string> titles = pVolume->GetNames(true);
|
||||
if (pVolume != nullptr)
|
||||
{
|
||||
std::map<DiscIO::IVolume::ELanguage, std::string> titles = pVolume->GetNames(true);
|
||||
|
||||
/*
|
||||
bool is_wii_title = pVolume->GetVolumeType() != DiscIO::IVolume::GAMECUBE_DISC;
|
||||
|
@ -260,13 +282,12 @@ static std::string GetTitle(std::string filename)
|
|||
auto end = titles.end();
|
||||
|
||||
// English tends to be a good fallback when the requested language isn't available
|
||||
//if (language != DiscIO::IVolume::ELanguage::LANGUAGE_ENGLISH) {
|
||||
// if (language != DiscIO::IVolume::ELanguage::LANGUAGE_ENGLISH) {
|
||||
auto it = titles.find(DiscIO::IVolume::ELanguage::LANGUAGE_ENGLISH);
|
||||
if (it != end)
|
||||
return it->second;
|
||||
//}
|
||||
|
||||
|
||||
// If English isn't available either, just pick something
|
||||
if (!titles.empty())
|
||||
return titles.cbegin()->second;
|
||||
|
@ -277,12 +298,13 @@ static std::string GetTitle(std::string filename)
|
|||
return name;
|
||||
}
|
||||
|
||||
return std::string ("");
|
||||
return std::string("");
|
||||
}
|
||||
|
||||
static std::string GetDescription(std::string filename)
|
||||
{
|
||||
__android_log_print(ANDROID_LOG_WARN, DOLPHIN_TAG, "Getting Description for file: %s", filename.c_str());
|
||||
__android_log_print(ANDROID_LOG_WARN, DOLPHIN_TAG, "Getting Description for file: %s",
|
||||
filename.c_str());
|
||||
|
||||
std::unique_ptr<DiscIO::IVolume> volume(DiscIO::CreateVolumeFromFilename(filename));
|
||||
|
||||
|
@ -301,7 +323,7 @@ static std::string GetDescription(std::string filename)
|
|||
auto end = descriptions.end();
|
||||
|
||||
// English tends to be a good fallback when the requested language isn't available
|
||||
//if (language != DiscIO::IVolume::ELanguage::LANGUAGE_ENGLISH) {
|
||||
// if (language != DiscIO::IVolume::ELanguage::LANGUAGE_ENGLISH) {
|
||||
auto it = descriptions.find(DiscIO::IVolume::ELanguage::LANGUAGE_ENGLISH);
|
||||
if (it != end)
|
||||
return it->second;
|
||||
|
@ -330,7 +352,8 @@ static std::string GetGameId(std::string filename)
|
|||
|
||||
static std::string GetCompany(std::string filename)
|
||||
{
|
||||
__android_log_print(ANDROID_LOG_WARN, DOLPHIN_TAG, "Getting Company for file: %s", filename.c_str());
|
||||
__android_log_print(ANDROID_LOG_WARN, DOLPHIN_TAG, "Getting Company for file: %s",
|
||||
filename.c_str());
|
||||
|
||||
std::unique_ptr<DiscIO::IVolume> volume(DiscIO::CreateVolumeFromFilename(filename));
|
||||
if (volume == nullptr)
|
||||
|
@ -354,66 +377,111 @@ static u64 GetFileSize(std::string filename)
|
|||
return size;
|
||||
}
|
||||
|
||||
static std::string GetJString(JNIEnv *env, jstring jstr)
|
||||
static std::string GetJString(JNIEnv* env, jstring jstr)
|
||||
{
|
||||
std::string result = "";
|
||||
if (!jstr)
|
||||
return result;
|
||||
|
||||
const char *s = env->GetStringUTFChars(jstr, nullptr);
|
||||
const char* s = env->GetStringUTFChars(jstr, nullptr);
|
||||
result = s;
|
||||
env->ReleaseStringUTFChars(jstr, s);
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_UnPauseEmulation(JNIEnv *env, jobject obj);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_PauseEmulation(JNIEnv *env, jobject obj);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_StopEmulation(JNIEnv *env, jobject obj);
|
||||
JNIEXPORT jboolean JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_onGamePadEvent(JNIEnv *env, jobject obj, jstring jDevice, jint Button, jint Action);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_onGamePadMoveEvent(JNIEnv *env, jobject obj, jstring jDevice, jint Axis, jfloat Value);
|
||||
JNIEXPORT jintArray JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetBanner(JNIEnv *env, jobject obj, jstring jFile);JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetTitle(JNIEnv *env, jobject obj, jstring jFilename);
|
||||
JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetDescription(JNIEnv *env, jobject obj, jstring jFilename);
|
||||
JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetGameId(JNIEnv *env, jobject obj, jstring jFilename);
|
||||
JNIEXPORT jint JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetCountry(JNIEnv *env, jobject obj, jstring jFilename);
|
||||
JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetCompany(JNIEnv *env, jobject obj, jstring jFilename);
|
||||
JNIEXPORT jlong JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetFilesize(JNIEnv *env, jobject obj, jstring jFilename);
|
||||
JNIEXPORT jint JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetPlatform(JNIEnv *env, jobject obj, jstring jFilename);
|
||||
JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetVersionString(JNIEnv *env, jobject obj);
|
||||
JNIEXPORT jboolean JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SupportsNEON(JNIEnv *env, jobject obj);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SaveScreenShot(JNIEnv *env, jobject obj);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_eglBindAPI(JNIEnv *env, jobject obj, jint api);
|
||||
JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetConfig(JNIEnv *env, jobject obj, jstring jFile, jstring jSection, jstring jKey, jstring jDefault);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetConfig(JNIEnv *env, jobject obj, jstring jFile, jstring jSection, jstring jKey, jstring jValue);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetFilename(JNIEnv *env, jobject obj, jstring jFile);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SaveState(JNIEnv *env, jobject obj, jint slot);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_LoadState(JNIEnv *env, jobject obj, jint slot);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_CreateUserFolders(JNIEnv *env, jobject obj);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetUserDirectory(JNIEnv *env, jobject obj, jstring jDirectory);
|
||||
JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetUserDirectory(JNIEnv *env, jobject obj);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetProfiling(JNIEnv *env, jobject obj, jboolean enable);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_WriteProfileResults(JNIEnv *env, jobject obj);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_CacheClassesAndMethods(JNIEnv *env, jobject obj);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_Run(JNIEnv *env, jobject obj);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SurfaceChanged(JNIEnv *env, jobject obj, jobject _surf);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SurfaceDestroyed(JNIEnv *env, jobject obj);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_UnPauseEmulation(JNIEnv* env,
|
||||
jobject obj);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_PauseEmulation(JNIEnv* env,
|
||||
jobject obj);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_StopEmulation(JNIEnv* env,
|
||||
jobject obj);
|
||||
JNIEXPORT jboolean JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_onGamePadEvent(
|
||||
JNIEnv* env, jobject obj, jstring jDevice, jint Button, jint Action);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_onGamePadMoveEvent(
|
||||
JNIEnv* env, jobject obj, jstring jDevice, jint Axis, jfloat Value);
|
||||
JNIEXPORT jintArray JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetBanner(JNIEnv* env,
|
||||
jobject obj,
|
||||
jstring jFile);
|
||||
JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetTitle(JNIEnv* env,
|
||||
jobject obj,
|
||||
jstring jFilename);
|
||||
JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetDescription(
|
||||
JNIEnv* env, jobject obj, jstring jFilename);
|
||||
JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetGameId(JNIEnv* env,
|
||||
jobject obj,
|
||||
jstring jFilename);
|
||||
JNIEXPORT jint JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetCountry(JNIEnv* env,
|
||||
jobject obj,
|
||||
jstring jFilename);
|
||||
JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetCompany(
|
||||
JNIEnv* env, jobject obj, jstring jFilename);
|
||||
JNIEXPORT jlong JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetFilesize(JNIEnv* env,
|
||||
jobject obj,
|
||||
jstring jFilename);
|
||||
JNIEXPORT jint JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetPlatform(JNIEnv* env,
|
||||
jobject obj,
|
||||
jstring jFilename);
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_org_dolphinemu_dolphinemu_NativeLibrary_GetVersionString(JNIEnv* env, jobject obj);
|
||||
JNIEXPORT jboolean JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SupportsNEON(JNIEnv* env,
|
||||
jobject obj);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SaveScreenShot(JNIEnv* env,
|
||||
jobject obj);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_eglBindAPI(JNIEnv* env,
|
||||
jobject obj,
|
||||
jint api);
|
||||
JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetConfig(
|
||||
JNIEnv* env, jobject obj, jstring jFile, jstring jSection, jstring jKey, jstring jDefault);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetConfig(
|
||||
JNIEnv* env, jobject obj, jstring jFile, jstring jSection, jstring jKey, jstring jValue);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetFilename(JNIEnv* env,
|
||||
jobject obj,
|
||||
jstring jFile);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SaveState(JNIEnv* env,
|
||||
jobject obj,
|
||||
jint slot);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_LoadState(JNIEnv* env,
|
||||
jobject obj,
|
||||
jint slot);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_CreateUserFolders(JNIEnv* env,
|
||||
jobject obj);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetUserDirectory(
|
||||
JNIEnv* env, jobject obj, jstring jDirectory);
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_org_dolphinemu_dolphinemu_NativeLibrary_GetUserDirectory(JNIEnv* env, jobject obj);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetProfiling(JNIEnv* env,
|
||||
jobject obj,
|
||||
jboolean enable);
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_dolphinemu_dolphinemu_NativeLibrary_WriteProfileResults(JNIEnv* env, jobject obj);
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_dolphinemu_dolphinemu_NativeLibrary_CacheClassesAndMethods(JNIEnv* env, jobject obj);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_Run(JNIEnv* env, jobject obj);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SurfaceChanged(JNIEnv* env,
|
||||
jobject obj,
|
||||
jobject _surf);
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SurfaceDestroyed(JNIEnv* env,
|
||||
jobject obj);
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_UnPauseEmulation(JNIEnv *env, jobject obj)
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_UnPauseEmulation(JNIEnv* env,
|
||||
jobject obj)
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(s_host_identity_lock);
|
||||
Core::SetState(Core::CORE_RUN);
|
||||
}
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_PauseEmulation(JNIEnv *env, jobject obj)
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_PauseEmulation(JNIEnv* env,
|
||||
jobject obj)
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(s_host_identity_lock);
|
||||
Core::SetState(Core::CORE_PAUSE);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_StopEmulation(JNIEnv *env, jobject obj)
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_StopEmulation(JNIEnv* env,
|
||||
jobject obj)
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(s_host_identity_lock);
|
||||
Core::SaveScreenShot("thumb");
|
||||
|
@ -421,16 +489,20 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_StopEmulatio
|
|||
Core::Stop();
|
||||
updateMainFrameEvent.Set(); // Kick the waiting event
|
||||
}
|
||||
JNIEXPORT jboolean JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_onGamePadEvent(JNIEnv *env, jobject obj, jstring jDevice, jint Button, jint Action)
|
||||
JNIEXPORT jboolean JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_onGamePadEvent(
|
||||
JNIEnv* env, jobject obj, jstring jDevice, jint Button, jint Action)
|
||||
{
|
||||
return ButtonManager::GamepadEvent(GetJString(env, jDevice), Button, Action);
|
||||
}
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_onGamePadMoveEvent(JNIEnv *env, jobject obj, jstring jDevice, jint Axis, jfloat Value)
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_onGamePadMoveEvent(
|
||||
JNIEnv* env, jobject obj, jstring jDevice, jint Axis, jfloat Value)
|
||||
{
|
||||
ButtonManager::GamepadAxisEvent(GetJString(env, jDevice), Axis, Value);
|
||||
}
|
||||
|
||||
JNIEXPORT jintArray JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetBanner(JNIEnv *env, jobject obj, jstring jFile)
|
||||
JNIEXPORT jintArray JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetBanner(JNIEnv* env,
|
||||
jobject obj,
|
||||
jstring jFile)
|
||||
{
|
||||
std::string file = GetJString(env, jFile);
|
||||
u32 uBanner[DVD_BANNER_WIDTH * DVD_BANNER_HEIGHT];
|
||||
|
@ -443,77 +515,96 @@ JNIEXPORT jintArray JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetBann
|
|||
return Banner;
|
||||
}
|
||||
|
||||
JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetTitle(JNIEnv *env, jobject obj, jstring jFilename)
|
||||
JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetTitle(JNIEnv* env,
|
||||
jobject obj,
|
||||
jstring jFilename)
|
||||
{
|
||||
std::string filename = GetJString(env, jFilename);
|
||||
std::string name = GetTitle(filename);
|
||||
return env->NewStringUTF(name.c_str());
|
||||
}
|
||||
|
||||
JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetDescription(JNIEnv *env, jobject obj, jstring jFilename)
|
||||
JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetDescription(
|
||||
JNIEnv* env, jobject obj, jstring jFilename)
|
||||
{
|
||||
std::string filename = GetJString(env, jFilename);
|
||||
std::string description = GetDescription(filename);
|
||||
return env->NewStringUTF(description.c_str());
|
||||
}
|
||||
|
||||
JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetGameId(JNIEnv *env, jobject obj, jstring jFilename)
|
||||
JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetGameId(JNIEnv* env,
|
||||
jobject obj,
|
||||
jstring jFilename)
|
||||
{
|
||||
std::string filename = GetJString(env, jFilename);
|
||||
std::string id = GetGameId(filename);
|
||||
return env->NewStringUTF(id.c_str());
|
||||
}
|
||||
|
||||
JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetCompany(JNIEnv *env, jobject obj, jstring jFilename)
|
||||
JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetCompany(JNIEnv* env,
|
||||
jobject obj,
|
||||
jstring jFilename)
|
||||
{
|
||||
std::string filename = GetJString(env, jFilename);
|
||||
std::string company = GetCompany(filename);
|
||||
return env->NewStringUTF(company.c_str());
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetCountry(JNIEnv *env, jobject obj, jstring jFilename)
|
||||
JNIEXPORT jint JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetCountry(JNIEnv* env,
|
||||
jobject obj,
|
||||
jstring jFilename)
|
||||
{
|
||||
std::string filename = GetJString(env, jFilename);
|
||||
int country = GetCountry(filename);
|
||||
return country;
|
||||
}
|
||||
|
||||
JNIEXPORT jlong JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetFilesize(JNIEnv *env, jobject obj, jstring jFilename)
|
||||
JNIEXPORT jlong JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetFilesize(JNIEnv* env,
|
||||
jobject obj,
|
||||
jstring jFilename)
|
||||
{
|
||||
std::string filename = GetJString(env, jFilename);
|
||||
u64 size = GetFileSize(filename);
|
||||
return size;
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetPlatform(JNIEnv *env, jobject obj, jstring jFilename)
|
||||
JNIEXPORT jint JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetPlatform(JNIEnv* env,
|
||||
jobject obj,
|
||||
jstring jFilename)
|
||||
{
|
||||
std::string filename = GetJString(env, jFilename);
|
||||
int platform = GetPlatform(filename);
|
||||
return platform;
|
||||
}
|
||||
|
||||
JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetVersionString(JNIEnv *env, jobject obj)
|
||||
JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetVersionString(JNIEnv* env,
|
||||
jobject obj)
|
||||
{
|
||||
return env->NewStringUTF(scm_rev_str.c_str());
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SupportsNEON(JNIEnv *env, jobject obj)
|
||||
JNIEXPORT jboolean JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SupportsNEON(JNIEnv* env,
|
||||
jobject obj)
|
||||
{
|
||||
return cpu_info.bASIMD;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SaveScreenShot(JNIEnv *env, jobject obj)
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SaveScreenShot(JNIEnv* env,
|
||||
jobject obj)
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(s_host_identity_lock);
|
||||
Core::SaveScreenShot();
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_eglBindAPI(JNIEnv *env, jobject obj, jint api)
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_eglBindAPI(JNIEnv* env,
|
||||
jobject obj,
|
||||
jint api)
|
||||
{
|
||||
eglBindAPI(api);
|
||||
}
|
||||
|
||||
JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetConfig(JNIEnv *env, jobject obj, jstring jFile, jstring jSection, jstring jKey, jstring jDefault)
|
||||
JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetConfig(
|
||||
JNIEnv* env, jobject obj, jstring jFile, jstring jSection, jstring jKey, jstring jDefault)
|
||||
{
|
||||
IniFile ini;
|
||||
std::string file = GetJString(env, jFile);
|
||||
|
@ -528,7 +619,8 @@ JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetConfig
|
|||
|
||||
return env->NewStringUTF(value.c_str());
|
||||
}
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetConfig(JNIEnv *env, jobject obj, jstring jFile, jstring jSection, jstring jKey, jstring jValue)
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetConfig(
|
||||
JNIEnv* env, jobject obj, jstring jFile, jstring jSection, jstring jKey, jstring jValue)
|
||||
{
|
||||
IniFile ini;
|
||||
std::string file = GetJString(env, jFile);
|
||||
|
@ -542,29 +634,38 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetConfig(JN
|
|||
ini.Save(File::GetUserPath(D_CONFIG_IDX) + std::string(file));
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetFilename(JNIEnv *env, jobject obj, jstring jFile)
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetFilename(JNIEnv* env,
|
||||
jobject obj,
|
||||
jstring jFile)
|
||||
{
|
||||
g_filename = GetJString(env, jFile);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SaveState(JNIEnv *env, jobject obj, jint slot)
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SaveState(JNIEnv* env,
|
||||
jobject obj,
|
||||
jint slot)
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(s_host_identity_lock);
|
||||
State::Save(slot);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_LoadState(JNIEnv *env, jobject obj, jint slot)
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_LoadState(JNIEnv* env,
|
||||
jobject obj,
|
||||
jint slot)
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(s_host_identity_lock);
|
||||
State::Load(slot);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_CreateUserFolders(JNIEnv *env, jobject obj)
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_CreateUserFolders(JNIEnv* env,
|
||||
jobject obj)
|
||||
{
|
||||
File::CreateFullPath(File::GetUserPath(D_CONFIG_IDX));
|
||||
File::CreateFullPath(File::GetUserPath(D_GCUSER_IDX));
|
||||
File::CreateFullPath(File::GetUserPath(D_WIIROOT_IDX) + DIR_SEP WII_WC24CONF_DIR DIR_SEP "mbox" DIR_SEP);
|
||||
File::CreateFullPath(File::GetUserPath(D_WIIROOT_IDX) + DIR_SEP "shared2" DIR_SEP "succession" DIR_SEP);
|
||||
File::CreateFullPath(File::GetUserPath(D_WIIROOT_IDX) + DIR_SEP WII_WC24CONF_DIR DIR_SEP
|
||||
"mbox" DIR_SEP);
|
||||
File::CreateFullPath(File::GetUserPath(D_WIIROOT_IDX) + DIR_SEP "shared2" DIR_SEP
|
||||
"succession" DIR_SEP);
|
||||
File::CreateFullPath(File::GetUserPath(D_WIIROOT_IDX) + DIR_SEP "shared2" DIR_SEP "ec" DIR_SEP);
|
||||
File::CreateFullPath(File::GetUserPath(D_WIIROOT_IDX) + DIR_SEP WII_SYSCONF_DIR DIR_SEP);
|
||||
File::CreateFullPath(File::GetUserPath(D_CACHE_IDX));
|
||||
|
@ -580,7 +681,8 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_CreateUserFo
|
|||
File::CreateFullPath(File::GetUserPath(D_GCUSER_IDX) + JAP_DIR DIR_SEP);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetUserDirectory(JNIEnv *env, jobject obj, jstring jDirectory)
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetUserDirectory(
|
||||
JNIEnv* env, jobject obj, jstring jDirectory)
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(s_host_identity_lock);
|
||||
std::string directory = GetJString(env, jDirectory);
|
||||
|
@ -588,12 +690,15 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetUserDirec
|
|||
UICommon::SetUserDirectory(directory);
|
||||
}
|
||||
|
||||
JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetUserDirectory(JNIEnv *env, jobject obj)
|
||||
JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetUserDirectory(JNIEnv* env,
|
||||
jobject obj)
|
||||
{
|
||||
return env->NewStringUTF(File::GetUserPath(D_USER_IDX).c_str());
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetProfiling(JNIEnv *env, jobject obj, jboolean enable)
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetProfiling(JNIEnv* env,
|
||||
jobject obj,
|
||||
jboolean enable)
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(s_host_identity_lock);
|
||||
Core::SetState(Core::CORE_PAUSE);
|
||||
|
@ -602,7 +707,8 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetProfiling
|
|||
Core::SetState(Core::CORE_RUN);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_WriteProfileResults(JNIEnv *env, jobject obj)
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_WriteProfileResults(JNIEnv* env,
|
||||
jobject obj)
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(s_host_identity_lock);
|
||||
std::string filename = File::GetUserPath(D_DUMP_IDX) + "Debug/profiler.txt";
|
||||
|
@ -610,7 +716,8 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_WriteProfile
|
|||
JitInterface::WriteProfileResults(filename);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_CacheClassesAndMethods(JNIEnv *env, jobject obj)
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_dolphinemu_dolphinemu_NativeLibrary_CacheClassesAndMethods(JNIEnv* env, jobject obj)
|
||||
{
|
||||
// This class reference is only valid for the lifetime of this method.
|
||||
jclass localClass = env->FindClass("org/dolphinemu/dolphinemu/NativeLibrary");
|
||||
|
@ -622,13 +729,17 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_CacheClasses
|
|||
// So we don't leak a reference to NativeLibrary.class.
|
||||
// env->DeleteGlobalRef(g_jni_class);
|
||||
|
||||
// Method signature taken from javap -s Source/Android/app/build/intermediates/classes/arm/debug/org/dolphinemu/dolphinemu/NativeLibrary.class
|
||||
g_jni_method_alert = env->GetStaticMethodID(g_jni_class, "displayAlertMsg", "(Ljava/lang/String;)V");
|
||||
// Method signature taken from javap -s
|
||||
// Source/Android/app/build/intermediates/classes/arm/debug/org/dolphinemu/dolphinemu/NativeLibrary.class
|
||||
g_jni_method_alert =
|
||||
env->GetStaticMethodID(g_jni_class, "displayAlertMsg", "(Ljava/lang/String;)V");
|
||||
g_jni_method_end = env->GetStaticMethodID(g_jni_class, "endEmulationActivity", "()V");
|
||||
}
|
||||
|
||||
// Surface Handling
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SurfaceChanged(JNIEnv *env, jobject obj, jobject _surf)
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SurfaceChanged(JNIEnv* env,
|
||||
jobject obj,
|
||||
jobject _surf)
|
||||
{
|
||||
surf = ANativeWindow_fromSurface(env, _surf);
|
||||
if (surf == nullptr)
|
||||
|
@ -644,7 +755,8 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SurfaceChang
|
|||
}
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SurfaceDestroyed(JNIEnv *env, jobject obj)
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SurfaceDestroyed(JNIEnv* env,
|
||||
jobject obj)
|
||||
{
|
||||
if (surf)
|
||||
{
|
||||
|
@ -661,13 +773,14 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SurfaceDestr
|
|||
Renderer::s_ChangedSurface.Wait();
|
||||
}
|
||||
}
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_RefreshWiimotes(JNIEnv *env, jobject obj)
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_RefreshWiimotes(JNIEnv* env,
|
||||
jobject obj)
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(s_host_identity_lock);
|
||||
WiimoteReal::Refresh();
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_Run(JNIEnv *env, jobject obj)
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_Run(JNIEnv* env, jobject obj)
|
||||
{
|
||||
__android_log_print(ANDROID_LOG_INFO, DOLPHIN_TAG, "Running : %s", g_filename.c_str());
|
||||
|
||||
|
@ -685,7 +798,7 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_Run(JNIEnv *
|
|||
|
||||
// No use running the loop when booting fails
|
||||
s_have_wm_user_stop = false;
|
||||
if ( BootManager::BootCore( g_filename.c_str() ) )
|
||||
if (BootManager::BootCore(g_filename.c_str()))
|
||||
{
|
||||
static constexpr int TIMEOUT = 10000;
|
||||
static constexpr int WAIT_STEP = 25;
|
||||
|
@ -719,7 +832,6 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_Run(JNIEnv *
|
|||
env->CallStaticVoidMethod(g_jni_class, g_jni_method_end);
|
||||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
|
||||
#include "AudioCommon/AOSoundStream.h"
|
||||
#include "AudioCommon/Mixer.h"
|
||||
#include "Common/MsgHandler.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Common/MsgHandler.h"
|
||||
|
||||
#if defined(HAVE_AO) && HAVE_AO
|
||||
|
||||
|
@ -32,7 +32,7 @@ void AOSound::SoundLoop()
|
|||
return;
|
||||
}
|
||||
|
||||
buf_size = format.bits/8 * format.channels * format.rate;
|
||||
buf_size = format.bits / 8 * format.channels * format.rate;
|
||||
|
||||
while (m_run_thread.load())
|
||||
{
|
||||
|
|
|
@ -26,7 +26,7 @@ class AOSound final : public SoundStream
|
|||
|
||||
int buf_size;
|
||||
|
||||
ao_device *device;
|
||||
ao_device* device;
|
||||
ao_sample_format format;
|
||||
int default_driver;
|
||||
|
||||
|
@ -38,10 +38,6 @@ public:
|
|||
void Stop() override;
|
||||
void Update() override;
|
||||
|
||||
static bool isValid()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool isValid() { return true; }
|
||||
#endif
|
||||
};
|
||||
|
|
|
@ -6,13 +6,12 @@
|
|||
|
||||
#include "AudioCommon/AlsaSoundStream.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/Thread.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Common/Thread.h"
|
||||
|
||||
AlsaSound::AlsaSound()
|
||||
: m_thread_status(ALSAThreadStatus::STOPPED)
|
||||
, handle(nullptr)
|
||||
, frames_to_deliver(FRAME_COUNT_MIN)
|
||||
: m_thread_status(ALSAThreadStatus::STOPPED), handle(nullptr),
|
||||
frames_to_deliver(FRAME_COUNT_MIN)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -33,8 +32,8 @@ void AlsaSound::Stop()
|
|||
{
|
||||
m_thread_status.store(ALSAThreadStatus::STOPPING);
|
||||
|
||||
//Give the opportunity to the audio thread
|
||||
//to realize we are stopping the emulation
|
||||
// Give the opportunity to the audio thread
|
||||
// to realize we are stopping the emulation
|
||||
cv.notify_one();
|
||||
thread.join();
|
||||
}
|
||||
|
@ -70,7 +69,7 @@ void AlsaSound::SoundLoop()
|
|||
|
||||
// Block until thread status changes.
|
||||
std::unique_lock<std::mutex> lock(cv_m);
|
||||
cv.wait(lock, [this]{ return m_thread_status.load() != ALSAThreadStatus::PAUSED; });
|
||||
cv.wait(lock, [this] { return m_thread_status.load() != ALSAThreadStatus::PAUSED; });
|
||||
|
||||
snd_pcm_prepare(handle); // resume sound output
|
||||
}
|
||||
|
@ -79,7 +78,6 @@ void AlsaSound::SoundLoop()
|
|||
m_thread_status.store(ALSAThreadStatus::STOPPED);
|
||||
}
|
||||
|
||||
|
||||
void AlsaSound::Clear(bool muted)
|
||||
{
|
||||
m_muted = muted;
|
||||
|
@ -92,9 +90,9 @@ bool AlsaSound::AlsaInit()
|
|||
unsigned int sample_rate = m_mixer->GetSampleRate();
|
||||
int err;
|
||||
int dir;
|
||||
snd_pcm_sw_params_t *swparams;
|
||||
snd_pcm_hw_params_t *hwparams;
|
||||
snd_pcm_uframes_t buffer_size,buffer_size_max;
|
||||
snd_pcm_sw_params_t* swparams;
|
||||
snd_pcm_hw_params_t* hwparams;
|
||||
snd_pcm_uframes_t buffer_size, buffer_size_max;
|
||||
unsigned int periods;
|
||||
|
||||
err = snd_pcm_open(&handle, "default", SND_PCM_STREAM_PLAYBACK, 0);
|
||||
|
@ -179,16 +177,18 @@ bool AlsaSound::AlsaInit()
|
|||
return false;
|
||||
}
|
||||
|
||||
//periods is the number of fragments alsa can wait for during one
|
||||
//buffer_size
|
||||
// periods is the number of fragments alsa can wait for during one
|
||||
// buffer_size
|
||||
frames_to_deliver = buffer_size / periods;
|
||||
//limit the minimum size. pulseaudio advertises a minimum of 32 samples.
|
||||
// limit the minimum size. pulseaudio advertises a minimum of 32 samples.
|
||||
if (frames_to_deliver < FRAME_COUNT_MIN)
|
||||
frames_to_deliver = FRAME_COUNT_MIN;
|
||||
//it is probably a bad idea to try to send more than one buffer of data
|
||||
// it is probably a bad idea to try to send more than one buffer of data
|
||||
if ((unsigned int)frames_to_deliver > buffer_size)
|
||||
frames_to_deliver = buffer_size;
|
||||
NOTICE_LOG(AUDIO, "ALSA gave us a %ld sample \"hardware\" buffer with %d periods. Will send %d samples per fragments.\n", buffer_size, periods, frames_to_deliver);
|
||||
NOTICE_LOG(AUDIO, "ALSA gave us a %ld sample \"hardware\" buffer with %d periods. Will send %d "
|
||||
"samples per fragments.\n",
|
||||
buffer_size, periods, frames_to_deliver);
|
||||
|
||||
snd_pcm_sw_params_alloca(&swparams);
|
||||
|
||||
|
@ -232,4 +232,3 @@ void AlsaSound::AlsaShutdown()
|
|||
handle = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,11 +28,7 @@ public:
|
|||
void Update() override;
|
||||
void Clear(bool) override;
|
||||
|
||||
static bool isValid()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool isValid() { return true; }
|
||||
private:
|
||||
// maximum number of frames the buffer can hold
|
||||
static constexpr size_t BUFFER_SIZE_MAX = 8192;
|
||||
|
@ -60,7 +56,7 @@ private:
|
|||
std::condition_variable cv;
|
||||
std::mutex cv_m;
|
||||
|
||||
snd_pcm_t *handle;
|
||||
snd_pcm_t* handle;
|
||||
unsigned int frames_to_deliver;
|
||||
#endif
|
||||
};
|
||||
|
|
|
@ -2,22 +2,21 @@
|
|||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
|
||||
#include "AudioCommon/AlsaSoundStream.h"
|
||||
#include "AudioCommon/AOSoundStream.h"
|
||||
#include "AudioCommon/AudioCommon.h"
|
||||
#include "AudioCommon/AOSoundStream.h"
|
||||
#include "AudioCommon/AlsaSoundStream.h"
|
||||
#include "AudioCommon/CoreAudioSoundStream.h"
|
||||
#include "AudioCommon/Mixer.h"
|
||||
#include "AudioCommon/NullSoundStream.h"
|
||||
#include "AudioCommon/OpenALStream.h"
|
||||
#include "AudioCommon/OpenSLESStream.h"
|
||||
#include "AudioCommon/PulseAudioStream.h"
|
||||
#include "AudioCommon/XAudio2_7Stream.h"
|
||||
#include "AudioCommon/XAudio2Stream.h"
|
||||
#include "AudioCommon/XAudio2_7Stream.h"
|
||||
#include "Common/Common.h"
|
||||
#include "Common/FileUtil.h"
|
||||
#include "Common/MsgHandler.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Common/MsgHandler.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/Movie.h"
|
||||
|
||||
|
@ -28,11 +27,11 @@ static bool s_audio_dump_start = false;
|
|||
|
||||
namespace AudioCommon
|
||||
{
|
||||
static const int AUDIO_VOLUME_MIN = 0;
|
||||
static const int AUDIO_VOLUME_MAX = 100;
|
||||
static const int AUDIO_VOLUME_MIN = 0;
|
||||
static const int AUDIO_VOLUME_MAX = 100;
|
||||
|
||||
SoundStream* InitSoundStream()
|
||||
{
|
||||
SoundStream* InitSoundStream()
|
||||
{
|
||||
std::string backend = SConfig::GetInstance().sBackend;
|
||||
if (backend == BACKEND_OPENAL && OpenALStream::isValid())
|
||||
g_sound_stream = new OpenALStream();
|
||||
|
@ -58,8 +57,8 @@ namespace AudioCommon
|
|||
|
||||
if (!g_sound_stream && NullSound::isValid())
|
||||
{
|
||||
WARN_LOG(AUDIO, "Could not initialize backend %s, using %s instead.",
|
||||
backend.c_str(), BACKEND_NULLSOUND);
|
||||
WARN_LOG(AUDIO, "Could not initialize backend %s, using %s instead.", backend.c_str(),
|
||||
BACKEND_NULLSOUND);
|
||||
g_sound_stream = new NullSound();
|
||||
}
|
||||
|
||||
|
@ -68,8 +67,8 @@ namespace AudioCommon
|
|||
UpdateSoundStream();
|
||||
if (!g_sound_stream->Start())
|
||||
{
|
||||
ERROR_LOG(AUDIO, "Could not start backend %s, using %s instead",
|
||||
backend.c_str(), BACKEND_NULLSOUND);
|
||||
ERROR_LOG(AUDIO, "Could not start backend %s, using %s instead", backend.c_str(),
|
||||
BACKEND_NULLSOUND);
|
||||
delete g_sound_stream;
|
||||
g_sound_stream = new NullSound();
|
||||
g_sound_stream->Start();
|
||||
|
@ -86,10 +85,10 @@ namespace AudioCommon
|
|||
delete g_sound_stream;
|
||||
g_sound_stream = nullptr;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void ShutdownSoundStream()
|
||||
{
|
||||
void ShutdownSoundStream()
|
||||
{
|
||||
INFO_LOG(AUDIO, "Shutting down sound stream");
|
||||
|
||||
if (g_sound_stream)
|
||||
|
@ -102,10 +101,10 @@ namespace AudioCommon
|
|||
}
|
||||
|
||||
INFO_LOG(AUDIO, "Done shutting down sound stream");
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<std::string> GetSoundBackends()
|
||||
{
|
||||
std::vector<std::string> GetSoundBackends()
|
||||
{
|
||||
std::vector<std::string> backends;
|
||||
|
||||
if (NullSound::isValid())
|
||||
|
@ -125,25 +124,25 @@ namespace AudioCommon
|
|||
if (OpenSLESStream::isValid())
|
||||
backends.push_back(BACKEND_OPENSLES);
|
||||
return backends;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateSoundStream()
|
||||
{
|
||||
void UpdateSoundStream()
|
||||
{
|
||||
if (g_sound_stream)
|
||||
{
|
||||
int volume = SConfig::GetInstance().m_IsMuted ? 0 : SConfig::GetInstance().m_Volume;
|
||||
g_sound_stream->SetVolume(volume);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ClearAudioBuffer(bool mute)
|
||||
{
|
||||
void ClearAudioBuffer(bool mute)
|
||||
{
|
||||
if (g_sound_stream)
|
||||
g_sound_stream->Clear(mute);
|
||||
}
|
||||
}
|
||||
|
||||
void SendAIBuffer(short *samples, unsigned int num_samples)
|
||||
{
|
||||
void SendAIBuffer(short* samples, unsigned int num_samples)
|
||||
{
|
||||
if (!g_sound_stream)
|
||||
return;
|
||||
|
||||
|
@ -160,10 +159,10 @@ namespace AudioCommon
|
|||
}
|
||||
|
||||
g_sound_stream->Update();
|
||||
}
|
||||
}
|
||||
|
||||
void StartAudioDump()
|
||||
{
|
||||
void StartAudioDump()
|
||||
{
|
||||
std::string audio_file_name_dtk = File::GetUserPath(D_DUMPAUDIO_IDX) + "dtkdump.wav";
|
||||
std::string audio_file_name_dsp = File::GetUserPath(D_DUMPAUDIO_IDX) + "dspdump.wav";
|
||||
File::CreateFullPath(audio_file_name_dtk);
|
||||
|
@ -171,39 +170,39 @@ namespace AudioCommon
|
|||
g_sound_stream->GetMixer()->StartLogDTKAudio(audio_file_name_dtk);
|
||||
g_sound_stream->GetMixer()->StartLogDSPAudio(audio_file_name_dsp);
|
||||
s_audio_dump_start = true;
|
||||
}
|
||||
}
|
||||
|
||||
void StopAudioDump()
|
||||
{
|
||||
void StopAudioDump()
|
||||
{
|
||||
g_sound_stream->GetMixer()->StopLogDTKAudio();
|
||||
g_sound_stream->GetMixer()->StopLogDSPAudio();
|
||||
s_audio_dump_start = false;
|
||||
}
|
||||
}
|
||||
|
||||
void IncreaseVolume(unsigned short offset)
|
||||
{
|
||||
void IncreaseVolume(unsigned short offset)
|
||||
{
|
||||
SConfig::GetInstance().m_IsMuted = false;
|
||||
int& currentVolume = SConfig::GetInstance().m_Volume;
|
||||
currentVolume += offset;
|
||||
if (currentVolume > AUDIO_VOLUME_MAX)
|
||||
currentVolume = AUDIO_VOLUME_MAX;
|
||||
UpdateSoundStream();
|
||||
}
|
||||
}
|
||||
|
||||
void DecreaseVolume(unsigned short offset)
|
||||
{
|
||||
void DecreaseVolume(unsigned short offset)
|
||||
{
|
||||
SConfig::GetInstance().m_IsMuted = false;
|
||||
int& currentVolume = SConfig::GetInstance().m_Volume;
|
||||
currentVolume -= offset;
|
||||
if (currentVolume < AUDIO_VOLUME_MIN)
|
||||
currentVolume = AUDIO_VOLUME_MIN;
|
||||
UpdateSoundStream();
|
||||
}
|
||||
}
|
||||
|
||||
void ToggleMuteVolume()
|
||||
{
|
||||
void ToggleMuteVolume()
|
||||
{
|
||||
bool& isMuted = SConfig::GetInstance().m_IsMuted;
|
||||
isMuted = !isMuted;
|
||||
UpdateSoundStream();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,22 +7,21 @@
|
|||
#include "AudioCommon/SoundStream.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
|
||||
|
||||
class CMixer;
|
||||
|
||||
extern SoundStream *g_sound_stream;
|
||||
extern SoundStream* g_sound_stream;
|
||||
|
||||
namespace AudioCommon
|
||||
{
|
||||
SoundStream* InitSoundStream();
|
||||
void ShutdownSoundStream();
|
||||
std::vector<std::string> GetSoundBackends();
|
||||
void UpdateSoundStream();
|
||||
void ClearAudioBuffer(bool mute);
|
||||
void SendAIBuffer(short* samples, unsigned int num_samples);
|
||||
void StartAudioDump();
|
||||
void StopAudioDump();
|
||||
void IncreaseVolume(unsigned short offset);
|
||||
void DecreaseVolume(unsigned short offset);
|
||||
void ToggleMuteVolume();
|
||||
SoundStream* InitSoundStream();
|
||||
void ShutdownSoundStream();
|
||||
std::vector<std::string> GetSoundBackends();
|
||||
void UpdateSoundStream();
|
||||
void ClearAudioBuffer(bool mute);
|
||||
void SendAIBuffer(short* samples, unsigned int num_samples);
|
||||
void StartAudioDump();
|
||||
void StopAudioDump();
|
||||
void IncreaseVolume(unsigned short offset);
|
||||
void DecreaseVolume(unsigned short offset);
|
||||
void ToggleMuteVolume();
|
||||
}
|
||||
|
|
|
@ -7,15 +7,13 @@
|
|||
#include "AudioCommon/CoreAudioSoundStream.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
|
||||
OSStatus CoreAudioSound::callback(void *inRefCon,
|
||||
AudioUnitRenderActionFlags *ioActionFlags,
|
||||
const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber,
|
||||
UInt32 inNumberFrames, AudioBufferList *ioData)
|
||||
OSStatus CoreAudioSound::callback(void* inRefCon, AudioUnitRenderActionFlags* ioActionFlags,
|
||||
const AudioTimeStamp* inTimeStamp, UInt32 inBusNumber,
|
||||
UInt32 inNumberFrames, AudioBufferList* ioData)
|
||||
{
|
||||
for (UInt32 i = 0; i < ioData->mNumberBuffers; i++)
|
||||
((CoreAudioSound *)inRefCon)->m_mixer->
|
||||
Mix((short *)ioData->mBuffers[i].mData,
|
||||
ioData->mBuffers[i].mDataByteSize / 4);
|
||||
((CoreAudioSound*)inRefCon)
|
||||
->m_mixer->Mix((short*)ioData->mBuffers[i].mData, ioData->mBuffers[i].mDataByteSize / 4);
|
||||
|
||||
return noErr;
|
||||
}
|
||||
|
@ -47,12 +45,9 @@ bool CoreAudioSound::Start()
|
|||
return false;
|
||||
}
|
||||
|
||||
FillOutASBDForLPCM(format, m_mixer->GetSampleRate(),
|
||||
2, 16, 16, false, false, false);
|
||||
err = AudioUnitSetProperty(audioUnit,
|
||||
kAudioUnitProperty_StreamFormat,
|
||||
kAudioUnitScope_Input, 0, &format,
|
||||
sizeof(AudioStreamBasicDescription));
|
||||
FillOutASBDForLPCM(format, m_mixer->GetSampleRate(), 2, 16, 16, false, false, false);
|
||||
err = AudioUnitSetProperty(audioUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0,
|
||||
&format, sizeof(AudioStreamBasicDescription));
|
||||
if (err != noErr)
|
||||
{
|
||||
ERROR_LOG(AUDIO, "error setting audio format");
|
||||
|
@ -61,19 +56,15 @@ bool CoreAudioSound::Start()
|
|||
|
||||
callback_struct.inputProc = callback;
|
||||
callback_struct.inputProcRefCon = this;
|
||||
err = AudioUnitSetProperty(audioUnit,
|
||||
kAudioUnitProperty_SetRenderCallback,
|
||||
kAudioUnitScope_Input, 0, &callback_struct,
|
||||
sizeof callback_struct);
|
||||
err = AudioUnitSetProperty(audioUnit, kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input,
|
||||
0, &callback_struct, sizeof callback_struct);
|
||||
if (err != noErr)
|
||||
{
|
||||
ERROR_LOG(AUDIO, "error setting audio callback");
|
||||
return false;
|
||||
}
|
||||
|
||||
err = AudioUnitSetParameter(audioUnit,
|
||||
kHALOutputParam_Volume,
|
||||
kAudioUnitScope_Output, 0,
|
||||
err = AudioUnitSetParameter(audioUnit, kHALOutputParam_Volume, kAudioUnitScope_Output, 0,
|
||||
m_volume / 100., 0);
|
||||
if (err != noErr)
|
||||
ERROR_LOG(AUDIO, "error setting volume");
|
||||
|
@ -100,9 +91,7 @@ void CoreAudioSound::SetVolume(int volume)
|
|||
OSStatus err;
|
||||
m_volume = volume;
|
||||
|
||||
err = AudioUnitSetParameter(audioUnit,
|
||||
kHALOutputParam_Volume,
|
||||
kAudioUnitScope_Output, 0,
|
||||
err = AudioUnitSetParameter(audioUnit, kHALOutputParam_Volume, kAudioUnitScope_Output, 0,
|
||||
volume / 100., 0);
|
||||
if (err != noErr)
|
||||
ERROR_LOG(AUDIO, "error setting volume");
|
||||
|
|
|
@ -20,19 +20,13 @@ public:
|
|||
void Stop() override;
|
||||
void Update() override;
|
||||
|
||||
static bool isValid()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool isValid() { return true; }
|
||||
private:
|
||||
AudioUnit audioUnit;
|
||||
int m_volume;
|
||||
|
||||
static OSStatus callback(void *inRefCon,
|
||||
AudioUnitRenderActionFlags *ioActionFlags,
|
||||
const AudioTimeStamp *inTimeStamp,
|
||||
UInt32 inBusNumber, UInt32 inNumberFrames,
|
||||
AudioBufferList *ioData);
|
||||
static OSStatus callback(void* inRefCon, AudioUnitRenderActionFlags* ioActionFlags,
|
||||
const AudioTimeStamp* inTimeStamp, UInt32 inBusNumber,
|
||||
UInt32 inNumberFrames, AudioBufferList* ioData);
|
||||
#endif
|
||||
};
|
||||
|
|
|
@ -35,11 +35,11 @@ static float adapt_l_gain, adapt_r_gain, adapt_lpr_gain, adapt_lmr_gain;
|
|||
static std::vector<float> lf, rf, lr, rr, cf, cr;
|
||||
static float LFE_buf[256];
|
||||
static unsigned int lfe_pos;
|
||||
static float *filter_coefs_lfe;
|
||||
static float* filter_coefs_lfe;
|
||||
static unsigned int len125;
|
||||
|
||||
template<class T, class _ftype_t>
|
||||
static _ftype_t DotProduct(int count, const T *buf, const _ftype_t *coefficients)
|
||||
template <class T, class _ftype_t>
|
||||
static _ftype_t DotProduct(int count, const T* buf, const _ftype_t* coefficients)
|
||||
{
|
||||
int i;
|
||||
float sum0 = 0.0f, sum1 = 0.0f, sum2 = 0.0f, sum3 = 0.0f;
|
||||
|
@ -60,15 +60,16 @@ static _ftype_t DotProduct(int count, const T *buf, const _ftype_t *coefficients
|
|||
return sum0 + sum1 + sum2 + sum3;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
static T FIRFilter(const T *buf, int pos, int len, int count, const float *coefficients)
|
||||
template <class T>
|
||||
static T FIRFilter(const T* buf, int pos, int len, int count, const float* coefficients)
|
||||
{
|
||||
int count1, count2;
|
||||
|
||||
if (pos >= count)
|
||||
{
|
||||
pos -= count;
|
||||
count1 = count; count2 = 0;
|
||||
count1 = count;
|
||||
count2 = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -78,9 +79,10 @@ static T FIRFilter(const T *buf, int pos, int len, int count, const float *coeff
|
|||
}
|
||||
|
||||
// high part of window
|
||||
const T *ptr = &buf[pos];
|
||||
const T* ptr = &buf[pos];
|
||||
|
||||
float r1 = DotProduct(count1, ptr, coefficients); coefficients += count1;
|
||||
float r1 = DotProduct(count1, ptr, coefficients);
|
||||
coefficients += count1;
|
||||
float r2 = DotProduct(count2, buf, coefficients);
|
||||
return T(r1 + r2);
|
||||
}
|
||||
|
@ -96,11 +98,11 @@ static T FIRFilter(const T *buf, int pos, int len, int count, const float *coeff
|
|||
*/
|
||||
static void Hamming(int n, float* w)
|
||||
{
|
||||
float k = float(2*M_PI/((float)(n - 1))); // 2*pi/(N-1)
|
||||
float k = float(2 * M_PI / ((float)(n - 1))); // 2*pi/(N-1)
|
||||
|
||||
// Calculate window coefficients
|
||||
for (int i = 0; i < n; i++)
|
||||
*w++ = float(0.54 - 0.46*cos(k*(float)i));
|
||||
*w++ = float(0.54 - 0.46 * cos(k * (float)i));
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -120,7 +122,7 @@ opt beta constant used only when designing using kaiser windows
|
|||
|
||||
returns 0 if OK, -1 if fail
|
||||
*/
|
||||
static float* DesignFIR(unsigned int *n, float* fc, float opt)
|
||||
static float* DesignFIR(unsigned int* n, float* fc, float opt)
|
||||
{
|
||||
unsigned int o = *n & 1; // Indicator for odd filter length
|
||||
unsigned int end = ((*n + 1) >> 1) - o; // Loop end
|
||||
|
@ -137,7 +139,7 @@ static float* DesignFIR(unsigned int *n, float* fc, float opt)
|
|||
|
||||
fc[0] = MathUtil::Clamp(fc[0], 0.001f, 1.0f);
|
||||
|
||||
float *w = (float*)calloc(sizeof(float), *n);
|
||||
float* w = (float*)calloc(sizeof(float), *n);
|
||||
|
||||
// Get window coefficients
|
||||
Hamming(*n, w);
|
||||
|
@ -163,13 +165,12 @@ static float* DesignFIR(unsigned int *n, float* fc, float opt)
|
|||
for (u32 i = 0; i < end; i++)
|
||||
{
|
||||
t1 = (float)(i + 1) - k2;
|
||||
w[end - i - 1] = w[*n - end + i] = float(w[end - i - 1] * sin(k1 * t1)/(M_PI * t1)); // Sinc
|
||||
g += 2*w[end - i - 1]; // Total gain in filter
|
||||
w[end - i - 1] = w[*n - end + i] = float(w[end - i - 1] * sin(k1 * t1) / (M_PI * t1)); // Sinc
|
||||
g += 2 * w[end - i - 1]; // Total gain in filter
|
||||
}
|
||||
|
||||
|
||||
// Normalize gain
|
||||
g = 1/g;
|
||||
g = 1 / g;
|
||||
for (u32 i = 0; i < *n; i++)
|
||||
w[i] *= g;
|
||||
|
||||
|
@ -208,7 +209,7 @@ static float* CalculateCoefficients125HzLowpass(int rate)
|
|||
{
|
||||
len125 = 256;
|
||||
float f = 125.0f / (rate / 2);
|
||||
float *coeffs = DesignFIR(&len125, &f, 0);
|
||||
float* coeffs = DesignFIR(&len125, &f, 0);
|
||||
static const float M3_01DB = 0.7071067812f;
|
||||
for (unsigned int i = 0; i < len125; i++)
|
||||
{
|
||||
|
@ -219,26 +220,24 @@ static float* CalculateCoefficients125HzLowpass(int rate)
|
|||
|
||||
static float PassiveLock(float x)
|
||||
{
|
||||
static const float MATAGCLOCK = 0.2f; /* AGC range (around 1) where the matrix behaves passively */
|
||||
static const float MATAGCLOCK =
|
||||
0.2f; /* AGC range (around 1) where the matrix behaves passively */
|
||||
const float x1 = x - 1;
|
||||
const float ax1s = fabs(x - 1) * (1.0f / MATAGCLOCK);
|
||||
return x1 - x1 / (1 + ax1s * ax1s) + 1;
|
||||
}
|
||||
|
||||
static void MatrixDecode(const float *in, const int k, const int il,
|
||||
const int ir, bool decode_rear,
|
||||
const int _dlbuflen,
|
||||
float _l_fwr, float _r_fwr,
|
||||
float _lpr_fwr, float _lmr_fwr,
|
||||
float *_adapt_l_gain, float *_adapt_r_gain,
|
||||
float *_adapt_lpr_gain, float *_adapt_lmr_gain,
|
||||
float *_lf, float *_rf, float *_lr,
|
||||
float *_rr, float *_cf)
|
||||
static void MatrixDecode(const float* in, const int k, const int il, const int ir, bool decode_rear,
|
||||
const int _dlbuflen, float _l_fwr, float _r_fwr, float _lpr_fwr,
|
||||
float _lmr_fwr, float* _adapt_l_gain, float* _adapt_r_gain,
|
||||
float* _adapt_lpr_gain, float* _adapt_lmr_gain, float* _lf, float* _rf,
|
||||
float* _lr, float* _rr, float* _cf)
|
||||
{
|
||||
static const float M9_03DB = 0.3535533906f;
|
||||
static const float MATAGCTRIG = 8.0f; /* (Fuzzy) AGC trigger */
|
||||
static const float MATAGCDECAY = 1.0f; /* AGC baseline decay rate (1/samp.) */
|
||||
static const float MATCOMPGAIN = 0.37f; /* Cross talk compensation gain, 0.50 - 0.55 is full cancellation. */
|
||||
static const float MATCOMPGAIN =
|
||||
0.37f; /* Cross talk compensation gain, 0.50 - 0.55 is full cancellation. */
|
||||
|
||||
const int kr = (k + olddelay) % _dlbuflen;
|
||||
float l_gain = (_l_fwr + _r_fwr) / (1 + _l_fwr + _l_fwr);
|
||||
|
@ -310,7 +309,7 @@ static void MatrixDecode(const float *in, const int k, const int il,
|
|||
_cf[k] += c_agc_cfk + c_agc_cfk;
|
||||
}
|
||||
|
||||
void DPL2Decode(float *samples, int numsamples, float *out)
|
||||
void DPL2Decode(float* samples, int numsamples, float* out)
|
||||
{
|
||||
static const unsigned int FWRDURATION = 240; // FWR average duration (samples)
|
||||
static const int cfg_delay = 0;
|
||||
|
@ -339,8 +338,8 @@ void DPL2Decode(float *samples, int numsamples, float *out)
|
|||
memset(LFE_buf, 0, sizeof(LFE_buf));
|
||||
}
|
||||
|
||||
float *in = samples; // Input audio data
|
||||
float *end = in + numsamples * fmt_nchannels; // Loop end
|
||||
float* in = samples; // Input audio data
|
||||
float* end = in + numsamples * fmt_nchannels; // Loop end
|
||||
|
||||
while (in < end)
|
||||
{
|
||||
|
@ -357,12 +356,9 @@ void DPL2Decode(float *samples, int numsamples, float *out)
|
|||
/* Matrix encoded 2 channel sources */
|
||||
fwrbuf_l[k] = in[0];
|
||||
fwrbuf_r[k] = in[1];
|
||||
MatrixDecode(in, k, 0, 1, true, dlbuflen,
|
||||
l_fwr, r_fwr,
|
||||
lpr_fwr, lmr_fwr,
|
||||
&adapt_l_gain, &adapt_r_gain,
|
||||
&adapt_lpr_gain, &adapt_lmr_gain,
|
||||
&lf[0], &rf[0], &lr[0], &rr[0], &cf[0]);
|
||||
MatrixDecode(in, k, 0, 1, true, dlbuflen, l_fwr, r_fwr, lpr_fwr, lmr_fwr, &adapt_l_gain,
|
||||
&adapt_r_gain, &adapt_lpr_gain, &adapt_lmr_gain, &lf[0], &rf[0], &lr[0], &rr[0],
|
||||
&cf[0]);
|
||||
|
||||
out[cur + 0] = lf[k];
|
||||
out[cur + 1] = rf[k];
|
||||
|
|
|
@ -4,5 +4,5 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
void DPL2Decode(float *samples, int numsamples, float *out);
|
||||
void DPL2Decode(float* samples, int numsamples, float* out);
|
||||
void DPL2Reset();
|
||||
|
|
|
@ -8,16 +8,15 @@
|
|||
#include "AudioCommon/Mixer.h"
|
||||
#include "Common/CommonFuncs.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/MathUtil.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Common/MathUtil.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
|
||||
#if _M_SSE >= 0x301 && !(defined __GNUC__ && !defined __SSSE3__)
|
||||
#include <tmmintrin.h>
|
||||
#endif
|
||||
|
||||
CMixer::CMixer(unsigned int BackendSampleRate)
|
||||
: m_sampleRate(BackendSampleRate)
|
||||
CMixer::CMixer(unsigned int BackendSampleRate) : m_sampleRate(BackendSampleRate)
|
||||
{
|
||||
INFO_LOG(AUDIO_INTERFACE, "Mixer is initialized");
|
||||
}
|
||||
|
@ -27,7 +26,8 @@ CMixer::~CMixer()
|
|||
}
|
||||
|
||||
// Executed from sound stream thread
|
||||
unsigned int CMixer::MixerFifo::Mix(short* samples, unsigned int numSamples, bool consider_framelimit)
|
||||
unsigned int CMixer::MixerFifo::Mix(short* samples, unsigned int numSamples,
|
||||
bool consider_framelimit)
|
||||
{
|
||||
unsigned int currentSample = 0;
|
||||
|
||||
|
@ -45,14 +45,16 @@ unsigned int CMixer::MixerFifo::Mix(short* samples, unsigned int numSamples, boo
|
|||
low_waterwark = std::min(low_waterwark, MAX_SAMPLES / 2);
|
||||
|
||||
float numLeft = (float)(((indexW - indexR) & INDEX_MASK) / 2);
|
||||
m_numLeftI = (numLeft + m_numLeftI*(CONTROL_AVG-1)) / CONTROL_AVG;
|
||||
m_numLeftI = (numLeft + m_numLeftI * (CONTROL_AVG - 1)) / CONTROL_AVG;
|
||||
float offset = (m_numLeftI - low_waterwark) * CONTROL_FACTOR;
|
||||
if (offset > MAX_FREQ_SHIFT) offset = MAX_FREQ_SHIFT;
|
||||
if (offset < -MAX_FREQ_SHIFT) offset = -MAX_FREQ_SHIFT;
|
||||
if (offset > MAX_FREQ_SHIFT)
|
||||
offset = MAX_FREQ_SHIFT;
|
||||
if (offset < -MAX_FREQ_SHIFT)
|
||||
offset = -MAX_FREQ_SHIFT;
|
||||
|
||||
//render numleft sample pairs to samples[]
|
||||
//advance indexR with sample position
|
||||
//remember fractional offset
|
||||
// render numleft sample pairs to samples[]
|
||||
// advance indexR with sample position
|
||||
// remember fractional offset
|
||||
|
||||
float emulationspeed = SConfig::GetInstance().m_EmulationSpeed;
|
||||
float aid_sample_rate = m_input_sample_rate + offset;
|
||||
|
@ -67,19 +69,19 @@ unsigned int CMixer::MixerFifo::Mix(short* samples, unsigned int numSamples, boo
|
|||
s32 rvolume = m_RVolume.load();
|
||||
|
||||
// TODO: consider a higher-quality resampling algorithm.
|
||||
for (; currentSample < numSamples * 2 && ((indexW-indexR) & INDEX_MASK) > 2; currentSample += 2)
|
||||
for (; currentSample < numSamples * 2 && ((indexW - indexR) & INDEX_MASK) > 2; currentSample += 2)
|
||||
{
|
||||
u32 indexR2 = indexR + 2; //next sample
|
||||
u32 indexR2 = indexR + 2; // next sample
|
||||
|
||||
s16 l1 = Common::swap16(m_buffer[indexR & INDEX_MASK]); //current
|
||||
s16 l2 = Common::swap16(m_buffer[indexR2 & INDEX_MASK]); //next
|
||||
s16 l1 = Common::swap16(m_buffer[indexR & INDEX_MASK]); // current
|
||||
s16 l2 = Common::swap16(m_buffer[indexR2 & INDEX_MASK]); // next
|
||||
int sampleL = ((l1 << 16) + (l2 - l1) * (u16)m_frac) >> 16;
|
||||
sampleL = (sampleL * lvolume) >> 8;
|
||||
sampleL += samples[currentSample + 1];
|
||||
samples[currentSample + 1] = MathUtil::Clamp(sampleL, -32767, 32767);
|
||||
|
||||
s16 r1 = Common::swap16(m_buffer[(indexR + 1) & INDEX_MASK]); //current
|
||||
s16 r2 = Common::swap16(m_buffer[(indexR2 + 1) & INDEX_MASK]); //next
|
||||
s16 r1 = Common::swap16(m_buffer[(indexR + 1) & INDEX_MASK]); // current
|
||||
s16 r2 = Common::swap16(m_buffer[(indexR2 + 1) & INDEX_MASK]); // next
|
||||
int sampleR = ((r1 << 16) + (r2 - r1) * (u16)m_frac) >> 16;
|
||||
sampleR = (sampleR * rvolume) >> 8;
|
||||
sampleR += samples[currentSample];
|
||||
|
@ -124,7 +126,7 @@ unsigned int CMixer::Mix(short* samples, unsigned int num_samples, bool consider
|
|||
return num_samples;
|
||||
}
|
||||
|
||||
void CMixer::MixerFifo::PushSamples(const short *samples, unsigned int num_samples)
|
||||
void CMixer::MixerFifo::PushSamples(const short* samples, unsigned int num_samples)
|
||||
{
|
||||
// Cache access in non-volatile variable
|
||||
// indexR isn't allowed to cache in the audio throttling loop as it
|
||||
|
@ -153,21 +155,22 @@ void CMixer::MixerFifo::PushSamples(const short *samples, unsigned int num_sampl
|
|||
m_indexW.fetch_add(num_samples * 2);
|
||||
}
|
||||
|
||||
void CMixer::PushSamples(const short *samples, unsigned int num_samples)
|
||||
void CMixer::PushSamples(const short* samples, unsigned int num_samples)
|
||||
{
|
||||
m_dma_mixer.PushSamples(samples, num_samples);
|
||||
if (m_log_dsp_audio)
|
||||
m_wave_writer_dsp.AddStereoSamplesBE(samples, num_samples);
|
||||
}
|
||||
|
||||
void CMixer::PushStreamingSamples(const short *samples, unsigned int num_samples)
|
||||
void CMixer::PushStreamingSamples(const short* samples, unsigned int num_samples)
|
||||
{
|
||||
m_streaming_mixer.PushSamples(samples, num_samples);
|
||||
if (m_log_dtk_audio)
|
||||
m_wave_writer_dtk.AddStereoSamplesBE(samples, num_samples);
|
||||
}
|
||||
|
||||
void CMixer::PushWiimoteSpeakerSamples(const short *samples, unsigned int num_samples, unsigned int sample_rate)
|
||||
void CMixer::PushWiimoteSpeakerSamples(const short* samples, unsigned int num_samples,
|
||||
unsigned int sample_rate)
|
||||
{
|
||||
short samples_stereo[MAX_SAMPLES * 2];
|
||||
|
||||
|
|
|
@ -22,9 +22,9 @@ public:
|
|||
// Called from main thread
|
||||
void PushSamples(const short* samples, unsigned int num_samples);
|
||||
void PushStreamingSamples(const short* samples, unsigned int num_samples);
|
||||
void PushWiimoteSpeakerSamples(const short* samples, unsigned int num_samples, unsigned int sample_rate);
|
||||
void PushWiimoteSpeakerSamples(const short* samples, unsigned int num_samples,
|
||||
unsigned int sample_rate);
|
||||
unsigned int GetSampleRate() const { return m_sampleRate; }
|
||||
|
||||
void SetDMAInputSampleRate(unsigned int rate);
|
||||
void SetStreamInputSampleRate(unsigned int rate);
|
||||
void SetStreamingVolume(unsigned int lvolume, unsigned int rvolume);
|
||||
|
@ -38,7 +38,6 @@ public:
|
|||
|
||||
float GetCurrentSpeed() const { return m_speed.load(); }
|
||||
void UpdateSpeed(float val) { m_speed.store(val); }
|
||||
|
||||
private:
|
||||
static constexpr u32 MAX_SAMPLES = 1024 * 4; // 128 ms
|
||||
static constexpr u32 INDEX_MASK = MAX_SAMPLES * 2 - 1;
|
||||
|
@ -50,14 +49,14 @@ private:
|
|||
{
|
||||
public:
|
||||
MixerFifo(CMixer* mixer, unsigned sample_rate)
|
||||
: m_mixer(mixer)
|
||||
, m_input_sample_rate(sample_rate)
|
||||
: m_mixer(mixer), m_input_sample_rate(sample_rate)
|
||||
{
|
||||
}
|
||||
void PushSamples(const short* samples, unsigned int num_samples);
|
||||
unsigned int Mix(short* samples, unsigned int numSamples, bool consider_framelimit = true);
|
||||
void SetInputSampleRate(unsigned int rate);
|
||||
void SetVolume(unsigned int lvolume, unsigned int rvolume);
|
||||
|
||||
private:
|
||||
CMixer* m_mixer;
|
||||
unsigned m_input_sample_rate;
|
||||
|
|
|
@ -25,9 +25,12 @@ void NullSound::Update()
|
|||
// num_samples_to_render in this update - depends on SystemTimers::AUDIO_DMA_PERIOD.
|
||||
constexpr u32 stereo_16_bit_size = 4;
|
||||
constexpr u32 dma_length = 32;
|
||||
const u64 audio_dma_period = SystemTimers::GetTicksPerSecond() / (AudioInterface::GetAIDSampleRate() * stereo_16_bit_size / dma_length);
|
||||
const u64 audio_dma_period =
|
||||
SystemTimers::GetTicksPerSecond() /
|
||||
(AudioInterface::GetAIDSampleRate() * stereo_16_bit_size / dma_length);
|
||||
const u64 ais_samples_per_second = 48000 * stereo_16_bit_size;
|
||||
const u64 num_samples_to_render = (audio_dma_period * ais_samples_per_second) / SystemTimers::GetTicksPerSecond();
|
||||
const u64 num_samples_to_render =
|
||||
(audio_dma_period * ais_samples_per_second) / SystemTimers::GetTicksPerSecond();
|
||||
|
||||
m_mixer->Mix(m_realtime_buffer.data(), (unsigned int)num_samples_to_render);
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@ public:
|
|||
void Update() override;
|
||||
|
||||
static bool isValid() { return true; }
|
||||
|
||||
private:
|
||||
static constexpr size_t BUFFER_SIZE = 48000 * 4 / 32;
|
||||
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
#include <cstring>
|
||||
#include <thread>
|
||||
|
||||
#include "AudioCommon/aldlist.h"
|
||||
#include "AudioCommon/DPL2Decoder.h"
|
||||
#include "AudioCommon/OpenALStream.h"
|
||||
#include "Common/Thread.h"
|
||||
#include "AudioCommon/aldlist.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Common/Thread.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
|
||||
#if defined HAVE_OPENAL && HAVE_OPENAL
|
||||
|
@ -31,20 +31,20 @@ bool OpenALStream::Start()
|
|||
ALDeviceList pDeviceList;
|
||||
if (pDeviceList.GetNumDevices())
|
||||
{
|
||||
char *defDevName = pDeviceList.GetDeviceName(pDeviceList.GetDefaultDevice());
|
||||
char* defDevName = pDeviceList.GetDeviceName(pDeviceList.GetDefaultDevice());
|
||||
|
||||
WARN_LOG(AUDIO, "Found OpenAL device %s", defDevName);
|
||||
|
||||
ALCdevice *pDevice = alcOpenDevice(defDevName);
|
||||
ALCdevice* pDevice = alcOpenDevice(defDevName);
|
||||
if (pDevice)
|
||||
{
|
||||
ALCcontext *pContext = alcCreateContext(pDevice, nullptr);
|
||||
ALCcontext* pContext = alcCreateContext(pDevice, nullptr);
|
||||
if (pContext)
|
||||
{
|
||||
// Used to determine an appropriate period size (2x period = total buffer size)
|
||||
//ALCint refresh;
|
||||
//alcGetIntegerv(pDevice, ALC_REFRESH, 1, &refresh);
|
||||
//period_size_in_millisec = 1000 / refresh;
|
||||
// ALCint refresh;
|
||||
// alcGetIntegerv(pDevice, ALC_REFRESH, 1, &refresh);
|
||||
// period_size_in_millisec = 1000 / refresh;
|
||||
|
||||
alcMakeContextCurrent(pContext);
|
||||
thread = std::thread(&OpenALStream::SoundLoop, this);
|
||||
|
@ -91,8 +91,8 @@ void OpenALStream::Stop()
|
|||
uiSource = 0;
|
||||
alDeleteBuffers(numBuffers, uiBuffers);
|
||||
|
||||
ALCcontext *pContext = alcGetCurrentContext();
|
||||
ALCdevice *pDevice = alcGetContextsDevice(pContext);
|
||||
ALCcontext* pContext = alcGetCurrentContext();
|
||||
ALCdevice* pDevice = alcGetContextsDevice(pContext);
|
||||
|
||||
alcMakeContextCurrent(nullptr);
|
||||
alcDestroyContext(pContext);
|
||||
|
@ -149,12 +149,13 @@ void OpenALStream::SoundLoop()
|
|||
memset(uiBuffers, 0, numBuffers * sizeof(ALuint));
|
||||
uiSource = 0;
|
||||
|
||||
// Checks if a X-Fi is being used. If it is, disable FLOAT32 support as this sound card has no support for it even though it reports it does.
|
||||
// Checks if a X-Fi is being used. If it is, disable FLOAT32 support as this sound card has no
|
||||
// support for it even though it reports it does.
|
||||
if (strstr(alGetString(AL_RENDERER), "X-Fi"))
|
||||
float32_capable = false;
|
||||
|
||||
// Generate some AL Buffers for streaming
|
||||
alGenBuffers(numBuffers, (ALuint *)uiBuffers);
|
||||
alGenBuffers(numBuffers, (ALuint*)uiBuffers);
|
||||
// Generate a Source to playback the Buffers
|
||||
alGenSources(1, &uiSource);
|
||||
|
||||
|
@ -171,13 +172,16 @@ void OpenALStream::SoundLoop()
|
|||
if (surround_capable)
|
||||
{
|
||||
if (float32_capable)
|
||||
alBufferData(uiBuffers[i], AL_FORMAT_51CHN32, sampleBuffer, 4 * FRAME_SURROUND_FLOAT, ulFrequency);
|
||||
alBufferData(uiBuffers[i], AL_FORMAT_51CHN32, sampleBuffer, 4 * FRAME_SURROUND_FLOAT,
|
||||
ulFrequency);
|
||||
else
|
||||
alBufferData(uiBuffers[i], AL_FORMAT_51CHN16, sampleBuffer, 4 * FRAME_SURROUND_SHORT, ulFrequency);
|
||||
alBufferData(uiBuffers[i], AL_FORMAT_51CHN16, sampleBuffer, 4 * FRAME_SURROUND_SHORT,
|
||||
ulFrequency);
|
||||
}
|
||||
else
|
||||
{
|
||||
alBufferData(uiBuffers[i], AL_FORMAT_STEREO16, realtimeBuffer, 4 * FRAME_STEREO_SHORT, ulFrequency);
|
||||
alBufferData(uiBuffers[i], AL_FORMAT_STEREO16, realtimeBuffer, 4 * FRAME_STEREO_SHORT,
|
||||
ulFrequency);
|
||||
}
|
||||
}
|
||||
alSourceQueueBuffers(uiSource, numBuffers, uiBuffers);
|
||||
|
@ -187,12 +191,12 @@ void OpenALStream::SoundLoop()
|
|||
alSourcef(uiSource, AL_GAIN, fVolume);
|
||||
|
||||
// TODO: Error handling
|
||||
//ALenum err = alGetError();
|
||||
// ALenum err = alGetError();
|
||||
|
||||
ALint iBuffersFilled = 0;
|
||||
ALint iBuffersProcessed = 0;
|
||||
ALint iState = 0;
|
||||
ALuint uiBufferTemp[OAL_MAX_BUFFERS] = { 0 };
|
||||
ALuint uiBufferTemp[OAL_MAX_BUFFERS] = {0};
|
||||
|
||||
soundTouch.setChannels(2);
|
||||
soundTouch.setSampleRate(ulFrequency);
|
||||
|
@ -209,11 +213,14 @@ void OpenALStream::SoundLoop()
|
|||
const u32 stereo_16_bit_size = 4;
|
||||
const u32 dma_length = 32;
|
||||
const u64 ais_samples_per_second = 48000 * stereo_16_bit_size;
|
||||
u64 audio_dma_period = SystemTimers::GetTicksPerSecond() / (AudioInterface::GetAIDSampleRate() * stereo_16_bit_size / dma_length);
|
||||
u64 num_samples_to_render = (audio_dma_period * ais_samples_per_second) / SystemTimers::GetTicksPerSecond();
|
||||
u64 audio_dma_period = SystemTimers::GetTicksPerSecond() /
|
||||
(AudioInterface::GetAIDSampleRate() * stereo_16_bit_size / dma_length);
|
||||
u64 num_samples_to_render =
|
||||
(audio_dma_period * ais_samples_per_second) / SystemTimers::GetTicksPerSecond();
|
||||
|
||||
unsigned int numSamples = (unsigned int)num_samples_to_render;
|
||||
unsigned int minSamples = surround_capable ? 240 : 0; // DPL2 accepts 240 samples minimum (FWRDURATION)
|
||||
unsigned int minSamples =
|
||||
surround_capable ? 240 : 0; // DPL2 accepts 240 samples minimum (FWRDURATION)
|
||||
|
||||
numSamples = (numSamples > OAL_MAX_SAMPLES) ? OAL_MAX_SAMPLES : numSamples;
|
||||
numSamples = m_mixer->Mix(realtimeBuffer, numSamples, false);
|
||||
|
@ -256,7 +263,8 @@ void OpenALStream::SoundLoop()
|
|||
if (nSamples <= minSamples)
|
||||
continue;
|
||||
|
||||
// Remove the Buffer from the Queue. (uiBuffer contains the Buffer ID for the unqueued Buffer)
|
||||
// Remove the Buffer from the Queue. (uiBuffer contains the Buffer ID for the unqueued
|
||||
// Buffer)
|
||||
if (iBuffersFilled == 0)
|
||||
{
|
||||
alSourceUnqueueBuffers(uiSource, iBuffersProcessed, uiBufferTemp);
|
||||
|
@ -278,12 +286,13 @@ void OpenALStream::SoundLoop()
|
|||
// DPL2Decode output: LEFTFRONT, RIGHTFRONT, CENTREFRONT, (sub), LEFTREAR, RIGHTREAR
|
||||
for (u32 i = 0; i < nSamples; ++i)
|
||||
{
|
||||
dpl2[i*SURROUND_CHANNELS + 3 /*sub/lfe*/] = 0.0f;
|
||||
dpl2[i * SURROUND_CHANNELS + 3 /*sub/lfe*/] = 0.0f;
|
||||
}
|
||||
|
||||
if (float32_capable)
|
||||
{
|
||||
alBufferData(uiBufferTemp[iBuffersFilled], AL_FORMAT_51CHN32, dpl2, nSamples * FRAME_SURROUND_FLOAT, ulFrequency);
|
||||
alBufferData(uiBufferTemp[iBuffersFilled], AL_FORMAT_51CHN32, dpl2,
|
||||
nSamples * FRAME_SURROUND_FLOAT, ulFrequency);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -291,14 +300,16 @@ void OpenALStream::SoundLoop()
|
|||
for (u32 i = 0; i < nSamples * SURROUND_CHANNELS; ++i)
|
||||
surround_short[i] = (short)((float)dpl2[i] * (1 << 15));
|
||||
|
||||
alBufferData(uiBufferTemp[iBuffersFilled], AL_FORMAT_51CHN16, surround_short, nSamples * FRAME_SURROUND_SHORT, ulFrequency);
|
||||
alBufferData(uiBufferTemp[iBuffersFilled], AL_FORMAT_51CHN16, surround_short,
|
||||
nSamples * FRAME_SURROUND_SHORT, ulFrequency);
|
||||
}
|
||||
|
||||
ALenum err = alGetError();
|
||||
if (err == AL_INVALID_ENUM)
|
||||
{
|
||||
// 5.1 is not supported by the host, fallback to stereo
|
||||
WARN_LOG(AUDIO, "Unable to set 5.1 surround mode. Updating OpenAL Soft might fix this issue.");
|
||||
WARN_LOG(AUDIO,
|
||||
"Unable to set 5.1 surround mode. Updating OpenAL Soft might fix this issue.");
|
||||
surround_capable = false;
|
||||
}
|
||||
else if (err != 0)
|
||||
|
@ -311,7 +322,8 @@ void OpenALStream::SoundLoop()
|
|||
{
|
||||
if (float32_capable)
|
||||
{
|
||||
alBufferData(uiBufferTemp[iBuffersFilled], AL_FORMAT_STEREO_FLOAT32, sampleBuffer, nSamples * FRAME_STEREO_FLOAT, ulFrequency);
|
||||
alBufferData(uiBufferTemp[iBuffersFilled], AL_FORMAT_STEREO_FLOAT32, sampleBuffer,
|
||||
nSamples * FRAME_STEREO_FLOAT, ulFrequency);
|
||||
ALenum err = alGetError();
|
||||
if (err == AL_INVALID_ENUM)
|
||||
{
|
||||
|
@ -330,7 +342,8 @@ void OpenALStream::SoundLoop()
|
|||
for (u32 i = 0; i < nSamples * STEREO_CHANNELS; ++i)
|
||||
stereo[i] = (short)((float)sampleBuffer[i] * (1 << 15));
|
||||
|
||||
alBufferData(uiBufferTemp[iBuffersFilled], AL_FORMAT_STEREO16, stereo, nSamples * FRAME_STEREO_SHORT, ulFrequency);
|
||||
alBufferData(uiBufferTemp[iBuffersFilled], AL_FORMAT_STEREO16, stereo,
|
||||
nSamples * FRAME_STEREO_SHORT, ulFrequency);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -371,5 +384,4 @@ void OpenALStream::SoundLoop()
|
|||
}
|
||||
}
|
||||
|
||||
#endif //HAVE_OPENAL
|
||||
|
||||
#endif // HAVE_OPENAL
|
||||
|
|
|
@ -32,8 +32,8 @@
|
|||
#define BOOL SoundTouch_BOOL
|
||||
#endif
|
||||
|
||||
#include <soundtouch/SoundTouch.h>
|
||||
#include <soundtouch/STTypes.h>
|
||||
#include <soundtouch/SoundTouch.h>
|
||||
|
||||
#ifdef __APPLE__
|
||||
#undef BOOL
|
||||
|
@ -47,20 +47,17 @@
|
|||
#define SURROUND_CHANNELS 6 // number of channels in surround mode
|
||||
#define SIZE_SHORT 2
|
||||
#define SIZE_FLOAT 4 // size of a float in bytes
|
||||
#define FRAME_STEREO_SHORT STEREO_CHANNELS * SIZE_SHORT
|
||||
#define FRAME_STEREO_FLOAT STEREO_CHANNELS * SIZE_FLOAT
|
||||
#define FRAME_SURROUND_FLOAT SURROUND_CHANNELS * SIZE_FLOAT
|
||||
#define FRAME_SURROUND_SHORT SURROUND_CHANNELS * SIZE_SHORT
|
||||
#define FRAME_STEREO_SHORT STEREO_CHANNELS* SIZE_SHORT
|
||||
#define FRAME_STEREO_FLOAT STEREO_CHANNELS* SIZE_FLOAT
|
||||
#define FRAME_SURROUND_FLOAT SURROUND_CHANNELS* SIZE_FLOAT
|
||||
#define FRAME_SURROUND_SHORT SURROUND_CHANNELS* SIZE_SHORT
|
||||
#endif
|
||||
|
||||
class OpenALStream final : public SoundStream
|
||||
{
|
||||
#if defined HAVE_OPENAL && HAVE_OPENAL
|
||||
public:
|
||||
OpenALStream() : uiSource(0)
|
||||
{
|
||||
}
|
||||
|
||||
OpenALStream() : uiSource(0) {}
|
||||
bool Start() override;
|
||||
void SoundLoop() override;
|
||||
void SetVolume(int volume) override;
|
||||
|
@ -69,7 +66,6 @@ public:
|
|||
void Update() override;
|
||||
|
||||
static bool isValid() { return true; }
|
||||
|
||||
private:
|
||||
std::thread thread;
|
||||
std::atomic<bool> m_run_thread;
|
||||
|
|
|
@ -24,7 +24,7 @@ static SLPlayItf bqPlayerPlay;
|
|||
static SLAndroidSimpleBufferQueueItf bqPlayerBufferQueue;
|
||||
static SLMuteSoloItf bqPlayerMuteSolo;
|
||||
static SLVolumeItf bqPlayerVolume;
|
||||
static CMixer *g_mixer;
|
||||
static CMixer* g_mixer;
|
||||
#define BUFFER_SIZE 512
|
||||
#define BUFFER_SIZE_IN_SAMPLES (BUFFER_SIZE / 2)
|
||||
|
||||
|
@ -32,14 +32,15 @@ static CMixer *g_mixer;
|
|||
static short buffer[2][BUFFER_SIZE];
|
||||
static int curBuffer = 0;
|
||||
|
||||
static void bqPlayerCallback(SLAndroidSimpleBufferQueueItf bq, void *context)
|
||||
static void bqPlayerCallback(SLAndroidSimpleBufferQueueItf bq, void* context)
|
||||
{
|
||||
assert(bq == bqPlayerBufferQueue);
|
||||
assert(nullptr == context);
|
||||
|
||||
// Render to the fresh buffer
|
||||
g_mixer->Mix(reinterpret_cast<short *>(buffer[curBuffer]), BUFFER_SIZE_IN_SAMPLES);
|
||||
SLresult result = (*bqPlayerBufferQueue)->Enqueue(bqPlayerBufferQueue, buffer[curBuffer], sizeof(buffer[0]));
|
||||
g_mixer->Mix(reinterpret_cast<short*>(buffer[curBuffer]), BUFFER_SIZE_IN_SAMPLES);
|
||||
SLresult result =
|
||||
(*bqPlayerBufferQueue)->Enqueue(bqPlayerBufferQueue, buffer[curBuffer], sizeof(buffer[0]));
|
||||
curBuffer ^= 1; // Switch buffer
|
||||
|
||||
// Comment from sample code:
|
||||
|
@ -64,15 +65,13 @@ bool OpenSLESStream::Start()
|
|||
assert(SL_RESULT_SUCCESS == result);
|
||||
|
||||
SLDataLocator_AndroidSimpleBufferQueue loc_bufq = {SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE, 2};
|
||||
SLDataFormat_PCM format_pcm = {
|
||||
SL_DATAFORMAT_PCM,
|
||||
SLDataFormat_PCM format_pcm = {SL_DATAFORMAT_PCM,
|
||||
2,
|
||||
m_mixer->GetSampleRate() * 1000,
|
||||
SL_PCMSAMPLEFORMAT_FIXED_16,
|
||||
SL_PCMSAMPLEFORMAT_FIXED_16,
|
||||
SL_SPEAKER_FRONT_LEFT | SL_SPEAKER_FRONT_RIGHT,
|
||||
SL_BYTEORDER_LITTLEENDIAN
|
||||
};
|
||||
SL_BYTEORDER_LITTLEENDIAN};
|
||||
|
||||
SLDataSource audioSrc = {&loc_bufq, &format_pcm};
|
||||
|
||||
|
@ -83,15 +82,17 @@ bool OpenSLESStream::Start()
|
|||
// create audio player
|
||||
const SLInterfaceID ids[2] = {SL_IID_BUFFERQUEUE, SL_IID_VOLUME};
|
||||
const SLboolean req[2] = {SL_BOOLEAN_TRUE, SL_BOOLEAN_TRUE};
|
||||
result = (*engineEngine)->CreateAudioPlayer(engineEngine, &bqPlayerObject, &audioSrc, &audioSnk, 2, ids, req);
|
||||
result =
|
||||
(*engineEngine)
|
||||
->CreateAudioPlayer(engineEngine, &bqPlayerObject, &audioSrc, &audioSnk, 2, ids, req);
|
||||
assert(SL_RESULT_SUCCESS == result);
|
||||
|
||||
result = (*bqPlayerObject)->Realize(bqPlayerObject, SL_BOOLEAN_FALSE);
|
||||
assert(SL_RESULT_SUCCESS == result);
|
||||
result = (*bqPlayerObject)->GetInterface(bqPlayerObject, SL_IID_PLAY, &bqPlayerPlay);
|
||||
assert(SL_RESULT_SUCCESS == result);
|
||||
result = (*bqPlayerObject)->GetInterface(bqPlayerObject, SL_IID_BUFFERQUEUE,
|
||||
&bqPlayerBufferQueue);
|
||||
result =
|
||||
(*bqPlayerObject)->GetInterface(bqPlayerObject, SL_IID_BUFFERQUEUE, &bqPlayerBufferQueue);
|
||||
assert(SL_RESULT_SUCCESS == result);
|
||||
result = (*bqPlayerBufferQueue)->RegisterCallback(bqPlayerBufferQueue, bqPlayerCallback, nullptr);
|
||||
assert(SL_RESULT_SUCCESS == result);
|
||||
|
|
|
@ -16,7 +16,6 @@ public:
|
|||
bool Start() override;
|
||||
void Stop() override;
|
||||
static bool isValid() { return true; }
|
||||
|
||||
private:
|
||||
std::thread thread;
|
||||
Common::Event soundSyncEvent;
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
#include "AudioCommon/DPL2Decoder.h"
|
||||
#include "AudioCommon/PulseAudioStream.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/Thread.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Common/Thread.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
|
||||
namespace
|
||||
|
@ -16,9 +16,7 @@ namespace
|
|||
const size_t BUFFER_SAMPLES = 512; // ~10 ms - needs to be at least 240 for surround
|
||||
}
|
||||
|
||||
PulseAudio::PulseAudio()
|
||||
: m_thread()
|
||||
, m_run_thread()
|
||||
PulseAudio::PulseAudio() : m_thread(), m_run_thread()
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -72,7 +70,8 @@ bool PulseAudio::PulseInit()
|
|||
m_pa_connected = 0;
|
||||
|
||||
// create pulseaudio main loop and context
|
||||
// also register the async state callback which is called when the connection to the pa server has changed
|
||||
// also register the async state callback which is called when the connection to the pa server has
|
||||
// changed
|
||||
m_pa_ml = pa_mainloop_new();
|
||||
m_pa_mlapi = pa_mainloop_get_api(m_pa_ml);
|
||||
m_pa_ctx = pa_context_new(m_pa_mlapi, "dolphin-emu");
|
||||
|
@ -126,8 +125,11 @@ bool PulseAudio::PulseInit()
|
|||
m_pa_ba.maxlength = -1; // max buffer, so also max latency
|
||||
m_pa_ba.minreq = -1; // don't read every byte, try to group them _a bit_
|
||||
m_pa_ba.prebuf = -1; // start as early as possible
|
||||
m_pa_ba.tlength = BUFFER_SAMPLES * m_channels * m_bytespersample; // designed latency, only change this flag for low latency output
|
||||
pa_stream_flags flags = pa_stream_flags(PA_STREAM_INTERPOLATE_TIMING | PA_STREAM_ADJUST_LATENCY | PA_STREAM_AUTO_TIMING_UPDATE);
|
||||
m_pa_ba.tlength =
|
||||
BUFFER_SAMPLES * m_channels *
|
||||
m_bytespersample; // designed latency, only change this flag for low latency output
|
||||
pa_stream_flags flags = pa_stream_flags(PA_STREAM_INTERPOLATE_TIMING | PA_STREAM_ADJUST_LATENCY |
|
||||
PA_STREAM_AUTO_TIMING_UPDATE);
|
||||
m_pa_error = pa_stream_connect_playback(m_pa_s, nullptr, &m_pa_ba, flags, nullptr, nullptr);
|
||||
if (m_pa_error < 0)
|
||||
{
|
||||
|
@ -188,7 +190,7 @@ void PulseAudio::WriteCallback(pa_stream* s, size_t length)
|
|||
if (m_stereo)
|
||||
{
|
||||
// use the raw s16 stereo mix
|
||||
m_mixer->Mix((s16*) buffer, frames);
|
||||
m_mixer->Mix((s16*)buffer, frames);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -198,7 +200,7 @@ void PulseAudio::WriteCallback(pa_stream* s, size_t length)
|
|||
|
||||
float floatbuffer_stereo[frames * 2];
|
||||
// s16 to float
|
||||
for (int i=0; i < frames * 2; ++i)
|
||||
for (int i = 0; i < frames * 2; ++i)
|
||||
{
|
||||
floatbuffer_stereo[i] = s16buffer_stereo[i] / float(1 << 15);
|
||||
}
|
||||
|
@ -211,10 +213,10 @@ void PulseAudio::WriteCallback(pa_stream* s, size_t length)
|
|||
|
||||
// Discard the subwoofer channel - DPL2Decode generates a pretty
|
||||
// good 5.0 but not a good 5.1 output.
|
||||
const int dpl2_to_5chan[] = {0,1,2,4,5};
|
||||
for (int i=0; i < frames; ++i)
|
||||
const int dpl2_to_5chan[] = {0, 1, 2, 4, 5};
|
||||
for (int i = 0; i < frames; ++i)
|
||||
{
|
||||
for (int j=0; j < m_channels; ++j)
|
||||
for (int j = 0; j < m_channels; ++j)
|
||||
{
|
||||
((float*)buffer)[m_channels * i + j] = floatbuffer_6chan[6 * i + dpl2_to_5chan[j]];
|
||||
}
|
||||
|
@ -234,18 +236,18 @@ void PulseAudio::WriteCallback(pa_stream* s, size_t length)
|
|||
|
||||
void PulseAudio::StateCallback(pa_context* c, void* userdata)
|
||||
{
|
||||
PulseAudio* p = (PulseAudio*) userdata;
|
||||
PulseAudio* p = (PulseAudio*)userdata;
|
||||
p->StateCallback(c);
|
||||
}
|
||||
|
||||
void PulseAudio::UnderflowCallback(pa_stream* s, void* userdata)
|
||||
{
|
||||
PulseAudio* p = (PulseAudio*) userdata;
|
||||
PulseAudio* p = (PulseAudio*)userdata;
|
||||
p->UnderflowCallback(s);
|
||||
}
|
||||
|
||||
void PulseAudio::WriteCallback(pa_stream* s, size_t length, void* userdata)
|
||||
{
|
||||
PulseAudio* p = (PulseAudio*) userdata;
|
||||
PulseAudio* p = (PulseAudio*)userdata;
|
||||
p->WriteCallback(s, length);
|
||||
}
|
||||
|
|
|
@ -25,10 +25,9 @@ public:
|
|||
void Update() override;
|
||||
|
||||
static bool isValid() { return true; }
|
||||
|
||||
void StateCallback(pa_context *c);
|
||||
void WriteCallback(pa_stream *s, size_t length);
|
||||
void UnderflowCallback(pa_stream *s);
|
||||
void StateCallback(pa_context* c);
|
||||
void WriteCallback(pa_stream* s, size_t length);
|
||||
void UnderflowCallback(pa_stream* s);
|
||||
|
||||
private:
|
||||
void SoundLoop() override;
|
||||
|
@ -37,9 +36,9 @@ private:
|
|||
void PulseShutdown();
|
||||
|
||||
// wrapper callback functions, last parameter _must_ be PulseAudio*
|
||||
static void StateCallback(pa_context *c, void *userdata);
|
||||
static void WriteCallback(pa_stream *s, size_t length, void *userdata);
|
||||
static void UnderflowCallback(pa_stream *s, void *userdata);
|
||||
static void StateCallback(pa_context* c, void* userdata);
|
||||
static void WriteCallback(pa_stream* s, size_t length, void* userdata);
|
||||
static void UnderflowCallback(pa_stream* s, void* userdata);
|
||||
|
||||
std::thread m_thread;
|
||||
std::atomic<bool> m_run_thread;
|
||||
|
@ -50,10 +49,10 @@ private:
|
|||
|
||||
int m_pa_error;
|
||||
int m_pa_connected;
|
||||
pa_mainloop *m_pa_ml;
|
||||
pa_mainloop_api *m_pa_mlapi;
|
||||
pa_context *m_pa_ctx;
|
||||
pa_stream *m_pa_s;
|
||||
pa_mainloop* m_pa_ml;
|
||||
pa_mainloop_api* m_pa_mlapi;
|
||||
pa_context* m_pa_ctx;
|
||||
pa_stream* m_pa_s;
|
||||
pa_buffer_attr m_pa_ba;
|
||||
#endif
|
||||
};
|
||||
|
|
|
@ -21,8 +21,7 @@ protected:
|
|||
|
||||
public:
|
||||
SoundStream() : m_mixer(new CMixer(48000)), m_logAudio(false), m_muted(false) {}
|
||||
virtual ~SoundStream() { }
|
||||
|
||||
virtual ~SoundStream() {}
|
||||
static bool isValid() { return false; }
|
||||
CMixer* GetMixer() const { return m_mixer.get(); }
|
||||
virtual bool Start() { return false; }
|
||||
|
@ -32,7 +31,6 @@ public:
|
|||
virtual void Update() {}
|
||||
virtual void Clear(bool mute) { m_muted = mute; }
|
||||
bool IsMuted() const { return m_muted; }
|
||||
|
||||
void StartLogAudio(const std::string& filename)
|
||||
{
|
||||
if (!m_logAudio)
|
||||
|
|
|
@ -25,14 +25,17 @@ bool WaveFileWriter::Start(const std::string& filename, unsigned int HLESampleRa
|
|||
// Check if the file is already open
|
||||
if (file)
|
||||
{
|
||||
PanicAlertT("The file %s was already open, the file header will not be written.", filename.c_str());
|
||||
PanicAlertT("The file %s was already open, the file header will not be written.",
|
||||
filename.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
file.Open(filename, "wb");
|
||||
if (!file)
|
||||
{
|
||||
PanicAlertT("The file %s could not be opened for writing. Please check if it's already opened by another program.", filename.c_str());
|
||||
PanicAlertT("The file %s could not be opened for writing. Please check if it's already opened "
|
||||
"by another program.",
|
||||
filename.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -47,11 +50,11 @@ bool WaveFileWriter::Start(const std::string& filename, unsigned int HLESampleRa
|
|||
Write4("fmt ");
|
||||
|
||||
Write(16); // size of fmt block
|
||||
Write(0x00020001); //two channels, uncompressed
|
||||
Write(0x00020001); // two channels, uncompressed
|
||||
|
||||
const u32 sample_rate = HLESampleRate;
|
||||
Write(sample_rate);
|
||||
Write(sample_rate * 2 * 2); //two channels, 16bit
|
||||
Write(sample_rate * 2 * 2); // two channels, 16bit
|
||||
|
||||
Write(0x00100004);
|
||||
Write4("data");
|
||||
|
@ -81,12 +84,12 @@ void WaveFileWriter::Write(u32 value)
|
|||
file.WriteArray(&value, 1);
|
||||
}
|
||||
|
||||
void WaveFileWriter::Write4(const char *ptr)
|
||||
void WaveFileWriter::Write4(const char* ptr)
|
||||
{
|
||||
file.WriteBytes(ptr, 4);
|
||||
}
|
||||
|
||||
void WaveFileWriter::AddStereoSamples(const short *sample_data, u32 count)
|
||||
void WaveFileWriter::AddStereoSamples(const short* sample_data, u32 count)
|
||||
{
|
||||
if (!file)
|
||||
PanicAlertT("WaveFileWriter - file not open.");
|
||||
|
@ -109,7 +112,7 @@ void WaveFileWriter::AddStereoSamples(const short *sample_data, u32 count)
|
|||
audio_size += count * 4;
|
||||
}
|
||||
|
||||
void WaveFileWriter::AddStereoSamplesBE(const short *sample_data, u32 count)
|
||||
void WaveFileWriter::AddStereoSamplesBE(const short* sample_data, u32 count)
|
||||
{
|
||||
if (!file)
|
||||
PanicAlertT("WaveFileWriter - file not open.");
|
||||
|
@ -133,7 +136,7 @@ void WaveFileWriter::AddStereoSamplesBE(const short *sample_data, u32 count)
|
|||
|
||||
for (u32 i = 0; i < count; i++)
|
||||
{
|
||||
//Flip the audio channels from RL to LR
|
||||
// Flip the audio channels from RL to LR
|
||||
conv_buffer[2 * i] = Common::swap16((u16)sample_data[2 * i + 1]);
|
||||
conv_buffer[2 * i + 1] = Common::swap16((u16)sample_data[2 * i]);
|
||||
}
|
||||
|
|
|
@ -30,11 +30,9 @@ public:
|
|||
void Stop();
|
||||
|
||||
void SetSkipSilence(bool skip) { skip_silence = skip; }
|
||||
|
||||
void AddStereoSamples(const short *sample_data, u32 count);
|
||||
void AddStereoSamplesBE(const short *sample_data, u32 count); // big endian
|
||||
void AddStereoSamples(const short* sample_data, u32 count);
|
||||
void AddStereoSamplesBE(const short* sample_data, u32 count); // big endian
|
||||
u32 GetAudioSize() const { return audio_size; }
|
||||
|
||||
private:
|
||||
static constexpr size_t BUFFER_SIZE = 32 * 1024;
|
||||
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "AudioCommon/XAudio2Stream.h"
|
||||
#include <xaudio2.h>
|
||||
#include "AudioCommon/AudioCommon.h"
|
||||
#include "AudioCommon/XAudio2Stream.h"
|
||||
#include "Common/Event.h"
|
||||
#include "Common/MsgHandler.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Common/MsgHandler.h"
|
||||
|
||||
#ifndef XAUDIO2_DLL
|
||||
#error You are building this module against the wrong version of DirectX. You probably need to remove DXSDK_DIR from your include path.
|
||||
|
@ -24,21 +24,20 @@ private:
|
|||
void SubmitBuffer(PBYTE buf_data);
|
||||
|
||||
public:
|
||||
StreamingVoiceContext(IXAudio2 *pXAudio2, CMixer *pMixer, Common::Event& pSyncEvent);
|
||||
StreamingVoiceContext(IXAudio2* pXAudio2, CMixer* pMixer, Common::Event& pSyncEvent);
|
||||
|
||||
~StreamingVoiceContext();
|
||||
|
||||
void StreamingVoiceContext::Stop();
|
||||
void StreamingVoiceContext::Play();
|
||||
|
||||
STDMETHOD_(void, OnVoiceError) (THIS_ void* pBufferContext, HRESULT Error) {}
|
||||
STDMETHOD_(void, OnVoiceProcessingPassStart) (UINT32) {}
|
||||
STDMETHOD_(void, OnVoiceProcessingPassEnd) () {}
|
||||
STDMETHOD_(void, OnBufferStart) (void*) {}
|
||||
STDMETHOD_(void, OnLoopEnd) (void*) {}
|
||||
STDMETHOD_(void, OnStreamEnd) () {}
|
||||
|
||||
STDMETHOD_(void, OnBufferEnd) (void* context);
|
||||
STDMETHOD_(void, OnVoiceError)(THIS_ void* pBufferContext, HRESULT Error) {}
|
||||
STDMETHOD_(void, OnVoiceProcessingPassStart)(UINT32) {}
|
||||
STDMETHOD_(void, OnVoiceProcessingPassEnd)() {}
|
||||
STDMETHOD_(void, OnBufferStart)(void*) {}
|
||||
STDMETHOD_(void, OnLoopEnd)(void*) {}
|
||||
STDMETHOD_(void, OnStreamEnd)() {}
|
||||
STDMETHOD_(void, OnBufferEnd)(void* context);
|
||||
};
|
||||
|
||||
const int NUM_BUFFERS = 3;
|
||||
|
@ -58,10 +57,10 @@ void StreamingVoiceContext::SubmitBuffer(PBYTE buf_data)
|
|||
m_source_voice->SubmitSourceBuffer(&buf);
|
||||
}
|
||||
|
||||
StreamingVoiceContext::StreamingVoiceContext(IXAudio2 *pXAudio2, CMixer *pMixer, Common::Event& pSyncEvent)
|
||||
: m_mixer(pMixer)
|
||||
, m_sound_sync_event(pSyncEvent)
|
||||
, xaudio_buffer(new BYTE[NUM_BUFFERS * BUFFER_SIZE_BYTES]())
|
||||
StreamingVoiceContext::StreamingVoiceContext(IXAudio2* pXAudio2, CMixer* pMixer,
|
||||
Common::Event& pSyncEvent)
|
||||
: m_mixer(pMixer), m_sound_sync_event(pSyncEvent),
|
||||
xaudio_buffer(new BYTE[NUM_BUFFERS * BUFFER_SIZE_BYTES]())
|
||||
{
|
||||
WAVEFORMATEXTENSIBLE wfx = {};
|
||||
|
||||
|
@ -69,7 +68,7 @@ StreamingVoiceContext::StreamingVoiceContext(IXAudio2 *pXAudio2, CMixer *pMixer,
|
|||
wfx.Format.nSamplesPerSec = m_mixer->GetSampleRate();
|
||||
wfx.Format.nChannels = 2;
|
||||
wfx.Format.wBitsPerSample = 16;
|
||||
wfx.Format.nBlockAlign = wfx.Format.nChannels*wfx.Format.wBitsPerSample / 8;
|
||||
wfx.Format.nBlockAlign = wfx.Format.nChannels * wfx.Format.wBitsPerSample / 8;
|
||||
wfx.Format.nAvgBytesPerSec = wfx.Format.nSamplesPerSec * wfx.Format.nBlockAlign;
|
||||
wfx.Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX);
|
||||
wfx.Samples.wValidBitsPerSample = 16;
|
||||
|
@ -78,7 +77,8 @@ StreamingVoiceContext::StreamingVoiceContext(IXAudio2 *pXAudio2, CMixer *pMixer,
|
|||
|
||||
// create source voice
|
||||
HRESULT hr;
|
||||
if (FAILED(hr = pXAudio2->CreateSourceVoice(&m_source_voice, &wfx.Format, XAUDIO2_VOICE_NOSRC, 1.0f, this)))
|
||||
if (FAILED(hr = pXAudio2->CreateSourceVoice(&m_source_voice, &wfx.Format, XAUDIO2_VOICE_NOSRC,
|
||||
1.0f, this)))
|
||||
{
|
||||
PanicAlert("XAudio2 CreateSourceVoice failed: %#X", hr);
|
||||
return;
|
||||
|
@ -119,8 +119,8 @@ void StreamingVoiceContext::OnBufferEnd(void* context)
|
|||
if (!m_source_voice || !context)
|
||||
return;
|
||||
|
||||
//m_sound_sync_event->Wait(); // sync
|
||||
//m_sound_sync_event->Spin(); // or tight sync
|
||||
// m_sound_sync_event->Wait(); // sync
|
||||
// m_sound_sync_event->Spin(); // or tight sync
|
||||
|
||||
m_mixer->Mix(static_cast<short*>(context), SAMPLES_PER_BUFFER);
|
||||
SubmitBuffer(static_cast<BYTE*>(context));
|
||||
|
@ -128,7 +128,7 @@ void StreamingVoiceContext::OnBufferEnd(void* context)
|
|||
|
||||
HMODULE XAudio2::m_xaudio2_dll = nullptr;
|
||||
typedef decltype(&XAudio2Create) XAudio2Create_t;
|
||||
void *XAudio2::PXAudio2Create = nullptr;
|
||||
void* XAudio2::PXAudio2Create = nullptr;
|
||||
|
||||
bool XAudio2::InitLibrary()
|
||||
{
|
||||
|
@ -158,9 +158,8 @@ bool XAudio2::InitLibrary()
|
|||
}
|
||||
|
||||
XAudio2::XAudio2()
|
||||
: m_mastering_voice(nullptr)
|
||||
, m_volume(1.0f)
|
||||
, m_cleanup_com(SUCCEEDED(CoInitializeEx(nullptr, COINIT_MULTITHREADED)))
|
||||
: m_mastering_voice(nullptr), m_volume(1.0f),
|
||||
m_cleanup_com(SUCCEEDED(CoInitializeEx(nullptr, COINIT_MULTITHREADED)))
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -197,15 +196,15 @@ bool XAudio2::Start()
|
|||
// Volume
|
||||
m_mastering_voice->SetVolume(m_volume);
|
||||
|
||||
m_voice_context = std::unique_ptr<StreamingVoiceContext>
|
||||
(new StreamingVoiceContext(m_xaudio2.get(), m_mixer.get(), m_sound_sync_event));
|
||||
m_voice_context = std::unique_ptr<StreamingVoiceContext>(
|
||||
new StreamingVoiceContext(m_xaudio2.get(), m_mixer.get(), m_sound_sync_event));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void XAudio2::SetVolume(int volume)
|
||||
{
|
||||
//linear 1- .01
|
||||
// linear 1- .01
|
||||
m_volume = (float)volume / 100.f;
|
||||
|
||||
if (m_mastering_voice)
|
||||
|
@ -227,7 +226,7 @@ void XAudio2::Clear(bool mute)
|
|||
|
||||
void XAudio2::Stop()
|
||||
{
|
||||
//m_sound_sync_event.Set();
|
||||
// m_sound_sync_event.Set();
|
||||
|
||||
m_voice_context.reset();
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ private:
|
|||
|
||||
std::unique_ptr<IXAudio2, Releaser> m_xaudio2;
|
||||
std::unique_ptr<StreamingVoiceContext> m_voice_context;
|
||||
IXAudio2MasteringVoice *m_mastering_voice;
|
||||
IXAudio2MasteringVoice* m_mastering_voice;
|
||||
|
||||
Common::Event m_sound_sync_event;
|
||||
float m_volume;
|
||||
|
@ -46,7 +46,7 @@ private:
|
|||
const bool m_cleanup_com;
|
||||
|
||||
static HMODULE m_xaudio2_dll;
|
||||
static void *PXAudio2Create;
|
||||
static void* PXAudio2Create;
|
||||
|
||||
static bool InitLibrary();
|
||||
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
#include "AudioCommon/AudioCommon.h"
|
||||
#include "AudioCommon/XAudio2_7Stream.h"
|
||||
#include "Common/Event.h"
|
||||
#include "Common/MsgHandler.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Common/MsgHandler.h"
|
||||
|
||||
struct StreamingVoiceContext2_7 : public IXAudio2VoiceCallback
|
||||
{
|
||||
|
@ -24,21 +24,20 @@ private:
|
|||
void SubmitBuffer(PBYTE buf_data);
|
||||
|
||||
public:
|
||||
StreamingVoiceContext2_7(IXAudio2 *pXAudio2, CMixer *pMixer, Common::Event& pSyncEvent);
|
||||
StreamingVoiceContext2_7(IXAudio2* pXAudio2, CMixer* pMixer, Common::Event& pSyncEvent);
|
||||
|
||||
~StreamingVoiceContext2_7();
|
||||
|
||||
void StreamingVoiceContext2_7::Stop();
|
||||
void StreamingVoiceContext2_7::Play();
|
||||
|
||||
STDMETHOD_(void, OnVoiceError) (THIS_ void* pBufferContext, HRESULT Error) {}
|
||||
STDMETHOD_(void, OnVoiceProcessingPassStart) (UINT32) {}
|
||||
STDMETHOD_(void, OnVoiceProcessingPassEnd) () {}
|
||||
STDMETHOD_(void, OnBufferStart) (void*) {}
|
||||
STDMETHOD_(void, OnLoopEnd) (void*) {}
|
||||
STDMETHOD_(void, OnStreamEnd) () {}
|
||||
|
||||
STDMETHOD_(void, OnBufferEnd) (void* context);
|
||||
STDMETHOD_(void, OnVoiceError)(THIS_ void* pBufferContext, HRESULT Error) {}
|
||||
STDMETHOD_(void, OnVoiceProcessingPassStart)(UINT32) {}
|
||||
STDMETHOD_(void, OnVoiceProcessingPassEnd)() {}
|
||||
STDMETHOD_(void, OnBufferStart)(void*) {}
|
||||
STDMETHOD_(void, OnLoopEnd)(void*) {}
|
||||
STDMETHOD_(void, OnStreamEnd)() {}
|
||||
STDMETHOD_(void, OnBufferEnd)(void* context);
|
||||
};
|
||||
|
||||
const int NUM_BUFFERS = 3;
|
||||
|
@ -58,10 +57,10 @@ void StreamingVoiceContext2_7::SubmitBuffer(PBYTE buf_data)
|
|||
m_source_voice->SubmitSourceBuffer(&buf);
|
||||
}
|
||||
|
||||
StreamingVoiceContext2_7::StreamingVoiceContext2_7(IXAudio2 *pXAudio2, CMixer *pMixer, Common::Event& pSyncEvent)
|
||||
: m_mixer(pMixer)
|
||||
, m_sound_sync_event(pSyncEvent)
|
||||
, xaudio_buffer(new BYTE[NUM_BUFFERS * BUFFER_SIZE_BYTES]())
|
||||
StreamingVoiceContext2_7::StreamingVoiceContext2_7(IXAudio2* pXAudio2, CMixer* pMixer,
|
||||
Common::Event& pSyncEvent)
|
||||
: m_mixer(pMixer), m_sound_sync_event(pSyncEvent),
|
||||
xaudio_buffer(new BYTE[NUM_BUFFERS * BUFFER_SIZE_BYTES]())
|
||||
{
|
||||
WAVEFORMATEXTENSIBLE wfx = {};
|
||||
|
||||
|
@ -69,7 +68,7 @@ StreamingVoiceContext2_7::StreamingVoiceContext2_7(IXAudio2 *pXAudio2, CMixer *p
|
|||
wfx.Format.nSamplesPerSec = m_mixer->GetSampleRate();
|
||||
wfx.Format.nChannels = 2;
|
||||
wfx.Format.wBitsPerSample = 16;
|
||||
wfx.Format.nBlockAlign = wfx.Format.nChannels*wfx.Format.wBitsPerSample / 8;
|
||||
wfx.Format.nBlockAlign = wfx.Format.nChannels * wfx.Format.wBitsPerSample / 8;
|
||||
wfx.Format.nAvgBytesPerSec = wfx.Format.nSamplesPerSec * wfx.Format.nBlockAlign;
|
||||
wfx.Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX);
|
||||
wfx.Samples.wValidBitsPerSample = 16;
|
||||
|
@ -78,7 +77,8 @@ StreamingVoiceContext2_7::StreamingVoiceContext2_7(IXAudio2 *pXAudio2, CMixer *p
|
|||
|
||||
// create source voice
|
||||
HRESULT hr;
|
||||
if (FAILED(hr = pXAudio2->CreateSourceVoice(&m_source_voice, &wfx.Format, XAUDIO2_VOICE_NOSRC, 1.0f, this)))
|
||||
if (FAILED(hr = pXAudio2->CreateSourceVoice(&m_source_voice, &wfx.Format, XAUDIO2_VOICE_NOSRC,
|
||||
1.0f, this)))
|
||||
{
|
||||
PanicAlert("XAudio2_7 CreateSourceVoice failed: %#X", hr);
|
||||
return;
|
||||
|
@ -119,8 +119,8 @@ void StreamingVoiceContext2_7::OnBufferEnd(void* context)
|
|||
if (!m_source_voice || !context)
|
||||
return;
|
||||
|
||||
//m_sound_sync_event->Wait(); // sync
|
||||
//m_sound_sync_event->Spin(); // or tight sync
|
||||
// m_sound_sync_event->Wait(); // sync
|
||||
// m_sound_sync_event->Spin(); // or tight sync
|
||||
|
||||
m_mixer->Mix(static_cast<short*>(context), SAMPLES_PER_BUFFER);
|
||||
SubmitBuffer(static_cast<BYTE*>(context));
|
||||
|
@ -146,9 +146,8 @@ bool XAudio2_7::InitLibrary()
|
|||
}
|
||||
|
||||
XAudio2_7::XAudio2_7()
|
||||
: m_mastering_voice(nullptr)
|
||||
, m_volume(1.0f)
|
||||
, m_cleanup_com(SUCCEEDED(CoInitializeEx(nullptr, COINIT_MULTITHREADED)))
|
||||
: m_mastering_voice(nullptr), m_volume(1.0f),
|
||||
m_cleanup_com(SUCCEEDED(CoInitializeEx(nullptr, COINIT_MULTITHREADED)))
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -185,15 +184,15 @@ bool XAudio2_7::Start()
|
|||
// Volume
|
||||
m_mastering_voice->SetVolume(m_volume);
|
||||
|
||||
m_voice_context = std::unique_ptr<StreamingVoiceContext2_7>
|
||||
(new StreamingVoiceContext2_7(m_xaudio2.get(), m_mixer.get(), m_sound_sync_event));
|
||||
m_voice_context = std::unique_ptr<StreamingVoiceContext2_7>(
|
||||
new StreamingVoiceContext2_7(m_xaudio2.get(), m_mixer.get(), m_sound_sync_event));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void XAudio2_7::SetVolume(int volume)
|
||||
{
|
||||
//linear 1- .01
|
||||
// linear 1- .01
|
||||
m_volume = (float)volume / 100.f;
|
||||
|
||||
if (m_mastering_voice)
|
||||
|
@ -215,7 +214,7 @@ void XAudio2_7::Clear(bool mute)
|
|||
|
||||
void XAudio2_7::Stop()
|
||||
{
|
||||
//m_sound_sync_event.Set();
|
||||
// m_sound_sync_event.Set();
|
||||
|
||||
m_voice_context.reset();
|
||||
|
||||
|
|
|
@ -32,13 +32,13 @@ class XAudio2_7 final : public SoundStream
|
|||
#ifdef _WIN32
|
||||
|
||||
private:
|
||||
static void ReleaseIXAudio2(IXAudio2 *ptr);
|
||||
static void ReleaseIXAudio2(IXAudio2* ptr);
|
||||
|
||||
class Releaser
|
||||
{
|
||||
public:
|
||||
template <typename R>
|
||||
void operator()(R *ptr)
|
||||
void operator()(R* ptr)
|
||||
{
|
||||
ReleaseIXAudio2(ptr);
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ private:
|
|||
|
||||
std::unique_ptr<IXAudio2, Releaser> m_xaudio2;
|
||||
std::unique_ptr<StreamingVoiceContext2_7> m_voice_context;
|
||||
IXAudio2MasteringVoice *m_mastering_voice;
|
||||
IXAudio2MasteringVoice* m_mastering_voice;
|
||||
|
||||
Common::Event m_sound_sync_event;
|
||||
float m_volume;
|
||||
|
|
|
@ -6,23 +6,35 @@
|
|||
* Copyright (c) 2006, Creative Labs Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
* provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of conditions and
|
||||
* * Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and
|
||||
* the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions
|
||||
* and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of Creative Labs Inc. nor the names of its contributors may be used to endorse or
|
||||
* * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
* conditions
|
||||
* and the following disclaimer in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* * Neither the name of Creative Labs Inc. nor the names of its contributors may be used to
|
||||
* endorse or
|
||||
* promote products derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
* IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A
|
||||
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED
|
||||
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
* THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
@ -42,7 +54,6 @@
|
|||
#include <AL/alc.h>
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Init call
|
||||
*/
|
||||
|
@ -50,34 +61,38 @@ ALDeviceList::ALDeviceList()
|
|||
{
|
||||
ALDEVICEINFO ALDeviceInfo;
|
||||
|
||||
// DeviceInfo vector stores, for each enumerated device, it's device name, selection status, spec version #, and extension support
|
||||
// DeviceInfo vector stores, for each enumerated device, it's device name, selection status, spec
|
||||
// version #, and extension support
|
||||
vDeviceInfo.clear();
|
||||
vDeviceInfo.reserve(10);
|
||||
|
||||
defaultDeviceIndex = 0;
|
||||
|
||||
// grab function pointers for 1.0-API functions, and if successful proceed to enumerate all devices
|
||||
//if (LoadOAL10Library(nullptr, &ALFunction) == TRUE) {
|
||||
// grab function pointers for 1.0-API functions, and if successful proceed to enumerate all
|
||||
// devices
|
||||
// if (LoadOAL10Library(nullptr, &ALFunction) == TRUE) {
|
||||
if (alcIsExtensionPresent(nullptr, "ALC_ENUMERATION_EXT"))
|
||||
{
|
||||
const char *devices = alcGetString(nullptr, ALC_DEVICE_SPECIFIER);
|
||||
const char *defaultDeviceName = alcGetString(nullptr, ALC_DEFAULT_DEVICE_SPECIFIER);
|
||||
// go through device list (each device terminated with a single nullptr, list terminated with double nullptr)
|
||||
for (s32 index = 0; devices != nullptr && strlen(devices) > 0; index++, devices += strlen(devices) + 1)
|
||||
const char* devices = alcGetString(nullptr, ALC_DEVICE_SPECIFIER);
|
||||
const char* defaultDeviceName = alcGetString(nullptr, ALC_DEFAULT_DEVICE_SPECIFIER);
|
||||
// go through device list (each device terminated with a single nullptr, list terminated with
|
||||
// double nullptr)
|
||||
for (s32 index = 0; devices != nullptr && strlen(devices) > 0;
|
||||
index++, devices += strlen(devices) + 1)
|
||||
{
|
||||
if (strcmp(defaultDeviceName, devices) == 0)
|
||||
{
|
||||
defaultDeviceIndex = index;
|
||||
}
|
||||
ALCdevice *device = alcOpenDevice(devices);
|
||||
ALCdevice* device = alcOpenDevice(devices);
|
||||
if (device)
|
||||
{
|
||||
ALCcontext *context = alcCreateContext(device, nullptr);
|
||||
ALCcontext* context = alcCreateContext(device, nullptr);
|
||||
if (context)
|
||||
{
|
||||
alcMakeContextCurrent(context);
|
||||
// if new actual device name isn't already in the list, then add it...
|
||||
const char *actualDeviceName = alcGetString(device, ALC_DEVICE_SPECIFIER);
|
||||
const char* actualDeviceName = alcGetString(device, ALC_DEVICE_SPECIFIER);
|
||||
bool bNewName = true;
|
||||
for (s32 i = 0; i < GetNumDevices(); i++)
|
||||
{
|
||||
|
@ -167,18 +182,19 @@ s32 ALDeviceList::GetNumDevices()
|
|||
/*
|
||||
* Returns the device name at an index in the complete device list
|
||||
*/
|
||||
char * ALDeviceList::GetDeviceName(s32 index)
|
||||
char* ALDeviceList::GetDeviceName(s32 index)
|
||||
{
|
||||
if (index < GetNumDevices())
|
||||
return (char *)vDeviceInfo[index].strDeviceName.c_str();
|
||||
return (char*)vDeviceInfo[index].strDeviceName.c_str();
|
||||
else
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the major and minor version numbers for a device at a specified index in the complete list
|
||||
* Returns the major and minor version numbers for a device at a specified index in the complete
|
||||
* list
|
||||
*/
|
||||
void ALDeviceList::GetDeviceVersion(s32 index, s32 *major, s32 *minor)
|
||||
void ALDeviceList::GetDeviceVersion(s32 index, s32* major, s32* minor)
|
||||
{
|
||||
if (index < GetNumDevices())
|
||||
{
|
||||
|
@ -203,7 +219,7 @@ u32 ALDeviceList::GetMaxNumSources(s32 index)
|
|||
/*
|
||||
* Checks if the extension is supported on the given device
|
||||
*/
|
||||
bool ALDeviceList::IsExtensionSupported(s32 index, char *szExtName)
|
||||
bool ALDeviceList::IsExtensionSupported(s32 index, char* szExtName)
|
||||
{
|
||||
bool bReturn = false;
|
||||
|
||||
|
@ -265,7 +281,7 @@ void ALDeviceList::FilterDevicesMaxVer(s32 major, s32 minor)
|
|||
/*
|
||||
* Deselects device which don't support the given extension name
|
||||
*/
|
||||
void ALDeviceList::FilterDevicesExtension(char *szExtName)
|
||||
void ALDeviceList::FilterDevicesExtension(char* szExtName)
|
||||
{
|
||||
bool bFound;
|
||||
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
#include "Common/CommonTypes.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma warning(disable: 4786) //disable warning "identifier was truncated to
|
||||
//'255' characters in the browser information"
|
||||
#pragma warning(disable : 4786) // disable warning "identifier was truncated to
|
||||
//'255' characters in the browser information"
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
#include <cmath>
|
||||
#include <cstdio>
|
||||
#include <string>
|
||||
#include <curl/curl.h>
|
||||
#include <string>
|
||||
|
||||
#include "Common/Analytics.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
|
@ -43,12 +43,10 @@ void AppendVarInt(std::string* out, u64 v)
|
|||
v >>= 7;
|
||||
current_byte |= (!!v) << 7;
|
||||
out->push_back(current_byte);
|
||||
}
|
||||
while (v);
|
||||
} while (v);
|
||||
}
|
||||
|
||||
void AppendBytes(std::string* out, const u8* bytes, u32 length,
|
||||
bool encode_length = true)
|
||||
void AppendBytes(std::string* out, const u8* bytes, u32 length, bool encode_length = true)
|
||||
{
|
||||
if (encode_length)
|
||||
{
|
||||
|
@ -75,58 +73,50 @@ AnalyticsReportBuilder::AnalyticsReportBuilder()
|
|||
m_report.push_back(WIRE_FORMAT_VERSION);
|
||||
}
|
||||
|
||||
void AnalyticsReportBuilder::AppendSerializedValue(std::string* report,
|
||||
const std::string& v)
|
||||
void AnalyticsReportBuilder::AppendSerializedValue(std::string* report, const std::string& v)
|
||||
{
|
||||
AppendType(report, TypeId::STRING);
|
||||
AppendBytes(report, reinterpret_cast<const u8*>(v.data()), static_cast<u32>(v.size()));
|
||||
}
|
||||
|
||||
void AnalyticsReportBuilder::AppendSerializedValue(std::string* report,
|
||||
const char* v)
|
||||
void AnalyticsReportBuilder::AppendSerializedValue(std::string* report, const char* v)
|
||||
{
|
||||
AppendSerializedValue(report, std::string(v));
|
||||
}
|
||||
|
||||
void AnalyticsReportBuilder::AppendSerializedValue(std::string* report,
|
||||
bool v)
|
||||
void AnalyticsReportBuilder::AppendSerializedValue(std::string* report, bool v)
|
||||
{
|
||||
AppendType(report, TypeId::BOOL);
|
||||
AppendBool(report, v);
|
||||
}
|
||||
|
||||
void AnalyticsReportBuilder::AppendSerializedValue(std::string* report,
|
||||
u64 v)
|
||||
void AnalyticsReportBuilder::AppendSerializedValue(std::string* report, u64 v)
|
||||
{
|
||||
AppendType(report, TypeId::UINT);
|
||||
AppendVarInt(report, v);
|
||||
}
|
||||
|
||||
void AnalyticsReportBuilder::AppendSerializedValue(std::string* report,
|
||||
s64 v)
|
||||
void AnalyticsReportBuilder::AppendSerializedValue(std::string* report, s64 v)
|
||||
{
|
||||
AppendType(report, TypeId::SINT);
|
||||
AppendBool(report, v >= 0);
|
||||
AppendVarInt(report, static_cast<u64>(std::abs(v)));
|
||||
}
|
||||
|
||||
void AnalyticsReportBuilder::AppendSerializedValue(std::string* report,
|
||||
u32 v)
|
||||
void AnalyticsReportBuilder::AppendSerializedValue(std::string* report, u32 v)
|
||||
{
|
||||
AppendSerializedValue(report, static_cast<u64>(v));
|
||||
}
|
||||
|
||||
void AnalyticsReportBuilder::AppendSerializedValue(std::string* report,
|
||||
s32 v)
|
||||
void AnalyticsReportBuilder::AppendSerializedValue(std::string* report, s32 v)
|
||||
{
|
||||
AppendSerializedValue(report, static_cast<s64>(v));
|
||||
}
|
||||
|
||||
void AnalyticsReportBuilder::AppendSerializedValue(std::string* report,
|
||||
float v)
|
||||
void AnalyticsReportBuilder::AppendSerializedValue(std::string* report, float v)
|
||||
{
|
||||
AppendType(report, TypeId::FLOAT);
|
||||
AppendBytes(report, reinterpret_cast<u8*>(&v), sizeof (v), false);
|
||||
AppendBytes(report, reinterpret_cast<u8*>(&v), sizeof(v), false);
|
||||
}
|
||||
|
||||
AnalyticsReporter::AnalyticsReporter()
|
||||
|
@ -189,8 +179,8 @@ void AnalyticsReporter::ThreadProc()
|
|||
|
||||
void StdoutAnalyticsBackend::Send(std::string report)
|
||||
{
|
||||
printf("Analytics report sent:\n%s", HexDump(
|
||||
reinterpret_cast<const u8*>(report.data()), report.size()).c_str());
|
||||
printf("Analytics report sent:\n%s",
|
||||
HexDump(reinterpret_cast<const u8*>(report.data()), report.size()).c_str());
|
||||
}
|
||||
|
||||
HttpAnalyticsBackend::HttpAnalyticsBackend(const std::string& endpoint)
|
||||
|
|
|
@ -41,14 +41,12 @@ typedef void CURL;
|
|||
|
||||
namespace Common
|
||||
{
|
||||
|
||||
// Generic interface for an analytics reporting backends. The main
|
||||
// implementation used in Dolphin can be found in Core/Analytics.h.
|
||||
class AnalyticsReportingBackend
|
||||
{
|
||||
public:
|
||||
virtual ~AnalyticsReportingBackend() {}
|
||||
|
||||
// Called from the AnalyticsReporter backend thread.
|
||||
virtual void Send(std::string report) = 0;
|
||||
};
|
||||
|
@ -60,11 +58,7 @@ public:
|
|||
AnalyticsReportBuilder();
|
||||
~AnalyticsReportBuilder() = default;
|
||||
|
||||
AnalyticsReportBuilder(const AnalyticsReportBuilder& other)
|
||||
{
|
||||
*this = other;
|
||||
}
|
||||
|
||||
AnalyticsReportBuilder(const AnalyticsReportBuilder& other) { *this = other; }
|
||||
AnalyticsReportBuilder(AnalyticsReportBuilder&& other)
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(other.m_lock);
|
||||
|
@ -147,16 +141,13 @@ public:
|
|||
// being sent. DO NOT use this builder to send a report. Only use it to add
|
||||
// new fields that should be globally available.
|
||||
AnalyticsReportBuilder& BaseBuilder() { return m_base_builder; }
|
||||
|
||||
// Gets a cloned builder that can be used to send a report.
|
||||
AnalyticsReportBuilder Builder() const { return m_base_builder; }
|
||||
|
||||
// Enqueues a report for sending. Consumes the report builder.
|
||||
void Send(AnalyticsReportBuilder&& report);
|
||||
|
||||
// For convenience.
|
||||
void Send(AnalyticsReportBuilder& report) { Send(std::move(report)); }
|
||||
|
||||
protected:
|
||||
void ThreadProc();
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -14,7 +14,6 @@
|
|||
|
||||
namespace Arm64Gen
|
||||
{
|
||||
|
||||
// X30 serves a dual purpose as a link register
|
||||
// Encoded as <u3:type><u5:reg>
|
||||
// Types:
|
||||
|
@ -26,54 +25,200 @@ namespace Arm64Gen
|
|||
enum ARM64Reg
|
||||
{
|
||||
// 32bit registers
|
||||
W0 = 0, W1, W2, W3, W4, W5, W6,
|
||||
W7, W8, W9, W10, W11, W12, W13, W14,
|
||||
W15, W16, W17, W18, W19, W20, W21, W22,
|
||||
W23, W24, W25, W26, W27, W28, W29, W30,
|
||||
W0 = 0,
|
||||
W1,
|
||||
W2,
|
||||
W3,
|
||||
W4,
|
||||
W5,
|
||||
W6,
|
||||
W7,
|
||||
W8,
|
||||
W9,
|
||||
W10,
|
||||
W11,
|
||||
W12,
|
||||
W13,
|
||||
W14,
|
||||
W15,
|
||||
W16,
|
||||
W17,
|
||||
W18,
|
||||
W19,
|
||||
W20,
|
||||
W21,
|
||||
W22,
|
||||
W23,
|
||||
W24,
|
||||
W25,
|
||||
W26,
|
||||
W27,
|
||||
W28,
|
||||
W29,
|
||||
W30,
|
||||
|
||||
WSP, // 32bit stack pointer
|
||||
|
||||
// 64bit registers
|
||||
X0 = 0x20, X1, X2, X3, X4, X5, X6,
|
||||
X7, X8, X9, X10, X11, X12, X13, X14,
|
||||
X15, X16, X17, X18, X19, X20, X21, X22,
|
||||
X23, X24, X25, X26, X27, X28, X29, X30,
|
||||
X0 = 0x20,
|
||||
X1,
|
||||
X2,
|
||||
X3,
|
||||
X4,
|
||||
X5,
|
||||
X6,
|
||||
X7,
|
||||
X8,
|
||||
X9,
|
||||
X10,
|
||||
X11,
|
||||
X12,
|
||||
X13,
|
||||
X14,
|
||||
X15,
|
||||
X16,
|
||||
X17,
|
||||
X18,
|
||||
X19,
|
||||
X20,
|
||||
X21,
|
||||
X22,
|
||||
X23,
|
||||
X24,
|
||||
X25,
|
||||
X26,
|
||||
X27,
|
||||
X28,
|
||||
X29,
|
||||
X30,
|
||||
|
||||
SP, // 64bit stack pointer
|
||||
|
||||
// VFP single precision registers
|
||||
S0 = 0x40, S1, S2, S3, S4, S5, S6,
|
||||
S7, S8, S9, S10, S11, S12, S13,
|
||||
S14, S15, S16, S17, S18, S19, S20,
|
||||
S21, S22, S23, S24, S25, S26, S27,
|
||||
S28, S29, S30, S31,
|
||||
S0 = 0x40,
|
||||
S1,
|
||||
S2,
|
||||
S3,
|
||||
S4,
|
||||
S5,
|
||||
S6,
|
||||
S7,
|
||||
S8,
|
||||
S9,
|
||||
S10,
|
||||
S11,
|
||||
S12,
|
||||
S13,
|
||||
S14,
|
||||
S15,
|
||||
S16,
|
||||
S17,
|
||||
S18,
|
||||
S19,
|
||||
S20,
|
||||
S21,
|
||||
S22,
|
||||
S23,
|
||||
S24,
|
||||
S25,
|
||||
S26,
|
||||
S27,
|
||||
S28,
|
||||
S29,
|
||||
S30,
|
||||
S31,
|
||||
|
||||
// VFP Double Precision registers
|
||||
D0 = 0x80, D1, D2, D3, D4, D5, D6, D7,
|
||||
D8, D9, D10, D11, D12, D13, D14, D15,
|
||||
D16, D17, D18, D19, D20, D21, D22, D23,
|
||||
D24, D25, D26, D27, D28, D29, D30, D31,
|
||||
D0 = 0x80,
|
||||
D1,
|
||||
D2,
|
||||
D3,
|
||||
D4,
|
||||
D5,
|
||||
D6,
|
||||
D7,
|
||||
D8,
|
||||
D9,
|
||||
D10,
|
||||
D11,
|
||||
D12,
|
||||
D13,
|
||||
D14,
|
||||
D15,
|
||||
D16,
|
||||
D17,
|
||||
D18,
|
||||
D19,
|
||||
D20,
|
||||
D21,
|
||||
D22,
|
||||
D23,
|
||||
D24,
|
||||
D25,
|
||||
D26,
|
||||
D27,
|
||||
D28,
|
||||
D29,
|
||||
D30,
|
||||
D31,
|
||||
|
||||
// ASIMD Quad-Word registers
|
||||
Q0 = 0xC0, Q1, Q2, Q3, Q4, Q5, Q6, Q7,
|
||||
Q8, Q9, Q10, Q11, Q12, Q13, Q14, Q15,
|
||||
Q16, Q17, Q18, Q19, Q20, Q21, Q22, Q23,
|
||||
Q24, Q25, Q26, Q27, Q28, Q29, Q30, Q31,
|
||||
Q0 = 0xC0,
|
||||
Q1,
|
||||
Q2,
|
||||
Q3,
|
||||
Q4,
|
||||
Q5,
|
||||
Q6,
|
||||
Q7,
|
||||
Q8,
|
||||
Q9,
|
||||
Q10,
|
||||
Q11,
|
||||
Q12,
|
||||
Q13,
|
||||
Q14,
|
||||
Q15,
|
||||
Q16,
|
||||
Q17,
|
||||
Q18,
|
||||
Q19,
|
||||
Q20,
|
||||
Q21,
|
||||
Q22,
|
||||
Q23,
|
||||
Q24,
|
||||
Q25,
|
||||
Q26,
|
||||
Q27,
|
||||
Q28,
|
||||
Q29,
|
||||
Q30,
|
||||
Q31,
|
||||
|
||||
// For PRFM(prefetch memory) encoding
|
||||
// This is encoded in the Rt register
|
||||
// Data preload
|
||||
PLDL1KEEP = 0, PLDL1STRM,
|
||||
PLDL2KEEP, PLDL2STRM,
|
||||
PLDL3KEEP, PLDL3STRM,
|
||||
PLDL1KEEP = 0,
|
||||
PLDL1STRM,
|
||||
PLDL2KEEP,
|
||||
PLDL2STRM,
|
||||
PLDL3KEEP,
|
||||
PLDL3STRM,
|
||||
// Instruction preload
|
||||
PLIL1KEEP = 8, PLIL1STRM,
|
||||
PLIL2KEEP, PLIL2STRM,
|
||||
PLIL3KEEP, PLIL3STRM,
|
||||
PLIL1KEEP = 8,
|
||||
PLIL1STRM,
|
||||
PLIL2KEEP,
|
||||
PLIL2STRM,
|
||||
PLIL3KEEP,
|
||||
PLIL3STRM,
|
||||
// Prepare for store
|
||||
PLTL1KEEP = 16, PLTL1STRM,
|
||||
PLTL2KEEP, PLTL2STRM,
|
||||
PLTL3KEEP, PLTL3STRM,
|
||||
PLTL1KEEP = 16,
|
||||
PLTL1STRM,
|
||||
PLTL2KEEP,
|
||||
PLTL2STRM,
|
||||
PLTL3KEEP,
|
||||
PLTL3STRM,
|
||||
|
||||
WZR = WSP,
|
||||
ZR = SP,
|
||||
|
@ -81,22 +226,59 @@ enum ARM64Reg
|
|||
INVALID_REG = 0xFFFFFFFF
|
||||
};
|
||||
|
||||
constexpr bool Is64Bit(ARM64Reg reg) { return (reg & 0x20) != 0; }
|
||||
constexpr bool IsSingle(ARM64Reg reg) { return (reg & 0xC0) == 0x40; }
|
||||
constexpr bool IsDouble(ARM64Reg reg) { return (reg & 0xC0) == 0x80; }
|
||||
constexpr bool IsScalar(ARM64Reg reg) { return IsSingle(reg) || IsDouble(reg); }
|
||||
constexpr bool IsQuad(ARM64Reg reg) { return (reg & 0xC0) == 0xC0; }
|
||||
constexpr bool IsVector(ARM64Reg reg) { return (reg & 0xC0) != 0; }
|
||||
constexpr bool IsGPR(ARM64Reg reg) { return static_cast<int>(reg) < 0x40; }
|
||||
constexpr bool Is64Bit(ARM64Reg reg)
|
||||
{
|
||||
return (reg & 0x20) != 0;
|
||||
}
|
||||
constexpr bool IsSingle(ARM64Reg reg)
|
||||
{
|
||||
return (reg & 0xC0) == 0x40;
|
||||
}
|
||||
constexpr bool IsDouble(ARM64Reg reg)
|
||||
{
|
||||
return (reg & 0xC0) == 0x80;
|
||||
}
|
||||
constexpr bool IsScalar(ARM64Reg reg)
|
||||
{
|
||||
return IsSingle(reg) || IsDouble(reg);
|
||||
}
|
||||
constexpr bool IsQuad(ARM64Reg reg)
|
||||
{
|
||||
return (reg & 0xC0) == 0xC0;
|
||||
}
|
||||
constexpr bool IsVector(ARM64Reg reg)
|
||||
{
|
||||
return (reg & 0xC0) != 0;
|
||||
}
|
||||
constexpr bool IsGPR(ARM64Reg reg)
|
||||
{
|
||||
return static_cast<int>(reg) < 0x40;
|
||||
}
|
||||
|
||||
constexpr ARM64Reg DecodeReg(ARM64Reg reg) { return static_cast<ARM64Reg>(reg & 0x1F); }
|
||||
constexpr ARM64Reg EncodeRegTo64(ARM64Reg reg) { return static_cast<ARM64Reg>(reg | 0x20); }
|
||||
constexpr ARM64Reg EncodeRegToSingle(ARM64Reg reg) { return static_cast<ARM64Reg>(DecodeReg(reg) + S0); }
|
||||
constexpr ARM64Reg EncodeRegToDouble(ARM64Reg reg) { return static_cast<ARM64Reg>((reg & ~0xC0) | 0x80); }
|
||||
constexpr ARM64Reg EncodeRegToQuad(ARM64Reg reg) { return static_cast<ARM64Reg>(reg | 0xC0); }
|
||||
constexpr ARM64Reg DecodeReg(ARM64Reg reg)
|
||||
{
|
||||
return static_cast<ARM64Reg>(reg & 0x1F);
|
||||
}
|
||||
constexpr ARM64Reg EncodeRegTo64(ARM64Reg reg)
|
||||
{
|
||||
return static_cast<ARM64Reg>(reg | 0x20);
|
||||
}
|
||||
constexpr ARM64Reg EncodeRegToSingle(ARM64Reg reg)
|
||||
{
|
||||
return static_cast<ARM64Reg>(DecodeReg(reg) + S0);
|
||||
}
|
||||
constexpr ARM64Reg EncodeRegToDouble(ARM64Reg reg)
|
||||
{
|
||||
return static_cast<ARM64Reg>((reg & ~0xC0) | 0x80);
|
||||
}
|
||||
constexpr ARM64Reg EncodeRegToQuad(ARM64Reg reg)
|
||||
{
|
||||
return static_cast<ARM64Reg>(reg | 0xC0);
|
||||
}
|
||||
|
||||
// For AND/TST/ORR/EOR etc
|
||||
bool IsImmLogical(uint64_t value, unsigned int width, unsigned int* n, unsigned int* imm_s, unsigned int* imm_r);
|
||||
bool IsImmLogical(uint64_t value, unsigned int width, unsigned int* n, unsigned int* imm_s,
|
||||
unsigned int* imm_r);
|
||||
// For ADD/SUB
|
||||
bool IsImmArithmetic(uint64_t input, u32* val, bool* shift);
|
||||
|
||||
|
@ -136,7 +318,8 @@ enum ShiftAmount
|
|||
SHIFT_48 = 3,
|
||||
};
|
||||
|
||||
enum RoundingMode {
|
||||
enum RoundingMode
|
||||
{
|
||||
ROUND_A, // round to nearest, ties to away
|
||||
ROUND_M, // round towards -inf
|
||||
ROUND_N, // round to nearest, ties to even
|
||||
|
@ -293,25 +476,17 @@ public:
|
|||
m_shift = 0;
|
||||
}
|
||||
}
|
||||
TypeSpecifier GetType() const
|
||||
{
|
||||
return m_type;
|
||||
}
|
||||
ARM64Reg GetReg() const
|
||||
{
|
||||
return m_destReg;
|
||||
}
|
||||
TypeSpecifier GetType() const { return m_type; }
|
||||
ARM64Reg GetReg() const { return m_destReg; }
|
||||
u32 GetData() const
|
||||
{
|
||||
switch (m_type)
|
||||
{
|
||||
case TYPE_EXTENDEDREG:
|
||||
return (m_extend << 13) |
|
||||
(m_shift << 10);
|
||||
return (m_extend << 13) | (m_shift << 10);
|
||||
break;
|
||||
case TYPE_SHIFTEDREG:
|
||||
return (m_shifttype << 22) |
|
||||
(m_shift << 10);
|
||||
return (m_shifttype << 22) | (m_shift << 10);
|
||||
break;
|
||||
default:
|
||||
_dbg_assert_msg_(DYNA_REC, false, "Invalid type in GetData");
|
||||
|
@ -335,7 +510,8 @@ private:
|
|||
void EncodeUnconditionalBranchInst(u32 opc, u32 op2, u32 op3, u32 op4, ARM64Reg Rn);
|
||||
void EncodeExceptionInst(u32 instenc, u32 imm);
|
||||
void EncodeSystemInst(u32 op0, u32 op1, u32 CRn, u32 CRm, u32 op2, ARM64Reg Rt);
|
||||
void EncodeArithmeticInst(u32 instenc, bool flags, ARM64Reg Rd, ARM64Reg Rn, ARM64Reg Rm, ArithOption Option);
|
||||
void EncodeArithmeticInst(u32 instenc, bool flags, ARM64Reg Rd, ARM64Reg Rn, ARM64Reg Rm,
|
||||
ArithOption Option);
|
||||
void EncodeArithmeticCarryInst(u32 op, bool flags, ARM64Reg Rd, ARM64Reg Rn, ARM64Reg Rm);
|
||||
void EncodeCondCompareImmInst(u32 op, ARM64Reg Rn, u32 imm, u32 nzcv, CCFlags cond);
|
||||
void EncodeCondCompareRegInst(u32 op, ARM64Reg Rn, ARM64Reg Rm, u32 nzcv, CCFlags cond);
|
||||
|
@ -354,7 +530,8 @@ private:
|
|||
void EncodeLoadStoreRegisterOffset(u32 size, u32 opc, ARM64Reg Rt, ARM64Reg Rn, ArithOption Rm);
|
||||
void EncodeAddSubImmInst(u32 op, bool flags, u32 shift, u32 imm, ARM64Reg Rn, ARM64Reg Rd);
|
||||
void EncodeLogicalImmInst(u32 op, ARM64Reg Rd, ARM64Reg Rn, u32 immr, u32 imms, int n);
|
||||
void EncodeLoadStorePair(u32 op, u32 load, IndexType type, ARM64Reg Rt, ARM64Reg Rt2, ARM64Reg Rn, s32 imm);
|
||||
void EncodeLoadStorePair(u32 op, u32 load, IndexType type, ARM64Reg Rt, ARM64Reg Rt2, ARM64Reg Rn,
|
||||
s32 imm);
|
||||
void EncodeAddressInst(u32 op, ARM64Reg Rd, s32 imm);
|
||||
void EncodeLoadStoreUnscaled(u32 size, u32 op, ARM64Reg Rt, ARM64Reg Rn, s32 imm);
|
||||
|
||||
|
@ -362,20 +539,14 @@ protected:
|
|||
void Write32(u32 value);
|
||||
|
||||
public:
|
||||
ARM64XEmitter()
|
||||
: m_code(nullptr), m_lastCacheFlushEnd(nullptr)
|
||||
ARM64XEmitter() : m_code(nullptr), m_lastCacheFlushEnd(nullptr) {}
|
||||
ARM64XEmitter(u8* code_ptr)
|
||||
{
|
||||
}
|
||||
|
||||
ARM64XEmitter(u8* code_ptr) {
|
||||
m_code = code_ptr;
|
||||
m_lastCacheFlushEnd = code_ptr;
|
||||
}
|
||||
|
||||
virtual ~ARM64XEmitter()
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~ARM64XEmitter() {}
|
||||
void SetCodePtr(u8* ptr);
|
||||
void SetCodePtrUnsafe(u8* ptr);
|
||||
void ReserveCodeSpace(u32 bytes);
|
||||
|
@ -480,11 +651,7 @@ public:
|
|||
ARM64Reg zr = Is64Bit(Rd) ? ZR : WZR;
|
||||
CSINC(Rd, zr, zr, (CCFlags)((u32)cond ^ 1));
|
||||
}
|
||||
void NEG(ARM64Reg Rd, ARM64Reg Rs)
|
||||
{
|
||||
SUB(Rd, Is64Bit(Rd) ? ZR : WZR, Rs);
|
||||
}
|
||||
|
||||
void NEG(ARM64Reg Rd, ARM64Reg Rs) { SUB(Rd, Is64Bit(Rd) ? ZR : WZR, Rs); }
|
||||
// Data-Processing 1 source
|
||||
void RBIT(ARM64Reg Rd, ARM64Reg Rn);
|
||||
void REV16(ARM64Reg Rd, ARM64Reg Rn);
|
||||
|
@ -542,7 +709,6 @@ public:
|
|||
void EON(ARM64Reg Rd, ARM64Reg Rn, ARM64Reg Rm) { EON(Rd, Rn, Rm, ArithOption(Rd, ST_LSL, 0)); }
|
||||
void ANDS(ARM64Reg Rd, ARM64Reg Rn, ARM64Reg Rm) { ANDS(Rd, Rn, Rm, ArithOption(Rd, ST_LSL, 0)); }
|
||||
void BICS(ARM64Reg Rd, ARM64Reg Rn, ARM64Reg Rm) { BICS(Rd, Rn, Rm, ArithOption(Rd, ST_LSL, 0)); }
|
||||
|
||||
// Convenience wrappers around ORR. These match the official convenience syntax.
|
||||
void MOV(ARM64Reg Rd, ARM64Reg Rm, ArithOption Shift);
|
||||
void MOV(ARM64Reg Rd, ARM64Reg Rm);
|
||||
|
@ -560,11 +726,7 @@ public:
|
|||
void EOR(ARM64Reg Rd, ARM64Reg Rn, u32 immr, u32 imms, bool invert = false);
|
||||
void ORR(ARM64Reg Rd, ARM64Reg Rn, u32 immr, u32 imms, bool invert = false);
|
||||
void TST(ARM64Reg Rn, u32 immr, u32 imms, bool invert = false);
|
||||
void TST(ARM64Reg Rn, ARM64Reg Rm)
|
||||
{
|
||||
ANDS(Is64Bit(Rn) ? ZR : WZR, Rn, Rm);
|
||||
}
|
||||
|
||||
void TST(ARM64Reg Rn, ARM64Reg Rm) { ANDS(Is64Bit(Rn) ? ZR : WZR, Rn, Rm); }
|
||||
// Add/subtract (immediate)
|
||||
void ADD(ARM64Reg Rd, ARM64Reg Rn, u32 imm, bool shift = false);
|
||||
void ADDS(ARM64Reg Rd, ARM64Reg Rn, u32 imm, bool shift = false);
|
||||
|
@ -594,11 +756,7 @@ public:
|
|||
void UXTB(ARM64Reg Rd, ARM64Reg Rn);
|
||||
void UXTH(ARM64Reg Rd, ARM64Reg Rn);
|
||||
|
||||
void UBFX(ARM64Reg Rd, ARM64Reg Rn, int lsb, int width)
|
||||
{
|
||||
UBFM(Rd, Rn, lsb, lsb + width - 1);
|
||||
}
|
||||
|
||||
void UBFX(ARM64Reg Rd, ARM64Reg Rn, int lsb, int width) { UBFM(Rd, Rn, lsb, lsb + width - 1); }
|
||||
// Load Register (Literal)
|
||||
void LDR(ARM64Reg Rt, u32 imm);
|
||||
void LDRSW(ARM64Reg Rt, u32 imm);
|
||||
|
@ -684,10 +842,14 @@ public:
|
|||
MOVI2R(Rd, (uintptr_t)ptr);
|
||||
}
|
||||
|
||||
// Wrapper around AND x, y, imm etc. If you are sure the imm will work, no need to pass a scratch register.
|
||||
// Wrapper around AND x, y, imm etc. If you are sure the imm will work, no need to pass a scratch
|
||||
// register.
|
||||
void ANDI2R(ARM64Reg Rd, ARM64Reg Rn, u64 imm, ARM64Reg scratch = INVALID_REG);
|
||||
void ANDSI2R(ARM64Reg Rd, ARM64Reg Rn, u64 imm, ARM64Reg scratch = INVALID_REG);
|
||||
void TSTI2R(ARM64Reg Rn, u64 imm, ARM64Reg scratch = INVALID_REG) { ANDSI2R(Is64Bit(Rn) ? ZR : WZR, Rn, imm, scratch); }
|
||||
void TSTI2R(ARM64Reg Rn, u64 imm, ARM64Reg scratch = INVALID_REG)
|
||||
{
|
||||
ANDSI2R(Is64Bit(Rn) ? ZR : WZR, Rn, imm, scratch);
|
||||
}
|
||||
void ORRI2R(ARM64Reg Rd, ARM64Reg Rn, u64 imm, ARM64Reg scratch = INVALID_REG);
|
||||
void EORI2R(ARM64Reg Rd, ARM64Reg Rn, u64 imm, ARM64Reg scratch = INVALID_REG);
|
||||
void CMPI2R(ARM64Reg Rn, u64 imm, ARM64Reg scratch = INVALID_REG);
|
||||
|
@ -726,13 +888,14 @@ public:
|
|||
{
|
||||
auto trampoline = &ARM64XEmitter::CallLambdaTrampoline<T, Args...>;
|
||||
MOVI2R(X30, (uintptr_t)trampoline);
|
||||
MOVI2R(X0, (uintptr_t)const_cast<void*>((const void*)f));
|
||||
MOVI2R(X0, (uintptr_t) const_cast<void*>((const void*)f));
|
||||
return X30;
|
||||
}
|
||||
|
||||
// Plain function call
|
||||
void QuickCallFunction(ARM64Reg scratchreg, const void* func);
|
||||
template <typename T> void QuickCallFunction(ARM64Reg scratchreg, T func)
|
||||
template <typename T>
|
||||
void QuickCallFunction(ARM64Reg scratchreg, T func)
|
||||
{
|
||||
QuickCallFunction(scratchreg, (const void*)func);
|
||||
}
|
||||
|
@ -742,7 +905,6 @@ class ARM64FloatEmitter
|
|||
{
|
||||
public:
|
||||
ARM64FloatEmitter(ARM64XEmitter* emit) : m_emit(emit) {}
|
||||
|
||||
void LDR(u8 size, IndexType type, ARM64Reg Rt, ARM64Reg Rn, s32 imm);
|
||||
void STR(u8 size, IndexType type, ARM64Reg Rt, ARM64Reg Rn, s32 imm);
|
||||
|
||||
|
@ -823,10 +985,7 @@ public:
|
|||
void FSUB(u8 size, ARM64Reg Rd, ARM64Reg Rn, ARM64Reg Rm);
|
||||
void NOT(ARM64Reg Rd, ARM64Reg Rn);
|
||||
void ORR(ARM64Reg Rd, ARM64Reg Rn, ARM64Reg Rm);
|
||||
void MOV(ARM64Reg Rd, ARM64Reg Rn)
|
||||
{
|
||||
ORR(Rd, Rn, Rn);
|
||||
}
|
||||
void MOV(ARM64Reg Rd, ARM64Reg Rn) { ORR(Rd, Rn, Rn); }
|
||||
void REV16(u8 size, ARM64Reg Rd, ARM64Reg Rn);
|
||||
void REV32(u8 size, ARM64Reg Rd, ARM64Reg Rn);
|
||||
void REV64(u8 size, ARM64Reg Rd, ARM64Reg Rn);
|
||||
|
@ -852,7 +1011,8 @@ public:
|
|||
void FCVT(u8 size_to, u8 size_from, ARM64Reg Rd, ARM64Reg Rn);
|
||||
|
||||
// Scalar convert float to int, in a lot of variants.
|
||||
// Note that the scalar version of this operation has two encodings, one that goes to an integer register
|
||||
// Note that the scalar version of this operation has two encodings, one that goes to an integer
|
||||
// register
|
||||
// and one that outputs to a scalar fp register.
|
||||
void FCVTS(ARM64Reg Rd, ARM64Reg Rn, RoundingMode round);
|
||||
void FCVTU(ARM64Reg Rd, ARM64Reg Rn, RoundingMode round);
|
||||
|
@ -920,18 +1080,21 @@ public:
|
|||
private:
|
||||
ARM64XEmitter* m_emit;
|
||||
inline void Write32(u32 value) { m_emit->Write32(value); }
|
||||
|
||||
// Emitting functions
|
||||
void EmitLoadStoreImmediate(u8 size, u32 opc, IndexType type, ARM64Reg Rt, ARM64Reg Rn, s32 imm);
|
||||
void EmitScalar2Source(bool M, bool S, u32 type, u32 opcode, ARM64Reg Rd, ARM64Reg Rn, ARM64Reg Rm);
|
||||
void EmitScalar2Source(bool M, bool S, u32 type, u32 opcode, ARM64Reg Rd, ARM64Reg Rn,
|
||||
ARM64Reg Rm);
|
||||
void EmitThreeSame(bool U, u32 size, u32 opcode, ARM64Reg Rd, ARM64Reg Rn, ARM64Reg Rm);
|
||||
void EmitCopy(bool Q, u32 op, u32 imm5, u32 imm4, ARM64Reg Rd, ARM64Reg Rn);
|
||||
void Emit2RegMisc(bool Q, bool U, u32 size, u32 opcode, ARM64Reg Rd, ARM64Reg Rn);
|
||||
void EmitLoadStoreSingleStructure(bool L, bool R, u32 opcode, bool S, u32 size, ARM64Reg Rt, ARM64Reg Rn);
|
||||
void EmitLoadStoreSingleStructure(bool L, bool R, u32 opcode, bool S, u32 size, ARM64Reg Rt, ARM64Reg Rn, ARM64Reg Rm);
|
||||
void EmitLoadStoreSingleStructure(bool L, bool R, u32 opcode, bool S, u32 size, ARM64Reg Rt,
|
||||
ARM64Reg Rn);
|
||||
void EmitLoadStoreSingleStructure(bool L, bool R, u32 opcode, bool S, u32 size, ARM64Reg Rt,
|
||||
ARM64Reg Rn, ARM64Reg Rm);
|
||||
void Emit1Source(bool M, bool S, u32 type, u32 opcode, ARM64Reg Rd, ARM64Reg Rn);
|
||||
void EmitConversion(bool sf, bool S, u32 type, u32 rmode, u32 opcode, ARM64Reg Rd, ARM64Reg Rn);
|
||||
void EmitConversion2(bool sf, bool S, bool direction, u32 type, u32 rmode, u32 opcode, int scale, ARM64Reg Rd, ARM64Reg Rn);
|
||||
void EmitConversion2(bool sf, bool S, bool direction, u32 type, u32 rmode, u32 opcode, int scale,
|
||||
ARM64Reg Rd, ARM64Reg Rn);
|
||||
void EmitCompare(bool M, bool S, u32 op, u32 opcode2, ARM64Reg Rn, ARM64Reg Rm);
|
||||
void EmitCondSelect(bool M, bool S, CCFlags cond, ARM64Reg Rd, ARM64Reg Rn, ARM64Reg Rm);
|
||||
void EmitPermute(u32 size, u32 op, ARM64Reg Rd, ARM64Reg Rn, ARM64Reg Rm);
|
||||
|
@ -939,13 +1102,17 @@ private:
|
|||
void EmitShiftImm(bool Q, bool U, u32 immh, u32 immb, u32 opcode, ARM64Reg Rd, ARM64Reg Rn);
|
||||
void EmitScalarShiftImm(bool U, u32 immh, u32 immb, u32 opcode, ARM64Reg Rd, ARM64Reg Rn);
|
||||
void EmitLoadStoreMultipleStructure(u32 size, bool L, u32 opcode, ARM64Reg Rt, ARM64Reg Rn);
|
||||
void EmitLoadStoreMultipleStructurePost(u32 size, bool L, u32 opcode, ARM64Reg Rt, ARM64Reg Rn, ARM64Reg Rm);
|
||||
void EmitLoadStoreMultipleStructurePost(u32 size, bool L, u32 opcode, ARM64Reg Rt, ARM64Reg Rn,
|
||||
ARM64Reg Rm);
|
||||
void EmitScalar1Source(bool M, bool S, u32 type, u32 opcode, ARM64Reg Rd, ARM64Reg Rn);
|
||||
void EmitVectorxElement(bool U, u32 size, bool L, u32 opcode, bool H, ARM64Reg Rd, ARM64Reg Rn, ARM64Reg Rm);
|
||||
void EmitVectorxElement(bool U, u32 size, bool L, u32 opcode, bool H, ARM64Reg Rd, ARM64Reg Rn,
|
||||
ARM64Reg Rm);
|
||||
void EmitLoadStoreUnscaled(u32 size, u32 op, ARM64Reg Rt, ARM64Reg Rn, s32 imm);
|
||||
void EmitConvertScalarToInt(ARM64Reg Rd, ARM64Reg Rn, RoundingMode round, bool sign);
|
||||
void EmitScalar3Source(bool isDouble, ARM64Reg Rd, ARM64Reg Rn, ARM64Reg Rm, ARM64Reg Ra, int opcode);
|
||||
void EncodeLoadStorePair(u32 size, bool load, IndexType type, ARM64Reg Rt, ARM64Reg Rt2, ARM64Reg Rn, s32 imm);
|
||||
void EmitScalar3Source(bool isDouble, ARM64Reg Rd, ARM64Reg Rn, ARM64Reg Rm, ARM64Reg Ra,
|
||||
int opcode);
|
||||
void EncodeLoadStorePair(u32 size, bool load, IndexType type, ARM64Reg Rt, ARM64Reg Rt2,
|
||||
ARM64Reg Rn, s32 imm);
|
||||
void EncodeLoadStoreRegisterOffset(u32 size, bool load, ARM64Reg Rt, ARM64Reg Rn, ArithOption Rm);
|
||||
void EncodeModImm(bool Q, u8 op, u8 cmode, u8 o2, ARM64Reg Rd, u8 abcdefgh);
|
||||
|
||||
|
@ -963,7 +1130,8 @@ private:
|
|||
{
|
||||
u32* ptr = (u32*)region;
|
||||
u32* maxptr = (u32*)(region + region_size);
|
||||
// If our memory isn't a multiple of u32 then this won't write the last remaining bytes with anything
|
||||
// If our memory isn't a multiple of u32 then this won't write the last remaining bytes with
|
||||
// anything
|
||||
// Less than optimal, but there would be nothing we could do but throw a runtime warning anyway.
|
||||
// AArch64: 0xD4200000 = BRK 0
|
||||
while (ptr < maxptr)
|
||||
|
@ -971,4 +1139,3 @@ private:
|
|||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -2,15 +2,15 @@
|
|||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <asm/hwcap.h>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <unistd.h>
|
||||
#include <asm/hwcap.h>
|
||||
#include <sys/auxv.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/CPUDetect.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/StringUtil.h"
|
||||
|
||||
const char procfile[] = "/proc/cpuinfo";
|
||||
|
@ -78,11 +78,16 @@ std::string CPUInfo::Summarize()
|
|||
else
|
||||
sum = StringFromFormat("%s, %i cores", cpu_string, num_cores);
|
||||
|
||||
if (bAES) sum += ", AES";
|
||||
if (bCRC32) sum += ", CRC32";
|
||||
if (bSHA1) sum += ", SHA1";
|
||||
if (bSHA2) sum += ", SHA2";
|
||||
if (CPU64bit) sum += ", 64-bit";
|
||||
if (bAES)
|
||||
sum += ", AES";
|
||||
if (bCRC32)
|
||||
sum += ", CRC32";
|
||||
if (bSHA1)
|
||||
sum += ", SHA1";
|
||||
if (bSHA2)
|
||||
sum += ", SHA2";
|
||||
if (CPU64bit)
|
||||
sum += ", 64-bit";
|
||||
|
||||
return sum;
|
||||
}
|
||||
|
|
|
@ -25,4 +25,3 @@ enum CCFlags
|
|||
CC_LO = CC_CC, // Alias of CC_CC Unsigned lower
|
||||
};
|
||||
const u32 NO_COND = 0xE0000000;
|
||||
|
||||
|
|
|
@ -6,31 +6,35 @@
|
|||
|
||||
#include "Common/Common.h"
|
||||
#include "Common/CommonFuncs.h"
|
||||
#include "Common/MsgHandler.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Common/MsgHandler.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#define _assert_msg_(_t_, _a_, _fmt_, ...) \
|
||||
if (!(_a_)) {\
|
||||
if (!(_a_)) \
|
||||
{ \
|
||||
if (!PanicYesNo(_fmt_, __VA_ARGS__)) \
|
||||
Crash(); \
|
||||
}
|
||||
|
||||
#define _dbg_assert_msg_(_t_, _a_, _msg_, ...)\
|
||||
if (MAX_LOGLEVEL >= LogTypes::LOG_LEVELS::LDEBUG && !(_a_)) {\
|
||||
#define _dbg_assert_msg_(_t_, _a_, _msg_, ...) \
|
||||
if (MAX_LOGLEVEL >= LogTypes::LOG_LEVELS::LDEBUG && !(_a_)) \
|
||||
{ \
|
||||
ERROR_LOG(_t_, _msg_, __VA_ARGS__); \
|
||||
if (!PanicYesNo(_msg_, __VA_ARGS__)) \
|
||||
Crash(); \
|
||||
}
|
||||
#else
|
||||
#define _assert_msg_(_t_, _a_, _fmt_, ...) \
|
||||
if (!(_a_)) {\
|
||||
if (!(_a_)) \
|
||||
{ \
|
||||
if (!PanicYesNo(_fmt_, ##__VA_ARGS__)) \
|
||||
Crash(); \
|
||||
}
|
||||
|
||||
#define _dbg_assert_msg_(_t_, _a_, _msg_, ...)\
|
||||
if (MAX_LOGLEVEL >= LogTypes::LOG_LEVELS::LDEBUG && !(_a_)) {\
|
||||
#define _dbg_assert_msg_(_t_, _a_, _msg_, ...) \
|
||||
if (MAX_LOGLEVEL >= LogTypes::LOG_LEVELS::LDEBUG && !(_a_)) \
|
||||
{ \
|
||||
ERROR_LOG(_t_, _msg_, ##__VA_ARGS__); \
|
||||
if (!PanicYesNo(_msg_, ##__VA_ARGS__)) \
|
||||
Crash(); \
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
|
||||
namespace Common
|
||||
{
|
||||
|
||||
inline void AtomicAdd(volatile u32& target, u32 value)
|
||||
{
|
||||
__sync_add_and_fetch(&target, value);
|
||||
|
@ -84,5 +83,4 @@ inline T* AtomicExchangeAcquire(T* volatile& loc, U newval)
|
|||
{
|
||||
return __atomic_exchange_n(&loc, newval, __ATOMIC_ACQ_REL);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
|
||||
namespace Common
|
||||
{
|
||||
|
||||
inline void AtomicAdd(volatile u32& target, u32 value)
|
||||
{
|
||||
_InterlockedExchangeAdd((volatile LONG*)&target, (LONG)value);
|
||||
|
@ -74,20 +73,19 @@ inline T AtomicLoadAcquire(volatile T& src)
|
|||
template <typename T, typename U>
|
||||
inline void AtomicStore(volatile T& dest, U value)
|
||||
{
|
||||
dest = (T) value; // 32-bit writes are always atomic.
|
||||
dest = (T)value; // 32-bit writes are always atomic.
|
||||
}
|
||||
|
||||
template <typename T, typename U>
|
||||
inline void AtomicStoreRelease(volatile T& dest, U value)
|
||||
{
|
||||
_WriteBarrier(); // Compiler instruction only. x86 stores always have release semantics.
|
||||
dest = (T) value; // 32-bit writes are always atomic.
|
||||
dest = (T)value; // 32-bit writes are always atomic.
|
||||
}
|
||||
|
||||
template <typename T, typename U>
|
||||
inline T* AtomicExchangeAcquire(T* volatile& loc, U newval)
|
||||
{
|
||||
return (T*) _InterlockedExchangePointer_acq((void* volatile*) &loc, (void*) newval);
|
||||
return (T*)_InterlockedExchangePointer_acq((void* volatile*)&loc, (void*)newval);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
|
||||
// Copyright 2014 Tony Wasserka
|
||||
// All rights reserved.
|
||||
//
|
||||
|
@ -30,7 +29,6 @@
|
|||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <limits>
|
||||
|
@ -111,7 +109,7 @@
|
|||
* symptoms.
|
||||
*/
|
||||
#pragma pack(1)
|
||||
template<std::size_t position, std::size_t bits, typename T>
|
||||
template <std::size_t position, std::size_t bits, typename T>
|
||||
struct BitField
|
||||
{
|
||||
private:
|
||||
|
@ -154,19 +152,14 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
__forceinline operator T() const
|
||||
{
|
||||
return Value();
|
||||
}
|
||||
|
||||
__forceinline operator T() const { return Value(); }
|
||||
private:
|
||||
// StorageType is T for non-enum types and the underlying type of T if
|
||||
// T is an enumeration. Note that T is wrapped within an enable_if in the
|
||||
// former case to workaround compile errors which arise when using
|
||||
// std::underlying_type<T>::type directly.
|
||||
typedef typename std::conditional<std::is_enum<T>::value,
|
||||
std::underlying_type<T>,
|
||||
std::enable_if<true,T>>::type::type StorageType;
|
||||
typedef typename std::conditional<std::is_enum<T>::value, std::underlying_type<T>,
|
||||
std::enable_if<true, T>>::type::type StorageType;
|
||||
|
||||
// Unsigned version of StorageType
|
||||
typedef typename std::make_unsigned<StorageType>::type StorageTypeU;
|
||||
|
|
|
@ -19,10 +19,10 @@ static inline int CountSetBits(T v)
|
|||
// from https://graphics.stanford.edu/~seander/bithacks.html
|
||||
// GCC has this built in, but MSVC's intrinsic will only emit the actual
|
||||
// POPCNT instruction, which we're not depending on
|
||||
v = v - ((v >> 1) & (T)~(T)0/3);
|
||||
v = (v & (T)~(T)0/15*3) + ((v >> 2) & (T)~(T)0/15*3);
|
||||
v = (v + (v >> 4)) & (T)~(T)0/255*15;
|
||||
return (T)(v * ((T)~(T)0/255)) >> (sizeof(T) - 1) * 8;
|
||||
v = v - ((v >> 1) & (T) ~(T)0 / 3);
|
||||
v = (v & (T) ~(T)0 / 15 * 3) + ((v >> 2) & (T) ~(T)0 / 15 * 3);
|
||||
v = (v + (v >> 4)) & (T) ~(T)0 / 255 * 15;
|
||||
return (T)(v * ((T) ~(T)0 / 255)) >> (sizeof(T) - 1) * 8;
|
||||
}
|
||||
static inline int LeastSignificantSetBit(u8 val)
|
||||
{
|
||||
|
@ -49,20 +49,43 @@ static inline int LeastSignificantSetBit(u64 val)
|
|||
return (int)index;
|
||||
}
|
||||
#else
|
||||
static inline int CountSetBits(u8 val) { return __builtin_popcount(val); }
|
||||
static inline int CountSetBits(u16 val) { return __builtin_popcount(val); }
|
||||
static inline int CountSetBits(u32 val) { return __builtin_popcount(val); }
|
||||
static inline int CountSetBits(u64 val) { return __builtin_popcountll(val); }
|
||||
static inline int LeastSignificantSetBit(u8 val) { return __builtin_ctz(val); }
|
||||
static inline int LeastSignificantSetBit(u16 val) { return __builtin_ctz(val); }
|
||||
static inline int LeastSignificantSetBit(u32 val) { return __builtin_ctz(val); }
|
||||
static inline int LeastSignificantSetBit(u64 val) { return __builtin_ctzll(val); }
|
||||
static inline int CountSetBits(u8 val)
|
||||
{
|
||||
return __builtin_popcount(val);
|
||||
}
|
||||
static inline int CountSetBits(u16 val)
|
||||
{
|
||||
return __builtin_popcount(val);
|
||||
}
|
||||
static inline int CountSetBits(u32 val)
|
||||
{
|
||||
return __builtin_popcount(val);
|
||||
}
|
||||
static inline int CountSetBits(u64 val)
|
||||
{
|
||||
return __builtin_popcountll(val);
|
||||
}
|
||||
static inline int LeastSignificantSetBit(u8 val)
|
||||
{
|
||||
return __builtin_ctz(val);
|
||||
}
|
||||
static inline int LeastSignificantSetBit(u16 val)
|
||||
{
|
||||
return __builtin_ctz(val);
|
||||
}
|
||||
static inline int LeastSignificantSetBit(u32 val)
|
||||
{
|
||||
return __builtin_ctz(val);
|
||||
}
|
||||
static inline int LeastSignificantSetBit(u64 val)
|
||||
{
|
||||
return __builtin_ctzll(val);
|
||||
}
|
||||
#endif
|
||||
|
||||
// namespace avoids conflict with OS X Carbon; don't use BitSet<T> directly
|
||||
namespace BS
|
||||
{
|
||||
|
||||
// Similar to std::bitset, this is a class which encapsulates a bitset, i.e.
|
||||
// using the set bits of an integer to represent a set of integers. Like that
|
||||
// class, it acts like an array of bools:
|
||||
|
@ -87,6 +110,7 @@ template <typename IntTy>
|
|||
class BitSet
|
||||
{
|
||||
static_assert(!std::is_signed<IntTy>::value, "BitSet should not be used with signed types");
|
||||
|
||||
public:
|
||||
// A reference to a particular bit, returned from operator[].
|
||||
class Ref
|
||||
|
@ -100,6 +124,7 @@ public:
|
|||
m_bs->m_val = (m_bs->m_val & ~m_mask) | (set ? m_mask : 0);
|
||||
return set;
|
||||
}
|
||||
|
||||
private:
|
||||
BitSet* m_bs;
|
||||
IntTy m_mask;
|
||||
|
@ -111,7 +136,11 @@ public:
|
|||
public:
|
||||
Iterator(const Iterator& other) : m_val(other.m_val), m_bit(other.m_bit) {}
|
||||
Iterator(IntTy val, int bit) : m_val(val), m_bit(bit) {}
|
||||
Iterator& operator=(Iterator other) { new (this) Iterator(other); return *this; }
|
||||
Iterator& operator=(Iterator other)
|
||||
{
|
||||
new (this) Iterator(other);
|
||||
return *this;
|
||||
}
|
||||
int operator*() { return m_bit; }
|
||||
Iterator& operator++()
|
||||
{
|
||||
|
@ -151,7 +180,7 @@ public:
|
|||
|
||||
static BitSet AllTrue(size_t count)
|
||||
{
|
||||
return BitSet(count == sizeof(IntTy)*8 ? ~(IntTy)0 : (((IntTy)1 << count) - 1));
|
||||
return BitSet(count == sizeof(IntTy) * 8 ? ~(IntTy)0 : (((IntTy)1 << count) - 1));
|
||||
}
|
||||
|
||||
Ref operator[](size_t bit) { return Ref(this, (IntTy)1 << bit); }
|
||||
|
@ -168,19 +197,19 @@ public:
|
|||
BitSet& operator&=(BitSet other) { return *this = *this & other; }
|
||||
BitSet& operator^=(BitSet other) { return *this = *this ^ other; }
|
||||
explicit operator bool() const { return m_val != 0; }
|
||||
|
||||
// Warning: Even though on modern CPUs this is a single fast instruction,
|
||||
// Dolphin's official builds do not currently assume POPCNT support on x86,
|
||||
// so slower explicit bit twiddling is generated. Still should generally
|
||||
// be faster than a loop.
|
||||
unsigned int Count() const { return CountSetBits(m_val); }
|
||||
|
||||
Iterator begin() const { Iterator it(m_val, 0); return ++it; }
|
||||
Iterator begin() const
|
||||
{
|
||||
Iterator it(m_val, 0);
|
||||
return ++it;
|
||||
}
|
||||
Iterator end() const { return Iterator(m_val, -1); }
|
||||
|
||||
IntTy m_val;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
typedef BS::BitSet<u8> BitSet8;
|
||||
|
|
|
@ -13,24 +13,17 @@
|
|||
|
||||
namespace Common
|
||||
{
|
||||
|
||||
// This class provides a synchronized loop.
|
||||
// It's a thread-safe way to trigger a new iteration without busy loops.
|
||||
// It's optimized for high-usage iterations which usually are already running while it's triggered often.
|
||||
// Be careful when using Wait() and Wakeup() at the same time. Wait() may block forever while Wakeup() is called regularly.
|
||||
// It's optimized for high-usage iterations which usually are already running while it's triggered
|
||||
// often.
|
||||
// Be careful when using Wait() and Wakeup() at the same time. Wait() may block forever while
|
||||
// Wakeup() is called regularly.
|
||||
class BlockingLoop
|
||||
{
|
||||
public:
|
||||
BlockingLoop()
|
||||
{
|
||||
m_stopped.Set();
|
||||
}
|
||||
|
||||
~BlockingLoop()
|
||||
{
|
||||
Stop();
|
||||
}
|
||||
|
||||
BlockingLoop() { m_stopped.Set(); }
|
||||
~BlockingLoop() { Stop(); }
|
||||
// Triggers to rerun the payload of the Run() function at least once again.
|
||||
// This function will never block and is designed to finish as fast as possible.
|
||||
void Wakeup()
|
||||
|
@ -75,7 +68,8 @@ public:
|
|||
|
||||
// Half start the worker.
|
||||
// So this object is in a running state and Wait() will block until the worker calls Run().
|
||||
// This may be called from any thread and is supposed to be called at least once before Wait() is used.
|
||||
// This may be called from any thread and is supposed to be called at least once before Wait() is
|
||||
// used.
|
||||
void Prepare()
|
||||
{
|
||||
// There is a race condition if the other threads call this function while
|
||||
|
@ -84,16 +78,19 @@ public:
|
|||
|
||||
if (!m_stopped.TestAndClear())
|
||||
return;
|
||||
m_running_state.store(STATE_LAST_EXECUTION); // so the payload will only be executed once without any Wakeup call
|
||||
m_running_state.store(
|
||||
STATE_LAST_EXECUTION); // so the payload will only be executed once without any Wakeup call
|
||||
m_shutdown.Clear();
|
||||
m_may_sleep.Set();
|
||||
}
|
||||
|
||||
// Main loop of this object.
|
||||
// The payload callback is called at least as often as it's needed to match the Wakeup() requirements.
|
||||
// The payload callback is called at least as often as it's needed to match the Wakeup()
|
||||
// requirements.
|
||||
// The optional timeout parameter is a timeout for how periodically the payload should be called.
|
||||
// Use timeout = 0 to run without a timeout at all.
|
||||
template<class F> void Run(F payload, int64_t timeout = 0)
|
||||
template <class F>
|
||||
void Run(F payload, int64_t timeout = 0)
|
||||
{
|
||||
// Asserts that Prepare is called at least once before we enter the loop.
|
||||
// But a good implementation should call this before already.
|
||||
|
@ -106,14 +103,17 @@ public:
|
|||
switch (m_running_state.load())
|
||||
{
|
||||
case STATE_NEED_EXECUTION:
|
||||
// We won't get notified while we are in the STATE_NEED_EXECUTION state, so maybe Wakeup was called.
|
||||
// So we have to assume on finishing the STATE_NEED_EXECUTION state, that there may be some remaining tasks.
|
||||
// We won't get notified while we are in the STATE_NEED_EXECUTION state, so maybe Wakeup was
|
||||
// called.
|
||||
// So we have to assume on finishing the STATE_NEED_EXECUTION state, that there may be some
|
||||
// remaining tasks.
|
||||
// To process this tasks, we call the payload again within the STATE_LAST_EXECUTION state.
|
||||
m_running_state--;
|
||||
break;
|
||||
|
||||
case STATE_LAST_EXECUTION:
|
||||
// If we're still in the STATE_LAST_EXECUTION state, then Wakeup wasn't called within the last
|
||||
// If we're still in the STATE_LAST_EXECUTION state, then Wakeup wasn't called within the
|
||||
// last
|
||||
// execution of the payload. This means we should be ready now.
|
||||
// But bad luck, Wakeup may have been called right now. So break and rerun the payload
|
||||
// if the state was touched.
|
||||
|
@ -126,7 +126,8 @@ public:
|
|||
m_done_event.Set();
|
||||
|
||||
case STATE_DONE:
|
||||
// We're done now. So time to check if we want to sleep or if we want to stay in a busy loop.
|
||||
// We're done now. So time to check if we want to sleep or if we want to stay in a busy
|
||||
// loop.
|
||||
if (m_may_sleep.TestAndClear())
|
||||
{
|
||||
// Try to set the sleeping state.
|
||||
|
@ -178,23 +179,11 @@ public:
|
|||
Wait();
|
||||
}
|
||||
|
||||
bool IsRunning() const
|
||||
{
|
||||
return !m_stopped.IsSet() && !m_shutdown.IsSet();
|
||||
}
|
||||
|
||||
bool IsDone() const
|
||||
{
|
||||
return m_stopped.IsSet() || m_running_state.load() <= STATE_DONE;
|
||||
}
|
||||
|
||||
bool IsRunning() const { return !m_stopped.IsSet() && !m_shutdown.IsSet(); }
|
||||
bool IsDone() const { return m_stopped.IsSet() || m_running_state.load() <= STATE_DONE; }
|
||||
// This function should be triggered regularly over time so
|
||||
// that we will fall back from the busy loop to sleeping.
|
||||
void AllowSleep()
|
||||
{
|
||||
m_may_sleep.Set();
|
||||
}
|
||||
|
||||
void AllowSleep() { m_may_sleep.Set(); }
|
||||
private:
|
||||
std::mutex m_wait_lock;
|
||||
std::mutex m_prepare_lock;
|
||||
|
@ -205,7 +194,8 @@ private:
|
|||
Event m_new_work_event;
|
||||
Event m_done_event;
|
||||
|
||||
enum RUNNING_TYPE {
|
||||
enum RUNNING_TYPE
|
||||
{
|
||||
STATE_SLEEPING = 0,
|
||||
STATE_DONE = 1,
|
||||
STATE_LAST_EXECUTION = 2,
|
||||
|
@ -213,7 +203,7 @@ private:
|
|||
};
|
||||
std::atomic<int> m_running_state; // must be of type RUNNING_TYPE
|
||||
|
||||
Flag m_may_sleep; // If this is set, we fall back from the busy loop to an event based synchronization.
|
||||
Flag m_may_sleep; // If this is set, we fall back from the busy loop to an event based
|
||||
// synchronization.
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -133,9 +133,9 @@ MemChecks::TMemChecksStr MemChecks::GetStrings() const
|
|||
{
|
||||
std::stringstream mc;
|
||||
mc << std::hex << bp.StartAddress;
|
||||
mc << " " << (bp.bRange ? bp.EndAddress : bp.StartAddress) << " " <<
|
||||
(bp.bRange ? "n" : "") << (bp.OnRead ? "r" : "") <<
|
||||
(bp.OnWrite ? "w" : "") << (bp.Log ? "l" : "") << (bp.Break ? "p" : "");
|
||||
mc << " " << (bp.bRange ? bp.EndAddress : bp.StartAddress) << " " << (bp.bRange ? "n" : "")
|
||||
<< (bp.OnRead ? "r" : "") << (bp.OnWrite ? "w" : "") << (bp.Log ? "l" : "")
|
||||
<< (bp.Break ? "p" : "");
|
||||
mcs.push_back(mc.str());
|
||||
}
|
||||
|
||||
|
@ -207,17 +207,16 @@ TMemCheck* MemChecks::GetMemCheck(u32 address)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
bool TMemCheck::Action(DebugInterface* debug_interface, u32 iValue, u32 addr, bool write, int size, u32 pc)
|
||||
bool TMemCheck::Action(DebugInterface* debug_interface, u32 iValue, u32 addr, bool write, int size,
|
||||
u32 pc)
|
||||
{
|
||||
if ((write && OnWrite) || (!write && OnRead))
|
||||
{
|
||||
if (Log)
|
||||
{
|
||||
INFO_LOG(MEMMAP, "CHK %08x (%s) %s%i %0*x at %08x (%s)",
|
||||
pc, debug_interface->GetDescription(pc).c_str(),
|
||||
write ? "Write" : "Read", size*8, size*2, iValue, addr,
|
||||
debug_interface->GetDescription(addr).c_str()
|
||||
);
|
||||
INFO_LOG(MEMMAP, "CHK %08x (%s) %s%i %0*x at %08x (%s)", pc,
|
||||
debug_interface->GetDescription(pc).c_str(), write ? "Write" : "Read", size * 8,
|
||||
size * 2, iValue, addr, debug_interface->GetDescription(addr).c_str());
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -225,7 +224,6 @@ bool TMemCheck::Action(DebugInterface* debug_interface, u32 iValue, u32 addr, bo
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool Watches::IsAddressWatch(u32 _iAddress) const
|
||||
{
|
||||
for (const TWatch& bp : m_Watches)
|
||||
|
|
|
@ -41,8 +41,7 @@ struct TMemCheck
|
|||
u32 numHits;
|
||||
|
||||
// returns whether to break
|
||||
bool Action(DebugInterface* dbg_interface, u32 _iValue, u32 addr,
|
||||
bool write, int size, u32 pc);
|
||||
bool Action(DebugInterface* dbg_interface, u32 _iValue, u32 addr, bool write, int size, u32 pc);
|
||||
};
|
||||
|
||||
struct TWatch
|
||||
|
@ -60,7 +59,6 @@ public:
|
|||
typedef std::vector<std::string> TBreakPointsStr;
|
||||
|
||||
const TBreakPoints& GetBreakPoints() { return m_BreakPoints; }
|
||||
|
||||
TBreakPointsStr GetStrings() const;
|
||||
void AddFromStrings(const TBreakPointsStr& bps);
|
||||
|
||||
|
@ -81,7 +79,6 @@ private:
|
|||
TBreakPoints m_BreakPoints;
|
||||
};
|
||||
|
||||
|
||||
// Memory breakpoints
|
||||
class MemChecks
|
||||
{
|
||||
|
@ -92,7 +89,6 @@ public:
|
|||
TMemChecks m_MemChecks;
|
||||
|
||||
const TMemChecks& GetMemChecks() { return m_MemChecks; }
|
||||
|
||||
TMemChecksStr GetStrings() const;
|
||||
void AddFromStrings(const TMemChecksStr& mcs);
|
||||
|
||||
|
@ -103,7 +99,6 @@ public:
|
|||
void Remove(u32 _Address);
|
||||
|
||||
void Clear() { m_MemChecks.clear(); }
|
||||
|
||||
bool HasAny() const { return !m_MemChecks.empty(); }
|
||||
};
|
||||
|
||||
|
@ -114,7 +109,6 @@ public:
|
|||
typedef std::vector<std::string> TWatchesStr;
|
||||
|
||||
const TWatches& GetWatches() { return m_Watches; }
|
||||
|
||||
TWatchesStr GetStrings() const;
|
||||
void AddFromStrings(const TWatchesStr& bps);
|
||||
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
#include <paths.h>
|
||||
#else
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#endif // WIN32
|
||||
|
||||
|
@ -61,7 +61,9 @@ std::vector<std::string> cdio_get_devices()
|
|||
}
|
||||
|
||||
// advance to next drive
|
||||
while (*drive++) {}
|
||||
while (*drive++)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
return drives;
|
||||
|
@ -85,11 +87,9 @@ std::vector<std::string> cdio_get_devices()
|
|||
if (classes_to_match == nullptr)
|
||||
return drives;
|
||||
|
||||
CFDictionarySetValue(classes_to_match,
|
||||
CFSTR(kIOMediaEjectableKey), kCFBooleanTrue);
|
||||
CFDictionarySetValue(classes_to_match, CFSTR(kIOMediaEjectableKey), kCFBooleanTrue);
|
||||
|
||||
kern_result = IOServiceGetMatchingServices(master_port,
|
||||
classes_to_match, &media_iterator);
|
||||
kern_result = IOServiceGetMatchingServices(master_port, classes_to_match, &media_iterator);
|
||||
if (kern_result != KERN_SUCCESS)
|
||||
return drives;
|
||||
|
||||
|
@ -101,9 +101,7 @@ std::vector<std::string> cdio_get_devices()
|
|||
do
|
||||
{
|
||||
str_bsd_path =
|
||||
IORegistryEntryCreateCFProperty(next_media,
|
||||
CFSTR(kIOBSDNameKey), kCFAllocatorDefault,
|
||||
0);
|
||||
IORegistryEntryCreateCFProperty(next_media, CFSTR(kIOBSDNameKey), kCFAllocatorDefault, 0);
|
||||
if (str_bsd_path == nullptr)
|
||||
{
|
||||
IOObjectRelease(next_media);
|
||||
|
@ -139,20 +137,15 @@ static struct
|
|||
const char* format;
|
||||
unsigned int num_min;
|
||||
unsigned int num_max;
|
||||
} checklist[] =
|
||||
{
|
||||
} checklist[] = {
|
||||
#ifdef __linux__
|
||||
{ "/dev/cdrom", 0, 0 },
|
||||
{ "/dev/dvd", 0, 0 },
|
||||
{ "/dev/hd%c", 'a', 'z' },
|
||||
{ "/dev/scd%d", 0, 27 },
|
||||
{ "/dev/sr%d", 0, 27 },
|
||||
{"/dev/cdrom", 0, 0}, {"/dev/dvd", 0, 0}, {"/dev/hd%c", 'a', 'z'},
|
||||
{"/dev/scd%d", 0, 27}, {"/dev/sr%d", 0, 27},
|
||||
#else
|
||||
{ "/dev/acd%d", 0, 27 },
|
||||
{ "/dev/cd%d", 0, 27 },
|
||||
{"/dev/acd%d", 0, 27},
|
||||
{"/dev/cd%d", 0, 27},
|
||||
#endif
|
||||
{ nullptr, 0, 0 }
|
||||
};
|
||||
{nullptr, 0, 0}};
|
||||
|
||||
// Returns true if a device is a block or char device and not a symbolic link
|
||||
static bool is_device(const std::string& source_name)
|
||||
|
@ -161,8 +154,7 @@ static bool is_device(const std::string& source_name)
|
|||
if (0 != lstat(source_name.c_str(), &buf))
|
||||
return false;
|
||||
|
||||
return ((S_ISBLK(buf.st_mode) || S_ISCHR(buf.st_mode)) &&
|
||||
!S_ISLNK(buf.st_mode));
|
||||
return ((S_ISBLK(buf.st_mode) || S_ISCHR(buf.st_mode)) && !S_ISLNK(buf.st_mode));
|
||||
}
|
||||
|
||||
// Check a device to see if it is a DVD/CD-ROM drive
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
|
||||
// Detect the CPU, so we'll know which optimizations to use
|
||||
#pragma once
|
||||
|
||||
|
|
|
@ -34,11 +34,14 @@
|
|||
// ewww
|
||||
|
||||
#ifndef __has_feature
|
||||
#define __has_feature(x) (0)
|
||||
#define __has_feature(x) (0)
|
||||
#endif
|
||||
|
||||
#if (__has_feature(is_trivially_copyable) && (defined(_LIBCPP_VERSION) || defined(__GLIBCXX__))) || (defined(__GNUC__) && __GNUC__ >= 5)
|
||||
#define IsTriviallyCopyable(T) std::is_trivially_copyable<typename std::remove_volatile<T>::type>::value
|
||||
#if (__has_feature(is_trivially_copyable) && \
|
||||
(defined(_LIBCPP_VERSION) || defined(__GLIBCXX__))) || \
|
||||
(defined(__GNUC__) && __GNUC__ >= 5)
|
||||
#define IsTriviallyCopyable(T) \
|
||||
std::is_trivially_copyable<typename std::remove_volatile<T>::type>::value
|
||||
#elif __GNUC__
|
||||
#define IsTriviallyCopyable(T) std::has_trivial_copy_constructor<T>::value
|
||||
#elif _MSC_VER
|
||||
|
@ -48,11 +51,10 @@
|
|||
#error No version of is_trivially_copyable
|
||||
#endif
|
||||
|
||||
|
||||
template <class T>
|
||||
struct LinkedListItem : public T
|
||||
{
|
||||
LinkedListItem<T> *next;
|
||||
LinkedListItem<T>* next;
|
||||
};
|
||||
|
||||
// Wrapper class
|
||||
|
@ -67,15 +69,13 @@ public:
|
|||
MODE_VERIFY, // compare
|
||||
};
|
||||
|
||||
u8 **ptr;
|
||||
u8** ptr;
|
||||
Mode mode;
|
||||
|
||||
public:
|
||||
PointerWrap(u8 **ptr_, Mode mode_) : ptr(ptr_), mode(mode_) {}
|
||||
|
||||
PointerWrap(u8** ptr_, Mode mode_) : ptr(ptr_), mode(mode_) {}
|
||||
void SetMode(Mode mode_) { mode = mode_; }
|
||||
Mode GetMode() const { return mode; }
|
||||
|
||||
template <typename K, class V>
|
||||
void Do(std::map<K, V>& x)
|
||||
{
|
||||
|
@ -192,7 +192,7 @@ public:
|
|||
flag.Set(s);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
template <typename T>
|
||||
void Do(std::atomic<T>& atomic)
|
||||
{
|
||||
T temp = atomic.load();
|
||||
|
@ -218,7 +218,6 @@ public:
|
|||
DoVoid((void*)&x, sizeof(x));
|
||||
}
|
||||
|
||||
|
||||
void Do(bool& x)
|
||||
{
|
||||
// bool's size can vary depending on platform, which can
|
||||
|
@ -235,7 +234,8 @@ public:
|
|||
template <typename T>
|
||||
void DoPointer(T*& x, T* const base)
|
||||
{
|
||||
// pointers can be more than 2^31 apart, but you're using this function wrong if you need that much range
|
||||
// pointers can be more than 2^31 apart, but you're using this function wrong if you need that
|
||||
// much range
|
||||
ptrdiff_t offset = x - base;
|
||||
Do(offset);
|
||||
if (mode == MODE_READ)
|
||||
|
@ -245,8 +245,9 @@ public:
|
|||
}
|
||||
|
||||
// Let's pretend std::list doesn't exist!
|
||||
template <class T, LinkedListItem<T>* (*TNew)(), void (*TFree)(LinkedListItem<T>*), void (*TDo)(PointerWrap&, T*)>
|
||||
void DoLinkedList(LinkedListItem<T>*& list_start, LinkedListItem<T>** list_end=0)
|
||||
template <class T, LinkedListItem<T>* (*TNew)(), void (*TFree)(LinkedListItem<T>*),
|
||||
void (*TDo)(PointerWrap&, T*)>
|
||||
void DoLinkedList(LinkedListItem<T>*& list_start, LinkedListItem<T>** list_end = 0)
|
||||
{
|
||||
LinkedListItem<T>* list_cur = list_start;
|
||||
LinkedListItem<T>* prev = nullptr;
|
||||
|
@ -311,7 +312,8 @@ public:
|
|||
|
||||
if (mode == PointerWrap::MODE_READ && cookie != arbitraryNumber)
|
||||
{
|
||||
PanicAlertT("Error: After \"%s\", found %d (0x%X) instead of save marker %d (0x%X). Aborting savestate load...",
|
||||
PanicAlertT("Error: After \"%s\", found %d (0x%X) instead of save marker %d (0x%X). Aborting "
|
||||
"savestate load...",
|
||||
prevName.c_str(), cookie, cookie, arbitraryNumber, arbitraryNumber);
|
||||
mode = PointerWrap::MODE_MEASURE;
|
||||
}
|
||||
|
@ -329,8 +331,7 @@ private:
|
|||
Do(elem);
|
||||
}
|
||||
|
||||
__forceinline
|
||||
void DoVoid(void* data, u32 size)
|
||||
__forceinline void DoVoid(void* data, u32 size)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
|
@ -347,8 +348,8 @@ private:
|
|||
|
||||
case MODE_VERIFY:
|
||||
_dbg_assert_msg_(COMMON, !memcmp(data, *ptr, size),
|
||||
"Savestate verification failure: buf %p != %p (size %u).\n",
|
||||
data, *ptr, size);
|
||||
"Savestate verification failure: buf %p != %p (size %u).\n", data, *ptr,
|
||||
size);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -362,7 +363,7 @@ class CChunkFileReader
|
|||
{
|
||||
public:
|
||||
// Load file template
|
||||
template<class T>
|
||||
template <class T>
|
||||
static bool Load(const std::string& _rFilename, u32 _Revision, T& _class)
|
||||
{
|
||||
INFO_LOG(COMMON, "ChunkReader: Loading %s", _rFilename.c_str());
|
||||
|
@ -397,8 +398,8 @@ public:
|
|||
// Check revision
|
||||
if (header.Revision != _Revision)
|
||||
{
|
||||
ERROR_LOG(COMMON, "ChunkReader: Wrong file revision, got %d expected %d",
|
||||
header.Revision, _Revision);
|
||||
ERROR_LOG(COMMON, "ChunkReader: Wrong file revision, got %d expected %d", header.Revision,
|
||||
_Revision);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -406,8 +407,7 @@ public:
|
|||
const u32 sz = (u32)(fileSize - headerSize);
|
||||
if (header.ExpectedSize != sz)
|
||||
{
|
||||
ERROR_LOG(COMMON, "ChunkReader: Bad file size, got %d expected %d",
|
||||
sz, header.ExpectedSize);
|
||||
ERROR_LOG(COMMON, "ChunkReader: Bad file size, got %d expected %d", sz, header.ExpectedSize);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -428,7 +428,7 @@ public:
|
|||
}
|
||||
|
||||
// Save file template
|
||||
template<class T>
|
||||
template <class T>
|
||||
static bool Save(const std::string& _rFilename, u32 _Revision, T& _class)
|
||||
{
|
||||
INFO_LOG(COMMON, "ChunkReader: Writing %s", _rFilename.c_str());
|
||||
|
|
|
@ -13,11 +13,13 @@
|
|||
// having to prefix them with gen-> or something similar.
|
||||
// Example implementation:
|
||||
// class JIT : public CodeBlock<ARMXEmitter> {}
|
||||
template<class T> class CodeBlock : public T, NonCopyable
|
||||
template <class T>
|
||||
class CodeBlock : public T, NonCopyable
|
||||
{
|
||||
private:
|
||||
// A privately used function to set the executable RAM space to something invalid.
|
||||
// For debugging usefulness it should be used to set the RAM to a host specific breakpoint instruction
|
||||
// For debugging usefulness it should be used to set the RAM to a host specific breakpoint
|
||||
// instruction
|
||||
virtual void PoisonMemory() = 0;
|
||||
|
||||
protected:
|
||||
|
@ -31,12 +33,16 @@ protected:
|
|||
|
||||
public:
|
||||
CodeBlock()
|
||||
: region(nullptr), region_size(0), parent_region_size(0),
|
||||
m_has_child(false), m_is_child(false), m_child(nullptr)
|
||||
: region(nullptr), region_size(0), parent_region_size(0), m_has_child(false),
|
||||
m_is_child(false), m_child(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~CodeBlock() { if (region) FreeCodeSpace(); }
|
||||
virtual ~CodeBlock()
|
||||
{
|
||||
if (region)
|
||||
FreeCodeSpace();
|
||||
}
|
||||
|
||||
// Call this before you generate any code.
|
||||
void AllocCodeSpace(int size, bool need_low = true)
|
||||
|
@ -68,23 +74,11 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
bool IsInSpace(u8* ptr) const
|
||||
{
|
||||
return (ptr >= region) && (ptr < (region + region_size));
|
||||
}
|
||||
|
||||
bool IsInSpace(u8* ptr) const { return (ptr >= region) && (ptr < (region + region_size)); }
|
||||
// Cannot currently be undone. Will write protect the entire code region.
|
||||
// Start over if you need to change the code (call FreeCodeSpace(), AllocCodeSpace()).
|
||||
void WriteProtect()
|
||||
{
|
||||
WriteProtectMemory(region, region_size, true);
|
||||
}
|
||||
|
||||
void ResetCodePtr()
|
||||
{
|
||||
T::SetCodePtr(region);
|
||||
}
|
||||
|
||||
void WriteProtect() { WriteProtectMemory(region, region_size, true); }
|
||||
void ResetCodePtr() { T::SetCodePtr(region); }
|
||||
size_t GetSpaceLeft() const
|
||||
{
|
||||
return (m_has_child ? parent_region_size : region_size) - (T::GetCodePtr() - region);
|
||||
|
|
|
@ -7,22 +7,14 @@
|
|||
|
||||
namespace ColorUtil
|
||||
{
|
||||
static const int s_lut5to8[] = {0x00, 0x08, 0x10, 0x18, 0x20, 0x29, 0x31, 0x39, 0x41, 0x4A, 0x52,
|
||||
0x5A, 0x62, 0x6A, 0x73, 0x7B, 0x83, 0x8B, 0x94, 0x9C, 0xA4, 0xAC,
|
||||
0xB4, 0xBD, 0xC5, 0xCD, 0xD5, 0xDE, 0xE6, 0xEE, 0xF6, 0xFF};
|
||||
|
||||
static const int s_lut5to8[] = {
|
||||
0x00,0x08,0x10,0x18,0x20,0x29,0x31,0x39,
|
||||
0x41,0x4A,0x52,0x5A,0x62,0x6A,0x73,0x7B,
|
||||
0x83,0x8B,0x94,0x9C,0xA4,0xAC,0xB4,0xBD,
|
||||
0xC5,0xCD,0xD5,0xDE,0xE6,0xEE,0xF6,0xFF
|
||||
};
|
||||
static const int s_lut4to8[] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
|
||||
0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF};
|
||||
|
||||
static const int s_lut4to8[] = {
|
||||
0x00,0x11,0x22,0x33,0x44,0x55,0x66,0x77,
|
||||
0x88,0x99,0xAA,0xBB,0xCC,0xDD,0xEE,0xFF
|
||||
};
|
||||
|
||||
static const int s_lut3to8[] = {
|
||||
0x00,0x24,0x48,0x6D,0x91,0xB6,0xDA,0xFF
|
||||
};
|
||||
static const int s_lut3to8[] = {0x00, 0x24, 0x48, 0x6D, 0x91, 0xB6, 0xDA, 0xFF};
|
||||
|
||||
static u32 Decode5A3(u16 val)
|
||||
{
|
||||
|
@ -34,7 +26,7 @@ static u32 Decode5A3(u16 val)
|
|||
{
|
||||
r = s_lut5to8[(val >> 10) & 0x1f];
|
||||
g = s_lut5to8[(val >> 5) & 0x1f];
|
||||
b = s_lut5to8[(val) & 0x1f];
|
||||
b = s_lut5to8[(val)&0x1f];
|
||||
a = 0xFF;
|
||||
}
|
||||
else
|
||||
|
@ -42,7 +34,7 @@ static u32 Decode5A3(u16 val)
|
|||
a = s_lut3to8[(val >> 12) & 0x7];
|
||||
r = (s_lut4to8[(val >> 8) & 0xf] * a + (bg_color & 0xFF) * (255 - a)) / 255;
|
||||
g = (s_lut4to8[(val >> 4) & 0xf] * a + ((bg_color >> 8) & 0xFF) * (255 - a)) / 255;
|
||||
b = (s_lut4to8[(val) & 0xf] * a + ((bg_color >> 16) & 0xFF) * (255 - a)) / 255;
|
||||
b = (s_lut4to8[(val)&0xf] * a + ((bg_color >> 16) & 0xFF) * (255 - a)) / 255;
|
||||
a = 0xFF;
|
||||
}
|
||||
return (a << 24) | (r << 16) | (g << 8) | b;
|
||||
|
@ -74,7 +66,7 @@ void decodeCI8image(u32* dst, u8* src, u16* pal, int width, int height)
|
|||
{
|
||||
for (int iy = 0; iy < 4; iy++, src += 8)
|
||||
{
|
||||
u32* tdst = dst+(y+iy)*width+x;
|
||||
u32* tdst = dst + (y + iy) * width + x;
|
||||
for (int ix = 0; ix < 8; ix++)
|
||||
{
|
||||
// huh, this seems wrong. CI8, not 5A3, no?
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
|
||||
namespace ColorUtil
|
||||
{
|
||||
|
||||
void decode5A3image(u32* dst, u16* src, int width, int height);
|
||||
void decodeCI8image(u32* dst, u8* src, u16* pal, int width, int height);
|
||||
|
||||
|
|
|
@ -35,25 +35,32 @@ extern const std::string scm_distributor_str;
|
|||
#if defined _WIN32
|
||||
|
||||
// Memory leak checks
|
||||
#define CHECK_HEAP_INTEGRITY()
|
||||
#define CHECK_HEAP_INTEGRITY()
|
||||
|
||||
// Since they are always around on Windows
|
||||
#define HAVE_WX 1
|
||||
#define HAVE_OPENAL 1
|
||||
#define HAVE_WX 1
|
||||
#define HAVE_OPENAL 1
|
||||
|
||||
#define HAVE_PORTAUDIO 1
|
||||
#define HAVE_PORTAUDIO 1
|
||||
|
||||
// Debug definitions
|
||||
#if defined(_DEBUG)
|
||||
#include <crtdbg.h>
|
||||
#undef CHECK_HEAP_INTEGRITY
|
||||
#define CHECK_HEAP_INTEGRITY() {if (!_CrtCheckMemory()) PanicAlert("memory corruption detected. see log.");}
|
||||
// If you want to see how much a pain in the ass singletons are, for example:
|
||||
// {614} normal block at 0x030C5310, 188 bytes long.
|
||||
// Data: <Master Log > 4D 61 73 74 65 72 20 4C 6F 67 00 00 00 00 00 00
|
||||
struct CrtDebugBreak { CrtDebugBreak(int spot) { _CrtSetBreakAlloc(spot); } };
|
||||
//CrtDebugBreak breakAt(614);
|
||||
#endif // end DEBUG/FAST
|
||||
#if defined(_DEBUG)
|
||||
#include <crtdbg.h>
|
||||
#undef CHECK_HEAP_INTEGRITY
|
||||
#define CHECK_HEAP_INTEGRITY() \
|
||||
{ \
|
||||
if (!_CrtCheckMemory()) \
|
||||
PanicAlert("memory corruption detected. see log."); \
|
||||
}
|
||||
// If you want to see how much a pain in the ass singletons are, for example:
|
||||
// {614} normal block at 0x030C5310, 188 bytes long.
|
||||
// Data: <Master Log > 4D 61 73 74 65 72 20 4C 6F 67 00 00 00 00 00 00
|
||||
struct CrtDebugBreak
|
||||
{
|
||||
CrtDebugBreak(int spot) { _CrtSetBreakAlloc(spot); }
|
||||
};
|
||||
// CrtDebugBreak breakAt(614);
|
||||
#endif // end DEBUG/FAST
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -19,11 +19,11 @@ constexpr size_t ArraySize(T (&arr)[N])
|
|||
return N;
|
||||
}
|
||||
|
||||
#define b2(x) ( (x) | ( (x) >> 1) )
|
||||
#define b4(x) ( b2(x) | ( b2(x) >> 2) )
|
||||
#define b8(x) ( b4(x) | ( b4(x) >> 4) )
|
||||
#define b16(x) ( b8(x) | ( b8(x) >> 8) )
|
||||
#define b32(x) (b16(x) | (b16(x) >>16) )
|
||||
#define b2(x) ((x) | ((x) >> 1))
|
||||
#define b4(x) (b2(x) | (b2(x) >> 2))
|
||||
#define b8(x) (b4(x) | (b4(x) >> 4))
|
||||
#define b16(x) (b8(x) | (b8(x) >> 8))
|
||||
#define b32(x) (b16(x) | (b16(x) >> 16))
|
||||
#define ROUND_UP_POW2(x) (b32(x - 1) + 1)
|
||||
|
||||
#ifndef _WIN32
|
||||
|
@ -36,7 +36,10 @@ constexpr size_t ArraySize(T (&arr)[N])
|
|||
#endif
|
||||
|
||||
// go to debugger mode
|
||||
#define Crash() { __builtin_trap(); }
|
||||
#define Crash() \
|
||||
{ \
|
||||
__builtin_trap(); \
|
||||
}
|
||||
|
||||
// GCC 4.8 defines all the rotate functions now
|
||||
// Small issue with GCC's lrotl/lrotr intrinsics is they are still 32bit while we require 64bit
|
||||
|
@ -44,14 +47,16 @@ constexpr size_t ArraySize(T (&arr)[N])
|
|||
inline u32 _rotl(u32 x, int shift)
|
||||
{
|
||||
shift &= 31;
|
||||
if (!shift) return x;
|
||||
if (!shift)
|
||||
return x;
|
||||
return (x << shift) | (x >> (32 - shift));
|
||||
}
|
||||
|
||||
inline u32 _rotr(u32 x, int shift)
|
||||
{
|
||||
shift &= 31;
|
||||
if (!shift) return x;
|
||||
if (!shift)
|
||||
return x;
|
||||
return (x >> shift) | (x << (32 - shift));
|
||||
}
|
||||
#endif
|
||||
|
@ -70,24 +75,26 @@ inline u64 _rotr64(u64 x, unsigned int shift)
|
|||
|
||||
#else // WIN32
|
||||
// Function Cross-Compatibility
|
||||
#define strcasecmp _stricmp
|
||||
#define strncasecmp _strnicmp
|
||||
#define unlink _unlink
|
||||
#define vscprintf _vscprintf
|
||||
#define strcasecmp _stricmp
|
||||
#define strncasecmp _strnicmp
|
||||
#define unlink _unlink
|
||||
#define vscprintf _vscprintf
|
||||
|
||||
// 64 bit offsets for Windows
|
||||
#define fseeko _fseeki64
|
||||
#define ftello _ftelli64
|
||||
#define atoll _atoi64
|
||||
#define stat64 _stat64
|
||||
#define fstat64 _fstat64
|
||||
#define fileno _fileno
|
||||
#define fseeko _fseeki64
|
||||
#define ftello _ftelli64
|
||||
#define atoll _atoi64
|
||||
#define stat64 _stat64
|
||||
#define fstat64 _fstat64
|
||||
#define fileno _fileno
|
||||
|
||||
extern "C"
|
||||
{
|
||||
__declspec(dllimport) void __stdcall DebugBreak(void);
|
||||
extern "C" {
|
||||
__declspec(dllimport) void __stdcall DebugBreak(void);
|
||||
}
|
||||
#define Crash() {DebugBreak();}
|
||||
#define Crash() \
|
||||
{ \
|
||||
DebugBreak(); \
|
||||
}
|
||||
#endif // WIN32 ndef
|
||||
|
||||
// Generic function to get last error message.
|
||||
|
@ -98,8 +105,14 @@ std::string GetLastErrorMsg();
|
|||
|
||||
namespace Common
|
||||
{
|
||||
inline u8 swap8(u8 _data) {return _data;}
|
||||
inline u32 swap24(const u8* _data) {return (_data[0] << 16) | (_data[1] << 8) | _data[2];}
|
||||
inline u8 swap8(u8 _data)
|
||||
{
|
||||
return _data;
|
||||
}
|
||||
inline u32 swap24(const u8* _data)
|
||||
{
|
||||
return (_data[0] << 16) | (_data[1] << 8) | _data[2];
|
||||
}
|
||||
|
||||
#ifdef ANDROID
|
||||
#undef swap16
|
||||
|
@ -108,43 +121,95 @@ inline u32 swap24(const u8* _data) {return (_data[0] << 16) | (_data[1] << 8) |
|
|||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
inline u16 swap16(u16 _data) {return _byteswap_ushort(_data);}
|
||||
inline u32 swap32(u32 _data) {return _byteswap_ulong (_data);}
|
||||
inline u64 swap64(u64 _data) {return _byteswap_uint64(_data);}
|
||||
inline u16 swap16(u16 _data)
|
||||
{
|
||||
return _byteswap_ushort(_data);
|
||||
}
|
||||
inline u32 swap32(u32 _data)
|
||||
{
|
||||
return _byteswap_ulong(_data);
|
||||
}
|
||||
inline u64 swap64(u64 _data)
|
||||
{
|
||||
return _byteswap_uint64(_data);
|
||||
}
|
||||
#elif __linux__ && !(ANDROID && _M_ARM_64)
|
||||
// Android NDK r10c has broken builtin byte swap routines
|
||||
// Disabled for now.
|
||||
inline u16 swap16(u16 _data) {return bswap_16(_data);}
|
||||
inline u32 swap32(u32 _data) {return bswap_32(_data);}
|
||||
inline u64 swap64(u64 _data) {return bswap_64(_data);}
|
||||
inline u16 swap16(u16 _data)
|
||||
{
|
||||
return bswap_16(_data);
|
||||
}
|
||||
inline u32 swap32(u32 _data)
|
||||
{
|
||||
return bswap_32(_data);
|
||||
}
|
||||
inline u64 swap64(u64 _data)
|
||||
{
|
||||
return bswap_64(_data);
|
||||
}
|
||||
#elif __APPLE__
|
||||
inline __attribute__((always_inline)) u16 swap16(u16 _data)
|
||||
{return OSSwapInt16(_data);}
|
||||
{
|
||||
return OSSwapInt16(_data);
|
||||
}
|
||||
inline __attribute__((always_inline)) u32 swap32(u32 _data)
|
||||
{return OSSwapInt32(_data);}
|
||||
{
|
||||
return OSSwapInt32(_data);
|
||||
}
|
||||
inline __attribute__((always_inline)) u64 swap64(u64 _data)
|
||||
{return OSSwapInt64(_data);}
|
||||
{
|
||||
return OSSwapInt64(_data);
|
||||
}
|
||||
#elif __FreeBSD__
|
||||
inline u16 swap16(u16 _data) {return bswap16(_data);}
|
||||
inline u32 swap32(u32 _data) {return bswap32(_data);}
|
||||
inline u64 swap64(u64 _data) {return bswap64(_data);}
|
||||
inline u16 swap16(u16 _data)
|
||||
{
|
||||
return bswap16(_data);
|
||||
}
|
||||
inline u32 swap32(u32 _data)
|
||||
{
|
||||
return bswap32(_data);
|
||||
}
|
||||
inline u64 swap64(u64 _data)
|
||||
{
|
||||
return bswap64(_data);
|
||||
}
|
||||
#else
|
||||
// Slow generic implementation.
|
||||
inline u16 swap16(u16 data) {return (data >> 8) | (data << 8);}
|
||||
inline u32 swap32(u32 data) {return (swap16(data) << 16) | swap16(data >> 16);}
|
||||
inline u64 swap64(u64 data) {return ((u64)swap32(data) << 32) | swap32(data >> 32);}
|
||||
inline u16 swap16(u16 data)
|
||||
{
|
||||
return (data >> 8) | (data << 8);
|
||||
}
|
||||
inline u32 swap32(u32 data)
|
||||
{
|
||||
return (swap16(data) << 16) | swap16(data >> 16);
|
||||
}
|
||||
inline u64 swap64(u64 data)
|
||||
{
|
||||
return ((u64)swap32(data) << 32) | swap32(data >> 32);
|
||||
}
|
||||
#endif
|
||||
|
||||
inline u16 swap16(const u8* _pData) {return swap16(*(const u16*)_pData);}
|
||||
inline u32 swap32(const u8* _pData) {return swap32(*(const u32*)_pData);}
|
||||
inline u64 swap64(const u8* _pData) {return swap64(*(const u64*)_pData);}
|
||||
inline u16 swap16(const u8* _pData)
|
||||
{
|
||||
return swap16(*(const u16*)_pData);
|
||||
}
|
||||
inline u32 swap32(const u8* _pData)
|
||||
{
|
||||
return swap32(*(const u32*)_pData);
|
||||
}
|
||||
inline u64 swap64(const u8* _pData)
|
||||
{
|
||||
return swap64(*(const u64*)_pData);
|
||||
}
|
||||
|
||||
template <int count>
|
||||
void swap(u8*);
|
||||
|
||||
template <>
|
||||
inline void swap<1>(u8* data)
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
template <>
|
||||
inline void swap<2>(u8* data)
|
||||
|
|
|
@ -11,35 +11,35 @@
|
|||
// The user data dir
|
||||
#define ROOT_DIR "."
|
||||
#ifdef _WIN32
|
||||
#define USERDATA_DIR "User"
|
||||
#define DOLPHIN_DATA_DIR "Dolphin"
|
||||
#define USERDATA_DIR "User"
|
||||
#define DOLPHIN_DATA_DIR "Dolphin"
|
||||
#elif defined __APPLE__
|
||||
// On OS X, USERDATA_DIR exists within the .app, but *always* reference
|
||||
// the copy in Application Support instead! (Copied on first run)
|
||||
// You can use the File::GetUserPath() util for this
|
||||
#define USERDATA_DIR "Contents/Resources/User"
|
||||
#define DOLPHIN_DATA_DIR "Library/Application Support/Dolphin"
|
||||
// On OS X, USERDATA_DIR exists within the .app, but *always* reference
|
||||
// the copy in Application Support instead! (Copied on first run)
|
||||
// You can use the File::GetUserPath() util for this
|
||||
#define USERDATA_DIR "Contents/Resources/User"
|
||||
#define DOLPHIN_DATA_DIR "Library/Application Support/Dolphin"
|
||||
#elif defined ANDROID
|
||||
#define USERDATA_DIR "user"
|
||||
#define DOLPHIN_DATA_DIR "/sdcard/dolphin-emu"
|
||||
#define USERDATA_DIR "user"
|
||||
#define DOLPHIN_DATA_DIR "/sdcard/dolphin-emu"
|
||||
#else
|
||||
#define USERDATA_DIR "user"
|
||||
#define DOLPHIN_DATA_DIR "dolphin-emu"
|
||||
#define USERDATA_DIR "user"
|
||||
#define DOLPHIN_DATA_DIR "dolphin-emu"
|
||||
#endif
|
||||
|
||||
// Shared data dirs (Sys and shared User for Linux)
|
||||
#if defined(_WIN32) || defined(LINUX_LOCAL_DEV)
|
||||
#define SYSDATA_DIR "Sys"
|
||||
#define SYSDATA_DIR "Sys"
|
||||
#elif defined __APPLE__
|
||||
#define SYSDATA_DIR "Contents/Resources/Sys"
|
||||
#define SYSDATA_DIR "Contents/Resources/Sys"
|
||||
#elif defined ANDROID
|
||||
#define SYSDATA_DIR "/sdcard/dolphin-emu"
|
||||
#define SYSDATA_DIR "/sdcard/dolphin-emu"
|
||||
#else
|
||||
#ifdef DATA_DIR
|
||||
#define SYSDATA_DIR DATA_DIR "sys"
|
||||
#else
|
||||
#define SYSDATA_DIR "sys"
|
||||
#endif
|
||||
#ifdef DATA_DIR
|
||||
#define SYSDATA_DIR DATA_DIR "sys"
|
||||
#else
|
||||
#define SYSDATA_DIR "sys"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Dirs in both User and Sys
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
|
||||
// This header contains type definitions that are shared between the Dolphin core and
|
||||
// other parts of the code. Any definitions that are only used by the core should be
|
||||
// placed in "Common.h" instead.
|
||||
|
|
|
@ -22,7 +22,8 @@ int bn_compare(const u8* a, const u8* b, u32 n)
|
|||
{
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
if (a[i] < b[i])
|
||||
return -1;
|
||||
if (a[i] > b[i])
|
||||
|
@ -39,7 +40,8 @@ void bn_sub_modulus(u8* a, const u8* N, u32 n)
|
|||
u8 c;
|
||||
|
||||
c = 0;
|
||||
for (i = n - 1; i < n; i--) {
|
||||
for (i = n - 1; i < n; i--)
|
||||
{
|
||||
dig = N[i] + c;
|
||||
c = (a[i] < dig);
|
||||
a[i] -= dig;
|
||||
|
@ -53,7 +55,8 @@ void bn_add(u8* d, const u8* a, const u8* b, const u8* N, u32 n)
|
|||
u8 c;
|
||||
|
||||
c = 0;
|
||||
for (i = n - 1; i < n; i--) {
|
||||
for (i = n - 1; i < n; i--)
|
||||
{
|
||||
dig = a[i] + b[i] + c;
|
||||
c = (dig >= 0x100);
|
||||
d[i] = dig;
|
||||
|
@ -74,7 +77,8 @@ void bn_mul(u8* d, const u8* a, const u8* b, const u8* N, u32 n)
|
|||
bn_zero(d, n);
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
for (mask = 0x80; mask != 0; mask >>= 1) {
|
||||
for (mask = 0x80; mask != 0; mask >>= 1)
|
||||
{
|
||||
bn_add(d, d, d, N, n);
|
||||
if ((a[i] & mask) != 0)
|
||||
bn_add(d, d, b, N, n);
|
||||
|
@ -88,9 +92,10 @@ void bn_exp(u8* d, const u8* a, const u8* N, u32 n, const u8* e, u32 en)
|
|||
u8 mask;
|
||||
|
||||
bn_zero(d, n);
|
||||
d[n-1] = 1;
|
||||
d[n - 1] = 1;
|
||||
for (i = 0; i < en; i++)
|
||||
for (mask = 0x80; mask != 0; mask >>= 1) {
|
||||
for (mask = 0x80; mask != 0; mask >>= 1)
|
||||
{
|
||||
bn_mul(t, d, d, N, n);
|
||||
if ((e[i] & mask) != 0)
|
||||
bn_mul(d, t, a, N, n);
|
||||
|
@ -106,7 +111,7 @@ void bn_inv(u8* d, const u8* a, const u8* N, u32 n)
|
|||
|
||||
bn_copy(t, N, n);
|
||||
bn_zero(s, n);
|
||||
s[n-1] = 2;
|
||||
s[n - 1] = 2;
|
||||
bn_sub_modulus(t, s, n);
|
||||
bn_exp(d, a, N, n, t, n);
|
||||
}
|
||||
|
|
|
@ -16,21 +16,21 @@
|
|||
#include "Common/Crypto/ec.h"
|
||||
|
||||
// y**2 + x*y = x**3 + x + b
|
||||
UNUSED static const u8 ec_b[30] =
|
||||
{0x00,0x66,0x64,0x7e,0xde,0x6c,0x33,0x2c,0x7f,0x8c,0x09,0x23,0xbb,0x58,0x21
|
||||
,0x3b,0x33,0x3b,0x20,0xe9,0xce,0x42,0x81,0xfe,0x11,0x5f,0x7d,0x8f,0x90,0xad};
|
||||
UNUSED static const u8 ec_b[30] = {0x00, 0x66, 0x64, 0x7e, 0xde, 0x6c, 0x33, 0x2c, 0x7f, 0x8c,
|
||||
0x09, 0x23, 0xbb, 0x58, 0x21, 0x3b, 0x33, 0x3b, 0x20, 0xe9,
|
||||
0xce, 0x42, 0x81, 0xfe, 0x11, 0x5f, 0x7d, 0x8f, 0x90, 0xad};
|
||||
|
||||
// order of the addition group of points
|
||||
static const u8 ec_N[30] =
|
||||
{0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x13,0xe9,0x74,0xe7,0x2f,0x8a,0x69,0x22,0x03,0x1d,0x26,0x03,0xcf,0xe0,0xd7};
|
||||
static const u8 ec_N[30] = {0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0xe9, 0x74, 0xe7, 0x2f,
|
||||
0x8a, 0x69, 0x22, 0x03, 0x1d, 0x26, 0x03, 0xcf, 0xe0, 0xd7};
|
||||
|
||||
// base point
|
||||
static const u8 ec_G[60] =
|
||||
{0x00,0xfa,0xc9,0xdf,0xcb,0xac,0x83,0x13,0xbb,0x21,0x39,0xf1,0xbb,0x75,0x5f
|
||||
,0xef,0x65,0xbc,0x39,0x1f,0x8b,0x36,0xf8,0xf8,0xeb,0x73,0x71,0xfd,0x55,0x8b
|
||||
,0x01,0x00,0x6a,0x08,0xa4,0x19,0x03,0x35,0x06,0x78,0xe5,0x85,0x28,0xbe,0xbf
|
||||
,0x8a,0x0b,0xef,0xf8,0x67,0xa7,0xca,0x36,0x71,0x6f,0x7e,0x01,0xf8,0x10,0x52};
|
||||
static const u8 ec_G[60] = {0x00, 0xfa, 0xc9, 0xdf, 0xcb, 0xac, 0x83, 0x13, 0xbb, 0x21, 0x39, 0xf1,
|
||||
0xbb, 0x75, 0x5f, 0xef, 0x65, 0xbc, 0x39, 0x1f, 0x8b, 0x36, 0xf8, 0xf8,
|
||||
0xeb, 0x73, 0x71, 0xfd, 0x55, 0x8b, 0x01, 0x00, 0x6a, 0x08, 0xa4, 0x19,
|
||||
0x03, 0x35, 0x06, 0x78, 0xe5, 0x85, 0x28, 0xbe, 0xbf, 0x8a, 0x0b, 0xef,
|
||||
0xf8, 0x67, 0xa7, 0xca, 0x36, 0x71, 0x6f, 0x7e, 0x01, 0xf8, 0x10, 0x52};
|
||||
|
||||
static void elt_copy(u8* d, const u8* a)
|
||||
{
|
||||
|
@ -69,7 +69,8 @@ static void elt_mul_x(u8* d, const u8* a)
|
|||
carry = a[0] & 1;
|
||||
|
||||
x = 0;
|
||||
for (i = 0; i < 29; i++) {
|
||||
for (i = 0; i < 29; i++)
|
||||
{
|
||||
y = a[i + 1];
|
||||
d[i] = x ^ (y >> 7);
|
||||
x = y << 1;
|
||||
|
@ -88,30 +89,33 @@ static void elt_mul(u8* d, const u8* a, const u8* b)
|
|||
|
||||
i = 0;
|
||||
mask = 1;
|
||||
for (n = 0; n < 233; n++) {
|
||||
for (n = 0; n < 233; n++)
|
||||
{
|
||||
elt_mul_x(d, d);
|
||||
|
||||
if ((a[i] & mask) != 0)
|
||||
elt_add(d, d, b);
|
||||
|
||||
mask >>= 1;
|
||||
if (mask == 0) {
|
||||
if (mask == 0)
|
||||
{
|
||||
mask = 0x80;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static const u8 square[16] =
|
||||
{0x00,0x01,0x04,0x05,0x10,0x11,0x14,0x15,0x40,0x41,0x44,0x45,0x50,0x51,0x54,0x55};
|
||||
static const u8 square[16] = {0x00, 0x01, 0x04, 0x05, 0x10, 0x11, 0x14, 0x15,
|
||||
0x40, 0x41, 0x44, 0x45, 0x50, 0x51, 0x54, 0x55};
|
||||
|
||||
static void elt_square_to_wide(u8* d, const u8* a)
|
||||
{
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < 30; i++) {
|
||||
d[2*i] = square[a[i] >> 4];
|
||||
d[2*i + 1] = square[a[i] & 15];
|
||||
for (i = 0; i < 30; i++)
|
||||
{
|
||||
d[2 * i] = square[a[i] >> 4];
|
||||
d[2 * i + 1] = square[a[i] & 15];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -120,7 +124,8 @@ static void wide_reduce(u8* d)
|
|||
u32 i;
|
||||
u8 x;
|
||||
|
||||
for (i = 0; i < 30; i++) {
|
||||
for (i = 0; i < 30; i++)
|
||||
{
|
||||
x = d[i];
|
||||
|
||||
d[i + 19] ^= x >> 7;
|
||||
|
@ -155,7 +160,8 @@ static void itoh_tsujii(u8* d, const u8* a, const u8* b, u32 j)
|
|||
u8 t[30];
|
||||
|
||||
elt_copy(t, a);
|
||||
while (j--) {
|
||||
while (j--)
|
||||
{
|
||||
elt_square(d, t);
|
||||
elt_copy(t, d);
|
||||
}
|
||||
|
@ -184,7 +190,7 @@ static void elt_inv(u8* d, const u8* a)
|
|||
UNUSED static int point_is_on_curve(u8* p)
|
||||
{
|
||||
u8 s[30], t[30];
|
||||
u8* x, *y;
|
||||
u8 *x, *y;
|
||||
|
||||
x = p;
|
||||
y = p + 30;
|
||||
|
@ -213,15 +219,16 @@ static int point_is_zero(const u8* p)
|
|||
static void point_double(u8* r, const u8* p)
|
||||
{
|
||||
u8 s[30], t[30];
|
||||
const u8* px, *py;
|
||||
u8* rx, *ry;
|
||||
const u8 *px, *py;
|
||||
u8 *rx, *ry;
|
||||
|
||||
px = p;
|
||||
py = p + 30;
|
||||
rx = r;
|
||||
ry = r + 30;
|
||||
|
||||
if (elt_is_zero(px)) {
|
||||
if (elt_is_zero(px))
|
||||
{
|
||||
elt_zero(rx);
|
||||
elt_zero(ry);
|
||||
|
||||
|
@ -246,8 +253,8 @@ static void point_double(u8* r, const u8* p)
|
|||
static void point_add(u8* r, const u8* p, const u8* q)
|
||||
{
|
||||
u8 s[30], t[30], u[30];
|
||||
const u8* px, *py, *qx, *qy;
|
||||
u8* rx, *ry;
|
||||
const u8 *px, *py, *qx, *qy;
|
||||
u8 *rx, *ry;
|
||||
|
||||
px = p;
|
||||
py = p + 30;
|
||||
|
@ -256,13 +263,15 @@ static void point_add(u8* r, const u8* p, const u8* q)
|
|||
rx = r;
|
||||
ry = r + 30;
|
||||
|
||||
if (point_is_zero(p)) {
|
||||
if (point_is_zero(p))
|
||||
{
|
||||
elt_copy(rx, qx);
|
||||
elt_copy(ry, qy);
|
||||
return;
|
||||
}
|
||||
|
||||
if (point_is_zero(q)) {
|
||||
if (point_is_zero(q))
|
||||
{
|
||||
elt_copy(rx, px);
|
||||
elt_copy(ry, py);
|
||||
return;
|
||||
|
@ -270,11 +279,13 @@ static void point_add(u8* r, const u8* p, const u8* q)
|
|||
|
||||
elt_add(u, px, qx);
|
||||
|
||||
if (elt_is_zero(u)) {
|
||||
if (elt_is_zero(u))
|
||||
{
|
||||
elt_add(u, py, qy);
|
||||
if (elt_is_zero(u))
|
||||
point_double(r, p);
|
||||
else {
|
||||
else
|
||||
{
|
||||
elt_zero(rx);
|
||||
elt_zero(ry);
|
||||
}
|
||||
|
@ -306,21 +317,22 @@ static void point_mul(u8* d, const u8* a, const u8* b) // a is bignum
|
|||
elt_zero(d + 30);
|
||||
|
||||
for (i = 0; i < 30; i++)
|
||||
for (mask = 0x80; mask != 0; mask >>= 1) {
|
||||
for (mask = 0x80; mask != 0; mask >>= 1)
|
||||
{
|
||||
point_double(d, d);
|
||||
if ((a[i] & mask) != 0)
|
||||
point_add(d, d, b);
|
||||
}
|
||||
}
|
||||
|
||||
static void silly_random(u8 * rndArea, u8 count)
|
||||
static void silly_random(u8* rndArea, u8 count)
|
||||
{
|
||||
u16 i;
|
||||
srand((unsigned) (time(nullptr)));
|
||||
srand((unsigned)(time(nullptr)));
|
||||
|
||||
for (i=0;i<count;i++)
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
rndArea[i]=rand();
|
||||
rndArea[i] = rand();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -331,17 +343,17 @@ void generate_ecdsa(u8* R, u8* S, const u8* k, const u8* hash)
|
|||
u8 m[30];
|
||||
u8 minv[30];
|
||||
u8 mG[60];
|
||||
//FILE *fp;
|
||||
// FILE *fp;
|
||||
|
||||
elt_zero(e);
|
||||
memcpy(e + 10, hash, 20);
|
||||
|
||||
//Changing random number generator to a lame one...
|
||||
// Changing random number generator to a lame one...
|
||||
silly_random(m, sizeof(m));
|
||||
//fp = fopen("/dev/random", "rb");
|
||||
//if (fread(m, sizeof m, 1, fp) != 1)
|
||||
// fp = fopen("/dev/random", "rb");
|
||||
// if (fread(m, sizeof m, 1, fp) != 1)
|
||||
// fatal("reading random");
|
||||
//fclose(fp);
|
||||
// fclose(fp);
|
||||
m[0] = 0;
|
||||
|
||||
// R = (mG).x
|
||||
|
|
|
@ -11,30 +11,33 @@ class DebugInterface
|
|||
{
|
||||
protected:
|
||||
virtual ~DebugInterface() {}
|
||||
|
||||
public:
|
||||
virtual std::string Disassemble(unsigned int /*address*/) { return "NODEBUGGER"; }
|
||||
virtual void GetRawMemoryString(int /*memory*/, unsigned int /*address*/, char* dest, int /*max_size*/) {strcpy(dest, "NODEBUGGER");}
|
||||
virtual int GetInstructionSize(int /*instruction*/) {return 1;}
|
||||
virtual bool IsAlive() {return true;}
|
||||
virtual bool IsBreakpoint(unsigned int /*address*/) {return false;}
|
||||
virtual void SetBreakpoint(unsigned int /*address*/){}
|
||||
virtual void ClearBreakpoint(unsigned int /*address*/){}
|
||||
virtual void GetRawMemoryString(int /*memory*/, unsigned int /*address*/, char* dest,
|
||||
int /*max_size*/)
|
||||
{
|
||||
strcpy(dest, "NODEBUGGER");
|
||||
}
|
||||
virtual int GetInstructionSize(int /*instruction*/) { return 1; }
|
||||
virtual bool IsAlive() { return true; }
|
||||
virtual bool IsBreakpoint(unsigned int /*address*/) { return false; }
|
||||
virtual void SetBreakpoint(unsigned int /*address*/) {}
|
||||
virtual void ClearBreakpoint(unsigned int /*address*/) {}
|
||||
virtual void ClearAllBreakpoints() {}
|
||||
virtual void ToggleBreakpoint(unsigned int /*address*/){}
|
||||
virtual void AddWatch(unsigned int /*address*/){}
|
||||
virtual void ToggleBreakpoint(unsigned int /*address*/) {}
|
||||
virtual void AddWatch(unsigned int /*address*/) {}
|
||||
virtual void ClearAllMemChecks() {}
|
||||
virtual bool IsMemCheck(unsigned int /*address*/) {return false;}
|
||||
virtual void ToggleMemCheck(unsigned int /*address*/){}
|
||||
virtual unsigned int ReadMemory(unsigned int /*address*/){return 0;}
|
||||
virtual bool IsMemCheck(unsigned int /*address*/) { return false; }
|
||||
virtual void ToggleMemCheck(unsigned int /*address*/) {}
|
||||
virtual unsigned int ReadMemory(unsigned int /*address*/) { return 0; }
|
||||
virtual void WriteExtraMemory(int /*memory*/, unsigned int /*value*/, unsigned int /*address*/) {}
|
||||
virtual unsigned int ReadExtraMemory(int /*memory*/, unsigned int /*address*/){return 0;}
|
||||
virtual unsigned int ReadInstruction(unsigned int /*address*/){return 0;}
|
||||
virtual unsigned int GetPC() {return 0;}
|
||||
virtual unsigned int ReadExtraMemory(int /*memory*/, unsigned int /*address*/) { return 0; }
|
||||
virtual unsigned int ReadInstruction(unsigned int /*address*/) { return 0; }
|
||||
virtual unsigned int GetPC() { return 0; }
|
||||
virtual void SetPC(unsigned int /*address*/) {}
|
||||
virtual void Step() {}
|
||||
virtual void RunToBreakpoint() {}
|
||||
virtual void InsertBLR(unsigned int /*address*/, unsigned int /*value*/) {}
|
||||
virtual int GetColor(unsigned int /*address*/){return 0xFFFFFFFF;}
|
||||
virtual int GetColor(unsigned int /*address*/) { return 0xFFFFFFFF; }
|
||||
virtual std::string GetDescription(unsigned int /*address*/) = 0;
|
||||
};
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
|
||||
namespace ENetUtil
|
||||
{
|
||||
|
||||
void WakeupThread(ENetHost* host)
|
||||
{
|
||||
// Send ourselves a spurious message. This is hackier than it should be.
|
||||
|
@ -32,11 +31,9 @@ int ENET_CALLBACK InterceptCallback(ENetHost* host, ENetEvent* event)
|
|||
// wakeup packet received
|
||||
if (host->receivedDataLength == 1 && host->receivedData[0] == 0)
|
||||
{
|
||||
event->type = (ENetEventType) 42;
|
||||
event->type = (ENetEventType)42;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
|
||||
namespace ENetUtil
|
||||
{
|
||||
|
||||
void WakeupThread(ENetHost* host);
|
||||
int ENET_CALLBACK InterceptCallback(ENetHost* host, ENetEvent* event);
|
||||
|
||||
}
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
|
||||
#include "Common/Flag.h"
|
||||
|
||||
namespace Common {
|
||||
|
||||
namespace Common
|
||||
{
|
||||
class Event final
|
||||
{
|
||||
public:
|
||||
|
@ -42,18 +42,17 @@ public:
|
|||
return;
|
||||
|
||||
std::unique_lock<std::mutex> lk(m_mutex);
|
||||
m_condvar.wait(lk, [&]{ return m_flag.TestAndClear(); });
|
||||
m_condvar.wait(lk, [&] { return m_flag.TestAndClear(); });
|
||||
}
|
||||
|
||||
template<class Rep, class Period>
|
||||
template <class Rep, class Period>
|
||||
bool WaitFor(const std::chrono::duration<Rep, Period>& rel_time)
|
||||
{
|
||||
if (m_flag.TestAndClear())
|
||||
return true;
|
||||
|
||||
std::unique_lock<std::mutex> lk(m_mutex);
|
||||
bool signaled = m_condvar.wait_for(lk, rel_time,
|
||||
[&]{ return m_flag.TestAndClear(); });
|
||||
bool signaled = m_condvar.wait_for(lk, rel_time, [&] { return m_flag.TestAndClear(); });
|
||||
|
||||
return signaled;
|
||||
}
|
||||
|
|
|
@ -8,29 +8,30 @@
|
|||
|
||||
namespace FPURoundMode
|
||||
{
|
||||
// TODO: MSVC currently produces broken code:
|
||||
// https://connect.microsoft.com/VisualStudio/feedback/details/828892/vc-2013-miscompilation-with-enums-and-bit-fields
|
||||
// Once that is fixed, change types in SetRoundMode(), SetSIMDMode(), and in UReg_FPSCR to 'RoundMode'.
|
||||
// TODO: MSVC currently produces broken code:
|
||||
// https://connect.microsoft.com/VisualStudio/feedback/details/828892/vc-2013-miscompilation-with-enums-and-bit-fields
|
||||
// Once that is fixed, change types in SetRoundMode(), SetSIMDMode(), and in UReg_FPSCR to
|
||||
// 'RoundMode'.
|
||||
|
||||
enum RoundMode
|
||||
{
|
||||
enum RoundMode
|
||||
{
|
||||
ROUND_NEAR = 0,
|
||||
ROUND_CHOP = 1,
|
||||
ROUND_UP = 2,
|
||||
ROUND_DOWN = 3
|
||||
};
|
||||
enum PrecisionMode
|
||||
{
|
||||
};
|
||||
enum PrecisionMode
|
||||
{
|
||||
PREC_24 = 0,
|
||||
PREC_53 = 1,
|
||||
PREC_64 = 2
|
||||
};
|
||||
};
|
||||
|
||||
void SetRoundMode(int mode);
|
||||
void SetRoundMode(int mode);
|
||||
|
||||
void SetPrecisionMode(PrecisionMode mode);
|
||||
void SetPrecisionMode(PrecisionMode mode);
|
||||
|
||||
void SetSIMDMode(int rounding_mode, bool non_ieee_mode);
|
||||
void SetSIMDMode(int rounding_mode, bool non_ieee_mode);
|
||||
|
||||
/*
|
||||
* There are two different flavors of float to int conversion:
|
||||
|
@ -39,7 +40,7 @@ namespace FPURoundMode
|
|||
* The first rounds according to the MXCSR rounding bits.
|
||||
* The second one always uses round towards zero.
|
||||
*/
|
||||
void SaveSIMDState();
|
||||
void LoadSIMDState();
|
||||
void LoadDefaultSIMDState();
|
||||
void SaveSIMDState();
|
||||
void LoadSIMDState();
|
||||
void LoadDefaultSIMDState();
|
||||
}
|
||||
|
|
|
@ -15,16 +15,11 @@
|
|||
|
||||
namespace Common
|
||||
{
|
||||
|
||||
template <typename T, bool NeedSize = true>
|
||||
class FifoQueue
|
||||
{
|
||||
public:
|
||||
FifoQueue() : m_size(0)
|
||||
{
|
||||
m_write_ptr = m_read_ptr = new ElementPtr();
|
||||
}
|
||||
|
||||
FifoQueue() : m_size(0) { m_write_ptr = m_read_ptr = new ElementPtr(); }
|
||||
~FifoQueue()
|
||||
{
|
||||
// this will empty out the whole queue
|
||||
|
@ -37,16 +32,8 @@ public:
|
|||
return m_size.load();
|
||||
}
|
||||
|
||||
bool Empty() const
|
||||
{
|
||||
return !m_read_ptr->next.load();
|
||||
}
|
||||
|
||||
T& Front() const
|
||||
{
|
||||
return m_read_ptr->current;
|
||||
}
|
||||
|
||||
bool Empty() const { return !m_read_ptr->next.load(); }
|
||||
T& Front() const { return m_read_ptr->current; }
|
||||
template <typename Arg>
|
||||
void Push(Arg&& t)
|
||||
{
|
||||
|
@ -104,7 +91,6 @@ private:
|
|||
{
|
||||
public:
|
||||
ElementPtr() : next(nullptr) {}
|
||||
|
||||
~ElementPtr()
|
||||
{
|
||||
ElementPtr* next_ptr = next.load();
|
||||
|
@ -121,5 +107,4 @@ private:
|
|||
ElementPtr* m_read_ptr;
|
||||
std::atomic<u32> m_size;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -9,7 +9,9 @@
|
|||
#include "Common/FileSearch.h"
|
||||
#include "Common/FileUtil.h"
|
||||
|
||||
static std::vector<std::string> FileSearchWithTest(const std::vector<std::string>& directories, bool recursive, std::function<bool(const File::FSTEntry &)> callback)
|
||||
static std::vector<std::string>
|
||||
FileSearchWithTest(const std::vector<std::string>& directories, bool recursive,
|
||||
std::function<bool(const File::FSTEntry&)> callback)
|
||||
{
|
||||
std::vector<std::string> result;
|
||||
for (const std::string& directory : directories)
|
||||
|
@ -32,7 +34,8 @@ static std::vector<std::string> FileSearchWithTest(const std::vector<std::string
|
|||
return result;
|
||||
}
|
||||
|
||||
std::vector<std::string> DoFileSearch(const std::vector<std::string>& exts, const std::vector<std::string>& directories, bool recursive)
|
||||
std::vector<std::string> DoFileSearch(const std::vector<std::string>& exts,
|
||||
const std::vector<std::string>& directories, bool recursive)
|
||||
{
|
||||
bool accept_all = std::find(exts.begin(), exts.end(), "") != exts.end();
|
||||
return FileSearchWithTest(directories, recursive, [&](const File::FSTEntry& entry) {
|
||||
|
@ -41,15 +44,16 @@ std::vector<std::string> DoFileSearch(const std::vector<std::string>& exts, cons
|
|||
std::string name = entry.virtualName;
|
||||
std::transform(name.begin(), name.end(), name.begin(), ::tolower);
|
||||
return std::any_of(exts.begin(), exts.end(), [&](const std::string& ext) {
|
||||
return name.length() >= ext.length() && name.compare(name.length() - ext.length(), ext.length(), ext) == 0;
|
||||
return name.length() >= ext.length() &&
|
||||
name.compare(name.length() - ext.length(), ext.length(), ext) == 0;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Result includes the passed directories themselves as well as their subdirectories.
|
||||
std::vector<std::string> FindSubdirectories(const std::vector<std::string>& directories, bool recursive)
|
||||
std::vector<std::string> FindSubdirectories(const std::vector<std::string>& directories,
|
||||
bool recursive)
|
||||
{
|
||||
return FileSearchWithTest(directories, true, [&](const File::FSTEntry& entry) {
|
||||
return entry.isDirectory;
|
||||
});
|
||||
return FileSearchWithTest(directories, true,
|
||||
[&](const File::FSTEntry& entry) { return entry.isDirectory; });
|
||||
}
|
||||
|
|
|
@ -7,5 +7,8 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
std::vector<std::string> DoFileSearch(const std::vector<std::string>& exts, const std::vector<std::string>& directories, bool recursive = false);
|
||||
std::vector<std::string> FindSubdirectories(const std::vector<std::string>& directories, bool recursive);
|
||||
std::vector<std::string> DoFileSearch(const std::vector<std::string>& exts,
|
||||
const std::vector<std::string>& directories,
|
||||
bool recursive = false);
|
||||
std::vector<std::string> FindSubdirectories(const std::vector<std::string>& directories,
|
||||
bool recursive);
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
#include <fcntl.h>
|
||||
#include <limits.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <sys/stat.h>
|
||||
#include <vector>
|
||||
|
||||
#include "Common/Common.h"
|
||||
#include "Common/CommonFuncs.h"
|
||||
|
@ -55,7 +55,6 @@
|
|||
// REMEMBER: strdup considered harmful!
|
||||
namespace File
|
||||
{
|
||||
|
||||
// Remove any ending forward slashes from directory paths
|
||||
// Modifies argument.
|
||||
static void StripTailDirSlashes(std::string& fname)
|
||||
|
@ -100,8 +99,8 @@ bool IsDirectory(const std::string& filename)
|
|||
|
||||
if (result < 0)
|
||||
{
|
||||
WARN_LOG(COMMON, "IsDirectory: stat failed on %s: %s",
|
||||
filename.c_str(), GetLastErrorMsg().c_str());
|
||||
WARN_LOG(COMMON, "IsDirectory: stat failed on %s: %s", filename.c_str(),
|
||||
GetLastErrorMsg().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -132,15 +131,15 @@ bool Delete(const std::string& filename)
|
|||
#ifdef _WIN32
|
||||
if (!DeleteFile(UTF8ToTStr(filename).c_str()))
|
||||
{
|
||||
WARN_LOG(COMMON, "Delete: DeleteFile failed on %s: %s",
|
||||
filename.c_str(), GetLastErrorMsg().c_str());
|
||||
WARN_LOG(COMMON, "Delete: DeleteFile failed on %s: %s", filename.c_str(),
|
||||
GetLastErrorMsg().c_str());
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
if (unlink(filename.c_str()) == -1)
|
||||
{
|
||||
WARN_LOG(COMMON, "Delete: unlink failed on %s: %s",
|
||||
filename.c_str(), GetLastErrorMsg().c_str());
|
||||
WARN_LOG(COMMON, "Delete: unlink failed on %s: %s", filename.c_str(),
|
||||
GetLastErrorMsg().c_str());
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -218,7 +217,6 @@ bool CreateFullPath(const std::string& fullPath)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// Deletes a directory filename, returns true on success
|
||||
bool DeleteDir(const std::string& filename)
|
||||
{
|
||||
|
@ -246,14 +244,14 @@ bool DeleteDir(const std::string& filename)
|
|||
// renames file srcFilename to destFilename, returns true on success
|
||||
bool Rename(const std::string& srcFilename, const std::string& destFilename)
|
||||
{
|
||||
INFO_LOG(COMMON, "Rename: %s --> %s",
|
||||
srcFilename.c_str(), destFilename.c_str());
|
||||
INFO_LOG(COMMON, "Rename: %s --> %s", srcFilename.c_str(), destFilename.c_str());
|
||||
#ifdef _WIN32
|
||||
auto sf = UTF8ToTStr(srcFilename);
|
||||
auto df = UTF8ToTStr(destFilename);
|
||||
// The Internet seems torn about whether ReplaceFile is atomic or not.
|
||||
// Hopefully it's atomic enough...
|
||||
if (ReplaceFile(df.c_str(), sf.c_str(), nullptr, REPLACEFILE_IGNORE_MERGE_ERRORS, nullptr, nullptr))
|
||||
if (ReplaceFile(df.c_str(), sf.c_str(), nullptr, REPLACEFILE_IGNORE_MERGE_ERRORS, nullptr,
|
||||
nullptr))
|
||||
return true;
|
||||
// Might have failed because the destination doesn't exist.
|
||||
if (GetLastError() == ERROR_FILE_NOT_FOUND)
|
||||
|
@ -265,8 +263,8 @@ bool Rename(const std::string& srcFilename, const std::string& destFilename)
|
|||
if (rename(srcFilename.c_str(), destFilename.c_str()) == 0)
|
||||
return true;
|
||||
#endif
|
||||
ERROR_LOG(COMMON, "Rename: failed %s --> %s: %s",
|
||||
srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg().c_str());
|
||||
ERROR_LOG(COMMON, "Rename: failed %s --> %s: %s", srcFilename.c_str(), destFilename.c_str(),
|
||||
GetLastErrorMsg().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -308,18 +306,17 @@ bool RenameSync(const std::string& srcFilename, const std::string& destFilename)
|
|||
// copies file srcFilename to destFilename, returns true on success
|
||||
bool Copy(const std::string& srcFilename, const std::string& destFilename)
|
||||
{
|
||||
INFO_LOG(COMMON, "Copy: %s --> %s",
|
||||
srcFilename.c_str(), destFilename.c_str());
|
||||
INFO_LOG(COMMON, "Copy: %s --> %s", srcFilename.c_str(), destFilename.c_str());
|
||||
#ifdef _WIN32
|
||||
if (CopyFile(UTF8ToTStr(srcFilename).c_str(), UTF8ToTStr(destFilename).c_str(), FALSE))
|
||||
return true;
|
||||
|
||||
ERROR_LOG(COMMON, "Copy: failed %s --> %s: %s",
|
||||
srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg().c_str());
|
||||
ERROR_LOG(COMMON, "Copy: failed %s --> %s: %s", srcFilename.c_str(), destFilename.c_str(),
|
||||
GetLastErrorMsg().c_str());
|
||||
return false;
|
||||
#else
|
||||
|
||||
// buffer size
|
||||
// buffer size
|
||||
#define BSIZE 1024
|
||||
|
||||
char buffer[BSIZE];
|
||||
|
@ -329,8 +326,8 @@ bool Copy(const std::string& srcFilename, const std::string& destFilename)
|
|||
OpenFStream(input, srcFilename, std::ifstream::in | std::ifstream::binary);
|
||||
if (!input.is_open())
|
||||
{
|
||||
ERROR_LOG(COMMON, "Copy: input failed %s --> %s: %s",
|
||||
srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg().c_str());
|
||||
ERROR_LOG(COMMON, "Copy: input failed %s --> %s: %s", srcFilename.c_str(), destFilename.c_str(),
|
||||
GetLastErrorMsg().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -339,8 +336,8 @@ bool Copy(const std::string& srcFilename, const std::string& destFilename)
|
|||
|
||||
if (!output.IsOpen())
|
||||
{
|
||||
ERROR_LOG(COMMON, "Copy: output failed %s --> %s: %s",
|
||||
srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg().c_str());
|
||||
ERROR_LOG(COMMON, "Copy: output failed %s --> %s: %s", srcFilename.c_str(),
|
||||
destFilename.c_str(), GetLastErrorMsg().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -351,18 +348,16 @@ bool Copy(const std::string& srcFilename, const std::string& destFilename)
|
|||
input.read(buffer, BSIZE);
|
||||
if (!input)
|
||||
{
|
||||
ERROR_LOG(COMMON,
|
||||
"Copy: failed reading from source, %s --> %s: %s",
|
||||
srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg().c_str());
|
||||
ERROR_LOG(COMMON, "Copy: failed reading from source, %s --> %s: %s", srcFilename.c_str(),
|
||||
destFilename.c_str(), GetLastErrorMsg().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
// write output
|
||||
if (!output.WriteBytes(buffer, BSIZE))
|
||||
{
|
||||
ERROR_LOG(COMMON,
|
||||
"Copy: failed writing to output, %s --> %s: %s",
|
||||
srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg().c_str());
|
||||
ERROR_LOG(COMMON, "Copy: failed writing to output, %s --> %s: %s", srcFilename.c_str(),
|
||||
destFilename.c_str(), GetLastErrorMsg().c_str());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -393,13 +388,11 @@ u64 GetSize(const std::string& filename)
|
|||
if (stat64(filename.c_str(), &buf) == 0)
|
||||
#endif
|
||||
{
|
||||
DEBUG_LOG(COMMON, "GetSize: %s: %lld",
|
||||
filename.c_str(), (long long)buf.st_size);
|
||||
DEBUG_LOG(COMMON, "GetSize: %s: %lld", filename.c_str(), (long long)buf.st_size);
|
||||
return buf.st_size;
|
||||
}
|
||||
|
||||
ERROR_LOG(COMMON, "GetSize: Stat failed %s: %s",
|
||||
filename.c_str(), GetLastErrorMsg().c_str());
|
||||
ERROR_LOG(COMMON, "GetSize: Stat failed %s: %s", filename.c_str(), GetLastErrorMsg().c_str());
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -409,8 +402,7 @@ u64 GetSize(const int fd)
|
|||
struct stat64 buf;
|
||||
if (fstat64(fd, &buf) != 0)
|
||||
{
|
||||
ERROR_LOG(COMMON, "GetSize: stat failed %i: %s",
|
||||
fd, GetLastErrorMsg().c_str());
|
||||
ERROR_LOG(COMMON, "GetSize: stat failed %i: %s", fd, GetLastErrorMsg().c_str());
|
||||
return 0;
|
||||
}
|
||||
return buf.st_size;
|
||||
|
@ -423,16 +415,14 @@ u64 GetSize(FILE* f)
|
|||
u64 pos = ftello(f);
|
||||
if (fseeko(f, 0, SEEK_END) != 0)
|
||||
{
|
||||
ERROR_LOG(COMMON, "GetSize: seek failed %p: %s",
|
||||
f, GetLastErrorMsg().c_str());
|
||||
ERROR_LOG(COMMON, "GetSize: seek failed %p: %s", f, GetLastErrorMsg().c_str());
|
||||
return 0;
|
||||
}
|
||||
|
||||
u64 size = ftello(f);
|
||||
if ((size != pos) && (fseeko(f, pos, SEEK_SET) != 0))
|
||||
{
|
||||
ERROR_LOG(COMMON, "GetSize: seek failed %p: %s",
|
||||
f, GetLastErrorMsg().c_str());
|
||||
ERROR_LOG(COMMON, "GetSize: seek failed %p: %s", f, GetLastErrorMsg().c_str());
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -446,15 +436,14 @@ bool CreateEmptyFile(const std::string& filename)
|
|||
|
||||
if (!File::IOFile(filename, "wb"))
|
||||
{
|
||||
ERROR_LOG(COMMON, "CreateEmptyFile: failed %s: %s",
|
||||
filename.c_str(), GetLastErrorMsg().c_str());
|
||||
ERROR_LOG(COMMON, "CreateEmptyFile: failed %s: %s", filename.c_str(),
|
||||
GetLastErrorMsg().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Scans the directory tree gets, starting from _Directory and adds the
|
||||
// results into parentEntry. Returns the number of files+directories found
|
||||
FSTEntry ScanDirectoryTree(const std::string& directory, bool recursive)
|
||||
|
@ -490,7 +479,7 @@ FSTEntry ScanDirectoryTree(const std::string& directory, bool recursive)
|
|||
while (!readdir_r(dirp, &dirent, &result) && result)
|
||||
{
|
||||
const std::string virtual_name(result->d_name);
|
||||
#endif
|
||||
#endif
|
||||
if (virtual_name == "." || virtual_name == "..")
|
||||
continue;
|
||||
auto physical_name = directory + DIR_SEP + virtual_name;
|
||||
|
@ -514,7 +503,7 @@ FSTEntry ScanDirectoryTree(const std::string& directory, bool recursive)
|
|||
++parent_entry.size;
|
||||
// Push into the tree
|
||||
parent_entry.children.push_back(entry);
|
||||
#ifdef _WIN32
|
||||
#ifdef _WIN32
|
||||
} while (FindNextFile(hFind, &ffd) != 0);
|
||||
FindClose(hFind);
|
||||
#else
|
||||
|
@ -525,7 +514,6 @@ FSTEntry ScanDirectoryTree(const std::string& directory, bool recursive)
|
|||
return parent_entry;
|
||||
}
|
||||
|
||||
|
||||
// Deletes the given directory and anything under it. Returns true on success.
|
||||
bool DeleteDirRecursively(const std::string& directory)
|
||||
{
|
||||
|
@ -561,8 +549,7 @@ bool DeleteDirRecursively(const std::string& directory)
|
|||
|
||||
// check for "." and ".."
|
||||
if (((virtualName[0] == '.') && (virtualName[1] == '\0')) ||
|
||||
((virtualName[0] == '.') && (virtualName[1] == '.') &&
|
||||
(virtualName[2] == '\0')))
|
||||
((virtualName[0] == '.') && (virtualName[1] == '.') && (virtualName[2] == '\0')))
|
||||
continue;
|
||||
|
||||
std::string newPath = directory + DIR_SEP_CHR + virtualName;
|
||||
|
@ -599,9 +586,12 @@ bool DeleteDirRecursively(const std::string& directory)
|
|||
// Create directory and copy contents (does not overwrite existing files)
|
||||
void CopyDir(const std::string& source_path, const std::string& dest_path)
|
||||
{
|
||||
if (source_path == dest_path) return;
|
||||
if (!File::Exists(source_path)) return;
|
||||
if (!File::Exists(dest_path)) File::CreateFullPath(dest_path);
|
||||
if (source_path == dest_path)
|
||||
return;
|
||||
if (!File::Exists(source_path))
|
||||
return;
|
||||
if (!File::Exists(dest_path))
|
||||
File::CreateFullPath(dest_path);
|
||||
|
||||
#ifdef _WIN32
|
||||
WIN32_FIND_DATA ffd;
|
||||
|
@ -619,7 +609,8 @@ void CopyDir(const std::string& source_path, const std::string& dest_path)
|
|||
#else
|
||||
struct dirent dirent, *result = nullptr;
|
||||
DIR* dirp = opendir(source_path.c_str());
|
||||
if (!dirp) return;
|
||||
if (!dirp)
|
||||
return;
|
||||
|
||||
while (!readdir_r(dirp, &dirent, &result) && result)
|
||||
{
|
||||
|
@ -633,10 +624,12 @@ void CopyDir(const std::string& source_path, const std::string& dest_path)
|
|||
std::string dest = dest_path + DIR_SEP + virtualName;
|
||||
if (IsDirectory(source))
|
||||
{
|
||||
if (!File::Exists(dest)) File::CreateFullPath(dest + DIR_SEP);
|
||||
if (!File::Exists(dest))
|
||||
File::CreateFullPath(dest + DIR_SEP);
|
||||
CopyDir(source, dest);
|
||||
}
|
||||
else if (!File::Exists(dest)) File::Copy(source, dest);
|
||||
else if (!File::Exists(dest))
|
||||
File::Copy(source, dest);
|
||||
#ifdef _WIN32
|
||||
} while (FindNextFile(hFind, &ffd) != 0);
|
||||
FindClose(hFind);
|
||||
|
@ -653,8 +646,7 @@ std::string GetCurrentDir()
|
|||
// Get the current working directory (getcwd uses malloc)
|
||||
if (!(dir = __getcwd(nullptr, 0)))
|
||||
{
|
||||
ERROR_LOG(COMMON, "GetCurrentDirectory failed: %s",
|
||||
GetLastErrorMsg().c_str());
|
||||
ERROR_LOG(COMMON, "GetCurrentDirectory failed: %s", GetLastErrorMsg().c_str());
|
||||
return nullptr;
|
||||
}
|
||||
std::string strDir = dir;
|
||||
|
@ -758,9 +750,9 @@ std::string GetSysDirectory()
|
|||
{
|
||||
std::string sysDir;
|
||||
|
||||
#if defined (__APPLE__)
|
||||
#if defined(__APPLE__)
|
||||
sysDir = GetBundleDirectory() + DIR_SEP + SYSDATA_DIR;
|
||||
#elif defined (_WIN32) || defined (LINUX_LOCAL_DEV)
|
||||
#elif defined(_WIN32) || defined(LINUX_LOCAL_DEV)
|
||||
sysDir = GetExeDirectory() + DIR_SEP + SYSDATA_DIR;
|
||||
#else
|
||||
sysDir = SYSDATA_DIR;
|
||||
|
@ -808,8 +800,10 @@ static void RebuildUserDirectories(unsigned int dir_index)
|
|||
s_user_paths[F_GCSRAM_IDX] = s_user_paths[D_GCUSER_IDX] + GC_SRAM;
|
||||
|
||||
s_user_paths[D_MEMORYWATCHER_IDX] = s_user_paths[D_USER_IDX] + MEMORYWATCHER_DIR DIR_SEP;
|
||||
s_user_paths[F_MEMORYWATCHERLOCATIONS_IDX] = s_user_paths[D_MEMORYWATCHER_IDX] + MEMORYWATCHER_LOCATIONS;
|
||||
s_user_paths[F_MEMORYWATCHERSOCKET_IDX] = s_user_paths[D_MEMORYWATCHER_IDX] + MEMORYWATCHER_SOCKET;
|
||||
s_user_paths[F_MEMORYWATCHERLOCATIONS_IDX] =
|
||||
s_user_paths[D_MEMORYWATCHER_IDX] + MEMORYWATCHER_LOCATIONS;
|
||||
s_user_paths[F_MEMORYWATCHERSOCKET_IDX] =
|
||||
s_user_paths[D_MEMORYWATCHER_IDX] + MEMORYWATCHER_SOCKET;
|
||||
|
||||
// The shader cache has moved to the cache directory, so remove the old one.
|
||||
// TODO: remove that someday.
|
||||
|
@ -900,16 +894,15 @@ bool ReadFileToString(const std::string& filename, std::string& str)
|
|||
return retval;
|
||||
}
|
||||
|
||||
IOFile::IOFile()
|
||||
: m_file(nullptr), m_good(true)
|
||||
{}
|
||||
IOFile::IOFile() : m_file(nullptr), m_good(true)
|
||||
{
|
||||
}
|
||||
|
||||
IOFile::IOFile(std::FILE* file)
|
||||
: m_file(file), m_good(true)
|
||||
{}
|
||||
IOFile::IOFile(std::FILE* file) : m_file(file), m_good(true)
|
||||
{
|
||||
}
|
||||
|
||||
IOFile::IOFile(const std::string& filename, const char openmode[])
|
||||
: m_file(nullptr), m_good(true)
|
||||
IOFile::IOFile(const std::string& filename, const char openmode[]) : m_file(nullptr), m_good(true)
|
||||
{
|
||||
Open(filename, openmode);
|
||||
}
|
||||
|
@ -919,8 +912,7 @@ IOFile::~IOFile()
|
|||
Close();
|
||||
}
|
||||
|
||||
IOFile::IOFile(IOFile&& other)
|
||||
: m_file(nullptr), m_good(true)
|
||||
IOFile::IOFile(IOFile&& other) : m_file(nullptr), m_good(true)
|
||||
{
|
||||
Swap(other);
|
||||
}
|
||||
|
@ -1007,7 +999,8 @@ bool IOFile::Flush()
|
|||
|
||||
bool IOFile::Resize(u64 size)
|
||||
{
|
||||
if (!IsOpen() || 0 !=
|
||||
if (!IsOpen() ||
|
||||
0 !=
|
||||
#ifdef _WIN32
|
||||
// ector: _chsize sucks, not 64-bit safe
|
||||
// F|RES: changed to _chsize_s. i think it is 64-bit safe
|
||||
|
|
|
@ -18,13 +18,15 @@
|
|||
#endif
|
||||
|
||||
// User directory indices for GetUserPath
|
||||
enum {
|
||||
enum
|
||||
{
|
||||
D_USER_IDX,
|
||||
D_GCUSER_IDX,
|
||||
D_WIIROOT_IDX, // always points to User/Wii or global user-configured directory
|
||||
D_SESSION_WIIROOT_IDX, // may point to minimal temporary directory for determinism
|
||||
D_CONFIG_IDX, // global settings
|
||||
D_GAMESETTINGS_IDX, // user-specified settings which override both the global and the default settings (per game)
|
||||
D_GAMESETTINGS_IDX, // user-specified settings which override both the global and the default
|
||||
// settings (per game)
|
||||
D_MAPS_IDX,
|
||||
D_CACHE_IDX,
|
||||
D_SHADERCACHE_IDX,
|
||||
|
@ -58,7 +60,6 @@ enum {
|
|||
|
||||
namespace File
|
||||
{
|
||||
|
||||
// FileSystem tree node/
|
||||
struct FSTEntry
|
||||
{
|
||||
|
@ -206,15 +207,12 @@ public:
|
|||
}
|
||||
|
||||
bool IsOpen() const { return nullptr != m_file; }
|
||||
|
||||
// m_good is set to false when a read, write or other function fails
|
||||
bool IsGood() const { return m_good; }
|
||||
operator void*() { return m_good ? m_file : nullptr; }
|
||||
|
||||
std::FILE* ReleaseHandle();
|
||||
|
||||
std::FILE* GetHandle() { return m_file; }
|
||||
|
||||
void SetHandle(std::FILE* file);
|
||||
|
||||
bool Seek(s64 off, int origin);
|
||||
|
@ -224,10 +222,15 @@ public:
|
|||
bool Flush();
|
||||
|
||||
// clear error state
|
||||
void Clear() { m_good = true; std::clearerr(m_file); }
|
||||
void Clear()
|
||||
{
|
||||
m_good = true;
|
||||
std::clearerr(m_file);
|
||||
}
|
||||
|
||||
std::FILE* m_file;
|
||||
bool m_good;
|
||||
|
||||
private:
|
||||
IOFile(IOFile&);
|
||||
IOFile& operator=(IOFile& other);
|
||||
|
|
|
@ -23,7 +23,6 @@ class FixedSizeQueue
|
|||
|
||||
// Make copy constructor private for now.
|
||||
FixedSizeQueue(FixedSizeQueue& other) {}
|
||||
|
||||
public:
|
||||
FixedSizeQueue()
|
||||
{
|
||||
|
@ -31,11 +30,7 @@ public:
|
|||
clear();
|
||||
}
|
||||
|
||||
~FixedSizeQueue()
|
||||
{
|
||||
delete[] storage;
|
||||
}
|
||||
|
||||
~FixedSizeQueue() { delete[] storage; }
|
||||
void clear()
|
||||
{
|
||||
head = 0;
|
||||
|
@ -69,9 +64,5 @@ public:
|
|||
|
||||
T& front() { return storage[head]; }
|
||||
const T& front() const { return storage[head]; }
|
||||
|
||||
size_t size() const
|
||||
{
|
||||
return count;
|
||||
}
|
||||
size_t size() const { return count; }
|
||||
};
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
|
||||
#include <atomic>
|
||||
|
||||
namespace Common {
|
||||
|
||||
namespace Common
|
||||
{
|
||||
class Flag final
|
||||
{
|
||||
public:
|
||||
|
@ -28,33 +28,16 @@ public:
|
|||
// object - it should be made explicit that a flag is *not* a normal
|
||||
// variable.
|
||||
explicit Flag(bool initial_value = false) : m_val(initial_value) {}
|
||||
|
||||
void Set(bool val = true)
|
||||
{
|
||||
m_val.store(val);
|
||||
}
|
||||
|
||||
void Clear()
|
||||
{
|
||||
Set(false);
|
||||
}
|
||||
|
||||
bool IsSet() const
|
||||
{
|
||||
return m_val.load();
|
||||
}
|
||||
|
||||
void Set(bool val = true) { m_val.store(val); }
|
||||
void Clear() { Set(false); }
|
||||
bool IsSet() const { return m_val.load(); }
|
||||
bool TestAndSet(bool val = true)
|
||||
{
|
||||
bool expected = !val;
|
||||
return m_val.compare_exchange_strong(expected, val);
|
||||
}
|
||||
|
||||
bool TestAndClear()
|
||||
{
|
||||
return TestAndSet(false);
|
||||
}
|
||||
|
||||
bool TestAndClear() { return TestAndSet(false); }
|
||||
private:
|
||||
std::atomic_bool m_val;
|
||||
};
|
||||
|
|
|
@ -24,4 +24,3 @@
|
|||
#include "Common/GL/GLExtensions/gl_common.h"
|
||||
|
||||
#define GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160
|
||||
|
||||
|
|
|
@ -23,11 +23,14 @@
|
|||
|
||||
#include "Common/GL/GLExtensions/gl_common.h"
|
||||
|
||||
typedef void (APIENTRYP PFNDOLRELEASESHADERCOMPILERPROC) (void);
|
||||
typedef void (APIENTRYP PFNDOLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length);
|
||||
typedef void (APIENTRYP PFNDOLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
|
||||
typedef void (APIENTRYP PFNDOLDEPTHRANGEFPROC) (GLfloat n, GLfloat f);
|
||||
typedef void (APIENTRYP PFNDOLCLEARDEPTHFPROC) (GLfloat d);
|
||||
typedef void(APIENTRYP PFNDOLRELEASESHADERCOMPILERPROC)(void);
|
||||
typedef void(APIENTRYP PFNDOLSHADERBINARYPROC)(GLsizei count, const GLuint* shaders,
|
||||
GLenum binaryformat, const void* binary,
|
||||
GLsizei length);
|
||||
typedef void(APIENTRYP PFNDOLGETSHADERPRECISIONFORMATPROC)(GLenum shadertype, GLenum precisiontype,
|
||||
GLint* range, GLint* precision);
|
||||
typedef void(APIENTRYP PFNDOLDEPTHRANGEFPROC)(GLfloat n, GLfloat f);
|
||||
typedef void(APIENTRYP PFNDOLCLEARDEPTHFPROC)(GLfloat d);
|
||||
|
||||
extern PFNDOLCLEARDEPTHFPROC dolClearDepthf;
|
||||
extern PFNDOLDEPTHRANGEFPROC dolDepthRangef;
|
||||
|
|
|
@ -28,8 +28,9 @@
|
|||
#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB
|
||||
#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC
|
||||
|
||||
typedef void (APIENTRYP PFNDOLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name);
|
||||
typedef GLint (APIENTRYP PFNDOLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar *name);
|
||||
typedef void(APIENTRYP PFNDOLBINDFRAGDATALOCATIONINDEXEDPROC)(GLuint program, GLuint colorNumber,
|
||||
GLuint index, const GLchar* name);
|
||||
typedef GLint(APIENTRYP PFNDOLGETFRAGDATAINDEXPROC)(GLuint program, const GLchar* name);
|
||||
|
||||
extern PFNDOLBINDFRAGDATALOCATIONINDEXEDPROC dolBindFragDataLocationIndexed;
|
||||
extern PFNDOLGETFRAGDATAINDEXPROC dolGetFragDataIndex;
|
||||
|
|
|
@ -33,8 +33,10 @@
|
|||
#define GL_BUFFER_IMMUTABLE_STORAGE 0x821F
|
||||
#define GL_BUFFER_STORAGE_FLAGS 0x8220
|
||||
|
||||
typedef void (APIENTRYP PFNDOLBUFFERSTORAGEPROC) (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags);
|
||||
typedef void (APIENTRYP PFNDOLNAMEDBUFFERSTORAGEEXTPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags);
|
||||
typedef void(APIENTRYP PFNDOLBUFFERSTORAGEPROC)(GLenum target, GLsizeiptr size, const void* data,
|
||||
GLbitfield flags);
|
||||
typedef void(APIENTRYP PFNDOLNAMEDBUFFERSTORAGEEXTPROC)(GLuint buffer, GLsizeiptr size,
|
||||
const void* data, GLbitfield flags);
|
||||
|
||||
extern PFNDOLBUFFERSTORAGEPROC dolBufferStorage;
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#define GL_CLIP_ORIGIN 0x935C
|
||||
#define GL_CLIP_DEPTH_MODE 0x935D
|
||||
|
||||
typedef void (APIENTRYP PFNDOLCLIPCONTROLPROC) (GLenum origin, GLenum depth);
|
||||
typedef void(APIENTRYP PFNDOLCLIPCONTROLPROC)(GLenum origin, GLenum depth);
|
||||
|
||||
extern PFNDOLCLIPCONTROLPROC dolClipControl;
|
||||
|
||||
|
|
|
@ -23,7 +23,12 @@
|
|||
|
||||
#include "Common/GL/GLExtensions/gl_common.h"
|
||||
|
||||
typedef void (APIENTRYP PFNDOLCOPYIMAGESUBDATAPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
|
||||
typedef void(APIENTRYP PFNDOLCOPYIMAGESUBDATAPROC)(GLuint srcName, GLenum srcTarget, GLint srcLevel,
|
||||
GLint srcX, GLint srcY, GLint srcZ,
|
||||
GLuint dstName, GLenum dstTarget, GLint dstLevel,
|
||||
GLint dstX, GLint dstY, GLint dstZ,
|
||||
GLsizei srcWidth, GLsizei srcHeight,
|
||||
GLsizei srcDepth);
|
||||
|
||||
extern PFNDOLCOPYIMAGESUBDATAPROC dolCopyImageSubData;
|
||||
|
||||
|
|
|
@ -23,7 +23,9 @@
|
|||
|
||||
#include "Common/GL/GLExtensions/gl_common.h"
|
||||
|
||||
typedef void (APIENTRYP GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
|
||||
typedef void(APIENTRYP GLDEBUGPROCARB)(GLenum source, GLenum type, GLuint id, GLenum severity,
|
||||
GLsizei length, const GLchar* message,
|
||||
const void* userParam);
|
||||
#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242
|
||||
#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243
|
||||
#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244
|
||||
|
@ -47,10 +49,18 @@ typedef void (APIENTRYP GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLen
|
|||
#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147
|
||||
#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148
|
||||
|
||||
typedef void (APIENTRYP PFNDOLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
|
||||
typedef void (APIENTRYP PFNDOLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
|
||||
typedef void (APIENTRYP PFNDOLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const void *userParam);
|
||||
typedef GLuint (APIENTRYP PFNDOLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
|
||||
typedef void(APIENTRYP PFNDOLDEBUGMESSAGECONTROLARBPROC)(GLenum source, GLenum type,
|
||||
GLenum severity, GLsizei count,
|
||||
const GLuint* ids, GLboolean enabled);
|
||||
typedef void(APIENTRYP PFNDOLDEBUGMESSAGEINSERTARBPROC)(GLenum source, GLenum type, GLuint id,
|
||||
GLenum severity, GLsizei length,
|
||||
const GLchar* buf);
|
||||
typedef void(APIENTRYP PFNDOLDEBUGMESSAGECALLBACKARBPROC)(GLDEBUGPROCARB callback,
|
||||
const void* userParam);
|
||||
typedef GLuint(APIENTRYP PFNDOLGETDEBUGMESSAGELOGARBPROC)(GLuint count, GLsizei bufSize,
|
||||
GLenum* sources, GLenum* types,
|
||||
GLuint* ids, GLenum* severities,
|
||||
GLsizei* lengths, GLchar* messageLog);
|
||||
|
||||
extern PFNDOLDEBUGMESSAGECALLBACKARBPROC dolDebugMessageCallbackARB;
|
||||
extern PFNDOLDEBUGMESSAGECONTROLARBPROC dolDebugMessageControlARB;
|
||||
|
|
|
@ -23,10 +23,21 @@
|
|||
|
||||
#include "Common/GL/GLExtensions/gl_common.h"
|
||||
|
||||
typedef void (APIENTRYP PFNDOLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
|
||||
typedef void (APIENTRYP PFNDOLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
|
||||
typedef void (APIENTRYP PFNDOLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
|
||||
typedef void (APIENTRYP PFNDOLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex);
|
||||
typedef void(APIENTRYP PFNDOLDRAWELEMENTSBASEVERTEXPROC)(GLenum mode, GLsizei count, GLenum type,
|
||||
const void* indices, GLint basevertex);
|
||||
typedef void(APIENTRYP PFNDOLDRAWRANGEELEMENTSBASEVERTEXPROC)(GLenum mode, GLuint start, GLuint end,
|
||||
GLsizei count, GLenum type,
|
||||
const void* indices,
|
||||
GLint basevertex);
|
||||
typedef void(APIENTRYP PFNDOLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)(GLenum mode, GLsizei count,
|
||||
GLenum type, const void* indices,
|
||||
GLsizei instancecount,
|
||||
GLint basevertex);
|
||||
typedef void(APIENTRYP PFNDOLMULTIDRAWELEMENTSBASEVERTEXPROC)(GLenum mode, const GLsizei* count,
|
||||
GLenum type,
|
||||
const void* const* indices,
|
||||
GLsizei drawcount,
|
||||
const GLint* basevertex);
|
||||
|
||||
extern PFNDOLDRAWELEMENTSBASEVERTEXPROC dolDrawElementsBaseVertex;
|
||||
extern PFNDOLDRAWELEMENTSINSTANCEDBASEVERTEXPROC dolDrawElementsInstancedBaseVertex;
|
||||
|
|
|
@ -23,26 +23,44 @@
|
|||
|
||||
#include "Common/GL/GLExtensions/gl_common.h"
|
||||
|
||||
typedef void (APIENTRYP PFNDOLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer);
|
||||
typedef void (APIENTRYP PFNDOLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer);
|
||||
typedef void (APIENTRYP PFNDOLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
|
||||
typedef GLenum (APIENTRYP PFNDOLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target);
|
||||
typedef void (APIENTRYP PFNDOLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers);
|
||||
typedef void (APIENTRYP PFNDOLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers);
|
||||
typedef void (APIENTRYP PFNDOLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
|
||||
typedef void (APIENTRYP PFNDOLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
typedef void (APIENTRYP PFNDOLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
typedef void (APIENTRYP PFNDOLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
|
||||
typedef void (APIENTRYP PFNDOLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
|
||||
typedef void (APIENTRYP PFNDOLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers);
|
||||
typedef void (APIENTRYP PFNDOLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers);
|
||||
typedef void (APIENTRYP PFNDOLGENERATEMIPMAPPROC) (GLenum target);
|
||||
typedef void (APIENTRYP PFNDOLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNDOLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
|
||||
typedef GLboolean (APIENTRYP PFNDOLISFRAMEBUFFERPROC) (GLuint framebuffer);
|
||||
typedef GLboolean (APIENTRYP PFNDOLISRENDERBUFFERPROC) (GLuint renderbuffer);
|
||||
typedef void (APIENTRYP PFNDOLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
typedef void (APIENTRYP PFNDOLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
typedef void(APIENTRYP PFNDOLBINDFRAMEBUFFERPROC)(GLenum target, GLuint framebuffer);
|
||||
typedef void(APIENTRYP PFNDOLBINDRENDERBUFFERPROC)(GLenum target, GLuint renderbuffer);
|
||||
typedef void(APIENTRYP PFNDOLBLITFRAMEBUFFERPROC)(GLint srcX0, GLint srcY0, GLint srcX1,
|
||||
GLint srcY1, GLint dstX0, GLint dstY0,
|
||||
GLint dstX1, GLint dstY1, GLbitfield mask,
|
||||
GLenum filter);
|
||||
typedef GLenum(APIENTRYP PFNDOLCHECKFRAMEBUFFERSTATUSPROC)(GLenum target);
|
||||
typedef void(APIENTRYP PFNDOLDELETEFRAMEBUFFERSPROC)(GLsizei n, const GLuint* framebuffers);
|
||||
typedef void(APIENTRYP PFNDOLDELETERENDERBUFFERSPROC)(GLsizei n, const GLuint* renderbuffers);
|
||||
typedef void(APIENTRYP PFNDOLFRAMEBUFFERRENDERBUFFERPROC)(GLenum target, GLenum attachment,
|
||||
GLenum renderbuffertarget,
|
||||
GLuint renderbuffer);
|
||||
typedef void(APIENTRYP PFNDOLFRAMEBUFFERTEXTURE1DPROC)(GLenum target, GLenum attachment,
|
||||
GLenum textarget, GLuint texture,
|
||||
GLint level);
|
||||
typedef void(APIENTRYP PFNDOLFRAMEBUFFERTEXTURE2DPROC)(GLenum target, GLenum attachment,
|
||||
GLenum textarget, GLuint texture,
|
||||
GLint level);
|
||||
typedef void(APIENTRYP PFNDOLFRAMEBUFFERTEXTURE3DPROC)(GLenum target, GLenum attachment,
|
||||
GLenum textarget, GLuint texture,
|
||||
GLint level, GLint zoffset);
|
||||
typedef void(APIENTRYP PFNDOLFRAMEBUFFERTEXTURELAYERPROC)(GLenum target, GLenum attachment,
|
||||
GLuint texture, GLint level, GLint layer);
|
||||
typedef void(APIENTRYP PFNDOLGENFRAMEBUFFERSPROC)(GLsizei n, GLuint* framebuffers);
|
||||
typedef void(APIENTRYP PFNDOLGENRENDERBUFFERSPROC)(GLsizei n, GLuint* renderbuffers);
|
||||
typedef void(APIENTRYP PFNDOLGENERATEMIPMAPPROC)(GLenum target);
|
||||
typedef void(APIENTRYP PFNDOLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)(GLenum target,
|
||||
GLenum attachment,
|
||||
GLenum pname, GLint* params);
|
||||
typedef void(APIENTRYP PFNDOLGETRENDERBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname,
|
||||
GLint* params);
|
||||
typedef GLboolean(APIENTRYP PFNDOLISFRAMEBUFFERPROC)(GLuint framebuffer);
|
||||
typedef GLboolean(APIENTRYP PFNDOLISRENDERBUFFERPROC)(GLuint renderbuffer);
|
||||
typedef void(APIENTRYP PFNDOLRENDERBUFFERSTORAGEPROC)(GLenum target, GLenum internalformat,
|
||||
GLsizei width, GLsizei height);
|
||||
typedef void(APIENTRYP PFNDOLRENDERBUFFERSTORAGEMULTISAMPLEPROC)(GLenum target, GLsizei samples,
|
||||
GLenum internalformat,
|
||||
GLsizei width, GLsizei height);
|
||||
|
||||
extern PFNDOLBINDFRAMEBUFFERPROC dolBindFramebuffer;
|
||||
extern PFNDOLBINDRENDERBUFFERPROC dolBindRenderbuffer;
|
||||
|
|
|
@ -28,9 +28,11 @@
|
|||
#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE
|
||||
#define GL_PROGRAM_BINARY_FORMATS 0x87FF
|
||||
|
||||
typedef void (APIENTRYP PFNDOLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
|
||||
typedef void (APIENTRYP PFNDOLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length);
|
||||
typedef void (APIENTRYP PFNDOLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value);
|
||||
typedef void(APIENTRYP PFNDOLGETPROGRAMBINARYPROC)(GLuint program, GLsizei bufSize, GLsizei* length,
|
||||
GLenum* binaryFormat, void* binary);
|
||||
typedef void(APIENTRYP PFNDOLPROGRAMBINARYPROC)(GLuint program, GLenum binaryFormat,
|
||||
const void* binary, GLsizei length);
|
||||
typedef void(APIENTRYP PFNDOLPROGRAMPARAMETERIPROC)(GLuint program, GLenum pname, GLint value);
|
||||
|
||||
extern PFNDOLGETPROGRAMBINARYPROC dolGetProgramBinary;
|
||||
extern PFNDOLPROGRAMBINARYPROC dolProgramBinary;
|
||||
|
|
|
@ -23,8 +23,10 @@
|
|||
|
||||
#include "Common/GL/GLExtensions/gl_common.h"
|
||||
|
||||
typedef void *(APIENTRYP PFNDOLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
|
||||
typedef void (APIENTRYP PFNDOLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length);
|
||||
typedef void*(APIENTRYP PFNDOLMAPBUFFERRANGEPROC)(GLenum target, GLintptr offset, GLsizeiptr length,
|
||||
GLbitfield access);
|
||||
typedef void(APIENTRYP PFNDOLFLUSHMAPPEDBUFFERRANGEPROC)(GLenum target, GLintptr offset,
|
||||
GLsizeiptr length);
|
||||
|
||||
extern PFNDOLFLUSHMAPPEDBUFFERRANGEPROC dolFlushMappedBufferRange;
|
||||
extern PFNDOLMAPBUFFERRANGEPROC dolMapBufferRange;
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include "Common/GL/GLExtensions/gl_common.h"
|
||||
|
||||
typedef void (APIENTRYP PFNDOLMINSAMPLESHADINGARBPROC) (GLfloat value);
|
||||
typedef void(APIENTRYP PFNDOLMINSAMPLESHADINGARBPROC)(GLfloat value);
|
||||
|
||||
extern PFNDOLMINSAMPLESHADINGARBPROC dolMinSampleShading;
|
||||
|
||||
|
|
|
@ -23,20 +23,28 @@
|
|||
|
||||
#include "Common/GL/GLExtensions/gl_common.h"
|
||||
|
||||
typedef void (APIENTRYP PFNDOLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers);
|
||||
typedef void (APIENTRYP PFNDOLDELETESAMPLERSPROC) (GLsizei count, const GLuint *samplers);
|
||||
typedef GLboolean (APIENTRYP PFNDOLISSAMPLERPROC) (GLuint sampler);
|
||||
typedef void (APIENTRYP PFNDOLBINDSAMPLERPROC) (GLuint unit, GLuint sampler);
|
||||
typedef void (APIENTRYP PFNDOLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param);
|
||||
typedef void (APIENTRYP PFNDOLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint *param);
|
||||
typedef void (APIENTRYP PFNDOLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param);
|
||||
typedef void (APIENTRYP PFNDOLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat *param);
|
||||
typedef void (APIENTRYP PFNDOLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint *param);
|
||||
typedef void (APIENTRYP PFNDOLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint *param);
|
||||
typedef void (APIENTRYP PFNDOLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNDOLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNDOLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat *params);
|
||||
typedef void (APIENTRYP PFNDOLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint *params);
|
||||
typedef void(APIENTRYP PFNDOLGENSAMPLERSPROC)(GLsizei count, GLuint* samplers);
|
||||
typedef void(APIENTRYP PFNDOLDELETESAMPLERSPROC)(GLsizei count, const GLuint* samplers);
|
||||
typedef GLboolean(APIENTRYP PFNDOLISSAMPLERPROC)(GLuint sampler);
|
||||
typedef void(APIENTRYP PFNDOLBINDSAMPLERPROC)(GLuint unit, GLuint sampler);
|
||||
typedef void(APIENTRYP PFNDOLSAMPLERPARAMETERIPROC)(GLuint sampler, GLenum pname, GLint param);
|
||||
typedef void(APIENTRYP PFNDOLSAMPLERPARAMETERIVPROC)(GLuint sampler, GLenum pname,
|
||||
const GLint* param);
|
||||
typedef void(APIENTRYP PFNDOLSAMPLERPARAMETERFPROC)(GLuint sampler, GLenum pname, GLfloat param);
|
||||
typedef void(APIENTRYP PFNDOLSAMPLERPARAMETERFVPROC)(GLuint sampler, GLenum pname,
|
||||
const GLfloat* param);
|
||||
typedef void(APIENTRYP PFNDOLSAMPLERPARAMETERIIVPROC)(GLuint sampler, GLenum pname,
|
||||
const GLint* param);
|
||||
typedef void(APIENTRYP PFNDOLSAMPLERPARAMETERIUIVPROC)(GLuint sampler, GLenum pname,
|
||||
const GLuint* param);
|
||||
typedef void(APIENTRYP PFNDOLGETSAMPLERPARAMETERIVPROC)(GLuint sampler, GLenum pname,
|
||||
GLint* params);
|
||||
typedef void(APIENTRYP PFNDOLGETSAMPLERPARAMETERIIVPROC)(GLuint sampler, GLenum pname,
|
||||
GLint* params);
|
||||
typedef void(APIENTRYP PFNDOLGETSAMPLERPARAMETERFVPROC)(GLuint sampler, GLenum pname,
|
||||
GLfloat* params);
|
||||
typedef void(APIENTRYP PFNDOLGETSAMPLERPARAMETERIUIVPROC)(GLuint sampler, GLenum pname,
|
||||
GLuint* params);
|
||||
|
||||
extern PFNDOLBINDSAMPLERPROC dolBindSampler;
|
||||
extern PFNDOLDELETESAMPLERSPROC dolDeleteSamplers;
|
||||
|
|
|
@ -40,7 +40,9 @@
|
|||
#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE
|
||||
#define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF
|
||||
|
||||
typedef void (APIENTRY * PFNDOLSHADERSTORAGEBLOCKBINDINGPROC) (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding);
|
||||
typedef void(APIENTRY* PFNDOLSHADERSTORAGEBLOCKBINDINGPROC)(GLuint program,
|
||||
GLuint storageBlockIndex,
|
||||
GLuint storageBlockBinding);
|
||||
|
||||
extern PFNDOLSHADERSTORAGEBLOCKBINDINGPROC dolShaderStorageBlockBinding;
|
||||
|
||||
|
|
|
@ -23,14 +23,15 @@
|
|||
|
||||
#include "Common/GL/GLExtensions/gl_common.h"
|
||||
|
||||
typedef GLsync (APIENTRYP PFNDOLFENCESYNCPROC) (GLenum condition, GLbitfield flags);
|
||||
typedef GLboolean (APIENTRYP PFNDOLISSYNCPROC) (GLsync sync);
|
||||
typedef void (APIENTRYP PFNDOLDELETESYNCPROC) (GLsync sync);
|
||||
typedef GLenum (APIENTRYP PFNDOLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
|
||||
typedef void (APIENTRYP PFNDOLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
|
||||
typedef void (APIENTRYP PFNDOLGETINTEGER64VPROC) (GLenum pname, GLint64 *data);
|
||||
typedef void (APIENTRYP PFNDOLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
|
||||
typedef void (APIENTRYP PFNDOLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data);
|
||||
typedef GLsync(APIENTRYP PFNDOLFENCESYNCPROC)(GLenum condition, GLbitfield flags);
|
||||
typedef GLboolean(APIENTRYP PFNDOLISSYNCPROC)(GLsync sync);
|
||||
typedef void(APIENTRYP PFNDOLDELETESYNCPROC)(GLsync sync);
|
||||
typedef GLenum(APIENTRYP PFNDOLCLIENTWAITSYNCPROC)(GLsync sync, GLbitfield flags, GLuint64 timeout);
|
||||
typedef void(APIENTRYP PFNDOLWAITSYNCPROC)(GLsync sync, GLbitfield flags, GLuint64 timeout);
|
||||
typedef void(APIENTRYP PFNDOLGETINTEGER64VPROC)(GLenum pname, GLint64* data);
|
||||
typedef void(APIENTRYP PFNDOLGETSYNCIVPROC)(GLsync sync, GLenum pname, GLsizei bufSize,
|
||||
GLsizei* length, GLint* values);
|
||||
typedef void(APIENTRYP PFNDOLGETINTEGER64I_VPROC)(GLenum target, GLuint index, GLint64* data);
|
||||
|
||||
extern PFNDOLCLIENTWAITSYNCPROC dolClientWaitSync;
|
||||
extern PFNDOLDELETESYNCPROC dolDeleteSync;
|
||||
|
|
|
@ -23,10 +23,16 @@
|
|||
|
||||
#include "Common/GL/GLExtensions/gl_common.h"
|
||||
|
||||
typedef void (APIENTRYP PFNDOLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
|
||||
typedef void (APIENTRYP PFNDOLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
|
||||
typedef void (APIENTRYP PFNDOLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat *val);
|
||||
typedef void (APIENTRYP PFNDOLSAMPLEMASKIPROC) (GLuint maskNumber, GLbitfield mask);
|
||||
typedef void(APIENTRYP PFNDOLTEXIMAGE2DMULTISAMPLEPROC)(GLenum target, GLsizei samples,
|
||||
GLenum internalformat, GLsizei width,
|
||||
GLsizei height,
|
||||
GLboolean fixedsamplelocations);
|
||||
typedef void(APIENTRYP PFNDOLTEXIMAGE3DMULTISAMPLEPROC)(GLenum target, GLsizei samples,
|
||||
GLenum internalformat, GLsizei width,
|
||||
GLsizei height, GLsizei depth,
|
||||
GLboolean fixedsamplelocations);
|
||||
typedef void(APIENTRYP PFNDOLGETMULTISAMPLEFVPROC)(GLenum pname, GLuint index, GLfloat* val);
|
||||
typedef void(APIENTRYP PFNDOLSAMPLEMASKIPROC)(GLuint maskNumber, GLbitfield mask);
|
||||
|
||||
extern PFNDOLTEXIMAGE2DMULTISAMPLEPROC dolTexImage2DMultisample;
|
||||
extern PFNDOLTEXIMAGE3DMULTISAMPLEPROC dolTexImage3DMultisample;
|
||||
|
|
|
@ -23,8 +23,14 @@
|
|||
|
||||
#include "Common/GL/GLExtensions/gl_common.h"
|
||||
|
||||
typedef void (APIENTRYP PFNDOLTEXSTORAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
|
||||
typedef void (APIENTRYP PFNDOLTEXSTORAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
|
||||
typedef void(APIENTRYP PFNDOLTEXSTORAGE2DMULTISAMPLEPROC)(GLenum target, GLsizei samples,
|
||||
GLenum internalformat, GLsizei width,
|
||||
GLsizei height,
|
||||
GLboolean fixedsamplelocations);
|
||||
typedef void(APIENTRYP PFNDOLTEXSTORAGE3DMULTISAMPLEPROC)(GLenum target, GLsizei samples,
|
||||
GLenum internalformat, GLsizei width,
|
||||
GLsizei height, GLsizei depth,
|
||||
GLboolean fixedsamplelocations);
|
||||
|
||||
extern PFNDOLTEXSTORAGE2DMULTISAMPLEPROC dolTexStorage2DMultisample;
|
||||
extern PFNDOLTEXSTORAGE3DMULTISAMPLEPROC dolTexStorage3DMultisample;
|
||||
|
|
|
@ -23,16 +23,29 @@
|
|||
|
||||
#include "Common/GL/GLExtensions/gl_common.h"
|
||||
|
||||
typedef void (APIENTRYP PFNDOLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint *data);
|
||||
typedef void (APIENTRYP PFNDOLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
|
||||
typedef void (APIENTRYP PFNDOLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer);
|
||||
typedef void (APIENTRYP PFNDOLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices);
|
||||
typedef void (APIENTRYP PFNDOLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNDOLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName);
|
||||
typedef GLuint (APIENTRYP PFNDOLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar *uniformBlockName);
|
||||
typedef void (APIENTRYP PFNDOLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNDOLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
|
||||
typedef void (APIENTRYP PFNDOLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
|
||||
typedef void(APIENTRYP PFNDOLGETINTEGERI_VPROC)(GLenum target, GLuint index, GLint* data);
|
||||
typedef void(APIENTRYP PFNDOLBINDBUFFERRANGEPROC)(GLenum target, GLuint index, GLuint buffer,
|
||||
GLintptr offset, GLsizeiptr size);
|
||||
typedef void(APIENTRYP PFNDOLBINDBUFFERBASEPROC)(GLenum target, GLuint index, GLuint buffer);
|
||||
typedef void(APIENTRYP PFNDOLGETUNIFORMINDICESPROC)(GLuint program, GLsizei uniformCount,
|
||||
const GLchar* const* uniformNames,
|
||||
GLuint* uniformIndices);
|
||||
typedef void(APIENTRYP PFNDOLGETACTIVEUNIFORMSIVPROC)(GLuint program, GLsizei uniformCount,
|
||||
const GLuint* uniformIndices, GLenum pname,
|
||||
GLint* params);
|
||||
typedef void(APIENTRYP PFNDOLGETACTIVEUNIFORMNAMEPROC)(GLuint program, GLuint uniformIndex,
|
||||
GLsizei bufSize, GLsizei* length,
|
||||
GLchar* uniformName);
|
||||
typedef GLuint(APIENTRYP PFNDOLGETUNIFORMBLOCKINDEXPROC)(GLuint program,
|
||||
const GLchar* uniformBlockName);
|
||||
typedef void(APIENTRYP PFNDOLGETACTIVEUNIFORMBLOCKIVPROC)(GLuint program, GLuint uniformBlockIndex,
|
||||
GLenum pname, GLint* params);
|
||||
typedef void(APIENTRYP PFNDOLGETACTIVEUNIFORMBLOCKNAMEPROC)(GLuint program,
|
||||
GLuint uniformBlockIndex,
|
||||
GLsizei bufSize, GLsizei* length,
|
||||
GLchar* uniformBlockName);
|
||||
typedef void(APIENTRYP PFNDOLUNIFORMBLOCKBINDINGPROC)(GLuint program, GLuint uniformBlockIndex,
|
||||
GLuint uniformBlockBinding);
|
||||
|
||||
extern PFNDOLBINDBUFFERBASEPROC dolBindBufferBase;
|
||||
extern PFNDOLBINDBUFFERRANGEPROC dolBindBufferRange;
|
||||
|
|
|
@ -23,10 +23,10 @@
|
|||
|
||||
#include "Common/GL/GLExtensions/gl_common.h"
|
||||
|
||||
typedef void (APIENTRYP PFNDOLBINDVERTEXARRAYPROC) (GLuint array);
|
||||
typedef void (APIENTRYP PFNDOLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays);
|
||||
typedef void (APIENTRYP PFNDOLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays);
|
||||
typedef GLboolean (APIENTRYP PFNDOLISVERTEXARRAYPROC) (GLuint array);
|
||||
typedef void(APIENTRYP PFNDOLBINDVERTEXARRAYPROC)(GLuint array);
|
||||
typedef void(APIENTRYP PFNDOLDELETEVERTEXARRAYSPROC)(GLsizei n, const GLuint* arrays);
|
||||
typedef void(APIENTRYP PFNDOLGENVERTEXARRAYSPROC)(GLsizei n, GLuint* arrays);
|
||||
typedef GLboolean(APIENTRYP PFNDOLISVERTEXARRAYPROC)(GLuint array);
|
||||
|
||||
extern PFNDOLBINDVERTEXARRAYPROC dolBindVertexArray;
|
||||
extern PFNDOLDELETEVERTEXARRAYSPROC dolDeleteVertexArrays;
|
||||
|
|
|
@ -23,16 +23,18 @@
|
|||
|
||||
#include "Common/GL/GLExtensions/gl_common.h"
|
||||
|
||||
typedef void (APIENTRYP PFNDOLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat *v);
|
||||
typedef void (APIENTRYP PFNDOLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h);
|
||||
typedef void (APIENTRYP PFNDOLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat *v);
|
||||
typedef void (APIENTRYP PFNDOLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint *v);
|
||||
typedef void (APIENTRYP PFNDOLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height);
|
||||
typedef void (APIENTRYP PFNDOLSCISSORINDEXEDVPROC) (GLuint index, const GLint *v);
|
||||
typedef void (APIENTRYP PFNDOLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLdouble *v);
|
||||
typedef void (APIENTRYP PFNDOLDEPTHRANGEINDEXEDPROC) (GLuint index, GLdouble n, GLdouble f);
|
||||
typedef void (APIENTRYP PFNDOLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat *data);
|
||||
typedef void (APIENTRYP PFNDOLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble *data);
|
||||
typedef void(APIENTRYP PFNDOLVIEWPORTARRAYVPROC)(GLuint first, GLsizei count, const GLfloat* v);
|
||||
typedef void(APIENTRYP PFNDOLVIEWPORTINDEXEDFPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat w,
|
||||
GLfloat h);
|
||||
typedef void(APIENTRYP PFNDOLVIEWPORTINDEXEDFVPROC)(GLuint index, const GLfloat* v);
|
||||
typedef void(APIENTRYP PFNDOLSCISSORARRAYVPROC)(GLuint first, GLsizei count, const GLint* v);
|
||||
typedef void(APIENTRYP PFNDOLSCISSORINDEXEDPROC)(GLuint index, GLint left, GLint bottom,
|
||||
GLsizei width, GLsizei height);
|
||||
typedef void(APIENTRYP PFNDOLSCISSORINDEXEDVPROC)(GLuint index, const GLint* v);
|
||||
typedef void(APIENTRYP PFNDOLDEPTHRANGEARRAYVPROC)(GLuint first, GLsizei count, const GLdouble* v);
|
||||
typedef void(APIENTRYP PFNDOLDEPTHRANGEINDEXEDPROC)(GLuint index, GLdouble n, GLdouble f);
|
||||
typedef void(APIENTRYP PFNDOLGETFLOATI_VPROC)(GLenum target, GLuint index, GLfloat* data);
|
||||
typedef void(APIENTRYP PFNDOLGETDOUBLEI_VPROC)(GLenum target, GLuint index, GLdouble* data);
|
||||
|
||||
extern PFNDOLDEPTHRANGEARRAYVPROC dolDepthRangeArrayv;
|
||||
extern PFNDOLDEPTHRANGEINDEXEDPROC dolDepthRangeIndexed;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -7,14 +7,14 @@
|
|||
#include "Common/CommonTypes.h"
|
||||
|
||||
#include "Common/GL/GLExtensions/AMD_pinned_memory.h"
|
||||
#include "Common/GL/GLExtensions/ARB_ES2_compatibility.h"
|
||||
#include "Common/GL/GLExtensions/ARB_ES3_compatibility.h"
|
||||
#include "Common/GL/GLExtensions/ARB_blend_func_extended.h"
|
||||
#include "Common/GL/GLExtensions/ARB_buffer_storage.h"
|
||||
#include "Common/GL/GLExtensions/ARB_clip_control.h"
|
||||
#include "Common/GL/GLExtensions/ARB_copy_image.h"
|
||||
#include "Common/GL/GLExtensions/ARB_debug_output.h"
|
||||
#include "Common/GL/GLExtensions/ARB_draw_elements_base_vertex.h"
|
||||
#include "Common/GL/GLExtensions/ARB_ES2_compatibility.h"
|
||||
#include "Common/GL/GLExtensions/ARB_ES3_compatibility.h"
|
||||
#include "Common/GL/GLExtensions/ARB_framebuffer_object.h"
|
||||
#include "Common/GL/GLExtensions/ARB_get_program_binary.h"
|
||||
#include "Common/GL/GLExtensions/ARB_map_buffer_range.h"
|
||||
|
@ -29,6 +29,10 @@
|
|||
#include "Common/GL/GLExtensions/ARB_vertex_array_object.h"
|
||||
#include "Common/GL/GLExtensions/ARB_viewport_array.h"
|
||||
#include "Common/GL/GLExtensions/EXT_texture_filter_anisotropic.h"
|
||||
#include "Common/GL/GLExtensions/HP_occlusion_test.h"
|
||||
#include "Common/GL/GLExtensions/KHR_debug.h"
|
||||
#include "Common/GL/GLExtensions/NV_occlusion_query_samples.h"
|
||||
#include "Common/GL/GLExtensions/NV_primitive_restart.h"
|
||||
#include "Common/GL/GLExtensions/gl_1_1.h"
|
||||
#include "Common/GL/GLExtensions/gl_1_2.h"
|
||||
#include "Common/GL/GLExtensions/gl_1_3.h"
|
||||
|
@ -43,20 +47,16 @@
|
|||
#include "Common/GL/GLExtensions/gl_4_3.h"
|
||||
#include "Common/GL/GLExtensions/gl_4_4.h"
|
||||
#include "Common/GL/GLExtensions/gl_4_5.h"
|
||||
#include "Common/GL/GLExtensions/HP_occlusion_test.h"
|
||||
#include "Common/GL/GLExtensions/KHR_debug.h"
|
||||
#include "Common/GL/GLExtensions/NV_occlusion_query_samples.h"
|
||||
#include "Common/GL/GLExtensions/NV_primitive_restart.h"
|
||||
|
||||
namespace GLExtensions
|
||||
{
|
||||
// Initializes the interface
|
||||
bool Init();
|
||||
// Initializes the interface
|
||||
bool Init();
|
||||
|
||||
// Function for checking if the hardware supports an extension
|
||||
// example: if (GLExtensions::Supports("GL_ARB_multi_map"))
|
||||
bool Supports(const std::string& name);
|
||||
// Function for checking if the hardware supports an extension
|
||||
// example: if (GLExtensions::Supports("GL_ARB_multi_map"))
|
||||
bool Supports(const std::string& name);
|
||||
|
||||
// Returns OpenGL version in format 430
|
||||
u32 Version();
|
||||
// Returns OpenGL version in format 430
|
||||
u32 Version();
|
||||
}
|
||||
|
|
|
@ -64,18 +64,31 @@
|
|||
#define GL_DEBUG_SEVERITY_LOW 0x9148
|
||||
#define GL_DEBUG_OUTPUT 0x92E0
|
||||
|
||||
typedef void (APIENTRYP GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
|
||||
typedef void(APIENTRYP GLDEBUGPROC)(GLenum source, GLenum type, GLuint id, GLenum severity,
|
||||
GLsizei length, const GLchar* message, const void* userParam);
|
||||
|
||||
typedef void (APIENTRYP PFNDOLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const GLvoid *userParam);
|
||||
typedef void (APIENTRYP PFNDOLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled);
|
||||
typedef void (APIENTRYP PFNDOLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf);
|
||||
typedef GLuint (APIENTRYP PFNDOLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufsize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog);
|
||||
typedef void (APIENTRYP PFNDOLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei* length, GLchar *label);
|
||||
typedef void (APIENTRYP PFNDOLGETOBJECTPTRLABELPROC) (void* ptr, GLsizei bufSize, GLsizei* length, GLchar *label);
|
||||
typedef void (APIENTRYP PFNDOLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar* label);
|
||||
typedef void (APIENTRYP PFNDOLOBJECTPTRLABELPROC) (void* ptr, GLsizei length, const GLchar* label);
|
||||
typedef void (APIENTRYP PFNDOLPOPDEBUGGROUPPROC) (void);
|
||||
typedef void (APIENTRYP PFNDOLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar * message);
|
||||
typedef void(APIENTRYP PFNDOLDEBUGMESSAGECALLBACKPROC)(GLDEBUGPROC callback,
|
||||
const GLvoid* userParam);
|
||||
typedef void(APIENTRYP PFNDOLDEBUGMESSAGECONTROLPROC)(GLenum source, GLenum type, GLenum severity,
|
||||
GLsizei count, const GLuint* ids,
|
||||
GLboolean enabled);
|
||||
typedef void(APIENTRYP PFNDOLDEBUGMESSAGEINSERTPROC)(GLenum source, GLenum type, GLuint id,
|
||||
GLenum severity, GLsizei length,
|
||||
const GLchar* buf);
|
||||
typedef GLuint(APIENTRYP PFNDOLGETDEBUGMESSAGELOGPROC)(GLuint count, GLsizei bufsize,
|
||||
GLenum* sources, GLenum* types, GLuint* ids,
|
||||
GLenum* severities, GLsizei* lengths,
|
||||
GLchar* messageLog);
|
||||
typedef void(APIENTRYP PFNDOLGETOBJECTLABELPROC)(GLenum identifier, GLuint name, GLsizei bufSize,
|
||||
GLsizei* length, GLchar* label);
|
||||
typedef void(APIENTRYP PFNDOLGETOBJECTPTRLABELPROC)(void* ptr, GLsizei bufSize, GLsizei* length,
|
||||
GLchar* label);
|
||||
typedef void(APIENTRYP PFNDOLOBJECTLABELPROC)(GLenum identifier, GLuint name, GLsizei length,
|
||||
const GLchar* label);
|
||||
typedef void(APIENTRYP PFNDOLOBJECTPTRLABELPROC)(void* ptr, GLsizei length, const GLchar* label);
|
||||
typedef void(APIENTRYP PFNDOLPOPDEBUGGROUPPROC)(void);
|
||||
typedef void(APIENTRYP PFNDOLPUSHDEBUGGROUPPROC)(GLenum source, GLuint id, GLsizei length,
|
||||
const GLchar* message);
|
||||
|
||||
extern PFNDOLDEBUGMESSAGECALLBACKPROC dolDebugMessageCallback;
|
||||
extern PFNDOLDEBUGMESSAGECONTROLPROC dolDebugMessageControl;
|
||||
|
|
|
@ -28,13 +28,13 @@
|
|||
#define GL_PIXEL_COUNT_NV 0x8866
|
||||
#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867
|
||||
|
||||
typedef void (APIENTRYP PFNDOLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids);
|
||||
typedef void (APIENTRYP PFNDOLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids);
|
||||
typedef GLboolean (APIENTRYP PFNDOLISOCCLUSIONQUERYNVPROC) (GLuint id);
|
||||
typedef void (APIENTRYP PFNDOLBEGINOCCLUSIONQUERYNVPROC) (GLuint id);
|
||||
typedef void (APIENTRYP PFNDOLENDOCCLUSIONQUERYNVPROC) (void);
|
||||
typedef void (APIENTRYP PFNDOLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNDOLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params);
|
||||
typedef void(APIENTRYP PFNDOLGENOCCLUSIONQUERIESNVPROC)(GLsizei n, GLuint* ids);
|
||||
typedef void(APIENTRYP PFNDOLDELETEOCCLUSIONQUERIESNVPROC)(GLsizei n, const GLuint* ids);
|
||||
typedef GLboolean(APIENTRYP PFNDOLISOCCLUSIONQUERYNVPROC)(GLuint id);
|
||||
typedef void(APIENTRYP PFNDOLBEGINOCCLUSIONQUERYNVPROC)(GLuint id);
|
||||
typedef void(APIENTRYP PFNDOLENDOCCLUSIONQUERYNVPROC)(void);
|
||||
typedef void(APIENTRYP PFNDOLGETOCCLUSIONQUERYIVNVPROC)(GLuint id, GLenum pname, GLint* params);
|
||||
typedef void(APIENTRYP PFNDOLGETOCCLUSIONQUERYUIVNVPROC)(GLuint id, GLenum pname, GLuint* params);
|
||||
|
||||
extern PFNDOLGENOCCLUSIONQUERIESNVPROC dolGenOcclusionQueriesNV;
|
||||
extern PFNDOLDELETEOCCLUSIONQUERIESNVPROC dolDeleteOcclusionQueriesNV;
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
#define GL_PRIMITIVE_RESTART_NV 0x8558
|
||||
#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559
|
||||
|
||||
typedef void (APIENTRYP PFNDOLPRIMITIVERESTARTINDEXNVPROC) (GLuint index);
|
||||
typedef void (APIENTRYP PFNDOLPRIMITIVERESTARTNVPROC) (void);
|
||||
typedef void(APIENTRYP PFNDOLPRIMITIVERESTARTINDEXNVPROC)(GLuint index);
|
||||
typedef void(APIENTRYP PFNDOLPRIMITIVERESTARTNVPROC)(void);
|
||||
|
||||
extern PFNDOLPRIMITIVERESTARTINDEXNVPROC dolPrimitiveRestartIndexNV;
|
||||
extern PFNDOLPRIMITIVERESTARTNVPROC dolPrimitiveRestartNV;
|
||||
|
|
|
@ -579,7 +579,6 @@
|
|||
#define GL_SCISSOR_BIT 0x00080000
|
||||
#define GL_ALL_ATTRIB_BITS 0x000FFFFF
|
||||
|
||||
|
||||
/* OpenGL 1.1 */
|
||||
#define GL_PROXY_TEXTURE_1D 0x8063
|
||||
#define GL_PROXY_TEXTURE_2D 0x8064
|
||||
|
@ -626,342 +625,387 @@
|
|||
#define GL_ALL_CLIENT_ATTRIB_BITS 0xFFFFFFFF
|
||||
#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF
|
||||
|
||||
typedef void (APIENTRYP PFNDOLCLEARINDEXPROC) ( GLfloat c );
|
||||
typedef void (APIENTRYP PFNDOLCLEARCOLORPROC) ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha );
|
||||
typedef void (APIENTRYP PFNDOLCLEARPROC) ( GLbitfield mask );
|
||||
typedef void (APIENTRYP PFNDOLINDEXMASKPROC) ( GLuint mask );
|
||||
typedef void (APIENTRYP PFNDOLCOLORMASKPROC) ( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha );
|
||||
typedef void (APIENTRYP PFNDOLALPHAFUNCPROC) ( GLenum func, GLclampf ref );
|
||||
typedef void (APIENTRYP PFNDOLBLENDFUNCPROC) ( GLenum sfactor, GLenum dfactor );
|
||||
typedef void (APIENTRYP PFNDOLLOGICOPPROC) ( GLenum opcode );
|
||||
typedef void (APIENTRYP PFNDOLCULLFACEPROC) ( GLenum mode );
|
||||
typedef void (APIENTRYP PFNDOLFRONTFACEPROC) ( GLenum mode );
|
||||
typedef void (APIENTRYP PFNDOLPOINTSIZEPROC) ( GLfloat size );
|
||||
typedef void (APIENTRYP PFNDOLLINEWIDTHPROC) ( GLfloat width );
|
||||
typedef void (APIENTRYP PFNDOLLINESTIPPLEPROC) ( GLint factor, GLushort pattern );
|
||||
typedef void (APIENTRYP PFNDOLPOLYGONMODEPROC) ( GLenum face, GLenum mode );
|
||||
typedef void (APIENTRYP PFNDOLPOLYGONOFFSETPROC) ( GLfloat factor, GLfloat units );
|
||||
typedef void (APIENTRYP PFNDOLPOLYGONSTIPPLEPROC) ( const GLubyte *mask );
|
||||
typedef void (APIENTRYP PFNDOLGETPOLYGONSTIPPLEPROC) ( GLubyte *mask );
|
||||
typedef void (APIENTRYP PFNDOLEDGEFLAGPROC) ( GLboolean flag );
|
||||
typedef void (APIENTRYP PFNDOLEDGEFLAGVPROC) ( const GLboolean *flag );
|
||||
typedef void (APIENTRYP PFNDOLSCISSORPROC) ( GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
typedef void (APIENTRYP PFNDOLCLIPPLANEPROC) ( GLenum plane, const GLdouble *equation );
|
||||
typedef void (APIENTRYP PFNDOLGETCLIPPLANEPROC) ( GLenum plane, GLdouble *equation );
|
||||
typedef void (APIENTRYP PFNDOLDRAWBUFFERPROC) ( GLenum mode );
|
||||
typedef void (APIENTRYP PFNDOLREADBUFFERPROC) ( GLenum mode );
|
||||
typedef void (APIENTRYP PFNDOLENABLEPROC) ( GLenum cap );
|
||||
typedef void (APIENTRYP PFNDOLDISABLEPROC) ( GLenum cap );
|
||||
typedef GLboolean (APIENTRYP PFNDOLISENABLEDPROC) ( GLenum cap );
|
||||
typedef void (APIENTRYP PFNDOLENABLECLIENTSTATEPROC) ( GLenum cap ); /* 1.1 */
|
||||
typedef void (APIENTRYP PFNDOLDISABLECLIENTSTATEPROC) ( GLenum cap ); /* 1.1 */
|
||||
typedef void (APIENTRYP PFNDOLGETBOOLEANVPROC) ( GLenum pname, GLboolean *params );
|
||||
typedef void (APIENTRYP PFNDOLGETDOUBLEVPROC) ( GLenum pname, GLdouble *params );
|
||||
typedef void (APIENTRYP PFNDOLGETFLOATVPROC) ( GLenum pname, GLfloat *params );
|
||||
typedef void (APIENTRYP PFNDOLGETINTEGERVPROC) ( GLenum pname, GLint *params );
|
||||
typedef void (APIENTRYP PFNDOLPUSHATTRIBPROC) ( GLbitfield mask );
|
||||
typedef void (APIENTRYP PFNDOLPOPATTRIBPROC) ( void );
|
||||
typedef void (APIENTRYP PFNDOLPUSHCLIENTATTRIBPROC) ( GLbitfield mask ); /* 1.1 */
|
||||
typedef void (APIENTRYP PFNDOLPOPCLIENTATTRIBPROC) ( void ); /* 1.1 */
|
||||
typedef GLint (APIENTRYP PFNDOLRENDERMODEPROC) ( GLenum mode );
|
||||
typedef GLenum (APIENTRYP PFNDOLGETERRORPROC) ( void );
|
||||
typedef const GLubyte* (APIENTRYP PFNDOLGETSTRINGPROC) ( GLenum name );
|
||||
typedef void (APIENTRYP PFNDOLFINISHPROC) ( void );
|
||||
typedef void (APIENTRYP PFNDOLFLUSHPROC) ( void );
|
||||
typedef void (APIENTRYP PFNDOLHINTPROC) ( GLenum target, GLenum mode );
|
||||
typedef void (APIENTRYP PFNDOLCLEARDEPTHPROC) ( GLclampd depth );
|
||||
typedef void (APIENTRYP PFNDOLDEPTHFUNCPROC) ( GLenum func );
|
||||
typedef void (APIENTRYP PFNDOLDEPTHMASKPROC) ( GLboolean flag );
|
||||
typedef void (APIENTRYP PFNDOLDEPTHRANGEPROC) ( GLclampd near_val, GLclampd far_val );
|
||||
typedef void (APIENTRYP PFNDOLCLEARACCUMPROC) ( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha );
|
||||
typedef void (APIENTRYP PFNDOLACCUMPROC) ( GLenum op, GLfloat value );
|
||||
typedef void (APIENTRYP PFNDOLMATRIXMODEPROC) ( GLenum mode );
|
||||
typedef void (APIENTRYP PFNDOLORTHOPROC) ( GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val );
|
||||
typedef void (APIENTRYP PFNDOLFRUSTUMPROC) ( GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val );
|
||||
typedef void (APIENTRYP PFNDOLVIEWPORTPROC) ( GLint x, GLint y, GLsizei width, GLsizei height );
|
||||
typedef void (APIENTRYP PFNDOLPUSHMATRIXPROC) ( void );
|
||||
typedef void (APIENTRYP PFNDOLPOPMATRIXPROC) ( void );
|
||||
typedef void (APIENTRYP PFNDOLLOADIDENTITYPROC) ( void );
|
||||
typedef void (APIENTRYP PFNDOLLOADMATRIXDPROC) ( const GLdouble *m );
|
||||
typedef void (APIENTRYP PFNDOLLOADMATRIXFPROC) ( const GLfloat *m );
|
||||
typedef void (APIENTRYP PFNDOLMULTMATRIXDPROC) ( const GLdouble *m );
|
||||
typedef void (APIENTRYP PFNDOLMULTMATRIXFPROC) ( const GLfloat *m );
|
||||
typedef void (APIENTRYP PFNDOLROTATEDPROC) ( GLdouble angle, GLdouble x, GLdouble y, GLdouble z );
|
||||
typedef void (APIENTRYP PFNDOLROTATEFPROC) ( GLfloat angle, GLfloat x, GLfloat y, GLfloat z );
|
||||
typedef void (APIENTRYP PFNDOLSCALEDPROC) ( GLdouble x, GLdouble y, GLdouble z );
|
||||
typedef void (APIENTRYP PFNDOLSCALEFPROC) ( GLfloat x, GLfloat y, GLfloat z );
|
||||
typedef void (APIENTRYP PFNDOLTRANSLATEDPROC) ( GLdouble x, GLdouble y, GLdouble z );
|
||||
typedef void (APIENTRYP PFNDOLTRANSLATEFPROC) ( GLfloat x, GLfloat y, GLfloat z );
|
||||
typedef GLboolean (APIENTRYP PFNDOLISLISTPROC) ( GLuint list );
|
||||
typedef void (APIENTRYP PFNDOLDELETELISTSPROC) ( GLuint list, GLsizei range );
|
||||
typedef GLuint (APIENTRYP PFNDOLGENLISTSPROC) ( GLsizei range );
|
||||
typedef void (APIENTRYP PFNDOLNEWLISTPROC) ( GLuint list, GLenum mode );
|
||||
typedef void (APIENTRYP PFNDOLENDLISTPROC) ( void );
|
||||
typedef void (APIENTRYP PFNDOLCALLLISTPROC) ( GLuint list );
|
||||
typedef void (APIENTRYP PFNDOLCALLLISTSPROC) ( GLsizei n, GLenum type, const GLvoid *lists );
|
||||
typedef void (APIENTRYP PFNDOLLISTBASEPROC) ( GLuint base );
|
||||
typedef void (APIENTRYP PFNDOLBEGINPROC) ( GLenum mode );
|
||||
typedef void (APIENTRYP PFNDOLENDPROC) ( void );
|
||||
typedef void (APIENTRYP PFNDOLVERTEX2DPROC) ( GLdouble x, GLdouble y );
|
||||
typedef void (APIENTRYP PFNDOLVERTEX2FPROC) ( GLfloat x, GLfloat y );
|
||||
typedef void (APIENTRYP PFNDOLVERTEX2IPROC) ( GLint x, GLint y );
|
||||
typedef void (APIENTRYP PFNDOLVERTEX2SPROC) ( GLshort x, GLshort y );
|
||||
typedef void (APIENTRYP PFNDOLVERTEX3DPROC) ( GLdouble x, GLdouble y, GLdouble z );
|
||||
typedef void (APIENTRYP PFNDOLVERTEX3FPROC) ( GLfloat x, GLfloat y, GLfloat z );
|
||||
typedef void (APIENTRYP PFNDOLVERTEX3IPROC) ( GLint x, GLint y, GLint z );
|
||||
typedef void (APIENTRYP PFNDOLVERTEX3SPROC) ( GLshort x, GLshort y, GLshort z );
|
||||
typedef void (APIENTRYP PFNDOLVERTEX4DPROC) ( GLdouble x, GLdouble y, GLdouble z, GLdouble w );
|
||||
typedef void (APIENTRYP PFNDOLVERTEX4FPROC) ( GLfloat x, GLfloat y, GLfloat z, GLfloat w );
|
||||
typedef void (APIENTRYP PFNDOLVERTEX4IPROC) ( GLint x, GLint y, GLint z, GLint w );
|
||||
typedef void (APIENTRYP PFNDOLVERTEX4SPROC) ( GLshort x, GLshort y, GLshort z, GLshort w );
|
||||
typedef void (APIENTRYP PFNDOLVERTEX2DVPROC) ( const GLdouble *v );
|
||||
typedef void (APIENTRYP PFNDOLVERTEX2FVPROC) ( const GLfloat *v );
|
||||
typedef void (APIENTRYP PFNDOLVERTEX2IVPROC) ( const GLint *v );
|
||||
typedef void (APIENTRYP PFNDOLVERTEX2SVPROC) ( const GLshort *v );
|
||||
typedef void (APIENTRYP PFNDOLVERTEX3DVPROC) ( const GLdouble *v );
|
||||
typedef void (APIENTRYP PFNDOLVERTEX3FVPROC) ( const GLfloat *v );
|
||||
typedef void (APIENTRYP PFNDOLVERTEX3IVPROC) ( const GLint *v );
|
||||
typedef void (APIENTRYP PFNDOLVERTEX3SVPROC) ( const GLshort *v );
|
||||
typedef void (APIENTRYP PFNDOLVERTEX4DVPROC) ( const GLdouble *v );
|
||||
typedef void (APIENTRYP PFNDOLVERTEX4FVPROC) ( const GLfloat *v );
|
||||
typedef void (APIENTRYP PFNDOLVERTEX4IVPROC) ( const GLint *v );
|
||||
typedef void (APIENTRYP PFNDOLVERTEX4SVPROC) ( const GLshort *v );
|
||||
typedef void (APIENTRYP PFNDOLNORMAL3BPROC) ( GLbyte nx, GLbyte ny, GLbyte nz );
|
||||
typedef void (APIENTRYP PFNDOLNORMAL3DPROC) ( GLdouble nx, GLdouble ny, GLdouble nz );
|
||||
typedef void (APIENTRYP PFNDOLNORMAL3FPROC) ( GLfloat nx, GLfloat ny, GLfloat nz );
|
||||
typedef void (APIENTRYP PFNDOLNORMAL3IPROC) ( GLint nx, GLint ny, GLint nz );
|
||||
typedef void (APIENTRYP PFNDOLNORMAL3SPROC) ( GLshort nx, GLshort ny, GLshort nz );
|
||||
typedef void (APIENTRYP PFNDOLNORMAL3BVPROC) ( const GLbyte *v );
|
||||
typedef void (APIENTRYP PFNDOLNORMAL3DVPROC) ( const GLdouble *v );
|
||||
typedef void (APIENTRYP PFNDOLNORMAL3FVPROC) ( const GLfloat *v );
|
||||
typedef void (APIENTRYP PFNDOLNORMAL3IVPROC) ( const GLint *v );
|
||||
typedef void (APIENTRYP PFNDOLNORMAL3SVPROC) ( const GLshort *v );
|
||||
typedef void (APIENTRYP PFNDOLINDEXDPROC) ( GLdouble c );
|
||||
typedef void (APIENTRYP PFNDOLINDEXFPROC) ( GLfloat c );
|
||||
typedef void (APIENTRYP PFNDOLINDEXIPROC) ( GLint c );
|
||||
typedef void (APIENTRYP PFNDOLINDEXSPROC) ( GLshort c );
|
||||
typedef void (APIENTRYP PFNDOLINDEXUBPROC) ( GLubyte c ); /* 1.1 */
|
||||
typedef void (APIENTRYP PFNDOLINDEXDVPROC) ( const GLdouble *c );
|
||||
typedef void (APIENTRYP PFNDOLINDEXFVPROC) ( const GLfloat *c );
|
||||
typedef void (APIENTRYP PFNDOLINDEXIVPROC) ( const GLint *c );
|
||||
typedef void (APIENTRYP PFNDOLINDEXSVPROC) ( const GLshort *c );
|
||||
typedef void (APIENTRYP PFNDOLINDEXUBVPROC) ( const GLubyte *c ); /* 1.1 */
|
||||
typedef void (APIENTRYP PFNDOLCOLOR3BPROC) ( GLbyte red, GLbyte green, GLbyte blue );
|
||||
typedef void (APIENTRYP PFNDOLCOLOR3DPROC) ( GLdouble red, GLdouble green, GLdouble blue );
|
||||
typedef void (APIENTRYP PFNDOLCOLOR3FPROC) ( GLfloat red, GLfloat green, GLfloat blue );
|
||||
typedef void (APIENTRYP PFNDOLCOLOR3IPROC) ( GLint red, GLint green, GLint blue );
|
||||
typedef void (APIENTRYP PFNDOLCOLOR3SPROC) ( GLshort red, GLshort green, GLshort blue );
|
||||
typedef void (APIENTRYP PFNDOLCOLOR3UBPROC) ( GLubyte red, GLubyte green, GLubyte blue );
|
||||
typedef void (APIENTRYP PFNDOLCOLOR3UIPROC) ( GLuint red, GLuint green, GLuint blue );
|
||||
typedef void (APIENTRYP PFNDOLCOLOR3USPROC) ( GLushort red, GLushort green, GLushort blue );
|
||||
typedef void (APIENTRYP PFNDOLCOLOR4BPROC) ( GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha );
|
||||
typedef void (APIENTRYP PFNDOLCOLOR4DPROC) ( GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha );
|
||||
typedef void (APIENTRYP PFNDOLCOLOR4FPROC) ( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha );
|
||||
typedef void (APIENTRYP PFNDOLCOLOR4IPROC) ( GLint red, GLint green, GLint blue, GLint alpha );
|
||||
typedef void (APIENTRYP PFNDOLCOLOR4SPROC) ( GLshort red, GLshort green, GLshort blue, GLshort alpha );
|
||||
typedef void (APIENTRYP PFNDOLCOLOR4UBPROC) ( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha );
|
||||
typedef void (APIENTRYP PFNDOLCOLOR4UIPROC) ( GLuint red, GLuint green, GLuint blue, GLuint alpha );
|
||||
typedef void (APIENTRYP PFNDOLCOLOR4USPROC) ( GLushort red, GLushort green, GLushort blue, GLushort alpha );
|
||||
typedef void (APIENTRYP PFNDOLCOLOR3BVPROC) ( const GLbyte *v );
|
||||
typedef void (APIENTRYP PFNDOLCOLOR3DVPROC) ( const GLdouble *v );
|
||||
typedef void (APIENTRYP PFNDOLCOLOR3FVPROC) ( const GLfloat *v );
|
||||
typedef void (APIENTRYP PFNDOLCOLOR3IVPROC) ( const GLint *v );
|
||||
typedef void (APIENTRYP PFNDOLCOLOR3SVPROC) ( const GLshort *v );
|
||||
typedef void (APIENTRYP PFNDOLCOLOR3UBVPROC) ( const GLubyte *v );
|
||||
typedef void (APIENTRYP PFNDOLCOLOR3UIVPROC) ( const GLuint *v );
|
||||
typedef void (APIENTRYP PFNDOLCOLOR3USVPROC) ( const GLushort *v );
|
||||
typedef void (APIENTRYP PFNDOLCOLOR4BVPROC) ( const GLbyte *v );
|
||||
typedef void (APIENTRYP PFNDOLCOLOR4DVPROC) ( const GLdouble *v );
|
||||
typedef void (APIENTRYP PFNDOLCOLOR4FVPROC) ( const GLfloat *v );
|
||||
typedef void (APIENTRYP PFNDOLCOLOR4IVPROC) ( const GLint *v );
|
||||
typedef void (APIENTRYP PFNDOLCOLOR4SVPROC) ( const GLshort *v );
|
||||
typedef void (APIENTRYP PFNDOLCOLOR4UBVPROC) ( const GLubyte *v );
|
||||
typedef void (APIENTRYP PFNDOLCOLOR4UIVPROC) ( const GLuint *v );
|
||||
typedef void (APIENTRYP PFNDOLCOLOR4USVPROC) ( const GLushort *v );
|
||||
typedef void (APIENTRYP PFNDOLTEXCOORD1DPROC) ( GLdouble s );
|
||||
typedef void (APIENTRYP PFNDOLTEXCOORD1FPROC) ( GLfloat s );
|
||||
typedef void (APIENTRYP PFNDOLTEXCOORD1IPROC) ( GLint s );
|
||||
typedef void (APIENTRYP PFNDOLTEXCOORD1SPROC) ( GLshort s );
|
||||
typedef void (APIENTRYP PFNDOLTEXCOORD2DPROC) ( GLdouble s, GLdouble t );
|
||||
typedef void (APIENTRYP PFNDOLTEXCOORD2FPROC) ( GLfloat s, GLfloat t );
|
||||
typedef void (APIENTRYP PFNDOLTEXCOORD2IPROC) ( GLint s, GLint t );
|
||||
typedef void (APIENTRYP PFNDOLTEXCOORD2SPROC) ( GLshort s, GLshort t );
|
||||
typedef void (APIENTRYP PFNDOLTEXCOORD3DPROC) ( GLdouble s, GLdouble t, GLdouble r );
|
||||
typedef void (APIENTRYP PFNDOLTEXCOORD3FPROC) ( GLfloat s, GLfloat t, GLfloat r );
|
||||
typedef void (APIENTRYP PFNDOLTEXCOORD3IPROC) ( GLint s, GLint t, GLint r );
|
||||
typedef void (APIENTRYP PFNDOLTEXCOORD3SPROC) ( GLshort s, GLshort t, GLshort r );
|
||||
typedef void (APIENTRYP PFNDOLTEXCOORD4DPROC) ( GLdouble s, GLdouble t, GLdouble r, GLdouble q );
|
||||
typedef void (APIENTRYP PFNDOLTEXCOORD4FPROC) ( GLfloat s, GLfloat t, GLfloat r, GLfloat q );
|
||||
typedef void (APIENTRYP PFNDOLTEXCOORD4IPROC) ( GLint s, GLint t, GLint r, GLint q );
|
||||
typedef void (APIENTRYP PFNDOLTEXCOORD4SPROC) ( GLshort s, GLshort t, GLshort r, GLshort q );
|
||||
typedef void (APIENTRYP PFNDOLTEXCOORD1DVPROC) ( const GLdouble *v );
|
||||
typedef void (APIENTRYP PFNDOLTEXCOORD1FVPROC) ( const GLfloat *v );
|
||||
typedef void (APIENTRYP PFNDOLTEXCOORD1IVPROC) ( const GLint *v );
|
||||
typedef void (APIENTRYP PFNDOLTEXCOORD1SVPROC) ( const GLshort *v );
|
||||
typedef void (APIENTRYP PFNDOLTEXCOORD2DVPROC) ( const GLdouble *v );
|
||||
typedef void (APIENTRYP PFNDOLTEXCOORD2FVPROC) ( const GLfloat *v );
|
||||
typedef void (APIENTRYP PFNDOLTEXCOORD2IVPROC) ( const GLint *v );
|
||||
typedef void (APIENTRYP PFNDOLTEXCOORD2SVPROC) ( const GLshort *v );
|
||||
typedef void (APIENTRYP PFNDOLTEXCOORD3DVPROC) ( const GLdouble *v );
|
||||
typedef void (APIENTRYP PFNDOLTEXCOORD3FVPROC) ( const GLfloat *v );
|
||||
typedef void (APIENTRYP PFNDOLTEXCOORD3IVPROC) ( const GLint *v );
|
||||
typedef void (APIENTRYP PFNDOLTEXCOORD3SVPROC) ( const GLshort *v );
|
||||
typedef void (APIENTRYP PFNDOLTEXCOORD4DVPROC) ( const GLdouble *v );
|
||||
typedef void (APIENTRYP PFNDOLTEXCOORD4FVPROC) ( const GLfloat *v );
|
||||
typedef void (APIENTRYP PFNDOLTEXCOORD4IVPROC) ( const GLint *v );
|
||||
typedef void (APIENTRYP PFNDOLTEXCOORD4SVPROC) ( const GLshort *v );
|
||||
typedef void (APIENTRYP PFNDOLRASTERPOS2DPROC) ( GLdouble x, GLdouble y );
|
||||
typedef void (APIENTRYP PFNDOLRASTERPOS2FPROC) ( GLfloat x, GLfloat y );
|
||||
typedef void (APIENTRYP PFNDOLRASTERPOS2IPROC) ( GLint x, GLint y );
|
||||
typedef void (APIENTRYP PFNDOLRASTERPOS2SPROC) ( GLshort x, GLshort y );
|
||||
typedef void (APIENTRYP PFNDOLRASTERPOS3DPROC) ( GLdouble x, GLdouble y, GLdouble z );
|
||||
typedef void (APIENTRYP PFNDOLRASTERPOS3FPROC) ( GLfloat x, GLfloat y, GLfloat z );
|
||||
typedef void (APIENTRYP PFNDOLRASTERPOS3IPROC) ( GLint x, GLint y, GLint z );
|
||||
typedef void (APIENTRYP PFNDOLRASTERPOS3SPROC) ( GLshort x, GLshort y, GLshort z );
|
||||
typedef void (APIENTRYP PFNDOLRASTERPOS4DPROC) ( GLdouble x, GLdouble y, GLdouble z, GLdouble w );
|
||||
typedef void (APIENTRYP PFNDOLRASTERPOS4FPROC) ( GLfloat x, GLfloat y, GLfloat z, GLfloat w );
|
||||
typedef void (APIENTRYP PFNDOLRASTERPOS4IPROC) ( GLint x, GLint y, GLint z, GLint w );
|
||||
typedef void (APIENTRYP PFNDOLRASTERPOS4SPROC) ( GLshort x, GLshort y, GLshort z, GLshort w );
|
||||
typedef void (APIENTRYP PFNDOLRASTERPOS2DVPROC) ( const GLdouble *v );
|
||||
typedef void (APIENTRYP PFNDOLRASTERPOS2FVPROC) ( const GLfloat *v );
|
||||
typedef void (APIENTRYP PFNDOLRASTERPOS2IVPROC) ( const GLint *v );
|
||||
typedef void (APIENTRYP PFNDOLRASTERPOS2SVPROC) ( const GLshort *v );
|
||||
typedef void (APIENTRYP PFNDOLRASTERPOS3DVPROC) ( const GLdouble *v );
|
||||
typedef void (APIENTRYP PFNDOLRASTERPOS3FVPROC) ( const GLfloat *v );
|
||||
typedef void (APIENTRYP PFNDOLRASTERPOS3IVPROC) ( const GLint *v );
|
||||
typedef void (APIENTRYP PFNDOLRASTERPOS3SVPROC) ( const GLshort *v );
|
||||
typedef void (APIENTRYP PFNDOLRASTERPOS4DVPROC) ( const GLdouble *v );
|
||||
typedef void (APIENTRYP PFNDOLRASTERPOS4FVPROC) ( const GLfloat *v );
|
||||
typedef void (APIENTRYP PFNDOLRASTERPOS4IVPROC) ( const GLint *v );
|
||||
typedef void (APIENTRYP PFNDOLRASTERPOS4SVPROC) ( const GLshort *v );
|
||||
typedef void (APIENTRYP PFNDOLRECTDPROC) ( GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2 );
|
||||
typedef void (APIENTRYP PFNDOLRECTFPROC) ( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 );
|
||||
typedef void (APIENTRYP PFNDOLRECTIPROC) ( GLint x1, GLint y1, GLint x2, GLint y2 );
|
||||
typedef void (APIENTRYP PFNDOLRECTSPROC) ( GLshort x1, GLshort y1, GLshort x2, GLshort y2 );
|
||||
typedef void (APIENTRYP PFNDOLRECTDVPROC) ( const GLdouble *v1, const GLdouble *v2 );
|
||||
typedef void (APIENTRYP PFNDOLRECTFVPROC) ( const GLfloat *v1, const GLfloat *v2 );
|
||||
typedef void (APIENTRYP PFNDOLRECTIVPROC) ( const GLint *v1, const GLint *v2 );
|
||||
typedef void (APIENTRYP PFNDOLRECTSVPROC) ( const GLshort *v1, const GLshort *v2 );
|
||||
typedef void (APIENTRYP PFNDOLVERTEXPOINTERPROC) ( GLint size, GLenum type, GLsizei stride, const GLvoid *ptr );
|
||||
typedef void (APIENTRYP PFNDOLNORMALPOINTERPROC) ( GLenum type, GLsizei stride, const GLvoid *ptr );
|
||||
typedef void (APIENTRYP PFNDOLCOLORPOINTERPROC) ( GLint size, GLenum type, GLsizei stride, const GLvoid *ptr );
|
||||
typedef void (APIENTRYP PFNDOLINDEXPOINTERPROC) ( GLenum type, GLsizei stride, const GLvoid *ptr );
|
||||
typedef void (APIENTRYP PFNDOLTEXCOORDPOINTERPROC) ( GLint size, GLenum type, GLsizei stride, const GLvoid *ptr );
|
||||
typedef void (APIENTRYP PFNDOLEDGEFLAGPOINTERPROC) ( GLsizei stride, const GLvoid *ptr );
|
||||
typedef void (APIENTRYP PFNDOLGETPOINTERVPROC) ( GLenum pname, GLvoid **params );
|
||||
typedef void (APIENTRYP PFNDOLARRAYELEMENTPROC) ( GLint i );
|
||||
typedef void (APIENTRYP PFNDOLDRAWARRAYSPROC) ( GLenum mode, GLint first, GLsizei count );
|
||||
typedef void (APIENTRYP PFNDOLDRAWELEMENTSPROC) ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices );
|
||||
typedef void (APIENTRYP PFNDOLINTERLEAVEDARRAYSPROC) ( GLenum format, GLsizei stride, const GLvoid *pointer );
|
||||
typedef void (APIENTRYP PFNDOLSHADEMODELPROC) ( GLenum mode );
|
||||
typedef void (APIENTRYP PFNDOLLIGHTFPROC) ( GLenum light, GLenum pname, GLfloat param );
|
||||
typedef void (APIENTRYP PFNDOLLIGHTIPROC) ( GLenum light, GLenum pname, GLint param );
|
||||
typedef void (APIENTRYP PFNDOLLIGHTFVPROC) ( GLenum light, GLenum pname, const GLfloat *params );
|
||||
typedef void (APIENTRYP PFNDOLLIGHTIVPROC) ( GLenum light, GLenum pname, const GLint *params );
|
||||
typedef void (APIENTRYP PFNDOLGETLIGHTFVPROC) ( GLenum light, GLenum pname, GLfloat *params );
|
||||
typedef void (APIENTRYP PFNDOLGETLIGHTIVPROC) ( GLenum light, GLenum pname, GLint *params );
|
||||
typedef void (APIENTRYP PFNDOLLIGHTMODELFPROC) ( GLenum pname, GLfloat param );
|
||||
typedef void (APIENTRYP PFNDOLLIGHTMODELIPROC) ( GLenum pname, GLint param );
|
||||
typedef void (APIENTRYP PFNDOLLIGHTMODELFVPROC) ( GLenum pname, const GLfloat *params );
|
||||
typedef void (APIENTRYP PFNDOLLIGHTMODELIVPROC) ( GLenum pname, const GLint *params );
|
||||
typedef void (APIENTRYP PFNDOLMATERIALFPROC) ( GLenum face, GLenum pname, GLfloat param );
|
||||
typedef void (APIENTRYP PFNDOLMATERIALIPROC) ( GLenum face, GLenum pname, GLint param );
|
||||
typedef void (APIENTRYP PFNDOLMATERIALFVPROC) ( GLenum face, GLenum pname, const GLfloat *params );
|
||||
typedef void (APIENTRYP PFNDOLMATERIALIVPROC) ( GLenum face, GLenum pname, const GLint *params );
|
||||
typedef void (APIENTRYP PFNDOLGETMATERIALFVPROC) ( GLenum face, GLenum pname, GLfloat *params );
|
||||
typedef void (APIENTRYP PFNDOLGETMATERIALIVPROC) ( GLenum face, GLenum pname, GLint *params );
|
||||
typedef void (APIENTRYP PFNDOLCOLORMATERIALPROC) ( GLenum face, GLenum mode );
|
||||
typedef void (APIENTRYP PFNDOLPIXELZOOMPROC) ( GLfloat xfactor, GLfloat yfactor );
|
||||
typedef void (APIENTRYP PFNDOLPIXELSTOREFPROC) ( GLenum pname, GLfloat param );
|
||||
typedef void (APIENTRYP PFNDOLPIXELSTOREIPROC) ( GLenum pname, GLint param );
|
||||
typedef void (APIENTRYP PFNDOLPIXELTRANSFERFPROC) ( GLenum pname, GLfloat param );
|
||||
typedef void (APIENTRYP PFNDOLPIXELTRANSFERIPROC) ( GLenum pname, GLint param );
|
||||
typedef void (APIENTRYP PFNDOLPIXELMAPFVPROC) ( GLenum map, GLsizei mapsize, const GLfloat *values );
|
||||
typedef void (APIENTRYP PFNDOLPIXELMAPUIVPROC) ( GLenum map, GLsizei mapsize, const GLuint *values );
|
||||
typedef void (APIENTRYP PFNDOLPIXELMAPUSVPROC) ( GLenum map, GLsizei mapsize, const GLushort *values );
|
||||
typedef void (APIENTRYP PFNDOLGETPIXELMAPFVPROC) ( GLenum map, GLfloat *values );
|
||||
typedef void (APIENTRYP PFNDOLGETPIXELMAPUIVPROC) ( GLenum map, GLuint *values );
|
||||
typedef void (APIENTRYP PFNDOLGETPIXELMAPUSVPROC) ( GLenum map, GLushort *values );
|
||||
typedef void (APIENTRYP PFNDOLBITMAPPROC) ( GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap );
|
||||
typedef void (APIENTRYP PFNDOLREADPIXELSPROC) ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels );
|
||||
typedef void (APIENTRYP PFNDOLDRAWPIXELSPROC) ( GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels );
|
||||
typedef void (APIENTRYP PFNDOLCOPYPIXELSPROC) ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum type );
|
||||
typedef void (APIENTRYP PFNDOLSTENCILFUNCPROC) ( GLenum func, GLint ref, GLuint mask );
|
||||
typedef void (APIENTRYP PFNDOLSTENCILMASKPROC) ( GLuint mask );
|
||||
typedef void (APIENTRYP PFNDOLSTENCILOPPROC) ( GLenum fail, GLenum zfail, GLenum zpass );
|
||||
typedef void (APIENTRYP PFNDOLCLEARSTENCILPROC) ( GLint s );
|
||||
typedef void (APIENTRYP PFNDOLTEXGENDPROC) ( GLenum coord, GLenum pname, GLdouble param );
|
||||
typedef void (APIENTRYP PFNDOLTEXGENFPROC) ( GLenum coord, GLenum pname, GLfloat param );
|
||||
typedef void (APIENTRYP PFNDOLTEXGENIPROC) ( GLenum coord, GLenum pname, GLint param );
|
||||
typedef void (APIENTRYP PFNDOLTEXGENDVPROC) ( GLenum coord, GLenum pname, const GLdouble *params );
|
||||
typedef void (APIENTRYP PFNDOLTEXGENFVPROC) ( GLenum coord, GLenum pname, const GLfloat *params );
|
||||
typedef void (APIENTRYP PFNDOLTEXGENIVPROC) ( GLenum coord, GLenum pname, const GLint *params );
|
||||
typedef void (APIENTRYP PFNDOLGETTEXGENDVPROC) ( GLenum coord, GLenum pname, GLdouble *params );
|
||||
typedef void (APIENTRYP PFNDOLGETTEXGENFVPROC) ( GLenum coord, GLenum pname, GLfloat *params );
|
||||
typedef void (APIENTRYP PFNDOLGETTEXGENIVPROC) ( GLenum coord, GLenum pname, GLint *params );
|
||||
typedef void (APIENTRYP PFNDOLTEXENVFPROC) ( GLenum target, GLenum pname, GLfloat param );
|
||||
typedef void (APIENTRYP PFNDOLTEXENVIPROC) ( GLenum target, GLenum pname, GLint param );
|
||||
typedef void (APIENTRYP PFNDOLTEXENVFVPROC) ( GLenum target, GLenum pname, const GLfloat *params );
|
||||
typedef void (APIENTRYP PFNDOLTEXENVIVPROC) ( GLenum target, GLenum pname, const GLint *params );
|
||||
typedef void (APIENTRYP PFNDOLGETTEXENVFVPROC) ( GLenum target, GLenum pname, GLfloat *params );
|
||||
typedef void (APIENTRYP PFNDOLGETTEXENVIVPROC) ( GLenum target, GLenum pname, GLint *params );
|
||||
typedef void (APIENTRYP PFNDOLTEXPARAMETERFPROC) ( GLenum target, GLenum pname, GLfloat param );
|
||||
typedef void (APIENTRYP PFNDOLTEXPARAMETERIPROC) ( GLenum target, GLenum pname, GLint param );
|
||||
typedef void (APIENTRYP PFNDOLTEXPARAMETERFVPROC) ( GLenum target, GLenum pname, const GLfloat *params );
|
||||
typedef void (APIENTRYP PFNDOLTEXPARAMETERIVPROC) ( GLenum target, GLenum pname, const GLint *params );
|
||||
typedef void (APIENTRYP PFNDOLGETTEXPARAMETERFVPROC) ( GLenum target, GLenum pname, GLfloat *params);
|
||||
typedef void (APIENTRYP PFNDOLGETTEXPARAMETERIVPROC) ( GLenum target, GLenum pname, GLint *params );
|
||||
typedef void (APIENTRYP PFNDOLGETTEXLEVELPARAMETERFVPROC) ( GLenum target, GLint level, GLenum pname, GLfloat *params );
|
||||
typedef void (APIENTRYP PFNDOLGETTEXLEVELPARAMETERIVPROC) ( GLenum target, GLint level, GLenum pname, GLint *params );
|
||||
typedef void (APIENTRYP PFNDOLTEXIMAGE1DPROC) ( GLenum target, GLint level, GLint internalFormat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels );
|
||||
typedef void (APIENTRYP PFNDOLTEXIMAGE2DPROC) ( GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels );
|
||||
typedef void (APIENTRYP PFNDOLGETTEXIMAGEPROC) ( GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels );
|
||||
typedef void (APIENTRYP PFNDOLGENTEXTURESPROC) ( GLsizei n, GLuint *textures );
|
||||
typedef void (APIENTRYP PFNDOLDELETETEXTURESPROC) ( GLsizei n, const GLuint *textures);
|
||||
typedef void (APIENTRYP PFNDOLBINDTEXTUREPROC) ( GLenum target, GLuint texture );
|
||||
typedef void (APIENTRYP PFNDOLPRIORITIZETEXTURESPROC) ( GLsizei n, const GLuint *textures, const GLclampf *priorities );
|
||||
typedef GLboolean (APIENTRYP PFNDOLARETEXTURESRESIDENTPROC) ( GLsizei n, const GLuint *textures, GLboolean *residences );
|
||||
typedef GLboolean (APIENTRYP PFNDOLISTEXTUREPROC) ( GLuint texture );
|
||||
typedef void (APIENTRYP PFNDOLTEXSUBIMAGE1DPROC) ( GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels );
|
||||
typedef void (APIENTRYP PFNDOLTEXSUBIMAGE2DPROC) ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels );
|
||||
typedef void (APIENTRYP PFNDOLCOPYTEXIMAGE1DPROC) ( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border );
|
||||
typedef void (APIENTRYP PFNDOLCOPYTEXIMAGE2DPROC) ( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border );
|
||||
typedef void (APIENTRYP PFNDOLCOPYTEXSUBIMAGE1DPROC) ( GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width );
|
||||
typedef void (APIENTRYP PFNDOLCOPYTEXSUBIMAGE2DPROC) ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height );
|
||||
typedef void (APIENTRYP PFNDOLMAP1DPROC) ( GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points );
|
||||
typedef void (APIENTRYP PFNDOLMAP1FPROC) ( GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points );
|
||||
typedef void (APIENTRYP PFNDOLMAP2DPROC) ( GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points );
|
||||
typedef void (APIENTRYP PFNDOLMAP2FPROC) ( GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points );
|
||||
typedef void (APIENTRYP PFNDOLGETMAPDVPROC) ( GLenum target, GLenum query, GLdouble *v );
|
||||
typedef void (APIENTRYP PFNDOLGETMAPFVPROC) ( GLenum target, GLenum query, GLfloat *v );
|
||||
typedef void (APIENTRYP PFNDOLGETMAPIVPROC) ( GLenum target, GLenum query, GLint *v );
|
||||
typedef void (APIENTRYP PFNDOLEVALCOORD1DPROC) ( GLdouble u );
|
||||
typedef void (APIENTRYP PFNDOLEVALCOORD1FPROC) ( GLfloat u );
|
||||
typedef void (APIENTRYP PFNDOLEVALCOORD1DVPROC) ( const GLdouble *u );
|
||||
typedef void (APIENTRYP PFNDOLEVALCOORD1FVPROC) ( const GLfloat *u );
|
||||
typedef void (APIENTRYP PFNDOLEVALCOORD2DPROC) ( GLdouble u, GLdouble v );
|
||||
typedef void (APIENTRYP PFNDOLEVALCOORD2FPROC) ( GLfloat u, GLfloat v );
|
||||
typedef void (APIENTRYP PFNDOLEVALCOORD2DVPROC) ( const GLdouble *u );
|
||||
typedef void (APIENTRYP PFNDOLEVALCOORD2FVPROC) ( const GLfloat *u );
|
||||
typedef void (APIENTRYP PFNDOLMAPGRID1DPROC) ( GLint un, GLdouble u1, GLdouble u2 );
|
||||
typedef void (APIENTRYP PFNDOLMAPGRID1FPROC) ( GLint un, GLfloat u1, GLfloat u2 );
|
||||
typedef void (APIENTRYP PFNDOLMAPGRID2DPROC) ( GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2 );
|
||||
typedef void (APIENTRYP PFNDOLMAPGRID2FPROC) ( GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2 );
|
||||
typedef void (APIENTRYP PFNDOLEVALPOINT1PROC) ( GLint i );
|
||||
typedef void (APIENTRYP PFNDOLEVALPOINT2PROC) ( GLint i, GLint j );
|
||||
typedef void (APIENTRYP PFNDOLEVALMESH1PROC) ( GLenum mode, GLint i1, GLint i2 );
|
||||
typedef void (APIENTRYP PFNDOLEVALMESH2PROC) ( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 );
|
||||
typedef void (APIENTRYP PFNDOLFOGFPROC) ( GLenum pname, GLfloat param );
|
||||
typedef void (APIENTRYP PFNDOLFOGIPROC) ( GLenum pname, GLint param );
|
||||
typedef void (APIENTRYP PFNDOLFOGFVPROC) ( GLenum pname, const GLfloat *params );
|
||||
typedef void (APIENTRYP PFNDOLFOGIVPROC) ( GLenum pname, const GLint *params );
|
||||
typedef void (APIENTRYP PFNDOLFEEDBACKBUFFERPROC) ( GLsizei size, GLenum type, GLfloat *buffer );
|
||||
typedef void (APIENTRYP PFNDOLPASSTHROUGHPROC) ( GLfloat token );
|
||||
typedef void (APIENTRYP PFNDOLSELECTBUFFERPROC) ( GLsizei size, GLuint *buffer );
|
||||
typedef void (APIENTRYP PFNDOLINITNAMESPROC) ( void );
|
||||
typedef void (APIENTRYP PFNDOLLOADNAMEPROC) ( GLuint name );
|
||||
typedef void (APIENTRYP PFNDOLPUSHNAMEPROC) ( GLuint name );
|
||||
typedef void (APIENTRYP PFNDOLPOPNAMEPROC) ( void );
|
||||
typedef void(APIENTRYP PFNDOLCLEARINDEXPROC)(GLfloat c);
|
||||
typedef void(APIENTRYP PFNDOLCLEARCOLORPROC)(GLclampf red, GLclampf green, GLclampf blue,
|
||||
GLclampf alpha);
|
||||
typedef void(APIENTRYP PFNDOLCLEARPROC)(GLbitfield mask);
|
||||
typedef void(APIENTRYP PFNDOLINDEXMASKPROC)(GLuint mask);
|
||||
typedef void(APIENTRYP PFNDOLCOLORMASKPROC)(GLboolean red, GLboolean green, GLboolean blue,
|
||||
GLboolean alpha);
|
||||
typedef void(APIENTRYP PFNDOLALPHAFUNCPROC)(GLenum func, GLclampf ref);
|
||||
typedef void(APIENTRYP PFNDOLBLENDFUNCPROC)(GLenum sfactor, GLenum dfactor);
|
||||
typedef void(APIENTRYP PFNDOLLOGICOPPROC)(GLenum opcode);
|
||||
typedef void(APIENTRYP PFNDOLCULLFACEPROC)(GLenum mode);
|
||||
typedef void(APIENTRYP PFNDOLFRONTFACEPROC)(GLenum mode);
|
||||
typedef void(APIENTRYP PFNDOLPOINTSIZEPROC)(GLfloat size);
|
||||
typedef void(APIENTRYP PFNDOLLINEWIDTHPROC)(GLfloat width);
|
||||
typedef void(APIENTRYP PFNDOLLINESTIPPLEPROC)(GLint factor, GLushort pattern);
|
||||
typedef void(APIENTRYP PFNDOLPOLYGONMODEPROC)(GLenum face, GLenum mode);
|
||||
typedef void(APIENTRYP PFNDOLPOLYGONOFFSETPROC)(GLfloat factor, GLfloat units);
|
||||
typedef void(APIENTRYP PFNDOLPOLYGONSTIPPLEPROC)(const GLubyte* mask);
|
||||
typedef void(APIENTRYP PFNDOLGETPOLYGONSTIPPLEPROC)(GLubyte* mask);
|
||||
typedef void(APIENTRYP PFNDOLEDGEFLAGPROC)(GLboolean flag);
|
||||
typedef void(APIENTRYP PFNDOLEDGEFLAGVPROC)(const GLboolean* flag);
|
||||
typedef void(APIENTRYP PFNDOLSCISSORPROC)(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
typedef void(APIENTRYP PFNDOLCLIPPLANEPROC)(GLenum plane, const GLdouble* equation);
|
||||
typedef void(APIENTRYP PFNDOLGETCLIPPLANEPROC)(GLenum plane, GLdouble* equation);
|
||||
typedef void(APIENTRYP PFNDOLDRAWBUFFERPROC)(GLenum mode);
|
||||
typedef void(APIENTRYP PFNDOLREADBUFFERPROC)(GLenum mode);
|
||||
typedef void(APIENTRYP PFNDOLENABLEPROC)(GLenum cap);
|
||||
typedef void(APIENTRYP PFNDOLDISABLEPROC)(GLenum cap);
|
||||
typedef GLboolean(APIENTRYP PFNDOLISENABLEDPROC)(GLenum cap);
|
||||
typedef void(APIENTRYP PFNDOLENABLECLIENTSTATEPROC)(GLenum cap); /* 1.1 */
|
||||
typedef void(APIENTRYP PFNDOLDISABLECLIENTSTATEPROC)(GLenum cap); /* 1.1 */
|
||||
typedef void(APIENTRYP PFNDOLGETBOOLEANVPROC)(GLenum pname, GLboolean* params);
|
||||
typedef void(APIENTRYP PFNDOLGETDOUBLEVPROC)(GLenum pname, GLdouble* params);
|
||||
typedef void(APIENTRYP PFNDOLGETFLOATVPROC)(GLenum pname, GLfloat* params);
|
||||
typedef void(APIENTRYP PFNDOLGETINTEGERVPROC)(GLenum pname, GLint* params);
|
||||
typedef void(APIENTRYP PFNDOLPUSHATTRIBPROC)(GLbitfield mask);
|
||||
typedef void(APIENTRYP PFNDOLPOPATTRIBPROC)(void);
|
||||
typedef void(APIENTRYP PFNDOLPUSHCLIENTATTRIBPROC)(GLbitfield mask); /* 1.1 */
|
||||
typedef void(APIENTRYP PFNDOLPOPCLIENTATTRIBPROC)(void); /* 1.1 */
|
||||
typedef GLint(APIENTRYP PFNDOLRENDERMODEPROC)(GLenum mode);
|
||||
typedef GLenum(APIENTRYP PFNDOLGETERRORPROC)(void);
|
||||
typedef const GLubyte*(APIENTRYP PFNDOLGETSTRINGPROC)(GLenum name);
|
||||
typedef void(APIENTRYP PFNDOLFINISHPROC)(void);
|
||||
typedef void(APIENTRYP PFNDOLFLUSHPROC)(void);
|
||||
typedef void(APIENTRYP PFNDOLHINTPROC)(GLenum target, GLenum mode);
|
||||
typedef void(APIENTRYP PFNDOLCLEARDEPTHPROC)(GLclampd depth);
|
||||
typedef void(APIENTRYP PFNDOLDEPTHFUNCPROC)(GLenum func);
|
||||
typedef void(APIENTRYP PFNDOLDEPTHMASKPROC)(GLboolean flag);
|
||||
typedef void(APIENTRYP PFNDOLDEPTHRANGEPROC)(GLclampd near_val, GLclampd far_val);
|
||||
typedef void(APIENTRYP PFNDOLCLEARACCUMPROC)(GLfloat red, GLfloat green, GLfloat blue,
|
||||
GLfloat alpha);
|
||||
typedef void(APIENTRYP PFNDOLACCUMPROC)(GLenum op, GLfloat value);
|
||||
typedef void(APIENTRYP PFNDOLMATRIXMODEPROC)(GLenum mode);
|
||||
typedef void(APIENTRYP PFNDOLORTHOPROC)(GLdouble left, GLdouble right, GLdouble bottom,
|
||||
GLdouble top, GLdouble near_val, GLdouble far_val);
|
||||
typedef void(APIENTRYP PFNDOLFRUSTUMPROC)(GLdouble left, GLdouble right, GLdouble bottom,
|
||||
GLdouble top, GLdouble near_val, GLdouble far_val);
|
||||
typedef void(APIENTRYP PFNDOLVIEWPORTPROC)(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
typedef void(APIENTRYP PFNDOLPUSHMATRIXPROC)(void);
|
||||
typedef void(APIENTRYP PFNDOLPOPMATRIXPROC)(void);
|
||||
typedef void(APIENTRYP PFNDOLLOADIDENTITYPROC)(void);
|
||||
typedef void(APIENTRYP PFNDOLLOADMATRIXDPROC)(const GLdouble* m);
|
||||
typedef void(APIENTRYP PFNDOLLOADMATRIXFPROC)(const GLfloat* m);
|
||||
typedef void(APIENTRYP PFNDOLMULTMATRIXDPROC)(const GLdouble* m);
|
||||
typedef void(APIENTRYP PFNDOLMULTMATRIXFPROC)(const GLfloat* m);
|
||||
typedef void(APIENTRYP PFNDOLROTATEDPROC)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
|
||||
typedef void(APIENTRYP PFNDOLROTATEFPROC)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
|
||||
typedef void(APIENTRYP PFNDOLSCALEDPROC)(GLdouble x, GLdouble y, GLdouble z);
|
||||
typedef void(APIENTRYP PFNDOLSCALEFPROC)(GLfloat x, GLfloat y, GLfloat z);
|
||||
typedef void(APIENTRYP PFNDOLTRANSLATEDPROC)(GLdouble x, GLdouble y, GLdouble z);
|
||||
typedef void(APIENTRYP PFNDOLTRANSLATEFPROC)(GLfloat x, GLfloat y, GLfloat z);
|
||||
typedef GLboolean(APIENTRYP PFNDOLISLISTPROC)(GLuint list);
|
||||
typedef void(APIENTRYP PFNDOLDELETELISTSPROC)(GLuint list, GLsizei range);
|
||||
typedef GLuint(APIENTRYP PFNDOLGENLISTSPROC)(GLsizei range);
|
||||
typedef void(APIENTRYP PFNDOLNEWLISTPROC)(GLuint list, GLenum mode);
|
||||
typedef void(APIENTRYP PFNDOLENDLISTPROC)(void);
|
||||
typedef void(APIENTRYP PFNDOLCALLLISTPROC)(GLuint list);
|
||||
typedef void(APIENTRYP PFNDOLCALLLISTSPROC)(GLsizei n, GLenum type, const GLvoid* lists);
|
||||
typedef void(APIENTRYP PFNDOLLISTBASEPROC)(GLuint base);
|
||||
typedef void(APIENTRYP PFNDOLBEGINPROC)(GLenum mode);
|
||||
typedef void(APIENTRYP PFNDOLENDPROC)(void);
|
||||
typedef void(APIENTRYP PFNDOLVERTEX2DPROC)(GLdouble x, GLdouble y);
|
||||
typedef void(APIENTRYP PFNDOLVERTEX2FPROC)(GLfloat x, GLfloat y);
|
||||
typedef void(APIENTRYP PFNDOLVERTEX2IPROC)(GLint x, GLint y);
|
||||
typedef void(APIENTRYP PFNDOLVERTEX2SPROC)(GLshort x, GLshort y);
|
||||
typedef void(APIENTRYP PFNDOLVERTEX3DPROC)(GLdouble x, GLdouble y, GLdouble z);
|
||||
typedef void(APIENTRYP PFNDOLVERTEX3FPROC)(GLfloat x, GLfloat y, GLfloat z);
|
||||
typedef void(APIENTRYP PFNDOLVERTEX3IPROC)(GLint x, GLint y, GLint z);
|
||||
typedef void(APIENTRYP PFNDOLVERTEX3SPROC)(GLshort x, GLshort y, GLshort z);
|
||||
typedef void(APIENTRYP PFNDOLVERTEX4DPROC)(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
|
||||
typedef void(APIENTRYP PFNDOLVERTEX4FPROC)(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
typedef void(APIENTRYP PFNDOLVERTEX4IPROC)(GLint x, GLint y, GLint z, GLint w);
|
||||
typedef void(APIENTRYP PFNDOLVERTEX4SPROC)(GLshort x, GLshort y, GLshort z, GLshort w);
|
||||
typedef void(APIENTRYP PFNDOLVERTEX2DVPROC)(const GLdouble* v);
|
||||
typedef void(APIENTRYP PFNDOLVERTEX2FVPROC)(const GLfloat* v);
|
||||
typedef void(APIENTRYP PFNDOLVERTEX2IVPROC)(const GLint* v);
|
||||
typedef void(APIENTRYP PFNDOLVERTEX2SVPROC)(const GLshort* v);
|
||||
typedef void(APIENTRYP PFNDOLVERTEX3DVPROC)(const GLdouble* v);
|
||||
typedef void(APIENTRYP PFNDOLVERTEX3FVPROC)(const GLfloat* v);
|
||||
typedef void(APIENTRYP PFNDOLVERTEX3IVPROC)(const GLint* v);
|
||||
typedef void(APIENTRYP PFNDOLVERTEX3SVPROC)(const GLshort* v);
|
||||
typedef void(APIENTRYP PFNDOLVERTEX4DVPROC)(const GLdouble* v);
|
||||
typedef void(APIENTRYP PFNDOLVERTEX4FVPROC)(const GLfloat* v);
|
||||
typedef void(APIENTRYP PFNDOLVERTEX4IVPROC)(const GLint* v);
|
||||
typedef void(APIENTRYP PFNDOLVERTEX4SVPROC)(const GLshort* v);
|
||||
typedef void(APIENTRYP PFNDOLNORMAL3BPROC)(GLbyte nx, GLbyte ny, GLbyte nz);
|
||||
typedef void(APIENTRYP PFNDOLNORMAL3DPROC)(GLdouble nx, GLdouble ny, GLdouble nz);
|
||||
typedef void(APIENTRYP PFNDOLNORMAL3FPROC)(GLfloat nx, GLfloat ny, GLfloat nz);
|
||||
typedef void(APIENTRYP PFNDOLNORMAL3IPROC)(GLint nx, GLint ny, GLint nz);
|
||||
typedef void(APIENTRYP PFNDOLNORMAL3SPROC)(GLshort nx, GLshort ny, GLshort nz);
|
||||
typedef void(APIENTRYP PFNDOLNORMAL3BVPROC)(const GLbyte* v);
|
||||
typedef void(APIENTRYP PFNDOLNORMAL3DVPROC)(const GLdouble* v);
|
||||
typedef void(APIENTRYP PFNDOLNORMAL3FVPROC)(const GLfloat* v);
|
||||
typedef void(APIENTRYP PFNDOLNORMAL3IVPROC)(const GLint* v);
|
||||
typedef void(APIENTRYP PFNDOLNORMAL3SVPROC)(const GLshort* v);
|
||||
typedef void(APIENTRYP PFNDOLINDEXDPROC)(GLdouble c);
|
||||
typedef void(APIENTRYP PFNDOLINDEXFPROC)(GLfloat c);
|
||||
typedef void(APIENTRYP PFNDOLINDEXIPROC)(GLint c);
|
||||
typedef void(APIENTRYP PFNDOLINDEXSPROC)(GLshort c);
|
||||
typedef void(APIENTRYP PFNDOLINDEXUBPROC)(GLubyte c); /* 1.1 */
|
||||
typedef void(APIENTRYP PFNDOLINDEXDVPROC)(const GLdouble* c);
|
||||
typedef void(APIENTRYP PFNDOLINDEXFVPROC)(const GLfloat* c);
|
||||
typedef void(APIENTRYP PFNDOLINDEXIVPROC)(const GLint* c);
|
||||
typedef void(APIENTRYP PFNDOLINDEXSVPROC)(const GLshort* c);
|
||||
typedef void(APIENTRYP PFNDOLINDEXUBVPROC)(const GLubyte* c); /* 1.1 */
|
||||
typedef void(APIENTRYP PFNDOLCOLOR3BPROC)(GLbyte red, GLbyte green, GLbyte blue);
|
||||
typedef void(APIENTRYP PFNDOLCOLOR3DPROC)(GLdouble red, GLdouble green, GLdouble blue);
|
||||
typedef void(APIENTRYP PFNDOLCOLOR3FPROC)(GLfloat red, GLfloat green, GLfloat blue);
|
||||
typedef void(APIENTRYP PFNDOLCOLOR3IPROC)(GLint red, GLint green, GLint blue);
|
||||
typedef void(APIENTRYP PFNDOLCOLOR3SPROC)(GLshort red, GLshort green, GLshort blue);
|
||||
typedef void(APIENTRYP PFNDOLCOLOR3UBPROC)(GLubyte red, GLubyte green, GLubyte blue);
|
||||
typedef void(APIENTRYP PFNDOLCOLOR3UIPROC)(GLuint red, GLuint green, GLuint blue);
|
||||
typedef void(APIENTRYP PFNDOLCOLOR3USPROC)(GLushort red, GLushort green, GLushort blue);
|
||||
typedef void(APIENTRYP PFNDOLCOLOR4BPROC)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha);
|
||||
typedef void(APIENTRYP PFNDOLCOLOR4DPROC)(GLdouble red, GLdouble green, GLdouble blue,
|
||||
GLdouble alpha);
|
||||
typedef void(APIENTRYP PFNDOLCOLOR4FPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
|
||||
typedef void(APIENTRYP PFNDOLCOLOR4IPROC)(GLint red, GLint green, GLint blue, GLint alpha);
|
||||
typedef void(APIENTRYP PFNDOLCOLOR4SPROC)(GLshort red, GLshort green, GLshort blue, GLshort alpha);
|
||||
typedef void(APIENTRYP PFNDOLCOLOR4UBPROC)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
|
||||
typedef void(APIENTRYP PFNDOLCOLOR4UIPROC)(GLuint red, GLuint green, GLuint blue, GLuint alpha);
|
||||
typedef void(APIENTRYP PFNDOLCOLOR4USPROC)(GLushort red, GLushort green, GLushort blue,
|
||||
GLushort alpha);
|
||||
typedef void(APIENTRYP PFNDOLCOLOR3BVPROC)(const GLbyte* v);
|
||||
typedef void(APIENTRYP PFNDOLCOLOR3DVPROC)(const GLdouble* v);
|
||||
typedef void(APIENTRYP PFNDOLCOLOR3FVPROC)(const GLfloat* v);
|
||||
typedef void(APIENTRYP PFNDOLCOLOR3IVPROC)(const GLint* v);
|
||||
typedef void(APIENTRYP PFNDOLCOLOR3SVPROC)(const GLshort* v);
|
||||
typedef void(APIENTRYP PFNDOLCOLOR3UBVPROC)(const GLubyte* v);
|
||||
typedef void(APIENTRYP PFNDOLCOLOR3UIVPROC)(const GLuint* v);
|
||||
typedef void(APIENTRYP PFNDOLCOLOR3USVPROC)(const GLushort* v);
|
||||
typedef void(APIENTRYP PFNDOLCOLOR4BVPROC)(const GLbyte* v);
|
||||
typedef void(APIENTRYP PFNDOLCOLOR4DVPROC)(const GLdouble* v);
|
||||
typedef void(APIENTRYP PFNDOLCOLOR4FVPROC)(const GLfloat* v);
|
||||
typedef void(APIENTRYP PFNDOLCOLOR4IVPROC)(const GLint* v);
|
||||
typedef void(APIENTRYP PFNDOLCOLOR4SVPROC)(const GLshort* v);
|
||||
typedef void(APIENTRYP PFNDOLCOLOR4UBVPROC)(const GLubyte* v);
|
||||
typedef void(APIENTRYP PFNDOLCOLOR4UIVPROC)(const GLuint* v);
|
||||
typedef void(APIENTRYP PFNDOLCOLOR4USVPROC)(const GLushort* v);
|
||||
typedef void(APIENTRYP PFNDOLTEXCOORD1DPROC)(GLdouble s);
|
||||
typedef void(APIENTRYP PFNDOLTEXCOORD1FPROC)(GLfloat s);
|
||||
typedef void(APIENTRYP PFNDOLTEXCOORD1IPROC)(GLint s);
|
||||
typedef void(APIENTRYP PFNDOLTEXCOORD1SPROC)(GLshort s);
|
||||
typedef void(APIENTRYP PFNDOLTEXCOORD2DPROC)(GLdouble s, GLdouble t);
|
||||
typedef void(APIENTRYP PFNDOLTEXCOORD2FPROC)(GLfloat s, GLfloat t);
|
||||
typedef void(APIENTRYP PFNDOLTEXCOORD2IPROC)(GLint s, GLint t);
|
||||
typedef void(APIENTRYP PFNDOLTEXCOORD2SPROC)(GLshort s, GLshort t);
|
||||
typedef void(APIENTRYP PFNDOLTEXCOORD3DPROC)(GLdouble s, GLdouble t, GLdouble r);
|
||||
typedef void(APIENTRYP PFNDOLTEXCOORD3FPROC)(GLfloat s, GLfloat t, GLfloat r);
|
||||
typedef void(APIENTRYP PFNDOLTEXCOORD3IPROC)(GLint s, GLint t, GLint r);
|
||||
typedef void(APIENTRYP PFNDOLTEXCOORD3SPROC)(GLshort s, GLshort t, GLshort r);
|
||||
typedef void(APIENTRYP PFNDOLTEXCOORD4DPROC)(GLdouble s, GLdouble t, GLdouble r, GLdouble q);
|
||||
typedef void(APIENTRYP PFNDOLTEXCOORD4FPROC)(GLfloat s, GLfloat t, GLfloat r, GLfloat q);
|
||||
typedef void(APIENTRYP PFNDOLTEXCOORD4IPROC)(GLint s, GLint t, GLint r, GLint q);
|
||||
typedef void(APIENTRYP PFNDOLTEXCOORD4SPROC)(GLshort s, GLshort t, GLshort r, GLshort q);
|
||||
typedef void(APIENTRYP PFNDOLTEXCOORD1DVPROC)(const GLdouble* v);
|
||||
typedef void(APIENTRYP PFNDOLTEXCOORD1FVPROC)(const GLfloat* v);
|
||||
typedef void(APIENTRYP PFNDOLTEXCOORD1IVPROC)(const GLint* v);
|
||||
typedef void(APIENTRYP PFNDOLTEXCOORD1SVPROC)(const GLshort* v);
|
||||
typedef void(APIENTRYP PFNDOLTEXCOORD2DVPROC)(const GLdouble* v);
|
||||
typedef void(APIENTRYP PFNDOLTEXCOORD2FVPROC)(const GLfloat* v);
|
||||
typedef void(APIENTRYP PFNDOLTEXCOORD2IVPROC)(const GLint* v);
|
||||
typedef void(APIENTRYP PFNDOLTEXCOORD2SVPROC)(const GLshort* v);
|
||||
typedef void(APIENTRYP PFNDOLTEXCOORD3DVPROC)(const GLdouble* v);
|
||||
typedef void(APIENTRYP PFNDOLTEXCOORD3FVPROC)(const GLfloat* v);
|
||||
typedef void(APIENTRYP PFNDOLTEXCOORD3IVPROC)(const GLint* v);
|
||||
typedef void(APIENTRYP PFNDOLTEXCOORD3SVPROC)(const GLshort* v);
|
||||
typedef void(APIENTRYP PFNDOLTEXCOORD4DVPROC)(const GLdouble* v);
|
||||
typedef void(APIENTRYP PFNDOLTEXCOORD4FVPROC)(const GLfloat* v);
|
||||
typedef void(APIENTRYP PFNDOLTEXCOORD4IVPROC)(const GLint* v);
|
||||
typedef void(APIENTRYP PFNDOLTEXCOORD4SVPROC)(const GLshort* v);
|
||||
typedef void(APIENTRYP PFNDOLRASTERPOS2DPROC)(GLdouble x, GLdouble y);
|
||||
typedef void(APIENTRYP PFNDOLRASTERPOS2FPROC)(GLfloat x, GLfloat y);
|
||||
typedef void(APIENTRYP PFNDOLRASTERPOS2IPROC)(GLint x, GLint y);
|
||||
typedef void(APIENTRYP PFNDOLRASTERPOS2SPROC)(GLshort x, GLshort y);
|
||||
typedef void(APIENTRYP PFNDOLRASTERPOS3DPROC)(GLdouble x, GLdouble y, GLdouble z);
|
||||
typedef void(APIENTRYP PFNDOLRASTERPOS3FPROC)(GLfloat x, GLfloat y, GLfloat z);
|
||||
typedef void(APIENTRYP PFNDOLRASTERPOS3IPROC)(GLint x, GLint y, GLint z);
|
||||
typedef void(APIENTRYP PFNDOLRASTERPOS3SPROC)(GLshort x, GLshort y, GLshort z);
|
||||
typedef void(APIENTRYP PFNDOLRASTERPOS4DPROC)(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
|
||||
typedef void(APIENTRYP PFNDOLRASTERPOS4FPROC)(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
typedef void(APIENTRYP PFNDOLRASTERPOS4IPROC)(GLint x, GLint y, GLint z, GLint w);
|
||||
typedef void(APIENTRYP PFNDOLRASTERPOS4SPROC)(GLshort x, GLshort y, GLshort z, GLshort w);
|
||||
typedef void(APIENTRYP PFNDOLRASTERPOS2DVPROC)(const GLdouble* v);
|
||||
typedef void(APIENTRYP PFNDOLRASTERPOS2FVPROC)(const GLfloat* v);
|
||||
typedef void(APIENTRYP PFNDOLRASTERPOS2IVPROC)(const GLint* v);
|
||||
typedef void(APIENTRYP PFNDOLRASTERPOS2SVPROC)(const GLshort* v);
|
||||
typedef void(APIENTRYP PFNDOLRASTERPOS3DVPROC)(const GLdouble* v);
|
||||
typedef void(APIENTRYP PFNDOLRASTERPOS3FVPROC)(const GLfloat* v);
|
||||
typedef void(APIENTRYP PFNDOLRASTERPOS3IVPROC)(const GLint* v);
|
||||
typedef void(APIENTRYP PFNDOLRASTERPOS3SVPROC)(const GLshort* v);
|
||||
typedef void(APIENTRYP PFNDOLRASTERPOS4DVPROC)(const GLdouble* v);
|
||||
typedef void(APIENTRYP PFNDOLRASTERPOS4FVPROC)(const GLfloat* v);
|
||||
typedef void(APIENTRYP PFNDOLRASTERPOS4IVPROC)(const GLint* v);
|
||||
typedef void(APIENTRYP PFNDOLRASTERPOS4SVPROC)(const GLshort* v);
|
||||
typedef void(APIENTRYP PFNDOLRECTDPROC)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2);
|
||||
typedef void(APIENTRYP PFNDOLRECTFPROC)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
|
||||
typedef void(APIENTRYP PFNDOLRECTIPROC)(GLint x1, GLint y1, GLint x2, GLint y2);
|
||||
typedef void(APIENTRYP PFNDOLRECTSPROC)(GLshort x1, GLshort y1, GLshort x2, GLshort y2);
|
||||
typedef void(APIENTRYP PFNDOLRECTDVPROC)(const GLdouble* v1, const GLdouble* v2);
|
||||
typedef void(APIENTRYP PFNDOLRECTFVPROC)(const GLfloat* v1, const GLfloat* v2);
|
||||
typedef void(APIENTRYP PFNDOLRECTIVPROC)(const GLint* v1, const GLint* v2);
|
||||
typedef void(APIENTRYP PFNDOLRECTSVPROC)(const GLshort* v1, const GLshort* v2);
|
||||
typedef void(APIENTRYP PFNDOLVERTEXPOINTERPROC)(GLint size, GLenum type, GLsizei stride,
|
||||
const GLvoid* ptr);
|
||||
typedef void(APIENTRYP PFNDOLNORMALPOINTERPROC)(GLenum type, GLsizei stride, const GLvoid* ptr);
|
||||
typedef void(APIENTRYP PFNDOLCOLORPOINTERPROC)(GLint size, GLenum type, GLsizei stride,
|
||||
const GLvoid* ptr);
|
||||
typedef void(APIENTRYP PFNDOLINDEXPOINTERPROC)(GLenum type, GLsizei stride, const GLvoid* ptr);
|
||||
typedef void(APIENTRYP PFNDOLTEXCOORDPOINTERPROC)(GLint size, GLenum type, GLsizei stride,
|
||||
const GLvoid* ptr);
|
||||
typedef void(APIENTRYP PFNDOLEDGEFLAGPOINTERPROC)(GLsizei stride, const GLvoid* ptr);
|
||||
typedef void(APIENTRYP PFNDOLGETPOINTERVPROC)(GLenum pname, GLvoid** params);
|
||||
typedef void(APIENTRYP PFNDOLARRAYELEMENTPROC)(GLint i);
|
||||
typedef void(APIENTRYP PFNDOLDRAWARRAYSPROC)(GLenum mode, GLint first, GLsizei count);
|
||||
typedef void(APIENTRYP PFNDOLDRAWELEMENTSPROC)(GLenum mode, GLsizei count, GLenum type,
|
||||
const GLvoid* indices);
|
||||
typedef void(APIENTRYP PFNDOLINTERLEAVEDARRAYSPROC)(GLenum format, GLsizei stride,
|
||||
const GLvoid* pointer);
|
||||
typedef void(APIENTRYP PFNDOLSHADEMODELPROC)(GLenum mode);
|
||||
typedef void(APIENTRYP PFNDOLLIGHTFPROC)(GLenum light, GLenum pname, GLfloat param);
|
||||
typedef void(APIENTRYP PFNDOLLIGHTIPROC)(GLenum light, GLenum pname, GLint param);
|
||||
typedef void(APIENTRYP PFNDOLLIGHTFVPROC)(GLenum light, GLenum pname, const GLfloat* params);
|
||||
typedef void(APIENTRYP PFNDOLLIGHTIVPROC)(GLenum light, GLenum pname, const GLint* params);
|
||||
typedef void(APIENTRYP PFNDOLGETLIGHTFVPROC)(GLenum light, GLenum pname, GLfloat* params);
|
||||
typedef void(APIENTRYP PFNDOLGETLIGHTIVPROC)(GLenum light, GLenum pname, GLint* params);
|
||||
typedef void(APIENTRYP PFNDOLLIGHTMODELFPROC)(GLenum pname, GLfloat param);
|
||||
typedef void(APIENTRYP PFNDOLLIGHTMODELIPROC)(GLenum pname, GLint param);
|
||||
typedef void(APIENTRYP PFNDOLLIGHTMODELFVPROC)(GLenum pname, const GLfloat* params);
|
||||
typedef void(APIENTRYP PFNDOLLIGHTMODELIVPROC)(GLenum pname, const GLint* params);
|
||||
typedef void(APIENTRYP PFNDOLMATERIALFPROC)(GLenum face, GLenum pname, GLfloat param);
|
||||
typedef void(APIENTRYP PFNDOLMATERIALIPROC)(GLenum face, GLenum pname, GLint param);
|
||||
typedef void(APIENTRYP PFNDOLMATERIALFVPROC)(GLenum face, GLenum pname, const GLfloat* params);
|
||||
typedef void(APIENTRYP PFNDOLMATERIALIVPROC)(GLenum face, GLenum pname, const GLint* params);
|
||||
typedef void(APIENTRYP PFNDOLGETMATERIALFVPROC)(GLenum face, GLenum pname, GLfloat* params);
|
||||
typedef void(APIENTRYP PFNDOLGETMATERIALIVPROC)(GLenum face, GLenum pname, GLint* params);
|
||||
typedef void(APIENTRYP PFNDOLCOLORMATERIALPROC)(GLenum face, GLenum mode);
|
||||
typedef void(APIENTRYP PFNDOLPIXELZOOMPROC)(GLfloat xfactor, GLfloat yfactor);
|
||||
typedef void(APIENTRYP PFNDOLPIXELSTOREFPROC)(GLenum pname, GLfloat param);
|
||||
typedef void(APIENTRYP PFNDOLPIXELSTOREIPROC)(GLenum pname, GLint param);
|
||||
typedef void(APIENTRYP PFNDOLPIXELTRANSFERFPROC)(GLenum pname, GLfloat param);
|
||||
typedef void(APIENTRYP PFNDOLPIXELTRANSFERIPROC)(GLenum pname, GLint param);
|
||||
typedef void(APIENTRYP PFNDOLPIXELMAPFVPROC)(GLenum map, GLsizei mapsize, const GLfloat* values);
|
||||
typedef void(APIENTRYP PFNDOLPIXELMAPUIVPROC)(GLenum map, GLsizei mapsize, const GLuint* values);
|
||||
typedef void(APIENTRYP PFNDOLPIXELMAPUSVPROC)(GLenum map, GLsizei mapsize, const GLushort* values);
|
||||
typedef void(APIENTRYP PFNDOLGETPIXELMAPFVPROC)(GLenum map, GLfloat* values);
|
||||
typedef void(APIENTRYP PFNDOLGETPIXELMAPUIVPROC)(GLenum map, GLuint* values);
|
||||
typedef void(APIENTRYP PFNDOLGETPIXELMAPUSVPROC)(GLenum map, GLushort* values);
|
||||
typedef void(APIENTRYP PFNDOLBITMAPPROC)(GLsizei width, GLsizei height, GLfloat xorig,
|
||||
GLfloat yorig, GLfloat xmove, GLfloat ymove,
|
||||
const GLubyte* bitmap);
|
||||
typedef void(APIENTRYP PFNDOLREADPIXELSPROC)(GLint x, GLint y, GLsizei width, GLsizei height,
|
||||
GLenum format, GLenum type, GLvoid* pixels);
|
||||
typedef void(APIENTRYP PFNDOLDRAWPIXELSPROC)(GLsizei width, GLsizei height, GLenum format,
|
||||
GLenum type, const GLvoid* pixels);
|
||||
typedef void(APIENTRYP PFNDOLCOPYPIXELSPROC)(GLint x, GLint y, GLsizei width, GLsizei height,
|
||||
GLenum type);
|
||||
typedef void(APIENTRYP PFNDOLSTENCILFUNCPROC)(GLenum func, GLint ref, GLuint mask);
|
||||
typedef void(APIENTRYP PFNDOLSTENCILMASKPROC)(GLuint mask);
|
||||
typedef void(APIENTRYP PFNDOLSTENCILOPPROC)(GLenum fail, GLenum zfail, GLenum zpass);
|
||||
typedef void(APIENTRYP PFNDOLCLEARSTENCILPROC)(GLint s);
|
||||
typedef void(APIENTRYP PFNDOLTEXGENDPROC)(GLenum coord, GLenum pname, GLdouble param);
|
||||
typedef void(APIENTRYP PFNDOLTEXGENFPROC)(GLenum coord, GLenum pname, GLfloat param);
|
||||
typedef void(APIENTRYP PFNDOLTEXGENIPROC)(GLenum coord, GLenum pname, GLint param);
|
||||
typedef void(APIENTRYP PFNDOLTEXGENDVPROC)(GLenum coord, GLenum pname, const GLdouble* params);
|
||||
typedef void(APIENTRYP PFNDOLTEXGENFVPROC)(GLenum coord, GLenum pname, const GLfloat* params);
|
||||
typedef void(APIENTRYP PFNDOLTEXGENIVPROC)(GLenum coord, GLenum pname, const GLint* params);
|
||||
typedef void(APIENTRYP PFNDOLGETTEXGENDVPROC)(GLenum coord, GLenum pname, GLdouble* params);
|
||||
typedef void(APIENTRYP PFNDOLGETTEXGENFVPROC)(GLenum coord, GLenum pname, GLfloat* params);
|
||||
typedef void(APIENTRYP PFNDOLGETTEXGENIVPROC)(GLenum coord, GLenum pname, GLint* params);
|
||||
typedef void(APIENTRYP PFNDOLTEXENVFPROC)(GLenum target, GLenum pname, GLfloat param);
|
||||
typedef void(APIENTRYP PFNDOLTEXENVIPROC)(GLenum target, GLenum pname, GLint param);
|
||||
typedef void(APIENTRYP PFNDOLTEXENVFVPROC)(GLenum target, GLenum pname, const GLfloat* params);
|
||||
typedef void(APIENTRYP PFNDOLTEXENVIVPROC)(GLenum target, GLenum pname, const GLint* params);
|
||||
typedef void(APIENTRYP PFNDOLGETTEXENVFVPROC)(GLenum target, GLenum pname, GLfloat* params);
|
||||
typedef void(APIENTRYP PFNDOLGETTEXENVIVPROC)(GLenum target, GLenum pname, GLint* params);
|
||||
typedef void(APIENTRYP PFNDOLTEXPARAMETERFPROC)(GLenum target, GLenum pname, GLfloat param);
|
||||
typedef void(APIENTRYP PFNDOLTEXPARAMETERIPROC)(GLenum target, GLenum pname, GLint param);
|
||||
typedef void(APIENTRYP PFNDOLTEXPARAMETERFVPROC)(GLenum target, GLenum pname,
|
||||
const GLfloat* params);
|
||||
typedef void(APIENTRYP PFNDOLTEXPARAMETERIVPROC)(GLenum target, GLenum pname, const GLint* params);
|
||||
typedef void(APIENTRYP PFNDOLGETTEXPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat* params);
|
||||
typedef void(APIENTRYP PFNDOLGETTEXPARAMETERIVPROC)(GLenum target, GLenum pname, GLint* params);
|
||||
typedef void(APIENTRYP PFNDOLGETTEXLEVELPARAMETERFVPROC)(GLenum target, GLint level, GLenum pname,
|
||||
GLfloat* params);
|
||||
typedef void(APIENTRYP PFNDOLGETTEXLEVELPARAMETERIVPROC)(GLenum target, GLint level, GLenum pname,
|
||||
GLint* params);
|
||||
typedef void(APIENTRYP PFNDOLTEXIMAGE1DPROC)(GLenum target, GLint level, GLint internalFormat,
|
||||
GLsizei width, GLint border, GLenum format,
|
||||
GLenum type, const GLvoid* pixels);
|
||||
typedef void(APIENTRYP PFNDOLTEXIMAGE2DPROC)(GLenum target, GLint level, GLint internalFormat,
|
||||
GLsizei width, GLsizei height, GLint border,
|
||||
GLenum format, GLenum type, const GLvoid* pixels);
|
||||
typedef void(APIENTRYP PFNDOLGETTEXIMAGEPROC)(GLenum target, GLint level, GLenum format,
|
||||
GLenum type, GLvoid* pixels);
|
||||
typedef void(APIENTRYP PFNDOLGENTEXTURESPROC)(GLsizei n, GLuint* textures);
|
||||
typedef void(APIENTRYP PFNDOLDELETETEXTURESPROC)(GLsizei n, const GLuint* textures);
|
||||
typedef void(APIENTRYP PFNDOLBINDTEXTUREPROC)(GLenum target, GLuint texture);
|
||||
typedef void(APIENTRYP PFNDOLPRIORITIZETEXTURESPROC)(GLsizei n, const GLuint* textures,
|
||||
const GLclampf* priorities);
|
||||
typedef GLboolean(APIENTRYP PFNDOLARETEXTURESRESIDENTPROC)(GLsizei n, const GLuint* textures,
|
||||
GLboolean* residences);
|
||||
typedef GLboolean(APIENTRYP PFNDOLISTEXTUREPROC)(GLuint texture);
|
||||
typedef void(APIENTRYP PFNDOLTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset,
|
||||
GLsizei width, GLenum format, GLenum type,
|
||||
const GLvoid* pixels);
|
||||
typedef void(APIENTRYP PFNDOLTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset,
|
||||
GLint yoffset, GLsizei width, GLsizei height,
|
||||
GLenum format, GLenum type, const GLvoid* pixels);
|
||||
typedef void(APIENTRYP PFNDOLCOPYTEXIMAGE1DPROC)(GLenum target, GLint level, GLenum internalformat,
|
||||
GLint x, GLint y, GLsizei width, GLint border);
|
||||
typedef void(APIENTRYP PFNDOLCOPYTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat,
|
||||
GLint x, GLint y, GLsizei width, GLsizei height,
|
||||
GLint border);
|
||||
typedef void(APIENTRYP PFNDOLCOPYTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset,
|
||||
GLint x, GLint y, GLsizei width);
|
||||
typedef void(APIENTRYP PFNDOLCOPYTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset,
|
||||
GLint yoffset, GLint x, GLint y, GLsizei width,
|
||||
GLsizei height);
|
||||
typedef void(APIENTRYP PFNDOLMAP1DPROC)(GLenum target, GLdouble u1, GLdouble u2, GLint stride,
|
||||
GLint order, const GLdouble* points);
|
||||
typedef void(APIENTRYP PFNDOLMAP1FPROC)(GLenum target, GLfloat u1, GLfloat u2, GLint stride,
|
||||
GLint order, const GLfloat* points);
|
||||
typedef void(APIENTRYP PFNDOLMAP2DPROC)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride,
|
||||
GLint uorder, GLdouble v1, GLdouble v2, GLint vstride,
|
||||
GLint vorder, const GLdouble* points);
|
||||
typedef void(APIENTRYP PFNDOLMAP2FPROC)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride,
|
||||
GLint uorder, GLfloat v1, GLfloat v2, GLint vstride,
|
||||
GLint vorder, const GLfloat* points);
|
||||
typedef void(APIENTRYP PFNDOLGETMAPDVPROC)(GLenum target, GLenum query, GLdouble* v);
|
||||
typedef void(APIENTRYP PFNDOLGETMAPFVPROC)(GLenum target, GLenum query, GLfloat* v);
|
||||
typedef void(APIENTRYP PFNDOLGETMAPIVPROC)(GLenum target, GLenum query, GLint* v);
|
||||
typedef void(APIENTRYP PFNDOLEVALCOORD1DPROC)(GLdouble u);
|
||||
typedef void(APIENTRYP PFNDOLEVALCOORD1FPROC)(GLfloat u);
|
||||
typedef void(APIENTRYP PFNDOLEVALCOORD1DVPROC)(const GLdouble* u);
|
||||
typedef void(APIENTRYP PFNDOLEVALCOORD1FVPROC)(const GLfloat* u);
|
||||
typedef void(APIENTRYP PFNDOLEVALCOORD2DPROC)(GLdouble u, GLdouble v);
|
||||
typedef void(APIENTRYP PFNDOLEVALCOORD2FPROC)(GLfloat u, GLfloat v);
|
||||
typedef void(APIENTRYP PFNDOLEVALCOORD2DVPROC)(const GLdouble* u);
|
||||
typedef void(APIENTRYP PFNDOLEVALCOORD2FVPROC)(const GLfloat* u);
|
||||
typedef void(APIENTRYP PFNDOLMAPGRID1DPROC)(GLint un, GLdouble u1, GLdouble u2);
|
||||
typedef void(APIENTRYP PFNDOLMAPGRID1FPROC)(GLint un, GLfloat u1, GLfloat u2);
|
||||
typedef void(APIENTRYP PFNDOLMAPGRID2DPROC)(GLint un, GLdouble u1, GLdouble u2, GLint vn,
|
||||
GLdouble v1, GLdouble v2);
|
||||
typedef void(APIENTRYP PFNDOLMAPGRID2FPROC)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1,
|
||||
GLfloat v2);
|
||||
typedef void(APIENTRYP PFNDOLEVALPOINT1PROC)(GLint i);
|
||||
typedef void(APIENTRYP PFNDOLEVALPOINT2PROC)(GLint i, GLint j);
|
||||
typedef void(APIENTRYP PFNDOLEVALMESH1PROC)(GLenum mode, GLint i1, GLint i2);
|
||||
typedef void(APIENTRYP PFNDOLEVALMESH2PROC)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2);
|
||||
typedef void(APIENTRYP PFNDOLFOGFPROC)(GLenum pname, GLfloat param);
|
||||
typedef void(APIENTRYP PFNDOLFOGIPROC)(GLenum pname, GLint param);
|
||||
typedef void(APIENTRYP PFNDOLFOGFVPROC)(GLenum pname, const GLfloat* params);
|
||||
typedef void(APIENTRYP PFNDOLFOGIVPROC)(GLenum pname, const GLint* params);
|
||||
typedef void(APIENTRYP PFNDOLFEEDBACKBUFFERPROC)(GLsizei size, GLenum type, GLfloat* buffer);
|
||||
typedef void(APIENTRYP PFNDOLPASSTHROUGHPROC)(GLfloat token);
|
||||
typedef void(APIENTRYP PFNDOLSELECTBUFFERPROC)(GLsizei size, GLuint* buffer);
|
||||
typedef void(APIENTRYP PFNDOLINITNAMESPROC)(void);
|
||||
typedef void(APIENTRYP PFNDOLLOADNAMEPROC)(GLuint name);
|
||||
typedef void(APIENTRYP PFNDOLPUSHNAMEPROC)(GLuint name);
|
||||
typedef void(APIENTRYP PFNDOLPOPNAMEPROC)(void);
|
||||
|
||||
extern PFNDOLCLEARINDEXPROC dolClearIndex;
|
||||
extern PFNDOLCLEARCOLORPROC dolClearColor;
|
||||
|
|
|
@ -65,10 +65,20 @@
|
|||
#define GL_MAX_3D_TEXTURE_SIZE 0x8073
|
||||
#define GL_TEXTURE_BINDING_3D 0x806A
|
||||
|
||||
typedef void (APIENTRYP PFNDOLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
|
||||
typedef void (APIENTRYP PFNDOLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
typedef void (APIENTRYP PFNDOLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
typedef void (APIENTRYP PFNDOLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
typedef void(APIENTRYP PFNDOLDRAWRANGEELEMENTSPROC)(GLenum mode, GLuint start, GLuint end,
|
||||
GLsizei count, GLenum type,
|
||||
const GLvoid* indices);
|
||||
typedef void(APIENTRYP PFNDOLTEXIMAGE3DPROC)(GLenum target, GLint level, GLint internalformat,
|
||||
GLsizei width, GLsizei height, GLsizei depth,
|
||||
GLint border, GLenum format, GLenum type,
|
||||
const GLvoid* pixels);
|
||||
typedef void(APIENTRYP PFNDOLTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset,
|
||||
GLint yoffset, GLint zoffset, GLsizei width,
|
||||
GLsizei height, GLsizei depth, GLenum format,
|
||||
GLenum type, const GLvoid* pixels);
|
||||
typedef void(APIENTRYP PFNDOLCOPYTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset,
|
||||
GLint yoffset, GLint zoffset, GLint x, GLint y,
|
||||
GLsizei width, GLsizei height);
|
||||
|
||||
extern PFNDOLCOPYTEXSUBIMAGE3DPROC dolCopyTexSubImage3D;
|
||||
extern PFNDOLDRAWRANGEELEMENTSPROC dolDrawRangeElements;
|
||||
|
|
|
@ -128,55 +128,80 @@
|
|||
/* texture_border_clamp */
|
||||
#define GL_CLAMP_TO_BORDER 0x812D
|
||||
|
||||
typedef void (APIENTRYP PFNDOLACTIVETEXTUREPROC) (GLenum texture);
|
||||
typedef void (APIENTRYP PFNDOLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert);
|
||||
typedef void (APIENTRYP PFNDOLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
typedef void (APIENTRYP PFNDOLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
typedef void (APIENTRYP PFNDOLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
typedef void (APIENTRYP PFNDOLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
typedef void (APIENTRYP PFNDOLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
typedef void (APIENTRYP PFNDOLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
typedef void (APIENTRYP PFNDOLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img);
|
||||
typedef void(APIENTRYP PFNDOLACTIVETEXTUREPROC)(GLenum texture);
|
||||
typedef void(APIENTRYP PFNDOLSAMPLECOVERAGEPROC)(GLclampf value, GLboolean invert);
|
||||
typedef void(APIENTRYP PFNDOLCOMPRESSEDTEXIMAGE3DPROC)(GLenum target, GLint level,
|
||||
GLenum internalformat, GLsizei width,
|
||||
GLsizei height, GLsizei depth, GLint border,
|
||||
GLsizei imageSize, const GLvoid* data);
|
||||
typedef void(APIENTRYP PFNDOLCOMPRESSEDTEXIMAGE2DPROC)(GLenum target, GLint level,
|
||||
GLenum internalformat, GLsizei width,
|
||||
GLsizei height, GLint border,
|
||||
GLsizei imageSize, const GLvoid* data);
|
||||
typedef void(APIENTRYP PFNDOLCOMPRESSEDTEXIMAGE1DPROC)(GLenum target, GLint level,
|
||||
GLenum internalformat, GLsizei width,
|
||||
GLint border, GLsizei imageSize,
|
||||
const GLvoid* data);
|
||||
typedef void(APIENTRYP PFNDOLCOMPRESSEDTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset,
|
||||
GLint yoffset, GLint zoffset,
|
||||
GLsizei width, GLsizei height,
|
||||
GLsizei depth, GLenum format,
|
||||
GLsizei imageSize, const GLvoid* data);
|
||||
typedef void(APIENTRYP PFNDOLCOMPRESSEDTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset,
|
||||
GLint yoffset, GLsizei width,
|
||||
GLsizei height, GLenum format,
|
||||
GLsizei imageSize, const GLvoid* data);
|
||||
typedef void(APIENTRYP PFNDOLCOMPRESSEDTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset,
|
||||
GLsizei width, GLenum format,
|
||||
GLsizei imageSize, const GLvoid* data);
|
||||
typedef void(APIENTRYP PFNDOLGETCOMPRESSEDTEXIMAGEPROC)(GLenum target, GLint level, GLvoid* img);
|
||||
|
||||
typedef void (APIENTRYP PFNDOLACTIVETEXTUREARBPROC) (GLenum texture);
|
||||
typedef void (APIENTRYP PFNDOLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
|
||||
typedef void (APIENTRYP PFNDOLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
|
||||
typedef void (APIENTRYP PFNDOLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
|
||||
typedef void (APIENTRYP PFNDOLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);
|
||||
typedef void (APIENTRYP PFNDOLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);
|
||||
typedef void (APIENTRYP PFNDOLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);
|
||||
typedef void (APIENTRYP PFNDOLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);
|
||||
typedef void (APIENTRYP PFNDOLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);
|
||||
typedef void (APIENTRYP PFNDOLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);
|
||||
typedef void (APIENTRYP PFNDOLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);
|
||||
typedef void (APIENTRYP PFNDOLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);
|
||||
typedef void (APIENTRYP PFNDOLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
|
||||
typedef void (APIENTRYP PFNDOLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);
|
||||
typedef void (APIENTRYP PFNDOLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);
|
||||
typedef void (APIENTRYP PFNDOLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);
|
||||
typedef void (APIENTRYP PFNDOLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);
|
||||
typedef void (APIENTRYP PFNDOLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);
|
||||
typedef void (APIENTRYP PFNDOLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
|
||||
typedef void (APIENTRYP PFNDOLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);
|
||||
typedef void (APIENTRYP PFNDOLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
|
||||
typedef void (APIENTRYP PFNDOLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);
|
||||
typedef void (APIENTRYP PFNDOLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);
|
||||
typedef void (APIENTRYP PFNDOLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);
|
||||
typedef void (APIENTRYP PFNDOLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
|
||||
typedef void (APIENTRYP PFNDOLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);
|
||||
typedef void (APIENTRYP PFNDOLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
|
||||
typedef void (APIENTRYP PFNDOLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);
|
||||
typedef void (APIENTRYP PFNDOLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
|
||||
typedef void (APIENTRYP PFNDOLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);
|
||||
typedef void (APIENTRYP PFNDOLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
|
||||
typedef void (APIENTRYP PFNDOLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);
|
||||
typedef void (APIENTRYP PFNDOLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
|
||||
typedef void (APIENTRYP PFNDOLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);
|
||||
typedef void (APIENTRYP PFNDOLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
|
||||
typedef void (APIENTRYP PFNDOLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
|
||||
typedef void (APIENTRYP PFNDOLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
|
||||
typedef void (APIENTRYP PFNDOLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
|
||||
typedef void (APIENTRYP PFNDOLSAMPLECOVERAGEARBPROC) (GLfloat value, GLboolean invert);
|
||||
typedef void(APIENTRYP PFNDOLACTIVETEXTUREARBPROC)(GLenum texture);
|
||||
typedef void(APIENTRYP PFNDOLCLIENTACTIVETEXTUREARBPROC)(GLenum texture);
|
||||
typedef void(APIENTRYP PFNDOLMULTITEXCOORD1DARBPROC)(GLenum target, GLdouble s);
|
||||
typedef void(APIENTRYP PFNDOLMULTITEXCOORD1DVARBPROC)(GLenum target, const GLdouble* v);
|
||||
typedef void(APIENTRYP PFNDOLMULTITEXCOORD1FARBPROC)(GLenum target, GLfloat s);
|
||||
typedef void(APIENTRYP PFNDOLMULTITEXCOORD1FVARBPROC)(GLenum target, const GLfloat* v);
|
||||
typedef void(APIENTRYP PFNDOLMULTITEXCOORD1IARBPROC)(GLenum target, GLint s);
|
||||
typedef void(APIENTRYP PFNDOLMULTITEXCOORD1IVARBPROC)(GLenum target, const GLint* v);
|
||||
typedef void(APIENTRYP PFNDOLMULTITEXCOORD1SARBPROC)(GLenum target, GLshort s);
|
||||
typedef void(APIENTRYP PFNDOLMULTITEXCOORD1SVARBPROC)(GLenum target, const GLshort* v);
|
||||
typedef void(APIENTRYP PFNDOLMULTITEXCOORD2DARBPROC)(GLenum target, GLdouble s, GLdouble t);
|
||||
typedef void(APIENTRYP PFNDOLMULTITEXCOORD2DVARBPROC)(GLenum target, const GLdouble* v);
|
||||
typedef void(APIENTRYP PFNDOLMULTITEXCOORD2FARBPROC)(GLenum target, GLfloat s, GLfloat t);
|
||||
typedef void(APIENTRYP PFNDOLMULTITEXCOORD2FVARBPROC)(GLenum target, const GLfloat* v);
|
||||
typedef void(APIENTRYP PFNDOLMULTITEXCOORD2IARBPROC)(GLenum target, GLint s, GLint t);
|
||||
typedef void(APIENTRYP PFNDOLMULTITEXCOORD2IVARBPROC)(GLenum target, const GLint* v);
|
||||
typedef void(APIENTRYP PFNDOLMULTITEXCOORD2SARBPROC)(GLenum target, GLshort s, GLshort t);
|
||||
typedef void(APIENTRYP PFNDOLMULTITEXCOORD2SVARBPROC)(GLenum target, const GLshort* v);
|
||||
typedef void(APIENTRYP PFNDOLMULTITEXCOORD3DARBPROC)(GLenum target, GLdouble s, GLdouble t,
|
||||
GLdouble r);
|
||||
typedef void(APIENTRYP PFNDOLMULTITEXCOORD3DVARBPROC)(GLenum target, const GLdouble* v);
|
||||
typedef void(APIENTRYP PFNDOLMULTITEXCOORD3FARBPROC)(GLenum target, GLfloat s, GLfloat t,
|
||||
GLfloat r);
|
||||
typedef void(APIENTRYP PFNDOLMULTITEXCOORD3FVARBPROC)(GLenum target, const GLfloat* v);
|
||||
typedef void(APIENTRYP PFNDOLMULTITEXCOORD3IARBPROC)(GLenum target, GLint s, GLint t, GLint r);
|
||||
typedef void(APIENTRYP PFNDOLMULTITEXCOORD3IVARBPROC)(GLenum target, const GLint* v);
|
||||
typedef void(APIENTRYP PFNDOLMULTITEXCOORD3SARBPROC)(GLenum target, GLshort s, GLshort t,
|
||||
GLshort r);
|
||||
typedef void(APIENTRYP PFNDOLMULTITEXCOORD3SVARBPROC)(GLenum target, const GLshort* v);
|
||||
typedef void(APIENTRYP PFNDOLMULTITEXCOORD4DARBPROC)(GLenum target, GLdouble s, GLdouble t,
|
||||
GLdouble r, GLdouble q);
|
||||
typedef void(APIENTRYP PFNDOLMULTITEXCOORD4DVARBPROC)(GLenum target, const GLdouble* v);
|
||||
typedef void(APIENTRYP PFNDOLMULTITEXCOORD4FARBPROC)(GLenum target, GLfloat s, GLfloat t, GLfloat r,
|
||||
GLfloat q);
|
||||
typedef void(APIENTRYP PFNDOLMULTITEXCOORD4FVARBPROC)(GLenum target, const GLfloat* v);
|
||||
typedef void(APIENTRYP PFNDOLMULTITEXCOORD4IARBPROC)(GLenum target, GLint s, GLint t, GLint r,
|
||||
GLint q);
|
||||
typedef void(APIENTRYP PFNDOLMULTITEXCOORD4IVARBPROC)(GLenum target, const GLint* v);
|
||||
typedef void(APIENTRYP PFNDOLMULTITEXCOORD4SARBPROC)(GLenum target, GLshort s, GLshort t, GLshort r,
|
||||
GLshort q);
|
||||
typedef void(APIENTRYP PFNDOLMULTITEXCOORD4SVARBPROC)(GLenum target, const GLshort* v);
|
||||
typedef void(APIENTRYP PFNDOLLOADTRANSPOSEMATRIXFARBPROC)(const GLfloat* m);
|
||||
typedef void(APIENTRYP PFNDOLLOADTRANSPOSEMATRIXDARBPROC)(const GLdouble* m);
|
||||
typedef void(APIENTRYP PFNDOLMULTTRANSPOSEMATRIXFARBPROC)(const GLfloat* m);
|
||||
typedef void(APIENTRYP PFNDOLMULTTRANSPOSEMATRIXDARBPROC)(const GLdouble* m);
|
||||
typedef void(APIENTRYP PFNDOLSAMPLECOVERAGEARBPROC)(GLfloat value, GLboolean invert);
|
||||
|
||||
extern PFNDOLACTIVETEXTUREARBPROC dolActiveTexture;
|
||||
extern PFNDOLCLIENTACTIVETEXTUREARBPROC dolClientActiveTexture;
|
||||
|
|
|
@ -72,53 +72,58 @@
|
|||
#define GL_CONSTANT_ALPHA 0x8003
|
||||
#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
|
||||
|
||||
typedef void (APIENTRYP PFNDOLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
|
||||
typedef void (APIENTRYP PFNDOLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount);
|
||||
typedef void (APIENTRYP PFNDOLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount);
|
||||
typedef void (APIENTRYP PFNDOLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param);
|
||||
typedef void (APIENTRYP PFNDOLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params);
|
||||
typedef void (APIENTRYP PFNDOLPOINTPARAMETERIPROC) (GLenum pname, GLint param);
|
||||
typedef void (APIENTRYP PFNDOLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params);
|
||||
typedef void (APIENTRYP PFNDOLFOGCOORDFPROC) (GLfloat coord);
|
||||
typedef void (APIENTRYP PFNDOLFOGCOORDFVPROC) (const GLfloat *coord);
|
||||
typedef void (APIENTRYP PFNDOLFOGCOORDDPROC) (GLdouble coord);
|
||||
typedef void (APIENTRYP PFNDOLFOGCOORDDVPROC) (const GLdouble *coord);
|
||||
typedef void (APIENTRYP PFNDOLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const void *pointer);
|
||||
typedef void (APIENTRYP PFNDOLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue);
|
||||
typedef void (APIENTRYP PFNDOLSECONDARYCOLOR3BVPROC) (const GLbyte *v);
|
||||
typedef void (APIENTRYP PFNDOLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue);
|
||||
typedef void (APIENTRYP PFNDOLSECONDARYCOLOR3DVPROC) (const GLdouble *v);
|
||||
typedef void (APIENTRYP PFNDOLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue);
|
||||
typedef void (APIENTRYP PFNDOLSECONDARYCOLOR3FVPROC) (const GLfloat *v);
|
||||
typedef void (APIENTRYP PFNDOLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue);
|
||||
typedef void (APIENTRYP PFNDOLSECONDARYCOLOR3IVPROC) (const GLint *v);
|
||||
typedef void (APIENTRYP PFNDOLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue);
|
||||
typedef void (APIENTRYP PFNDOLSECONDARYCOLOR3SVPROC) (const GLshort *v);
|
||||
typedef void (APIENTRYP PFNDOLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue);
|
||||
typedef void (APIENTRYP PFNDOLSECONDARYCOLOR3UBVPROC) (const GLubyte *v);
|
||||
typedef void (APIENTRYP PFNDOLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue);
|
||||
typedef void (APIENTRYP PFNDOLSECONDARYCOLOR3UIVPROC) (const GLuint *v);
|
||||
typedef void (APIENTRYP PFNDOLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue);
|
||||
typedef void (APIENTRYP PFNDOLSECONDARYCOLOR3USVPROC) (const GLushort *v);
|
||||
typedef void (APIENTRYP PFNDOLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer);
|
||||
typedef void (APIENTRYP PFNDOLWINDOWPOS2DPROC) (GLdouble x, GLdouble y);
|
||||
typedef void (APIENTRYP PFNDOLWINDOWPOS2DVPROC) (const GLdouble *v);
|
||||
typedef void (APIENTRYP PFNDOLWINDOWPOS2FPROC) (GLfloat x, GLfloat y);
|
||||
typedef void (APIENTRYP PFNDOLWINDOWPOS2FVPROC) (const GLfloat *v);
|
||||
typedef void (APIENTRYP PFNDOLWINDOWPOS2IPROC) (GLint x, GLint y);
|
||||
typedef void (APIENTRYP PFNDOLWINDOWPOS2IVPROC) (const GLint *v);
|
||||
typedef void (APIENTRYP PFNDOLWINDOWPOS2SPROC) (GLshort x, GLshort y);
|
||||
typedef void (APIENTRYP PFNDOLWINDOWPOS2SVPROC) (const GLshort *v);
|
||||
typedef void (APIENTRYP PFNDOLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z);
|
||||
typedef void (APIENTRYP PFNDOLWINDOWPOS3DVPROC) (const GLdouble *v);
|
||||
typedef void (APIENTRYP PFNDOLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z);
|
||||
typedef void (APIENTRYP PFNDOLWINDOWPOS3FVPROC) (const GLfloat *v);
|
||||
typedef void (APIENTRYP PFNDOLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z);
|
||||
typedef void (APIENTRYP PFNDOLWINDOWPOS3IVPROC) (const GLint *v);
|
||||
typedef void (APIENTRYP PFNDOLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z);
|
||||
typedef void (APIENTRYP PFNDOLWINDOWPOS3SVPROC) (const GLshort *v);
|
||||
typedef void (APIENTRYP PFNDOLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
|
||||
typedef void (APIENTRYP PFNDOLBLENDEQUATIONPROC) (GLenum mode);
|
||||
typedef void(APIENTRYP PFNDOLBLENDFUNCSEPARATEPROC)(GLenum sfactorRGB, GLenum dfactorRGB,
|
||||
GLenum sfactorAlpha, GLenum dfactorAlpha);
|
||||
typedef void(APIENTRYP PFNDOLMULTIDRAWARRAYSPROC)(GLenum mode, const GLint* first,
|
||||
const GLsizei* count, GLsizei drawcount);
|
||||
typedef void(APIENTRYP PFNDOLMULTIDRAWELEMENTSPROC)(GLenum mode, const GLsizei* count, GLenum type,
|
||||
const void* const* indices, GLsizei drawcount);
|
||||
typedef void(APIENTRYP PFNDOLPOINTPARAMETERFPROC)(GLenum pname, GLfloat param);
|
||||
typedef void(APIENTRYP PFNDOLPOINTPARAMETERFVPROC)(GLenum pname, const GLfloat* params);
|
||||
typedef void(APIENTRYP PFNDOLPOINTPARAMETERIPROC)(GLenum pname, GLint param);
|
||||
typedef void(APIENTRYP PFNDOLPOINTPARAMETERIVPROC)(GLenum pname, const GLint* params);
|
||||
typedef void(APIENTRYP PFNDOLFOGCOORDFPROC)(GLfloat coord);
|
||||
typedef void(APIENTRYP PFNDOLFOGCOORDFVPROC)(const GLfloat* coord);
|
||||
typedef void(APIENTRYP PFNDOLFOGCOORDDPROC)(GLdouble coord);
|
||||
typedef void(APIENTRYP PFNDOLFOGCOORDDVPROC)(const GLdouble* coord);
|
||||
typedef void(APIENTRYP PFNDOLFOGCOORDPOINTERPROC)(GLenum type, GLsizei stride, const void* pointer);
|
||||
typedef void(APIENTRYP PFNDOLSECONDARYCOLOR3BPROC)(GLbyte red, GLbyte green, GLbyte blue);
|
||||
typedef void(APIENTRYP PFNDOLSECONDARYCOLOR3BVPROC)(const GLbyte* v);
|
||||
typedef void(APIENTRYP PFNDOLSECONDARYCOLOR3DPROC)(GLdouble red, GLdouble green, GLdouble blue);
|
||||
typedef void(APIENTRYP PFNDOLSECONDARYCOLOR3DVPROC)(const GLdouble* v);
|
||||
typedef void(APIENTRYP PFNDOLSECONDARYCOLOR3FPROC)(GLfloat red, GLfloat green, GLfloat blue);
|
||||
typedef void(APIENTRYP PFNDOLSECONDARYCOLOR3FVPROC)(const GLfloat* v);
|
||||
typedef void(APIENTRYP PFNDOLSECONDARYCOLOR3IPROC)(GLint red, GLint green, GLint blue);
|
||||
typedef void(APIENTRYP PFNDOLSECONDARYCOLOR3IVPROC)(const GLint* v);
|
||||
typedef void(APIENTRYP PFNDOLSECONDARYCOLOR3SPROC)(GLshort red, GLshort green, GLshort blue);
|
||||
typedef void(APIENTRYP PFNDOLSECONDARYCOLOR3SVPROC)(const GLshort* v);
|
||||
typedef void(APIENTRYP PFNDOLSECONDARYCOLOR3UBPROC)(GLubyte red, GLubyte green, GLubyte blue);
|
||||
typedef void(APIENTRYP PFNDOLSECONDARYCOLOR3UBVPROC)(const GLubyte* v);
|
||||
typedef void(APIENTRYP PFNDOLSECONDARYCOLOR3UIPROC)(GLuint red, GLuint green, GLuint blue);
|
||||
typedef void(APIENTRYP PFNDOLSECONDARYCOLOR3UIVPROC)(const GLuint* v);
|
||||
typedef void(APIENTRYP PFNDOLSECONDARYCOLOR3USPROC)(GLushort red, GLushort green, GLushort blue);
|
||||
typedef void(APIENTRYP PFNDOLSECONDARYCOLOR3USVPROC)(const GLushort* v);
|
||||
typedef void(APIENTRYP PFNDOLSECONDARYCOLORPOINTERPROC)(GLint size, GLenum type, GLsizei stride,
|
||||
const void* pointer);
|
||||
typedef void(APIENTRYP PFNDOLWINDOWPOS2DPROC)(GLdouble x, GLdouble y);
|
||||
typedef void(APIENTRYP PFNDOLWINDOWPOS2DVPROC)(const GLdouble* v);
|
||||
typedef void(APIENTRYP PFNDOLWINDOWPOS2FPROC)(GLfloat x, GLfloat y);
|
||||
typedef void(APIENTRYP PFNDOLWINDOWPOS2FVPROC)(const GLfloat* v);
|
||||
typedef void(APIENTRYP PFNDOLWINDOWPOS2IPROC)(GLint x, GLint y);
|
||||
typedef void(APIENTRYP PFNDOLWINDOWPOS2IVPROC)(const GLint* v);
|
||||
typedef void(APIENTRYP PFNDOLWINDOWPOS2SPROC)(GLshort x, GLshort y);
|
||||
typedef void(APIENTRYP PFNDOLWINDOWPOS2SVPROC)(const GLshort* v);
|
||||
typedef void(APIENTRYP PFNDOLWINDOWPOS3DPROC)(GLdouble x, GLdouble y, GLdouble z);
|
||||
typedef void(APIENTRYP PFNDOLWINDOWPOS3DVPROC)(const GLdouble* v);
|
||||
typedef void(APIENTRYP PFNDOLWINDOWPOS3FPROC)(GLfloat x, GLfloat y, GLfloat z);
|
||||
typedef void(APIENTRYP PFNDOLWINDOWPOS3FVPROC)(const GLfloat* v);
|
||||
typedef void(APIENTRYP PFNDOLWINDOWPOS3IPROC)(GLint x, GLint y, GLint z);
|
||||
typedef void(APIENTRYP PFNDOLWINDOWPOS3IVPROC)(const GLint* v);
|
||||
typedef void(APIENTRYP PFNDOLWINDOWPOS3SPROC)(GLshort x, GLshort y, GLshort z);
|
||||
typedef void(APIENTRYP PFNDOLWINDOWPOS3SVPROC)(const GLshort* v);
|
||||
typedef void(APIENTRYP PFNDOLBLENDCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue,
|
||||
GLfloat alpha);
|
||||
typedef void(APIENTRYP PFNDOLBLENDEQUATIONPROC)(GLenum mode);
|
||||
|
||||
// These two are provided by ARB_imaging as well
|
||||
extern PFNDOLBLENDCOLORPROC dolBlendColor;
|
||||
|
|
|
@ -74,25 +74,28 @@
|
|||
#define GL_SRC0_ALPHA 0x8588
|
||||
#define GL_SRC2_ALPHA 0x858A
|
||||
|
||||
typedef void (APIENTRYP PFNDOLGENQUERIESPROC) (GLsizei n, GLuint *ids);
|
||||
typedef void (APIENTRYP PFNDOLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids);
|
||||
typedef GLboolean (APIENTRYP PFNDOLISQUERYPROC) (GLuint id);
|
||||
typedef void (APIENTRYP PFNDOLBEGINQUERYPROC) (GLenum target, GLuint id);
|
||||
typedef void (APIENTRYP PFNDOLENDQUERYPROC) (GLenum target);
|
||||
typedef void (APIENTRYP PFNDOLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNDOLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNDOLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params);
|
||||
typedef void (APIENTRYP PFNDOLBINDBUFFERPROC) (GLenum target, GLuint buffer);
|
||||
typedef void (APIENTRYP PFNDOLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);
|
||||
typedef void (APIENTRYP PFNDOLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
|
||||
typedef GLboolean (APIENTRYP PFNDOLISBUFFERPROC) (GLuint buffer);
|
||||
typedef void (APIENTRYP PFNDOLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
|
||||
typedef void (APIENTRYP PFNDOLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
|
||||
typedef void (APIENTRYP PFNDOLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, void *data);
|
||||
typedef void *(APIENTRYP PFNDOLMAPBUFFERPROC) (GLenum target, GLenum access);
|
||||
typedef GLboolean (APIENTRYP PFNDOLUNMAPBUFFERPROC) (GLenum target);
|
||||
typedef void (APIENTRYP PFNDOLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNDOLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, void **params);
|
||||
typedef void(APIENTRYP PFNDOLGENQUERIESPROC)(GLsizei n, GLuint* ids);
|
||||
typedef void(APIENTRYP PFNDOLDELETEQUERIESPROC)(GLsizei n, const GLuint* ids);
|
||||
typedef GLboolean(APIENTRYP PFNDOLISQUERYPROC)(GLuint id);
|
||||
typedef void(APIENTRYP PFNDOLBEGINQUERYPROC)(GLenum target, GLuint id);
|
||||
typedef void(APIENTRYP PFNDOLENDQUERYPROC)(GLenum target);
|
||||
typedef void(APIENTRYP PFNDOLGETQUERYIVPROC)(GLenum target, GLenum pname, GLint* params);
|
||||
typedef void(APIENTRYP PFNDOLGETQUERYOBJECTIVPROC)(GLuint id, GLenum pname, GLint* params);
|
||||
typedef void(APIENTRYP PFNDOLGETQUERYOBJECTUIVPROC)(GLuint id, GLenum pname, GLuint* params);
|
||||
typedef void(APIENTRYP PFNDOLBINDBUFFERPROC)(GLenum target, GLuint buffer);
|
||||
typedef void(APIENTRYP PFNDOLDELETEBUFFERSPROC)(GLsizei n, const GLuint* buffers);
|
||||
typedef void(APIENTRYP PFNDOLGENBUFFERSPROC)(GLsizei n, GLuint* buffers);
|
||||
typedef GLboolean(APIENTRYP PFNDOLISBUFFERPROC)(GLuint buffer);
|
||||
typedef void(APIENTRYP PFNDOLBUFFERDATAPROC)(GLenum target, GLsizeiptr size, const void* data,
|
||||
GLenum usage);
|
||||
typedef void(APIENTRYP PFNDOLBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size,
|
||||
const void* data);
|
||||
typedef void(APIENTRYP PFNDOLGETBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size,
|
||||
void* data);
|
||||
typedef void*(APIENTRYP PFNDOLMAPBUFFERPROC)(GLenum target, GLenum access);
|
||||
typedef GLboolean(APIENTRYP PFNDOLUNMAPBUFFERPROC)(GLenum target);
|
||||
typedef void(APIENTRYP PFNDOLGETBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint* params);
|
||||
typedef void(APIENTRYP PFNDOLGETBUFFERPOINTERVPROC)(GLenum target, GLenum pname, void** params);
|
||||
|
||||
extern PFNDOLBEGINQUERYPROC dolBeginQuery;
|
||||
extern PFNDOLBINDBUFFERPROC dolBindBuffer;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue