void desactivar_actuador(int x, int y, TipoActuador actuador, string nombre){
        std::swap( x,y);
        SDL_Rect rect;
        rect.x = x;
        rect.y = y;
        rect.w = 100;
        rect.h = 100;
        SDL_SetRenderDrawColor(renderer,0xFF,0xFF,0xFF,0xFF);
        SDL_RenderFillRect(renderer, &rect);
        SDL_RenderPresent(renderer);
        switch (actuador){
        case Alarma:
            filledCircleRGBA( renderer, ORIGEN_X + x,   ORIGEN_Y + y, 6, 0xFF,0xFF,0xFF,0xFF);
            circleRGBA(renderer, ORIGEN_X + x,   ORIGEN_Y + y, 6 , 0xFF,0x00,0x00,0xFF);
            renderString(nombre.c_str(), x +ORIGEN_X-3 ,y+ORIGEN_Y-18, 0xFF,0x00,0x00);
            renderString("OFF", x +ORIGEN_X-6 ,y+ORIGEN_Y+10, 0xFF,0x00,0x00);
            break;
        case Luz:
            filledCircleRGBA( renderer, ORIGEN_X + x,   ORIGEN_Y + y, 6, 0xFF,0xFF,0xFF,0xFF);
            circleRGBA(renderer, ORIGEN_X + x,   ORIGEN_Y + y, 6 , 0xFF,0xB4,0x00,0xFF);
            renderString(nombre.c_str(), x +ORIGEN_X-3 ,y+ORIGEN_Y-18,0xFF,0xB4,0x00);
            renderString("OFF", x +ORIGEN_X-6 ,y+ORIGEN_Y+10,0xFF,0xB4,0x00);
            break;
        };
        SDL_RenderPresent(renderer);
}
void valor_sensor(int x, int y, TipoSensor sensor, float valor){
        std::swap( x,y);
        SDL_Rect rect;
        rect.x = x +ORIGEN_X-6;
        rect.y = y+ORIGEN_Y+10;
        rect.w = 50;
        rect.h = 14;
        SDL_SetRenderDrawColor(renderer,0xFF,0xFF,0xFF,0xFF);
        SDL_RenderFillRect(renderer, &rect);
        SDL_RenderPresent(renderer);
        switch (sensor){
        case Temperatura:
            circleRGBA( renderer, ORIGEN_X + x,   ORIGEN_Y + y, 6, 0,255,0,255);
            renderString(toString(valor).c_str(), x +ORIGEN_X-6 ,y+ORIGEN_Y+10,0,255,0);
            break;
        case Luminosidad:
            circleRGBA( renderer, ORIGEN_X + x,   ORIGEN_Y + y, 6, 0xFF,0xFF,0xFF,0xFF);
            renderString(toString(valor).c_str(), x +ORIGEN_X-6 ,y+ORIGEN_Y+10,0xFF,0xFF,0xFF);
            break;
        case Humo:
            circleRGBA( renderer, ORIGEN_X + x,   ORIGEN_Y + y, 6, 0x00,0x00,0xFF,0xFF);
            renderString(toString(valor).c_str(), x +ORIGEN_X-6 ,y+ORIGEN_Y+10,0x00,0x00,0xFF);
            break;
        };
}
Beispiel #3
0
void DebugDraw::DrawCircle (const b2Vec2 &center, float32 radius, const b2Color &color)
{
    SDL_Rect r = Camera::getInstance()->getRect();
    circleRGBA( SDL_GetVideoSurface(), center.x*World::ratio -r.x, center.y*World::ratio -r.y,
                radius*World::ratio, 0, 0, 0, 255);
    //std::cout << "Drawing Solid Circle" << std::endl;*/
}
Beispiel #4
0
void Circulo(int x, int y, int rad,
             unsigned char r, unsigned char g, unsigned char b, GRF_Imagen img)
{
    GRF_Imagen ptr = ((img==0) ? ventana : img);
    circleRGBA(ptr, x, y, rad, r, g, b,255);
    if (img==0 && dibujo_activo) SDL_UpdateRect(ptr, x-rad, y-rad, rad*2+1, rad*2+1);
}
Beispiel #5
0
void draw_user_selected_unit (SDL_Surface *screen, Sint16 wx, Sint16 wy, Sint16 zoom)
{
	/* center of selected field */
	Sint16 x_rel = wx - world_up_x;
	Sint16 y_rel = wy - world_up_y;
	
	Sint16 x1 = (x_rel * zoom) + (zoom / 4);
	Sint16 y1 = (y_rel * zoom) + (zoom / 4);
	Sint16 x2 = (x_rel * zoom) + (zoom - (zoom / 4));
	Sint16 y2 = (y_rel * zoom) + (zoom - (zoom / 4));
	
	Sint16 mark_x = x1 + (x2 - x1) / 2;
	Sint16 mark_y = y1 + (y2 - y1) / 2;
	
	circleRGBA (screen, mark_x, mark_y, zoom / 2, 204, 24, 24, 255);
	circleRGBA (screen, mark_x, mark_y, zoom, 204, 24, 24, 255);
}
Beispiel #6
0
void Renderer::drawCircle(const b2Vec2& center, float32 radius, Uint8 red, Uint8 green, Uint8 blue, Uint8 alpha, bool filled){
	b2Vec2 coords = toScreenCoords(center);

	if(filled){
		filledCircleRGBA(renderer, (Sint16) coords.x, (Sint16) coords.y, (Sint16) metersToPixels(radius), red, green, blue, alpha);
	}else{
		circleRGBA(renderer, (Sint16) coords.x, (Sint16) coords.y, (Sint16) metersToPixels(radius), red, green, blue, alpha);
	}
}
void Draw(SDL_Surface *screen)
{
 int i,rate,x,y,dx,dy,r,g,b;
 FPSmanager fpsm;
 
 /* Initialize variables */
 srand(time(NULL));
 i=0;
 x=screen->w/2;
 y=screen->h/2;
 dx=7;
 dy=5;
 r=g=b=255;
  
 SDL_initFramerate(&fpsm);

 while (1) {
  
  /* Set/switch framerate */
  i -= 1;
  if (i<0) {
   /* Set new rate */
   rate=5+5*(rand() % 10);
   SDL_setFramerate(&fpsm,rate);
   printf ("\nFramerate set to %i Hz ...\n\n",rate);
   /* New timeout */
   i=2*rate;
   /* New Color */
   r=rand() & 255;
   g=rand() & 255;
   b=rand() & 255;
  }

  HandleEvent();
  
  /* Black screen */
  ClearScreen(screen);

  /* Move */
  x += dx;
  y += dy;
  
  /* Reflect */
  if ((x<0) || (x>screen->w)) { dx=-dx; }
  if ((y<0) || (y>screen->h)) { dy=-dy; }

  /* Draw */
  filledCircleRGBA (screen,x,y,30,r,g,b,255);
  circleRGBA(screen,x,y,30,255,255,255,255);
    
  /* Display by flipping screens */
  SDL_UpdateRect(screen,0,0,0,0);

  /* Delay to fix rate */                   
  SDL_framerateDelay(&fpsm);  
 }
}
Beispiel #8
0
void Draw(SDL_Renderer *renderer, FPSmanager *fpsm)
{
	int newRate;
	int currentRate;

		/* FPSmanager: get current rate */
		currentRate = SDL_getFramerate(fpsm);

		/* Set/switch framerate */
		timeout--;
		if (timeout < 0) {
			/* New rate */
			newRate = 5 + 5 * (rand() % 10);

			/* Update timeout */
			timeout = 2 * newRate;

			/* New Color */
			r = rand() & 255;
			g = rand() & 255;
			b = rand() & 255;

			/* FPSmanager: set new rate */
			SDL_setFramerate(fpsm, newRate);
		}

		/* Black screen */
		ClearScreen(renderer);

		/* Move */
		x += dx;
		y += dy;

		/* Reflect */
		if ((x<0) || (x>WIDTH)) { dx=-dx; }
		if ((y<0) || (y>HEIGHT)) { dy=-dy; }

		/* Draw */
		filledCircleRGBA (renderer,x,y,30,r,g,b,255);
		circleRGBA(renderer,x,y,30,255,255,255,255);

		/* Report set rate and current delay (from last iteration) */
		if (time_passed > 0) {
			SDL_snprintf(messageText, 1024, "Set rate: %4iHz   Last delay=%4ims / Calc.Rate=%4iHz", currentRate, time_passed, 1000 / time_passed); 
			stringRGBA (renderer, WIDTH/2 - 4*strlen(messageText),HEIGHT-24,messageText,255,255,255,255);
		}

		/* Simulate some random delay from drawing, business logic, network interaction, etc. */
		SDL_Delay(1 + rand() % 10);

		/* Display */
		SDL_RenderPresent(renderer);

		/* FPSmanager: Delay to a fixed rate */                   
		time_passed = SDL_framerateDelay(fpsm);  
}
Beispiel #9
0
void Tower::DrawRange()
{
	int r = 255;
	int g = 0;
	int b = 0;

	int x = (gridX + .5)*TILESIZE + Surface::Padding;
	int y = (gridY + .5)*TILESIZE + Surface::Padding;

	filledCircleRGBA(Surface::Display, x, y, range, r, g, b, 64);
	circleRGBA(Surface::Display, x, y, range, r, g, b, 255);
};
Beispiel #10
0
CAMLprim value ml_circleRGBA(value dst,value p,value ra, value col,value alpha)
{
  SDL_Surface *sur= SDL_SURFACE(dst);
  SDL_Rect prect;
  SDL_Color c;
  int r;

  SDLRect_of_value(&prect,p);
  SDLColor_of_value(&c,col);
  r=circleRGBA(sur,prect.x,prect.y,Int_val(ra),c.r,c.g,c.b, Int_val(alpha));

  return Val_bool(r);
}
Beispiel #11
0
void affichage(){
    
       
    cpFloat timeStep = 1.0/60.0;
      SDL_Color white={255,255,255};
          for(cpFloat time = 0; time < 25; time += timeStep){
              SDL_FillRect(ecran, NULL, SDL_MapRGB(ecran->format,0,0,0));
              for(int i=0;i<50;i++){
                  if(lesBoules[i].del==FALSE){
                 cpVect pos = cpBodyGetPos(lesBoules[i].body);
                 cpVect vel = cpBodyGetVel(lesBoules[i].body);
    
                 rectangleColor(ecran,10, 0, 630, 420,SDL_MapRGB(ecran->format,255,255,255));
                 circleRGBA(ecran, pos.y, pos.x, lesBoules[i].radius, lesBoules[i].r,lesBoules[i].g,lesBoules[i].b,lesBoules[i].a); 
                 filledCircleRGBA(ecran,pos.y,pos.x,lesBoules[i].radius, lesBoules[i].r,lesBoules[i].g,lesBoules[i].b,lesBoules[i].a);
                 
                 //lettre
                 
                 SDL_Surface *lettre= TTF_RenderText_Solid(police, lesBoules[i].lettre, white);
                 SDL_Rect position;
                 position.y=pos.x;
                 position.x=pos.y;
                 lesBoules[i].x=pos.x;
                 lesBoules[i].y=pos.y;
                 SDL_BlitSurface(lettre, NULL, ecran, &position);
                  }
                 
 
               }

              SDL_Surface *pointsTexte=TTF_RenderText_Solid(police,"Score:" , white);
                 SDL_Rect position_pointsTexte;
                 position_pointsTexte.y=435;
                 position_pointsTexte.x=10;
                 SDL_BlitSurface(pointsTexte, NULL, ecran, &position_pointsTexte);
                 char scoreChar[15]={"0"};
                 snprintf(scoreChar, 15, "%d", score);
                 SDL_Surface *points=TTF_RenderText_Solid(police,scoreChar, white);
                 SDL_Rect position_points;
                 position_points.y=435;
                 position_points.x=100;
                 SDL_BlitSurface(points, NULL, ecran, &position_points);
                 
                 
              cpSpaceStep(espace, timeStep);
              SDL_Flip(ecran);
          }
                      //affichage points
                 
 SDL_Flip(ecran);
}
Beispiel #12
0
//http://www.ferzkopp.net/Software/SDL2_gfx/Docs/html/_s_d_l2__gfx_primitives_8h.html
//utilisation de la primitive gfx
// ici on ajoute des cercles pein ou vide
// on peut aussi ajouter des courbes de bézier, des polygones,des lignes épaisses...
void createShapes(){
        Sint16 circleR = 100;
        Sint16 circleX = 300;
        Sint16 circleY = 300;
        SDL_Renderer* renderer=SDLS_getRenderer();
        filledCircleColor(renderer, circleX, circleY, circleR, 0xFF0000FF);
        circleRGBA(renderer,200,200,100,0,255,0,255);
        roundedRectangleRGBA(renderer,10,10,100,100,30,120,120,0,255);
        thickLineRGBA(renderer,450,150,150,450,50,255,0,255,255);
        trigonRGBA(renderer,100,100,200,200,100,300,0,255,120,255);
        Sint16 vx[10]={10,50,150,200, 220,240,410,500,200,250};
         Sint16 vy[10]={10,80,10,0,10,30,50,80,30,150};
        bezierRGBA(renderer,vx,vy,10,3,50,0,255,255);
}
Beispiel #13
0
void GUI::draw(const WorldModel &wm) {
	// Draw balls
	for(int i = 0; i < (int)wm.balls.size(); i ++)
	{
		float alpha = 0;
		float alphaChange = float(255 / (wm.balls.at(i).radius  * (float)display->w/2 / 2)) ;
		for(int r = 0 ; r < wm.balls.at(i).radius * (float)display->w/2 ; r++)
		{
			circleRGBA(display, converter.convert(wm.balls[i].pos).x(), converter.convert(wm.balls[i].pos).y(), r ,
				255, 255, 255, alpha);
			alpha += alphaChange;
		}
	}
}
Beispiel #14
0
// ML type: surface -> circle -> color -> unit
// Draws a circle of the given color on the surface.
EXTERNML value draw_draw_circle(value wScreen, value wCircle, value wColor) {
    SDL_Surface *screen = (SDL_Surface *)Addr_val(wScreen);

    int x = Long_val(Field(Field(wCircle, 0), 0)),
        y = Long_val(Field(Field(wCircle, 0), 1)),
        r = Long_val(Field(wCircle, 1)),
        colorr = Long_val(Field(wColor, 0)),
        colorg = Long_val(Field(wColor, 1)),
        colorb = Long_val(Field(wColor, 2)),
        colora = Tag_val(wColor) == RGBA ? Long_val(Field(wColor, 3)) : 255;

    if (Tag_val(wCircle) == FilledCircle) {
        filledCircleRGBA(screen, x, y, r, colorr, colorg, colorb, colora);
    } else if (Tag_val(wCircle) == AntiAliasedCircle) {
        aacircleRGBA(screen, x, y, r, colorr, colorg, colorb, colora);
    } else {
        circleRGBA(screen, x, y, r, colorr, colorg, colorb, colora);
    }

    return Val_unit;
}
Beispiel #15
0
int cSleeperGuard::render(SDL_Surface* dst, cLevel* level, bool los) {
    coord tc = {x, y};
    tc = level->toScreen(tc);

    switch (state) {
        case SleeperGuardStates_ALARM:
            drawLOS(dst, level, x, y, angle, GUARD_FOV, 100);

            applySurface(sGuard, dst, tc.x - sGuard->w/2, tc.y - sGuard->h/2);

            break;
        case SleeperGuardStates_SLEEP:
            circleRGBA(dst, tc.x, tc.y, range, 255, 0, 0, 255);
            filledCircleRGBA(dst, tc.x, tc.y, range, 255, 0, 0, 80);

            applySurface(sGuard, dst, tc.x - sGuard->w/2, tc.y - sGuard->h/2);

            break;
    }
    return 0;
}
Beispiel #16
0
void drawcircle(int x1, int y1, int radius){
	circleRGBA(screen, x1, y1, radius, foreground_color.r, foreground_color.g, foreground_color.b , 255);
	
	/* SDL_Flip(screen); */
}
Beispiel #17
0
//functionality
void Player::Draw ( void )
{
	circleRGBA( PlayerImage, X, Y, 5, 0,n0, 0, 255);
};
Beispiel #18
0
void Boid::DrawDebug(SDL_Renderer* renderer)
{
	if (currentBehaviour == Behaviour::OBSTACLE_AVOIDANCE)
	{
		if (obstacleAvoidanceCollision == true)
		{
			filledCircleColor(renderer, avoidTarget.x, avoidTarget.y, 10, Colors::TURQUOISE);
		}
	}
	else if (currentBehaviour == Behaviour::COLLISION_AVOIDANCE 
		|| currentBehaviour == Behaviour::PRIORITY_COLLISION)
	{
		static int timerColor = 0;
		int maxTime = 10;
		Uint32 collisionColor = Colors::BELIZE_HOLE;
		if (collisionDetected == true || timerColor > 0)
		{
			collisionColor = Colors::ORANGE;
			if (collisionDetected == true)
			{
				timerColor = maxTime;
			}
		}
		--timerColor;
		Vector2D triangleX1 = { position.x + coneHeight, position.y - tanf(coneHalfAngle * DEG2RAD) * coneHeight };
		Vector2D triangleX2 = { position.x + coneHeight, position.y + tanf(coneHalfAngle * DEG2RAD) * coneHeight };
		Vector2D rotatedTriangle1 = Vector2DUtils::RotatePoint(position, triangleX1, angle);
		Vector2D rotatedTriangle2 = Vector2DUtils::RotatePoint(position, triangleX2, angle);
		filledTrigonColor(renderer, position.x, position.y,
			rotatedTriangle1.x, rotatedTriangle1.y,
			rotatedTriangle2.x, rotatedTriangle2.y,
			collisionColor);
		return;
	}
	else if (currentBehaviour == Behaviour::ARRIVE)
	{
		circleRGBA(renderer, target->position.x, target->position.y, slowingRadius, 255, 255, 0, 255);
		sprintf(textBuffer, "Speed = %.2f", desiredVelocity.Length());
		RotatedText_SetText(&informationText4, textBuffer);
		RotatedText_DrawText(&informationText4, position.x + 10.0f,
			position.y + 10.0f, 0.0f,
			0, 0, 255, 255);
	}
	else if (currentBehaviour == Behaviour::WANDER)
	{
		circleRGBA(renderer, wanderCircleCenter.x, wanderCircleCenter.y, wanderCircleRadius, 255, 255, 0, 255);
		filledCircleRGBA(renderer, wanderDisplacementVector.x, wanderDisplacementVector.y, 10, 128, 0, 128, 255);

		SDL_SetRenderDrawColor(renderer, 255, 0, 0, 255);
		SDL_RenderDrawLine(renderer, position.x, position.y, wanderDisplacementVector.x, wanderDisplacementVector.y);
	}
	else if (currentBehaviour != Behaviour::PRIORITY_OBSTACLE)
	{
		int currentTextAngle;

		SDL_SetRenderDrawColor(renderer, 255, 0, 0, 255);
		SDL_RenderDrawLine(renderer, position.x, position.y, position.x + speed.x, position.y + speed.y);

		if (isSteering == true)
		{
			SDL_SetRenderDrawColor(renderer, 255, 255, 0, 255);
			SDL_RenderDrawLine(renderer, position.x, position.y, position.x + desiredVelocity.x, position.y + desiredVelocity.y);

			SDL_SetRenderDrawColor(renderer, 255, 0, 255, 255);
			SDL_RenderDrawLine(renderer, position.x + speed.x, position.y + speed.y, position.x + desiredVelocity.x, position.y + desiredVelocity.y);

			currentTextAngle = atan2f(desiredVelocity.y, desiredVelocity.x) * RAD2DEG;
			if (currentTextAngle < -90 || (currentTextAngle > 90 && currentTextAngle < 180))
			{
				currentTextAngle = currentTextAngle - 180;
			}
			RotatedText_DrawText(&informationText2,
				(2 * position.x + (desiredVelocity.x)) / 2,
				(2 * position.y + desiredVelocity.y) / 2,
				currentTextAngle,
				255, 255, 0, 255);

			currentTextAngle = atan2f((desiredVelocity.y - speed.y), (desiredVelocity.x - speed.x)) * RAD2DEG;
			if (currentTextAngle < -90 || (currentTextAngle > 90 && currentTextAngle < 180))
			{
				currentTextAngle = currentTextAngle - 180;
			}
			RotatedText_DrawText(&informationText3,
				(position.x + (speed.x) + position.x + (desiredVelocity.x)) / 2,
				(position.y + speed.y + position.y + desiredVelocity.y) / 2,
				currentTextAngle,
				255, 0, 255, 255);

			if (currentBehaviour == Behaviour::PURSUE || currentBehaviour == Behaviour::EVADE)
			{
				filledCircleRGBA(renderer, futurePosition.x, futurePosition.y, 20, 255, 255, 0, 255);
			}
		}

		currentTextAngle = angle;
		if (currentTextAngle < -90 || (currentTextAngle > 90 && currentTextAngle < 180))
		{
			currentTextAngle = currentTextAngle - 180;
		}
		RotatedText_DrawText(&informationText1,
			(2 * position.x + (speed.x)) / 2,
			(2 * position.y + speed.y) / 2,
			currentTextAngle,
			255, 0, 0, 255);
	}
}
Beispiel #19
0
			void _render(SDL_Surface* surface, SDL_Color color, vector offset) {
				for(int i=0;i < params.value1;i++) {
					circleRGBA(surface, randint(0,surface->w), randint(0,surface->h), params.value2, color.r, color.g, color.b, 255);
				}
			}
Beispiel #20
0
/* Calls to commands created via [sdl.surface] are implemented by this
 * C command. */
static int JimSdlHandlerCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
    JimSdlSurface *jss = Jim_CmdPrivData(interp);
    int option;
    static const char * const options[] = {
        "free", "flip", "pixel", "rectangle", "box", "line", "aaline",
        "circle", "aacircle", "fcircle", NULL
    };
    enum
    { OPT_FREE, OPT_FLIP, OPT_PIXEL, OPT_RECTANGLE, OPT_BOX, OPT_LINE,
        OPT_AALINE, OPT_CIRCLE, OPT_AACIRCLE, OPT_FCIRCLE
    };

    if (argc < 2) {
        Jim_WrongNumArgs(interp, 1, argv, "method ?args ...?");
        return JIM_ERR;
    }
    if (Jim_GetEnum(interp, argv[1], options, &option, "SDL surface method", JIM_ERRMSG) != JIM_OK)
        return JIM_ERR;
    if (option == OPT_PIXEL) {
        /* PIXEL */
        long x, y, red, green, blue, alpha = 255;

        if (argc != 7 && argc != 8) {
            Jim_WrongNumArgs(interp, 2, argv, "x y red green blue ?alpha?");
            return JIM_ERR;
        }
        if (Jim_GetLong(interp, argv[2], &x) != JIM_OK ||
            Jim_GetLong(interp, argv[3], &y) != JIM_OK ||
            Jim_GetLong(interp, argv[4], &red) != JIM_OK ||
            Jim_GetLong(interp, argv[5], &green) != JIM_OK ||
            Jim_GetLong(interp, argv[6], &blue) != JIM_OK) {
            return JIM_ERR;
        }
        if (argc == 8 && Jim_GetLong(interp, argv[7], &alpha) != JIM_OK)
            return JIM_ERR;
        pixelRGBA(jss->screen, x, y, red, green, blue, alpha);
        return JIM_OK;
    }
    else if (option == OPT_RECTANGLE || option == OPT_BOX ||
        option == OPT_LINE || option == OPT_AALINE) {
        /* RECTANGLE, BOX, LINE, AALINE */
        long x1, y1, x2, y2, red, green, blue, alpha = 255;

        if (argc != 9 && argc != 10) {
            Jim_WrongNumArgs(interp, 2, argv, "x y red green blue ?alpha?");
            return JIM_ERR;
        }
        if (Jim_GetLong(interp, argv[2], &x1) != JIM_OK ||
            Jim_GetLong(interp, argv[3], &y1) != JIM_OK ||
            Jim_GetLong(interp, argv[4], &x2) != JIM_OK ||
            Jim_GetLong(interp, argv[5], &y2) != JIM_OK ||
            Jim_GetLong(interp, argv[6], &red) != JIM_OK ||
            Jim_GetLong(interp, argv[7], &green) != JIM_OK ||
            Jim_GetLong(interp, argv[8], &blue) != JIM_OK) {
            return JIM_ERR;
        }
        if (argc == 10 && Jim_GetLong(interp, argv[9], &alpha) != JIM_OK)
            return JIM_ERR;
        switch (option) {
            case OPT_RECTANGLE:
                rectangleRGBA(jss->screen, x1, y1, x2, y2, red, green, blue, alpha);
                break;
            case OPT_BOX:
                boxRGBA(jss->screen, x1, y1, x2, y2, red, green, blue, alpha);
                break;
            case OPT_LINE:
                lineRGBA(jss->screen, x1, y1, x2, y2, red, green, blue, alpha);
                break;
            case OPT_AALINE:
                aalineRGBA(jss->screen, x1, y1, x2, y2, red, green, blue, alpha);
                break;
        }
        return JIM_OK;
    }
    else if (option == OPT_CIRCLE || option == OPT_AACIRCLE || option == OPT_FCIRCLE) {
        /* CIRCLE, AACIRCLE, FCIRCLE */
        long x, y, radius, red, green, blue, alpha = 255;

        if (argc != 8 && argc != 9) {
            Jim_WrongNumArgs(interp, 2, argv, "x y radius red green blue ?alpha?");
            return JIM_ERR;
        }
        if (Jim_GetLong(interp, argv[2], &x) != JIM_OK ||
            Jim_GetLong(interp, argv[3], &y) != JIM_OK ||
            Jim_GetLong(interp, argv[4], &radius) != JIM_OK ||
            Jim_GetLong(interp, argv[5], &red) != JIM_OK ||
            Jim_GetLong(interp, argv[6], &green) != JIM_OK ||
            Jim_GetLong(interp, argv[7], &blue) != JIM_OK) {
            return JIM_ERR;
        }
        if (argc == 9 && Jim_GetLong(interp, argv[8], &alpha) != JIM_OK)
            return JIM_ERR;
        switch (option) {
            case OPT_CIRCLE:
                circleRGBA(jss->screen, x, y, radius, red, green, blue, alpha);
                break;
            case OPT_AACIRCLE:
                aacircleRGBA(jss->screen, x, y, radius, red, green, blue, alpha);
                break;
            case OPT_FCIRCLE:
                filledCircleRGBA(jss->screen, x, y, radius, red, green, blue, alpha);
                break;
        }
        return JIM_OK;
    }
    else if (option == OPT_FREE) {
        /* FREE */
        if (argc != 2) {
            Jim_WrongNumArgs(interp, 2, argv, "");
            return JIM_ERR;
        }
        Jim_DeleteCommand(interp, Jim_String(argv[0]));
        return JIM_OK;
    }
    else if (option == OPT_FLIP) {
        /* FLIP */
        if (argc != 2) {
            Jim_WrongNumArgs(interp, 2, argv, "");
            return JIM_ERR;
        }
        SDL_Flip(jss->screen);
        return JIM_OK;
    }
    return JIM_OK;
}