Compare commits
7 Commits
18a363a8e0
...
c17620ce52
Author | SHA1 | Date |
---|---|---|
camh | c17620ce52 | |
camh | c38e79ef0b | |
camh | 385003d534 | |
camh | 2bb6d39e94 | |
camh | 71c53cba00 | |
camh | 7a9a78567e | |
camh | 29afee66ee |
|
@ -47,7 +47,7 @@ OSErr setupDebugSerialPort(short refNum) {
|
|||
CntrlParam cb2;
|
||||
cb2.ioCRefNum = serialPort;
|
||||
cb2.csCode = 8;
|
||||
cb2.csParam[0] = stop10 | noParity | data8 | baud9600;
|
||||
cb2.csParam[0] = stop10 | noParity | data8 | baud19200;
|
||||
|
||||
err = PBControl ((ParmBlkPtr) & cb2, 0);
|
||||
|
||||
|
|
|
@ -236,6 +236,9 @@ void readSerialPort(char* output) {
|
|||
writeSerialPortDebug(boutRefNum, "readSerialPort, enter loop");
|
||||
#endif
|
||||
|
||||
// wait a moment for the buffer to fill
|
||||
wait(0.01);
|
||||
|
||||
while (!done) {
|
||||
|
||||
if (loopCounter++ > MAX_RECIEVE_LOOP_ITERATIONS) {
|
||||
|
@ -339,6 +342,14 @@ void readSerialPort(char* output) {
|
|||
// writeSerialPortDebug(boutRefNum, "\n");
|
||||
#endif
|
||||
|
||||
done = true;
|
||||
} else {
|
||||
|
||||
#ifdef DEBUGGING
|
||||
writeSerialPortDebug(boutRefNum, "receive loop complete, but terminator is missing");
|
||||
writeSerialPortDebug(boutRefNum, tempOutput);
|
||||
#endif
|
||||
|
||||
done = true;
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -52,7 +52,7 @@ NK_API NkQuickDrawFont* nk_quickdraw_font_create_from_file();
|
|||
*
|
||||
* ===============================================================
|
||||
*/
|
||||
#define MAX_MEMORY_IN_KB 6
|
||||
#define MAX_MEMORY_IN_KB 8
|
||||
#ifdef NK_QUICKDRAW_IMPLEMENTATION
|
||||
#ifndef NK_QUICKDRAW_TEXT_MAX
|
||||
#define NK_QUICKDRAW_TEXT_MAX 256
|
||||
|
@ -559,6 +559,13 @@ void updateBounds(int top, int bottom, int left, int right) {
|
|||
|
||||
#ifdef COMMAND_CACHING
|
||||
|
||||
char x[255];
|
||||
sprintf(x, "cmd: %d", cmd->type);
|
||||
writeSerialPortDebug(boutRefNum, x);
|
||||
char y[255];
|
||||
sprintf(y, "lastCmd: %d", lastCmd->type);
|
||||
writeSerialPortDebug(boutRefNum, y);
|
||||
|
||||
if (!lastInputWasBackspace && cmd->type == lastCmd->type && memcmp(r, lastCmd, sizeof(struct nk_command_rect)) == 0) {
|
||||
|
||||
#ifdef NK_QUICKDRAW_GRAPHICS_DEBUGGING
|
||||
|
@ -599,8 +606,10 @@ void updateBounds(int top, int bottom, int left, int right) {
|
|||
#endif
|
||||
|
||||
const struct nk_command_rect_filled *r = (const struct nk_command_rect_filled *)cmd;
|
||||
writeSerialPortDebug(boutRefNum, "NK_COMMAND_RECT_FILLED1");
|
||||
|
||||
if (r->allowCache == false) {
|
||||
writeSerialPortDebug(boutRefNum, "NK_COMMAND_RECT_FILLED2");
|
||||
|
||||
Rect quickDrawRectangle;
|
||||
quickDrawRectangle.top = r->y;
|
||||
|
@ -608,15 +617,26 @@ void updateBounds(int top, int bottom, int left, int right) {
|
|||
quickDrawRectangle.bottom = r->y + r->h;
|
||||
quickDrawRectangle.right = r->x + r->w;
|
||||
|
||||
writeSerialPortDebug(boutRefNum, "NK_COMMAND_RECT_FILLED3");
|
||||
#ifdef ENABLED_DOUBLE_BUFFERING
|
||||
updateBounds(quickDrawRectangle.top, quickDrawRectangle.bottom, quickDrawRectangle.left, quickDrawRectangle.right);
|
||||
#endif
|
||||
|
||||
writeSerialPortDebug(boutRefNum, "NK_COMMAND_RECT_FILLED4");
|
||||
FillRoundRect(&quickDrawRectangle, r->rounding, r->rounding, &qd.white);
|
||||
break;
|
||||
}
|
||||
|
||||
writeSerialPortDebug(boutRefNum, "NK_COMMAND_RECT_FILLED5");
|
||||
#ifdef COMMAND_CACHING
|
||||
|
||||
char x[255];
|
||||
sprintf(x, "cmd: %d", cmd->type);
|
||||
writeSerialPortDebug(boutRefNum, x);
|
||||
char y[255];
|
||||
sprintf(y, "lastCmd: %d", lastCmd->type);
|
||||
writeSerialPortDebug(boutRefNum, y);
|
||||
|
||||
if (!lastInputWasBackspace && cmd->type == lastCmd->type && memcmp(r, lastCmd, sizeof(struct nk_command_rect_filled)) == 0) {
|
||||
|
||||
#ifdef NK_QUICKDRAW_GRAPHICS_DEBUGGING
|
||||
|
@ -627,6 +647,7 @@ void updateBounds(int top, int bottom, int left, int right) {
|
|||
}
|
||||
#endif
|
||||
|
||||
writeSerialPortDebug(boutRefNum, "NK_COMMAND_RECT_FILLED6");
|
||||
// TODO: to support coloring the lines, we need to map from qd Pattern types to integer colors
|
||||
// color = nk_color_to_quickdraw_bw_color(r->color);
|
||||
// ForeColor(color);
|
||||
|
@ -640,12 +661,18 @@ void updateBounds(int top, int bottom, int left, int right) {
|
|||
quickDrawRectangle.bottom = r->y + r->h;
|
||||
quickDrawRectangle.right = r->x + r->w;
|
||||
|
||||
|
||||
writeSerialPortDebug(boutRefNum, "NK_COMMAND_RECT_FILLED7");
|
||||
|
||||
#ifdef ENABLED_DOUBLE_BUFFERING
|
||||
updateBounds(quickDrawRectangle.top, quickDrawRectangle.bottom, quickDrawRectangle.left, quickDrawRectangle.right);
|
||||
#endif
|
||||
|
||||
writeSerialPortDebug(boutRefNum, "NK_COMMAND_RECT_FILLED8");
|
||||
FillRoundRect(&quickDrawRectangle, r->rounding, r->rounding, &r->color);
|
||||
writeSerialPortDebug(boutRefNum, "NK_COMMAND_RECT_FILLED9");
|
||||
FrameRoundRect(&quickDrawRectangle, r->rounding, r->rounding); // http://mirror.informatimago.com/next/developer.apple.com/documentation/mac/QuickDraw/QuickDraw-105.html#HEADING105-0
|
||||
writeSerialPortDebug(boutRefNum, "NK_COMMAND_RECT_FILLED10 (done)");
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue