- Joined
- Dec 25, 2010
- Messages
- 46
- Reaction score
- 0
- Points
- 0
The input system of TransX has always irked me as sometimes I just want to type in a value, without having to click my way there via +/-adj and ++/--
So I added an [ENT] button that lets one do just that. Then, while testing, I got distracted by the disappearing-graphics issue, so I fixed that too...in a way. OOP and private variables have made it hard to find -what- is causing the deletion of sketchpad pens, but TransX now detects and deals with it:
A precompiled dll (tested with 2010p1) is available at:
http://orbiterfixes.googlecode.com/files/transx-3.13-enterbutton-graphicsfix.zip
The summary of all changes, and full source, is available at:
http://code.google.com/p/orbiterfixes/source/detail?r=7
So I added an [ENT] button that lets one do just that. Then, while testing, I got distracted by the disappearing-graphics issue, so I fixed that too...in a way. OOP and private variables have made it hard to find -what- is causing the deletion of sketchpad pens, but TransX now detects and deals with it:
Code:
diff -ur ../transx/transx/TransX/trunk/TransXFunction.cpp ./TransXFunction.cpp
--- ../transx/transx/TransX/trunk/TransXFunction.cpp 2011-01-30 04:33:20.047875000 -0600
+++ ./TransXFunction.cpp 2011-01-30 14:11:26.813500000 -0600
@@ -337,10 +337,18 @@
//(rbd-)
Pen* TransXFunction::SelectDefaultPen(Sketchpad *sketchpad, int value)
{
- if(value < NUM_PENS) //(rbd+)
- return sketchpad->SetPen(pens[value]);
- else
- return sketchpad->SetPen(pens[Green]);
+ oapi::Pen* ret;
+ if(value < NUM_PENS) {//(rbd+)
+ ret=sketchpad->SetPen(pens[value]);
+ } else {
+ ret=sketchpad->SetPen(pens[Green]);
+ }
+ if(ret==NULL) {
+ char dstr[256];
+ sprintf(dstr,"TransX: SelectDefaultPen(%i): Pen got nuked, fixing.",value);oapiWriteLog(dstr);
+ initpens();
+ }
+ return ret;
}
Brush* TransXFunction::SelectBrush(Sketchpad *sketchpad, int value)
A precompiled dll (tested with 2010p1) is available at:
http://orbiterfixes.googlecode.com/files/transx-3.13-enterbutton-graphicsfix.zip
The summary of all changes, and full source, is available at:
http://code.google.com/p/orbiterfixes/source/detail?r=7
Last edited:
