/[gzz]/gzz/gfx/librenderables/renderables.py
ViewVC logotype

Diff of /gzz/gfx/librenderables/renderables.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.130 by jvk, Mon Nov 4 15:47:07 2002 UTC revision 1.131 by tjl, Tue Nov 5 08:21:01 2002 UTC
# Line 1336  rs = [ Line 1336  rs = [
1336    
1337                  ZPt tmp(x*scale, y*scale, 0);                  ZPt tmp(x*scale, y*scale, 0);
1338    
                 tmp = c.transform(tmp);  
   
1339                  tmp.x += orig.x;                  tmp.x += orig.x;
1340                  tmp.y += orig.y;                  tmp.y += orig.y;
1341    
1342                  // already transformed from coords1, so:                  c.vertex(tmp);
                 glVertex3f(tmp.x, tmp.y, tmp.z);  
1343              }              }
1344          };          };
1345          """,          """,
1346      "RenderCode" : """      "RenderCode" : """
1347              if (dbg) cout << "Calendar - linewidth: " << linewidth << "\\n";              DBG(dbg_calendar) << "Calendar - linewidth: " << linewidth << "\\n";
1348            
1349              glPushAttrib(GL_ENABLE_BIT);              glPushAttrib(GL_ENABLE_BIT);
1350              glEnable(GL_BLEND);              glEnable(GL_BLEND);
# Line 1412  rs = [ Line 1409  rs = [
1409              glEnable(GL_TEXTURE_2D);              glEnable(GL_TEXTURE_2D);
1410              float date_scale = scales[0];              float date_scale = scales[0];
1411    
1412                Coords &coords2inv = *coords2.getInverse();
1413    
1414              for (int i=1; i<=days; i++) {              for (int i=1; i<=days; i++) {
1415                  int column = (empty_days + i -1) % 7;                  int column = (empty_days + i -1) % 7;
1416                  int row  =1+ (empty_days + i -1) / 7;                  int row  =1+ (empty_days + i -1) / 7;
# Line 1433  rs = [ Line 1432  rs = [
1432                  glColor3f(1.0, 1.0, 1.0);                  glColor3f(1.0, 1.0, 1.0);
1433    
1434                  Vertexer<Coords> v_date(coords2, date_scale,                  Vertexer<Coords> v_date(coords2, date_scale,
1435                                          coords1.transform(ZPt(fcol, frow,0))                                          coords2inv.transform(
1436                                                coords1.transform(ZPt(fcol, frow,0)))
1437                  );                  );
1438                                    
1439                  Text::renderIter(*r_date, buffer, buffer+strlen(buffer),                  Text::renderIter(*r_date, buffer, buffer+strlen(buffer),
# Line 1458  rs = [ Line 1458  rs = [
1458              float week_num_scale = scales[1];              float week_num_scale = scales[1];
1459              for (int i=0; i<weeks; i++) {              for (int i=0; i<weeks; i++) {
1460                  Vertexer<Coords> v_week_num(coords2, week_num_scale,                  Vertexer<Coords> v_week_num(coords2, week_num_scale,
1461                      coords1.transform(ZPt(0, month_name_h + weekday_h + i,0))                      coords2inv.transform(
1462                            coords1.transform(ZPt(0, month_name_h + weekday_h + i,0))
1463                            )
1464                  );                  );
1465                                            
1466                  static char buffer[64];                  static char buffer[64];
# Line 1477  rs = [ Line 1479  rs = [
1479              for (int i=0; i<7; i++) {              for (int i=0; i<7; i++) {
1480    
1481                  Vertexer<Coords> v_weekday(coords2, weekday_scale,                  Vertexer<Coords> v_weekday(coords2, weekday_scale,
1482                      coords1.transform(ZPt(week_num_w + i + 0.1, month_name_h + weekday_h - 0.15, 0 ))                      coords2inv.transform(
1483                            coords1.transform(ZPt(week_num_w + i + 0.1, month_name_h + weekday_h - 0.15, 0 ))
1484                            )
1485                  );                  );
1486                            
1487                  Text::renderIter(*r, d_txt[i].begin(), d_txt[i].end(),                  Text::renderIter(*r, d_txt[i].begin(), d_txt[i].end(),
# Line 1490  rs = [ Line 1494  rs = [
1494              // Month name              // Month name
1495              float month_name_scale = scales[3];              float month_name_scale = scales[3];
1496              Vertexer<Coords> v_month(coords2, month_name_scale,              Vertexer<Coords> v_month(coords2, month_name_scale,
1497                    coords2inv.transform(
1498                  coords1.transform(ZPt(week_num_w, month_name_h - 0.15, 0))                  coords1.transform(ZPt(week_num_w, month_name_h - 0.15, 0))
1499                    )
1500              );              );
1501    
1502              Text::renderIter(*r, m_txt.begin(), m_txt.end(),              Text::renderIter(*r, m_txt.begin(), m_txt.end(),

Legend:
Removed from v.1.130  
changed lines
  Added in v.1.131

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26