Skip to content

Commit 51df2f8

Browse files
committed
gs2
1 parent 3ef6b24 commit 51df2f8

File tree

4 files changed

+51
-28
lines changed

4 files changed

+51
-28
lines changed

doc/components.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ graphics.cls
378378
graphics.show
379379
```
380380

381-
### Form: `showpixel` - COMING SOON!
381+
### Form: `showpixel`
382382
- "Activate" a specific pixel on the graphics grid.
383383

384384
```cpp
@@ -387,5 +387,32 @@ graphics.showpixel(row, column)
387387

388388
Example:
389389
```cpp
390-
graphics.showpixel(2,3)
390+
graphics.showpixel(9,50)
391+
```
392+
393+
Output:
394+
```
395+
[Info] PawnScript: Graphics Mode Version: [Gs2]
396+
[Info] [Rows: 20 Columns: 100]
397+
[Info]
398+
[Info]
399+
[Info]
400+
[Info]
401+
[Info]
402+
[Info]
403+
[Info]
404+
[Info]
405+
[Info]
406+
[Info]
407+
[Info]
408+
[Info]
409+
[Info]
410+
[Info]
411+
[Info]
412+
[Info]
413+
[Info]
414+
[Info]
415+
[Info]
416+
[Info]
417+
[Info] Powered by: Pawn Release: 3.10.11
391418
```

src/components/graphics.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public dpp_processgraphics(funcgroup[][],args[][],args_const[][])
3737
//cls
3838
if(!strcmp(funcgroup[1], "cls"))
3939
{
40-
CallLocalFunction("dpp_graphics__cls", "");
40+
CallLocalFunction("dpp_graphics__cls", "i", 1);
4141
dpp_internal<return>(1);
4242
}
4343
//showpicel
@@ -54,7 +54,7 @@ public dpp_processgraphics(funcgroup[][],args[][],args_const[][])
5454
return 1;
5555
}
5656

57-
printf("showpixel\t\targs[0] : '%i'\targs[1] : '%i'", strval(args[0]),strval(args[1]));
57+
//printf("showpixel\t\targs[0] : '%i'\targs[1] : '%i'", strval(args[0]),strval(args[1]));
5858

5959
CallLocalFunction("dpp_graphics__showpixel", "ii", strval(args[0]),strval(args[1]));
6060
dpp_internal<return>(1);

src/core/ver.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ the Initial Developer. All Rights Reserved.
2828
//dpp_genver__()
2929
#define DPP_VERSION_RELEASE "u"
3030
//dpp_genver__()*2
31-
#define DPP_VERSION_GS 1
31+
#define DPP_VERSION_GS 2
3232

3333
new dpp_vers_string__[100];
3434

src/ps_graphics.pwn

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,42 +17,35 @@ the Initial Developer. All Rights Reserved.
1717
1818
*/
1919

20-
#define dpp_graphics_major 0
21-
#define dpp_graphics_minor 0
22-
#define dpp_graphics_patch 1
20+
#define dpp_emptychar '\32'
21+
#define dpp_fullchar '¤'
2322

24-
#define GRAPHICS_ROWS 5
25-
#define GRAPHICS_COLUMNS 5
23+
#define GRAPHICS_ROWS 20
24+
#define GRAPHICS_COLUMNS 100
2625

2726
new dpp_graphics_grid__[GRAPHICS_ROWS][GRAPHICS_COLUMNS];
27+
new dpp_gtemp__[10];
2828

2929
// Setup
3030

3131
dpp_graphics__init(); // Initialize the screen.
3232
dpp_graphics__show(); // Show the screen.
3333
dpp_graphics__showpixel(row, column); // Show pixel.
34-
dpp_graphics__cls(); // Clean the screen.
34+
dpp_graphics__cls(mode); // Clean the screen.
3535

3636
// Functions
3737
public dpp_graphics__init() //Internal
3838
{
39-
for(new i; i < GRAPHICS_ROWS; i++)
40-
{
41-
format(dpp_graphics_grid__[i], GRAPHICS_COLUMNS, "\n");
42-
}
43-
for(new i; i < GRAPHICS_ROWS; i++)
44-
{
45-
for(new j; j < GRAPHICS_COLUMNS; j++)
46-
{
47-
dpp_graphics_grid__[i][j] = '-';
48-
}
49-
}
50-
dpp_gprint("Graphics grid has been initialized.");
39+
CallLocalFunction("dpp_graphics__cls", "i", 0);
5140
return 1;
5241
}
5342

5443
public dpp_graphics__show()
5544
{
45+
for(new i; i < GRAPHICS_COLUMNS; i++)
46+
{
47+
print("\t");
48+
}
5649
printf("\tPawnScript: Graphics Mode\t\t\tVersion: [Gs%i]",
5750
DPP_VERSION_GS);
5851
printf("\t[Rows: %i\t\tColumns: %i]",GRAPHICS_ROWS,GRAPHICS_COLUMNS);
@@ -88,20 +81,23 @@ public dpp_graphics__showpixel(row, column)
8881
dpp_gerror("System encountered an error.");
8982
return 1;
9083
}
91-
printf("__showpixel\t\targs[0] : '%i'\targs[1] : '%i'", row,column);
92-
dpp_graphics_grid__[row-1][column-1] = '+';
84+
//printf("__showpixel\t\targs[0] : '%i'\targs[1] : '%i'", row,column);
85+
dpp_graphics_grid__[row-1][column-1] = dpp_fullchar;
9386
return 1;
9487
}
9588

96-
public dpp_graphics__cls()
89+
public dpp_graphics__cls(mode)
9790
{
9891
for(new i; i < GRAPHICS_ROWS; i++)
9992
{
93+
format(dpp_graphics_grid__[i], GRAPHICS_COLUMNS, "");
10094
for(new j; j < GRAPHICS_COLUMNS; j++)
10195
{
102-
dpp_graphics_grid__[i][j] = '-';
96+
format(dpp_gtemp__,sizeof dpp_gtemp__,"%c",dpp_emptychar);
97+
strcat(dpp_graphics_grid__[i], dpp_gtemp__);
10398
}
10499
}
105-
dpp_gprint("Graphics grid is clean.");
100+
if(mode == 0) dpp_gprint("Graphics grid has been initialized.");
101+
if(mode == 1) dpp_gprint("Graphics grid is clean.");
106102
return 1;
107103
}

0 commit comments

Comments
 (0)