Skip to content

Commit

Permalink
added black outlines to non selected cars
Browse files Browse the repository at this point in the history
  • Loading branch information
DogeSSBM committed May 17, 2022
1 parent f785b27 commit 944d431
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 59 deletions.
106 changes: 53 additions & 53 deletions .tags
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,36 @@ BLEND_ALPHA Types.h 46;" d
BLEND_MOD Types.h 48;" d
BLEND_NONE Types.h 45;" d
BLUE Colors.h /^const Color BLUE = {0x00, 0x00, 0xFF, 0xFF};$/;" v
BORDERLESS Types.h /^ BORDERLESS = SDL_WINDOW_FULLSCREEN_DESKTOP,$/;" e enum:__anon3
BORDERLESS Types.h /^ BORDERLESS = SDL_WINDOW_FULLSCREEN_DESKTOP,$/;" e enum:__anon5
BlendMode Types.h /^typedef SDL_BlendMode BlendMode;$/;" t
CAR_A Cars.h /^ CAR_A,CAR_B,CAR_C,CAR_D,CAR_E,CAR_F,CAR_G,CAR_H,CAR_I,CAR_J,CAR_K,$/;" e enum:__anon1
CAR_B Cars.h /^ CAR_A,CAR_B,CAR_C,CAR_D,CAR_E,CAR_F,CAR_G,CAR_H,CAR_I,CAR_J,CAR_K,$/;" e enum:__anon1
CAR_C Cars.h /^ CAR_A,CAR_B,CAR_C,CAR_D,CAR_E,CAR_F,CAR_G,CAR_H,CAR_I,CAR_J,CAR_K,$/;" e enum:__anon1
CAR_D Cars.h /^ CAR_A,CAR_B,CAR_C,CAR_D,CAR_E,CAR_F,CAR_G,CAR_H,CAR_I,CAR_J,CAR_K,$/;" e enum:__anon1
CAR_E Cars.h /^ CAR_A,CAR_B,CAR_C,CAR_D,CAR_E,CAR_F,CAR_G,CAR_H,CAR_I,CAR_J,CAR_K,$/;" e enum:__anon1
CAR_F Cars.h /^ CAR_A,CAR_B,CAR_C,CAR_D,CAR_E,CAR_F,CAR_G,CAR_H,CAR_I,CAR_J,CAR_K,$/;" e enum:__anon1
CAR_G Cars.h /^ CAR_A,CAR_B,CAR_C,CAR_D,CAR_E,CAR_F,CAR_G,CAR_H,CAR_I,CAR_J,CAR_K,$/;" e enum:__anon1
CAR_H Cars.h /^ CAR_A,CAR_B,CAR_C,CAR_D,CAR_E,CAR_F,CAR_G,CAR_H,CAR_I,CAR_J,CAR_K,$/;" e enum:__anon1
CAR_I Cars.h /^ CAR_A,CAR_B,CAR_C,CAR_D,CAR_E,CAR_F,CAR_G,CAR_H,CAR_I,CAR_J,CAR_K,$/;" e enum:__anon1
CAR_J Cars.h /^ CAR_A,CAR_B,CAR_C,CAR_D,CAR_E,CAR_F,CAR_G,CAR_H,CAR_I,CAR_J,CAR_K,$/;" e enum:__anon1
CAR_K Cars.h /^ CAR_A,CAR_B,CAR_C,CAR_D,CAR_E,CAR_F,CAR_G,CAR_H,CAR_I,CAR_J,CAR_K,$/;" e enum:__anon1
CAR_O Cars.h /^ CAR_O,CAR_P,CAR_Q,CAR_R,$/;" e enum:__anon1
CAR_P Cars.h /^ CAR_O,CAR_P,CAR_Q,CAR_R,$/;" e enum:__anon1
CAR_Q Cars.h /^ CAR_O,CAR_P,CAR_Q,CAR_R,$/;" e enum:__anon1
CAR_R Cars.h /^ CAR_O,CAR_P,CAR_Q,CAR_R,$/;" e enum:__anon1
CAR_X Cars.h /^ CAR_X$/;" e enum:__anon1
Car Cars.h /^}Car;$/;" t typeref:struct:__anon2
CarArrIndex Cars.h /^}CarArrIndex;$/;" t typeref:enum:__anon1
CAR_A Cars.h /^ CAR_A,CAR_B,CAR_C,CAR_D,CAR_E,CAR_F,CAR_G,CAR_H,CAR_I,CAR_J,CAR_K,$/;" e enum:__anon2
CAR_B Cars.h /^ CAR_A,CAR_B,CAR_C,CAR_D,CAR_E,CAR_F,CAR_G,CAR_H,CAR_I,CAR_J,CAR_K,$/;" e enum:__anon2
CAR_C Cars.h /^ CAR_A,CAR_B,CAR_C,CAR_D,CAR_E,CAR_F,CAR_G,CAR_H,CAR_I,CAR_J,CAR_K,$/;" e enum:__anon2
CAR_D Cars.h /^ CAR_A,CAR_B,CAR_C,CAR_D,CAR_E,CAR_F,CAR_G,CAR_H,CAR_I,CAR_J,CAR_K,$/;" e enum:__anon2
CAR_E Cars.h /^ CAR_A,CAR_B,CAR_C,CAR_D,CAR_E,CAR_F,CAR_G,CAR_H,CAR_I,CAR_J,CAR_K,$/;" e enum:__anon2
CAR_F Cars.h /^ CAR_A,CAR_B,CAR_C,CAR_D,CAR_E,CAR_F,CAR_G,CAR_H,CAR_I,CAR_J,CAR_K,$/;" e enum:__anon2
CAR_G Cars.h /^ CAR_A,CAR_B,CAR_C,CAR_D,CAR_E,CAR_F,CAR_G,CAR_H,CAR_I,CAR_J,CAR_K,$/;" e enum:__anon2
CAR_H Cars.h /^ CAR_A,CAR_B,CAR_C,CAR_D,CAR_E,CAR_F,CAR_G,CAR_H,CAR_I,CAR_J,CAR_K,$/;" e enum:__anon2
CAR_I Cars.h /^ CAR_A,CAR_B,CAR_C,CAR_D,CAR_E,CAR_F,CAR_G,CAR_H,CAR_I,CAR_J,CAR_K,$/;" e enum:__anon2
CAR_J Cars.h /^ CAR_A,CAR_B,CAR_C,CAR_D,CAR_E,CAR_F,CAR_G,CAR_H,CAR_I,CAR_J,CAR_K,$/;" e enum:__anon2
CAR_K Cars.h /^ CAR_A,CAR_B,CAR_C,CAR_D,CAR_E,CAR_F,CAR_G,CAR_H,CAR_I,CAR_J,CAR_K,$/;" e enum:__anon2
CAR_O Cars.h /^ CAR_O,CAR_P,CAR_Q,CAR_R,$/;" e enum:__anon2
CAR_P Cars.h /^ CAR_O,CAR_P,CAR_Q,CAR_R,$/;" e enum:__anon2
CAR_Q Cars.h /^ CAR_O,CAR_P,CAR_Q,CAR_R,$/;" e enum:__anon2
CAR_R Cars.h /^ CAR_O,CAR_P,CAR_Q,CAR_R,$/;" e enum:__anon2
CAR_X Cars.h /^ CAR_X$/;" e enum:__anon2
Car Cars.h /^}Car;$/;" t typeref:struct:__anon3
CarArrIndex Cars.h /^}CarArrIndex;$/;" t typeref:enum:__anon2
Color Types.h /^typedef SDL_Color Color;$/;" t
Coord Types.h /^}Coord;$/;" t typeref:union:__anon4
DIR_D Types.h /^ DIR_D = 0b10,$/;" e enum:__anon6
DIR_L Types.h /^ DIR_L = 0b11$/;" e enum:__anon6
DIR_R Types.h /^ DIR_R = 0b01,$/;" e enum:__anon6
DIR_U Types.h /^ DIR_U = 0b00,$/;" e enum:__anon6
Direction Types.h /^}Direction;$/;" t typeref:enum:__anon6
Coord Types.h /^}Coord;$/;" t typeref:union:__anon6
DIR_D Types.h /^ DIR_D = 0b10,$/;" e enum:__anon8
DIR_L Types.h /^ DIR_L = 0b11$/;" e enum:__anon8
DIR_R Types.h /^ DIR_R = 0b01,$/;" e enum:__anon8
DIR_U Types.h /^ DIR_U = 0b00,$/;" e enum:__anon8
Direction Types.h /^}Direction;$/;" t typeref:enum:__anon8
Event Types.h /^typedef SDL_Event Event;$/;" t
FPS main.c 11;" d file:
FULLSCREEN Types.h /^ FULLSCREEN = SDL_WINDOW_FULLSCREEN,$/;" e enum:__anon3
FULLSCREEN Types.h /^ FULLSCREEN = SDL_WINDOW_FULLSCREEN,$/;" e enum:__anon5
File Types.h /^typedef FILE File;$/;" t
GREEN Colors.h /^const Color GREEN = {0x00, 0xFF, 0x00, 0xFF};$/;" v
GREY Colors.h /^const Color GREY = {0x80, 0x80, 0x80, 0xFF};$/;" v
Expand Down Expand Up @@ -73,21 +73,21 @@ TB_draw Text.h /^void TB_draw(TextBox *tb)$/;" f
TB_setText Text.h /^void TB_setText(TextBox *tb, const char *text)$/;" f
TB_setTextSize Text.h /^void TB_setTextSize(TextBox *tb, int size)$/;" f
TPS main.c 12;" d file:
TextBox Text.h /^}TextBox;$/;" t typeref:struct:__anon8
TextBox Text.h /^}TextBox;$/;" t typeref:struct:__anon4
Ticks Types.h /^typedef unsigned int Ticks;$/;" t
Time Types.h /^typedef time_t Time;$/;" t
U16MAX Types.h 32;" d
U32MAX Types.h 33;" d
U64MAX Types.h 34;" d
U8MAX Types.h 31;" d
WHITE Colors.h /^const Color WHITE = {0xFF, 0xFF, 0xFF, 0xFF};$/;" v
WINDOWED Types.h /^ WINDOWED = 0$/;" e enum:__anon3
WINDOWED Types.h /^ WINDOWED = 0$/;" e enum:__anon5
WINLEN main.c 3;" d file:
WindowMode Types.h /^}WindowMode;$/;" t typeref:enum:__anon3
WindowMode Types.h /^}WindowMode;$/;" t typeref:enum:__anon5
YELLOW Colors.h /^const Color YELLOW = {0xFF, 0xFF, 0x00, 0xFF};$/;" v
ZFLOOR Types.h 37;" d
arr Types.h /^ int arr[2];$/;" m union:__anon4
backColor Text.h /^ Color backColor;$/;" m struct:__anon8
arr Types.h /^ int arr[2];$/;" m union:__anon6
backColor Text.h /^ Color backColor;$/;" m struct:__anon4
carArr Cars.h /^Car carArr[NUMCAR] = {$/;" v
charToInt GetInt.h /^int charToInt(const char c)$/;" f
checkGrid Grid.h /^char checkGrid(void)$/;" f
Expand All @@ -96,12 +96,12 @@ checkLevels Grid.h /^void checkLevels(void)$/;" f
clamp Types.h /^int clamp(const int n, const int min, const int max)$/;" f
clear Graphics.h /^void clear()$/;" f
clearTerminal DogeUtil.h /^void clearTerminal(void)$/;" f
color Cars.h /^ Color color;$/;" m struct:__anon2
color Cars.h /^ Color color;$/;" m struct:__anon3
coordClamp Types.h /^Coord coordClamp(const Coord coord, const int min, const int max)$/;" f
coordShift Types.h /^Coord coordShift(const Coord coord, const Direction dir, const int units)$/;" f
countChar Grid.h /^uint countChar(const char c)$/;" f
cycleCar Events.h /^char cycleCar(const char selected, bool prev)$/;" f
defaultColor Graphics.h /^ Color defaultColor;$/;" m struct:__anon7
defaultColor Graphics.h /^ Color defaultColor;$/;" m struct:__anon1
dirINV Types.h 82;" d
dirLR Types.h 83;" d
dirNEG Types.h 86;" d
Expand All @@ -110,9 +110,9 @@ dirROL Types.h 78;" d
dirROR Types.h 77;" d
dirUD Types.h 84;" d
draw Graphics.h /^void draw()$/;" f
drawCarOutline Draw.h /^void drawCarOutline(const char letter)$/;" f
drawCarOutline Draw.h /^void drawCarOutline(const char letter, const bool selected)$/;" f
drawCarSquare Draw.h /^void drawCarSquare(const uint x, const uint y, const char letter)$/;" f
drawCarSquareOutline Draw.h /^void drawCarSquareOutline(const uint x, const uint y)$/;" f
drawCarSquareOutline Draw.h /^void drawCarSquareOutline(const uint x, const uint y, const bool selected)$/;" f
drawCars Draw.h /^void drawCars(void)$/;" f
drawCircle Graphics.h /^void drawCircle(uint x, uint y, uint radius)$/;" f
drawCircleCoord Graphics.h /^void drawCircleCoord(const Coord pos, const uint radius)$/;" f
Expand All @@ -127,7 +127,7 @@ drawSquare Graphics.h /^void drawSquare(uint x, uint y, uint len)$/;" f
drawText Text.h /^void drawText(uint x, uint y, const char *text)$/;" f
drawTextCentered Text.h /^void drawTextCentered(uint x, uint y, const char *text)$/;" f
drawVLine Graphics.h /^void drawVLine(uint x, uint y, int len)$/;" f
enabled Cars.h /^ bool enabled;$/;" m struct:__anon2
enabled Cars.h /^ bool enabled;$/;" m struct:__anon3
events Events.h /^void events(Ticks frameEnd, char *selected)$/;" f
fillBorder Graphics.h /^void fillBorder(uint x, uint y, uint xlen, uint ylen, int b)$/;" f
fillCircle Graphics.h /^void fillCircle(uint x, uint y, uint radius)$/;" f
Expand All @@ -137,16 +137,16 @@ fillScreen Graphics.h /^void fillScreen()$/;" f
fillSquare Graphics.h /^void fillSquare(uint x, uint y, uint len)$/;" f
fillSquareCoord Graphics.h /^void fillSquareCoord(const Coord pos, const uint len)$/;" f
flen DogeUtil.h /^lint flen(File *f)$/;" f
font Graphics.h /^ TTF_Font* font;$/;" m struct:__anon7
fontColor Graphics.h /^ Color fontColor;$/;" m struct:__anon7
fontSize Graphics.h /^ int fontSize;$/;" m struct:__anon7
font Graphics.h /^ TTF_Font* font;$/;" m struct:__anon1
fontColor Graphics.h /^ Color fontColor;$/;" m struct:__anon1
fontSize Graphics.h /^ int fontSize;$/;" m struct:__anon1
freeImg Image.h /^void freeImg(Img *image)$/;" f
getCharCarLen Grid.h /^uint getCharCarLen(const char c)$/;" f
getColor Graphics.h /^Color getColor(void)$/;" f
getInt GetInt.h /^int getInt(void)$/;" f
getR GetInt.h /^int getR(const int num)$/;" f
getTicks Timing.h /^Ticks getTicks(void)$/;" f
gfx Graphics.h /^}gfx = {};$/;" v typeref:struct:__anon7
gfx Graphics.h /^}gfx = {};$/;" v typeref:struct:__anon1
gfx_init Graphics.h /^void gfx_init(uint winXlen, uint winYlen)$/;" f
gfx_quit Graphics.h /^void gfx_quit(void)$/;" f
grid Grid.h /^char grid[GRIDLEN][GRIDLEN];$/;" v
Expand All @@ -159,13 +159,13 @@ i8 Types.h /^typedef int8_t i8;$/;" t
img_init Image.h /^void img_init(void)$/;" f
img_quit Image.h /^void img_quit(void)$/;" f
inBound Types.h /^bool inBound(const int n, const int min, const int max)$/;" f
index Cars.h /^ CarArrIndex index;$/;" m struct:__anon2
index Cars.h /^ CarArrIndex index;$/;" m struct:__anon3
init DogeUtil.h /^void init(uint winXlen, uint winYlen)$/;" f
intToChar GetInt.h /^char intToChar(const int num)$/;" f
intToStr GetInt.h /^char* intToStr(int num, char* str)$/;" f
isValidChar Grid.h /^bool isValidChar(const int c)$/;" f
len Cars.h /^ uint len;$/;" m struct:__anon2
letter Cars.h /^ char letter;$/;" m struct:__anon2
len Cars.h /^ uint len;$/;" m struct:__anon3
letter Cars.h /^ char letter;$/;" m struct:__anon3
lint Types.h /^typedef long int lint;$/;" t
loadDrawImg Image.h /^void loadDrawImg(const char *imgFile)$/;" f
loadGrid Grid.h /^void loadGrid(const char *levelStr)$/;" f
Expand All @@ -175,10 +175,10 @@ menu Menu.h /^void menu(const bool increment)$/;" f
menuSelect Menu.h /^bool menuSelect(Ticks frameEnd, char *levelStr)$/;" f
parseLevelFile Grid.h /^bool parseLevelFile(File *f)$/;" f
printGrid Grid.h /^void printGrid(void)$/;" f
r Text.h /^ Rect r;$/;" m struct:__anon8
r Text.h /^ Rect r;$/;" m struct:__anon4
randRange DogeUtil.h /^float randRange(float a, float b)$/;" f
readin DogeUtil.h /^char* readin(char *buffer, int size)$/;" f
renderer Graphics.h /^ SDL_Renderer* renderer;$/;" m struct:__anon7
renderer Graphics.h /^ SDL_Renderer* renderer;$/;" m struct:__anon1
rgbToColor Colors.h /^Color rgbToColor(const uint R, const uint G, const uint B)$/;" f
rgbaToColor Colors.h /^Color rgbaToColor(const uint R, const uint G, const uint B, const uint A)$/;" f
sameCoord Types.h /^bool sameCoord(const Coord pos1, const Coord pos2)$/;" f
Expand All @@ -195,10 +195,10 @@ setWindowSize Graphics.h /^void setWindowSize(const uint x, const uint y)$/;" f
shiftCar Events.h /^void shiftCar(char *selected, const Direction dir)$/;" f
shiftL GetInt.h /^int shiftL(int num, int digits)$/;" f
shiftR GetInt.h /^int shiftR(const int num)$/;" f
size Text.h /^ int size;$/;" m struct:__anon8
size Text.h /^ int size;$/;" m struct:__anon4
strToInt GetInt.h /^int strToInt(const char *str)$/;" f
text Text.h /^ char* text;$/;" m struct:__anon8
textColor Text.h /^ Color textColor;$/;" m struct:__anon8
text Text.h /^ char* text;$/;" m struct:__anon4
textColor Text.h /^ Color textColor;$/;" m struct:__anon4
text_init Text.h /^void text_init(void)$/;" f
text_quit Text.h /^void text_quit(void)$/;" f
u16 Types.h /^typedef uint16_t u16;$/;" t
Expand All @@ -209,9 +209,9 @@ uchar Types.h /^typedef unsigned char uchar;$/;" t
uint Types.h /^typedef unsigned int uint;$/;" t
ul Types.h /^typedef unsigned long ul;$/;" t
ull Types.h /^typedef unsigned long long ull;$/;" t
window Graphics.h /^ SDL_Window* window;$/;" m struct:__anon7
window Graphics.h /^ SDL_Window* window;$/;" m struct:__anon1
wrap Types.h /^int wrap(const int n, const int min, const int max)$/;" f
x Types.h /^ int x;$/;" m struct:__anon4::__anon5
xlen Graphics.h /^ uint xlen, ylen;$/;" m struct:__anon7
y Types.h /^ int y;$/;" m struct:__anon4::__anon5
ylen Graphics.h /^ uint xlen, ylen;$/;" m struct:__anon7
x Types.h /^ int x;$/;" m struct:__anon6::__anon7
xlen Graphics.h /^ uint xlen, ylen;$/;" m struct:__anon1
y Types.h /^ int y;$/;" m struct:__anon6::__anon7
ylen Graphics.h /^ uint xlen, ylen;$/;" m struct:__anon1
8 changes: 4 additions & 4 deletions Draw.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,24 @@ void drawGrid(void)
}
}

void drawCarSquareOutline(const uint x, const uint y)
void drawCarSquareOutline(const uint x, const uint y, const bool selected)
{
const uint sx = gridToScreen(x);
const uint sy = gridToScreen(y);
setColor(WHITE);
setColor(selected ? WHITE : BLACK);
fillSquare(x*SCALE+5, y*SCALE+5, SCALE-10);
if(x < GRIDLEN-1 && grid[x+1][y] == grid[x][y])
fillSquare(sx+HSCALE+10, sy+10, SCALE-20);
if(y < GRIDLEN-1 && grid[x][y+1] == grid[x][y])
fillSquare(sx+10, sy+HSCALE+10, SCALE-20);
}

void drawCarOutline(const char letter)
void drawCarOutline(const char letter, const bool selected)
{
for(uint x = 0; x < GRIDLEN; x++){
for(uint y = 0; y < GRIDLEN; y++){
if(grid[x][y] == letter)
drawCarSquareOutline(x, y);
drawCarSquareOutline(x, y, selected);
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ int main(int argc, char const *argv[])
Ticks frameStart = getTicks();
clear();
drawGrid();
if(selected != '-')
drawCarOutline(selected);
for(uint i = 0; i < NUMCAR; i++)
if(carArr[i].enabled)
drawCarOutline(carArr[i].letter, selected == carArr[i].letter);
drawCars();
draw();
events(frameStart + TPS, &selected);
Expand Down

0 comments on commit 944d431

Please sign in to comment.