Originally committed to SVN as r795.

This commit is contained in:
Rodrigo Braz Monteiro 2007-01-15 05:38:32 +00:00
parent b4d1384c6d
commit e5ad6e4b60
6 changed files with 45 additions and 6 deletions

View File

@ -135,6 +135,14 @@ bool AegisubApp::OnInit() {
}
////////
// Exit
int AegisubApp::OnExit() {
Options.Clear();
return wxApp::OnExit();
}
#ifndef _DEBUG
///////////////////////
// Unhandled exception

View File

@ -75,6 +75,7 @@ public:
void AssociateType(wxString type);
bool OnInit();
int OnExit();
int OnRun();
#ifdef __WXMAC__

View File

@ -59,7 +59,15 @@ OptionsManager::OptionsManager() {
//////////////
// Destructor
OptionsManager::~OptionsManager() {
Clear();
}
/////////
// Clear
void OptionsManager::Clear() {
opt.clear();
optType.clear();
}

View File

@ -73,6 +73,7 @@ public:
OptionsManager();
~OptionsManager();
void Clear();
void SetFile(wxString file);
void Save();
void Load();

View File

@ -203,7 +203,7 @@ wxString TextFileReader::ReadLineFromFile() {
// Read ASCII/UTF-8 line from file
else {
#ifdef WIN32
char *buffer = new char[512];
char buffer[512];
while (1) {
buffer[511] = '\1';
if (fgets(buffer, 512, file)) {

View File

@ -988,16 +988,23 @@ void VideoDisplayVisual::OnMouseEvent (wxMouseEvent &event) {
// Rotate Z
else if (hold == 2) {
// Find screen angle
// Find angle
float screenAngle = atan2(double(lineOrgY-y*sh/h),double(x*sw/w-lineOrgX)) * 180.0 / 3.1415926535897932;
curAngle = screenAngle - startAngle + origAngle;
while (curAngle < 0.0f) curAngle += 360.0f;
while (curAngle >= 360.0f) curAngle -= 360.0f;
// Snap
if (event.ShiftDown()) {
curAngle = (float)((int)((curAngle+15.0f)/30.0f))*30.0f;
if (curAngle == 360.0f) curAngle = 0.0f;
}
// Update
curAngle = screenAngle - startAngle + origAngle;
while (curAngle < 0.0) curAngle += 360.0;
while (curAngle >= 360.0) curAngle -= 360.0;
if (realTime) {
AssLimitToVisibleFilter::SetFrame(frame_n);
grid->editBox->SetOverride(_T("\\frz"),PrettyFloat(wxString::Format(_T("(%0.3f)"),curAngle)),0);
wxString param = PrettyFloat(wxString::Format(_T("(%0.3f)"),curAngle));
grid->editBox->SetOverride(_T("\\frz"),param,0);
grid->editBox->CommitText(true);
grid->CommitChanges(false,true);
}
@ -1017,6 +1024,14 @@ void VideoDisplayVisual::OnMouseEvent (wxMouseEvent &event) {
while (curAngle2 < 0.0) curAngle2 += 360.0;
while (curAngle2 >= 360.0) curAngle2 -= 360.0;
// Oh Snap
if (event.ShiftDown()) {
curAngle = (float)((int)((curAngle+15.0f)/30.0f))*30.0f;
curAngle2 = (float)((int)((curAngle2+15.0f)/30.0f))*30.0f;
if (curAngle == 360.0f) curAngle = 0.0f;
if (curAngle2 == 360.0f) curAngle = 0.0f;
}
// Update
if (realTime) {
AssLimitToVisibleFilter::SetFrame(frame_n);
@ -1035,6 +1050,12 @@ void VideoDisplayVisual::OnMouseEvent (wxMouseEvent &event) {
if (curScaleX < 0.0f) curScaleX = 0.0f;
if (curScaleY < 0.0f) curScaleY = 0.0f;
// Snap
if (event.ShiftDown()) {
curScaleX = (float)((int)((curScaleX+12.5f)/25.0f))*25.0f;
curScaleY = (float)((int)((curScaleY+12.5f)/25.0f))*25.0f;
}
// Update
if (realTime) {
AssLimitToVisibleFilter::SetFrame(frame_n);