소스 검색

* Renamed caca_set_delay() and caca_get_rendertime() into

caca_set_display_time() and caca_get_display_time() for consistency.
tags/v0.99.beta14
Sam Hocevar sam 18 년 전
부모
커밋
5d12480dd6
11개의 변경된 파일35개의 추가작업 그리고 35개의 파일을 삭제
  1. +2
    -2
      caca/caca.h
  2. +16
    -16
      caca/graphics.c
  3. +6
    -6
      python/pypycaca.c
  4. +2
    -2
      python/pypycaca.h
  5. +1
    -1
      src/aafire.c
  6. +1
    -1
      src/cacaball.c
  7. +1
    -1
      src/cacamoir.c
  8. +1
    -1
      src/cacaplas.c
  9. +3
    -3
      test/demo.c
  10. +1
    -1
      test/frames.c
  11. +1
    -1
      test/gamma.c

+ 2
- 2
caca/caca.h 파일 보기

@@ -151,9 +151,9 @@ enum caca_key
* @{ */
caca_display_t * caca_create_display(cucul_canvas_t *);
void caca_free_display(caca_display_t *);
void caca_set_delay(caca_display_t *, unsigned int);
void caca_refresh_display(caca_display_t *);
unsigned int caca_get_rendertime(caca_display_t *);
void caca_set_display_time(caca_display_t *, unsigned int);
unsigned int caca_get_display_time(caca_display_t *);
unsigned int caca_get_display_width(caca_display_t *);
unsigned int caca_get_display_height(caca_display_t *);
int caca_set_display_title(caca_display_t *, char const *);


+ 16
- 16
caca/graphics.c 파일 보기

@@ -28,7 +28,7 @@
* If libcaca runs in a window, try to change its title. This works with
* the X11 and Win32 drivers.
*
* \param dp The libcaca graphical context.
* \param dp The libcaca display context.
* \param title The desired display title.
* \return 0 upon success, a non-zero value if an error occurs.
*/
@@ -44,7 +44,7 @@ int caca_set_display_title(caca_display_t *dp, char const *title)
* or if there is no way to know the font size, most drivers will assume a
* 6x10 font is being used. Note that the units are not necessarily pixels.
*
* \param dp The libcaca graphical context.
* \param dp The libcaca display context.
* \return The display width.
*/
unsigned int caca_get_display_width(caca_display_t *dp)
@@ -59,7 +59,7 @@ unsigned int caca_get_display_width(caca_display_t *dp)
* or if there is no way to know the font size, assume a 6x10 font is being
* used. Note that the units are not necessarily pixels.
*
* \param dp The libcaca graphical context.
* \param dp The libcaca display context.
* \return The display height.
*/
unsigned int caca_get_display_height(caca_display_t *dp)
@@ -76,26 +76,26 @@ unsigned int caca_get_display_height(caca_display_t *dp)
* If the argument is zero, constant framerate is disabled. This is the
* default behaviour.
*
* \param dp The libcaca graphical context.
* \param dp The libcaca display context.
* \param usec The refresh delay in microseconds.
*/
void caca_set_delay(caca_display_t *dp, unsigned int usec)
void caca_set_display_time(caca_display_t *dp, unsigned int usec)
{
dp->delay = usec;
}

/** \brief Get the average rendering time.
/** \brief Get the display's average rendering time.
*
* This function returns the average rendering time, which is the average
* measured time between two caca_refresh_display() calls, in microseconds. If
* constant framerate was activated by calling caca_set_delay(), the average
* rendering time will not be considerably shorter than the requested delay
* even if the real rendering time was shorter.
* constant framerate was activated by calling caca_set_display_time(), the
* average rendering time will not be considerably shorter than the requested
* delay even if the real rendering time was shorter.
*
* \param dp The libcaca graphical context.
* \param dp The libcaca display context.
* \return The render time in microseconds.
*/
unsigned int caca_get_rendertime(caca_display_t *dp)
unsigned int caca_get_display_time(caca_display_t *dp)
{
return dp->rendertime;
}
@@ -106,13 +106,13 @@ unsigned int caca_get_rendertime(caca_display_t *dp)
* screen. Nothing will show on the screen until caca_refresh_display() is
* called.
*
* If caca_set_delay() was called with a non-zero value,
* If caca_set_display_time() was called with a non-zero value,
* caca_refresh_display() will use that value to achieve constant
* framerate: if two consecutive calls to caca_refresh_display() are
* within a time range shorter than the value set with caca_set_delay(),
* framerate: if two consecutive calls to caca_refresh_display() are within
* a time range shorter than the value set with caca_set_display_time(),
* the second call will be delayed before performing the screen refresh.
*
* \param dp The libcaca graphical context.
* \param dp The libcaca display context.
*/
void caca_refresh_display(caca_display_t *dp)
{
@@ -154,7 +154,7 @@ void caca_refresh_display(caca_display_t *dp)
* This function shows or hides the mouse pointer, for devices that
* support it.
*
* \param dp The libcaca graphical context.
* \param dp The libcaca display context.
* \param flag 0 hides the pointer, 1 shows the system's default pointer
* (usually an arrow). Other values are reserved for future use.
*/


+ 6
- 6
python/pypycaca.c 파일 보기

@@ -15,8 +15,8 @@

static PyMethodDef CacaMethods[] = {
{"init", pycaca_init, METH_VARARGS, "Init libcaca"},
{"set_delay", pycaca_set_delay, METH_VARARGS, "Set delay"},
{"get_rendertime", pycaca_get_rendertime, METH_NOARGS, "Get render time"},
{"set_display_time", pycaca_set_display_time, METH_VARARGS, "Set display time"},
{"get_display_time", pycaca_get_display_time, METH_NOARGS, "Get render time"},
{"get_width", pycaca_get_width, METH_NOARGS, "Get width"},
{"get_height", pycaca_get_height, METH_NOARGS, "Get Height"},
{"set_size", pycaca_set_size, METH_VARARGS, "Set size"},
@@ -196,18 +196,18 @@ pycaca_init(PyObject *self, PyObject *args)
}

static PyObject *
pycaca_set_delay(PyObject *self, PyObject *args)
pycaca_set_display_time(PyObject *self, PyObject *args)
{
int value=0;
if (!PyArg_ParseTuple(args, "i", &value))
caca_set_delay(value);
caca_set_display_time(value);
return Py_BuildValue("i", 1); /*FIXME*/
}

static PyObject *
pycaca_get_rendertime(PyObject *self, PyObject *args)
pycaca_get_display_time(PyObject *self, PyObject *args)
{
int ret = caca_get_rendertime();
int ret = caca_get_display_time();
return Py_BuildValue("i", ret);
}



+ 2
- 2
python/pypycaca.h 파일 보기

@@ -24,9 +24,9 @@ PyMODINIT_FUNC initcaca(void);
static PyObject *
pycaca_init(PyObject *self, PyObject *args);
static PyObject *
pycaca_set_delay(PyObject *self, PyObject *args);
pycaca_set_display_time(PyObject *self, PyObject *args);
static PyObject *
pycaca_get_rendertime(PyObject *self, PyObject *args);
pycaca_get_display_time(PyObject *self, PyObject *args);
static PyObject *
pycaca_get_width(PyObject *self, PyObject *args);
static PyObject *


+ 1
- 1
src/aafire.c 파일 보기

@@ -113,7 +113,7 @@ initialize (void)
printf ("Failed to initialize libcaca\n");
exit (1);
}
caca_set_delay(dp, 10000);
caca_set_display_time(dp, 10000);
XSIZ = cucul_get_canvas_width(cv) * 2;
YSIZ = cucul_get_canvas_height(cv) * 2 - 4;
#else


+ 1
- 1
src/cacaball.c 파일 보기

@@ -61,7 +61,7 @@ int main(int argc, char **argv)
if(!dp)
return 1;

caca_set_delay(dp, 20000);
caca_set_display_time(dp, 20000);

/* Make the palette eatable by libcaca */
for(p = 0; p < 256; p++)


+ 1
- 1
src/cacamoir.c 파일 보기

@@ -50,7 +50,7 @@ int main (int argc, char **argv)
if(!dp)
return 1;

caca_set_delay(dp, 20000);
caca_set_display_time(dp, 20000);

/* Fill various tables */
for(i = 0 ; i < 256; i++)


+ 1
- 1
src/cacaplas.c 파일 보기

@@ -54,7 +54,7 @@ int main (int argc, char **argv)
if(!dp)
return 1;

caca_set_delay(dp, 20000);
caca_set_display_time(dp, 20000);

c2 = cucul_create_canvas(cucul_get_canvas_width(cv),
cucul_get_canvas_height(cv));


+ 3
- 3
test/demo.c 파일 보기

@@ -55,7 +55,7 @@ int main(int argc, char **argv)
if(!dp)
return 1;

caca_set_delay(dp, 40000);
caca_set_display_time(dp, 40000);

/* Initialize data */
#if 0
@@ -187,8 +187,8 @@ int main(int argc, char **argv)
cucul_draw_thin_box(cv, 1, 1, cucul_get_canvas_width(cv) - 2,
cucul_get_canvas_height(cv) - 2);
cucul_printf(cv, 4, 1, "[%i.%i fps]----",
1000000 / caca_get_rendertime(dp),
(10000000 / caca_get_rendertime(dp)) % 10);
1000000 / caca_get_display_time(dp),
(10000000 / caca_get_display_time(dp)) % 10);
caca_refresh_display(dp);
}
}


+ 1
- 1
test/frames.c 파일 보기

@@ -42,7 +42,7 @@ int main(void)
cucul_set_canvas_size(cv, 41, 16);

dp = caca_create_display(cv);
caca_set_delay(dp, 50000);
caca_set_display_time(dp, 50000);

/* Fill the first 16 frames with a different colour */
for(frame = 0; frame < 16; frame++)


+ 1
- 1
test/gamma.c 파일 보기

@@ -55,7 +55,7 @@ int main(void)
0x00ff0000, 0x0000ff00, 0x000000ff, 0x0);
right = cucul_create_dither(32, 256, 4, 4 * 256,
0x00ff0000, 0x0000ff00, 0x000000ff, 0x0);
caca_set_delay(dp, 20000);
caca_set_display_time(dp, 20000);

for(x = 0; ; x++)
{


불러오는 중...
취소
저장