Author Topic: SWGPTG - 02 - Drawing Basic Shapes  (Read 2573 times)

caballero

  • Member
  • *****
  • Posts: 1188
    • abre ojos ensamblador
Re: SWGPTG - 02 - Drawing Basic Shapes
« Reply #15 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.

This time poasm version for 32 and 64 bits.
The logic of the error is hidden among the most unexpected lines of the program

daydreamer

  • Member
  • ****
  • Posts: 907
  • watch Chebyshev on the backside of the Moon
Re: SWGPTG - 02 - Drawing Basic Shapes
« Reply #16 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:
Quote from Flashdance
Nick  :  When you give up your dream, you die
*wears a flameproof asbestos suit*
Gone serverside programming p:  :D

caballero

  • Member
  • *****
  • Posts: 1188
    • abre ojos ensamblador
Re: SWGPTG - 02 - Drawing Basic Shapes
« Reply #17 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:
The logic of the error is hidden among the most unexpected lines of the program

daydreamer

  • Member
  • ****
  • Posts: 907
  • watch Chebyshev on the backside of the Moon
Re: SWGPTG - 02 - Drawing Basic Shapes
« Reply #18 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
Quote from Flashdance
Nick  :  When you give up your dream, you die
*wears a flameproof asbestos suit*
Gone serverside programming p:  :D

caballero

  • Member
  • *****
  • Posts: 1188
    • abre ojos ensamblador
Re: SWGPTG - 02 - Drawing Basic Shapes
« Reply #19 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
The logic of the error is hidden among the most unexpected lines of the program

HSE

  • Member
  • *****
  • Posts: 1104
  • <AMD>< 7-32>
Re: SWGPTG - 02 - Drawing Basic Shapes
« Reply #20 on: August 20, 2019, 01:07:34 AM »
 :thumbsup:

caballero

  • Member
  • *****
  • Posts: 1188
    • abre ojos ensamblador
Re: SWGPTG - 02 - Drawing Basic Shapes
« Reply #21 on: August 24, 2019, 11:29:55 PM »
Burning logo
The logic of the error is hidden among the most unexpected lines of the program

caballero

  • Member
  • *****
  • Posts: 1188
    • abre ojos ensamblador
Re: SWGPTG - 02 - Drawing Basic Shapes
« Reply #22 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.
The logic of the error is hidden among the most unexpected lines of the program

caballero

  • Member
  • *****
  • Posts: 1188
    • abre ojos ensamblador
Re: SWGPTG - 02 - Drawing Basic Shapes
« Reply #23 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, though I will upload it soon the English 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.
The logic of the error is hidden among the most unexpected lines of the program

HSE

  • Member
  • *****
  • Posts: 1104
  • <AMD>< 7-32>
Re: SWGPTG - 02 - Drawing Basic Shapes
« Reply #24 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,

TimoVJL

  • Member
  • ***
  • Posts: 432
Re: SWGPTG - 02 - Drawing Basic Shapes
« Reply #25 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.
May the source be with you

caballero

  • Member
  • *****
  • Posts: 1188
    • abre ojos ensamblador
Re: SWGPTG - 02 - Drawing Basic Shapes
« Reply #26 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;
The logic of the error is hidden among the most unexpected lines of the program

caballero

  • Member
  • *****
  • Posts: 1188
    • abre ojos ensamblador
Re: SWGPTG - 02 - Drawing Basic Shapes
« Reply #27 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.
The logic of the error is hidden among the most unexpected lines of the program

caballero

  • Member
  • *****
  • Posts: 1188
    • abre ojos ensamblador
Re: SWGPTG - 02 - Drawing Basic Shapes
« Reply #28 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 :eusa_boohoo:
The logic of the error is hidden among the most unexpected lines of the program

caballero

  • Member
  • *****
  • Posts: 1188
    • abre ojos ensamblador
Re: SWGPTG - 02 - Drawing Basic Shapes
« Reply #29 on: Today at 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:
The logic of the error is hidden among the most unexpected lines of the program