Ignore:
Timestamp:
Feb 8, 2010, 2:27:22 AM (11 years ago)
Author:
Sam Hocevar
Message:

Large source code cleanup, getting rid of spaces, tabs, and svn keywords.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca-php/examples/truecolor.php

    r4148 r4333  
    22<?php
    33/*
    4  *  truecolor     truecolor canvas features
     4 *  truecolor      truecolor canvas features
    55 *  Copyright (c) 2008 Benjamin C. Wiley Sittler <bsittler@gmail.com>
    66 *
    77 *  This file is a Php port of "examples/truecolor.c"
    8  *  which is: 
     8 *  which is:
    99 *  Copyright (c) 2006 Sam Hocevar <sam@hocevar.net>
    10  *                All Rights Reserved
    11  *
    12  *  $Id$
     10 *          All Rights Reserved
    1311 *
    1412 *  This program is free software. It comes without any warranty, to
     
    2018
    2119if (php_sapi_name() != "cli") {
    22         die("You have to run this program with php-cli!\n");
     20    die("You have to run this program with php-cli!\n");
    2321}
    2422
    2523$cv = caca_create_canvas(32, 16);
    2624if(!$cv) {
    27         die("Failed to create canvas\n");
     25    die("Failed to create canvas\n");
    2826}
    2927
    3028$dp = caca_create_display($cv);
    3129if(!$dp) {
    32         die("Failed to create display\n");
     30    die("Failed to create display\n");
    3331}
    3432
    3533for($y = 0; $y < 16; $y++)
    36         for($x = 0; $x < 16; $x++)
    37         {
    38                 $bgcolor = 0xff00 | ($y << 4) | $x;
    39                 $fgcolor = 0xf000 | ((15 - $y) << 4) | ((15 - $x) << 8);
    40                
    41                 caca_set_color_argb($cv, $fgcolor, $bgcolor);
    42                 caca_put_str($cv, $x * 2, $y, "CA");
    43         }
     34    for($x = 0; $x < 16; $x++)
     35    {
     36        $bgcolor = 0xff00 | ($y << 4) | $x;
     37        $fgcolor = 0xf000 | ((15 - $y) << 4) | ((15 - $x) << 8);
     38
     39        caca_set_color_argb($cv, $fgcolor, $bgcolor);
     40        caca_put_str($cv, $x * 2, $y, "CA");
     41    }
    4442
    4543caca_set_color_ansi($cv, CACA_WHITE, CACA_LIGHTBLUE);
Note: See TracChangeset for help on using the changeset viewer.