The MASM Forum

Projects => Game Development => Topic started by: caballero on May 15, 2018, 10:21:14 PM

Title: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on May 15, 2018, 10:21:14 PM
Starting making one of the previous lesson quiz for a few compilers 32 and 64 bits
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on June 03, 2018, 06:40:29 PM
I have added some basic shapes using the standard GDI functions. Only in TinyC folder, the others is the same.

This is quite powerful in the sense that you can draw bitmaps on the fly than you can use in your own windows objects.

Really anyone interested? If so I don't like to speak to myself. Any feedback and code will be welcome.

PS. When maximize the smile face window it get quite slow. Fortunatelly it can be improved with our drawing routines.
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: Siekmanski on June 03, 2018, 06:53:15 PM
Quote
Really anyone interested?

 :t I am.

Always want to learn and see how routines are done by other people.

I think it is a cool idea to discuss the different methods to create one effect.
Demo effects are a great resource for building games too. ( many of the game techniques stem from Demos )
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: felipe on June 04, 2018, 02:35:29 AM
Hey caballero this is a great contribution, thank you  :icon14:. I can't promise to be a good student, but surely i will have a look to the code when i get the time. You should keep with your courses when there are interest, i agree with that (that's also a good idea to make students better), but please don't delete what you upload, is good for the forum and when some people get the time to learn about this issue they will come here too.  :idea:
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on June 05, 2018, 04:05:40 AM
I almos forgot. Though I don't like much PeekMessage, here is a way to use it and stabilizing the fps, painting the fps on the screen. Ie, a way to write text to the screen using standard GDI functions.

I know that there's a way to optimize it, maybe using the function Sleep, that decreases the resources used. But, no time to chase it. If anyone knows how to do it, would be nice to tell us :t
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: felipe on June 05, 2018, 04:37:56 AM
 :icon14: This is great, thank you very much.
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on June 24, 2018, 06:18:37 PM
First shape made by hand. Bresenham lines
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on June 24, 2018, 07:28:38 PM
More on basic shapes: circles. Fractal of Apolonio.

And more with Aldus haza (https://youtu.be/dbc1ollRt_E). HIEEERBA.
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: Siekmanski on June 24, 2018, 08:02:31 PM
Very interesting routine, thanks.  8)
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: daydreamer on June 24, 2018, 10:20:07 PM
cool,thanks 8)
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: HSE on June 25, 2018, 01:21:06 AM
Very nice  :t
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on August 09, 2019, 11:17:33 PM
Hello, I'm moving my graphic tutos here (http://abreojosensamblador.epizy.com/?Tarea=5&SubTarea=0&Lang=1&nivel=0&padre=0&accion=0). A work in progress.
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on August 15, 2019, 08:18:47 PM
Plasma made with poasm, 32 and 64 bits
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on August 17, 2019, 02:26:47 AM
Hello

I have started the third chapter (http://abreojosensamblador.epizy.com/?Tarea=5&SubTarea=3&Lang=1&nivel=0&padre=0&accion=0) (palette) with two examples at the moment, if anyone interested. All the compilers have worked well for 32 and 64 bits, except GoAsm for the 64 bits plasma and the palette builder for 32 bits. NasmX also fails for both examples for 64 bits. If anyone find the problem, please, tell me, in other case, I will check it when I have time.

Regards
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on August 17, 2019, 06:05:42 PM
Keep working with Palette examples, here a classical bars demo in 32 and 64 bits, made in fasm.
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on August 18, 2019, 02:30:16 AM
The last example for palette: copper bars, widly used years ago in MS-DOS. Already uploaded to my site in the third chapter (http://abreojosensamblador.epizy.com/?Tarea=5&SubTarea=3&Lang=1&nivel=0&padre=0&accion=0).

This time poasm version for 32 and 64 bits.
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: daydreamer on August 18, 2019, 03:06:00 AM
Keep working with Palette examples, here a classical bars demo in 32 and 64 bits, made in fasm.
nice :thumbsup:
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on August 18, 2019, 03:33:20 AM
Ops, I almost forgot my old good friend worm demo. I finish copper bars for nasmx and goasm and incorporate this one too... when I have time. This one made with tinyc.

Thank you, daydreamer. :thumbsup:
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: daydreamer on August 19, 2019, 07:18:20 PM
nice
I read about you wannat go 3d
I am open for suggestions of different palettes,that is used for landscapes,LUT of colors use by heightmap
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on August 20, 2019, 12:38:35 AM
>that is used for landscapes

Yeah, you can move with cursor keys. :thumbsup:

> you wanna go 3d
Yes, I did

I have a lot of things that I will gradually uploading
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: HSE on August 20, 2019, 01:07:34 AM
 :thumbsup:
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on August 24, 2019, 11:29:55 PM
Burning logo
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on September 02, 2019, 05:11:49 AM
Hello. Image files, this time bitmap 24 bits in resources. Reading it and dump its data image in an array. Also for pcx, tga and even for saving gif. The example is a bmp rotozoomer. It accepts any bmp file that you can drag and drop over the program window, don't use a big one, better a 200x200 for example. Don't pretend to be an image reader, just manage bmp, pcx, tga for our purposes.
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on September 16, 2019, 02:31:01 AM
Hello, I'm uploading the 4th chapter, for graphics files. At the moment only in the Spanish version (http://abreojosensamblador.epizy.com/?Tarea=5&SubTarea=4), though I will upload it soon the English (http://abreojosensamblador.epizy.com/?Tarea=5&SubTarea=4&Lang=1&nivel=0&padre=0&accion=0) one too.

Graphics files:
- BMP. 8 and 24 bits. Reading from files and resources
- TGA. 8 and 24 bits. Reading from files.
- PCX. 8 bits. Reading from file.
- PPM. 24 bits. Writing and reading from file. Using a little raytracing program for that.
- GIF. 8 bits. Writing to file. Using a little program to gerating it.

At the moment only for tinyc. I will make the rest when time permits.
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: HSE on September 24, 2019, 08:27:14 PM
Hi caballero!

In calWM01 and 02 in MASM:
Code: [Select]
.DATA?
  CommandLine   DD          ?
  wc            WNDCLASSEX  <>
  MainhWnd      HWND        <>
  MainHdc       HDC         <>

must be:
Code: [Select]
.DATA?
  CommandLine   DD          ?
  wc            WNDCLASSEX  <>
  MainhWnd      HWND        ?
  MainHdc       HDC         ?

Regards,
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: TimoVJL on September 24, 2019, 09:20:35 PM
Fix for TinyC example BMP8bitsWC01.c
Code: [Select]
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
...
// Variables globales
DWORD              *pMainDIB    = NULL;  // line 48
...
      *(pMainDIB+index) = *(DWORD*)(miBMP->data + k);   // Lo pasamos a pantalla line 116
after that msvc, clang and Pelles C compiles it.
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on September 25, 2019, 12:07:11 AM
Hello

@HSE
Ok, thank you. I had to look where these files were :)

@TimoVJL
Yes, thank you. In fact, it should be this way, but I like more the other one:

Code: [Select]
*(pMainDIB+index) = (miBMP->data[k].Rojo<<16) |
                    (miBMP->data[k].Verde<<8) |
                     miBMP->data[k].Azul;
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on September 25, 2019, 04:17:39 AM
uploaded the fixed codes and bmp and tga versions for masm32 at the moment, and a 8 bitmap from resources also.
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on September 28, 2019, 11:10:26 PM
hello, I have uploaded nearly all the masm32 versions: readers for bmp, pcx, tga, ppm for files and in resources, 8 and 24 bits. Only lefts writing gif and the tiny raytracer. And the versions for the other compilers.

Martik C (https://www.youtube.com/watch?v=wobrgx4e1Lw&list=RD6bgW6i-AqPM&index=6) :eusa_boohoo:
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on October 17, 2019, 07:18:44 AM
To compensate the scam's thread, here it is a tiny game with source, one of the first in history. I believe that Mr Bill Gates did it some decades ago. TinyC source code, 8 kb :thumbsup:

And a great song (https://www.youtube.com/watch?v=QJqxC3RAKtc&feature=youtu.be&t=2635)
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on November 25, 2019, 05:58:23 AM
Hello, I have just uploaded my fifth chapter (http://abreojosensamblador.epizy.com/?Tarea=5&SubTarea=5) about basic maths for 2d graphics. It is a work in progress that I have just started. The last point is for moving a point between 2 points in the screen in a straight way. If anyone want to try it before I upload more stuff in this chapter is welcome to do it. For the moment only in Spanish and only for TinyC. Regards.
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: HSE on November 25, 2019, 11:43:32 PM
Hola Caballero!

Me parece que no está muy claro que son los números complejos. A lo mejor ayudaría una nota que diga para que nos va a servir conocer los números complejos.

Aparentemente todavía no se puede descargar ningún código TinyC.

 :thumbsup:
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on November 26, 2019, 02:37:59 AM
Bueno, gajes del directo :biggrin:, ya se pueden descargar. He explicado someramente lo que son los números complejos, en principio no quiero profundizar más para no liar al que lo lea, básicamente el cuerpo de los números complejos se corresponde con el plano real. Los vamos a usar para rotar un número, cuyo ejemplo está en el punto 5.1.3. como he indicado ahí, concretamente la circunferencia de la izquierda. :thumbsup:
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: HSE on November 26, 2019, 05:04:49 AM
Faltaría un cast:
Code: (Espiral01c.c) [Select]
  108: pMainDIB[i] = (int) miPaleta[m];

Ya voy a entender lo de la paleta  :biggrin:
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on November 26, 2019, 05:19:50 AM
 :thumbsup:No tiene mucho misterio, pero es una herramienta muy potente para la programación de gráficos.
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on November 27, 2019, 07:31:39 AM
Hello, a simple stright line path example. Don't know if anyone want to try it
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: Biterider on November 27, 2019, 05:14:24 PM
Hi
Works fine on W10-64 Home  :thumbsup:

Biterider
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: daydreamer on November 27, 2019, 10:38:34 PM
Hello, I have just uploaded my fifth chapter (http://abreojosensamblador.epizy.com/?Tarea=5&SubTarea=5) about basic maths for 2d graphics. It is a work in progress that I have just started. The last point is for moving a point between 2 points in the screen in a straight way. If anyone want to try it before I upload more stuff in this chapter is welcome to do it. For the moment only in Spanish and only for TinyC. Regards.
I really like your spirals,I tested move path between 2 points program and it works

 
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on November 29, 2019, 07:49:44 AM
Uploaded the stright line path source code in chapter 5.1.4.1. (http://abreojosensamblador.epizy.com/?Tarea=5&SubTarea=5#LineaRecta)
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on December 01, 2019, 10:19:40 PM
I have updated the fifth chapter including (http://abreojosensamblador.epizy.com/?Tarea=5&SubTarea=5#Circular) two path examples: circular and splines. Attached here one for the last one: 5 random generating points calculated each time the program starts.
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: daydreamer on December 02, 2019, 03:47:40 AM
I have updated the fifth chapter including (http://abreojosensamblador.epizy.com/?Tarea=5&SubTarea=5#Circular) two path examples: circular and splines. Attached here one for the last one: 5 random generating points calculated each time the program starts.
works fine,also nice polar rose
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on December 02, 2019, 04:58:48 AM
Thank you for test it  :thumbsup:
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: Siekmanski on December 02, 2019, 11:19:22 AM
They work fine, as all your demos do on my Win 8.1 64 bit PC.  :thumbsup:
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on December 03, 2019, 09:38:28 AM
Talking about paths, here a nice program that I found some time ago here (https://www.freebasic.net/forum/viewtopic.php?t=25301) that I have translated to tiny c, the original in freebasic flickers a bit.
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: daydreamer on December 04, 2019, 02:20:34 AM
Talking about paths, here a nice program that I found some time ago here (https://www.freebasic.net/forum/viewtopic.php?t=25301) that I have translated to tiny c, the original in freebasic flickers a bit.
It works
I want your version of polar rose with source please
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on December 04, 2019, 02:52:57 AM
My version of polar rose is in my site, with source code
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on December 04, 2019, 08:06:20 AM
Bouncing ball with gravity
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on December 05, 2019, 08:12:29 AM
Updated the fifth chapter with the bouncing ball demo and the relationship between Pythagoras' theorem and circumferences
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: HSE on December 06, 2019, 01:32:43 AM
Very nice  :thumbsup:
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on December 09, 2019, 05:01:12 AM
This chapter (http://abreojosensamblador.epizy.com/?Tarea=5&SubTarea=5&Lang=1&nivel=0&padre=0&accion=0) translated to English and some new code.
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: daydreamer on December 10, 2019, 01:44:46 AM
This chapter (http://abreojosensamblador.epizy.com/?Tarea=5&SubTarea=5&Lang=1&nivel=0&padre=0&accion=0) translated to English and some new code.
maybe better to reorder math from simpler pythagoras and circlemaking sine and cosine to be before the more advanced rotation formula which is based on the previous its made from same radius on both the old angle and the new angle
good work with making that chapter :thumbsup:
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on December 10, 2019, 07:58:08 AM
Better show first Pythagoras than complex numbers and rotation? Maybe. Thank you anyway  :thumbsup:
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on December 15, 2019, 08:47:02 PM
I have started the chapter of graphics demos, here is a "raining drops" demo. Note that the window is a 512x512 size that will facilitate me the calculation of random points through xorshifts functions. The use of the standard c rand function is heavy and would lead to a greater increase in CPU usage. In this case it is inappreciable. It may take me a little longer to start with this chapter because I would like to leave the asm versions of the previous ones.

Chapter 6 started here, only in Spanish for the moment
http://abreojosensamblador.epizy.com/?Tarea=5&SubTarea=6
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: HSE on December 16, 2019, 07:32:09 AM
 :thumbsup:
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on December 18, 2019, 06:31:20 AM
This time a flag demo to show how useful may be the sine/cosine function. There's an interesting tricky here: though there are 360 degrees we can reduce them to 255 and play with binary functions (and) instead of divisions (module). This is a quite simple example too and is quite easy to design your own flag too.
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on December 29, 2019, 04:21:51 AM
Blobs Demo, 32 and 64 bits
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: Iznogoode on December 29, 2019, 05:43:39 AM
Thank you caballero for these fascinating works.  I'm reading your first posts and some chapters of Charles Petzold's book (Programming Windows - fith edition) are very useful for understanding any aspects of your work.  Thank you very much !
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on December 29, 2019, 05:59:44 AM
Thank you to you. That is a really good book  :thumbsup:
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on December 29, 2019, 10:38:23 PM
Blur effect is quite important because is used in many graphic demos. This sample is a bit more elaborated, uses blurring that gives a 3d sensation, observe the rhodonea path, and we are here I have added a text scrolling with pixel clipping and a tune in the background. Everything in 108kb uncompressed that could be 17kb compressed.
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: daydreamer on December 31, 2019, 04:57:13 AM
nice work Carlos :thumbsup:

how is your take on make simplest tunnel and more advanced?


Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on December 31, 2019, 06:19:36 AM
 :biggrin: Don't know if you refer to me, because my name is Alfonso, if this would be the case... I will focus this subject a bit later, you can get a good reference here:

https://lodev.org/cgtutor/tunnel.html
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: daydreamer on December 31, 2019, 09:59:32 PM
:biggrin: Don't know if you refer to me, because my name is Alfonso, if this would be the case... I will focus this subject a bit later, you can get a good reference here:

https://lodev.org/cgtutor/tunnel.html
I meant Caballero
thanks, I like your turning tunnel in other thread,but I think it can be made with a different approach,make curved tunnel in C and use break; in loop when detect its turned into hidden pixels
related to tunnels are star gate animation that start when you step thru it


Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on January 03, 2020, 04:32:05 AM
I've just uploaded many of the examples for 6th chapter (http://abreojosensamblador.epizy.com/?Tarea=5&SubTarea=6) at the moment only in Spanish. I have reduced the compilers to fasm, poasm and tinyc, I am too old to manage others that are basically the same. At the moment all of them are in tinyc and some in fasm, I will populate ASAP. Here the examples in tinyc.

Here the codes compiled for now.

Edited: all the demos for the sixth chapter up today
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: daydreamer on January 04, 2020, 03:30:46 AM
I've just uploaded many of the examples for 6th chapter (http://abreojosensamblador.epizy.com/?Tarea=5&SubTarea=6) at the moment only in Spanish. I have reduced the compilers to fasm, poasm and tinyc, I am too old to manage others that are basically the same. At the moment all of them are in tinyc and some in fasm, I will populate ASAP. Here the examples in tinyc.

Here the codes compiled for now.
looks good,except when maximize maybe it would help to use "round pixels",in fireworks
your sine/cosine LUT inspired me to experiment and got spinning kinda Milky way
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on January 04, 2020, 03:57:43 AM
I think that the full screen fireworks do not look bad, obviously you could increase the resolution with a higher CPU load, the current version hardly uses it. Other demos of fireworks that I have seen make intensive use of the CPU.
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on January 04, 2020, 07:49:15 AM
I have tried to upload several images and programs for the sixth chapter but it seems that the server rejects them and I do not see the reason very well, maybe it is that I have exceeded some file limit or something (it is a freeware hosting)... I am already beginning to be older to fight with such stupid things.

If there is anyone there, I would appreciate if you could try the program that I attached here (which I have also tried to attach to my site). This is a bumpmapping demo, for this I have used a standard Windows font called "Impact". And this is where my doubt comes: if really everyone would have it in their system and if someone would appear in a way that exceeded the window boundaries.


You should move your mouse over the windows for the demo take effect.   :thumbsup:


Regards
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: HSE on January 04, 2020, 08:54:02 AM
Apparently it's not possible to see anything... fortunately look like if my mouse have a lantern  :biggrin: :biggrin:

Impact is here  :thumbsup:
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: FORTRANS on January 04, 2020, 09:17:29 AM
Hi,

If there is anyone there, I would appreciate if you could try the program that I attached here (which I have also tried to attach to my site). This is a bumpmapping demo, for this I have used a standard Windows font called "Impact". And this is where my doubt comes: if really everyone would have it in their system and if someone would appear in a way that exceeded the window boundaries.

   It runs here on Windows 2000.  Impact font is
shown in "Control Panel", "Fonts".

Regards,

Steve N.
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: Siekmanski on January 04, 2020, 10:02:47 AM
Windows 8.1

(http://members.home.nl/siekmanski/BumpMapping.png)
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on January 04, 2020, 10:46:31 AM
Hey!, thank you for your help, guys!  :thumbsup:
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on January 07, 2020, 04:14:52 AM
Hello, I have updated the sixth chapter (http://abreojosensamblador.epizy.com/?Tarea=5&SubTarea=6#Plasma) for plasmas, static and dynamic. I attached here several samples related to plasmas:

- PlasmaEstaticoWC01. A static plasma example.
- PlasmaDinamicoWC01. The same as before, but this time is dynamic.
- PaletaPlasmaWF01. This program shows the palete used by the plasma. It is very useful to know if the palette is adecuated for so.
- CubeCTexPlasmaMModWC01. A 3d rotating cube with a dynamic plasma for corrected texture.

Any feedback would be welcome, as ever  :thumbsup:

Regards
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on January 07, 2020, 10:32:36 PM
Hello, a note on dumping the palette structure miPaleta. TinyC allows to dump it as a integer, that in the end it is what it is, but strictly speaking it is a structure and it should be treated as is. So the right way to use it, that is what PellesC and others c expect is:

Code: [Select]
color = miPaleta[i].Azul | (miPaleta[i].Verde<<8) | (miPaleta[i].Rojo << 16);
This is the right way, more than casting it. I use in TinyC "color = miPaleta" because TinyC allows me to do so and it is smaller and smarter. With above you may loose a few cycles but don't believe that you could realize that.

Regards.
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on January 09, 2020, 08:48:35 AM
Shadebob
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on January 10, 2020, 08:54:47 AM
BuddahBrot (https://en.wikipedia.org/wiki/Buddhabrot) and BuddahGirl
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: mineiro on January 10, 2020, 10:53:56 AM
BuddahBrot (https://en.wikipedia.org/wiki/Buddhabrot) and BuddahGirl
It reminds me of orchids.
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on January 20, 2020, 01:58:30 AM
A first stage for an sprite demo, a little weak in the movement for now. Pixel clipping.

https://www.youtube.com/watch?v=u-PPrealGH0
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on April 11, 2020, 05:30:46 AM
Sprites demo with bezier path calculation. 25kb

https://www.youtube.com/watch?v=aGp5fRc_6n0
 :thumbsup: Yeah

Edited: fixed a small gap in the movement
Title: Re: SWGPTG - 02 - Drawing Basic Shapes
Post by: caballero on May 11, 2020, 03:20:02 AM
Quadratic Bezier curves explained. You can drag and drop any of the three nodes, but I have to improve its movement.