Author Topic: pSDL v1.0.0  (Read 17280 times)

0 Members and 3 Guests are viewing this topic.

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: pSDL v0.1.0
« Reply #15 on: June 26, 2012, 12:59:42 am »
maybe currently they are very limited though I'm working to try and fix that though there is not much i can do right now

EDIT: forgot i posted this merged later post

First real complicated program on the prizm is a basic fire demo



EDIT: attatched g3a of demo it should work and exit after 2.5 seconds but I'm sorry if it doesnt and please dont hold me responsible for any damage it does to you calc as i have only tested on manager software so far
« Last Edit: June 26, 2012, 01:43:02 am by ruler501 »
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline Spenceboy98

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 547
  • Rating: +59/-2
    • View Profile
Re: pSDL v0.1.0
« Reply #16 on: June 26, 2012, 10:51:26 am »
Looks nice. I hope you can fix all the problems there are. :thumbsup:
I like milk.

Offline flyingfisch

  • I'm 1337 now!
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1620
  • Rating: +94/-17
  • Testing, testing, 1...2...3...4...5...6...7...8..9
    • View Profile
    • Top Page Website Design
Re: pSDL v0.1.0
« Reply #17 on: June 26, 2012, 11:12:16 am »
Looks good! What is SDL, exactly? Is it a new language or a library?



Quote from: my dad
"welcome to the world of computers, where everything seems to be based on random number generators"



The Game V. 2.0

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: pSDL v0.1.0
« Reply #18 on: June 26, 2012, 12:05:32 pm »
SDL is indeed, a library (a set of libraries); it's very portable, and thousands of SDL-based games have been made for dozens of platforms :)
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: pSDL v0.1.0
« Reply #19 on: June 26, 2012, 01:21:07 pm »
Though i think I'll have to port SDL_image so we can use smaller images then bmp(though I'm still not sure if bmp loading works currentlly)

EDIT: since file i/o currently doesnt work I'll find a way to implement the header based images everyone else used for SDL
« Last Edit: June 26, 2012, 01:50:56 pm by ruler501 »
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: pSDL v0.1.0
« Reply #20 on: June 30, 2012, 12:36:30 pm »
I need some help getting basic image loading working. I use the two arrays from sourcecoders conversion to 8 bit to create the surface. the image appears to be blue shifted on everything.

Code: [Select]
SDL_Color rgb16to24(Uint16 x)
{
SDL_Color newcolor;
newcolor.b= (x & 0x1F) * 8;
        newcolor.g = ((x >> 5) & 0x2F)* 4;
    newcolor.r = ((x >> 11) & 0x1F)* 8;
return newcolor;
}

SDL_Surface* LoadSCImage(Uint16* pallete, int paletteSize, unsigned char* image, int x, int y)
{
int i, j;
SDL_Color newColors[paletteSize];
for (i = 0; i < paletteSize; i++)
{
newColors[i] = rgb16to24(pallete[i]);
}
SDL_Surface  *tempsurf = SDL_CreateRGBSurface( SDL_SWSURFACE, x, y, 8, 0,0,0,0);
for (i = 0; i < y; i++)
{
for (j=0; j < x; j++)
{
*(Uint8 *)(tempsurf->pixels + i*tempsurf->pitch + j) = image[i*x + j];
}
}
SDL_SetColors(tempsurf, newColors, 0, paletteSize);
return tempsurf;
}
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline hoffa

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: pSDL v0.1.0
« Reply #21 on: June 30, 2012, 02:27:02 pm »
You could use the simple image format I'm using for nSDL. The code is very short (here) and it returns a 16-bit/8-bit surface. It should require no changes to compile, and would assure some sort of compatibility between both platforms.

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: pSDL v0.1.0
« Reply #22 on: June 30, 2012, 03:33:29 pm »
I think I will implement that too.
I'll be putting these in a second library called pSDLlib so that my pSDL port remains SDL and pSDLlib is an addition for easier use
thanks hoffa.
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: pSDL v1.0.0
« Reply #23 on: July 01, 2012, 09:14:14 am »
Image Loading Cross Post from Cemetech

I couldnt get 8 bit working but heres the function that correctly loads 16 bit
Code: [Select]
SDL_Surface* LoadSCImage(Uint16* image, int x, int y)
{
SDL_Surface  *rimage, *tempsurf =  SDL_CreateRGBSurfaceFrom(image, x, y, 16, 2*x, PZM_RMASK16,PZM_GMASK16,PZM_BMASK16,0);
rimage = SDL_DisplayFormat(tempsurf);
SDL_FreeSurface(tempsurf);
return rimage;
}

I'll compile this and a few things from hoffa's nSDL to a seperate library when i came back to work on this in August
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: pSDL v1.0.0
« Reply #24 on: July 01, 2012, 11:55:58 pm »
Good luck! ALso i watched the video and it looks pretty nice :). I hope this allows more games to be easily produced for this calc in the near future. :)

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: pSDL v1.0.0
« Reply #25 on: July 30, 2012, 06:21:19 pm »
I'm back now and now I need to decide what I need to do with this project. I think that one of the main things that will need to be done is get the events to recognize all keys. If anyone knows a way to do this please tell me. I also plan on making some demo's and trying to find more efficient ways to implement some of the internal functions.

What I need help with:
Testing what keys are down for the entire prizm keyboard
Getting file i/o for bmp loading
Getting other SDL libraries working(SDL_gfx most importantly)
If I could get these things working I think it would greatly improve this library
« Last Edit: July 30, 2012, 06:21:30 pm by ruler501 »
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: pSDL v1.0.0
« Reply #26 on: July 30, 2012, 08:12:58 pm »
Welcome back. I unfortunately cannot help but hopefully someone can answer in the PRIZM section. You might need to create a separate topic, though, so people notice your question.

Offline Spenceboy98

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 547
  • Rating: +59/-2
    • View Profile
Re: pSDL v1.0.0
« Reply #27 on: January 03, 2013, 04:15:55 pm »
*Necropost?*
I'm guessing that progress hasn't been very good lately?
I like milk.

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: pSDL v1.0.0
« Reply #28 on: January 03, 2013, 06:13:25 pm »
I haven't done anything with it since I got back. I haven't really done much coding overall. If there are any problems or requests I'll probably look into it but I make no promises for now
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: pSDL v1.0.0
« Reply #29 on: January 04, 2013, 12:30:34 am »
Hopefully you don't stop coding completely D: