View Issue Details

IDProjectCategoryView StatusLast Update
0006155Multi Theft Auto : San AndreasClientpublic2015-03-28 23:13
ReporterDevan_LTAssigned Toccw 
PrioritynormalSeverityfeatureReproducibilityN/A
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version1.3.1 
Summary0006155: Using 2D tables as image data
Description

My suggestion is to make 2D tables work as filepath argument in DX drawing functions which use images. Then images could be more dynamic. Also, image formats which are not supported could be loaded into table with file functions and then displayed. That would also be useful for playing videos.

There's a workaround:
for y,row in ipairs(image)
for x,color in ipairs(row) do
dxDrawRectangle(x,y,1,1,color)
end
end

It displays the image at the top left corner of the screen. But it's very slow.

TagsNo tags attached.

Activities

MX_Master

2011-06-04 11:52

viewer   ~~0013584

it's really bad idea

Devan_LT

2011-06-04 19:33

viewer   ~~0013593

Why?

Maccer

2011-06-05 00:07

viewer   ~~0013595

I don't have a lot of knowledge regarding DirectX, but I assume just like in OpenGL, you'd have to create a new texture and write it off pixel by pixel.

I suppose someone could make a createTextureFromTable, but please keep in mind we don't have THAT MUCH developers to work on a lot of things, Devan_LT. Frankly, I don't see much utility in this, and AFAIK you could create it with some work yourself using the client-side 1.1 fileWrite functions. Since PNG files are basically treated as textures or images.

qaisjp

2015-03-10 20:47

administrator   ~~0023085

This is a very bad idea.
A "better" solution would be to have an "ImageData" "element" that has functions like:
ImageData:setPixel( x, y, r, g, b, a )
ImageData:mapPixel( pixelFunction )
ImageData:getWidth( )
ImageData:getSize() (returns bytes)
ImageData:getString() (returns string that can be written to file)
ImageData:encode(file, outFormat) (outFormat is an enum: bmp, tga, png, jpg)

sbx320

2015-03-28 23:11

administrator   ~~0023137

Last edited: 2015-03-28 23:12

View 2 revisions

Can be done using a string of pixel data with
https://wiki.multitheftauto.com/wiki/DxSetTexturePixels

Therefore fixed since https://code.google.com/p/mtasa-blue/source/detail?r=4019

Issue History

Date Modified Username Field Change